@nxgt/material 3.101.0 → 3.104.0

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 (207) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +37 -5
  3. package/dist/{alert-dialog-DYzxchiS.js → alert-dialog-CK_47jfm.js} +1 -1
  4. package/dist/{async-slice-drJyPvuM.js → async-slice-1ZNMiwyJ.js} +1 -1
  5. package/dist/{bubble-input-CQwVSoU3.js → bubble-input-BxI1WmNs.js} +17 -5
  6. package/dist/{button-GeIsUekU.js → button-YfEMZbRO.js} +2 -2
  7. package/dist/{calculator-BS4PAm6l.js → calculator-BmYZId4c.js} +261 -460
  8. package/dist/calculator-field.js +7 -7
  9. package/dist/{calculator-segment-CEdwE24M.js → calculator-segment-DJ08DJ-n.js} +1 -1
  10. package/dist/calculator.js +1 -1
  11. package/dist/charts.js +819 -764
  12. package/dist/{chip-BdEtFQ85.js → chip-DPj6e-3v.js} +2 -2
  13. package/dist/{code-editor-BByXZOGy.js → code-editor-CZg3nLZO.js} +178 -177
  14. package/dist/code-editor.js +5 -5
  15. package/dist/{code-language-items-CSZX5zxD.js → code-language-items-Nq1iOGId.js} +14 -5
  16. package/dist/components/ui/actions/action-card/action-card-tile.css +47 -0
  17. package/dist/components/ui/display/chip/chip-soft.css +27 -2
  18. package/dist/components/ui/display/code/code-moonlight.css +10 -10
  19. package/dist/components/ui/primitives/collapsible/collapsible.css +9 -0
  20. package/dist/{components-DQ4MljCr.js → components-B2wrH_W0.js} +19302 -18583
  21. package/dist/components.js +38 -37
  22. package/dist/{conversion-variant-DTQqAyDt.js → conversion-variant-C-LPx5ek.js} +5 -5
  23. package/dist/{currency-field-Dnju7ss2.js → currency-field-DnsRIA80.js} +24 -23
  24. package/dist/{dialog-5_2__tu8.js → dialog-BKBsDGFc.js} +3 -3
  25. package/dist/dnd.js +1 -1
  26. package/dist/{dropdown-menu-FdGC5kIP.js → dropdown-menu-QMDbRidH.js} +1 -1
  27. package/dist/editor.js +9 -9
  28. package/dist/{empty-state-BoepPG5v.js → empty-state-BLIJ6znY.js} +1 -1
  29. package/dist/{field-blur-DkiZOVNV.js → field-blur-DMJwPLsg.js} +9 -9
  30. package/dist/field-blur-context-3rKussBQ.js +29 -0
  31. package/dist/{financial-variant-BhqJp5C-.js → financial-variant-Ws0Jp01H.js} +5 -5
  32. package/dist/{hooks-DjcbJZiO.js → hooks-C3vkQmzh.js} +106 -61
  33. package/dist/hooks.js +3 -3
  34. package/dist/{hover-card-CmHJeBeY.js → hover-card-Df649U6I.js} +1 -1
  35. package/dist/i18n.js +3 -3
  36. package/dist/{icon-badge-LGUPQh_c.js → icon-badge-Cma1qOOJ.js} +1 -1
  37. package/dist/{icon-button-BSVpO1jP.js → icon-button-CpKxV264.js} +1 -1
  38. package/dist/key-layout-D2goCDkD.js +31 -0
  39. package/dist/keypad.js +551 -0
  40. package/dist/label-DR-zZyGQ.js +47 -0
  41. package/dist/lib/components/ui/actions/index.d.ts +1 -0
  42. package/dist/lib/components/ui/actions/product-tile/index.d.ts +1 -0
  43. package/dist/lib/components/ui/actions/product-tile/product-tile-link.d.ts +16 -0
  44. package/dist/lib/components/ui/actions/product-tile/product-tile.d.ts +41 -0
  45. package/dist/lib/components/ui/collections/data-table/data-table-density.d.ts +1 -1
  46. package/dist/lib/components/ui/collections/data-table/partials/data-table-scroll-region.d.ts +4 -1
  47. package/dist/lib/components/ui/collections/data-table/partials/layouts/data-table-list-bar.d.ts +6 -3
  48. package/dist/lib/components/ui/collections/data-table/partials/layouts/list-bar-in-row.d.ts +2 -1
  49. package/dist/lib/components/ui/collections/data-table/types.d.ts +11 -8
  50. package/dist/lib/components/ui/collections/data-table/virtual-option.d.ts +9 -3
  51. package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +2 -0
  52. package/dist/lib/components/ui/collections/server-table/partials/server-table-passed-through.d.ts +1 -0
  53. package/dist/lib/components/ui/collections/server-table/types.d.ts +1 -1
  54. package/dist/lib/components/ui/display/chip/chip.variants.d.ts +5 -4
  55. package/dist/lib/components/ui/display/code/code-block-parts.d.ts +1 -1
  56. package/dist/lib/components/ui/display/code/code-block.d.ts +4 -1
  57. package/dist/lib/components/ui/display/code/languages.d.ts +2 -0
  58. package/dist/lib/components/ui/display/code/moonlight-tokens.d.ts +10 -10
  59. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-props.d.ts +73 -0
  60. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-rules.d.ts +12 -0
  61. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog.d.ts +5 -61
  62. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-footer.d.ts +12 -0
  63. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-phrase.d.ts +26 -0
  64. package/dist/lib/components/ui/feedback/confirm-dialog/use-confirm-action.d.ts +1 -1
  65. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  66. package/dist/lib/components/ui/fields/index.d.ts +1 -0
  67. package/dist/lib/components/ui/fields/quantity-field/types.d.ts +1 -1
  68. package/dist/lib/components/ui/fields/quantity-stepper/index.d.ts +2 -0
  69. package/dist/lib/components/ui/fields/quantity-stepper/quantity-stepper-model.d.ts +9 -0
  70. package/dist/lib/components/ui/fields/quantity-stepper/quantity-stepper-value.d.ts +15 -0
  71. package/dist/lib/components/ui/fields/quantity-stepper/quantity-stepper.d.ts +9 -0
  72. package/dist/lib/components/ui/fields/quantity-stepper/quantity-stepper.types.d.ts +35 -0
  73. package/dist/lib/components/ui/fields/quantity-stepper/use-quantity-stepper.d.ts +28 -0
  74. package/dist/lib/components/ui/layout/index.d.ts +1 -0
  75. package/dist/lib/components/ui/layout/pane-layout/pane-layout.d.ts +8 -3
  76. package/dist/lib/components/ui/layout/pane-layout/partials/pane-layout-classes.d.ts +2 -2
  77. package/dist/lib/components/ui/layout/pane-layout/partials/pane-layout-context.d.ts +9 -0
  78. package/dist/lib/components/ui/layout/pane-layout/partials/use-pane-layout-state.d.ts +7 -2
  79. package/dist/lib/components/ui/layout/panel-card/index.d.ts +1 -0
  80. package/dist/lib/components/ui/layout/panel-card/panel-card.d.ts +23 -0
  81. package/dist/lib/components/ui/primitives/collapsible/collapsible.d.ts +9 -1
  82. package/dist/lib/components/ui/primitives/tabs/partials/tabs-list.d.ts +6 -1
  83. package/dist/lib/components/ui/primitives/tabs/tabs-classes.d.ts +1 -0
  84. package/dist/lib/components/ui/selection/chip-group-field/chip-group-field.d.ts +8 -0
  85. package/dist/lib/components/ui/selection/chip-group-field/chip-group-field.types.d.ts +6 -0
  86. package/dist/lib/components/ui/selection/chip-group-field/partials/chip-group-reasons.d.ts +10 -0
  87. package/dist/lib/components/ui/selection/chip-group-field/partials/use-chip-rail.d.ts +12 -0
  88. package/dist/lib/components/ui/selection/choice-group/choice-group-root.d.ts +5 -2
  89. package/dist/lib/components/ui/selection/index.d.ts +1 -0
  90. package/dist/lib/components/ui/selection/status-menu/index.d.ts +3 -0
  91. package/dist/lib/components/ui/selection/status-menu/partials/status-confirm.d.ts +12 -0
  92. package/dist/lib/components/ui/selection/status-menu/partials/status-icon.d.ts +6 -0
  93. package/dist/lib/components/ui/selection/status-menu/partials/status-items.d.ts +18 -0
  94. package/dist/lib/components/ui/selection/status-menu/partials/status-menu-list.d.ts +14 -0
  95. package/dist/lib/components/ui/selection/status-menu/partials/status-sheet-row.d.ts +11 -0
  96. package/dist/lib/components/ui/selection/status-menu/partials/status-sheet.d.ts +21 -0
  97. package/dist/lib/components/ui/selection/status-menu/partials/status-trigger.d.ts +18 -0
  98. package/dist/lib/components/ui/selection/status-menu/status-menu-data.d.ts +12 -0
  99. package/dist/lib/components/ui/selection/status-menu/status-menu-form-field.d.ts +20 -0
  100. package/dist/lib/components/ui/selection/status-menu/status-menu.d.ts +13 -0
  101. package/dist/lib/components/ui/selection/status-menu/types.d.ts +76 -0
  102. package/dist/lib/components/ui/selection/status-menu/use-status-change.d.ts +18 -0
  103. package/dist/lib/components/ui/selection/status-menu/use-status-menu.d.ts +30 -0
  104. package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +1 -5
  105. package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +3 -49
  106. package/dist/lib/components/ui/widgets/keypad/cash-model.d.ts +16 -0
  107. package/dist/lib/components/ui/widgets/keypad/index.d.ts +5 -0
  108. package/dist/lib/components/ui/widgets/keypad/key-layout.d.ts +56 -0
  109. package/dist/lib/components/ui/widgets/keypad/keypad-binding.d.ts +32 -0
  110. package/dist/lib/components/ui/widgets/keypad/keypad-cash.d.ts +28 -0
  111. package/dist/lib/components/ui/widgets/keypad/keypad-display.d.ts +11 -0
  112. package/dist/lib/components/ui/widgets/keypad/keypad-entry.d.ts +39 -0
  113. package/dist/lib/components/ui/widgets/keypad/keypad-grid.d.ts +27 -0
  114. package/dist/lib/components/ui/widgets/{calculator/partials/calculator-key.d.ts → keypad/keypad-key.d.ts} +6 -3
  115. package/dist/lib/components/ui/widgets/keypad/keypad-layout.d.ts +19 -0
  116. package/dist/lib/components/ui/widgets/{calculator/partials → keypad}/keypad-navigation.d.ts +1 -1
  117. package/dist/lib/components/ui/widgets/keypad/keypad.d.ts +9 -0
  118. package/dist/lib/components/ui/widgets/keypad/keypad.types.d.ts +91 -0
  119. package/dist/lib/components/ui/widgets/keypad/use-keypad-cash.d.ts +14 -0
  120. package/dist/lib/components/ui/widgets/keypad/use-keypad-keyboard.d.ts +7 -0
  121. package/dist/lib/components/ui/widgets/keypad/use-keypad-number.d.ts +10 -0
  122. package/dist/lib/components/ui/widgets/keypad/use-keypad-quantity.d.ts +16 -0
  123. package/dist/lib/components/ui/widgets/keypad/use-keypad-value.d.ts +17 -0
  124. package/dist/lib/components/ui/widgets/keypad/use-keypad.d.ts +23 -0
  125. package/dist/lib/components/ui/widgets/native-charts/core/label-placement.d.ts +25 -0
  126. package/dist/lib/components/ui/widgets/native-charts/core/reference-geometry.d.ts +3 -2
  127. package/dist/lib/hooks/index.d.ts +1 -0
  128. package/dist/lib/hooks/use-barcode-scanner.d.ts +39 -0
  129. package/dist/lib/i18n/resources/en/en.d.ts +28 -0
  130. package/dist/lib/i18n/resources/en/material.json.d.ts +30 -2
  131. package/dist/lib/i18n/resources/fr/fr.d.ts +28 -0
  132. package/dist/lib/i18n/resources/fr/material.json.d.ts +30 -2
  133. package/dist/lib/i18n/resources/resources.d.ts +56 -0
  134. package/dist/lib/i18n/translator.d.ts +1 -1
  135. package/dist/lib/keypad/index.d.ts +20 -0
  136. package/dist/lib/print/output/csv.d.ts +37 -0
  137. package/dist/lib/print/output/index.d.ts +1 -0
  138. package/dist/lib.js +1 -1
  139. package/dist/main.js +54 -53
  140. package/dist/map.js +9 -9
  141. package/dist/material.css +1 -1
  142. package/dist/pdf-reader.js +1 -1
  143. package/dist/{percent-field-DGlU_xii.js → percent-field-sAq7BaxN.js} +15 -14
  144. package/dist/{picker-surface-CGhqNR8a.js → picker-surface--6E-nvpU.js} +4 -4
  145. package/dist/{popover-ZxL7ktKk.js → popover-bEB8I_-w.js} +1 -1
  146. package/dist/{pos-types-BQ0QpYMp.js → pos-types-Cpdc4E33.js} +1 -1
  147. package/dist/{pos-variant-CKy8h_5i.js → pos-variant-ClMGu59I.js} +25 -25
  148. package/dist/print.js +146 -127
  149. package/dist/{programmer-variant-CbHstE28.js → programmer-variant-ChzgyA7x.js} +30 -30
  150. package/dist/{public-D-tdOz4b.js → public-BY8N5NDT.js} +9 -9
  151. package/dist/{rich-code-block-CTPj1LuD.js → rich-code-block-D2GiWuqD.js} +18 -18
  152. package/dist/{scientific-variant-B8U9h3II.js → scientific-variant-31_93gcZ.js} +8 -8
  153. package/dist/{sortable-provider-CSoWE7Ce.js → sortable-provider-DGiVn72t.js} +2 -2
  154. package/dist/{spinner-ffuwBXHl.js → spinner-CEVomQ5K.js} +1 -1
  155. package/dist/standard-layout-DTr9yy8Z.js +48 -0
  156. package/dist/{tabs-JgRq6ZJx.js → tabs-B8MXBbPW.js} +14 -14
  157. package/dist/{text-field-DURkIP-v.js → text-field-DN88qD0Q.js} +16 -15
  158. package/dist/theme-picker.js +13 -13
  159. package/dist/{theme-toggle-n_Zg7JAA.js → theme-toggle-C7pnu1Xh.js} +1 -1
  160. package/dist/{toolbar-items-IANZdcw4.js → toolbar-items-BDfoh8QB.js} +4 -4
  161. package/dist/{translate-material-CMHUH5Ha.js → translate-material-s_lxIV43.js} +1 -1
  162. package/dist/{translator-9zA-Um3W.js → translator-Cgql9srO.js} +56 -4
  163. package/dist/use-calculator-keyboard-DysnFK8m.js +222 -0
  164. package/dist/{use-chat-composer-BoIN7RCA.js → use-chat-composer-xCcp9fVc.js} +2250 -2195
  165. package/dist/{use-heading-spy-Ciw9GBHL.js → use-heading-spy-FIZlf9qj.js} +235 -154
  166. package/dist/{use-material-translation-CLNaMhUf.js → use-material-translation-xNzbSVgS.js} +1 -1
  167. package/dist/{use-return-focus-DWhbTGVe.js → use-return-focus-CW9KkDkp.js} +1 -1
  168. package/docs/README.md +2 -1
  169. package/docs/components/README.md +2 -0
  170. package/docs/components/buttons-and-actions.md +81 -2
  171. package/docs/components/data-display.md +6 -3
  172. package/docs/components/data-table-filter-and-lists.md +19 -6
  173. package/docs/components/feedback-and-status.md +20 -0
  174. package/docs/components/form-fields.md +60 -7
  175. package/docs/components/navigation-and-layout.md +48 -2
  176. package/docs/components/primitives.md +44 -2
  177. package/docs/components/rich-widgets.md +28 -0
  178. package/docs/components/selection-and-choice.md +176 -1
  179. package/docs/guides/calculator.md +1 -1
  180. package/docs/guides/cards-and-tiles.md +31 -24
  181. package/docs/guides/csp.md +4 -3
  182. package/docs/guides/data-grid.md +5 -4
  183. package/docs/guides/field-look-refined.md +2 -2
  184. package/docs/guides/forms.md +1 -0
  185. package/docs/guides/helpers.md +49 -0
  186. package/docs/guides/keypad.md +233 -0
  187. package/docs/guides/printing.md +51 -1
  188. package/docs/previews/buttons-actions-producttile.webp +0 -0
  189. package/docs/previews/data-display-codeblock.webp +0 -0
  190. package/docs/previews/data-display-codegroup.webp +0 -0
  191. package/docs/previews/data-display-jsonviewer.webp +0 -0
  192. package/docs/previews/form-fields-quantitystepper.webp +0 -0
  193. package/docs/previews/navigation-layout-panelcard.webp +0 -0
  194. package/docs/previews/rich-widgets-keypad.webp +0 -0
  195. package/docs/previews/selection-choice-statusmenu.webp +0 -0
  196. package/docs/roadmap.md +21 -0
  197. package/docs/troubleshooting.md +68 -4
  198. package/lib/components/ui/actions/action-card/action-card-tile.css +47 -0
  199. package/lib/components/ui/display/chip/chip-soft.css +27 -2
  200. package/lib/components/ui/display/code/code-moonlight.css +10 -10
  201. package/lib/components/ui/primitives/collapsible/collapsible.css +9 -0
  202. package/lib/components/ui/widgets/calculator/calculator-keys.css +3 -0
  203. package/lib/components/ui/widgets/calculator/calculator.css +118 -0
  204. package/package.json +7 -2
  205. package/dist/field-blur-context-BLGgf_3z.js +0 -73
  206. package/dist/key-layout-cR79xfGE.js +0 -38
  207. package/dist/standard-layout-BuSRr3TY.js +0 -40
@@ -1,47 +1,46 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
- import { d as t, n, r, t as i } from "./tabs-JgRq6ZJx.js";
3
- import { t as a } from "./button-GeIsUekU.js";
4
- import { t as o } from "./use-material-translation-CLNaMhUf.js";
5
- import { t as s } from "./icon-button-BSVpO1jP.js";
2
+ import { d as t, n, r, t as i } from "./tabs-B8MXBbPW.js";
3
+ import { t as a } from "./button-YfEMZbRO.js";
4
+ import { t as o } from "./use-material-translation-xNzbSVgS.js";
5
+ import { t as s } from "./icon-button-CpKxV264.js";
6
6
  import { t as c } from "./copy-to-clipboard-Be5Ffvs_.js";
7
- import { t as l } from "./useEvent-2fKq-6w8.js";
8
- import { t as u } from "./useLatest-C2PnQEeD.js";
9
- import { n as d } from "./use-slice-reducer-BGkeGtML.js";
10
- import { t as f } from "./skeleton-DSdtr2qc.js";
11
- import { t as p } from "./live-status-BGPaN8r8.js";
12
- import { n as m, t as h } from "./calculator-context-BugcKuVG.js";
13
- import { a as g, c as _, i as v, l as y, n as b, o as ee, r as te, s as ne } from "./calculator-announce-DRd2c6Dq.js";
14
- import { i as re, t as ie } from "./pos-types-BQ0QpYMp.js";
15
- import { a as ae, r as oe } from "./key-layout-cR79xfGE.js";
16
- import { n as x, r as se, t as ce } from "./programmer-word-CNCF7DJF.js";
17
- import { t as le } from "./standard-layout-BuSRr3TY.js";
18
- import { useCallback as S, useEffect as C, useId as w, useMemo as T, useRef as E, useState as ue, useSyncExternalStore as de } from "react";
19
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
20
- import { ClipboardPaste as fe, Copy as pe, History as me, Trash2 as he } from "lucide-react";
21
- import { createSlice as ge } from "@reduxjs/toolkit";
22
- import { currencyFractionDigits as _e } from "@nxgt/material-core/currency-digits";
23
- import { EMPTY_SESSION as A, calculate as ve, formatDecimal as j, formatExpression as M, historyEntry as N, keyFromEvent as P, localeSeparators as F, normaliseExpression as ye, parseDecimal as I, parseStoredHistory as be, press as L, pushHistory as xe, serializeHistory as Se, sessionOptions as Ce, toCanonical as R } from "@nxgt/material-core/calculator";
7
+ import { n as l } from "./use-slice-reducer-BGkeGtML.js";
8
+ import { t as u } from "./skeleton-DSdtr2qc.js";
9
+ import { t as d } from "./live-status-BGPaN8r8.js";
10
+ import { n as f, t as p } from "./calculator-context-BugcKuVG.js";
11
+ import { a as m, c as h, i as g, l as _, n as v, o as y, r as b, s as ee } from "./calculator-announce-DRd2c6Dq.js";
12
+ import { i as x, t as te } from "./pos-types-Cpdc4E33.js";
13
+ import { n as ne, t as re } from "./use-calculator-keyboard-DysnFK8m.js";
14
+ import { i as ie, n as ae } from "./key-layout-D2goCDkD.js";
15
+ import { t as oe } from "./standard-layout-DTr9yy8Z.js";
16
+ import { n as S, r as se, t as C } from "./programmer-word-CNCF7DJF.js";
17
+ import { useCallback as w, useEffect as T, useId as E, useMemo as D, useRef as O, useSyncExternalStore as ce } from "react";
18
+ import { Fragment as le, jsx as k, jsxs as A } from "react/jsx-runtime";
19
+ import { ClipboardPaste as ue, Copy as de, History as fe, Trash2 as pe } from "lucide-react";
20
+ import { createSlice as me } from "@reduxjs/toolkit";
21
+ import { currencyFractionDigits as he } from "@nxgt/material-core/currency-digits";
22
+ import { EMPTY_SESSION as j, calculate as ge, formatDecimal as M, formatExpression as N, historyEntry as P, localeSeparators as F, normaliseExpression as I, parseDecimal as L, parseStoredHistory as _e, press as R, pushHistory as ve, serializeHistory as ye, sessionOptions as be, toCanonical as z } from "@nxgt/material-core/calculator";
24
23
  //#region lib/components/ui/widgets/calculator/partials/calculator-announcer.tsx
25
- function we() {
26
- let { t: e } = o(), { state: t } = m(), n = t.announcement;
27
- return /* @__PURE__ */ O(p, {
24
+ function xe() {
25
+ let { t: e } = o(), { state: t } = f(), n = t.announcement;
26
+ return /* @__PURE__ */ k(d, {
28
27
  slot: "calculator-status",
29
28
  children: n ? e(n.key, n.fallback, n.values) : null
30
29
  });
31
30
  }
32
31
  //#endregion
33
32
  //#region lib/components/ui/widgets/calculator/partials/calculator-memory.tsx
34
- function Te() {
35
- let { t: e } = o(), { hasMemory: t, state: n, locale: r } = m();
33
+ function Se() {
34
+ let { t: e } = o(), { hasMemory: t, state: n, locale: r } = f();
36
35
  if (!t) return null;
37
- let i = v(n.session.memory, r);
38
- return /* @__PURE__ */ k("span", {
36
+ let i = g(n.session.memory, r);
37
+ return /* @__PURE__ */ A("span", {
39
38
  "data-slot": "calculator-memory",
40
39
  className: "nxgt-calc-memory bg-primary-container text-foreground",
41
- children: [/* @__PURE__ */ O("span", {
40
+ children: [/* @__PURE__ */ k("span", {
42
41
  "aria-hidden": "true",
43
42
  children: "M"
44
- }), /* @__PURE__ */ O("span", {
43
+ }), /* @__PURE__ */ k("span", {
45
44
  className: "sr-only",
46
45
  children: e("material.calculator.display.memory", "Memory {value}", { value: i })
47
46
  })]
@@ -49,31 +48,31 @@ function Te() {
49
48
  }
50
49
  //#endregion
51
50
  //#region lib/components/ui/widgets/calculator/partials/calculator-tools.tsx
52
- function Ee({ tapeId: e }) {
53
- let { t } = o(), { display: n, copy: r, paste: i, toggleTape: a, state: c, toggleRef: l } = m();
54
- return /* @__PURE__ */ k("div", {
51
+ function Ce({ tapeId: e }) {
52
+ let { t } = o(), { display: n, copy: r, paste: i, toggleTape: a, state: c, toggleRef: l } = f();
53
+ return /* @__PURE__ */ A("div", {
55
54
  className: "nxgt-calc-tools",
56
55
  children: [
57
- /* @__PURE__ */ O(Te, {}),
58
- /* @__PURE__ */ O("span", { className: "nxgt-calc-grow" }),
59
- /* @__PURE__ */ O(s, {
56
+ /* @__PURE__ */ k(Se, {}),
57
+ /* @__PURE__ */ k("span", { className: "nxgt-calc-grow" }),
58
+ /* @__PURE__ */ k(s, {
60
59
  size: "sm",
61
60
  variant: "ghost",
62
61
  className: "nxgt-calc-tool",
63
62
  "aria-label": t("material.calculator.copy", "Copy result"),
64
63
  disabled: n.value === "",
65
64
  onClick: r,
66
- children: /* @__PURE__ */ O(pe, {})
65
+ children: /* @__PURE__ */ k(de, {})
67
66
  }),
68
- /* @__PURE__ */ O(s, {
67
+ /* @__PURE__ */ k(s, {
69
68
  size: "sm",
70
69
  variant: "ghost",
71
70
  className: "nxgt-calc-tool",
72
71
  "aria-label": t("material.calculator.paste", "Paste an expression"),
73
72
  onClick: i,
74
- children: /* @__PURE__ */ O(fe, {})
73
+ children: /* @__PURE__ */ k(ue, {})
75
74
  }),
76
- /* @__PURE__ */ O(s, {
75
+ /* @__PURE__ */ k(s, {
77
76
  ref: l,
78
77
  size: "sm",
79
78
  variant: "ghost",
@@ -82,219 +81,59 @@ function Ee({ tapeId: e }) {
82
81
  "aria-expanded": c.tapeOpen,
83
82
  "aria-controls": e,
84
83
  onClick: a,
85
- children: /* @__PURE__ */ O(me, {})
84
+ children: /* @__PURE__ */ k(fe, {})
86
85
  })
87
86
  ]
88
87
  });
89
88
  }
90
89
  //#endregion
91
90
  //#region lib/components/ui/widgets/calculator/partials/calculator-display.tsx
92
- function De({ tapeId: e }) {
93
- return /* @__PURE__ */ k("div", {
91
+ function we({ tapeId: e }) {
92
+ return /* @__PURE__ */ A("div", {
94
93
  "data-slot": "calculator-display",
95
94
  className: "nxgt-calc-display bg-muted",
96
- children: [/* @__PURE__ */ O(Ee, { tapeId: e }), /* @__PURE__ */ O(re, {})]
95
+ children: [/* @__PURE__ */ k(Ce, { tapeId: e }), /* @__PURE__ */ k(x, {})]
97
96
  });
98
97
  }
99
98
  //#endregion
100
- //#region lib/components/ui/widgets/calculator/partials/calculator-key.tsx
101
- var Oe = {
102
- digit: "bg-muted text-foreground",
103
- operator: "bg-secondary-container text-foreground",
104
- equals: "bg-primary text-primary-foreground",
105
- utility: "bg-tertiary-container text-foreground",
106
- function: "bg-muted text-foreground",
107
- memory: "bg-muted text-foreground",
108
- bracket: "bg-muted text-foreground"
109
- };
110
- function ke({ def: t, row: n, index: r, tabIndex: i, decimal: a, unavailable: s, onPress: c, onFocus: l, buttonRef: u }) {
111
- let { t: d } = o();
112
- return /* @__PURE__ */ O("button", {
113
- ref: u,
114
- type: "button",
115
- "data-slot": "calculator-key",
116
- "data-key": t.id,
117
- "data-role": t.role,
118
- "data-span": t.span,
119
- "aria-disabled": s ? !0 : void 0,
120
- tabIndex: i,
121
- "aria-label": d(t.name.key, t.name.fallback),
122
- className: e("nxgt-calc-key", Oe[t.role]),
123
- onClick: () => !s && c(t),
124
- onFocus: () => l(n, r),
125
- children: /* @__PURE__ */ O("span", {
126
- "aria-hidden": "true",
127
- children: t.key === "." ? a : t.glyph
128
- })
129
- });
130
- }
131
- //#endregion
132
- //#region lib/components/ui/widgets/calculator/partials/keypad-navigation.ts
133
- function Ae(e) {
134
- return e.rows.map((e) => {
135
- let t = 0;
136
- return e.map((e) => {
137
- let n = t;
138
- return t += e.span ?? 1, {
139
- start: n,
140
- end: t
141
- };
142
- });
143
- });
144
- }
145
- var z = (e) => Math.max(e - 1, 0);
146
- function je(e, t, n, r) {
147
- let i = t.row < r, a = i ? 0 : r, o = i ? r - 1 : z(e.length), s = e[t.row] ?? [];
148
- if (n === "ArrowUp" || n === "ArrowDown") {
149
- let e = t.row + (n === "ArrowUp" ? -1 : 1);
150
- return e < a || e > o ? void 0 : null;
151
- }
152
- if (!(i ? n === "ArrowRight" && t.index === z(s.length) : n === "ArrowLeft" && t.index === 0)) return null;
153
- let c = t.row - a, l = i ? [r, z(e.length)] : [0, r - 1], u = Math.min(l[0] + c, l[1]);
154
- return {
155
- row: u,
156
- index: i ? 0 : z((e[u] ?? []).length)
157
- };
158
- }
159
- function Me(e, t, n, r = !1, i) {
160
- let a = e[t.row] ?? [], o = a[t.index];
161
- if (!o) return;
162
- if (i && !(r && (n === "Home" || n === "End"))) {
163
- let r = je(e, t, n, i);
164
- if (r != null) return r;
165
- if (r === void 0) return;
166
- }
167
- let s = z(e.length);
168
- switch (n) {
169
- case "ArrowLeft": return t.index > 0 ? {
170
- row: t.row,
171
- index: t.index - 1
172
- } : void 0;
173
- case "ArrowRight": return t.index < z(a.length) ? {
174
- row: t.row,
175
- index: t.index + 1
176
- } : void 0;
177
- case "ArrowUp":
178
- case "ArrowDown": {
179
- let r = t.row + (n === "ArrowUp" ? -1 : 1), i = e[r];
180
- if (!i) return;
181
- let a = i.findIndex((e) => e.start <= o.start && o.start < e.end);
182
- return {
183
- row: r,
184
- index: Math.max(a, 0)
185
- };
186
- }
187
- case "Home": return r ? {
188
- row: 0,
189
- index: 0
190
- } : {
191
- row: t.row,
192
- index: 0
193
- };
194
- case "End": return r ? {
195
- row: s,
196
- index: z((e[s] ?? []).length)
197
- } : {
198
- row: t.row,
199
- index: z(a.length)
200
- };
201
- default: return;
202
- }
203
- }
204
- function Ne(e) {
205
- let t = e.querySelectorAll("[data-pane]"), [n, r] = [t[0]?.firstElementChild, t[1]?.firstElementChild];
206
- return !n || !r ? !1 : n.getBoundingClientRect().right <= r.getBoundingClientRect().left;
207
- }
208
- //#endregion
209
99
  //#region lib/components/ui/widgets/calculator/partials/calculator-keypad.tsx
210
- var Pe = {
100
+ var Te = {
211
101
  columns: 12,
212
102
  rows: []
213
103
  };
214
- function Fe(e, t, n) {
215
- let r = e.map((e, t) => n(e, t));
216
- return t ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("div", {
217
- className: "nxgt-calc-pane",
218
- "data-pane": "functions",
219
- children: r.slice(0, t)
220
- }), /* @__PURE__ */ O("div", {
221
- className: "nxgt-calc-pane",
222
- "data-pane": "main",
223
- children: r.slice(t)
224
- })] }) : r;
225
- }
226
- var Ie = /* @__PURE__ */ new Set([
227
- "ArrowLeft",
228
- "ArrowRight",
229
- "ArrowUp",
230
- "ArrowDown",
231
- "Home",
232
- "End"
233
- ]);
234
- function Le({ helpId: e }) {
235
- let { t } = o(), { definition: n, press: r, locale: i, state: a } = m(), s = n.layout ?? Pe, c = T(() => Ae(s), [s]), [l, u] = ue({
236
- row: 0,
237
- index: 0
238
- }), d = c[l.row]?.[l.index] ? l : {
239
- row: 0,
240
- index: 0
241
- }, f = E(/* @__PURE__ */ new Map()), p = F(i).decimal, h = n.programmer ? a.programmer.base : void 0;
242
- function g(e) {
243
- if (!Ie.has(e.key) || e.altKey || e.metaKey) return;
244
- let t = Me(c, d, e.key, e.ctrlKey, Ne(e.currentTarget) ? s.split : void 0);
245
- e.preventDefault(), t && f.current.get(`${t.row}:${t.index}`)?.focus();
246
- }
247
- return /* @__PURE__ */ O("div", {
248
- role: "group",
249
- "aria-label": t("material.calculator.keypad", "Keypad"),
250
- "aria-describedby": e,
251
- dir: "ltr",
252
- "data-slot": "calculator-keypad",
253
- "data-columns": s.columns,
254
- className: "nxgt-calc-keys",
255
- onKeyDown: g,
256
- children: Fe(s.rows, s.split, (e, t) => e.map((e, n) => {
257
- let i = oe(e, a.second);
258
- return /* @__PURE__ */ O(ke, {
259
- def: i,
260
- row: t,
261
- index: n,
262
- decimal: p,
263
- unavailable: h !== void 0 && x(i.key, h),
264
- tabIndex: d.row === t && d.index === n ? 0 : -1,
265
- buttonRef: (e) => {
266
- f.current.set(`${t}:${n}`, e);
267
- },
268
- onFocus: (e, t) => u({
269
- row: e,
270
- index: t
271
- }),
272
- onPress: (e) => {
273
- for (let t of ae(e)) r(t);
274
- }
275
- }, i.id);
276
- }))
104
+ function Ee({ helpId: e }) {
105
+ let { t } = o(), { definition: n, press: r, locale: i, state: a } = f(), s = n.layout ?? Te, c = n.programmer ? a.programmer.base : void 0, l = a.second, u = D(() => (e) => ae(e, l), [l]);
106
+ return /* @__PURE__ */ k(ne, {
107
+ layout: s,
108
+ label: t("material.calculator.keypad", "Keypad"),
109
+ describedBy: e,
110
+ decimal: F(i).decimal,
111
+ faceOf: u,
112
+ unavailable: (e) => c !== void 0 && S(e.key, c),
113
+ onPress: (e) => {
114
+ for (let t of ie(e)) r(t);
115
+ }
277
116
  });
278
117
  }
279
118
  //#endregion
280
119
  //#region lib/components/ui/widgets/calculator/variants/variant-loader.ts
281
- var Re = {
282
- scientific: () => import("./scientific-variant-B8U9h3II.js"),
283
- pos: () => import("./pos-variant-CKy8h_5i.js"),
284
- programmer: () => import("./programmer-variant-CbHstE28.js"),
285
- financial: () => import("./financial-variant-BhqJp5C-.js"),
286
- conversion: () => import("./conversion-variant-DTQqAyDt.js")
120
+ var De = {
121
+ scientific: () => import("./scientific-variant-31_93gcZ.js"),
122
+ pos: () => import("./pos-variant-ClMGu59I.js"),
123
+ programmer: () => import("./programmer-variant-ChzgyA7x.js"),
124
+ financial: () => import("./financial-variant-Ws0Jp01H.js"),
125
+ conversion: () => import("./conversion-variant-C-LPx5ek.js")
287
126
  }, B = "failed", V = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Set(), W = () => {
288
127
  for (let e of U) e();
289
128
  };
290
129
  function G(e) {
291
- let t = Re[e];
130
+ let t = De[e];
292
131
  if (!t || V.has(e) && V.get(e) !== B) return Promise.resolve();
293
132
  let n = H.get(e);
294
133
  if (n) return n;
295
134
  V.get(e) === B && (V.delete(e), W());
296
135
  let r = t().then(({ variant: t }) => {
297
- t.logic && y(e, t.logic), V.set(e, t.part);
136
+ t.logic && _(e, t.logic), V.set(e, t.part);
298
137
  }).catch(() => {
299
138
  V.set(e, B);
300
139
  }).finally(() => {
@@ -302,59 +141,59 @@ function G(e) {
302
141
  });
303
142
  return H.set(e, r), r;
304
143
  }
305
- var ze = (e) => (U.add(e), () => {
144
+ var Oe = (e) => (U.add(e), () => {
306
145
  U.delete(e);
307
146
  });
308
- function Be(e) {
309
- let t = de(ze, () => V.get(e), () => void 0);
310
- return C(() => {
147
+ function ke(e) {
148
+ let t = ce(Oe, () => V.get(e), () => void 0);
149
+ return T(() => {
311
150
  V.has(e) || G(e);
312
151
  }, [e]), t;
313
152
  }
314
153
  //#endregion
315
154
  //#region lib/components/ui/widgets/calculator/partials/calculator-loading.tsx
316
- var Ve = 24;
317
- function He() {
318
- let { t: e } = o(), { variant: t, definition: n } = m(), r = n.pending === "failed", i = r ? e("material.calculator.load-failed", "This calculator could not be loaded.") : e("material.calculator.loading", "Loading the calculator");
319
- return /* @__PURE__ */ O("div", {
155
+ var Ae = 24;
156
+ function je() {
157
+ let { t: e } = o(), { variant: t, definition: n } = f(), r = n.pending === "failed", i = r ? e("material.calculator.load-failed", "This calculator could not be loaded.") : e("material.calculator.loading", "Loading the calculator");
158
+ return /* @__PURE__ */ k("div", {
320
159
  className: "nxgt-calc-body nxgt-calc-loading",
321
160
  "data-state": r ? "failed" : "loading",
322
161
  role: "status",
323
- children: /* @__PURE__ */ k("div", {
162
+ children: /* @__PURE__ */ A("div", {
324
163
  className: "nxgt-calc-main",
325
- children: [r ? /* @__PURE__ */ k("div", {
164
+ children: [r ? /* @__PURE__ */ A("div", {
326
165
  className: "nxgt-calc-loading-message",
327
- children: [/* @__PURE__ */ O("p", { children: i }), /* @__PURE__ */ O(a, {
166
+ children: [/* @__PURE__ */ k("p", { children: i }), /* @__PURE__ */ k(a, {
328
167
  type: "button",
329
168
  variant: "outlined",
330
169
  onClick: () => void G(t),
331
170
  children: e("material.calculator.retry", "Try again")
332
171
  })]
333
- }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("p", {
172
+ }) : /* @__PURE__ */ A(le, { children: [/* @__PURE__ */ k("p", {
334
173
  className: "sr-only",
335
174
  children: i
336
- }), /* @__PURE__ */ O(f, {
175
+ }), /* @__PURE__ */ k(u, {
337
176
  "aria-hidden": "true",
338
177
  className: "nxgt-calc-loading-display"
339
- })] }), /* @__PURE__ */ O("div", {
178
+ })] }), /* @__PURE__ */ k("div", {
340
179
  className: "nxgt-calc-loading-pad",
341
180
  "aria-hidden": "true",
342
181
  "aria-busy": !r || void 0,
343
- children: Array.from({ length: Ve }, (e, t) => /* @__PURE__ */ O(f, {}, t))
182
+ children: Array.from({ length: Ae }, (e, t) => /* @__PURE__ */ k(u, {}, t))
344
183
  })]
345
184
  })
346
185
  });
347
186
  }
348
187
  //#endregion
349
188
  //#region lib/components/ui/widgets/calculator/partials/calculator-panel-body.tsx
350
- function Ue({ panel: e }) {
351
- return /* @__PURE__ */ O("div", {
189
+ function Me({ panel: e }) {
190
+ return /* @__PURE__ */ k("div", {
352
191
  className: "nxgt-calc-body",
353
192
  onKeyDown: (e) => e.stopPropagation(),
354
193
  onPaste: (e) => e.stopPropagation(),
355
- children: /* @__PURE__ */ O("div", {
194
+ children: /* @__PURE__ */ k("div", {
356
195
  className: "nxgt-calc-main",
357
- children: /* @__PURE__ */ O(e, {})
196
+ children: /* @__PURE__ */ k(e, {})
358
197
  })
359
198
  });
360
199
  }
@@ -392,10 +231,10 @@ var K = [
392
231
  key: "material.calculator.variants.conversion",
393
232
  fallback: "Conversion"
394
233
  }
395
- }, We = {
234
+ }, Ne = {
396
235
  id: "standard",
397
236
  label: q.standard,
398
- layout: le,
237
+ layout: oe,
399
238
  extraKeys: [
400
239
  "(",
401
240
  ")",
@@ -403,11 +242,11 @@ var K = [
403
242
  "ans"
404
243
  ]
405
244
  };
406
- function Ge() {
245
+ function Pe() {
407
246
  return K;
408
247
  }
409
- function Ke(e, t) {
410
- if (e === "standard") return We;
248
+ function Fe(e, t) {
249
+ if (e === "standard") return Ne;
411
250
  let n = {
412
251
  id: e,
413
252
  label: q[e]
@@ -423,33 +262,33 @@ function Ke(e, t) {
423
262
  ...t
424
263
  };
425
264
  }
426
- function qe(e) {
265
+ function Ie(e) {
427
266
  let t = new Set(e.extraKeys ?? []);
428
267
  for (let n of e.layout?.rows ?? []) for (let e of n) t.add(e.key), e.alt && t.add(e.alt.key);
429
268
  return t;
430
269
  }
431
270
  //#endregion
432
271
  //#region lib/components/ui/widgets/calculator/partials/calculator-switcher.tsx
433
- function Je({ children: e }) {
434
- let { t: a } = o(), { variant: s, variants: c, setVariant: l } = m();
435
- return /* @__PURE__ */ k(i, {
272
+ function Le({ children: e }) {
273
+ let { t: a } = o(), { variant: s, variants: c, setVariant: l } = f();
274
+ return /* @__PURE__ */ A(i, {
436
275
  value: s,
437
276
  variant: "segmented",
438
277
  className: "nxgt-calc-tabs",
439
278
  onValueChange: (e) => l(e),
440
- children: [/* @__PURE__ */ O(r, {
279
+ children: [/* @__PURE__ */ k(r, {
441
280
  "aria-label": a("material.calculator.variants.label", "Calculator type"),
442
281
  className: "nxgt-calc-switcher",
443
282
  children: c.map((e) => {
444
283
  let t = q[e];
445
- return /* @__PURE__ */ O(n, {
284
+ return /* @__PURE__ */ k(n, {
446
285
  value: e,
447
286
  onPointerEnter: () => void G(e),
448
287
  onFocus: () => void G(e),
449
288
  children: a(t.key, t.fallback)
450
289
  }, e);
451
290
  })
452
- }), /* @__PURE__ */ O(t, {
291
+ }), /* @__PURE__ */ k(t, {
453
292
  value: s,
454
293
  className: "nxgt-calc-panel",
455
294
  children: e
@@ -463,34 +302,34 @@ var J = [
463
302
  "bg-secondary-container",
464
303
  "bg-tertiary-container"
465
304
  ];
466
- function Ye({ entry: e, colour: t }) {
467
- let { t: n } = o(), { replay: r, reuse: i, locale: a } = m(), s = M(e.expression, { locale: a }), c = I(e.result), l = c ? j(c, { locale: a }) : e.result;
468
- return /* @__PURE__ */ k("li", {
305
+ function Re({ entry: e, colour: t }) {
306
+ let { t: n } = o(), { replay: r, reuse: i, locale: a } = f(), s = N(e.expression, { locale: a }), c = L(e.result), l = c ? M(c, { locale: a }) : e.result;
307
+ return /* @__PURE__ */ A("li", {
469
308
  "data-slot": "calculator-tape-entry",
470
309
  className: `nxgt-calc-entry ${t}`,
471
- children: [/* @__PURE__ */ O("button", {
310
+ children: [/* @__PURE__ */ k("button", {
472
311
  type: "button",
473
312
  dir: "ltr",
474
313
  className: "nxgt-calc-entry-expression",
475
314
  "aria-label": n("material.calculator.tape.replay", "Replay {expression}", { expression: s }),
476
315
  onClick: () => r(e),
477
316
  children: s
478
- }), /* @__PURE__ */ k("button", {
317
+ }), /* @__PURE__ */ A("button", {
479
318
  type: "button",
480
319
  dir: "ltr",
481
320
  className: "nxgt-calc-entry-result",
482
321
  "aria-label": n("material.calculator.tape.reuse", "Use result {result}", { result: l }),
483
322
  onClick: () => i(e),
484
- children: [/* @__PURE__ */ O("span", {
323
+ children: [/* @__PURE__ */ k("span", {
485
324
  "aria-hidden": "true",
486
325
  children: "= "
487
326
  }), l]
488
327
  })]
489
328
  });
490
329
  }
491
- function Y({ id: e }) {
492
- let { t } = o(), { state: n, clearTape: r, tapeRef: i } = m(), { history: a } = n;
493
- return /* @__PURE__ */ k("div", {
330
+ function ze({ id: e }) {
331
+ let { t } = o(), { state: n, clearTape: r, tapeRef: i } = f(), { history: a } = n;
332
+ return /* @__PURE__ */ A("div", {
494
333
  ref: i,
495
334
  id: e,
496
335
  role: "group",
@@ -498,30 +337,30 @@ function Y({ id: e }) {
498
337
  "data-slot": "calculator-tape",
499
338
  "aria-label": t("material.calculator.tape.label", "History"),
500
339
  className: "nxgt-calc-tape",
501
- children: [/* @__PURE__ */ k("header", {
340
+ children: [/* @__PURE__ */ A("header", {
502
341
  className: "nxgt-calc-tape-head",
503
342
  children: [
504
- /* @__PURE__ */ O("p", {
343
+ /* @__PURE__ */ k("p", {
505
344
  className: "nxgt-calc-tape-title",
506
345
  children: t("material.calculator.tape.label", "History")
507
346
  }),
508
- /* @__PURE__ */ O("span", { className: "nxgt-calc-grow" }),
509
- /* @__PURE__ */ O(s, {
347
+ /* @__PURE__ */ k("span", { className: "nxgt-calc-grow" }),
348
+ /* @__PURE__ */ k(s, {
510
349
  size: "sm",
511
350
  variant: "ghost",
512
351
  className: "nxgt-calc-tool",
513
352
  "aria-label": t("material.calculator.tape.clear", "Clear history"),
514
353
  disabled: a.length === 0,
515
354
  onClick: r,
516
- children: /* @__PURE__ */ O(he, {})
355
+ children: /* @__PURE__ */ k(pe, {})
517
356
  })
518
357
  ]
519
- }), a.length === 0 ? /* @__PURE__ */ O("p", {
358
+ }), a.length === 0 ? /* @__PURE__ */ k("p", {
520
359
  className: "nxgt-calc-tape-empty text-muted-foreground",
521
360
  children: t("material.calculator.tape.empty", "Your calculations appear here.")
522
- }) : /* @__PURE__ */ O("ul", {
361
+ }) : /* @__PURE__ */ k("ul", {
523
362
  className: "nxgt-calc-entries",
524
- children: a.map((e, t) => /* @__PURE__ */ O(Ye, {
363
+ children: a.map((e, t) => /* @__PURE__ */ k(Re, {
525
364
  entry: e,
526
365
  colour: J[(a.length - 1 - t) % J.length] ?? ""
527
366
  }, e.id))
@@ -530,23 +369,23 @@ function Y({ id: e }) {
530
369
  }
531
370
  //#endregion
532
371
  //#region lib/components/ui/widgets/calculator/partials/calculator-shell.tsx
533
- function Xe({ className: t, "aria-label": n, onKeyDown: r, onPaste: i }) {
534
- let { t: a } = o(), { variant: s, variants: c, state: l, definition: u } = m(), d = u.toolbar, f = u.panel, p = w(), h = w(), g = u.display, _ = u.aside, v = u.pending !== void 0, y = !!f || v, b = v ? /* @__PURE__ */ O(He, {}) : f ? /* @__PURE__ */ O(Ue, { panel: f }) : /* @__PURE__ */ k("div", {
372
+ function Be({ className: t, "aria-label": n, onKeyDown: r, onPaste: i }) {
373
+ let { t: a } = o(), { variant: s, variants: c, state: l, definition: u } = f(), d = u.toolbar, p = u.panel, m = E(), h = E(), g = u.display, _ = u.aside, v = u.pending !== void 0, y = !!p || v, b = v ? /* @__PURE__ */ k(je, {}) : p ? /* @__PURE__ */ k(Me, { panel: p }) : /* @__PURE__ */ A("div", {
535
374
  className: "nxgt-calc-body",
536
- children: [/* @__PURE__ */ k("div", {
375
+ children: [/* @__PURE__ */ A("div", {
537
376
  className: "nxgt-calc-main",
538
377
  children: [
539
- g ? /* @__PURE__ */ O(g, {}) : /* @__PURE__ */ O(De, { tapeId: h }),
540
- d ? /* @__PURE__ */ O(d, {}) : null,
541
- /* @__PURE__ */ O(Le, { helpId: p })
378
+ g ? /* @__PURE__ */ k(g, {}) : /* @__PURE__ */ k(we, { tapeId: h }),
379
+ d ? /* @__PURE__ */ k(d, {}) : null,
380
+ /* @__PURE__ */ k(Ee, { helpId: m })
542
381
  ]
543
- }), _ ? /* @__PURE__ */ O("div", {
382
+ }), _ ? /* @__PURE__ */ k("div", {
544
383
  "data-slot": "calculator-aside",
545
384
  className: "nxgt-calc-aside",
546
- children: /* @__PURE__ */ O(_, {})
547
- }) : /* @__PURE__ */ O(Y, { id: h })]
385
+ children: /* @__PURE__ */ k(_, {})
386
+ }) : /* @__PURE__ */ k(ze, { id: h })]
548
387
  });
549
- return /* @__PURE__ */ k("div", {
388
+ return /* @__PURE__ */ A("div", {
550
389
  role: "group",
551
390
  "aria-label": n ?? a("material.calculator.label", "Calculator"),
552
391
  "data-slot": "calculator",
@@ -556,36 +395,36 @@ function Xe({ className: t, "aria-label": n, onKeyDown: r, onPaste: i }) {
556
395
  onKeyDown: r,
557
396
  onPaste: i,
558
397
  children: [
559
- c.length > 1 ? /* @__PURE__ */ O(Je, { children: b }) : b,
560
- y ? null : /* @__PURE__ */ O("p", {
561
- id: p,
398
+ c.length > 1 ? /* @__PURE__ */ k(Le, { children: b }) : b,
399
+ y ? null : /* @__PURE__ */ k("p", {
400
+ id: m,
562
401
  className: "sr-only",
563
402
  children: a("material.calculator.help", "Type digits and operators. Enter calculates, Escape clears, Backspace deletes.")
564
403
  }),
565
- y ? null : /* @__PURE__ */ O(we, {})
404
+ y ? null : /* @__PURE__ */ k(xe, {})
566
405
  ]
567
406
  });
568
407
  }
569
408
  //#endregion
570
409
  //#region lib/components/ui/widgets/calculator/engine.ts
571
- function X(e) {
410
+ function Y(e) {
572
411
  let t = {};
573
412
  e.precision !== void 0 && (t.precision = Math.min(Math.max(Math.trunc(e.precision), 1), 34)), e.rounding && (t.rounding = e.rounding);
574
413
  let n = {
575
414
  percent: e.percent,
576
415
  ctx: t
577
416
  };
578
- return e.programmer ? _("programmer")?.options?.(n, e) ?? n : e.scientific ? _("scientific")?.options?.(n, e) ?? n : n;
417
+ return e.programmer ? h("programmer")?.options?.(n, e) ?? n : e.scientific ? h("scientific")?.options?.(n, e) ?? n : n;
579
418
  }
580
- var Ze = {
419
+ var Ve = {
581
420
  auto: "auto",
582
421
  sci: "scientific",
583
422
  eng: "engineering"
584
- }, Qe = (e) => Ze[e ?? "auto"], $e = /(?:\s*(?:mod|[-+*/^])\s*)+$/, et = /\d*\.?\d+$|\d+\.$/, tt = (e) => e.replace($e, "").trim();
585
- function nt(e, t) {
586
- let n = t.programmer ? _("programmer")?.display?.(e, t) : void 0;
423
+ }, He = (e) => Ve[e ?? "auto"], Ue = /(?:\s*(?:mod|[-+*/^])\s*)+$/, We = /\d*\.?\d+$|\d+\.$/, Ge = (e) => e.replace(Ue, "").trim();
424
+ function Ke(e, t) {
425
+ let n = t.programmer ? h("programmer")?.display?.(e, t) : void 0;
587
426
  if (n) return n;
588
- let { session: r } = e, { locale: i } = t, a = Qe(t.notation), o = M(r.expression, { locale: i });
427
+ let { session: r } = e, { locale: i } = t, a = He(t.notation), o = N(r.expression, { locale: i });
589
428
  if (r.error) return {
590
429
  expression: o,
591
430
  result: "",
@@ -593,10 +432,10 @@ function nt(e, t) {
593
432
  value: "",
594
433
  error: r.error
595
434
  };
596
- let s = r.justEvaluated ? I(r.result) : void 0;
435
+ let s = r.justEvaluated ? L(r.result) : void 0;
597
436
  if (s) return {
598
437
  expression: o,
599
- result: j(s, {
438
+ result: M(s, {
600
439
  locale: i,
601
440
  notation: a
602
441
  }),
@@ -604,7 +443,7 @@ function nt(e, t) {
604
443
  value: r.result,
605
444
  error: ""
606
445
  };
607
- let c = tt(r.expression);
446
+ let c = Ge(r.expression);
608
447
  if (c === "") return {
609
448
  expression: o,
610
449
  result: "0",
@@ -612,65 +451,65 @@ function nt(e, t) {
612
451
  value: "",
613
452
  error: ""
614
453
  };
615
- let l = ve(c, Ce(r, X(t)));
454
+ let l = ge(c, be(r, Y(t)));
616
455
  if (l.ok) return {
617
456
  expression: o,
618
- result: j(l.value, {
457
+ result: M(l.value, {
619
458
  locale: i,
620
459
  notation: a
621
460
  }),
622
461
  kind: "preview",
623
- value: R(l.value),
462
+ value: z(l.value),
624
463
  error: ""
625
464
  };
626
- let u = et.exec(c)?.[0], d = u ? I(u) : void 0;
465
+ let u = We.exec(c)?.[0], d = u ? L(u) : void 0;
627
466
  return {
628
467
  expression: o,
629
- result: d ? j(d, { locale: i }) : "0",
468
+ result: d ? M(d, { locale: i }) : "0",
630
469
  kind: "preview",
631
470
  value: "",
632
471
  error: ""
633
472
  };
634
473
  }
635
- var rt = (e) => {
636
- let t = I(e.session.memory);
474
+ var qe = (e) => {
475
+ let t = L(e.session.memory);
637
476
  return t !== void 0 && t.c !== 0n;
638
477
  };
639
478
  //#endregion
640
479
  //#region lib/components/ui/widgets/calculator/calculator-variant-steps.ts
641
- function it(e, t) {
642
- let { action: n, env: r, format: i } = t, a = _("pos");
480
+ function Je(e, t) {
481
+ let { action: n, env: r, format: i } = t, a = h("pos");
643
482
  if (!a?.reducePos || !a.announcePos) return;
644
483
  let o = a.reducePos(e.pos, n, r);
645
484
  e.announcement = a.announcePos(e.pos, o, n, r, i), e.pos = o;
646
485
  }
647
- function at(e, t) {
648
- let n = _("programmer")?.reduce?.(e.session, e.programmer, t);
486
+ function Ye(e, t) {
487
+ let n = h("programmer")?.reduce?.(e.session, e.programmer, t);
649
488
  n && Object.assign(e, n);
650
489
  }
651
490
  //#endregion
652
491
  //#region lib/components/ui/widgets/calculator/calculator.slice.ts
653
- var ot = {
492
+ var Xe = {
654
493
  variant: "standard",
655
- session: A,
494
+ session: j,
656
495
  history: [],
657
496
  tapeOpen: !1,
658
497
  angle: "deg",
659
498
  notation: "auto",
660
499
  second: !1,
661
- pos: ie,
662
- programmer: ce,
500
+ pos: te,
501
+ programmer: C,
663
502
  announcement: null,
664
503
  restored: !1
665
- }, st = 1e3, Z = ge({
504
+ }, Ze = 1e3, X = me({
666
505
  name: "calculator",
667
- initialState: ot,
506
+ initialState: Xe,
668
507
  reducers: {
669
508
  press: (e, t) => {
670
- let { key: n, settings: r, id: i } = t.payload, a = e.session, o = L(a, n, X(r));
671
- e.session = o, e.announcement = te(n, a, o, r.locale, r.programmer);
672
- let s = n === "=" && !a.justEvaluated ? N(o, e.variant, i) : void 0;
673
- s && (e.history = xe(e.history, s));
509
+ let { key: n, settings: r, id: i } = t.payload, a = e.session, o = R(a, n, Y(r));
510
+ e.session = o, e.announcement = b(n, a, o, r.locale, r.programmer);
511
+ let s = n === "=" && !a.justEvaluated ? P(o, e.variant, i) : void 0;
512
+ s && (e.history = ve(e.history, s));
674
513
  },
675
514
  setVariant: (e, t) => {
676
515
  e.variant = t.payload;
@@ -685,35 +524,35 @@ var ot = {
685
524
  }, e.announcement = null;
686
525
  },
687
526
  reuse: (e, t) => {
688
- e.session = L({
527
+ e.session = R({
689
528
  ...e.session,
690
529
  ans: t.payload.entry.result
691
- }, "ans", X(t.payload.settings)), e.announcement = null;
530
+ }, "ans", Y(t.payload.settings)), e.announcement = null;
692
531
  },
693
532
  paste: (e, t) => {
694
- let n = ye(t.payload.text.slice(0, st), t.payload.locale).trim();
533
+ let n = I(t.payload.text.slice(0, Ze), t.payload.locale).trim();
695
534
  n !== "" && (e.session = {
696
535
  ...e.session,
697
536
  expression: n,
698
537
  result: "",
699
538
  error: "",
700
539
  justEvaluated: !1
701
- }, e.announcement = g("pasted"));
540
+ }, e.announcement = m("pasted"));
702
541
  },
703
542
  setAngle: (e, t) => {
704
- e.angle = t.payload, e.announcement = b(t.payload);
543
+ e.angle = t.payload, e.announcement = v(t.payload);
705
544
  },
706
545
  setNotation: (e, t) => {
707
- e.notation = t.payload, e.announcement = ee(t.payload);
546
+ e.notation = t.payload, e.announcement = y(t.payload);
708
547
  },
709
548
  toggleSecond: (e, t) => {
710
- e.second = t.payload ?? !e.second, e.announcement = ne(e.second);
549
+ e.second = t.payload ?? !e.second, e.announcement = ee(e.second);
711
550
  },
712
551
  pos: (e, t) => {
713
- it(e, t.payload);
552
+ Je(e, t.payload);
714
553
  },
715
554
  programmer: (e, t) => {
716
- at(e, t.payload);
555
+ Ye(e, t.payload);
717
556
  },
718
557
  announce: (e, t) => {
719
558
  e.announcement = t.payload;
@@ -736,13 +575,13 @@ var ot = {
736
575
  }
737
576
  }
738
577
  });
739
- Z.actions;
578
+ X.actions;
740
579
  //#endregion
741
580
  //#region lib/components/ui/widgets/calculator/calculator-clipboard.ts
742
- async function ct(e, t, n, r) {
743
- let i = I(e);
581
+ async function Qe(e, t, n, r) {
582
+ let i = L(e);
744
583
  if (!i) return !1;
745
- let a = r ? _("programmer")?.copy?.(e, r) : j(i, {
584
+ let a = r ? h("programmer")?.copy?.(e, r) : M(i, {
746
585
  locale: t,
747
586
  grouping: !1
748
587
  });
@@ -752,9 +591,9 @@ async function ct(e, t, n, r) {
752
591
  } catch {
753
592
  return !1;
754
593
  }
755
- return n.announce(g("copied")), !0;
594
+ return n.announce(m("copied")), !0;
756
595
  }
757
- async function lt(e) {
596
+ async function $e(e) {
758
597
  try {
759
598
  return await e?.() ?? "";
760
599
  } catch {
@@ -763,10 +602,10 @@ async function lt(e) {
763
602
  }
764
603
  //#endregion
765
604
  //#region lib/components/ui/widgets/calculator/use-calculator-clipboard.ts
766
- function ut(e, t, n, r) {
605
+ function et(e, t, n, r) {
767
606
  let { announce: i, paste: a } = n;
768
607
  return {
769
- copy: S(() => ct(e, t, {
608
+ copy: w(() => Qe(e, t, {
770
609
  write: c,
771
610
  announce: i
772
611
  }, r), [
@@ -775,14 +614,14 @@ function ut(e, t, n, r) {
775
614
  e,
776
615
  r
777
616
  ]),
778
- paste: S(async () => {
779
- let e = await lt(() => navigator.clipboard.readText());
617
+ paste: w(async () => {
618
+ let e = await $e(() => navigator.clipboard.readText());
780
619
  e && a({
781
620
  text: e,
782
621
  locale: t
783
622
  });
784
623
  }, [t, a]),
785
- pasteEvent: S((e) => {
624
+ pasteEvent: w((e) => {
786
625
  e && a({
787
626
  text: e,
788
627
  locale: t
@@ -792,8 +631,8 @@ function ut(e, t, n, r) {
792
631
  }
793
632
  //#endregion
794
633
  //#region lib/components/ui/widgets/calculator/use-calculator-conversion.ts
795
- function dt(e) {
796
- return T(() => ({
634
+ function tt(e) {
635
+ return D(() => ({
797
636
  currencyRates: e.currencyRates,
798
637
  precision: e.precision,
799
638
  rounding: e.rounding
@@ -803,12 +642,12 @@ function dt(e) {
803
642
  e.rounding
804
643
  ]);
805
644
  }
806
- function ft(e, t) {
645
+ function nt(e, t) {
807
646
  if (e) try {
808
647
  e.haptics && !t.reducedMotion() && t.vibrate?.(8), e.sound && t.audio?.()?.tick();
809
648
  } catch {}
810
649
  }
811
- function pt() {
650
+ function rt() {
812
651
  let e;
813
652
  return () => {
814
653
  let t = window.AudioContext ?? window.webkitAudioContext;
@@ -822,7 +661,7 @@ function pt() {
822
661
  } };
823
662
  };
824
663
  }
825
- function mt(e) {
664
+ function it(e) {
826
665
  return {
827
666
  vibrate: (e) => navigator.vibrate?.(e) ?? !1,
828
667
  reducedMotion: () => window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1,
@@ -831,13 +670,13 @@ function mt(e) {
831
670
  }
832
671
  //#endregion
833
672
  //#region lib/components/ui/widgets/calculator/use-calculator-feedback.ts
834
- function ht(e) {
835
- let t = T(() => pt(), []), n = e?.haptics, r = e?.sound;
836
- return S(() => {
837
- !n && !r || ft({
673
+ function at(e) {
674
+ let t = D(() => rt(), []), n = e?.haptics, r = e?.sound;
675
+ return w(() => {
676
+ !n && !r || nt({
838
677
  haptics: n,
839
678
  sound: r
840
- }, mt(t));
679
+ }, it(t));
841
680
  }, [
842
681
  n,
843
682
  r,
@@ -846,30 +685,30 @@ function ht(e) {
846
685
  }
847
686
  //#endregion
848
687
  //#region lib/components/ui/widgets/calculator/calculator-storage.ts
849
- var gt = "nxgt-calculator:", Q = 1;
850
- function $() {
688
+ var ot = "nxgt-calculator:", Z = 1;
689
+ function Q() {
851
690
  try {
852
691
  return typeof window > "u" ? void 0 : window.localStorage;
853
692
  } catch {
854
693
  return;
855
694
  }
856
695
  }
857
- function _t(e) {
858
- return e === !1 ? void 0 : `${gt}${typeof e == "object" ? e.key : "default"}`;
696
+ function st(e) {
697
+ return e === !1 ? void 0 : `${ot}${typeof e == "object" ? e.key : "default"}`;
859
698
  }
860
- function vt(e) {
699
+ function ct(e) {
861
700
  try {
862
- let t = JSON.parse(e ?? ""), n = t.v === Q ? t.memory : void 0;
863
- return typeof n == "string" && n.length <= 10100 && I(n) ? n : "0";
701
+ let t = JSON.parse(e ?? ""), n = t.v === Z ? t.memory : void 0;
702
+ return typeof n == "string" && n.length <= 10100 && L(n) ? n : "0";
864
703
  } catch {
865
704
  return "0";
866
705
  }
867
706
  }
868
- function yt(e, t) {
707
+ function lt(e, t) {
869
708
  try {
870
709
  return {
871
- history: be(e?.getItem(`${t}:history`)),
872
- memory: vt(e?.getItem(`${t}:memory`) ?? null)
710
+ history: _e(e?.getItem(`${t}:history`)),
711
+ memory: ct(e?.getItem(`${t}:memory`) ?? null)
873
712
  };
874
713
  } catch {
875
714
  return {
@@ -878,30 +717,30 @@ function yt(e, t) {
878
717
  };
879
718
  }
880
719
  }
881
- function bt(e, t, n) {
720
+ function ut(e, t, n) {
882
721
  try {
883
- e?.setItem(`${t}:history`, Se(n.history)), e?.setItem(`${t}:memory`, JSON.stringify({
884
- v: Q,
722
+ e?.setItem(`${t}:history`, ye(n.history)), e?.setItem(`${t}:memory`, JSON.stringify({
723
+ v: Z,
885
724
  memory: n.memory
886
725
  }));
887
726
  } catch {}
888
727
  }
889
728
  //#endregion
890
729
  //#region lib/components/ui/widgets/calculator/use-calculator-persistence.ts
891
- var xt = 300;
892
- function St(e, t, n) {
893
- let r = _t(e), { restore: i, markRestored: a } = n;
894
- C(() => {
730
+ var dt = 300;
731
+ function ft(e, t, n) {
732
+ let r = st(e), { restore: i, markRestored: a } = n;
733
+ T(() => {
895
734
  if (!r) return a();
896
- i(yt($(), r));
735
+ i(lt(Q(), r));
897
736
  }, [r]);
898
737
  let { history: o } = t, { memory: s } = t.session;
899
- C(() => {
738
+ T(() => {
900
739
  if (!r || !t.restored) return;
901
- let e = setTimeout(() => bt($(), r, {
740
+ let e = setTimeout(() => ut(Q(), r, {
902
741
  history: o,
903
742
  memory: s
904
- }), xt);
743
+ }), dt);
905
744
  return () => clearTimeout(e);
906
745
  }, [
907
746
  r,
@@ -912,8 +751,8 @@ function St(e, t, n) {
912
751
  }
913
752
  //#endregion
914
753
  //#region lib/components/ui/widgets/calculator/use-calculator-pos.ts
915
- function Ct(e, t, n, r, i) {
916
- let { vatRates: a, denominations: o, pricesIncludeVat: s, currency: c } = e, l = c ? _e(c) : 2, u = (a ?? []).join(" "), d = (o ?? []).join(" "), f = T(() => ({
754
+ function pt(e, t, n, r, i) {
755
+ let { vatRates: a, denominations: o, pricesIncludeVat: s, currency: c } = e, l = c ? he(c) : 2, u = (a ?? []).join(" "), d = (o ?? []).join(" "), f = D(() => ({
917
756
  currency: c,
918
757
  digits: l,
919
758
  rates: u === "" ? [] : u.split(" "),
@@ -923,7 +762,7 @@ function Ct(e, t, n, r, i) {
923
762
  l,
924
763
  u,
925
764
  s
926
- ]), p = T(() => ({
765
+ ]), p = D(() => ({
927
766
  locale: t,
928
767
  denominations: d === "" ? [] : d.split(" ")
929
768
  }), [t, d]);
@@ -931,14 +770,14 @@ function Ct(e, t, n, r, i) {
931
770
  props: e,
932
771
  env: f,
933
772
  format: p,
934
- view: T(() => r ? _("pos")?.selectPos?.(n, f, p.denominations, t) ?? null : null, [
773
+ view: D(() => r ? h("pos")?.selectPos?.(n, f, p.denominations, t) ?? null : null, [
935
774
  r,
936
775
  n,
937
776
  f,
938
777
  p,
939
778
  t
940
779
  ]),
941
- dispatch: S((e) => i({
780
+ dispatch: w((e) => i({
942
781
  action: e,
943
782
  env: f,
944
783
  format: p
@@ -951,12 +790,12 @@ function Ct(e, t, n, r, i) {
951
790
  }
952
791
  //#endregion
953
792
  //#region lib/components/ui/widgets/calculator/use-calculator-press.ts
954
- var wt = 0, Tt = () => `${Date.now().toString(36)}-${(wt++).toString(36)}`;
955
- function Et(e) {
793
+ var mt = 0, ht = () => `${Date.now().toString(36)}-${(mt++).toString(36)}`;
794
+ function gt(e) {
956
795
  let { actions: t, feel: n, settings: r, isPos: i, dispatchPos: a, t: o } = e;
957
- return S((e) => {
958
- if (r.programmer && x(e, r.programmer.base)) {
959
- let e = _("programmer")?.refused?.(r.programmer.base, o);
796
+ return w((e) => {
797
+ if (r.programmer && S(e, r.programmer.base)) {
798
+ let e = h("programmer")?.refused?.(r.programmer.base, o);
960
799
  e && t.announce(e);
961
800
  return;
962
801
  }
@@ -966,7 +805,7 @@ function Et(e) {
966
805
  }) : t.press({
967
806
  key: e,
968
807
  settings: r,
969
- id: Tt()
808
+ id: ht()
970
809
  });
971
810
  }, [
972
811
  t,
@@ -979,26 +818,26 @@ function Et(e) {
979
818
  }
980
819
  //#endregion
981
820
  //#region lib/components/ui/widgets/calculator/use-calculator-tape.ts
982
- function Dt(e, t, n) {
821
+ function _t(e, t, n) {
983
822
  return !e || !t || t.getClientRects().length === 0 ? !1 : (n(), t.focus(), !0);
984
823
  }
985
- function Ot(e, t, n, r) {
824
+ function vt(e, t, n, r) {
986
825
  t && n && e?.(n, r);
987
826
  }
988
- function kt(e, t) {
989
- let n = E(null), r = E(null), i = E(!1);
990
- return C(() => {
827
+ function yt(e, t) {
828
+ let n = O(null), r = O(null), i = O(!1);
829
+ return T(() => {
991
830
  e && !i.current && r.current?.focus(), i.current = e;
992
831
  }, [e]), {
993
832
  toggleRef: n,
994
833
  tapeRef: r,
995
- closeTapeOverlay: S(() => Dt(e, n.current, t), [t, e])
834
+ closeTapeOverlay: w(() => _t(e, n.current, t), [t, e])
996
835
  };
997
836
  }
998
- function At(e, { justEvaluated: t, result: n, expression: r }) {
999
- let i = E(e);
1000
- i.current = e, C(() => {
1001
- Ot(i.current, t, n, r);
837
+ function $(e, { justEvaluated: t, result: n, expression: r }) {
838
+ let i = O(e);
839
+ i.current = e, T(() => {
840
+ vt(i.current, t, n, r);
1002
841
  }, [
1003
842
  t,
1004
843
  n,
@@ -1007,28 +846,28 @@ function At(e, { justEvaluated: t, result: n, expression: r }) {
1007
846
  }
1008
847
  //#endregion
1009
848
  //#region lib/components/ui/widgets/calculator/use-calculator-value.ts
1010
- function jt(e) {
1011
- let t = e === void 0 ? void 0 : I(e.trim());
1012
- if (!t) return A;
1013
- let n = R(t);
849
+ function bt(e) {
850
+ let t = e === void 0 ? void 0 : L(e.trim());
851
+ if (!t) return j;
852
+ let n = z(t);
1014
853
  return {
1015
- ...A,
854
+ ...j,
1016
855
  expression: n,
1017
856
  result: n,
1018
857
  ans: n,
1019
858
  justEvaluated: !0
1020
859
  };
1021
860
  }
1022
- function Mt(e, t) {
1023
- let n = E(e);
1024
- n.current = e, C(() => {
861
+ function xt(e, t) {
862
+ let n = O(e);
863
+ n.current = e, T(() => {
1025
864
  n.current?.(t);
1026
865
  }, [t]);
1027
866
  }
1028
867
  //#endregion
1029
868
  //#region lib/components/ui/widgets/calculator/use-calculator-variant.ts
1030
- function Nt(e, t) {
1031
- let n = Ge(), r = (e.variants ?? n).filter((e) => n.includes(e)), i = e.variant ?? t, a = r.includes(i) ? i : r[0] ?? "standard", o = Be(a), s = T(() => Ke(a, o), [a, o]), c = T(() => qe(s), [s]);
869
+ function St(e, t) {
870
+ let n = Pe(), r = (e.variants ?? n).filter((e) => n.includes(e)), i = e.variant ?? t, a = r.includes(i) ? i : r[0] ?? "standard", o = ke(a), s = D(() => Fe(a, o), [a, o]), c = D(() => Ie(s), [s]);
1032
871
  return {
1033
872
  variant: a,
1034
873
  variants: r,
@@ -1036,11 +875,11 @@ function Nt(e, t) {
1036
875
  accepts: (e) => c.has(e)
1037
876
  };
1038
877
  }
1039
- function Pt(e, t, n, r) {
878
+ function Ct(e, t, n, r) {
1040
879
  e !== t && (n(e), r?.(e));
1041
880
  }
1042
- function Ft(e, t, n) {
1043
- return S((r) => Pt(r, e, t, n), [
881
+ function wt(e, t, n) {
882
+ return w((r) => Ct(r, e, t, n), [
1044
883
  e,
1045
884
  t,
1046
885
  n
@@ -1048,9 +887,9 @@ function Ft(e, t, n) {
1048
887
  }
1049
888
  //#endregion
1050
889
  //#region lib/components/ui/widgets/calculator/use-engine-settings.ts
1051
- function It(e, t, n, r) {
890
+ function Tt(e, t, n, r) {
1052
891
  let { percent: i, precision: a, rounding: o } = e, { angle: s, notation: c } = n, l = r.scientific === !0, u = r.programmer ? n.programmer : void 0;
1053
- return T(() => ({
892
+ return D(() => ({
1054
893
  locale: t,
1055
894
  percent: i ?? (l ? "literal" : "contextual"),
1056
895
  precision: a,
@@ -1072,29 +911,29 @@ function It(e, t, n, r) {
1072
911
  }
1073
912
  //#endregion
1074
913
  //#region lib/components/ui/widgets/calculator/use-calculator.ts
1075
- function Lt(e) {
1076
- let { language: t, t: n } = o(), r = e.locale ?? t, [i, a] = d(Z, {
914
+ function Et(e) {
915
+ let { language: t, t: n } = o(), r = e.locale ?? t, [i, a] = l(X, {
1077
916
  variant: e.defaultVariant ?? "standard",
1078
917
  programmer: se(e),
1079
- session: jt(e.defaultValue)
1080
- }), s = Nt(e, i.variant), c = It(e, r, i, s.definition), l = ht(e.feedback);
1081
- St(e.persist, i, a);
1082
- let u = T(() => nt(i, c), [i, c]), f = ut(u.value, r, a, c.programmer), p = s.variant === "pos" && !s.definition.pending, m = Ct(e, r, i.pos, p, a.pos), h = dt(e), g = Et({
918
+ session: bt(e.defaultValue)
919
+ }), s = St(e, i.variant), c = Tt(e, r, i, s.definition), u = at(e.feedback);
920
+ ft(e.persist, i, a);
921
+ let d = D(() => Ke(i, c), [i, c]), f = et(d.value, r, a, c.programmer), p = s.variant === "pos" && !s.definition.pending, m = pt(e, r, i.pos, p, a.pos), h = tt(e), g = gt({
1083
922
  actions: a,
1084
- feel: l,
923
+ feel: u,
1085
924
  settings: c,
1086
925
  isPos: p,
1087
926
  dispatchPos: m.dispatch,
1088
927
  t: n
1089
- }), _ = Ft(s.variant, a.setVariant, e.onVariantChange), { toggleRef: v, tapeRef: y, closeTapeOverlay: b } = kt(i.tapeOpen, () => a.toggleTape(!1));
1090
- return At(e.onResult, i.session), Mt(e.onValueChange, u.value), {
928
+ }), _ = wt(s.variant, a.setVariant, e.onVariantChange), { toggleRef: v, tapeRef: y, closeTapeOverlay: b } = yt(i.tapeOpen, () => a.toggleTape(!1));
929
+ return $(e.onResult, i.session), xt(e.onValueChange, d.value), {
1091
930
  state: i,
1092
931
  ...s,
1093
932
  locale: r,
1094
933
  conversion: h,
1095
934
  currency: e.currency,
1096
- display: u,
1097
- hasMemory: rt(i),
935
+ display: d,
936
+ hasMemory: qe(i),
1098
937
  press: g,
1099
938
  setVariant: _,
1100
939
  setAngle: a.setAngle,
@@ -1122,53 +961,15 @@ function Lt(e) {
1122
961
  };
1123
962
  }
1124
963
  //#endregion
1125
- //#region lib/components/ui/widgets/calculator/calculator-keyboard.ts
1126
- var Rt = /* @__PURE__ */ new Set([
1127
- "INPUT",
1128
- "TEXTAREA",
1129
- "SELECT"
1130
- ]);
1131
- function zt(e) {
1132
- return e ? Rt.has(e.tagName?.toUpperCase() ?? "") || e.isContentEditable === !0 : !1;
1133
- }
1134
- function Bt(e, t) {
1135
- if (e.defaultPrevented) return null;
1136
- let n = e.target;
1137
- if (t.global && zt(n) || e.key === "Enter" && n?.closest?.("button")) return null;
1138
- let r = P(e, {
1139
- locale: t.locale,
1140
- programmer: t.programmer
1141
- });
1142
- return r === null ? null : r === "copy" ? t.hasSelection?.() ? null : r : r === "paste" ? null : t.accepts(r) ? r : null;
1143
- }
1144
- //#endregion
1145
- //#region lib/components/ui/widgets/calculator/use-calculator-keyboard.ts
1146
- var Vt = () => (globalThis.getSelection?.()?.toString() ?? "") !== "";
1147
- function Ht(e) {
1148
- let t = u(e), n = S((e) => {
1149
- let { locale: n, accepts: r, global: i, programmer: a, onKey: o, onCopy: s, beforeKey: c } = t.current;
1150
- if (!e.defaultPrevented && c?.(e)) return e.preventDefault();
1151
- let l = Bt(e, {
1152
- locale: n,
1153
- accepts: r,
1154
- global: i,
1155
- programmer: a,
1156
- hasSelection: Vt
1157
- });
1158
- l !== null && (e.preventDefault(), l === "copy" ? s() : l !== "paste" && o(l));
1159
- }, [t]);
1160
- return l("keydown", S((e) => n(e), [n]), e.global && typeof window < "u" ? window : null), S((e) => n(e), [n]);
1161
- }
1162
- //#endregion
1163
964
  //#region lib/components/ui/widgets/calculator/calculator.tsx
1164
- function Ut({ className: e, "aria-label": t, ...n }) {
1165
- let r = Lt(n);
1166
- return /* @__PURE__ */ O(h, {
965
+ function Dt({ className: e, "aria-label": t, ...n }) {
966
+ let r = Et(n);
967
+ return /* @__PURE__ */ k(p, {
1167
968
  value: r,
1168
- children: /* @__PURE__ */ O(Xe, {
969
+ children: /* @__PURE__ */ k(Be, {
1169
970
  className: e,
1170
971
  "aria-label": t,
1171
- onKeyDown: Ht({
972
+ onKeyDown: re({
1172
973
  locale: r.locale,
1173
974
  accepts: r.accepts,
1174
975
  programmer: r.definition.programmer,
@@ -1186,4 +987,4 @@ function Ut({ className: e, "aria-label": t, ...n }) {
1186
987
  });
1187
988
  }
1188
989
  //#endregion
1189
- export { K as n, Ut as t };
990
+ export { K as n, Dt as t };