@okam/stack-ui 1.44.1 → 1.44.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/index145.js +1 -1
  3. package/index145.mjs +1 -1
  4. package/index149.js +1 -1
  5. package/index149.mjs +3 -3
  6. package/index155.js +1 -1
  7. package/index155.mjs +1 -1
  8. package/index157.js +1 -1
  9. package/index157.mjs +4 -4
  10. package/index158.js +1 -1
  11. package/index158.mjs +2 -2
  12. package/index159.js +1 -1
  13. package/index159.mjs +1 -1
  14. package/index160.js +1 -1
  15. package/index160.mjs +1 -1
  16. package/index161.js +1 -1
  17. package/index161.mjs +2 -2
  18. package/index165.js +1 -1
  19. package/index165.mjs +2 -2
  20. package/index166.js +1 -1
  21. package/index166.mjs +4 -4
  22. package/index167.js +1 -1
  23. package/index167.mjs +3 -3
  24. package/index168.js +1 -1
  25. package/index168.mjs +9 -9
  26. package/index169.js +1 -1
  27. package/index169.mjs +2 -2
  28. package/index174.js +1 -1
  29. package/index174.mjs +2 -2
  30. package/index179.js +1 -1
  31. package/index179.mjs +4 -4
  32. package/index180.js +1 -1
  33. package/index180.mjs +1 -1
  34. package/index181.js +1 -1
  35. package/index181.mjs +2 -2
  36. package/index182.js +1 -1
  37. package/index182.mjs +3 -3
  38. package/index185.js +1 -1
  39. package/index185.mjs +3 -3
  40. package/index186.js +1 -1
  41. package/index186.mjs +23 -23
  42. package/index187.js +1 -1
  43. package/index187.mjs +12 -12
  44. package/index188.js +1 -1
  45. package/index188.mjs +5 -2024
  46. package/index189.js +2 -1
  47. package/index189.mjs +48 -58
  48. package/index190.js +1 -1
  49. package/index190.mjs +2010 -174
  50. package/index191.js +1 -1
  51. package/index191.mjs +56 -200
  52. package/index192.js +1 -1
  53. package/index192.mjs +186 -62
  54. package/index193.js +1 -1
  55. package/index193.mjs +189 -129
  56. package/index194.js +1 -1
  57. package/index194.mjs +55 -115
  58. package/index195.js +1 -1
  59. package/index195.mjs +127 -208
  60. package/index196.js +1 -1
  61. package/index196.mjs +107 -173
  62. package/index197.js +1 -1
  63. package/index197.mjs +215 -60
  64. package/index198.js +1 -1
  65. package/index198.mjs +178 -267
  66. package/index199.js +1 -1
  67. package/index199.mjs +63 -92
  68. package/index200.js +1 -1
  69. package/index200.mjs +254 -163
  70. package/index201.js +1 -1
  71. package/index201.mjs +91 -77
  72. package/index202.js +1 -1
  73. package/index202.mjs +183 -53
  74. package/index203.js +1 -1
  75. package/index203.mjs +72 -114
  76. package/index204.js +1 -1
  77. package/index204.mjs +51 -109
  78. package/index205.js +1 -1
  79. package/index205.mjs +112 -108
  80. package/index206.js +1 -1
  81. package/index206.mjs +109 -65
  82. package/index207.js +1 -1
  83. package/index207.mjs +117 -105
  84. package/index208.js +1 -1
  85. package/index208.mjs +68 -48
  86. package/index209.js +1 -1
  87. package/index209.mjs +108 -91
  88. package/index210.js +1 -1
  89. package/index210.mjs +36 -54
  90. package/index211.js +1 -1
  91. package/index211.mjs +78 -41
  92. package/index212.js +1 -1
  93. package/index212.mjs +52 -81
  94. package/index213.js +1 -5
  95. package/index213.mjs +42 -66
  96. package/index214.js +1 -1
  97. package/index214.mjs +100 -12
  98. package/index215.js +5 -1
  99. package/index215.mjs +80 -5
  100. package/index216.js +1 -2
  101. package/index216.mjs +11 -49
  102. package/index217.js +1 -1
  103. package/index217.mjs +124 -9
  104. package/index218.js +1 -1
  105. package/index218.mjs +132 -56
  106. package/index219.js +1 -1
  107. package/index219.mjs +73 -131
  108. package/index220.js +1 -1
  109. package/index220.mjs +14 -14
  110. package/index221.js +1 -1
  111. package/index221.mjs +85 -33
  112. package/index222.js +1 -1
  113. package/index222.mjs +104 -229
  114. package/index223.js +1 -1
  115. package/index223.mjs +4 -125
  116. package/index224.js +1 -1
  117. package/index224.mjs +3 -72
  118. package/index225.js +1 -7
  119. package/index225.mjs +117 -431
  120. package/index226.js +1 -1
  121. package/index226.mjs +29 -58
  122. package/index227.js +1 -1
  123. package/index227.mjs +51 -54
  124. package/index228.js +1 -1
  125. package/index228.mjs +45 -4
  126. package/index229.js +1 -1
  127. package/index229.mjs +36 -24
  128. package/index230.js +1 -1
  129. package/index230.mjs +106 -40
  130. package/index231.js +1 -1
  131. package/index231.mjs +77 -5
  132. package/index232.js +1 -1
  133. package/index232.mjs +100 -23
  134. package/index233.js +1 -1
  135. package/index233.mjs +98 -13
  136. package/index234.js +1 -1
  137. package/index234.mjs +130 -4
  138. package/index235.js +1 -1
  139. package/index235.mjs +190 -14
  140. package/index236.js +1 -1
  141. package/index236.mjs +4 -43
  142. package/index237.js +1 -1
  143. package/index237.mjs +25 -43
  144. package/index238.js +1 -1
  145. package/index238.mjs +44 -29
  146. package/index239.js +1 -1
  147. package/index239.mjs +4 -30
  148. package/index240.js +1 -1
  149. package/index240.mjs +24 -10
  150. package/index241.js +1 -1
  151. package/index241.mjs +11 -28
  152. package/index242.js +1 -1
  153. package/index242.mjs +4 -15
  154. package/index243.js +1 -1
  155. package/index243.mjs +14 -9
  156. package/index244.js +1 -1
  157. package/index244.mjs +42 -6
  158. package/index245.js +1 -1
  159. package/index245.mjs +58 -5
  160. package/index246.js +1 -1
  161. package/index246.mjs +43 -7
  162. package/index247.js +1 -1
  163. package/index247.mjs +30 -27
  164. package/index248.js +1 -1
  165. package/index248.mjs +29 -15
  166. package/index249.js +1 -1
  167. package/index249.mjs +14 -44
  168. package/index250.js +1 -1
  169. package/index250.mjs +10 -8
  170. package/index251.js +1 -1
  171. package/index251.mjs +27 -14
  172. package/index252.js +1 -1
  173. package/index252.mjs +16 -3
  174. package/index253.js +1 -1
  175. package/index253.mjs +9 -19
  176. package/index254.js +1 -1
  177. package/index254.mjs +6 -34
  178. package/index255.js +1 -1
  179. package/index255.mjs +5 -22
  180. package/index256.js +1 -1
  181. package/index256.mjs +7 -27
  182. package/index257.js +1 -1
  183. package/index257.mjs +27 -128
  184. package/index258.js +1 -1
  185. package/index258.mjs +17 -190
  186. package/index259.js +1 -1
  187. package/index259.mjs +43 -8
  188. package/index260.js +1 -1
  189. package/index260.mjs +8 -3
  190. package/index261.js +1 -1
  191. package/index261.mjs +15 -35
  192. package/index262.js +1 -1
  193. package/index262.mjs +3 -6
  194. package/index263.js +1 -1
  195. package/index263.mjs +19 -29
  196. package/index264.js +1 -1
  197. package/index264.mjs +34 -6
  198. package/index265.js +1 -1
  199. package/index265.mjs +20 -122
  200. package/index266.js +1 -1
  201. package/index266.mjs +8 -133
  202. package/index267.js +1 -1
  203. package/index267.mjs +3 -75
  204. package/index268.js +1 -1
  205. package/index268.mjs +36 -14
  206. package/index269.js +1 -1
  207. package/index269.mjs +5 -95
  208. package/index270.js +1 -1
  209. package/index270.mjs +28 -105
  210. package/index271.js +1 -1
  211. package/index271.mjs +6 -4
  212. package/index272.js +1 -1
  213. package/index272.mjs +9 -3
  214. package/index273.js +1 -1
  215. package/index273.mjs +130 -122
  216. package/index274.js +1 -1
  217. package/index274.mjs +37 -23
  218. package/index275.js +1 -1
  219. package/index275.mjs +231 -51
  220. package/index276.js +1 -1
  221. package/index276.mjs +122 -41
  222. package/index277.js +1 -1
  223. package/index277.mjs +70 -35
  224. package/index278.js +7 -1
  225. package/index278.mjs +429 -103
  226. package/index279.js +1 -1
  227. package/index279.mjs +58 -77
  228. package/index280.js +1 -1
  229. package/index280.mjs +52 -99
  230. package/index281.js +1 -1
  231. package/index281.mjs +27 -97
  232. package/index282.js +1 -1
  233. package/index282.mjs +28 -141
  234. package/index283.js +1 -1
  235. package/index283.mjs +140 -209
  236. package/index284.js +1 -1
  237. package/index284.mjs +213 -22
  238. package/index285.js +1 -1
  239. package/index285.mjs +20 -47
  240. package/index286.js +1 -1
  241. package/index286.mjs +45 -42
  242. package/index287.js +1 -6
  243. package/index287.mjs +41 -108
  244. package/index288.js +6 -1
  245. package/index288.mjs +114 -72
  246. package/index289.js +1 -1
  247. package/index289.mjs +72 -75
  248. package/index290.js +1 -1
  249. package/index290.mjs +74 -7
  250. package/index291.js +1 -1
  251. package/index291.mjs +7 -11
  252. package/index292.js +1 -1
  253. package/index292.mjs +10 -30
  254. package/index293.js +1 -1
  255. package/index293.mjs +4 -3
  256. package/index294.js +1 -1
  257. package/index294.mjs +3 -4
  258. package/index329.js +1 -1
  259. package/index329.mjs +1 -1
  260. package/index331.js +1 -1
  261. package/index331.mjs +4 -4
  262. package/index332.js +1 -1
  263. package/index332.mjs +4 -4
  264. package/index333.js +1 -1
  265. package/index333.mjs +5 -5
  266. package/index335.js +1 -1
  267. package/index335.mjs +2 -2
  268. package/index336.js +1 -1
  269. package/index336.mjs +4 -4
  270. package/index339.js +1 -1
  271. package/index339.mjs +3 -3
  272. package/index342.js +1 -1
  273. package/index342.mjs +1 -1
  274. package/index345.js +1 -1
  275. package/index345.mjs +1 -1
  276. package/logger.d.ts +2 -2
  277. package/package.json +2 -2
package/index275.mjs CHANGED
@@ -1,54 +1,234 @@
1
- import { CalendarDate as f } from "./index265.mjs";
2
- import { GregorianCalendar as c, getExtendedYear as s, fromExtendedYear as g } from "./index269.mjs";
3
- const n = 1911;
4
- function i(r) {
5
- return r.era === "minguo" ? r.year + n : 1 - r.year + n;
6
- }
7
- function o(r) {
8
- let e = r - n;
9
- return e > 0 ? [
10
- "minguo",
11
- e
12
- ] : [
13
- "before_minguo",
14
- 1 - e
15
- ];
16
- }
17
- class m extends c {
18
- fromJulianDay(e) {
19
- let a = super.fromJulianDay(e), t = s(a.era, a.year), [u, $] = o(t);
20
- return new f(this, u, $, a.month, a.day);
21
- }
22
- toJulianDay(e) {
23
- return super.toJulianDay(b(e));
24
- }
25
- getEras() {
26
- return [
27
- "before_minguo",
28
- "minguo"
29
- ];
30
- }
31
- balanceDate(e) {
32
- let [a, t] = o(i(e));
33
- e.era = a, e.year = t;
34
- }
35
- isInverseEra(e) {
36
- return e.era === "before_minguo";
37
- }
38
- getDaysInMonth(e) {
39
- return super.getDaysInMonth(b(e));
40
- }
41
- getYearsInEra(e) {
42
- return e.era === "before_minguo" ? 9999 : 9999 - n;
43
- }
44
- constructor(...e) {
45
- super(...e), this.identifier = "roc";
46
- }
47
- }
48
- function b(r) {
49
- let [e, a] = g(i(r));
50
- return new f(e, a, r.month, r.day);
1
+ import { getItemElement as B, useCollectionId as ue, isNonContiguousSelectionModifier as H } from "./index329.mjs";
2
+ import { useTypeSelect as fe } from "./index330.mjs";
3
+ import { getActiveElement as se } from "./index240.mjs";
4
+ import { mergeProps as q } from "./index158.mjs";
5
+ import { focusWithoutScrolling as G } from "./index244.mjs";
6
+ import { useRouter as ae } from "./index245.mjs";
7
+ import { useUpdateLayoutEffect as j } from "./index250.mjs";
8
+ import { useEvent as S } from "./index258.mjs";
9
+ import { scrollIntoView as de, scrollIntoViewport as J } from "./index259.mjs";
10
+ import { FOCUS_EVENT as ve, CLEAR_FOCUS_EVENT as pe } from "./index262.mjs";
11
+ import { isCtrlKeyPressed as F } from "./index263.mjs";
12
+ import { isTabbable as be } from "./index264.mjs";
13
+ import { moveVirtualFocus as me, dispatchVirtualFocus as ye, getFocusableTreeWalker as $e } from "@react-aria/focus";
14
+ import { flushSync as Ke } from "react-dom";
15
+ import { useRef as m, useEffect as C } from "react";
16
+ import { getInteractionModality as Q } from "./index331.mjs";
17
+ import { focusSafely as X } from "./index332.mjs";
18
+ import { useLocale as Fe } from "@react-aria/i18n";
19
+ function Ue(Y) {
20
+ let { selectionManager: e, keyboardDelegate: o, ref: i, autoFocus: w = !1, shouldFocusWrap: x = !1, disallowEmptySelection: Z = !1, disallowSelectAll: g = !1, escapeKeyBehavior: _ = "clearSelection", selectOnFocus: y = e.selectionBehavior === "replace", disallowTypeAhead: ee = !1, shouldUseVirtualFocus: b, allowsTabNavigation: le = !1, isVirtualized: N, scrollRef: s = i, linkBehavior: U = "action" } = Y, { direction: T } = Fe(), oe = ae(), te = (l) => {
21
+ var r;
22
+ if (l.altKey && l.key === "Tab" && l.preventDefault(), !(!((r = i.current) === null || r === void 0) && r.contains(l.target))) return;
23
+ const c = (t, v) => {
24
+ if (t != null) {
25
+ if (e.isLink(t) && U === "selection" && y && !H(l)) {
26
+ Ke(() => {
27
+ e.setFocusedKey(t, v);
28
+ });
29
+ let p = B(i, t), W = e.getItemProps(t);
30
+ p && oe.open(p, l, W.href, W.routerOptions);
31
+ return;
32
+ }
33
+ if (e.setFocusedKey(t, v), e.isLink(t) && U === "override") return;
34
+ l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : y && !H(l) && e.replaceSelection(t);
35
+ }
36
+ };
37
+ switch (l.key) {
38
+ case "ArrowDown":
39
+ if (o.getKeyBelow) {
40
+ var n, f, u;
41
+ let t = e.focusedKey != null ? (n = o.getKeyBelow) === null || n === void 0 ? void 0 : n.call(o, e.focusedKey) : (f = o.getFirstKey) === null || f === void 0 ? void 0 : f.call(o);
42
+ t == null && x && (t = (u = o.getFirstKey) === null || u === void 0 ? void 0 : u.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t));
43
+ }
44
+ break;
45
+ case "ArrowUp":
46
+ if (o.getKeyAbove) {
47
+ var a, d, A;
48
+ let t = e.focusedKey != null ? (a = o.getKeyAbove) === null || a === void 0 ? void 0 : a.call(o, e.focusedKey) : (d = o.getLastKey) === null || d === void 0 ? void 0 : d.call(o);
49
+ t == null && x && (t = (A = o.getLastKey) === null || A === void 0 ? void 0 : A.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t));
50
+ }
51
+ break;
52
+ case "ArrowLeft":
53
+ if (o.getKeyLeftOf) {
54
+ var k, I, M;
55
+ let t = e.focusedKey != null ? (k = o.getKeyLeftOf) === null || k === void 0 ? void 0 : k.call(o, e.focusedKey) : null;
56
+ t == null && x && (t = T === "rtl" ? (I = o.getFirstKey) === null || I === void 0 ? void 0 : I.call(o, e.focusedKey) : (M = o.getLastKey) === null || M === void 0 ? void 0 : M.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t, T === "rtl" ? "first" : "last"));
57
+ }
58
+ break;
59
+ case "ArrowRight":
60
+ if (o.getKeyRightOf) {
61
+ var R, V, O;
62
+ let t = e.focusedKey != null ? (R = o.getKeyRightOf) === null || R === void 0 ? void 0 : R.call(o, e.focusedKey) : null;
63
+ t == null && x && (t = T === "rtl" ? (V = o.getLastKey) === null || V === void 0 ? void 0 : V.call(o, e.focusedKey) : (O = o.getFirstKey) === null || O === void 0 ? void 0 : O.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t, T === "rtl" ? "last" : "first"));
64
+ }
65
+ break;
66
+ case "Home":
67
+ if (o.getFirstKey) {
68
+ if (e.focusedKey === null && l.shiftKey) return;
69
+ l.preventDefault();
70
+ let t = o.getFirstKey(e.focusedKey, F(l));
71
+ e.setFocusedKey(t), t != null && (F(l) && l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : y && e.replaceSelection(t));
72
+ }
73
+ break;
74
+ case "End":
75
+ if (o.getLastKey) {
76
+ if (e.focusedKey === null && l.shiftKey) return;
77
+ l.preventDefault();
78
+ let t = o.getLastKey(e.focusedKey, F(l));
79
+ e.setFocusedKey(t), t != null && (F(l) && l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : y && e.replaceSelection(t));
80
+ }
81
+ break;
82
+ case "PageDown":
83
+ if (o.getKeyPageBelow && e.focusedKey != null) {
84
+ let t = o.getKeyPageBelow(e.focusedKey);
85
+ t != null && (l.preventDefault(), c(t));
86
+ }
87
+ break;
88
+ case "PageUp":
89
+ if (o.getKeyPageAbove && e.focusedKey != null) {
90
+ let t = o.getKeyPageAbove(e.focusedKey);
91
+ t != null && (l.preventDefault(), c(t));
92
+ }
93
+ break;
94
+ case "a":
95
+ F(l) && e.selectionMode === "multiple" && g !== !0 && (l.preventDefault(), e.selectAll());
96
+ break;
97
+ case "Escape":
98
+ _ === "clearSelection" && !Z && e.selectedKeys.size !== 0 && (l.stopPropagation(), l.preventDefault(), e.clearSelection());
99
+ break;
100
+ case "Tab":
101
+ if (!le) {
102
+ if (l.shiftKey) i.current.focus();
103
+ else {
104
+ let t = $e(i.current, {
105
+ tabbable: !0
106
+ }), v, p;
107
+ do
108
+ p = t.lastChild(), p && (v = p);
109
+ while (p);
110
+ v && (!v.contains(document.activeElement) || document.activeElement && !be(document.activeElement)) && G(v);
111
+ }
112
+ break;
113
+ }
114
+ }
115
+ }, E = m({
116
+ top: 0,
117
+ left: 0
118
+ });
119
+ S(s, "scroll", N ? void 0 : () => {
120
+ var l, r, c, n;
121
+ E.current = {
122
+ top: (c = (l = s.current) === null || l === void 0 ? void 0 : l.scrollTop) !== null && c !== void 0 ? c : 0,
123
+ left: (n = (r = s.current) === null || r === void 0 ? void 0 : r.scrollLeft) !== null && n !== void 0 ? n : 0
124
+ };
125
+ });
126
+ let re = (l) => {
127
+ if (e.isFocused) {
128
+ l.currentTarget.contains(l.target) || e.setFocused(!1);
129
+ return;
130
+ }
131
+ if (l.currentTarget.contains(l.target)) {
132
+ if (e.setFocused(!0), e.focusedKey == null) {
133
+ var r, c;
134
+ let u = (d) => {
135
+ d != null && (e.setFocusedKey(d), y && !e.isSelected(d) && e.replaceSelection(d));
136
+ }, a = l.relatedTarget;
137
+ var n, f;
138
+ a && l.currentTarget.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_FOLLOWING ? u((n = e.lastSelectedKey) !== null && n !== void 0 ? n : (r = o.getLastKey) === null || r === void 0 ? void 0 : r.call(o)) : u((f = e.firstSelectedKey) !== null && f !== void 0 ? f : (c = o.getFirstKey) === null || c === void 0 ? void 0 : c.call(o));
139
+ } else !N && s.current && (s.current.scrollTop = E.current.top, s.current.scrollLeft = E.current.left);
140
+ if (e.focusedKey != null && s.current) {
141
+ let u = B(i, e.focusedKey);
142
+ u instanceof HTMLElement && (!u.contains(document.activeElement) && !b && G(u), Q() === "keyboard" && J(u, {
143
+ containingElement: i.current
144
+ }));
145
+ }
146
+ }
147
+ }, ce = (l) => {
148
+ l.currentTarget.contains(l.relatedTarget) || e.setFocused(!1);
149
+ }, $ = m(!1);
150
+ S(i, ve, b ? (l) => {
151
+ let { detail: r } = l;
152
+ l.stopPropagation(), e.setFocused(!0), (r == null ? void 0 : r.focusStrategy) === "first" && ($.current = !0);
153
+ } : void 0), j(() => {
154
+ if ($.current) {
155
+ var l, r;
156
+ let c = (r = (l = o.getFirstKey) === null || l === void 0 ? void 0 : l.call(o)) !== null && r !== void 0 ? r : null;
157
+ if (c == null) {
158
+ let n = se();
159
+ me(i.current), ye(n, null), e.collection.size > 0 && ($.current = !1);
160
+ } else
161
+ e.setFocusedKey(c), $.current = !1;
162
+ }
163
+ }, [
164
+ e.collection
165
+ ]), j(() => {
166
+ e.collection.size > 0 && ($.current = !1);
167
+ }, [
168
+ e.focusedKey
169
+ ]), S(i, pe, b ? (l) => {
170
+ var r;
171
+ l.stopPropagation(), e.setFocused(!1), !((r = l.detail) === null || r === void 0) && r.clearFocusKey && e.setFocusedKey(null);
172
+ } : void 0);
173
+ const z = m(w), h = m(!1);
174
+ C(() => {
175
+ if (z.current) {
176
+ var l, r;
177
+ let f = null;
178
+ var c;
179
+ w === "first" && (f = (c = (l = o.getFirstKey) === null || l === void 0 ? void 0 : l.call(o)) !== null && c !== void 0 ? c : null);
180
+ var n;
181
+ w === "last" && (f = (n = (r = o.getLastKey) === null || r === void 0 ? void 0 : r.call(o)) !== null && n !== void 0 ? n : null);
182
+ let u = e.selectedKeys;
183
+ if (u.size) {
184
+ for (let a of u) if (e.canSelectItem(a)) {
185
+ f = a;
186
+ break;
187
+ }
188
+ }
189
+ e.setFocused(!0), e.setFocusedKey(f), f == null && !b && i.current && X(i.current), e.collection.size > 0 && (z.current = !1, h.current = !0);
190
+ }
191
+ });
192
+ let D = m(e.focusedKey), K = m(null);
193
+ C(() => {
194
+ if (e.isFocused && e.focusedKey != null && (e.focusedKey !== D.current || h.current) && s.current && i.current) {
195
+ let l = Q(), r = B(i, e.focusedKey);
196
+ if (!(r instanceof HTMLElement))
197
+ return;
198
+ (l === "keyboard" || h.current) && (K.current && cancelAnimationFrame(K.current), K.current = requestAnimationFrame(() => {
199
+ s.current && (de(s.current, r), l !== "virtual" && J(r, {
200
+ containingElement: i.current
201
+ }));
202
+ }));
203
+ }
204
+ !b && e.isFocused && e.focusedKey == null && D.current != null && i.current && X(i.current), D.current = e.focusedKey, h.current = !1;
205
+ }), C(() => () => {
206
+ K.current && cancelAnimationFrame(K.current);
207
+ }, []), S(i, "react-aria-focus-scope-restore", (l) => {
208
+ l.preventDefault(), e.setFocused(!0);
209
+ });
210
+ let P = {
211
+ onKeyDown: te,
212
+ onFocus: re,
213
+ onBlur: ce,
214
+ onMouseDown(l) {
215
+ s.current === l.target && l.preventDefault();
216
+ }
217
+ }, { typeSelectProps: ie } = fe({
218
+ keyboardDelegate: o,
219
+ selectionManager: e
220
+ });
221
+ ee || (P = q(ie, P));
222
+ let L;
223
+ b || (L = e.focusedKey == null ? 0 : -1);
224
+ let ne = ue(e.collection);
225
+ return {
226
+ collectionProps: q(P, {
227
+ tabIndex: L,
228
+ "data-collection": ne
229
+ })
230
+ };
51
231
  }
52
232
  export {
53
- m as TaiwanCalendar
233
+ Ue as useSelectableCollection
54
234
  };
package/index276.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index265.js"),u=require("./index272.js"),o=1948320,l=[0,31,62,93,124,155,186,216,246,276,306,336];class c{fromJulianDay(e){let r=e-o,a=1+Math.floor((33*r+3)/12053),i=365*(a-1)+Math.floor((8*a+21)/33),t=r-i,n=t<216?Math.floor(t/31):Math.floor((t-6)/30),s=t-l[n]+1;return new f.CalendarDate(this,a,n+1,s)}toJulianDay(e){let r=o-1+365*(e.year-1)+Math.floor((8*e.year+21)/33);return r+=l[e.month-1],r+=e.day,r}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||u.mod(25*e.year+11,33)<8?30:29}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}exports.PersianCalendar=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),v={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},x={...v,customError:!0,valid:!1},c={isInvalid:!1,validationDetails:v,validationErrors:[]},h=n.createContext({}),I="__formValidationState"+Date.now();function R(e){if(e[I]){let{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:d,commitValidation:l}=e[I];return{realtimeValidation:a,displayValidation:t,updateValidation:i,resetValidation:d,commitValidation:l}}return w(e)}function w(e){let{isInvalid:a,validationState:t,name:i,value:d,builtinValidation:l,validate:s,validationBehavior:o="aria"}=e;t&&(a||(a=t==="invalid"));let V=a!==void 0?{isInvalid:a,validationErrors:[],validationDetails:x}:null,m=n.useMemo(()=>{if(!s||d==null)return null;let r=F(s,d);return T(r)},[s,d]);l!=null&&l.validationDetails.valid&&(l=void 0);let u=n.useContext(h),A=n.useMemo(()=>i?Array.isArray(i)?i.flatMap(r=>D(u[r])):D(u[i]):[],[u,i]),[C,L]=n.useState(u),[g,$]=n.useState(!1);u!==C&&(L(u),$(!1));let b=n.useMemo(()=>T(g?[]:A),[g,A]),M=n.useRef(c),[E,p]=n.useState(c),f=n.useRef(c),_=()=>{if(!O)return;S(!1);let r=m||l||M.current;y(r,f.current)||(f.current=r,p(r))},[O,S]=n.useState(!1);return n.useEffect(_),{realtimeValidation:V||b||m||l||c,displayValidation:o==="native"?V||b||E:V||b||m||l||E,updateValidation(r){o==="aria"&&!y(E,r)?p(r):M.current=r},resetValidation(){let r=c;y(r,f.current)||(f.current=r,p(r)),o==="native"&&S(!1),$(!0)},commitValidation(){o==="native"&&S(!0),$(!0)}}}function D(e){return e?Array.isArray(e)?e:[e]:[]}function F(e,a){if(typeof e=="function"){let t=e(a);if(t&&typeof t!="boolean")return D(t)}return[]}function T(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:x}:null}function y(e,a){return e===a?!0:!!e&&!!a&&e.isInvalid===a.isInvalid&&e.validationErrors.length===a.validationErrors.length&&e.validationErrors.every((t,i)=>t===a.validationErrors[i])&&Object.entries(e.validationDetails).every(([t,i])=>a.validationDetails[t]===i)}function U(...e){let a=new Set,t=!1,i={...v};for(let s of e){var d,l;for(let o of s.validationErrors)a.add(o);t||(t=s.isInvalid);for(let o in i)(d=i)[l=o]||(d[l]=s.validationDetails[o])}return i.valid=!t,{isInvalid:t,validationErrors:[...a],validationDetails:i}}exports.DEFAULT_VALIDATION_RESULT=c;exports.FormValidationContext=h;exports.VALID_VALIDITY_STATE=v;exports.mergeValidation=U;exports.privateValidationStateProp=I;exports.useFormValidationState=R;
package/index276.mjs CHANGED
@@ -1,47 +1,128 @@
1
- import { CalendarDate as i } from "./index265.mjs";
2
- import { mod as c } from "./index272.mjs";
3
- const n = 1948320, f = [
4
- 0,
5
- 31,
6
- 62,
7
- 93,
8
- 124,
9
- 155,
10
- 186,
11
- 216,
12
- 246,
13
- 276,
14
- 306,
15
- 336
16
- // Esfand
17
- ];
18
- class u {
19
- fromJulianDay(e) {
20
- let r = e - n, t = 1 + Math.floor((33 * r + 3) / 12053), s = 365 * (t - 1) + Math.floor((8 * t + 21) / 33), a = r - s, o = a < 216 ? Math.floor(a / 31) : Math.floor((a - 6) / 30), l = a - f[o] + 1;
21
- return new i(this, t, o + 1, l);
1
+ import { useMemo as I, useContext as O, createContext as U, useState as f, useRef as T, useEffect as R } from "react";
2
+ const D = {
3
+ badInput: !1,
4
+ customError: !1,
5
+ patternMismatch: !1,
6
+ rangeOverflow: !1,
7
+ rangeUnderflow: !1,
8
+ stepMismatch: !1,
9
+ tooLong: !1,
10
+ tooShort: !1,
11
+ typeMismatch: !1,
12
+ valueMissing: !1,
13
+ valid: !0
14
+ }, L = {
15
+ ...D,
16
+ customError: !0,
17
+ valid: !1
18
+ }, u = {
19
+ isInvalid: !1,
20
+ validationDetails: D,
21
+ validationErrors: []
22
+ }, B = U({}), h = "__formValidationState" + Date.now();
23
+ function P(a) {
24
+ if (a[h]) {
25
+ let { realtimeValidation: e, displayValidation: t, updateValidation: i, resetValidation: o, commitValidation: l } = a[h];
26
+ return {
27
+ realtimeValidation: e,
28
+ displayValidation: t,
29
+ updateValidation: i,
30
+ resetValidation: o,
31
+ commitValidation: l
32
+ };
22
33
  }
23
- toJulianDay(e) {
24
- let r = n - 1 + 365 * (e.year - 1) + Math.floor((8 * e.year + 21) / 33);
25
- return r += f[e.month - 1], r += e.day, r;
26
- }
27
- getMonthsInYear() {
28
- return 12;
29
- }
30
- getDaysInMonth(e) {
31
- return e.month <= 6 ? 31 : e.month <= 11 || c(25 * e.year + 11, 33) < 8 ? 30 : 29;
32
- }
33
- getEras() {
34
- return [
35
- "AP"
36
- ];
37
- }
38
- getYearsInEra() {
39
- return 9377;
34
+ return Q(a);
35
+ }
36
+ function Q(a) {
37
+ let { isInvalid: e, validationState: t, name: i, value: o, builtinValidation: l, validate: d, validationBehavior: n = "aria" } = a;
38
+ t && (e || (e = t === "invalid"));
39
+ let v = e !== void 0 ? {
40
+ isInvalid: e,
41
+ validationErrors: [],
42
+ validationDetails: L
43
+ } : null, V = I(() => {
44
+ if (!d || o == null) return null;
45
+ let r = Y(d, o);
46
+ return C(r);
47
+ }, [
48
+ d,
49
+ o
50
+ ]);
51
+ l != null && l.validationDetails.valid && (l = void 0);
52
+ let s = O(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
53
+ s,
54
+ i
55
+ ]), [M, _] = f(s), [x, m] = f(!1);
56
+ s !== M && (_(s), m(!1));
57
+ let $ = I(() => C(x ? [] : A), [
58
+ x,
59
+ A
60
+ ]), g = T(u), [b, E] = f(u), c = T(u), w = () => {
61
+ if (!F) return;
62
+ p(!1);
63
+ let r = V || l || g.current;
64
+ y(r, c.current) || (c.current = r, E(r));
65
+ }, [F, p] = f(!1);
66
+ return R(w), {
67
+ realtimeValidation: v || $ || V || l || u,
68
+ displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
69
+ updateValidation(r) {
70
+ n === "aria" && !y(b, r) ? E(r) : g.current = r;
71
+ },
72
+ resetValidation() {
73
+ let r = u;
74
+ y(r, c.current) || (c.current = r, E(r)), n === "native" && p(!1), m(!0);
75
+ },
76
+ commitValidation() {
77
+ n === "native" && p(!0), m(!0);
78
+ }
79
+ };
80
+ }
81
+ function S(a) {
82
+ return a ? Array.isArray(a) ? a : [
83
+ a
84
+ ] : [];
85
+ }
86
+ function Y(a, e) {
87
+ if (typeof a == "function") {
88
+ let t = a(e);
89
+ if (t && typeof t != "boolean") return S(t);
40
90
  }
41
- constructor() {
42
- this.identifier = "persian";
91
+ return [];
92
+ }
93
+ function C(a) {
94
+ return a.length ? {
95
+ isInvalid: !0,
96
+ validationErrors: a,
97
+ validationDetails: L
98
+ } : null;
99
+ }
100
+ function y(a, e) {
101
+ return a === e ? !0 : !!a && !!e && a.isInvalid === e.isInvalid && a.validationErrors.length === e.validationErrors.length && a.validationErrors.every((t, i) => t === e.validationErrors[i]) && Object.entries(a.validationDetails).every(([t, i]) => e.validationDetails[t] === i);
102
+ }
103
+ function k(...a) {
104
+ let e = /* @__PURE__ */ new Set(), t = !1, i = {
105
+ ...D
106
+ };
107
+ for (let d of a) {
108
+ var o, l;
109
+ for (let n of d.validationErrors) e.add(n);
110
+ t || (t = d.isInvalid);
111
+ for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
43
112
  }
113
+ return i.valid = !t, {
114
+ isInvalid: t,
115
+ validationErrors: [
116
+ ...e
117
+ ],
118
+ validationDetails: i
119
+ };
44
120
  }
45
121
  export {
46
- u as PersianCalendar
122
+ u as DEFAULT_VALIDATION_RESULT,
123
+ B as FormValidationContext,
124
+ D as VALID_VALIDITY_STATE,
125
+ k as mergeValidation,
126
+ h as privateValidationStateProp,
127
+ P as useFormValidationState
47
128
  };
package/index277.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index265.js"),t=require("./index269.js"),u=78,y=80;class f extends t.GregorianCalendar{fromJulianDay(e){let i=super.fromJulianDay(e),l=i.year-u,r=e-t.gregorianToJulianDay(i.era,i.year,1,1),n;r<y?(l--,n=t.isLeapYear(i.year-1)?31:30,r+=n+155+90+10):(n=t.isLeapYear(i.year)?31:30,r-=y);let a,s;if(r<n)a=1,s=r+1;else{let o=r-n;o<155?(a=Math.floor(o/31)+2,s=o%31+1):(o-=155,a=Math.floor(o/30)+7,s=o%30+1)}return new d.CalendarDate(this,l,a,s)}toJulianDay(e){let i=e.year+u,[l,r]=t.fromExtendedYear(i),n,a;return t.isLeapYear(r)?(n=31,a=t.gregorianToJulianDay(l,r,3,21)):(n=30,a=t.gregorianToJulianDay(l,r,3,22)),e.month===1?a+e.day-1:(a+=n+Math.min(e.month-2,5)*31,e.month>=8&&(a+=(e.month-7)*30),a+=e.day-1,a)}getDaysInMonth(e){return e.month===1&&t.isLeapYear(e.year+u)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...e){super(...e),this.identifier="indian"}}exports.IndianCalendar=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index331.js"),m=require("react"),E=require("./index236.js"),d=require("./index252.js");function y(n,e,t){let{validationBehavior:v,focus:s}=n;E.useLayoutEffect(()=>{if(v==="native"&&(t!=null&&t.current)&&!t.current.disabled){let a=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";t.current.setCustomValidity(a),t.current.hasAttribute("title")||(t.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(M(t.current))}});let l=m.useRef(!1),u=d.useEffectEvent(()=>{l.current||e.resetValidation()}),c=d.useEffectEvent(a=>{var i;e.displayValidation.isInvalid||e.commitValidation();let o=t==null||(i=t.current)===null||i===void 0?void 0:i.form;if(!a.defaultPrevented&&t&&o&&b(o)===t.current){var r;s?s():(r=t.current)===null||r===void 0||r.focus(),g.setInteractionModality("keyboard")}a.preventDefault()}),f=d.useEffectEvent(()=>{e.commitValidation()});m.useEffect(()=>{let a=t==null?void 0:t.current;if(!a)return;let i=a.form,o=i==null?void 0:i.reset;return i&&(i.reset=()=>{l.current=!window.event||window.event.type==="message"&&window.event.target instanceof MessagePort,o==null||o.call(i),l.current=!1}),a.addEventListener("invalid",c),a.addEventListener("change",f),i==null||i.addEventListener("reset",u),()=>{a.removeEventListener("invalid",c),a.removeEventListener("change",f),i==null||i.removeEventListener("reset",u),i&&(i.reset=o)}},[t,v])}function h(n){let e=n.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function M(n){return{isInvalid:!n.validity.valid,validationDetails:h(n),validationErrors:n.validationMessage?[n.validationMessage]:[]}}function b(n){for(let e=0;e<n.elements.length;e++){let t=n.elements[e];if(!t.validity.valid)return t}return null}exports.useFormValidation=y;
package/index277.mjs CHANGED
@@ -1,40 +1,75 @@
1
- import { CalendarDate as c } from "./index265.mjs";
2
- import { GregorianCalendar as y, gregorianToJulianDay as f, isLeapYear as s, fromExtendedYear as d } from "./index269.mjs";
3
- const $ = 78, b = 80;
4
- class p extends y {
5
- fromJulianDay(e) {
6
- let t = super.fromJulianDay(e), i = t.year - $, r = e - f(t.era, t.year, 1, 1), n;
7
- r < b ? (i--, n = s(t.year - 1) ? 31 : 30, r += n + 155 + 90 + 10) : (n = s(t.year) ? 31 : 30, r -= b);
8
- let a, l;
9
- if (r < n)
10
- a = 1, l = r + 1;
11
- else {
12
- let o = r - n;
13
- o < 155 ? (a = Math.floor(o / 31) + 2, l = o % 31 + 1) : (o -= 155, a = Math.floor(o / 30) + 7, l = o % 30 + 1);
1
+ import { setInteractionModality as f } from "./index331.mjs";
2
+ import { useRef as g, useEffect as $ } from "react";
3
+ import { useLayoutEffect as p } from "./index236.mjs";
4
+ import { useEffectEvent as d } from "./index252.mjs";
5
+ function w(a, e, t) {
6
+ let { validationBehavior: v, focus: s } = a;
7
+ p(() => {
8
+ if (v === "native" && (t != null && t.current) && !t.current.disabled) {
9
+ let n = e.realtimeValidation.isInvalid ? e.realtimeValidation.validationErrors.join(" ") || "Invalid value." : "";
10
+ t.current.setCustomValidity(n), t.current.hasAttribute("title") || (t.current.title = ""), e.realtimeValidation.isInvalid || e.updateValidation(h(t.current));
14
11
  }
15
- return new c(this, i, a, l);
16
- }
17
- toJulianDay(e) {
18
- let t = e.year + $, [i, r] = d(t), n, a;
19
- return s(r) ? (n = 31, a = f(i, r, 3, 21)) : (n = 30, a = f(i, r, 3, 22)), e.month === 1 ? a + e.day - 1 : (a += n + Math.min(e.month - 2, 5) * 31, e.month >= 8 && (a += (e.month - 7) * 30), a += e.day - 1, a);
20
- }
21
- getDaysInMonth(e) {
22
- return e.month === 1 && s(e.year + $) || e.month >= 2 && e.month <= 6 ? 31 : 30;
23
- }
24
- getYearsInEra() {
25
- return 9919;
26
- }
27
- getEras() {
28
- return [
29
- "saka"
30
- ];
31
- }
32
- balanceDate() {
33
- }
34
- constructor(...e) {
35
- super(...e), this.identifier = "indian";
12
+ });
13
+ let r = g(!1), u = d(() => {
14
+ r.current || e.resetValidation();
15
+ }), c = d((n) => {
16
+ var i;
17
+ e.displayValidation.isInvalid || e.commitValidation();
18
+ let o = t == null || (i = t.current) === null || i === void 0 ? void 0 : i.form;
19
+ if (!n.defaultPrevented && t && o && y(o) === t.current) {
20
+ var l;
21
+ s ? s() : (l = t.current) === null || l === void 0 || l.focus(), f("keyboard");
22
+ }
23
+ n.preventDefault();
24
+ }), m = d(() => {
25
+ e.commitValidation();
26
+ });
27
+ $(() => {
28
+ let n = t == null ? void 0 : t.current;
29
+ if (!n) return;
30
+ let i = n.form, o = i == null ? void 0 : i.reset;
31
+ return i && (i.reset = () => {
32
+ r.current = !window.event || window.event.type === "message" && window.event.target instanceof MessagePort, o == null || o.call(i), r.current = !1;
33
+ }), n.addEventListener("invalid", c), n.addEventListener("change", m), i == null || i.addEventListener("reset", u), () => {
34
+ n.removeEventListener("invalid", c), n.removeEventListener("change", m), i == null || i.removeEventListener("reset", u), i && (i.reset = o);
35
+ };
36
+ }, [
37
+ t,
38
+ v
39
+ ]);
40
+ }
41
+ function b(a) {
42
+ let e = a.validity;
43
+ return {
44
+ badInput: e.badInput,
45
+ customError: e.customError,
46
+ patternMismatch: e.patternMismatch,
47
+ rangeOverflow: e.rangeOverflow,
48
+ rangeUnderflow: e.rangeUnderflow,
49
+ stepMismatch: e.stepMismatch,
50
+ tooLong: e.tooLong,
51
+ tooShort: e.tooShort,
52
+ typeMismatch: e.typeMismatch,
53
+ valueMissing: e.valueMissing,
54
+ valid: e.valid
55
+ };
56
+ }
57
+ function h(a) {
58
+ return {
59
+ isInvalid: !a.validity.valid,
60
+ validationDetails: b(a),
61
+ validationErrors: a.validationMessage ? [
62
+ a.validationMessage
63
+ ] : []
64
+ };
65
+ }
66
+ function y(a) {
67
+ for (let e = 0; e < a.elements.length; e++) {
68
+ let t = a.elements[e];
69
+ if (!t.validity.valid) return t;
36
70
  }
71
+ return null;
37
72
  }
38
73
  export {
39
- p as IndianCalendar
74
+ w as useFormValidation
40
75
  };
package/index278.js CHANGED
@@ -1 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index265.js"),d=1948440,U=1948439,n=1300,u=1600,h=460322;function $(a,e,r,t){return t+Math.ceil(29.5*(r-1))+(e-1)*354+Math.floor((3+11*e)/30)+a-1}function p(a,e,r){let t=Math.floor((30*(r-e)+10646)/10631),C=Math.min(12,Math.ceil((r-(29+$(e,t,1,1)))/29.5)+1),l=r-$(e,t,C,1)+1;return new B.CalendarDate(a,t,C,l)}function b(a){return(14+11*a)%30<11}class Q{fromJulianDay(e){return p(this,d,e)}toJulianDay(e){return $(d,e.year,e.month,e.day)}getDaysInMonth(e){let r=29+e.month%2;return e.month===12&&b(e.year)&&r++,r}getMonthsInYear(){return 12}getDaysInYear(e){return b(e.year)?355:354}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class w extends Q{fromJulianDay(e){return p(this,U,e)}toJulianDay(e){return $(U,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier="islamic-tbla"}}const J="qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";let y,s;function g(a){return h+s[a-n]}function f(a,e){let r=a-n,t=1<<11-(e-1);return y[r]&t?30:29}function m(a,e){let r=g(a);for(let t=1;t<e;t++)r+=f(a,t);return r}function D(a){return s[a+1-n]-s[a-n]}class q extends Q{fromJulianDay(e){let r=e-d,t=g(n),C=g(u);if(r<t||r>C)return super.fromJulianDay(e);{let l=n-1,i=1,o=1;for(;o>0;){l++,o=r-g(l)+1;let c=D(l);if(o===c){i=12;break}else if(o<c){let A=f(l,i);for(i=1;o>A;)o-=A,i++,A=f(l,i);break}}return new B.CalendarDate(this,l,i,r-m(l,i)+1)}}toJulianDay(e){return e.year<n||e.year>u?super.toJulianDay(e):d+m(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<n||e.year>u?super.getDaysInMonth(e):f(e.year,e.month)}getDaysInYear(e){return e.year<n||e.year>u?super.getDaysInYear(e):D(e.year)}constructor(){if(super(),this.identifier="islamic-umalqura",y||(y=new Uint16Array(Uint8Array.from(atob(J),e=>e.charCodeAt(0)).buffer)),!s){s=new Uint32Array(u-n+1);let e=0;for(let r=n;r<=u;r++){s[r-n]=e;for(let t=1;t<=12;t++)e+=f(r,t)}}}}exports.IslamicCivilCalendar=Q;exports.IslamicTabularCalendar=w;exports.IslamicUmalquraCalendar=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./index336.js"),x=require("./index339.js"),Ee=require("./index334.js"),Pe=require("./index340.js"),ye=require("./index223.js"),ee=require("./index341.js"),he=require("./index239.js"),a=require("./index240.js"),d=require("./index241.js"),ue=require("./index158.js"),me=require("./index244.js"),te=require("./index245.js"),$e=require("./index248.js"),re=require("./index236.js"),Se=require("./index253.js"),be=require("./index246.js"),W=require("./index260.js"),U=require("./index252.js"),Ce=require("react-dom"),p=require("react");function Oe(n){let s=p.useContext(Ee.PressResponderContext);if(s){let{register:l,...c}=s;n=ue.mergeProps(c,n),l()}return Se.useSyncRef(s,n.ref),n}var X=new WeakMap;class F{continuePropagation(){ee._(this,X,!1)}get shouldStopPropagation(){return Pe._(this,X)}constructor(s,l,c,f){ye._(this,X,{writable:!0,value:void 0}),ee._(this,X,!0);var P;let T=(P=f==null?void 0:f.target)!==null&&P!==void 0?P:c.currentTarget;const g=T==null?void 0:T.getBoundingClientRect();let D,b=0,w,v=null;c.clientX!=null&&c.clientY!=null&&(w=c.clientX,v=c.clientY),g&&(w!=null&&v!=null?(D=w-g.left,b=v-g.top):(D=g.width/2,b=g.height/2)),this.type=s,this.pointerType=l,this.target=c.currentTarget,this.shiftKey=c.shiftKey,this.metaKey=c.metaKey,this.ctrlKey=c.ctrlKey,this.altKey=c.altKey,this.x=D,this.y=b}}const ne=Symbol("linkClicked"),ie="react-aria-pressable-style",se="data-react-aria-pressable";function ke(n){let{onPress:s,onPressChange:l,onPressStart:c,onPressEnd:f,onPressUp:P,onClick:T,isDisabled:g,isPressed:D,preventFocusOnPress:b,shouldCancelOnPointerExit:w,allowTextSelectionOnPress:v,ref:A,...fe}=Oe(n),[ge,J]=p.useState(!1),h=p.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:m,removeAllGlobalListeners:M,removeGlobalListener:C}=$e.useGlobalListeners(),y=p.useCallback((e,r)=>{let t=h.current;if(g||t.didFirePressStart)return!1;let i=!0;if(t.isTriggeringEvent=!0,c){let o=new F("pressstart",r,e);c(o),i=o.shouldStopPropagation}return l&&l(!0),t.isTriggeringEvent=!1,t.didFirePressStart=!0,J(!0),i},[g,c,l]),E=p.useCallback((e,r,t=!0)=>{let i=h.current;if(!i.didFirePressStart)return!1;i.didFirePressStart=!1,i.isTriggeringEvent=!0;let o=!0;if(f){let u=new F("pressend",r,e);f(u),o=u.shouldStopPropagation}if(l&&l(!1),J(!1),s&&t&&!g){let u=new F("press",r,e);s(u),o&&(o=u.shouldStopPropagation)}return i.isTriggeringEvent=!1,o},[g,f,l,s]),pe=U.useEffectEvent(E),O=p.useCallback((e,r)=>{let t=h.current;if(g)return!1;if(P){t.isTriggeringEvent=!0;let i=new F("pressup",r,e);return P(i),t.isTriggeringEvent=!1,i.shouldStopPropagation}return!0},[g,P]),de=U.useEffectEvent(O),$=p.useCallback(e=>{let r=h.current;if(r.isPressed&&r.target){r.didFirePressStart&&r.pointerType!=null&&E(K(r.target,e),r.pointerType,!1),r.isPressed=!1,L(null),r.isOverTarget=!1,r.activePointerId=null,r.pointerType=null,M(),v||x.restoreTextSelection(r.target);for(let t of r.disposables)t();r.disposables=[]}},[v,M,E]),I=U.useEffectEvent($),q=p.useCallback(e=>{w&&$(e)},[w,$]),N=p.useCallback(e=>{g||T==null||T(e)},[g,T]),V=p.useCallback((e,r)=>{if(!g&&T){let t=new MouseEvent("click",e);Y.setEventTarget(t,r),T(Y.createSyntheticEvent(t))}},[g,T]),ve=U.useEffectEvent(V),[Q,Z]=p.useState(!1);re.useLayoutEffect(()=>{let e=h.current;if(Q){let r=u=>{var k;if(e.isPressed&&e.target&&z(u,e.target)){var G;le(a.getEventTarget(u),u.key)&&u.preventDefault();let B=a.getEventTarget(u),R=a.nodeContains(e.target,a.getEventTarget(u));pe(K(e.target,u),"keyboard",R),R&&ve(u,e.target),M(),u.key!=="Enter"&&j(e.target)&&a.nodeContains(e.target,B)&&!u[ne]&&(u[ne]=!0,te.openLink(e.target,u,!1)),e.isPressed=!1,Z(!1),(G=e.metaKeyEvents)===null||G===void 0||G.delete(u.key)}else if(u.key==="Meta"&&(!((k=e.metaKeyEvents)===null||k===void 0)&&k.size)){var H;let B=e.metaKeyEvents;e.metaKeyEvents=void 0;for(let R of B.values())(H=e.target)===null||H===void 0||H.dispatchEvent(new KeyboardEvent("keyup",R))}},t=e.target,i=u=>{t&&z(u,t)&&!u.repeat&&a.nodeContains(t,a.getEventTarget(u))&&e.target&&de(K(e.target,u),"keyboard")},o=he.chain(i,r);return m(d.getOwnerDocument(e.target),"keyup",o,!0),()=>{C(d.getOwnerDocument(e.target),"keyup",o,!0)}}},[Q,m,M,C]);let[_,L]=p.useState(null);re.useLayoutEffect(()=>{let e=h.current;if(_==="pointer"){let r=i=>{if(i.pointerId===e.activePointerId&&e.isPressed&&i.button===0&&e.target){if(a.nodeContains(e.target,a.getEventTarget(i))&&e.pointerType!=null){let o=!1,u=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(o?I(i):(me.focusWithoutScrolling(e.target),e.target.click()))},80);m(i.currentTarget,"click",()=>o=!0,!0),e.disposables.push(()=>clearTimeout(u))}else I(i);e.isOverTarget=!1}},t=i=>{I(i)};return m(d.getOwnerDocument(e.target),"pointerup",r,!1),m(d.getOwnerDocument(e.target),"pointercancel",t,!1),()=>{C(d.getOwnerDocument(e.target),"pointerup",r,!1),C(d.getOwnerDocument(e.target),"pointercancel",t,!1)}}else if(_==="mouse"&&process.env.NODE_ENV==="test"){let r=t=>{if(t.button===0){if(e.ignoreEmulatedMouseEvents){e.ignoreEmulatedMouseEvents=!1;return}e.target&&e.target.contains(t.target)&&e.pointerType!=null||I(t),e.isOverTarget=!1}};return m(d.getOwnerDocument(e.target),"mouseup",r,!1),()=>{C(d.getOwnerDocument(e.target),"mouseup",r,!1)}}else if(_==="touch"&&process.env.NODE_ENV==="test"){let r=t=>{e.isPressed&&a.nodeContains(a.getEventTarget(t),e.target)&&I({currentTarget:e.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};return m(d.getOwnerWindow(e.target),"scroll",r,!0),()=>{C(d.getOwnerWindow(e.target),"scroll",r,!0)}}},[_,m,C]);let Te=p.useMemo(()=>{let e=h.current,r={onKeyDown(t){if(z(t.nativeEvent,t.currentTarget)&&a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent))){var i;le(a.getEventTarget(t.nativeEvent),t.key)&&t.preventDefault();let o=!0;!e.isPressed&&!t.repeat&&(e.target=t.currentTarget,e.isPressed=!0,Z(!0),e.pointerType="keyboard",o=y(t,"keyboard")),o&&t.stopPropagation(),t.metaKey&&be.isMac()&&((i=e.metaKeyEvents)===null||i===void 0||i.set(t.key,t.nativeEvent))}else t.key==="Meta"&&(e.metaKeyEvents=new Map)},onClick(t){if(!(t&&!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent)))&&t&&t.button===0&&!e.isTriggeringEvent&&!te.openLink.isOpening){let i=!0;if(g&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType==="virtual"||W.isVirtualClick(t.nativeEvent))){let o=y(t,"virtual"),u=O(t,"virtual"),k=E(t,"virtual");N(t),i=o&&u&&k}else if(e.isPressed&&e.pointerType!=="keyboard"){let o=e.pointerType||t.nativeEvent.pointerType||"virtual",u=O(K(t.currentTarget,t),o),k=E(K(t.currentTarget,t),o,!0);i=u&&k,e.isOverTarget=!1,N(t),$(t)}e.ignoreEmulatedMouseEvents=!1,i&&t.stopPropagation()}}};return typeof PointerEvent<"u"?(r.onPointerDown=t=>{if(t.button!==0||!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent)))return;if(W.isVirtualPointerEvent(t.nativeEvent)){e.pointerType="virtual";return}e.pointerType=t.pointerType;let i=!0;if(!e.isPressed){e.isPressed=!0,L("pointer"),e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,v||x.disableTextSelection(e.target),i=y(t,e.pointerType);let o=a.getEventTarget(t.nativeEvent);"releasePointerCapture"in o&&o.releasePointerCapture(t.pointerId)}i&&t.stopPropagation()},r.onMouseDown=t=>{if(a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent))&&t.button===0){if(b){let i=Y.preventFocus(t.target);i&&e.disposables.push(i)}t.stopPropagation()}},r.onPointerUp=t=>{!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent))||e.pointerType==="virtual"||t.button===0&&!e.isPressed&&O(t,e.pointerType||t.pointerType)},r.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,y(K(e.target,t),e.pointerType))},r.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,E(K(e.target,t),e.pointerType,!1),q(t))},r.onDragStart=t=>{a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent))&&$(t)}):process.env.NODE_ENV==="test"&&(r.onMouseDown=t=>{if(t.button!==0||!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent)))return;if(e.ignoreEmulatedMouseEvents){t.stopPropagation();return}if(e.isPressed=!0,L("mouse"),e.isOverTarget=!0,e.target=t.currentTarget,e.pointerType=W.isVirtualClick(t.nativeEvent)?"virtual":"mouse",Ce.flushSync(()=>y(t,e.pointerType))&&t.stopPropagation(),b){let o=Y.preventFocus(t.target);o&&e.disposables.push(o)}},r.onMouseEnter=t=>{if(!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent)))return;let i=!0;e.isPressed&&!e.ignoreEmulatedMouseEvents&&e.pointerType!=null&&(e.isOverTarget=!0,i=y(t,e.pointerType)),i&&t.stopPropagation()},r.onMouseLeave=t=>{if(!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent)))return;let i=!0;e.isPressed&&!e.ignoreEmulatedMouseEvents&&e.pointerType!=null&&(e.isOverTarget=!1,i=E(t,e.pointerType,!1),q(t)),i&&t.stopPropagation()},r.onMouseUp=t=>{a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent))&&!e.ignoreEmulatedMouseEvents&&t.button===0&&!e.isPressed&&O(t,e.pointerType||"mouse")},r.onTouchStart=t=>{if(!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent)))return;let i=Ke(t.nativeEvent);if(!i)return;e.activePointerId=i.identifier,e.ignoreEmulatedMouseEvents=!0,e.isOverTarget=!0,e.isPressed=!0,L("touch"),e.target=t.currentTarget,e.pointerType="touch",v||x.disableTextSelection(e.target),y(S(e.target,t),e.pointerType)&&t.stopPropagation()},r.onTouchMove=t=>{if(!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent)))return;if(!e.isPressed){t.stopPropagation();return}let i=ae(t.nativeEvent,e.activePointerId),o=!0;i&&oe(i,t.currentTarget)?!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,o=y(S(e.target,t),e.pointerType)):e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,o=E(S(e.target,t),e.pointerType,!1),q(S(e.target,t))),o&&t.stopPropagation()},r.onTouchEnd=t=>{if(!a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent)))return;if(!e.isPressed){t.stopPropagation();return}let i=ae(t.nativeEvent,e.activePointerId),o=!0;i&&oe(i,t.currentTarget)&&e.pointerType!=null?(O(S(e.target,t),e.pointerType),o=E(S(e.target,t),e.pointerType),V(t.nativeEvent,e.target)):e.isOverTarget&&e.pointerType!=null&&(o=E(S(e.target,t),e.pointerType,!1)),o&&t.stopPropagation(),e.isPressed=!1,L(null),e.activePointerId=null,e.isOverTarget=!1,e.ignoreEmulatedMouseEvents=!0,e.target&&!v&&x.restoreTextSelection(e.target),M()},r.onTouchCancel=t=>{a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent))&&(t.stopPropagation(),e.isPressed&&$(S(e.target,t)))},r.onDragStart=t=>{a.nodeContains(t.currentTarget,a.getEventTarget(t.nativeEvent))&&$(t)}),r},[g,b,M,v,$,q,E,y,O,N,V]);return p.useEffect(()=>{if(!A||process.env.NODE_ENV==="test")return;const e=d.getOwnerDocument(A.current);if(!e||!e.head||e.getElementById(ie))return;const r=e.createElement("style");r.id=ie,r.textContent=`
2
+ @layer {
3
+ [${se}] {
4
+ touch-action: pan-x pan-y pinch-zoom;
5
+ }
6
+ }
7
+ `.trim(),e.head.prepend(r)},[A]),p.useEffect(()=>{let e=h.current;return()=>{var r;v||x.restoreTextSelection((r=e.target)!==null&&r!==void 0?r:void 0);for(let t of e.disposables)t();e.disposables=[]}},[v]),{isPressed:D||ge,pressProps:ue.mergeProps(fe,Te,{[se]:!0})}}function j(n){return n.tagName==="A"&&n.hasAttribute("href")}function z(n,s){const{key:l,code:c}=n,f=s,P=f.getAttribute("role");return(l==="Enter"||l===" "||l==="Spacebar"||c==="Space")&&!(f instanceof d.getOwnerWindow(f).HTMLInputElement&&!ce(f,l)||f instanceof d.getOwnerWindow(f).HTMLTextAreaElement||f.isContentEditable)&&!((P==="link"||!P&&j(f))&&l!=="Enter")}function Ke(n){const{targetTouches:s}=n;return s.length>0?s[0]:null}function ae(n,s){const l=n.changedTouches;for(let c=0;c<l.length;c++){const f=l[c];if(f.identifier===s)return f}return null}function S(n,s){let l=0,c=0;return s.targetTouches&&s.targetTouches.length===1&&(l=s.targetTouches[0].clientX,c=s.targetTouches[0].clientY),{currentTarget:n,shiftKey:s.shiftKey,ctrlKey:s.ctrlKey,metaKey:s.metaKey,altKey:s.altKey,clientX:l,clientY:c}}function K(n,s){let l=s.clientX,c=s.clientY;return{currentTarget:n,shiftKey:s.shiftKey,ctrlKey:s.ctrlKey,metaKey:s.metaKey,altKey:s.altKey,clientX:l,clientY:c}}function we(n){let s=0,l=0;return n.width!==void 0?s=n.width/2:n.radiusX!==void 0&&(s=n.radiusX),n.height!==void 0?l=n.height/2:n.radiusY!==void 0&&(l=n.radiusY),{top:n.clientY-l,right:n.clientX+s,bottom:n.clientY+l,left:n.clientX-s}}function Me(n,s){return!(n.left>s.right||s.left>n.right||n.top>s.bottom||s.top>n.bottom)}function oe(n,s){let l=s.getBoundingClientRect(),c=we(n);return Me(l,c)}function De(n){return n instanceof HTMLInputElement?!1:n instanceof HTMLButtonElement?n.type!=="submit"&&n.type!=="reset":!j(n)}function le(n,s){return n instanceof HTMLInputElement?!ce(n,s):De(n)}const Ie=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ce(n,s){return n.type==="checkbox"||n.type==="radio"?s===" ":Ie.has(n.type)}exports.usePress=ke;