@sanity/ui 3.3.1 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (651) hide show
  1. package/dist/_visual-editing.d.mts +2 -1126
  2. package/dist/_visual-editing.d.ts +2 -1126
  3. package/dist/_visual-editing.js +3 -31
  4. package/dist/_visual-editing.mjs +2 -31
  5. package/dist/index.d.mts +555 -2769
  6. package/dist/index.d.mts.map +1 -0
  7. package/dist/index.d.ts +555 -2769
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +2982 -1934
  10. package/dist/index.mjs +2950 -1903
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/refractor.js +16 -0
  13. package/dist/refractor.mjs +21 -0
  14. package/dist/refractor.mjs.map +1 -0
  15. package/dist/tabList.js +3804 -0
  16. package/dist/tabList.mjs +3355 -0
  17. package/dist/tabList.mjs.map +1 -0
  18. package/dist/theme.d.mts +927 -1227
  19. package/dist/theme.d.mts.map +1 -0
  20. package/dist/theme.d.ts +927 -1227
  21. package/dist/theme.d.ts.map +1 -0
  22. package/dist/theme.js +3 -4127
  23. package/dist/theme.mjs +2 -4127
  24. package/dist/theme2.d.mts +2 -0
  25. package/dist/theme2.d.ts +2 -0
  26. package/dist/theme2.js +4104 -0
  27. package/dist/theme2.mjs +3851 -0
  28. package/dist/theme2.mjs.map +1 -0
  29. package/dist/useTheme.d.mts +1451 -0
  30. package/dist/useTheme.d.mts.map +1 -0
  31. package/dist/useTheme.d.ts +1451 -0
  32. package/dist/useTheme.d.ts.map +1 -0
  33. package/package.json +48 -106
  34. package/dist/_chunks-cjs/_visual-editing.js +0 -5899
  35. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  36. package/dist/_chunks-cjs/refractor.js +0 -23
  37. package/dist/_chunks-cjs/refractor.js.map +0 -1
  38. package/dist/_chunks-es/_visual-editing.mjs +0 -5905
  39. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  40. package/dist/_chunks-es/refractor.mjs +0 -26
  41. package/dist/_chunks-es/refractor.mjs.map +0 -1
  42. package/dist/_visual-editing.js.map +0 -1
  43. package/dist/_visual-editing.mjs.map +0 -1
  44. package/dist/index.js.map +0 -1
  45. package/dist/theme.js.map +0 -1
  46. package/dist/theme.mjs.map +0 -1
  47. package/exports/_visual-editing.ts +0 -31
  48. package/exports/index.ts +0 -1
  49. package/exports/theme.ts +0 -1
  50. package/src/core/__workshop__/constants.ts +0 -293
  51. package/src/core/_compat.ts +0 -264
  52. package/src/core/components/autocomplete/__mocks__/apiStore.ts +0 -49
  53. package/src/core/components/autocomplete/__mocks__/countries.ts +0 -245
  54. package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
  55. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -137
  56. package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -89
  57. package/src/core/components/autocomplete/__workshop__/example.tsx +0 -79
  58. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
  59. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -294
  60. package/src/core/components/autocomplete/__workshop__/index.ts +0 -39
  61. package/src/core/components/autocomplete/__workshop__/types.ts +0 -4
  62. package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -39
  63. package/src/core/components/autocomplete/autocomplete.tsx +0 -767
  64. package/src/core/components/autocomplete/autocompleteOption.tsx +0 -45
  65. package/src/core/components/autocomplete/autocompleteReducer.ts +0 -47
  66. package/src/core/components/autocomplete/constants.ts +0 -28
  67. package/src/core/components/autocomplete/index.ts +0 -2
  68. package/src/core/components/autocomplete/types.ts +0 -108
  69. package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -62
  70. package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -14
  71. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -18
  72. package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +0 -51
  73. package/src/core/components/breadcrumbs/breadcrumbs.tsx +0 -133
  74. package/src/core/components/breadcrumbs/index.ts +0 -1
  75. package/src/core/components/dialog/__workshop__/activate.tsx +0 -134
  76. package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
  77. package/src/core/components/dialog/__workshop__/index.ts +0 -19
  78. package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
  79. package/src/core/components/dialog/__workshop__/nested.tsx +0 -72
  80. package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -39
  81. package/src/core/components/dialog/__workshop__/panes.tsx +0 -82
  82. package/src/core/components/dialog/__workshop__/position.tsx +0 -30
  83. package/src/core/components/dialog/__workshop__/props.tsx +0 -75
  84. package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
  85. package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
  86. package/src/core/components/dialog/dialog.tsx +0 -430
  87. package/src/core/components/dialog/dialogContext.ts +0 -20
  88. package/src/core/components/dialog/dialogProvider.tsx +0 -35
  89. package/src/core/components/dialog/index.ts +0 -4
  90. package/src/core/components/dialog/styles.ts +0 -77
  91. package/src/core/components/dialog/useDialog.ts +0 -11
  92. package/src/core/components/hotkeys/__workshop__/index.ts +0 -14
  93. package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
  94. package/src/core/components/hotkeys/hotkeys.test.tsx +0 -42
  95. package/src/core/components/hotkeys/hotkeys.tsx +0 -66
  96. package/src/core/components/hotkeys/index.ts +0 -1
  97. package/src/core/components/index.ts +0 -9
  98. package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
  99. package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -51
  100. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -46
  101. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
  102. package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
  103. package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -39
  104. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
  105. package/src/core/components/menu/__workshop__/groups.tsx +0 -156
  106. package/src/core/components/menu/__workshop__/index.ts +0 -89
  107. package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
  108. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -65
  109. package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
  110. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
  111. package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
  112. package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -47
  113. package/src/core/components/menu/__workshop__/tones.tsx +0 -25
  114. package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
  115. package/src/core/components/menu/helpers.ts +0 -82
  116. package/src/core/components/menu/index.ts +0 -5
  117. package/src/core/components/menu/menu.spacing.test.tsx +0 -63
  118. package/src/core/components/menu/menu.test.tsx +0 -125
  119. package/src/core/components/menu/menu.tsx +0 -178
  120. package/src/core/components/menu/menuButton.tsx +0 -268
  121. package/src/core/components/menu/menuContext.ts +0 -18
  122. package/src/core/components/menu/menuDivider.ts +0 -23
  123. package/src/core/components/menu/menuGroup.spacing.test.tsx +0 -63
  124. package/src/core/components/menu/menuGroup.tsx +0 -233
  125. package/src/core/components/menu/menuItem.spacing.test.tsx +0 -59
  126. package/src/core/components/menu/menuItem.tsx +0 -197
  127. package/src/core/components/menu/useMenu.ts +0 -21
  128. package/src/core/components/menu/useMenuController.ts +0 -231
  129. package/src/core/components/skeleton/__workshop__/delay.tsx +0 -70
  130. package/src/core/components/skeleton/__workshop__/index.ts +0 -11
  131. package/src/core/components/skeleton/__workshop__/skeleton.tsx +0 -64
  132. package/src/core/components/skeleton/index.ts +0 -2
  133. package/src/core/components/skeleton/skeleton.tsx +0 -57
  134. package/src/core/components/skeleton/styles.ts +0 -50
  135. package/src/core/components/skeleton/textSkeleton.tsx +0 -122
  136. package/src/core/components/tab/__workshop__/example.tsx +0 -79
  137. package/src/core/components/tab/__workshop__/index.ts +0 -14
  138. package/src/core/components/tab/index.ts +0 -3
  139. package/src/core/components/tab/tab.tsx +0 -101
  140. package/src/core/components/tab/tabList.test.tsx +0 -48
  141. package/src/core/components/tab/tabList.tsx +0 -70
  142. package/src/core/components/tab/tabPanel.tsx +0 -39
  143. package/src/core/components/toast/__workshop__/hook.tsx +0 -71
  144. package/src/core/components/toast/__workshop__/index.ts +0 -19
  145. package/src/core/components/toast/__workshop__/toast.tsx +0 -26
  146. package/src/core/components/toast/index.ts +0 -4
  147. package/src/core/components/toast/styles.ts +0 -77
  148. package/src/core/components/toast/toast.test.tsx +0 -101
  149. package/src/core/components/toast/toast.tsx +0 -198
  150. package/src/core/components/toast/toastContext.ts +0 -7
  151. package/src/core/components/toast/toastLayer.tsx +0 -51
  152. package/src/core/components/toast/toastProvider.tsx +0 -113
  153. package/src/core/components/toast/toastState.ts +0 -6
  154. package/src/core/components/toast/types.ts +0 -26
  155. package/src/core/components/toast/useToast.ts +0 -25
  156. package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
  157. package/src/core/components/tree/__workshop__/basic.tsx +0 -105
  158. package/src/core/components/tree/__workshop__/index.ts +0 -21
  159. package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
  160. package/src/core/components/tree/helpers.ts +0 -105
  161. package/src/core/components/tree/index.ts +0 -4
  162. package/src/core/components/tree/style.ts +0 -105
  163. package/src/core/components/tree/tree.test.tsx +0 -55
  164. package/src/core/components/tree/tree.tsx +0 -240
  165. package/src/core/components/tree/treeContext.ts +0 -10
  166. package/src/core/components/tree/treeGroup.tsx +0 -28
  167. package/src/core/components/tree/treeItem.test.tsx +0 -65
  168. package/src/core/components/tree/treeItem.tsx +0 -224
  169. package/src/core/components/tree/types.ts +0 -25
  170. package/src/core/components/tree/useTree.ts +0 -17
  171. package/src/core/constants.ts +0 -79
  172. package/src/core/helpers/animation.ts +0 -27
  173. package/src/core/helpers/element.ts +0 -55
  174. package/src/core/helpers/focus.ts +0 -100
  175. package/src/core/helpers/index.ts +0 -4
  176. package/src/core/helpers/scroll.ts +0 -15
  177. package/src/core/hooks/index.ts +0 -12
  178. package/src/core/hooks/useArrayProp.ts +0 -17
  179. package/src/core/hooks/useClickOutside.test.tsx +0 -482
  180. package/src/core/hooks/useClickOutside.ts +0 -118
  181. package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -115
  182. package/src/core/hooks/useClickOutsideEvent.ts +0 -73
  183. package/src/core/hooks/useCustomValidity.ts +0 -13
  184. package/src/core/hooks/useDelayed.test.ts +0 -88
  185. package/src/core/hooks/useDelayedState.ts +0 -36
  186. package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -32
  187. package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
  188. package/src/core/hooks/useElementRect/index.ts +0 -1
  189. package/src/core/hooks/useElementRect/useElementRect.ts +0 -13
  190. package/src/core/hooks/useElementSize.ts +0 -19
  191. package/src/core/hooks/useForwardedRef.ts +0 -19
  192. package/src/core/hooks/useGlobalKeyDown.ts +0 -24
  193. package/src/core/hooks/useIsomorphicEffect.ts +0 -7
  194. package/src/core/hooks/useMatchMedia.ts +0 -28
  195. package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -14
  196. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
  197. package/src/core/hooks/useMediaIndex/index.ts +0 -1
  198. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -36
  199. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +0 -102
  200. package/src/core/hooks/useMounted.ts +0 -15
  201. package/src/core/hooks/usePrefersDark.hydration.test.tsx +0 -56
  202. package/src/core/hooks/usePrefersDark.test.tsx +0 -19
  203. package/src/core/hooks/usePrefersDark.ts +0 -16
  204. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
  205. package/src/core/hooks/usePrefersReducedMotion.test.tsx +0 -19
  206. package/src/core/hooks/usePrefersReducedMotion.ts +0 -16
  207. package/src/core/index.ts +0 -10
  208. package/src/core/lib/createGlobalScopedContext.ts +0 -36
  209. package/src/core/lib/globalScope.ts +0 -19
  210. package/src/core/lib/isRecord.ts +0 -3
  211. package/src/core/middleware/origin.ts +0 -47
  212. package/src/core/observers/elementSizeObserver.ts +0 -116
  213. package/src/core/observers/index.ts +0 -2
  214. package/src/core/observers/resizeObserver.ts +0 -9
  215. package/src/core/primitives/_selectable/index.ts +0 -1
  216. package/src/core/primitives/_selectable/selectable.tsx +0 -15
  217. package/src/core/primitives/_selectable/style.ts +0 -115
  218. package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
  219. package/src/core/primitives/avatar/__workshop__/index.ts +0 -29
  220. package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
  221. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -63
  222. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -70
  223. package/src/core/primitives/avatar/avatar.tsx +0 -200
  224. package/src/core/primitives/avatar/avatarCounter.tsx +0 -91
  225. package/src/core/primitives/avatar/avatarStack.tsx +0 -100
  226. package/src/core/primitives/avatar/index.ts +0 -4
  227. package/src/core/primitives/avatar/styles.ts +0 -167
  228. package/src/core/primitives/avatar/types.ts +0 -17
  229. package/src/core/primitives/badge/__workshop__/index.ts +0 -19
  230. package/src/core/primitives/badge/__workshop__/props.tsx +0 -30
  231. package/src/core/primitives/badge/__workshop__/tones.tsx +0 -21
  232. package/src/core/primitives/badge/badge.test.tsx +0 -16
  233. package/src/core/primitives/badge/badge.tsx +0 -70
  234. package/src/core/primitives/badge/index.ts +0 -1
  235. package/src/core/primitives/badge/styles.ts +0 -20
  236. package/src/core/primitives/badge/types.ts +0 -8
  237. package/src/core/primitives/box/__workshop__/asComponent.tsx +0 -31
  238. package/src/core/primitives/box/__workshop__/index.ts +0 -24
  239. package/src/core/primitives/box/__workshop__/props.tsx +0 -20
  240. package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
  241. package/src/core/primitives/box/box.test.tsx +0 -142
  242. package/src/core/primitives/box/box.tsx +0 -154
  243. package/src/core/primitives/box/index.ts +0 -1
  244. package/src/core/primitives/button/__workshop__/custom.tsx +0 -51
  245. package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
  246. package/src/core/primitives/button/__workshop__/disabled.tsx +0 -74
  247. package/src/core/primitives/button/__workshop__/index.ts +0 -59
  248. package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
  249. package/src/core/primitives/button/__workshop__/props.tsx +0 -55
  250. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
  251. package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
  252. package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
  253. package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
  254. package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -28
  255. package/src/core/primitives/button/button.test.tsx +0 -82
  256. package/src/core/primitives/button/button.tsx +0 -210
  257. package/src/core/primitives/button/index.ts +0 -1
  258. package/src/core/primitives/button/styles.ts +0 -117
  259. package/src/core/primitives/card/__workshop__/allTones.tsx +0 -25
  260. package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
  261. package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
  262. package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
  263. package/src/core/primitives/card/__workshop__/index.ts +0 -18
  264. package/src/core/primitives/card/__workshop__/interactive.tsx +0 -30
  265. package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -80
  266. package/src/core/primitives/card/__workshop__/props.tsx +0 -53
  267. package/src/core/primitives/card/__workshop__/selected.tsx +0 -94
  268. package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
  269. package/src/core/primitives/card/card.tsx +0 -128
  270. package/src/core/primitives/card/index.ts +0 -2
  271. package/src/core/primitives/card/styles.ts +0 -147
  272. package/src/core/primitives/card/types.ts +0 -11
  273. package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
  274. package/src/core/primitives/checkbox/__workshop__/index.ts +0 -13
  275. package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -33
  276. package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
  277. package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -28
  278. package/src/core/primitives/checkbox/checkbox.tsx +0 -73
  279. package/src/core/primitives/checkbox/index.ts +0 -1
  280. package/src/core/primitives/checkbox/styles.ts +0 -128
  281. package/src/core/primitives/code/__workshop__/index.ts +0 -19
  282. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
  283. package/src/core/primitives/code/__workshop__/props.tsx +0 -21
  284. package/src/core/primitives/code/code.tsx +0 -55
  285. package/src/core/primitives/code/index.ts +0 -1
  286. package/src/core/primitives/code/refractor.tsx +0 -20
  287. package/src/core/primitives/code/styles.ts +0 -77
  288. package/src/core/primitives/container/__workshop__/example.tsx +0 -20
  289. package/src/core/primitives/container/__workshop__/index.ts +0 -8
  290. package/src/core/primitives/container/container.tsx +0 -54
  291. package/src/core/primitives/container/index.ts +0 -2
  292. package/src/core/primitives/container/styles.ts +0 -23
  293. package/src/core/primitives/container/types.ts +0 -6
  294. package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
  295. package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
  296. package/src/core/primitives/flex/__workshop__/index.ts +0 -11
  297. package/src/core/primitives/flex/flex.tsx +0 -64
  298. package/src/core/primitives/flex/index.ts +0 -1
  299. package/src/core/primitives/grid/__workshop__/index.ts +0 -10
  300. package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
  301. package/src/core/primitives/grid/grid.test.tsx +0 -80
  302. package/src/core/primitives/grid/grid.tsx +0 -74
  303. package/src/core/primitives/grid/index.ts +0 -1
  304. package/src/core/primitives/heading/__workshop__/index.ts +0 -19
  305. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
  306. package/src/core/primitives/heading/__workshop__/plain.tsx +0 -32
  307. package/src/core/primitives/heading/heading.tsx +0 -88
  308. package/src/core/primitives/heading/index.ts +0 -1
  309. package/src/core/primitives/heading/styles.ts +0 -64
  310. package/src/core/primitives/heading/types.ts +0 -7
  311. package/src/core/primitives/index.ts +0 -27
  312. package/src/core/primitives/inline/__workshop__/index.ts +0 -8
  313. package/src/core/primitives/inline/__workshop__/plain.tsx +0 -27
  314. package/src/core/primitives/inline/index.ts +0 -1
  315. package/src/core/primitives/inline/inline.test.tsx +0 -51
  316. package/src/core/primitives/inline/inline.tsx +0 -63
  317. package/src/core/primitives/inline/styles.ts +0 -32
  318. package/src/core/primitives/inline/types.ts +0 -6
  319. package/src/core/primitives/kbd/__workshop__/index.ts +0 -8
  320. package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
  321. package/src/core/primitives/kbd/index.ts +0 -1
  322. package/src/core/primitives/kbd/kbd.tsx +0 -69
  323. package/src/core/primitives/label/__workshop__/index.ts +0 -19
  324. package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -48
  325. package/src/core/primitives/label/__workshop__/plain.tsx +0 -24
  326. package/src/core/primitives/label/index.ts +0 -1
  327. package/src/core/primitives/label/label.tsx +0 -87
  328. package/src/core/primitives/label/styles.ts +0 -45
  329. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
  330. package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
  331. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
  332. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
  333. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
  334. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
  335. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -89
  336. package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -97
  337. package/src/core/primitives/popover/__workshop__/index.ts +0 -49
  338. package/src/core/primitives/popover/constants.ts +0 -22
  339. package/src/core/primitives/popover/floating-ui/size.ts +0 -99
  340. package/src/core/primitives/popover/helpers.ts +0 -31
  341. package/src/core/primitives/popover/index.ts +0 -2
  342. package/src/core/primitives/popover/popover.tsx +0 -511
  343. package/src/core/primitives/popover/popoverCard.tsx +0 -166
  344. package/src/core/primitives/popover/types.ts +0 -7
  345. package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
  346. package/src/core/primitives/radio/__workshop__/index.ts +0 -11
  347. package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
  348. package/src/core/primitives/radio/index.ts +0 -1
  349. package/src/core/primitives/radio/radio.tsx +0 -51
  350. package/src/core/primitives/radio/styles.ts +0 -117
  351. package/src/core/primitives/select/__workshop__/index.ts +0 -11
  352. package/src/core/primitives/select/__workshop__/plain.tsx +0 -27
  353. package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
  354. package/src/core/primitives/select/index.ts +0 -1
  355. package/src/core/primitives/select/select.test.tsx +0 -52
  356. package/src/core/primitives/select/select.tsx +0 -94
  357. package/src/core/primitives/select/styles.ts +0 -166
  358. package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
  359. package/src/core/primitives/spinner/__workshop__/index.ts +0 -14
  360. package/src/core/primitives/spinner/index.ts +0 -1
  361. package/src/core/primitives/spinner/spinner.tsx +0 -46
  362. package/src/core/primitives/stack/__workshop__/index.ts +0 -14
  363. package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
  364. package/src/core/primitives/stack/index.ts +0 -1
  365. package/src/core/primitives/stack/stack.test.tsx +0 -57
  366. package/src/core/primitives/stack/stack.tsx +0 -57
  367. package/src/core/primitives/stack/styles.ts +0 -32
  368. package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
  369. package/src/core/primitives/switch/__workshop__/index.ts +0 -11
  370. package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
  371. package/src/core/primitives/switch/index.ts +0 -1
  372. package/src/core/primitives/switch/styles.ts +0 -173
  373. package/src/core/primitives/switch/switch.tsx +0 -68
  374. package/src/core/primitives/text/__workshop__/colored.tsx +0 -30
  375. package/src/core/primitives/text/__workshop__/example.tsx +0 -39
  376. package/src/core/primitives/text/__workshop__/index.ts +0 -24
  377. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
  378. package/src/core/primitives/text/index.ts +0 -1
  379. package/src/core/primitives/text/styles.ts +0 -74
  380. package/src/core/primitives/text/text.tsx +0 -89
  381. package/src/core/primitives/textArea/__workshop__/index.ts +0 -14
  382. package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -50
  383. package/src/core/primitives/textArea/index.ts +0 -1
  384. package/src/core/primitives/textArea/textArea.tsx +0 -120
  385. package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
  386. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
  387. package/src/core/primitives/textInput/__workshop__/index.ts +0 -44
  388. package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -98
  389. package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
  390. package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
  391. package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
  392. package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
  393. package/src/core/primitives/textInput/index.ts +0 -1
  394. package/src/core/primitives/textInput/textInput.test.tsx +0 -48
  395. package/src/core/primitives/textInput/textInput.tsx +0 -395
  396. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
  397. package/src/core/primitives/tooltip/__workshop__/index.ts +0 -29
  398. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
  399. package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -107
  400. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
  401. package/src/core/primitives/tooltip/constants.ts +0 -23
  402. package/src/core/primitives/tooltip/index.ts +0 -2
  403. package/src/core/primitives/tooltip/tooltip.test.tsx +0 -452
  404. package/src/core/primitives/tooltip/tooltip.tsx +0 -495
  405. package/src/core/primitives/tooltip/tooltipCard.tsx +0 -109
  406. package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +0 -4
  407. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -11
  408. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -57
  409. package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +0 -10
  410. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
  411. package/src/core/primitives/types.ts +0 -179
  412. package/src/core/styles/border/borderStyle.ts +0 -56
  413. package/src/core/styles/border/index.ts +0 -2
  414. package/src/core/styles/border/types.ts +0 -10
  415. package/src/core/styles/box/boxStyle.ts +0 -69
  416. package/src/core/styles/box/index.ts +0 -2
  417. package/src/core/styles/box/types.ts +0 -11
  418. package/src/core/styles/card/_cardColorStyle.ts +0 -108
  419. package/src/core/styles/card/index.ts +0 -1
  420. package/src/core/styles/flex/flexItemStyle.ts +0 -27
  421. package/src/core/styles/flex/flexStyle.ts +0 -70
  422. package/src/core/styles/flex/index.ts +0 -3
  423. package/src/core/styles/flex/types.ts +0 -25
  424. package/src/core/styles/focusRing/index.ts +0 -25
  425. package/src/core/styles/font/codeFontStyle.ts +0 -13
  426. package/src/core/styles/font/headingFontStyle.ts +0 -13
  427. package/src/core/styles/font/index.ts +0 -6
  428. package/src/core/styles/font/labelFontStyle.ts +0 -13
  429. package/src/core/styles/font/responsiveFont.ts +0 -103
  430. package/src/core/styles/font/textAlignStyle.ts +0 -19
  431. package/src/core/styles/font/textFontStyle.ts +0 -13
  432. package/src/core/styles/font/types.ts +0 -35
  433. package/src/core/styles/grid/gridItemStyle.ts +0 -82
  434. package/src/core/styles/grid/gridStyle.ts +0 -108
  435. package/src/core/styles/grid/index.ts +0 -3
  436. package/src/core/styles/grid/types.ts +0 -37
  437. package/src/core/styles/helpers.ts +0 -72
  438. package/src/core/styles/index.ts +0 -5
  439. package/src/core/styles/input/index.ts +0 -2
  440. package/src/core/styles/input/responsiveInputPaddingStyle.ts +0 -78
  441. package/src/core/styles/input/textInputStyle.ts +0 -263
  442. package/src/core/styles/internal.ts +0 -12
  443. package/src/core/styles/margin/index.ts +0 -2
  444. package/src/core/styles/margin/marginStyle.ts +0 -21
  445. package/src/core/styles/margin/marginsStyle.test.ts +0 -33
  446. package/src/core/styles/margin/types.ts +0 -9
  447. package/src/core/styles/padding/index.ts +0 -2
  448. package/src/core/styles/padding/paddingStyle.test.ts +0 -33
  449. package/src/core/styles/padding/paddingStyle.ts +0 -21
  450. package/src/core/styles/padding/types.ts +0 -12
  451. package/src/core/styles/radius/index.ts +0 -2
  452. package/src/core/styles/radius/radiusStyle.ts +0 -23
  453. package/src/core/styles/radius/types.ts +0 -8
  454. package/src/core/styles/shadow/index.ts +0 -2
  455. package/src/core/styles/shadow/shadowStyle.ts +0 -29
  456. package/src/core/styles/shadow/types.ts +0 -6
  457. package/src/core/styles/types.ts +0 -8
  458. package/src/core/theme/__workshop__/build/Root.tsx +0 -367
  459. package/src/core/theme/__workshop__/build/helpers.ts +0 -46
  460. package/src/core/theme/__workshop__/build/story.tsx +0 -465
  461. package/src/core/theme/__workshop__/canvas.tsx +0 -352
  462. package/src/core/theme/__workshop__/color.tsx +0 -62
  463. package/src/core/theme/__workshop__/debug/story.tsx +0 -408
  464. package/src/core/theme/__workshop__/index.ts +0 -39
  465. package/src/core/theme/__workshop__/layer.tsx +0 -78
  466. package/src/core/theme/__workshop__/nestedProvider.tsx +0 -15
  467. package/src/core/theme/index.ts +0 -5
  468. package/src/core/theme/theme.test.tsx +0 -73
  469. package/src/core/theme/themeColorProvider.tsx +0 -29
  470. package/src/core/theme/themeContext.ts +0 -10
  471. package/src/core/theme/themeProvider.tsx +0 -62
  472. package/src/core/theme/types.ts +0 -12
  473. package/src/core/theme/useRootTheme.ts +0 -17
  474. package/src/core/theme/useTheme.ts +0 -16
  475. package/src/core/types/avatar.ts +0 -14
  476. package/src/core/types/badge.ts +0 -12
  477. package/src/core/types/box.ts +0 -19
  478. package/src/core/types/button.ts +0 -21
  479. package/src/core/types/card.ts +0 -6
  480. package/src/core/types/component.ts +0 -32
  481. package/src/core/types/dialog.ts +0 -4
  482. package/src/core/types/flex.ts +0 -30
  483. package/src/core/types/grid.ts +0 -14
  484. package/src/core/types/gridItem.ts +0 -29
  485. package/src/core/types/index.ts +0 -15
  486. package/src/core/types/placement.ts +0 -18
  487. package/src/core/types/popover.ts +0 -4
  488. package/src/core/types/radius.ts +0 -4
  489. package/src/core/types/selectable.ts +0 -6
  490. package/src/core/types/text.ts +0 -4
  491. package/src/core/utils/arrow/arrow.tsx +0 -123
  492. package/src/core/utils/arrow/cmds.ts +0 -91
  493. package/src/core/utils/arrow/index.ts +0 -1
  494. package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -14
  495. package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
  496. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +0 -100
  497. package/src/core/utils/boundaryElement/boundaryElementContext.ts +0 -7
  498. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +0 -24
  499. package/src/core/utils/boundaryElement/index.ts +0 -3
  500. package/src/core/utils/boundaryElement/types.ts +0 -7
  501. package/src/core/utils/boundaryElement/useBoundaryElement.ts +0 -26
  502. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -21
  503. package/src/core/utils/conditionalWrapper/index.ts +0 -1
  504. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
  505. package/src/core/utils/elementQuery/__workshop__/index.ts +0 -14
  506. package/src/core/utils/elementQuery/elementQuery.tsx +0 -53
  507. package/src/core/utils/elementQuery/helpers.ts +0 -27
  508. package/src/core/utils/elementQuery/index.ts +0 -1
  509. package/src/core/utils/errorBoundary.tsx +0 -48
  510. package/src/core/utils/getElementRef.ts +0 -26
  511. package/src/core/utils/index.ts +0 -9
  512. package/src/core/utils/layer/__workshop__/_debug.tsx +0 -17
  513. package/src/core/utils/layer/__workshop__/index.ts +0 -24
  514. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +0 -49
  515. package/src/core/utils/layer/__workshop__/nested.tsx +0 -98
  516. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
  517. package/src/core/utils/layer/getLayerContext.test.ts +0 -30
  518. package/src/core/utils/layer/getLayerContext.ts +0 -21
  519. package/src/core/utils/layer/index.ts +0 -4
  520. package/src/core/utils/layer/layer.test.tsx +0 -108
  521. package/src/core/utils/layer/layer.tsx +0 -98
  522. package/src/core/utils/layer/layerContext.ts +0 -7
  523. package/src/core/utils/layer/layerProvider.tsx +0 -111
  524. package/src/core/utils/layer/types.ts +0 -9
  525. package/src/core/utils/layer/useLayer.ts +0 -26
  526. package/src/core/utils/portal/__workshop__/index.ts +0 -14
  527. package/src/core/utils/portal/__workshop__/named.tsx +0 -63
  528. package/src/core/utils/portal/index.ts +0 -4
  529. package/src/core/utils/portal/portal.test.tsx +0 -103
  530. package/src/core/utils/portal/portal.ts +0 -32
  531. package/src/core/utils/portal/portalContext.ts +0 -31
  532. package/src/core/utils/portal/portalProvider.tsx +0 -47
  533. package/src/core/utils/portal/types.ts +0 -9
  534. package/src/core/utils/portal/usePortal.ts +0 -25
  535. package/src/core/utils/spanWithTextOverflow.tsx +0 -10
  536. package/src/core/utils/srOnly/index.ts +0 -1
  537. package/src/core/utils/srOnly/srOnly.tsx +0 -36
  538. package/src/core/utils/virtualList/__workshop__/changingProps.tsx +0 -36
  539. package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +0 -24
  540. package/src/core/utils/virtualList/__workshop__/index.ts +0 -29
  541. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
  542. package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +0 -22
  543. package/src/core/utils/virtualList/index.ts +0 -1
  544. package/src/core/utils/virtualList/virtualList.tsx +0 -200
  545. package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
  546. package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
  547. package/src/theme/build/_deprecated/color/button/createButtonModes.ts +0 -22
  548. package/src/theme/build/_deprecated/color/button/createButtonTones.ts +0 -55
  549. package/src/theme/build/_deprecated/color/card/createCardStates.ts +0 -60
  550. package/src/theme/build/_deprecated/color/color.test.ts +0 -63
  551. package/src/theme/build/_deprecated/color/defaults.ts +0 -390
  552. package/src/theme/build/_deprecated/color/factory.ts +0 -142
  553. package/src/theme/build/_deprecated/color/index.ts +0 -1
  554. package/src/theme/build/_deprecated/color/input/createInputModes.ts +0 -81
  555. package/src/theme/build/_deprecated/color/muted/createMuted.ts +0 -54
  556. package/src/theme/build/_deprecated/color/spot/createSpot.ts +0 -20
  557. package/src/theme/build/buildColorTheme.test.ts +0 -183
  558. package/src/theme/build/buildColorTheme.ts +0 -499
  559. package/src/theme/build/buildTheme.test.ts +0 -87
  560. package/src/theme/build/buildTheme.ts +0 -36
  561. package/src/theme/build/colorToken/colorToken.ts +0 -19
  562. package/src/theme/build/colorToken/compileColorToken.ts +0 -21
  563. package/src/theme/build/colorToken/index.ts +0 -2
  564. package/src/theme/build/colorToken/types.ts +0 -6
  565. package/src/theme/build/index.ts +0 -3
  566. package/src/theme/build/lib/color-fns/blend/index.ts +0 -3
  567. package/src/theme/build/lib/color-fns/blend/mix.ts +0 -21
  568. package/src/theme/build/lib/color-fns/blend/multiply.ts +0 -18
  569. package/src/theme/build/lib/color-fns/blend/screen.ts +0 -18
  570. package/src/theme/build/lib/color-fns/color-fns.test.ts +0 -68
  571. package/src/theme/build/lib/color-fns/contrastRatio.ts +0 -31
  572. package/src/theme/build/lib/color-fns/convert.ts +0 -150
  573. package/src/theme/build/lib/color-fns/index.ts +0 -6
  574. package/src/theme/build/lib/color-fns/parse.ts +0 -60
  575. package/src/theme/build/lib/color-fns/rgba.ts +0 -10
  576. package/src/theme/build/lib/color-fns/types.ts +0 -28
  577. package/src/theme/build/lib/isRecord.ts +0 -3
  578. package/src/theme/build/lib/lazy.ts +0 -30
  579. package/src/theme/build/lib/utils.ts +0 -19
  580. package/src/theme/build/merge.ts +0 -26
  581. package/src/theme/build/mixThemeColor.test.ts +0 -21
  582. package/src/theme/build/mixThemeColor.ts +0 -53
  583. package/src/theme/build/renderColorTheme.ts +0 -532
  584. package/src/theme/build/renderColorValue.ts +0 -85
  585. package/src/theme/build/resolveColorTokens.ts +0 -268
  586. package/src/theme/build/theme.test.ts +0 -27
  587. package/src/theme/config/helpers.ts +0 -55
  588. package/src/theme/config/index.ts +0 -4
  589. package/src/theme/config/system.ts +0 -115
  590. package/src/theme/config/tokens/color/index.ts +0 -1
  591. package/src/theme/config/tokens/color/types.ts +0 -133
  592. package/src/theme/config/tokens/index.ts +0 -4
  593. package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
  594. package/src/theme/config/tokens/parseTokenKey.ts +0 -67
  595. package/src/theme/config/tokens/parseTokenValue.test.ts +0 -42
  596. package/src/theme/config/tokens/parseTokenValue.ts +0 -133
  597. package/src/theme/config/tokens/types.ts +0 -53
  598. package/src/theme/config/types.ts +0 -46
  599. package/src/theme/defaults/colorPalette.ts +0 -5
  600. package/src/theme/defaults/colorTokens.ts +0 -648
  601. package/src/theme/defaults/config.ts +0 -84
  602. package/src/theme/defaults/fonts.ts +0 -227
  603. package/src/theme/getScopedTheme.ts +0 -98
  604. package/src/theme/index.ts +0 -5
  605. package/src/theme/system/avatar.ts +0 -14
  606. package/src/theme/system/color/_constants.ts +0 -45
  607. package/src/theme/system/color/_helpers.ts +0 -24
  608. package/src/theme/system/color/_system.ts +0 -40
  609. package/src/theme/system/color/avatar.ts +0 -15
  610. package/src/theme/system/color/badge.ts +0 -16
  611. package/src/theme/system/color/button.ts +0 -17
  612. package/src/theme/system/color/color.ts +0 -34
  613. package/src/theme/system/color/index.ts +0 -13
  614. package/src/theme/system/color/input.ts +0 -25
  615. package/src/theme/system/color/kbd.ts +0 -8
  616. package/src/theme/system/color/selectable.ts +0 -12
  617. package/src/theme/system/color/shadow.ts +0 -7
  618. package/src/theme/system/color/state.ts +0 -43
  619. package/src/theme/system/color/syntax.ts +0 -41
  620. package/src/theme/system/css.ts +0 -14
  621. package/src/theme/system/focusRing.ts +0 -7
  622. package/src/theme/system/font.ts +0 -52
  623. package/src/theme/system/index.ts +0 -11
  624. package/src/theme/system/input.ts +0 -33
  625. package/src/theme/system/layer.ts +0 -8
  626. package/src/theme/system/shadow.ts +0 -19
  627. package/src/theme/system/styles.ts +0 -13
  628. package/src/theme/system/theme.ts +0 -138
  629. package/src/theme/system/v0/avatar.ts +0 -10
  630. package/src/theme/system/v0/color/_generic.ts +0 -35
  631. package/src/theme/system/v0/color/_system.ts +0 -17
  632. package/src/theme/system/v0/color/base.ts +0 -21
  633. package/src/theme/system/v0/color/button.ts +0 -42
  634. package/src/theme/system/v0/color/card.ts +0 -19
  635. package/src/theme/system/v0/color/color.ts +0 -40
  636. package/src/theme/system/v0/color/index.ts +0 -11
  637. package/src/theme/system/v0/color/input.ts +0 -34
  638. package/src/theme/system/v0/color/muted.ts +0 -26
  639. package/src/theme/system/v0/color/selectable.ts +0 -31
  640. package/src/theme/system/v0/color/solid.ts +0 -26
  641. package/src/theme/system/v0/color/spot.ts +0 -13
  642. package/src/theme/system/v0/index.ts +0 -3
  643. package/src/theme/system/v0/input.ts +0 -23
  644. package/src/theme/versioning/getTheme_v2.ts +0 -57
  645. package/src/theme/versioning/index.ts +0 -5
  646. package/src/theme/versioning/is_v0.ts +0 -6
  647. package/src/theme/versioning/is_v2.ts +0 -6
  648. package/src/theme/versioning/themeColor_v0_v2.ts +0 -243
  649. package/src/theme/versioning/themeColor_v2_v2_9.ts +0 -49
  650. package/src/theme/versioning/v0_v2.ts +0 -94
  651. package/src/theme/versioning/v2_v0.ts +0 -135
@@ -0,0 +1,3804 @@
1
+ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __copyProps = (to, from, except, desc) => {
2
+ if (from && typeof from == "object" || typeof from == "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) key = keys[i], !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
3
+ get: ((k) => from[k]).bind(null, key),
4
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
5
+ });
6
+ return to;
7
+ }, __toESM = (mod, isNodeMode, target) => (target = mod == null ? {} : __create(__getProtoOf(mod)), __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
8
+ value: mod,
9
+ enumerable: !0
10
+ }) : target, mod));
11
+ const require_theme = require("./theme2.js");
12
+ let react_compiler_runtime = require("react-compiler-runtime"), _sanity_icons = require("@sanity/icons"), react = require("react");
13
+ react = __toESM(react);
14
+ let react_is = require("react-is"), styled_components = require("styled-components"), react_jsx_runtime = require("react/jsx-runtime"), 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");
15
+ /**
16
+ * @public
17
+ * @deprecated Use `createColorTheme` from `@sanity/ui/theme` instead.
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 = {
20
+ card: {
21
+ initial: {
22
+ scale: .97,
23
+ willChange: "transform"
24
+ },
25
+ hidden: { opacity: 0 },
26
+ visible: {
27
+ opacity: 1,
28
+ transition: {
29
+ when: "beforeChildren",
30
+ duration: POPOVER_MOTION_DURATION / 2
31
+ }
32
+ },
33
+ scaleIn: { scale: 1 },
34
+ scaleOut: { scale: .97 }
35
+ },
36
+ children: {
37
+ hidden: { opacity: 0 },
38
+ visible: { opacity: 1 }
39
+ },
40
+ transition: {
41
+ type: "spring",
42
+ visualDuration: POPOVER_MOTION_DURATION,
43
+ bounce: .25
44
+ }
45
+ };
46
+ /**
47
+ * @internal
48
+ */
49
+ function _isEnterToClickElement(element) {
50
+ return isHTMLAnchorElement(element) || isHTMLButtonElement(element);
51
+ }
52
+ /**
53
+ * @internal
54
+ */
55
+ function isHTMLElement(node) {
56
+ return node instanceof Node && node.nodeType === Node.ELEMENT_NODE;
57
+ }
58
+ /**
59
+ * @internal
60
+ */
61
+ function isHTMLAnchorElement(element) {
62
+ return isHTMLElement(element) && element.nodeName === "A";
63
+ }
64
+ /**
65
+ * @internal
66
+ */
67
+ function isHTMLInputElement(element) {
68
+ return isHTMLElement(element) && element.nodeName === "INPUT";
69
+ }
70
+ /**
71
+ * @internal
72
+ */
73
+ function isHTMLButtonElement(element) {
74
+ return isHTMLElement(element) && element.nodeName === "BUTTON";
75
+ }
76
+ /**
77
+ * @internal
78
+ */
79
+ function isHTMLSelectElement(element) {
80
+ return isHTMLElement(element) && element.nodeName === "SELECT";
81
+ }
82
+ /**
83
+ * @internal
84
+ */
85
+ function isHTMLTextAreaElement(element) {
86
+ return isHTMLElement(element) && element.nodeName === "TEXTAREA";
87
+ }
88
+ /**
89
+ * @internal
90
+ */
91
+ function containsOrEqualsElement(element, node) {
92
+ return element.contains(node) || element === node;
93
+ }
94
+ /**
95
+ * @internal
96
+ */
97
+ function _fillCSSObject(keys, value) {
98
+ return keys.reduce((style, key) => (style[key] = value, style), {});
99
+ }
100
+ /**
101
+ * @public
102
+ */
103
+ function rem(pixelValue) {
104
+ return pixelValue === 0 ? 0 : `${pixelValue / 16}rem`;
105
+ }
106
+ /**
107
+ * @internal
108
+ */
109
+ function _responsive(media, values, callback) {
110
+ return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : { [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement });
111
+ }
112
+ /**
113
+ * @internal
114
+ */
115
+ function _getArrayProp(val, defaultVal) {
116
+ return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
117
+ }
118
+ /**
119
+ * @internal
120
+ */
121
+ function _getResponsiveSpace(theme, props, spaceIndexes = EMPTY_ARRAY) {
122
+ if (!Array.isArray(spaceIndexes)) throw Error("the property must be array of numbers");
123
+ if (spaceIndexes.length === 0) return null;
124
+ let { media, space } = require_theme.X(theme);
125
+ return _responsive(media, spaceIndexes, (spaceIndex) => _fillCSSObject(props, rem(space[spaceIndex])));
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
+ ThemeProvider.displayName = "ThemeProvider";
277
+ /**
278
+ * @public
279
+ */
280
+ function useRootTheme() {
281
+ let value = (0, react.useContext)(ThemeContext);
282
+ if (!value) throw Error("useRootTheme(): missing context value");
283
+ return value;
284
+ }
285
+ /**
286
+ * @public
287
+ */
288
+ function ThemeColorProvider(props) {
289
+ let $ = (0, react_compiler_runtime.c)(5), { children, scheme, tone } = props, root = useRootTheme(), t0 = scheme || root.scheme, t1;
290
+ return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeProvider, {
291
+ scheme: t0,
292
+ theme: root.theme,
293
+ tone,
294
+ children
295
+ }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
296
+ }
297
+ ThemeColorProvider.displayName = "ThemeColorProvider";
298
+ /**
299
+ * @public
300
+ */
301
+ function useTheme() {
302
+ return (0, styled_components.useTheme)();
303
+ }
304
+ /**
305
+ * @public
306
+ */
307
+ function useTheme_v2() {
308
+ return require_theme.X((0, styled_components.useTheme)());
309
+ }
310
+ function responsiveBorderStyle() {
311
+ return [
312
+ border,
313
+ borderTop,
314
+ borderRight,
315
+ borderBottom,
316
+ borderLeft
317
+ ];
318
+ }
319
+ function border(props) {
320
+ let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
321
+ return _responsive(media, props.$border, (value) => value ? { "&&": { border: borderStyle } } : { "&&": { border: 0 } });
322
+ }
323
+ function borderTop(props) {
324
+ let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
325
+ return _responsive(media, props.$borderTop, (value) => value ? { "&&": { borderTop: borderStyle } } : { "&&": { borderTop: 0 } });
326
+ }
327
+ function borderRight(props) {
328
+ let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
329
+ return _responsive(media, props.$borderRight, (value) => value ? { "&&": { borderRight: borderStyle } } : { "&&": { borderRight: 0 } });
330
+ }
331
+ function borderBottom(props) {
332
+ let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
333
+ return _responsive(media, props.$borderBottom, (value) => value ? { "&&": { borderBottom: borderStyle } } : { "&&": { borderBottom: 0 } });
334
+ }
335
+ function borderLeft(props) {
336
+ let { card, media } = require_theme.X(props.theme), borderStyle = `${card.border?.width ?? 1}px solid var(--card-border-color)`;
337
+ return _responsive(media, props.$borderLeft, (value) => value ? { "&&": { borderLeft: borderStyle } } : { "&&": { borderLeft: 0 } });
338
+ }
339
+ const BASE_STYLE$3 = { "&[data-as=\"ul\"],&[data-as=\"ol\"]": { listStyle: "none" } }, BOX_SIZING = {
340
+ content: "content-box",
341
+ border: "border-box"
342
+ }, BOX_HEIGHT = {
343
+ stretch: "stretch",
344
+ fill: "100%"
345
+ };
346
+ function boxStyle() {
347
+ return BASE_STYLE$3;
348
+ }
349
+ function responsiveBoxStyle() {
350
+ return [
351
+ responsiveBoxSizingStyle,
352
+ responsiveBoxHeightStyle,
353
+ responsiveBoxOverflowStyle,
354
+ responsiveBoxDisplayStyle
355
+ ];
356
+ }
357
+ function responsiveBoxDisplayStyle(props) {
358
+ let { media } = require_theme.X(props.theme);
359
+ return _responsive(media, props.$display, (display) => ({ "&:not([hidden])": { display } }));
360
+ }
361
+ function responsiveBoxSizingStyle(props) {
362
+ let { media } = require_theme.X(props.theme);
363
+ return _responsive(media, props.$sizing, (sizing) => ({ boxSizing: BOX_SIZING[sizing] }));
364
+ }
365
+ function responsiveBoxHeightStyle(props) {
366
+ let { media } = require_theme.X(props.theme);
367
+ return _responsive(media, props.$height, (height) => ({ height: BOX_HEIGHT[height] }));
368
+ }
369
+ function responsiveBoxOverflowStyle(props) {
370
+ let { media } = require_theme.X(props.theme);
371
+ return _responsive(media, props.$overflow, (overflow) => ({ overflow }));
372
+ }
373
+ const BASE_STYLE$2 = {
374
+ minWidth: 0,
375
+ minHeight: 0
376
+ };
377
+ function flexItemStyle() {
378
+ return [BASE_STYLE$2, responsiveFlexItemStyle];
379
+ }
380
+ function responsiveFlexItemStyle(props) {
381
+ let { media } = require_theme.X(props.theme);
382
+ return props.$flex ? _responsive(media, props.$flex, (flex) => ({ flex: `${flex}` })) : EMPTY_ARRAY;
383
+ }
384
+ const BASE_STYLE$1 = { "&&:not([hidden])": { display: "flex" } };
385
+ function responsiveFlexStyle() {
386
+ return [
387
+ BASE_STYLE$1,
388
+ responsiveFlexAlignStyle,
389
+ responsiveFlexGapStyle,
390
+ responsiveFlexWrapStyle,
391
+ responsiveFlexJustifyStyle,
392
+ responsiveFlexDirectionStyle
393
+ ];
394
+ }
395
+ function responsiveFlexAlignStyle(props) {
396
+ let { media } = require_theme.X(props.theme);
397
+ return _responsive(media, props.$align, (align) => ({ alignItems: align }));
398
+ }
399
+ function responsiveFlexGapStyle(props) {
400
+ let { media, space } = require_theme.X(props.theme);
401
+ return _responsive(media, props.$gap, (gap) => ({ gap: gap ? rem(space[gap]) : void 0 }));
402
+ }
403
+ function responsiveFlexWrapStyle(props) {
404
+ let { media } = require_theme.X(props.theme);
405
+ return _responsive(media, props.$wrap, (wrap) => ({ flexWrap: wrap }));
406
+ }
407
+ function responsiveFlexJustifyStyle(props) {
408
+ let { media } = require_theme.X(props.theme);
409
+ return _responsive(media, props.$justify, (justify) => ({ justifyContent: justify }));
410
+ }
411
+ function responsiveFlexDirectionStyle(props) {
412
+ let { media } = require_theme.X(props.theme);
413
+ return _responsive(media, props.$direction, (direction) => ({ flexDirection: direction }));
414
+ }
415
+ function focusRingBorderStyle(border) {
416
+ return `inset 0 0 0 ${border.width}px ${border.color}`;
417
+ }
418
+ function focusRingStyle(opts) {
419
+ let { base, border, focusRing } = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
420
+ return [
421
+ focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,
422
+ border && focusRingBorderStyle(border),
423
+ focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,
424
+ focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`
425
+ ].filter(Boolean).join(",");
426
+ }
427
+ function responsiveGridItemStyle() {
428
+ return [
429
+ responsiveGridItemRowStyle,
430
+ responsiveGridItemRowStartStyle,
431
+ responsiveGridItemRowEndStyle,
432
+ responsiveGridItemColumnStyle,
433
+ responsiveGridItemColumnStartStyle,
434
+ responsiveGridItemColumnEndStyle
435
+ ];
436
+ }
437
+ const GRID_ITEM_ROW = {
438
+ auto: "auto",
439
+ full: "1 / -1"
440
+ }, GRID_ITEM_COLUMN = {
441
+ auto: "auto",
442
+ full: "1 / -1"
443
+ };
444
+ function responsiveGridItemRowStyle(props) {
445
+ let { media } = require_theme.X(props.theme);
446
+ return _responsive(media, props.$row, (row) => typeof row == "number" ? { gridRow: `span ${row} / span ${row}` } : { gridRow: GRID_ITEM_ROW[row] });
447
+ }
448
+ function responsiveGridItemRowStartStyle(props) {
449
+ let { media } = require_theme.X(props.theme);
450
+ return _responsive(media, props.$rowStart, (rowStart) => ({ gridRowStart: `${rowStart}` }));
451
+ }
452
+ function responsiveGridItemRowEndStyle(props) {
453
+ let { media } = require_theme.X(props.theme);
454
+ return _responsive(media, props.$rowEnd, (rowEnd) => ({ gridRowEnd: `${rowEnd}` }));
455
+ }
456
+ function responsiveGridItemColumnStyle(props) {
457
+ let { media } = require_theme.X(props.theme);
458
+ return _responsive(media, props.$column, (column) => typeof column == "number" ? { gridColumn: `span ${column} / span ${column}` } : { gridColumn: GRID_ITEM_COLUMN[column] });
459
+ }
460
+ function responsiveGridItemColumnStartStyle(props) {
461
+ let { media } = require_theme.X(props.theme);
462
+ return _responsive(media, props.$columnStart, (columnStart) => ({ gridColumnStart: `${columnStart}` }));
463
+ }
464
+ function responsiveGridItemColumnEndStyle(props) {
465
+ let { media } = require_theme.X(props.theme);
466
+ return _responsive(media, props.$columnEnd, (columnEnd) => ({ gridColumnEnd: `${columnEnd}` }));
467
+ }
468
+ const GRID_CSS = {
469
+ "&&:not([hidden])": { display: "grid" },
470
+ "&[data-as=\"ul\"],&[data-as=\"ol\"]": { listStyle: "none" }
471
+ }, GRID_AUTO_COLUMS = {
472
+ auto: "auto",
473
+ min: "min-content",
474
+ max: "max-content",
475
+ fr: "minmax(0, 1fr)"
476
+ }, GRID_AUTO_ROWS = {
477
+ auto: "auto",
478
+ min: "min-content",
479
+ max: "max-content",
480
+ fr: "minmax(0, 1fr)"
481
+ };
482
+ function responsiveGridStyle() {
483
+ return [
484
+ GRID_CSS,
485
+ responsiveGridAutoFlowStyle,
486
+ responsiveGridAutoRowsStyle,
487
+ responsiveGridAutoColsStyle,
488
+ responsiveGridColumnsStyle,
489
+ responsiveGridRowsStyle,
490
+ responsiveGridGapStyle,
491
+ responsiveGridGapXStyle,
492
+ responsiveGridGapYStyle
493
+ ];
494
+ }
495
+ function responsiveGridAutoFlowStyle(props) {
496
+ let { media } = require_theme.X(props.theme);
497
+ return _responsive(media, props.$autoFlow, (autoFlow) => ({ gridAutoFlow: autoFlow }));
498
+ }
499
+ function responsiveGridAutoRowsStyle(props) {
500
+ let { media } = require_theme.X(props.theme);
501
+ return _responsive(media, props.$autoRows, (autoRows) => ({ gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows] }));
502
+ }
503
+ function responsiveGridAutoColsStyle(props) {
504
+ let { media } = require_theme.X(props.theme);
505
+ return _responsive(media, props.$autoCols, (autoCols) => ({ gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols] }));
506
+ }
507
+ function responsiveGridColumnsStyle(props) {
508
+ let { media } = require_theme.X(props.theme);
509
+ return _responsive(media, props.$columns, (columns) => ({ gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));` }));
510
+ }
511
+ function responsiveGridRowsStyle(props) {
512
+ let { media } = require_theme.X(props.theme);
513
+ return _responsive(media, props.$rows, (rows) => ({ gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));` }));
514
+ }
515
+ function responsiveGridGapStyle(props) {
516
+ let { media, space } = require_theme.X(props.theme);
517
+ return _responsive(media, props.$gap, (gap) => ({ gridGap: gap ? rem(space[gap]) : void 0 }));
518
+ }
519
+ function responsiveGridGapXStyle(props) {
520
+ let { media, space } = require_theme.X(props.theme);
521
+ return _responsive(media, props.$gapX, (gapX) => ({ columnGap: gapX ? rem(space[gapX]) : void 0 }));
522
+ }
523
+ function responsiveGridGapYStyle(props) {
524
+ let { media, space } = require_theme.X(props.theme);
525
+ return _responsive(media, props.$gapY, (gapY) => ({ rowGap: gapY ? rem(space[gapY]) : void 0 }));
526
+ }
527
+ function responsiveInputPaddingStyle(props) {
528
+ 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 = [];
529
+ 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];
530
+ return _responsive(media, _padding, (_, i) => {
531
+ 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 = {
532
+ paddingTop: rem(p - size.ascenderHeight),
533
+ paddingRight: rem(p),
534
+ paddingBottom: rem(p - size.descenderHeight),
535
+ paddingLeft: rem(p)
536
+ };
537
+ return $iconRight && (styles.paddingRight = rem(p + emSize + s)), $iconLeft && (styles.paddingLeft = rem(p + emSize + s)), styles;
538
+ });
539
+ }
540
+ function responsiveInputPaddingIconRightStyle(props) {
541
+ return responsiveInputPaddingStyle({
542
+ ...props,
543
+ $iconRight: !0
544
+ });
545
+ }
546
+ const ROOT_STYLE = styled_components.css`&:not([hidden]){display:flex;}align-items:center;`;
547
+ function textInputRootStyle() {
548
+ return ROOT_STYLE;
549
+ }
550
+ function textInputBaseStyle(props) {
551
+ let { $scheme, $tone, $weight } = props, { color, font } = require_theme.X(props.theme);
552
+ 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};}}`;
553
+ }
554
+ function textInputFontSizeStyle(props) {
555
+ let { font, media } = require_theme.X(props.theme);
556
+ return _responsive(media, props.$fontSize, (sizeIndex) => {
557
+ let size = font.text.sizes[sizeIndex] || font.text.sizes[2];
558
+ return {
559
+ fontSize: rem(size.fontSize),
560
+ lineHeight: `${size.lineHeight / size.fontSize}`
561
+ };
562
+ });
563
+ }
564
+ function textInputRepresentationStyle(props) {
565
+ let { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props, { color, input } = require_theme.X(props.theme);
566
+ 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({
567
+ color: color.input.default.enabled.border,
568
+ width: input.border.width
569
+ })};}*: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({
570
+ color: color.input.invalid.enabled.border,
571
+ width: input.border.width
572
+ })};}}*:not(:disabled):focus + &{&[data-border]{--input-box-shadow:${$unstableDisableFocusRing ? void 0 : focusRingStyle({
573
+ border: {
574
+ color: color.input.default.enabled.border,
575
+ width: input.border.width
576
+ },
577
+ focusRing: input.text.focusRing
578
+ })};}&: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({
579
+ color: color.input.default.disabled.border,
580
+ width: input.border.width
581
+ })};}}*: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({
582
+ color: color.input.invalid.disabled.border,
583
+ width: input.border.width
584
+ })};}}*: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({
585
+ color: color.input.default.hovered.border,
586
+ width: input.border.width
587
+ })};}*:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border]{--input-box-shadow:${focusRingBorderStyle({
588
+ color: color.input.invalid.hovered.border,
589
+ width: input.border.width
590
+ })};}}}`;
591
+ }
592
+ function responsiveMarginStyle(props) {
593
+ let { theme } = props;
594
+ return [
595
+ _getResponsiveSpace(theme, ["margin"], props.$margin),
596
+ _getResponsiveSpace(theme, ["marginLeft", "marginRight"], props.$marginX),
597
+ _getResponsiveSpace(theme, ["marginTop", "marginBottom"], props.$marginY),
598
+ _getResponsiveSpace(theme, ["marginTop"], props.$marginTop),
599
+ _getResponsiveSpace(theme, ["marginRight"], props.$marginRight),
600
+ _getResponsiveSpace(theme, ["marginBottom"], props.$marginBottom),
601
+ _getResponsiveSpace(theme, ["marginLeft"], props.$marginLeft)
602
+ ].filter(Boolean);
603
+ }
604
+ function responsivePaddingStyle(props) {
605
+ let { theme } = props;
606
+ return [
607
+ _getResponsiveSpace(theme, ["padding"], props.$padding),
608
+ _getResponsiveSpace(theme, ["paddingLeft", "paddingRight"], props.$paddingX),
609
+ _getResponsiveSpace(theme, ["paddingTop", "paddingBottom"], props.$paddingY),
610
+ _getResponsiveSpace(theme, ["paddingTop"], props.$paddingTop),
611
+ _getResponsiveSpace(theme, ["paddingRight"], props.$paddingRight),
612
+ _getResponsiveSpace(theme, ["paddingBottom"], props.$paddingBottom),
613
+ _getResponsiveSpace(theme, ["paddingLeft"], props.$paddingLeft)
614
+ ].filter(Boolean);
615
+ }
616
+ function responsiveRadiusStyle(props) {
617
+ let { media, radius } = require_theme.X(props.theme);
618
+ return _responsive(media, props.$radius, (value) => {
619
+ let borderRadius = 0;
620
+ return typeof value == "number" && (borderRadius = rem(radius[value])), value === "full" && (borderRadius = "9999px"), { borderRadius };
621
+ });
622
+ }
623
+ function toBoxShadow(shadow, color) {
624
+ return `${shadow.map(rem).join(" ")} ${color}`;
625
+ }
626
+ function shadowStyle(shadow, outlineWidth = 1) {
627
+ 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;
628
+ }
629
+ function responsiveShadowStyle(props) {
630
+ let { card, media, shadow } = require_theme.X(props.theme);
631
+ return _responsive(media, props.$shadow, (index) => shadowStyle(shadow[index], card.shadow.outline));
632
+ }
633
+ /** @internal */
634
+ const SpanWithTextOverflow = styled_components.styled.span.withConfig({
635
+ displayName: "SpanWithTextOverflow",
636
+ componentId: "sc-xkyu3h-0"
637
+ })`display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;overflow:clip;`, StyledBox = /* @__PURE__ */ styled_components.styled.div.withConfig({
638
+ displayName: "StyledBox",
639
+ componentId: "sc-7yq461-0"
640
+ })(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), BoxComponent = (0, react.forwardRef)(function(props, ref) {
641
+ 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;
642
+ $[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);
643
+ let asProp = t0 === void 0 ? "div" : t0, display = t1 === void 0 ? "block" : t1, margin = t2 === void 0 ? 0 : t2, padding = t3 === void 0 ? 0 : t3, column = gridColumn === void 0 ? deprecated_column : gridColumn, columnStart = gridColumnStart === void 0 ? deprecated_columnStart : gridColumnStart, columnEnd = gridColumnEnd === void 0 ? deprecated_columnEnd : gridColumnEnd, row = gridRow === void 0 ? deprecated_row : gridRow, rowStart = gridRowStart === void 0 ? deprecated_rowStart : gridRowStart, rowEnd = gridRowEnd === void 0 ? deprecated_rowEnd : gridRowEnd, t4 = typeof asProp == "string" ? asProp : void 0, t5;
644
+ $[34] === column ? t5 = $[35] : (t5 = _getArrayProp(column), $[34] = column, $[35] = t5);
645
+ let t6;
646
+ $[36] === columnStart ? t6 = $[37] : (t6 = _getArrayProp(columnStart), $[36] = columnStart, $[37] = t6);
647
+ let t7;
648
+ $[38] === columnEnd ? t7 = $[39] : (t7 = _getArrayProp(columnEnd), $[38] = columnEnd, $[39] = t7);
649
+ let t8;
650
+ $[40] === display ? t8 = $[41] : (t8 = _getArrayProp(display), $[40] = display, $[41] = t8);
651
+ let t9;
652
+ $[42] === flex ? t9 = $[43] : (t9 = _getArrayProp(flex), $[42] = flex, $[43] = t9);
653
+ let t10;
654
+ $[44] === height ? t10 = $[45] : (t10 = _getArrayProp(height), $[44] = height, $[45] = t10);
655
+ let t11;
656
+ $[46] === margin ? t11 = $[47] : (t11 = _getArrayProp(margin), $[46] = margin, $[47] = t11);
657
+ let t12;
658
+ $[48] === marginX ? t12 = $[49] : (t12 = _getArrayProp(marginX), $[48] = marginX, $[49] = t12);
659
+ let t13;
660
+ $[50] === marginY ? t13 = $[51] : (t13 = _getArrayProp(marginY), $[50] = marginY, $[51] = t13);
661
+ let t14;
662
+ $[52] === marginTop ? t14 = $[53] : (t14 = _getArrayProp(marginTop), $[52] = marginTop, $[53] = t14);
663
+ let t15;
664
+ $[54] === marginRight ? t15 = $[55] : (t15 = _getArrayProp(marginRight), $[54] = marginRight, $[55] = t15);
665
+ let t16;
666
+ $[56] === marginBottom ? t16 = $[57] : (t16 = _getArrayProp(marginBottom), $[56] = marginBottom, $[57] = t16);
667
+ let t17;
668
+ $[58] === marginLeft ? t17 = $[59] : (t17 = _getArrayProp(marginLeft), $[58] = marginLeft, $[59] = t17);
669
+ let t18;
670
+ $[60] === overflow ? t18 = $[61] : (t18 = _getArrayProp(overflow), $[60] = overflow, $[61] = t18);
671
+ let t19;
672
+ $[62] === padding ? t19 = $[63] : (t19 = _getArrayProp(padding), $[62] = padding, $[63] = t19);
673
+ let t20;
674
+ $[64] === paddingX ? t20 = $[65] : (t20 = _getArrayProp(paddingX), $[64] = paddingX, $[65] = t20);
675
+ let t21;
676
+ $[66] === paddingY ? t21 = $[67] : (t21 = _getArrayProp(paddingY), $[66] = paddingY, $[67] = t21);
677
+ let t22;
678
+ $[68] === paddingTop ? t22 = $[69] : (t22 = _getArrayProp(paddingTop), $[68] = paddingTop, $[69] = t22);
679
+ let t23;
680
+ $[70] === paddingRight ? t23 = $[71] : (t23 = _getArrayProp(paddingRight), $[70] = paddingRight, $[71] = t23);
681
+ let t24;
682
+ $[72] === paddingBottom ? t24 = $[73] : (t24 = _getArrayProp(paddingBottom), $[72] = paddingBottom, $[73] = t24);
683
+ let t25;
684
+ $[74] === paddingLeft ? t25 = $[75] : (t25 = _getArrayProp(paddingLeft), $[74] = paddingLeft, $[75] = t25);
685
+ let t26;
686
+ $[76] === row ? t26 = $[77] : (t26 = _getArrayProp(row), $[76] = row, $[77] = t26);
687
+ let t27;
688
+ $[78] === rowStart ? t27 = $[79] : (t27 = _getArrayProp(rowStart), $[78] = rowStart, $[79] = t27);
689
+ let t28;
690
+ $[80] === rowEnd ? t28 = $[81] : (t28 = _getArrayProp(rowEnd), $[80] = rowEnd, $[81] = t28);
691
+ let t29;
692
+ $[82] === sizing ? t29 = $[83] : (t29 = _getArrayProp(sizing), $[82] = sizing, $[83] = t29);
693
+ let t30;
694
+ return $[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 ? (t30 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledBox, {
695
+ "data-as": t4,
696
+ "data-ui": "Box",
697
+ ...restProps,
698
+ $column: t5,
699
+ $columnStart: t6,
700
+ $columnEnd: t7,
701
+ $display: t8,
702
+ $flex: t9,
703
+ $height: t10,
704
+ $margin: t11,
705
+ $marginX: t12,
706
+ $marginY: t13,
707
+ $marginTop: t14,
708
+ $marginRight: t15,
709
+ $marginBottom: t16,
710
+ $marginLeft: t17,
711
+ $overflow: t18,
712
+ $padding: t19,
713
+ $paddingX: t20,
714
+ $paddingY: t21,
715
+ $paddingTop: t22,
716
+ $paddingRight: t23,
717
+ $paddingBottom: t24,
718
+ $paddingLeft: t25,
719
+ $row: t26,
720
+ $rowStart: t27,
721
+ $rowEnd: t28,
722
+ $sizing: t29,
723
+ as: asProp,
724
+ ref,
725
+ children: props.children
726
+ }), $[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;
727
+ });
728
+ BoxComponent.displayName = "ForwardRef(Box)";
729
+ /**
730
+ * The `Box` component is a basic layout wrapper component which provides utility properties
731
+ * for flex, margins and padding.
732
+ *
733
+ * @public
734
+ */
735
+ const Box = BoxComponent;
736
+ function textBaseStyle(props) {
737
+ let { $accent, $muted } = props, { font } = require_theme.X(props.theme);
738
+ 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;}}`;
739
+ }
740
+ const StyledText = /* @__PURE__ */ styled_components.styled.div.withConfig({
741
+ displayName: "StyledText",
742
+ componentId: "sc-aca14k-0"
743
+ })(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle), TextComponent = (0, react.forwardRef)(function(props, ref) {
744
+ let $ = (0, react_compiler_runtime.c)(26), align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
745
+ $[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);
746
+ let accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size = t2 === void 0 ? 2 : t2, children = childrenProp;
747
+ if (textOverflow === "ellipsis") {
748
+ let t3;
749
+ $[9] === children ? t3 = $[10] : (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t3), children = t3;
750
+ }
751
+ let t3;
752
+ $[11] === align ? t3 = $[12] : (t3 = _getArrayProp(align), $[11] = align, $[12] = t3);
753
+ let t4;
754
+ $[13] === size ? t4 = $[14] : (t4 = _getArrayProp(size), $[13] = size, $[14] = t4);
755
+ let t5;
756
+ $[15] === children ? t5 = $[16] : (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children }), $[15] = children, $[16] = t5);
757
+ let t6;
758
+ 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, {
759
+ "data-ui": "Text",
760
+ ...restProps,
761
+ $accent: accent,
762
+ $align: t3,
763
+ $muted: muted,
764
+ ref,
765
+ $size: t4,
766
+ $weight: weight,
767
+ children: t5
768
+ }), $[17] = accent, $[18] = muted, $[19] = ref, $[20] = restProps, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = weight, $[25] = t6) : t6 = $[25], t6;
769
+ });
770
+ TextComponent.displayName = "ForwardRef(Text)";
771
+ /**
772
+ * The `Text` component is an agile, themed typographic element.
773
+ *
774
+ * @public
775
+ */
776
+ const Text = TextComponent, StyledFlex = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
777
+ displayName: "StyledFlex",
778
+ componentId: "sc-r9nqck-0"
779
+ })(flexItemStyle, responsiveFlexStyle), FlexComponent = (0, react.forwardRef)(function(props, ref) {
780
+ let $ = (0, react_compiler_runtime.c)(27), align, as, gap, justify, restProps, t0, wrap;
781
+ $[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);
782
+ let direction = t0 === void 0 ? "row" : t0, t1;
783
+ $[8] === align ? t1 = $[9] : (t1 = _getArrayProp(align), $[8] = align, $[9] = t1);
784
+ let t2;
785
+ $[10] === direction ? t2 = $[11] : (t2 = _getArrayProp(direction), $[10] = direction, $[11] = t2);
786
+ let t3;
787
+ $[12] === gap ? t3 = $[13] : (t3 = _getArrayProp(gap), $[12] = gap, $[13] = t3);
788
+ let t4;
789
+ $[14] === justify ? t4 = $[15] : (t4 = _getArrayProp(justify), $[14] = justify, $[15] = t4);
790
+ let t5;
791
+ $[16] === wrap ? t5 = $[17] : (t5 = _getArrayProp(wrap), $[16] = wrap, $[17] = t5);
792
+ let t6;
793
+ return $[18] !== as || $[19] !== ref || $[20] !== restProps || $[21] !== t1 || $[22] !== t2 || $[23] !== t3 || $[24] !== t4 || $[25] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledFlex, {
794
+ "data-ui": "Flex",
795
+ ...restProps,
796
+ $align: t1,
797
+ $direction: t2,
798
+ $gap: t3,
799
+ $justify: t4,
800
+ $wrap: t5,
801
+ forwardedAs: as,
802
+ ref
803
+ }), $[18] = as, $[19] = ref, $[20] = restProps, $[21] = t1, $[22] = t2, $[23] = t3, $[24] = t4, $[25] = t5, $[26] = t6) : t6 = $[26], t6;
804
+ });
805
+ FlexComponent.displayName = "ForwardRef(Flex)";
806
+ /**
807
+ * The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
808
+ *
809
+ * @public
810
+ */
811
+ const Flex = FlexComponent, rotate = styled_components.keyframes`from{transform:rotate(0deg);}to{transform:rotate(360deg);}`, StyledSpinner = (0, styled_components.styled)(Text).withConfig({
812
+ displayName: "StyledSpinner",
813
+ componentId: "sc-jtkakc-0"
814
+ })`& > span > svg{animation:${rotate} 500ms linear infinite;}`, Spinner = (0, react.forwardRef)(function(props, ref) {
815
+ let $ = (0, react_compiler_runtime.c)(4), t0;
816
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sanity_icons.SpinnerIcon, {}), $[0] = t0) : t0 = $[0];
817
+ let t1;
818
+ return $[1] !== props || $[2] !== ref ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSpinner, {
819
+ "data-ui": "Spinner",
820
+ ...props,
821
+ ref,
822
+ children: t0
823
+ }), $[1] = props, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
824
+ });
825
+ Spinner.displayName = "ForwardRef(Spinner)";
826
+ /**
827
+ * @internal
828
+ */
829
+ function _cardColorStyle(base, color, checkered = !1) {
830
+ return {
831
+ "--card-backdrop-color": base.backdrop,
832
+ "--card-focus-ring-color": base.focusRing,
833
+ "--card-shadow-outline-color": base.shadow.outline,
834
+ "--card-shadow-umbra-color": base.shadow.umbra,
835
+ "--card-shadow-penumbra-color": base.shadow.penumbra,
836
+ "--card-shadow-ambient-color": base.shadow.ambient,
837
+ "--card-accent-fg-color": color.accent.fg,
838
+ "--card-avatar-gray-bg-color": color.avatar.gray.bg,
839
+ "--card-avatar-gray-fg-color": color.avatar.gray.fg,
840
+ "--card-avatar-blue-bg-color": color.avatar.blue.bg,
841
+ "--card-avatar-blue-fg-color": color.avatar.blue.fg,
842
+ "--card-avatar-purple-bg-color": color.avatar.purple.bg,
843
+ "--card-avatar-purple-fg-color": color.avatar.purple.fg,
844
+ "--card-avatar-magenta-bg-color": color.avatar.magenta.bg,
845
+ "--card-avatar-magenta-fg-color": color.avatar.magenta.fg,
846
+ "--card-avatar-red-bg-color": color.avatar.red.bg,
847
+ "--card-avatar-red-fg-color": color.avatar.red.fg,
848
+ "--card-avatar-orange-bg-color": color.avatar.orange.bg,
849
+ "--card-avatar-orange-fg-color": color.avatar.orange.fg,
850
+ "--card-avatar-yellow-bg-color": color.avatar.yellow.bg,
851
+ "--card-avatar-yellow-fg-color": color.avatar.yellow.fg,
852
+ "--card-avatar-green-bg-color": color.avatar.green.bg,
853
+ "--card-avatar-green-fg-color": color.avatar.green.fg,
854
+ "--card-avatar-cyan-bg-color": color.avatar.cyan.bg,
855
+ "--card-avatar-cyan-fg-color": color.avatar.cyan.fg,
856
+ "--card-bg-color": color.bg,
857
+ "--card-bg-image": checkered ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)` : void 0,
858
+ "--card-border-color": color.border,
859
+ "--card-badge-default-bg-color": color.badge.default.bg,
860
+ "--card-badge-default-dot-color": color.badge.default.dot,
861
+ "--card-badge-default-fg-color": color.badge.default.fg,
862
+ "--card-badge-default-icon-color": color.badge.default.icon,
863
+ "--card-badge-neutral-bg-color": color.badge.neutral?.bg,
864
+ "--card-badge-neutral-dot-color": color.badge.neutral?.dot,
865
+ "--card-badge-neutral-fg-color": color.badge.neutral?.fg,
866
+ "--card-badge-neutral-icon-color": color.badge.neutral?.icon,
867
+ "--card-badge-primary-bg-color": color.badge.primary.bg,
868
+ "--card-badge-primary-dot-color": color.badge.primary.dot,
869
+ "--card-badge-primary-fg-color": color.badge.primary.fg,
870
+ "--card-badge-primary-icon-color": color.badge.primary.icon,
871
+ "--card-badge-suggest-bg-color": color.badge.suggest?.bg,
872
+ "--card-badge-suggest-dot-color": color.badge.suggest?.dot,
873
+ "--card-badge-suggest-fg-color": color.badge.suggest?.fg,
874
+ "--card-badge-suggest-icon-color": color.badge.suggest?.icon,
875
+ "--card-badge-positive-bg-color": color.badge.positive.bg,
876
+ "--card-badge-positive-dot-color": color.badge.positive.dot,
877
+ "--card-badge-positive-fg-color": color.badge.positive.fg,
878
+ "--card-badge-positive-icon-color": color.badge.positive.icon,
879
+ "--card-badge-caution-bg-color": color.badge.caution.bg,
880
+ "--card-badge-caution-dot-color": color.badge.caution.dot,
881
+ "--card-badge-caution-fg-color": color.badge.caution.fg,
882
+ "--card-badge-caution-icon-color": color.badge.caution.icon,
883
+ "--card-badge-critical-bg-color": color.badge.critical.bg,
884
+ "--card-badge-critical-dot-color": color.badge.critical.dot,
885
+ "--card-badge-critical-fg-color": color.badge.critical.fg,
886
+ "--card-badge-critical-icon-color": color.badge.critical.icon,
887
+ "--card-code-bg-color": color.code.bg,
888
+ "--card-code-fg-color": color.code.fg,
889
+ "--card-fg-color": color.fg,
890
+ "--card-icon-color": color.icon,
891
+ "--card-kbd-bg-color": color.kbd.bg,
892
+ "--card-kbd-border-color": color.kbd.border,
893
+ "--card-kbd-fg-color": color.kbd.fg,
894
+ "--card-link-fg-color": color.link.fg,
895
+ "--card-muted-bg-color": color.muted.bg,
896
+ "--card-muted-fg-color": color.muted.fg,
897
+ "--card-skeleton-color-from": color.skeleton.from,
898
+ "--card-skeleton-color-to": color.skeleton.to,
899
+ "--card-bg2-color": color.muted.bg,
900
+ "--card-link-color": color.link.fg,
901
+ "--card-hairline-soft-color": color.border,
902
+ "--card-hairline-hard-color": color.border
903
+ };
904
+ }
905
+ /**
906
+ * @internal
907
+ */
908
+ function buttonBaseStyles(props) {
909
+ let { $width } = props, { style } = require_theme.X(props.theme);
910
+ 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;}`;
911
+ }
912
+ function combineBoxShadow(...boxShadows) {
913
+ return boxShadows.filter(Boolean).join(",");
914
+ }
915
+ /**
916
+ * @internal
917
+ */
918
+ function buttonColorStyles(props) {
919
+ let { $mode } = props, { button, color: baseColor, style } = require_theme.X(props.theme);
920
+ props.$mode;
921
+ let mode = baseColor.button[$mode] || baseColor.button.default, color = mode[props.$tone] || mode.default, border = {
922
+ width: button.border.width,
923
+ color: "var(--card-border-color)"
924
+ };
925
+ return [
926
+ _cardColorStyle(baseColor, color.enabled),
927
+ {
928
+ backgroundColor: "var(--card-bg-color)",
929
+ color: "var(--card-fg-color)",
930
+ boxShadow: focusRingBorderStyle(border),
931
+ "&:disabled, &[data-disabled=\"true\"]": _cardColorStyle(baseColor, color.disabled),
932
+ "&:not([data-disabled='true'])": {
933
+ boxShadow: combineBoxShadow(focusRingBorderStyle(border), void 0),
934
+ "&:focus": { boxShadow: focusRingStyle({
935
+ base: baseColor,
936
+ border: {
937
+ width: 2,
938
+ color: baseColor.bg
939
+ },
940
+ focusRing: button.focusRing
941
+ }) },
942
+ "&:focus:not(:focus-visible)": { boxShadow: combineBoxShadow(focusRingBorderStyle(border), void 0) },
943
+ "@media (hover: hover)": {
944
+ "&:hover": _cardColorStyle(baseColor, color.hovered),
945
+ "&:active": _cardColorStyle(baseColor, color.pressed),
946
+ "&[data-hovered]": _cardColorStyle(baseColor, color.hovered)
947
+ },
948
+ "&[data-selected]": _cardColorStyle(baseColor, color.pressed)
949
+ }
950
+ },
951
+ style?.button?.root
952
+ ].filter(Boolean);
953
+ }
954
+ const StyledButton = /* @__PURE__ */ styled_components.styled.button.withConfig({
955
+ displayName: "StyledButton",
956
+ componentId: "sc-czwr2e-0"
957
+ })(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles), LoadingBox = styled_components.styled.div.withConfig({
958
+ displayName: "LoadingBox",
959
+ componentId: "sc-czwr2e-1"
960
+ })`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;`, ButtonComponent = (0, react.forwardRef)(function(props, ref) {
961
+ 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;
962
+ $[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);
963
+ let fontSize = t0 === void 0 ? 1 : t0, justifyProp = t1 === void 0 ? "center" : t1, mode = t2 === void 0 ? "default" : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, deprecated_space = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, type = t7 === void 0 ? "button" : t7, muted = t8 === void 0 ? !1 : t8, { button } = useTheme_v2(), t9;
964
+ $[28] === justifyProp ? t9 = $[29] : (t9 = _getArrayProp(justifyProp), $[28] = justifyProp, $[29] = t9);
965
+ let justify = t9, t10;
966
+ $[30] === paddingProp ? t10 = $[31] : (t10 = _getArrayProp(paddingProp), $[30] = paddingProp, $[31] = t10);
967
+ let padding = t10, t11;
968
+ $[32] === paddingXProp ? t11 = $[33] : (t11 = _getArrayProp(paddingXProp), $[32] = paddingXProp, $[33] = t11);
969
+ let paddingX = t11, t12;
970
+ $[34] === paddingYProp ? t12 = $[35] : (t12 = _getArrayProp(paddingYProp), $[34] = paddingYProp, $[35] = t12);
971
+ let paddingY = t12, t13;
972
+ $[36] === paddingTopProp ? t13 = $[37] : (t13 = _getArrayProp(paddingTopProp), $[36] = paddingTopProp, $[37] = t13);
973
+ let paddingTop = t13, t14;
974
+ $[38] === paddingBottomProp ? t14 = $[39] : (t14 = _getArrayProp(paddingBottomProp), $[38] = paddingBottomProp, $[39] = t14);
975
+ let paddingBottom = t14, t15;
976
+ $[40] === paddingLeftProp ? t15 = $[41] : (t15 = _getArrayProp(paddingLeftProp), $[40] = paddingLeftProp, $[41] = t15);
977
+ let paddingLeft = t15, t16;
978
+ $[42] === paddingRightProp ? t16 = $[43] : (t16 = _getArrayProp(paddingRightProp), $[42] = paddingRightProp, $[43] = t16);
979
+ let paddingRight = t16, t17;
980
+ $[44] === radiusProp ? t17 = $[45] : (t17 = _getArrayProp(radiusProp), $[44] = radiusProp, $[45] = t17);
981
+ let radius = t17, t18 = gap === void 0 ? deprecated_space : gap, t19;
982
+ $[46] === t18 ? t19 = $[47] : (t19 = _getArrayProp(t18), $[46] = t18, $[47] = t19);
983
+ let spacing = t19, t20;
984
+ $[48] !== padding || $[49] !== paddingBottom || $[50] !== paddingLeft || $[51] !== paddingRight || $[52] !== paddingTop || $[53] !== paddingX || $[54] !== paddingY ? (t20 = {
985
+ padding,
986
+ paddingX,
987
+ paddingY,
988
+ paddingTop,
989
+ paddingBottom,
990
+ paddingLeft,
991
+ paddingRight
992
+ }, $[48] = padding, $[49] = paddingBottom, $[50] = paddingLeft, $[51] = paddingRight, $[52] = paddingTop, $[53] = paddingX, $[54] = paddingY, $[55] = t20) : t20 = $[55];
993
+ let boxProps = t20, t21 = !!(loading || disabled), t22 = selected ? "" : void 0, t23 = !!(loading || disabled), t24;
994
+ $[56] === loading ? t24 = $[57] : (t24 = !!loading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadingBox, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Spinner, {}) }), $[56] = loading, $[57] = t24);
995
+ let t25;
996
+ $[58] !== IconComponent || $[59] !== IconRightComponent || $[60] !== boxProps || $[61] !== button || $[62] !== fontSize || $[63] !== justify || $[64] !== muted || $[65] !== spacing || $[66] !== text || $[67] !== textAlign || $[68] !== textWeight ? (t25 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
997
+ as: "span",
998
+ ...boxProps,
999
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Flex, {
1000
+ as: "span",
1001
+ justify,
1002
+ gap: spacing,
1003
+ children: [
1004
+ IconComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Text, {
1005
+ size: fontSize,
1006
+ children: [(0, react.isValidElement)(IconComponent) && IconComponent, (0, react_is.isValidElementType)(IconComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconComponent, {})]
1007
+ }),
1008
+ text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
1009
+ muted,
1010
+ align: textAlign,
1011
+ size: fontSize,
1012
+ textOverflow: "ellipsis",
1013
+ weight: textWeight ?? button.textWeight,
1014
+ children: text
1015
+ }) }),
1016
+ IconRightComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Text, {
1017
+ size: fontSize,
1018
+ children: [(0, react.isValidElement)(IconRightComponent) && IconRightComponent, (0, react_is.isValidElementType)(IconRightComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRightComponent, {})]
1019
+ })
1020
+ ]
1021
+ })
1022
+ }), $[58] = IconComponent, $[59] = IconRightComponent, $[60] = boxProps, $[61] = button, $[62] = fontSize, $[63] = justify, $[64] = muted, $[65] = spacing, $[66] = text, $[67] = textAlign, $[68] = textWeight, $[69] = t25) : t25 = $[69];
1023
+ let t26;
1024
+ $[70] !== boxProps || $[71] !== children ? (t26 = children && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
1025
+ as: "span",
1026
+ ...boxProps,
1027
+ children
1028
+ }), $[70] = boxProps, $[71] = children, $[72] = t26) : t26 = $[72];
1029
+ let t27;
1030
+ return $[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 ? (t27 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledButton, {
1031
+ "data-ui": "Button",
1032
+ ...restProps,
1033
+ $mode: mode,
1034
+ $radius: radius,
1035
+ $tone: tone,
1036
+ "data-disabled": t21,
1037
+ "data-selected": t22,
1038
+ disabled: t23,
1039
+ ref,
1040
+ type,
1041
+ $width: width,
1042
+ children: [
1043
+ t24,
1044
+ t25,
1045
+ t26
1046
+ ]
1047
+ }), $[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;
1048
+ });
1049
+ ButtonComponent.displayName = "ForwardRef(Button)";
1050
+ /**
1051
+ * @public
1052
+ */
1053
+ const Button = ButtonComponent;
1054
+ function cardStyle(props) {
1055
+ return [cardBaseStyle(props), cardColorStyle(props)];
1056
+ }
1057
+ function cardBaseStyle(props) {
1058
+ let { $checkered } = props, { space } = require_theme.X(props.theme);
1059
+ 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;}`;
1060
+ }
1061
+ function cardColorStyle(props) {
1062
+ let { $checkered, $focusRing, $muted } = props, { card, color, style } = require_theme.X(props.theme), border = {
1063
+ width: card.border.width,
1064
+ color: "var(--card-border-color)"
1065
+ };
1066
+ return styled_components.css`color-scheme:${color._dark ? "dark" : "light"};${_cardColorStyle(color, color, $checkered)} background-color:${$muted ? "var(--card-muted-bg-color)" : "var(--card-bg-color)"};color:var(--card-fg-color);&[data-as='button']{--card-focus-ring-box-shadow:none;cursor:default;box-shadow:var(--card-focus-ring-box-shadow);&:disabled{${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}}&:not(:disabled){&[data-pressed]{${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}}&[data-selected]{${_cardColorStyle(color, color.selectable.default.selected, $checkered)}}@media (hover:hover){&:not([data-pressed]):not([data-selected]){&[data-hovered],&:hover{${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}}&:active{${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}}}}&:focus-visible{--card-focus-ring-box-shadow:${$focusRing ? focusRingStyle({
1067
+ base: color,
1068
+ border,
1069
+ focusRing: card.focusRing
1070
+ }) : void 0};}}}&[data-as='a']{cursor:pointer;box-shadow:var(--card-focus-ring-box-shadow);&[data-disabled]{${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}}&:not([data-disabled]){&[data-pressed]{${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}}&[data-selected]{${_cardColorStyle(color, color.selectable.default.selected, $checkered)}}@media (hover:hover){&:not([data-pressed]):not([data-selected]){&[data-hovered],&:hover{${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}}&:active{${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}}}}&:focus-visible{--card-focus-ring-box-shadow:${$focusRing ? focusRingStyle({
1071
+ base: color,
1072
+ border,
1073
+ focusRing: card.focusRing
1074
+ }) : void 0};}}}${style?.card?.root}`;
1075
+ }
1076
+ const StyledCard = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
1077
+ displayName: "StyledCard",
1078
+ componentId: "sc-5721dn-0"
1079
+ })(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), CardComponent = (0, react.forwardRef)(function(props, ref) {
1080
+ let $ = (0, react_compiler_runtime.c)(56), asProp, border, borderBottom, borderLeft, borderRight, borderTop, muted, pressed, restProps, scheme, selected, shadow, t0, t1, t2, t3;
1081
+ $[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);
1082
+ let checkered = t0 === void 0 ? !1 : t0, focusRing = t1 === void 0 ? !1 : t1, radius = t2 === void 0 ? 0 : t2, toneProp = t3 === void 0 ? "default" : t3, as = (0, react_is.isValidElementType)(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp, t4 = typeof as == "string" ? as : void 0, t5 = rootTheme.scheme, t6;
1083
+ $[17] === border ? t6 = $[18] : (t6 = _getArrayProp(border), $[17] = border, $[18] = t6);
1084
+ let t7;
1085
+ $[19] === borderTop ? t7 = $[20] : (t7 = _getArrayProp(borderTop), $[19] = borderTop, $[20] = t7);
1086
+ let t8;
1087
+ $[21] === borderRight ? t8 = $[22] : (t8 = _getArrayProp(borderRight), $[21] = borderRight, $[22] = t8);
1088
+ let t9;
1089
+ $[23] === borderBottom ? t9 = $[24] : (t9 = _getArrayProp(borderBottom), $[23] = borderBottom, $[24] = t9);
1090
+ let t10;
1091
+ $[25] === borderLeft ? t10 = $[26] : (t10 = _getArrayProp(borderLeft), $[25] = borderLeft, $[26] = t10);
1092
+ let t11;
1093
+ $[27] === radius ? t11 = $[28] : (t11 = _getArrayProp(radius), $[27] = radius, $[28] = t11);
1094
+ let t12;
1095
+ $[29] === shadow ? t12 = $[30] : (t12 = _getArrayProp(shadow), $[29] = shadow, $[30] = t12);
1096
+ let t13 = checkered ? "" : void 0, t14 = pressed ? "" : void 0, t15 = selected ? "" : void 0, t16;
1097
+ $[31] !== as || $[32] !== checkered || $[33] !== focusRing || $[34] !== muted || $[35] !== ref || $[36] !== restProps || $[37] !== rootTheme.scheme || $[38] !== selected || $[39] !== t10 || $[40] !== t11 || $[41] !== t12 || $[42] !== t13 || $[43] !== t14 || $[44] !== t15 || $[45] !== t4 || $[46] !== t6 || $[47] !== t7 || $[48] !== t8 || $[49] !== t9 || $[50] !== tone ? (t16 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledCard, {
1098
+ "data-as": t4,
1099
+ "data-scheme": t5,
1100
+ "data-ui": "Card",
1101
+ "data-tone": tone,
1102
+ ...restProps,
1103
+ $border: t6,
1104
+ $borderTop: t7,
1105
+ $borderRight: t8,
1106
+ $borderBottom: t9,
1107
+ $borderLeft: t10,
1108
+ $checkered: checkered,
1109
+ $focusRing: focusRing,
1110
+ $muted: muted,
1111
+ $radius: t11,
1112
+ $shadow: t12,
1113
+ $tone: tone,
1114
+ "data-checkered": t13,
1115
+ "data-pressed": t14,
1116
+ "data-selected": t15,
1117
+ forwardedAs: as,
1118
+ ref,
1119
+ selected
1120
+ }), $[31] = as, $[32] = checkered, $[33] = focusRing, $[34] = muted, $[35] = ref, $[36] = restProps, $[37] = rootTheme.scheme, $[38] = selected, $[39] = t10, $[40] = t11, $[41] = t12, $[42] = t13, $[43] = t14, $[44] = t15, $[45] = t4, $[46] = t6, $[47] = t7, $[48] = t8, $[49] = t9, $[50] = tone, $[51] = t16) : t16 = $[51];
1121
+ let t17;
1122
+ return $[52] !== scheme || $[53] !== t16 || $[54] !== tone ? (t17 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeColorProvider, {
1123
+ scheme,
1124
+ tone,
1125
+ children: t16
1126
+ }), $[52] = scheme, $[53] = t16, $[54] = tone, $[55] = t17) : t17 = $[55], t17;
1127
+ });
1128
+ CardComponent.displayName = "ForwardRef(Card)";
1129
+ /**
1130
+ * The `Card` component acts much like a `Box`, but with a background and foreground color.
1131
+ * Components within a `Card` inherit its colors.
1132
+ *
1133
+ * @public
1134
+ */
1135
+ const Card = CardComponent;
1136
+ /**
1137
+ * @public
1138
+ */
1139
+ function useClickOutsideEvent(listener, elementsArg = () => EMPTY_ARRAY, boundaryElement) {
1140
+ /**
1141
+ * The `useEffectEvent` hook allow us to always see the latest value of `listener`, `elementsArg` and `boundaryElement` without needing to
1142
+ * juggle `useState`, `useRef` and `useState` to make sure the `mousedown` event listener isn't constantly being added and removed.
1143
+ */
1144
+ let onEvent = (0, use_effect_event.useEffectEvent)((evt) => {
1145
+ if (!listener) return;
1146
+ let target = evt.target;
1147
+ if (!(target instanceof Node)) return;
1148
+ let resolvedBoundaryElement = boundaryElement?.();
1149
+ if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target)) return;
1150
+ let elements = elementsArg().flat();
1151
+ for (let el of elements) if (el && (target === el || el.contains(target))) return;
1152
+ listener(evt);
1153
+ }), hasListener = !!listener;
1154
+ (0, react.useEffect)(() => {
1155
+ if (!hasListener) return;
1156
+ let handleEvent = (evt) => onEvent(evt);
1157
+ return document.addEventListener("mousedown", handleEvent), () => {
1158
+ document.removeEventListener("mousedown", handleEvent);
1159
+ };
1160
+ }, [hasListener]), (0, react.useDebugValue)(listener ? "MouseDown On" : "MouseDown Off");
1161
+ }
1162
+ /**
1163
+ * @beta
1164
+ */
1165
+ function useCustomValidity(ref, customValidity) {
1166
+ (0, react.useEffect)(() => {
1167
+ ref.current?.setCustomValidity(customValidity || "");
1168
+ }, [customValidity, ref]);
1169
+ }
1170
+ /**
1171
+ * @internal
1172
+ */
1173
+ const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : _juggle_resize_observer.ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
1174
+ function _createElementRectValueListener() {
1175
+ return { subscribe(element, subscriber) {
1176
+ let resizeObserver = new _ResizeObserver(([entry]) => {
1177
+ subscriber({
1178
+ _contentRect: entry.contentRect,
1179
+ border: {
1180
+ width: entry.borderBoxSize[0].inlineSize,
1181
+ height: entry.borderBoxSize[0].blockSize
1182
+ },
1183
+ content: {
1184
+ width: entry.contentRect.width,
1185
+ height: entry.contentRect.height
1186
+ }
1187
+ });
1188
+ });
1189
+ return resizeObserver.observe(element), () => {
1190
+ resizeObserver.unobserve(element), resizeObserver.disconnect();
1191
+ };
1192
+ } };
1193
+ }
1194
+ function _createElementSizeObserver() {
1195
+ let disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
1196
+ return { subscribe(element, subscriber) {
1197
+ let subscribers = subscribersCache.get(element) || [], dispose = disposeCache.get(element);
1198
+ return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
1199
+ for (let sub of subscribers) sub(elementRect);
1200
+ })), subscribers.push(subscriber), () => {
1201
+ let idx = subscribers.indexOf(subscriber);
1202
+ idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
1203
+ };
1204
+ } };
1205
+ }
1206
+ /**
1207
+ * Subscribe to the size of a DOM element.
1208
+ * @beta
1209
+ */
1210
+ function useElementSize(element) {
1211
+ let [size, setSize] = (0, react.useState)(null);
1212
+ return (0, react.useEffect)(() => {
1213
+ if (element) return _elementSizeObserver.subscribe(element, setSize);
1214
+ }, [element]), size;
1215
+ }
1216
+ /**
1217
+ * Adds global keydown event listener to the window.
1218
+ *
1219
+ * @param onKeyDown - The function to call when a keydown event is triggered.
1220
+ * @param options - The options to pass to the addEventListener function (example, capture: true)
1221
+ * @beta
1222
+ */
1223
+ function useGlobalKeyDown(onKeyDown, options) {
1224
+ let handleKeyDown = (0, use_effect_event.useEffectEvent)((event) => onKeyDown(event));
1225
+ (0, react.useEffect)(() => {
1226
+ let handler = (event) => handleKeyDown(event);
1227
+ return window.addEventListener("keydown", handler, options), () => window.removeEventListener("keydown", handler, options);
1228
+ }, [options]);
1229
+ }
1230
+ /**
1231
+ * Efficiently subscribes to `window.matchMedia` queries
1232
+ *
1233
+ * @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)
1234
+ *
1235
+ * @public
1236
+ */
1237
+ function useMatchMedia(mediaQueryString, getServerSnapshot) {
1238
+ return (0, react.useDebugValue)(mediaQueryString), (0, react.useSyncExternalStore)((0, react.useCallback)((onStoreChange) => {
1239
+ let media = window.matchMedia(mediaQueryString);
1240
+ return media.addEventListener("change", onStoreChange), () => media.removeEventListener("change", onStoreChange);
1241
+ }, [mediaQueryString]), () => window.matchMedia(mediaQueryString).matches, getServerSnapshot);
1242
+ }
1243
+ function _getMediaQuery(media, index) {
1244
+ 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)`;
1245
+ }
1246
+ function _createMediaStore(media) {
1247
+ let mediaLen = media.length, sizes, getSizes = () => {
1248
+ if (!sizes) {
1249
+ sizes = [];
1250
+ for (let index = mediaLen; index > -1; --index) {
1251
+ let mediaQuery = _getMediaQuery(media, index);
1252
+ sizes.push({
1253
+ index,
1254
+ mq: window.matchMedia(mediaQuery)
1255
+ });
1256
+ }
1257
+ }
1258
+ return sizes;
1259
+ };
1260
+ return {
1261
+ getSnapshot: () => {
1262
+ for (let { index, mq } of getSizes()) if (mq.matches) return index;
1263
+ return 0;
1264
+ },
1265
+ subscribe: (onStoreChange) => {
1266
+ let disposeFns = [];
1267
+ for (let { mq } of getSizes()) {
1268
+ let handleChange = () => {
1269
+ mq.matches && onStoreChange();
1270
+ };
1271
+ mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
1272
+ }
1273
+ return () => {
1274
+ for (let disposeFn of disposeFns) disposeFn();
1275
+ };
1276
+ }
1277
+ };
1278
+ }
1279
+ /**
1280
+ * Only called during server-side rendering, and hydration if using hydrateRoot
1281
+ * Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query
1282
+ * and we assume `(prefers-color-scheme: light)` since it's the most common scheme
1283
+ *
1284
+ * @link https://beta.reactjs.org/apis/react/useSyncExternalStore#adding-support-for-server-rendering
1285
+ */
1286
+ function getServerSnapshot() {
1287
+ return 0;
1288
+ }
1289
+ /**
1290
+ * This API might change. DO NOT USE IN PRODUCTION.
1291
+ * @beta
1292
+ */
1293
+ function useMediaIndex() {
1294
+ let { media } = useTheme_v2(), store = (0, react.useMemo)(() => _createMediaStore(media), [media]);
1295
+ return (0, react.useSyncExternalStore)(store.subscribe, store.getSnapshot, getServerSnapshot);
1296
+ }
1297
+ /**
1298
+ * Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
1299
+ *
1300
+ * @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)
1301
+ *
1302
+ * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
1303
+ * 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
1304
+ * @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
1305
+ *
1306
+ * @public
1307
+ */
1308
+ function usePrefersDark(getServerSnapshot = () => !1) {
1309
+ return useMatchMedia("(prefers-color-scheme: dark)", getServerSnapshot);
1310
+ }
1311
+ /**
1312
+ * Returns true if motion should be reduced
1313
+ *
1314
+ * @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-reduced-motion: no-preference)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
1315
+ *
1316
+ * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
1317
+ * Chrome supports reading the `prefers-reduced-motion` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion
1318
+ * @example https://gist.github.com/stipsan/0c0f839a27842249cada893e9fb7767b
1319
+ *
1320
+ * @public
1321
+ */
1322
+ function usePrefersReducedMotion(getServerSnapshot = () => !1) {
1323
+ return useMatchMedia("(prefers-reduced-motion: reduce)", getServerSnapshot);
1324
+ }
1325
+ const StyledGrid = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
1326
+ displayName: "StyledGrid",
1327
+ componentId: "sc-p9qx07-0"
1328
+ })(responsiveGridStyle), GridComponent = (0, react.forwardRef)(function(props, ref) {
1329
+ let $ = (0, react_compiler_runtime.c)(44), as, autoCols, autoFlow, autoRows, children, columns, gap, gapX, gapY, gridTemplateColumns, gridTemplateRows, restProps, rows;
1330
+ $[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);
1331
+ let t0 = typeof as == "string" ? as : void 0, t1;
1332
+ $[14] === autoRows ? t1 = $[15] : (t1 = _getArrayProp(autoRows), $[14] = autoRows, $[15] = t1);
1333
+ let t2;
1334
+ $[16] === autoCols ? t2 = $[17] : (t2 = _getArrayProp(autoCols), $[16] = autoCols, $[17] = t2);
1335
+ let t3;
1336
+ $[18] === autoFlow ? t3 = $[19] : (t3 = _getArrayProp(autoFlow), $[18] = autoFlow, $[19] = t3);
1337
+ let t4 = gridTemplateColumns === void 0 ? columns : gridTemplateColumns, t5;
1338
+ $[20] === t4 ? t5 = $[21] : (t5 = _getArrayProp(t4), $[20] = t4, $[21] = t5);
1339
+ let t6;
1340
+ $[22] === gap ? t6 = $[23] : (t6 = _getArrayProp(gap), $[22] = gap, $[23] = t6);
1341
+ let t7;
1342
+ $[24] === gapX ? t7 = $[25] : (t7 = _getArrayProp(gapX), $[24] = gapX, $[25] = t7);
1343
+ let t8;
1344
+ $[26] === gapY ? t8 = $[27] : (t8 = _getArrayProp(gapY), $[26] = gapY, $[27] = t8);
1345
+ let t9 = gridTemplateRows === void 0 ? rows : gridTemplateRows, t10;
1346
+ $[28] === t9 ? t10 = $[29] : (t10 = _getArrayProp(t9), $[28] = t9, $[29] = t10);
1347
+ let t11;
1348
+ 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, {
1349
+ "data-as": t0,
1350
+ "data-ui": "Grid",
1351
+ ...restProps,
1352
+ $autoRows: t1,
1353
+ $autoCols: t2,
1354
+ $autoFlow: t3,
1355
+ $columns: t5,
1356
+ $gap: t6,
1357
+ $gapX: t7,
1358
+ $gapY: t8,
1359
+ $rows: t10,
1360
+ forwardedAs: as,
1361
+ ref,
1362
+ children
1363
+ }), $[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;
1364
+ });
1365
+ GridComponent.displayName = "ForwardRef(Grid)";
1366
+ /**
1367
+ * The `Grid` component is for building 2-dimensional layers (based on CSS grid).
1368
+ *
1369
+ * @public
1370
+ */
1371
+ const Grid = GridComponent;
1372
+ function inlineBaseStyle() {
1373
+ return {
1374
+ lineHeight: "0",
1375
+ "&&:not([hidden])": { display: "block" },
1376
+ "& > div": {
1377
+ display: "inline-block",
1378
+ verticalAlign: "middle"
1379
+ }
1380
+ };
1381
+ }
1382
+ function inlineSpaceStyle(props) {
1383
+ let { media, space } = require_theme.X(props.theme);
1384
+ return _responsive(media, props.$space, (spaceIndex) => {
1385
+ let _space = rem(spaceIndex === .5 ? space[1] / 2 : space[spaceIndex]);
1386
+ return {
1387
+ margin: `-${_space} 0 0 -${_space}`,
1388
+ "& > div": { padding: `${_space} 0 0 ${_space}` }
1389
+ };
1390
+ });
1391
+ }
1392
+ const StyledInline = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
1393
+ displayName: "StyledInline",
1394
+ componentId: "sc-aabqmb-0"
1395
+ })(inlineBaseStyle, inlineSpaceStyle), InlineComponent = (0, react.forwardRef)(function(props, ref) {
1396
+ let $ = (0, react_compiler_runtime.c)(16), as, childrenProp, deprecated_space, gap, restProps;
1397
+ $[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);
1398
+ let spacing = gap === void 0 ? deprecated_space : gap, t0;
1399
+ $[6] === childrenProp ? t0 = $[7] : (t0 = react.Children.map(childrenProp, _temp$4), $[6] = childrenProp, $[7] = t0);
1400
+ let children = t0, t1;
1401
+ $[8] === spacing ? t1 = $[9] : (t1 = _getArrayProp(spacing), $[8] = spacing, $[9] = t1);
1402
+ let t2 = ref, t3;
1403
+ return $[10] !== as || $[11] !== children || $[12] !== restProps || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledInline, {
1404
+ "data-ui": "Inline",
1405
+ ...restProps,
1406
+ $space: t1,
1407
+ forwardedAs: as,
1408
+ ref: t2,
1409
+ children
1410
+ }), $[10] = as, $[11] = children, $[12] = restProps, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
1411
+ });
1412
+ InlineComponent.displayName = "ForwardRef(Inline)";
1413
+ /**
1414
+ * The `Inline` component is a layout utility for aligning and spacing items horizontally.
1415
+ *
1416
+ * @public
1417
+ */
1418
+ const Inline = InlineComponent;
1419
+ function _temp$4(child) {
1420
+ return child && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: child });
1421
+ }
1422
+ function kbdStyle() {
1423
+ 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;}`;
1424
+ }
1425
+ const StyledKBD = /* @__PURE__ */ styled_components.styled.kbd.withConfig({
1426
+ displayName: "StyledKBD",
1427
+ componentId: "sc-ielwjm-0"
1428
+ })(responsiveRadiusStyle, kbdStyle), KBDComponent = (0, react.forwardRef)(function(props, ref) {
1429
+ let $ = (0, react_compiler_runtime.c)(19), children, restProps, t0, t1, t2;
1430
+ $[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);
1431
+ let fontSize = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? 2 : t2, t3;
1432
+ $[6] === radius ? t3 = $[7] : (t3 = _getArrayProp(radius), $[6] = radius, $[7] = t3);
1433
+ let t4;
1434
+ $[8] !== children || $[9] !== fontSize ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
1435
+ as: "span",
1436
+ size: fontSize,
1437
+ weight: "semibold",
1438
+ children
1439
+ }), $[8] = children, $[9] = fontSize, $[10] = t4) : t4 = $[10];
1440
+ let t5;
1441
+ $[11] !== padding || $[12] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
1442
+ as: "span",
1443
+ padding,
1444
+ children: t4
1445
+ }), $[11] = padding, $[12] = t4, $[13] = t5) : t5 = $[13];
1446
+ let t6;
1447
+ return $[14] !== ref || $[15] !== restProps || $[16] !== t3 || $[17] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledKBD, {
1448
+ "data-ui": "KBD",
1449
+ ...restProps,
1450
+ $radius: t3,
1451
+ ref,
1452
+ children: t5
1453
+ }), $[14] = ref, $[15] = restProps, $[16] = t3, $[17] = t5, $[18] = t6) : t6 = $[18], t6;
1454
+ });
1455
+ KBDComponent.displayName = "ForwardRef(KBD)";
1456
+ /**
1457
+ * Used to define some text as keyboard input.
1458
+ *
1459
+ * @public
1460
+ */
1461
+ const KBD = KBDComponent, origin = {
1462
+ name: "@sanity/ui/origin",
1463
+ fn({ middlewareData, placement, rects }) {
1464
+ let [side] = placement.split("-"), floatingWidth = rects.floating.width, floatingHeight = rects.floating.height, shiftX = middlewareData.shift?.x || 0, shiftY = middlewareData.shift?.y || 0;
1465
+ if (floatingWidth <= 0 || floatingHeight <= 0) return {};
1466
+ let { originX, originY } = ["bottom", "top"].includes(side) ? {
1467
+ originX: clamp(.5 - shiftX / floatingWidth, 0, 1),
1468
+ originY: side === "bottom" ? 0 : 1
1469
+ } : {
1470
+ originX: +(side === "left"),
1471
+ originY: clamp(.5 - shiftY / floatingHeight, 0, 1)
1472
+ };
1473
+ return { data: {
1474
+ originX,
1475
+ originY
1476
+ } };
1477
+ }
1478
+ };
1479
+ function clamp(num, min, max) {
1480
+ return Math.min(Math.max(num, min), max);
1481
+ }
1482
+ function moveTowardsLength(movingPoint, targetPoint, amount) {
1483
+ let width = targetPoint.x - movingPoint.x, height = targetPoint.y - movingPoint.y, distance = Math.sqrt(width * width + height * height);
1484
+ return moveTowardsFractional(movingPoint, targetPoint, Math.min(1, amount / distance));
1485
+ }
1486
+ function moveTowardsFractional(movingPoint, targetPoint, fraction) {
1487
+ return {
1488
+ x: movingPoint.x + (targetPoint.x - movingPoint.x) * fraction,
1489
+ y: movingPoint.y + (targetPoint.y - movingPoint.y) * fraction
1490
+ };
1491
+ }
1492
+ function getRoundedCommands(points) {
1493
+ let len = points.length, cmds = [];
1494
+ for (let i = 0; i < len; i += 1) {
1495
+ let point = points[i], prevPoint = points[i - 1], nextPoint = points[i + 1];
1496
+ if (prevPoint && point.radius) {
1497
+ let curveStart = moveTowardsLength(point, prevPoint, point.radius), curveEnd = moveTowardsLength(point, nextPoint, point.radius), startControl = moveTowardsFractional(curveStart, point, .5), endControl = moveTowardsFractional(point, curveEnd, .5);
1498
+ cmds.push({
1499
+ type: "point",
1500
+ ...curveStart
1501
+ }), cmds.push({
1502
+ type: "curve",
1503
+ curveEnd,
1504
+ startControl,
1505
+ endControl
1506
+ });
1507
+ } else cmds.push({
1508
+ type: "point",
1509
+ ...point
1510
+ });
1511
+ }
1512
+ return cmds;
1513
+ }
1514
+ function compileCommands(cmds) {
1515
+ 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(" ");
1516
+ }
1517
+ const StyledArrow = /* @__PURE__ */ styled_components.styled.div.withConfig({
1518
+ displayName: "StyledArrow",
1519
+ componentId: "sc-d20m08-0"
1520
+ })(({ $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({
1521
+ displayName: "StrokePath",
1522
+ componentId: "sc-d20m08-1"
1523
+ })`stroke:var(--card-shadow-outline-color);`, ShapePath = styled_components.styled.path.withConfig({
1524
+ displayName: "ShapePath",
1525
+ componentId: "sc-d20m08-2"
1526
+ })`fill:var(--card-bg-color);`, Arrow = (0, react.forwardRef)(function(props, ref) {
1527
+ let $ = (0, react_compiler_runtime.c)(29), h, restProps, t0, w;
1528
+ $[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);
1529
+ let radius = t0 === void 0 ? 0 : t0, { card } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, t1;
1530
+ $[5] !== center || $[6] !== h || $[7] !== radius || $[8] !== w ? (t1 = compileCommands(getRoundedCommands([
1531
+ {
1532
+ x: 0,
1533
+ y: 0
1534
+ },
1535
+ {
1536
+ x: radius,
1537
+ y: 0,
1538
+ radius
1539
+ },
1540
+ {
1541
+ x: center,
1542
+ y: h - 1,
1543
+ radius
1544
+ },
1545
+ {
1546
+ x: w - radius,
1547
+ y: 0,
1548
+ radius
1549
+ },
1550
+ {
1551
+ x: w,
1552
+ y: 0
1553
+ }
1554
+ ])), $[5] = center, $[6] = h, $[7] = radius, $[8] = w, $[9] = t1) : t1 = $[9];
1555
+ let path = t1, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t2 = `0 0 ${w} ${w}`, t3;
1556
+ $[10] !== strokeWidth || $[11] !== w ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("mask", {
1557
+ id: "stroke-mask",
1558
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
1559
+ x: 0,
1560
+ y: strokeWidth,
1561
+ width: w,
1562
+ height: w,
1563
+ fill: "white"
1564
+ })
1565
+ }), $[10] = strokeWidth, $[11] = w, $[12] = t3) : t3 = $[12];
1566
+ let t4 = strokeWidth * 2, t5;
1567
+ $[13] !== strokePath || $[14] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrokePath, {
1568
+ d: strokePath,
1569
+ mask: "url(#stroke-mask)",
1570
+ strokeWidth: t4
1571
+ }), $[13] = strokePath, $[14] = t4, $[15] = t5) : t5 = $[15];
1572
+ let t6;
1573
+ $[16] === fillPath ? t6 = $[17] : (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ShapePath, { d: fillPath }), $[16] = fillPath, $[17] = t6);
1574
+ let t7;
1575
+ $[18] !== t2 || $[19] !== t3 || $[20] !== t5 || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1576
+ width: w,
1577
+ height: w,
1578
+ viewBox: t2,
1579
+ children: [
1580
+ t3,
1581
+ t5,
1582
+ t6
1583
+ ]
1584
+ }), $[18] = t2, $[19] = t3, $[20] = t5, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23];
1585
+ let t8;
1586
+ return $[24] !== ref || $[25] !== restProps || $[26] !== t7 || $[27] !== w ? (t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledArrow, {
1587
+ ...restProps,
1588
+ $w: w,
1589
+ ref,
1590
+ children: t7
1591
+ }), $[24] = ref, $[25] = restProps, $[26] = t7, $[27] = w, $[28] = t8) : t8 = $[28], t8;
1592
+ });
1593
+ Arrow.displayName = "ForwardRef(Arrow)";
1594
+ const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
1595
+ function isRecord(value) {
1596
+ return !!(value && typeof value == "object" && !Array.isArray(value));
1597
+ }
1598
+ const DEFAULT_VALUE = {
1599
+ version: 0,
1600
+ element: null
1601
+ };
1602
+ /**
1603
+ * @public
1604
+ */
1605
+ function useBoundaryElement() {
1606
+ let value = (0, react.useContext)(BoundaryElementContext);
1607
+ if (value && (!isRecord(value) || value.version !== 0)) throw Error("useBoundaryElement(): the context value is not compatible");
1608
+ return value || DEFAULT_VALUE;
1609
+ }
1610
+ function getLayerContext(contextValue) {
1611
+ if (!isRecord(contextValue) || contextValue.version !== 0) throw Error("the context value is not compatible");
1612
+ if (!contextValue) throw Error("components using `useLayer()` should be wrapped in a <LayerProvider>.");
1613
+ if (contextValue.version === 0) return contextValue;
1614
+ throw Error("could not get layer context");
1615
+ }
1616
+ const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
1617
+ /**
1618
+ * @public
1619
+ */
1620
+ function LayerProvider(props) {
1621
+ let $ = (0, react_compiler_runtime.c)(21), { children, zOffset: t0 } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = (0, react.useContext)(LayerContext), t1;
1622
+ $[0] === parentContextValue ? t1 = $[1] : (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1);
1623
+ let parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, t2;
1624
+ $[2] === zOffsetProp ? t2 = $[3] : (t2 = _getArrayProp(zOffsetProp), $[2] = zOffsetProp, $[3] = t2);
1625
+ let zOffset = t2, maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex], t3;
1626
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[4] = t3) : t3 = $[4];
1627
+ let [, setChildLayers] = (0, react.useState)(t3), [size, setSize] = (0, react.useState)(0), isTopLayer = size === 0, t4;
1628
+ $[5] !== parentRegisterChild || $[6] !== setChildLayers ? (t4 = (childLevel) => {
1629
+ let parentDispose = parentRegisterChild?.(childLevel);
1630
+ return childLevel === void 0 ? setSize(_temp$3) : setChildLayers((state) => {
1631
+ let prevLen = state[childLevel] ?? 0, nextState = {
1632
+ ...state,
1633
+ [childLevel]: prevLen + 1
1634
+ };
1635
+ return setSize(Object.keys(nextState).length), nextState;
1636
+ }), () => {
1637
+ childLevel === void 0 ? setSize(_temp2$2) : setChildLayers((state_0) => {
1638
+ let nextState_0 = { ...state_0 };
1639
+ return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
1640
+ }), parentDispose?.();
1641
+ };
1642
+ }, $[5] = parentRegisterChild, $[6] = setChildLayers, $[7] = t4) : t4 = $[7];
1643
+ let registerChild = t4, t5, t6;
1644
+ $[8] !== level || $[9] !== parentRegisterChild ? (t5 = () => parentRegisterChild?.(level), t6 = [level, parentRegisterChild], $[8] = level, $[9] = parentRegisterChild, $[10] = t5, $[11] = t6) : (t5 = $[10], t6 = $[11]), (0, react.useEffect)(t5, t6);
1645
+ let t7;
1646
+ $[12] !== isTopLayer || $[13] !== level || $[14] !== registerChild || $[15] !== size || $[16] !== zIndex ? (t7 = {
1647
+ version: 0,
1648
+ isTopLayer,
1649
+ level,
1650
+ registerChild,
1651
+ size,
1652
+ zIndex
1653
+ }, $[12] = isTopLayer, $[13] = level, $[14] = registerChild, $[15] = size, $[16] = zIndex, $[17] = t7) : t7 = $[17];
1654
+ let value = t7, t8;
1655
+ return $[18] !== children || $[19] !== value ? (t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LayerContext.Provider, {
1656
+ value,
1657
+ children
1658
+ }), $[18] = children, $[19] = value, $[20] = t8) : t8 = $[20], t8;
1659
+ }
1660
+ function _temp2$2(v_0) {
1661
+ return v_0 - 1;
1662
+ }
1663
+ function _temp$3(v) {
1664
+ return v + 1;
1665
+ }
1666
+ LayerProvider.displayName = "LayerProvider";
1667
+ /**
1668
+ * @public
1669
+ */
1670
+ function useLayer() {
1671
+ let value = (0, react.useContext)(LayerContext);
1672
+ if (!value) throw Error("useLayer(): missing context value");
1673
+ try {
1674
+ return getLayerContext(value);
1675
+ } catch (err) {
1676
+ throw err instanceof Error ? Error(`useLayer(): ${err.message}`) : Error(`useLayer(): ${err}`);
1677
+ }
1678
+ }
1679
+ const StyledLayer = /* @__PURE__ */ styled_components.styled.div.withConfig({
1680
+ displayName: "StyledLayer",
1681
+ componentId: "sc-h90030-0"
1682
+ })({ position: "relative" }), LayerChildren = (0, react.forwardRef)(function(props, forwardedRef) {
1683
+ let $ = (0, react_compiler_runtime.c)(22), children, onActivate, onFocus, restProps, t0;
1684
+ $[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);
1685
+ 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;
1686
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[6] = t1) : t1 = $[6], (0, react.useImperativeHandle)(forwardedRef, t1);
1687
+ let t2, t3;
1688
+ $[7] !== isTopLayer || $[8] !== onActivate ? (t2 = () => {
1689
+ isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({ activeElement: lastFocusedRef.current }), isTopLayerRef.current = isTopLayer;
1690
+ }, t3 = [isTopLayer, onActivate], $[7] = isTopLayer, $[8] = onActivate, $[9] = t2, $[10] = t3) : (t2 = $[9], t3 = $[10]), (0, react.useEffect)(t2, t3);
1691
+ let t4;
1692
+ $[11] !== isTopLayer || $[12] !== onFocus ? (t4 = (event) => {
1693
+ onFocus?.(event);
1694
+ let rootElement = ref.current, target = document.activeElement;
1695
+ !isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
1696
+ }, $[11] = isTopLayer, $[12] = onFocus, $[13] = t4) : t4 = $[13];
1697
+ let handleFocus = t4, t5;
1698
+ $[14] !== style || $[15] !== zIndex ? (t5 = {
1699
+ ...style,
1700
+ zIndex
1701
+ }, $[14] = style, $[15] = zIndex, $[16] = t5) : t5 = $[16];
1702
+ let t6;
1703
+ return $[17] !== children || $[18] !== handleFocus || $[19] !== restProps || $[20] !== t5 ? (t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledLayer, {
1704
+ ...restProps,
1705
+ "data-ui": "Layer",
1706
+ onFocus: handleFocus,
1707
+ ref,
1708
+ style: t5,
1709
+ children
1710
+ }), $[17] = children, $[18] = handleFocus, $[19] = restProps, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
1711
+ }), Layer = (0, react.forwardRef)(function(props, ref) {
1712
+ let $ = (0, react_compiler_runtime.c)(11), children, restProps, t0;
1713
+ $[0] === props ? (children = $[1], restProps = $[2], t0 = $[3]) : ({children, zOffset: t0, ...restProps} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0);
1714
+ let zOffset = t0 === void 0 ? 1 : t0, t1;
1715
+ $[4] !== children || $[5] !== ref || $[6] !== restProps ? (t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LayerChildren, {
1716
+ ...restProps,
1717
+ ref,
1718
+ children
1719
+ }), $[4] = children, $[5] = ref, $[6] = restProps, $[7] = t1) : t1 = $[7];
1720
+ let t2;
1721
+ return $[8] !== t1 || $[9] !== zOffset ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LayerProvider, {
1722
+ zOffset,
1723
+ children: t1
1724
+ }), $[8] = t1, $[9] = zOffset, $[10] = t2) : t2 = $[10], t2;
1725
+ });
1726
+ Layer.displayName = "ForwardRef(Layer)";
1727
+ const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
1728
+ globalScope[elementKey] = null;
1729
+ const PortalContext = createGlobalScopedContext(key, {
1730
+ version: 0,
1731
+ boundaryElement: null,
1732
+ get element() {
1733
+ return typeof document > "u" ? null : globalScope[elementKey] ? globalScope[elementKey] : (globalScope[elementKey] = document.createElement("div"), globalScope[elementKey].setAttribute("data-portal", ""), document.body.appendChild(globalScope[elementKey]), globalScope[elementKey]);
1734
+ }
1735
+ });
1736
+ /**
1737
+ * @public
1738
+ */
1739
+ function usePortal() {
1740
+ let value = (0, react.useContext)(PortalContext);
1741
+ if (!value) throw Error("usePortal(): missing context value");
1742
+ if (!isRecord(value) || value.version !== 0) throw Error("usePortal(): the context value is not compatible");
1743
+ return value;
1744
+ }
1745
+ /**
1746
+ * @public
1747
+ */
1748
+ function Portal(props) {
1749
+ let { children, __unstable_name: name } = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
1750
+ return portalElement ? (0, react_dom.createPortal)(children, portalElement) : null;
1751
+ }
1752
+ Portal.displayName = "Portal";
1753
+ /**
1754
+ * @public
1755
+ */
1756
+ function PortalProvider(props) {
1757
+ let $ = (0, react_compiler_runtime.c)(7), { boundaryElement, children, element, __unstable_elements: elements } = props, fallbackElement = (0, react.useSyncExternalStore)(emptySubscribe, _temp$2, _temp2$1), t0 = boundaryElement || null, t1 = element || fallbackElement, t2;
1758
+ $[0] !== elements || $[1] !== t0 || $[2] !== t1 ? (t2 = {
1759
+ version: 0,
1760
+ boundaryElement: t0,
1761
+ element: t1,
1762
+ elements
1763
+ }, $[0] = elements, $[1] = t0, $[2] = t1, $[3] = t2) : t2 = $[3];
1764
+ let value = t2, t3;
1765
+ return $[4] !== children || $[5] !== value ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortalContext.Provider, {
1766
+ value,
1767
+ children
1768
+ }), $[4] = children, $[5] = value, $[6] = t3) : t3 = $[6], t3;
1769
+ }
1770
+ function _temp2$1() {
1771
+ return null;
1772
+ }
1773
+ function _temp$2() {
1774
+ return document.body;
1775
+ }
1776
+ PortalProvider.displayName = "PortalProvider";
1777
+ const emptySubscribe = () => () => {};
1778
+ function getElementRef(element) {
1779
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1780
+ 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);
1781
+ }
1782
+ const DEFAULT_POPOVER_MARGINS = [
1783
+ 0,
1784
+ 0,
1785
+ 0,
1786
+ 0
1787
+ ], DEFAULT_FALLBACK_PLACEMENTS$1 = {
1788
+ top: [
1789
+ "bottom",
1790
+ "left",
1791
+ "right"
1792
+ ],
1793
+ "top-start": [
1794
+ "bottom-start",
1795
+ "left-start",
1796
+ "right-start"
1797
+ ],
1798
+ "top-end": [
1799
+ "bottom-end",
1800
+ "left-end",
1801
+ "right-end"
1802
+ ],
1803
+ bottom: [
1804
+ "top",
1805
+ "left",
1806
+ "right"
1807
+ ],
1808
+ "bottom-start": [
1809
+ "top-start",
1810
+ "left-start",
1811
+ "right-start"
1812
+ ],
1813
+ "bottom-end": [
1814
+ "top-end",
1815
+ "left-end",
1816
+ "right-end"
1817
+ ],
1818
+ left: [
1819
+ "right",
1820
+ "top",
1821
+ "bottom"
1822
+ ],
1823
+ "left-start": [
1824
+ "right-start",
1825
+ "top-start",
1826
+ "bottom-start"
1827
+ ],
1828
+ "left-end": [
1829
+ "right-end",
1830
+ "top-end",
1831
+ "bottom-end"
1832
+ ],
1833
+ right: [
1834
+ "left",
1835
+ "top",
1836
+ "bottom"
1837
+ ],
1838
+ "right-start": [
1839
+ "left-start",
1840
+ "top-start",
1841
+ "bottom-start"
1842
+ ],
1843
+ "right-end": [
1844
+ "left-end",
1845
+ "top-end",
1846
+ "bottom-end"
1847
+ ]
1848
+ };
1849
+ function size(options) {
1850
+ let { constrainSize, margins, matchReferenceWidth, maxWidthRef, padding = 0, referenceWidthRef, setReferenceWidth, widthRef } = options;
1851
+ return {
1852
+ name: "@sanity/ui/size",
1853
+ async fn(args) {
1854
+ let { elements, placement, platform, rects } = args, { floating, reference } = rects, overflow = await (0, _floating_ui_react_dom.detectOverflow)(args, {
1855
+ altBoundary: !0,
1856
+ boundary: options.boundaryElement || void 0,
1857
+ elementContext: "floating",
1858
+ padding,
1859
+ rootBoundary: "viewport"
1860
+ }), maxWidth = Infinity, maxHeight = Infinity, floatingW = floating.width, floatingH = floating.height;
1861
+ placement.includes("top") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.top), placement.includes("right") && (maxWidth = floatingW - overflow.right, maxHeight = floatingH - (overflow.top + overflow.bottom)), placement.includes("bottom") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.bottom), placement.includes("left") && (maxWidth = floatingW - overflow.left, maxHeight = floatingH - (overflow.top + overflow.bottom));
1862
+ let availableWidth = maxWidth - margins[1] - margins[3], availableHeight = maxHeight - margins[0] - margins[2], referenceWidth = reference.width - margins[1] - margins[3];
1863
+ referenceWidthRef.current = referenceWidth, setReferenceWidth(referenceWidth), matchReferenceWidth ? elements.floating.style.width = `${referenceWidth}px` : widthRef.current !== void 0 && (elements.floating.style.width = `${widthRef.current}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(availableWidth, maxWidthRef.current ?? Infinity)}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
1864
+ let nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height;
1865
+ return floatingW !== nextDimensions.width || floatingH !== targetH ? { reset: { rects: !0 } } : {};
1866
+ }
1867
+ };
1868
+ }
1869
+ function calcCurrentWidth(params) {
1870
+ let { container, mediaIndex, width } = params, w = width[mediaIndex], currentWidth = w === void 0 ? width[width.length - 1] : w;
1871
+ return typeof currentWidth == "number" ? container[currentWidth] : void 0;
1872
+ }
1873
+ function calcMaxWidth(params) {
1874
+ let { boundaryWidth, currentWidth } = params;
1875
+ if (!(currentWidth === void 0 && boundaryWidth === void 0)) return Math.min(currentWidth ?? Infinity, (boundaryWidth || Infinity) - 8);
1876
+ }
1877
+ const MotionCard$1 = (0, styled_components.styled)(motion_react.motion.create(Card)).withConfig({
1878
+ displayName: "MotionCard",
1879
+ componentId: "sc-5mkek4-0"
1880
+ })`&: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({
1881
+ displayName: "MotionFlex",
1882
+ componentId: "sc-5mkek4-1"
1883
+ })`will-change:opacity;`, PopoverCard = (0, react.forwardRef)(function(props, ref) {
1884
+ 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;
1885
+ $[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);
1886
+ let { zIndex } = useLayer(), margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t0 = animate ? "transform" : void 0, t1;
1887
+ $[23] !== originX || $[24] !== originY || $[25] !== strategy || $[26] !== style || $[27] !== t0 || $[28] !== width || $[29] !== x || $[30] !== y || $[31] !== zIndex ? (t1 = {
1888
+ left: x,
1889
+ originX,
1890
+ originY,
1891
+ position: strategy,
1892
+ top: y,
1893
+ width,
1894
+ zIndex,
1895
+ willChange: t0,
1896
+ ...style
1897
+ }, $[23] = originX, $[24] = originY, $[25] = strategy, $[26] = style, $[27] = t0, $[28] = width, $[29] = x, $[30] = y, $[31] = zIndex, $[32] = t1) : t1 = $[32];
1898
+ let rootStyle = t1, t2 = arrowX === null ? void 0 : arrowX, t3 = arrowY === null ? void 0 : arrowY, t4;
1899
+ $[33] !== t2 || $[34] !== t3 ? (t4 = {
1900
+ left: t2,
1901
+ top: t3,
1902
+ right: void 0,
1903
+ bottom: void 0
1904
+ }, $[33] = t2, $[34] = t3, $[35] = t4) : t4 = $[35];
1905
+ let arrowStyle = t4, t5 = restProps, t6;
1906
+ $[36] === animate ? t6 = $[37] : (t6 = animate ? ["hidden", "initial"] : void 0, $[36] = animate, $[37] = t6);
1907
+ let t7;
1908
+ $[38] === animate ? t7 = $[39] : (t7 = animate ? ["visible", "scaleIn"] : void 0, $[38] = animate, $[39] = t7);
1909
+ let t8;
1910
+ $[40] === animate ? t8 = $[41] : (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[40] = animate, $[41] = t8);
1911
+ let t9;
1912
+ $[42] !== children || $[43] !== padding ? (t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Flex, {
1913
+ direction: "column",
1914
+ flex: 1,
1915
+ padding,
1916
+ children
1917
+ }), $[42] = children, $[43] = padding, $[44] = t9) : t9 = $[44];
1918
+ let t10;
1919
+ $[45] !== overflow || $[46] !== t9 ? (t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MotionFlex, {
1920
+ "data-ui": "Popover__wrapper",
1921
+ direction: "column",
1922
+ flex: 1,
1923
+ overflow,
1924
+ variants: POPOVER_MOTION_PROPS.children,
1925
+ transition: POPOVER_MOTION_PROPS.transition,
1926
+ children: t9
1927
+ }), $[45] = overflow, $[46] = t9, $[47] = t10) : t10 = $[47];
1928
+ let t11;
1929
+ $[48] !== arrow || $[49] !== arrowRef || $[50] !== arrowStyle ? (t11 = arrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Arrow, {
1930
+ ref: arrowRef,
1931
+ style: arrowStyle,
1932
+ width: 19,
1933
+ height: 8,
1934
+ radius: 2
1935
+ }), $[48] = arrow, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t11) : t11 = $[51];
1936
+ let t12;
1937
+ 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, {
1938
+ "data-ui": "Popover",
1939
+ ...t5,
1940
+ "data-placement": placement,
1941
+ radius,
1942
+ ref,
1943
+ scheme,
1944
+ shadow,
1945
+ sizing: "border",
1946
+ style: rootStyle,
1947
+ tone,
1948
+ variants: POPOVER_MOTION_PROPS.card,
1949
+ transition: POPOVER_MOTION_PROPS.transition,
1950
+ initial: t6,
1951
+ animate: t7,
1952
+ exit: t8,
1953
+ children: [t10, t11]
1954
+ }), $[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;
1955
+ });
1956
+ PopoverCard.displayName = "ForwardRef(PopoverCard)";
1957
+ const ViewportOverlay = () => {
1958
+ let $ = (0, react_compiler_runtime.c)(2), { zIndex } = useLayer(), t0;
1959
+ return $[0] === zIndex ? t0 = $[1] : (t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
1960
+ height: "100vh",
1961
+ inset: 0,
1962
+ position: "fixed",
1963
+ width: "100vw",
1964
+ zIndex
1965
+ } }), $[0] = zIndex, $[1] = t0), t0;
1966
+ }, Popover = (0, react.forwardRef)(function(props, forwardedRef) {
1967
+ 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;
1968
+ if ($[0] !== props) {
1969
+ 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;
1970
+ 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;
1971
+ } 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];
1972
+ let margins = t0 === void 0 ? DEFAULT_POPOVER_MARGINS : t0, _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, constrainSize = t3 === void 0 ? !1 : t3, overflow = t4 === void 0 ? "hidden" : t4, placementProp = t5 === void 0 ? "bottom" : t5, placementStrategy = t6 === void 0 ? "flip" : t6, preventOverflow = t7 === void 0 ? !0 : t7, radiusProp = t8 === void 0 ? 3 : t8, shadowProp = t9 === void 0 ? 3 : t9, tone = t10 === void 0 ? "inherit" : t10, widthProp = t11 === void 0 ? "auto" : t11, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? props.boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? props.boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, t12;
1973
+ $[30] === paddingProp ? t12 = $[31] : (t12 = _getArrayProp(paddingProp), $[30] = paddingProp, $[31] = t12);
1974
+ let padding = t12, t13;
1975
+ $[32] === radiusProp ? t13 = $[33] : (t13 = _getArrayProp(radiusProp), $[32] = radiusProp, $[33] = t13);
1976
+ let radius = t13, t14;
1977
+ $[34] === shadowProp ? t14 = $[35] : (t14 = _getArrayProp(shadowProp), $[34] = shadowProp, $[35] = t14);
1978
+ let shadow = t14, widthArrayProp = _getArrayProp(widthProp), t15;
1979
+ $[36] === zOffsetProp ? t15 = $[37] : (t15 = _getArrayProp(zOffsetProp), $[36] = zOffsetProp, $[37] = t15);
1980
+ let zOffset = t15, ref = (0, react.useRef)(null), arrowRef = (0, react.useRef)(null), t16;
1981
+ $[38] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => ref.current, $[38] = t16) : t16 = $[38], (0, react.useImperativeHandle)(forwardedRef, t16);
1982
+ let mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
1983
+ container,
1984
+ mediaIndex,
1985
+ width: widthArrayProp
1986
+ }), widthRef = (0, react.useRef)(width), t17, t18;
1987
+ $[39] === width ? (t17 = $[40], t18 = $[41]) : (t17 = () => {
1988
+ widthRef.current = width;
1989
+ }, t18 = [width], $[39] = width, $[40] = t17, $[41] = t18), (0, react.useEffect)(t17, t18);
1990
+ let t19;
1991
+ $[42] !== boundaryWidth || $[43] !== width ? (t19 = calcMaxWidth({
1992
+ boundaryWidth,
1993
+ currentWidth: width
1994
+ }), $[42] = boundaryWidth, $[43] = width, $[44] = t19) : t19 = $[44];
1995
+ let maxWidth = t19, maxWidthRef = (0, react.useRef)(maxWidth), t20, t21;
1996
+ $[45] === maxWidth ? (t20 = $[46], t21 = $[47]) : (t20 = () => {
1997
+ maxWidthRef.current = maxWidth;
1998
+ }, t21 = [maxWidth], $[45] = maxWidth, $[46] = t20, $[47] = t21), (0, react.useEffect)(t20, t21);
1999
+ let referenceWidthRef = (0, react.useRef)(void 0), t22, t23;
2000
+ $[48] !== matchReferenceWidth || $[49] !== maxWidth || $[50] !== open || $[51] !== width ? (t22 = () => {
2001
+ let floatingElement = ref.current;
2002
+ if (!open || !floatingElement) return;
2003
+ let referenceWidth = referenceWidthRef.current;
2004
+ matchReferenceWidth ? referenceWidth !== void 0 && (floatingElement.style.width = `${referenceWidth}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
2005
+ }, t23 = [
2006
+ width,
2007
+ matchReferenceWidth,
2008
+ maxWidth,
2009
+ open
2010
+ ], $[48] = matchReferenceWidth, $[49] = maxWidth, $[50] = open, $[51] = width, $[52] = t22, $[53] = t23) : (t22 = $[52], t23 = $[53]), (0, react.useEffect)(t22, t23);
2011
+ let [referenceWidth_0, setReferenceWidth] = (0, react.useState)(void 0), t24;
2012
+ $[54] !== animate || $[55] !== arrowProp || $[56] !== constrainSize || $[57] !== fallbackPlacements || $[58] !== floatingBoundary || $[59] !== margins || $[60] !== matchReferenceWidth || $[61] !== placementProp || $[62] !== placementStrategy || $[63] !== preventOverflow || $[64] !== referenceBoundary ? (t24 = {
2013
+ animate,
2014
+ arrowProp,
2015
+ arrowRef,
2016
+ constrainSize,
2017
+ fallbackPlacements,
2018
+ floatingBoundary,
2019
+ margins,
2020
+ matchReferenceWidth,
2021
+ maxWidthRef,
2022
+ placementProp,
2023
+ placementStrategy,
2024
+ preventOverflow,
2025
+ referenceBoundary,
2026
+ referenceWidthRef,
2027
+ rootBoundary: "viewport",
2028
+ setReferenceWidth,
2029
+ widthRef
2030
+ }, $[54] = animate, $[55] = arrowProp, $[56] = constrainSize, $[57] = fallbackPlacements, $[58] = floatingBoundary, $[59] = margins, $[60] = matchReferenceWidth, $[61] = placementProp, $[62] = placementStrategy, $[63] = preventOverflow, $[64] = referenceBoundary, $[65] = t24) : t24 = $[65];
2031
+ let middleware = useMiddleware$1(t24), t25;
2032
+ $[66] === referenceElement ? t25 = $[67] : (t25 = referenceElement ? { reference: referenceElement } : void 0, $[66] = referenceElement, $[67] = t25);
2033
+ let t26;
2034
+ $[68] !== middleware || $[69] !== placementProp || $[70] !== t25 ? (t26 = {
2035
+ middleware,
2036
+ placement: placementProp,
2037
+ whileElementsMounted: _floating_ui_react_dom.autoUpdate,
2038
+ elements: t25
2039
+ }, $[68] = middleware, $[69] = placementProp, $[70] = t25, $[71] = t26) : t26 = $[71];
2040
+ let { x, y, middlewareData, placement, refs, strategy, update } = (0, _floating_ui_react_dom.useFloating)(t26), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, t27;
2041
+ $[72] === Symbol.for("react.memo_cache_sentinel") ? (t27 = (arrowEl) => {
2042
+ arrowRef.current = arrowEl;
2043
+ }, $[72] = t27) : t27 = $[72];
2044
+ let setArrow = t27, t28;
2045
+ $[73] === refs ? t28 = $[74] : (t28 = (node) => {
2046
+ ref.current = node, refs.setFloating(node);
2047
+ }, $[73] = refs, $[74] = t28);
2048
+ let setFloating = t28, t29;
2049
+ $[75] === childProp ? t29 = $[76] : (t29 = childProp ? getElementRef(childProp) : null, $[75] = childProp, $[76] = t29);
2050
+ let t30;
2051
+ $[77] === refs.reference.current ? t30 = $[78] : (t30 = () => refs.reference.current, $[77] = refs.reference.current, $[78] = t30), (0, react.useImperativeHandle)(t29, t30);
2052
+ let t31;
2053
+ bb0: {
2054
+ if (referenceElement) {
2055
+ t31 = childProp;
2056
+ break bb0;
2057
+ }
2058
+ if (!childProp) {
2059
+ t31 = null;
2060
+ break bb0;
2061
+ }
2062
+ let t32;
2063
+ $[79] !== childProp || $[80] !== refs.setReference ? (t32 = (0, react.cloneElement)(childProp, { ref: refs.setReference }), $[79] = childProp, $[80] = refs.setReference, $[81] = t32) : t32 = $[81], t31 = t32;
2064
+ }
2065
+ let child = t31, t32, t33;
2066
+ if ($[82] === update ? (t32 = $[83], t33 = $[84]) : (t32 = () => update, t33 = [update], $[82] = update, $[83] = t32, $[84] = t33), (0, react.useImperativeHandle)(updateRef, t32, t33), disabled) {
2067
+ let t34;
2068
+ return $[85] === childProp ? t34 = $[86] : (t34 = childProp || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {}), $[85] = childProp, $[86] = t34), t34;
2069
+ }
2070
+ let t34;
2071
+ $[87] === modal ? t34 = $[88] : (t34 = modal && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ViewportOverlay, {}), $[87] = modal, $[88] = t34);
2072
+ let t35 = matchReferenceWidth ? referenceWidth_0 : width, t36;
2073
+ $[89] !== animate || $[90] !== arrowProp || $[91] !== arrowX || $[92] !== arrowY || $[93] !== content || $[94] !== margins || $[95] !== originX || $[96] !== originY || $[97] !== overflow || $[98] !== padding || $[99] !== placement || $[100] !== radius || $[101] !== referenceHidden || $[102] !== restProps || $[103] !== scheme || $[104] !== setFloating || $[105] !== shadow || $[106] !== strategy || $[107] !== t35 || $[108] !== tone || $[109] !== x || $[110] !== y ? (t36 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverCard, {
2074
+ ...restProps,
2075
+ __unstable_margins: margins,
2076
+ animate,
2077
+ arrow: arrowProp,
2078
+ arrowRef: setArrow,
2079
+ arrowX,
2080
+ arrowY,
2081
+ hidden: referenceHidden,
2082
+ overflow,
2083
+ padding,
2084
+ placement,
2085
+ radius,
2086
+ ref: setFloating,
2087
+ scheme,
2088
+ shadow,
2089
+ originX,
2090
+ originY,
2091
+ strategy,
2092
+ tone,
2093
+ width: t35,
2094
+ x,
2095
+ y,
2096
+ children: content
2097
+ }), $[89] = animate, $[90] = arrowProp, $[91] = arrowX, $[92] = arrowY, $[93] = content, $[94] = margins, $[95] = originX, $[96] = originY, $[97] = overflow, $[98] = padding, $[99] = placement, $[100] = radius, $[101] = referenceHidden, $[102] = restProps, $[103] = scheme, $[104] = setFloating, $[105] = shadow, $[106] = strategy, $[107] = t35, $[108] = tone, $[109] = x, $[110] = y, $[111] = t36) : t36 = $[111];
2098
+ let t37;
2099
+ $[112] !== t34 || $[113] !== t36 || $[114] !== zOffset ? (t37 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LayerProvider, {
2100
+ zOffset,
2101
+ children: [t34, t36]
2102
+ }), $[112] = t34, $[113] = t36, $[114] = zOffset, $[115] = t37) : t37 = $[115];
2103
+ let popover = t37, t38;
2104
+ $[116] !== open || $[117] !== popover || $[118] !== portal ? (t38 = open && (portal ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Portal, {
2105
+ __unstable_name: typeof portal == "string" ? portal : void 0,
2106
+ children: popover
2107
+ }) : popover), $[116] = open, $[117] = popover, $[118] = portal, $[119] = t38) : t38 = $[119];
2108
+ let children = t38, t39;
2109
+ $[120] !== animate || $[121] !== children ? (t39 = animate ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, { children }) : children, $[120] = animate, $[121] = children, $[122] = t39) : t39 = $[122];
2110
+ let t40;
2111
+ return $[123] !== child || $[124] !== t39 ? (t40 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t39, child] }), $[123] = child, $[124] = t39, $[125] = t40) : t40 = $[125], t40;
2112
+ });
2113
+ Popover.displayName = "ForwardRef(Popover)";
2114
+ function useMiddleware$1(t0) {
2115
+ let $ = (0, react_compiler_runtime.c)(42), { animate, arrowProp, arrowRef, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, maxWidthRef, placementProp, placementStrategy, preventOverflow, referenceBoundary, referenceWidthRef, rootBoundary, setReferenceWidth, widthRef } = t0, ret;
2116
+ if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== constrainSize || $[4] !== fallbackPlacements || $[5] !== floatingBoundary || $[6] !== margins || $[7] !== matchReferenceWidth || $[8] !== maxWidthRef || $[9] !== placementProp || $[10] !== placementStrategy || $[11] !== preventOverflow || $[12] !== referenceBoundary || $[13] !== referenceWidthRef || $[14] !== rootBoundary || $[15] !== setReferenceWidth || $[16] !== widthRef) {
2117
+ if (ret = [], constrainSize || preventOverflow) if (placementStrategy === "autoPlacement") {
2118
+ let t1;
2119
+ $[18] !== fallbackPlacements || $[19] !== placementProp ? (t1 = (0, _floating_ui_react_dom.autoPlacement)({ allowedPlacements: [placementProp].concat(fallbackPlacements) }), $[18] = fallbackPlacements, $[19] = placementProp, $[20] = t1) : t1 = $[20], ret.push(t1);
2120
+ } else {
2121
+ let t1 = floatingBoundary || void 0, t2;
2122
+ $[21] !== fallbackPlacements || $[22] !== rootBoundary || $[23] !== t1 ? (t2 = (0, _floating_ui_react_dom.flip)({
2123
+ boundary: t1,
2124
+ fallbackPlacements,
2125
+ padding: 4,
2126
+ rootBoundary
2127
+ }), $[21] = fallbackPlacements, $[22] = rootBoundary, $[23] = t1, $[24] = t2) : t2 = $[24], ret.push(t2);
2128
+ }
2129
+ let t1;
2130
+ if ($[25] === Symbol.for("react.memo_cache_sentinel") ? (t1 = (0, _floating_ui_react_dom.offset)({ mainAxis: 4 }), $[25] = t1) : t1 = $[25], ret.push(t1), constrainSize || matchReferenceWidth) {
2131
+ let t2 = floatingBoundary || void 0, t3;
2132
+ $[26] !== constrainSize || $[27] !== margins || $[28] !== matchReferenceWidth || $[29] !== maxWidthRef || $[30] !== referenceWidthRef || $[31] !== setReferenceWidth || $[32] !== t2 || $[33] !== widthRef ? (t3 = size({
2133
+ boundaryElement: t2,
2134
+ constrainSize,
2135
+ margins,
2136
+ matchReferenceWidth,
2137
+ maxWidthRef,
2138
+ padding: 4,
2139
+ referenceWidthRef,
2140
+ setReferenceWidth,
2141
+ widthRef
2142
+ }), $[26] = constrainSize, $[27] = margins, $[28] = matchReferenceWidth, $[29] = maxWidthRef, $[30] = referenceWidthRef, $[31] = setReferenceWidth, $[32] = t2, $[33] = widthRef, $[34] = t3) : t3 = $[34], ret.push(t3);
2143
+ }
2144
+ if (preventOverflow) {
2145
+ let t2 = floatingBoundary || void 0, t3;
2146
+ $[35] !== rootBoundary || $[36] !== t2 ? (t3 = (0, _floating_ui_react_dom.shift)({
2147
+ boundary: t2,
2148
+ rootBoundary,
2149
+ padding: 4
2150
+ }), $[35] = rootBoundary, $[36] = t2, $[37] = t3) : t3 = $[37], ret.push(t3);
2151
+ }
2152
+ if (arrowProp) {
2153
+ let t2;
2154
+ $[38] === arrowRef ? t2 = $[39] : (t2 = (0, _floating_ui_react_dom.arrow)({
2155
+ element: arrowRef,
2156
+ padding: 4
2157
+ }), $[38] = arrowRef, $[39] = t2), ret.push(t2);
2158
+ }
2159
+ animate && ret.push(origin);
2160
+ let t2 = referenceBoundary || void 0, t3;
2161
+ $[40] === t2 ? t3 = $[41] : (t3 = (0, _floating_ui_react_dom.hide)({
2162
+ boundary: t2,
2163
+ padding: 4,
2164
+ strategy: "referenceHidden"
2165
+ }), $[40] = t2, $[41] = t3), ret.push(t3), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = constrainSize, $[4] = fallbackPlacements, $[5] = floatingBoundary, $[6] = margins, $[7] = matchReferenceWidth, $[8] = maxWidthRef, $[9] = placementProp, $[10] = placementStrategy, $[11] = preventOverflow, $[12] = referenceBoundary, $[13] = referenceWidthRef, $[14] = rootBoundary, $[15] = setReferenceWidth, $[16] = widthRef, $[17] = ret;
2166
+ } else ret = $[17];
2167
+ return ret;
2168
+ }
2169
+ const BASE_STYLE = {
2170
+ "&&:not([hidden])": { display: "grid" },
2171
+ "&[data-as=\"ul\"],&[data-as=\"ol\"]": { listStyle: "none" },
2172
+ gridTemplateColumns: "minmax(0, 1fr)",
2173
+ gridAutoRows: "min-content"
2174
+ };
2175
+ function stackBaseStyle() {
2176
+ return BASE_STYLE;
2177
+ }
2178
+ function responsiveStackSpaceStyle(props) {
2179
+ let { media, space } = require_theme.X(props.theme);
2180
+ return _responsive(media, props.$space, (spaceIndex) => ({ gridGap: rem(space[spaceIndex]) }));
2181
+ }
2182
+ const StyledStack = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
2183
+ displayName: "StyledStack",
2184
+ componentId: "sc-tusrcx-0"
2185
+ })(stackBaseStyle, responsiveStackSpaceStyle), StackComponent = (0, react.forwardRef)(function(props, ref) {
2186
+ let $ = (0, react_compiler_runtime.c)(13), as, deprecated_space, gap, restProps;
2187
+ $[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);
2188
+ let spacing = gap === void 0 ? deprecated_space : gap, t0 = typeof as == "string" ? as : void 0, t1;
2189
+ $[5] === spacing ? t1 = $[6] : (t1 = _getArrayProp(spacing), $[5] = spacing, $[6] = t1);
2190
+ let t2;
2191
+ return $[7] !== as || $[8] !== ref || $[9] !== restProps || $[10] !== t0 || $[11] !== t1 ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledStack, {
2192
+ "data-as": t0,
2193
+ "data-ui": "Stack",
2194
+ ...restProps,
2195
+ $space: t1,
2196
+ forwardedAs: as,
2197
+ ref
2198
+ }), $[7] = as, $[8] = ref, $[9] = restProps, $[10] = t0, $[11] = t1, $[12] = t2) : t2 = $[12], t2;
2199
+ });
2200
+ StackComponent.displayName = "ForwardRef(Stack)";
2201
+ /**
2202
+ * The `Stack` component is used to place elements on top of each other.
2203
+ *
2204
+ * @public
2205
+ */
2206
+ const Stack = StackComponent, CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, StyledTextInput = /* @__PURE__ */ (0, styled_components.styled)(Card).attrs({ forwardedAs: "span" }).withConfig({
2207
+ displayName: "StyledTextInput",
2208
+ componentId: "sc-p5vqj0-0"
2209
+ })(textInputRootStyle), InputRoot = styled_components.styled.span.withConfig({
2210
+ displayName: "InputRoot",
2211
+ componentId: "sc-p5vqj0-1"
2212
+ })`flex:1;min-width:0;display:block;position:relative;`, Prefix = (0, styled_components.styled)(Card).attrs({ forwardedAs: "span" }).withConfig({
2213
+ displayName: "Prefix",
2214
+ componentId: "sc-p5vqj0-2"
2215
+ })`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({
2216
+ displayName: "Suffix",
2217
+ componentId: "sc-p5vqj0-3"
2218
+ })`border-top-left-radius:0;border-bottom-left-radius:0;& > span{display:block;margin:-1px;}`, Input = /* @__PURE__ */ styled_components.styled.input.withConfig({
2219
+ displayName: "Input",
2220
+ componentId: "sc-p5vqj0-4"
2221
+ })(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation = /* @__PURE__ */ styled_components.styled.span.withConfig({
2222
+ displayName: "Presentation",
2223
+ componentId: "sc-p5vqj0-5"
2224
+ })(responsiveRadiusStyle, textInputRepresentationStyle), LeftBox = (0, styled_components.styled)(Box).withConfig({
2225
+ displayName: "LeftBox",
2226
+ componentId: "sc-p5vqj0-6"
2227
+ })`position:absolute;top:0;left:0;`, RightBox = (0, styled_components.styled)(Box).withConfig({
2228
+ displayName: "RightBox",
2229
+ componentId: "sc-p5vqj0-7"
2230
+ })`position:absolute;top:0;right:0;`, RightCard = (0, styled_components.styled)(Card).withConfig({
2231
+ displayName: "RightCard",
2232
+ componentId: "sc-p5vqj0-8"
2233
+ })`background-color:transparent;position:absolute;top:0;right:0;`, TextInputClearButton = /* @__PURE__ */ (0, styled_components.styled)(Button).withConfig({
2234
+ displayName: "TextInputClearButton",
2235
+ componentId: "sc-p5vqj0-9"
2236
+ })({ "&:not([hidden])": { display: "block" } }), TextInput = (0, react.forwardRef)(function(props, forwardedRef) {
2237
+ 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;
2238
+ $[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);
2239
+ let border = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, deprecated_space = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = (0, react.useRef)(null), rootTheme = useRootTheme(), t7;
2240
+ $[20] === fontSizeProp ? t7 = $[21] : (t7 = _getArrayProp(fontSizeProp), $[20] = fontSizeProp, $[21] = t7);
2241
+ let fontSize = t7, t8;
2242
+ $[22] === paddingProp ? t8 = $[23] : (t8 = _getArrayProp(paddingProp), $[22] = paddingProp, $[23] = t8);
2243
+ let padding = t8, t9;
2244
+ $[24] === radiusProp ? t9 = $[25] : (t9 = _getArrayProp(radiusProp), $[24] = radiusProp, $[25] = t9);
2245
+ let radius = t9, t10 = gap === void 0 ? deprecated_space : gap, t11;
2246
+ $[26] === t10 ? t11 = $[27] : (t11 = _getArrayProp(t10), $[26] = t10, $[27] = t11);
2247
+ let space = t11, $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix, t12;
2248
+ $[28] === Symbol.for("react.memo_cache_sentinel") ? (t12 = () => ref.current, $[28] = t12) : t12 = $[28], (0, react.useImperativeHandle)(forwardedRef, t12), useCustomValidity(ref, customValidity);
2249
+ let handleClearMouseDown = _temp$1, t13;
2250
+ $[29] === onClear ? t13 = $[30] : (t13 = (event_0) => {
2251
+ event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
2252
+ }, $[29] = onClear, $[30] = t13);
2253
+ let handleClearClick = t13, t14;
2254
+ $[31] !== prefix || $[32] !== radius ? (t14 = prefix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Prefix, {
2255
+ borderTop: !0,
2256
+ borderLeft: !0,
2257
+ borderBottom: !0,
2258
+ radius,
2259
+ sizing: "border",
2260
+ tone: "inherit",
2261
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: prefix })
2262
+ }), $[31] = prefix, $[32] = radius, $[33] = t14) : t14 = $[33];
2263
+ let prefixNode = t14, t15 = border ? "" : void 0, t16;
2264
+ $[34] !== IconComponent || $[35] !== fontSize || $[36] !== padding ? (t16 = IconComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LeftBox, {
2265
+ padding,
2266
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Text, {
2267
+ size: fontSize,
2268
+ children: [(0, react.isValidElement)(IconComponent) && IconComponent, (0, react_is.isValidElementType)(IconComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconComponent, {})]
2269
+ })
2270
+ }), $[34] = IconComponent, $[35] = fontSize, $[36] = padding, $[37] = t16) : t16 = $[37];
2271
+ let t17;
2272
+ $[38] !== $hasClearButton || $[39] !== IconRightComponent || $[40] !== fontSize || $[41] !== padding ? (t17 = !$hasClearButton && IconRightComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RightBox, {
2273
+ padding,
2274
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Text, {
2275
+ size: fontSize,
2276
+ children: [(0, react.isValidElement)(IconRightComponent) && IconRightComponent, (0, react_is.isValidElementType)(IconRightComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRightComponent, {})]
2277
+ })
2278
+ }), $[38] = $hasClearButton, $[39] = IconRightComponent, $[40] = fontSize, $[41] = padding, $[42] = t17) : t17 = $[42];
2279
+ let t18;
2280
+ $[43] !== $hasPrefix || $[44] !== $hasSuffix || $[45] !== __unstable_disableFocusRing || $[46] !== radius || $[47] !== rootTheme.scheme || $[48] !== rootTheme.tone || $[49] !== t15 || $[50] !== t16 || $[51] !== t17 ? (t18 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Presentation, {
2281
+ $hasPrefix,
2282
+ $unstableDisableFocusRing: __unstable_disableFocusRing,
2283
+ $hasSuffix,
2284
+ $radius: radius,
2285
+ $scheme: rootTheme.scheme,
2286
+ $tone: rootTheme.tone,
2287
+ "data-border": t15,
2288
+ "data-scheme": rootTheme.scheme,
2289
+ "data-tone": rootTheme.tone,
2290
+ children: [t16, t17]
2291
+ }), $[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];
2292
+ let presentationNode = t18, t19;
2293
+ $[53] === padding ? t19 = $[54] : (t19 = padding.map(_temp2), $[53] = padding, $[54] = t19);
2294
+ let clearButtonBoxPadding = t19, t20;
2295
+ $[55] === padding ? t20 = $[56] : (t20 = padding.map(_temp3), $[55] = padding, $[56] = t20);
2296
+ let clearButtonPadding = t20, clearButtonProps = typeof clearButton == "object" ? clearButton : EMPTY_RECORD, t21;
2297
+ $[57] !== clearButton || $[58] !== clearButtonBoxPadding || $[59] !== clearButtonPadding || $[60] !== clearButtonProps || $[61] !== customValidity || $[62] !== disabled || $[63] !== fontSize || $[64] !== handleClearClick || $[65] !== radius || $[66] !== readOnly ? (t21 = !disabled && !readOnly && clearButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RightCard, {
2298
+ forwardedAs: "span",
2299
+ padding: clearButtonBoxPadding,
2300
+ style: CLEAR_BUTTON_BOX_STYLE,
2301
+ tone: customValidity ? "critical" : "inherit",
2302
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextInputClearButton, {
2303
+ "aria-label": "Clear",
2304
+ "data-qa": "clear-button",
2305
+ fontSize,
2306
+ icon: _sanity_icons.CloseIcon,
2307
+ mode: "bleed",
2308
+ padding: clearButtonPadding,
2309
+ radius,
2310
+ ...clearButtonProps,
2311
+ onClick: handleClearClick,
2312
+ onMouseDown: handleClearMouseDown
2313
+ })
2314
+ }), $[57] = clearButton, $[58] = clearButtonBoxPadding, $[59] = clearButtonPadding, $[60] = clearButtonProps, $[61] = customValidity, $[62] = disabled, $[63] = fontSize, $[64] = handleClearClick, $[65] = radius, $[66] = readOnly, $[67] = t21) : t21 = $[67];
2315
+ let clearButtonNode = t21, t22;
2316
+ $[68] !== radius || $[69] !== suffix ? (t22 = suffix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Suffix, {
2317
+ borderTop: !0,
2318
+ borderRight: !0,
2319
+ borderBottom: !0,
2320
+ radius,
2321
+ sizing: "border",
2322
+ tone: "inherit",
2323
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: suffix })
2324
+ }), $[68] = radius, $[69] = suffix, $[70] = t22) : t22 = $[70];
2325
+ let suffixNode = t22, t23 = $hasIconRight || $hasClearButton, t24;
2326
+ $[71] !== $hasIcon || $[72] !== disabled || $[73] !== fontSize || $[74] !== padding || $[75] !== readOnly || $[76] !== restProps || $[77] !== rootTheme.scheme || $[78] !== rootTheme.tone || $[79] !== space || $[80] !== t23 || $[81] !== type || $[82] !== weight ? (t24 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
2327
+ "data-as": "input",
2328
+ "data-scheme": rootTheme.scheme,
2329
+ "data-tone": rootTheme.tone,
2330
+ ...restProps,
2331
+ $fontSize: fontSize,
2332
+ $iconLeft: $hasIcon,
2333
+ $iconRight: t23,
2334
+ $padding: padding,
2335
+ $scheme: rootTheme.scheme,
2336
+ $space: space,
2337
+ $tone: rootTheme.tone,
2338
+ $weight: weight,
2339
+ disabled,
2340
+ readOnly,
2341
+ ref,
2342
+ type
2343
+ }), $[71] = $hasIcon, $[72] = disabled, $[73] = fontSize, $[74] = padding, $[75] = readOnly, $[76] = restProps, $[77] = rootTheme.scheme, $[78] = rootTheme.tone, $[79] = space, $[80] = t23, $[81] = type, $[82] = weight, $[83] = t24) : t24 = $[83];
2344
+ let t25;
2345
+ $[84] !== clearButtonNode || $[85] !== presentationNode || $[86] !== t24 ? (t25 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(InputRoot, { children: [
2346
+ t24,
2347
+ presentationNode,
2348
+ clearButtonNode
2349
+ ] }), $[84] = clearButtonNode, $[85] = presentationNode, $[86] = t24, $[87] = t25) : t25 = $[87];
2350
+ let t26;
2351
+ return $[88] !== prefixNode || $[89] !== rootTheme.tone || $[90] !== suffixNode || $[91] !== t25 ? (t26 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledTextInput, {
2352
+ "data-ui": "TextInput",
2353
+ tone: rootTheme.tone,
2354
+ children: [
2355
+ prefixNode,
2356
+ t25,
2357
+ suffixNode
2358
+ ]
2359
+ }), $[88] = prefixNode, $[89] = rootTheme.tone, $[90] = suffixNode, $[91] = t25, $[92] = t26) : t26 = $[92], t26;
2360
+ });
2361
+ TextInput.displayName = "ForwardRef(TextInput)";
2362
+ function _temp$1(event) {
2363
+ event.preventDefault(), event.stopPropagation();
2364
+ }
2365
+ function _temp2(v) {
2366
+ return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
2367
+ }
2368
+ function _temp3(v_0) {
2369
+ return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
2370
+ }
2371
+ /**
2372
+ * @beta
2373
+ */
2374
+ function useDelayedState(initialState) {
2375
+ let [state, setState] = (0, react.useState)(initialState), delayedAction = (0, react.useRef)(void 0), onStateChange = (0, react.useCallback)((nextState, delay) => {
2376
+ let action = () => {
2377
+ setState(nextState);
2378
+ };
2379
+ if (delayedAction.current &&= (clearTimeout(delayedAction.current), void 0), !delay) return action();
2380
+ delayedAction.current = setTimeout(action, delay);
2381
+ }, []);
2382
+ return (0, react.useEffect)(() => () => {
2383
+ delayedAction.current && clearTimeout(delayedAction.current);
2384
+ }, []), [state, onStateChange];
2385
+ }
2386
+ const DEFAULT_FALLBACK_PLACEMENTS = {
2387
+ top: [
2388
+ "top-end",
2389
+ "top-start",
2390
+ "bottom",
2391
+ "left",
2392
+ "right"
2393
+ ],
2394
+ "top-start": [
2395
+ "top",
2396
+ "top-end",
2397
+ "bottom-start",
2398
+ "left-start",
2399
+ "right-start"
2400
+ ],
2401
+ "top-end": [
2402
+ "top",
2403
+ "top-start",
2404
+ "bottom-end",
2405
+ "left-end",
2406
+ "right-end"
2407
+ ],
2408
+ bottom: [
2409
+ "bottom-end",
2410
+ "bottom-start",
2411
+ "top",
2412
+ "left",
2413
+ "right"
2414
+ ],
2415
+ "bottom-start": [
2416
+ "bottom",
2417
+ "bottom-end",
2418
+ "top-start",
2419
+ "left-start",
2420
+ "right-start"
2421
+ ],
2422
+ "bottom-end": [
2423
+ "bottom",
2424
+ "bottom-start",
2425
+ "top-end",
2426
+ "left-end",
2427
+ "right-end"
2428
+ ],
2429
+ left: [
2430
+ "left-end",
2431
+ "left-start",
2432
+ "right",
2433
+ "top",
2434
+ "bottom"
2435
+ ],
2436
+ "left-start": [
2437
+ "left",
2438
+ "left-end",
2439
+ "right-start",
2440
+ "top-start",
2441
+ "bottom-start"
2442
+ ],
2443
+ "left-end": [
2444
+ "left",
2445
+ "left-start",
2446
+ "right-end",
2447
+ "top-end",
2448
+ "bottom-end"
2449
+ ],
2450
+ right: [
2451
+ "right-end",
2452
+ "right-start",
2453
+ "left",
2454
+ "top",
2455
+ "bottom"
2456
+ ],
2457
+ "right-start": [
2458
+ "right",
2459
+ "right-end",
2460
+ "left-start",
2461
+ "top-start",
2462
+ "bottom-start"
2463
+ ],
2464
+ "right-end": [
2465
+ "right",
2466
+ "right-start",
2467
+ "left-end",
2468
+ "top-end",
2469
+ "bottom-end"
2470
+ ]
2471
+ }, MotionCard = (0, styled_components.styled)(motion_react.motion.create(Card)).withConfig({
2472
+ displayName: "MotionCard",
2473
+ componentId: "sc-ae1zod-0"
2474
+ })`will-change:transform;`, TooltipCard = (0, react.forwardRef)(function(props, ref) {
2475
+ let $ = (0, react_compiler_runtime.c)(48), animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style;
2476
+ $[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);
2477
+ let t0 = animate ? "transform" : void 0, t1;
2478
+ $[16] !== originX || $[17] !== originY || $[18] !== style || $[19] !== t0 ? (t1 = {
2479
+ originX,
2480
+ originY,
2481
+ willChange: t0,
2482
+ ...style
2483
+ }, $[16] = originX, $[17] = originY, $[18] = style, $[19] = t0, $[20] = t1) : t1 = $[20];
2484
+ let rootStyle = t1, t2 = arrowX === null ? void 0 : arrowX, t3 = arrowY === null ? void 0 : arrowY, t4;
2485
+ $[21] !== t2 || $[22] !== t3 ? (t4 = {
2486
+ left: t2,
2487
+ top: t3,
2488
+ right: void 0,
2489
+ bottom: void 0
2490
+ }, $[21] = t2, $[22] = t3, $[23] = t4) : t4 = $[23];
2491
+ let arrowStyle = t4, t5 = restProps, t6;
2492
+ $[24] === animate ? t6 = $[25] : (t6 = animate ? ["hidden", "initial"] : void 0, $[24] = animate, $[25] = t6);
2493
+ let t7;
2494
+ $[26] === animate ? t7 = $[27] : (t7 = animate ? ["visible", "scaleIn"] : void 0, $[26] = animate, $[27] = t7);
2495
+ let t8;
2496
+ $[28] === animate ? t8 = $[29] : (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[28] = animate, $[29] = t8);
2497
+ let t9;
2498
+ $[30] !== arrow || $[31] !== arrowRef || $[32] !== arrowStyle ? (t9 = arrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Arrow, {
2499
+ ref: arrowRef,
2500
+ style: arrowStyle,
2501
+ width: 15,
2502
+ height: 6,
2503
+ radius: 2
2504
+ }), $[30] = arrow, $[31] = arrowRef, $[32] = arrowStyle, $[33] = t9) : t9 = $[33];
2505
+ let t10;
2506
+ 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, {
2507
+ "data-ui": "Tooltip__card",
2508
+ ...t5,
2509
+ "data-placement": placement,
2510
+ padding,
2511
+ radius,
2512
+ ref,
2513
+ scheme,
2514
+ shadow,
2515
+ style: rootStyle,
2516
+ variants: POPOVER_MOTION_PROPS.card,
2517
+ transition: POPOVER_MOTION_PROPS.transition,
2518
+ initial: t6,
2519
+ animate: t7,
2520
+ exit: t8,
2521
+ children: [children, t9]
2522
+ }), $[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;
2523
+ });
2524
+ TooltipCard.displayName = "ForwardRef(TooltipCard)";
2525
+ /**
2526
+ * @beta
2527
+ */
2528
+ const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
2529
+ /**
2530
+ * @beta
2531
+ */
2532
+ function useTooltipDelayGroup() {
2533
+ return (0, react.useContext)(TooltipDelayGroupContext);
2534
+ }
2535
+ const StyledTooltip = (0, styled_components.styled)(Layer).withConfig({
2536
+ displayName: "StyledTooltip",
2537
+ componentId: "sc-hx8o7p-0"
2538
+ })`pointer-events:none;`, Tooltip = (0, react.forwardRef)(function(props, forwardedRef) {
2539
+ 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;
2540
+ $[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);
2541
+ let _animate = t0 === void 0 ? !1 : t0, arrowProp = t1 === void 0 ? !1 : t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, t6;
2542
+ $[17] === fallbackPlacementsProp ? t6 = $[18] : (t6 = _getArrayProp(fallbackPlacementsProp), $[17] = fallbackPlacementsProp, $[18] = t6);
2543
+ 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;
2544
+ $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], (0, react.useImperativeHandle)(forwardedRef, t7);
2545
+ let portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, t8;
2546
+ $[20] !== animate || $[21] !== arrowProp || $[22] !== boundaryElement || $[23] !== fallbackPlacements ? (t8 = {
2547
+ animate,
2548
+ arrowProp,
2549
+ arrowRef,
2550
+ boundaryElement,
2551
+ fallbackPlacements,
2552
+ rootBoundary: "viewport"
2553
+ }, $[20] = animate, $[21] = arrowProp, $[22] = boundaryElement, $[23] = fallbackPlacements, $[24] = t8) : t8 = $[24];
2554
+ let middleware = useMiddleware(t8), t9;
2555
+ $[25] === referenceElement ? t9 = $[26] : (t9 = { reference: referenceElement }, $[25] = referenceElement, $[26] = t9);
2556
+ let t10;
2557
+ $[27] !== middleware || $[28] !== placementProp || $[29] !== t9 ? (t10 = {
2558
+ middleware,
2559
+ placement: placementProp,
2560
+ whileElementsMounted: _floating_ui_react_dom.autoUpdate,
2561
+ elements: t9
2562
+ }, $[27] = middleware, $[28] = placementProp, $[29] = t9, $[30] = t10) : t10 = $[30];
2563
+ 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;
2564
+ $[31] === delayGroupContext ? t11 = $[32] : (t11 = delayGroupContext || {}, $[31] = delayGroupContext, $[32] = t11);
2565
+ 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;
2566
+ $[33] !== closeDelay || $[34] !== isInsideGroup || $[35] !== openDelay || $[36] !== setIsGroupActive || $[37] !== setIsOpen || $[38] !== setOpenTooltipId || $[39] !== tooltipId ? (t12 = (open, immediate) => {
2567
+ if (isInsideGroup) if (open) {
2568
+ let groupedOpenDelay = immediate ? 0 : openDelay;
2569
+ setIsGroupActive?.(open, groupedOpenDelay), setOpenTooltipId?.(tooltipId, groupedOpenDelay);
2570
+ } else setIsGroupActive?.(open, closeDelay > 200 ? closeDelay : 200), setOpenTooltipId?.(null, immediate ? 0 : closeDelay);
2571
+ else setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
2572
+ }, $[33] = closeDelay, $[34] = isInsideGroup, $[35] = openDelay, $[36] = setIsGroupActive, $[37] = setIsOpen, $[38] = setOpenTooltipId, $[39] = tooltipId, $[40] = t12) : t12 = $[40];
2573
+ let handleIsOpenChange = t12, t13;
2574
+ $[41] !== childProp?.props || $[42] !== handleIsOpenChange ? (t13 = (e) => {
2575
+ handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
2576
+ }, $[41] = childProp?.props, $[42] = handleIsOpenChange, $[43] = t13) : t13 = $[43], childProp?.props;
2577
+ let handleBlur = t13, t14;
2578
+ $[44] !== childProp?.props || $[45] !== handleIsOpenChange ? (t14 = (e_0) => {
2579
+ handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
2580
+ }, $[44] = childProp?.props, $[45] = handleIsOpenChange, $[46] = t14) : t14 = $[46], childProp?.props;
2581
+ let handleClick = t14, t15;
2582
+ $[47] !== childProp?.props || $[48] !== handleIsOpenChange ? (t15 = (e_1) => {
2583
+ handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
2584
+ }, $[47] = childProp?.props, $[48] = handleIsOpenChange, $[49] = t15) : t15 = $[49], childProp?.props;
2585
+ let handleContextMenu = t15, t16;
2586
+ $[50] !== childProp?.props || $[51] !== handleIsOpenChange ? (t16 = (e_2) => {
2587
+ handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
2588
+ }, $[50] = childProp?.props, $[51] = handleIsOpenChange, $[52] = t16) : t16 = $[52], childProp?.props;
2589
+ let handleFocus = t16, t17;
2590
+ $[53] !== childProp?.props || $[54] !== handleIsOpenChange ? (t17 = (e_3) => {
2591
+ handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
2592
+ }, $[53] = childProp?.props, $[54] = handleIsOpenChange, $[55] = t17) : t17 = $[55], childProp?.props;
2593
+ let handleMouseEnter = t17, t18;
2594
+ $[56] !== childProp?.props || $[57] !== handleIsOpenChange ? (t18 = (e_4) => {
2595
+ handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
2596
+ }, $[56] = childProp?.props, $[57] = handleIsOpenChange, $[58] = t18) : t18 = $[58], childProp?.props;
2597
+ let handleMouseLeave = t18, t19;
2598
+ $[59] !== handleIsOpenChange || $[60] !== isInsideGroup || $[61] !== referenceElement || $[62] !== showTooltip ? (t19 = {
2599
+ handleIsOpenChange,
2600
+ referenceElement,
2601
+ showTooltip,
2602
+ isInsideGroup
2603
+ }, $[59] = handleIsOpenChange, $[60] = isInsideGroup, $[61] = referenceElement, $[62] = showTooltip, $[63] = t19) : t19 = $[63], useCloseOnMouseLeave(t19);
2604
+ let t20, t21;
2605
+ $[64] !== disabled || $[65] !== handleIsOpenChange || $[66] !== showTooltip ? (t20 = () => {
2606
+ disabled && showTooltip && handleIsOpenChange(!1);
2607
+ }, t21 = [
2608
+ disabled,
2609
+ handleIsOpenChange,
2610
+ showTooltip
2611
+ ], $[64] = disabled, $[65] = handleIsOpenChange, $[66] = showTooltip, $[67] = t20, $[68] = t21) : (t20 = $[67], t21 = $[68]), (0, react.useEffect)(t20, t21);
2612
+ let t22, t23;
2613
+ $[69] !== content || $[70] !== handleIsOpenChange || $[71] !== showTooltip ? (t22 = () => {
2614
+ !content && showTooltip && handleIsOpenChange(!1);
2615
+ }, t23 = [
2616
+ content,
2617
+ handleIsOpenChange,
2618
+ showTooltip
2619
+ ], $[69] = content, $[70] = handleIsOpenChange, $[71] = showTooltip, $[72] = t22, $[73] = t23) : (t22 = $[72], t23 = $[73]), (0, react.useEffect)(t22, t23);
2620
+ let t24, t25;
2621
+ $[74] !== handleIsOpenChange || $[75] !== showTooltip ? (t24 = () => {
2622
+ if (!showTooltip) return;
2623
+ let handleWindowKeyDown = function(event) {
2624
+ event.key === "Escape" && handleIsOpenChange(!1, !0);
2625
+ };
2626
+ return window.addEventListener("keydown", handleWindowKeyDown), () => {
2627
+ window.removeEventListener("keydown", handleWindowKeyDown);
2628
+ };
2629
+ }, t25 = [handleIsOpenChange, showTooltip], $[74] = handleIsOpenChange, $[75] = showTooltip, $[76] = t24, $[77] = t25) : (t24 = $[76], t25 = $[77]), (0, react.useEffect)(t24, t25);
2630
+ let t26;
2631
+ $[78] !== boundaryElement || $[79] !== portalElement?.offsetWidth ? (t26 = () => {
2632
+ let availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
2633
+ setTooltipMaxWidth(Math.min(...availableWidths) - 8);
2634
+ }, $[78] = boundaryElement, $[79] = portalElement?.offsetWidth, $[80] = t26) : t26 = $[80];
2635
+ let t27;
2636
+ $[81] !== boundaryElement || $[82] !== portalElement ? (t27 = [boundaryElement, portalElement], $[81] = boundaryElement, $[82] = portalElement, $[83] = t27) : t27 = $[83], (0, react.useLayoutEffect)(t26, t27);
2637
+ let t28;
2638
+ $[84] === update ? t28 = $[85] : (t28 = (arrowEl) => {
2639
+ arrowRef.current = arrowEl, update();
2640
+ }, $[84] = update, $[85] = t28);
2641
+ let setArrow = t28, t29;
2642
+ $[86] === refs ? t29 = $[87] : (t29 = (node) => {
2643
+ ref.current = node, refs.setFloating(node);
2644
+ }, $[86] = refs, $[87] = t29);
2645
+ let setFloating = t29, t30;
2646
+ bb0: {
2647
+ if (!childProp) {
2648
+ t30 = null;
2649
+ break bb0;
2650
+ }
2651
+ let t31;
2652
+ $[88] !== childProp || $[89] !== handleBlur || $[90] !== handleClick || $[91] !== handleContextMenu || $[92] !== handleFocus || $[93] !== handleMouseEnter || $[94] !== handleMouseLeave ? (t31 = (0, react.cloneElement)(childProp, {
2653
+ onBlur: handleBlur,
2654
+ onFocus: handleFocus,
2655
+ onMouseEnter: handleMouseEnter,
2656
+ onMouseLeave: handleMouseLeave,
2657
+ onClick: handleClick,
2658
+ onContextMenu: handleContextMenu,
2659
+ ref: setReferenceElement
2660
+ }), $[88] = childProp, $[89] = handleBlur, $[90] = handleClick, $[91] = handleContextMenu, $[92] = handleFocus, $[93] = handleMouseEnter, $[94] = handleMouseLeave, $[95] = t31) : t31 = $[95], t30 = t31;
2661
+ }
2662
+ let child = t30, t31;
2663
+ $[96] === childProp ? t31 = $[97] : (t31 = childProp ? getElementRef(childProp) : null, $[96] = childProp, $[97] = t31);
2664
+ let t32, t33;
2665
+ if ($[98] === referenceElement ? (t32 = $[99], t33 = $[100]) : (t32 = () => referenceElement, t33 = [referenceElement], $[98] = referenceElement, $[99] = t32, $[100] = t33), (0, react.useImperativeHandle)(t31, t32, t33), !child) {
2666
+ let t34;
2667
+ return $[101] === Symbol.for("react.memo_cache_sentinel") ? (t34 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {}), $[101] = t34) : t34 = $[101], t34;
2668
+ }
2669
+ if (disabled) return child;
2670
+ let t34 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0, t35;
2671
+ $[102] !== floatingStyles || $[103] !== t34 ? (t35 = {
2672
+ ...floatingStyles,
2673
+ maxWidth: t34
2674
+ }, $[102] = floatingStyles, $[103] = t34, $[104] = t35) : t35 = $[104];
2675
+ let t36;
2676
+ $[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, {
2677
+ ...restProps,
2678
+ animate,
2679
+ arrow: arrowProp,
2680
+ arrowRef: setArrow,
2681
+ arrowX,
2682
+ arrowY,
2683
+ originX,
2684
+ originY,
2685
+ padding,
2686
+ placement,
2687
+ radius,
2688
+ ref: setFloating,
2689
+ scheme,
2690
+ shadow,
2691
+ children: content
2692
+ }), $[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];
2693
+ let t37;
2694
+ $[121] !== restProps || $[122] !== setFloating || $[123] !== t35 || $[124] !== t36 || $[125] !== zOffset ? (t37 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTooltip, {
2695
+ "data-ui": "Tooltip",
2696
+ ...restProps,
2697
+ ref: setFloating,
2698
+ style: t35,
2699
+ zOffset,
2700
+ children: t36
2701
+ }), $[121] = restProps, $[122] = setFloating, $[123] = t35, $[124] = t36, $[125] = zOffset, $[126] = t37) : t37 = $[126];
2702
+ let tooltip = t37, t38;
2703
+ $[127] !== portalProp || $[128] !== showTooltip || $[129] !== tooltip ? (t38 = showTooltip && (portalProp ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Portal, {
2704
+ __unstable_name: typeof portalProp == "string" ? portalProp : void 0,
2705
+ children: tooltip
2706
+ }) : tooltip), $[127] = portalProp, $[128] = showTooltip, $[129] = tooltip, $[130] = t38) : t38 = $[130];
2707
+ let children = t38, t39;
2708
+ $[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];
2709
+ let t40;
2710
+ 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;
2711
+ });
2712
+ Tooltip.displayName = "ForwardRef(Tooltip)";
2713
+ function useMiddleware(t0) {
2714
+ let $ = (0, react_compiler_runtime.c)(17), { animate, arrowProp, arrowRef, boundaryElement, fallbackPlacements, rootBoundary } = t0, ret;
2715
+ if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== boundaryElement || $[4] !== fallbackPlacements || $[5] !== rootBoundary) {
2716
+ ret = [];
2717
+ let t1 = boundaryElement || void 0, t2;
2718
+ $[7] !== fallbackPlacements || $[8] !== rootBoundary || $[9] !== t1 ? (t2 = (0, _floating_ui_react_dom.flip)({
2719
+ boundary: t1,
2720
+ fallbackPlacements,
2721
+ padding: 4,
2722
+ rootBoundary
2723
+ }), $[7] = fallbackPlacements, $[8] = rootBoundary, $[9] = t1, $[10] = t2) : t2 = $[10], ret.push(t2);
2724
+ let t3;
2725
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t3 = (0, _floating_ui_react_dom.offset)({ mainAxis: 4 }), $[11] = t3) : t3 = $[11], ret.push(t3);
2726
+ let t4 = boundaryElement || void 0, t5;
2727
+ if ($[12] !== rootBoundary || $[13] !== t4 ? (t5 = (0, _floating_ui_react_dom.shift)({
2728
+ boundary: t4,
2729
+ rootBoundary,
2730
+ padding: 4
2731
+ }), $[12] = rootBoundary, $[13] = t4, $[14] = t5) : t5 = $[14], ret.push(t5), arrowProp) {
2732
+ let t6;
2733
+ $[15] === arrowRef ? t6 = $[16] : (t6 = (0, _floating_ui_react_dom.arrow)({
2734
+ element: arrowRef,
2735
+ padding: 4
2736
+ }), $[15] = arrowRef, $[16] = t6), ret.push(t6);
2737
+ }
2738
+ animate && ret.push(origin), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = boundaryElement, $[4] = fallbackPlacements, $[5] = rootBoundary, $[6] = ret;
2739
+ } else ret = $[6];
2740
+ return ret;
2741
+ }
2742
+ /**
2743
+ * As `useEffectEvent` should never be passed to other components or hooks, this custom hook groups together the `useEffectEvent` and the `useEffect` hook using it.
2744
+ * @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
2745
+ */
2746
+ function useCloseOnMouseLeave(t0) {
2747
+ let $ = (0, react_compiler_runtime.c)(10), { handleIsOpenChange, referenceElement, showTooltip, isInsideGroup } = t0, t1;
2748
+ $[0] !== handleIsOpenChange || $[1] !== referenceElement ? (t1 = (target, teardown) => {
2749
+ referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
2750
+ }, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
2751
+ let onMouseMove = (0, use_effect_event.useEffectEvent)(t1), t2;
2752
+ $[3] !== isInsideGroup || $[4] !== onMouseMove || $[5] !== showTooltip ? (t2 = () => {
2753
+ if (!showTooltip || isInsideGroup) return;
2754
+ let handleMouseMove = (event) => {
2755
+ onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
2756
+ };
2757
+ return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
2758
+ }, $[3] = isInsideGroup, $[4] = onMouseMove, $[5] = showTooltip, $[6] = t2) : t2 = $[6];
2759
+ let t3;
2760
+ $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], (0, react.useEffect)(t2, t3);
2761
+ }
2762
+ const StyledHotkeys = styled_components.styled.kbd.withConfig({
2763
+ displayName: "StyledHotkeys",
2764
+ componentId: "sc-j9kh17-0"
2765
+ })`font:inherit;padding:1px;&:not([hidden]){display:block;}`, Key = (0, styled_components.styled)(KBD).withConfig({
2766
+ displayName: "Key",
2767
+ componentId: "sc-j9kh17-1"
2768
+ })`&:not([hidden]){display:block;}`, Hotkeys = (0, react.forwardRef)(function(props, ref) {
2769
+ let $ = (0, react_compiler_runtime.c)(27), fontSize, gap, keys, padding, radius, restProps, t0;
2770
+ $[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);
2771
+ let t1 = gap === void 0 ? t0 === void 0 ? .5 : t0 : gap, t2;
2772
+ $[8] === t1 ? t2 = $[9] : (t2 = _getArrayProp(t1), $[8] = t1, $[9] = t2);
2773
+ let spacing = t2;
2774
+ if (!keys || keys.length === 0) {
2775
+ let t3;
2776
+ return $[10] === Symbol.for("react.memo_cache_sentinel") ? (t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {}), $[10] = t3) : t3 = $[10], t3;
2777
+ }
2778
+ let t3;
2779
+ if ($[11] !== fontSize || $[12] !== keys || $[13] !== padding || $[14] !== radius) {
2780
+ let t4;
2781
+ $[16] !== fontSize || $[17] !== padding || $[18] !== radius ? (t4 = (key, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Key, {
2782
+ fontSize,
2783
+ padding,
2784
+ radius,
2785
+ children: key
2786
+ }, i), $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t4) : t4 = $[19], t3 = keys.map(t4), $[11] = fontSize, $[12] = keys, $[13] = padding, $[14] = radius, $[15] = t3;
2787
+ } else t3 = $[15];
2788
+ let t4;
2789
+ $[20] !== spacing || $[21] !== t3 ? (t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Inline, {
2790
+ as: "span",
2791
+ gap: spacing,
2792
+ children: t3
2793
+ }), $[20] = spacing, $[21] = t3, $[22] = t4) : t4 = $[22];
2794
+ let t5;
2795
+ return $[23] !== ref || $[24] !== restProps || $[25] !== t4 ? (t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledHotkeys, {
2796
+ "data-ui": "Hotkeys",
2797
+ ...restProps,
2798
+ ref,
2799
+ children: t4
2800
+ }), $[23] = ref, $[24] = restProps, $[25] = t4, $[26] = t5) : t5 = $[26], t5;
2801
+ });
2802
+ Hotkeys.displayName = "ForwardRef(Hotkeys)";
2803
+ const MenuContext = createGlobalScopedContext("@sanity/ui/context/menu", null);
2804
+ /**
2805
+ * @internal
2806
+ */
2807
+ function _isFocusable(element) {
2808
+ return isHTMLAnchorElement(element) && element.getAttribute("data-disabled") !== "true" || isHTMLButtonElement(element) && !element.disabled;
2809
+ }
2810
+ /**
2811
+ * @internal
2812
+ */
2813
+ function _getFocusableElements(elements) {
2814
+ return elements.filter(_isFocusable);
2815
+ }
2816
+ /**
2817
+ * @internal
2818
+ */
2819
+ function _getDOMPath(rootElement, el) {
2820
+ let path = [], e = el;
2821
+ for (; e !== rootElement;) {
2822
+ let parentElement = e.parentElement;
2823
+ if (!parentElement) return path;
2824
+ let index = Array.from(parentElement.childNodes).indexOf(e);
2825
+ if (path.unshift(index), parentElement === rootElement) return path;
2826
+ e = parentElement;
2827
+ }
2828
+ return path;
2829
+ }
2830
+ const EMPTY_PATH = [];
2831
+ /**
2832
+ * @internal
2833
+ */
2834
+ function _sortElements(rootElement, elements) {
2835
+ if (!rootElement) return;
2836
+ let map = /* @__PURE__ */ new WeakMap();
2837
+ for (let el of elements) map.set(el, _getDOMPath(rootElement, el));
2838
+ elements.sort((a, b) => {
2839
+ let _a = map.get(a) || EMPTY_PATH, _b = map.get(b) || EMPTY_PATH, len = Math.max(_a.length, _b.length);
2840
+ for (let i = 0; i < len; i += 1) {
2841
+ let aIndex = _a[i] || -1, bIndex = _b[i] || -1;
2842
+ if (aIndex !== bIndex) return aIndex - bIndex;
2843
+ }
2844
+ return 0;
2845
+ });
2846
+ }
2847
+ /**
2848
+ * This controller is responsible for controlling UI menu state.
2849
+ *
2850
+ * @internal
2851
+ */
2852
+ function useMenuController(props) {
2853
+ let { onKeyDown, originElement, shouldFocus, rootElementRef } = props, elementsRef = (0, react.useRef)([]), [activeIndex, _setActiveIndex] = (0, react.useState)(-1), activeIndexRef = (0, react.useRef)(activeIndex), [activeElement, setActiveElement] = (0, react.useState)(null), setActiveIndex = (0, react.useCallback)((nextActiveIndex) => {
2854
+ _setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex, setActiveElement(elementsRef.current[nextActiveIndex] || null);
2855
+ }, []), mount = (0, react.useCallback)((element, selected) => {
2856
+ if (!element) return () => void 0;
2857
+ if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
2858
+ let selectedIndex = elementsRef.current.indexOf(element);
2859
+ setActiveIndex(selectedIndex);
2860
+ }
2861
+ return () => {
2862
+ let idx = elementsRef.current.indexOf(element);
2863
+ idx > -1 && elementsRef.current.splice(idx, 1);
2864
+ };
2865
+ }, [rootElementRef, setActiveIndex]), handleKeyDown = (0, react.useCallback)((event) => {
2866
+ if (event.key === "Tab") {
2867
+ originElement && originElement.focus();
2868
+ return;
2869
+ }
2870
+ if (event.key === "Home") {
2871
+ event.preventDefault(), event.stopPropagation();
2872
+ let el = _getFocusableElements(elementsRef.current)[0];
2873
+ if (!el) return;
2874
+ let currentIndex = elementsRef.current.indexOf(el);
2875
+ setActiveIndex(currentIndex);
2876
+ return;
2877
+ }
2878
+ if (event.key === "End") {
2879
+ event.preventDefault(), event.stopPropagation();
2880
+ let focusableElements = _getFocusableElements(elementsRef.current), el = focusableElements[focusableElements.length - 1];
2881
+ if (!el) return;
2882
+ let currentIndex = elementsRef.current.indexOf(el);
2883
+ setActiveIndex(currentIndex);
2884
+ return;
2885
+ }
2886
+ if (event.key === "ArrowUp") {
2887
+ event.preventDefault(), event.stopPropagation();
2888
+ let focusableElements = _getFocusableElements(elementsRef.current), focusableLen = focusableElements.length;
2889
+ if (focusableLen === 0) return;
2890
+ let focusedElement = elementsRef.current[activeIndexRef.current], focusedIndex = focusableElements.indexOf(focusedElement);
2891
+ focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
2892
+ let el = focusableElements[focusedIndex], currentIndex = elementsRef.current.indexOf(el);
2893
+ setActiveIndex(currentIndex);
2894
+ return;
2895
+ }
2896
+ if (event.key === "ArrowDown") {
2897
+ event.preventDefault(), event.stopPropagation();
2898
+ let focusableElements = _getFocusableElements(elementsRef.current), focusableLen = focusableElements.length;
2899
+ if (focusableLen === 0) return;
2900
+ let focusedElement = elementsRef.current[activeIndexRef.current], focusedIndex = focusableElements.indexOf(focusedElement);
2901
+ focusedIndex = (focusedIndex + 1) % focusableLen;
2902
+ let el = focusableElements[focusedIndex], currentIndex = elementsRef.current.indexOf(el);
2903
+ setActiveIndex(currentIndex);
2904
+ return;
2905
+ }
2906
+ onKeyDown && onKeyDown(event);
2907
+ }, [
2908
+ onKeyDown,
2909
+ originElement,
2910
+ setActiveIndex
2911
+ ]), handleItemMouseEnter = (0, react.useCallback)((event) => {
2912
+ let element = event.currentTarget, currentIndex = elementsRef.current.indexOf(element);
2913
+ setActiveIndex(currentIndex);
2914
+ }, [setActiveIndex]), handleItemMouseLeave = (0, react.useCallback)(() => {
2915
+ setActiveIndex(-2), rootElementRef.current?.focus();
2916
+ }, [rootElementRef, setActiveIndex]);
2917
+ return (0, react.useEffect)(() => {
2918
+ if (!rootElementRef.current) return;
2919
+ let rafId = requestAnimationFrame(() => {
2920
+ if (activeIndex === -1) {
2921
+ if (shouldFocus === "first") {
2922
+ let el = _getFocusableElements(elementsRef.current)[0];
2923
+ if (el) {
2924
+ let currentIndex = elementsRef.current.indexOf(el);
2925
+ setActiveIndex(currentIndex);
2926
+ }
2927
+ }
2928
+ if (shouldFocus === "last") {
2929
+ let focusableElements = _getFocusableElements(elementsRef.current), el = focusableElements[focusableElements.length - 1];
2930
+ if (el) {
2931
+ let currentIndex = elementsRef.current.indexOf(el);
2932
+ setActiveIndex(currentIndex);
2933
+ }
2934
+ }
2935
+ return;
2936
+ }
2937
+ (elementsRef.current[activeIndex] || null)?.focus();
2938
+ });
2939
+ return () => cancelAnimationFrame(rafId);
2940
+ }, [
2941
+ activeIndex,
2942
+ rootElementRef,
2943
+ setActiveIndex,
2944
+ shouldFocus
2945
+ ]), {
2946
+ activeElement,
2947
+ activeIndex,
2948
+ handleItemMouseEnter,
2949
+ handleItemMouseLeave,
2950
+ handleKeyDown,
2951
+ mount
2952
+ };
2953
+ }
2954
+ const StyledMenu = (0, styled_components.styled)(Box).withConfig({
2955
+ displayName: "StyledMenu",
2956
+ componentId: "sc-hkwd9h-0"
2957
+ })`outline:none;overflow:auto;`, Menu = (0, react.forwardRef)(function(props, forwardedRef) {
2958
+ let $ = (0, react_compiler_runtime.c)(50), _shouldFocus, children, gap, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, restProps, t0, t1;
2959
+ if ($[0] !== props) {
2960
+ let { children: t2, focusFirst, focusLast, onClickOutside: t3, onEscape: t4, onItemClick: t5, onItemSelect: t6, onKeyDown: t7, originElement: t8, padding: t9, registerElement: t10, shouldFocus: t11, gap: t12, space: t13, ...t14 } = props;
2961
+ children = t2, onClickOutside = t3, onEscape = t4, onItemClick = t5, onItemSelect = t6, onKeyDown = t7, originElement = t8, t0 = t9, registerElement = t10, _shouldFocus = t11, gap = t12, t1 = t13, restProps = t14, $[0] = props, $[1] = _shouldFocus, $[2] = children, $[3] = gap, $[4] = onClickOutside, $[5] = onEscape, $[6] = onItemClick, $[7] = onItemSelect, $[8] = onKeyDown, $[9] = originElement, $[10] = registerElement, $[11] = restProps, $[12] = t0, $[13] = t1;
2962
+ } else _shouldFocus = $[1], children = $[2], gap = $[3], onClickOutside = $[4], onEscape = $[5], onItemClick = $[6], onItemSelect = $[7], onKeyDown = $[8], originElement = $[9], registerElement = $[10], restProps = $[11], t0 = $[12], t1 = $[13];
2963
+ let padding = t0 === void 0 ? 1 : t0, spacing = gap === void 0 ? t1 === void 0 ? 1 : t1 : gap, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = (0, react.useRef)(null), t2;
2964
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], (0, react.useImperativeHandle)(forwardedRef, t2);
2965
+ let { isTopLayer } = useLayer(), t3;
2966
+ $[15] !== onKeyDown || $[16] !== originElement || $[17] !== shouldFocus ? (t3 = {
2967
+ onKeyDown,
2968
+ originElement,
2969
+ shouldFocus,
2970
+ rootElementRef: ref
2971
+ }, $[15] = onKeyDown, $[16] = originElement, $[17] = shouldFocus, $[18] = t3) : t3 = $[18];
2972
+ let { activeElement, activeIndex, handleItemMouseEnter, handleItemMouseLeave, handleKeyDown, mount } = useMenuController(t3), unregisterElementRef = (0, react.useRef)(null), t4;
2973
+ $[19] === registerElement ? t4 = $[20] : (t4 = (el) => {
2974
+ unregisterElementRef.current &&= (unregisterElementRef.current(), null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
2975
+ }, $[19] = registerElement, $[20] = t4);
2976
+ let handleRefChange = t4, t5, t6;
2977
+ $[21] !== activeIndex || $[22] !== onItemSelect ? (t5 = () => {
2978
+ onItemSelect && onItemSelect(activeIndex);
2979
+ }, t6 = [activeIndex, onItemSelect], $[21] = activeIndex, $[22] = onItemSelect, $[23] = t5, $[24] = t6) : (t5 = $[23], t6 = $[24]), (0, react.useEffect)(t5, t6);
2980
+ let t7;
2981
+ $[25] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[25] = t7) : t7 = $[25], useClickOutsideEvent(isTopLayer && onClickOutside, t7);
2982
+ let t8;
2983
+ $[26] !== isTopLayer || $[27] !== onEscape ? (t8 = (event) => {
2984
+ isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
2985
+ }, $[26] = isTopLayer, $[27] = onEscape, $[28] = t8) : t8 = $[28], useGlobalKeyDown(t8);
2986
+ let t9;
2987
+ $[29] !== activeElement || $[30] !== handleItemMouseEnter || $[31] !== handleItemMouseLeave || $[32] !== mount || $[33] !== onClickOutside || $[34] !== onEscape || $[35] !== onItemClick || $[36] !== registerElement ? (t9 = {
2988
+ version: 2,
2989
+ activeElement,
2990
+ mount,
2991
+ onClickOutside,
2992
+ onEscape,
2993
+ onItemClick,
2994
+ onItemMouseEnter: handleItemMouseEnter,
2995
+ onItemMouseLeave: handleItemMouseLeave,
2996
+ registerElement
2997
+ }, $[29] = activeElement, $[30] = handleItemMouseEnter, $[31] = handleItemMouseLeave, $[32] = mount, $[33] = onClickOutside, $[34] = onEscape, $[35] = onItemClick, $[36] = registerElement, $[37] = t9) : t9 = $[37];
2998
+ let value = t9, t10;
2999
+ $[38] !== children || $[39] !== spacing ? (t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stack, {
3000
+ gap: spacing,
3001
+ children
3002
+ }), $[38] = children, $[39] = spacing, $[40] = t10) : t10 = $[40];
3003
+ let t11;
3004
+ $[41] !== handleKeyDown || $[42] !== handleRefChange || $[43] !== padding || $[44] !== restProps || $[45] !== t10 ? (t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledMenu, {
3005
+ "data-ui": "Menu",
3006
+ ...restProps,
3007
+ onKeyDown: handleKeyDown,
3008
+ padding,
3009
+ ref: handleRefChange,
3010
+ role: "menu",
3011
+ tabIndex: -1,
3012
+ children: t10
3013
+ }), $[41] = handleKeyDown, $[42] = handleRefChange, $[43] = padding, $[44] = restProps, $[45] = t10, $[46] = t11) : t11 = $[46];
3014
+ let t12;
3015
+ return $[47] !== t11 || $[48] !== value ? (t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuContext.Provider, {
3016
+ value,
3017
+ children: t11
3018
+ }), $[47] = t11, $[48] = value, $[49] = t12) : t12 = $[49], t12;
3019
+ });
3020
+ Menu.displayName = "ForwardRef(Menu)";
3021
+ const StyledMenuDivider = styled_components.styled.hr.withConfig({
3022
+ displayName: "StyledMenuDivider",
3023
+ componentId: "sc-bemnwm-0"
3024
+ })`height:1px;border:0;background:var(--card-hairline-soft-color);margin:0;`;
3025
+ StyledMenuDivider.displayName = "MenuDivider";
3026
+ /**
3027
+ * @public
3028
+ */
3029
+ const MenuDivider = StyledMenuDivider;
3030
+ function selectableBaseStyle() {
3031
+ 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;}`;
3032
+ }
3033
+ function selectableColorStyle(props) {
3034
+ let { $tone } = props, { color, style } = require_theme.X(props.theme), tone = color.selectable[$tone];
3035
+ 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}`;
3036
+ }
3037
+ /**
3038
+ * @internal
3039
+ */
3040
+ const Selectable = /* @__PURE__ */ (0, styled_components.styled)(Box).withConfig({
3041
+ displayName: "Selectable",
3042
+ componentId: "sc-q5xa1z-0"
3043
+ })(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
3044
+ Selectable.displayName = "Selectable";
3045
+ function useMenu() {
3046
+ let value = (0, react.useContext)(MenuContext);
3047
+ if (!value) throw Error("useMenu(): missing context value");
3048
+ if (!isRecord(value) || value.version !== 2) throw Error("useMenu(): the context value is not compatible");
3049
+ return value;
3050
+ }
3051
+ function MenuGroupComponent(props) {
3052
+ let $ = (0, react_compiler_runtime.c)(82), IconComponent, children, gap, menuProps, onClick, popover, restProps, t0, t1, t2, t3, t4, t5, text;
3053
+ $[0] === props ? (IconComponent = $[1], children = $[2], gap = $[3], menuProps = $[4], onClick = $[5], popover = $[6], restProps = $[7], t0 = $[8], t1 = $[9], t2 = $[10], t3 = $[11], t4 = $[12], t5 = $[13], text = $[14]) : ({as: t0, children, fontSize: t1, icon: IconComponent, menu: menuProps, onClick, padding: t2, popover, radius: t3, gap, space: t4, text, tone: t5, ...restProps} = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = gap, $[4] = menuProps, $[5] = onClick, $[6] = popover, $[7] = restProps, $[8] = t0, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = t4, $[13] = t5, $[14] = text);
3054
+ let as = t0 === void 0 ? "button" : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, deprecated_space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, spacing = gap === void 0 ? deprecated_space : gap, menu = useMenu(), { scheme } = useRootTheme(), { activeElement, mount, onClickOutside, onEscape, onItemClick, onItemMouseEnter: _onItemMouseEnter, registerElement } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, [rootElement, setRootElement] = (0, react.useState)(null), [open, setOpen] = (0, react.useState)(!1), [shouldFocus, setShouldFocus] = (0, react.useState)(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = (0, react.useState)(!1), t6;
3055
+ $[15] === onItemMouseEnter ? t6 = $[16] : (t6 = (event) => {
3056
+ setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
3057
+ }, $[15] = onItemMouseEnter, $[16] = t6);
3058
+ let handleMouseEnter = t6, t7;
3059
+ $[17] === rootElement ? t7 = $[18] : (t7 = (event_0) => {
3060
+ event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
3061
+ rootElement?.focus();
3062
+ }));
3063
+ }, $[17] = rootElement, $[18] = t7);
3064
+ let handleMenuKeyDown = t7, t8;
3065
+ $[19] === onClick ? t8 = $[20] : (t8 = (event_1) => {
3066
+ onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
3067
+ }, $[19] = onClick, $[20] = t8);
3068
+ let handleClick = t8, t9;
3069
+ $[21] === onItemClick ? t9 = $[22] : (t9 = () => {
3070
+ setOpen(!1), onItemClick?.();
3071
+ }, $[21] = onItemClick, $[22] = t9);
3072
+ let handleChildItemClick = t9, t10;
3073
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => setWithinMenu(!0), $[23] = t10) : t10 = $[23];
3074
+ let handleMenuMouseEnter = t10, t11, t12;
3075
+ $[24] !== mount || $[25] !== rootElement ? (t11 = () => mount(rootElement), t12 = [mount, rootElement], $[24] = mount, $[25] = rootElement, $[26] = t11, $[27] = t12) : (t11 = $[26], t12 = $[27]), (0, react.useEffect)(t11, t12);
3076
+ let t13, t14;
3077
+ $[28] === active ? (t13 = $[29], t14 = $[30]) : (t13 = () => {
3078
+ active || setOpen(!1);
3079
+ }, t14 = [active], $[28] = active, $[29] = t13, $[30] = t14), (0, react.useEffect)(t13, t14);
3080
+ let t15, t16;
3081
+ $[31] === open ? (t15 = $[32], t16 = $[33]) : (t15 = () => {
3082
+ open || setWithinMenu(!1);
3083
+ }, t16 = [open], $[31] = open, $[32] = t15, $[33] = t16), (0, react.useEffect)(t15, t16);
3084
+ let t17, t18;
3085
+ $[34] === shouldFocus ? (t17 = $[35], t18 = $[36]) : (t17 = () => {
3086
+ if (!shouldFocus) return;
3087
+ let rafId = requestAnimationFrame(() => setShouldFocus(null));
3088
+ return () => cancelAnimationFrame(rafId);
3089
+ }, t18 = [shouldFocus], $[34] = shouldFocus, $[35] = t17, $[36] = t18), (0, react.useEffect)(t17, t18);
3090
+ let t19;
3091
+ $[37] !== children || $[38] !== handleChildItemClick || $[39] !== handleMenuKeyDown || $[40] !== menuProps || $[41] !== onClickOutside || $[42] !== onEscape || $[43] !== registerElement || $[44] !== shouldFocus ? (t19 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu, {
3092
+ ...menuProps,
3093
+ onClickOutside,
3094
+ onEscape,
3095
+ onItemClick: handleChildItemClick,
3096
+ onKeyDown: handleMenuKeyDown,
3097
+ onMouseEnter: handleMenuMouseEnter,
3098
+ registerElement,
3099
+ shouldFocus,
3100
+ children
3101
+ }), $[37] = children, $[38] = handleChildItemClick, $[39] = handleMenuKeyDown, $[40] = menuProps, $[41] = onClickOutside, $[42] = onEscape, $[43] = registerElement, $[44] = shouldFocus, $[45] = t19) : t19 = $[45];
3102
+ let childMenu = t19, t20;
3103
+ $[46] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
3104
+ let target = event_2.currentTarget;
3105
+ if (document.activeElement === target && event_2.key === "ArrowRight") {
3106
+ setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
3107
+ return;
3108
+ }
3109
+ }, $[46] = t20) : t20 = $[46];
3110
+ let handleKeyDown = t20, t21 = as === "button" ? withinMenu : void 0, t22 = as === "button" ? void 0 : withinMenu, t23 = !withinMenu && active ? "" : void 0, t24;
3111
+ $[47] === radius ? t24 = $[48] : (t24 = _getArrayProp(radius), $[47] = radius, $[48] = t24);
3112
+ let t25 = as === "button" ? "button" : void 0, t26;
3113
+ $[49] !== IconComponent || $[50] !== fontSize ? (t26 = IconComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Text, {
3114
+ size: fontSize,
3115
+ children: [(0, react.isValidElement)(IconComponent) && IconComponent, (0, react_is.isValidElementType)(IconComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconComponent, {})]
3116
+ }), $[49] = IconComponent, $[50] = fontSize, $[51] = t26) : t26 = $[51];
3117
+ let t27;
3118
+ $[52] !== fontSize || $[53] !== text ? (t27 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
3119
+ flex: 1,
3120
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
3121
+ size: fontSize,
3122
+ textOverflow: "ellipsis",
3123
+ weight: "medium",
3124
+ children: text
3125
+ })
3126
+ }), $[52] = fontSize, $[53] = text, $[54] = t27) : t27 = $[54];
3127
+ let t28;
3128
+ $[55] === Symbol.for("react.memo_cache_sentinel") ? (t28 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_sanity_icons.ChevronRightIcon, {}), $[55] = t28) : t28 = $[55];
3129
+ let t29;
3130
+ $[56] === fontSize ? t29 = $[57] : (t29 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
3131
+ size: fontSize,
3132
+ children: t28
3133
+ }), $[56] = fontSize, $[57] = t29);
3134
+ let t30;
3135
+ $[58] !== padding || $[59] !== spacing || $[60] !== t26 || $[61] !== t27 || $[62] !== t29 ? (t30 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Flex, {
3136
+ gap: spacing,
3137
+ padding,
3138
+ children: [
3139
+ t26,
3140
+ t27,
3141
+ t29
3142
+ ]
3143
+ }), $[58] = padding, $[59] = spacing, $[60] = t26, $[61] = t27, $[62] = t29, $[63] = t30) : t30 = $[63];
3144
+ let t31;
3145
+ $[64] !== as || $[65] !== handleClick || $[66] !== handleMouseEnter || $[67] !== restProps || $[68] !== scheme || $[69] !== t21 || $[70] !== t22 || $[71] !== t23 || $[72] !== t24 || $[73] !== t25 || $[74] !== t30 || $[75] !== tone ? (t31 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Selectable, {
3146
+ "data-as": as,
3147
+ "data-ui": "MenuGroup",
3148
+ forwardedAs: as,
3149
+ ...restProps,
3150
+ "aria-pressed": t21,
3151
+ "data-pressed": t22,
3152
+ "data-selected": t23,
3153
+ $radius: t24,
3154
+ $tone: tone,
3155
+ $scheme: scheme,
3156
+ onClick: handleClick,
3157
+ onKeyDown: handleKeyDown,
3158
+ onMouseEnter: handleMouseEnter,
3159
+ ref: setRootElement,
3160
+ tabIndex: -1,
3161
+ type: t25,
3162
+ children: t30
3163
+ }), $[64] = as, $[65] = handleClick, $[66] = handleMouseEnter, $[67] = restProps, $[68] = scheme, $[69] = t21, $[70] = t22, $[71] = t23, $[72] = t24, $[73] = t25, $[74] = t30, $[75] = tone, $[76] = t31) : t31 = $[76];
3164
+ let t32;
3165
+ return $[77] !== childMenu || $[78] !== open || $[79] !== popover || $[80] !== t31 ? (t32 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Popover, {
3166
+ ...popover,
3167
+ content: childMenu,
3168
+ "data-ui": "MenuGroup__popover",
3169
+ open,
3170
+ children: t31
3171
+ }), $[77] = childMenu, $[78] = open, $[79] = popover, $[80] = t31, $[81] = t32) : t32 = $[81], t32;
3172
+ }
3173
+ MenuGroupComponent.displayName = "MenuGroup";
3174
+ /**
3175
+ * @public
3176
+ */
3177
+ const MenuGroup = MenuGroupComponent, MenuItemComponent = (0, react.forwardRef)(function(props, forwardedRef) {
3178
+ let $ = (0, react_compiler_runtime.c)(76), IconComponent, IconRightComponent, children, disabled, gap, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, restProps, selectedProp, t0, t1, t2, t3, t4, t5, text;
3179
+ $[0] === props ? (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], gap = $[5], hotkeys = $[6], onClick = $[7], paddingBottom = $[8], paddingLeft = $[9], paddingRight = $[10], paddingTop = $[11], paddingX = $[12], paddingY = $[13], pressed = $[14], restProps = $[15], selectedProp = $[16], t0 = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], text = $[23]) : ({as: t0, children, disabled, fontSize: t1, hotkeys, icon: IconComponent, iconRight: IconRightComponent, onClick, padding: t2, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft, pressed, radius: t3, selected: selectedProp, gap, space: t4, text, tone: t5, ...restProps} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = gap, $[6] = hotkeys, $[7] = onClick, $[8] = paddingBottom, $[9] = paddingLeft, $[10] = paddingRight, $[11] = paddingTop, $[12] = paddingX, $[13] = paddingY, $[14] = pressed, $[15] = restProps, $[16] = selectedProp, $[17] = t0, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = text);
3180
+ let as = t0 === void 0 ? "button" : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, deprecated_space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, spacing = gap === void 0 ? deprecated_space : gap, { scheme } = useRootTheme(), menu = useMenu(), { activeElement, mount, onItemClick, onItemMouseEnter: _onItemMouseEnter, onItemMouseLeave: _onItemMouseLeave } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, onItemMouseLeave = _onItemMouseLeave ?? menu.onItemMouseLeave, [rootElement, setRootElement] = (0, react.useState)(null), active = !!activeElement && activeElement === rootElement, ref = (0, react.useRef)(null), t6;
3181
+ $[24] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[24] = t6) : t6 = $[24], (0, react.useImperativeHandle)(forwardedRef, t6);
3182
+ let t7, t8;
3183
+ $[25] !== mount || $[26] !== rootElement || $[27] !== selectedProp ? (t7 = () => mount(rootElement, selectedProp), t8 = [
3184
+ mount,
3185
+ rootElement,
3186
+ selectedProp
3187
+ ], $[25] = mount, $[26] = rootElement, $[27] = selectedProp, $[28] = t7, $[29] = t8) : (t7 = $[28], t8 = $[29]), (0, react.useEffect)(t7, t8);
3188
+ let t9;
3189
+ $[30] !== disabled || $[31] !== onClick || $[32] !== onItemClick ? (t9 = (event) => {
3190
+ disabled || (onClick && onClick(event), onItemClick && onItemClick());
3191
+ }, $[30] = disabled, $[31] = onClick, $[32] = onItemClick, $[33] = t9) : t9 = $[33];
3192
+ let handleClick = t9, t10;
3193
+ $[34] !== padding || $[35] !== paddingBottom || $[36] !== paddingLeft || $[37] !== paddingRight || $[38] !== paddingTop || $[39] !== paddingX || $[40] !== paddingY ? (t10 = {
3194
+ padding,
3195
+ paddingX,
3196
+ paddingY,
3197
+ paddingTop,
3198
+ paddingRight,
3199
+ paddingBottom,
3200
+ paddingLeft
3201
+ }, $[34] = padding, $[35] = paddingBottom, $[36] = paddingLeft, $[37] = paddingRight, $[38] = paddingTop, $[39] = paddingX, $[40] = paddingY, $[41] = t10) : t10 = $[41];
3202
+ let paddingProps = t10, t11;
3203
+ $[42] === fontSize ? t11 = $[43] : (t11 = _getArrayProp(fontSize).map(_temp), $[42] = fontSize, $[43] = t11);
3204
+ let hotkeysFontSize = t11, t12;
3205
+ $[44] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (el) => {
3206
+ ref.current = el, setRootElement(el);
3207
+ }, $[44] = t12) : t12 = $[44];
3208
+ let setRef = t12, t13 = as !== "button" && pressed ? "" : void 0, t14 = active ? "" : void 0, t15 = disabled ? "" : void 0, t16;
3209
+ $[45] === radius ? t16 = $[46] : (t16 = _getArrayProp(radius), $[45] = radius, $[46] = t16);
3210
+ let t17;
3211
+ $[47] === Symbol.for("react.memo_cache_sentinel") ? (t17 = _getArrayProp(0), $[47] = t17) : t17 = $[47];
3212
+ let t18 = disabled ? "default" : tone, t19 = as === "button" ? "button" : void 0, t20;
3213
+ $[48] !== IconComponent || $[49] !== IconRightComponent || $[50] !== fontSize || $[51] !== hotkeys || $[52] !== hotkeysFontSize || $[53] !== paddingProps || $[54] !== spacing || $[55] !== text ? (t20 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Flex, {
3214
+ as: "span",
3215
+ gap: spacing,
3216
+ align: "center",
3217
+ ...paddingProps,
3218
+ children: [
3219
+ IconComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Text, {
3220
+ size: fontSize,
3221
+ children: [(0, react.isValidElement)(IconComponent) && IconComponent, (0, react_is.isValidElementType)(IconComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconComponent, {})]
3222
+ }),
3223
+ text && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
3224
+ flex: 1,
3225
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
3226
+ size: fontSize,
3227
+ textOverflow: "ellipsis",
3228
+ weight: "medium",
3229
+ children: text
3230
+ })
3231
+ }),
3232
+ hotkeys && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hotkeys, {
3233
+ fontSize: hotkeysFontSize,
3234
+ keys: hotkeys,
3235
+ style: {
3236
+ marginTop: -4,
3237
+ marginBottom: -4
3238
+ }
3239
+ }),
3240
+ IconRightComponent && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Text, {
3241
+ size: fontSize,
3242
+ children: [(0, react.isValidElement)(IconRightComponent) && IconRightComponent, (0, react_is.isValidElementType)(IconRightComponent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconRightComponent, {})]
3243
+ })
3244
+ ]
3245
+ }), $[48] = IconComponent, $[49] = IconRightComponent, $[50] = fontSize, $[51] = hotkeys, $[52] = hotkeysFontSize, $[53] = paddingProps, $[54] = spacing, $[55] = text, $[56] = t20) : t20 = $[56];
3246
+ let t21;
3247
+ $[57] !== children || $[58] !== paddingProps ? (t21 = children && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Box, {
3248
+ as: "span",
3249
+ ...paddingProps,
3250
+ children
3251
+ }), $[57] = children, $[58] = paddingProps, $[59] = t21) : t21 = $[59];
3252
+ let t22;
3253
+ return $[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 ? (t22 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Selectable, {
3254
+ "data-ui": "MenuItem",
3255
+ role: "menuitem",
3256
+ ...restProps,
3257
+ "data-pressed": t13,
3258
+ "data-selected": t14,
3259
+ "data-disabled": t15,
3260
+ forwardedAs: as,
3261
+ $radius: t16,
3262
+ $padding: t17,
3263
+ $tone: t18,
3264
+ $scheme: scheme,
3265
+ disabled,
3266
+ onClick: handleClick,
3267
+ onMouseEnter: onItemMouseEnter,
3268
+ onMouseLeave: onItemMouseLeave,
3269
+ ref: setRef,
3270
+ tabIndex: -1,
3271
+ type: t19,
3272
+ children: [t20, t21]
3273
+ }), $[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;
3274
+ });
3275
+ MenuItemComponent.displayName = "ForwardRef(MenuItem)";
3276
+ /**
3277
+ * @public
3278
+ */
3279
+ const MenuItem = MenuItemComponent;
3280
+ function _temp(s) {
3281
+ return s - 1;
3282
+ }
3283
+ const CustomButton = (0, styled_components.styled)(Button).withConfig({
3284
+ displayName: "CustomButton",
3285
+ componentId: "sc-epil5s-0"
3286
+ })`max-width:100%;`, Tab = (0, react.forwardRef)(function(props, forwardedRef) {
3287
+ let $ = (0, react_compiler_runtime.c)(30), focused, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
3288
+ $[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);
3289
+ let fontSize = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 2 : t1, ref = (0, react.useRef)(null), focusedRef = (0, react.useRef)(!1), t2;
3290
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[11] = t2) : t2 = $[11], (0, react.useImperativeHandle)(forwardedRef, t2);
3291
+ let t3;
3292
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
3293
+ focusedRef.current = !1;
3294
+ }, $[12] = t3) : t3 = $[12];
3295
+ let handleBlur = t3, t4;
3296
+ $[13] === onFocus ? t4 = $[14] : (t4 = (event) => {
3297
+ focusedRef.current = !0, onFocus && onFocus(event);
3298
+ }, $[13] = onFocus, $[14] = t4);
3299
+ let handleFocus = t4, t5, t6;
3300
+ $[15] === focused ? (t5 = $[16], t6 = $[17]) : (t5 = () => {
3301
+ focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
3302
+ }, t6 = [focused], $[15] = focused, $[16] = t5, $[17] = t6), (0, react.useEffect)(t5, t6);
3303
+ let t7 = selected ? "true" : "false", t8 = selected ? 0 : -1, t9;
3304
+ return $[18] !== fontSize || $[19] !== handleFocus || $[20] !== icon || $[21] !== id || $[22] !== label || $[23] !== onClick || $[24] !== padding || $[25] !== restProps || $[26] !== selected || $[27] !== t7 || $[28] !== t8 ? (t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomButton, {
3305
+ "data-ui": "Tab",
3306
+ ...restProps,
3307
+ "aria-selected": t7,
3308
+ fontSize,
3309
+ icon,
3310
+ id,
3311
+ mode: "bleed",
3312
+ onClick,
3313
+ onBlur: handleBlur,
3314
+ onFocus: handleFocus,
3315
+ padding,
3316
+ ref,
3317
+ role: "tab",
3318
+ selected,
3319
+ tabIndex: t8,
3320
+ text: label,
3321
+ type: "button"
3322
+ }), $[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;
3323
+ });
3324
+ Tab.displayName = "ForwardRef(Tab)";
3325
+ const CustomInline = (0, styled_components.styled)(Inline).withConfig({
3326
+ displayName: "CustomInline",
3327
+ componentId: "sc-k5whbp-0"
3328
+ })`& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}`, TabList = (0, react.forwardRef)(function(props, ref) {
3329
+ let $ = (0, react_compiler_runtime.c)(15), childrenProp, restProps;
3330
+ $[0] === props ? (childrenProp = $[1], restProps = $[2]) : ({children: childrenProp, ...restProps} = props, $[0] = props, $[1] = childrenProp, $[2] = restProps);
3331
+ let [focusedIndex, setFocusedIndex] = (0, react.useState)(-1), t0;
3332
+ if ($[3] !== childrenProp || $[4] !== focusedIndex) {
3333
+ let children = react.Children.toArray(childrenProp).filter(react.isValidElement), t1;
3334
+ $[6] === focusedIndex ? t1 = $[7] : (t1 = (child, childIndex) => (0, react.cloneElement)(child, {
3335
+ focused: focusedIndex === childIndex,
3336
+ key: childIndex,
3337
+ onFocus: () => setFocusedIndex(childIndex)
3338
+ }), $[6] = focusedIndex, $[7] = t1), t0 = children.map(t1), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
3339
+ } else t0 = $[5];
3340
+ let tabs = t0, numTabs = tabs.length, t1;
3341
+ $[8] === numTabs ? t1 = $[9] : (t1 = (event) => {
3342
+ event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
3343
+ }, $[8] = numTabs, $[9] = t1);
3344
+ let handleKeyDown = t1, t2;
3345
+ return $[10] !== handleKeyDown || $[11] !== ref || $[12] !== restProps || $[13] !== tabs ? (t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomInline, {
3346
+ "data-ui": "TabList",
3347
+ ...restProps,
3348
+ onKeyDown: handleKeyDown,
3349
+ ref,
3350
+ role: "tablist",
3351
+ children: tabs
3352
+ }), $[10] = handleKeyDown, $[11] = ref, $[12] = restProps, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
3353
+ });
3354
+ TabList.displayName = "ForwardRef(TabList)", Object.defineProperty(exports, "$", {
3355
+ enumerable: !0,
3356
+ get: function() {
3357
+ return responsiveInputPaddingStyle;
3358
+ }
3359
+ }), Object.defineProperty(exports, "A", {
3360
+ enumerable: !0,
3361
+ get: function() {
3362
+ return useMediaIndex;
3363
+ }
3364
+ }), Object.defineProperty(exports, "At", {
3365
+ enumerable: !0,
3366
+ get: function() {
3367
+ return parseColor;
3368
+ }
3369
+ }), Object.defineProperty(exports, "B", {
3370
+ enumerable: !0,
3371
+ get: function() {
3372
+ return _cardColorStyle;
3373
+ }
3374
+ }), Object.defineProperty(exports, "C", {
3375
+ enumerable: !0,
3376
+ get: function() {
3377
+ return BoundaryElementContext;
3378
+ }
3379
+ }), Object.defineProperty(exports, "Ct", {
3380
+ enumerable: !0,
3381
+ get: function() {
3382
+ return isHTMLTextAreaElement;
3383
+ }
3384
+ }), Object.defineProperty(exports, "D", {
3385
+ enumerable: !0,
3386
+ get: function() {
3387
+ return Grid;
3388
+ }
3389
+ }), Object.defineProperty(exports, "Dt", {
3390
+ enumerable: !0,
3391
+ get: function() {
3392
+ return hexToRgb;
3393
+ }
3394
+ }), Object.defineProperty(exports, "E", {
3395
+ enumerable: !0,
3396
+ get: function() {
3397
+ return Inline;
3398
+ }
3399
+ }), Object.defineProperty(exports, "Et", {
3400
+ enumerable: !0,
3401
+ get: function() {
3402
+ return createColorTheme;
3403
+ }
3404
+ }), Object.defineProperty(exports, "F", {
3405
+ enumerable: !0,
3406
+ get: function() {
3407
+ return _ResizeObserver;
3408
+ }
3409
+ }), Object.defineProperty(exports, "Ft", {
3410
+ enumerable: !0,
3411
+ get: function() {
3412
+ return studioTheme;
3413
+ }
3414
+ }), Object.defineProperty(exports, "G", {
3415
+ enumerable: !0,
3416
+ get: function() {
3417
+ return SpanWithTextOverflow;
3418
+ }
3419
+ }), Object.defineProperty(exports, "H", {
3420
+ enumerable: !0,
3421
+ get: function() {
3422
+ return Flex;
3423
+ }
3424
+ }), Object.defineProperty(exports, "I", {
3425
+ enumerable: !0,
3426
+ get: function() {
3427
+ return useCustomValidity;
3428
+ }
3429
+ }), Object.defineProperty(exports, "It", {
3430
+ enumerable: !0,
3431
+ get: function() {
3432
+ return __toESM;
3433
+ }
3434
+ }), Object.defineProperty(exports, "J", {
3435
+ enumerable: !0,
3436
+ get: function() {
3437
+ return textInputBaseStyle;
3438
+ }
3439
+ }), Object.defineProperty(exports, "K", {
3440
+ enumerable: !0,
3441
+ get: function() {
3442
+ return responsiveRadiusStyle;
3443
+ }
3444
+ }), Object.defineProperty(exports, "L", {
3445
+ enumerable: !0,
3446
+ get: function() {
3447
+ return useClickOutsideEvent;
3448
+ }
3449
+ }), Object.defineProperty(exports, "M", {
3450
+ enumerable: !0,
3451
+ get: function() {
3452
+ return useGlobalKeyDown;
3453
+ }
3454
+ }), Object.defineProperty(exports, "Mt", {
3455
+ enumerable: !0,
3456
+ get: function() {
3457
+ return rgbToHsl;
3458
+ }
3459
+ }), Object.defineProperty(exports, "N", {
3460
+ enumerable: !0,
3461
+ get: function() {
3462
+ return useElementSize;
3463
+ }
3464
+ }), Object.defineProperty(exports, "Nt", {
3465
+ enumerable: !0,
3466
+ get: function() {
3467
+ return rgba;
3468
+ }
3469
+ }), Object.defineProperty(exports, "O", {
3470
+ enumerable: !0,
3471
+ get: function() {
3472
+ return usePrefersReducedMotion;
3473
+ }
3474
+ }), Object.defineProperty(exports, "Ot", {
3475
+ enumerable: !0,
3476
+ get: function() {
3477
+ return hslToRgb;
3478
+ }
3479
+ }), Object.defineProperty(exports, "P", {
3480
+ enumerable: !0,
3481
+ get: function() {
3482
+ return _elementSizeObserver;
3483
+ }
3484
+ }), Object.defineProperty(exports, "Pt", {
3485
+ enumerable: !0,
3486
+ get: function() {
3487
+ return screen;
3488
+ }
3489
+ }), Object.defineProperty(exports, "Q", {
3490
+ enumerable: !0,
3491
+ get: function() {
3492
+ return responsiveInputPaddingIconRightStyle;
3493
+ }
3494
+ }), Object.defineProperty(exports, "R", {
3495
+ enumerable: !0,
3496
+ get: function() {
3497
+ return Card;
3498
+ }
3499
+ }), Object.defineProperty(exports, "S", {
3500
+ enumerable: !0,
3501
+ get: function() {
3502
+ return isRecord;
3503
+ }
3504
+ }), Object.defineProperty(exports, "St", {
3505
+ enumerable: !0,
3506
+ get: function() {
3507
+ return isHTMLSelectElement;
3508
+ }
3509
+ }), Object.defineProperty(exports, "T", {
3510
+ enumerable: !0,
3511
+ get: function() {
3512
+ return KBD;
3513
+ }
3514
+ }), Object.defineProperty(exports, "Tt", {
3515
+ enumerable: !0,
3516
+ get: function() {
3517
+ return EMPTY_RECORD;
3518
+ }
3519
+ }), Object.defineProperty(exports, "U", {
3520
+ enumerable: !0,
3521
+ get: function() {
3522
+ return Text;
3523
+ }
3524
+ }), Object.defineProperty(exports, "V", {
3525
+ enumerable: !0,
3526
+ get: function() {
3527
+ return Spinner;
3528
+ }
3529
+ }), Object.defineProperty(exports, "W", {
3530
+ enumerable: !0,
3531
+ get: function() {
3532
+ return Box;
3533
+ }
3534
+ }), Object.defineProperty(exports, "X", {
3535
+ enumerable: !0,
3536
+ get: function() {
3537
+ return textInputRepresentationStyle;
3538
+ }
3539
+ }), Object.defineProperty(exports, "Y", {
3540
+ enumerable: !0,
3541
+ get: function() {
3542
+ return textInputFontSizeStyle;
3543
+ }
3544
+ }), Object.defineProperty(exports, "Z", {
3545
+ enumerable: !0,
3546
+ get: function() {
3547
+ return textInputRootStyle;
3548
+ }
3549
+ }), Object.defineProperty(exports, "_", {
3550
+ enumerable: !0,
3551
+ get: function() {
3552
+ return usePortal;
3553
+ }
3554
+ }), Object.defineProperty(exports, "_t", {
3555
+ enumerable: !0,
3556
+ get: function() {
3557
+ return containsOrEqualsElement;
3558
+ }
3559
+ }), Object.defineProperty(exports, "a", {
3560
+ enumerable: !0,
3561
+ get: function() {
3562
+ return MenuDivider;
3563
+ }
3564
+ }), Object.defineProperty(exports, "at", {
3565
+ enumerable: !0,
3566
+ get: function() {
3567
+ return useRootTheme;
3568
+ }
3569
+ }), Object.defineProperty(exports, "b", {
3570
+ enumerable: !0,
3571
+ get: function() {
3572
+ return LayerProvider;
3573
+ }
3574
+ }), Object.defineProperty(exports, "bt", {
3575
+ enumerable: !0,
3576
+ get: function() {
3577
+ return isHTMLElement;
3578
+ }
3579
+ }), Object.defineProperty(exports, "c", {
3580
+ enumerable: !0,
3581
+ get: function() {
3582
+ return Tooltip;
3583
+ }
3584
+ }), Object.defineProperty(exports, "ct", {
3585
+ enumerable: !0,
3586
+ get: function() {
3587
+ return responsiveTextFont;
3588
+ }
3589
+ }), Object.defineProperty(exports, "d", {
3590
+ enumerable: !0,
3591
+ get: function() {
3592
+ return useDelayedState;
3593
+ }
3594
+ }), Object.defineProperty(exports, "dt", {
3595
+ enumerable: !0,
3596
+ get: function() {
3597
+ return _fillCSSObject;
3598
+ }
3599
+ }), Object.defineProperty(exports, "et", {
3600
+ enumerable: !0,
3601
+ get: function() {
3602
+ return focusRingBorderStyle;
3603
+ }
3604
+ }), Object.defineProperty(exports, "f", {
3605
+ enumerable: !0,
3606
+ get: function() {
3607
+ return TextInput;
3608
+ }
3609
+ }), Object.defineProperty(exports, "ft", {
3610
+ enumerable: !0,
3611
+ get: function() {
3612
+ return _getArrayProp;
3613
+ }
3614
+ }), Object.defineProperty(exports, "g", {
3615
+ enumerable: !0,
3616
+ get: function() {
3617
+ return Portal;
3618
+ }
3619
+ }), Object.defineProperty(exports, "gt", {
3620
+ enumerable: !0,
3621
+ get: function() {
3622
+ return _isEnterToClickElement;
3623
+ }
3624
+ }), Object.defineProperty(exports, "h", {
3625
+ enumerable: !0,
3626
+ get: function() {
3627
+ return PortalProvider;
3628
+ }
3629
+ }), Object.defineProperty(exports, "ht", {
3630
+ enumerable: !0,
3631
+ get: function() {
3632
+ return rem;
3633
+ }
3634
+ }), Object.defineProperty(exports, "i", {
3635
+ enumerable: !0,
3636
+ get: function() {
3637
+ return MenuGroup;
3638
+ }
3639
+ }), Object.defineProperty(exports, "it", {
3640
+ enumerable: !0,
3641
+ get: function() {
3642
+ return ThemeColorProvider;
3643
+ }
3644
+ }), Object.defineProperty(exports, "j", {
3645
+ enumerable: !0,
3646
+ get: function() {
3647
+ return useMatchMedia;
3648
+ }
3649
+ }), Object.defineProperty(exports, "jt", {
3650
+ enumerable: !0,
3651
+ get: function() {
3652
+ return rgbToHex;
3653
+ }
3654
+ }), Object.defineProperty(exports, "k", {
3655
+ enumerable: !0,
3656
+ get: function() {
3657
+ return usePrefersDark;
3658
+ }
3659
+ }), Object.defineProperty(exports, "kt", {
3660
+ enumerable: !0,
3661
+ get: function() {
3662
+ return multiply;
3663
+ }
3664
+ }), Object.defineProperty(exports, "l", {
3665
+ enumerable: !0,
3666
+ get: function() {
3667
+ return useTooltipDelayGroup;
3668
+ }
3669
+ }), Object.defineProperty(exports, "lt", {
3670
+ enumerable: !0,
3671
+ get: function() {
3672
+ return responsiveTextAlignStyle;
3673
+ }
3674
+ }), Object.defineProperty(exports, "m", {
3675
+ enumerable: !0,
3676
+ get: function() {
3677
+ return Popover;
3678
+ }
3679
+ }), Object.defineProperty(exports, "mt", {
3680
+ enumerable: !0,
3681
+ get: function() {
3682
+ return _responsive;
3683
+ }
3684
+ }), Object.defineProperty(exports, "n", {
3685
+ enumerable: !0,
3686
+ get: function() {
3687
+ return Tab;
3688
+ }
3689
+ }), Object.defineProperty(exports, "nt", {
3690
+ enumerable: !0,
3691
+ get: function() {
3692
+ return useTheme;
3693
+ }
3694
+ }), Object.defineProperty(exports, "o", {
3695
+ enumerable: !0,
3696
+ get: function() {
3697
+ return Menu;
3698
+ }
3699
+ }), Object.defineProperty(exports, "ot", {
3700
+ enumerable: !0,
3701
+ get: function() {
3702
+ return ThemeProvider;
3703
+ }
3704
+ }), Object.defineProperty(exports, "p", {
3705
+ enumerable: !0,
3706
+ get: function() {
3707
+ return Stack;
3708
+ }
3709
+ }), Object.defineProperty(exports, "pt", {
3710
+ enumerable: !0,
3711
+ get: function() {
3712
+ return _getResponsiveSpace;
3713
+ }
3714
+ }), Object.defineProperty(exports, "q", {
3715
+ enumerable: !0,
3716
+ get: function() {
3717
+ return responsivePaddingStyle;
3718
+ }
3719
+ }), Object.defineProperty(exports, "r", {
3720
+ enumerable: !0,
3721
+ get: function() {
3722
+ return MenuItem;
3723
+ }
3724
+ }), Object.defineProperty(exports, "rt", {
3725
+ enumerable: !0,
3726
+ get: function() {
3727
+ return useTheme_v2;
3728
+ }
3729
+ }), Object.defineProperty(exports, "s", {
3730
+ enumerable: !0,
3731
+ get: function() {
3732
+ return Hotkeys;
3733
+ }
3734
+ }), Object.defineProperty(exports, "st", {
3735
+ enumerable: !0,
3736
+ get: function() {
3737
+ return createGlobalScopedContext;
3738
+ }
3739
+ }), Object.defineProperty(exports, "t", {
3740
+ enumerable: !0,
3741
+ get: function() {
3742
+ return TabList;
3743
+ }
3744
+ }), Object.defineProperty(exports, "tt", {
3745
+ enumerable: !0,
3746
+ get: function() {
3747
+ return focusRingStyle;
3748
+ }
3749
+ }), Object.defineProperty(exports, "u", {
3750
+ enumerable: !0,
3751
+ get: function() {
3752
+ return TooltipDelayGroupContext;
3753
+ }
3754
+ }), Object.defineProperty(exports, "ut", {
3755
+ enumerable: !0,
3756
+ get: function() {
3757
+ return responsiveFont;
3758
+ }
3759
+ }), Object.defineProperty(exports, "v", {
3760
+ enumerable: !0,
3761
+ get: function() {
3762
+ return Layer;
3763
+ }
3764
+ }), Object.defineProperty(exports, "vt", {
3765
+ enumerable: !0,
3766
+ get: function() {
3767
+ return isHTMLAnchorElement;
3768
+ }
3769
+ }), Object.defineProperty(exports, "w", {
3770
+ enumerable: !0,
3771
+ get: function() {
3772
+ return Arrow;
3773
+ }
3774
+ }), Object.defineProperty(exports, "wt", {
3775
+ enumerable: !0,
3776
+ get: function() {
3777
+ return EMPTY_ARRAY;
3778
+ }
3779
+ }), Object.defineProperty(exports, "x", {
3780
+ enumerable: !0,
3781
+ get: function() {
3782
+ return useBoundaryElement;
3783
+ }
3784
+ }), Object.defineProperty(exports, "xt", {
3785
+ enumerable: !0,
3786
+ get: function() {
3787
+ return isHTMLInputElement;
3788
+ }
3789
+ }), Object.defineProperty(exports, "y", {
3790
+ enumerable: !0,
3791
+ get: function() {
3792
+ return useLayer;
3793
+ }
3794
+ }), Object.defineProperty(exports, "yt", {
3795
+ enumerable: !0,
3796
+ get: function() {
3797
+ return isHTMLButtonElement;
3798
+ }
3799
+ }), Object.defineProperty(exports, "z", {
3800
+ enumerable: !0,
3801
+ get: function() {
3802
+ return Button;
3803
+ }
3804
+ });