@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 _arrayLikeToArray(r, a) {
9
9
  (null == a || a > r.length) && (a = r.length);
@@ -166,15 +166,6 @@ function _toPropertyKey(t) {
166
166
  var i = _toPrimitive(t, "string");
167
167
  return "symbol" == typeof i ? i : i + "";
168
168
  }
169
- function _typeof(o) {
170
- "@babel/helpers - typeof";
171
-
172
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
173
- return typeof o;
174
- } : function (o) {
175
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
176
- }, _typeof(o);
177
- }
178
169
  function _unsupportedIterableToArray(r, a) {
179
170
  if (r) {
180
171
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
@@ -806,313 +797,2124 @@ function requireStyle () {
806
797
  var styleExports = requireStyle();
807
798
  var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
808
799
 
809
- var defaultFont = {
810
- sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
811
- mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
812
- prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
813
- };
814
- var defaultBreakpoints = {
815
- xs: {
816
- min: '0',
817
- max: '650px'
818
- },
819
- sm: {
820
- min: '650px',
821
- max: '900px'
822
- },
823
- md: {
824
- min: '900px',
825
- max: '1280px'
826
- },
827
- lg: {
828
- min: '1280px',
829
- max: '1920px'
830
- },
831
- xl: {
832
- min: '1920px',
833
- max: '10000px'
834
- }
835
- };
836
- var defaultLayout = {
837
- gap: '16pt',
838
- gapNegative: '-16pt',
839
- gapHalf: '8pt',
840
- gapHalfNegative: '-8pt',
841
- gapQuarter: '4pt',
842
- gapQuarterNegative: '-4pt',
843
- pageMargin: '16pt',
844
- pageWidth: '750pt',
845
- pageWidthWithMargin: '782pt',
846
- breakpointMobile: defaultBreakpoints.xs.max,
847
- breakpointTablet: defaultBreakpoints.sm.max,
848
- radius: '6px',
849
- unit: '16px'
850
- };
800
+ var dist = {};
851
801
 
852
- var palette$1 = {
853
- accents_1: '#fafafa',
854
- accents_2: '#eaeaea',
855
- accents_3: '#999',
856
- accents_4: '#888',
857
- accents_5: '#666',
858
- accents_6: '#444',
859
- accents_7: '#333',
860
- accents_8: '#111',
861
- background: '#fff',
862
- foreground: '#000',
863
- selection: '#79ffe1',
864
- secondary: '#666',
865
- code: '#f81ce5',
866
- border: '#eaeaea',
867
- error: '#e00',
868
- errorLight: '#ff1a1a',
869
- errorLighter: '#f7d4d6',
870
- errorDark: '#c50000',
871
- success: '#0070f3',
872
- successLight: '#3291ff',
873
- successLighter: '#d3e5ff',
874
- successDark: '#0761d1',
875
- warning: '#f5a623',
876
- warningLight: '#f7b955',
877
- warningLighter: '#ffefcf',
878
- warningDark: '#ab570a',
879
- cyan: '#50e3c2',
880
- cyanLighter: '#aaffec',
881
- cyanLight: '#79ffe1',
882
- cyanDark: '#29bc9b',
883
- violet: '#7928ca',
884
- violetLighter: '#e3d7fc',
885
- violetLight: '#8a63d2',
886
- violetDark: '#4c2889',
887
- purple: '#f81ce5',
888
- alert: '#ff0080',
889
- magenta: '#eb367f',
890
- link: '#0070f3'
891
- };
892
- var expressiveness$1 = {
893
- linkStyle: 'none',
894
- linkHoverStyle: 'none',
895
- dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
896
- scrollerStart: 'rgba(255, 255, 255, 1)',
897
- scrollerEnd: 'rgba(255, 255, 255, 0)',
898
- shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
899
- shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
900
- shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
901
- portalOpacity: 0.25
902
- };
903
- var font$1 = defaultFont;
904
- var breakpoints$1 = defaultBreakpoints;
905
- var layout$1 = defaultLayout;
906
- var themes$1 = {
907
- type: 'light',
908
- font: font$1,
909
- layout: layout$1,
910
- palette: palette$1,
911
- breakpoints: breakpoints$1,
912
- expressiveness: expressiveness$1
913
- };
802
+ var hasRequiredDist;
914
803
 
915
- var palette = {
916
- accents_1: '#111',
917
- accents_2: '#333',
918
- accents_3: '#444',
919
- accents_4: '#666',
920
- accents_5: '#888',
921
- accents_6: '#999',
922
- accents_7: '#eaeaea',
923
- accents_8: '#fafafa',
924
- background: '#000',
925
- foreground: '#fff',
926
- selection: '#f81ce5',
927
- secondary: '#888',
928
- code: '#79ffe1',
929
- border: '#333',
930
- error: '#e00',
931
- errorLighter: '#f7d4d6',
932
- errorLight: '#ff1a1a',
933
- errorDark: '#c50000',
934
- success: '#0070f3',
935
- successLighter: '#d3e5ff',
936
- successLight: '#3291ff',
937
- successDark: '#0761d1',
938
- warning: '#f5a623',
939
- warningLighter: '#ffefcf',
940
- warningLight: '#f7b955',
941
- warningDark: '#ab570a',
942
- cyan: '#50e3c2',
943
- cyanLighter: '#aaffec',
944
- cyanLight: '#79ffe1',
945
- cyanDark: '#29bc9b',
946
- violet: '#7928ca',
947
- violetLighter: '#e3d7fc',
948
- violetLight: '#8a63d2',
949
- violetDark: '#4c2889',
950
- purple: '#f81ce5',
951
- alert: '#ff0080',
952
- magenta: '#eb367f',
953
- link: '#3291ff'
954
- };
955
- var expressiveness = {
956
- linkStyle: 'none',
957
- linkHoverStyle: 'none',
958
- dropdownBoxShadow: '0 0 0 1px #333',
959
- scrollerStart: 'rgba(255, 255, 255, 1)',
960
- scrollerEnd: 'rgba(255, 255, 255, 0)',
961
- shadowSmall: '0 0 0 1px #333',
962
- shadowMedium: '0 0 0 1px #333',
963
- shadowLarge: '0 0 0 1px #333',
964
- portalOpacity: 0.75
965
- };
966
- var font = defaultFont;
967
- var breakpoints = defaultBreakpoints;
968
- var layout = defaultLayout;
969
- var themes = {
970
- type: 'dark',
971
- font: font,
972
- layout: layout,
973
- palette: palette,
974
- breakpoints: breakpoints,
975
- expressiveness: expressiveness
976
- };
804
+ function requireDist () {
805
+ if (hasRequiredDist) return dist;
806
+ hasRequiredDist = 1;
977
807
 
978
- var isObject = function isObject(target) {
979
- return target && _typeof(target) === 'object';
980
- };
981
- var _deepDuplicable = function deepDuplicable(source, target) {
982
- if (!isObject(target) || !isObject(source)) return source;
983
- var sourceKeys = Object.keys(source);
984
- var result = {};
985
- for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
986
- var key = _sourceKeys[_i];
987
- var sourceValue = source[key];
988
- var targetValue = target[key];
989
- if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
990
- result[key] = targetValue.concat(sourceValue);
991
- } else if (isObject(sourceValue) && isObject(targetValue)) {
992
- result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
993
- } else if (targetValue) {
994
- result[key] = targetValue;
995
- } else {
996
- result[key] = sourceValue;
997
- }
998
- }
999
- return result;
1000
- };
1001
- var getPresets = function getPresets() {
1002
- return [themes$1, themes];
1003
- };
1004
- var getPresetStaticTheme = function getPresetStaticTheme() {
1005
- return themes$1;
1006
- };
1007
- var isAvailableThemeType = function isAvailableThemeType(type) {
1008
- if (!type) return false;
1009
- var presetThemes = getPresets();
1010
- var hasType = presetThemes.find(function (theme) {
1011
- return theme.type === type;
1012
- });
1013
- return !hasType;
1014
- };
1015
- var isPresetTheme = function isPresetTheme(themeOrType) {
1016
- if (!themeOrType) return false;
1017
- var isType = typeof themeOrType === 'string';
1018
- var type = isType ? themeOrType : themeOrType.type;
1019
- return !isAvailableThemeType(type);
1020
- };
1021
- var hasUserCustomTheme = function hasUserCustomTheme() {
1022
- var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1023
- return !!themes.find(function (item) {
1024
- return isAvailableThemeType(item.type);
1025
- });
1026
- };
1027
- var create = function create(base, custom) {
1028
- if (!isAvailableThemeType(custom.type)) {
1029
- throw new Error('Duplicate or unavailable theme type');
1030
- }
1031
- return _deepDuplicable(base, custom);
1032
- };
1033
- var createFromDark = function createFromDark(custom) {
1034
- return create(themes, custom);
1035
- };
1036
- var createFromLight = function createFromLight(custom) {
1037
- return create(themes$1, custom);
1038
- };
1039
- var Themes = {
1040
- isPresetTheme: isPresetTheme,
1041
- isAvailableThemeType: isAvailableThemeType,
1042
- hasUserCustomTheme: hasUserCustomTheme,
1043
- getPresets: getPresets,
1044
- getPresetStaticTheme: getPresetStaticTheme,
1045
- create: create,
1046
- createFromDark: createFromDark,
1047
- createFromLight: createFromLight
1048
- };
808
+ var React$1 = React;
809
+ var reactDom = require$$1;
1049
810
 
1050
- /* "use client" */
811
+ function _arrayLikeToArray(r, a) {
812
+ (null == a || a > r.length) && (a = r.length);
813
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
814
+ return n;
815
+ }
816
+ function _arrayWithHoles(r) {
817
+ if (Array.isArray(r)) return r;
818
+ }
819
+ function _arrayWithoutHoles(r) {
820
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
821
+ }
822
+ function _defineProperty(e, r, t) {
823
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
824
+ value: t,
825
+ enumerable: true,
826
+ configurable: true,
827
+ writable: true
828
+ }) : e[r] = t, e;
829
+ }
830
+ function _extends() {
831
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
832
+ for (var e = 1; e < arguments.length; e++) {
833
+ var t = arguments[e];
834
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
835
+ }
836
+ return n;
837
+ }, _extends.apply(null, arguments);
838
+ }
839
+ function _iterableToArray(r) {
840
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
841
+ }
842
+ function _iterableToArrayLimit(r, l) {
843
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
844
+ if (null != t) {
845
+ var e,
846
+ n,
847
+ i,
848
+ u,
849
+ a = [],
850
+ f = true,
851
+ o = false;
852
+ try {
853
+ if (i = (t = t.call(r)).next, 0 === l) {
854
+ if (Object(t) !== t) return;
855
+ f = !1;
856
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
857
+ } catch (r) {
858
+ o = true, n = r;
859
+ } finally {
860
+ try {
861
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
862
+ } finally {
863
+ if (o) throw n;
864
+ }
865
+ }
866
+ return a;
867
+ }
868
+ }
869
+ function _nonIterableRest() {
870
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
871
+ }
872
+ function _nonIterableSpread() {
873
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
874
+ }
875
+ function ownKeys(e, r) {
876
+ var t = Object.keys(e);
877
+ if (Object.getOwnPropertySymbols) {
878
+ var o = Object.getOwnPropertySymbols(e);
879
+ r && (o = o.filter(function (r) {
880
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
881
+ })), t.push.apply(t, o);
882
+ }
883
+ return t;
884
+ }
885
+ function _objectSpread2(e) {
886
+ for (var r = 1; r < arguments.length; r++) {
887
+ var t = null != arguments[r] ? arguments[r] : {};
888
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
889
+ _defineProperty(e, r, t[r]);
890
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
891
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
892
+ });
893
+ }
894
+ return e;
895
+ }
896
+ function _objectWithoutProperties(e, t) {
897
+ if (null == e) return {};
898
+ var o,
899
+ r,
900
+ i = _objectWithoutPropertiesLoose(e, t);
901
+ if (Object.getOwnPropertySymbols) {
902
+ var n = Object.getOwnPropertySymbols(e);
903
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
904
+ }
905
+ return i;
906
+ }
907
+ function _objectWithoutPropertiesLoose(r, e) {
908
+ if (null == r) return {};
909
+ var t = {};
910
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
911
+ if (-1 !== e.indexOf(n)) continue;
912
+ t[n] = r[n];
913
+ }
914
+ return t;
915
+ }
916
+ function _slicedToArray(r, e) {
917
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
918
+ }
919
+ function _toConsumableArray(r) {
920
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
921
+ }
922
+ function _toPrimitive(t, r) {
923
+ if ("object" != typeof t || !t) return t;
924
+ var e = t[Symbol.toPrimitive];
925
+ if (void 0 !== e) {
926
+ var i = e.call(t, r);
927
+ if ("object" != typeof i) return i;
928
+ throw new TypeError("@@toPrimitive must return a primitive value.");
929
+ }
930
+ return ("string" === r ? String : Number)(t);
931
+ }
932
+ function _toPropertyKey(t) {
933
+ var i = _toPrimitive(t, "string");
934
+ return "symbol" == typeof i ? i : i + "";
935
+ }
936
+ function _typeof(o) {
937
+ "@babel/helpers - typeof";
1051
938
 
1052
- var defaultTheme = Themes.getPresetStaticTheme();
1053
- var ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
1054
- var useTheme = function useTheme() {
1055
- return React.useContext(ThemeContext);
1056
- };
939
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
940
+ return typeof o;
941
+ } : function (o) {
942
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
943
+ }, _typeof(o);
944
+ }
945
+ function _unsupportedIterableToArray(r, a) {
946
+ if (r) {
947
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
948
+ var t = {}.toString.call(r).slice(8, -1);
949
+ 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;
950
+ }
951
+ }
1057
952
 
1058
- var _excluded$b = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1059
- var CssTransition = function CssTransition(_ref) {
1060
- var children = _ref.children,
1061
- _ref$className = _ref.className,
1062
- className = _ref$className === void 0 ? '' : _ref$className,
1063
- _ref$visible = _ref.visible,
1064
- visible = _ref$visible === void 0 ? false : _ref$visible,
1065
- _ref$enterTime = _ref.enterTime,
1066
- enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1067
- _ref$leaveTime = _ref.leaveTime,
1068
- leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1069
- _ref$clearTime = _ref.clearTime,
1070
- clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1071
- _ref$name = _ref.name,
1072
- name = _ref$name === void 0 ? 'transition' : _ref$name,
1073
- props = _objectWithoutProperties(_ref, _excluded$b);
1074
- var _useState = React.useState(''),
1075
- _useState2 = _slicedToArray(_useState, 2),
1076
- classes = _useState2[0],
1077
- setClasses = _useState2[1];
1078
- var _useState3 = React.useState(visible),
1079
- _useState4 = _slicedToArray(_useState3, 2),
1080
- renderable = _useState4[0],
1081
- setRenderable = _useState4[1];
1082
- React.useEffect(function () {
1083
- var statusClassName = visible ? 'enter' : 'leave';
1084
- var time = visible ? enterTime : leaveTime;
1085
- if (visible && !renderable) {
1086
- setRenderable(true);
1087
- }
1088
- setClasses("".concat(name, "-").concat(statusClassName));
1089
-
1090
- // set class to active
1091
- var timer = setTimeout(function () {
1092
- setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1093
- clearTimeout(timer);
1094
- }, time);
1095
-
1096
- // remove classess when animation over
1097
- var clearClassesTimer = setTimeout(function () {
1098
- if (!visible) {
1099
- setClasses('');
1100
- setRenderable(false);
1101
- }
1102
- clearTimeout(clearClassesTimer);
1103
- }, time + clearTime);
1104
- return function () {
1105
- clearTimeout(timer);
1106
- clearTimeout(clearClassesTimer);
1107
- };
1108
- }, [visible, renderable]);
1109
- if (! /*#__PURE__*/React.isValidElement(children) || !renderable) return null;
1110
- var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1111
- className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1112
- });
1113
- return /*#__PURE__*/React.cloneElement(children, propsTransition);
1114
- };
1115
- CssTransition.displayName = 'CssTransition';
953
+ var defaultToastLayout = {
954
+ padding: '12px 16px',
955
+ margin: '8px 0',
956
+ width: '420px',
957
+ maxWidth: '90vw',
958
+ maxHeight: '75px',
959
+ placement: 'bottomRight'
960
+ };
961
+ var defaultParams = {
962
+ toasts: [],
963
+ toastLayout: defaultToastLayout,
964
+ updateToastLayout: function updateToastLayout(t) {
965
+ return t;
966
+ },
967
+ updateToasts: function updateToasts(t) {
968
+ return t;
969
+ },
970
+ lastUpdateToastId: null,
971
+ updateLastToastId: function updateLastToastId() {
972
+ return null;
973
+ }
974
+ };
975
+ var HUIContent = /*#__PURE__*/React$1.createContext(defaultParams);
976
+ var useHUIContext = function useHUIContext() {
977
+ return React$1.useContext(HUIContent);
978
+ };
979
+
980
+ var defaultFont = {
981
+ sans: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
982
+ mono: 'Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace',
983
+ prism: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,"Liberation Mono", "Courier New", monospace'
984
+ };
985
+ var defaultBreakpoints = {
986
+ xs: {
987
+ min: '0',
988
+ max: '650px'
989
+ },
990
+ sm: {
991
+ min: '650px',
992
+ max: '900px'
993
+ },
994
+ md: {
995
+ min: '900px',
996
+ max: '1280px'
997
+ },
998
+ lg: {
999
+ min: '1280px',
1000
+ max: '1920px'
1001
+ },
1002
+ xl: {
1003
+ min: '1920px',
1004
+ max: '10000px'
1005
+ }
1006
+ };
1007
+ var defaultLayout = {
1008
+ gap: '16pt',
1009
+ gapNegative: '-16pt',
1010
+ gapHalf: '8pt',
1011
+ gapHalfNegative: '-8pt',
1012
+ gapQuarter: '4pt',
1013
+ gapQuarterNegative: '-4pt',
1014
+ pageMargin: '16pt',
1015
+ pageWidth: '750pt',
1016
+ pageWidthWithMargin: '782pt',
1017
+ breakpointMobile: defaultBreakpoints.xs.max,
1018
+ breakpointTablet: defaultBreakpoints.sm.max,
1019
+ radius: '6px',
1020
+ unit: '16px'
1021
+ };
1022
+
1023
+ var palette$1 = {
1024
+ accents_1: '#fafafa',
1025
+ accents_2: '#eaeaea',
1026
+ accents_3: '#999',
1027
+ accents_4: '#888',
1028
+ accents_5: '#666',
1029
+ accents_6: '#444',
1030
+ accents_7: '#333',
1031
+ accents_8: '#111',
1032
+ background: '#fff',
1033
+ foreground: '#000',
1034
+ selection: '#79ffe1',
1035
+ secondary: '#666',
1036
+ code: '#f81ce5',
1037
+ border: '#eaeaea',
1038
+ error: '#e00',
1039
+ errorLight: '#ff1a1a',
1040
+ errorLighter: '#f7d4d6',
1041
+ errorDark: '#c50000',
1042
+ success: '#0070f3',
1043
+ successLight: '#3291ff',
1044
+ successLighter: '#d3e5ff',
1045
+ successDark: '#0761d1',
1046
+ warning: '#f5a623',
1047
+ warningLight: '#f7b955',
1048
+ warningLighter: '#ffefcf',
1049
+ warningDark: '#ab570a',
1050
+ cyan: '#50e3c2',
1051
+ cyanLighter: '#aaffec',
1052
+ cyanLight: '#79ffe1',
1053
+ cyanDark: '#29bc9b',
1054
+ violet: '#7928ca',
1055
+ violetLighter: '#e3d7fc',
1056
+ violetLight: '#8a63d2',
1057
+ violetDark: '#4c2889',
1058
+ purple: '#f81ce5',
1059
+ alert: '#ff0080',
1060
+ magenta: '#eb367f',
1061
+ link: '#0070f3'
1062
+ };
1063
+ var expressiveness$1 = {
1064
+ linkStyle: 'none',
1065
+ linkHoverStyle: 'none',
1066
+ dropdownBoxShadow: '0 4px 4px 0 rgba(0, 0, 0, 0.02)',
1067
+ scrollerStart: 'rgba(255, 255, 255, 1)',
1068
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
1069
+ shadowSmall: '0 5px 10px rgba(0, 0, 0, 0.12)',
1070
+ shadowMedium: '0 8px 30px rgba(0, 0, 0, 0.12)',
1071
+ shadowLarge: '0 30px 60px rgba(0, 0, 0, 0.12)',
1072
+ portalOpacity: 0.25
1073
+ };
1074
+ var font$1 = defaultFont;
1075
+ var breakpoints$1 = defaultBreakpoints;
1076
+ var layout$1 = defaultLayout;
1077
+ var themes$1 = {
1078
+ type: 'light',
1079
+ font: font$1,
1080
+ layout: layout$1,
1081
+ palette: palette$1,
1082
+ breakpoints: breakpoints$1,
1083
+ expressiveness: expressiveness$1
1084
+ };
1085
+
1086
+ var palette = {
1087
+ accents_1: '#111',
1088
+ accents_2: '#333',
1089
+ accents_3: '#444',
1090
+ accents_4: '#666',
1091
+ accents_5: '#888',
1092
+ accents_6: '#999',
1093
+ accents_7: '#eaeaea',
1094
+ accents_8: '#fafafa',
1095
+ background: '#000',
1096
+ foreground: '#fff',
1097
+ selection: '#f81ce5',
1098
+ secondary: '#888',
1099
+ code: '#79ffe1',
1100
+ border: '#333',
1101
+ error: '#e00',
1102
+ errorLighter: '#f7d4d6',
1103
+ errorLight: '#ff1a1a',
1104
+ errorDark: '#c50000',
1105
+ success: '#0070f3',
1106
+ successLighter: '#d3e5ff',
1107
+ successLight: '#3291ff',
1108
+ successDark: '#0761d1',
1109
+ warning: '#f5a623',
1110
+ warningLighter: '#ffefcf',
1111
+ warningLight: '#f7b955',
1112
+ warningDark: '#ab570a',
1113
+ cyan: '#50e3c2',
1114
+ cyanLighter: '#aaffec',
1115
+ cyanLight: '#79ffe1',
1116
+ cyanDark: '#29bc9b',
1117
+ violet: '#7928ca',
1118
+ violetLighter: '#e3d7fc',
1119
+ violetLight: '#8a63d2',
1120
+ violetDark: '#4c2889',
1121
+ purple: '#f81ce5',
1122
+ alert: '#ff0080',
1123
+ magenta: '#eb367f',
1124
+ link: '#3291ff'
1125
+ };
1126
+ var expressiveness = {
1127
+ linkStyle: 'none',
1128
+ linkHoverStyle: 'none',
1129
+ dropdownBoxShadow: '0 0 0 1px #333',
1130
+ scrollerStart: 'rgba(255, 255, 255, 1)',
1131
+ scrollerEnd: 'rgba(255, 255, 255, 0)',
1132
+ shadowSmall: '0 0 0 1px #333',
1133
+ shadowMedium: '0 0 0 1px #333',
1134
+ shadowLarge: '0 0 0 1px #333',
1135
+ portalOpacity: 0.75
1136
+ };
1137
+ var font = defaultFont;
1138
+ var breakpoints = defaultBreakpoints;
1139
+ var layout = defaultLayout;
1140
+ var themes = {
1141
+ type: 'dark',
1142
+ font: font,
1143
+ layout: layout,
1144
+ palette: palette,
1145
+ breakpoints: breakpoints,
1146
+ expressiveness: expressiveness
1147
+ };
1148
+
1149
+ var isObject = function isObject(target) {
1150
+ return target && _typeof(target) === 'object';
1151
+ };
1152
+ var _deepDuplicable = function deepDuplicable(source, target) {
1153
+ if (!isObject(target) || !isObject(source)) return source;
1154
+ var sourceKeys = Object.keys(source);
1155
+ var result = {};
1156
+ for (var _i = 0, _sourceKeys = sourceKeys; _i < _sourceKeys.length; _i++) {
1157
+ var key = _sourceKeys[_i];
1158
+ var sourceValue = source[key];
1159
+ var targetValue = target[key];
1160
+ if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
1161
+ result[key] = targetValue.concat(sourceValue);
1162
+ } else if (isObject(sourceValue) && isObject(targetValue)) {
1163
+ result[key] = _deepDuplicable(sourceValue, _objectSpread2({}, targetValue));
1164
+ } else if (targetValue) {
1165
+ result[key] = targetValue;
1166
+ } else {
1167
+ result[key] = sourceValue;
1168
+ }
1169
+ }
1170
+ return result;
1171
+ };
1172
+ var getPresets = function getPresets() {
1173
+ return [themes$1, themes];
1174
+ };
1175
+ var getPresetStaticTheme = function getPresetStaticTheme() {
1176
+ return themes$1;
1177
+ };
1178
+ var isAvailableThemeType = function isAvailableThemeType(type) {
1179
+ if (!type) return false;
1180
+ var presetThemes = getPresets();
1181
+ var hasType = presetThemes.find(function (theme) {
1182
+ return theme.type === type;
1183
+ });
1184
+ return !hasType;
1185
+ };
1186
+ var isPresetTheme = function isPresetTheme(themeOrType) {
1187
+ if (!themeOrType) return false;
1188
+ var isType = typeof themeOrType === 'string';
1189
+ var type = isType ? themeOrType : themeOrType.type;
1190
+ return !isAvailableThemeType(type);
1191
+ };
1192
+ var hasUserCustomTheme = function hasUserCustomTheme() {
1193
+ var themes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1194
+ return !!themes.find(function (item) {
1195
+ return isAvailableThemeType(item.type);
1196
+ });
1197
+ };
1198
+ var create = function create(base, custom) {
1199
+ if (!isAvailableThemeType(custom.type)) {
1200
+ throw new Error('Duplicate or unavailable theme type');
1201
+ }
1202
+ return _deepDuplicable(base, custom);
1203
+ };
1204
+ var createFromDark = function createFromDark(custom) {
1205
+ return create(themes, custom);
1206
+ };
1207
+ var createFromLight = function createFromLight(custom) {
1208
+ return create(themes$1, custom);
1209
+ };
1210
+ var Themes = {
1211
+ isPresetTheme: isPresetTheme,
1212
+ isAvailableThemeType: isAvailableThemeType,
1213
+ hasUserCustomTheme: hasUserCustomTheme,
1214
+ getPresets: getPresets,
1215
+ getPresetStaticTheme: getPresetStaticTheme,
1216
+ create: create,
1217
+ createFromDark: createFromDark,
1218
+ createFromLight: createFromLight
1219
+ };
1220
+
1221
+ /* "use client" */
1222
+
1223
+ var defaultTheme = Themes.getPresetStaticTheme();
1224
+ var ThemeContext = /*#__PURE__*/React$1.createContext(defaultTheme);
1225
+ var useTheme = function useTheme() {
1226
+ return React$1.useContext(ThemeContext);
1227
+ };
1228
+
1229
+ /* "use client" */
1230
+
1231
+ var defaultAllThemesConfig = {
1232
+ themes: Themes.getPresets()
1233
+ };
1234
+ var AllThemesContext = /*#__PURE__*/React$1.createContext(defaultAllThemesConfig);
1235
+ var useAllThemes = function useAllThemes() {
1236
+ return React$1.useContext(AllThemesContext);
1237
+ };
1238
+
1239
+ var ThemeProvider = function ThemeProvider(_ref) {
1240
+ var children = _ref.children,
1241
+ themeType = _ref.themeType,
1242
+ _ref$themes = _ref.themes,
1243
+ themes = _ref$themes === void 0 ? [] : _ref$themes;
1244
+ var _React$useState = React$1.useState({
1245
+ themes: Themes.getPresets()
1246
+ }),
1247
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1248
+ allThemes = _React$useState2[0],
1249
+ setAllThemes = _React$useState2[1];
1250
+ var currentTheme = React$1.useMemo(function () {
1251
+ var theme = allThemes.themes.find(function (item) {
1252
+ return item.type === themeType;
1253
+ });
1254
+ if (theme) return theme;
1255
+ return Themes.getPresetStaticTheme();
1256
+ }, [allThemes, themeType]);
1257
+ React$1.useEffect(function () {
1258
+ if (!(themes !== null && themes !== void 0 && themes.length)) return;
1259
+ setAllThemes(function (last) {
1260
+ var safeThemes = themes.filter(function (item) {
1261
+ return Themes.isAvailableThemeType(item.type);
1262
+ });
1263
+ var nextThemes = Themes.getPresets().concat(safeThemes);
1264
+ return _objectSpread2(_objectSpread2({}, last), {}, {
1265
+ themes: nextThemes
1266
+ });
1267
+ });
1268
+ }, [themes]);
1269
+ return /*#__PURE__*/React$1.createElement(AllThemesContext.Provider, {
1270
+ value: allThemes
1271
+ }, /*#__PURE__*/React$1.createElement(ThemeContext.Provider, {
1272
+ value: currentTheme
1273
+ }, children));
1274
+ };
1275
+
1276
+ var useCurrentState = function useCurrentState(initialState) {
1277
+ var _useState = React$1.useState(function () {
1278
+ return typeof initialState === 'function' ? initialState() : initialState;
1279
+ }),
1280
+ _useState2 = _slicedToArray(_useState, 2),
1281
+ state = _useState2[0],
1282
+ setState = _useState2[1];
1283
+ var ref = React$1.useRef(initialState);
1284
+ React$1.useEffect(function () {
1285
+ ref.current = state;
1286
+ }, [state]);
1287
+ var setValue = function setValue(val) {
1288
+ var result = typeof val === 'function' ? val(ref.current) : val;
1289
+ ref.current = result;
1290
+ setState(result);
1291
+ };
1292
+ return [state, setValue, ref];
1293
+ };
1294
+
1295
+ function getDefaultExportFromCjs (x) {
1296
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1297
+ }
1298
+
1299
+ var index = {};
1300
+
1301
+ var hasRequiredIndex;
1302
+
1303
+ function requireIndex () {
1304
+ if (hasRequiredIndex) return index;
1305
+ hasRequiredIndex = 1;
1306
+ var React$1$1 = React$1;
1307
+
1308
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
1309
+
1310
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1$1);
1311
+
1312
+ /*
1313
+ Based on Glamor's sheet
1314
+ https://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js
1315
+ */ function _defineProperties(target, props) {
1316
+ for(var i = 0; i < props.length; i++){
1317
+ var descriptor = props[i];
1318
+ descriptor.enumerable = descriptor.enumerable || false;
1319
+ descriptor.configurable = true;
1320
+ if ("value" in descriptor) descriptor.writable = true;
1321
+ Object.defineProperty(target, descriptor.key, descriptor);
1322
+ }
1323
+ }
1324
+ function _createClass(Constructor, protoProps, staticProps) {
1325
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1326
+ return Constructor;
1327
+ }
1328
+ var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
1329
+ var isString = function(o) {
1330
+ return Object.prototype.toString.call(o) === "[object String]";
1331
+ };
1332
+ var StyleSheet = /*#__PURE__*/ function() {
1333
+ function StyleSheet(param) {
1334
+ var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
1335
+ invariant$1(isString(name), "`name` must be a string");
1336
+ this._name = name;
1337
+ this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
1338
+ invariant$1(typeof optimizeForSpeed === "boolean", "`optimizeForSpeed` must be a boolean");
1339
+ this._optimizeForSpeed = optimizeForSpeed;
1340
+ this._serverSheet = undefined;
1341
+ this._tags = [];
1342
+ this._injected = false;
1343
+ this._rulesCount = 0;
1344
+ var node = typeof window !== "undefined" && document.querySelector('meta[property="csp-nonce"]');
1345
+ this._nonce = node ? node.getAttribute("content") : null;
1346
+ }
1347
+ var _proto = StyleSheet.prototype;
1348
+ _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {
1349
+ invariant$1(typeof bool === "boolean", "`setOptimizeForSpeed` accepts a boolean");
1350
+ invariant$1(this._rulesCount === 0, "optimizeForSpeed cannot be when rules have already been inserted");
1351
+ this.flush();
1352
+ this._optimizeForSpeed = bool;
1353
+ this.inject();
1354
+ };
1355
+ _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {
1356
+ return this._optimizeForSpeed;
1357
+ };
1358
+ _proto.inject = function inject() {
1359
+ var _this = this;
1360
+ invariant$1(!this._injected, "sheet already injected");
1361
+ this._injected = true;
1362
+ if (typeof window !== "undefined" && this._optimizeForSpeed) {
1363
+ this._tags[0] = this.makeStyleTag(this._name);
1364
+ this._optimizeForSpeed = "insertRule" in this.getSheet();
1365
+ if (!this._optimizeForSpeed) {
1366
+ if (!isProd) {
1367
+ console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.");
1368
+ }
1369
+ this.flush();
1370
+ this._injected = true;
1371
+ }
1372
+ return;
1373
+ }
1374
+ this._serverSheet = {
1375
+ cssRules: [],
1376
+ insertRule: function(rule, index) {
1377
+ if (typeof index === "number") {
1378
+ _this._serverSheet.cssRules[index] = {
1379
+ cssText: rule
1380
+ };
1381
+ } else {
1382
+ _this._serverSheet.cssRules.push({
1383
+ cssText: rule
1384
+ });
1385
+ }
1386
+ return index;
1387
+ },
1388
+ deleteRule: function(index) {
1389
+ _this._serverSheet.cssRules[index] = null;
1390
+ }
1391
+ };
1392
+ };
1393
+ _proto.getSheetForTag = function getSheetForTag(tag) {
1394
+ if (tag.sheet) {
1395
+ return tag.sheet;
1396
+ }
1397
+ // this weirdness brought to you by firefox
1398
+ for(var i = 0; i < document.styleSheets.length; i++){
1399
+ if (document.styleSheets[i].ownerNode === tag) {
1400
+ return document.styleSheets[i];
1401
+ }
1402
+ }
1403
+ };
1404
+ _proto.getSheet = function getSheet() {
1405
+ return this.getSheetForTag(this._tags[this._tags.length - 1]);
1406
+ };
1407
+ _proto.insertRule = function insertRule(rule, index) {
1408
+ invariant$1(isString(rule), "`insertRule` accepts only strings");
1409
+ if (typeof window === "undefined") {
1410
+ if (typeof index !== "number") {
1411
+ index = this._serverSheet.cssRules.length;
1412
+ }
1413
+ this._serverSheet.insertRule(rule, index);
1414
+ return this._rulesCount++;
1415
+ }
1416
+ if (this._optimizeForSpeed) {
1417
+ var sheet = this.getSheet();
1418
+ if (typeof index !== "number") {
1419
+ index = sheet.cssRules.length;
1420
+ }
1421
+ // this weirdness for perf, and chrome's weird bug
1422
+ // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule
1423
+ try {
1424
+ sheet.insertRule(rule, index);
1425
+ } catch (error) {
1426
+ if (!isProd) {
1427
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1428
+ }
1429
+ return -1;
1430
+ }
1431
+ } else {
1432
+ var insertionPoint = this._tags[index];
1433
+ this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));
1434
+ }
1435
+ return this._rulesCount++;
1436
+ };
1437
+ _proto.replaceRule = function replaceRule(index, rule) {
1438
+ if (this._optimizeForSpeed || typeof window === "undefined") {
1439
+ var sheet = typeof window !== "undefined" ? this.getSheet() : this._serverSheet;
1440
+ if (!rule.trim()) {
1441
+ rule = this._deletedRulePlaceholder;
1442
+ }
1443
+ if (!sheet.cssRules[index]) {
1444
+ // @TBD Should we throw an error?
1445
+ return index;
1446
+ }
1447
+ sheet.deleteRule(index);
1448
+ try {
1449
+ sheet.insertRule(rule, index);
1450
+ } catch (error) {
1451
+ if (!isProd) {
1452
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
1453
+ }
1454
+ // In order to preserve the indices we insert a deleteRulePlaceholder
1455
+ sheet.insertRule(this._deletedRulePlaceholder, index);
1456
+ }
1457
+ } else {
1458
+ var tag = this._tags[index];
1459
+ invariant$1(tag, "old rule at index `" + index + "` not found");
1460
+ tag.textContent = rule;
1461
+ }
1462
+ return index;
1463
+ };
1464
+ _proto.deleteRule = function deleteRule(index) {
1465
+ if (typeof window === "undefined") {
1466
+ this._serverSheet.deleteRule(index);
1467
+ return;
1468
+ }
1469
+ if (this._optimizeForSpeed) {
1470
+ this.replaceRule(index, "");
1471
+ } else {
1472
+ var tag = this._tags[index];
1473
+ invariant$1(tag, "rule at index `" + index + "` not found");
1474
+ tag.parentNode.removeChild(tag);
1475
+ this._tags[index] = null;
1476
+ }
1477
+ };
1478
+ _proto.flush = function flush() {
1479
+ this._injected = false;
1480
+ this._rulesCount = 0;
1481
+ if (typeof window !== "undefined") {
1482
+ this._tags.forEach(function(tag) {
1483
+ return tag && tag.parentNode.removeChild(tag);
1484
+ });
1485
+ this._tags = [];
1486
+ } else {
1487
+ // simpler on server
1488
+ this._serverSheet.cssRules = [];
1489
+ }
1490
+ };
1491
+ _proto.cssRules = function cssRules() {
1492
+ var _this = this;
1493
+ if (typeof window === "undefined") {
1494
+ return this._serverSheet.cssRules;
1495
+ }
1496
+ return this._tags.reduce(function(rules, tag) {
1497
+ if (tag) {
1498
+ rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {
1499
+ return rule.cssText === _this._deletedRulePlaceholder ? null : rule;
1500
+ }));
1501
+ } else {
1502
+ rules.push(null);
1503
+ }
1504
+ return rules;
1505
+ }, []);
1506
+ };
1507
+ _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {
1508
+ if (cssString) {
1509
+ invariant$1(isString(cssString), "makeStyleTag accepts only strings as second parameter");
1510
+ }
1511
+ var tag = document.createElement("style");
1512
+ if (this._nonce) tag.setAttribute("nonce", this._nonce);
1513
+ tag.type = "text/css";
1514
+ tag.setAttribute("data-" + name, "");
1515
+ if (cssString) {
1516
+ tag.appendChild(document.createTextNode(cssString));
1517
+ }
1518
+ var head = document.head || document.getElementsByTagName("head")[0];
1519
+ if (relativeToTag) {
1520
+ head.insertBefore(tag, relativeToTag);
1521
+ } else {
1522
+ head.appendChild(tag);
1523
+ }
1524
+ return tag;
1525
+ };
1526
+ _createClass(StyleSheet, [
1527
+ {
1528
+ key: "length",
1529
+ get: function get() {
1530
+ return this._rulesCount;
1531
+ }
1532
+ }
1533
+ ]);
1534
+ return StyleSheet;
1535
+ }();
1536
+ function invariant$1(condition, message) {
1537
+ if (!condition) {
1538
+ throw new Error("StyleSheet: " + message + ".");
1539
+ }
1540
+ }
1541
+
1542
+ function hash(str) {
1543
+ var _$hash = 5381, i = str.length;
1544
+ while(i){
1545
+ _$hash = _$hash * 33 ^ str.charCodeAt(--i);
1546
+ }
1547
+ /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
1548
+ * integers. Since we want the results to be always positive, convert the
1549
+ * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
1550
+ }
1551
+ var stringHash = hash;
1552
+
1553
+ var sanitize = function(rule) {
1554
+ return rule.replace(/\/style/gi, "\\/style");
1555
+ };
1556
+ var cache = {};
1557
+ /**
1558
+ * computeId
1559
+ *
1560
+ * Compute and memoize a jsx id from a basedId and optionally props.
1561
+ */ function computeId(baseId, props) {
1562
+ if (!props) {
1563
+ return "jsx-" + baseId;
1564
+ }
1565
+ var propsToString = String(props);
1566
+ var key = baseId + propsToString;
1567
+ if (!cache[key]) {
1568
+ cache[key] = "jsx-" + stringHash(baseId + "-" + propsToString);
1569
+ }
1570
+ return cache[key];
1571
+ }
1572
+ /**
1573
+ * computeSelector
1574
+ *
1575
+ * Compute and memoize dynamic selectors.
1576
+ */ function computeSelector(id, css) {
1577
+ var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;
1578
+ // Sanitize SSR-ed CSS.
1579
+ // Client side code doesn't need to be sanitized since we use
1580
+ // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).
1581
+ if (typeof window === "undefined") {
1582
+ css = sanitize(css);
1583
+ }
1584
+ var idcss = id + css;
1585
+ if (!cache[idcss]) {
1586
+ cache[idcss] = css.replace(selectoPlaceholderRegexp, id);
1587
+ }
1588
+ return cache[idcss];
1589
+ }
1590
+
1591
+ function mapRulesToStyle(cssRules, options) {
1592
+ if (options === void 0) options = {};
1593
+ return cssRules.map(function(args) {
1594
+ var id = args[0];
1595
+ var css = args[1];
1596
+ return /*#__PURE__*/ React__default["default"].createElement("style", {
1597
+ id: "__" + id,
1598
+ // Avoid warnings upon render with a key
1599
+ key: "__" + id,
1600
+ nonce: options.nonce ? options.nonce : undefined,
1601
+ dangerouslySetInnerHTML: {
1602
+ __html: css
1603
+ }
1604
+ });
1605
+ });
1606
+ }
1607
+ var StyleSheetRegistry = /*#__PURE__*/ function() {
1608
+ function StyleSheetRegistry(param) {
1609
+ var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
1610
+ this._sheet = styleSheet || new StyleSheet({
1611
+ name: "styled-jsx",
1612
+ optimizeForSpeed: optimizeForSpeed
1613
+ });
1614
+ this._sheet.inject();
1615
+ if (styleSheet && typeof optimizeForSpeed === "boolean") {
1616
+ this._sheet.setOptimizeForSpeed(optimizeForSpeed);
1617
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1618
+ }
1619
+ this._fromServer = undefined;
1620
+ this._indices = {};
1621
+ this._instancesCounts = {};
1622
+ }
1623
+ var _proto = StyleSheetRegistry.prototype;
1624
+ _proto.add = function add(props) {
1625
+ var _this = this;
1626
+ if (undefined === this._optimizeForSpeed) {
1627
+ this._optimizeForSpeed = Array.isArray(props.children);
1628
+ this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);
1629
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
1630
+ }
1631
+ if (typeof window !== "undefined" && !this._fromServer) {
1632
+ this._fromServer = this.selectFromServer();
1633
+ this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {
1634
+ acc[tagName] = 0;
1635
+ return acc;
1636
+ }, {});
1637
+ }
1638
+ var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;
1639
+ // Deduping: just increase the instances count.
1640
+ if (styleId in this._instancesCounts) {
1641
+ this._instancesCounts[styleId] += 1;
1642
+ return;
1643
+ }
1644
+ var indices = rules.map(function(rule) {
1645
+ return _this._sheet.insertRule(rule);
1646
+ })// Filter out invalid rules
1647
+ .filter(function(index) {
1648
+ return index !== -1;
1649
+ });
1650
+ this._indices[styleId] = indices;
1651
+ this._instancesCounts[styleId] = 1;
1652
+ };
1653
+ _proto.remove = function remove(props) {
1654
+ var _this = this;
1655
+ var styleId = this.getIdAndRules(props).styleId;
1656
+ invariant(styleId in this._instancesCounts, "styleId: `" + styleId + "` not found");
1657
+ this._instancesCounts[styleId] -= 1;
1658
+ if (this._instancesCounts[styleId] < 1) {
1659
+ var tagFromServer = this._fromServer && this._fromServer[styleId];
1660
+ if (tagFromServer) {
1661
+ tagFromServer.parentNode.removeChild(tagFromServer);
1662
+ delete this._fromServer[styleId];
1663
+ } else {
1664
+ this._indices[styleId].forEach(function(index) {
1665
+ return _this._sheet.deleteRule(index);
1666
+ });
1667
+ delete this._indices[styleId];
1668
+ }
1669
+ delete this._instancesCounts[styleId];
1670
+ }
1671
+ };
1672
+ _proto.update = function update(props, nextProps) {
1673
+ this.add(nextProps);
1674
+ this.remove(props);
1675
+ };
1676
+ _proto.flush = function flush() {
1677
+ this._sheet.flush();
1678
+ this._sheet.inject();
1679
+ this._fromServer = undefined;
1680
+ this._indices = {};
1681
+ this._instancesCounts = {};
1682
+ };
1683
+ _proto.cssRules = function cssRules() {
1684
+ var _this = this;
1685
+ var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {
1686
+ return [
1687
+ styleId,
1688
+ _this._fromServer[styleId]
1689
+ ];
1690
+ }) : [];
1691
+ var cssRules = this._sheet.cssRules();
1692
+ return fromServer.concat(Object.keys(this._indices).map(function(styleId) {
1693
+ return [
1694
+ styleId,
1695
+ _this._indices[styleId].map(function(index) {
1696
+ return cssRules[index].cssText;
1697
+ }).join(_this._optimizeForSpeed ? "" : "\n")
1698
+ ];
1699
+ })// filter out empty rules
1700
+ .filter(function(rule) {
1701
+ return Boolean(rule[1]);
1702
+ }));
1703
+ };
1704
+ _proto.styles = function styles(options) {
1705
+ return mapRulesToStyle(this.cssRules(), options);
1706
+ };
1707
+ _proto.getIdAndRules = function getIdAndRules(props) {
1708
+ var css = props.children, dynamic = props.dynamic, id = props.id;
1709
+ if (dynamic) {
1710
+ var styleId = computeId(id, dynamic);
1711
+ return {
1712
+ styleId: styleId,
1713
+ rules: Array.isArray(css) ? css.map(function(rule) {
1714
+ return computeSelector(styleId, rule);
1715
+ }) : [
1716
+ computeSelector(styleId, css)
1717
+ ]
1718
+ };
1719
+ }
1720
+ return {
1721
+ styleId: computeId(id),
1722
+ rules: Array.isArray(css) ? css : [
1723
+ css
1724
+ ]
1725
+ };
1726
+ };
1727
+ /**
1728
+ * selectFromServer
1729
+ *
1730
+ * Collects style tags from the document with id __jsx-XXX
1731
+ */ _proto.selectFromServer = function selectFromServer() {
1732
+ var elements = Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));
1733
+ return elements.reduce(function(acc, element) {
1734
+ var id = element.id.slice(2);
1735
+ acc[id] = element;
1736
+ return acc;
1737
+ }, {});
1738
+ };
1739
+ return StyleSheetRegistry;
1740
+ }();
1741
+ function invariant(condition, message) {
1742
+ if (!condition) {
1743
+ throw new Error("StyleSheetRegistry: " + message + ".");
1744
+ }
1745
+ }
1746
+ var StyleSheetContext = /*#__PURE__*/ React$1$1.createContext(null);
1747
+ StyleSheetContext.displayName = "StyleSheetContext";
1748
+ function createStyleRegistry() {
1749
+ return new StyleSheetRegistry();
1750
+ }
1751
+ function StyleRegistry(param) {
1752
+ var configuredRegistry = param.registry, children = param.children;
1753
+ var rootRegistry = React$1$1.useContext(StyleSheetContext);
1754
+ var ref = React$1$1.useState(function() {
1755
+ return rootRegistry || configuredRegistry || createStyleRegistry();
1756
+ }), registry = ref[0];
1757
+ return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
1758
+ value: registry
1759
+ }, children);
1760
+ }
1761
+ function useStyleRegistry() {
1762
+ return React$1$1.useContext(StyleSheetContext);
1763
+ }
1764
+
1765
+ // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
1766
+ // https://github.com/reactwg/react-18/discussions/110
1767
+ var useInsertionEffect = React__default["default"].useInsertionEffect || React$1$1.useLayoutEffect;
1768
+ var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
1769
+ function JSXStyle(props) {
1770
+ var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
1771
+ var insertionEffectCalled = React$1$1.useRef(false);
1772
+ // `registry` might not exist while server-side rendering
1773
+ if (!registry) {
1774
+ return null;
1775
+ }
1776
+ if (typeof window === "undefined") {
1777
+ registry.add(props);
1778
+ return null;
1779
+ }
1780
+ useInsertionEffect(function() {
1781
+ // ReactDOM removes all DOM during hydration in certain cases
1782
+ if (!document.head) {
1783
+ return;
1784
+ }
1785
+ registry.add(props);
1786
+ insertionEffectCalled.current = true;
1787
+ return function() {
1788
+ insertionEffectCalled.current = false;
1789
+ registry.remove(props);
1790
+ };
1791
+ }, [
1792
+ props.id,
1793
+ String(props.dynamic)
1794
+ ]);
1795
+ React$1$1.useLayoutEffect(function() {
1796
+ if (!document.head || insertionEffectCalled.current) {
1797
+ return;
1798
+ }
1799
+ registry.add(props);
1800
+ return function() {
1801
+ registry.remove(props);
1802
+ };
1803
+ // props.children can be string[], will be striped since id is identical
1804
+ }, [
1805
+ props.id,
1806
+ String(props.dynamic)
1807
+ ]);
1808
+ return null;
1809
+ }
1810
+ JSXStyle.dynamic = function(info) {
1811
+ return info.map(function(tagInfo) {
1812
+ var baseId = tagInfo[0];
1813
+ var props = tagInfo[1];
1814
+ return computeId(baseId, props);
1815
+ }).join(" ");
1816
+ };
1817
+
1818
+ index.StyleRegistry = StyleRegistry;
1819
+ index.createStyleRegistry = createStyleRegistry;
1820
+ index.style = JSXStyle;
1821
+ index.useStyleRegistry = useStyleRegistry;
1822
+ return index;
1823
+ }
1824
+
1825
+ var style;
1826
+ var hasRequiredStyle;
1827
+
1828
+ function requireStyle () {
1829
+ if (hasRequiredStyle) return style;
1830
+ hasRequiredStyle = 1;
1831
+ style = requireIndex().style;
1832
+ return style;
1833
+ }
1834
+
1835
+ var styleExports = requireStyle();
1836
+ var _JSXStyle = /*@__PURE__*/getDefaultExportFromCjs(styleExports);
1837
+
1838
+ /* "use client" */
1839
+
1840
+ var getId = function getId() {
1841
+ return Math.random().toString(32).slice(2, 10);
1842
+ };
1843
+ var isBrowser = function isBrowser() {
1844
+ return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1845
+ };
1846
+
1847
+ var useSSR = function useSSR() {
1848
+ var _useState = React$1.useState(false),
1849
+ _useState2 = _slicedToArray(_useState, 2),
1850
+ browser = _useState2[0],
1851
+ setBrowser = _useState2[1];
1852
+ React$1.useEffect(function () {
1853
+ setBrowser(isBrowser());
1854
+ }, []);
1855
+ return {
1856
+ isBrowser: browser,
1857
+ isServer: !browser
1858
+ };
1859
+ };
1860
+
1861
+ var createElement = function createElement(id) {
1862
+ var el = document.createElement('div');
1863
+ el.setAttribute('id', id);
1864
+ return el;
1865
+ };
1866
+ var usePortal = function usePortal() {
1867
+ var selectId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getId();
1868
+ var getContainer = arguments.length > 1 ? arguments[1] : undefined;
1869
+ var id = "helpdice-ui-".concat(selectId);
1870
+ var _useSSR = useSSR(),
1871
+ isBrowser = _useSSR.isBrowser;
1872
+ var _useState = React$1.useState(isBrowser ? createElement(id) : null),
1873
+ _useState2 = _slicedToArray(_useState, 2),
1874
+ elSnapshot = _useState2[0],
1875
+ setElSnapshot = _useState2[1];
1876
+ React$1.useEffect(function () {
1877
+ var customContainer = getContainer ? getContainer() : null;
1878
+ var parentElement = customContainer || document.body;
1879
+ var hasElement = parentElement.querySelector("#".concat(id));
1880
+ var el = hasElement || createElement(id);
1881
+ if (!hasElement) {
1882
+ parentElement.appendChild(el);
1883
+ }
1884
+ setElSnapshot(el);
1885
+ }, []);
1886
+ return elSnapshot;
1887
+ };
1888
+
1889
+ var _excluded$2 = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1890
+ var CssTransition = function CssTransition(_ref) {
1891
+ var children = _ref.children,
1892
+ _ref$className = _ref.className,
1893
+ className = _ref$className === void 0 ? '' : _ref$className,
1894
+ _ref$visible = _ref.visible,
1895
+ visible = _ref$visible === void 0 ? false : _ref$visible,
1896
+ _ref$enterTime = _ref.enterTime,
1897
+ enterTime = _ref$enterTime === void 0 ? 60 : _ref$enterTime,
1898
+ _ref$leaveTime = _ref.leaveTime,
1899
+ leaveTime = _ref$leaveTime === void 0 ? 60 : _ref$leaveTime,
1900
+ _ref$clearTime = _ref.clearTime,
1901
+ clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1902
+ _ref$name = _ref.name,
1903
+ name = _ref$name === void 0 ? 'transition' : _ref$name,
1904
+ props = _objectWithoutProperties(_ref, _excluded$2);
1905
+ var _useState = React$1.useState(''),
1906
+ _useState2 = _slicedToArray(_useState, 2),
1907
+ classes = _useState2[0],
1908
+ setClasses = _useState2[1];
1909
+ var _useState3 = React$1.useState(visible),
1910
+ _useState4 = _slicedToArray(_useState3, 2),
1911
+ renderable = _useState4[0],
1912
+ setRenderable = _useState4[1];
1913
+ React$1.useEffect(function () {
1914
+ var statusClassName = visible ? 'enter' : 'leave';
1915
+ var time = visible ? enterTime : leaveTime;
1916
+ if (visible && !renderable) {
1917
+ setRenderable(true);
1918
+ }
1919
+ setClasses("".concat(name, "-").concat(statusClassName));
1920
+
1921
+ // set class to active
1922
+ var timer = setTimeout(function () {
1923
+ setClasses("".concat(name, "-").concat(statusClassName, " ").concat(name, "-").concat(statusClassName, "-active"));
1924
+ clearTimeout(timer);
1925
+ }, time);
1926
+
1927
+ // remove classess when animation over
1928
+ var clearClassesTimer = setTimeout(function () {
1929
+ if (!visible) {
1930
+ setClasses('');
1931
+ setRenderable(false);
1932
+ }
1933
+ clearTimeout(clearClassesTimer);
1934
+ }, time + clearTime);
1935
+ return function () {
1936
+ clearTimeout(timer);
1937
+ clearTimeout(clearClassesTimer);
1938
+ };
1939
+ }, [visible, renderable]);
1940
+ if (! /*#__PURE__*/React$1.isValidElement(children) || !renderable) return null;
1941
+ var propsTransition = _objectSpread2(_objectSpread2({}, props), {}, {
1942
+ className: "".concat(children.props.className, " ").concat(className, " ").concat(classes)
1943
+ });
1944
+ return /*#__PURE__*/React$1.cloneElement(children, propsTransition);
1945
+ };
1946
+ CssTransition.displayName = 'CssTransition';
1947
+
1948
+ var tuple = function tuple() {
1949
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1950
+ args[_key] = arguments[_key];
1951
+ }
1952
+ return args;
1953
+ };
1954
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'abort', 'secondary-light', 'success-light', 'warning-light', 'error-light');
1955
+ tuple('default', 'secondary', 'success', 'warning', 'error');
1956
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite');
1957
+ tuple('default', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'alert', 'purple', 'violet', 'cyan');
1958
+ tuple('default', 'silent', 'prevent');
1959
+ tuple('hover', 'click');
1960
+ tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1961
+ tuple('start', 'center', 'end', 'left', 'right');
1962
+
1963
+ var makeToastActions = function makeToastActions(actions, cancelHandle) {
1964
+ var handler = function handler(event, userHandler) {
1965
+ userHandler && userHandler(event, cancelHandle);
1966
+ };
1967
+ if (!actions || !actions.length) return null;
1968
+ return actions.map(function (action, index) {
1969
+ return /*#__PURE__*/React$1.createElement("button", {
1970
+ color: action.passive ? 'default' : 'secondary',
1971
+ key: "action-".concat(index),
1972
+ onClick: function onClick(event) {
1973
+ return handler(event, action.handler);
1974
+ }
1975
+ }, action.name);
1976
+ });
1977
+ };
1978
+ var getColors = function getColors(palette, type) {
1979
+ var colors = {
1980
+ "default": palette.background,
1981
+ secondary: palette.secondary,
1982
+ success: palette.success,
1983
+ warning: palette.warning,
1984
+ error: palette.error
1985
+ };
1986
+ var isDefault = !type || type === 'default';
1987
+ if (isDefault) return {
1988
+ bgColor: colors["default"],
1989
+ color: palette.foreground
1990
+ };
1991
+ /**
1992
+ * Prevent main color change in special types.
1993
+ * The color will only follow the theme when it is in the default type.
1994
+ */
1995
+ return {
1996
+ bgColor: colors[type],
1997
+ color: 'white'
1998
+ };
1999
+ };
2000
+ tuple('topLeft', 'topRight', 'bottomLeft', 'bottomRight');
2001
+ var isTopPlacement = function isTopPlacement(placement) {
2002
+ return "".concat(placement).toLowerCase().startsWith('top');
2003
+ };
2004
+ var isLeftPlacement = function isLeftPlacement(placement) {
2005
+ return "".concat(placement).toLowerCase().endsWith('left');
2006
+ };
2007
+ var getTranslateByPlacement = function getTranslateByPlacement(placement) {
2008
+ var translateInByPlacement = {
2009
+ topLeft: 'translate(-60px, -60px)',
2010
+ topRight: 'translate(60px, -60px)',
2011
+ bottomLeft: 'translate(-60px, 60px)',
2012
+ bottomRight: 'translate(60px, 60px)'
2013
+ };
2014
+ var translateOutByPlacement = {
2015
+ topLeft: 'translate(-50px, 15px) scale(0.85)',
2016
+ topRight: 'translate(50px, 15px) scale(0.85)',
2017
+ bottomLeft: 'translate(-50px, -15px) scale(0.85)',
2018
+ bottomRight: 'translate(50px, -15px) scale(0.85)'
2019
+ };
2020
+ return {
2021
+ enter: translateInByPlacement[placement],
2022
+ leave: translateOutByPlacement[placement]
2023
+ };
2024
+ };
2025
+
2026
+ var ToastItem = /*#__PURE__*/React$1.memo(function (_ref) {
2027
+ var toast = _ref.toast,
2028
+ layout = _ref.layout;
2029
+ var theme = useTheme();
2030
+ var _useMemo = React$1.useMemo(function () {
2031
+ return getColors(theme.palette, toast.type);
2032
+ }, [theme.palette, toast.type]),
2033
+ color = _useMemo.color,
2034
+ bgColor = _useMemo.bgColor;
2035
+ var isReactNode = typeof toast.text !== 'string';
2036
+ var padding = layout.padding,
2037
+ margin = layout.margin,
2038
+ maxHeight = layout.maxHeight,
2039
+ maxWidth = layout.maxWidth,
2040
+ width = layout.width,
2041
+ placement = layout.placement;
2042
+ var _useMemo2 = React$1.useMemo(function () {
2043
+ return getTranslateByPlacement(placement);
2044
+ }, [placement]),
2045
+ enter = _useMemo2.enter,
2046
+ leave = _useMemo2.leave;
2047
+ return /*#__PURE__*/React$1.createElement(CssTransition, {
2048
+ name: "toast",
2049
+ visible: toast.visible,
2050
+ clearTime: 350
2051
+ }, /*#__PURE__*/React$1.createElement("div", {
2052
+ key: toast.id,
2053
+ 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"
2054
+ }, isReactNode ? toast.text : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
2055
+ 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"
2056
+ }, toast.text), /*#__PURE__*/React$1.createElement("div", {
2057
+ 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"
2058
+ }, makeToastActions(toast.actions, toast.cancel))), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2059
+ id: "1407001838",
2060
+ dynamic: [width, maxWidth, maxHeight, theme.palette.foreground, bgColor, color, theme.layout.radius, theme.expressiveness.shadowSmall, theme.layout.gapHalf, enter, margin, padding, margin, padding, leave]
2061
+ }, ".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, ";}"))));
2062
+ });
2063
+
2064
+ /* "use client" */
2065
+
2066
+ var classObjectToString = function classObjectToString(className) {
2067
+ var keys = Object.keys(className);
2068
+ var len = keys.length;
2069
+ var str = '';
2070
+ for (var index = 0; index < len; index++) {
2071
+ var key = keys[index];
2072
+ var val = className[keys[index]];
2073
+ if (!val) continue;
2074
+ str = str ? "".concat(str, " ").concat(String(key)) : String(key);
2075
+ }
2076
+ return str;
2077
+ };
2078
+ var isObjectClassName = function isObjectClassName(value) {
2079
+ return _typeof(value) === 'object' && !Array.isArray(value);
2080
+ };
2081
+ var useClasses = function useClasses() {
2082
+ var len = arguments.length;
2083
+ var classes = '';
2084
+ if (len === 0) return classes;
2085
+ for (var index = 0; index < len; index++) {
2086
+ var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
2087
+ if (!val) continue;
2088
+ if (isObjectClassName(val)) {
2089
+ classes += " ".concat(classObjectToString(val));
2090
+ } else {
2091
+ classes += " ".concat(String(val).trim());
2092
+ }
2093
+ }
2094
+ return classes.trim();
2095
+ };
2096
+
2097
+ var ToastContainer = function ToastContainer() {
2098
+ var theme = useTheme();
2099
+ var portal = usePortal('toast');
2100
+ var _useCurrentState = useCurrentState(false),
2101
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2102
+ setHovering = _useCurrentState2[1],
2103
+ hoveringRef = _useCurrentState2[2];
2104
+ var _useHUIContext = useHUIContext(),
2105
+ toasts = _useHUIContext.toasts,
2106
+ updateToasts = _useHUIContext.updateToasts,
2107
+ toastLayout = _useHUIContext.toastLayout,
2108
+ lastUpdateToastId = _useHUIContext.lastUpdateToastId;
2109
+ var memoizedLayout = React$1.useMemo(function () {
2110
+ return toastLayout;
2111
+ }, [toastLayout]);
2112
+ var toastElements = React$1.useMemo(function () {
2113
+ return toasts.map(function (toast) {
2114
+ return /*#__PURE__*/React$1.createElement(ToastItem, {
2115
+ toast: toast,
2116
+ layout: memoizedLayout,
2117
+ key: toast._internalIdent
2118
+ });
2119
+ });
2120
+ }, [toasts, memoizedLayout]);
2121
+ var classNames = React$1.useMemo(function () {
2122
+ return useClasses('toasts', {
2123
+ top: isTopPlacement(toastLayout.placement),
2124
+ left: isLeftPlacement(toastLayout.placement)
2125
+ });
2126
+ }, [memoizedLayout]);
2127
+ var hoverHandler = function hoverHandler(isHovering) {
2128
+ setHovering(isHovering);
2129
+ if (isHovering) {
2130
+ return updateToasts(function (last) {
2131
+ return last.map(function (toast) {
2132
+ if (!toast.visible) return toast;
2133
+ toast._timeout && window.clearTimeout(toast._timeout);
2134
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2135
+ timeout: null
2136
+ });
2137
+ });
2138
+ });
2139
+ }
2140
+ updateToasts(function (last) {
2141
+ return last.map(function (toast, index) {
2142
+ if (!toast.visible) return toast;
2143
+ toast._timeout && window.clearTimeout(toast._timeout);
2144
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2145
+ _timeout: function () {
2146
+ var timer = window.setTimeout(function () {
2147
+ toast.cancel();
2148
+ window.clearTimeout(timer);
2149
+ }, toast.delay + index * 100);
2150
+ return timer;
2151
+ }()
2152
+ });
2153
+ });
2154
+ });
2155
+ };
2156
+ React$1.useEffect(function () {
2157
+ var index = toasts.findIndex(function (r) {
2158
+ return r._internalIdent === lastUpdateToastId;
2159
+ });
2160
+ var toast = toasts[index];
2161
+ if (!toast || toast.visible || !hoveringRef.current) return;
2162
+ var hasVisible = toasts.find(function (r, i) {
2163
+ return i < index && r.visible;
2164
+ });
2165
+ if (hasVisible || !hoveringRef.current) return;
2166
+ hoverHandler(false);
2167
+ }, [toasts, lastUpdateToastId]);
2168
+ React$1.useEffect(function () {
2169
+ var timeout = null;
2170
+ var timer = window.setInterval(function () {
2171
+ if (toasts.length === 0) return;
2172
+ timeout = window.setTimeout(function () {
2173
+ var allInvisible = !toasts.find(function (r) {
2174
+ return r.visible;
2175
+ });
2176
+ allInvisible && updateToasts(function () {
2177
+ return [];
2178
+ });
2179
+ timeout && clearTimeout(timeout);
2180
+ }, 350);
2181
+ }, 5000);
2182
+ return function () {
2183
+ timer && clearInterval(timer);
2184
+ timeout && clearTimeout(timeout);
2185
+ };
2186
+ }, [toasts]);
2187
+ if (!portal) return null;
2188
+ if (!toasts || toasts.length === 0) return null;
2189
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement("div", {
2190
+ onMouseEnter: function onMouseEnter() {
2191
+ return hoverHandler(true);
2192
+ },
2193
+ onMouseLeave: function onMouseLeave() {
2194
+ return hoverHandler(false);
2195
+ },
2196
+ className: _JSXStyle.dynamic([["622610754", [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]]]) + " " + (classNames || "")
2197
+ }, toastElements, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2198
+ id: "622610754",
2199
+ dynamic: [theme.layout.gap, theme.layout.gap, theme.layout.gap, theme.layout.gap]
2200
+ }, ".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);
2201
+ };
2202
+
2203
+ var HuiProvider = function HuiProvider(_ref) {
2204
+ var themes = _ref.themes,
2205
+ themeType = _ref.themeType,
2206
+ children = _ref.children;
2207
+ var _React$useState = React$1.useState(''),
2208
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2209
+ lastUpdateToastId = _React$useState2[0],
2210
+ setLastUpdateToastId = _React$useState2[1];
2211
+ var _useCurrentState = useCurrentState([]),
2212
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2213
+ toasts = _useCurrentState2[0],
2214
+ setToasts = _useCurrentState2[1],
2215
+ toastsRef = _useCurrentState2[2];
2216
+ var _useCurrentState3 = useCurrentState(defaultToastLayout),
2217
+ _useCurrentState4 = _slicedToArray(_useCurrentState3, 3),
2218
+ toastLayout = _useCurrentState4[0],
2219
+ setToastLayout = _useCurrentState4[1],
2220
+ toastLayoutRef = _useCurrentState4[2];
2221
+ var updateToasts = function updateToasts(fn) {
2222
+ var nextToasts = fn(toastsRef.current);
2223
+ setToasts(nextToasts);
2224
+ };
2225
+ var updateToastLayout = function updateToastLayout(fn) {
2226
+ var nextLayout = fn(toastLayoutRef.current);
2227
+ setToastLayout(nextLayout);
2228
+ };
2229
+ var updateLastToastId = function updateLastToastId(fn) {
2230
+ setLastUpdateToastId(fn());
2231
+ };
2232
+ var initialValue = React$1.useMemo(function () {
2233
+ return {
2234
+ toasts: toasts,
2235
+ toastLayout: toastLayout,
2236
+ updateToasts: updateToasts,
2237
+ lastUpdateToastId: lastUpdateToastId,
2238
+ updateToastLayout: updateToastLayout,
2239
+ updateLastToastId: updateLastToastId
2240
+ };
2241
+ }, [toasts, toastLayout, lastUpdateToastId]);
2242
+ return /*#__PURE__*/React$1.createElement(HUIContent.Provider, {
2243
+ value: initialValue
2244
+ }, /*#__PURE__*/React$1.createElement(ThemeProvider, {
2245
+ themes: themes,
2246
+ themeType: themeType
2247
+ }, children, /*#__PURE__*/React$1.createElement(ToastContainer, null)));
2248
+ };
2249
+
2250
+ // import flush from 'styled-jsx'
2251
+
2252
+ // export type FlushToReact = <T>(opts?: { nonce?: string }) => Array<ReactElement<T>>
2253
+
2254
+ // export type FlushToHTML = (opts?: { nonce?: string }) => string
2255
+
2256
+ var CssBaseline = function CssBaseline(_ref) {
2257
+ var children = _ref.children;
2258
+ var theme = useTheme();
2259
+ return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2260
+ id: "3647548829",
2261
+ 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]
2262
+ }, "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, ";}")));
2263
+ };
2264
+ var MemoCssBaseline = /*#__PURE__*/React$1.memo(CssBaseline);
2265
+
2266
+ var getElementOffset = function getElementOffset(el) {
2267
+ if (!el) return {
2268
+ top: 0,
2269
+ left: 0
2270
+ };
2271
+ var _el$getBoundingClient = el.getBoundingClientRect(),
2272
+ top = _el$getBoundingClient.top,
2273
+ left = _el$getBoundingClient.left;
2274
+ return {
2275
+ top: top,
2276
+ left: left
2277
+ };
2278
+ };
2279
+ var defaultRect$1 = {
2280
+ top: -1e3,
2281
+ left: -1e3,
2282
+ right: -1e3,
2283
+ width: 0,
2284
+ height: 0,
2285
+ elementTop: -1e3
2286
+ };
2287
+ var getRectFromDOMWithContainer = function getRectFromDOMWithContainer(domRect, getContainer) {
2288
+ if (!domRect) return defaultRect$1;
2289
+ var container = getContainer ? getContainer() : null;
2290
+ var scrollElement = container || document.documentElement;
2291
+ var _getElementOffset = getElementOffset(container),
2292
+ offsetTop = _getElementOffset.top,
2293
+ offsetLeft = _getElementOffset.left;
2294
+ return _objectSpread2(_objectSpread2({}, domRect), {}, {
2295
+ width: domRect.width || domRect.right - domRect.left,
2296
+ height: domRect.height || domRect.top - domRect.bottom,
2297
+ top: domRect.bottom + scrollElement.scrollTop - offsetTop,
2298
+ left: domRect.left + scrollElement.scrollLeft - offsetLeft,
2299
+ elementTop: domRect.top + scrollElement.scrollTop - offsetTop
2300
+ });
2301
+ };
2302
+ var isUnplacedRect = function isUnplacedRect(rect) {
2303
+ if (!rect) return true;
2304
+ return rect.top === defaultRect$1.top && rect.left === defaultRect$1.left;
2305
+ };
2306
+ var getRefRect = function getRefRect(ref, getContainer) {
2307
+ if (!ref || !ref.current) return defaultRect$1;
2308
+ var rect = ref.current.getBoundingClientRect();
2309
+ return getRectFromDOMWithContainer(rect, getContainer);
2310
+ };
2311
+ var getEventRect = function getEventRect(event, getContainer) {
2312
+ var _event$target;
2313
+ var rect = event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getBoundingClientRect();
2314
+ if (!rect) return defaultRect$1;
2315
+ return getRectFromDOMWithContainer(rect, getContainer);
2316
+ };
2317
+ var isRefTarget = function isRefTarget(eventOrRef) {
2318
+ return typeof (eventOrRef === null || eventOrRef === void 0 ? void 0 : eventOrRef.target) === 'undefined';
2319
+ };
2320
+ var useRect = function useRect(initialState) {
2321
+ var _useState = React$1.useState(initialState || defaultRect$1),
2322
+ _useState2 = _slicedToArray(_useState, 2),
2323
+ rect = _useState2[0],
2324
+ setRect = _useState2[1];
2325
+ var updateRect = function updateRect(eventOrRef, getContainer) {
2326
+ if (isRefTarget(eventOrRef)) return setRect(getRefRect(eventOrRef, getContainer));
2327
+ setRect(getEventRect(eventOrRef, getContainer));
2328
+ };
2329
+ return {
2330
+ rect: rect,
2331
+ setRect: updateRect
2332
+ };
2333
+ };
2334
+
2335
+ var defaultToast = {
2336
+ delay: 2000,
2337
+ type: 'default'
2338
+ };
2339
+ var useToasts = function useToasts(layout) {
2340
+ var _useHUIContext = useHUIContext(),
2341
+ updateToasts = _useHUIContext.updateToasts,
2342
+ toasts = _useHUIContext.toasts,
2343
+ updateToastLayout = _useHUIContext.updateToastLayout,
2344
+ updateLastToastId = _useHUIContext.updateLastToastId;
2345
+ React$1.useEffect(function () {
2346
+ if (!layout) return;
2347
+ updateToastLayout(function () {
2348
+ return layout ? _objectSpread2(_objectSpread2({}, defaultToastLayout), layout) : defaultToastLayout;
2349
+ });
2350
+ }, []);
2351
+ var _cancel = function cancel(internalId) {
2352
+ updateToasts(function (currentToasts) {
2353
+ return currentToasts.map(function (item) {
2354
+ if (item._internalIdent !== internalId) return item;
2355
+ return _objectSpread2(_objectSpread2({}, item), {}, {
2356
+ visible: false
2357
+ });
2358
+ });
2359
+ });
2360
+ updateLastToastId(function () {
2361
+ return internalId;
2362
+ });
2363
+ };
2364
+ var removeAll = function removeAll() {
2365
+ updateToasts(function (last) {
2366
+ return last.map(function (toast) {
2367
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2368
+ visible: false
2369
+ });
2370
+ });
2371
+ });
2372
+ };
2373
+ var findToastOneByID = function findToastOneByID(id) {
2374
+ return toasts.find(function (t) {
2375
+ return t.id === id;
2376
+ });
2377
+ };
2378
+ var removeToastOneByID = function removeToastOneByID(id) {
2379
+ updateToasts(function (last) {
2380
+ return last.map(function (toast) {
2381
+ if (toast.id !== id) return toast;
2382
+ return _objectSpread2(_objectSpread2({}, toast), {}, {
2383
+ visible: false
2384
+ });
2385
+ });
2386
+ });
2387
+ };
2388
+ var setToast = function setToast(toast) {
2389
+ var internalIdent = "toast-".concat(getId());
2390
+ var delay = toast.delay || defaultToast.delay;
2391
+ if (toast.id) {
2392
+ var hasIdent = toasts.find(function (t) {
2393
+ return t.id === toast.id;
2394
+ });
2395
+ if (hasIdent) {
2396
+ throw new Error('Toast: Already have the same key: "ident"');
2397
+ }
2398
+ }
2399
+ updateToasts(function (last) {
2400
+ var newToast = {
2401
+ delay: delay,
2402
+ text: toast.text,
2403
+ visible: true,
2404
+ type: toast.type || defaultToast.type,
2405
+ id: toast.id || internalIdent,
2406
+ actions: toast.actions || [],
2407
+ _internalIdent: internalIdent,
2408
+ _timeout: window.setTimeout(function () {
2409
+ _cancel(internalIdent);
2410
+ if (newToast._timeout) {
2411
+ window.clearTimeout(newToast._timeout);
2412
+ newToast._timeout = null;
2413
+ }
2414
+ }, delay),
2415
+ cancel: function cancel() {
2416
+ return _cancel(internalIdent);
2417
+ }
2418
+ };
2419
+ return [].concat(_toConsumableArray(last), [newToast]);
2420
+ });
2421
+ };
2422
+ return {
2423
+ toasts: toasts,
2424
+ setToast: setToast,
2425
+ removeAll: removeAll,
2426
+ findToastOneByID: findToastOneByID,
2427
+ removeToastOneByID: removeToastOneByID
2428
+ };
2429
+ };
2430
+
2431
+ tuple('xs', 'sm', 'md', 'lg', 'xl', 'mobile');
2432
+ tuple('up', 'down', 'default');
2433
+ var defaultResponsiveOptions = {
2434
+ match: 'default'
2435
+ };
2436
+ var makeQueries = function makeQueries(bp, up, down) {
2437
+ var queryString = function queryString(item) {
2438
+ var upQuery = "(min-width: ".concat(item.min, ")");
2439
+ var downQuery = "(max-width: ".concat(item.max, ")");
2440
+ return up ? upQuery : down ? downQuery : "".concat(upQuery, " and ").concat(downQuery);
2441
+ };
2442
+ var xs = queryString(bp.xs);
2443
+ return {
2444
+ xs: xs,
2445
+ mobile: xs,
2446
+ sm: queryString(bp.sm),
2447
+ md: queryString(bp.md),
2448
+ lg: queryString(bp.lg),
2449
+ xl: queryString(bp.xl)
2450
+ };
2451
+ };
2452
+ var useMediaQuery = function useMediaQuery(breakpoint) {
2453
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultResponsiveOptions;
2454
+ var _options$match = options.match,
2455
+ matchType = _options$match === void 0 ? 'default' : _options$match,
2456
+ _options$ssrMatchMedi = options.ssrMatchMedia,
2457
+ ssrMatchMedia = _options$ssrMatchMedi === void 0 ? null : _options$ssrMatchMedi;
2458
+ var supportMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
2459
+ var theme = useTheme();
2460
+ var mediaQueries = React$1.useMemo(function () {
2461
+ var up = matchType === 'up';
2462
+ var down = matchType === 'down';
2463
+ return makeQueries(theme.breakpoints, up, down);
2464
+ }, [theme.breakpoints, options]);
2465
+ var query = React$1.useMemo(function () {
2466
+ return mediaQueries[breakpoint];
2467
+ }, [mediaQueries, breakpoint]);
2468
+ var matchQuery = function matchQuery(q) {
2469
+ return window.matchMedia(q);
2470
+ };
2471
+
2472
+ /**
2473
+ * Do nothing in the server-side rendering.
2474
+ * If server match query fucntion is simulated, return user-defined value first.
2475
+ */
2476
+ var _useState = React$1.useState(function () {
2477
+ if (supportMedia) return matchQuery(query).matches;
2478
+ if (ssrMatchMedia && typeof ssrMatchMedia === 'function') {
2479
+ return ssrMatchMedia(query).matches;
2480
+ }
2481
+ return false;
2482
+ }),
2483
+ _useState2 = _slicedToArray(_useState, 2),
2484
+ state = _useState2[0],
2485
+ setState = _useState2[1];
2486
+ React$1.useEffect(function () {
2487
+ if (!supportMedia) return;
2488
+ var queryList = matchQuery(query);
2489
+ var update = function update() {
2490
+ return setState(matchQuery(query).matches);
2491
+ };
2492
+ update();
2493
+
2494
+ /**
2495
+ * addListener is deprecated. EventTarget.addEventListener is recommended.
2496
+ * But in some old browsers, MediaQueryList does not inherit from EventTarget.
2497
+ */
2498
+ queryList.addListener(update);
2499
+ return function () {
2500
+ queryList.removeListener(update);
2501
+ };
2502
+ }, [supportMedia]);
2503
+ return state;
2504
+ };
2505
+
2506
+ /* "use client" */
2507
+
2508
+ var usePrevious = function usePrevious(state) {
2509
+ var ref = React$1.useRef(null);
2510
+ React$1.useEffect(function () {
2511
+ ref.current = state;
2512
+ });
2513
+ return ref ? ref.current : null;
2514
+ };
2515
+
2516
+ var _excluded$1 = ["rect", "visible", "hoverHeightRatio", "hoverWidthRatio", "activeOpacity", "className"];
2517
+ var Highlight = function Highlight(_ref) {
2518
+ var rect = _ref.rect,
2519
+ visible = _ref.visible,
2520
+ _ref$hoverHeightRatio = _ref.hoverHeightRatio,
2521
+ hoverHeightRatio = _ref$hoverHeightRatio === void 0 ? 1 : _ref$hoverHeightRatio,
2522
+ _ref$hoverWidthRatio = _ref.hoverWidthRatio,
2523
+ hoverWidthRatio = _ref$hoverWidthRatio === void 0 ? 1 : _ref$hoverWidthRatio,
2524
+ _ref$activeOpacity = _ref.activeOpacity,
2525
+ activeOpacity = _ref$activeOpacity === void 0 ? 0.8 : _ref$activeOpacity,
2526
+ className = _ref.className,
2527
+ props = _objectWithoutProperties(_ref, _excluded$1);
2528
+ var theme = useTheme();
2529
+ var ref = React$1.useRef(null);
2530
+ var isFirstVisible = usePrevious(isUnplacedRect(rect));
2531
+ var position = React$1.useMemo(function () {
2532
+ var width = rect.width * hoverWidthRatio;
2533
+ var height = rect.height * hoverHeightRatio;
2534
+ return {
2535
+ width: "".concat(width, "px"),
2536
+ left: "".concat(rect.left + (rect.width - width) / 2, "px"),
2537
+ height: "".concat(height, "px"),
2538
+ top: "".concat(rect.elementTop + (rect.height - height) / 2, "px"),
2539
+ transition: isFirstVisible ? 'opacity' : 'opacity, width, left, top'
2540
+ };
2541
+ }, [rect, hoverWidthRatio, hoverHeightRatio]);
2542
+ return /*#__PURE__*/React$1.createElement("div", _extends({
2543
+ ref: ref
2544
+ }, props, {
2545
+ 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) || "")
2546
+ }), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2547
+ id: "603024321",
2548
+ dynamic: [theme.palette.accents_2, position.width, position.left, position.height, position.top, visible ? activeOpacity : 0, position.transition]
2549
+ }, ".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, ";}")));
2550
+ };
2551
+
2552
+ var Ellipsis = function Ellipsis(_ref) {
2553
+ var children = _ref.children,
2554
+ height = _ref.height;
2555
+ return /*#__PURE__*/React$1.createElement("span", {
2556
+ className: _JSXStyle.dynamic([["822089635", [height]]])
2557
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2558
+ id: "822089635",
2559
+ dynamic: [height]
2560
+ }, "span.__jsx-style-dynamic-selector{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:".concat(height, ";min-width:0;}")));
2561
+ };
2562
+ var ellipsis = /*#__PURE__*/React$1.memo(Ellipsis);
2563
+
2564
+ var getRealShape = function getRealShape(el) {
2565
+ var defaultShape = {
2566
+ width: 0,
2567
+ height: 0
2568
+ };
2569
+ if (!el || typeof window === 'undefined') return defaultShape;
2570
+ var rect = el.getBoundingClientRect();
2571
+ var _window$getComputedSt = window.getComputedStyle(el),
2572
+ width = _window$getComputedSt.width,
2573
+ height = _window$getComputedSt.height;
2574
+ var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
2575
+ if (!str) return 0;
2576
+ var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
2577
+ return Number.isNaN(+strVal) ? 0 : +strVal;
2578
+ };
2579
+ return {
2580
+ width: getCSSStyleVal("".concat(width), rect.width),
2581
+ height: getCSSStyleVal("".concat(height), rect.height)
2582
+ };
2583
+ };
2584
+ var useRealShape = function useRealShape(ref) {
2585
+ var _useState = React$1.useState({
2586
+ width: 0,
2587
+ height: 0
2588
+ }),
2589
+ _useState2 = _slicedToArray(_useState, 2),
2590
+ state = _useState2[0],
2591
+ setState = _useState2[1];
2592
+ var update = function update() {
2593
+ var _getRealShape = getRealShape(ref.current),
2594
+ width = _getRealShape.width,
2595
+ height = _getRealShape.height;
2596
+ setState({
2597
+ width: width,
2598
+ height: height
2599
+ });
2600
+ };
2601
+ React$1.useEffect(function () {
2602
+ return update();
2603
+ }, [ref.current]);
2604
+ return [state, update];
2605
+ };
2606
+
2607
+ var Expand = function Expand(_ref) {
2608
+ var _ref$isExpanded = _ref.isExpanded,
2609
+ isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
2610
+ _ref$delay = _ref.delay,
2611
+ delay = _ref$delay === void 0 ? 200 : _ref$delay,
2612
+ children = _ref.children;
2613
+ var _useState = React$1.useState(isExpanded ? 'auto' : '0'),
2614
+ _useState2 = _slicedToArray(_useState, 2),
2615
+ height = _useState2[0],
2616
+ setHeight = _useState2[1];
2617
+ var _useState3 = React$1.useState(isExpanded),
2618
+ _useState4 = _slicedToArray(_useState3, 2),
2619
+ selfExpanded = _useState4[0],
2620
+ setSelfExpanded = _useState4[1];
2621
+ var _useState5 = React$1.useState(isExpanded),
2622
+ _useState6 = _slicedToArray(_useState5, 2),
2623
+ visible = _useState6[0],
2624
+ setVisible = _useState6[1];
2625
+ var contentRef = React$1.useRef(null);
2626
+ var entryTimer = React$1.useRef();
2627
+ var leaveTimer = React$1.useRef();
2628
+ var resetTimer = React$1.useRef();
2629
+ var _useRealShape = useRealShape(contentRef),
2630
+ _useRealShape2 = _slicedToArray(_useRealShape, 2),
2631
+ state = _useRealShape2[0],
2632
+ updateShape = _useRealShape2[1];
2633
+ var classes = useClasses('container', {
2634
+ expanded: selfExpanded
2635
+ });
2636
+ React$1.useEffect(function () {
2637
+ return setHeight("".concat(state.height, "px"));
2638
+ }, [state.height]);
2639
+ React$1.useEffect(function () {
2640
+ // show element or reset height.
2641
+ // force an update once manually, even if the element does not change.
2642
+ // (the height of the element might be "auto")
2643
+ if (isExpanded) {
2644
+ setVisible(isExpanded);
2645
+ } else {
2646
+ updateShape();
2647
+ setHeight("".concat(state.height, "px"));
2648
+ }
2649
+
2650
+ // show expand animation
2651
+ entryTimer.current = window.setTimeout(function () {
2652
+ setSelfExpanded(isExpanded);
2653
+ clearTimeout(entryTimer.current);
2654
+ }, 30);
2655
+
2656
+ // Reset height after animation
2657
+ if (isExpanded) {
2658
+ resetTimer.current = window.setTimeout(function () {
2659
+ setHeight('auto');
2660
+ clearTimeout(resetTimer.current);
2661
+ }, delay);
2662
+ } else {
2663
+ leaveTimer.current = window.setTimeout(function () {
2664
+ setVisible(isExpanded);
2665
+ clearTimeout(leaveTimer.current);
2666
+ }, delay / 2);
2667
+ }
2668
+ return function () {
2669
+ clearTimeout(entryTimer.current);
2670
+ clearTimeout(leaveTimer.current);
2671
+ clearTimeout(resetTimer.current);
2672
+ };
2673
+ }, [isExpanded]);
2674
+ return /*#__PURE__*/React$1.createElement("div", {
2675
+ className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + (classes || "")
2676
+ }, /*#__PURE__*/React$1.createElement("div", {
2677
+ ref: contentRef,
2678
+ className: _JSXStyle.dynamic([["1918690829", [visible ? 'visible' : 'hidden', delay, height]]]) + " " + "content"
2679
+ }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2680
+ id: "1918690829",
2681
+ dynamic: [visible ? 'visible' : 'hidden', delay, height]
2682
+ }, ".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;}")));
2683
+ };
2684
+ Expand.displayName = 'Expand';
2685
+
2686
+ /* "use client" */
2687
+
2688
+ var useResize = function useResize(callback) {
2689
+ var immediatelyInvoke = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2690
+ React$1.useEffect(function () {
2691
+ var fn = function fn() {
2692
+ return callback();
2693
+ };
2694
+ if (immediatelyInvoke) {
2695
+ fn();
2696
+ }
2697
+ window.addEventListener('resize', fn);
2698
+ return function () {
2699
+ return window.removeEventListener('resize', fn);
2700
+ };
2701
+ }, []);
2702
+ };
2703
+
2704
+ /* "use client" */
2705
+
2706
+ var useClickAnyWhere = function useClickAnyWhere(handler) {
2707
+ React$1.useEffect(function () {
2708
+ var callback = function callback(event) {
2709
+ return handler(event);
2710
+ };
2711
+ document.addEventListener('click', callback);
2712
+ return function () {
2713
+ return document.removeEventListener('click', callback);
2714
+ };
2715
+ }, [handler]);
2716
+ };
2717
+
2718
+ /* "use client" */
2719
+
2720
+ var useDOMObserver = function useDOMObserver(ref) {
2721
+ var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
2722
+ var config = {
2723
+ attributes: false,
2724
+ childList: true,
2725
+ subtree: true
2726
+ };
2727
+ React$1.useEffect(function () {
2728
+ if (!ref || !ref.current) return;
2729
+ var unmount = false;
2730
+ var done = function done() {
2731
+ if (unmount) return;
2732
+ callback.apply(void 0, arguments);
2733
+ };
2734
+ var observer = new MutationObserver(done);
2735
+ observer.observe(ref.current, config);
2736
+ return function () {
2737
+ unmount = true;
2738
+ observer.disconnect();
2739
+ };
2740
+ }, [ref]);
2741
+ };
2742
+
2743
+ var warningStack = {};
2744
+ var useWarning = function useWarning(message, component) {
2745
+ var tag = ' ';
2746
+ var log = "[Helpdice UI]".concat(tag, ": ").concat(message);
2747
+ if (typeof console === 'undefined') return;
2748
+ if (warningStack[log]) return;
2749
+ warningStack[log] = true;
2750
+ if (process.env.NODE_ENV !== 'production') {
2751
+ return console.error(log);
2752
+ }
2753
+ console.warn(log);
2754
+ };
2755
+
2756
+ var defaultRect = {
2757
+ top: -1e3,
2758
+ left: -1e3,
2759
+ right: -1e3,
2760
+ width: 0
2761
+ };
2762
+ var Dropdown = /*#__PURE__*/React$1.memo(function (_ref) {
2763
+ var children = _ref.children,
2764
+ parent = _ref.parent,
2765
+ visible = _ref.visible,
2766
+ disableMatchWidth = _ref.disableMatchWidth,
2767
+ getPopupContainer = _ref.getPopupContainer;
2768
+ var el = usePortal('dropdown', getPopupContainer);
2769
+ var _useState = React$1.useState(defaultRect),
2770
+ _useState2 = _slicedToArray(_useState, 2),
2771
+ rect = _useState2[0],
2772
+ setRect = _useState2[1];
2773
+ var classes = useClasses('dropdown', disableMatchWidth ? 'disable-match' : 'width-match');
2774
+ if (!parent) return null;
2775
+
2776
+ /* istanbul ignore next */
2777
+ if (process.env.NODE_ENV !== 'production') {
2778
+ if (getPopupContainer && getPopupContainer()) {
2779
+ var _el = getPopupContainer();
2780
+ var style = window.getComputedStyle(_el);
2781
+ if (style.position === 'static') {
2782
+ useWarning('The element specified by "getPopupContainer" must have "position" set.');
2783
+ }
2784
+ }
2785
+ }
2786
+ var updateRect = function updateRect() {
2787
+ var _getRefRect = getRefRect(parent, getPopupContainer),
2788
+ top = _getRefRect.top,
2789
+ left = _getRefRect.left,
2790
+ right = _getRefRect.right,
2791
+ nativeWidth = _getRefRect.width;
2792
+ setRect({
2793
+ top: top,
2794
+ left: left,
2795
+ right: right,
2796
+ width: nativeWidth
2797
+ });
2798
+ };
2799
+ useResize(updateRect);
2800
+ useClickAnyWhere(function () {
2801
+ var _getRefRect2 = getRefRect(parent, getPopupContainer),
2802
+ top = _getRefRect2.top,
2803
+ left = _getRefRect2.left;
2804
+ var shouldUpdatePosition = top !== rect.top || left !== rect.left;
2805
+ if (!shouldUpdatePosition) return;
2806
+ updateRect();
2807
+ });
2808
+ useDOMObserver(parent, function () {
2809
+ updateRect();
2810
+ });
2811
+ React$1.useEffect(function () {
2812
+ if (!parent || !parent.current) return;
2813
+ parent.current.addEventListener('mouseenter', updateRect);
2814
+ /* istanbul ignore next */
2815
+ return function () {
2816
+ if (!parent || !parent.current) return;
2817
+ parent.current.removeEventListener('mouseenter', updateRect);
2818
+ };
2819
+ }, [parent]);
2820
+ var clickHandler = function clickHandler(event) {
2821
+ event.stopPropagation();
2822
+ event.nativeEvent.stopImmediatePropagation();
2823
+ event.preventDefault();
2824
+ };
2825
+ var mouseDownHandler = function mouseDownHandler(event) {
2826
+ event.preventDefault();
2827
+ };
2828
+ if (!el) return null;
2829
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React$1.createElement(CssTransition, {
2830
+ visible: visible
2831
+ }, /*#__PURE__*/React$1.createElement("div", {
2832
+ onClick: clickHandler,
2833
+ onMouseDown: mouseDownHandler,
2834
+ className: _JSXStyle.dynamic([["1644673105", [rect.top + 2, rect.left, rect.width, rect.width]]]) + " " + (classes || "")
2835
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
2836
+ id: "1644673105",
2837
+ dynamic: [rect.top + 2, rect.left, rect.width, rect.width]
2838
+ }, ".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);
2839
+ });
2840
+
2841
+ var _excluded = ["children", "onClick", "visible", "width", "onContentClick", "backdropClassName", "positionClassName", "layerClassName"];
2842
+ var Backdrop = /*#__PURE__*/React$1.memo(function (_ref) {
2843
+ var children = _ref.children,
2844
+ _ref$onClick = _ref.onClick,
2845
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
2846
+ _ref$visible = _ref.visible,
2847
+ visible = _ref$visible === void 0 ? false : _ref$visible,
2848
+ width = _ref.width,
2849
+ _ref$onContentClick = _ref.onContentClick,
2850
+ onContentClick = _ref$onContentClick === void 0 ? function () {} : _ref$onContentClick,
2851
+ _ref$backdropClassNam = _ref.backdropClassName,
2852
+ backdropClassName = _ref$backdropClassNam === void 0 ? '' : _ref$backdropClassNam,
2853
+ _ref$positionClassNam = _ref.positionClassName,
2854
+ positionClassName = _ref$positionClassNam === void 0 ? '' : _ref$positionClassNam,
2855
+ _ref$layerClassName = _ref.layerClassName,
2856
+ layerClassName = _ref$layerClassName === void 0 ? '' : _ref$layerClassName,
2857
+ props = _objectWithoutProperties(_ref, _excluded);
2858
+ var theme = useTheme();
2859
+ var _useCurrentState = useCurrentState(false),
2860
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2861
+ setIsContentMouseDown = _useCurrentState2[1],
2862
+ IsContentMouseDownRef = _useCurrentState2[2];
2863
+ var clickHandler = function clickHandler(event) {
2864
+ if (IsContentMouseDownRef.current) return;
2865
+ onClick && onClick(event);
2866
+ };
2867
+ var mouseUpHandler = function mouseUpHandler() {
2868
+ if (!IsContentMouseDownRef.current) return;
2869
+ var timer = setTimeout(function () {
2870
+ setIsContentMouseDown(false);
2871
+ clearTimeout(timer);
2872
+ }, 0);
2873
+ };
2874
+ return /*#__PURE__*/React$1.createElement(CssTransition, {
2875
+ name: "backdrop-wrapper",
2876
+ visible: visible,
2877
+ clearTime: 300
2878
+ }, /*#__PURE__*/React$1.createElement("div", _extends({
2879
+ onClick: clickHandler,
2880
+ onMouseUp: mouseUpHandler
2881
+ }, props, {
2882
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (props && props.className != null && props.className || useClasses('backdrop', backdropClassName) || "")
2883
+ }), /*#__PURE__*/React$1.createElement("div", {
2884
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('layer', layerClassName) || "")
2885
+ }), /*#__PURE__*/React$1.createElement("div", {
2886
+ onClick: onContentClick,
2887
+ onMouseDown: function onMouseDown() {
2888
+ return setIsContentMouseDown(true);
2889
+ },
2890
+ className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('position', positionClassName) || "")
2891
+ }, children), /*#__PURE__*/React$1.createElement(_JSXStyle, {
2892
+ id: "2021762493",
2893
+ dynamic: [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]
2894
+ }, ".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;}"))));
2895
+ });
2896
+ Backdrop.displayName = 'Backdrop';
2897
+
2898
+ dist.Backdrop = Backdrop;
2899
+ dist.CssBaseline = MemoCssBaseline;
2900
+ dist.CssTransition = CssTransition;
2901
+ dist.Dropdown = Dropdown;
2902
+ dist.Ellipsis = ellipsis;
2903
+ dist.Expand = Expand;
2904
+ dist.Highlight = Highlight;
2905
+ dist.Themes = Themes;
2906
+ dist.UiProvider = HuiProvider;
2907
+ dist.useAllThemes = useAllThemes;
2908
+ dist.useClasses = useClasses;
2909
+ dist.useCurrentState = useCurrentState;
2910
+ dist.useMediaQuery = useMediaQuery;
2911
+ dist.useRect = useRect;
2912
+ dist.useTheme = useTheme;
2913
+ dist.useToasts = useToasts;
2914
+ return dist;
2915
+ }
2916
+
2917
+ var distExports = /*@__PURE__*/ requireDist();
1116
2918
 
1117
2919
  /* "use client" */
1118
2920
 
@@ -1197,7 +2999,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
1197
2999
  return getAllScaleProps;
1198
3000
  };
1199
3001
 
1200
- var _excluded$a = ["children"];
3002
+ var _excluded$9 = ["children"];
1201
3003
  var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
1202
3004
  if (scale === 1) return scale;
1203
3005
  var diff = Math.abs((scale - 1) / 2);
@@ -1207,8 +3009,8 @@ var withScale = function withScale(Render) {
1207
3009
  var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1208
3010
  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;
1209
3011
  var children = _ref.children,
1210
- props = _objectWithoutProperties(_ref, _excluded$a);
1211
- var _useTheme = useTheme(),
3012
+ props = _objectWithoutProperties(_ref, _excluded$9);
3013
+ var _useTheme = distExports.useTheme(),
1212
3014
  layout = _useTheme.layout;
1213
3015
  var paddingLeft = props.paddingLeft,
1214
3016
  pl = props.pl,
@@ -1290,48 +3092,15 @@ var withScale = function withScale(Render) {
1290
3092
  return ScaleFC;
1291
3093
  };
1292
3094
 
1293
- /* "use client" */
1294
-
1295
- var classObjectToString = function classObjectToString(className) {
1296
- var keys = Object.keys(className);
1297
- var len = keys.length;
1298
- var str = '';
1299
- for (var index = 0; index < len; index++) {
1300
- var key = keys[index];
1301
- var val = className[keys[index]];
1302
- if (!val) continue;
1303
- str = str ? "".concat(str, " ").concat(String(key)) : String(key);
1304
- }
1305
- return str;
1306
- };
1307
- var isObjectClassName = function isObjectClassName(value) {
1308
- return _typeof(value) === 'object' && !Array.isArray(value);
1309
- };
1310
- var useClasses = function useClasses() {
1311
- var len = arguments.length;
1312
- var classes = '';
1313
- if (len === 0) return classes;
1314
- for (var index = 0; index < len; index++) {
1315
- var val = index < 0 || arguments.length <= index ? undefined : arguments[index];
1316
- if (!val) continue;
1317
- if (isObjectClassName(val)) {
1318
- classes += " ".concat(classObjectToString(val));
1319
- } else {
1320
- classes += " ".concat(String(val).trim());
1321
- }
1322
- }
1323
- return classes.trim();
1324
- };
1325
-
1326
- var _excluded$9 = ["className", "children", "visible"];
3095
+ var _excluded$8 = ["className", "children", "visible"];
1327
3096
  var ModalWrapper = function ModalWrapper(_ref) {
1328
3097
  var _ref$className = _ref.className,
1329
3098
  className = _ref$className === void 0 ? '' : _ref$className,
1330
3099
  children = _ref.children,
1331
3100
  _ref$visible = _ref.visible,
1332
3101
  visible = _ref$visible === void 0 ? false : _ref$visible,
1333
- props = _objectWithoutProperties(_ref, _excluded$9);
1334
- var theme = useTheme();
3102
+ props = _objectWithoutProperties(_ref, _excluded$8);
3103
+ var theme = distExports.useTheme();
1335
3104
  var _useScale = useScale(),
1336
3105
  SCALES = _useScale.SCALES;
1337
3106
  var modalContent = React.useRef(null);
@@ -1358,7 +3127,7 @@ var ModalWrapper = function ModalWrapper(_ref) {
1358
3127
  }
1359
3128
  }
1360
3129
  };
1361
- return /*#__PURE__*/React.createElement(CssTransition, {
3130
+ return /*#__PURE__*/React.createElement(distExports.CssTransition, {
1362
3131
  name: "wrapper",
1363
3132
  visible: visible,
1364
3133
  clearTime: 300
@@ -1368,7 +3137,7 @@ var ModalWrapper = function ModalWrapper(_ref) {
1368
3137
  onKeyDown: onKeyDown,
1369
3138
  ref: modalContent
1370
3139
  }, props, {
1371
- className: _JSXStyle.dynamic([["4268738715", [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, SCALES.font(1), SCALES.height(1, 'auto'), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || useClasses('wrapper', className) || "")
3140
+ className: _JSXStyle.dynamic([["4268738715", [theme.palette.background, theme.palette.foreground, theme.layout.radius, theme.expressiveness.shadowLarge, SCALES.font(1), SCALES.height(1, 'auto'), SCALES.pl(1.3125), SCALES.pr(1.3125), SCALES.pt(1.3125), SCALES.pb(1.3125), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || distExports.useClasses('wrapper', className) || "")
1372
3141
  }), /*#__PURE__*/React.createElement("div", {
1373
3142
  tabIndex: 0,
1374
3143
  "aria-hidden": "true",
@@ -1448,7 +3217,7 @@ var ButtonDrip = function ButtonDrip(_ref) {
1448
3217
  };
1449
3218
  ButtonDrip.displayName = 'ButtonDrip';
1450
3219
 
1451
- var _excluded$8 = ["children", "type", "color", "className", "spaceRatio"];
3220
+ var _excluded$7 = ["children", "type", "color", "className", "spaceRatio"];
1452
3221
  var getIconBgColor = function getIconBgColor(type, palette, color) {
1453
3222
  var colors = {
1454
3223
  "default": palette.accents_6,
@@ -1468,11 +3237,11 @@ var LoadingComponent = function LoadingComponent(_ref) {
1468
3237
  className = _ref$className === void 0 ? '' : _ref$className,
1469
3238
  _ref$spaceRatio = _ref.spaceRatio,
1470
3239
  spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
1471
- props = _objectWithoutProperties(_ref, _excluded$8);
1472
- var theme = useTheme();
3240
+ props = _objectWithoutProperties(_ref, _excluded$7);
3241
+ var theme = distExports.useTheme();
1473
3242
  var _useScale = useScale(),
1474
3243
  SCALES = _useScale.SCALES;
1475
- var classes = useClasses('loading-container', className);
3244
+ var classes = distExports.useClasses('loading-container', className);
1476
3245
  var bgColor = React.useMemo(function () {
1477
3246
  return getIconBgColor(type, theme.palette, color);
1478
3247
  }, [type, theme.palette, color]);
@@ -1508,7 +3277,7 @@ var ButtonLoading = function ButtonLoading(_ref) {
1508
3277
  };
1509
3278
  ButtonLoading.displayName = 'ButtonLoading';
1510
3279
 
1511
- var _excluded$7 = ["isRight", "isSingle", "children", "className"];
3280
+ var _excluded$6 = ["isRight", "isSingle", "children", "className"];
1512
3281
  var ButtonIcon = function ButtonIcon(_ref) {
1513
3282
  var _ref$isRight = _ref.isRight,
1514
3283
  isRight = _ref$isRight === void 0 ? false : _ref$isRight,
@@ -1516,8 +3285,8 @@ var ButtonIcon = function ButtonIcon(_ref) {
1516
3285
  children = _ref.children,
1517
3286
  _ref$className = _ref.className,
1518
3287
  className = _ref$className === void 0 ? '' : _ref$className,
1519
- props = _objectWithoutProperties(_ref, _excluded$7);
1520
- var classes = useClasses('icon', {
3288
+ props = _objectWithoutProperties(_ref, _excluded$6);
3289
+ var classes = distExports.useClasses('icon', {
1521
3290
  right: isRight,
1522
3291
  single: isSingle
1523
3292
  }, className);
@@ -1535,7 +3304,7 @@ var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, childre
1535
3304
  var hasIcon = icon || iconRight;
1536
3305
  var isRight = Boolean(iconRight);
1537
3306
  var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
1538
- var classes = useClasses('text', isRight ? 'right' : 'left');
3307
+ var classes = distExports.useClasses('text', isRight ? 'right' : 'left');
1539
3308
  if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
1540
3309
  className: "text"
1541
3310
  }, children);
@@ -1798,9 +3567,9 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
1798
3567
  return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
1799
3568
  };
1800
3569
 
1801
- var _excluded$6 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
3570
+ var _excluded$5 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
1802
3571
  var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1803
- var theme = useTheme();
3572
+ var theme = distExports.useTheme();
1804
3573
  var _useScale = useScale(),
1805
3574
  SCALES = _useScale.SCALES;
1806
3575
  var buttonRef = React.useRef(null);
@@ -1847,7 +3616,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1847
3616
  _filteredProps$classN = filteredProps.className,
1848
3617
  className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
1849
3618
  filteredProps.crossOrigin;
1850
- var props = _objectWithoutProperties(filteredProps, _excluded$6);
3619
+ var props = _objectWithoutProperties(filteredProps, _excluded$5);
1851
3620
  /* eslint-enable @typescript-eslint/no-unused-vars */
1852
3621
 
1853
3622
  var _useMemo = React.useMemo(function () {
@@ -1900,7 +3669,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1900
3669
  disabled: disabled,
1901
3670
  onClick: clickHandler
1902
3671
  }, props, {
1903
- 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) || "")
3672
+ 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) || "")
1904
3673
  }), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
1905
3674
  color: color
1906
3675
  }), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
@@ -1916,7 +3685,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1916
3685
  ButtonComponent.displayName = 'Button';
1917
3686
  var Button = withScale(ButtonComponent);
1918
3687
 
1919
- var _excluded$5 = ["className", "children", "onClick", "passive", "disabled"];
3688
+ var _excluded$4 = ["className", "children", "onClick", "passive", "disabled"];
1920
3689
  var ModalActionComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1921
3690
  var _ref$className = _ref.className,
1922
3691
  className = _ref$className === void 0 ? '' : _ref$className,
@@ -1926,8 +3695,8 @@ var ModalActionComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1926
3695
  passive = _ref$passive === void 0 ? false : _ref$passive,
1927
3696
  _ref$disabled = _ref.disabled,
1928
3697
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1929
- props = _objectWithoutProperties(_ref, _excluded$5);
1930
- var theme = useTheme();
3698
+ props = _objectWithoutProperties(_ref, _excluded$4);
3699
+ var theme = distExports.useTheme();
1931
3700
  var _useScale = useScale(),
1932
3701
  SCALES = _useScale.SCALES;
1933
3702
  var btnRef = React.useRef(null);
@@ -1961,7 +3730,7 @@ var ModalActionComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1961
3730
  },
1962
3731
  resolveClassName = _styles$className.className,
1963
3732
  styles = _styles$className.styles;
1964
- var classes = useClasses(resolveClassName, className);
3733
+ var classes = distExports.useClasses(resolveClassName, className);
1965
3734
  var overrideProps = _objectSpread2(_objectSpread2({}, props), {}, {
1966
3735
  effect: false,
1967
3736
  ref: btnRef
@@ -1975,11 +3744,11 @@ var ModalActionComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1975
3744
  ModalActionComponent.displayName = 'ModalAction';
1976
3745
  var ModalAction = withScale(ModalActionComponent);
1977
3746
 
1978
- var _excluded$4 = ["children"];
3747
+ var _excluded$3 = ["children"];
1979
3748
  var ModalActionsComponent = function ModalActionsComponent(_ref) {
1980
3749
  var children = _ref.children,
1981
- props = _objectWithoutProperties(_ref, _excluded$4);
1982
- var theme = useTheme();
3750
+ props = _objectWithoutProperties(_ref, _excluded$3);
3751
+ var theme = distExports.useTheme();
1983
3752
  var ref = React.useRef(null);
1984
3753
  var _useState = React.useState('auto'),
1985
3754
  _useState2 = _slicedToArray(_useState, 2),
@@ -2003,82 +3772,6 @@ var ModalActionsComponent = function ModalActionsComponent(_ref) {
2003
3772
  ModalActionsComponent.displayName = 'ModalActions';
2004
3773
  var ModalActions = /*#__PURE__*/React.memo(ModalActionsComponent);
2005
3774
 
2006
- var useCurrentState = function useCurrentState(initialState) {
2007
- var _useState = React.useState(function () {
2008
- return initialState;
2009
- }),
2010
- _useState2 = _slicedToArray(_useState, 2),
2011
- state = _useState2[0],
2012
- setState = _useState2[1];
2013
- var ref = React.useRef(initialState);
2014
- React.useEffect(function () {
2015
- ref.current = state;
2016
- }, [state]);
2017
- var setValue = function setValue(val) {
2018
- var result = typeof val === 'function' ? val(ref.current) : val;
2019
- ref.current = result;
2020
- setState(result);
2021
- };
2022
- return [state, setValue, ref];
2023
- };
2024
-
2025
- var _excluded$3 = ["children", "onClick", "visible", "width", "onContentClick", "backdropClassName", "positionClassName", "layerClassName"];
2026
- var Backdrop = /*#__PURE__*/React.memo(function (_ref) {
2027
- var children = _ref.children,
2028
- _ref$onClick = _ref.onClick,
2029
- onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
2030
- _ref$visible = _ref.visible,
2031
- visible = _ref$visible === void 0 ? false : _ref$visible,
2032
- width = _ref.width,
2033
- _ref$onContentClick = _ref.onContentClick,
2034
- onContentClick = _ref$onContentClick === void 0 ? function () {} : _ref$onContentClick,
2035
- _ref$backdropClassNam = _ref.backdropClassName,
2036
- backdropClassName = _ref$backdropClassNam === void 0 ? '' : _ref$backdropClassNam,
2037
- _ref$positionClassNam = _ref.positionClassName,
2038
- positionClassName = _ref$positionClassNam === void 0 ? '' : _ref$positionClassNam,
2039
- _ref$layerClassName = _ref.layerClassName,
2040
- layerClassName = _ref$layerClassName === void 0 ? '' : _ref$layerClassName,
2041
- props = _objectWithoutProperties(_ref, _excluded$3);
2042
- var theme = useTheme();
2043
- var _useCurrentState = useCurrentState(false),
2044
- _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
2045
- setIsContentMouseDown = _useCurrentState2[1],
2046
- IsContentMouseDownRef = _useCurrentState2[2];
2047
- var clickHandler = function clickHandler(event) {
2048
- if (IsContentMouseDownRef.current) return;
2049
- onClick && onClick(event);
2050
- };
2051
- var mouseUpHandler = function mouseUpHandler() {
2052
- if (!IsContentMouseDownRef.current) return;
2053
- var timer = setTimeout(function () {
2054
- setIsContentMouseDown(false);
2055
- clearTimeout(timer);
2056
- }, 0);
2057
- };
2058
- return /*#__PURE__*/React.createElement(CssTransition, {
2059
- name: "backdrop-wrapper",
2060
- visible: visible,
2061
- clearTime: 300
2062
- }, /*#__PURE__*/React.createElement("div", _extends({
2063
- onClick: clickHandler,
2064
- onMouseUp: mouseUpHandler
2065
- }, props, {
2066
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (props && props.className != null && props.className || useClasses('backdrop', backdropClassName) || "")
2067
- }), /*#__PURE__*/React.createElement("div", {
2068
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('layer', layerClassName) || "")
2069
- }), /*#__PURE__*/React.createElement("div", {
2070
- onClick: onContentClick,
2071
- onMouseDown: function onMouseDown() {
2072
- return setIsContentMouseDown(true);
2073
- },
2074
- className: _JSXStyle.dynamic([["2021762493", [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]]]) + " " + (useClasses('position', positionClassName) || "")
2075
- }, children), /*#__PURE__*/React.createElement(_JSXStyle, {
2076
- id: "2021762493",
2077
- dynamic: [width, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity, theme.expressiveness.portalOpacity]
2078
- }, ".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;}"))));
2079
- });
2080
- Backdrop.displayName = 'Backdrop';
2081
-
2082
3775
  var defaultOptions = {
2083
3776
  scrollLayer: false,
2084
3777
  delayReset: 0
@@ -2384,9 +4077,9 @@ var ModalComponent = function ModalComponent(_ref) {
2384
4077
  };
2385
4078
  }, []);
2386
4079
  if (!portal) return null;
2387
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(ModalContext.Provider, {
4080
+ return /*#__PURE__*/require$$1.createPortal(/*#__PURE__*/React.createElement(ModalContext.Provider, {
2388
4081
  value: modalConfig
2389
- }, /*#__PURE__*/React.createElement(Backdrop, _extends({
4082
+ }, /*#__PURE__*/React.createElement(distExports.Backdrop, _extends({
2390
4083
  onClick: closeFromBackdrop,
2391
4084
  onContentClick: onContentClick,
2392
4085
  visible: visible,
@@ -2408,7 +4101,7 @@ var ModalTitleComponent = function ModalTitleComponent(_ref) {
2408
4101
  className = _ref$className === void 0 ? '' : _ref$className,
2409
4102
  children = _ref.children,
2410
4103
  props = _objectWithoutProperties(_ref, _excluded$2);
2411
- var theme = useTheme();
4104
+ var theme = distExports.useTheme();
2412
4105
  var _useScale = useScale(),
2413
4106
  SCALES = _useScale.SCALES;
2414
4107
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h2", _extends({}, props, {
@@ -2427,7 +4120,7 @@ var ModalSubtitleComponent = function ModalSubtitleComponent(_ref) {
2427
4120
  className = _ref$className === void 0 ? '' : _ref$className,
2428
4121
  children = _ref.children,
2429
4122
  props = _objectWithoutProperties(_ref, _excluded$1);
2430
- var theme = useTheme();
4123
+ var theme = distExports.useTheme();
2431
4124
  var _useScale = useScale(),
2432
4125
  SCALES = _useScale.SCALES;
2433
4126
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", _extends({}, props, {
@@ -2449,7 +4142,7 @@ var ModalContentComponent = function ModalContentComponent(_ref) {
2449
4142
  var _useScale = useScale(),
2450
4143
  SCALES = _useScale.SCALES;
2451
4144
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({}, props, {
2452
- className: _JSXStyle.dynamic([["498745028", [SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(1.3125), SCALES.pr(1.3125), SCALES.pb(0.6625), SCALES.pl(1.3125), SCALES.mt(0), SCALES.mr(0, 'calc(var(--modal-wrapper-padding-right) * -1)'), SCALES.mb(0), SCALES.ml(0, 'calc(var(--modal-wrapper-padding-left) * -1)')]]]) + " " + (props && props.className != null && props.className || useClasses('content', className) || "")
4145
+ className: _JSXStyle.dynamic([["498745028", [SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(1.3125), SCALES.pr(1.3125), SCALES.pb(0.6625), SCALES.pl(1.3125), SCALES.mt(0), SCALES.mr(0, 'calc(var(--modal-wrapper-padding-right) * -1)'), SCALES.mb(0), SCALES.ml(0, 'calc(var(--modal-wrapper-padding-left) * -1)')]]]) + " " + (props && props.className != null && props.className || distExports.useClasses('content', className) || "")
2453
4146
  }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
2454
4147
  id: "498745028",
2455
4148
  dynamic: [SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(1.3125), SCALES.pr(1.3125), SCALES.pb(0.6625), SCALES.pl(1.3125), SCALES.mt(0), SCALES.mr(0, 'calc(var(--modal-wrapper-padding-right) * -1)'), SCALES.mb(0), SCALES.ml(0, 'calc(var(--modal-wrapper-padding-left) * -1)')]