@sanity/ui 3.4.5 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/_chunks/{theme.cjs → getScopedTheme.cjs} +3534 -3597
  2. package/dist/_chunks/getScopedTheme.cjs.map +1 -0
  3. package/dist/_chunks/{theme.js → getScopedTheme.js} +3477 -3525
  4. package/dist/_chunks/getScopedTheme.js.map +1 -0
  5. package/dist/_chunks/{tabList.cjs → portalProvider.cjs} +1561 -1554
  6. package/dist/_chunks/portalProvider.cjs.map +1 -0
  7. package/dist/_chunks/{useTheme.d.ts → portalProvider.d.cts} +307 -647
  8. package/dist/_chunks/portalProvider.d.cts.map +1 -0
  9. package/dist/_chunks/{useTheme.d.cts → portalProvider.d.ts} +307 -647
  10. package/dist/_chunks/portalProvider.d.ts.map +1 -0
  11. package/dist/_chunks/{tabList.js → portalProvider.js} +1359 -1352
  12. package/dist/_chunks/portalProvider.js.map +1 -0
  13. package/dist/_chunks/{theme.d.ts → rgba.d.cts} +178 -453
  14. package/dist/_chunks/rgba.d.cts.map +1 -0
  15. package/dist/_chunks/{theme.d.cts → rgba.d.ts} +178 -453
  16. package/dist/_chunks/rgba.d.ts.map +1 -0
  17. package/dist/_visual-editing.cjs +3 -2
  18. package/dist/_visual-editing.d.cts +1 -1
  19. package/dist/_visual-editing.d.ts +1 -1
  20. package/dist/_visual-editing.js +2 -1
  21. package/dist/index.cjs +2802 -2798
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +549 -203
  24. package/dist/index.d.cts.map +1 -1
  25. package/dist/index.d.ts +549 -203
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +2781 -2777
  28. package/dist/index.js.map +1 -1
  29. package/dist/theme.cjs +53 -2
  30. package/dist/theme.cjs.map +1 -0
  31. package/dist/theme.d.cts +278 -2
  32. package/dist/theme.d.cts.map +1 -0
  33. package/dist/theme.d.ts +278 -2
  34. package/dist/theme.d.ts.map +1 -0
  35. package/dist/theme.js +52 -1
  36. package/dist/theme.js.map +1 -0
  37. package/package.json +4 -4
  38. package/dist/_chunks/tabList.cjs.map +0 -1
  39. package/dist/_chunks/tabList.js.map +0 -1
  40. package/dist/_chunks/theme.cjs.map +0 -1
  41. package/dist/_chunks/theme.d.cts.map +0 -1
  42. package/dist/_chunks/theme.d.ts.map +0 -1
  43. package/dist/_chunks/theme.js.map +0 -1
  44. package/dist/_chunks/useTheme.d.cts.map +0 -1
  45. package/dist/_chunks/useTheme.d.ts.map +0 -1
@@ -8,15 +8,15 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
8
8
  value: mod,
9
9
  enumerable: !0
10
10
  }) : target, mod));
11
- const require_theme = require("./theme.cjs");
11
+ const require_getScopedTheme = require("./getScopedTheme.cjs");
12
12
  let react_compiler_runtime = require("react-compiler-runtime"), react = require("react");
13
13
  react = __toESM(react, 1);
14
- let react_is = require("react-is"), styled_components = require("styled-components"), react_jsx_runtime = require("react/jsx-runtime"), _sanity_icons_Spinner = require("@sanity/icons/Spinner"), use_effect_event = require("use-effect-event"), _juggle_resize_observer = require("@juggle/resize-observer"), _floating_ui_react_dom = require("@floating-ui/react-dom"), motion_react = require("motion/react"), react_dom = require("react-dom"), _sanity_icons_Close = require("@sanity/icons/Close"), _sanity_icons_ChevronRight = require("@sanity/icons/ChevronRight");
14
+ let styled_components = require("styled-components"), react_jsx_runtime = require("react/jsx-runtime"), react_is = require("react-is"), _sanity_icons_Spinner = require("@sanity/icons/Spinner"), _floating_ui_react_dom = require("@floating-ui/react-dom"), motion_react = require("motion/react"), _juggle_resize_observer = require("@juggle/resize-observer"), react_dom = require("react-dom"), _sanity_icons_Close = require("@sanity/icons/Close"), use_effect_event = require("use-effect-event"), _sanity_icons_ChevronRight = require("@sanity/icons/ChevronRight");
15
15
  /**
16
16
  * @public
17
17
  * @deprecated Use `createColorTheme` from `@sanity/ui/theme` instead.
18
18
  */
19
- const createColorTheme = require_theme.Z, hexToRgb = require_theme.o, hslToRgb = require_theme.s, multiply = require_theme.f, parseColor = require_theme.a, rgbToHex = require_theme.c, rgbToHsl = require_theme.l, rgba = require_theme.r, screen = require_theme.d, studioTheme = require_theme.n(), EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_DURATION = .2, POPOVER_MOTION_PROPS = {
19
+ const createColorTheme = require_getScopedTheme.a, hexToRgb = require_getScopedTheme.d, hslToRgb = require_getScopedTheme.f, multiply = require_getScopedTheme.c, parseColor = require_getScopedTheme.u, rgbToHex = require_getScopedTheme.p, rgbToHsl = require_getScopedTheme.m, rgba = require_getScopedTheme.l, screen = require_getScopedTheme.s, studioTheme = require_getScopedTheme.o(), EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_DURATION = .2, POPOVER_MOTION_PROPS = {
20
20
  card: {
21
21
  initial: {
22
22
  scale: .97,
@@ -121,220 +121,9 @@ function _getArrayProp(val, defaultVal) {
121
121
  function _getResponsiveSpace(theme, props, spaceIndexes = EMPTY_ARRAY) {
122
122
  if (!Array.isArray(spaceIndexes)) throw Error("the property must be array of numbers");
123
123
  if (spaceIndexes.length === 0) return null;
124
- let { media, space } = require_theme.X(theme);
124
+ let { media, space } = require_getScopedTheme.i(theme);
125
125
  return _responsive(media, spaceIndexes, (spaceIndex) => _fillCSSObject(props, rem(space[spaceIndex])));
126
126
  }
127
- /**
128
- * A utility function getting responsive font styles.
129
- * @internal
130
- */
131
- function responsiveFont(fontKey, props) {
132
- let { $size, $weight } = props, { font, media } = require_theme.X(props.theme), { family, sizes, weights } = font[fontKey], fontWeight = $weight && weights[$weight] || weights.regular, defaultSize = sizes[2], base = {
133
- position: "relative",
134
- fontFamily: family,
135
- fontWeight: `${fontWeight}`,
136
- padding: "1px 0",
137
- margin: 0,
138
- "&:before": {
139
- content: "\"\"",
140
- display: "block",
141
- height: 0
142
- },
143
- "&:after": {
144
- content: "\"\"",
145
- display: "block",
146
- height: 0
147
- },
148
- "& > code, & > span": { display: "block" },
149
- "&:not([hidden])": { display: "block" }
150
- };
151
- return $size ? [base, ..._responsive(media, $size, (sizeIndex) => fontSize(sizes[sizeIndex] || defaultSize))] : (responsiveFont.warned ||= (console.warn("No size specified for responsive font", {
152
- fontKey,
153
- $size,
154
- props,
155
- base
156
- }), !0), [base]);
157
- }
158
- function fontSize(size) {
159
- let { ascenderHeight, descenderHeight, fontSize, iconSize, letterSpacing, lineHeight } = size, negHeight = ascenderHeight + descenderHeight, capHeight = lineHeight - negHeight, iconOffset = (capHeight - iconSize) / 2, customIconSize = Math.floor(fontSize * 1.125 / 2) * 2 + 1, customIconOffset = (capHeight - customIconSize) / 2;
160
- return {
161
- fontSize: rem(fontSize),
162
- lineHeight: `calc(${lineHeight} / ${fontSize})`,
163
- letterSpacing: rem(letterSpacing),
164
- transform: `translateY(${rem(descenderHeight)})`,
165
- "&:before": { marginTop: `calc(${rem(0 - negHeight)} - 1px)` },
166
- "&:after": { marginBottom: "-1px" },
167
- "& svg:not([data-sanity-icon])": {
168
- fontSize: `calc(${customIconSize} / 16 * 1rem)`,
169
- margin: rem(customIconOffset)
170
- },
171
- "& [data-sanity-icon]": {
172
- fontSize: `calc(${iconSize} / 16 * 1rem)`,
173
- margin: rem(iconOffset)
174
- }
175
- };
176
- }
177
- /**
178
- * Get responsive text align styles.
179
- * @internal
180
- */
181
- function responsiveTextAlignStyle(props) {
182
- let { media } = require_theme.X(props.theme);
183
- return _responsive(media, props.$align, (textAlign) => ({ textAlign }));
184
- }
185
- /**
186
- * Get responsive CSS for the `text` font style.
187
- * @internal
188
- */
189
- function responsiveTextFont(props) {
190
- return responsiveFont("text", props);
191
- }
192
- /**
193
- * Gets the global scope instance in a given environment.
194
- *
195
- * The strategy is to return the most modern, and if not, the most common:
196
- * - The `globalThis` variable is the modern approach to accessing the global scope
197
- * - The `window` variable is the global scope in a web browser
198
- * - The `self` variable is the global scope in workers and others
199
- * - The `global` variable is the global scope in Node.js
200
- */
201
- function getGlobalScope() {
202
- if (typeof globalThis < "u") return globalThis;
203
- if (typeof window < "u") return window;
204
- if (typeof self < "u") return self;
205
- if (typeof global < "u") return global;
206
- throw Error("@sanity/ui: could not locate global scope");
207
- }
208
- const globalScope = getGlobalScope();
209
- /**
210
- * As `@sanity/ui` is declared as a dependency, and may be duplicated, sometimes across major versions
211
- * it's critical that vital react contexts are shared even when there is a duplicate.
212
- * If we used a model similar to `sanity` itself, or `styled-components`, this would be unnecessary as
213
- * those libraries enforce single instances.
214
- * Since we don't enforce it we have to support a sanity plugin being able to call hooks like `useToast`, and then
215
- * read the context setup by `sanity`, which calls `ToastProvider`, even if the provider and hook are different instances in memory.
216
- * It's also why it's vital that all changes to globally scoped providers remain fully backwards compatible to v1.
217
- */
218
- function createGlobalScopedContext(key, defaultValue) {
219
- let symbol = Symbol.for(key);
220
- /**
221
- * Prevent errors about re-renders on React SSR on Next.js App Router
222
- */
223
- if (typeof document > "u") {
224
- let context = (0, react.createContext)(defaultValue);
225
- return context.displayName = key, context;
226
- }
227
- return globalScope[symbol] = globalScope[symbol] || (0, react.createContext)(defaultValue), globalScope[symbol];
228
- }
229
- /**
230
- * @internal
231
- */
232
- const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
233
- /**
234
- * @public
235
- */
236
- function ThemeProvider(props) {
237
- let $ = (0, react_compiler_runtime.c)(15), parentTheme = (0, react.useContext)(ThemeContext), { children } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default"), t0;
238
- bb0: {
239
- if (!rootTheme) {
240
- t0 = null;
241
- break bb0;
242
- }
243
- let t1;
244
- $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t1 = {
245
- version: 0,
246
- theme: rootTheme,
247
- scheme,
248
- tone
249
- }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t1) : t1 = $[3], t0 = t1;
250
- }
251
- let themeContext = t0, t1;
252
- bb1: {
253
- if (!rootTheme) {
254
- t1 = null;
255
- break bb1;
256
- }
257
- let t2;
258
- $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t2 = require_theme.t(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t2) : t2 = $[7], t1 = t2;
259
- }
260
- let theme = t1;
261
- if (!theme) {
262
- let t2;
263
- return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: "ThemeProvider: no \"theme\" property provided" }), $[8] = t2) : t2 = $[8], t2;
264
- }
265
- let t2;
266
- $[9] !== children || $[10] !== theme ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(styled_components.ThemeProvider, {
267
- theme,
268
- children
269
- }), $[9] = children, $[10] = theme, $[11] = t2) : t2 = $[11];
270
- let t3;
271
- return $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
272
- value: themeContext,
273
- children: t2
274
- }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14], t3;
275
- }
276
- /**
277
- * @public
278
- */
279
- function useRootTheme() {
280
- let value = (0, react.useContext)(ThemeContext);
281
- if (!value) throw Error("useRootTheme(): missing context value");
282
- return value;
283
- }
284
- /**
285
- * @public
286
- */
287
- function ThemeColorProvider(props) {
288
- let $ = (0, react_compiler_runtime.c)(5), { children, scheme, tone } = props, root = useRootTheme(), t0 = scheme || root.scheme, t1;
289
- return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeProvider, {
290
- scheme: t0,
291
- theme: root.theme,
292
- tone,
293
- children
294
- }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
295
- }
296
- /**
297
- * @public
298
- */
299
- function useTheme() {
300
- return (0, styled_components.useTheme)();
301
- }
302
- /**
303
- * @public
304
- */
305
- function useTheme_v2() {
306
- let $ = (0, react_compiler_runtime.c)(2), t0 = (0, styled_components.useTheme)(), t1;
307
- return $[0] === t0 ? t1 = $[1] : (t1 = require_theme.X(t0), $[0] = t0, $[1] = t1), t1;
308
- }
309
- function responsiveBorderStyle() {
310
- return [
311
- border,
312
- borderTop,
313
- borderRight,
314
- borderBottom,
315
- borderLeft
316
- ];
317
- }
318
- function border(props) {
319
- let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
320
- return _responsive(media, props.$border, (value) => value ? { "&&": { border: borderStyle } } : { "&&": { border: 0 } });
321
- }
322
- function borderTop(props) {
323
- let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
324
- return _responsive(media, props.$borderTop, (value) => value ? { "&&": { borderTop: borderStyle } } : { "&&": { borderTop: 0 } });
325
- }
326
- function borderRight(props) {
327
- let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
328
- return _responsive(media, props.$borderRight, (value) => value ? { "&&": { borderRight: borderStyle } } : { "&&": { borderRight: 0 } });
329
- }
330
- function borderBottom(props) {
331
- let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
332
- return _responsive(media, props.$borderBottom, (value) => value ? { "&&": { borderBottom: borderStyle } } : { "&&": { borderBottom: 0 } });
333
- }
334
- function borderLeft(props) {
335
- let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
336
- return _responsive(media, props.$borderLeft, (value) => value ? { "&&": { borderLeft: borderStyle } } : { "&&": { borderLeft: 0 } });
337
- }
338
127
  const BASE_STYLE$3 = { "&[data-as=\"ul\"],&[data-as=\"ol\"]": { listStyle: "none" } }, BOX_SIZING = {
339
128
  content: "content-box",
340
129
  border: "border-box"
@@ -354,19 +143,19 @@ function responsiveBoxStyle() {
354
143
  ];
355
144
  }
356
145
  function responsiveBoxDisplayStyle(props) {
357
- let { media } = require_theme.X(props.theme);
146
+ let { media } = require_getScopedTheme.i(props.theme);
358
147
  return _responsive(media, props.$display, (display) => ({ "&:not([hidden])": { display } }));
359
148
  }
360
149
  function responsiveBoxSizingStyle(props) {
361
- let { media } = require_theme.X(props.theme);
150
+ let { media } = require_getScopedTheme.i(props.theme);
362
151
  return _responsive(media, props.$sizing, (sizing) => ({ boxSizing: BOX_SIZING[sizing] }));
363
152
  }
364
153
  function responsiveBoxHeightStyle(props) {
365
- let { media } = require_theme.X(props.theme);
154
+ let { media } = require_getScopedTheme.i(props.theme);
366
155
  return _responsive(media, props.$height, (height) => ({ height: BOX_HEIGHT[height] }));
367
156
  }
368
157
  function responsiveBoxOverflowStyle(props) {
369
- let { media } = require_theme.X(props.theme);
158
+ let { media } = require_getScopedTheme.i(props.theme);
370
159
  return _responsive(media, props.$overflow, (overflow) => ({ overflow }));
371
160
  }
372
161
  const BASE_STYLE$2 = {
@@ -377,52 +166,9 @@ function flexItemStyle() {
377
166
  return [BASE_STYLE$2, responsiveFlexItemStyle];
378
167
  }
379
168
  function responsiveFlexItemStyle(props) {
380
- let { media } = require_theme.X(props.theme);
169
+ let { media } = require_getScopedTheme.i(props.theme);
381
170
  return props.$flex ? _responsive(media, props.$flex, (flex) => ({ flex: `${flex}` })) : EMPTY_ARRAY;
382
171
  }
383
- const BASE_STYLE$1 = { "&&:not([hidden])": { display: "flex" } };
384
- function responsiveFlexStyle() {
385
- return [
386
- BASE_STYLE$1,
387
- responsiveFlexAlignStyle,
388
- responsiveFlexGapStyle,
389
- responsiveFlexWrapStyle,
390
- responsiveFlexJustifyStyle,
391
- responsiveFlexDirectionStyle
392
- ];
393
- }
394
- function responsiveFlexAlignStyle(props) {
395
- let { media } = require_theme.X(props.theme);
396
- return _responsive(media, props.$align, (align) => ({ alignItems: align }));
397
- }
398
- function responsiveFlexGapStyle(props) {
399
- let { media, space } = require_theme.X(props.theme);
400
- return _responsive(media, props.$gap, (gap) => ({ gap: gap ? rem(space[gap]) : void 0 }));
401
- }
402
- function responsiveFlexWrapStyle(props) {
403
- let { media } = require_theme.X(props.theme);
404
- return _responsive(media, props.$wrap, (wrap) => ({ flexWrap: wrap }));
405
- }
406
- function responsiveFlexJustifyStyle(props) {
407
- let { media } = require_theme.X(props.theme);
408
- return _responsive(media, props.$justify, (justify) => ({ justifyContent: justify }));
409
- }
410
- function responsiveFlexDirectionStyle(props) {
411
- let { media } = require_theme.X(props.theme);
412
- return _responsive(media, props.$direction, (direction) => ({ flexDirection: direction }));
413
- }
414
- function focusRingBorderStyle(border) {
415
- return `inset 0 0 0 ${border.width}px ${border.color}`;
416
- }
417
- function focusRingStyle(opts) {
418
- let { base, border, focusRing } = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
419
- return [
420
- focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,
421
- border && focusRingBorderStyle(border),
422
- focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,
423
- focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`
424
- ].filter(Boolean).join(",");
425
- }
426
172
  function responsiveGridItemStyle() {
427
173
  return [
428
174
  responsiveGridItemRowStyle,
@@ -441,155 +187,31 @@ const GRID_ITEM_ROW = {
441
187
  full: "1 / -1"
442
188
  };
443
189
  function responsiveGridItemRowStyle(props) {
444
- let { media } = require_theme.X(props.theme);
190
+ let { media } = require_getScopedTheme.i(props.theme);
445
191
  return _responsive(media, props.$row, (row) => typeof row == "number" ? { gridRow: `span ${row} / span ${row}` } : { gridRow: GRID_ITEM_ROW[row] });
446
192
  }
447
193
  function responsiveGridItemRowStartStyle(props) {
448
- let { media } = require_theme.X(props.theme);
194
+ let { media } = require_getScopedTheme.i(props.theme);
449
195
  return _responsive(media, props.$rowStart, (rowStart) => ({ gridRowStart: `${rowStart}` }));
450
196
  }
451
197
  function responsiveGridItemRowEndStyle(props) {
452
- let { media } = require_theme.X(props.theme);
198
+ let { media } = require_getScopedTheme.i(props.theme);
453
199
  return _responsive(media, props.$rowEnd, (rowEnd) => ({ gridRowEnd: `${rowEnd}` }));
454
200
  }
455
201
  function responsiveGridItemColumnStyle(props) {
456
- let { media } = require_theme.X(props.theme);
202
+ let { media } = require_getScopedTheme.i(props.theme);
457
203
  return _responsive(media, props.$column, (column) => typeof column == "number" ? { gridColumn: `span ${column} / span ${column}` } : { gridColumn: GRID_ITEM_COLUMN[column] });
458
204
  }
459
205
  function responsiveGridItemColumnStartStyle(props) {
460
- let { media } = require_theme.X(props.theme);
206
+ let { media } = require_getScopedTheme.i(props.theme);
461
207
  return _responsive(media, props.$columnStart, (columnStart) => ({ gridColumnStart: `${columnStart}` }));
462
208
  }
463
209
  function responsiveGridItemColumnEndStyle(props) {
464
- let { media } = require_theme.X(props.theme);
210
+ let { media } = require_getScopedTheme.i(props.theme);
465
211
  return _responsive(media, props.$columnEnd, (columnEnd) => ({ gridColumnEnd: `${columnEnd}` }));
466
212
  }
467
- const GRID_CSS = {
468
- "&&:not([hidden])": { display: "grid" },
469
- "&[data-as=\"ul\"],&[data-as=\"ol\"]": { listStyle: "none" }
470
- }, GRID_AUTO_COLUMS = {
471
- auto: "auto",
472
- min: "min-content",
473
- max: "max-content",
474
- fr: "minmax(0, 1fr)"
475
- }, GRID_AUTO_ROWS = {
476
- auto: "auto",
477
- min: "min-content",
478
- max: "max-content",
479
- fr: "minmax(0, 1fr)"
480
- };
481
- function responsiveGridStyle() {
482
- return [
483
- GRID_CSS,
484
- responsiveGridAutoFlowStyle,
485
- responsiveGridAutoRowsStyle,
486
- responsiveGridAutoColsStyle,
487
- responsiveGridColumnsStyle,
488
- responsiveGridRowsStyle,
489
- responsiveGridGapStyle,
490
- responsiveGridGapXStyle,
491
- responsiveGridGapYStyle
492
- ];
493
- }
494
- function responsiveGridAutoFlowStyle(props) {
495
- let { media } = require_theme.X(props.theme);
496
- return _responsive(media, props.$autoFlow, (autoFlow) => ({ gridAutoFlow: autoFlow }));
497
- }
498
- function responsiveGridAutoRowsStyle(props) {
499
- let { media } = require_theme.X(props.theme);
500
- return _responsive(media, props.$autoRows, (autoRows) => ({ gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows] }));
501
- }
502
- function responsiveGridAutoColsStyle(props) {
503
- let { media } = require_theme.X(props.theme);
504
- return _responsive(media, props.$autoCols, (autoCols) => ({ gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols] }));
505
- }
506
- function responsiveGridColumnsStyle(props) {
507
- let { media } = require_theme.X(props.theme);
508
- return _responsive(media, props.$columns, (columns) => ({ gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));` }));
509
- }
510
- function responsiveGridRowsStyle(props) {
511
- let { media } = require_theme.X(props.theme);
512
- return _responsive(media, props.$rows, (rows) => ({ gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));` }));
513
- }
514
- function responsiveGridGapStyle(props) {
515
- let { media, space } = require_theme.X(props.theme);
516
- return _responsive(media, props.$gap, (gap) => ({ gridGap: gap ? rem(space[gap]) : void 0 }));
517
- }
518
- function responsiveGridGapXStyle(props) {
519
- let { media, space } = require_theme.X(props.theme);
520
- return _responsive(media, props.$gapX, (gapX) => ({ columnGap: gapX ? rem(space[gapX]) : void 0 }));
521
- }
522
- function responsiveGridGapYStyle(props) {
523
- let { media, space } = require_theme.X(props.theme);
524
- return _responsive(media, props.$gapY, (gapY) => ({ rowGap: gapY ? rem(space[gapY]) : void 0 }));
525
- }
526
- function responsiveInputPaddingStyle(props) {
527
- let { $fontSize, $iconLeft, $iconRight, $padding, $space } = props, { font, media, space } = require_theme.X(props.theme), len = Math.max($padding.length, $space.length, $fontSize.length), _padding = [], _space = [], _fontSize = [];
528
- for (let i = 0; i < len; i += 1) _fontSize[i] = $fontSize[i] === void 0 ? _fontSize[i - 1] : $fontSize[i], _padding[i] = $padding[i] === void 0 ? _padding[i - 1] : $padding[i], _space[i] = $space[i] === void 0 ? _space[i - 1] : $space[i];
529
- return _responsive(media, _padding, (_, i) => {
530
- let size = font.text.sizes[_fontSize[i]] || font.text.sizes[2], emSize = size.lineHeight - size.ascenderHeight - size.descenderHeight, p = space[_padding[i]], s = space[_space[i]], styles = {
531
- paddingTop: rem(p - size.ascenderHeight),
532
- paddingRight: rem(p),
533
- paddingBottom: rem(p - size.descenderHeight),
534
- paddingLeft: rem(p)
535
- };
536
- return $iconRight && (styles.paddingRight = rem(p + emSize + s)), $iconLeft && (styles.paddingLeft = rem(p + emSize + s)), styles;
537
- });
538
- }
539
- function responsiveInputPaddingIconRightStyle(props) {
540
- return responsiveInputPaddingStyle({
541
- ...props,
542
- $iconRight: !0
543
- });
544
- }
545
- const ROOT_STYLE = styled_components.css`&:not([hidden]){display:flex;}align-items:center;`;
546
- function textInputRootStyle() {
547
- return ROOT_STYLE;
548
- }
549
- function textInputBaseStyle(props) {
550
- let { $scheme, $tone, $weight } = props, { color, font } = require_theme.X(props.theme);
551
- return styled_components.css`appearance:none;background:none;border:0;border-radius:0;outline:none;width:100%;box-sizing:border-box;font-family:${font.text.family};font-weight:${$weight && font.text.weights[$weight] || font.text.weights.regular};margin:0;position:relative;z-index:1;display:block;&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus,&:-webkit-autofill:active{-webkit-text-fill-color:var(--input-fg-color) !important;transition:background-color 5000s;transition-delay:86400s;}&[data-as='textarea']{resize:none;}color:var(--input-fg-color);&::placeholder{color:var(--input-placeholder-color);}&[data-scheme='${$scheme}'][data-tone='${$tone}']{--input-fg-color:${color.input.default.enabled.fg};--input-placeholder-color:${color.input.default.enabled.placeholder};&:not(:invalid):not(:disabled):not(:read-only){--input-fg-color:${color.input.default.enabled.fg};--input-placeholder-color:${color.input.default.enabled.placeholder};}&:not(:invalid):disabled{--input-fg-color:${color.input.default.disabled.fg};--input-placeholder-color:${color.input.default.disabled.placeholder};}&:invalid{--input-fg-color:${color.input.invalid.enabled.fg};--input-placeholder-color:${color.input.invalid.enabled.placeholder};}&:read-only{--input-fg-color:${color.input.default.readOnly.fg};--input-placeholder-color:${color.input.default.readOnly.placeholder};}}`;
552
- }
553
- function textInputFontSizeStyle(props) {
554
- let { font, media } = require_theme.X(props.theme);
555
- return _responsive(media, props.$fontSize, (sizeIndex) => {
556
- let size = font.text.sizes[sizeIndex] || font.text.sizes[2];
557
- return {
558
- fontSize: rem(size.fontSize),
559
- lineHeight: `${size.lineHeight / size.fontSize}`
560
- };
561
- });
562
- }
563
- function textInputRepresentationStyle(props) {
564
- let { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = require_theme.X(props.theme);
565
- return styled_components.css`--input-box-shadow:none;position:absolute;top:0;left:0;right:0;bottom:0;display:block;pointer-events:none;z-index:0;background-color:var(--card-bg-color);box-shadow:var(--input-box-shadow);border-top-left-radius:${$hasPrefix ? 0 : void 0};border-bottom-left-radius:${$hasPrefix ? 0 : void 0};border-top-right-radius:${$hasSuffix ? 0 : void 0};border-bottom-right-radius:${$hasSuffix ? 0 : void 0};&[data-scheme='${$scheme}'][data-tone='${$tone}']{--card-bg-color:${color.input.default.enabled.bg};--card-fg-color:${color.input.default.enabled.fg};*:not(:disabled) + &[data-border]{--input-box-shadow:${focusRingBorderStyle({
566
- color: color.input.default.enabled.border,
567
- width: input.border.width
568
- })};}*:not(:disabled):invalid + &{--card-bg-color:${color.input.invalid.enabled.bg};--card-fg-color:${color.input.invalid.enabled.fg};&[data-border]{--input-box-shadow:${focusRingBorderStyle({
569
- color: color.input.invalid.enabled.border,
570
- width: input.border.width
571
- })};}}*:not(:disabled):focus + &{&[data-border]{--input-box-shadow:${$unstableDisableFocusRing ? void 0 : focusRingStyle({
572
- border: {
573
- color: color.input.default.enabled.border,
574
- width: input.border.width
575
- },
576
- focusRing: input.text.focusRing
577
- })};}&:not([data-border]){--input-box-shadow:${$unstableDisableFocusRing ? void 0 : focusRingStyle({ focusRing: input.text.focusRing })};}}*:not(:invalid):disabled + &{--card-bg-color:${color.input.default.disabled.bg} !important;--card-fg-color:${color.input.default.disabled.fg} !important;--card-icon-color:${color.input.default.disabled.fg} !important;&[data-border]{--input-box-shadow:${focusRingBorderStyle({
578
- color: color.input.default.disabled.border,
579
- width: input.border.width
580
- })};}}*:invalid:disabled + &{--card-bg-color:${color.input.invalid.disabled.bg} !important;--card-fg-color:${color.input.invalid.disabled.fg} !important;--card-icon-color:${color.input.invalid.disabled.fg} !important;&[data-border]{--input-box-shadow:${focusRingBorderStyle({
581
- color: color.input.invalid.disabled.border,
582
- width: input.border.width
583
- })};}}*:not(:invalid):read-only + &{--card-bg-color:${color.input.default.readOnly.bg} !important;--card-fg-color:${color.input.default.readOnly.fg} !important;}*:invalid:read-only + &{--card-bg-color:${color.input.invalid.readOnly.bg} !important;--card-fg-color:${color.input.invalid.readOnly.fg} !important;}@media (hover:hover){*:not(:disabled):not(:read-only):not(:invalid):hover + &{--card-bg-color:${color.input.default.hovered.bg};--card-fg-color:${color.input.default.hovered.fg};}*:invalid:not(:disabled):not(:read-only):hover + &{--card-bg-color:${color.input.invalid.hovered.bg};--card-fg-color:${color.input.invalid.hovered.fg};}*:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border]{--input-box-shadow:${focusRingBorderStyle({
584
- color: color.input.default.hovered.border,
585
- width: input.border.width
586
- })};}*:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border]{--input-box-shadow:${focusRingBorderStyle({
587
- color: color.input.invalid.hovered.border,
588
- width: input.border.width
589
- })};}}}`;
590
- }
591
- function responsiveMarginStyle(props) {
592
- let { theme } = props;
213
+ function responsiveMarginStyle(props) {
214
+ let { theme } = props;
593
215
  return [
594
216
  _getResponsiveSpace(theme, ["margin"], props.$margin),
595
217
  _getResponsiveSpace(theme, ["marginLeft", "marginRight"], props.$marginX),
@@ -612,30 +234,9 @@ function responsivePaddingStyle(props) {
612
234
  _getResponsiveSpace(theme, ["paddingLeft"], props.$paddingLeft)
613
235
  ].filter(Boolean);
614
236
  }
615
- function responsiveRadiusStyle(props) {
616
- let { media, radius } = require_theme.X(props.theme);
617
- return _responsive(media, props.$radius, (value) => {
618
- let borderRadius = 0;
619
- return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), { borderRadius };
620
- });
621
- }
622
- function toBoxShadow(shadow, color) {
623
- return `${shadow.map(rem).join(" ")} ${color}`;
624
- }
625
- function shadowStyle(shadow, outlineWidth = 1) {
626
- return shadow ? { boxShadow: `${`0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`}, ${toBoxShadow(shadow.umbra, "var(--card-shadow-umbra-color)")}, ${toBoxShadow(shadow.penumbra, "var(--card-shadow-penumbra-color)")}, ${toBoxShadow(shadow.ambient, "var(--card-shadow-ambient-color)")}` } : EMPTY_RECORD;
627
- }
628
- function responsiveShadowStyle(props) {
629
- let { card, media, shadow } = require_theme.X(props.theme);
630
- return _responsive(media, props.$shadow, (index) => shadowStyle(shadow[index], card.shadow.outline));
631
- }
632
- /** @internal */
633
- const SpanWithTextOverflow = styled_components.styled.span.withConfig({
634
- displayName: "SpanWithTextOverflow",
635
- componentId: "sc-xkyu3h-0"
636
- })`display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;overflow:clip;`, StyledBox = /* @__PURE__ */ styled_components.styled.div.withConfig({
237
+ const StyledBox = /* @__PURE__ */ styled_components.styled.div.withConfig({
637
238
  displayName: "StyledBox",
638
- componentId: "sc-yj6ffl-0"
239
+ componentId: "sc-p4sc7t-0"
639
240
  })(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = (0, react.forwardRef)(function Box(props, ref) {
640
241
  let $ = (0, react_compiler_runtime.c)(115), deprecated_column, deprecated_columnEnd, deprecated_columnStart, deprecated_row, deprecated_rowEnd, deprecated_rowStart, flex, gridColumn, gridColumnEnd, gridColumnStart, gridRow, gridRowEnd, gridRowStart, height, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, restProps, sizing, t0, t1, t2, t3;
641
242
  $[0] === props ? (deprecated_column = $[1], deprecated_columnEnd = $[2], deprecated_columnStart = $[3], deprecated_row = $[4], deprecated_rowEnd = $[5], deprecated_rowStart = $[6], flex = $[7], gridColumn = $[8], gridColumnEnd = $[9], gridColumnStart = $[10], gridRow = $[11], gridRowEnd = $[12], gridRowStart = $[13], height = $[14], marginBottom = $[15], marginLeft = $[16], marginRight = $[17], marginTop = $[18], marginX = $[19], marginY = $[20], overflow = $[21], paddingBottom = $[22], paddingLeft = $[23], paddingRight = $[24], paddingTop = $[25], paddingX = $[26], paddingY = $[27], restProps = $[28], sizing = $[29], t0 = $[30], t1 = $[31], t2 = $[32], t3 = $[33]) : ({as: t0, gridColumn, column: deprecated_column, gridColumnStart, columnStart: deprecated_columnStart, gridColumnEnd, columnEnd: deprecated_columnEnd, display: t1, flex, height, margin: t2, marginX, marginY, marginTop, marginRight, marginBottom, marginLeft, overflow, padding: t3, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft, gridRow, row: deprecated_row, gridRowStart, rowStart: deprecated_rowStart, gridRowEnd, rowEnd: deprecated_rowEnd, sizing, ...restProps} = props, $[0] = props, $[1] = deprecated_column, $[2] = deprecated_columnEnd, $[3] = deprecated_columnStart, $[4] = deprecated_row, $[5] = deprecated_rowEnd, $[6] = deprecated_rowStart, $[7] = flex, $[8] = gridColumn, $[9] = gridColumnEnd, $[10] = gridColumnStart, $[11] = gridRow, $[12] = gridRowEnd, $[13] = gridRowStart, $[14] = height, $[15] = marginBottom, $[16] = marginLeft, $[17] = marginRight, $[18] = marginTop, $[19] = marginX, $[20] = marginY, $[21] = overflow, $[22] = paddingBottom, $[23] = paddingLeft, $[24] = paddingRight, $[25] = paddingTop, $[26] = paddingX, $[27] = paddingY, $[28] = restProps, $[29] = sizing, $[30] = t0, $[31] = t1, $[32] = t2, $[33] = t3);
@@ -724,42 +325,60 @@ const SpanWithTextOverflow = styled_components.styled.span.withConfig({
724
325
  children: props.children
725
326
  }), $[84] = asProp, $[85] = props.children, $[86] = ref, $[87] = restProps, $[88] = t10, $[89] = t11, $[90] = t12, $[91] = t13, $[92] = t14, $[93] = t15, $[94] = t16, $[95] = t17, $[96] = t18, $[97] = t19, $[98] = t20, $[99] = t21, $[100] = t22, $[101] = t23, $[102] = t24, $[103] = t25, $[104] = t26, $[105] = t27, $[106] = t28, $[107] = t29, $[108] = t4, $[109] = t5, $[110] = t6, $[111] = t7, $[112] = t8, $[113] = t9, $[114] = t30) : t30 = $[114], t30;
726
327
  });
727
- function textBaseStyle(props) {
728
- let { $accent, $muted } = props, { font } = require_theme.X(props.theme);
729
- return styled_components.css`color:var(--card-fg-color);${$accent && styled_components.css`color:var(--card-accent-fg-color);`} ${$muted && styled_components.css`color:var(--card-muted-fg-color);`} & code{font-family:${font.code.family};border-radius:1px;background-color:var(--card-code-bg-color);color:var(--card-code-fg-color);}& a{text-decoration:none;border-radius:1px;color:var(--card-link-color);outline:none;@media (hover:hover){&:hover{text-decoration:underline;}}&:focus{box-shadow:0 0 0 1px var(--card-bg-color),0 0 0 3px var(--card-focus-ring-color);}&:focus:not(:focus-visible){box-shadow:none;}}& strong{font-weight:${font.text.weights.bold};}& svg{display:inline;}& [data-sanity-icon]{vertical-align:baseline;color:var(--card-icon-color);& path{vector-effect:non-scaling-stroke !important;}}`;
328
+ function responsiveRadiusStyle(props) {
329
+ let { media, radius } = require_getScopedTheme.i(props.theme);
330
+ return _responsive(media, props.$radius, (value) => {
331
+ let borderRadius = 0;
332
+ return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), { borderRadius };
333
+ });
730
334
  }
731
- const StyledText = /* @__PURE__ */ styled_components.styled.div.withConfig({
732
- displayName: "StyledText",
733
- componentId: "sc-d4ufel-0"
734
- })(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle), Text = (0, react.forwardRef)(function Text(props, ref) {
735
- let $ = (0, react_compiler_runtime.c)(26), align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
736
- $[0] === props ? (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]) : ({accent: t0, align, children: childrenProp, muted: t1, size: t2, textOverflow, weight, ...restProps} = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight);
737
- let accent = t0 !== void 0 && t0, muted = t1 !== void 0 && t1, size = t2 === void 0 ? 2 : t2, children = childrenProp;
738
- if (textOverflow === "ellipsis") {
739
- let t3;
740
- $[9] === children ? t3 = $[10] : (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t3), children = t3;
741
- }
742
- let t3;
743
- $[11] === align ? t3 = $[12] : (t3 = _getArrayProp(align), $[11] = align, $[12] = t3);
744
- let t4;
745
- $[13] === size ? t4 = $[14] : (t4 = _getArrayProp(size), $[13] = size, $[14] = t4);
746
- let t5;
747
- $[15] === children ? t5 = $[16] : (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children }), $[15] = children, $[16] = t5);
748
- let t6;
749
- return $[17] !== accent || $[18] !== muted || $[19] !== ref || $[20] !== restProps || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== weight ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledText, {
750
- "data-ui": "Text",
751
- ...restProps,
752
- $accent: accent,
753
- $align: t3,
754
- $muted: muted,
755
- ref,
756
- $size: t4,
757
- $weight: weight,
758
- children: t5
759
- }), $[17] = accent, $[18] = muted, $[19] = ref, $[20] = restProps, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = weight, $[25] = t6) : t6 = $[25], t6;
760
- }), StyledFlex = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
335
+ /**
336
+ * @public
337
+ */
338
+ function useTheme() {
339
+ return (0, styled_components.useTheme)();
340
+ }
341
+ /**
342
+ * @public
343
+ */
344
+ function useTheme_v2() {
345
+ let $ = (0, react_compiler_runtime.c)(2), t0 = (0, styled_components.useTheme)(), t1;
346
+ return $[0] === t0 ? t1 = $[1] : (t1 = require_getScopedTheme.i(t0), $[0] = t0, $[1] = t1), t1;
347
+ }
348
+ const BASE_STYLE$1 = { "&&:not([hidden])": { display: "flex" } };
349
+ function responsiveFlexStyle() {
350
+ return [
351
+ BASE_STYLE$1,
352
+ responsiveFlexAlignStyle,
353
+ responsiveFlexGapStyle,
354
+ responsiveFlexWrapStyle,
355
+ responsiveFlexJustifyStyle,
356
+ responsiveFlexDirectionStyle
357
+ ];
358
+ }
359
+ function responsiveFlexAlignStyle(props) {
360
+ let { media } = require_getScopedTheme.i(props.theme);
361
+ return _responsive(media, props.$align, (align) => ({ alignItems: align }));
362
+ }
363
+ function responsiveFlexGapStyle(props) {
364
+ let { media, space } = require_getScopedTheme.i(props.theme);
365
+ return _responsive(media, props.$gap, (gap) => ({ gap: gap ? rem(space[gap]) : void 0 }));
366
+ }
367
+ function responsiveFlexWrapStyle(props) {
368
+ let { media } = require_getScopedTheme.i(props.theme);
369
+ return _responsive(media, props.$wrap, (wrap) => ({ flexWrap: wrap }));
370
+ }
371
+ function responsiveFlexJustifyStyle(props) {
372
+ let { media } = require_getScopedTheme.i(props.theme);
373
+ return _responsive(media, props.$justify, (justify) => ({ justifyContent: justify }));
374
+ }
375
+ function responsiveFlexDirectionStyle(props) {
376
+ let { media } = require_getScopedTheme.i(props.theme);
377
+ return _responsive(media, props.$direction, (direction) => ({ flexDirection: direction }));
378
+ }
379
+ const StyledFlex = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
761
380
  displayName: "StyledFlex",
762
- componentId: "sc-ux9uze-0"
381
+ componentId: "sc-5lzqa2-0"
763
382
  })(flexItemStyle, responsiveFlexStyle), Flex = (0, react.forwardRef)(function Flex(props, ref) {
764
383
  let $ = (0, react_compiler_runtime.c)(27), align, as, gap, justify, restProps, t0, wrap;
765
384
  $[0] === props ? (align = $[1], as = $[2], gap = $[3], justify = $[4], restProps = $[5], t0 = $[6], wrap = $[7]) : ({align, as, direction: t0, gap, justify, wrap, ...restProps} = props, $[0] = props, $[1] = align, $[2] = as, $[3] = gap, $[4] = justify, $[5] = restProps, $[6] = t0, $[7] = wrap);
@@ -785,41 +404,145 @@ const StyledText = /* @__PURE__ */ styled_components.styled.div.withConfig({
785
404
  forwardedAs: as,
786
405
  ref
787
406
  }), $[18] = as, $[19] = ref, $[20] = restProps, $[21] = t1, $[22] = t2, $[23] = t3, $[24] = t4, $[25] = t5, $[26] = t6) : t6 = $[26], t6;
788
- }), rotate = styled_components.keyframes`from{transform:rotate(0deg);}to{transform:rotate(360deg);}`, StyledSpinner = (0, styled_components.styled)(Text).withConfig({
789
- displayName: "StyledSpinner",
790
- componentId: "sc-10l2iw-0"
791
- })`& > span > svg{animation:${rotate} 500ms linear infinite;}`, Spinner = (0, react.forwardRef)(function Spinner(props, ref) {
792
- let $ = (0, react_compiler_runtime.c)(4), t0;
793
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sanity_icons_Spinner.SpinnerIcon, {}), $[0] = t0) : t0 = $[0];
794
- let t1;
795
- return $[1] !== props || $[2] !== ref ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSpinner, {
796
- "data-ui": "Spinner",
797
- ...props,
798
- ref,
799
- children: t0
800
- }), $[1] = props, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
801
407
  });
802
408
  /**
409
+ * Get responsive text align styles.
803
410
  * @internal
804
411
  */
805
- function _cardColorStyle(base, color, checkered = !1) {
412
+ function responsiveTextAlignStyle(props) {
413
+ let { media } = require_getScopedTheme.i(props.theme);
414
+ return _responsive(media, props.$align, (textAlign) => ({ textAlign }));
415
+ }
416
+ /**
417
+ * A utility function getting responsive font styles.
418
+ * @internal
419
+ */
420
+ function responsiveFont(fontKey, props) {
421
+ let { $size, $weight } = props, { font, media } = require_getScopedTheme.i(props.theme), { family, sizes, weights } = font[fontKey], fontWeight = $weight && weights[$weight] || weights.regular, defaultSize = sizes[2], base = {
422
+ position: "relative",
423
+ fontFamily: family,
424
+ fontWeight: `${fontWeight}`,
425
+ padding: "1px 0",
426
+ margin: 0,
427
+ "&:before": {
428
+ content: "\"\"",
429
+ display: "block",
430
+ height: 0
431
+ },
432
+ "&:after": {
433
+ content: "\"\"",
434
+ display: "block",
435
+ height: 0
436
+ },
437
+ "& > code, & > span": { display: "block" },
438
+ "&:not([hidden])": { display: "block" }
439
+ };
440
+ return $size ? [base, ..._responsive(media, $size, (sizeIndex) => fontSize(sizes[sizeIndex] || defaultSize))] : (responsiveFont.warned ||= (console.warn("No size specified for responsive font", {
441
+ fontKey,
442
+ $size,
443
+ props,
444
+ base
445
+ }), !0), [base]);
446
+ }
447
+ function fontSize(size) {
448
+ let { ascenderHeight, descenderHeight, fontSize, iconSize, letterSpacing, lineHeight } = size, negHeight = ascenderHeight + descenderHeight, capHeight = lineHeight - negHeight, iconOffset = (capHeight - iconSize) / 2, customIconSize = Math.floor(fontSize * 1.125 / 2) * 2 + 1, customIconOffset = (capHeight - customIconSize) / 2;
806
449
  return {
807
- "--card-backdrop-color": base.backdrop,
808
- "--card-focus-ring-color": base.focusRing,
809
- "--card-shadow-outline-color": base.shadow.outline,
810
- "--card-shadow-umbra-color": base.shadow.umbra,
811
- "--card-shadow-penumbra-color": base.shadow.penumbra,
812
- "--card-shadow-ambient-color": base.shadow.ambient,
813
- "--card-accent-fg-color": color.accent.fg,
814
- "--card-avatar-gray-bg-color": color.avatar.gray.bg,
815
- "--card-avatar-gray-fg-color": color.avatar.gray.fg,
816
- "--card-avatar-blue-bg-color": color.avatar.blue.bg,
817
- "--card-avatar-blue-fg-color": color.avatar.blue.fg,
818
- "--card-avatar-purple-bg-color": color.avatar.purple.bg,
819
- "--card-avatar-purple-fg-color": color.avatar.purple.fg,
820
- "--card-avatar-magenta-bg-color": color.avatar.magenta.bg,
821
- "--card-avatar-magenta-fg-color": color.avatar.magenta.fg,
822
- "--card-avatar-red-bg-color": color.avatar.red.bg,
450
+ fontSize: rem(fontSize),
451
+ lineHeight: `calc(${lineHeight} / ${fontSize})`,
452
+ letterSpacing: rem(letterSpacing),
453
+ transform: `translateY(${rem(descenderHeight)})`,
454
+ "&:before": { marginTop: `calc(${rem(0 - negHeight)} - 1px)` },
455
+ "&:after": { marginBottom: "-1px" },
456
+ "& svg:not([data-sanity-icon])": {
457
+ fontSize: `calc(${customIconSize} / 16 * 1rem)`,
458
+ margin: rem(customIconOffset)
459
+ },
460
+ "& [data-sanity-icon]": {
461
+ fontSize: `calc(${iconSize} / 16 * 1rem)`,
462
+ margin: rem(iconOffset)
463
+ }
464
+ };
465
+ }
466
+ /**
467
+ * Get responsive CSS for the `text` font style.
468
+ * @internal
469
+ */
470
+ function responsiveTextFont(props) {
471
+ return responsiveFont("text", props);
472
+ }
473
+ /** @internal */
474
+ const SpanWithTextOverflow = styled_components.styled.span.withConfig({
475
+ displayName: "SpanWithTextOverflow",
476
+ componentId: "sc-xkyu3h-0"
477
+ })`display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;overflow:clip;`;
478
+ function textBaseStyle(props) {
479
+ let { $accent, $muted } = props, { font } = require_getScopedTheme.i(props.theme);
480
+ return styled_components.css`color:var(--card-fg-color);${$accent && styled_components.css`color:var(--card-accent-fg-color);`} ${$muted && styled_components.css`color:var(--card-muted-fg-color);`} & code{font-family:${font.code.family};border-radius:1px;background-color:var(--card-code-bg-color);color:var(--card-code-fg-color);}& a{text-decoration:none;border-radius:1px;color:var(--card-link-color);outline:none;@media (hover:hover){&:hover{text-decoration:underline;}}&:focus{box-shadow:0 0 0 1px var(--card-bg-color),0 0 0 3px var(--card-focus-ring-color);}&:focus:not(:focus-visible){box-shadow:none;}}& strong{font-weight:${font.text.weights.bold};}& svg{display:inline;}& [data-sanity-icon]{vertical-align:baseline;color:var(--card-icon-color);& path{vector-effect:non-scaling-stroke !important;}}`;
481
+ }
482
+ const StyledText = /* @__PURE__ */ styled_components.styled.div.withConfig({
483
+ displayName: "StyledText",
484
+ componentId: "sc-m7q2yn-0"
485
+ })(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle), Text = (0, react.forwardRef)(function Text(props, ref) {
486
+ let $ = (0, react_compiler_runtime.c)(26), align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
487
+ $[0] === props ? (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]) : ({accent: t0, align, children: childrenProp, muted: t1, size: t2, textOverflow, weight, ...restProps} = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight);
488
+ let accent = t0 !== void 0 && t0, muted = t1 !== void 0 && t1, size = t2 === void 0 ? 2 : t2, children = childrenProp;
489
+ if (textOverflow === "ellipsis") {
490
+ let t3;
491
+ $[9] === children ? t3 = $[10] : (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t3), children = t3;
492
+ }
493
+ let t3;
494
+ $[11] === align ? t3 = $[12] : (t3 = _getArrayProp(align), $[11] = align, $[12] = t3);
495
+ let t4;
496
+ $[13] === size ? t4 = $[14] : (t4 = _getArrayProp(size), $[13] = size, $[14] = t4);
497
+ let t5;
498
+ $[15] === children ? t5 = $[16] : (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children }), $[15] = children, $[16] = t5);
499
+ let t6;
500
+ return $[17] !== accent || $[18] !== muted || $[19] !== ref || $[20] !== restProps || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== weight ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledText, {
501
+ "data-ui": "Text",
502
+ ...restProps,
503
+ $accent: accent,
504
+ $align: t3,
505
+ $muted: muted,
506
+ ref,
507
+ $size: t4,
508
+ $weight: weight,
509
+ children: t5
510
+ }), $[17] = accent, $[18] = muted, $[19] = ref, $[20] = restProps, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = weight, $[25] = t6) : t6 = $[25], t6;
511
+ }), rotate = styled_components.keyframes`from{transform:rotate(0deg);}to{transform:rotate(360deg);}`, StyledSpinner = (0, styled_components.styled)(Text).withConfig({
512
+ displayName: "StyledSpinner",
513
+ componentId: "sc-k51eu1-0"
514
+ })`& > span > svg{animation:${rotate} 500ms linear infinite;}`, Spinner = (0, react.forwardRef)(function Spinner(props, ref) {
515
+ let $ = (0, react_compiler_runtime.c)(4), t0;
516
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sanity_icons_Spinner.SpinnerIcon, {}), $[0] = t0) : t0 = $[0];
517
+ let t1;
518
+ return $[1] !== props || $[2] !== ref ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSpinner, {
519
+ "data-ui": "Spinner",
520
+ ...props,
521
+ ref,
522
+ children: t0
523
+ }), $[1] = props, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
524
+ });
525
+ /**
526
+ * @internal
527
+ */
528
+ function _cardColorStyle(base, color, checkered = !1) {
529
+ return {
530
+ "--card-backdrop-color": base.backdrop,
531
+ "--card-focus-ring-color": base.focusRing,
532
+ "--card-shadow-outline-color": base.shadow.outline,
533
+ "--card-shadow-umbra-color": base.shadow.umbra,
534
+ "--card-shadow-penumbra-color": base.shadow.penumbra,
535
+ "--card-shadow-ambient-color": base.shadow.ambient,
536
+ "--card-accent-fg-color": color.accent.fg,
537
+ "--card-avatar-gray-bg-color": color.avatar.gray.bg,
538
+ "--card-avatar-gray-fg-color": color.avatar.gray.fg,
539
+ "--card-avatar-blue-bg-color": color.avatar.blue.bg,
540
+ "--card-avatar-blue-fg-color": color.avatar.blue.fg,
541
+ "--card-avatar-purple-bg-color": color.avatar.purple.bg,
542
+ "--card-avatar-purple-fg-color": color.avatar.purple.fg,
543
+ "--card-avatar-magenta-bg-color": color.avatar.magenta.bg,
544
+ "--card-avatar-magenta-fg-color": color.avatar.magenta.fg,
545
+ "--card-avatar-red-bg-color": color.avatar.red.bg,
823
546
  "--card-avatar-red-fg-color": color.avatar.red.fg,
824
547
  "--card-avatar-orange-bg-color": color.avatar.orange.bg,
825
548
  "--card-avatar-orange-fg-color": color.avatar.orange.fg,
@@ -878,11 +601,23 @@ function _cardColorStyle(base, color, checkered = !1) {
878
601
  "--card-hairline-hard-color": color.border
879
602
  };
880
603
  }
604
+ function focusRingBorderStyle(border) {
605
+ return `inset 0 0 0 ${border.width}px ${border.color}`;
606
+ }
607
+ function focusRingStyle(opts) {
608
+ let { base, border, focusRing } = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
609
+ return [
610
+ focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,
611
+ border && focusRingBorderStyle(border),
612
+ focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,
613
+ focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`
614
+ ].filter(Boolean).join(",");
615
+ }
881
616
  /**
882
617
  * @internal
883
618
  */
884
619
  function buttonBaseStyles(props) {
885
- let { $width } = props, { style } = require_theme.X(props.theme);
620
+ let { $width } = props, { style } = require_getScopedTheme.i(props.theme);
886
621
  return styled_components.css`${style?.button};-webkit-font-smoothing:inherit;appearance:none;display:inline-flex;align-items:center;font:inherit;border:0;outline:none;user-select:none;text-decoration:none;border:0;box-sizing:border-box;padding:0;margin:0;white-space:nowrap;text-align:left;position:relative;vertical-align:top;${$width === "fill" && styled_components.css`width:-moz-available;width:-webkit-fill-available;width:stretch;`} & > span{display:block;flex:1;min-width:0;border-radius:inherit;}&::-moz-focus-inner{border:0;padding:0;}`;
887
622
  }
888
623
  function combineBoxShadow(...boxShadows) {
@@ -892,7 +627,7 @@ function combineBoxShadow(...boxShadows) {
892
627
  * @internal
893
628
  */
894
629
  function buttonColorStyles(props) {
895
- let { $mode } = props, { button, color: baseColor, style } = require_theme.X(props.theme);
630
+ let { $mode } = props, { button, color: baseColor, style } = require_getScopedTheme.i(props.theme);
896
631
  props.$mode;
897
632
  let mode = baseColor.button[$mode] || baseColor.button.default, color = mode[props.$tone] || mode.default, border = {
898
633
  width: button.border.width,
@@ -929,10 +664,10 @@ function buttonColorStyles(props) {
929
664
  }
930
665
  const StyledButton = /* @__PURE__ */ styled_components.styled.button.withConfig({
931
666
  displayName: "StyledButton",
932
- componentId: "sc-rwh0gh-0"
667
+ componentId: "sc-5eghxe-0"
933
668
  })(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles), LoadingBox = styled_components.styled.div.withConfig({
934
669
  displayName: "LoadingBox",
935
- componentId: "sc-rwh0gh-1"
670
+ componentId: "sc-5eghxe-1"
936
671
  })`position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:var(--card-bg-color);border-radius:inherit;z-index:1;box-shadow:inherit;`, Button = (0, react.forwardRef)(function Button(props, ref) {
937
672
  let $ = (0, react_compiler_runtime.c)(87), IconComponent, IconRightComponent, children, disabled, gap, loading, paddingBottomProp, paddingLeftProp, paddingRightProp, paddingTopProp, paddingXProp, paddingYProp, restProps, selected, t0, t1, t2, t3, t4, t5, t6, t7, t8, text, textAlign, textWeight, width;
938
673
  $[0] === props ? (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], gap = $[5], loading = $[6], paddingBottomProp = $[7], paddingLeftProp = $[8], paddingRightProp = $[9], paddingTopProp = $[10], paddingXProp = $[11], paddingYProp = $[12], restProps = $[13], selected = $[14], t0 = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21], t7 = $[22], t8 = $[23], text = $[24], textAlign = $[25], textWeight = $[26], width = $[27]) : ({children, disabled, fontSize: t0, icon: IconComponent, iconRight: IconRightComponent, justify: t1, loading, mode: t2, padding: t3, paddingX: paddingXProp, paddingY: paddingYProp, paddingTop: paddingTopProp, paddingBottom: paddingBottomProp, paddingLeft: paddingLeftProp, paddingRight: paddingRightProp, radius: t4, selected, gap, space: t5, text, textAlign, textWeight, tone: t6, type: t7, muted: t8, width, ...restProps} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = gap, $[6] = loading, $[7] = paddingBottomProp, $[8] = paddingLeftProp, $[9] = paddingRightProp, $[10] = paddingTopProp, $[11] = paddingXProp, $[12] = paddingYProp, $[13] = restProps, $[14] = selected, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = t8, $[24] = text, $[25] = textAlign, $[26] = textWeight, $[27] = width);
@@ -1022,15 +757,158 @@ const StyledButton = /* @__PURE__ */ styled_components.styled.button.withConfig(
1022
757
  ]
1023
758
  }), $[73] = mode, $[74] = radius, $[75] = ref, $[76] = restProps, $[77] = t21, $[78] = t22, $[79] = t23, $[80] = t24, $[81] = t25, $[82] = t26, $[83] = tone, $[84] = type, $[85] = width, $[86] = t27) : t27 = $[86], t27;
1024
759
  });
760
+ function responsiveBorderStyle() {
761
+ return [
762
+ border,
763
+ borderTop,
764
+ borderRight,
765
+ borderBottom,
766
+ borderLeft
767
+ ];
768
+ }
769
+ function border(props) {
770
+ let { card, media } = require_getScopedTheme.i(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
771
+ return _responsive(media, props.$border, (value) => value ? { "&&": { border: borderStyle } } : { "&&": { border: 0 } });
772
+ }
773
+ function borderTop(props) {
774
+ let { card, media } = require_getScopedTheme.i(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
775
+ return _responsive(media, props.$borderTop, (value) => value ? { "&&": { borderTop: borderStyle } } : { "&&": { borderTop: 0 } });
776
+ }
777
+ function borderRight(props) {
778
+ let { card, media } = require_getScopedTheme.i(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
779
+ return _responsive(media, props.$borderRight, (value) => value ? { "&&": { borderRight: borderStyle } } : { "&&": { borderRight: 0 } });
780
+ }
781
+ function borderBottom(props) {
782
+ let { card, media } = require_getScopedTheme.i(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
783
+ return _responsive(media, props.$borderBottom, (value) => value ? { "&&": { borderBottom: borderStyle } } : { "&&": { borderBottom: 0 } });
784
+ }
785
+ function borderLeft(props) {
786
+ let { card, media } = require_getScopedTheme.i(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
787
+ return _responsive(media, props.$borderLeft, (value) => value ? { "&&": { borderLeft: borderStyle } } : { "&&": { borderLeft: 0 } });
788
+ }
789
+ function toBoxShadow(shadow, color) {
790
+ return `${shadow.map(rem).join(" ")} ${color}`;
791
+ }
792
+ function shadowStyle(shadow, outlineWidth = 1) {
793
+ return shadow ? { boxShadow: `${`0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`}, ${toBoxShadow(shadow.umbra, "var(--card-shadow-umbra-color)")}, ${toBoxShadow(shadow.penumbra, "var(--card-shadow-penumbra-color)")}, ${toBoxShadow(shadow.ambient, "var(--card-shadow-ambient-color)")}` } : EMPTY_RECORD;
794
+ }
795
+ function responsiveShadowStyle(props) {
796
+ let { card, media, shadow } = require_getScopedTheme.i(props.theme);
797
+ return _responsive(media, props.$shadow, (index) => shadowStyle(shadow[index], card.shadow.outline));
798
+ }
799
+ /**
800
+ * Gets the global scope instance in a given environment.
801
+ *
802
+ * The strategy is to return the most modern, and if not, the most common:
803
+ * - The `globalThis` variable is the modern approach to accessing the global scope
804
+ * - The `window` variable is the global scope in a web browser
805
+ * - The `self` variable is the global scope in workers and others
806
+ * - The `global` variable is the global scope in Node.js
807
+ */
808
+ function getGlobalScope() {
809
+ if (typeof globalThis < "u") return globalThis;
810
+ if (typeof window < "u") return window;
811
+ if (typeof self < "u") return self;
812
+ if (typeof global < "u") return global;
813
+ throw Error("@sanity/ui: could not locate global scope");
814
+ }
815
+ const globalScope = getGlobalScope();
816
+ /**
817
+ * As `@sanity/ui` is declared as a dependency, and may be duplicated, sometimes across major versions
818
+ * it's critical that vital react contexts are shared even when there is a duplicate.
819
+ * If we used a model similar to `sanity` itself, or `styled-components`, this would be unnecessary as
820
+ * those libraries enforce single instances.
821
+ * Since we don't enforce it we have to support a sanity plugin being able to call hooks like `useToast`, and then
822
+ * read the context setup by `sanity`, which calls `ToastProvider`, even if the provider and hook are different instances in memory.
823
+ * It's also why it's vital that all changes to globally scoped providers remain fully backwards compatible to v1.
824
+ */
825
+ function createGlobalScopedContext(key, defaultValue) {
826
+ let symbol = Symbol.for(key);
827
+ /**
828
+ * Prevent errors about re-renders on React SSR on Next.js App Router
829
+ */
830
+ if (typeof document > "u") {
831
+ let context = (0, react.createContext)(defaultValue);
832
+ return context.displayName = key, context;
833
+ }
834
+ return globalScope[symbol] = globalScope[symbol] || (0, react.createContext)(defaultValue), globalScope[symbol];
835
+ }
836
+ /**
837
+ * @internal
838
+ */
839
+ const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
840
+ /**
841
+ * @public
842
+ */
843
+ function ThemeProvider(props) {
844
+ let $ = (0, react_compiler_runtime.c)(15), parentTheme = (0, react.useContext)(ThemeContext), { children } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default"), t0;
845
+ bb0: {
846
+ if (!rootTheme) {
847
+ t0 = null;
848
+ break bb0;
849
+ }
850
+ let t1;
851
+ $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t1 = {
852
+ version: 0,
853
+ theme: rootTheme,
854
+ scheme,
855
+ tone
856
+ }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t1) : t1 = $[3], t0 = t1;
857
+ }
858
+ let themeContext = t0, t1;
859
+ bb1: {
860
+ if (!rootTheme) {
861
+ t1 = null;
862
+ break bb1;
863
+ }
864
+ let t2;
865
+ $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t2 = require_getScopedTheme.t(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t2) : t2 = $[7], t1 = t2;
866
+ }
867
+ let theme = t1;
868
+ if (!theme) {
869
+ let t2;
870
+ return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: "ThemeProvider: no \"theme\" property provided" }), $[8] = t2) : t2 = $[8], t2;
871
+ }
872
+ let t2;
873
+ $[9] !== children || $[10] !== theme ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(styled_components.ThemeProvider, {
874
+ theme,
875
+ children
876
+ }), $[9] = children, $[10] = theme, $[11] = t2) : t2 = $[11];
877
+ let t3;
878
+ return $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
879
+ value: themeContext,
880
+ children: t2
881
+ }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14], t3;
882
+ }
883
+ /**
884
+ * @public
885
+ */
886
+ function useRootTheme() {
887
+ let value = (0, react.useContext)(ThemeContext);
888
+ if (!value) throw Error("useRootTheme(): missing context value");
889
+ return value;
890
+ }
891
+ /**
892
+ * @public
893
+ */
894
+ function ThemeColorProvider(props) {
895
+ let $ = (0, react_compiler_runtime.c)(5), { children, scheme, tone } = props, root = useRootTheme(), t0 = scheme || root.scheme, t1;
896
+ return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeProvider, {
897
+ scheme: t0,
898
+ theme: root.theme,
899
+ tone,
900
+ children
901
+ }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
902
+ }
1025
903
  function cardStyle(props) {
1026
904
  return [cardBaseStyle(props), cardColorStyle(props)];
1027
905
  }
1028
906
  function cardBaseStyle(props) {
1029
- let { $checkered } = props, { space } = require_theme.X(props.theme);
907
+ let { $checkered } = props, { space } = require_getScopedTheme.i(props.theme);
1030
908
  return styled_components.css`${$checkered && styled_components.css`background-size:${space[3]}px ${space[3]}px;background-position:50% 50%;background-image:var(--card-bg-image);`} &[data-as='button']{-webkit-font-smoothing:inherit;appearance:none;outline:none;font:inherit;text-align:inherit;border:0;width:-moz-available;width:-webkit-fill-available;width:stretch;}&[data-as='a']{outline:none;text-decoration:none;}&[data-as='pre']{font:inherit;}`;
1031
909
  }
1032
910
  function cardColorStyle(props) {
1033
- let { $checkered, $focusRing, $muted } = props, { card, color, style } = require_theme.X(props.theme), border = {
911
+ let { $checkered, $focusRing, $muted } = props, { card, color, style } = require_getScopedTheme.i(props.theme), border = {
1034
912
  width: card.border.width,
1035
913
  color: "var(--card-border-color)"
1036
914
  };
@@ -1046,7 +924,7 @@ function cardColorStyle(props) {
1046
924
  }
1047
925
  const StyledCard = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
1048
926
  displayName: "StyledCard",
1049
- componentId: "sc-p2pbep-0"
927
+ componentId: "sc-2ikw89-0"
1050
928
  })(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = (0, react.forwardRef)(function Card(props, ref) {
1051
929
  let $ = (0, react_compiler_runtime.c)(56), asProp, border, borderBottom, borderLeft, borderRight, borderTop, muted, pressed, restProps, scheme, selected, shadow, t0, t1, t2, t3;
1052
930
  $[0] === props ? (asProp = $[1], border = $[2], borderBottom = $[3], borderLeft = $[4], borderRight = $[5], borderTop = $[6], muted = $[7], pressed = $[8], restProps = $[9], scheme = $[10], selected = $[11], shadow = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16]) : ({__unstable_checkered: t0, __unstable_focusRing: t1, as: asProp, border, borderTop, borderRight, borderBottom, borderLeft, muted, pressed, radius: t2, scheme, selected, shadow, tone: t3, ...restProps} = props, $[0] = props, $[1] = asProp, $[2] = border, $[3] = borderBottom, $[4] = borderLeft, $[5] = borderRight, $[6] = borderTop, $[7] = muted, $[8] = pressed, $[9] = restProps, $[10] = scheme, $[11] = selected, $[12] = shadow, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3);
@@ -1095,49 +973,7 @@ const StyledCard = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig
1095
973
  tone,
1096
974
  children: t16
1097
975
  }), $[52] = scheme, $[53] = t16, $[54] = tone, $[55] = t17) : t17 = $[55], t17;
1098
- });
1099
- /**
1100
- * @public
1101
- */
1102
- function useClickOutsideEvent(listener, t0, boundaryElement) {
1103
- let $ = (0, react_compiler_runtime.c)(9), elementsArg = t0 === void 0 ? _temp$8 : t0, t1;
1104
- $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
1105
- if (!listener) return;
1106
- let target = evt.target;
1107
- if (!(target instanceof Node)) return;
1108
- let resolvedBoundaryElement = boundaryElement?.();
1109
- if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target)) return;
1110
- let elements = elementsArg().flat();
1111
- for (let el of elements) if (el && (target === el || el.contains(target))) return;
1112
- listener(evt);
1113
- }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
1114
- let onEvent = (0, use_effect_event.useEffectEvent)(t1), hasListener = !!listener, t2;
1115
- $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
1116
- if (!hasListener) return;
1117
- let handleEvent = (evt_0) => onEvent(evt_0);
1118
- return document.addEventListener("mousedown", handleEvent), () => {
1119
- document.removeEventListener("mousedown", handleEvent);
1120
- };
1121
- }, $[4] = hasListener, $[5] = onEvent, $[6] = t2) : t2 = $[6];
1122
- let t3;
1123
- $[7] === hasListener ? t3 = $[8] : (t3 = [hasListener], $[7] = hasListener, $[8] = t3), (0, react.useEffect)(t2, t3), (0, react.useDebugValue)(listener ? "MouseDown On" : "MouseDown Off");
1124
- }
1125
- function _temp$8() {
1126
- return EMPTY_ARRAY;
1127
- }
1128
- /**
1129
- * @beta
1130
- */
1131
- function useCustomValidity(ref, customValidity) {
1132
- let $ = (0, react_compiler_runtime.c)(4), t0, t1;
1133
- $[0] !== customValidity || $[1] !== ref ? (t0 = () => {
1134
- ref.current?.setCustomValidity(customValidity || "");
1135
- }, t1 = [customValidity, ref], $[0] = customValidity, $[1] = ref, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), (0, react.useEffect)(t0, t1);
1136
- }
1137
- /**
1138
- * @internal
1139
- */
1140
- const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : _juggle_resize_observer.ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
976
+ }), _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : _juggle_resize_observer.ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
1141
977
  function _createElementRectValueListener() {
1142
978
  return { subscribe(element, subscriber) {
1143
979
  let resizeObserver = new _ResizeObserver(([entry]) => {
@@ -1180,42 +1016,6 @@ function useElementSize(element) {
1180
1016
  if (element) return _elementSizeObserver.subscribe(element, setSize);
1181
1017
  }, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1), (0, react.useEffect)(t0, t1), size;
1182
1018
  }
1183
- /**
1184
- * Adds global keydown event listener to the window.
1185
- *
1186
- * @param onKeyDown - The function to call when a keydown event is triggered.
1187
- * @param options - The options to pass to the addEventListener function (example, capture: true)
1188
- * @beta
1189
- */
1190
- function useGlobalKeyDown(onKeyDown, options) {
1191
- let $ = (0, react_compiler_runtime.c)(7), t0;
1192
- $[0] === onKeyDown ? t0 = $[1] : (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0);
1193
- let handleKeyDown = (0, use_effect_event.useEffectEvent)(t0), t1;
1194
- $[2] !== handleKeyDown || $[3] !== options ? (t1 = () => {
1195
- let handler = (event_0) => handleKeyDown(event_0);
1196
- return window.addEventListener("keydown", handler, options), () => window.removeEventListener("keydown", handler, options);
1197
- }, $[2] = handleKeyDown, $[3] = options, $[4] = t1) : t1 = $[4];
1198
- let t2;
1199
- $[5] === options ? t2 = $[6] : (t2 = [options], $[5] = options, $[6] = t2), (0, react.useEffect)(t1, t2);
1200
- }
1201
- /**
1202
- * Efficiently subscribes to `window.matchMedia` queries
1203
- *
1204
- * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
1205
- *
1206
- * @public
1207
- */
1208
- function useMatchMedia(mediaQueryString, getServerSnapshot) {
1209
- let $ = (0, react_compiler_runtime.c)(4);
1210
- (0, react.useDebugValue)(mediaQueryString);
1211
- let t0;
1212
- $[0] === mediaQueryString ? t0 = $[1] : (t0 = (onStoreChange) => {
1213
- let media = window.matchMedia(mediaQueryString);
1214
- return media.addEventListener("change", onStoreChange), () => media.removeEventListener("change", onStoreChange);
1215
- }, $[0] = mediaQueryString, $[1] = t0);
1216
- let t1;
1217
- return $[2] === mediaQueryString ? t1 = $[3] : (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1), (0, react.useSyncExternalStore)(t0, t1, getServerSnapshot);
1218
- }
1219
1019
  function _getMediaQuery(media, index) {
1220
1020
  return index === 0 ? `screen and (max-width: ${media[index] - 1}px)` : index === media.length ? `screen and (min-width: ${media[index - 1]}px)` : `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
1221
1021
  }
@@ -1273,21 +1073,22 @@ function useMediaIndex() {
1273
1073
  return (0, react.useSyncExternalStore)(store.subscribe, store.getSnapshot, getServerSnapshot);
1274
1074
  }
1275
1075
  /**
1276
- * Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
1277
- *
1278
- * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-color-scheme: light)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
1076
+ * Efficiently subscribes to `window.matchMedia` queries
1279
1077
  *
1280
- * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
1281
- * Chrome supports reading the `prefers-color-scheme` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme
1282
- * @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
1078
+ * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
1283
1079
  *
1284
1080
  * @public
1285
1081
  */
1286
- function usePrefersDark(t0) {
1287
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$7 : t0);
1288
- }
1289
- function _temp$7() {
1290
- return !1;
1082
+ function useMatchMedia(mediaQueryString, getServerSnapshot) {
1083
+ let $ = (0, react_compiler_runtime.c)(4);
1084
+ (0, react.useDebugValue)(mediaQueryString);
1085
+ let t0;
1086
+ $[0] === mediaQueryString ? t0 = $[1] : (t0 = (onStoreChange) => {
1087
+ let media = window.matchMedia(mediaQueryString);
1088
+ return media.addEventListener("change", onStoreChange), () => media.removeEventListener("change", onStoreChange);
1089
+ }, $[0] = mediaQueryString, $[1] = t0);
1090
+ let t1;
1091
+ return $[2] === mediaQueryString ? t1 = $[3] : (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1), (0, react.useSyncExternalStore)(t0, t1, getServerSnapshot);
1291
1092
  }
1292
1093
  /**
1293
1094
  * Returns true if motion should be reduced
@@ -1301,127 +1102,21 @@ function _temp$7() {
1301
1102
  * @public
1302
1103
  */
1303
1104
  function usePrefersReducedMotion(t0) {
1304
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$6 : t0);
1105
+ return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$8 : t0);
1305
1106
  }
1306
- function _temp$6() {
1107
+ function _temp$8() {
1307
1108
  return !1;
1308
1109
  }
1309
- const StyledGrid = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
1310
- displayName: "StyledGrid",
1311
- componentId: "sc-1yxm55-0"
1312
- })(responsiveGridStyle), Grid = (0, react.forwardRef)(function Grid(props, ref) {
1313
- let $ = (0, react_compiler_runtime.c)(44), as, autoCols, autoFlow, autoRows, children, columns, gap, gapX, gapY, gridTemplateColumns, gridTemplateRows, restProps, rows;
1314
- $[0] === props ? (as = $[1], autoCols = $[2], autoFlow = $[3], autoRows = $[4], children = $[5], columns = $[6], gap = $[7], gapX = $[8], gapY = $[9], gridTemplateColumns = $[10], gridTemplateRows = $[11], restProps = $[12], rows = $[13]) : ({as, autoRows, autoCols, autoFlow, columns, gridTemplateColumns, gap, gapX, gapY, rows, gridTemplateRows, children, ...restProps} = props, $[0] = props, $[1] = as, $[2] = autoCols, $[3] = autoFlow, $[4] = autoRows, $[5] = children, $[6] = columns, $[7] = gap, $[8] = gapX, $[9] = gapY, $[10] = gridTemplateColumns, $[11] = gridTemplateRows, $[12] = restProps, $[13] = rows);
1315
- let t0 = typeof as == "string" ? as : void 0, t1;
1316
- $[14] === autoRows ? t1 = $[15] : (t1 = _getArrayProp(autoRows), $[14] = autoRows, $[15] = t1);
1317
- let t2;
1318
- $[16] === autoCols ? t2 = $[17] : (t2 = _getArrayProp(autoCols), $[16] = autoCols, $[17] = t2);
1319
- let t3;
1320
- $[18] === autoFlow ? t3 = $[19] : (t3 = _getArrayProp(autoFlow), $[18] = autoFlow, $[19] = t3);
1321
- let t4 = gridTemplateColumns === void 0 ? columns : gridTemplateColumns, t5;
1322
- $[20] === t4 ? t5 = $[21] : (t5 = _getArrayProp(t4), $[20] = t4, $[21] = t5);
1323
- let t6;
1324
- $[22] === gap ? t6 = $[23] : (t6 = _getArrayProp(gap), $[22] = gap, $[23] = t6);
1325
- let t7;
1326
- $[24] === gapX ? t7 = $[25] : (t7 = _getArrayProp(gapX), $[24] = gapX, $[25] = t7);
1327
- let t8;
1328
- $[26] === gapY ? t8 = $[27] : (t8 = _getArrayProp(gapY), $[26] = gapY, $[27] = t8);
1329
- let t9 = gridTemplateRows === void 0 ? rows : gridTemplateRows, t10;
1330
- $[28] === t9 ? t10 = $[29] : (t10 = _getArrayProp(t9), $[28] = t9, $[29] = t10);
1331
- let t11;
1332
- return $[30] !== as || $[31] !== children || $[32] !== ref || $[33] !== restProps || $[34] !== t0 || $[35] !== t1 || $[36] !== t10 || $[37] !== t2 || $[38] !== t3 || $[39] !== t5 || $[40] !== t6 || $[41] !== t7 || $[42] !== t8 ? (t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledGrid, {
1333
- "data-as": t0,
1334
- "data-ui": "Grid",
1335
- ...restProps,
1336
- $autoRows: t1,
1337
- $autoCols: t2,
1338
- $autoFlow: t3,
1339
- $columns: t5,
1340
- $gap: t6,
1341
- $gapX: t7,
1342
- $gapY: t8,
1343
- $rows: t10,
1344
- forwardedAs: as,
1345
- ref,
1346
- children
1347
- }), $[30] = as, $[31] = children, $[32] = ref, $[33] = restProps, $[34] = t0, $[35] = t1, $[36] = t10, $[37] = t2, $[38] = t3, $[39] = t5, $[40] = t6, $[41] = t7, $[42] = t8, $[43] = t11) : t11 = $[43], t11;
1348
- });
1349
- function inlineBaseStyle() {
1350
- return {
1351
- lineHeight: "0",
1352
- "&&:not([hidden])": { display: "block" },
1353
- "& > div": {
1354
- display: "inline-block",
1355
- verticalAlign: "middle"
1356
- }
1357
- };
1358
- }
1359
- function inlineSpaceStyle(props) {
1360
- let { media, space } = require_theme.X(props.theme);
1361
- return _responsive(media, props.$space, (spaceIndex) => {
1362
- let _space = rem(spaceIndex === .5 ? space[1] / 2 : space[spaceIndex]);
1363
- return {
1364
- margin: `-${_space} 0 0 -${_space}`,
1365
- "& > div": { padding: `${_space} 0 0 ${_space}` }
1366
- };
1367
- });
1368
- }
1369
- const StyledInline = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
1370
- displayName: "StyledInline",
1371
- componentId: "sc-8j2qbm-0"
1372
- })(inlineBaseStyle, inlineSpaceStyle), Inline = (0, react.forwardRef)(function Inline(props, ref) {
1373
- let $ = (0, react_compiler_runtime.c)(16), as, childrenProp, deprecated_space, gap, restProps;
1374
- $[0] === props ? (as = $[1], childrenProp = $[2], deprecated_space = $[3], gap = $[4], restProps = $[5]) : ({as, children: childrenProp, gap, space: deprecated_space, ...restProps} = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = deprecated_space, $[4] = gap, $[5] = restProps);
1375
- let spacing = gap === void 0 ? deprecated_space : gap, t0;
1376
- $[6] === childrenProp ? t0 = $[7] : (t0 = react.Children.map(childrenProp, _temp$5), $[6] = childrenProp, $[7] = t0);
1377
- let children = t0, t1;
1378
- $[8] === spacing ? t1 = $[9] : (t1 = _getArrayProp(spacing), $[8] = spacing, $[9] = t1);
1379
- let t2 = ref, t3;
1380
- return $[10] !== as || $[11] !== children || $[12] !== restProps || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledInline, {
1381
- "data-ui": "Inline",
1382
- ...restProps,
1383
- $space: t1,
1384
- forwardedAs: as,
1385
- ref: t2,
1386
- children
1387
- }), $[10] = as, $[11] = children, $[12] = restProps, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
1388
- });
1389
- function _temp$5(child) {
1390
- return child && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: child });
1391
- }
1392
- function kbdStyle() {
1393
- return styled_components.css`--card-bg-color:var(--card-kbd-bg-color);--card-border-color:var(--card-kbd-border-color);--card-fg-color:var(--card-kbd-fg-color);box-shadow:inset 0 0 0 1px var(--card-border-color);background:var(--card-bg-color);font:inherit;vertical-align:top;&:not([hidden]){display:inline-block;}`;
1394
- }
1395
- const StyledKBD = /* @__PURE__ */ styled_components.styled.kbd.withConfig({
1396
- displayName: "StyledKBD",
1397
- componentId: "sc-pgjv2l-0"
1398
- })(responsiveRadiusStyle, kbdStyle), KBD = (0, react.forwardRef)(function KBD(props, ref) {
1399
- let $ = (0, react_compiler_runtime.c)(19), children, restProps, t0, t1, t2;
1400
- $[0] === props ? (children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5]) : ({children, fontSize: t0, padding: t1, radius: t2, ...restProps} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2);
1401
- let fontSize = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? 2 : t2, t3;
1402
- $[6] === radius ? t3 = $[7] : (t3 = _getArrayProp(radius), $[6] = radius, $[7] = t3);
1403
- let t4;
1404
- $[8] !== children || $[9] !== fontSize ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
1405
- as: "span",
1406
- size: fontSize,
1407
- weight: "semibold",
1408
- children
1409
- }), $[8] = children, $[9] = fontSize, $[10] = t4) : t4 = $[10];
1410
- let t5;
1411
- $[11] !== padding || $[12] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
1412
- as: "span",
1413
- padding,
1414
- children: t4
1415
- }), $[11] = padding, $[12] = t4, $[13] = t5) : t5 = $[13];
1416
- let t6;
1417
- return $[14] !== ref || $[15] !== restProps || $[16] !== t3 || $[17] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledKBD, {
1418
- "data-ui": "KBD",
1419
- ...restProps,
1420
- $radius: t3,
1421
- ref,
1422
- children: t5
1423
- }), $[14] = ref, $[15] = restProps, $[16] = t3, $[17] = t5, $[18] = t6) : t6 = $[18], t6;
1424
- }), origin = {
1110
+ /**
1111
+ * Custom floating-ui middleware which calculates transform-origin X + Y offsets
1112
+ * based on the current floating rect's dimensions and shift offset.
1113
+ *
1114
+ * Scaling popovers with these transform-origin offsets will give the effect of
1115
+ * popvers slightly 'growing' from the origin/reference element.
1116
+ *
1117
+ * This middleware must be applied after both `@sanity/ui/size` and `shift` middlewares.
1118
+ */
1119
+ const origin = {
1425
1120
  name: "@sanity/ui/origin",
1426
1121
  fn({ middlewareData, placement, rects }) {
1427
1122
  let [side] = placement.split("-"), floatingWidth = rects.floating.width, floatingHeight = rects.floating.height, shiftX = middlewareData.shift?.x || 0, shiftY = middlewareData.shift?.y || 0;
@@ -1442,137 +1137,30 @@ const StyledKBD = /* @__PURE__ */ styled_components.styled.kbd.withConfig({
1442
1137
  function clamp(num, min, max) {
1443
1138
  return Math.min(Math.max(num, min), max);
1444
1139
  }
1445
- function moveTowardsLength(movingPoint, targetPoint, amount) {
1446
- let width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
1447
- return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
1140
+ function isRecord(value) {
1141
+ return !!(value && typeof value == "object" && !Array.isArray(value));
1448
1142
  }
1449
- function moveTowardsFractional(movingPoint, targetPoint, fraction) {
1450
- return {
1451
- x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
1452
- y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
1453
- };
1143
+ const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null), DEFAULT_VALUE = {
1144
+ version: 0,
1145
+ element: null
1146
+ };
1147
+ /**
1148
+ * @public
1149
+ */
1150
+ function useBoundaryElement() {
1151
+ let value = (0, react.useContext)(BoundaryElementContext);
1152
+ if (value && (!isRecord(value) || value.version !== 0)) throw Error("useBoundaryElement(): the context value is not compatible");
1153
+ return value || DEFAULT_VALUE;
1454
1154
  }
1455
- function getRoundedCommands(points) {
1456
- let len = points.length, cmds = [];
1457
- for (let i = 0; i < len; i += 1) {
1458
- let point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
1459
- if (prevPoint && point.radius) {
1460
- let curveStart = moveTowardsLength(point, prevPoint, point.radius), curveEnd = moveTowardsLength(point, nextPoint, point.radius), startControl = moveTowardsFractional(curveStart, point, .5), endControl = moveTowardsFractional(point, curveEnd, .5);
1461
- cmds.push({
1462
- type: "point",
1463
- ...curveStart
1464
- }), cmds.push({
1465
- type: "curve",
1466
- curveEnd,
1467
- startControl,
1468
- endControl
1469
- });
1470
- } else cmds.push({
1471
- type: "point",
1472
- ...point
1473
- });
1474
- }
1475
- return cmds;
1155
+ function getElementRef(element) {
1156
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1157
+ return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
1476
1158
  }
1477
- function compileCommands(cmds) {
1478
- return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
1479
- }
1480
- const StyledArrow = /* @__PURE__ */ styled_components.styled.div.withConfig({
1481
- displayName: "StyledArrow",
1482
- componentId: "sc-1ev21f-0"
1483
- })(({ $w: w }) => styled_components.css`position:absolute;width:${w}px;height:${w}px;:empty + &{display:none;}& > svg{display:block;line-height:0;transform-origin:${w / 2}px ${w / 2}px;}[data-placement^='top'] > &{bottom:-${w}px;& > svg{transform:rotate(0);}}[data-placement^='right'] > &{left:-${w}px;& > svg{transform:rotate(90deg);}}[data-placement^='left'] > &{right:-${w}px;& > svg{transform:rotate(-90deg);}}[data-placement^='bottom'] > &{top:-${w}px;& > svg{transform:rotate(180deg);}}`), StrokePath = styled_components.styled.path.withConfig({
1484
- displayName: "StrokePath",
1485
- componentId: "sc-1ev21f-1"
1486
- })`stroke:var(--card-shadow-outline-color);`, ShapePath = styled_components.styled.path.withConfig({
1487
- displayName: "ShapePath",
1488
- componentId: "sc-1ev21f-2"
1489
- })`fill:var(--card-bg-color);`, Arrow = (0, react.forwardRef)(function Arrow(props, ref) {
1490
- let $ = (0, react_compiler_runtime.c)(29), h, restProps, t0, w;
1491
- $[0] === props ? (h = $[1], restProps = $[2], t0 = $[3], w = $[4]) : ({width: w, height: h, radius: t0, ...restProps} = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = t0, $[4] = w);
1492
- let radius = t0 === void 0 ? 0 : t0, { card } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, t1;
1493
- $[5] !== center || $[6] !== h || $[7] !== radius || $[8] !== w ? (t1 = compileCommands(getRoundedCommands([
1494
- {
1495
- x: 0,
1496
- y: 0
1497
- },
1498
- {
1499
- x: radius,
1500
- y: 0,
1501
- radius
1502
- },
1503
- {
1504
- x: center,
1505
- y: h - 1,
1506
- radius
1507
- },
1508
- {
1509
- x: w - radius,
1510
- y: 0,
1511
- radius
1512
- },
1513
- {
1514
- x: w,
1515
- y: 0
1516
- }
1517
- ])), $[5] = center, $[6] = h, $[7] = radius, $[8] = w, $[9] = t1) : t1 = $[9];
1518
- let path = t1, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t2 = `0 0 ${w} ${w}`, t3;
1519
- $[10] !== strokeWidth || $[11] !== w ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("mask", {
1520
- id: "stroke-mask",
1521
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
1522
- x: 0,
1523
- y: strokeWidth,
1524
- width: w,
1525
- height: w,
1526
- fill: "white"
1527
- })
1528
- }), $[10] = strokeWidth, $[11] = w, $[12] = t3) : t3 = $[12];
1529
- let t4 = strokeWidth * 2, t5;
1530
- $[13] !== strokePath || $[14] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrokePath, {
1531
- d: strokePath,
1532
- mask: "url(#stroke-mask)",
1533
- strokeWidth: t4
1534
- }), $[13] = strokePath, $[14] = t4, $[15] = t5) : t5 = $[15];
1535
- let t6;
1536
- $[16] === fillPath ? t6 = $[17] : (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShapePath, { d: fillPath }), $[16] = fillPath, $[17] = t6);
1537
- let t7;
1538
- $[18] !== t2 || $[19] !== t3 || $[20] !== t5 || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1539
- width: w,
1540
- height: w,
1541
- viewBox: t2,
1542
- children: [
1543
- t3,
1544
- t5,
1545
- t6
1546
- ]
1547
- }), $[18] = t2, $[19] = t3, $[20] = t5, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23];
1548
- let t8;
1549
- return $[24] !== ref || $[25] !== restProps || $[26] !== t7 || $[27] !== w ? (t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledArrow, {
1550
- ...restProps,
1551
- $w: w,
1552
- ref,
1553
- children: t7
1554
- }), $[24] = ref, $[25] = restProps, $[26] = t7, $[27] = w, $[28] = t8) : t8 = $[28], t8;
1555
- }), BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
1556
- function isRecord(value) {
1557
- return !!(value && typeof value == "object" && !Array.isArray(value));
1558
- }
1559
- const DEFAULT_VALUE = {
1560
- version: 0,
1561
- element: null
1562
- };
1563
- /**
1564
- * @public
1565
- */
1566
- function useBoundaryElement() {
1567
- let value = (0, react.useContext)(BoundaryElementContext);
1568
- if (value && (!isRecord(value) || value.version !== 0)) throw Error("useBoundaryElement(): the context value is not compatible");
1569
- return value || DEFAULT_VALUE;
1570
- }
1571
- function getLayerContext(contextValue) {
1572
- if (!isRecord(contextValue) || contextValue.version !== 0) throw Error("the context value is not compatible");
1573
- if (!contextValue) throw Error("components using `useLayer()` should be wrapped in a <LayerProvider>.");
1574
- if (contextValue.version === 0) return contextValue;
1575
- throw Error("could not get layer context");
1159
+ function getLayerContext(contextValue) {
1160
+ if (!isRecord(contextValue) || contextValue.version !== 0) throw Error("the context value is not compatible");
1161
+ if (!contextValue) throw Error("components using `useLayer()` should be wrapped in a <LayerProvider>.");
1162
+ if (contextValue.version === 0) return contextValue;
1163
+ throw Error("could not get layer context");
1576
1164
  }
1577
1165
  const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
1578
1166
  /**
@@ -1588,7 +1176,7 @@ function LayerProvider(props) {
1588
1176
  let [, setChildLayers] = (0, react.useState)(t3), [size, setSize] = (0, react.useState)(0), isTopLayer = size === 0, t4;
1589
1177
  $[5] !== parentRegisterChild || $[6] !== setChildLayers ? (t4 = (childLevel) => {
1590
1178
  let parentDispose = parentRegisterChild?.(childLevel);
1591
- return childLevel === void 0 ? setSize(_temp$4) : setChildLayers((state) => {
1179
+ return childLevel === void 0 ? setSize(_temp$7) : setChildLayers((state) => {
1592
1180
  let prevLen = state[childLevel] ?? 0, nextState = {
1593
1181
  ...state,
1594
1182
  [childLevel]: prevLen + 1
@@ -1621,7 +1209,7 @@ function LayerProvider(props) {
1621
1209
  function _temp2$2(v_0) {
1622
1210
  return v_0 - 1;
1623
1211
  }
1624
- function _temp$4(v) {
1212
+ function _temp$7(v) {
1625
1213
  return v + 1;
1626
1214
  }
1627
1215
  /**
@@ -1638,53 +1226,7 @@ function useLayer() {
1638
1226
  throw err instanceof Error ? Error(`useLayer(): ${err.message}`) : Error(`useLayer(): ${err}`);
1639
1227
  }
1640
1228
  }
1641
- const StyledLayer = /* @__PURE__ */ styled_components.styled.div.withConfig({
1642
- displayName: "StyledLayer",
1643
- componentId: "sc-100e5i-0"
1644
- })({ position: "relative" }), LayerChildren = (0, react.forwardRef)(function LayerChildren(props, forwardedRef) {
1645
- let $ = (0, react_compiler_runtime.c)(22), children, onActivate, onFocus, restProps, t0;
1646
- $[0] === props ? (children = $[1], onActivate = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]) : ({children, onActivate, onFocus, style: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = onActivate, $[3] = onFocus, $[4] = restProps, $[5] = t0);
1647
- let style = t0 === void 0 ? EMPTY_RECORD : t0, { zIndex, isTopLayer } = useLayer(), lastFocusedRef = (0, react.useRef)(null), ref = (0, react.useRef)(null), isTopLayerRef = (0, react.useRef)(isTopLayer), t1;
1648
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[6] = t1) : t1 = $[6], (0, react.useImperativeHandle)(forwardedRef, t1);
1649
- let t2, t3;
1650
- $[7] !== isTopLayer || $[8] !== onActivate ? (t2 = () => {
1651
- isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({ activeElement: lastFocusedRef.current }), isTopLayerRef.current = isTopLayer;
1652
- }, t3 = [isTopLayer, onActivate], $[7] = isTopLayer, $[8] = onActivate, $[9] = t2, $[10] = t3) : (t2 = $[9], t3 = $[10]), (0, react.useEffect)(t2, t3);
1653
- let t4;
1654
- $[11] !== isTopLayer || $[12] !== onFocus ? (t4 = (event) => {
1655
- onFocus?.(event);
1656
- let rootElement = ref.current, target = document.activeElement;
1657
- !isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
1658
- }, $[11] = isTopLayer, $[12] = onFocus, $[13] = t4) : t4 = $[13];
1659
- let handleFocus = t4, t5;
1660
- $[14] !== style || $[15] !== zIndex ? (t5 = {
1661
- ...style,
1662
- zIndex
1663
- }, $[14] = style, $[15] = zIndex, $[16] = t5) : t5 = $[16];
1664
- let t6;
1665
- return $[17] !== children || $[18] !== handleFocus || $[19] !== restProps || $[20] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledLayer, {
1666
- ...restProps,
1667
- "data-ui": "Layer",
1668
- onFocus: handleFocus,
1669
- ref,
1670
- style: t5,
1671
- children
1672
- }), $[17] = children, $[18] = handleFocus, $[19] = restProps, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
1673
- }), Layer = (0, react.forwardRef)(function Layer(props, ref) {
1674
- let $ = (0, react_compiler_runtime.c)(11), children, restProps, t0;
1675
- $[0] === props ? (children = $[1], restProps = $[2], t0 = $[3]) : ({children, zOffset: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0);
1676
- let zOffset = t0 === void 0 ? 1 : t0, t1;
1677
- $[4] !== children || $[5] !== ref || $[6] !== restProps ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LayerChildren, {
1678
- ...restProps,
1679
- ref,
1680
- children
1681
- }), $[4] = children, $[5] = ref, $[6] = restProps, $[7] = t1) : t1 = $[7];
1682
- let t2;
1683
- return $[8] !== t1 || $[9] !== zOffset ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LayerProvider, {
1684
- zOffset,
1685
- children: t1
1686
- }), $[8] = t1, $[9] = zOffset, $[10] = t2) : t2 = $[10], t2;
1687
- }), key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
1229
+ const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
1688
1230
  globalScope[elementKey] = null;
1689
1231
  const PortalContext = createGlobalScopedContext(key, {
1690
1232
  version: 0,
@@ -1711,34 +1253,6 @@ function Portal(props) {
1711
1253
  let t0;
1712
1254
  return $[0] !== children || $[1] !== portalElement ? (t0 = (0, react_dom.createPortal)(children, portalElement), $[0] = children, $[1] = portalElement, $[2] = t0) : t0 = $[2], t0;
1713
1255
  }
1714
- /**
1715
- * @public
1716
- */
1717
- function PortalProvider(props) {
1718
- let $ = (0, react_compiler_runtime.c)(7), { boundaryElement, children, element, __unstable_elements: elements } = props, fallbackElement = (0, react.useSyncExternalStore)(emptySubscribe, _temp$3, _temp2$1), t0 = boundaryElement || null, t1 = element || fallbackElement, t2;
1719
- $[0] !== elements || $[1] !== t0 || $[2] !== t1 ? (t2 = {
1720
- version: 0,
1721
- boundaryElement: t0,
1722
- element: t1,
1723
- elements
1724
- }, $[0] = elements, $[1] = t0, $[2] = t1, $[3] = t2) : t2 = $[3];
1725
- let value = t2, t3;
1726
- return $[4] !== children || $[5] !== value ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortalContext.Provider, {
1727
- value,
1728
- children
1729
- }), $[4] = children, $[5] = value, $[6] = t3) : t3 = $[6], t3;
1730
- }
1731
- function _temp2$1() {
1732
- return null;
1733
- }
1734
- function _temp$3() {
1735
- return document.body;
1736
- }
1737
- const emptySubscribe = () => () => {};
1738
- function getElementRef(element) {
1739
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1740
- return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
1741
- }
1742
1256
  const DEFAULT_POPOVER_MARGINS = [
1743
1257
  0,
1744
1258
  0,
@@ -1834,112 +1348,222 @@ function calcMaxWidth(params) {
1834
1348
  let { boundaryWidth, currentWidth } = params;
1835
1349
  if (currentWidth !== void 0 || boundaryWidth !== void 0) return Math.min(currentWidth ?? Infinity, (boundaryWidth || Infinity) - 8);
1836
1350
  }
1837
- const MotionCard$1 = (0, styled_components.styled)(motion_react.motion.create(Card)).withConfig({
1838
- displayName: "MotionCard",
1839
- componentId: "sc-n3w53t-0"
1840
- })`&:not([hidden]){display:flex;}flex-direction:column;width:max-content;min-width:min-content;will-change:transform;`, MotionFlex = (0, styled_components.styled)(motion_react.motion.create(Flex)).withConfig({
1841
- displayName: "MotionFlex",
1842
- componentId: "sc-n3w53t-1"
1843
- })`will-change:opacity;`, PopoverCard = (0, react.forwardRef)(function PopoverCard(props, ref) {
1844
- let $ = (0, react_compiler_runtime.c)(66), animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, originX, originY, overflow, padding, placement, radius, restProps, scheme, shadow, strategy, style, tone, width, xProp, yProp;
1845
- $[0] === props ? (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], originX = $[8], originY = $[9], overflow = $[10], padding = $[11], placement = $[12], radius = $[13], restProps = $[14], scheme = $[15], shadow = $[16], strategy = $[17], style = $[18], tone = $[19], width = $[20], xProp = $[21], yProp = $[22]) : ({__unstable_margins: marginsProp, animate, arrow, arrowRef, arrowX, arrowY, children, padding, placement, originX, originY, overflow, radius, scheme, shadow, strategy, style, tone, width, x: xProp, y: yProp, ...restProps} = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = originX, $[9] = originY, $[10] = overflow, $[11] = padding, $[12] = placement, $[13] = radius, $[14] = restProps, $[15] = scheme, $[16] = shadow, $[17] = strategy, $[18] = style, $[19] = tone, $[20] = width, $[21] = xProp, $[22] = yProp);
1846
- let { zIndex } = useLayer(), margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t0 = animate ? "transform" : void 0, t1;
1847
- $[23] !== originX || $[24] !== originY || $[25] !== strategy || $[26] !== style || $[27] !== t0 || $[28] !== width || $[29] !== x || $[30] !== y || $[31] !== zIndex ? (t1 = {
1848
- left: x,
1849
- originX,
1850
- originY,
1851
- position: strategy,
1852
- top: y,
1853
- width,
1854
- zIndex,
1855
- willChange: t0,
1856
- ...style
1857
- }, $[23] = originX, $[24] = originY, $[25] = strategy, $[26] = style, $[27] = t0, $[28] = width, $[29] = x, $[30] = y, $[31] = zIndex, $[32] = t1) : t1 = $[32];
1858
- let rootStyle = t1, t2 = arrowX === null ? void 0 : arrowX, t3 = arrowY === null ? void 0 : arrowY, t4;
1859
- $[33] !== t2 || $[34] !== t3 ? (t4 = {
1860
- left: t2,
1861
- top: t3,
1862
- right: void 0,
1863
- bottom: void 0
1864
- }, $[33] = t2, $[34] = t3, $[35] = t4) : t4 = $[35];
1865
- let arrowStyle = t4, t5 = restProps, t6;
1866
- $[36] === animate ? t6 = $[37] : (t6 = animate ? ["hidden", "initial"] : void 0, $[36] = animate, $[37] = t6);
1867
- let t7;
1868
- $[38] === animate ? t7 = $[39] : (t7 = animate ? ["visible", "scaleIn"] : void 0, $[38] = animate, $[39] = t7);
1869
- let t8;
1870
- $[40] === animate ? t8 = $[41] : (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[40] = animate, $[41] = t8);
1871
- let t9;
1872
- $[42] !== children || $[43] !== padding ? (t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Flex, {
1873
- direction: "column",
1874
- flex: 1,
1875
- padding,
1876
- children
1877
- }), $[42] = children, $[43] = padding, $[44] = t9) : t9 = $[44];
1878
- let t10;
1879
- $[45] !== overflow || $[46] !== t9 ? (t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MotionFlex, {
1880
- "data-ui": "Popover__wrapper",
1881
- direction: "column",
1882
- flex: 1,
1883
- overflow,
1884
- variants: POPOVER_MOTION_PROPS.children,
1885
- transition: POPOVER_MOTION_PROPS.transition,
1886
- children: t9
1887
- }), $[45] = overflow, $[46] = t9, $[47] = t10) : t10 = $[47];
1888
- let t11;
1889
- $[48] !== arrow || $[49] !== arrowRef || $[50] !== arrowStyle ? (t11 = arrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Arrow, {
1890
- ref: arrowRef,
1891
- style: arrowStyle,
1892
- width: 19,
1893
- height: 8,
1894
- radius: 2
1895
- }), $[48] = arrow, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t11) : t11 = $[51];
1896
- let t12;
1897
- return $[52] !== placement || $[53] !== radius || $[54] !== ref || $[55] !== rootStyle || $[56] !== scheme || $[57] !== shadow || $[58] !== t10 || $[59] !== t11 || $[60] !== t5 || $[61] !== t6 || $[62] !== t7 || $[63] !== t8 || $[64] !== tone ? (t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionCard$1, {
1898
- "data-ui": "Popover",
1899
- ...t5,
1900
- "data-placement": placement,
1901
- radius,
1902
- ref,
1903
- scheme,
1904
- shadow,
1905
- sizing: "border",
1906
- style: rootStyle,
1907
- tone,
1908
- variants: POPOVER_MOTION_PROPS.card,
1909
- transition: POPOVER_MOTION_PROPS.transition,
1910
- initial: t6,
1911
- animate: t7,
1912
- exit: t8,
1913
- children: [t10, t11]
1914
- }), $[52] = placement, $[53] = radius, $[54] = ref, $[55] = rootStyle, $[56] = scheme, $[57] = shadow, $[58] = t10, $[59] = t11, $[60] = t5, $[61] = t6, $[62] = t7, $[63] = t8, $[64] = tone, $[65] = t12) : t12 = $[65], t12;
1915
- }), ViewportOverlay = () => {
1916
- let $ = (0, react_compiler_runtime.c)(2), { zIndex } = useLayer(), t0;
1917
- return $[0] === zIndex ? t0 = $[1] : (t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1918
- height: "100vh",
1919
- inset: 0,
1920
- position: "fixed",
1921
- width: "100vw",
1922
- zIndex
1923
- } }), $[0] = zIndex, $[1] = t0), t0;
1924
- }, Popover = (0, react.forwardRef)(function Popover(props, forwardedRef) {
1925
- let $ = (0, react_compiler_runtime.c)(126), { container, layer } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), _boundaryElement, _fallbackPlacements, _floatingBoundary, _referenceBoundary, _zOffsetProp, childProp, content, disabled, matchReferenceWidth, modal, open, paddingProp, portal, referenceElement, restProps, scheme, t0, t1, t10, t11, t2, t3, t4, t5, t6, t7, t8, t9, updateRef;
1926
- if ($[0] !== props) {
1927
- let { __unstable_margins: t12, animate: t13, arrow: t14, boundaryElement: t15, children: t16, constrainSize: t17, content: t18, disabled: t19, fallbackPlacements: t20, matchReferenceWidth: t21, floatingBoundary: t22, modal: t23, onActivate, open: t24, overflow: t25, padding: t26, placement: t27, placementStrategy: t28, portal: t29, preventOverflow: t30, radius: t31, referenceBoundary: t32, referenceElement: t33, scheme: t34, shadow: t35, tone: t36, width: t37, zOffset: t38, updateRef: t39, ...t40 } = props;
1928
- t0 = t12, t1 = t13, t2 = t14, _boundaryElement = t15, childProp = t16, t3 = t17, content = t18, disabled = t19, _fallbackPlacements = t20, matchReferenceWidth = t21, _floatingBoundary = t22, modal = t23, open = t24, t4 = t25, paddingProp = t26, t5 = t27, t6 = t28, portal = t29, t7 = t30, t8 = t31, _referenceBoundary = t32, referenceElement = t33, scheme = t34, t9 = t35, t10 = t36, t11 = t37, _zOffsetProp = t38, updateRef = t39, restProps = t40, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacements, $[3] = _floatingBoundary, $[4] = _referenceBoundary, $[5] = _zOffsetProp, $[6] = childProp, $[7] = content, $[8] = disabled, $[9] = matchReferenceWidth, $[10] = modal, $[11] = open, $[12] = paddingProp, $[13] = portal, $[14] = referenceElement, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t10, $[20] = t11, $[21] = t2, $[22] = t3, $[23] = t4, $[24] = t5, $[25] = t6, $[26] = t7, $[27] = t8, $[28] = t9, $[29] = updateRef;
1929
- } else _boundaryElement = $[1], _fallbackPlacements = $[2], _floatingBoundary = $[3], _referenceBoundary = $[4], _zOffsetProp = $[5], childProp = $[6], content = $[7], disabled = $[8], matchReferenceWidth = $[9], modal = $[10], open = $[11], paddingProp = $[12], portal = $[13], referenceElement = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t10 = $[19], t11 = $[20], t2 = $[21], t3 = $[22], t4 = $[23], t5 = $[24], t6 = $[25], t7 = $[26], t8 = $[27], t9 = $[28], updateRef = $[29];
1930
- let margins = t0 === void 0 ? DEFAULT_POPOVER_MARGINS : t0, _animate = t1 !== void 0 && t1, arrowProp = t2 !== void 0 && t2, constrainSize = t3 !== void 0 && t3, overflow = t4 === void 0 ? "hidden" : t4, placementProp = t5 === void 0 ? "bottom" : t5, placementStrategy = t6 === void 0 ? "flip" : t6, preventOverflow = t7 === void 0 || t7, radiusProp = t8 === void 0 ? 3 : t8, shadowProp = t9 === void 0 ? 3 : t9, tone = t10 === void 0 ? "inherit" : t10, widthProp = t11 === void 0 ? "auto" : t11, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? props.boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? props.boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = !usePrefersReducedMotion() && _animate, boundarySize = useElementSize(boundaryElement)?.border, t12;
1931
- $[30] === paddingProp ? t12 = $[31] : (t12 = _getArrayProp(paddingProp), $[30] = paddingProp, $[31] = t12);
1932
- let padding = t12, t13;
1933
- $[32] === radiusProp ? t13 = $[33] : (t13 = _getArrayProp(radiusProp), $[32] = radiusProp, $[33] = t13);
1934
- let radius = t13, t14;
1935
- $[34] === shadowProp ? t14 = $[35] : (t14 = _getArrayProp(shadowProp), $[34] = shadowProp, $[35] = t14);
1936
- let shadow = t14, widthArrayProp = _getArrayProp(widthProp), t15;
1937
- $[36] === zOffsetProp ? t15 = $[37] : (t15 = _getArrayProp(zOffsetProp), $[36] = zOffsetProp, $[37] = t15);
1938
- let zOffset = t15, ref = (0, react.useRef)(null), arrowRef = (0, react.useRef)(null), t16;
1939
- $[38] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => ref.current, $[38] = t16) : t16 = $[38], (0, react.useImperativeHandle)(forwardedRef, t16);
1940
- let mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
1941
- container,
1942
- mediaIndex,
1351
+ function moveTowardsLength(movingPoint, targetPoint, amount) {
1352
+ let width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
1353
+ return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
1354
+ }
1355
+ function moveTowardsFractional(movingPoint, targetPoint, fraction) {
1356
+ return {
1357
+ x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
1358
+ y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
1359
+ };
1360
+ }
1361
+ function getRoundedCommands(points) {
1362
+ let len = points.length, cmds = [];
1363
+ for (let i = 0; i < len; i += 1) {
1364
+ let point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
1365
+ if (prevPoint && point.radius) {
1366
+ let curveStart = moveTowardsLength(point, prevPoint, point.radius), curveEnd = moveTowardsLength(point, nextPoint, point.radius), startControl = moveTowardsFractional(curveStart, point, .5), endControl = moveTowardsFractional(point, curveEnd, .5);
1367
+ cmds.push({
1368
+ type: "point",
1369
+ ...curveStart
1370
+ }), cmds.push({
1371
+ type: "curve",
1372
+ curveEnd,
1373
+ startControl,
1374
+ endControl
1375
+ });
1376
+ } else cmds.push({
1377
+ type: "point",
1378
+ ...point
1379
+ });
1380
+ }
1381
+ return cmds;
1382
+ }
1383
+ function compileCommands(cmds) {
1384
+ return cmds.map((n, idx) => n.type === "point" ? `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}` : n.type === "curve" ? `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}` : "").join(" ");
1385
+ }
1386
+ const StyledArrow = /* @__PURE__ */ styled_components.styled.div.withConfig({
1387
+ displayName: "StyledArrow",
1388
+ componentId: "sc-ivw6of-0"
1389
+ })(({ $w: w }) => styled_components.css`position:absolute;width:${w}px;height:${w}px;:empty + &{display:none;}& > svg{display:block;line-height:0;transform-origin:${w / 2}px ${w / 2}px;}[data-placement^='top'] > &{bottom:-${w}px;& > svg{transform:rotate(0);}}[data-placement^='right'] > &{left:-${w}px;& > svg{transform:rotate(90deg);}}[data-placement^='left'] > &{right:-${w}px;& > svg{transform:rotate(-90deg);}}[data-placement^='bottom'] > &{top:-${w}px;& > svg{transform:rotate(180deg);}}`), StrokePath = styled_components.styled.path.withConfig({
1390
+ displayName: "StrokePath",
1391
+ componentId: "sc-ivw6of-1"
1392
+ })`stroke:var(--card-shadow-outline-color);`, ShapePath = styled_components.styled.path.withConfig({
1393
+ displayName: "ShapePath",
1394
+ componentId: "sc-ivw6of-2"
1395
+ })`fill:var(--card-bg-color);`, Arrow = (0, react.forwardRef)(function Arrow(props, ref) {
1396
+ let $ = (0, react_compiler_runtime.c)(29), h, restProps, t0, w;
1397
+ $[0] === props ? (h = $[1], restProps = $[2], t0 = $[3], w = $[4]) : ({width: w, height: h, radius: t0, ...restProps} = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = t0, $[4] = w);
1398
+ let radius = t0 === void 0 ? 0 : t0, { card } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, t1;
1399
+ $[5] !== center || $[6] !== h || $[7] !== radius || $[8] !== w ? (t1 = compileCommands(getRoundedCommands([
1400
+ {
1401
+ x: 0,
1402
+ y: 0
1403
+ },
1404
+ {
1405
+ x: radius,
1406
+ y: 0,
1407
+ radius
1408
+ },
1409
+ {
1410
+ x: center,
1411
+ y: h - 1,
1412
+ radius
1413
+ },
1414
+ {
1415
+ x: w - radius,
1416
+ y: 0,
1417
+ radius
1418
+ },
1419
+ {
1420
+ x: w,
1421
+ y: 0
1422
+ }
1423
+ ])), $[5] = center, $[6] = h, $[7] = radius, $[8] = w, $[9] = t1) : t1 = $[9];
1424
+ let path = t1, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t2 = `0 0 ${w} ${w}`, t3;
1425
+ $[10] !== strokeWidth || $[11] !== w ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("mask", {
1426
+ id: "stroke-mask",
1427
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
1428
+ x: 0,
1429
+ y: strokeWidth,
1430
+ width: w,
1431
+ height: w,
1432
+ fill: "white"
1433
+ })
1434
+ }), $[10] = strokeWidth, $[11] = w, $[12] = t3) : t3 = $[12];
1435
+ let t4 = strokeWidth * 2, t5;
1436
+ $[13] !== strokePath || $[14] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrokePath, {
1437
+ d: strokePath,
1438
+ mask: "url(#stroke-mask)",
1439
+ strokeWidth: t4
1440
+ }), $[13] = strokePath, $[14] = t4, $[15] = t5) : t5 = $[15];
1441
+ let t6;
1442
+ $[16] === fillPath ? t6 = $[17] : (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShapePath, { d: fillPath }), $[16] = fillPath, $[17] = t6);
1443
+ let t7;
1444
+ $[18] !== t2 || $[19] !== t3 || $[20] !== t5 || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1445
+ width: w,
1446
+ height: w,
1447
+ viewBox: t2,
1448
+ children: [
1449
+ t3,
1450
+ t5,
1451
+ t6
1452
+ ]
1453
+ }), $[18] = t2, $[19] = t3, $[20] = t5, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23];
1454
+ let t8;
1455
+ return $[24] !== ref || $[25] !== restProps || $[26] !== t7 || $[27] !== w ? (t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledArrow, {
1456
+ ...restProps,
1457
+ $w: w,
1458
+ ref,
1459
+ children: t7
1460
+ }), $[24] = ref, $[25] = restProps, $[26] = t7, $[27] = w, $[28] = t8) : t8 = $[28], t8;
1461
+ }), MotionCard$1 = (0, styled_components.styled)(motion_react.motion.create(Card)).withConfig({
1462
+ displayName: "MotionCard",
1463
+ componentId: "sc-tq6s8o-0"
1464
+ })`&:not([hidden]){display:flex;}flex-direction:column;width:max-content;min-width:min-content;will-change:transform;`, MotionFlex = (0, styled_components.styled)(motion_react.motion.create(Flex)).withConfig({
1465
+ displayName: "MotionFlex",
1466
+ componentId: "sc-tq6s8o-1"
1467
+ })`will-change:opacity;`, PopoverCard = (0, react.forwardRef)(function PopoverCard(props, ref) {
1468
+ let $ = (0, react_compiler_runtime.c)(66), animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, originX, originY, overflow, padding, placement, radius, restProps, scheme, shadow, strategy, style, tone, width, xProp, yProp;
1469
+ $[0] === props ? (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], originX = $[8], originY = $[9], overflow = $[10], padding = $[11], placement = $[12], radius = $[13], restProps = $[14], scheme = $[15], shadow = $[16], strategy = $[17], style = $[18], tone = $[19], width = $[20], xProp = $[21], yProp = $[22]) : ({__unstable_margins: marginsProp, animate, arrow, arrowRef, arrowX, arrowY, children, padding, placement, originX, originY, overflow, radius, scheme, shadow, strategy, style, tone, width, x: xProp, y: yProp, ...restProps} = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = originX, $[9] = originY, $[10] = overflow, $[11] = padding, $[12] = placement, $[13] = radius, $[14] = restProps, $[15] = scheme, $[16] = shadow, $[17] = strategy, $[18] = style, $[19] = tone, $[20] = width, $[21] = xProp, $[22] = yProp);
1470
+ let { zIndex } = useLayer(), margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t0 = animate ? "transform" : void 0, t1;
1471
+ $[23] !== originX || $[24] !== originY || $[25] !== strategy || $[26] !== style || $[27] !== t0 || $[28] !== width || $[29] !== x || $[30] !== y || $[31] !== zIndex ? (t1 = {
1472
+ left: x,
1473
+ originX,
1474
+ originY,
1475
+ position: strategy,
1476
+ top: y,
1477
+ width,
1478
+ zIndex,
1479
+ willChange: t0,
1480
+ ...style
1481
+ }, $[23] = originX, $[24] = originY, $[25] = strategy, $[26] = style, $[27] = t0, $[28] = width, $[29] = x, $[30] = y, $[31] = zIndex, $[32] = t1) : t1 = $[32];
1482
+ let rootStyle = t1, t2 = arrowX === null ? void 0 : arrowX, t3 = arrowY === null ? void 0 : arrowY, t4;
1483
+ $[33] !== t2 || $[34] !== t3 ? (t4 = {
1484
+ left: t2,
1485
+ top: t3,
1486
+ right: void 0,
1487
+ bottom: void 0
1488
+ }, $[33] = t2, $[34] = t3, $[35] = t4) : t4 = $[35];
1489
+ let arrowStyle = t4, t5 = restProps, t6;
1490
+ $[36] === animate ? t6 = $[37] : (t6 = animate ? ["hidden", "initial"] : void 0, $[36] = animate, $[37] = t6);
1491
+ let t7;
1492
+ $[38] === animate ? t7 = $[39] : (t7 = animate ? ["visible", "scaleIn"] : void 0, $[38] = animate, $[39] = t7);
1493
+ let t8;
1494
+ $[40] === animate ? t8 = $[41] : (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[40] = animate, $[41] = t8);
1495
+ let t9;
1496
+ $[42] !== children || $[43] !== padding ? (t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Flex, {
1497
+ direction: "column",
1498
+ flex: 1,
1499
+ padding,
1500
+ children
1501
+ }), $[42] = children, $[43] = padding, $[44] = t9) : t9 = $[44];
1502
+ let t10;
1503
+ $[45] !== overflow || $[46] !== t9 ? (t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MotionFlex, {
1504
+ "data-ui": "Popover__wrapper",
1505
+ direction: "column",
1506
+ flex: 1,
1507
+ overflow,
1508
+ variants: POPOVER_MOTION_PROPS.children,
1509
+ transition: POPOVER_MOTION_PROPS.transition,
1510
+ children: t9
1511
+ }), $[45] = overflow, $[46] = t9, $[47] = t10) : t10 = $[47];
1512
+ let t11;
1513
+ $[48] !== arrow || $[49] !== arrowRef || $[50] !== arrowStyle ? (t11 = arrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Arrow, {
1514
+ ref: arrowRef,
1515
+ style: arrowStyle,
1516
+ width: 19,
1517
+ height: 8,
1518
+ radius: 2
1519
+ }), $[48] = arrow, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t11) : t11 = $[51];
1520
+ let t12;
1521
+ return $[52] !== placement || $[53] !== radius || $[54] !== ref || $[55] !== rootStyle || $[56] !== scheme || $[57] !== shadow || $[58] !== t10 || $[59] !== t11 || $[60] !== t5 || $[61] !== t6 || $[62] !== t7 || $[63] !== t8 || $[64] !== tone ? (t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionCard$1, {
1522
+ "data-ui": "Popover",
1523
+ ...t5,
1524
+ "data-placement": placement,
1525
+ radius,
1526
+ ref,
1527
+ scheme,
1528
+ shadow,
1529
+ sizing: "border",
1530
+ style: rootStyle,
1531
+ tone,
1532
+ variants: POPOVER_MOTION_PROPS.card,
1533
+ transition: POPOVER_MOTION_PROPS.transition,
1534
+ initial: t6,
1535
+ animate: t7,
1536
+ exit: t8,
1537
+ children: [t10, t11]
1538
+ }), $[52] = placement, $[53] = radius, $[54] = ref, $[55] = rootStyle, $[56] = scheme, $[57] = shadow, $[58] = t10, $[59] = t11, $[60] = t5, $[61] = t6, $[62] = t7, $[63] = t8, $[64] = tone, $[65] = t12) : t12 = $[65], t12;
1539
+ }), ViewportOverlay = () => {
1540
+ let $ = (0, react_compiler_runtime.c)(2), { zIndex } = useLayer(), t0;
1541
+ return $[0] === zIndex ? t0 = $[1] : (t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1542
+ height: "100vh",
1543
+ inset: 0,
1544
+ position: "fixed",
1545
+ width: "100vw",
1546
+ zIndex
1547
+ } }), $[0] = zIndex, $[1] = t0), t0;
1548
+ }, Popover = (0, react.forwardRef)(function Popover(props, forwardedRef) {
1549
+ let $ = (0, react_compiler_runtime.c)(126), { container, layer } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), _boundaryElement, _fallbackPlacements, _floatingBoundary, _referenceBoundary, _zOffsetProp, childProp, content, disabled, matchReferenceWidth, modal, open, paddingProp, portal, referenceElement, restProps, scheme, t0, t1, t10, t11, t2, t3, t4, t5, t6, t7, t8, t9, updateRef;
1550
+ if ($[0] !== props) {
1551
+ let { __unstable_margins: t12, animate: t13, arrow: t14, boundaryElement: t15, children: t16, constrainSize: t17, content: t18, disabled: t19, fallbackPlacements: t20, matchReferenceWidth: t21, floatingBoundary: t22, modal: t23, onActivate, open: t24, overflow: t25, padding: t26, placement: t27, placementStrategy: t28, portal: t29, preventOverflow: t30, radius: t31, referenceBoundary: t32, referenceElement: t33, scheme: t34, shadow: t35, tone: t36, width: t37, zOffset: t38, updateRef: t39, ...t40 } = props;
1552
+ t0 = t12, t1 = t13, t2 = t14, _boundaryElement = t15, childProp = t16, t3 = t17, content = t18, disabled = t19, _fallbackPlacements = t20, matchReferenceWidth = t21, _floatingBoundary = t22, modal = t23, open = t24, t4 = t25, paddingProp = t26, t5 = t27, t6 = t28, portal = t29, t7 = t30, t8 = t31, _referenceBoundary = t32, referenceElement = t33, scheme = t34, t9 = t35, t10 = t36, t11 = t37, _zOffsetProp = t38, updateRef = t39, restProps = t40, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacements, $[3] = _floatingBoundary, $[4] = _referenceBoundary, $[5] = _zOffsetProp, $[6] = childProp, $[7] = content, $[8] = disabled, $[9] = matchReferenceWidth, $[10] = modal, $[11] = open, $[12] = paddingProp, $[13] = portal, $[14] = referenceElement, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t10, $[20] = t11, $[21] = t2, $[22] = t3, $[23] = t4, $[24] = t5, $[25] = t6, $[26] = t7, $[27] = t8, $[28] = t9, $[29] = updateRef;
1553
+ } else _boundaryElement = $[1], _fallbackPlacements = $[2], _floatingBoundary = $[3], _referenceBoundary = $[4], _zOffsetProp = $[5], childProp = $[6], content = $[7], disabled = $[8], matchReferenceWidth = $[9], modal = $[10], open = $[11], paddingProp = $[12], portal = $[13], referenceElement = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t10 = $[19], t11 = $[20], t2 = $[21], t3 = $[22], t4 = $[23], t5 = $[24], t6 = $[25], t7 = $[26], t8 = $[27], t9 = $[28], updateRef = $[29];
1554
+ let margins = t0 === void 0 ? DEFAULT_POPOVER_MARGINS : t0, _animate = t1 !== void 0 && t1, arrowProp = t2 !== void 0 && t2, constrainSize = t3 !== void 0 && t3, overflow = t4 === void 0 ? "hidden" : t4, placementProp = t5 === void 0 ? "bottom" : t5, placementStrategy = t6 === void 0 ? "flip" : t6, preventOverflow = t7 === void 0 || t7, radiusProp = t8 === void 0 ? 3 : t8, shadowProp = t9 === void 0 ? 3 : t9, tone = t10 === void 0 ? "inherit" : t10, widthProp = t11 === void 0 ? "auto" : t11, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? props.boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? props.boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = !usePrefersReducedMotion() && _animate, boundarySize = useElementSize(boundaryElement)?.border, t12;
1555
+ $[30] === paddingProp ? t12 = $[31] : (t12 = _getArrayProp(paddingProp), $[30] = paddingProp, $[31] = t12);
1556
+ let padding = t12, t13;
1557
+ $[32] === radiusProp ? t13 = $[33] : (t13 = _getArrayProp(radiusProp), $[32] = radiusProp, $[33] = t13);
1558
+ let radius = t13, t14;
1559
+ $[34] === shadowProp ? t14 = $[35] : (t14 = _getArrayProp(shadowProp), $[34] = shadowProp, $[35] = t14);
1560
+ let shadow = t14, widthArrayProp = _getArrayProp(widthProp), t15;
1561
+ $[36] === zOffsetProp ? t15 = $[37] : (t15 = _getArrayProp(zOffsetProp), $[36] = zOffsetProp, $[37] = t15);
1562
+ let zOffset = t15, ref = (0, react.useRef)(null), arrowRef = (0, react.useRef)(null), t16;
1563
+ $[38] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => ref.current, $[38] = t16) : t16 = $[38], (0, react.useImperativeHandle)(forwardedRef, t16);
1564
+ let mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
1565
+ container,
1566
+ mediaIndex,
1943
1567
  width: widthArrayProp
1944
1568
  }), widthRef = (0, react.useRef)(width), t17, t18;
1945
1569
  $[39] === width ? (t17 = $[40], t18 = $[41]) : (t17 = () => {
@@ -2133,12 +1757,12 @@ function stackBaseStyle() {
2133
1757
  return BASE_STYLE;
2134
1758
  }
2135
1759
  function responsiveStackSpaceStyle(props) {
2136
- let { media, space } = require_theme.X(props.theme);
1760
+ let { media, space } = require_getScopedTheme.i(props.theme);
2137
1761
  return _responsive(media, props.$space, (spaceIndex) => ({ gridGap: rem(space[spaceIndex]) }));
2138
1762
  }
2139
1763
  const StyledStack = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
2140
1764
  displayName: "StyledStack",
2141
- componentId: "sc-0k6050-0"
1765
+ componentId: "sc-ux0lrj-0"
2142
1766
  })(stackBaseStyle, responsiveStackSpaceStyle), Stack = (0, react.forwardRef)(function Stack(props, ref) {
2143
1767
  let $ = (0, react_compiler_runtime.c)(13), as, deprecated_space, gap, restProps;
2144
1768
  $[0] === props ? (as = $[1], deprecated_space = $[2], gap = $[3], restProps = $[4]) : ({as, gap, space: deprecated_space, ...restProps} = props, $[0] = props, $[1] = as, $[2] = deprecated_space, $[3] = gap, $[4] = restProps);
@@ -2153,64 +1777,139 @@ const StyledStack = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfi
2153
1777
  forwardedAs: as,
2154
1778
  ref
2155
1779
  }), $[7] = as, $[8] = ref, $[9] = restProps, $[10] = t0, $[11] = t1, $[12] = t2) : t2 = $[12], t2;
2156
- }), CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, StyledTextInput = /* @__PURE__ */ (0, styled_components.styled)(Card).attrs({ forwardedAs: "span" }).withConfig({
2157
- displayName: "StyledTextInput",
2158
- componentId: "sc-iuvxo7-0"
2159
- })(textInputRootStyle), InputRoot = styled_components.styled.span.withConfig({
2160
- displayName: "InputRoot",
2161
- componentId: "sc-iuvxo7-1"
2162
- })`flex:1;min-width:0;display:block;position:relative;`, Prefix = (0, styled_components.styled)(Card).attrs({ forwardedAs: "span" }).withConfig({
2163
- displayName: "Prefix",
2164
- componentId: "sc-iuvxo7-2"
2165
- })`border-top-right-radius:0;border-bottom-right-radius:0;& > span{display:block;margin:-1px;}`, Suffix = (0, styled_components.styled)(Card).attrs({ forwardedAs: "span" }).withConfig({
2166
- displayName: "Suffix",
2167
- componentId: "sc-iuvxo7-3"
2168
- })`border-top-left-radius:0;border-bottom-left-radius:0;& > span{display:block;margin:-1px;}`, Input = /* @__PURE__ */ styled_components.styled.input.withConfig({
2169
- displayName: "Input",
2170
- componentId: "sc-iuvxo7-4"
2171
- })(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation = /* @__PURE__ */ styled_components.styled.span.withConfig({
2172
- displayName: "Presentation",
2173
- componentId: "sc-iuvxo7-5"
2174
- })(responsiveRadiusStyle, textInputRepresentationStyle), LeftBox = (0, styled_components.styled)(Box).withConfig({
2175
- displayName: "LeftBox",
2176
- componentId: "sc-iuvxo7-6"
2177
- })`position:absolute;top:0;left:0;`, RightBox = (0, styled_components.styled)(Box).withConfig({
2178
- displayName: "RightBox",
2179
- componentId: "sc-iuvxo7-7"
2180
- })`position:absolute;top:0;right:0;`, RightCard = (0, styled_components.styled)(Card).withConfig({
2181
- displayName: "RightCard",
2182
- componentId: "sc-iuvxo7-8"
2183
- })`background-color:transparent;position:absolute;top:0;right:0;`, TextInputClearButton = /* @__PURE__ */ (0, styled_components.styled)(Button).withConfig({
2184
- displayName: "TextInputClearButton",
2185
- componentId: "sc-iuvxo7-9"
2186
- })({ "&:not([hidden])": { display: "block" } }), TextInput = (0, react.forwardRef)(function TextInput(props, forwardedRef) {
2187
- let $ = (0, react_compiler_runtime.c)(93), IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, gap, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
2188
- $[0] === props ? (IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], clearButton = $[4], customValidity = $[5], gap = $[6], onClear = $[7], prefix = $[8], readOnly = $[9], restProps = $[10], suffix = $[11], t0 = $[12], t1 = $[13], t2 = $[14], t3 = $[15], t4 = $[16], t5 = $[17], t6 = $[18], weight = $[19]) : ({__unstable_disableFocusRing, border: t0, clearButton, disabled: t1, fontSize: t2, gap, icon: IconComponent, iconRight: IconRightComponent, onClear, padding: t3, prefix, radius: t4, readOnly, space: t5, suffix, customValidity, type: t6, weight, ...restProps} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = clearButton, $[5] = customValidity, $[6] = gap, $[7] = onClear, $[8] = prefix, $[9] = readOnly, $[10] = restProps, $[11] = suffix, $[12] = t0, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = weight);
2189
- let border = t0 === void 0 || t0, disabled = t1 !== void 0 && t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, deprecated_space = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = (0, react.useRef)(null), rootTheme = useRootTheme(), t7;
2190
- $[20] === fontSizeProp ? t7 = $[21] : (t7 = _getArrayProp(fontSizeProp), $[20] = fontSizeProp, $[21] = t7);
2191
- let fontSize = t7, t8;
2192
- $[22] === paddingProp ? t8 = $[23] : (t8 = _getArrayProp(paddingProp), $[22] = paddingProp, $[23] = t8);
2193
- let padding = t8, t9;
2194
- $[24] === radiusProp ? t9 = $[25] : (t9 = _getArrayProp(radiusProp), $[24] = radiusProp, $[25] = t9);
2195
- let radius = t9, t10 = gap === void 0 ? deprecated_space : gap, t11;
2196
- $[26] === t10 ? t11 = $[27] : (t11 = _getArrayProp(t10), $[26] = t10, $[27] = t11);
2197
- let space = t11, $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix, t12;
2198
- $[28] === Symbol.for("react.memo_cache_sentinel") ? (t12 = () => ref.current, $[28] = t12) : t12 = $[28], (0, react.useImperativeHandle)(forwardedRef, t12), useCustomValidity(ref, customValidity);
2199
- let handleClearMouseDown = _temp$2, t13;
2200
- $[29] === onClear ? t13 = $[30] : (t13 = (event_0) => {
2201
- event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
2202
- }, $[29] = onClear, $[30] = t13);
2203
- let handleClearClick = t13, t14;
2204
- $[31] !== prefix || $[32] !== radius ? (t14 = prefix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Prefix, {
2205
- borderTop: !0,
2206
- borderLeft: !0,
2207
- borderBottom: !0,
2208
- radius,
2209
- sizing: "border",
2210
- tone: "inherit",
2211
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: prefix })
2212
- }), $[31] = prefix, $[32] = radius, $[33] = t14) : t14 = $[33];
2213
- let prefixNode = t14, t15 = border ? "" : void 0, t16;
1780
+ });
1781
+ /**
1782
+ * @beta
1783
+ */
1784
+ function useCustomValidity(ref, customValidity) {
1785
+ let $ = (0, react_compiler_runtime.c)(4), t0, t1;
1786
+ $[0] !== customValidity || $[1] !== ref ? (t0 = () => {
1787
+ ref.current?.setCustomValidity(customValidity || "");
1788
+ }, t1 = [customValidity, ref], $[0] = customValidity, $[1] = ref, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), (0, react.useEffect)(t0, t1);
1789
+ }
1790
+ function responsiveInputPaddingStyle(props) {
1791
+ let { $fontSize, $iconLeft, $iconRight, $padding, $space } = props, { font, media, space } = require_getScopedTheme.i(props.theme), len = Math.max($padding.length, $space.length, $fontSize.length), _padding = [], _space = [], _fontSize = [];
1792
+ for (let i = 0; i < len; i += 1) _fontSize[i] = $fontSize[i] === void 0 ? _fontSize[i - 1] : $fontSize[i], _padding[i] = $padding[i] === void 0 ? _padding[i - 1] : $padding[i], _space[i] = $space[i] === void 0 ? _space[i - 1] : $space[i];
1793
+ return _responsive(media, _padding, (_, i) => {
1794
+ let size = font.text.sizes[_fontSize[i]] || font.text.sizes[2], emSize = size.lineHeight - size.ascenderHeight - size.descenderHeight, p = space[_padding[i]], s = space[_space[i]], styles = {
1795
+ paddingTop: rem(p - size.ascenderHeight),
1796
+ paddingRight: rem(p),
1797
+ paddingBottom: rem(p - size.descenderHeight),
1798
+ paddingLeft: rem(p)
1799
+ };
1800
+ return $iconRight && (styles.paddingRight = rem(p + emSize + s)), $iconLeft && (styles.paddingLeft = rem(p + emSize + s)), styles;
1801
+ });
1802
+ }
1803
+ function responsiveInputPaddingIconRightStyle(props) {
1804
+ return responsiveInputPaddingStyle({
1805
+ ...props,
1806
+ $iconRight: !0
1807
+ });
1808
+ }
1809
+ const ROOT_STYLE = styled_components.css`&:not([hidden]){display:flex;}align-items:center;`;
1810
+ function textInputRootStyle() {
1811
+ return ROOT_STYLE;
1812
+ }
1813
+ function textInputBaseStyle(props) {
1814
+ let { $scheme, $tone, $weight } = props, { color, font } = require_getScopedTheme.i(props.theme);
1815
+ return styled_components.css`appearance:none;background:none;border:0;border-radius:0;outline:none;width:100%;box-sizing:border-box;font-family:${font.text.family};font-weight:${$weight && font.text.weights[$weight] || font.text.weights.regular};margin:0;position:relative;z-index:1;display:block;&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus,&:-webkit-autofill:active{-webkit-text-fill-color:var(--input-fg-color) !important;transition:background-color 5000s;transition-delay:86400s;}&[data-as='textarea']{resize:none;}color:var(--input-fg-color);&::placeholder{color:var(--input-placeholder-color);}&[data-scheme='${$scheme}'][data-tone='${$tone}']{--input-fg-color:${color.input.default.enabled.fg};--input-placeholder-color:${color.input.default.enabled.placeholder};&:not(:invalid):not(:disabled):not(:read-only){--input-fg-color:${color.input.default.enabled.fg};--input-placeholder-color:${color.input.default.enabled.placeholder};}&:not(:invalid):disabled{--input-fg-color:${color.input.default.disabled.fg};--input-placeholder-color:${color.input.default.disabled.placeholder};}&:invalid{--input-fg-color:${color.input.invalid.enabled.fg};--input-placeholder-color:${color.input.invalid.enabled.placeholder};}&:read-only{--input-fg-color:${color.input.default.readOnly.fg};--input-placeholder-color:${color.input.default.readOnly.placeholder};}}`;
1816
+ }
1817
+ function textInputFontSizeStyle(props) {
1818
+ let { font, media } = require_getScopedTheme.i(props.theme);
1819
+ return _responsive(media, props.$fontSize, (sizeIndex) => {
1820
+ let size = font.text.sizes[sizeIndex] || font.text.sizes[2];
1821
+ return {
1822
+ fontSize: rem(size.fontSize),
1823
+ lineHeight: `${size.lineHeight / size.fontSize}`
1824
+ };
1825
+ });
1826
+ }
1827
+ function textInputRepresentationStyle(props) {
1828
+ let { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = require_getScopedTheme.i(props.theme);
1829
+ return styled_components.css`--input-box-shadow:none;position:absolute;top:0;left:0;right:0;bottom:0;display:block;pointer-events:none;z-index:0;background-color:var(--card-bg-color);box-shadow:var(--input-box-shadow);border-top-left-radius:${$hasPrefix ? 0 : void 0};border-bottom-left-radius:${$hasPrefix ? 0 : void 0};border-top-right-radius:${$hasSuffix ? 0 : void 0};border-bottom-right-radius:${$hasSuffix ? 0 : void 0};&[data-scheme='${$scheme}'][data-tone='${$tone}']{--card-bg-color:${color.input.default.enabled.bg};--card-fg-color:${color.input.default.enabled.fg};*:not(:disabled) + &[data-border]{--input-box-shadow:${focusRingBorderStyle({
1830
+ color: color.input.default.enabled.border,
1831
+ width: input.border.width
1832
+ })};}*:not(:disabled):invalid + &{--card-bg-color:${color.input.invalid.enabled.bg};--card-fg-color:${color.input.invalid.enabled.fg};&[data-border]{--input-box-shadow:${focusRingBorderStyle({
1833
+ color: color.input.invalid.enabled.border,
1834
+ width: input.border.width
1835
+ })};}}*:not(:disabled):focus + &{&[data-border]{--input-box-shadow:${$unstableDisableFocusRing ? void 0 : focusRingStyle({
1836
+ border: {
1837
+ color: color.input.default.enabled.border,
1838
+ width: input.border.width
1839
+ },
1840
+ focusRing: input.text.focusRing
1841
+ })};}&:not([data-border]){--input-box-shadow:${$unstableDisableFocusRing ? void 0 : focusRingStyle({ focusRing: input.text.focusRing })};}}*:not(:invalid):disabled + &{--card-bg-color:${color.input.default.disabled.bg} !important;--card-fg-color:${color.input.default.disabled.fg} !important;--card-icon-color:${color.input.default.disabled.fg} !important;&[data-border]{--input-box-shadow:${focusRingBorderStyle({
1842
+ color: color.input.default.disabled.border,
1843
+ width: input.border.width
1844
+ })};}}*:invalid:disabled + &{--card-bg-color:${color.input.invalid.disabled.bg} !important;--card-fg-color:${color.input.invalid.disabled.fg} !important;--card-icon-color:${color.input.invalid.disabled.fg} !important;&[data-border]{--input-box-shadow:${focusRingBorderStyle({
1845
+ color: color.input.invalid.disabled.border,
1846
+ width: input.border.width
1847
+ })};}}*:not(:invalid):read-only + &{--card-bg-color:${color.input.default.readOnly.bg} !important;--card-fg-color:${color.input.default.readOnly.fg} !important;}*:invalid:read-only + &{--card-bg-color:${color.input.invalid.readOnly.bg} !important;--card-fg-color:${color.input.invalid.readOnly.fg} !important;}@media (hover:hover){*:not(:disabled):not(:read-only):not(:invalid):hover + &{--card-bg-color:${color.input.default.hovered.bg};--card-fg-color:${color.input.default.hovered.fg};}*:invalid:not(:disabled):not(:read-only):hover + &{--card-bg-color:${color.input.invalid.hovered.bg};--card-fg-color:${color.input.invalid.hovered.fg};}*:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border]{--input-box-shadow:${focusRingBorderStyle({
1848
+ color: color.input.default.hovered.border,
1849
+ width: input.border.width
1850
+ })};}*:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border]{--input-box-shadow:${focusRingBorderStyle({
1851
+ color: color.input.invalid.hovered.border,
1852
+ width: input.border.width
1853
+ })};}}}`;
1854
+ }
1855
+ const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, StyledTextInput = /* @__PURE__ */ (0, styled_components.styled)(Card).attrs({ forwardedAs: "span" }).withConfig({
1856
+ displayName: "StyledTextInput",
1857
+ componentId: "sc-7gzsyi-0"
1858
+ })(textInputRootStyle), InputRoot = styled_components.styled.span.withConfig({
1859
+ displayName: "InputRoot",
1860
+ componentId: "sc-7gzsyi-1"
1861
+ })`flex:1;min-width:0;display:block;position:relative;`, Prefix = (0, styled_components.styled)(Card).attrs({ forwardedAs: "span" }).withConfig({
1862
+ displayName: "Prefix",
1863
+ componentId: "sc-7gzsyi-2"
1864
+ })`border-top-right-radius:0;border-bottom-right-radius:0;& > span{display:block;margin:-1px;}`, Suffix = (0, styled_components.styled)(Card).attrs({ forwardedAs: "span" }).withConfig({
1865
+ displayName: "Suffix",
1866
+ componentId: "sc-7gzsyi-3"
1867
+ })`border-top-left-radius:0;border-bottom-left-radius:0;& > span{display:block;margin:-1px;}`, Input = /* @__PURE__ */ styled_components.styled.input.withConfig({
1868
+ displayName: "Input",
1869
+ componentId: "sc-7gzsyi-4"
1870
+ })(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation = /* @__PURE__ */ styled_components.styled.span.withConfig({
1871
+ displayName: "Presentation",
1872
+ componentId: "sc-7gzsyi-5"
1873
+ })(responsiveRadiusStyle, textInputRepresentationStyle), LeftBox = (0, styled_components.styled)(Box).withConfig({
1874
+ displayName: "LeftBox",
1875
+ componentId: "sc-7gzsyi-6"
1876
+ })`position:absolute;top:0;left:0;`, RightBox = (0, styled_components.styled)(Box).withConfig({
1877
+ displayName: "RightBox",
1878
+ componentId: "sc-7gzsyi-7"
1879
+ })`position:absolute;top:0;right:0;`, RightCard = (0, styled_components.styled)(Card).withConfig({
1880
+ displayName: "RightCard",
1881
+ componentId: "sc-7gzsyi-8"
1882
+ })`background-color:transparent;position:absolute;top:0;right:0;`, TextInputClearButton = /* @__PURE__ */ (0, styled_components.styled)(Button).withConfig({
1883
+ displayName: "TextInputClearButton",
1884
+ componentId: "sc-7gzsyi-9"
1885
+ })({ "&:not([hidden])": { display: "block" } }), TextInput = (0, react.forwardRef)(function TextInput(props, forwardedRef) {
1886
+ let $ = (0, react_compiler_runtime.c)(93), IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, gap, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
1887
+ $[0] === props ? (IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], clearButton = $[4], customValidity = $[5], gap = $[6], onClear = $[7], prefix = $[8], readOnly = $[9], restProps = $[10], suffix = $[11], t0 = $[12], t1 = $[13], t2 = $[14], t3 = $[15], t4 = $[16], t5 = $[17], t6 = $[18], weight = $[19]) : ({__unstable_disableFocusRing, border: t0, clearButton, disabled: t1, fontSize: t2, gap, icon: IconComponent, iconRight: IconRightComponent, onClear, padding: t3, prefix, radius: t4, readOnly, space: t5, suffix, customValidity, type: t6, weight, ...restProps} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = clearButton, $[5] = customValidity, $[6] = gap, $[7] = onClear, $[8] = prefix, $[9] = readOnly, $[10] = restProps, $[11] = suffix, $[12] = t0, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = weight);
1888
+ let border = t0 === void 0 || t0, disabled = t1 !== void 0 && t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, deprecated_space = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = (0, react.useRef)(null), rootTheme = useRootTheme(), t7;
1889
+ $[20] === fontSizeProp ? t7 = $[21] : (t7 = _getArrayProp(fontSizeProp), $[20] = fontSizeProp, $[21] = t7);
1890
+ let fontSize = t7, t8;
1891
+ $[22] === paddingProp ? t8 = $[23] : (t8 = _getArrayProp(paddingProp), $[22] = paddingProp, $[23] = t8);
1892
+ let padding = t8, t9;
1893
+ $[24] === radiusProp ? t9 = $[25] : (t9 = _getArrayProp(radiusProp), $[24] = radiusProp, $[25] = t9);
1894
+ let radius = t9, t10 = gap === void 0 ? deprecated_space : gap, t11;
1895
+ $[26] === t10 ? t11 = $[27] : (t11 = _getArrayProp(t10), $[26] = t10, $[27] = t11);
1896
+ let space = t11, $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix, t12;
1897
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t12 = () => ref.current, $[28] = t12) : t12 = $[28], (0, react.useImperativeHandle)(forwardedRef, t12), useCustomValidity(ref, customValidity);
1898
+ let handleClearMouseDown = _temp$6, t13;
1899
+ $[29] === onClear ? t13 = $[30] : (t13 = (event_0) => {
1900
+ event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
1901
+ }, $[29] = onClear, $[30] = t13);
1902
+ let handleClearClick = t13, t14;
1903
+ $[31] !== prefix || $[32] !== radius ? (t14 = prefix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Prefix, {
1904
+ borderTop: !0,
1905
+ borderLeft: !0,
1906
+ borderBottom: !0,
1907
+ radius,
1908
+ sizing: "border",
1909
+ tone: "inherit",
1910
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: prefix })
1911
+ }), $[31] = prefix, $[32] = radius, $[33] = t14) : t14 = $[33];
1912
+ let prefixNode = t14, t15 = border ? "" : void 0, t16;
2214
1913
  $[34] !== IconComponent || $[35] !== fontSize || $[36] !== padding ? (t16 = IconComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LeftBox, {
2215
1914
  padding,
2216
1915
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Text, {
@@ -2240,7 +1939,7 @@ const StyledStack = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfi
2240
1939
  children: [t16, t17]
2241
1940
  }), $[43] = $hasPrefix, $[44] = $hasSuffix, $[45] = __unstable_disableFocusRing, $[46] = radius, $[47] = rootTheme.scheme, $[48] = rootTheme.tone, $[49] = t15, $[50] = t16, $[51] = t17, $[52] = t18) : t18 = $[52];
2242
1941
  let presentationNode = t18, t19;
2243
- $[53] === padding ? t19 = $[54] : (t19 = padding.map(_temp2), $[53] = padding, $[54] = t19);
1942
+ $[53] === padding ? t19 = $[54] : (t19 = padding.map(_temp2$1), $[53] = padding, $[54] = t19);
2244
1943
  let clearButtonBoxPadding = t19, t20;
2245
1944
  $[55] === padding ? t20 = $[56] : (t20 = padding.map(_temp3), $[55] = padding, $[56] = t20);
2246
1945
  let clearButtonPadding = t20, clearButtonProps = typeof clearButton == "object" ? clearButton : EMPTY_RECORD, t21;
@@ -2308,410 +2007,190 @@ const StyledStack = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfi
2308
2007
  ]
2309
2008
  }), $[88] = prefixNode, $[89] = rootTheme.tone, $[90] = suffixNode, $[91] = t25, $[92] = t26) : t26 = $[92], t26;
2310
2009
  });
2311
- function _temp$2(event) {
2010
+ function _temp$6(event) {
2312
2011
  event.preventDefault(), event.stopPropagation();
2313
2012
  }
2314
- function _temp2(v) {
2013
+ function _temp2$1(v) {
2315
2014
  return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
2316
2015
  }
2317
2016
  function _temp3(v_0) {
2318
2017
  return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
2319
2018
  }
2320
2019
  /**
2321
- * @beta
2020
+ * @public
2322
2021
  */
2323
- function useDelayedState(initialState) {
2324
- let $ = (0, react_compiler_runtime.c)(5), [state, setState] = (0, react.useState)(initialState), delayedAction = (0, react.useRef)(void 0), t0;
2325
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (nextState, delay) => {
2326
- let action = () => {
2327
- setState(nextState);
2022
+ function useClickOutsideEvent(listener, t0, boundaryElement) {
2023
+ let $ = (0, react_compiler_runtime.c)(9), elementsArg = t0 === void 0 ? _temp$5 : t0, t1;
2024
+ $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
2025
+ if (!listener) return;
2026
+ let target = evt.target;
2027
+ if (!(target instanceof Node)) return;
2028
+ let resolvedBoundaryElement = boundaryElement?.();
2029
+ if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target)) return;
2030
+ let elements = elementsArg().flat();
2031
+ for (let el of elements) if (el && (target === el || el.contains(target))) return;
2032
+ listener(evt);
2033
+ }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
2034
+ let onEvent = (0, use_effect_event.useEffectEvent)(t1), hasListener = !!listener, t2;
2035
+ $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
2036
+ if (!hasListener) return;
2037
+ let handleEvent = (evt_0) => onEvent(evt_0);
2038
+ return document.addEventListener("mousedown", handleEvent), () => {
2039
+ document.removeEventListener("mousedown", handleEvent);
2328
2040
  };
2329
- if (delayedAction.current &&= (clearTimeout(delayedAction.current), void 0), !delay) return action();
2330
- delayedAction.current = setTimeout(action, delay);
2331
- }, $[0] = t0) : t0 = $[0];
2332
- let onStateChange = t0, t1, t2;
2333
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => () => {
2334
- delayedAction.current && clearTimeout(delayedAction.current);
2335
- }, t2 = [], $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), (0, react.useEffect)(t1, t2);
2041
+ }, $[4] = hasListener, $[5] = onEvent, $[6] = t2) : t2 = $[6];
2336
2042
  let t3;
2337
- return $[3] === state ? t3 = $[4] : (t3 = [state, onStateChange], $[3] = state, $[4] = t3), t3;
2043
+ $[7] === hasListener ? t3 = $[8] : (t3 = [hasListener], $[7] = hasListener, $[8] = t3), (0, react.useEffect)(t2, t3), (0, react.useDebugValue)(listener ? "MouseDown On" : "MouseDown Off");
2044
+ }
2045
+ function _temp$5() {
2046
+ return EMPTY_ARRAY;
2338
2047
  }
2339
- const DEFAULT_FALLBACK_PLACEMENTS = {
2340
- top: [
2341
- "top-end",
2342
- "top-start",
2343
- "bottom",
2344
- "left",
2345
- "right"
2346
- ],
2347
- "top-start": [
2348
- "top",
2349
- "top-end",
2350
- "bottom-start",
2351
- "left-start",
2352
- "right-start"
2353
- ],
2354
- "top-end": [
2355
- "top",
2356
- "top-start",
2357
- "bottom-end",
2358
- "left-end",
2359
- "right-end"
2360
- ],
2361
- bottom: [
2362
- "bottom-end",
2363
- "bottom-start",
2364
- "top",
2365
- "left",
2366
- "right"
2367
- ],
2368
- "bottom-start": [
2369
- "bottom",
2370
- "bottom-end",
2371
- "top-start",
2372
- "left-start",
2373
- "right-start"
2374
- ],
2375
- "bottom-end": [
2376
- "bottom",
2377
- "bottom-start",
2378
- "top-end",
2379
- "left-end",
2380
- "right-end"
2381
- ],
2382
- left: [
2383
- "left-end",
2384
- "left-start",
2385
- "right",
2386
- "top",
2387
- "bottom"
2388
- ],
2389
- "left-start": [
2390
- "left",
2391
- "left-end",
2392
- "right-start",
2393
- "top-start",
2394
- "bottom-start"
2395
- ],
2396
- "left-end": [
2397
- "left",
2398
- "left-start",
2399
- "right-end",
2400
- "top-end",
2401
- "bottom-end"
2402
- ],
2403
- right: [
2404
- "right-end",
2405
- "right-start",
2406
- "left",
2407
- "top",
2408
- "bottom"
2409
- ],
2410
- "right-start": [
2411
- "right",
2412
- "right-end",
2413
- "left-start",
2414
- "top-start",
2415
- "bottom-start"
2416
- ],
2417
- "right-end": [
2418
- "right",
2419
- "right-start",
2420
- "left-end",
2421
- "top-end",
2422
- "bottom-end"
2423
- ]
2424
- }, MotionCard = (0, styled_components.styled)(motion_react.motion.create(Card)).withConfig({
2425
- displayName: "MotionCard",
2426
- componentId: "sc-d1w0oq-0"
2427
- })`will-change:transform;`, TooltipCard = (0, react.forwardRef)(function TooltipCard(props, ref) {
2428
- let $ = (0, react_compiler_runtime.c)(48), animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style;
2429
- $[0] === props ? (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], restProps = $[12], scheme = $[13], shadow = $[14], style = $[15]) : ({animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, scheme, shadow, style, ...restProps} = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = restProps, $[13] = scheme, $[14] = shadow, $[15] = style);
2430
- let t0 = animate ? "transform" : void 0, t1;
2431
- $[16] !== originX || $[17] !== originY || $[18] !== style || $[19] !== t0 ? (t1 = {
2432
- originX,
2433
- originY,
2434
- willChange: t0,
2435
- ...style
2436
- }, $[16] = originX, $[17] = originY, $[18] = style, $[19] = t0, $[20] = t1) : t1 = $[20];
2437
- let rootStyle = t1, t2 = arrowX === null ? void 0 : arrowX, t3 = arrowY === null ? void 0 : arrowY, t4;
2438
- $[21] !== t2 || $[22] !== t3 ? (t4 = {
2439
- left: t2,
2440
- top: t3,
2441
- right: void 0,
2442
- bottom: void 0
2443
- }, $[21] = t2, $[22] = t3, $[23] = t4) : t4 = $[23];
2444
- let arrowStyle = t4, t5 = restProps, t6;
2445
- $[24] === animate ? t6 = $[25] : (t6 = animate ? ["hidden", "initial"] : void 0, $[24] = animate, $[25] = t6);
2446
- let t7;
2447
- $[26] === animate ? t7 = $[27] : (t7 = animate ? ["visible", "scaleIn"] : void 0, $[26] = animate, $[27] = t7);
2448
- let t8;
2449
- $[28] === animate ? t8 = $[29] : (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[28] = animate, $[29] = t8);
2450
- let t9;
2451
- $[30] !== arrow || $[31] !== arrowRef || $[32] !== arrowStyle ? (t9 = arrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Arrow, {
2452
- ref: arrowRef,
2453
- style: arrowStyle,
2454
- width: 15,
2455
- height: 6,
2456
- radius: 2
2457
- }), $[30] = arrow, $[31] = arrowRef, $[32] = arrowStyle, $[33] = t9) : t9 = $[33];
2458
- let t10;
2459
- return $[34] !== children || $[35] !== padding || $[36] !== placement || $[37] !== radius || $[38] !== ref || $[39] !== rootStyle || $[40] !== scheme || $[41] !== shadow || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 || $[46] !== t9 ? (t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionCard, {
2460
- "data-ui": "Tooltip__card",
2461
- ...t5,
2462
- "data-placement": placement,
2463
- padding,
2464
- radius,
2465
- ref,
2466
- scheme,
2467
- shadow,
2468
- style: rootStyle,
2469
- variants: POPOVER_MOTION_PROPS.card,
2470
- transition: POPOVER_MOTION_PROPS.transition,
2471
- initial: t6,
2472
- animate: t7,
2473
- exit: t8,
2474
- children: [children, t9]
2475
- }), $[34] = children, $[35] = padding, $[36] = placement, $[37] = radius, $[38] = ref, $[39] = rootStyle, $[40] = scheme, $[41] = shadow, $[42] = t5, $[43] = t6, $[44] = t7, $[45] = t8, $[46] = t9, $[47] = t10) : t10 = $[47], t10;
2476
- }), TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
2477
2048
  /**
2049
+ * Adds global keydown event listener to the window.
2050
+ *
2051
+ * @param onKeyDown - The function to call when a keydown event is triggered.
2052
+ * @param options - The options to pass to the addEventListener function (example, capture: true)
2478
2053
  * @beta
2479
2054
  */
2480
- function useTooltipDelayGroup() {
2481
- return (0, react.useContext)(TooltipDelayGroupContext);
2055
+ function useGlobalKeyDown(onKeyDown, options) {
2056
+ let $ = (0, react_compiler_runtime.c)(7), t0;
2057
+ $[0] === onKeyDown ? t0 = $[1] : (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0);
2058
+ let handleKeyDown = (0, use_effect_event.useEffectEvent)(t0), t1;
2059
+ $[2] !== handleKeyDown || $[3] !== options ? (t1 = () => {
2060
+ let handler = (event_0) => handleKeyDown(event_0);
2061
+ return window.addEventListener("keydown", handler, options), () => window.removeEventListener("keydown", handler, options);
2062
+ }, $[2] = handleKeyDown, $[3] = options, $[4] = t1) : t1 = $[4];
2063
+ let t2;
2064
+ $[5] === options ? t2 = $[6] : (t2 = [options], $[5] = options, $[6] = t2), (0, react.useEffect)(t1, t2);
2482
2065
  }
2483
- const StyledTooltip = (0, styled_components.styled)(Layer).withConfig({
2484
- displayName: "StyledTooltip",
2485
- componentId: "sc-dkqcjk-0"
2486
- })`pointer-events:none;`, Tooltip = (0, react.forwardRef)(function Tooltip(props, forwardedRef) {
2487
- let $ = (0, react_compiler_runtime.c)(137), boundaryElementContext = useBoundaryElement(), { layer } = useTheme_v2(), _boundaryElement, _fallbackPlacementsProp, _zOffset, childProp, content, delay, disabled, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5;
2488
- $[0] === props ? (_boundaryElement = $[1], _fallbackPlacementsProp = $[2], _zOffset = $[3], childProp = $[4], content = $[5], delay = $[6], disabled = $[7], portalProp = $[8], restProps = $[9], scheme = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16]) : ({animate: t0, arrow: t1, boundaryElement: _boundaryElement, children: childProp, content, disabled, fallbackPlacements: _fallbackPlacementsProp, padding: t2, placement: t3, portal: portalProp, radius: t4, scheme, shadow: t5, zOffset: _zOffset, delay, ...restProps} = props, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacementsProp, $[3] = _zOffset, $[4] = childProp, $[5] = content, $[6] = delay, $[7] = disabled, $[8] = portalProp, $[9] = restProps, $[10] = scheme, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5);
2489
- let _animate = t0 !== void 0 && t0, arrowProp = t1 !== void 0 && t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = !usePrefersReducedMotion() && _animate, t6;
2490
- $[17] === fallbackPlacementsProp ? t6 = $[18] : (t6 = _getArrayProp(fallbackPlacementsProp), $[17] = fallbackPlacementsProp, $[18] = t6);
2491
- let fallbackPlacements = t6, ref = (0, react.useRef)(null), [referenceElement, setReferenceElement] = (0, react.useState)(null), arrowRef = (0, react.useRef)(null), [tooltipMaxWidth, setTooltipMaxWidth] = (0, react.useState)(0), t7;
2492
- $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], (0, react.useImperativeHandle)(forwardedRef, t7);
2493
- let portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, t8;
2494
- $[20] !== animate || $[21] !== arrowProp || $[22] !== boundaryElement || $[23] !== fallbackPlacements ? (t8 = {
2495
- animate,
2496
- arrowProp,
2497
- arrowRef,
2498
- boundaryElement,
2499
- fallbackPlacements,
2500
- rootBoundary: "viewport"
2501
- }, $[20] = animate, $[21] = arrowProp, $[22] = boundaryElement, $[23] = fallbackPlacements, $[24] = t8) : t8 = $[24];
2502
- let middleware = useMiddleware(t8), t9;
2503
- $[25] === referenceElement ? t9 = $[26] : (t9 = { reference: referenceElement }, $[25] = referenceElement, $[26] = t9);
2504
- let t10;
2505
- $[27] !== middleware || $[28] !== placementProp || $[29] !== t9 ? (t10 = {
2506
- middleware,
2507
- placement: placementProp,
2508
- whileElementsMounted: _floating_ui_react_dom.autoUpdate,
2509
- elements: t9
2510
- }, $[27] = middleware, $[28] = placementProp, $[29] = t9, $[30] = t10) : t10 = $[30];
2511
- let { floatingStyles, placement, middlewareData, refs, update } = (0, _floating_ui_react_dom.useFloating)(t10), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = (0, react.useId)(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), t11;
2512
- $[31] === delayGroupContext ? t11 = $[32] : (t11 = delayGroupContext || {}, $[31] = delayGroupContext, $[32] = t11);
2513
- let { setIsGroupActive, setOpenTooltipId } = t11, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, t12;
2514
- $[33] !== closeDelay || $[34] !== isInsideGroup || $[35] !== openDelay || $[36] !== setIsGroupActive || $[37] !== setIsOpen || $[38] !== setOpenTooltipId || $[39] !== tooltipId ? (t12 = (open, immediate) => {
2515
- if (isInsideGroup) if (open) {
2516
- let groupedOpenDelay = immediate ? 0 : openDelay;
2517
- setIsGroupActive?.(open, groupedOpenDelay), setOpenTooltipId?.(tooltipId, groupedOpenDelay);
2518
- } else setIsGroupActive?.(open, closeDelay > 200 ? closeDelay : 200), setOpenTooltipId?.(null, immediate ? 0 : closeDelay);
2519
- else setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
2520
- }, $[33] = closeDelay, $[34] = isInsideGroup, $[35] = openDelay, $[36] = setIsGroupActive, $[37] = setIsOpen, $[38] = setOpenTooltipId, $[39] = tooltipId, $[40] = t12) : t12 = $[40];
2521
- let handleIsOpenChange = t12, t13;
2522
- $[41] !== childProp?.props || $[42] !== handleIsOpenChange ? (t13 = (e) => {
2523
- handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
2524
- }, $[41] = childProp?.props, $[42] = handleIsOpenChange, $[43] = t13) : t13 = $[43], childProp?.props;
2525
- let handleBlur = t13, t14;
2526
- $[44] !== childProp?.props || $[45] !== handleIsOpenChange ? (t14 = (e_0) => {
2527
- handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
2528
- }, $[44] = childProp?.props, $[45] = handleIsOpenChange, $[46] = t14) : t14 = $[46], childProp?.props;
2529
- let handleClick = t14, t15;
2530
- $[47] !== childProp?.props || $[48] !== handleIsOpenChange ? (t15 = (e_1) => {
2531
- handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
2532
- }, $[47] = childProp?.props, $[48] = handleIsOpenChange, $[49] = t15) : t15 = $[49], childProp?.props;
2533
- let handleContextMenu = t15, t16;
2534
- $[50] !== childProp?.props || $[51] !== handleIsOpenChange ? (t16 = (e_2) => {
2535
- handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
2536
- }, $[50] = childProp?.props, $[51] = handleIsOpenChange, $[52] = t16) : t16 = $[52], childProp?.props;
2537
- let handleFocus = t16, t17;
2538
- $[53] !== childProp?.props || $[54] !== handleIsOpenChange ? (t17 = (e_3) => {
2539
- handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
2540
- }, $[53] = childProp?.props, $[54] = handleIsOpenChange, $[55] = t17) : t17 = $[55], childProp?.props;
2541
- let handleMouseEnter = t17, t18;
2542
- $[56] !== childProp?.props || $[57] !== handleIsOpenChange ? (t18 = (e_4) => {
2543
- handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
2544
- }, $[56] = childProp?.props, $[57] = handleIsOpenChange, $[58] = t18) : t18 = $[58], childProp?.props;
2545
- let handleMouseLeave = t18, t19;
2546
- $[59] !== handleIsOpenChange || $[60] !== isInsideGroup || $[61] !== referenceElement || $[62] !== showTooltip ? (t19 = {
2547
- handleIsOpenChange,
2548
- referenceElement,
2549
- showTooltip,
2550
- isInsideGroup
2551
- }, $[59] = handleIsOpenChange, $[60] = isInsideGroup, $[61] = referenceElement, $[62] = showTooltip, $[63] = t19) : t19 = $[63], useCloseOnMouseLeave(t19);
2552
- let t20, t21;
2553
- $[64] !== disabled || $[65] !== handleIsOpenChange || $[66] !== showTooltip ? (t20 = () => {
2554
- disabled && showTooltip && handleIsOpenChange(!1);
2555
- }, t21 = [
2556
- disabled,
2557
- handleIsOpenChange,
2558
- showTooltip
2559
- ], $[64] = disabled, $[65] = handleIsOpenChange, $[66] = showTooltip, $[67] = t20, $[68] = t21) : (t20 = $[67], t21 = $[68]), (0, react.useEffect)(t20, t21);
2560
- let t22, t23;
2561
- $[69] !== content || $[70] !== handleIsOpenChange || $[71] !== showTooltip ? (t22 = () => {
2562
- !content && showTooltip && handleIsOpenChange(!1);
2563
- }, t23 = [
2564
- content,
2565
- handleIsOpenChange,
2566
- showTooltip
2567
- ], $[69] = content, $[70] = handleIsOpenChange, $[71] = showTooltip, $[72] = t22, $[73] = t23) : (t22 = $[72], t23 = $[73]), (0, react.useEffect)(t22, t23);
2568
- let t24, t25;
2569
- $[74] !== handleIsOpenChange || $[75] !== showTooltip ? (t24 = () => {
2570
- if (!showTooltip) return;
2571
- let handleWindowKeyDown = function handleWindowKeyDown(event) {
2572
- event.key === "Escape" && handleIsOpenChange(!1, !0);
2573
- };
2574
- return window.addEventListener("keydown", handleWindowKeyDown), () => {
2575
- window.removeEventListener("keydown", handleWindowKeyDown);
2576
- };
2577
- }, t25 = [handleIsOpenChange, showTooltip], $[74] = handleIsOpenChange, $[75] = showTooltip, $[76] = t24, $[77] = t25) : (t24 = $[76], t25 = $[77]), (0, react.useEffect)(t24, t25);
2578
- let t26;
2579
- $[78] !== boundaryElement || $[79] !== portalElement?.offsetWidth ? (t26 = () => {
2580
- let availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
2581
- setTooltipMaxWidth(Math.min(...availableWidths) - 8);
2582
- }, $[78] = boundaryElement, $[79] = portalElement?.offsetWidth, $[80] = t26) : t26 = $[80];
2583
- let t27;
2584
- $[81] !== boundaryElement || $[82] !== portalElement ? (t27 = [boundaryElement, portalElement], $[81] = boundaryElement, $[82] = portalElement, $[83] = t27) : t27 = $[83], (0, react.useLayoutEffect)(t26, t27);
2585
- let t28;
2586
- $[84] === update ? t28 = $[85] : (t28 = (arrowEl) => {
2587
- arrowRef.current = arrowEl, update();
2588
- }, $[84] = update, $[85] = t28);
2589
- let setArrow = t28, t29;
2590
- $[86] === refs ? t29 = $[87] : (t29 = (node) => {
2591
- ref.current = node, refs.setFloating(node);
2592
- }, $[86] = refs, $[87] = t29);
2593
- let setFloating = t29, t30;
2594
- bb0: {
2595
- if (!childProp) {
2596
- t30 = null;
2597
- break bb0;
2598
- }
2599
- let t31;
2600
- $[88] !== childProp || $[89] !== handleBlur || $[90] !== handleClick || $[91] !== handleContextMenu || $[92] !== handleFocus || $[93] !== handleMouseEnter || $[94] !== handleMouseLeave ? (t31 = (0, react.cloneElement)(childProp, {
2601
- onBlur: handleBlur,
2602
- onFocus: handleFocus,
2603
- onMouseEnter: handleMouseEnter,
2604
- onMouseLeave: handleMouseLeave,
2605
- onClick: handleClick,
2606
- onContextMenu: handleContextMenu,
2607
- ref: setReferenceElement
2608
- }), $[88] = childProp, $[89] = handleBlur, $[90] = handleClick, $[91] = handleContextMenu, $[92] = handleFocus, $[93] = handleMouseEnter, $[94] = handleMouseLeave, $[95] = t31) : t31 = $[95], t30 = t31;
2609
- }
2610
- let child = t30, t31;
2611
- $[96] === childProp ? t31 = $[97] : (t31 = childProp ? getElementRef(childProp) : null, $[96] = childProp, $[97] = t31);
2612
- let t32, t33;
2613
- if ($[98] === referenceElement ? (t32 = $[99], t33 = $[100]) : (t32 = () => referenceElement, t33 = [referenceElement], $[98] = referenceElement, $[99] = t32, $[100] = t33), (0, react.useImperativeHandle)(t31, t32, t33), !child) {
2614
- let t34;
2615
- return $[101] === Symbol.for("react.memo_cache_sentinel") ? (t34 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {}), $[101] = t34) : t34 = $[101], t34;
2616
- }
2617
- if (disabled) return child;
2618
- let t34 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0, t35;
2619
- $[102] !== floatingStyles || $[103] !== t34 ? (t35 = {
2620
- ...floatingStyles,
2621
- maxWidth: t34
2622
- }, $[102] = floatingStyles, $[103] = t34, $[104] = t35) : t35 = $[104];
2623
- let t36;
2624
- $[105] !== animate || $[106] !== arrowProp || $[107] !== arrowX || $[108] !== arrowY || $[109] !== content || $[110] !== originX || $[111] !== originY || $[112] !== padding || $[113] !== placement || $[114] !== radius || $[115] !== restProps || $[116] !== scheme || $[117] !== setArrow || $[118] !== setFloating || $[119] !== shadow ? (t36 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipCard, {
2066
+ const StyledLayer = /* @__PURE__ */ styled_components.styled.div.withConfig({
2067
+ displayName: "StyledLayer",
2068
+ componentId: "sc-c59p9w-0"
2069
+ })({ position: "relative" }), LayerChildren = (0, react.forwardRef)(function LayerChildren(props, forwardedRef) {
2070
+ let $ = (0, react_compiler_runtime.c)(22), children, onActivate, onFocus, restProps, t0;
2071
+ $[0] === props ? (children = $[1], onActivate = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]) : ({children, onActivate, onFocus, style: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = onActivate, $[3] = onFocus, $[4] = restProps, $[5] = t0);
2072
+ let style = t0 === void 0 ? EMPTY_RECORD : t0, { zIndex, isTopLayer } = useLayer(), lastFocusedRef = (0, react.useRef)(null), ref = (0, react.useRef)(null), isTopLayerRef = (0, react.useRef)(isTopLayer), t1;
2073
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[6] = t1) : t1 = $[6], (0, react.useImperativeHandle)(forwardedRef, t1);
2074
+ let t2, t3;
2075
+ $[7] !== isTopLayer || $[8] !== onActivate ? (t2 = () => {
2076
+ isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({ activeElement: lastFocusedRef.current }), isTopLayerRef.current = isTopLayer;
2077
+ }, t3 = [isTopLayer, onActivate], $[7] = isTopLayer, $[8] = onActivate, $[9] = t2, $[10] = t3) : (t2 = $[9], t3 = $[10]), (0, react.useEffect)(t2, t3);
2078
+ let t4;
2079
+ $[11] !== isTopLayer || $[12] !== onFocus ? (t4 = (event) => {
2080
+ onFocus?.(event);
2081
+ let rootElement = ref.current, target = document.activeElement;
2082
+ !isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
2083
+ }, $[11] = isTopLayer, $[12] = onFocus, $[13] = t4) : t4 = $[13];
2084
+ let handleFocus = t4, t5;
2085
+ $[14] !== style || $[15] !== zIndex ? (t5 = {
2086
+ ...style,
2087
+ zIndex
2088
+ }, $[14] = style, $[15] = zIndex, $[16] = t5) : t5 = $[16];
2089
+ let t6;
2090
+ return $[17] !== children || $[18] !== handleFocus || $[19] !== restProps || $[20] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledLayer, {
2625
2091
  ...restProps,
2626
- animate,
2627
- arrow: arrowProp,
2628
- arrowRef: setArrow,
2629
- arrowX,
2630
- arrowY,
2631
- originX,
2632
- originY,
2633
- padding,
2634
- placement,
2635
- radius,
2636
- ref: setFloating,
2637
- scheme,
2638
- shadow,
2639
- children: content
2640
- }), $[105] = animate, $[106] = arrowProp, $[107] = arrowX, $[108] = arrowY, $[109] = content, $[110] = originX, $[111] = originY, $[112] = padding, $[113] = placement, $[114] = radius, $[115] = restProps, $[116] = scheme, $[117] = setArrow, $[118] = setFloating, $[119] = shadow, $[120] = t36) : t36 = $[120];
2641
- let t37;
2642
- $[121] !== restProps || $[122] !== setFloating || $[123] !== t35 || $[124] !== t36 || $[125] !== zOffset ? (t37 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTooltip, {
2643
- "data-ui": "Tooltip",
2092
+ "data-ui": "Layer",
2093
+ onFocus: handleFocus,
2094
+ ref,
2095
+ style: t5,
2096
+ children
2097
+ }), $[17] = children, $[18] = handleFocus, $[19] = restProps, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
2098
+ }), Layer = (0, react.forwardRef)(function Layer(props, ref) {
2099
+ let $ = (0, react_compiler_runtime.c)(11), children, restProps, t0;
2100
+ $[0] === props ? (children = $[1], restProps = $[2], t0 = $[3]) : ({children, zOffset: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0);
2101
+ let zOffset = t0 === void 0 ? 1 : t0, t1;
2102
+ $[4] !== children || $[5] !== ref || $[6] !== restProps ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LayerChildren, {
2644
2103
  ...restProps,
2645
- ref: setFloating,
2646
- style: t35,
2104
+ ref,
2105
+ children
2106
+ }), $[4] = children, $[5] = ref, $[6] = restProps, $[7] = t1) : t1 = $[7];
2107
+ let t2;
2108
+ return $[8] !== t1 || $[9] !== zOffset ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LayerProvider, {
2647
2109
  zOffset,
2648
- children: t36
2649
- }), $[121] = restProps, $[122] = setFloating, $[123] = t35, $[124] = t36, $[125] = zOffset, $[126] = t37) : t37 = $[126];
2650
- let tooltip = t37, t38;
2651
- $[127] !== portalProp || $[128] !== showTooltip || $[129] !== tooltip ? (t38 = showTooltip && (portalProp ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Portal, {
2652
- __unstable_name: typeof portalProp == "string" ? portalProp : void 0,
2653
- children: tooltip
2654
- }) : tooltip), $[127] = portalProp, $[128] = showTooltip, $[129] = tooltip, $[130] = t38) : t38 = $[130];
2655
- let children = t38, t39;
2656
- $[131] !== animate || $[132] !== children ? (t39 = animate ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, { children }) : children, $[131] = animate, $[132] = children, $[133] = t39) : t39 = $[133];
2657
- let t40;
2658
- return $[134] !== child || $[135] !== t39 ? (t40 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t39, child] }), $[134] = child, $[135] = t39, $[136] = t40) : t40 = $[136], t40;
2110
+ children: t1
2111
+ }), $[8] = t1, $[9] = zOffset, $[10] = t2) : t2 = $[10], t2;
2659
2112
  });
2660
- function useMiddleware(t0) {
2661
- let $ = (0, react_compiler_runtime.c)(17), { animate, arrowProp, arrowRef, boundaryElement, fallbackPlacements, rootBoundary } = t0, ret;
2662
- if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== boundaryElement || $[4] !== fallbackPlacements || $[5] !== rootBoundary) {
2663
- ret = [];
2664
- let t1 = boundaryElement || void 0, t2;
2665
- $[7] !== fallbackPlacements || $[8] !== rootBoundary || $[9] !== t1 ? (t2 = (0, _floating_ui_react_dom.flip)({
2666
- boundary: t1,
2667
- fallbackPlacements,
2668
- padding: 4,
2669
- rootBoundary
2670
- }), $[7] = fallbackPlacements, $[8] = rootBoundary, $[9] = t1, $[10] = t2) : t2 = $[10], ret.push(t2);
2671
- let t3;
2672
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t3 = (0, _floating_ui_react_dom.offset)({ mainAxis: 4 }), $[11] = t3) : t3 = $[11], ret.push(t3);
2673
- let t4 = boundaryElement || void 0, t5;
2674
- if ($[12] !== rootBoundary || $[13] !== t4 ? (t5 = (0, _floating_ui_react_dom.shift)({
2675
- boundary: t4,
2676
- rootBoundary,
2677
- padding: 4
2678
- }), $[12] = rootBoundary, $[13] = t4, $[14] = t5) : t5 = $[14], ret.push(t5), arrowProp) {
2679
- let t6;
2680
- $[15] === arrowRef ? t6 = $[16] : (t6 = (0, _floating_ui_react_dom.arrow)({
2681
- element: arrowRef,
2682
- padding: 4
2683
- }), $[15] = arrowRef, $[16] = t6), ret.push(t6);
2113
+ function inlineBaseStyle() {
2114
+ return {
2115
+ lineHeight: "0",
2116
+ "&&:not([hidden])": { display: "block" },
2117
+ "& > div": {
2118
+ display: "inline-block",
2119
+ verticalAlign: "middle"
2684
2120
  }
2685
- animate && ret.push(origin), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = boundaryElement, $[4] = fallbackPlacements, $[5] = rootBoundary, $[6] = ret;
2686
- } else ret = $[6];
2687
- return ret;
2121
+ };
2688
2122
  }
2689
- /**
2690
- * As `useEffectEvent` should never be passed to other components or hooks, this custom hook groups together the `useEffectEvent` and the `useEffect` hook using it.
2691
- * @see https://19.react.dev/learn/separating-events-from-effects#reading-latest-props-and-state-with-effect-events:~:text=Never%20pass%20them%20to%20other%20components%20or%20Hooks
2692
- */
2693
- function useCloseOnMouseLeave(t0) {
2694
- let $ = (0, react_compiler_runtime.c)(10), { handleIsOpenChange, referenceElement, showTooltip, isInsideGroup } = t0, t1;
2695
- $[0] !== handleIsOpenChange || $[1] !== referenceElement ? (t1 = (target, teardown) => {
2696
- referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
2697
- }, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
2698
- let onMouseMove = (0, use_effect_event.useEffectEvent)(t1), t2;
2699
- $[3] !== isInsideGroup || $[4] !== onMouseMove || $[5] !== showTooltip ? (t2 = () => {
2700
- if (!showTooltip || isInsideGroup) return;
2701
- let handleMouseMove = (event) => {
2702
- onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
2123
+ function inlineSpaceStyle(props) {
2124
+ let { media, space } = require_getScopedTheme.i(props.theme);
2125
+ return _responsive(media, props.$space, (spaceIndex) => {
2126
+ let _space = rem(spaceIndex === .5 ? space[1] / 2 : space[spaceIndex]);
2127
+ return {
2128
+ margin: `-${_space} 0 0 -${_space}`,
2129
+ "& > div": { padding: `${_space} 0 0 ${_space}` }
2703
2130
  };
2704
- return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
2705
- }, $[3] = isInsideGroup, $[4] = onMouseMove, $[5] = showTooltip, $[6] = t2) : t2 = $[6];
2706
- let t3;
2707
- $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], (0, react.useEffect)(t2, t3);
2131
+ });
2132
+ }
2133
+ const StyledInline = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
2134
+ displayName: "StyledInline",
2135
+ componentId: "sc-zsbqh7-0"
2136
+ })(inlineBaseStyle, inlineSpaceStyle), Inline = (0, react.forwardRef)(function Inline(props, ref) {
2137
+ let $ = (0, react_compiler_runtime.c)(16), as, childrenProp, deprecated_space, gap, restProps;
2138
+ $[0] === props ? (as = $[1], childrenProp = $[2], deprecated_space = $[3], gap = $[4], restProps = $[5]) : ({as, children: childrenProp, gap, space: deprecated_space, ...restProps} = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = deprecated_space, $[4] = gap, $[5] = restProps);
2139
+ let spacing = gap === void 0 ? deprecated_space : gap, t0;
2140
+ $[6] === childrenProp ? t0 = $[7] : (t0 = react.Children.map(childrenProp, _temp$4), $[6] = childrenProp, $[7] = t0);
2141
+ let children = t0, t1;
2142
+ $[8] === spacing ? t1 = $[9] : (t1 = _getArrayProp(spacing), $[8] = spacing, $[9] = t1);
2143
+ let t2 = ref, t3;
2144
+ return $[10] !== as || $[11] !== children || $[12] !== restProps || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledInline, {
2145
+ "data-ui": "Inline",
2146
+ ...restProps,
2147
+ $space: t1,
2148
+ forwardedAs: as,
2149
+ ref: t2,
2150
+ children
2151
+ }), $[10] = as, $[11] = children, $[12] = restProps, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
2152
+ });
2153
+ function _temp$4(child) {
2154
+ return child && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: child });
2708
2155
  }
2709
- const StyledHotkeys = styled_components.styled.kbd.withConfig({
2156
+ function kbdStyle() {
2157
+ return styled_components.css`--card-bg-color:var(--card-kbd-bg-color);--card-border-color:var(--card-kbd-border-color);--card-fg-color:var(--card-kbd-fg-color);box-shadow:inset 0 0 0 1px var(--card-border-color);background:var(--card-bg-color);font:inherit;vertical-align:top;&:not([hidden]){display:inline-block;}`;
2158
+ }
2159
+ const StyledKBD = /* @__PURE__ */ styled_components.styled.kbd.withConfig({
2160
+ displayName: "StyledKBD",
2161
+ componentId: "sc-xzhxcv-0"
2162
+ })(responsiveRadiusStyle, kbdStyle), KBD = (0, react.forwardRef)(function KBD(props, ref) {
2163
+ let $ = (0, react_compiler_runtime.c)(19), children, restProps, t0, t1, t2;
2164
+ $[0] === props ? (children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5]) : ({children, fontSize: t0, padding: t1, radius: t2, ...restProps} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2);
2165
+ let fontSize = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? 2 : t2, t3;
2166
+ $[6] === radius ? t3 = $[7] : (t3 = _getArrayProp(radius), $[6] = radius, $[7] = t3);
2167
+ let t4;
2168
+ $[8] !== children || $[9] !== fontSize ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
2169
+ as: "span",
2170
+ size: fontSize,
2171
+ weight: "semibold",
2172
+ children
2173
+ }), $[8] = children, $[9] = fontSize, $[10] = t4) : t4 = $[10];
2174
+ let t5;
2175
+ $[11] !== padding || $[12] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
2176
+ as: "span",
2177
+ padding,
2178
+ children: t4
2179
+ }), $[11] = padding, $[12] = t4, $[13] = t5) : t5 = $[13];
2180
+ let t6;
2181
+ return $[14] !== ref || $[15] !== restProps || $[16] !== t3 || $[17] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledKBD, {
2182
+ "data-ui": "KBD",
2183
+ ...restProps,
2184
+ $radius: t3,
2185
+ ref,
2186
+ children: t5
2187
+ }), $[14] = ref, $[15] = restProps, $[16] = t3, $[17] = t5, $[18] = t6) : t6 = $[18], t6;
2188
+ }), StyledHotkeys = styled_components.styled.kbd.withConfig({
2710
2189
  displayName: "StyledHotkeys",
2711
- componentId: "sc-07x5rd-0"
2190
+ componentId: "sc-1soubc-0"
2712
2191
  })`font:inherit;padding:1px;&:not([hidden]){display:block;}`, Key = (0, styled_components.styled)(KBD).withConfig({
2713
2192
  displayName: "Key",
2714
- componentId: "sc-07x5rd-1"
2193
+ componentId: "sc-1soubc-1"
2715
2194
  })`&:not([hidden]){display:block;}`, Hotkeys = (0, react.forwardRef)(function Hotkeys(props, ref) {
2716
2195
  let $ = (0, react_compiler_runtime.c)(27), fontSize, gap, keys, padding, radius, restProps, t0;
2717
2196
  $[0] === props ? (fontSize = $[1], gap = $[2], keys = $[3], padding = $[4], radius = $[5], restProps = $[6], t0 = $[7]) : ({fontSize, gap, keys, padding, radius, space: t0, ...restProps} = props, $[0] = props, $[1] = fontSize, $[2] = gap, $[3] = keys, $[4] = padding, $[5] = radius, $[6] = restProps, $[7] = t0);
@@ -2801,7 +2280,7 @@ function useMenuController(props) {
2801
2280
  }, $[1] = t1) : t1 = $[1];
2802
2281
  let setActiveIndex = t1, t2;
2803
2282
  $[2] === rootElementRef ? t2 = $[3] : (t2 = (element, selected) => {
2804
- if (!element) return _temp$1;
2283
+ if (!element) return _temp$3;
2805
2284
  if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
2806
2285
  let selectedIndex = elementsRef.current.indexOf(element);
2807
2286
  setActiveIndex(selectedIndex);
@@ -2904,10 +2383,10 @@ function useMenuController(props) {
2904
2383
  mount
2905
2384
  }, $[15] = activeElement, $[16] = activeIndex, $[17] = handleItemMouseLeave, $[18] = handleKeyDown, $[19] = mount, $[20] = t8) : t8 = $[20], t8;
2906
2385
  }
2907
- function _temp$1() {}
2386
+ function _temp$3() {}
2908
2387
  const StyledMenu = (0, styled_components.styled)(Box).withConfig({
2909
2388
  displayName: "StyledMenu",
2910
- componentId: "sc-88w4l4-0"
2389
+ componentId: "sc-xvs9y5-0"
2911
2390
  })`outline:none;overflow:auto;`, Menu = (0, react.forwardRef)(function Menu(props, forwardedRef) {
2912
2391
  let $ = (0, react_compiler_runtime.c)(50), _shouldFocus, children, gap, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, restProps, t0, t1;
2913
2392
  if ($[0] !== props) {
@@ -2972,13 +2451,13 @@ const StyledMenu = (0, styled_components.styled)(Box).withConfig({
2972
2451
  }), $[47] = t11, $[48] = value, $[49] = t12) : t12 = $[49], t12;
2973
2452
  }), MenuDivider = styled_components.styled.hr.withConfig({
2974
2453
  displayName: "MenuDivider",
2975
- componentId: "sc-8tblqx-0"
2454
+ componentId: "sc-sxuath-0"
2976
2455
  })`height:1px;border:0;background:var(--card-hairline-soft-color);margin:0;`;
2977
2456
  function selectableBaseStyle() {
2978
2457
  return styled_components.css`background-color:inherit;color:inherit;&[data-as='button']{-webkit-font-smoothing:inherit;appearance:none;outline:none;font:inherit;text-align:inherit;border:0;width:-moz-available;width:-webkit-fill-available;width:stretch;}&[data-as='a']{text-decoration:none;}`;
2979
2458
  }
2980
2459
  function selectableColorStyle(props) {
2981
- let { $tone } = props, { color, style } = require_theme.X(props.theme), tone = color.selectable[$tone];
2460
+ let { $tone } = props, { color, style } = require_getScopedTheme.i(props.theme), tone = color.selectable[$tone];
2982
2461
  return styled_components.css`${_cardColorStyle(color, tone.enabled)} background-color:var(--card-bg-color);color:var(--card-fg-color);outline:none;&[data-as='button']{&:disabled{${_cardColorStyle(color, tone.disabled)}}&:not(:disabled){&[aria-pressed='true']{${_cardColorStyle(color, tone.pressed)}}&[data-selected],&[aria-selected='true'] > &{${_cardColorStyle(color, tone.selected)}}@media (hover:hover){&:not([data-selected]){&[data-hovered],&:hover{${_cardColorStyle(color, tone.hovered)}}&:active{${_cardColorStyle(color, tone.pressed)}}}}}}&[data-as='a']{&[data-disabled]{${_cardColorStyle(color, tone.disabled)}}&:not([data-disabled]){&[data-pressed]{${_cardColorStyle(color, tone.pressed)}}&[data-selected]{${_cardColorStyle(color, tone.selected)}}@media (hover:hover){&:not([data-selected]){&[data-hovered],&:hover{${_cardColorStyle(color, tone.hovered)}}&:active{${_cardColorStyle(color, tone.pressed)}}}}}}${style?.card?.root}`;
2983
2462
  }
2984
2463
  /**
@@ -2986,7 +2465,7 @@ function selectableColorStyle(props) {
2986
2465
  */
2987
2466
  const Selectable = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
2988
2467
  displayName: "Selectable",
2989
- componentId: "sc-sk8nre-0"
2468
+ componentId: "sc-njdnrn-0"
2990
2469
  })(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
2991
2470
  function useMenu() {
2992
2471
  let value = (0, react.useContext)(MenuContext);
@@ -3144,7 +2623,7 @@ const MenuGroup = function MenuGroup(props) {
3144
2623
  paddingLeft
3145
2624
  }, $[34] = padding, $[35] = paddingBottom, $[36] = paddingLeft, $[37] = paddingRight, $[38] = paddingTop, $[39] = paddingX, $[40] = paddingY, $[41] = t10) : t10 = $[41];
3146
2625
  let paddingProps = t10, t11;
3147
- $[42] === fontSize ? t11 = $[43] : (t11 = _getArrayProp(fontSize).map(_temp), $[42] = fontSize, $[43] = t11);
2626
+ $[42] === fontSize ? t11 = $[43] : (t11 = _getArrayProp(fontSize).map(_temp$2), $[42] = fontSize, $[43] = t11);
3148
2627
  let hotkeysFontSize = t11, t12;
3149
2628
  $[44] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (el) => {
3150
2629
  ref.current = el, setRootElement(el);
@@ -3216,12 +2695,12 @@ const MenuGroup = function MenuGroup(props) {
3216
2695
  children: [t20, t21]
3217
2696
  }), $[60] = as, $[61] = disabled, $[62] = handleClick, $[63] = onItemMouseEnter, $[64] = onItemMouseLeave, $[65] = restProps, $[66] = scheme, $[67] = t13, $[68] = t14, $[69] = t15, $[70] = t16, $[71] = t18, $[72] = t19, $[73] = t20, $[74] = t21, $[75] = t22) : t22 = $[75], t22;
3218
2697
  });
3219
- function _temp(s) {
2698
+ function _temp$2(s) {
3220
2699
  return s - 1;
3221
2700
  }
3222
2701
  const CustomButton = (0, styled_components.styled)(Button).withConfig({
3223
2702
  displayName: "CustomButton",
3224
- componentId: "sc-rhibqq-0"
2703
+ componentId: "sc-whlh6p-0"
3225
2704
  })`max-width:100%;`, Tab = (0, react.forwardRef)(function Tab(props, forwardedRef) {
3226
2705
  let $ = (0, react_compiler_runtime.c)(30), focused, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
3227
2706
  $[0] === props ? (focused = $[1], icon = $[2], id = $[3], label = $[4], onClick = $[5], onFocus = $[6], restProps = $[7], selected = $[8], t0 = $[9], t1 = $[10]) : ({icon, id, focused, fontSize: t0, label, onClick, onFocus, padding: t1, selected, ...restProps} = props, $[0] = props, $[1] = focused, $[2] = icon, $[3] = id, $[4] = label, $[5] = onClick, $[6] = onFocus, $[7] = restProps, $[8] = selected, $[9] = t0, $[10] = t1);
@@ -3252,51 +2731,579 @@ const CustomButton = (0, styled_components.styled)(Button).withConfig({
3252
2731
  onBlur: handleBlur,
3253
2732
  onFocus: handleFocus,
3254
2733
  padding,
3255
- ref,
3256
- role: "tab",
3257
- selected,
3258
- tabIndex: t8,
3259
- text: label,
3260
- type: "button"
3261
- }), $[18] = fontSize, $[19] = handleFocus, $[20] = icon, $[21] = id, $[22] = label, $[23] = onClick, $[24] = padding, $[25] = restProps, $[26] = selected, $[27] = t7, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
3262
- }), CustomInline = (0, styled_components.styled)(Inline).withConfig({
3263
- displayName: "CustomInline",
3264
- componentId: "sc-40huc5-0"
3265
- })`& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}`, TabList = (0, react.forwardRef)(function TabList(props, ref) {
3266
- let $ = (0, react_compiler_runtime.c)(15), childrenProp, restProps;
3267
- $[0] === props ? (childrenProp = $[1], restProps = $[2]) : ({children: childrenProp, ...restProps} = props, $[0] = props, $[1] = childrenProp, $[2] = restProps);
3268
- let [focusedIndex, setFocusedIndex] = (0, react.useState)(-1), t0;
3269
- if ($[3] !== childrenProp || $[4] !== focusedIndex) {
3270
- let children = react.Children.toArray(childrenProp).filter(react.isValidElement), t1;
3271
- $[6] === focusedIndex ? t1 = $[7] : (t1 = (child, childIndex) => (0, react.cloneElement)(child, {
3272
- focused: focusedIndex === childIndex,
3273
- key: childIndex,
3274
- onFocus: () => setFocusedIndex(childIndex)
3275
- }), $[6] = focusedIndex, $[7] = t1), t0 = children.map(t1), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
3276
- } else t0 = $[5];
3277
- let tabs = t0, numTabs = tabs.length, t1;
3278
- $[8] === numTabs ? t1 = $[9] : (t1 = (event) => {
3279
- event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
3280
- }, $[8] = numTabs, $[9] = t1);
3281
- let handleKeyDown = t1, t2;
3282
- return $[10] !== handleKeyDown || $[11] !== ref || $[12] !== restProps || $[13] !== tabs ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomInline, {
3283
- "data-ui": "TabList",
2734
+ ref,
2735
+ role: "tab",
2736
+ selected,
2737
+ tabIndex: t8,
2738
+ text: label,
2739
+ type: "button"
2740
+ }), $[18] = fontSize, $[19] = handleFocus, $[20] = icon, $[21] = id, $[22] = label, $[23] = onClick, $[24] = padding, $[25] = restProps, $[26] = selected, $[27] = t7, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
2741
+ }), CustomInline = (0, styled_components.styled)(Inline).withConfig({
2742
+ displayName: "CustomInline",
2743
+ componentId: "sc-tlz8f1-0"
2744
+ })`& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}`, TabList = (0, react.forwardRef)(function TabList(props, ref) {
2745
+ let $ = (0, react_compiler_runtime.c)(15), childrenProp, restProps;
2746
+ $[0] === props ? (childrenProp = $[1], restProps = $[2]) : ({children: childrenProp, ...restProps} = props, $[0] = props, $[1] = childrenProp, $[2] = restProps);
2747
+ let [focusedIndex, setFocusedIndex] = (0, react.useState)(-1), t0;
2748
+ if ($[3] !== childrenProp || $[4] !== focusedIndex) {
2749
+ let children = react.Children.toArray(childrenProp).filter(react.isValidElement), t1;
2750
+ $[6] === focusedIndex ? t1 = $[7] : (t1 = (child, childIndex) => (0, react.cloneElement)(child, {
2751
+ focused: focusedIndex === childIndex,
2752
+ key: childIndex,
2753
+ onFocus: () => setFocusedIndex(childIndex)
2754
+ }), $[6] = focusedIndex, $[7] = t1), t0 = children.map(t1), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
2755
+ } else t0 = $[5];
2756
+ let tabs = t0, numTabs = tabs.length, t1;
2757
+ $[8] === numTabs ? t1 = $[9] : (t1 = (event) => {
2758
+ event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
2759
+ }, $[8] = numTabs, $[9] = t1);
2760
+ let handleKeyDown = t1, t2;
2761
+ return $[10] !== handleKeyDown || $[11] !== ref || $[12] !== restProps || $[13] !== tabs ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomInline, {
2762
+ "data-ui": "TabList",
2763
+ ...restProps,
2764
+ onKeyDown: handleKeyDown,
2765
+ ref,
2766
+ role: "tablist",
2767
+ children: tabs
2768
+ }), $[10] = handleKeyDown, $[11] = ref, $[12] = restProps, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
2769
+ }), GRID_CSS = {
2770
+ "&&:not([hidden])": { display: "grid" },
2771
+ "&[data-as=\"ul\"],&[data-as=\"ol\"]": { listStyle: "none" }
2772
+ }, GRID_AUTO_COLUMS = {
2773
+ auto: "auto",
2774
+ min: "min-content",
2775
+ max: "max-content",
2776
+ fr: "minmax(0, 1fr)"
2777
+ }, GRID_AUTO_ROWS = {
2778
+ auto: "auto",
2779
+ min: "min-content",
2780
+ max: "max-content",
2781
+ fr: "minmax(0, 1fr)"
2782
+ };
2783
+ function responsiveGridStyle() {
2784
+ return [
2785
+ GRID_CSS,
2786
+ responsiveGridAutoFlowStyle,
2787
+ responsiveGridAutoRowsStyle,
2788
+ responsiveGridAutoColsStyle,
2789
+ responsiveGridColumnsStyle,
2790
+ responsiveGridRowsStyle,
2791
+ responsiveGridGapStyle,
2792
+ responsiveGridGapXStyle,
2793
+ responsiveGridGapYStyle
2794
+ ];
2795
+ }
2796
+ function responsiveGridAutoFlowStyle(props) {
2797
+ let { media } = require_getScopedTheme.i(props.theme);
2798
+ return _responsive(media, props.$autoFlow, (autoFlow) => ({ gridAutoFlow: autoFlow }));
2799
+ }
2800
+ function responsiveGridAutoRowsStyle(props) {
2801
+ let { media } = require_getScopedTheme.i(props.theme);
2802
+ return _responsive(media, props.$autoRows, (autoRows) => ({ gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows] }));
2803
+ }
2804
+ function responsiveGridAutoColsStyle(props) {
2805
+ let { media } = require_getScopedTheme.i(props.theme);
2806
+ return _responsive(media, props.$autoCols, (autoCols) => ({ gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols] }));
2807
+ }
2808
+ function responsiveGridColumnsStyle(props) {
2809
+ let { media } = require_getScopedTheme.i(props.theme);
2810
+ return _responsive(media, props.$columns, (columns) => ({ gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));` }));
2811
+ }
2812
+ function responsiveGridRowsStyle(props) {
2813
+ let { media } = require_getScopedTheme.i(props.theme);
2814
+ return _responsive(media, props.$rows, (rows) => ({ gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));` }));
2815
+ }
2816
+ function responsiveGridGapStyle(props) {
2817
+ let { media, space } = require_getScopedTheme.i(props.theme);
2818
+ return _responsive(media, props.$gap, (gap) => ({ gridGap: gap ? rem(space[gap]) : void 0 }));
2819
+ }
2820
+ function responsiveGridGapXStyle(props) {
2821
+ let { media, space } = require_getScopedTheme.i(props.theme);
2822
+ return _responsive(media, props.$gapX, (gapX) => ({ columnGap: gapX ? rem(space[gapX]) : void 0 }));
2823
+ }
2824
+ function responsiveGridGapYStyle(props) {
2825
+ let { media, space } = require_getScopedTheme.i(props.theme);
2826
+ return _responsive(media, props.$gapY, (gapY) => ({ rowGap: gapY ? rem(space[gapY]) : void 0 }));
2827
+ }
2828
+ const StyledGrid = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
2829
+ displayName: "StyledGrid",
2830
+ componentId: "sc-osmjhz-0"
2831
+ })(responsiveGridStyle), Grid = (0, react.forwardRef)(function Grid(props, ref) {
2832
+ let $ = (0, react_compiler_runtime.c)(44), as, autoCols, autoFlow, autoRows, children, columns, gap, gapX, gapY, gridTemplateColumns, gridTemplateRows, restProps, rows;
2833
+ $[0] === props ? (as = $[1], autoCols = $[2], autoFlow = $[3], autoRows = $[4], children = $[5], columns = $[6], gap = $[7], gapX = $[8], gapY = $[9], gridTemplateColumns = $[10], gridTemplateRows = $[11], restProps = $[12], rows = $[13]) : ({as, autoRows, autoCols, autoFlow, columns, gridTemplateColumns, gap, gapX, gapY, rows, gridTemplateRows, children, ...restProps} = props, $[0] = props, $[1] = as, $[2] = autoCols, $[3] = autoFlow, $[4] = autoRows, $[5] = children, $[6] = columns, $[7] = gap, $[8] = gapX, $[9] = gapY, $[10] = gridTemplateColumns, $[11] = gridTemplateRows, $[12] = restProps, $[13] = rows);
2834
+ let t0 = typeof as == "string" ? as : void 0, t1;
2835
+ $[14] === autoRows ? t1 = $[15] : (t1 = _getArrayProp(autoRows), $[14] = autoRows, $[15] = t1);
2836
+ let t2;
2837
+ $[16] === autoCols ? t2 = $[17] : (t2 = _getArrayProp(autoCols), $[16] = autoCols, $[17] = t2);
2838
+ let t3;
2839
+ $[18] === autoFlow ? t3 = $[19] : (t3 = _getArrayProp(autoFlow), $[18] = autoFlow, $[19] = t3);
2840
+ let t4 = gridTemplateColumns === void 0 ? columns : gridTemplateColumns, t5;
2841
+ $[20] === t4 ? t5 = $[21] : (t5 = _getArrayProp(t4), $[20] = t4, $[21] = t5);
2842
+ let t6;
2843
+ $[22] === gap ? t6 = $[23] : (t6 = _getArrayProp(gap), $[22] = gap, $[23] = t6);
2844
+ let t7;
2845
+ $[24] === gapX ? t7 = $[25] : (t7 = _getArrayProp(gapX), $[24] = gapX, $[25] = t7);
2846
+ let t8;
2847
+ $[26] === gapY ? t8 = $[27] : (t8 = _getArrayProp(gapY), $[26] = gapY, $[27] = t8);
2848
+ let t9 = gridTemplateRows === void 0 ? rows : gridTemplateRows, t10;
2849
+ $[28] === t9 ? t10 = $[29] : (t10 = _getArrayProp(t9), $[28] = t9, $[29] = t10);
2850
+ let t11;
2851
+ return $[30] !== as || $[31] !== children || $[32] !== ref || $[33] !== restProps || $[34] !== t0 || $[35] !== t1 || $[36] !== t10 || $[37] !== t2 || $[38] !== t3 || $[39] !== t5 || $[40] !== t6 || $[41] !== t7 || $[42] !== t8 ? (t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledGrid, {
2852
+ "data-as": t0,
2853
+ "data-ui": "Grid",
2854
+ ...restProps,
2855
+ $autoRows: t1,
2856
+ $autoCols: t2,
2857
+ $autoFlow: t3,
2858
+ $columns: t5,
2859
+ $gap: t6,
2860
+ $gapX: t7,
2861
+ $gapY: t8,
2862
+ $rows: t10,
2863
+ forwardedAs: as,
2864
+ ref,
2865
+ children
2866
+ }), $[30] = as, $[31] = children, $[32] = ref, $[33] = restProps, $[34] = t0, $[35] = t1, $[36] = t10, $[37] = t2, $[38] = t3, $[39] = t5, $[40] = t6, $[41] = t7, $[42] = t8, $[43] = t11) : t11 = $[43], t11;
2867
+ });
2868
+ /**
2869
+ * Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
2870
+ *
2871
+ * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-color-scheme: light)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
2872
+ *
2873
+ * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
2874
+ * Chrome supports reading the `prefers-color-scheme` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme
2875
+ * @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
2876
+ *
2877
+ * @public
2878
+ */
2879
+ function usePrefersDark(t0) {
2880
+ return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$1 : t0);
2881
+ }
2882
+ function _temp$1() {
2883
+ return !1;
2884
+ }
2885
+ /**
2886
+ * @beta
2887
+ */
2888
+ function useDelayedState(initialState) {
2889
+ let $ = (0, react_compiler_runtime.c)(5), [state, setState] = (0, react.useState)(initialState), delayedAction = (0, react.useRef)(void 0), t0;
2890
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (nextState, delay) => {
2891
+ let action = () => {
2892
+ setState(nextState);
2893
+ };
2894
+ if (delayedAction.current &&= (clearTimeout(delayedAction.current), void 0), !delay) return action();
2895
+ delayedAction.current = setTimeout(action, delay);
2896
+ }, $[0] = t0) : t0 = $[0];
2897
+ let onStateChange = t0, t1, t2;
2898
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => () => {
2899
+ delayedAction.current && clearTimeout(delayedAction.current);
2900
+ }, t2 = [], $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), (0, react.useEffect)(t1, t2);
2901
+ let t3;
2902
+ return $[3] === state ? t3 = $[4] : (t3 = [state, onStateChange], $[3] = state, $[4] = t3), t3;
2903
+ }
2904
+ const DEFAULT_FALLBACK_PLACEMENTS = {
2905
+ top: [
2906
+ "top-end",
2907
+ "top-start",
2908
+ "bottom",
2909
+ "left",
2910
+ "right"
2911
+ ],
2912
+ "top-start": [
2913
+ "top",
2914
+ "top-end",
2915
+ "bottom-start",
2916
+ "left-start",
2917
+ "right-start"
2918
+ ],
2919
+ "top-end": [
2920
+ "top",
2921
+ "top-start",
2922
+ "bottom-end",
2923
+ "left-end",
2924
+ "right-end"
2925
+ ],
2926
+ bottom: [
2927
+ "bottom-end",
2928
+ "bottom-start",
2929
+ "top",
2930
+ "left",
2931
+ "right"
2932
+ ],
2933
+ "bottom-start": [
2934
+ "bottom",
2935
+ "bottom-end",
2936
+ "top-start",
2937
+ "left-start",
2938
+ "right-start"
2939
+ ],
2940
+ "bottom-end": [
2941
+ "bottom",
2942
+ "bottom-start",
2943
+ "top-end",
2944
+ "left-end",
2945
+ "right-end"
2946
+ ],
2947
+ left: [
2948
+ "left-end",
2949
+ "left-start",
2950
+ "right",
2951
+ "top",
2952
+ "bottom"
2953
+ ],
2954
+ "left-start": [
2955
+ "left",
2956
+ "left-end",
2957
+ "right-start",
2958
+ "top-start",
2959
+ "bottom-start"
2960
+ ],
2961
+ "left-end": [
2962
+ "left",
2963
+ "left-start",
2964
+ "right-end",
2965
+ "top-end",
2966
+ "bottom-end"
2967
+ ],
2968
+ right: [
2969
+ "right-end",
2970
+ "right-start",
2971
+ "left",
2972
+ "top",
2973
+ "bottom"
2974
+ ],
2975
+ "right-start": [
2976
+ "right",
2977
+ "right-end",
2978
+ "left-start",
2979
+ "top-start",
2980
+ "bottom-start"
2981
+ ],
2982
+ "right-end": [
2983
+ "right",
2984
+ "right-start",
2985
+ "left-end",
2986
+ "top-end",
2987
+ "bottom-end"
2988
+ ]
2989
+ }, MotionCard = (0, styled_components.styled)(motion_react.motion.create(Card)).withConfig({
2990
+ displayName: "MotionCard",
2991
+ componentId: "sc-k6wgsf-0"
2992
+ })`will-change:transform;`, TooltipCard = (0, react.forwardRef)(function TooltipCard(props, ref) {
2993
+ let $ = (0, react_compiler_runtime.c)(48), animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style;
2994
+ $[0] === props ? (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], restProps = $[12], scheme = $[13], shadow = $[14], style = $[15]) : ({animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, scheme, shadow, style, ...restProps} = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = restProps, $[13] = scheme, $[14] = shadow, $[15] = style);
2995
+ let t0 = animate ? "transform" : void 0, t1;
2996
+ $[16] !== originX || $[17] !== originY || $[18] !== style || $[19] !== t0 ? (t1 = {
2997
+ originX,
2998
+ originY,
2999
+ willChange: t0,
3000
+ ...style
3001
+ }, $[16] = originX, $[17] = originY, $[18] = style, $[19] = t0, $[20] = t1) : t1 = $[20];
3002
+ let rootStyle = t1, t2 = arrowX === null ? void 0 : arrowX, t3 = arrowY === null ? void 0 : arrowY, t4;
3003
+ $[21] !== t2 || $[22] !== t3 ? (t4 = {
3004
+ left: t2,
3005
+ top: t3,
3006
+ right: void 0,
3007
+ bottom: void 0
3008
+ }, $[21] = t2, $[22] = t3, $[23] = t4) : t4 = $[23];
3009
+ let arrowStyle = t4, t5 = restProps, t6;
3010
+ $[24] === animate ? t6 = $[25] : (t6 = animate ? ["hidden", "initial"] : void 0, $[24] = animate, $[25] = t6);
3011
+ let t7;
3012
+ $[26] === animate ? t7 = $[27] : (t7 = animate ? ["visible", "scaleIn"] : void 0, $[26] = animate, $[27] = t7);
3013
+ let t8;
3014
+ $[28] === animate ? t8 = $[29] : (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[28] = animate, $[29] = t8);
3015
+ let t9;
3016
+ $[30] !== arrow || $[31] !== arrowRef || $[32] !== arrowStyle ? (t9 = arrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Arrow, {
3017
+ ref: arrowRef,
3018
+ style: arrowStyle,
3019
+ width: 15,
3020
+ height: 6,
3021
+ radius: 2
3022
+ }), $[30] = arrow, $[31] = arrowRef, $[32] = arrowStyle, $[33] = t9) : t9 = $[33];
3023
+ let t10;
3024
+ return $[34] !== children || $[35] !== padding || $[36] !== placement || $[37] !== radius || $[38] !== ref || $[39] !== rootStyle || $[40] !== scheme || $[41] !== shadow || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 || $[46] !== t9 ? (t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MotionCard, {
3025
+ "data-ui": "Tooltip__card",
3026
+ ...t5,
3027
+ "data-placement": placement,
3028
+ padding,
3029
+ radius,
3030
+ ref,
3031
+ scheme,
3032
+ shadow,
3033
+ style: rootStyle,
3034
+ variants: POPOVER_MOTION_PROPS.card,
3035
+ transition: POPOVER_MOTION_PROPS.transition,
3036
+ initial: t6,
3037
+ animate: t7,
3038
+ exit: t8,
3039
+ children: [children, t9]
3040
+ }), $[34] = children, $[35] = padding, $[36] = placement, $[37] = radius, $[38] = ref, $[39] = rootStyle, $[40] = scheme, $[41] = shadow, $[42] = t5, $[43] = t6, $[44] = t7, $[45] = t8, $[46] = t9, $[47] = t10) : t10 = $[47], t10;
3041
+ }), TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
3042
+ /**
3043
+ * @beta
3044
+ */
3045
+ function useTooltipDelayGroup() {
3046
+ return (0, react.useContext)(TooltipDelayGroupContext);
3047
+ }
3048
+ const StyledTooltip = (0, styled_components.styled)(Layer).withConfig({
3049
+ displayName: "StyledTooltip",
3050
+ componentId: "sc-4nppkj-0"
3051
+ })`pointer-events:none;`, Tooltip = (0, react.forwardRef)(function Tooltip(props, forwardedRef) {
3052
+ let $ = (0, react_compiler_runtime.c)(137), boundaryElementContext = useBoundaryElement(), { layer } = useTheme_v2(), _boundaryElement, _fallbackPlacementsProp, _zOffset, childProp, content, delay, disabled, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5;
3053
+ $[0] === props ? (_boundaryElement = $[1], _fallbackPlacementsProp = $[2], _zOffset = $[3], childProp = $[4], content = $[5], delay = $[6], disabled = $[7], portalProp = $[8], restProps = $[9], scheme = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16]) : ({animate: t0, arrow: t1, boundaryElement: _boundaryElement, children: childProp, content, disabled, fallbackPlacements: _fallbackPlacementsProp, padding: t2, placement: t3, portal: portalProp, radius: t4, scheme, shadow: t5, zOffset: _zOffset, delay, ...restProps} = props, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacementsProp, $[3] = _zOffset, $[4] = childProp, $[5] = content, $[6] = delay, $[7] = disabled, $[8] = portalProp, $[9] = restProps, $[10] = scheme, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5);
3054
+ let _animate = t0 !== void 0 && t0, arrowProp = t1 !== void 0 && t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = !usePrefersReducedMotion() && _animate, t6;
3055
+ $[17] === fallbackPlacementsProp ? t6 = $[18] : (t6 = _getArrayProp(fallbackPlacementsProp), $[17] = fallbackPlacementsProp, $[18] = t6);
3056
+ let fallbackPlacements = t6, ref = (0, react.useRef)(null), [referenceElement, setReferenceElement] = (0, react.useState)(null), arrowRef = (0, react.useRef)(null), [tooltipMaxWidth, setTooltipMaxWidth] = (0, react.useState)(0), t7;
3057
+ $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], (0, react.useImperativeHandle)(forwardedRef, t7);
3058
+ let portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, t8;
3059
+ $[20] !== animate || $[21] !== arrowProp || $[22] !== boundaryElement || $[23] !== fallbackPlacements ? (t8 = {
3060
+ animate,
3061
+ arrowProp,
3062
+ arrowRef,
3063
+ boundaryElement,
3064
+ fallbackPlacements,
3065
+ rootBoundary: "viewport"
3066
+ }, $[20] = animate, $[21] = arrowProp, $[22] = boundaryElement, $[23] = fallbackPlacements, $[24] = t8) : t8 = $[24];
3067
+ let middleware = useMiddleware(t8), t9;
3068
+ $[25] === referenceElement ? t9 = $[26] : (t9 = { reference: referenceElement }, $[25] = referenceElement, $[26] = t9);
3069
+ let t10;
3070
+ $[27] !== middleware || $[28] !== placementProp || $[29] !== t9 ? (t10 = {
3071
+ middleware,
3072
+ placement: placementProp,
3073
+ whileElementsMounted: _floating_ui_react_dom.autoUpdate,
3074
+ elements: t9
3075
+ }, $[27] = middleware, $[28] = placementProp, $[29] = t9, $[30] = t10) : t10 = $[30];
3076
+ let { floatingStyles, placement, middlewareData, refs, update } = (0, _floating_ui_react_dom.useFloating)(t10), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = (0, react.useId)(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), t11;
3077
+ $[31] === delayGroupContext ? t11 = $[32] : (t11 = delayGroupContext || {}, $[31] = delayGroupContext, $[32] = t11);
3078
+ let { setIsGroupActive, setOpenTooltipId } = t11, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, t12;
3079
+ $[33] !== closeDelay || $[34] !== isInsideGroup || $[35] !== openDelay || $[36] !== setIsGroupActive || $[37] !== setIsOpen || $[38] !== setOpenTooltipId || $[39] !== tooltipId ? (t12 = (open, immediate) => {
3080
+ if (isInsideGroup) if (open) {
3081
+ let groupedOpenDelay = immediate ? 0 : openDelay;
3082
+ setIsGroupActive?.(open, groupedOpenDelay), setOpenTooltipId?.(tooltipId, groupedOpenDelay);
3083
+ } else setIsGroupActive?.(open, closeDelay > 200 ? closeDelay : 200), setOpenTooltipId?.(null, immediate ? 0 : closeDelay);
3084
+ else setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
3085
+ }, $[33] = closeDelay, $[34] = isInsideGroup, $[35] = openDelay, $[36] = setIsGroupActive, $[37] = setIsOpen, $[38] = setOpenTooltipId, $[39] = tooltipId, $[40] = t12) : t12 = $[40];
3086
+ let handleIsOpenChange = t12, t13;
3087
+ $[41] !== childProp?.props || $[42] !== handleIsOpenChange ? (t13 = (e) => {
3088
+ handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
3089
+ }, $[41] = childProp?.props, $[42] = handleIsOpenChange, $[43] = t13) : t13 = $[43], childProp?.props;
3090
+ let handleBlur = t13, t14;
3091
+ $[44] !== childProp?.props || $[45] !== handleIsOpenChange ? (t14 = (e_0) => {
3092
+ handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
3093
+ }, $[44] = childProp?.props, $[45] = handleIsOpenChange, $[46] = t14) : t14 = $[46], childProp?.props;
3094
+ let handleClick = t14, t15;
3095
+ $[47] !== childProp?.props || $[48] !== handleIsOpenChange ? (t15 = (e_1) => {
3096
+ handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
3097
+ }, $[47] = childProp?.props, $[48] = handleIsOpenChange, $[49] = t15) : t15 = $[49], childProp?.props;
3098
+ let handleContextMenu = t15, t16;
3099
+ $[50] !== childProp?.props || $[51] !== handleIsOpenChange ? (t16 = (e_2) => {
3100
+ handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
3101
+ }, $[50] = childProp?.props, $[51] = handleIsOpenChange, $[52] = t16) : t16 = $[52], childProp?.props;
3102
+ let handleFocus = t16, t17;
3103
+ $[53] !== childProp?.props || $[54] !== handleIsOpenChange ? (t17 = (e_3) => {
3104
+ handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
3105
+ }, $[53] = childProp?.props, $[54] = handleIsOpenChange, $[55] = t17) : t17 = $[55], childProp?.props;
3106
+ let handleMouseEnter = t17, t18;
3107
+ $[56] !== childProp?.props || $[57] !== handleIsOpenChange ? (t18 = (e_4) => {
3108
+ handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
3109
+ }, $[56] = childProp?.props, $[57] = handleIsOpenChange, $[58] = t18) : t18 = $[58], childProp?.props;
3110
+ let handleMouseLeave = t18, t19;
3111
+ $[59] !== handleIsOpenChange || $[60] !== isInsideGroup || $[61] !== referenceElement || $[62] !== showTooltip ? (t19 = {
3112
+ handleIsOpenChange,
3113
+ referenceElement,
3114
+ showTooltip,
3115
+ isInsideGroup
3116
+ }, $[59] = handleIsOpenChange, $[60] = isInsideGroup, $[61] = referenceElement, $[62] = showTooltip, $[63] = t19) : t19 = $[63], useCloseOnMouseLeave(t19);
3117
+ let t20, t21;
3118
+ $[64] !== disabled || $[65] !== handleIsOpenChange || $[66] !== showTooltip ? (t20 = () => {
3119
+ disabled && showTooltip && handleIsOpenChange(!1);
3120
+ }, t21 = [
3121
+ disabled,
3122
+ handleIsOpenChange,
3123
+ showTooltip
3124
+ ], $[64] = disabled, $[65] = handleIsOpenChange, $[66] = showTooltip, $[67] = t20, $[68] = t21) : (t20 = $[67], t21 = $[68]), (0, react.useEffect)(t20, t21);
3125
+ let t22, t23;
3126
+ $[69] !== content || $[70] !== handleIsOpenChange || $[71] !== showTooltip ? (t22 = () => {
3127
+ !content && showTooltip && handleIsOpenChange(!1);
3128
+ }, t23 = [
3129
+ content,
3130
+ handleIsOpenChange,
3131
+ showTooltip
3132
+ ], $[69] = content, $[70] = handleIsOpenChange, $[71] = showTooltip, $[72] = t22, $[73] = t23) : (t22 = $[72], t23 = $[73]), (0, react.useEffect)(t22, t23);
3133
+ let t24, t25;
3134
+ $[74] !== handleIsOpenChange || $[75] !== showTooltip ? (t24 = () => {
3135
+ if (!showTooltip) return;
3136
+ let handleWindowKeyDown = function handleWindowKeyDown(event) {
3137
+ event.key === "Escape" && handleIsOpenChange(!1, !0);
3138
+ };
3139
+ return window.addEventListener("keydown", handleWindowKeyDown), () => {
3140
+ window.removeEventListener("keydown", handleWindowKeyDown);
3141
+ };
3142
+ }, t25 = [handleIsOpenChange, showTooltip], $[74] = handleIsOpenChange, $[75] = showTooltip, $[76] = t24, $[77] = t25) : (t24 = $[76], t25 = $[77]), (0, react.useEffect)(t24, t25);
3143
+ let t26;
3144
+ $[78] !== boundaryElement || $[79] !== portalElement?.offsetWidth ? (t26 = () => {
3145
+ let availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
3146
+ setTooltipMaxWidth(Math.min(...availableWidths) - 8);
3147
+ }, $[78] = boundaryElement, $[79] = portalElement?.offsetWidth, $[80] = t26) : t26 = $[80];
3148
+ let t27;
3149
+ $[81] !== boundaryElement || $[82] !== portalElement ? (t27 = [boundaryElement, portalElement], $[81] = boundaryElement, $[82] = portalElement, $[83] = t27) : t27 = $[83], (0, react.useLayoutEffect)(t26, t27);
3150
+ let t28;
3151
+ $[84] === update ? t28 = $[85] : (t28 = (arrowEl) => {
3152
+ arrowRef.current = arrowEl, update();
3153
+ }, $[84] = update, $[85] = t28);
3154
+ let setArrow = t28, t29;
3155
+ $[86] === refs ? t29 = $[87] : (t29 = (node) => {
3156
+ ref.current = node, refs.setFloating(node);
3157
+ }, $[86] = refs, $[87] = t29);
3158
+ let setFloating = t29, t30;
3159
+ bb0: {
3160
+ if (!childProp) {
3161
+ t30 = null;
3162
+ break bb0;
3163
+ }
3164
+ let t31;
3165
+ $[88] !== childProp || $[89] !== handleBlur || $[90] !== handleClick || $[91] !== handleContextMenu || $[92] !== handleFocus || $[93] !== handleMouseEnter || $[94] !== handleMouseLeave ? (t31 = (0, react.cloneElement)(childProp, {
3166
+ onBlur: handleBlur,
3167
+ onFocus: handleFocus,
3168
+ onMouseEnter: handleMouseEnter,
3169
+ onMouseLeave: handleMouseLeave,
3170
+ onClick: handleClick,
3171
+ onContextMenu: handleContextMenu,
3172
+ ref: setReferenceElement
3173
+ }), $[88] = childProp, $[89] = handleBlur, $[90] = handleClick, $[91] = handleContextMenu, $[92] = handleFocus, $[93] = handleMouseEnter, $[94] = handleMouseLeave, $[95] = t31) : t31 = $[95], t30 = t31;
3174
+ }
3175
+ let child = t30, t31;
3176
+ $[96] === childProp ? t31 = $[97] : (t31 = childProp ? getElementRef(childProp) : null, $[96] = childProp, $[97] = t31);
3177
+ let t32, t33;
3178
+ if ($[98] === referenceElement ? (t32 = $[99], t33 = $[100]) : (t32 = () => referenceElement, t33 = [referenceElement], $[98] = referenceElement, $[99] = t32, $[100] = t33), (0, react.useImperativeHandle)(t31, t32, t33), !child) {
3179
+ let t34;
3180
+ return $[101] === Symbol.for("react.memo_cache_sentinel") ? (t34 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {}), $[101] = t34) : t34 = $[101], t34;
3181
+ }
3182
+ if (disabled) return child;
3183
+ let t34 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0, t35;
3184
+ $[102] !== floatingStyles || $[103] !== t34 ? (t35 = {
3185
+ ...floatingStyles,
3186
+ maxWidth: t34
3187
+ }, $[102] = floatingStyles, $[103] = t34, $[104] = t35) : t35 = $[104];
3188
+ let t36;
3189
+ $[105] !== animate || $[106] !== arrowProp || $[107] !== arrowX || $[108] !== arrowY || $[109] !== content || $[110] !== originX || $[111] !== originY || $[112] !== padding || $[113] !== placement || $[114] !== radius || $[115] !== restProps || $[116] !== scheme || $[117] !== setArrow || $[118] !== setFloating || $[119] !== shadow ? (t36 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipCard, {
3190
+ ...restProps,
3191
+ animate,
3192
+ arrow: arrowProp,
3193
+ arrowRef: setArrow,
3194
+ arrowX,
3195
+ arrowY,
3196
+ originX,
3197
+ originY,
3198
+ padding,
3199
+ placement,
3200
+ radius,
3201
+ ref: setFloating,
3202
+ scheme,
3203
+ shadow,
3204
+ children: content
3205
+ }), $[105] = animate, $[106] = arrowProp, $[107] = arrowX, $[108] = arrowY, $[109] = content, $[110] = originX, $[111] = originY, $[112] = padding, $[113] = placement, $[114] = radius, $[115] = restProps, $[116] = scheme, $[117] = setArrow, $[118] = setFloating, $[119] = shadow, $[120] = t36) : t36 = $[120];
3206
+ let t37;
3207
+ $[121] !== restProps || $[122] !== setFloating || $[123] !== t35 || $[124] !== t36 || $[125] !== zOffset ? (t37 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTooltip, {
3208
+ "data-ui": "Tooltip",
3284
3209
  ...restProps,
3285
- onKeyDown: handleKeyDown,
3286
- ref,
3287
- role: "tablist",
3288
- children: tabs
3289
- }), $[10] = handleKeyDown, $[11] = ref, $[12] = restProps, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
3210
+ ref: setFloating,
3211
+ style: t35,
3212
+ zOffset,
3213
+ children: t36
3214
+ }), $[121] = restProps, $[122] = setFloating, $[123] = t35, $[124] = t36, $[125] = zOffset, $[126] = t37) : t37 = $[126];
3215
+ let tooltip = t37, t38;
3216
+ $[127] !== portalProp || $[128] !== showTooltip || $[129] !== tooltip ? (t38 = showTooltip && (portalProp ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Portal, {
3217
+ __unstable_name: typeof portalProp == "string" ? portalProp : void 0,
3218
+ children: tooltip
3219
+ }) : tooltip), $[127] = portalProp, $[128] = showTooltip, $[129] = tooltip, $[130] = t38) : t38 = $[130];
3220
+ let children = t38, t39;
3221
+ $[131] !== animate || $[132] !== children ? (t39 = animate ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, { children }) : children, $[131] = animate, $[132] = children, $[133] = t39) : t39 = $[133];
3222
+ let t40;
3223
+ return $[134] !== child || $[135] !== t39 ? (t40 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t39, child] }), $[134] = child, $[135] = t39, $[136] = t40) : t40 = $[136], t40;
3290
3224
  });
3225
+ function useMiddleware(t0) {
3226
+ let $ = (0, react_compiler_runtime.c)(17), { animate, arrowProp, arrowRef, boundaryElement, fallbackPlacements, rootBoundary } = t0, ret;
3227
+ if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== boundaryElement || $[4] !== fallbackPlacements || $[5] !== rootBoundary) {
3228
+ ret = [];
3229
+ let t1 = boundaryElement || void 0, t2;
3230
+ $[7] !== fallbackPlacements || $[8] !== rootBoundary || $[9] !== t1 ? (t2 = (0, _floating_ui_react_dom.flip)({
3231
+ boundary: t1,
3232
+ fallbackPlacements,
3233
+ padding: 4,
3234
+ rootBoundary
3235
+ }), $[7] = fallbackPlacements, $[8] = rootBoundary, $[9] = t1, $[10] = t2) : t2 = $[10], ret.push(t2);
3236
+ let t3;
3237
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t3 = (0, _floating_ui_react_dom.offset)({ mainAxis: 4 }), $[11] = t3) : t3 = $[11], ret.push(t3);
3238
+ let t4 = boundaryElement || void 0, t5;
3239
+ if ($[12] !== rootBoundary || $[13] !== t4 ? (t5 = (0, _floating_ui_react_dom.shift)({
3240
+ boundary: t4,
3241
+ rootBoundary,
3242
+ padding: 4
3243
+ }), $[12] = rootBoundary, $[13] = t4, $[14] = t5) : t5 = $[14], ret.push(t5), arrowProp) {
3244
+ let t6;
3245
+ $[15] === arrowRef ? t6 = $[16] : (t6 = (0, _floating_ui_react_dom.arrow)({
3246
+ element: arrowRef,
3247
+ padding: 4
3248
+ }), $[15] = arrowRef, $[16] = t6), ret.push(t6);
3249
+ }
3250
+ animate && ret.push(origin), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = boundaryElement, $[4] = fallbackPlacements, $[5] = rootBoundary, $[6] = ret;
3251
+ } else ret = $[6];
3252
+ return ret;
3253
+ }
3254
+ /**
3255
+ * As `useEffectEvent` should never be passed to other components or hooks, this custom hook groups together the `useEffectEvent` and the `useEffect` hook using it.
3256
+ * @see https://19.react.dev/learn/separating-events-from-effects#reading-latest-props-and-state-with-effect-events:~:text=Never%20pass%20them%20to%20other%20components%20or%20Hooks
3257
+ */
3258
+ function useCloseOnMouseLeave(t0) {
3259
+ let $ = (0, react_compiler_runtime.c)(10), { handleIsOpenChange, referenceElement, showTooltip, isInsideGroup } = t0, t1;
3260
+ $[0] !== handleIsOpenChange || $[1] !== referenceElement ? (t1 = (target, teardown) => {
3261
+ referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
3262
+ }, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
3263
+ let onMouseMove = (0, use_effect_event.useEffectEvent)(t1), t2;
3264
+ $[3] !== isInsideGroup || $[4] !== onMouseMove || $[5] !== showTooltip ? (t2 = () => {
3265
+ if (!showTooltip || isInsideGroup) return;
3266
+ let handleMouseMove = (event) => {
3267
+ onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
3268
+ };
3269
+ return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
3270
+ }, $[3] = isInsideGroup, $[4] = onMouseMove, $[5] = showTooltip, $[6] = t2) : t2 = $[6];
3271
+ let t3;
3272
+ $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], (0, react.useEffect)(t2, t3);
3273
+ }
3274
+ /**
3275
+ * @public
3276
+ */
3277
+ function PortalProvider(props) {
3278
+ let $ = (0, react_compiler_runtime.c)(7), { boundaryElement, children, element, __unstable_elements: elements } = props, fallbackElement = (0, react.useSyncExternalStore)(emptySubscribe, _temp, _temp2), t0 = boundaryElement || null, t1 = element || fallbackElement, t2;
3279
+ $[0] !== elements || $[1] !== t0 || $[2] !== t1 ? (t2 = {
3280
+ version: 0,
3281
+ boundaryElement: t0,
3282
+ element: t1,
3283
+ elements
3284
+ }, $[0] = elements, $[1] = t0, $[2] = t1, $[3] = t2) : t2 = $[3];
3285
+ let value = t2, t3;
3286
+ return $[4] !== children || $[5] !== value ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortalContext.Provider, {
3287
+ value,
3288
+ children
3289
+ }), $[4] = children, $[5] = value, $[6] = t3) : t3 = $[6], t3;
3290
+ }
3291
+ function _temp2() {
3292
+ return null;
3293
+ }
3294
+ function _temp() {
3295
+ return document.body;
3296
+ }
3297
+ const emptySubscribe = () => () => {};
3291
3298
  Object.defineProperty(exports, "$", {
3292
3299
  enumerable: !0,
3293
3300
  get: function() {
3294
- return responsiveInputPaddingStyle;
3301
+ return Spinner;
3295
3302
  }
3296
3303
  }), Object.defineProperty(exports, "A", {
3297
3304
  enumerable: !0,
3298
3305
  get: function() {
3299
- return useMediaIndex;
3306
+ return Arrow;
3300
3307
  }
3301
3308
  }), Object.defineProperty(exports, "At", {
3302
3309
  enumerable: !0,
@@ -3306,12 +3313,12 @@ Object.defineProperty(exports, "$", {
3306
3313
  }), Object.defineProperty(exports, "B", {
3307
3314
  enumerable: !0,
3308
3315
  get: function() {
3309
- return _cardColorStyle;
3316
+ return useMediaIndex;
3310
3317
  }
3311
3318
  }), Object.defineProperty(exports, "C", {
3312
3319
  enumerable: !0,
3313
3320
  get: function() {
3314
- return BoundaryElementContext;
3321
+ return textInputRepresentationStyle;
3315
3322
  }
3316
3323
  }), Object.defineProperty(exports, "Ct", {
3317
3324
  enumerable: !0,
@@ -3321,7 +3328,7 @@ Object.defineProperty(exports, "$", {
3321
3328
  }), Object.defineProperty(exports, "D", {
3322
3329
  enumerable: !0,
3323
3330
  get: function() {
3324
- return Grid;
3331
+ return useCustomValidity;
3325
3332
  }
3326
3333
  }), Object.defineProperty(exports, "Dt", {
3327
3334
  enumerable: !0,
@@ -3331,7 +3338,7 @@ Object.defineProperty(exports, "$", {
3331
3338
  }), Object.defineProperty(exports, "E", {
3332
3339
  enumerable: !0,
3333
3340
  get: function() {
3334
- return Inline;
3341
+ return responsiveInputPaddingStyle;
3335
3342
  }
3336
3343
  }), Object.defineProperty(exports, "Et", {
3337
3344
  enumerable: !0,
@@ -3341,7 +3348,7 @@ Object.defineProperty(exports, "$", {
3341
3348
  }), Object.defineProperty(exports, "F", {
3342
3349
  enumerable: !0,
3343
3350
  get: function() {
3344
- return _ResizeObserver;
3351
+ return useBoundaryElement;
3345
3352
  }
3346
3353
  }), Object.defineProperty(exports, "Ft", {
3347
3354
  enumerable: !0,
@@ -3351,17 +3358,17 @@ Object.defineProperty(exports, "$", {
3351
3358
  }), Object.defineProperty(exports, "G", {
3352
3359
  enumerable: !0,
3353
3360
  get: function() {
3354
- return SpanWithTextOverflow;
3361
+ return ThemeColorProvider;
3355
3362
  }
3356
3363
  }), Object.defineProperty(exports, "H", {
3357
3364
  enumerable: !0,
3358
3365
  get: function() {
3359
- return Flex;
3366
+ return _elementSizeObserver;
3360
3367
  }
3361
3368
  }), Object.defineProperty(exports, "I", {
3362
3369
  enumerable: !0,
3363
3370
  get: function() {
3364
- return useCustomValidity;
3371
+ return BoundaryElementContext;
3365
3372
  }
3366
3373
  }), Object.defineProperty(exports, "It", {
3367
3374
  enumerable: !0,
@@ -3371,22 +3378,22 @@ Object.defineProperty(exports, "$", {
3371
3378
  }), Object.defineProperty(exports, "J", {
3372
3379
  enumerable: !0,
3373
3380
  get: function() {
3374
- return textInputBaseStyle;
3381
+ return createGlobalScopedContext;
3375
3382
  }
3376
3383
  }), Object.defineProperty(exports, "K", {
3377
3384
  enumerable: !0,
3378
3385
  get: function() {
3379
- return responsiveRadiusStyle;
3386
+ return useRootTheme;
3380
3387
  }
3381
3388
  }), Object.defineProperty(exports, "L", {
3382
3389
  enumerable: !0,
3383
3390
  get: function() {
3384
- return useClickOutsideEvent;
3391
+ return isRecord;
3385
3392
  }
3386
3393
  }), Object.defineProperty(exports, "M", {
3387
3394
  enumerable: !0,
3388
3395
  get: function() {
3389
- return useGlobalKeyDown;
3396
+ return usePortal;
3390
3397
  }
3391
3398
  }), Object.defineProperty(exports, "Mt", {
3392
3399
  enumerable: !0,
@@ -3396,7 +3403,7 @@ Object.defineProperty(exports, "$", {
3396
3403
  }), Object.defineProperty(exports, "N", {
3397
3404
  enumerable: !0,
3398
3405
  get: function() {
3399
- return useElementSize;
3406
+ return useLayer;
3400
3407
  }
3401
3408
  }), Object.defineProperty(exports, "Nt", {
3402
3409
  enumerable: !0,
@@ -3406,7 +3413,7 @@ Object.defineProperty(exports, "$", {
3406
3413
  }), Object.defineProperty(exports, "O", {
3407
3414
  enumerable: !0,
3408
3415
  get: function() {
3409
- return usePrefersReducedMotion;
3416
+ return Stack;
3410
3417
  }
3411
3418
  }), Object.defineProperty(exports, "Ot", {
3412
3419
  enumerable: !0,
@@ -3416,7 +3423,7 @@ Object.defineProperty(exports, "$", {
3416
3423
  }), Object.defineProperty(exports, "P", {
3417
3424
  enumerable: !0,
3418
3425
  get: function() {
3419
- return _elementSizeObserver;
3426
+ return LayerProvider;
3420
3427
  }
3421
3428
  }), Object.defineProperty(exports, "Pt", {
3422
3429
  enumerable: !0,
@@ -3426,17 +3433,17 @@ Object.defineProperty(exports, "$", {
3426
3433
  }), Object.defineProperty(exports, "Q", {
3427
3434
  enumerable: !0,
3428
3435
  get: function() {
3429
- return responsiveInputPaddingIconRightStyle;
3436
+ return _cardColorStyle;
3430
3437
  }
3431
3438
  }), Object.defineProperty(exports, "R", {
3432
3439
  enumerable: !0,
3433
3440
  get: function() {
3434
- return Card;
3441
+ return usePrefersReducedMotion;
3435
3442
  }
3436
3443
  }), Object.defineProperty(exports, "S", {
3437
3444
  enumerable: !0,
3438
3445
  get: function() {
3439
- return isRecord;
3446
+ return textInputFontSizeStyle;
3440
3447
  }
3441
3448
  }), Object.defineProperty(exports, "St", {
3442
3449
  enumerable: !0,
@@ -3446,7 +3453,7 @@ Object.defineProperty(exports, "$", {
3446
3453
  }), Object.defineProperty(exports, "T", {
3447
3454
  enumerable: !0,
3448
3455
  get: function() {
3449
- return KBD;
3456
+ return responsiveInputPaddingIconRightStyle;
3450
3457
  }
3451
3458
  }), Object.defineProperty(exports, "Tt", {
3452
3459
  enumerable: !0,
@@ -3456,37 +3463,37 @@ Object.defineProperty(exports, "$", {
3456
3463
  }), Object.defineProperty(exports, "U", {
3457
3464
  enumerable: !0,
3458
3465
  get: function() {
3459
- return Text;
3466
+ return _ResizeObserver;
3460
3467
  }
3461
3468
  }), Object.defineProperty(exports, "V", {
3462
3469
  enumerable: !0,
3463
3470
  get: function() {
3464
- return Spinner;
3471
+ return useElementSize;
3465
3472
  }
3466
3473
  }), Object.defineProperty(exports, "W", {
3467
3474
  enumerable: !0,
3468
3475
  get: function() {
3469
- return Box;
3476
+ return Card;
3470
3477
  }
3471
3478
  }), Object.defineProperty(exports, "X", {
3472
3479
  enumerable: !0,
3473
3480
  get: function() {
3474
- return textInputRepresentationStyle;
3481
+ return focusRingBorderStyle;
3475
3482
  }
3476
3483
  }), Object.defineProperty(exports, "Y", {
3477
3484
  enumerable: !0,
3478
3485
  get: function() {
3479
- return textInputFontSizeStyle;
3486
+ return Button;
3480
3487
  }
3481
3488
  }), Object.defineProperty(exports, "Z", {
3482
3489
  enumerable: !0,
3483
3490
  get: function() {
3484
- return textInputRootStyle;
3491
+ return focusRingStyle;
3485
3492
  }
3486
3493
  }), Object.defineProperty(exports, "_", {
3487
3494
  enumerable: !0,
3488
3495
  get: function() {
3489
- return usePortal;
3496
+ return Layer;
3490
3497
  }
3491
3498
  }), Object.defineProperty(exports, "_t", {
3492
3499
  enumerable: !0,
@@ -3496,17 +3503,17 @@ Object.defineProperty(exports, "$", {
3496
3503
  }), Object.defineProperty(exports, "a", {
3497
3504
  enumerable: !0,
3498
3505
  get: function() {
3499
- return MenuDivider;
3506
+ return useDelayedState;
3500
3507
  }
3501
3508
  }), Object.defineProperty(exports, "at", {
3502
3509
  enumerable: !0,
3503
3510
  get: function() {
3504
- return useRootTheme;
3511
+ return Flex;
3505
3512
  }
3506
3513
  }), Object.defineProperty(exports, "b", {
3507
3514
  enumerable: !0,
3508
3515
  get: function() {
3509
- return LayerProvider;
3516
+ return TextInput;
3510
3517
  }
3511
3518
  }), Object.defineProperty(exports, "bt", {
3512
3519
  enumerable: !0,
@@ -3516,17 +3523,17 @@ Object.defineProperty(exports, "$", {
3516
3523
  }), Object.defineProperty(exports, "c", {
3517
3524
  enumerable: !0,
3518
3525
  get: function() {
3519
- return Tooltip;
3526
+ return TabList;
3520
3527
  }
3521
3528
  }), Object.defineProperty(exports, "ct", {
3522
3529
  enumerable: !0,
3523
3530
  get: function() {
3524
- return responsiveTextFont;
3531
+ return responsiveRadiusStyle;
3525
3532
  }
3526
3533
  }), Object.defineProperty(exports, "d", {
3527
3534
  enumerable: !0,
3528
3535
  get: function() {
3529
- return useDelayedState;
3536
+ return MenuGroup;
3530
3537
  }
3531
3538
  }), Object.defineProperty(exports, "dt", {
3532
3539
  enumerable: !0,
@@ -3536,12 +3543,12 @@ Object.defineProperty(exports, "$", {
3536
3543
  }), Object.defineProperty(exports, "et", {
3537
3544
  enumerable: !0,
3538
3545
  get: function() {
3539
- return focusRingBorderStyle;
3546
+ return Text;
3540
3547
  }
3541
3548
  }), Object.defineProperty(exports, "f", {
3542
3549
  enumerable: !0,
3543
3550
  get: function() {
3544
- return TextInput;
3551
+ return MenuDivider;
3545
3552
  }
3546
3553
  }), Object.defineProperty(exports, "ft", {
3547
3554
  enumerable: !0,
@@ -3551,7 +3558,7 @@ Object.defineProperty(exports, "$", {
3551
3558
  }), Object.defineProperty(exports, "g", {
3552
3559
  enumerable: !0,
3553
3560
  get: function() {
3554
- return Portal;
3561
+ return Inline;
3555
3562
  }
3556
3563
  }), Object.defineProperty(exports, "gt", {
3557
3564
  enumerable: !0,
@@ -3561,7 +3568,7 @@ Object.defineProperty(exports, "$", {
3561
3568
  }), Object.defineProperty(exports, "h", {
3562
3569
  enumerable: !0,
3563
3570
  get: function() {
3564
- return PortalProvider;
3571
+ return KBD;
3565
3572
  }
3566
3573
  }), Object.defineProperty(exports, "ht", {
3567
3574
  enumerable: !0,
@@ -3571,17 +3578,17 @@ Object.defineProperty(exports, "$", {
3571
3578
  }), Object.defineProperty(exports, "i", {
3572
3579
  enumerable: !0,
3573
3580
  get: function() {
3574
- return MenuGroup;
3581
+ return TooltipDelayGroupContext;
3575
3582
  }
3576
3583
  }), Object.defineProperty(exports, "it", {
3577
3584
  enumerable: !0,
3578
3585
  get: function() {
3579
- return ThemeColorProvider;
3586
+ return responsiveTextAlignStyle;
3580
3587
  }
3581
3588
  }), Object.defineProperty(exports, "j", {
3582
3589
  enumerable: !0,
3583
3590
  get: function() {
3584
- return useMatchMedia;
3591
+ return Portal;
3585
3592
  }
3586
3593
  }), Object.defineProperty(exports, "jt", {
3587
3594
  enumerable: !0,
@@ -3591,7 +3598,7 @@ Object.defineProperty(exports, "$", {
3591
3598
  }), Object.defineProperty(exports, "k", {
3592
3599
  enumerable: !0,
3593
3600
  get: function() {
3594
- return usePrefersDark;
3601
+ return Popover;
3595
3602
  }
3596
3603
  }), Object.defineProperty(exports, "kt", {
3597
3604
  enumerable: !0,
@@ -3601,17 +3608,17 @@ Object.defineProperty(exports, "$", {
3601
3608
  }), Object.defineProperty(exports, "l", {
3602
3609
  enumerable: !0,
3603
3610
  get: function() {
3604
- return useTooltipDelayGroup;
3611
+ return Tab;
3605
3612
  }
3606
3613
  }), Object.defineProperty(exports, "lt", {
3607
3614
  enumerable: !0,
3608
3615
  get: function() {
3609
- return responsiveTextAlignStyle;
3616
+ return Box;
3610
3617
  }
3611
3618
  }), Object.defineProperty(exports, "m", {
3612
3619
  enumerable: !0,
3613
3620
  get: function() {
3614
- return Popover;
3621
+ return Hotkeys;
3615
3622
  }
3616
3623
  }), Object.defineProperty(exports, "mt", {
3617
3624
  enumerable: !0,
@@ -3621,27 +3628,27 @@ Object.defineProperty(exports, "$", {
3621
3628
  }), Object.defineProperty(exports, "n", {
3622
3629
  enumerable: !0,
3623
3630
  get: function() {
3624
- return Tab;
3631
+ return Tooltip;
3625
3632
  }
3626
3633
  }), Object.defineProperty(exports, "nt", {
3627
3634
  enumerable: !0,
3628
3635
  get: function() {
3629
- return useTheme;
3636
+ return responsiveTextFont;
3630
3637
  }
3631
3638
  }), Object.defineProperty(exports, "o", {
3632
3639
  enumerable: !0,
3633
3640
  get: function() {
3634
- return Menu;
3641
+ return usePrefersDark;
3635
3642
  }
3636
3643
  }), Object.defineProperty(exports, "ot", {
3637
3644
  enumerable: !0,
3638
3645
  get: function() {
3639
- return ThemeProvider;
3646
+ return useTheme;
3640
3647
  }
3641
3648
  }), Object.defineProperty(exports, "p", {
3642
3649
  enumerable: !0,
3643
3650
  get: function() {
3644
- return Stack;
3651
+ return Menu;
3645
3652
  }
3646
3653
  }), Object.defineProperty(exports, "pt", {
3647
3654
  enumerable: !0,
@@ -3651,52 +3658,52 @@ Object.defineProperty(exports, "$", {
3651
3658
  }), Object.defineProperty(exports, "q", {
3652
3659
  enumerable: !0,
3653
3660
  get: function() {
3654
- return responsivePaddingStyle;
3661
+ return ThemeProvider;
3655
3662
  }
3656
3663
  }), Object.defineProperty(exports, "r", {
3657
3664
  enumerable: !0,
3658
3665
  get: function() {
3659
- return MenuItem;
3666
+ return useTooltipDelayGroup;
3660
3667
  }
3661
3668
  }), Object.defineProperty(exports, "rt", {
3662
3669
  enumerable: !0,
3663
3670
  get: function() {
3664
- return useTheme_v2;
3671
+ return responsiveFont;
3665
3672
  }
3666
3673
  }), Object.defineProperty(exports, "s", {
3667
3674
  enumerable: !0,
3668
3675
  get: function() {
3669
- return Hotkeys;
3676
+ return Grid;
3670
3677
  }
3671
3678
  }), Object.defineProperty(exports, "st", {
3672
3679
  enumerable: !0,
3673
3680
  get: function() {
3674
- return createGlobalScopedContext;
3681
+ return useTheme_v2;
3675
3682
  }
3676
3683
  }), Object.defineProperty(exports, "t", {
3677
3684
  enumerable: !0,
3678
3685
  get: function() {
3679
- return TabList;
3686
+ return PortalProvider;
3680
3687
  }
3681
3688
  }), Object.defineProperty(exports, "tt", {
3682
3689
  enumerable: !0,
3683
3690
  get: function() {
3684
- return focusRingStyle;
3691
+ return SpanWithTextOverflow;
3685
3692
  }
3686
3693
  }), Object.defineProperty(exports, "u", {
3687
3694
  enumerable: !0,
3688
3695
  get: function() {
3689
- return TooltipDelayGroupContext;
3696
+ return MenuItem;
3690
3697
  }
3691
3698
  }), Object.defineProperty(exports, "ut", {
3692
3699
  enumerable: !0,
3693
3700
  get: function() {
3694
- return responsiveFont;
3701
+ return responsivePaddingStyle;
3695
3702
  }
3696
3703
  }), Object.defineProperty(exports, "v", {
3697
3704
  enumerable: !0,
3698
3705
  get: function() {
3699
- return Layer;
3706
+ return useGlobalKeyDown;
3700
3707
  }
3701
3708
  }), Object.defineProperty(exports, "vt", {
3702
3709
  enumerable: !0,
@@ -3706,7 +3713,7 @@ Object.defineProperty(exports, "$", {
3706
3713
  }), Object.defineProperty(exports, "w", {
3707
3714
  enumerable: !0,
3708
3715
  get: function() {
3709
- return Arrow;
3716
+ return textInputRootStyle;
3710
3717
  }
3711
3718
  }), Object.defineProperty(exports, "wt", {
3712
3719
  enumerable: !0,
@@ -3716,7 +3723,7 @@ Object.defineProperty(exports, "$", {
3716
3723
  }), Object.defineProperty(exports, "x", {
3717
3724
  enumerable: !0,
3718
3725
  get: function() {
3719
- return useBoundaryElement;
3726
+ return textInputBaseStyle;
3720
3727
  }
3721
3728
  }), Object.defineProperty(exports, "xt", {
3722
3729
  enumerable: !0,
@@ -3726,7 +3733,7 @@ Object.defineProperty(exports, "$", {
3726
3733
  }), Object.defineProperty(exports, "y", {
3727
3734
  enumerable: !0,
3728
3735
  get: function() {
3729
- return useLayer;
3736
+ return useClickOutsideEvent;
3730
3737
  }
3731
3738
  }), Object.defineProperty(exports, "yt", {
3732
3739
  enumerable: !0,
@@ -3736,8 +3743,8 @@ Object.defineProperty(exports, "$", {
3736
3743
  }), Object.defineProperty(exports, "z", {
3737
3744
  enumerable: !0,
3738
3745
  get: function() {
3739
- return Button;
3746
+ return useMatchMedia;
3740
3747
  }
3741
3748
  });
3742
3749
 
3743
- //# sourceMappingURL=tabList.cjs.map
3750
+ //# sourceMappingURL=portalProvider.cjs.map