@helpdice/ui 1.7.5 → 1.7.8

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 (304) hide show
  1. package/dist/CurrencyInput/index.js +2981 -0
  2. package/dist/LinearProgress/index.d.ts +2 -0
  3. package/dist/{css-baseline → LinearProgress}/index.js +25 -317
  4. package/dist/LinearProgress/linear-progress.d.ts +9 -0
  5. package/dist/Loadable/index.js +570 -0
  6. package/dist/PhoneInput/index.js +2136 -314
  7. package/dist/Placeholder/index.js +2116 -254
  8. package/dist/auto-complete/index.js +2145 -652
  9. package/dist/avatar/index.js +2119 -333
  10. package/dist/badge/index.js +2117 -331
  11. package/dist/breadcrumbs/index.js +2126 -340
  12. package/dist/button/button.compact.d.ts +2 -0
  13. package/dist/button/index.js +2214 -342
  14. package/dist/button-dropdown/index.js +2120 -291
  15. package/dist/button-group/index.js +2117 -331
  16. package/dist/capacity/index.js +2117 -331
  17. package/dist/card/index.js +2127 -298
  18. package/dist/checkbox/index.js +2119 -290
  19. package/dist/code/index.js +2116 -297
  20. package/dist/collapse/index.js +2117 -475
  21. package/dist/description/index.js +2117 -331
  22. package/dist/display/index.js +2117 -331
  23. package/dist/divider/index.js +2118 -332
  24. package/dist/dot/index.js +2117 -331
  25. package/dist/drawer/index.js +2129 -439
  26. package/dist/fieldset/index.js +2121 -354
  27. package/dist/grid/index.js +2119 -333
  28. package/dist/image/index.js +2122 -336
  29. package/dist/index.d.ts +2 -14
  30. package/dist/index.js +3175 -1879
  31. package/dist/input/index.js +2125 -296
  32. package/dist/keyboard/index.js +2116 -297
  33. package/dist/link/index.js +2117 -331
  34. package/dist/list/index.js +2119 -333
  35. package/dist/loading/index.js +2117 -331
  36. package/dist/menu/index.js +77 -45
  37. package/dist/modal/index.js +2145 -452
  38. package/dist/note/index.js +2117 -331
  39. package/dist/page/index.js +2117 -331
  40. package/dist/pagination/index.js +2118 -351
  41. package/dist/popover/index.js +2123 -354
  42. package/dist/progress/index.js +2117 -331
  43. package/dist/radio/index.js +2120 -334
  44. package/dist/rating/index.js +2118 -332
  45. package/dist/row/index.js +2115 -296
  46. package/dist/select/index.js +2151 -688
  47. package/dist/slider/index.js +2123 -356
  48. package/dist/snippet/index.js +2118 -421
  49. package/dist/spacer/index.js +2115 -296
  50. package/dist/spinner/index.js +2117 -331
  51. package/dist/table/index.js +2341 -754
  52. package/dist/tabs/index.js +2123 -344
  53. package/dist/tag/index.js +2116 -254
  54. package/dist/text/index.js +2116 -297
  55. package/dist/textarea/index.js +2117 -288
  56. package/dist/toggle/index.js +2117 -331
  57. package/dist/tooltip/index.js +2120 -351
  58. package/dist/tree/index.js +2123 -459
  59. package/dist/use-input/index.js +2122 -24
  60. package/dist/use-modal/index.js +2122 -24
  61. package/dist/use-network-status/index.d.ts +2 -0
  62. package/dist/{use-current-state → use-network-status}/index.js +22 -15
  63. package/dist/use-network-status/use-netowork-status.d.ts +4 -0
  64. package/dist/use-scale/index.js +2115 -296
  65. package/dist/use-tabs/index.js +2122 -24
  66. package/dist/user/index.js +2123 -337
  67. package/esm/CurrencyInput/components/CurrencyInput.js +342 -0
  68. package/esm/CurrencyInput/components/CurrencyInputProps.js +1 -0
  69. package/esm/CurrencyInput/components/utils/addSeparators.js +7 -0
  70. package/esm/CurrencyInput/components/utils/cleanValue.js +69 -0
  71. package/esm/CurrencyInput/components/utils/escapeRegExp.js +8 -0
  72. package/esm/CurrencyInput/components/utils/fixedDecimalValue.js +29 -0
  73. package/esm/CurrencyInput/components/utils/formatValue.js +124 -0
  74. package/esm/CurrencyInput/components/utils/getLocaleConfig.js +47 -0
  75. package/esm/CurrencyInput/components/utils/getSuffix.js +10 -0
  76. package/esm/CurrencyInput/components/utils/index.js +8 -0
  77. package/esm/CurrencyInput/components/utils/isNumber.js +3 -0
  78. package/esm/CurrencyInput/components/utils/padTrimValue.js +27 -0
  79. package/esm/CurrencyInput/components/utils/parseAbbrValue.js +43 -0
  80. package/esm/CurrencyInput/components/utils/removeInvalidChars.js +10 -0
  81. package/esm/CurrencyInput/components/utils/removeSeparators.js +10 -0
  82. package/esm/CurrencyInput/components/utils/repositionCursor.js +35 -0
  83. package/esm/CurrencyInput/index.js +4 -0
  84. package/esm/LinearProgress/index.d.ts +2 -0
  85. package/esm/LinearProgress/index.js +2 -0
  86. package/esm/LinearProgress/linear-progress.d.ts +9 -0
  87. package/esm/LinearProgress/linear-progress.js +28 -0
  88. package/esm/Loadable/index.js +2 -0
  89. package/esm/PhoneInput/phone.js +22 -19
  90. package/esm/auto-complete/auto-complete-dropdown.js +1 -3
  91. package/esm/auto-complete/auto-complete-item.js +1 -3
  92. package/esm/auto-complete/auto-complete-searching.js +1 -1
  93. package/esm/auto-complete/auto-complete.js +1 -1
  94. package/esm/avatar/avatar-group.js +1 -2
  95. package/esm/avatar/avatar.js +1 -2
  96. package/esm/badge/badge.js +1 -2
  97. package/esm/breadcrumbs/breadcrumbs-item.js +1 -1
  98. package/esm/breadcrumbs/breadcrumbs-separator.js +1 -1
  99. package/esm/breadcrumbs/breadcrumbs.js +1 -1
  100. package/esm/button/button-icon.js +1 -1
  101. package/esm/button/button.compact.d.ts +2 -0
  102. package/esm/button/button.compact.js +94 -50
  103. package/esm/button/button.js +1 -2
  104. package/esm/button/utils.js +1 -1
  105. package/esm/button-dropdown/button-dropdown-item.js +1 -1
  106. package/esm/button-dropdown/button-dropdown.js +1 -2
  107. package/esm/button-group/button-group.js +1 -2
  108. package/esm/capacity/capacity.js +1 -2
  109. package/esm/card/card-content.js +1 -1
  110. package/esm/card/card-footer.js +1 -2
  111. package/esm/card/card.js +1 -2
  112. package/esm/carousal/Arrow.js +18 -0
  113. package/esm/carousal/Indicator.js +20 -0
  114. package/esm/carousal/Thumbs.js +302 -0
  115. package/esm/carousal/animations.js +162 -0
  116. package/esm/carousal/index.js +683 -0
  117. package/esm/carousal/types.js +1 -0
  118. package/esm/carousal/utils.js +49 -0
  119. package/esm/checkbox/checkbox-group.js +1 -1
  120. package/esm/checkbox/checkbox.icon.js +1 -1
  121. package/esm/checkbox/checkbox.js +1 -2
  122. package/esm/code/code.js +1 -1
  123. package/esm/collapse/collapse-group.js +1 -2
  124. package/esm/collapse/collapse.js +1 -4
  125. package/esm/description/description.js +1 -2
  126. package/esm/display/display.js +1 -2
  127. package/esm/divider/divider.js +1 -2
  128. package/esm/dot/dot.js +1 -2
  129. package/esm/drawer/drawer-wrapper.js +1 -3
  130. package/esm/drawer/drawer.js +1 -1
  131. package/esm/fieldset/fieldset-content.js +1 -1
  132. package/esm/fieldset/fieldset-footer.js +1 -1
  133. package/esm/fieldset/fieldset-group.js +1 -3
  134. package/esm/fieldset/fieldset-title.js +1 -1
  135. package/esm/fieldset/fieldset.js +1 -2
  136. package/esm/grid/basic-item.js +1 -2
  137. package/esm/grid/grid-container.js +1 -1
  138. package/esm/grid/grid.js +1 -1
  139. package/esm/image/image-browser.js +1 -2
  140. package/esm/image/image.js +1 -2
  141. package/esm/image/image.skeleton.js +1 -1
  142. package/esm/index.d.ts +2 -14
  143. package/esm/index.js +5 -9
  144. package/esm/input/input-block-label.js +1 -1
  145. package/esm/input/input-icon-clear.js +1 -2
  146. package/esm/input/input-label.js +1 -1
  147. package/esm/input/input.js +1 -2
  148. package/esm/keyboard/keyboard.js +1 -1
  149. package/esm/link/link.js +1 -2
  150. package/esm/list/list-item.js +1 -2
  151. package/esm/loading/loading.js +1 -2
  152. package/esm/modal/modal-action.js +1 -2
  153. package/esm/modal/modal-actions.js +1 -1
  154. package/esm/modal/modal-content.js +1 -1
  155. package/esm/modal/modal-subtitle.js +1 -1
  156. package/esm/modal/modal-title.js +1 -1
  157. package/esm/modal/modal-wrapper.js +1 -3
  158. package/esm/modal/modal.js +1 -1
  159. package/esm/note/note.js +1 -2
  160. package/esm/page/page-header.js +1 -1
  161. package/esm/page/page.js +1 -1
  162. package/esm/pagination/pagination-item.js +1 -2
  163. package/esm/pagination/pagination.js +1 -1
  164. package/esm/popover/popover-item.js +1 -2
  165. package/esm/popover/popover.js +1 -1
  166. package/esm/progress/progress.js +1 -2
  167. package/esm/radio/radio-description.js +1 -1
  168. package/esm/radio/radio-group.js +1 -1
  169. package/esm/radio/radio.js +1 -2
  170. package/esm/rating/rating.js +1 -2
  171. package/esm/row/row.js +1 -1
  172. package/esm/select/select-dropdown.js +1 -3
  173. package/esm/select/select-icon-clear.js +1 -1
  174. package/esm/select/select-multiple-value.js +1 -1
  175. package/esm/select/select-option.js +1 -3
  176. package/esm/select/select.js +9 -12
  177. package/esm/slider/slider-dot.js +1 -2
  178. package/esm/slider/slider-mark.js +1 -1
  179. package/esm/slider/slider.js +1 -3
  180. package/esm/snippet/snippet.js +1 -3
  181. package/esm/spinner/spinner.js +1 -2
  182. package/esm/table/table-body.js +1 -2
  183. package/esm/table/table-head.js +3 -2
  184. package/esm/tabs/tabs-item.js +1 -2
  185. package/esm/tabs/tabs.js +1 -3
  186. package/esm/tag/tag.js +1 -1
  187. package/esm/text/child.js +1 -1
  188. package/esm/textarea/textarea.js +1 -2
  189. package/esm/toggle/toggle.js +1 -2
  190. package/esm/tooltip/tooltip-content.js +1 -3
  191. package/esm/tooltip/tooltip-icon.js +1 -1
  192. package/esm/tooltip/tooltip.js +1 -1
  193. package/esm/tree/tree-file-icon.js +1 -1
  194. package/esm/tree/tree-file.js +1 -2
  195. package/esm/tree/tree-folder-icon.js +1 -1
  196. package/esm/tree/tree-folder.js +1 -3
  197. package/esm/tree/tree-status-icon.js +1 -1
  198. package/esm/tree/tree.js +1 -1
  199. package/esm/use-input/use-input.js +1 -1
  200. package/esm/use-modal/use-modal.js +1 -1
  201. package/esm/use-network-status/index.d.ts +2 -0
  202. package/esm/use-network-status/index.js +2 -0
  203. package/esm/use-network-status/use-netowork-status.d.ts +4 -0
  204. package/esm/use-network-status/use-netowork-status.js +29 -0
  205. package/esm/use-scale/with-scale.js +1 -1
  206. package/esm/use-tabs/use-tabs.js +1 -1
  207. package/esm/user/user.js +1 -2
  208. package/esm/utils/use-context-state/use-context-state.js +1 -1
  209. package/esm/utils/use-drag.js +1 -1
  210. package/package.json +12 -4
  211. package/dist/css-baseline/css-baseline.d.ts +0 -9
  212. package/dist/css-baseline/index.d.ts +0 -1
  213. package/dist/shared/backdrop.d.ts +0 -14
  214. package/dist/shared/css-transition.d.ts +0 -13
  215. package/dist/shared/dropdown.d.ts +0 -9
  216. package/dist/shared/ellipsis.d.ts +0 -6
  217. package/dist/shared/expand.d.ts +0 -7
  218. package/dist/shared/highlight.d.ts +0 -13
  219. package/dist/ui-provider/index.d.ts +0 -3
  220. package/dist/ui-provider/index.js +0 -2186
  221. package/dist/ui-provider/theme-provider.d.ts +0 -8
  222. package/dist/ui-provider/ui-provider.d.ts +0 -8
  223. package/dist/use-all-themes/all-themes-context.d.ts +0 -7
  224. package/dist/use-all-themes/index.d.ts +0 -3
  225. package/dist/use-all-themes/index.js +0 -311
  226. package/dist/use-classes/index.d.ts +0 -2
  227. package/dist/use-classes/index.js +0 -48
  228. package/dist/use-classes/use-classes.d.ts +0 -4
  229. package/dist/use-current-state/index.d.ts +0 -2
  230. package/dist/use-current-state/use-current-state.d.ts +0 -4
  231. package/dist/use-media-query/index.d.ts +0 -3
  232. package/dist/use-media-query/index.js +0 -444
  233. package/dist/use-media-query/use-media-query.d.ts +0 -12
  234. package/dist/use-theme/index.d.ts +0 -2
  235. package/dist/use-theme/index.js +0 -309
  236. package/dist/use-theme/theme-context.d.ts +0 -4
  237. package/dist/use-toasts/helpers.d.ts +0 -18
  238. package/dist/use-toasts/index.d.ts +0 -3
  239. package/dist/use-toasts/index.js +0 -204
  240. package/dist/use-toasts/toast-container.d.ts +0 -3
  241. package/dist/use-toasts/toast-item.d.ts +0 -8
  242. package/dist/use-toasts/use-toast.d.ts +0 -40
  243. package/dist/utils/use-current-state.d.ts +0 -2
  244. package/dist/utils/use-dom-observer.d.ts +0 -3
  245. package/dist/utils/use-hd-ui-context.d.ts +0 -16
  246. package/dist/utils/use-previous.d.ts +0 -2
  247. package/esm/captcha/index.js +0 -128
  248. package/esm/css-baseline/css-baseline.d.ts +0 -9
  249. package/esm/css-baseline/css-baseline.js +0 -23
  250. package/esm/css-baseline/index.d.ts +0 -1
  251. package/esm/css-baseline/index.js +0 -2
  252. package/esm/shared/backdrop.d.ts +0 -14
  253. package/esm/shared/backdrop.js +0 -66
  254. package/esm/shared/css-transition.d.ts +0 -13
  255. package/esm/shared/css-transition.js +0 -65
  256. package/esm/shared/dropdown.d.ts +0 -9
  257. package/esm/shared/dropdown.js +0 -99
  258. package/esm/shared/ellipsis.d.ts +0 -6
  259. package/esm/shared/ellipsis.js +0 -13
  260. package/esm/shared/expand.d.ts +0 -7
  261. package/esm/shared/expand.js +0 -86
  262. package/esm/shared/highlight.d.ts +0 -13
  263. package/esm/shared/highlight.js +0 -46
  264. package/esm/ui-provider/index.d.ts +0 -3
  265. package/esm/ui-provider/index.js +0 -4
  266. package/esm/ui-provider/theme-provider.d.ts +0 -8
  267. package/esm/ui-provider/theme-provider.js +0 -45
  268. package/esm/ui-provider/ui-provider.d.ts +0 -8
  269. package/esm/ui-provider/ui-provider.js +0 -55
  270. package/esm/use-all-themes/all-themes-context.d.ts +0 -7
  271. package/esm/use-all-themes/all-themes-context.js +0 -11
  272. package/esm/use-all-themes/index.d.ts +0 -3
  273. package/esm/use-all-themes/index.js +0 -2
  274. package/esm/use-classes/index.d.ts +0 -2
  275. package/esm/use-classes/index.js +0 -2
  276. package/esm/use-classes/use-classes.d.ts +0 -4
  277. package/esm/use-classes/use-classes.js +0 -34
  278. package/esm/use-current-state/index.d.ts +0 -2
  279. package/esm/use-current-state/index.js +0 -2
  280. package/esm/use-current-state/use-current-state.d.ts +0 -4
  281. package/esm/use-current-state/use-current-state.js +0 -23
  282. package/esm/use-media-query/index.d.ts +0 -3
  283. package/esm/use-media-query/index.js +0 -2
  284. package/esm/use-media-query/use-media-query.d.ts +0 -12
  285. package/esm/use-media-query/use-media-query.js +0 -81
  286. package/esm/use-theme/index.d.ts +0 -2
  287. package/esm/use-theme/index.js +0 -2
  288. package/esm/use-theme/theme-context.d.ts +0 -4
  289. package/esm/use-theme/theme-context.js +0 -9
  290. package/esm/use-toasts/helpers.d.ts +0 -18
  291. package/esm/use-toasts/helpers.js +0 -68
  292. package/esm/use-toasts/index.d.ts +0 -3
  293. package/esm/use-toasts/index.js +0 -2
  294. package/esm/use-toasts/toast-container.d.ts +0 -3
  295. package/esm/use-toasts/toast-container.js +0 -120
  296. package/esm/use-toasts/toast-item.d.ts +0 -8
  297. package/esm/use-toasts/toast-item.js +0 -45
  298. package/esm/use-toasts/use-toast.d.ts +0 -40
  299. package/esm/use-toasts/use-toast.js +0 -103
  300. package/esm/utils/use-current-state.d.ts +0 -2
  301. package/esm/utils/use-current-state.js +0 -2
  302. package/esm/utils/use-dom-observer.d.ts +0 -3
  303. package/esm/utils/use-hd-ui-context.d.ts +0 -16
  304. package/esm/utils/use-previous.d.ts +0 -2
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var reactDom = require('react-dom');
6
+ var require$$1 = require('react-dom');
7
7
 
8
8
  function _interopNamespaceDefault(e) {
9
9
  var n = Object.create(null);
@@ -197,15 +197,6 @@ function _toPropertyKey(t) {
197
197
  var i = _toPrimitive(t, "string");
198
198
  return "symbol" == typeof i ? i : i + "";
199
199
  }
200
- function _typeof(o) {
201
- "@babel/helpers - typeof";
202
-
203
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
204
- return typeof o;
205
- } : function (o) {
206
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
207
- }, _typeof(o);
208
- }
209
200
  function _unsupportedIterableToArray(r, a) {
210
201
  if (r) {
211
202
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
@@ -759,259 +750,2129 @@ function requireStyle () {
759
750
  var styleExports = requireStyle();
760
751
  var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
761
752
 
762
- var defaultFont = {
763
- sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
764
- mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
765
- prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
766
- };
767
- var defaultBreakpoints = {
768
- xs: {
769
- min: '0',
770
- max: '650px'
771
- },
772
- sm: {
773
- min: '650px',
774
- max: '900px'
775
- },
776
- md: {
777
- min: '900px',
778
- max: '1280px'
779
- },
780
- lg: {
781
- min: '1280px',
782
- max: '1920px'
783
- },
784
- xl: {
785
- min: '1920px',
786
- max: '10000px'
787
- }
788
- };
789
- var defaultLayout = {
790
- gap: '16pt',
791
- gapNegative: '-16pt',
792
- gapHalf: '8pt',
793
- gapHalfNegative: '-8pt',
794
- gapQuarter: '4pt',
795
- gapQuarterNegative: '-4pt',
796
- pageMargin: '16pt',
797
- pageWidth: '750pt',
798
- pageWidthWithMargin: '782pt',
799
- breakpointMobile: defaultBreakpoints.xs.max,
800
- breakpointTablet: defaultBreakpoints.sm.max,
801
- radius: '6px',
802
- unit: '16px'
803
- };
753
+ var dist = {};
804
754
 
805
- var palette$1 = {
806
- accents_1: '#fafafa',
807
- accents_2: '#eaeaea',
808
- accents_3: '#999',
809
- accents_4: '#888',
810
- accents_5: '#666',
811
- accents_6: '#444',
812
- accents_7: '#333',
813
- accents_8: '#111',
814
- background: '#fff',
815
- foreground: '#000',
816
- selection: '#79ffe1',
817
- secondary: '#666',
818
- code: '#f81ce5',
819
- border: '#eaeaea',
820
- error: '#e00',
821
- errorLight: '#ff1a1a',
822
- errorLighter: '#f7d4d6',
823
- errorDark: '#c50000',
824
- success: '#0070f3',
825
- successLight: '#3291ff',
826
- successLighter: '#d3e5ff',
827
- successDark: '#0761d1',
828
- warning: '#f5a623',
829
- warningLight: '#f7b955',
830
- warningLighter: '#ffefcf',
831
- warningDark: '#ab570a',
832
- cyan: '#50e3c2',
833
- cyanLighter: '#aaffec',
834
- cyanLight: '#79ffe1',
835
- cyanDark: '#29bc9b',
836
- violet: '#7928ca',
837
- violetLighter: '#e3d7fc',
838
- violetLight: '#8a63d2',
839
- violetDark: '#4c2889',
840
- purple: '#f81ce5',
841
- alert: '#ff0080',
842
- magenta: '#eb367f',
843
- link: '#0070f3'
844
- };
845
- var expressiveness$1 = {
846
- linkStyle: 'none',
847
- linkHoverStyle: 'none',
848
- dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
849
- scrollerStart: 'rgba(255, 255, 255, 1)',
850
- scrollerEnd: 'rgba(255, 255, 255, 0)',
851
- shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
852
- shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
853
- shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
854
- portalOpacity: 0.25
855
- };
856
- var font$1 = defaultFont;
857
- var breakpoints$1 = defaultBreakpoints;
858
- var layout$1 = defaultLayout;
859
- var themes$1 = {
860
- type: 'light',
861
- font: font$1,
862
- layout: layout$1,
863
- palette: palette$1,
864
- breakpoints: breakpoints$1,
865
- expressiveness: expressiveness$1
866
- };
867
-
868
- var palette = {
869
- accents_1: '#111',
870
- accents_2: '#333',
871
- accents_3: '#444',
872
- accents_4: '#666',
873
- accents_5: '#888',
874
- accents_6: '#999',
875
- accents_7: '#eaeaea',
876
- accents_8: '#fafafa',
877
- background: '#000',
878
- foreground: '#fff',
879
- selection: '#f81ce5',
880
- secondary: '#888',
881
- code: '#79ffe1',
882
- border: '#333',
883
- error: '#e00',
884
- errorLighter: '#f7d4d6',
885
- errorLight: '#ff1a1a',
886
- errorDark: '#c50000',
887
- success: '#0070f3',
888
- successLighter: '#d3e5ff',
889
- successLight: '#3291ff',
890
- successDark: '#0761d1',
891
- warning: '#f5a623',
892
- warningLighter: '#ffefcf',
893
- warningLight: '#f7b955',
894
- warningDark: '#ab570a',
895
- cyan: '#50e3c2',
896
- cyanLighter: '#aaffec',
897
- cyanLight: '#79ffe1',
898
- cyanDark: '#29bc9b',
899
- violet: '#7928ca',
900
- violetLighter: '#e3d7fc',
901
- violetLight: '#8a63d2',
902
- violetDark: '#4c2889',
903
- purple: '#f81ce5',
904
- alert: '#ff0080',
905
- magenta: '#eb367f',
906
- link: '#3291ff'
907
- };
908
- var expressiveness = {
909
- linkStyle: 'none',
910
- linkHoverStyle: 'none',
911
- dropdownBoxShadow: '0 0 0 1px #333',
912
- scrollerStart: 'rgba(255, 255, 255, 1)',
913
- scrollerEnd: 'rgba(255, 255, 255, 0)',
914
- shadowSmall: '0 0 0 1px #333',
915
- shadowMedium: '0 0 0 1px #333',
916
- shadowLarge: '0 0 0 1px #333',
917
- portalOpacity: 0.75
918
- };
919
- var font = defaultFont;
920
- var breakpoints = defaultBreakpoints;
921
- var layout = defaultLayout;
922
- var themes = {
923
- type: 'dark',
924
- font: font,
925
- layout: layout,
926
- palette: palette,
927
- breakpoints: breakpoints,
928
- expressiveness: expressiveness
929
- };
930
-
931
- var isObject = function isObject(target) {
932
- return target && _typeof(target) === 'object';
933
- };
934
- var _deepDuplicable = function deepDuplicable(source, target) {
935
- if (!isObject(target) || !isObject(source)) return source;
936
- var sourceKeys = Object.keys(source);
937
- var result = {};
938
- for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
939
- var key = _sourceKeys[_i];
940
- var sourceValue = source[key];
941
- var targetValue = target[key];
942
- if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
943
- result[key] = targetValue.concat(sourceValue);
944
- } else if (isObject(sourceValue) && isObject(targetValue)) {
945
- result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
946
- } else if (targetValue) {
947
- result[key] = targetValue;
948
- } else {
949
- result[key] = sourceValue;
950
- }
951
- }
952
- return result;
953
- };
954
- var getPresets = function getPresets() {
955
- return [themes$1, themes];
956
- };
957
- var getPresetStaticTheme = function getPresetStaticTheme() {
958
- return themes$1;
959
- };
960
- var isAvailableThemeType = function isAvailableThemeType(type) {
961
- if (!type) return false;
962
- var presetThemes = getPresets();
963
- var hasType = presetThemes.find(function (theme) {
964
- return theme.type === type;
965
- });
966
- return !hasType;
967
- };
968
- var isPresetTheme = function isPresetTheme(themeOrType) {
969
- if (!themeOrType) return false;
970
- var isType = typeof themeOrType === 'string';
971
- var type = isType ? themeOrType : themeOrType.type;
972
- return !isAvailableThemeType(type);
973
- };
974
- var hasUserCustomTheme = function hasUserCustomTheme() {
975
- var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
976
- return !!themes.find(function (item) {
977
- return isAvailableThemeType(item.type);
978
- });
979
- };
980
- var create = function create(base, custom) {
981
- if (!isAvailableThemeType(custom.type)) {
982
- throw new Error('Duplicate or unavailable theme type');
983
- }
984
- return _deepDuplicable(base, custom);
985
- };
986
- var createFromDark = function createFromDark(custom) {
987
- return create(themes, custom);
988
- };
989
- var createFromLight = function createFromLight(custom) {
990
- return create(themes$1, custom);
991
- };
992
- var Themes = {
993
- isPresetTheme: isPresetTheme,
994
- isAvailableThemeType: isAvailableThemeType,
995
- hasUserCustomTheme: hasUserCustomTheme,
996
- getPresets: getPresets,
997
- getPresetStaticTheme: getPresetStaticTheme,
998
- create: create,
999
- createFromDark: createFromDark,
1000
- createFromLight: createFromLight
1001
- };
755
+ var hasRequiredDist;
1002
756
 
1003
- /* "use client" */
757
+ function requireDist () {
758
+ if (hasRequiredDist) return dist;
759
+ hasRequiredDist = 1;
1004
760
 
1005
- var defaultTheme = Themes.getPresetStaticTheme();
1006
- var ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
1007
- var useTheme = function useTheme() {
1008
- return React.useContext(ThemeContext);
1009
- };
761
+ var React$1 = React;
762
+ var reactDom = require$$1;
763
+
764
+ function _arrayLikeToArray(r, a) {
765
+ (null == a || a > r.length) && (a = r.length);
766
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
767
+ return n;
768
+ }
769
+ function _arrayWithHoles(r) {
770
+ if (Array.isArray(r)) return r;
771
+ }
772
+ function _arrayWithoutHoles(r) {
773
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
774
+ }
775
+ function _defineProperty(e, r, t) {
776
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
777
+ value: t,
778
+ enumerable: true,
779
+ configurable: true,
780
+ writable: true
781
+ }) : e[r] = t, e;
782
+ }
783
+ function _extends() {
784
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
785
+ for (var e = 1; e < arguments.length; e++) {
786
+ var t = arguments[e];
787
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
788
+ }
789
+ return n;
790
+ }, _extends.apply(null, arguments);
791
+ }
792
+ function _iterableToArray(r) {
793
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
794
+ }
795
+ function _iterableToArrayLimit(r, l) {
796
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
797
+ if (null != t) {
798
+ var e,
799
+ n,
800
+ i,
801
+ u,
802
+ a = [],
803
+ f = true,
804
+ o = false;
805
+ try {
806
+ if (i = (t = t.call(r)).next, 0 === l) {
807
+ if (Object(t) !== t) return;
808
+ f = !1;
809
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
810
+ } catch (r) {
811
+ o = true, n = r;
812
+ } finally {
813
+ try {
814
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
815
+ } finally {
816
+ if (o) throw n;
817
+ }
818
+ }
819
+ return a;
820
+ }
821
+ }
822
+ function _nonIterableRest() {
823
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
824
+ }
825
+ function _nonIterableSpread() {
826
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
827
+ }
828
+ function ownKeys(e, r) {
829
+ var t = Object.keys(e);
830
+ if (Object.getOwnPropertySymbols) {
831
+ var o = Object.getOwnPropertySymbols(e);
832
+ r && (o = o.filter(function (r) {
833
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
834
+ })), t.push.apply(t, o);
835
+ }
836
+ return t;
837
+ }
838
+ function _objectSpread2(e) {
839
+ for (var r = 1; r < arguments.length; r++) {
840
+ var t = null != arguments[r] ? arguments[r] : {};
841
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
842
+ _defineProperty(e, r, t[r]);
843
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
844
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
845
+ });
846
+ }
847
+ return e;
848
+ }
849
+ function _objectWithoutProperties(e, t) {
850
+ if (null == e) return {};
851
+ var o,
852
+ r,
853
+ i = _objectWithoutPropertiesLoose(e, t);
854
+ if (Object.getOwnPropertySymbols) {
855
+ var n = Object.getOwnPropertySymbols(e);
856
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
857
+ }
858
+ return i;
859
+ }
860
+ function _objectWithoutPropertiesLoose(r, e) {
861
+ if (null == r) return {};
862
+ var t = {};
863
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
864
+ if (-1 !== e.indexOf(n)) continue;
865
+ t[n] = r[n];
866
+ }
867
+ return t;
868
+ }
869
+ function _slicedToArray(r, e) {
870
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
871
+ }
872
+ function _toConsumableArray(r) {
873
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
874
+ }
875
+ function _toPrimitive(t, r) {
876
+ if ("object" != typeof t || !t) return t;
877
+ var e = t[Symbol.toPrimitive];
878
+ if (void 0 !== e) {
879
+ var i = e.call(t, r);
880
+ if ("object" != typeof i) return i;
881
+ throw new TypeError("@@toPrimitive must return a primitive value.");
882
+ }
883
+ return ("string" === r ? String : Number)(t);
884
+ }
885
+ function _toPropertyKey(t) {
886
+ var i = _toPrimitive(t, "string");
887
+ return "symbol" == typeof i ? i : i + "";
888
+ }
889
+ function _typeof(o) {
890
+ "@babel/helpers - typeof";
891
+
892
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
893
+ return typeof o;
894
+ } : function (o) {
895
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
896
+ }, _typeof(o);
897
+ }
898
+ function _unsupportedIterableToArray(r, a) {
899
+ if (r) {
900
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
901
+ var t = {}.toString.call(r).slice(8, -1);
902
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
903
+ }
904
+ }
905
+
906
+ var defaultToastLayout = {
907
+ padding: '12px 16px',
908
+ margin: '8px 0',
909
+ width: '420px',
910
+ maxWidth: '90vw',
911
+ maxHeight: '75px',
912
+ placement: 'bottomRight'
913
+ };
914
+ var defaultParams = {
915
+ toasts: [],
916
+ toastLayout: defaultToastLayout,
917
+ updateToastLayout: function updateToastLayout(t) {
918
+ return t;
919
+ },
920
+ updateToasts: function updateToasts(t) {
921
+ return t;
922
+ },
923
+ lastUpdateToastId: null,
924
+ updateLastToastId: function updateLastToastId() {
925
+ return null;
926
+ }
927
+ };
928
+ var HUIContent = /*#__PURE__*/React$1.createContext(defaultParams);
929
+ var useHUIContext = function useHUIContext() {
930
+ return React$1.useContext(HUIContent);
931
+ };
932
+
933
+ var defaultFont = {
934
+ sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
935
+ mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
936
+ prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
937
+ };
938
+ var defaultBreakpoints = {
939
+ xs: {
940
+ min: '0',
941
+ max: '650px'
942
+ },
943
+ sm: {
944
+ min: '650px',
945
+ max: '900px'
946
+ },
947
+ md: {
948
+ min: '900px',
949
+ max: '1280px'
950
+ },
951
+ lg: {
952
+ min: '1280px',
953
+ max: '1920px'
954
+ },
955
+ xl: {
956
+ min: '1920px',
957
+ max: '10000px'
958
+ }
959
+ };
960
+ var defaultLayout = {
961
+ gap: '16pt',
962
+ gapNegative: '-16pt',
963
+ gapHalf: '8pt',
964
+ gapHalfNegative: '-8pt',
965
+ gapQuarter: '4pt',
966
+ gapQuarterNegative: '-4pt',
967
+ pageMargin: '16pt',
968
+ pageWidth: '750pt',
969
+ pageWidthWithMargin: '782pt',
970
+ breakpointMobile: defaultBreakpoints.xs.max,
971
+ breakpointTablet: defaultBreakpoints.sm.max,
972
+ radius: '6px',
973
+ unit: '16px'
974
+ };
975
+
976
+ var palette$1 = {
977
+ accents_1: '#fafafa',
978
+ accents_2: '#eaeaea',
979
+ accents_3: '#999',
980
+ accents_4: '#888',
981
+ accents_5: '#666',
982
+ accents_6: '#444',
983
+ accents_7: '#333',
984
+ accents_8: '#111',
985
+ background: '#fff',
986
+ foreground: '#000',
987
+ selection: '#79ffe1',
988
+ secondary: '#666',
989
+ code: '#f81ce5',
990
+ border: '#eaeaea',
991
+ error: '#e00',
992
+ errorLight: '#ff1a1a',
993
+ errorLighter: '#f7d4d6',
994
+ errorDark: '#c50000',
995
+ success: '#0070f3',
996
+ successLight: '#3291ff',
997
+ successLighter: '#d3e5ff',
998
+ successDark: '#0761d1',
999
+ warning: '#f5a623',
1000
+ warningLight: '#f7b955',
1001
+ warningLighter: '#ffefcf',
1002
+ warningDark: '#ab570a',
1003
+ cyan: '#50e3c2',
1004
+ cyanLighter: '#aaffec',
1005
+ cyanLight: '#79ffe1',
1006
+ cyanDark: '#29bc9b',
1007
+ violet: '#7928ca',
1008
+ violetLighter: '#e3d7fc',
1009
+ violetLight: '#8a63d2',
1010
+ violetDark: '#4c2889',
1011
+ purple: '#f81ce5',
1012
+ alert: '#ff0080',
1013
+ magenta: '#eb367f',
1014
+ link: '#0070f3'
1015
+ };
1016
+ var expressiveness$1 = {
1017
+ linkStyle: 'none',
1018
+ linkHoverStyle: 'none',
1019
+ dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
1020
+ scrollerStart: 'rgba(255, 255, 255, 1)',
1021
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
1022
+ shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
1023
+ shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
1024
+ shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
1025
+ portalOpacity: 0.25
1026
+ };
1027
+ var font$1 = defaultFont;
1028
+ var breakpoints$1 = defaultBreakpoints;
1029
+ var layout$1 = defaultLayout;
1030
+ var themes$1 = {
1031
+ type: 'light',
1032
+ font: font$1,
1033
+ layout: layout$1,
1034
+ palette: palette$1,
1035
+ breakpoints: breakpoints$1,
1036
+ expressiveness: expressiveness$1
1037
+ };
1038
+
1039
+ var palette = {
1040
+ accents_1: '#111',
1041
+ accents_2: '#333',
1042
+ accents_3: '#444',
1043
+ accents_4: '#666',
1044
+ accents_5: '#888',
1045
+ accents_6: '#999',
1046
+ accents_7: '#eaeaea',
1047
+ accents_8: '#fafafa',
1048
+ background: '#000',
1049
+ foreground: '#fff',
1050
+ selection: '#f81ce5',
1051
+ secondary: '#888',
1052
+ code: '#79ffe1',
1053
+ border: '#333',
1054
+ error: '#e00',
1055
+ errorLighter: '#f7d4d6',
1056
+ errorLight: '#ff1a1a',
1057
+ errorDark: '#c50000',
1058
+ success: '#0070f3',
1059
+ successLighter: '#d3e5ff',
1060
+ successLight: '#3291ff',
1061
+ successDark: '#0761d1',
1062
+ warning: '#f5a623',
1063
+ warningLighter: '#ffefcf',
1064
+ warningLight: '#f7b955',
1065
+ warningDark: '#ab570a',
1066
+ cyan: '#50e3c2',
1067
+ cyanLighter: '#aaffec',
1068
+ cyanLight: '#79ffe1',
1069
+ cyanDark: '#29bc9b',
1070
+ violet: '#7928ca',
1071
+ violetLighter: '#e3d7fc',
1072
+ violetLight: '#8a63d2',
1073
+ violetDark: '#4c2889',
1074
+ purple: '#f81ce5',
1075
+ alert: '#ff0080',
1076
+ magenta: '#eb367f',
1077
+ link: '#3291ff'
1078
+ };
1079
+ var expressiveness = {
1080
+ linkStyle: 'none',
1081
+ linkHoverStyle: 'none',
1082
+ dropdownBoxShadow: '0 0 0 1px #333',
1083
+ scrollerStart: 'rgba(255, 255, 255, 1)',
1084
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
1085
+ shadowSmall: '0 0 0 1px #333',
1086
+ shadowMedium: '0 0 0 1px #333',
1087
+ shadowLarge: '0 0 0 1px #333',
1088
+ portalOpacity: 0.75
1089
+ };
1090
+ var font = defaultFont;
1091
+ var breakpoints = defaultBreakpoints;
1092
+ var layout = defaultLayout;
1093
+ var themes = {
1094
+ type: 'dark',
1095
+ font: font,
1096
+ layout: layout,
1097
+ palette: palette,
1098
+ breakpoints: breakpoints,
1099
+ expressiveness: expressiveness
1100
+ };
1101
+
1102
+ var isObject = function isObject(target) {
1103
+ return target && _typeof(target) === 'object';
1104
+ };
1105
+ var _deepDuplicable = function deepDuplicable(source, target) {
1106
+ if (!isObject(target) || !isObject(source)) return source;
1107
+ var sourceKeys = Object.keys(source);
1108
+ var result = {};
1109
+ for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
1110
+ var key = _sourceKeys[_i];
1111
+ var sourceValue = source[key];
1112
+ var targetValue = target[key];
1113
+ if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
1114
+ result[key] = targetValue.concat(sourceValue);
1115
+ } else if (isObject(sourceValue) && isObject(targetValue)) {
1116
+ result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
1117
+ } else if (targetValue) {
1118
+ result[key] = targetValue;
1119
+ } else {
1120
+ result[key] = sourceValue;
1121
+ }
1122
+ }
1123
+ return result;
1124
+ };
1125
+ var getPresets = function getPresets() {
1126
+ return [themes$1, themes];
1127
+ };
1128
+ var getPresetStaticTheme = function getPresetStaticTheme() {
1129
+ return themes$1;
1130
+ };
1131
+ var isAvailableThemeType = function isAvailableThemeType(type) {
1132
+ if (!type) return false;
1133
+ var presetThemes = getPresets();
1134
+ var hasType = presetThemes.find(function (theme) {
1135
+ return theme.type === type;
1136
+ });
1137
+ return !hasType;
1138
+ };
1139
+ var isPresetTheme = function isPresetTheme(themeOrType) {
1140
+ if (!themeOrType) return false;
1141
+ var isType = typeof themeOrType === 'string';
1142
+ var type = isType ? themeOrType : themeOrType.type;
1143
+ return !isAvailableThemeType(type);
1144
+ };
1145
+ var hasUserCustomTheme = function hasUserCustomTheme() {
1146
+ var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1147
+ return !!themes.find(function (item) {
1148
+ return isAvailableThemeType(item.type);
1149
+ });
1150
+ };
1151
+ var create = function create(base, custom) {
1152
+ if (!isAvailableThemeType(custom.type)) {
1153
+ throw new Error('Duplicate or unavailable theme type');
1154
+ }
1155
+ return _deepDuplicable(base, custom);
1156
+ };
1157
+ var createFromDark = function createFromDark(custom) {
1158
+ return create(themes, custom);
1159
+ };
1160
+ var createFromLight = function createFromLight(custom) {
1161
+ return create(themes$1, custom);
1162
+ };
1163
+ var Themes = {
1164
+ isPresetTheme: isPresetTheme,
1165
+ isAvailableThemeType: isAvailableThemeType,
1166
+ hasUserCustomTheme: hasUserCustomTheme,
1167
+ getPresets: getPresets,
1168
+ getPresetStaticTheme: getPresetStaticTheme,
1169
+ create: create,
1170
+ createFromDark: createFromDark,
1171
+ createFromLight: createFromLight
1172
+ };
1173
+
1174
+ /* "use client" */
1175
+
1176
+ var defaultTheme = Themes.getPresetStaticTheme();
1177
+ var ThemeContext = /*#__PURE__*/React$1.createContext(defaultTheme);
1178
+ var useTheme = function useTheme() {
1179
+ return React$1.useContext(ThemeContext);
1180
+ };
1181
+
1182
+ /* "use client" */
1183
+
1184
+ var defaultAllThemesConfig = {
1185
+ themes: Themes.getPresets()
1186
+ };
1187
+ var AllThemesContext = /*#__PURE__*/React$1.createContext(defaultAllThemesConfig);
1188
+ var useAllThemes = function useAllThemes() {
1189
+ return React$1.useContext(AllThemesContext);
1190
+ };
1191
+
1192
+ var ThemeProvider = function ThemeProvider(_ref) {
1193
+ var children = _ref.children,
1194
+ themeType = _ref.themeType,
1195
+ _ref$themes = _ref.themes,
1196
+ themes = _ref$themes === void 0 ? [] : _ref$themes;
1197
+ var _React$useState = React$1.useState({
1198
+ themes: Themes.getPresets()
1199
+ }),
1200
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1201
+ allThemes = _React$useState2[0],
1202
+ setAllThemes = _React$useState2[1];
1203
+ var currentTheme = React$1.useMemo(function () {
1204
+ var theme = allThemes.themes.find(function (item) {
1205
+ return item.type === themeType;
1206
+ });
1207
+ if (theme) return theme;
1208
+ return Themes.getPresetStaticTheme();
1209
+ }, [allThemes, themeType]);
1210
+ React$1.useEffect(function () {
1211
+ if (!(themes !== null && themes !== void 0 && themes.length)) return;
1212
+ setAllThemes(function (last) {
1213
+ var safeThemes = themes.filter(function (item) {
1214
+ return Themes.isAvailableThemeType(item.type);
1215
+ });
1216
+ var nextThemes = Themes.getPresets().concat(safeThemes);
1217
+ return _objectSpread2(_objectSpread2({}, last), {}, {
1218
+ themes: nextThemes
1219
+ });
1220
+ });
1221
+ }, [themes]);
1222
+ return /*#__PURE__*/React$1.createElement(AllThemesContext.Provider, {
1223
+ value: allThemes
1224
+ }, /*#__PURE__*/React$1.createElement(ThemeContext.Provider, {
1225
+ value: currentTheme
1226
+ }, children));
1227
+ };
1228
+
1229
+ var useCurrentState = function useCurrentState(initialState) {
1230
+ var _useState = React$1.useState(function () {
1231
+ return typeof initialState === 'function' ? initialState() : initialState;
1232
+ }),
1233
+ _useState2 = _slicedToArray(_useState, 2),
1234
+ state = _useState2[0],
1235
+ setState = _useState2[1];
1236
+ var ref = React$1.useRef(initialState);
1237
+ React$1.useEffect(function () {
1238
+ ref.current = state;
1239
+ }, [state]);
1240
+ var setValue = function setValue(val) {
1241
+ var result = typeof val === 'function' ? val(ref.current) : val;
1242
+ ref.current = result;
1243
+ setState(result);
1244
+ };
1245
+ return [state, setValue, ref];
1246
+ };
1247
+
1248
+ function getDefaultExportFromCjs (x) {
1249
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1250
+ }
1251
+
1252
+ var index = {};
1253
+
1254
+ var hasRequiredIndex;
1255
+
1256
+ function requireIndex () {
1257
+ if (hasRequiredIndex) return index;
1258
+ hasRequiredIndex = 1;
1259
+ var React$1$1 = React$1;
1260
+
1261
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
1262
+
1263
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1$1);
1264
+
1265
+ /*
1266
+ Based on Glamor's sheet
1267
+ https://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js
1268
+ */ function _defineProperties(target, props) {
1269
+ for(var i = 0; i < props.length; i++){
1270
+ var descriptor = props[i];
1271
+ descriptor.enumerable = descriptor.enumerable || false;
1272
+ descriptor.configurable = true;
1273
+ if ("value" in descriptor) descriptor.writable = true;
1274
+ Object.defineProperty(target, descriptor.key, descriptor);
1275
+ }
1276
+ }
1277
+ function _createClass(Constructor, protoProps, staticProps) {
1278
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1279
+ return Constructor;
1280
+ }
1281
+ var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
1282
+ var isString = function(o) {
1283
+ return Object.prototype.toString.call(o) === "[object String]";
1284
+ };
1285
+ var StyleSheet = /*#__PURE__*/ function() {
1286
+ function StyleSheet(param) {
1287
+ var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
1288
+ invariant$1(isString(name), "`name` must be a string");
1289
+ this._name = name;
1290
+ this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
1291
+ invariant$1(typeof optimizeForSpeed === "boolean", "`optimizeForSpeed` must be a boolean");
1292
+ this._optimizeForSpeed = optimizeForSpeed;
1293
+ this._serverSheet = undefined;
1294
+ this._tags = [];
1295
+ this._injected = false;
1296
+ this._rulesCount = 0;
1297
+ var node = typeof window !== "undefined" && document.querySelector('meta[property="csp-nonce"]');
1298
+ this._nonce = node ? node.getAttribute("content") : null;
1299
+ }
1300
+ var _proto = StyleSheet.prototype;
1301
+ _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {
1302
+ invariant$1(typeof bool === "boolean", "`setOptimizeForSpeed` accepts a boolean");
1303
+ invariant$1(this._rulesCount === 0, "optimizeForSpeed cannot be when rules have already been inserted");
1304
+ this.flush();
1305
+ this._optimizeForSpeed = bool;
1306
+ this.inject();
1307
+ };
1308
+ _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {
1309
+ return this._optimizeForSpeed;
1310
+ };
1311
+ _proto.inject = function inject() {
1312
+ var _this = this;
1313
+ invariant$1(!this._injected, "sheet already injected");
1314
+ this._injected = true;
1315
+ if (typeof window !== "undefined" && this._optimizeForSpeed) {
1316
+ this._tags[0] = this.makeStyleTag(this._name);
1317
+ this._optimizeForSpeed = "insertRule" in this.getSheet();
1318
+ if (!this._optimizeForSpeed) {
1319
+ if (!isProd) {
1320
+ console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.");
1321
+ }
1322
+ this.flush();
1323
+ this._injected = true;
1324
+ }
1325
+ return;
1326
+ }
1327
+ this._serverSheet = {
1328
+ cssRules: [],
1329
+ insertRule: function(rule, index) {
1330
+ if (typeof index === "number") {
1331
+ _this._serverSheet.cssRules[index] = {
1332
+ cssText: rule
1333
+ };
1334
+ } else {
1335
+ _this._serverSheet.cssRules.push({
1336
+ cssText: rule
1337
+ });
1338
+ }
1339
+ return index;
1340
+ },
1341
+ deleteRule: function(index) {
1342
+ _this._serverSheet.cssRules[index] = null;
1343
+ }
1344
+ };
1345
+ };
1346
+ _proto.getSheetForTag = function getSheetForTag(tag) {
1347
+ if (tag.sheet) {
1348
+ return tag.sheet;
1349
+ }
1350
+ // this weirdness brought to you by firefox
1351
+ for(var i = 0; i < document.styleSheets.length; i++){
1352
+ if (document.styleSheets[i].ownerNode === tag) {
1353
+ return document.styleSheets[i];
1354
+ }
1355
+ }
1356
+ };
1357
+ _proto.getSheet = function getSheet() {
1358
+ return this.getSheetForTag(this._tags[this._tags.length - 1]);
1359
+ };
1360
+ _proto.insertRule = function insertRule(rule, index) {
1361
+ invariant$1(isString(rule), "`insertRule` accepts only strings");
1362
+ if (typeof window === "undefined") {
1363
+ if (typeof index !== "number") {
1364
+ index = this._serverSheet.cssRules.length;
1365
+ }
1366
+ this._serverSheet.insertRule(rule, index);
1367
+ return this._rulesCount++;
1368
+ }
1369
+ if (this._optimizeForSpeed) {
1370
+ var sheet = this.getSheet();
1371
+ if (typeof index !== "number") {
1372
+ index = sheet.cssRules.length;
1373
+ }
1374
+ // this weirdness for perf, and chrome's weird bug
1375
+ // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule
1376
+ try {
1377
+ sheet.insertRule(rule, index);
1378
+ } catch (error) {
1379
+ if (!isProd) {
1380
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1381
+ }
1382
+ return -1;
1383
+ }
1384
+ } else {
1385
+ var insertionPoint = this._tags[index];
1386
+ this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));
1387
+ }
1388
+ return this._rulesCount++;
1389
+ };
1390
+ _proto.replaceRule = function replaceRule(index, rule) {
1391
+ if (this._optimizeForSpeed || typeof window === "undefined") {
1392
+ var sheet = typeof window !== "undefined" ? this.getSheet() : this._serverSheet;
1393
+ if (!rule.trim()) {
1394
+ rule = this._deletedRulePlaceholder;
1395
+ }
1396
+ if (!sheet.cssRules[index]) {
1397
+ // @TBD Should we throw an error?
1398
+ return index;
1399
+ }
1400
+ sheet.deleteRule(index);
1401
+ try {
1402
+ sheet.insertRule(rule, index);
1403
+ } catch (error) {
1404
+ if (!isProd) {
1405
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1406
+ }
1407
+ // In order to preserve the indices we insert a deleteRulePlaceholder
1408
+ sheet.insertRule(this._deletedRulePlaceholder, index);
1409
+ }
1410
+ } else {
1411
+ var tag = this._tags[index];
1412
+ invariant$1(tag, "old rule at index `" + index + "` not found");
1413
+ tag.textContent = rule;
1414
+ }
1415
+ return index;
1416
+ };
1417
+ _proto.deleteRule = function deleteRule(index) {
1418
+ if (typeof window === "undefined") {
1419
+ this._serverSheet.deleteRule(index);
1420
+ return;
1421
+ }
1422
+ if (this._optimizeForSpeed) {
1423
+ this.replaceRule(index, "");
1424
+ } else {
1425
+ var tag = this._tags[index];
1426
+ invariant$1(tag, "rule at index `" + index + "` not found");
1427
+ tag.parentNode.removeChild(tag);
1428
+ this._tags[index] = null;
1429
+ }
1430
+ };
1431
+ _proto.flush = function flush() {
1432
+ this._injected = false;
1433
+ this._rulesCount = 0;
1434
+ if (typeof window !== "undefined") {
1435
+ this._tags.forEach(function(tag) {
1436
+ return tag && tag.parentNode.removeChild(tag);
1437
+ });
1438
+ this._tags = [];
1439
+ } else {
1440
+ // simpler on server
1441
+ this._serverSheet.cssRules = [];
1442
+ }
1443
+ };
1444
+ _proto.cssRules = function cssRules() {
1445
+ var _this = this;
1446
+ if (typeof window === "undefined") {
1447
+ return this._serverSheet.cssRules;
1448
+ }
1449
+ return this._tags.reduce(function(rules, tag) {
1450
+ if (tag) {
1451
+ rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {
1452
+ return rule.cssText === _this._deletedRulePlaceholder ? null : rule;
1453
+ }));
1454
+ } else {
1455
+ rules.push(null);
1456
+ }
1457
+ return rules;
1458
+ }, []);
1459
+ };
1460
+ _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {
1461
+ if (cssString) {
1462
+ invariant$1(isString(cssString), "makeStyleTag accepts only strings as second parameter");
1463
+ }
1464
+ var tag = document.createElement("style");
1465
+ if (this._nonce) tag.setAttribute("nonce", this._nonce);
1466
+ tag.type = "text/css";
1467
+ tag.setAttribute("data-" + name, "");
1468
+ if (cssString) {
1469
+ tag.appendChild(document.createTextNode(cssString));
1470
+ }
1471
+ var head = document.head || document.getElementsByTagName("head")[0];
1472
+ if (relativeToTag) {
1473
+ head.insertBefore(tag, relativeToTag);
1474
+ } else {
1475
+ head.appendChild(tag);
1476
+ }
1477
+ return tag;
1478
+ };
1479
+ _createClass(StyleSheet, [
1480
+ {
1481
+ key: "length",
1482
+ get: function get() {
1483
+ return this._rulesCount;
1484
+ }
1485
+ }
1486
+ ]);
1487
+ return StyleSheet;
1488
+ }();
1489
+ function invariant$1(condition, message) {
1490
+ if (!condition) {
1491
+ throw new Error("StyleSheet: " + message + ".");
1492
+ }
1493
+ }
1494
+
1495
+ function hash(str) {
1496
+ var _$hash = 5381, i = str.length;
1497
+ while(i){
1498
+ _$hash = _$hash * 33 ^ str.charCodeAt(--i);
1499
+ }
1500
+ /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
1501
+ * integers. Since we want the results to be always positive, convert the
1502
+ * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
1503
+ }
1504
+ var stringHash = hash;
1505
+
1506
+ var sanitize = function(rule) {
1507
+ return rule.replace(/\/style/gi, "\\/style");
1508
+ };
1509
+ var cache = {};
1510
+ /**
1511
+ * computeId
1512
+ *
1513
+ * Compute and memoize a jsx id from a basedId and optionally props.
1514
+ */ function computeId(baseId, props) {
1515
+ if (!props) {
1516
+ return "jsx-" + baseId;
1517
+ }
1518
+ var propsToString = String(props);
1519
+ var key = baseId + propsToString;
1520
+ if (!cache[key]) {
1521
+ cache[key] = "jsx-" + stringHash(baseId + "-" + propsToString);
1522
+ }
1523
+ return cache[key];
1524
+ }
1525
+ /**
1526
+ * computeSelector
1527
+ *
1528
+ * Compute and memoize dynamic selectors.
1529
+ */ function computeSelector(id, css) {
1530
+ var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;
1531
+ // Sanitize SSR-ed CSS.
1532
+ // Client side code doesn't need to be sanitized since we use
1533
+ // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).
1534
+ if (typeof window === "undefined") {
1535
+ css = sanitize(css);
1536
+ }
1537
+ var idcss = id + css;
1538
+ if (!cache[idcss]) {
1539
+ cache[idcss] = css.replace(selectoPlaceholderRegexp, id);
1540
+ }
1541
+ return cache[idcss];
1542
+ }
1543
+
1544
+ function mapRulesToStyle(cssRules, options) {
1545
+ if (options === void 0) options = {};
1546
+ return cssRules.map(function(args) {
1547
+ var id = args[0];
1548
+ var css = args[1];
1549
+ return /*#__PURE__*/ React__default["default"].createElement("style", {
1550
+ id: "__" + id,
1551
+ // Avoid warnings upon render with a key
1552
+ key: "__" + id,
1553
+ nonce: options.nonce ? options.nonce : undefined,
1554
+ dangerouslySetInnerHTML: {
1555
+ __html: css
1556
+ }
1557
+ });
1558
+ });
1559
+ }
1560
+ var StyleSheetRegistry = /*#__PURE__*/ function() {
1561
+ function StyleSheetRegistry(param) {
1562
+ var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
1563
+ this._sheet = styleSheet || new StyleSheet({
1564
+ name: "styled-jsx",
1565
+ optimizeForSpeed: optimizeForSpeed
1566
+ });
1567
+ this._sheet.inject();
1568
+ if (styleSheet && typeof optimizeForSpeed === "boolean") {
1569
+ this._sheet.setOptimizeForSpeed(optimizeForSpeed);
1570
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1571
+ }
1572
+ this._fromServer = undefined;
1573
+ this._indices = {};
1574
+ this._instancesCounts = {};
1575
+ }
1576
+ var _proto = StyleSheetRegistry.prototype;
1577
+ _proto.add = function add(props) {
1578
+ var _this = this;
1579
+ if (undefined === this._optimizeForSpeed) {
1580
+ this._optimizeForSpeed = Array.isArray(props.children);
1581
+ this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);
1582
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1583
+ }
1584
+ if (typeof window !== "undefined" && !this._fromServer) {
1585
+ this._fromServer = this.selectFromServer();
1586
+ this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {
1587
+ acc[tagName] = 0;
1588
+ return acc;
1589
+ }, {});
1590
+ }
1591
+ var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;
1592
+ // Deduping: just increase the instances count.
1593
+ if (styleId in this._instancesCounts) {
1594
+ this._instancesCounts[styleId] += 1;
1595
+ return;
1596
+ }
1597
+ var indices = rules.map(function(rule) {
1598
+ return _this._sheet.insertRule(rule);
1599
+ })// Filter out invalid rules
1600
+ .filter(function(index) {
1601
+ return index !== -1;
1602
+ });
1603
+ this._indices[styleId] = indices;
1604
+ this._instancesCounts[styleId] = 1;
1605
+ };
1606
+ _proto.remove = function remove(props) {
1607
+ var _this = this;
1608
+ var styleId = this.getIdAndRules(props).styleId;
1609
+ invariant(styleId in this._instancesCounts, "styleId: `" + styleId + "` not found");
1610
+ this._instancesCounts[styleId] -= 1;
1611
+ if (this._instancesCounts[styleId] < 1) {
1612
+ var tagFromServer = this._fromServer && this._fromServer[styleId];
1613
+ if (tagFromServer) {
1614
+ tagFromServer.parentNode.removeChild(tagFromServer);
1615
+ delete this._fromServer[styleId];
1616
+ } else {
1617
+ this._indices[styleId].forEach(function(index) {
1618
+ return _this._sheet.deleteRule(index);
1619
+ });
1620
+ delete this._indices[styleId];
1621
+ }
1622
+ delete this._instancesCounts[styleId];
1623
+ }
1624
+ };
1625
+ _proto.update = function update(props, nextProps) {
1626
+ this.add(nextProps);
1627
+ this.remove(props);
1628
+ };
1629
+ _proto.flush = function flush() {
1630
+ this._sheet.flush();
1631
+ this._sheet.inject();
1632
+ this._fromServer = undefined;
1633
+ this._indices = {};
1634
+ this._instancesCounts = {};
1635
+ };
1636
+ _proto.cssRules = function cssRules() {
1637
+ var _this = this;
1638
+ var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {
1639
+ return [
1640
+ styleId,
1641
+ _this._fromServer[styleId]
1642
+ ];
1643
+ }) : [];
1644
+ var cssRules = this._sheet.cssRules();
1645
+ return fromServer.concat(Object.keys(this._indices).map(function(styleId) {
1646
+ return [
1647
+ styleId,
1648
+ _this._indices[styleId].map(function(index) {
1649
+ return cssRules[index].cssText;
1650
+ }).join(_this._optimizeForSpeed ? "" : "\n")
1651
+ ];
1652
+ })// filter out empty rules
1653
+ .filter(function(rule) {
1654
+ return Boolean(rule[1]);
1655
+ }));
1656
+ };
1657
+ _proto.styles = function styles(options) {
1658
+ return mapRulesToStyle(this.cssRules(), options);
1659
+ };
1660
+ _proto.getIdAndRules = function getIdAndRules(props) {
1661
+ var css = props.children, dynamic = props.dynamic, id = props.id;
1662
+ if (dynamic) {
1663
+ var styleId = computeId(id, dynamic);
1664
+ return {
1665
+ styleId: styleId,
1666
+ rules: Array.isArray(css) ? css.map(function(rule) {
1667
+ return computeSelector(styleId, rule);
1668
+ }) : [
1669
+ computeSelector(styleId, css)
1670
+ ]
1671
+ };
1672
+ }
1673
+ return {
1674
+ styleId: computeId(id),
1675
+ rules: Array.isArray(css) ? css : [
1676
+ css
1677
+ ]
1678
+ };
1679
+ };
1680
+ /**
1681
+ * selectFromServer
1682
+ *
1683
+ * Collects style tags from the document with id __jsx-XXX
1684
+ */ _proto.selectFromServer = function selectFromServer() {
1685
+ var elements = Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));
1686
+ return elements.reduce(function(acc, element) {
1687
+ var id = element.id.slice(2);
1688
+ acc[id] = element;
1689
+ return acc;
1690
+ }, {});
1691
+ };
1692
+ return StyleSheetRegistry;
1693
+ }();
1694
+ function invariant(condition, message) {
1695
+ if (!condition) {
1696
+ throw new Error("StyleSheetRegistry: " + message + ".");
1697
+ }
1698
+ }
1699
+ var StyleSheetContext = /*#__PURE__*/ React$1$1.createContext(null);
1700
+ StyleSheetContext.displayName = "StyleSheetContext";
1701
+ function createStyleRegistry() {
1702
+ return new StyleSheetRegistry();
1703
+ }
1704
+ function StyleRegistry(param) {
1705
+ var configuredRegistry = param.registry, children = param.children;
1706
+ var rootRegistry = React$1$1.useContext(StyleSheetContext);
1707
+ var ref = React$1$1.useState(function() {
1708
+ return rootRegistry || configuredRegistry || createStyleRegistry();
1709
+ }), registry = ref[0];
1710
+ return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
1711
+ value: registry
1712
+ }, children);
1713
+ }
1714
+ function useStyleRegistry() {
1715
+ return React$1$1.useContext(StyleSheetContext);
1716
+ }
1717
+
1718
+ // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
1719
+ // https://github.com/reactwg/react-18/discussions/110
1720
+ var useInsertionEffect = React__default["default"].useInsertionEffect || React$1$1.useLayoutEffect;
1721
+ var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
1722
+ function JSXStyle(props) {
1723
+ var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
1724
+ var insertionEffectCalled = React$1$1.useRef(false);
1725
+ // `registry` might not exist while server-side rendering
1726
+ if (!registry) {
1727
+ return null;
1728
+ }
1729
+ if (typeof window === "undefined") {
1730
+ registry.add(props);
1731
+ return null;
1732
+ }
1733
+ useInsertionEffect(function() {
1734
+ // ReactDOM removes all DOM during hydration in certain cases
1735
+ if (!document.head) {
1736
+ return;
1737
+ }
1738
+ registry.add(props);
1739
+ insertionEffectCalled.current = true;
1740
+ return function() {
1741
+ insertionEffectCalled.current = false;
1742
+ registry.remove(props);
1743
+ };
1744
+ }, [
1745
+ props.id,
1746
+ String(props.dynamic)
1747
+ ]);
1748
+ React$1$1.useLayoutEffect(function() {
1749
+ if (!document.head || insertionEffectCalled.current) {
1750
+ return;
1751
+ }
1752
+ registry.add(props);
1753
+ return function() {
1754
+ registry.remove(props);
1755
+ };
1756
+ // props.children can be string[], will be striped since id is identical
1757
+ }, [
1758
+ props.id,
1759
+ String(props.dynamic)
1760
+ ]);
1761
+ return null;
1762
+ }
1763
+ JSXStyle.dynamic = function(info) {
1764
+ return info.map(function(tagInfo) {
1765
+ var baseId = tagInfo[0];
1766
+ var props = tagInfo[1];
1767
+ return computeId(baseId, props);
1768
+ }).join(" ");
1769
+ };
1770
+
1771
+ index.StyleRegistry = StyleRegistry;
1772
+ index.createStyleRegistry = createStyleRegistry;
1773
+ index.style = JSXStyle;
1774
+ index.useStyleRegistry = useStyleRegistry;
1775
+ return index;
1776
+ }
1777
+
1778
+ var style;
1779
+ var hasRequiredStyle;
1780
+
1781
+ function requireStyle () {
1782
+ if (hasRequiredStyle) return style;
1783
+ hasRequiredStyle = 1;
1784
+ style = requireIndex().style;
1785
+ return style;
1786
+ }
1787
+
1788
+ var styleExports = requireStyle();
1789
+ var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
1790
+
1791
+ /* "use client" */
1792
+
1793
+ var getId = function getId() {
1794
+ return Math.random().toString(32).slice(2, 10);
1795
+ };
1796
+ var isBrowser = function isBrowser() {
1797
+ return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1798
+ };
1799
+
1800
+ var useSSR = function useSSR() {
1801
+ var _useState = React$1.useState(false),
1802
+ _useState2 = _slicedToArray(_useState, 2),
1803
+ browser = _useState2[0],
1804
+ setBrowser = _useState2[1];
1805
+ React$1.useEffect(function () {
1806
+ setBrowser(isBrowser());
1807
+ }, []);
1808
+ return {
1809
+ isBrowser: browser,
1810
+ isServer: !browser
1811
+ };
1812
+ };
1813
+
1814
+ var createElement = function createElement(id) {
1815
+ var el = document.createElement('div');
1816
+ el.setAttribute('id', id);
1817
+ return el;
1818
+ };
1819
+ var usePortal = function usePortal() {
1820
+ var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
1821
+ var getContainer = arguments.length > 1 ? arguments[1] : undefined;
1822
+ var id = "helpdice-ui-".concat(selectId);
1823
+ var _useSSR = useSSR(),
1824
+ isBrowser = _useSSR.isBrowser;
1825
+ var _useState = React$1.useState(isBrowser ? createElement(id) : null),
1826
+ _useState2 = _slicedToArray(_useState, 2),
1827
+ elSnapshot = _useState2[0],
1828
+ setElSnapshot = _useState2[1];
1829
+ React$1.useEffect(function () {
1830
+ var customContainer = getContainer ? getContainer() : null;
1831
+ var parentElement = customContainer || document.body;
1832
+ var hasElement = parentElement.querySelector("#".concat(id));
1833
+ var el = hasElement || createElement(id);
1834
+ if (!hasElement) {
1835
+ parentElement.appendChild(el);
1836
+ }
1837
+ setElSnapshot(el);
1838
+ }, []);
1839
+ return elSnapshot;
1840
+ };
1841
+
1842
+ var _excluded$2 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1843
+ var CssTransition = function CssTransition(_ref) {
1844
+ var children = _ref.children,
1845
+ _ref$className = _ref.className,
1846
+ className = _ref$className === void 0 ? '' : _ref$className,
1847
+ _ref$visible = _ref.visible,
1848
+ visible = _ref$visible === void 0 ? false : _ref$visible,
1849
+ _ref$enterTime = _ref.enterTime,
1850
+ enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1851
+ _ref$leaveTime = _ref.leaveTime,
1852
+ leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1853
+ _ref$clearTime = _ref.clearTime,
1854
+ clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1855
+ _ref$name = _ref.name,
1856
+ name = _ref$name === void 0 ? 'transition' : _ref$name,
1857
+ props = _objectWithoutProperties(_ref, _excluded$2);
1858
+ var _useState = React$1.useState(''),
1859
+ _useState2 = _slicedToArray(_useState, 2),
1860
+ classes = _useState2[0],
1861
+ setClasses = _useState2[1];
1862
+ var _useState3 = React$1.useState(visible),
1863
+ _useState4 = _slicedToArray(_useState3, 2),
1864
+ renderable = _useState4[0],
1865
+ setRenderable = _useState4[1];
1866
+ React$1.useEffect(function () {
1867
+ var statusClassName = visible ? 'enter' : 'leave';
1868
+ var time = visible ? enterTime : leaveTime;
1869
+ if (visible && !renderable) {
1870
+ setRenderable(true);
1871
+ }
1872
+ setClasses("".concat(name, "-").concat(statusClassName));
1873
+
1874
+ // set class to active
1875
+ var timer = setTimeout(function () {
1876
+ setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1877
+ clearTimeout(timer);
1878
+ }, time);
1879
+
1880
+ // remove classess when animation over
1881
+ var clearClassesTimer = setTimeout(function () {
1882
+ if (!visible) {
1883
+ setClasses('');
1884
+ setRenderable(false);
1885
+ }
1886
+ clearTimeout(clearClassesTimer);
1887
+ }, time + clearTime);
1888
+ return function () {
1889
+ clearTimeout(timer);
1890
+ clearTimeout(clearClassesTimer);
1891
+ };
1892
+ }, [visible, renderable]);
1893
+ if (! /*#__PURE__*/React$1.isValidElement(children) || !renderable) return null;
1894
+ var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1895
+ className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1896
+ });
1897
+ return /*#__PURE__*/React$1.cloneElement(children, propsTransition);
1898
+ };
1899
+ CssTransition.displayName = 'CssTransition';
1900
+
1901
+ var tuple = function tuple() {
1902
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1903
+ args[_key] = arguments[_key];
1904
+ }
1905
+ return args;
1906
+ };
1907
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
1908
+ tuple('default', 'secondary', 'success', 'warning', 'error');
1909
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
1910
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
1911
+ tuple('default', 'silent', 'prevent');
1912
+ tuple('hover', 'click');
1913
+ tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1914
+ tuple('start', 'center', 'end', 'left', 'right');
1915
+
1916
+ var makeToastActions = function makeToastActions(actions, cancelHandle) {
1917
+ var handler = function handler(event, userHandler) {
1918
+ userHandler && userHandler(event, cancelHandle);
1919
+ };
1920
+ if (!actions || !actions.length) return null;
1921
+ return actions.map(function (action, index) {
1922
+ return /*#__PURE__*/React$1.createElement("button", {
1923
+ color: action.passive ? 'default' : 'secondary',
1924
+ key: "action-".concat(index),
1925
+ onClick: function onClick(event) {
1926
+ return handler(event, action.handler);
1927
+ }
1928
+ }, action.name);
1929
+ });
1930
+ };
1931
+ var getColors = function getColors(palette, type) {
1932
+ var colors = {
1933
+ "default": palette.background,
1934
+ secondary: palette.secondary,
1935
+ success: palette.success,
1936
+ warning: palette.warning,
1937
+ error: palette.error
1938
+ };
1939
+ var isDefault = !type || type === 'default';
1940
+ if (isDefault) return {
1941
+ bgColor: colors["default"],
1942
+ color: palette.foreground
1943
+ };
1944
+ /**
1945
+ * Prevent main color change in special types.
1946
+ * The color will only follow the theme when it is in the default type.
1947
+ */
1948
+ return {
1949
+ bgColor: colors[type],
1950
+ color: 'white'
1951
+ };
1952
+ };
1953
+ tuple('topLeft', 'topRight', 'bottomLeft', 'bottomRight');
1954
+ var isTopPlacement = function isTopPlacement(placement) {
1955
+ return "".concat(placement).toLowerCase().startsWith('top');
1956
+ };
1957
+ var isLeftPlacement = function isLeftPlacement(placement) {
1958
+ return "".concat(placement).toLowerCase().endsWith('left');
1959
+ };
1960
+ var getTranslateByPlacement = function getTranslateByPlacement(placement) {
1961
+ var translateInByPlacement = {
1962
+ topLeft: 'translate(-60px, -60px)',
1963
+ topRight: 'translate(60px, -60px)',
1964
+ bottomLeft: 'translate(-60px, 60px)',
1965
+ bottomRight: 'translate(60px, 60px)'
1966
+ };
1967
+ var translateOutByPlacement = {
1968
+ topLeft: 'translate(-50px, 15px) scale(0.85)',
1969
+ topRight: 'translate(50px, 15px) scale(0.85)',
1970
+ bottomLeft: 'translate(-50px, -15px) scale(0.85)',
1971
+ bottomRight: 'translate(50px, -15px) scale(0.85)'
1972
+ };
1973
+ return {
1974
+ enter: translateInByPlacement[placement],
1975
+ leave: translateOutByPlacement[placement]
1976
+ };
1977
+ };
1978
+
1979
+ var ToastItem = /*#__PURE__*/React$1.memo(function (_ref) {
1980
+ var toast = _ref.toast,
1981
+ layout = _ref.layout;
1982
+ var theme = useTheme();
1983
+ var _useMemo = React$1.useMemo(function () {
1984
+ return getColors(theme.palette, toast.type);
1985
+ }, [theme.palette, toast.type]),
1986
+ color = _useMemo.color,
1987
+ bgColor = _useMemo.bgColor;
1988
+ var isReactNode = typeof toast.text !== 'string';
1989
+ var padding = layout.padding,
1990
+ margin = layout.margin,
1991
+ maxHeight = layout.maxHeight,
1992
+ maxWidth = layout.maxWidth,
1993
+ width = layout.width,
1994
+ placement = layout.placement;
1995
+ var _useMemo2 = React$1.useMemo(function () {
1996
+ return getTranslateByPlacement(placement);
1997
+ }, [placement]),
1998
+ enter = _useMemo2.enter,
1999
+ leave = _useMemo2.leave;
2000
+ return /*#__PURE__*/React$1.createElement(CssTransition, {
2001
+ name: "toast",
2002
+ visible: toast.visible,
2003
+ clearTime: 350
2004
+ }, /*#__PURE__*/React$1.createElement("div", {
2005
+ key: toast.id,
2006
+ className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "toast"
2007
+ }, isReactNode ? toast.text : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
2008
+ className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "message"
2009
+ }, toast.text), /*#__PURE__*/React$1.createElement("div", {
2010
+ className: _JSXStyle.dynamic([["1407001838", [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]]]) + " " + "action"
2011
+ }, makeToastActions(toast.actions, toast.cancel))), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2012
+ id: "1407001838",
2013
+ dynamic: [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]
2014
+ }, ".toast.__jsx-style-dynamic-selector{width:".concat(width, ";max-width:").concat(maxWidth, ";max-height:").concat(maxHeight, ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(theme.palette.foreground, ";background-color:").concat(bgColor, ";color:").concat(color, ";border:0;border-radius:").concat(theme.layout.radius, ";opacity:1;box-shadow:").concat(theme.expressiveness.shadowSmall, ";-webkit-transition:all 350ms cubic-bezier(0.1,0.2,0.1,1);transition:all 350ms cubic-bezier(0.1,0.2,0.1,1);overflow:hidden;}.message.__jsx-style-dynamic-selector{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;font-size:0.875em;display:-webkit-box;word-break:break-all;padding-right:").concat(theme.layout.gapHalf, ";overflow:hidden;max-height:100%;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.1rem;}.toast-enter.__jsx-style-dynamic-selector{opacity:0;height:0;padding:0;margin:0;-webkit-transform:").concat(enter, ";-ms-transform:").concat(enter, ";transform:").concat(enter, ";}.toast-enter-active.__jsx-style-dynamic-selector{opacity:1;height:auto;margin:").concat(margin, ";padding:").concat(padding, ";-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0);}.toast-leave.__jsx-style-dynamic-selector{opacity:1;-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0);height:auto;margin:").concat(margin, ";padding:").concat(padding, ";}.toast-leave-active.__jsx-style-dynamic-selector{opacity:0;-webkit-transform:").concat(leave, ";-ms-transform:").concat(leave, ";transform:").concat(leave, ";}"))));
2015
+ });
2016
+
2017
+ /* "use client" */
2018
+
2019
+ var classObjectToString = function classObjectToString(className) {
2020
+ var keys = Object.keys(className);
2021
+ var len = keys.length;
2022
+ var str = '';
2023
+ for (var index = 0; index < len; index++) {
2024
+ var key = keys[index];
2025
+ var val = className[keys[index]];
2026
+ if (!val) continue;
2027
+ str = str ? "".concat(str, " ").concat(String(key)) : String(key);
2028
+ }
2029
+ return str;
2030
+ };
2031
+ var isObjectClassName = function isObjectClassName(value) {
2032
+ return _typeof(value) === 'object' && !Array.isArray(value);
2033
+ };
2034
+ var useClasses = function useClasses() {
2035
+ var len = arguments.length;
2036
+ var classes = '';
2037
+ if (len === 0) return classes;
2038
+ for (var index = 0; index < len; index++) {
2039
+ var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
2040
+ if (!val) continue;
2041
+ if (isObjectClassName(val)) {
2042
+ classes += " ".concat(classObjectToString(val));
2043
+ } else {
2044
+ classes += " ".concat(String(val).trim());
2045
+ }
2046
+ }
2047
+ return classes.trim();
2048
+ };
2049
+
2050
+ var ToastContainer = function ToastContainer() {
2051
+ var theme = useTheme();
2052
+ var portal = usePortal('toast');
2053
+ var _useCurrentState = useCurrentState(false),
2054
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2055
+ setHovering = _useCurrentState2[1],
2056
+ hoveringRef = _useCurrentState2[2];
2057
+ var _useHUIContext = useHUIContext(),
2058
+ toasts = _useHUIContext.toasts,
2059
+ updateToasts = _useHUIContext.updateToasts,
2060
+ toastLayout = _useHUIContext.toastLayout,
2061
+ lastUpdateToastId = _useHUIContext.lastUpdateToastId;
2062
+ var memoizedLayout = React$1.useMemo(function () {
2063
+ return toastLayout;
2064
+ }, [toastLayout]);
2065
+ var toastElements = React$1.useMemo(function () {
2066
+ return toasts.map(function (toast) {
2067
+ return /*#__PURE__*/React$1.createElement(ToastItem, {
2068
+ toast: toast,
2069
+ layout: memoizedLayout,
2070
+ key: toast._internalIdent
2071
+ });
2072
+ });
2073
+ }, [toasts, memoizedLayout]);
2074
+ var classNames = React$1.useMemo(function () {
2075
+ return useClasses('toasts', {
2076
+ top: isTopPlacement(toastLayout.placement),
2077
+ left: isLeftPlacement(toastLayout.placement)
2078
+ });
2079
+ }, [memoizedLayout]);
2080
+ var hoverHandler = function hoverHandler(isHovering) {
2081
+ setHovering(isHovering);
2082
+ if (isHovering) {
2083
+ return updateToasts(function (last) {
2084
+ return last.map(function (toast) {
2085
+ if (!toast.visible) return toast;
2086
+ toast._timeout && window.clearTimeout(toast._timeout);
2087
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2088
+ timeout: null
2089
+ });
2090
+ });
2091
+ });
2092
+ }
2093
+ updateToasts(function (last) {
2094
+ return last.map(function (toast, index) {
2095
+ if (!toast.visible) return toast;
2096
+ toast._timeout && window.clearTimeout(toast._timeout);
2097
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2098
+ _timeout: function () {
2099
+ var timer = window.setTimeout(function () {
2100
+ toast.cancel();
2101
+ window.clearTimeout(timer);
2102
+ }, toast.delay + index * 100);
2103
+ return timer;
2104
+ }()
2105
+ });
2106
+ });
2107
+ });
2108
+ };
2109
+ React$1.useEffect(function () {
2110
+ var index = toasts.findIndex(function (r) {
2111
+ return r._internalIdent === lastUpdateToastId;
2112
+ });
2113
+ var toast = toasts[index];
2114
+ if (!toast || toast.visible || !hoveringRef.current) return;
2115
+ var hasVisible = toasts.find(function (r, i) {
2116
+ return i < index && r.visible;
2117
+ });
2118
+ if (hasVisible || !hoveringRef.current) return;
2119
+ hoverHandler(false);
2120
+ }, [toasts, lastUpdateToastId]);
2121
+ React$1.useEffect(function () {
2122
+ var timeout = null;
2123
+ var timer = window.setInterval(function () {
2124
+ if (toasts.length === 0) return;
2125
+ timeout = window.setTimeout(function () {
2126
+ var allInvisible = !toasts.find(function (r) {
2127
+ return r.visible;
2128
+ });
2129
+ allInvisible && updateToasts(function () {
2130
+ return [];
2131
+ });
2132
+ timeout && clearTimeout(timeout);
2133
+ }, 350);
2134
+ }, 5000);
2135
+ return function () {
2136
+ timer && clearInterval(timer);
2137
+ timeout && clearTimeout(timeout);
2138
+ };
2139
+ }, [toasts]);
2140
+ if (!portal) return null;
2141
+ if (!toasts || toasts.length === 0) return null;
2142
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement("div", {
2143
+ onMouseEnter: function onMouseEnter() {
2144
+ return hoverHandler(true);
2145
+ },
2146
+ onMouseLeave: function onMouseLeave() {
2147
+ return hoverHandler(false);
2148
+ },
2149
+ className: _JSXStyle.dynamic([["622610754", [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]]]) + " " + (classNames || "")
2150
+ }, toastElements, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2151
+ id: "622610754",
2152
+ dynamic: [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]
2153
+ }, ".toasts.__jsx-style-dynamic-selector{position:fixed;width:auto;max-width:100%;right:".concat(theme.layout.gap, ";bottom:").concat(theme.layout.gap, ";z-index:2000;-webkit-transition:all 400ms ease;transition:all 400ms ease;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.top.__jsx-style-dynamic-selector{bottom:unset;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;top:").concat(theme.layout.gap, ";}.left.__jsx-style-dynamic-selector{right:unset;left:").concat(theme.layout.gap, ";}"))), portal);
2154
+ };
2155
+
2156
+ var HuiProvider = function HuiProvider(_ref) {
2157
+ var themes = _ref.themes,
2158
+ themeType = _ref.themeType,
2159
+ children = _ref.children;
2160
+ var _React$useState = React$1.useState(''),
2161
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2162
+ lastUpdateToastId = _React$useState2[0],
2163
+ setLastUpdateToastId = _React$useState2[1];
2164
+ var _useCurrentState = useCurrentState([]),
2165
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2166
+ toasts = _useCurrentState2[0],
2167
+ setToasts = _useCurrentState2[1],
2168
+ toastsRef = _useCurrentState2[2];
2169
+ var _useCurrentState3 = useCurrentState(defaultToastLayout),
2170
+ _useCurrentState4 = _slicedToArray(_useCurrentState3, 3),
2171
+ toastLayout = _useCurrentState4[0],
2172
+ setToastLayout = _useCurrentState4[1],
2173
+ toastLayoutRef = _useCurrentState4[2];
2174
+ var updateToasts = function updateToasts(fn) {
2175
+ var nextToasts = fn(toastsRef.current);
2176
+ setToasts(nextToasts);
2177
+ };
2178
+ var updateToastLayout = function updateToastLayout(fn) {
2179
+ var nextLayout = fn(toastLayoutRef.current);
2180
+ setToastLayout(nextLayout);
2181
+ };
2182
+ var updateLastToastId = function updateLastToastId(fn) {
2183
+ setLastUpdateToastId(fn());
2184
+ };
2185
+ var initialValue = React$1.useMemo(function () {
2186
+ return {
2187
+ toasts: toasts,
2188
+ toastLayout: toastLayout,
2189
+ updateToasts: updateToasts,
2190
+ lastUpdateToastId: lastUpdateToastId,
2191
+ updateToastLayout: updateToastLayout,
2192
+ updateLastToastId: updateLastToastId
2193
+ };
2194
+ }, [toasts, toastLayout, lastUpdateToastId]);
2195
+ return /*#__PURE__*/React$1.createElement(HUIContent.Provider, {
2196
+ value: initialValue
2197
+ }, /*#__PURE__*/React$1.createElement(ThemeProvider, {
2198
+ themes: themes,
2199
+ themeType: themeType
2200
+ }, children, /*#__PURE__*/React$1.createElement(ToastContainer, null)));
2201
+ };
2202
+
2203
+ // import flush from 'styled-jsx'
2204
+
2205
+ // export type FlushToReact = <T>(opts?: { nonce?: string }) => Array<ReactElement<T>>
2206
+
2207
+ // export type FlushToHTML = (opts?: { nonce?: string }) => string
2208
+
2209
+ var CssBaseline = function CssBaseline(_ref) {
2210
+ var children = _ref.children;
2211
+ var theme = useTheme();
2212
+ return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2213
+ id: "3647548829",
2214
+ dynamic: [theme.palette.background, theme.palette.foreground, theme.palette.background, theme.font.sans, theme.font.sans, theme.palette.link, theme.expressiveness.linkStyle, theme.expressiveness.linkHoverStyle, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gapHalf, theme.layout.gap, theme.palette.foreground, theme.palette.code, theme.font.mono, theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.palette.accents_2, theme.layout.radius, theme.font.mono, theme.palette.foreground, theme.palette.accents_2, theme.palette.accents_1, theme.layout.gap, theme.layout.gap, theme.palette.accents_5, theme.palette.accents_1, theme.layout.radius, theme.palette.border, theme.palette.selection, theme.palette.foreground]
2215
+ }, "html,body{background-color:".concat(theme.palette.background, ";color:").concat(theme.palette.foreground, ";}html{font-size:16px;--helpdice-icons-background:").concat(theme.palette.background, ";}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-size:1rem;line-height:1.5;margin:0;padding:0;min-height:100%;position:relative;overflow-x:hidden;font-family:").concat(theme.font.sans, ";}#__next{overflow-x:hidden;}*,*:before,*:after{box-sizing:inherit;text-rendering:geometricPrecision;-webkit-tap-highlight-color:transparent;}p,small{font-weight:400;color:inherit;-webkit-letter-spacing:-0.005625em;-moz-letter-spacing:-0.005625em;-ms-letter-spacing:-0.005625em;letter-spacing:-0.005625em;font-family:").concat(theme.font.sans, ";}p{margin:1em 0;font-size:1em;line-height:1.625em;}small{margin:0;line-height:1.5;font-size:0.875em;}b{font-weight:600;}span{font-size:inherit;color:inherit;font-weight:inherit;}img{max-width:100%;}a{cursor:pointer;font-size:inherit;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(theme.palette.link, ";-webkit-text-decoration:").concat(theme.expressiveness.linkStyle, ";text-decoration:").concat(theme.expressiveness.linkStyle, ";}a:hover{-webkit-text-decoration:").concat(theme.expressiveness.linkHoverStyle, ";text-decoration:").concat(theme.expressiveness.linkHoverStyle, ";}ul,ol{padding:0;list-style-type:none;margin:").concat(theme.layout.gapHalf, " ").concat(theme.layout.gapHalf, " ").concat(theme.layout.gapHalf, " ").concat(theme.layout.gap, ";color:").concat(theme.palette.foreground, ";}ol{list-style-type:decimal;}li{margin-bottom:0.625em;font-size:1em;line-height:1.625em;}h1,h2,h3,h4,h5,h6{color:inherit;margin:0 0 0.7rem 0;}h1{font-size:3rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;line-height:1.5;font-weight:700;}h2{font-size:2.25rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h3{font-size:1.5rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h4{font-size:1.25rem;-webkit-letter-spacing:-0.02em;-moz-letter-spacing:-0.02em;-ms-letter-spacing:-0.02em;letter-spacing:-0.02em;font-weight:600;}h5{font-size:1rem;-webkit-letter-spacing:-0.01em;-moz-letter-spacing:-0.01em;-ms-letter-spacing:-0.01em;letter-spacing:-0.01em;font-weight:600;}h6{font-size:0.875rem;-webkit-letter-spacing:-0.005em;-moz-letter-spacing:-0.005em;-ms-letter-spacing:-0.005em;letter-spacing:-0.005em;font-weight:600;}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;color:inherit;margin:0;}button:focus,input:focus,select:focus,textarea:focus{outline:none;}code{color:").concat(theme.palette.code, ";font-family:").concat(theme.font.mono, ";font-size:0.9em;white-space:pre-wrap;}code:before,code:after{content:'\\`';}pre{padding:calc(").concat(theme.layout.gap, " * 0.9) ").concat(theme.layout.gap, ";margin:").concat(theme.layout.gap, " 0;border:1px solid ").concat(theme.palette.accents_2, ";border-radius:").concat(theme.layout.radius, ";font-family:").concat(theme.font.mono, ";white-space:pre;overflow:auto;line-height:1.5;text-align:left;font-size:14px;-webkit-overflow-scrolling:touch;}pre code{color:").concat(theme.palette.foreground, ";font-size:1em;line-height:1.25em;white-space:pre;}pre code:before,pre code:after{display:none;}pre p{margin:0;}pre::-webkit-scrollbar{display:none;width:0;height:0;background:transparent;}hr{border-color:").concat(theme.palette.accents_2, ";}details{background-color:").concat(theme.palette.accents_1, ";border:none;}details:focus,details:hover,details:active{outline:none;}summary{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;outline:none;}summary::marker,summary::before,summary::-webkit-details-marker{display:none;}summary::-moz-list-bullet{font-size:0;}summary:focus,summary:hover,summary:active{outline:none;list-style:none;}blockquote{padding:calc(0.667 * ").concat(theme.layout.gap, ") ").concat(theme.layout.gap, ";color:").concat(theme.palette.accents_5, ";background-color:").concat(theme.palette.accents_1, ";border-radius:").concat(theme.layout.radius, ";margin:1.5em 0;border:1px solid ").concat(theme.palette.border, ";}blockquote *:first-child{margin-top:0;}blockquote *:last-child{margin-bottom:0;}::selection{background-color:").concat(theme.palette.selection, ";color:").concat(theme.palette.foreground, ";}")));
2216
+ };
2217
+ var MemoCssBaseline = /*#__PURE__*/React$1.memo(CssBaseline);
2218
+
2219
+ var getElementOffset = function getElementOffset(el) {
2220
+ if (!el) return {
2221
+ top: 0,
2222
+ left: 0
2223
+ };
2224
+ var _el$getBoundingClient = el.getBoundingClientRect(),
2225
+ top = _el$getBoundingClient.top,
2226
+ left = _el$getBoundingClient.left;
2227
+ return {
2228
+ top: top,
2229
+ left: left
2230
+ };
2231
+ };
2232
+ var defaultRect$1 = {
2233
+ top: -1e3,
2234
+ left: -1e3,
2235
+ right: -1e3,
2236
+ width: 0,
2237
+ height: 0,
2238
+ elementTop: -1e3
2239
+ };
2240
+ var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
2241
+ if (!domRect) return defaultRect$1;
2242
+ var container = getContainer ? getContainer() : null;
2243
+ var scrollElement = container || document.documentElement;
2244
+ var _getElementOffset = getElementOffset(container),
2245
+ offsetTop = _getElementOffset.top,
2246
+ offsetLeft = _getElementOffset.left;
2247
+ return _objectSpread2(_objectSpread2({}, domRect), {}, {
2248
+ width: domRect.width || domRect.right - domRect.left,
2249
+ height: domRect.height || domRect.top - domRect.bottom,
2250
+ top: domRect.bottom + scrollElement.scrollTop - offsetTop,
2251
+ left: domRect.left + scrollElement.scrollLeft - offsetLeft,
2252
+ elementTop: domRect.top + scrollElement.scrollTop - offsetTop
2253
+ });
2254
+ };
2255
+ var isUnplacedRect = function isUnplacedRect(rect) {
2256
+ if (!rect) return true;
2257
+ return rect.top === defaultRect$1.top && rect.left === defaultRect$1.left;
2258
+ };
2259
+ var getRefRect = function getRefRect(ref, getContainer) {
2260
+ if (!ref || !ref.current) return defaultRect$1;
2261
+ var rect = ref.current.getBoundingClientRect();
2262
+ return getRectFromDOMWithContainer(rect, getContainer);
2263
+ };
2264
+ var getEventRect = function getEventRect(event, getContainer) {
2265
+ var _event$target;
2266
+ var rect = event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getBoundingClientRect();
2267
+ if (!rect) return defaultRect$1;
2268
+ return getRectFromDOMWithContainer(rect, getContainer);
2269
+ };
2270
+ var isRefTarget = function isRefTarget(eventOrRef) {
2271
+ return typeof (eventOrRef === null || eventOrRef === void 0 ? void 0 : eventOrRef.target) === 'undefined';
2272
+ };
2273
+ var useRect = function useRect(initialState) {
2274
+ var _useState = React$1.useState(initialState || defaultRect$1),
2275
+ _useState2 = _slicedToArray(_useState, 2),
2276
+ rect = _useState2[0],
2277
+ setRect = _useState2[1];
2278
+ var updateRect = function updateRect(eventOrRef, getContainer) {
2279
+ if (isRefTarget(eventOrRef)) return setRect(getRefRect(eventOrRef, getContainer));
2280
+ setRect(getEventRect(eventOrRef, getContainer));
2281
+ };
2282
+ return {
2283
+ rect: rect,
2284
+ setRect: updateRect
2285
+ };
2286
+ };
2287
+
2288
+ var defaultToast = {
2289
+ delay: 2000,
2290
+ type: 'default'
2291
+ };
2292
+ var useToasts = function useToasts(layout) {
2293
+ var _useHUIContext = useHUIContext(),
2294
+ updateToasts = _useHUIContext.updateToasts,
2295
+ toasts = _useHUIContext.toasts,
2296
+ updateToastLayout = _useHUIContext.updateToastLayout,
2297
+ updateLastToastId = _useHUIContext.updateLastToastId;
2298
+ React$1.useEffect(function () {
2299
+ if (!layout) return;
2300
+ updateToastLayout(function () {
2301
+ return layout ? _objectSpread2(_objectSpread2({}, defaultToastLayout), layout) : defaultToastLayout;
2302
+ });
2303
+ }, []);
2304
+ var _cancel = function cancel(internalId) {
2305
+ updateToasts(function (currentToasts) {
2306
+ return currentToasts.map(function (item) {
2307
+ if (item._internalIdent !== internalId) return item;
2308
+ return _objectSpread2(_objectSpread2({}, item), {}, {
2309
+ visible: false
2310
+ });
2311
+ });
2312
+ });
2313
+ updateLastToastId(function () {
2314
+ return internalId;
2315
+ });
2316
+ };
2317
+ var removeAll = function removeAll() {
2318
+ updateToasts(function (last) {
2319
+ return last.map(function (toast) {
2320
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2321
+ visible: false
2322
+ });
2323
+ });
2324
+ });
2325
+ };
2326
+ var findToastOneByID = function findToastOneByID(id) {
2327
+ return toasts.find(function (t) {
2328
+ return t.id === id;
2329
+ });
2330
+ };
2331
+ var removeToastOneByID = function removeToastOneByID(id) {
2332
+ updateToasts(function (last) {
2333
+ return last.map(function (toast) {
2334
+ if (toast.id !== id) return toast;
2335
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2336
+ visible: false
2337
+ });
2338
+ });
2339
+ });
2340
+ };
2341
+ var setToast = function setToast(toast) {
2342
+ var internalIdent = "toast-".concat(getId());
2343
+ var delay = toast.delay || defaultToast.delay;
2344
+ if (toast.id) {
2345
+ var hasIdent = toasts.find(function (t) {
2346
+ return t.id === toast.id;
2347
+ });
2348
+ if (hasIdent) {
2349
+ throw new Error('Toast: Already have the same key: "ident"');
2350
+ }
2351
+ }
2352
+ updateToasts(function (last) {
2353
+ var newToast = {
2354
+ delay: delay,
2355
+ text: toast.text,
2356
+ visible: true,
2357
+ type: toast.type || defaultToast.type,
2358
+ id: toast.id || internalIdent,
2359
+ actions: toast.actions || [],
2360
+ _internalIdent: internalIdent,
2361
+ _timeout: window.setTimeout(function () {
2362
+ _cancel(internalIdent);
2363
+ if (newToast._timeout) {
2364
+ window.clearTimeout(newToast._timeout);
2365
+ newToast._timeout = null;
2366
+ }
2367
+ }, delay),
2368
+ cancel: function cancel() {
2369
+ return _cancel(internalIdent);
2370
+ }
2371
+ };
2372
+ return [].concat(_toConsumableArray(last), [newToast]);
2373
+ });
2374
+ };
2375
+ return {
2376
+ toasts: toasts,
2377
+ setToast: setToast,
2378
+ removeAll: removeAll,
2379
+ findToastOneByID: findToastOneByID,
2380
+ removeToastOneByID: removeToastOneByID
2381
+ };
2382
+ };
2383
+
2384
+ tuple('xs', 'sm', 'md', 'lg', 'xl', 'mobile');
2385
+ tuple('up', 'down', 'default');
2386
+ var defaultResponsiveOptions = {
2387
+ match: 'default'
2388
+ };
2389
+ var makeQueries = function makeQueries(bp, up, down) {
2390
+ var queryString = function queryString(item) {
2391
+ var upQuery = "(min-width: ".concat(item.min, ")");
2392
+ var downQuery = "(max-width: ".concat(item.max, ")");
2393
+ return up ? upQuery : down ? downQuery : "".concat(upQuery, " and ").concat(downQuery);
2394
+ };
2395
+ var xs = queryString(bp.xs);
2396
+ return {
2397
+ xs: xs,
2398
+ mobile: xs,
2399
+ sm: queryString(bp.sm),
2400
+ md: queryString(bp.md),
2401
+ lg: queryString(bp.lg),
2402
+ xl: queryString(bp.xl)
2403
+ };
2404
+ };
2405
+ var useMediaQuery = function useMediaQuery(breakpoint) {
2406
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultResponsiveOptions;
2407
+ var _options$match = options.match,
2408
+ matchType = _options$match === void 0 ? 'default' : _options$match,
2409
+ _options$ssrMatchMedi = options.ssrMatchMedia,
2410
+ ssrMatchMedia = _options$ssrMatchMedi === void 0 ? null : _options$ssrMatchMedi;
2411
+ var supportMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
2412
+ var theme = useTheme();
2413
+ var mediaQueries = React$1.useMemo(function () {
2414
+ var up = matchType === 'up';
2415
+ var down = matchType === 'down';
2416
+ return makeQueries(theme.breakpoints, up, down);
2417
+ }, [theme.breakpoints, options]);
2418
+ var query = React$1.useMemo(function () {
2419
+ return mediaQueries[breakpoint];
2420
+ }, [mediaQueries, breakpoint]);
2421
+ var matchQuery = function matchQuery(q) {
2422
+ return window.matchMedia(q);
2423
+ };
2424
+
2425
+ /**
2426
+ * Do nothing in the server-side rendering.
2427
+ * If server match query fucntion is simulated, return user-defined value first.
2428
+ */
2429
+ var _useState = React$1.useState(function () {
2430
+ if (supportMedia) return matchQuery(query).matches;
2431
+ if (ssrMatchMedia && typeof ssrMatchMedia === 'function') {
2432
+ return ssrMatchMedia(query).matches;
2433
+ }
2434
+ return false;
2435
+ }),
2436
+ _useState2 = _slicedToArray(_useState, 2),
2437
+ state = _useState2[0],
2438
+ setState = _useState2[1];
2439
+ React$1.useEffect(function () {
2440
+ if (!supportMedia) return;
2441
+ var queryList = matchQuery(query);
2442
+ var update = function update() {
2443
+ return setState(matchQuery(query).matches);
2444
+ };
2445
+ update();
2446
+
2447
+ /**
2448
+ * addListener is deprecated. EventTarget.addEventListener is recommended.
2449
+ * But in some old browsers, MediaQueryList does not inherit from EventTarget.
2450
+ */
2451
+ queryList.addListener(update);
2452
+ return function () {
2453
+ queryList.removeListener(update);
2454
+ };
2455
+ }, [supportMedia]);
2456
+ return state;
2457
+ };
2458
+
2459
+ /* "use client" */
2460
+
2461
+ var usePrevious = function usePrevious(state) {
2462
+ var ref = React$1.useRef(null);
2463
+ React$1.useEffect(function () {
2464
+ ref.current = state;
2465
+ });
2466
+ return ref ? ref.current : null;
2467
+ };
2468
+
2469
+ var _excluded$1 = ["rect", "visible", "hoverHeightRatio", "hoverWidthRatio", "activeOpacity", "className"];
2470
+ var Highlight = function Highlight(_ref) {
2471
+ var rect = _ref.rect,
2472
+ visible = _ref.visible,
2473
+ _ref$hoverHeightRatio = _ref.hoverHeightRatio,
2474
+ hoverHeightRatio = _ref$hoverHeightRatio === void 0 ? 1 : _ref$hoverHeightRatio,
2475
+ _ref$hoverWidthRatio = _ref.hoverWidthRatio,
2476
+ hoverWidthRatio = _ref$hoverWidthRatio === void 0 ? 1 : _ref$hoverWidthRatio,
2477
+ _ref$activeOpacity = _ref.activeOpacity,
2478
+ activeOpacity = _ref$activeOpacity === void 0 ? 0.8 : _ref$activeOpacity,
2479
+ className = _ref.className,
2480
+ props = _objectWithoutProperties(_ref, _excluded$1);
2481
+ var theme = useTheme();
2482
+ var ref = React$1.useRef(null);
2483
+ var isFirstVisible = usePrevious(isUnplacedRect(rect));
2484
+ var position = React$1.useMemo(function () {
2485
+ var width = rect.width * hoverWidthRatio;
2486
+ var height = rect.height * hoverHeightRatio;
2487
+ return {
2488
+ width: "".concat(width, "px"),
2489
+ left: "".concat(rect.left + (rect.width - width) / 2, "px"),
2490
+ height: "".concat(height, "px"),
2491
+ top: "".concat(rect.elementTop + (rect.height - height) / 2, "px"),
2492
+ transition: isFirstVisible ? 'opacity' : 'opacity, width, left, top'
2493
+ };
2494
+ }, [rect, hoverWidthRatio, hoverHeightRatio]);
2495
+ return /*#__PURE__*/React$1.createElement("div", _extends({
2496
+ ref: ref
2497
+ }, props, {
2498
+ className: _JSXStyle.dynamic([["603024321", [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]]]) + " " + (props && props.className != null && props.className || useClasses('highlight', className) || "")
2499
+ }), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2500
+ id: "603024321",
2501
+ dynamic: [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]
2502
+ }, ".highlight.__jsx-style-dynamic-selector{background:".concat(theme.palette.accents_2, ";position:absolute;border-radius:5px;width:").concat(position.width, ";left:").concat(position.left, ";height:").concat(position.height, ";top:").concat(position.top, ";opacity:").concat(visible ? activeOpacity : 0, ";-webkit-transition:0.15s ease;transition:0.15s ease;-webkit-transition-property:").concat(position.transition, ";transition-property:").concat(position.transition, ";}")));
2503
+ };
2504
+
2505
+ var Ellipsis = function Ellipsis(_ref) {
2506
+ var children = _ref.children,
2507
+ height = _ref.height;
2508
+ return /*#__PURE__*/React$1.createElement("span", {
2509
+ className: _JSXStyle.dynamic([["822089635", [height]]])
2510
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2511
+ id: "822089635",
2512
+ dynamic: [height]
2513
+ }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
2514
+ };
2515
+ var ellipsis = /*#__PURE__*/React$1.memo(Ellipsis);
2516
+
2517
+ var getRealShape = function getRealShape(el) {
2518
+ var defaultShape = {
2519
+ width: 0,
2520
+ height: 0
2521
+ };
2522
+ if (!el || typeof window === 'undefined') return defaultShape;
2523
+ var rect = el.getBoundingClientRect();
2524
+ var _window$getComputedSt = window.getComputedStyle(el),
2525
+ width = _window$getComputedSt.width,
2526
+ height = _window$getComputedSt.height;
2527
+ var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
2528
+ if (!str) return 0;
2529
+ var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
2530
+ return Number.isNaN(+strVal) ? 0 : +strVal;
2531
+ };
2532
+ return {
2533
+ width: getCSSStyleVal("".concat(width), rect.width),
2534
+ height: getCSSStyleVal("".concat(height), rect.height)
2535
+ };
2536
+ };
2537
+ var useRealShape = function useRealShape(ref) {
2538
+ var _useState = React$1.useState({
2539
+ width: 0,
2540
+ height: 0
2541
+ }),
2542
+ _useState2 = _slicedToArray(_useState, 2),
2543
+ state = _useState2[0],
2544
+ setState = _useState2[1];
2545
+ var update = function update() {
2546
+ var _getRealShape = getRealShape(ref.current),
2547
+ width = _getRealShape.width,
2548
+ height = _getRealShape.height;
2549
+ setState({
2550
+ width: width,
2551
+ height: height
2552
+ });
2553
+ };
2554
+ React$1.useEffect(function () {
2555
+ return update();
2556
+ }, [ref.current]);
2557
+ return [state, update];
2558
+ };
2559
+
2560
+ var Expand = function Expand(_ref) {
2561
+ var _ref$isExpanded = _ref.isExpanded,
2562
+ isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
2563
+ _ref$delay = _ref.delay,
2564
+ delay = _ref$delay === void 0 ? 200 : _ref$delay,
2565
+ children = _ref.children;
2566
+ var _useState = React$1.useState(isExpanded ? 'auto' : '0'),
2567
+ _useState2 = _slicedToArray(_useState, 2),
2568
+ height = _useState2[0],
2569
+ setHeight = _useState2[1];
2570
+ var _useState3 = React$1.useState(isExpanded),
2571
+ _useState4 = _slicedToArray(_useState3, 2),
2572
+ selfExpanded = _useState4[0],
2573
+ setSelfExpanded = _useState4[1];
2574
+ var _useState5 = React$1.useState(isExpanded),
2575
+ _useState6 = _slicedToArray(_useState5, 2),
2576
+ visible = _useState6[0],
2577
+ setVisible = _useState6[1];
2578
+ var contentRef = React$1.useRef(null);
2579
+ var entryTimer = React$1.useRef();
2580
+ var leaveTimer = React$1.useRef();
2581
+ var resetTimer = React$1.useRef();
2582
+ var _useRealShape = useRealShape(contentRef),
2583
+ _useRealShape2 = _slicedToArray(_useRealShape, 2),
2584
+ state = _useRealShape2[0],
2585
+ updateShape = _useRealShape2[1];
2586
+ var classes = useClasses('container', {
2587
+ expanded: selfExpanded
2588
+ });
2589
+ React$1.useEffect(function () {
2590
+ return setHeight("".concat(state.height, "px"));
2591
+ }, [state.height]);
2592
+ React$1.useEffect(function () {
2593
+ // show element or reset height.
2594
+ // force an update once manually, even if the element does not change.
2595
+ // (the height of the element might be "auto")
2596
+ if (isExpanded) {
2597
+ setVisible(isExpanded);
2598
+ } else {
2599
+ updateShape();
2600
+ setHeight("".concat(state.height, "px"));
2601
+ }
2602
+
2603
+ // show expand animation
2604
+ entryTimer.current = window.setTimeout(function () {
2605
+ setSelfExpanded(isExpanded);
2606
+ clearTimeout(entryTimer.current);
2607
+ }, 30);
2608
+
2609
+ // Reset height after animation
2610
+ if (isExpanded) {
2611
+ resetTimer.current = window.setTimeout(function () {
2612
+ setHeight('auto');
2613
+ clearTimeout(resetTimer.current);
2614
+ }, delay);
2615
+ } else {
2616
+ leaveTimer.current = window.setTimeout(function () {
2617
+ setVisible(isExpanded);
2618
+ clearTimeout(leaveTimer.current);
2619
+ }, delay / 2);
2620
+ }
2621
+ return function () {
2622
+ clearTimeout(entryTimer.current);
2623
+ clearTimeout(leaveTimer.current);
2624
+ clearTimeout(resetTimer.current);
2625
+ };
2626
+ }, [isExpanded]);
2627
+ return /*#__PURE__*/React$1.createElement("div", {
2628
+ className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + (classes || "")
2629
+ }, /*#__PURE__*/React$1.createElement("div", {
2630
+ ref: contentRef,
2631
+ className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + "content"
2632
+ }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2633
+ id: "1918690829",
2634
+ dynamic: [visible ? 'visible' : 'hidden', delay, height]
2635
+ }, ".container.__jsx-style-dynamic-selector{padding:0;margin:0;height:0;overflow:hidden;visibility:".concat(visible ? 'visible' : 'hidden', ";-webkit-transition:height ").concat(delay, "ms ease;transition:height ").concat(delay, "ms ease;}.expanded.__jsx-style-dynamic-selector{height:").concat(height, ";visibility:visible;}")));
2636
+ };
2637
+ Expand.displayName = 'Expand';
2638
+
2639
+ /* "use client" */
2640
+
2641
+ var useResize = function useResize(callback) {
2642
+ var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2643
+ React$1.useEffect(function () {
2644
+ var fn = function fn() {
2645
+ return callback();
2646
+ };
2647
+ if (immediatelyInvoke) {
2648
+ fn();
2649
+ }
2650
+ window.addEventListener('resize', fn);
2651
+ return function () {
2652
+ return window.removeEventListener('resize', fn);
2653
+ };
2654
+ }, []);
2655
+ };
2656
+
2657
+ /* "use client" */
2658
+
2659
+ var useClickAnyWhere = function useClickAnyWhere(handler) {
2660
+ React$1.useEffect(function () {
2661
+ var callback = function callback(event) {
2662
+ return handler(event);
2663
+ };
2664
+ document.addEventListener('click', callback);
2665
+ return function () {
2666
+ return document.removeEventListener('click', callback);
2667
+ };
2668
+ }, [handler]);
2669
+ };
2670
+
2671
+ /* "use client" */
2672
+
2673
+ var useDOMObserver = function useDOMObserver(ref) {
2674
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
2675
+ var config = {
2676
+ attributes: false,
2677
+ childList: true,
2678
+ subtree: true
2679
+ };
2680
+ React$1.useEffect(function () {
2681
+ if (!ref || !ref.current) return;
2682
+ var unmount = false;
2683
+ var done = function done() {
2684
+ if (unmount) return;
2685
+ callback.apply(void 0, arguments);
2686
+ };
2687
+ var observer = new MutationObserver(done);
2688
+ observer.observe(ref.current, config);
2689
+ return function () {
2690
+ unmount = true;
2691
+ observer.disconnect();
2692
+ };
2693
+ }, [ref]);
2694
+ };
2695
+
2696
+ var warningStack = {};
2697
+ var useWarning = function useWarning(message, component) {
2698
+ var tag = ' ';
2699
+ var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
2700
+ if (typeof console === 'undefined') return;
2701
+ if (warningStack[log]) return;
2702
+ warningStack[log] = true;
2703
+ if (process.env.NODE_ENV !== 'production') {
2704
+ return console.error(log);
2705
+ }
2706
+ console.warn(log);
2707
+ };
2708
+
2709
+ var defaultRect = {
2710
+ top: -1e3,
2711
+ left: -1e3,
2712
+ right: -1e3,
2713
+ width: 0
2714
+ };
2715
+ var Dropdown = /*#__PURE__*/React$1.memo(function (_ref) {
2716
+ var children = _ref.children,
2717
+ parent = _ref.parent,
2718
+ visible = _ref.visible,
2719
+ disableMatchWidth = _ref.disableMatchWidth,
2720
+ getPopupContainer = _ref.getPopupContainer;
2721
+ var el = usePortal('dropdown', getPopupContainer);
2722
+ var _useState = React$1.useState(defaultRect),
2723
+ _useState2 = _slicedToArray(_useState, 2),
2724
+ rect = _useState2[0],
2725
+ setRect = _useState2[1];
2726
+ var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
2727
+ if (!parent) return null;
2728
+
2729
+ /* istanbul ignore next */
2730
+ if (process.env.NODE_ENV !== 'production') {
2731
+ if (getPopupContainer && getPopupContainer()) {
2732
+ var _el = getPopupContainer();
2733
+ var style = window.getComputedStyle(_el);
2734
+ if (style.position === 'static') {
2735
+ useWarning('The element specified by "getPopupContainer" must have "position" set.');
2736
+ }
2737
+ }
2738
+ }
2739
+ var updateRect = function updateRect() {
2740
+ var _getRefRect = getRefRect(parent, getPopupContainer),
2741
+ top = _getRefRect.top,
2742
+ left = _getRefRect.left,
2743
+ right = _getRefRect.right,
2744
+ nativeWidth = _getRefRect.width;
2745
+ setRect({
2746
+ top: top,
2747
+ left: left,
2748
+ right: right,
2749
+ width: nativeWidth
2750
+ });
2751
+ };
2752
+ useResize(updateRect);
2753
+ useClickAnyWhere(function () {
2754
+ var _getRefRect2 = getRefRect(parent, getPopupContainer),
2755
+ top = _getRefRect2.top,
2756
+ left = _getRefRect2.left;
2757
+ var shouldUpdatePosition = top !== rect.top || left !== rect.left;
2758
+ if (!shouldUpdatePosition) return;
2759
+ updateRect();
2760
+ });
2761
+ useDOMObserver(parent, function () {
2762
+ updateRect();
2763
+ });
2764
+ React$1.useEffect(function () {
2765
+ if (!parent || !parent.current) return;
2766
+ parent.current.addEventListener('mouseenter', updateRect);
2767
+ /* istanbul ignore next */
2768
+ return function () {
2769
+ if (!parent || !parent.current) return;
2770
+ parent.current.removeEventListener('mouseenter', updateRect);
2771
+ };
2772
+ }, [parent]);
2773
+ var clickHandler = function clickHandler(event) {
2774
+ event.stopPropagation();
2775
+ event.nativeEvent.stopImmediatePropagation();
2776
+ event.preventDefault();
2777
+ };
2778
+ var mouseDownHandler = function mouseDownHandler(event) {
2779
+ event.preventDefault();
2780
+ };
2781
+ if (!el) return null;
2782
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement(CssTransition, {
2783
+ visible: visible
2784
+ }, /*#__PURE__*/React$1.createElement("div", {
2785
+ onClick: clickHandler,
2786
+ onMouseDown: mouseDownHandler,
2787
+ className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
2788
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2789
+ id: "1644673105",
2790
+ dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
2791
+ }, ".dropdown.__jsx-style-dynamic-selector{position:absolute;top:".concat(rect.top + 2, "px;left:").concat(rect.left, "px;z-index:1100;}.width-match.__jsx-style-dynamic-selector{width:").concat(rect.width, "px;}.disable-match.__jsx-style-dynamic-selector{min-width:").concat(rect.width, "px;}")))), el);
2792
+ });
2793
+
2794
+ var _excluded = ["children", "onClick", "visible", "width", "onContentClick", "backdropClassName", "positionClassName", "layerClassName"];
2795
+ var Backdrop = /*#__PURE__*/React$1.memo(function (_ref) {
2796
+ var children = _ref.children,
2797
+ _ref$onClick = _ref.onClick,
2798
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
2799
+ _ref$visible = _ref.visible,
2800
+ visible = _ref$visible === void 0 ? false : _ref$visible,
2801
+ width = _ref.width,
2802
+ _ref$onContentClick = _ref.onContentClick,
2803
+ onContentClick = _ref$onContentClick === void 0 ? function () {} : _ref$onContentClick,
2804
+ _ref$backdropClassNam = _ref.backdropClassName,
2805
+ backdropClassName = _ref$backdropClassNam === void 0 ? '' : _ref$backdropClassNam,
2806
+ _ref$positionClassNam = _ref.positionClassName,
2807
+ positionClassName = _ref$positionClassNam === void 0 ? '' : _ref$positionClassNam,
2808
+ _ref$layerClassName = _ref.layerClassName,
2809
+ layerClassName = _ref$layerClassName === void 0 ? '' : _ref$layerClassName,
2810
+ props = _objectWithoutProperties(_ref, _excluded);
2811
+ var theme = useTheme();
2812
+ var _useCurrentState = useCurrentState(false),
2813
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2814
+ setIsContentMouseDown = _useCurrentState2[1],
2815
+ IsContentMouseDownRef = _useCurrentState2[2];
2816
+ var clickHandler = function clickHandler(event) {
2817
+ if (IsContentMouseDownRef.current) return;
2818
+ onClick && onClick(event);
2819
+ };
2820
+ var mouseUpHandler = function mouseUpHandler() {
2821
+ if (!IsContentMouseDownRef.current) return;
2822
+ var timer = setTimeout(function () {
2823
+ setIsContentMouseDown(false);
2824
+ clearTimeout(timer);
2825
+ }, 0);
2826
+ };
2827
+ return /*#__PURE__*/React$1.createElement(CssTransition, {
2828
+ name: "backdrop-wrapper",
2829
+ visible: visible,
2830
+ clearTime: 300
2831
+ }, /*#__PURE__*/React$1.createElement("div", _extends({
2832
+ onClick: clickHandler,
2833
+ onMouseUp: mouseUpHandler
2834
+ }, props, {
2835
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (props && props.className != null && props.className || useClasses('backdrop', backdropClassName) || "")
2836
+ }), /*#__PURE__*/React$1.createElement("div", {
2837
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('layer', layerClassName) || "")
2838
+ }), /*#__PURE__*/React$1.createElement("div", {
2839
+ onClick: onContentClick,
2840
+ onMouseDown: function onMouseDown() {
2841
+ return setIsContentMouseDown(true);
2842
+ },
2843
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('position', positionClassName) || "")
2844
+ }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2845
+ id: "2021762493",
2846
+ dynamic: [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]
2847
+ }, ".backdrop.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;overflow:auto;z-index:1000;-webkit-overflow-scrolling:touch;box-sizing:border-box;text-align:center;}.position.__jsx-style-dynamic-selector{position:relative;z-index:1001;outline:none;max-width:90%;width:".concat(width, ";margin:20px auto;vertical-align:middle;display:inline-block;}.backdrop.__jsx-style-dynamic-selector:before{display:inline-block;width:0;height:100%;vertical-align:middle;content:'';}.layer.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;opacity:").concat(theme.expressiveness.portalOpacity, ";background-color:black;-webkit-transition:opacity 0.35s cubic-bezier(0.4,0,0.2,1);transition:opacity 0.35s cubic-bezier(0.4,0,0.2,1);pointer-events:none;z-index:1000;}.backdrop-wrapper-enter.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:0;}.backdrop-wrapper-enter-active.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:").concat(theme.expressiveness.portalOpacity, ";}.backdrop-wrapper-leave.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:").concat(theme.expressiveness.portalOpacity, ";}.backdrop-wrapper-leave-active.__jsx-style-dynamic-selector .layer.__jsx-style-dynamic-selector{opacity:0;}"))));
2848
+ });
2849
+ Backdrop.displayName = 'Backdrop';
2850
+
2851
+ dist.Backdrop = Backdrop;
2852
+ dist.CssBaseline = MemoCssBaseline;
2853
+ dist.CssTransition = CssTransition;
2854
+ dist.Dropdown = Dropdown;
2855
+ dist.Ellipsis = ellipsis;
2856
+ dist.Expand = Expand;
2857
+ dist.Highlight = Highlight;
2858
+ dist.Themes = Themes;
2859
+ dist.UiProvider = HuiProvider;
2860
+ dist.useAllThemes = useAllThemes;
2861
+ dist.useClasses = useClasses;
2862
+ dist.useCurrentState = useCurrentState;
2863
+ dist.useMediaQuery = useMediaQuery;
2864
+ dist.useRect = useRect;
2865
+ dist.useTheme = useTheme;
2866
+ dist.useToasts = useToasts;
2867
+ return dist;
2868
+ }
2869
+
2870
+ var distExports = /*@__PURE__*/ requireDist();
1010
2871
 
1011
2872
  var InputLabel = function InputLabel(_ref) {
1012
2873
  var children = _ref.children,
1013
2874
  isRight = _ref.isRight;
1014
- var theme = useTheme();
2875
+ var theme = distExports.useTheme();
1015
2876
  return /*#__PURE__*/React.createElement("span", {
1016
2877
  className: _JSXStyle.dynamic([["3089782703", [theme.layout.gapHalf, theme.palette.accents_4, theme.palette.accents_1, theme.layout.radius, theme.layout.radius, theme.palette.border, theme.palette.border, theme.palette.border, theme.layout.radius, theme.layout.radius, theme.palette.border]]]) + " " + ((isRight ? 'right' : '') || "")
1017
2878
  }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
@@ -1023,7 +2884,7 @@ var MemoInputLabel = /*#__PURE__*/React.memo(InputLabel);
1023
2884
 
1024
2885
  var InputBlockLabelComponent = function InputBlockLabelComponent(_ref) {
1025
2886
  var children = _ref.children;
1026
- var theme = useTheme();
2887
+ var theme = distExports.useTheme();
1027
2888
  return /*#__PURE__*/React.createElement("label", {
1028
2889
  className: _JSXStyle.dynamic([["1278828862", [theme.palette.accents_6]]])
1029
2890
  }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
@@ -1050,45 +2911,12 @@ var InputIconComponent = function InputIconComponent(_ref) {
1050
2911
  InputIconComponent.displayName = 'InputIcon';
1051
2912
  var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
1052
2913
 
1053
- /* "use client" */
1054
-
1055
- var classObjectToString = function classObjectToString(className) {
1056
- var keys = Object.keys(className);
1057
- var len = keys.length;
1058
- var str = '';
1059
- for (var index = 0; index < len; index++) {
1060
- var key = keys[index];
1061
- var val = className[keys[index]];
1062
- if (!val) continue;
1063
- str = str ? "".concat(str, " ").concat(String(key)) : String(key);
1064
- }
1065
- return str;
1066
- };
1067
- var isObjectClassName = function isObjectClassName(value) {
1068
- return _typeof(value) === 'object' && !Array.isArray(value);
1069
- };
1070
- var useClasses = function useClasses() {
1071
- var len = arguments.length;
1072
- var classes = '';
1073
- if (len === 0) return classes;
1074
- for (var index = 0; index < len; index++) {
1075
- var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
1076
- if (!val) continue;
1077
- if (isObjectClassName(val)) {
1078
- classes += " ".concat(classObjectToString(val));
1079
- } else {
1080
- classes += " ".concat(String(val).trim());
1081
- }
1082
- }
1083
- return classes.trim();
1084
- };
1085
-
1086
2914
  var InputIconClear = function InputIconClear(_ref) {
1087
2915
  var onClick = _ref.onClick,
1088
2916
  disabled = _ref.disabled,
1089
2917
  visible = _ref.visible;
1090
- var theme = useTheme();
1091
- var classes = useClasses('clear-icon', {
2918
+ var theme = distExports.useTheme();
2919
+ var classes = distExports.useClasses('clear-icon', {
1092
2920
  visible: visible
1093
2921
  });
1094
2922
  var clickHandler = function clickHandler(event) {
@@ -1284,7 +3112,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
1284
3112
  return getAllScaleProps;
1285
3113
  };
1286
3114
 
1287
- var _excluded$k = ["children"];
3115
+ var _excluded$j = ["children"];
1288
3116
  var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
1289
3117
  if (scale === 1) return scale;
1290
3118
  var diff = Math.abs((scale - 1) / 2);
@@ -1294,8 +3122,8 @@ var withScale = function withScale(Render) {
1294
3122
  var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1295
3123
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
1296
3124
  var children = _ref.children,
1297
- props = _objectWithoutProperties(_ref, _excluded$k);
1298
- var _useTheme = useTheme(),
3125
+ props = _objectWithoutProperties(_ref, _excluded$j);
3126
+ var _useTheme = distExports.useTheme(),
1299
3127
  layout = _useTheme.layout;
1300
3128
  var paddingLeft = props.paddingLeft,
1301
3129
  pl = props.pl,
@@ -1377,7 +3205,7 @@ var withScale = function withScale(Render) {
1377
3205
  return ScaleFC;
1378
3206
  };
1379
3207
 
1380
- var _excluded$j = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
3208
+ var _excluded$i = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
1381
3209
  var simulateChangeEvent = function simulateChangeEvent(el, event) {
1382
3210
  return _objectSpread2(_objectSpread2({}, event), {}, {
1383
3211
  target: el,
@@ -1417,8 +3245,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1417
3245
  children = _ref.children,
1418
3246
  _ref$disabled = _ref.disabled,
1419
3247
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1420
- props = _objectWithoutProperties(_ref, _excluded$j);
1421
- var theme = useTheme();
3248
+ props = _objectWithoutProperties(_ref, _excluded$i);
3249
+ var theme = distExports.useTheme();
1422
3250
  var _useScale = useScale(),
1423
3251
  SCALES = _useScale.SCALES;
1424
3252
  var inputRef = React.useRef(null);
@@ -1496,9 +3324,9 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1496
3324
  return /*#__PURE__*/React.createElement("div", {
1497
3325
  className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + "with-label"
1498
3326
  }, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
1499
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-container', className) || "")
3327
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (distExports.useClasses('input-container', className) || "")
1500
3328
  }, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
1501
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (useClasses('input-wrapper', {
3329
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (distExports.useClasses('input-wrapper', {
1502
3330
  hover: hover,
1503
3331
  disabled: disabled
1504
3332
  }, labelClasses) || "")
@@ -1515,7 +3343,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1515
3343
  onChange: changeHandler,
1516
3344
  autoComplete: autoComplete
1517
3345
  }, inputProps, {
1518
- className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || useClasses({
3346
+ className: _JSXStyle.dynamic([["1424341926", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, 'initial'), theme.layout.radius, borderColor, theme.palette.accents_1, theme.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme.palette.accents_3, theme.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || distExports.useClasses({
1519
3347
  disabled: disabled
1520
3348
  }, iconClasses) || "")
1521
3349
  })), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
@@ -1560,7 +3388,7 @@ tuple('hover', 'click');
1560
3388
  tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1561
3389
  tuple('start', 'center', 'end', 'left', 'right');
1562
3390
 
1563
- var _excluded$i = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
3391
+ var _excluded$h = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1564
3392
  tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
1565
3393
  var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1566
3394
  var _ref$type = _ref.type,
@@ -1580,8 +3408,8 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1580
3408
  placeholder = _ref.placeholder,
1581
3409
  _ref$resize = _ref.resize,
1582
3410
  resize = _ref$resize === void 0 ? 'none' : _ref$resize,
1583
- props = _objectWithoutProperties(_ref, _excluded$i);
1584
- var theme = useTheme();
3411
+ props = _objectWithoutProperties(_ref, _excluded$h);
3412
+ var theme = distExports.useTheme();
1585
3413
  var _useScale = useScale(),
1586
3414
  SCALES = _useScale.SCALES;
1587
3415
  var textareaRef = React.useRef(null);
@@ -1605,7 +3433,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1605
3433
  color = _useMemo.color,
1606
3434
  borderColor = _useMemo.borderColor,
1607
3435
  hoverBorder = _useMemo.hoverBorder;
1608
- var classes = useClasses('wrapper', {
3436
+ var classes = distExports.useClasses('wrapper', {
1609
3437
  hover: hover,
1610
3438
  disabled: disabled
1611
3439
  }, className);
@@ -1671,411 +3499,94 @@ var PasswordIcon = function PasswordIcon(_ref) {
1671
3499
  }), /*#__PURE__*/React.createElement("circle", {
1672
3500
  cx: "12",
1673
3501
  cy: "12",
1674
- r: "3"
1675
- })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
1676
- d: "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"
1677
- }), /*#__PURE__*/React.createElement("path", {
1678
- d: "M1 1l22 22"
1679
- })));
1680
- };
1681
- var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
1682
-
1683
- var _excluded$h = ["hideToggle", "children"];
1684
- var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1685
- var hideToggle = _ref.hideToggle,
1686
- children = _ref.children,
1687
- props = _objectWithoutProperties(_ref, _excluded$h);
1688
- var _useScale = useScale(),
1689
- getAllScaleProps = _useScale.getAllScaleProps;
1690
- var inputRef = React.useRef(null);
1691
- var _useState = React.useState(false),
1692
- _useState2 = _slicedToArray(_useState, 2),
1693
- visible = _useState2[0],
1694
- setVisible = _useState2[1];
1695
- React.useImperativeHandle(ref, function () {
1696
- return inputRef.current;
1697
- }); // Changed with !
1698
-
1699
- var iconClickHandler = function iconClickHandler() {
1700
- setVisible(function (v) {
1701
- return !v;
1702
- });
1703
- /* istanbul ignore next */
1704
- if (inputRef && inputRef.current) {
1705
- inputRef.current.focus();
1706
- }
1707
- };
1708
- var inputProps = React.useMemo(function () {
1709
- return _objectSpread2(_objectSpread2({}, props), {}, {
1710
- ref: inputRef,
1711
- iconClickable: true,
1712
- onIconClick: iconClickHandler,
1713
- type: visible ? 'text' : 'password'
1714
- });
1715
- }, [props, iconClickHandler, visible, inputRef]);
1716
- var icon = React.useMemo(function () {
1717
- if (hideToggle) return null;
1718
- return /*#__PURE__*/React.createElement(MemoPasswordIcon, {
1719
- visible: visible
1720
- });
1721
- }, [hideToggle, visible]);
1722
- return /*#__PURE__*/React.createElement(Input, _extends({
1723
- iconRight: icon
1724
- }, getAllScaleProps(), inputProps), children);
1725
- });
1726
- InputPasswordComponent.displayName = 'InputPassword';
1727
- var InputPassword = withScale(InputPasswordComponent);
1728
-
1729
- /* "use client" */
1730
- Input.Textarea = Textarea;
1731
- Input.Password = InputPassword;
1732
-
1733
- var useCurrentState = function useCurrentState(initialState) {
1734
- var _useState = React.useState(function () {
1735
- return typeof initialState === 'function' ? initialState() : initialState;
1736
- }),
1737
- _useState2 = _slicedToArray(_useState, 2),
1738
- state = _useState2[0],
1739
- setState = _useState2[1];
1740
- var ref = React.useRef(initialState);
1741
- React.useEffect(function () {
1742
- ref.current = state;
1743
- }, [state]);
1744
- var setValue = function setValue(val) {
1745
- var result = typeof val === 'function' ? val(ref.current) : val;
1746
- ref.current = result;
1747
- setState(result);
1748
- };
1749
- return [state, setValue, ref];
1750
- };
1751
-
1752
- var SelectIconComponent = function SelectIconComponent() {
1753
- return /*#__PURE__*/React.createElement("svg", {
1754
- viewBox: "0 0 24 24",
1755
- strokeWidth: "1",
1756
- strokeLinecap: "round",
1757
- strokeLinejoin: "round",
1758
- fill: "none",
1759
- shapeRendering: "geometricPrecision",
1760
- className: "jsx-2742933678"
1761
- }, /*#__PURE__*/React.createElement("path", {
1762
- d: "M6 9l6 6 6-6",
1763
- className: "jsx-2742933678"
1764
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
1765
- id: "2742933678"
1766
- }, "svg.jsx-2742933678{color:inherit;stroke:currentColor;-webkit-transition:all 200ms ease;transition:all 200ms ease;width:1.214em;height:1.214em;}"));
1767
- };
1768
- SelectIconComponent.displayName = 'SelectIcon';
1769
- var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
1770
-
1771
- /* "use client" */
1772
-
1773
- var defaultContext$3 = {
1774
- visible: false,
1775
- disableAll: false
1776
- };
1777
- var SelectContext = /*#__PURE__*/React.createContext(defaultContext$3);
1778
- var useSelectContext = function useSelectContext() {
1779
- return React.useContext(SelectContext);
1780
- };
1781
-
1782
- var useSSR = function useSSR() {
1783
- var _useState = React.useState(false),
1784
- _useState2 = _slicedToArray(_useState, 2),
1785
- browser = _useState2[0],
1786
- setBrowser = _useState2[1];
1787
- React.useEffect(function () {
1788
- setBrowser(isBrowser());
1789
- }, []);
1790
- return {
1791
- isBrowser: browser,
1792
- isServer: !browser
1793
- };
1794
- };
1795
-
1796
- var createElement = function createElement(id) {
1797
- var el = document.createElement('div');
1798
- el.setAttribute('id', id);
1799
- return el;
1800
- };
1801
- var usePortal = function usePortal() {
1802
- var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
1803
- var getContainer = arguments.length > 1 ? arguments[1] : undefined;
1804
- var id = "helpdice-ui-".concat(selectId);
1805
- var _useSSR = useSSR(),
1806
- isBrowser = _useSSR.isBrowser;
1807
- var _useState = React.useState(isBrowser ? createElement(id) : null),
1808
- _useState2 = _slicedToArray(_useState, 2),
1809
- elSnapshot = _useState2[0],
1810
- setElSnapshot = _useState2[1];
1811
- React.useEffect(function () {
1812
- var customContainer = getContainer ? getContainer() : null;
1813
- var parentElement = customContainer || document.body;
1814
- var hasElement = parentElement.querySelector("#".concat(id));
1815
- var el = hasElement || createElement(id);
1816
- if (!hasElement) {
1817
- parentElement.appendChild(el);
1818
- }
1819
- setElSnapshot(el);
1820
- }, []);
1821
- return elSnapshot;
1822
- };
1823
-
1824
- /* "use client" */
1825
-
1826
- var useResize = function useResize(callback) {
1827
- var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1828
- React.useEffect(function () {
1829
- var fn = function fn() {
1830
- return callback();
1831
- };
1832
- if (immediatelyInvoke) {
1833
- fn();
1834
- }
1835
- window.addEventListener('resize', fn);
1836
- return function () {
1837
- return window.removeEventListener('resize', fn);
1838
- };
1839
- }, []);
1840
- };
1841
-
1842
- var _excluded$g = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1843
- var CssTransition = function CssTransition(_ref) {
1844
- var children = _ref.children,
1845
- _ref$className = _ref.className,
1846
- className = _ref$className === void 0 ? '' : _ref$className,
1847
- _ref$visible = _ref.visible,
1848
- visible = _ref$visible === void 0 ? false : _ref$visible,
1849
- _ref$enterTime = _ref.enterTime,
1850
- enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1851
- _ref$leaveTime = _ref.leaveTime,
1852
- leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1853
- _ref$clearTime = _ref.clearTime,
1854
- clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1855
- _ref$name = _ref.name,
1856
- name = _ref$name === void 0 ? 'transition' : _ref$name,
1857
- props = _objectWithoutProperties(_ref, _excluded$g);
1858
- var _useState = React.useState(''),
1859
- _useState2 = _slicedToArray(_useState, 2),
1860
- classes = _useState2[0],
1861
- setClasses = _useState2[1];
1862
- var _useState3 = React.useState(visible),
1863
- _useState4 = _slicedToArray(_useState3, 2),
1864
- renderable = _useState4[0],
1865
- setRenderable = _useState4[1];
1866
- React.useEffect(function () {
1867
- var statusClassName = visible ? 'enter' : 'leave';
1868
- var time = visible ? enterTime : leaveTime;
1869
- if (visible && !renderable) {
1870
- setRenderable(true);
1871
- }
1872
- setClasses("".concat(name, "-").concat(statusClassName));
1873
-
1874
- // set class to active
1875
- var timer = setTimeout(function () {
1876
- setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1877
- clearTimeout(timer);
1878
- }, time);
1879
-
1880
- // remove classess when animation over
1881
- var clearClassesTimer = setTimeout(function () {
1882
- if (!visible) {
1883
- setClasses('');
1884
- setRenderable(false);
1885
- }
1886
- clearTimeout(clearClassesTimer);
1887
- }, time + clearTime);
1888
- return function () {
1889
- clearTimeout(timer);
1890
- clearTimeout(clearClassesTimer);
1891
- };
1892
- }, [visible, renderable]);
1893
- if (! /*#__PURE__*/React.isValidElement(children) || !renderable) return null;
1894
- var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1895
- className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1896
- });
1897
- return /*#__PURE__*/React.cloneElement(children, propsTransition);
3502
+ r: "3"
3503
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
3504
+ d: "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"
3505
+ }), /*#__PURE__*/React.createElement("path", {
3506
+ d: "M1 1l22 22"
3507
+ })));
1898
3508
  };
1899
- CssTransition.displayName = 'CssTransition';
3509
+ var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
1900
3510
 
1901
- /* "use client" */
3511
+ var _excluded$g = ["hideToggle", "children"];
3512
+ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
3513
+ var hideToggle = _ref.hideToggle,
3514
+ children = _ref.children,
3515
+ props = _objectWithoutProperties(_ref, _excluded$g);
3516
+ var _useScale = useScale(),
3517
+ getAllScaleProps = _useScale.getAllScaleProps;
3518
+ var inputRef = React.useRef(null);
3519
+ var _useState = React.useState(false),
3520
+ _useState2 = _slicedToArray(_useState, 2),
3521
+ visible = _useState2[0],
3522
+ setVisible = _useState2[1];
3523
+ React.useImperativeHandle(ref, function () {
3524
+ return inputRef.current;
3525
+ }); // Changed with !
1902
3526
 
1903
- var useClickAnyWhere = function useClickAnyWhere(handler) {
1904
- React.useEffect(function () {
1905
- var callback = function callback(event) {
1906
- return handler(event);
1907
- };
1908
- document.addEventListener('click', callback);
1909
- return function () {
1910
- return document.removeEventListener('click', callback);
1911
- };
1912
- }, [handler]);
1913
- };
3527
+ var iconClickHandler = function iconClickHandler() {
3528
+ setVisible(function (v) {
3529
+ return !v;
3530
+ });
3531
+ /* istanbul ignore next */
3532
+ if (inputRef && inputRef.current) {
3533
+ inputRef.current.focus();
3534
+ }
3535
+ };
3536
+ var inputProps = React.useMemo(function () {
3537
+ return _objectSpread2(_objectSpread2({}, props), {}, {
3538
+ ref: inputRef,
3539
+ iconClickable: true,
3540
+ onIconClick: iconClickHandler,
3541
+ type: visible ? 'text' : 'password'
3542
+ });
3543
+ }, [props, iconClickHandler, visible, inputRef]);
3544
+ var icon = React.useMemo(function () {
3545
+ if (hideToggle) return null;
3546
+ return /*#__PURE__*/React.createElement(MemoPasswordIcon, {
3547
+ visible: visible
3548
+ });
3549
+ }, [hideToggle, visible]);
3550
+ return /*#__PURE__*/React.createElement(Input, _extends({
3551
+ iconRight: icon
3552
+ }, getAllScaleProps(), inputProps), children);
3553
+ });
3554
+ InputPasswordComponent.displayName = 'InputPassword';
3555
+ var InputPassword = withScale(InputPasswordComponent);
1914
3556
 
1915
3557
  /* "use client" */
3558
+ Input.Textarea = Textarea;
3559
+ Input.Password = InputPassword;
1916
3560
 
1917
- var useDOMObserver = function useDOMObserver(ref) {
1918
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
1919
- var config = {
1920
- attributes: false,
1921
- childList: true,
1922
- subtree: true
1923
- };
1924
- React.useEffect(function () {
1925
- if (!ref || !ref.current) return;
1926
- var unmount = false;
1927
- var done = function done() {
1928
- if (unmount) return;
1929
- callback.apply(void 0, arguments);
1930
- };
1931
- var observer = new MutationObserver(done);
1932
- observer.observe(ref.current, config);
1933
- return function () {
1934
- unmount = true;
1935
- observer.disconnect();
1936
- };
1937
- }, [ref]);
3561
+ var SelectIconComponent = function SelectIconComponent() {
3562
+ return /*#__PURE__*/React.createElement("svg", {
3563
+ viewBox: "0 0 24 24",
3564
+ strokeWidth: "1",
3565
+ strokeLinecap: "round",
3566
+ strokeLinejoin: "round",
3567
+ fill: "none",
3568
+ shapeRendering: "geometricPrecision",
3569
+ className: "jsx-2742933678"
3570
+ }, /*#__PURE__*/React.createElement("path", {
3571
+ d: "M6 9l6 6 6-6",
3572
+ className: "jsx-2742933678"
3573
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
3574
+ id: "2742933678"
3575
+ }, "svg.jsx-2742933678{color:inherit;stroke:currentColor;-webkit-transition:all 200ms ease;transition:all 200ms ease;width:1.214em;height:1.214em;}"));
1938
3576
  };
3577
+ SelectIconComponent.displayName = 'SelectIcon';
3578
+ var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
1939
3579
 
1940
- var warningStack = {};
1941
- var useWarning = function useWarning(message, component) {
1942
- var tag = component ? " [".concat(component, "]") : ' ';
1943
- var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
1944
- if (typeof console === 'undefined') return;
1945
- if (warningStack[log]) return;
1946
- warningStack[log] = true;
1947
- if (process.env.NODE_ENV !== 'production') {
1948
- return console.error(log);
1949
- }
1950
- console.warn(log);
1951
- };
3580
+ /* "use client" */
1952
3581
 
1953
- var getElementOffset = function getElementOffset(el) {
1954
- if (!el) return {
1955
- top: 0,
1956
- left: 0
1957
- };
1958
- var _el$getBoundingClient = el.getBoundingClientRect(),
1959
- top = _el$getBoundingClient.top,
1960
- left = _el$getBoundingClient.left;
1961
- return {
1962
- top: top,
1963
- left: left
1964
- };
1965
- };
1966
- var defaultRect$2 = {
1967
- top: -1e3,
1968
- left: -1e3,
1969
- right: -1e3,
1970
- width: 0,
1971
- height: 0,
1972
- elementTop: -1e3
1973
- };
1974
- var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
1975
- if (!domRect) return defaultRect$2;
1976
- var container = getContainer ? getContainer() : null;
1977
- var scrollElement = container || document.documentElement;
1978
- var _getElementOffset = getElementOffset(container),
1979
- offsetTop = _getElementOffset.top,
1980
- offsetLeft = _getElementOffset.left;
1981
- return _objectSpread2(_objectSpread2({}, domRect), {}, {
1982
- width: domRect.width || domRect.right - domRect.left,
1983
- height: domRect.height || domRect.top - domRect.bottom,
1984
- top: domRect.bottom + scrollElement.scrollTop - offsetTop,
1985
- left: domRect.left + scrollElement.scrollLeft - offsetLeft,
1986
- elementTop: domRect.top + scrollElement.scrollTop - offsetTop
1987
- });
1988
- };
1989
- var getRefRect = function getRefRect(ref, getContainer) {
1990
- if (!ref || !ref.current) return defaultRect$2;
1991
- var rect = ref.current.getBoundingClientRect();
1992
- return getRectFromDOMWithContainer(rect, getContainer);
3582
+ var defaultContext$3 = {
3583
+ visible: false,
3584
+ disableAll: false
1993
3585
  };
1994
-
1995
- var defaultRect$1 = {
1996
- top: -1e3,
1997
- left: -1e3,
1998
- right: -1e3,
1999
- width: 0
3586
+ var SelectContext = /*#__PURE__*/React.createContext(defaultContext$3);
3587
+ var useSelectContext = function useSelectContext() {
3588
+ return React.useContext(SelectContext);
2000
3589
  };
2001
- var Dropdown = /*#__PURE__*/React.memo(function (_ref) {
2002
- var children = _ref.children,
2003
- parent = _ref.parent,
2004
- visible = _ref.visible,
2005
- disableMatchWidth = _ref.disableMatchWidth,
2006
- getPopupContainer = _ref.getPopupContainer;
2007
- var el = usePortal('dropdown', getPopupContainer);
2008
- var _useState = React.useState(defaultRect$1),
2009
- _useState2 = _slicedToArray(_useState, 2),
2010
- rect = _useState2[0],
2011
- setRect = _useState2[1];
2012
- var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
2013
- if (!parent) return null;
2014
-
2015
- /* istanbul ignore next */
2016
- if (process.env.NODE_ENV !== 'production') {
2017
- if (getPopupContainer && getPopupContainer()) {
2018
- var _el = getPopupContainer();
2019
- var style = window.getComputedStyle(_el);
2020
- if (style.position === 'static') {
2021
- useWarning('The element specified by "getPopupContainer" must have "position" set.');
2022
- }
2023
- }
2024
- }
2025
- var updateRect = function updateRect() {
2026
- var _getRefRect = getRefRect(parent, getPopupContainer),
2027
- top = _getRefRect.top,
2028
- left = _getRefRect.left,
2029
- right = _getRefRect.right,
2030
- nativeWidth = _getRefRect.width;
2031
- setRect({
2032
- top: top,
2033
- left: left,
2034
- right: right,
2035
- width: nativeWidth
2036
- });
2037
- };
2038
- useResize(updateRect);
2039
- useClickAnyWhere(function () {
2040
- var _getRefRect2 = getRefRect(parent, getPopupContainer),
2041
- top = _getRefRect2.top,
2042
- left = _getRefRect2.left;
2043
- var shouldUpdatePosition = top !== rect.top || left !== rect.left;
2044
- if (!shouldUpdatePosition) return;
2045
- updateRect();
2046
- });
2047
- useDOMObserver(parent, function () {
2048
- updateRect();
2049
- });
2050
- React.useEffect(function () {
2051
- if (!parent || !parent.current) return;
2052
- parent.current.addEventListener('mouseenter', updateRect);
2053
- /* istanbul ignore next */
2054
- return function () {
2055
- if (!parent || !parent.current) return;
2056
- parent.current.removeEventListener('mouseenter', updateRect);
2057
- };
2058
- }, [parent]);
2059
- var clickHandler = function clickHandler(event) {
2060
- event.stopPropagation();
2061
- event.nativeEvent.stopImmediatePropagation();
2062
- event.preventDefault();
2063
- };
2064
- var mouseDownHandler = function mouseDownHandler(event) {
2065
- event.preventDefault();
2066
- };
2067
- if (!el) return null;
2068
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(CssTransition, {
2069
- visible: visible
2070
- }, /*#__PURE__*/React.createElement("div", {
2071
- onClick: clickHandler,
2072
- onMouseDown: mouseDownHandler,
2073
- className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
2074
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
2075
- id: "1644673105",
2076
- dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
2077
- }, ".dropdown.__jsx-style-dynamic-selector{position:absolute;top:".concat(rect.top + 2, "px;left:").concat(rect.left, "px;z-index:1100;}.width-match.__jsx-style-dynamic-selector{width:").concat(rect.width, "px;}.disable-match.__jsx-style-dynamic-selector{min-width:").concat(rect.width, "px;}")))), el);
2078
- });
2079
3590
 
2080
3591
  var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef) {
2081
3592
  var visible = _ref.visible,
@@ -2086,15 +3597,15 @@ var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef)
2086
3597
  dropdownStyle = _ref$dropdownStyle === void 0 ? {} : _ref$dropdownStyle,
2087
3598
  disableMatchWidth = _ref.disableMatchWidth,
2088
3599
  getPopupContainer = _ref.getPopupContainer;
2089
- var theme = useTheme();
3600
+ var theme = distExports.useTheme();
2090
3601
  var internalDropdownRef = React.useRef(null);
2091
3602
  var _useSelectContext = useSelectContext(),
2092
3603
  ref = _useSelectContext.ref;
2093
- var classes = useClasses('select-dropdown', className);
3604
+ var classes = distExports.useClasses('select-dropdown', className);
2094
3605
  React.useImperativeHandle(dropdownRef, function () {
2095
3606
  return internalDropdownRef.current;
2096
3607
  });
2097
- return /*#__PURE__*/React.createElement(Dropdown, {
3608
+ return /*#__PURE__*/React.createElement(distExports.Dropdown, {
2098
3609
  parent: ref,
2099
3610
  visible: visible,
2100
3611
  disableMatchWidth: disableMatchWidth,
@@ -2149,7 +3660,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
2149
3660
  _ref$className = _ref.className,
2150
3661
  className = _ref$className === void 0 ? '' : _ref$className,
2151
3662
  props = _objectWithoutProperties(_ref, _excluded$f);
2152
- var theme = useTheme();
3663
+ var theme = distExports.useTheme();
2153
3664
  var _useScale = useScale(),
2154
3665
  SCALES = _useScale.SCALES;
2155
3666
  var classes = React.useMemo(function () {
@@ -2180,7 +3691,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
2180
3691
  };
2181
3692
  }, [xs, sm, md, lg, xl]);
2182
3693
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
2183
- className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || useClasses('item', classes, className) || "")
3694
+ className: _JSXStyle.dynamic([["568430467", [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]]]) + " " + (props && props.className != null && props.className || distExports.useClasses('item', classes, className) || "")
2184
3695
  }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
2185
3696
  id: "568430467",
2186
3697
  dynamic: [SCALES.font(1, 'inherit'), SCALES.height(1, 'auto'), justify, direction, alignContent, alignItems, layout.xs.grow, layout.xs.width, layout.xs.basis, layout.xs.display, theme.breakpoints.sm.min, layout.sm.grow, layout.sm.width, layout.sm.basis, layout.sm.display, theme.breakpoints.md.min, layout.md.grow, layout.md.width, layout.md.basis, layout.md.display, theme.breakpoints.lg.min, layout.lg.grow, layout.lg.width, layout.lg.basis, layout.lg.display, theme.breakpoints.xl.min, layout.xl.grow, layout.xl.width, layout.xl.basis, layout.xl.display]
@@ -2205,7 +3716,7 @@ var GridComponent = function GridComponent(_ref) {
2205
3716
  },
2206
3717
  resolveClassName = _styles$className.className,
2207
3718
  styles = _styles$className.styles;
2208
- var classes = useClasses(resolveClassName, className);
3719
+ var classes = distExports.useClasses(resolveClassName, className);
2209
3720
  return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
2210
3721
  className: classes
2211
3722
  }, props), children, styles);
@@ -2238,7 +3749,7 @@ var GridContainerComponent = function GridContainerComponent(_ref) {
2238
3749
  },
2239
3750
  resolveClassName = _styles$className.className,
2240
3751
  styles = _styles$className.styles;
2241
- var classes = useClasses(resolveClassName, className);
3752
+ var classes = distExports.useClasses(resolveClassName, className);
2242
3753
  return /*#__PURE__*/React.createElement(GridBasicItem, _extends({
2243
3754
  className: classes
2244
3755
  }, props), children, styles);
@@ -2250,7 +3761,7 @@ Grid.Container = GridContainer;
2250
3761
 
2251
3762
  var SelectIconClear = function SelectIconClear(_ref) {
2252
3763
  var onClick = _ref.onClick;
2253
- var theme = useTheme();
3764
+ var theme = distExports.useTheme();
2254
3765
  var clickHandler = function clickHandler(event) {
2255
3766
  event.preventDefault();
2256
3767
  event.stopPropagation();
@@ -2286,7 +3797,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
2286
3797
  var disabled = _ref.disabled,
2287
3798
  onClear = _ref.onClear,
2288
3799
  children = _ref.children;
2289
- var theme = useTheme();
3800
+ var theme = distExports.useTheme();
2290
3801
  return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement("div", {
2291
3802
  className: _JSXStyle.dynamic([["3357578496", [theme.layout.radius, theme.palette.accents_2, disabled ? theme.palette.accents_4 : theme.palette.accents_6]]]) + " " + "item"
2292
3803
  }, children, !!onClear && /*#__PURE__*/React.createElement(MemoSelectIconClear, {
@@ -2335,18 +3846,6 @@ var getColors$1 = function getColors(palette, status) {
2335
3846
  return colors[status];
2336
3847
  };
2337
3848
 
2338
- var Ellipsis = function Ellipsis(_ref) {
2339
- var children = _ref.children,
2340
- height = _ref.height;
2341
- return /*#__PURE__*/React.createElement("span", {
2342
- className: _JSXStyle.dynamic([["822089635", [height]]])
2343
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
2344
- id: "822089635",
2345
- dynamic: [height]
2346
- }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
2347
- };
2348
- var Ellipsis$1 = /*#__PURE__*/React.memo(Ellipsis);
2349
-
2350
3849
  var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
2351
3850
  var visible = _ref.visible,
2352
3851
  onBlur = _ref.onBlur,
@@ -2408,7 +3907,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2408
3907
  _ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
2409
3908
  onDropdownVisibleChange = _ref$onDropdownVisibl === void 0 ? function () {} : _ref$onDropdownVisibl,
2410
3909
  props = _objectWithoutProperties(_ref, _excluded$c);
2411
- var theme = useTheme();
3910
+ var theme = distExports.useTheme();
2412
3911
  var _useScale = useScale(),
2413
3912
  SCALES = _useScale.SCALES;
2414
3913
  var ref = React.useRef(null);
@@ -2422,7 +3921,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2422
3921
  _useState4 = _slicedToArray(_useState3, 2),
2423
3922
  selectFocus = _useState4[0],
2424
3923
  setSelectFocus = _useState4[1];
2425
- var _useCurrentState = useCurrentState(function () {
3924
+ var _useCurrentState = distExports.useCurrentState(function () {
2426
3925
  if (!multiple) return init;
2427
3926
  if (Array.isArray(init)) return init;
2428
3927
  return typeof init === 'undefined' ? [] : [init];
@@ -2523,12 +4022,12 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2523
4022
  updateVisible(false);
2524
4023
  setSelectFocus(false);
2525
4024
  };
2526
- var classes = useClasses('select', {
4025
+ var classes = distExports.useClasses('select', {
2527
4026
  active: selectFocus || visible,
2528
4027
  multiple: multiple
2529
4028
  }, className);
2530
4029
  return /*#__PURE__*/React.createElement("div", {
2531
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
4030
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
2532
4031
  }, label && /*#__PURE__*/React.createElement("label", {
2533
4032
  style: {
2534
4033
  display: 'block',
@@ -2536,7 +4035,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2536
4035
  fontSize: '14px',
2537
4036
  fontWeight: 'light'
2538
4037
  },
2539
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
4038
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
2540
4039
  }, label), /*#__PURE__*/React.createElement(SelectContext.Provider, {
2541
4040
  value: initialValue
2542
4041
  }, /*#__PURE__*/React.createElement("div", _extends({
@@ -2544,7 +4043,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2544
4043
  onClick: clickHandler,
2545
4044
  onMouseDown: mouseDownHandler
2546
4045
  }, props, {
2547
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + (props && props.className != null && props.className || classes || "")
4046
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + (props && props.className != null && props.className || classes || "")
2548
4047
  }), /*#__PURE__*/React.createElement(SelectInput, {
2549
4048
  ref: inputRef,
2550
4049
  visible: visible,
@@ -2553,11 +4052,11 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2553
4052
  return setSelectFocus(true);
2554
4053
  }
2555
4054
  }), isEmpty && /*#__PURE__*/React.createElement("span", {
2556
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value placeholder"
2557
- }, /*#__PURE__*/React.createElement(Ellipsis$1, {
4055
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value placeholder"
4056
+ }, /*#__PURE__*/React.createElement(distExports.Ellipsis, {
2558
4057
  height: "var(--select-height)"
2559
4058
  }, placeholder)), value && !multiple && /*#__PURE__*/React.createElement("span", {
2560
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value"
4059
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "value"
2561
4060
  }, selectedChild), value && multiple && /*#__PURE__*/React.createElement(Grid.Container, {
2562
4061
  gap: 0.5
2563
4062
  }, selectedChild), /*#__PURE__*/React.createElement(SelectDropdown, {
@@ -2568,17 +4067,30 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2568
4067
  disableMatchWidth: disableMatchWidth,
2569
4068
  getPopupContainer: getPopupContainer
2570
4069
  }, children), !pure && /*#__PURE__*/React.createElement("div", {
2571
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "icon"
4070
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]]) + " " + "icon"
2572
4071
  }, /*#__PURE__*/React.createElement(Icon, {
2573
- className: _JSXStyle.dynamic([["3282295248", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
4072
+ className: _JSXStyle.dynamic([["2996243684", [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]]])
2574
4073
  })))), /*#__PURE__*/React.createElement(_JSXStyle, {
2575
- id: "3282295248",
4074
+ id: "2996243684",
2576
4075
  dynamic: [disabled ? 'not-allowed' : 'pointer', border, theme.layout.radius, disabled ? theme.palette.accents_1 : theme.palette.background, SCALES.font(0.875), SCALES.height(2.25), SCALES.width(1, 'initial'), SCALES.pt(0), SCALES.pr(0.334), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.334), SCALES.pr(0.334), SCALES.pb(0.334), SCALES.pl(0.667), disabled ? theme.palette.border : borderActive, disabled ? theme.palette.accents_5 : borderActive, disabled ? theme.palette.accents_4 : theme.palette.foreground, placeholderColor, theme.layout.gapQuarter, visible ? '180' : '0', iconBorder]
2577
4076
  }, ".select.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;position:relative;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";max-width:90vw;overflow:hidden;-webkit-transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;transition:border 150ms ease-in 0s,color 200ms ease-out 0s, box-shadow 200ms ease 0s;border:1px solid ").concat(border, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(disabled ? theme.palette.accents_1 : theme.palette.background, ";--select-font-size:").concat(SCALES.font(0.875), ";--select-height:").concat(SCALES.height(2.25), ";min-width:11.5em;width:").concat(SCALES.width(1, 'initial'), ";height:var(--select-height);padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.667), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.multiple.__jsx-style-dynamic-selector{height:auto;min-height:var(--select-height);padding:").concat(SCALES.pt(0.334), " ").concat(SCALES.pr(0.334), " ").concat(SCALES.pb(0.334), " ").concat(SCALES.pl(0.667), ";}.select.active.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover{border-color:").concat(disabled ? theme.palette.border : borderActive, ";}.select.active.icon.__jsx-style-dynamic-selector,.select.__jsx-style-dynamic-selector:hover .icon.__jsx-style-dynamic-selector{color:").concat(disabled ? theme.palette.accents_5 : borderActive, ";}.value.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex:1;-ms-flex:1;flex:1;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1;padding:0;margin-right:1.25em;font-size:var(--select-font-size);color:").concat(disabled ? theme.palette.accents_4 : theme.palette.foreground, ";width:calc(100% - 1.25em);}.value.__jsx-style-dynamic-selector>div,.value.__jsx-style-dynamic-selector>div:hover{border-radius:0;background-color:transparent;padding:0;margin:0;color:inherit;}.placeholder.__jsx-style-dynamic-selector{color:").concat(placeholderColor, ";}.icon.__jsx-style-dynamic-selector{position:absolute;right:").concat(theme.layout.gapQuarter, ";font-size:var(--select-font-size);top:50%;bottom:0;-webkit-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);-ms-transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);transform:translateY(-50%) rotate(").concat(visible ? '180' : '0', "deg);pointer-events:none;-webkit-transition:-webkit-transform 200ms ease;-webkit-transition:transform 200ms ease;transition:transform 200ms ease;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:").concat(iconBorder, ";}")));
2578
4077
  });
2579
4078
  SelectComponent.displayName = 'Select';
2580
4079
  var Select = withScale(SelectComponent);
2581
4080
 
4081
+ var warningStack = {};
4082
+ var useWarning = function useWarning(message, component) {
4083
+ var tag = component ? " [".concat(component, "]") : ' ';
4084
+ var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
4085
+ if (typeof console === 'undefined') return;
4086
+ if (warningStack[log]) return;
4087
+ warningStack[log] = true;
4088
+ if (process.env.NODE_ENV !== 'production') {
4089
+ return console.error(log);
4090
+ }
4091
+ console.warn(log);
4092
+ };
4093
+
2582
4094
  var _excluded$b = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
2583
4095
  var SelectOptionComponent = function SelectOptionComponent(_ref) {
2584
4096
  var identValue = _ref.value,
@@ -2594,7 +4106,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
2594
4106
  _ref$preventAllEvents = _ref.preventAllEvents,
2595
4107
  preventAllEvents = _ref$preventAllEvents === void 0 ? false : _ref$preventAllEvents,
2596
4108
  props = _objectWithoutProperties(_ref, _excluded$b);
2597
- var theme = useTheme();
4109
+ var theme = distExports.useTheme();
2598
4110
  var _useScale = useScale(),
2599
4111
  SCALES = _useScale.SCALES;
2600
4112
  var _useSelectContext = useSelectContext(),
@@ -2607,7 +4119,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
2607
4119
  var isLabel = React.useMemo(function () {
2608
4120
  return label || divider;
2609
4121
  }, [label, divider]);
2610
- var classes = useClasses('option', {
4122
+ var classes = distExports.useClasses('option', {
2611
4123
  divider: divider,
2612
4124
  label: label
2613
4125
  }, className);
@@ -2645,7 +4157,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
2645
4157
  onClick: clickHandler
2646
4158
  }, props, {
2647
4159
  className: _JSXStyle.dynamic([["199367556", [bgColor, color, isDisabled ? 'not-allowed' : 'pointer', SCALES.font(0.75), SCALES.width(1, '100%'), SCALES.height(2.25), SCALES.pt(0), SCALES.pr(0.667), SCALES.pb(0), SCALES.pl(0.667), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBgColor, theme.palette.accents_7, theme.palette.border, SCALES.width(1, '100%'), SCALES.height(1, 0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0.5), SCALES.mr(0), SCALES.mb(0.5), SCALES.ml(0), theme.palette.accents_7, theme.palette.border, SCALES.font(0.875), SCALES.width(1, '100%')]]]) + " " + (props && props.className != null && props.className || classes || "")
2648
- }), /*#__PURE__*/React.createElement(Ellipsis$1, {
4160
+ }), /*#__PURE__*/React.createElement(distExports.Ellipsis, {
2649
4161
  height: SCALES.height(2.25)
2650
4162
  }, children), /*#__PURE__*/React.createElement(_JSXStyle, {
2651
4163
  id: "199367556",
@@ -2676,7 +4188,7 @@ var makeColgroup = function makeColgroup(width, columns) {
2676
4188
  }));
2677
4189
  };
2678
4190
  var TableHead = function TableHead(props) {
2679
- var theme = useTheme();
4191
+ var theme = distExports.useTheme();
2680
4192
  var _ref = props,
2681
4193
  columns = _ref.columns,
2682
4194
  width = _ref.width,
@@ -2734,7 +4246,8 @@ var TableHead = function TableHead(props) {
2734
4246
  // }
2735
4247
  return /*#__PURE__*/React.createElement("th", {
2736
4248
  style: {
2737
- padding: '3px'
4249
+ padding: '3px',
4250
+ display: 'flex'
2738
4251
  },
2739
4252
  "data-column": Header
2740
4253
  }, accessor === 'fixed' && /*#__PURE__*/React.createElement(Select
@@ -20400,7 +21913,7 @@ var TextChild = function TextChild(_ref) {
20400
21913
  color = _ref$color === void 0 ? 'default' : _ref$color,
20401
21914
  props = _objectWithoutProperties(_ref, _excluded$a);
20402
21915
  var Component = tag;
20403
- var theme = useTheme();
21916
+ var theme = distExports.useTheme();
20404
21917
  var _useScale = useScale(),
20405
21918
  SCALES = _useScale.SCALES,
20406
21919
  getScaleProps = _useScale.getScaleProps;
@@ -20647,7 +22160,7 @@ var TableBody = function TableBody(_ref) {
20647
22160
  _ref$readOnly = _ref.readOnly,
20648
22161
  readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
20649
22162
  onSelected = _ref.onSelected;
20650
- var theme = useTheme();
22163
+ var theme = distExports.useTheme();
20651
22164
  var _useState = React.useState([]),
20652
22165
  _useState2 = _slicedToArray(_useState, 2),
20653
22166
  selected = _useState2[0],
@@ -20732,7 +22245,7 @@ var TableBody = function TableBody(_ref) {
20732
22245
  }
20733
22246
  }
20734
22247
  },
20735
- className: _JSXStyle.dynamic([["787902152", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
22248
+ className: _JSXStyle.dynamic([["787902152", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (distExports.useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
20736
22249
  }, /*#__PURE__*/React.createElement(TableCell, {
20737
22250
  columns: cols,
20738
22251
  row: rw,
@@ -20835,6 +22348,24 @@ var useRealShape = function useRealShape(ref) {
20835
22348
 
20836
22349
  /* "use client" */
20837
22350
 
22351
+ var useResize = function useResize(callback) {
22352
+ var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
22353
+ React.useEffect(function () {
22354
+ var fn = function fn() {
22355
+ return callback();
22356
+ };
22357
+ if (immediatelyInvoke) {
22358
+ fn();
22359
+ }
22360
+ window.addEventListener('resize', fn);
22361
+ return function () {
22362
+ return window.removeEventListener('resize', fn);
22363
+ };
22364
+ }, []);
22365
+ };
22366
+
22367
+ /* "use client" */
22368
+
20838
22369
  var TableColumn = function TableColumn(columnProps) {
20839
22370
  var _ref = columnProps,
20840
22371
  children = _ref.children,
@@ -30796,14 +32327,14 @@ var PaginationItem = function PaginationItem(_ref) {
30796
32327
  disabled = _ref.disabled,
30797
32328
  onClick = _ref.onClick,
30798
32329
  props = _objectWithoutProperties(_ref, _excluded$8);
30799
- var theme = useTheme();
32330
+ var theme = distExports.useTheme();
30800
32331
  var _useMemo = React.useMemo(function () {
30801
32332
  return [addColorAlpha(theme.palette.success, 0.1), addColorAlpha(theme.palette.success, 0.8)];
30802
32333
  }, [theme.palette.success]),
30803
32334
  _useMemo2 = _slicedToArray(_useMemo, 2),
30804
32335
  hover = _useMemo2[0],
30805
32336
  activeHover = _useMemo2[1];
30806
- var classes = useClasses({
32337
+ var classes = distExports.useClasses({
30807
32338
  active: active,
30808
32339
  disabled: disabled
30809
32340
  });
@@ -31027,7 +32558,7 @@ var PaginationComponent = function PaginationComponent(_ref) {
31027
32558
  props = _objectWithoutProperties(_ref, _excluded$5);
31028
32559
  var _useScale = useScale(),
31029
32560
  SCALES = _useScale.SCALES;
31030
- var _useCurrentState = useCurrentState(initialPage),
32561
+ var _useCurrentState = distExports.useCurrentState(initialPage),
31031
32562
  _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
31032
32563
  page = _useCurrentState2[0],
31033
32564
  setPage = _useCurrentState2[1],
@@ -31171,10 +32702,10 @@ var LoadingComponent = function LoadingComponent(_ref) {
31171
32702
  _ref$spaceRatio = _ref.spaceRatio,
31172
32703
  spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
31173
32704
  props = _objectWithoutProperties(_ref, _excluded$4);
31174
- var theme = useTheme();
32705
+ var theme = distExports.useTheme();
31175
32706
  var _useScale = useScale(),
31176
32707
  SCALES = _useScale.SCALES;
31177
- var classes = useClasses('loading-container', className);
32708
+ var classes = distExports.useClasses('loading-container', className);
31178
32709
  var bgColor = React.useMemo(function () {
31179
32710
  return getIconBgColor(type, theme.palette, color);
31180
32711
  }, [type, theme.palette, color]);
@@ -31219,7 +32750,7 @@ var ButtonIcon = function ButtonIcon(_ref) {
31219
32750
  _ref$className = _ref.className,
31220
32751
  className = _ref$className === void 0 ? '' : _ref$className,
31221
32752
  props = _objectWithoutProperties(_ref, _excluded$3);
31222
- var classes = useClasses('icon', {
32753
+ var classes = distExports.useClasses('icon', {
31223
32754
  right: isRight,
31224
32755
  single: isSingle
31225
32756
  }, className);
@@ -31237,7 +32768,7 @@ var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, childre
31237
32768
  var hasIcon = icon || iconRight;
31238
32769
  var isRight = Boolean(iconRight);
31239
32770
  var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
31240
- var classes = useClasses('text', isRight ? 'right' : 'left');
32771
+ var classes = distExports.useClasses('text', isRight ? 'right' : 'left');
31241
32772
  if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
31242
32773
  className: "text"
31243
32774
  }, children);
@@ -31467,7 +32998,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
31467
32998
 
31468
32999
  var _excluded$2 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
31469
33000
  var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
31470
- var theme = useTheme();
33001
+ var theme = distExports.useTheme();
31471
33002
  var _useScale = useScale(),
31472
33003
  SCALES = _useScale.SCALES;
31473
33004
  var buttonRef = React.useRef(null);
@@ -31567,7 +33098,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
31567
33098
  disabled: disabled,
31568
33099
  onClick: clickHandler
31569
33100
  }, props, {
31570
- className: _JSXStyle.dynamic([["1558010596", [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
33101
+ className: _JSXStyle.dynamic([["1558010596", [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || distExports.useClasses('btn', className) || "")
31571
33102
  }), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
31572
33103
  color: color
31573
33104
  }), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
@@ -31583,6 +33114,62 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
31583
33114
  ButtonComponent.displayName = 'Button';
31584
33115
  var Button = withScale(ButtonComponent);
31585
33116
 
33117
+ var useSSR = function useSSR() {
33118
+ var _useState = React.useState(false),
33119
+ _useState2 = _slicedToArray(_useState, 2),
33120
+ browser = _useState2[0],
33121
+ setBrowser = _useState2[1];
33122
+ React.useEffect(function () {
33123
+ setBrowser(isBrowser());
33124
+ }, []);
33125
+ return {
33126
+ isBrowser: browser,
33127
+ isServer: !browser
33128
+ };
33129
+ };
33130
+
33131
+ var createElement = function createElement(id) {
33132
+ var el = document.createElement('div');
33133
+ el.setAttribute('id', id);
33134
+ return el;
33135
+ };
33136
+ var usePortal = function usePortal() {
33137
+ var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
33138
+ var getContainer = arguments.length > 1 ? arguments[1] : undefined;
33139
+ var id = "helpdice-ui-".concat(selectId);
33140
+ var _useSSR = useSSR(),
33141
+ isBrowser = _useSSR.isBrowser;
33142
+ var _useState = React.useState(isBrowser ? createElement(id) : null),
33143
+ _useState2 = _slicedToArray(_useState, 2),
33144
+ elSnapshot = _useState2[0],
33145
+ setElSnapshot = _useState2[1];
33146
+ React.useEffect(function () {
33147
+ var customContainer = getContainer ? getContainer() : null;
33148
+ var parentElement = customContainer || document.body;
33149
+ var hasElement = parentElement.querySelector("#".concat(id));
33150
+ var el = hasElement || createElement(id);
33151
+ if (!hasElement) {
33152
+ parentElement.appendChild(el);
33153
+ }
33154
+ setElSnapshot(el);
33155
+ }, []);
33156
+ return elSnapshot;
33157
+ };
33158
+
33159
+ /* "use client" */
33160
+
33161
+ var useClickAnyWhere = function useClickAnyWhere(handler) {
33162
+ React.useEffect(function () {
33163
+ var callback = function callback(event) {
33164
+ return handler(event);
33165
+ };
33166
+ document.addEventListener('click', callback);
33167
+ return function () {
33168
+ return document.removeEventListener('click', callback);
33169
+ };
33170
+ }, [handler]);
33171
+ };
33172
+
31586
33173
  var getColors = function getColors(type, palette) {
31587
33174
  var colors = {
31588
33175
  "default": palette.background,
@@ -31764,7 +33351,7 @@ var getIconPosition = function getIconPosition(placement, offsetX, offsetY) {
31764
33351
  var TooltipIcon = function TooltipIcon(_ref) {
31765
33352
  var placement = _ref.placement,
31766
33353
  shadow = _ref.shadow;
31767
- var theme = useTheme();
33354
+ var theme = distExports.useTheme();
31768
33355
  var _useMemo = React.useMemo(function () {
31769
33356
  return getIconPosition(placement, 'var(--tooltip-icon-offset-x)', 'var(--tooltip-icon-offset-y)');
31770
33357
  }, [placement]),
@@ -31816,7 +33403,7 @@ var TooltipContent = function TooltipContent(_ref) {
31816
33403
  type = _ref.type,
31817
33404
  className = _ref.className,
31818
33405
  hideArrow = _ref.hideArrow;
31819
- var theme = useTheme();
33406
+ var theme = distExports.useTheme();
31820
33407
  var _useScale = useScale(),
31821
33408
  SCALES = _useScale.SCALES;
31822
33409
  var el = usePortal('tooltip');
@@ -31829,7 +33416,7 @@ var TooltipContent = function TooltipContent(_ref) {
31829
33416
  return getColors(type, theme.palette);
31830
33417
  }, [type, theme.palette]);
31831
33418
  var hasShadow = type === 'default';
31832
- var classes = useClasses('tooltip-content', className);
33419
+ var classes = distExports.useClasses('tooltip-content', className);
31833
33420
  if (!parent) return null;
31834
33421
  var updateRect = function updateRect() {
31835
33422
  var position = getPosition(placement, getRect(parent), offset);
@@ -31847,7 +33434,7 @@ var TooltipContent = function TooltipContent(_ref) {
31847
33434
  event.nativeEvent.stopImmediatePropagation();
31848
33435
  };
31849
33436
  if (!el) return null;
31850
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(CssTransition, {
33437
+ return /*#__PURE__*/require$$1.createPortal(/*#__PURE__*/React.createElement(distExports.CssTransition, {
31851
33438
  visible: visible
31852
33439
  }, /*#__PURE__*/React.createElement("div", {
31853
33440
  ref: selfRef,
@@ -31984,7 +33571,7 @@ var TooltipComponent = function TooltipComponent(_ref) {
31984
33571
  return mouseEventHandler(false);
31985
33572
  }
31986
33573
  }, props, {
31987
- className: "jsx-418573366" + " " + (props && props.className != null && props.className || useClasses('tooltip', className) || "")
33574
+ className: "jsx-418573366" + " " + (props && props.className != null && props.className || distExports.useClasses('tooltip', className) || "")
31988
33575
  }), children, /*#__PURE__*/React.createElement(TooltipContent, contentProps, text), /*#__PURE__*/React.createElement(_JSXStyle, {
31989
33576
  id: "418573366"
31990
33577
  }, ".tooltip.jsx-418573366{width:-webkit-max-content;width:-moz-max-content;width:max-content;display:inline-block;}"));