@okam/stack-ui 1.35.6 → 1.35.7

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 (227) hide show
  1. package/index107.js +1 -1
  2. package/index107.mjs +1 -1
  3. package/index114.js +1 -1
  4. package/index114.mjs +1 -1
  5. package/index116.js +1 -1
  6. package/index116.mjs +3 -3
  7. package/index117.js +1 -1
  8. package/index117.mjs +3 -3
  9. package/index118.js +1 -1
  10. package/index118.mjs +1 -1
  11. package/index119.js +1 -1
  12. package/index119.mjs +1 -1
  13. package/index124.js +1 -1
  14. package/index124.mjs +1 -1
  15. package/index126.js +1 -1
  16. package/index126.mjs +2 -2
  17. package/index127.js +1 -1
  18. package/index127.mjs +5 -5
  19. package/index128.js +1 -1
  20. package/index128.mjs +3 -3
  21. package/index129.js +1 -1
  22. package/index129.mjs +9 -9
  23. package/index135.js +1 -1
  24. package/index135.mjs +1 -1
  25. package/index144.js +1 -1
  26. package/index144.mjs +55 -10
  27. package/index145.js +1 -1
  28. package/index145.mjs +10 -55
  29. package/index150.js +1 -1
  30. package/index150.mjs +1 -1
  31. package/index151.js +1 -1
  32. package/index151.mjs +1 -1
  33. package/index153.js +1 -1
  34. package/index153.mjs +22 -68
  35. package/index154.js +1 -1
  36. package/index154.mjs +62 -370
  37. package/index155.js +1 -1
  38. package/index155.mjs +379 -44
  39. package/index156.js +1 -1
  40. package/index156.mjs +47 -4
  41. package/index157.js +1 -1
  42. package/index157.mjs +4 -25
  43. package/index158.js +1 -1
  44. package/index158.mjs +23 -46
  45. package/index159.js +1 -1
  46. package/index159.mjs +46 -4
  47. package/index160.js +1 -1
  48. package/index160.mjs +5 -24
  49. package/index161.js +1 -1
  50. package/index161.mjs +23 -11
  51. package/index162.js +1 -1
  52. package/index162.mjs +12 -4
  53. package/index163.js +1 -1
  54. package/index163.mjs +4 -14
  55. package/index164.js +1 -1
  56. package/index164.mjs +14 -21
  57. package/index165.js +1 -1
  58. package/index165.mjs +21 -42
  59. package/index166.js +1 -1
  60. package/index166.mjs +41 -23
  61. package/index167.js +1 -1
  62. package/index167.mjs +24 -42
  63. package/index168.js +1 -1
  64. package/index168.mjs +41 -27
  65. package/index169.js +1 -1
  66. package/index169.mjs +27 -30
  67. package/index170.js +1 -1
  68. package/index170.mjs +30 -13
  69. package/index171.js +1 -1
  70. package/index171.mjs +14 -28
  71. package/index172.js +1 -1
  72. package/index172.mjs +28 -9
  73. package/index173.js +1 -1
  74. package/index173.mjs +9 -6
  75. package/index174.js +1 -1
  76. package/index174.mjs +6 -5
  77. package/index175.js +1 -1
  78. package/index175.mjs +5 -13
  79. package/index176.js +1 -1
  80. package/index176.mjs +13 -8
  81. package/index177.js +1 -1
  82. package/index177.mjs +8 -17
  83. package/index178.js +1 -1
  84. package/index178.mjs +17 -19
  85. package/index179.js +1 -1
  86. package/index179.mjs +19 -54
  87. package/index18.js +1 -1
  88. package/index18.mjs +49 -44
  89. package/index180.js +1 -1
  90. package/index180.mjs +50 -23
  91. package/index181.js +1 -1
  92. package/index181.mjs +122 -138
  93. package/index182.js +1 -1
  94. package/index182.mjs +129 -192
  95. package/index183.js +1 -1
  96. package/index183.mjs +44 -22
  97. package/index184.js +1 -1
  98. package/index184.mjs +14 -49
  99. package/index185.js +1 -1
  100. package/index185.mjs +93 -46
  101. package/index186.js +1 -1
  102. package/index186.mjs +98 -89
  103. package/index187.js +1 -1
  104. package/index187.mjs +5 -72
  105. package/index188.js +1 -1
  106. package/index188.mjs +3 -68
  107. package/index189.js +1 -1
  108. package/index189.mjs +125 -7
  109. package/index190.js +1 -1
  110. package/index190.mjs +29 -11
  111. package/index191.js +1 -1
  112. package/index191.mjs +40 -113
  113. package/index192.js +1 -1
  114. package/index192.mjs +41 -131
  115. package/index193.js +1 -1
  116. package/index193.mjs +36 -43
  117. package/index194.js +1 -1
  118. package/index194.mjs +110 -11
  119. package/index195.js +1 -1
  120. package/index195.mjs +59 -77
  121. package/index196.js +1 -1
  122. package/index196.mjs +94 -99
  123. package/index197.js +1 -1
  124. package/index197.mjs +98 -5
  125. package/index198.js +1 -1
  126. package/index198.mjs +140 -3
  127. package/index199.js +1 -1
  128. package/index199.mjs +191 -119
  129. package/index200.js +1 -1
  130. package/index200.mjs +22 -29
  131. package/index201.js +1 -1
  132. package/index201.mjs +49 -51
  133. package/index202.js +1 -1
  134. package/index202.mjs +47 -43
  135. package/index203.js +1 -1
  136. package/index203.mjs +95 -35
  137. package/index204.js +1 -1
  138. package/index204.mjs +72 -114
  139. package/index205.js +1 -1
  140. package/index205.mjs +67 -76
  141. package/index206.js +1 -1
  142. package/index206.mjs +7 -101
  143. package/index207.js +1 -1
  144. package/index207.mjs +12 -98
  145. package/index235.js +1 -1
  146. package/index235.mjs +5 -5
  147. package/index236.js +1 -1
  148. package/index236.mjs +1 -1
  149. package/index237.js +1 -1
  150. package/index237.mjs +4 -4
  151. package/index238.js +1 -1
  152. package/index238.mjs +1 -1
  153. package/index239.js +1 -1
  154. package/index239.mjs +1 -1
  155. package/index240.js +1 -1
  156. package/index240.mjs +4 -4
  157. package/index241.js +1 -1
  158. package/index241.mjs +4 -4
  159. package/index242.js +1 -1
  160. package/index242.mjs +1 -1
  161. package/index243.js +1 -1
  162. package/index243.mjs +4 -4
  163. package/index244.js +1 -1
  164. package/index244.mjs +4 -4
  165. package/index245.js +1 -1
  166. package/index245.mjs +1 -1
  167. package/index246.js +1 -1
  168. package/index246.mjs +4 -4
  169. package/index247.js +1 -1
  170. package/index247.mjs +4 -4
  171. package/index248.js +1 -1
  172. package/index248.mjs +1 -1
  173. package/index249.js +1 -1
  174. package/index249.mjs +1 -1
  175. package/index250.js +1 -1
  176. package/index250.mjs +4 -4
  177. package/index251.js +1 -1
  178. package/index251.mjs +4 -4
  179. package/index252.js +1 -1
  180. package/index252.mjs +1 -1
  181. package/index253.js +1 -1
  182. package/index253.mjs +4 -4
  183. package/index254.js +1 -1
  184. package/index254.mjs +4 -4
  185. package/index255.js +1 -1
  186. package/index255.mjs +4 -4
  187. package/index256.js +1 -1
  188. package/index256.mjs +1 -1
  189. package/index257.js +1 -1
  190. package/index257.mjs +4 -4
  191. package/index258.js +1 -1
  192. package/index258.mjs +4 -4
  193. package/index259.js +1 -1
  194. package/index259.mjs +4 -4
  195. package/index260.js +1 -1
  196. package/index260.mjs +4 -4
  197. package/index261.js +1 -1
  198. package/index261.mjs +4 -4
  199. package/index262.js +1 -1
  200. package/index262.mjs +1 -1
  201. package/index263.js +1 -1
  202. package/index263.mjs +1 -1
  203. package/index264.js +1 -1
  204. package/index264.mjs +1 -1
  205. package/index265.js +1 -1
  206. package/index265.mjs +4 -4
  207. package/index266.js +1 -1
  208. package/index266.mjs +4 -4
  209. package/index267.js +1 -1
  210. package/index267.mjs +4 -4
  211. package/index268.js +1 -1
  212. package/index268.mjs +4 -4
  213. package/index269.js +1 -1
  214. package/index269.mjs +5 -5
  215. package/index278.js +1 -1
  216. package/index278.mjs +3 -3
  217. package/index280.js +1 -1
  218. package/index280.mjs +2 -2
  219. package/index281.js +1 -1
  220. package/index281.mjs +5 -5
  221. package/index284.js +1 -1
  222. package/index284.mjs +3 -3
  223. package/index287.js +1 -1
  224. package/index287.mjs +1 -1
  225. package/index288.js +1 -1
  226. package/index288.mjs +4 -4
  227. package/package.json +1 -1
package/index189.mjs CHANGED
@@ -1,10 +1,128 @@
1
- import { useContext as e, createContext as o } from "react";
2
- const r = /* @__PURE__ */ o({});
3
- function a() {
4
- var t;
5
- return (t = e(r)) !== null && t !== void 0 ? t : {};
1
+ import { CalendarDate as $ } from "./index181.mjs";
2
+ import { GregorianCalendar as c } from "./index185.mjs";
3
+ const f = [
4
+ [
5
+ 1868,
6
+ 9,
7
+ 8
8
+ ],
9
+ [
10
+ 1912,
11
+ 7,
12
+ 30
13
+ ],
14
+ [
15
+ 1926,
16
+ 12,
17
+ 25
18
+ ],
19
+ [
20
+ 1989,
21
+ 1,
22
+ 8
23
+ ],
24
+ [
25
+ 2019,
26
+ 5,
27
+ 1
28
+ ]
29
+ ], D = [
30
+ [
31
+ 1912,
32
+ 7,
33
+ 29
34
+ ],
35
+ [
36
+ 1926,
37
+ 12,
38
+ 24
39
+ ],
40
+ [
41
+ 1989,
42
+ 1,
43
+ 7
44
+ ],
45
+ [
46
+ 2019,
47
+ 4,
48
+ 30
49
+ ]
50
+ ], u = [
51
+ 1867,
52
+ 1911,
53
+ 1925,
54
+ 1988,
55
+ 2018
56
+ ], i = [
57
+ "meiji",
58
+ "taisho",
59
+ "showa",
60
+ "heisei",
61
+ "reiwa"
62
+ ];
63
+ function h(e) {
64
+ const r = f.findIndex(([n, a, t]) => e.year < n || e.year === n && e.month < a || e.year === n && e.month === a && e.day < t);
65
+ return r === -1 ? f.length - 1 : r === 0 ? 0 : r - 1;
66
+ }
67
+ function s(e) {
68
+ let r = u[i.indexOf(e.era)];
69
+ if (!r) throw new Error("Unknown era: " + e.era);
70
+ return new $(e.year + r, e.month, e.day);
71
+ }
72
+ class g extends c {
73
+ fromJulianDay(r) {
74
+ let n = super.fromJulianDay(r), a = h(n);
75
+ return new $(this, i[a], n.year - u[a], n.month, n.day);
76
+ }
77
+ toJulianDay(r) {
78
+ return super.toJulianDay(s(r));
79
+ }
80
+ balanceDate(r) {
81
+ let n = s(r), a = h(n);
82
+ i[a] !== r.era && (r.era = i[a], r.year = n.year - u[a]), this.constrainDate(r);
83
+ }
84
+ constrainDate(r) {
85
+ let n = i.indexOf(r.era), a = D[n];
86
+ if (a != null) {
87
+ let [t, o, y] = a, m = t - u[n];
88
+ r.year = Math.max(1, Math.min(m, r.year)), r.year === m && (r.month = Math.min(o, r.month), r.month === o && (r.day = Math.min(y, r.day)));
89
+ }
90
+ if (r.year === 1 && n >= 0) {
91
+ let [, t, o] = f[n];
92
+ r.month = Math.max(t, r.month), r.month === t && (r.day = Math.max(o, r.day));
93
+ }
94
+ }
95
+ getEras() {
96
+ return i;
97
+ }
98
+ getYearsInEra(r) {
99
+ let n = i.indexOf(r.era), a = f[n], t = f[n + 1];
100
+ if (t == null)
101
+ return 9999 - a[0] + 1;
102
+ let o = t[0] - a[0];
103
+ return (r.month < t[1] || r.month === t[1] && r.day < t[2]) && o++, o;
104
+ }
105
+ getDaysInMonth(r) {
106
+ return super.getDaysInMonth(s(r));
107
+ }
108
+ getMinimumMonthInYear(r) {
109
+ let n = l(r);
110
+ return n ? n[1] : 1;
111
+ }
112
+ getMinimumDayInMonth(r) {
113
+ let n = l(r);
114
+ return n && r.month === n[1] ? n[2] : 1;
115
+ }
116
+ constructor(...r) {
117
+ super(...r), this.identifier = "japanese";
118
+ }
119
+ }
120
+ function l(e) {
121
+ if (e.year === 1) {
122
+ let r = i.indexOf(e.era);
123
+ return f[r];
124
+ }
6
125
  }
7
126
  export {
8
- r as PortalContext,
9
- a as useUNSAFE_PortalContext
127
+ g as JapaneseCalendar
10
128
  };
package/index190.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index279.js"),e=require("react");function n({children:r}){let t=e.useMemo(()=>({register:()=>{}}),[]);return e.createElement(o.PressResponderContext.Provider,{value:t},r)}exports.ClearPressResponder=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index181.js"),t=require("./index185.js"),o=-543;class i extends t.GregorianCalendar{fromJulianDay(e){let r=super.fromJulianDay(e),u=t.getExtendedYear(r.era,r.year);return new d.CalendarDate(this,u-o,r.month,r.day)}toJulianDay(e){return super.toJulianDay(n(e))}getEras(){return["BE"]}getDaysInMonth(e){return super.getDaysInMonth(n(e))}balanceDate(){}constructor(...e){super(...e),this.identifier="buddhist"}}function n(a){let[e,r]=t.fromExtendedYear(a.year+o);return new d.CalendarDate(e,r,a.month,a.day)}exports.BuddhistCalendar=i;
package/index190.mjs CHANGED
@@ -1,14 +1,32 @@
1
- import { PressResponderContext as t } from "./index279.mjs";
2
- import a, { useMemo as o } from "react";
3
- function n({ children: e }) {
4
- let r = o(() => ({
5
- register: () => {
6
- }
7
- }), []);
8
- return /* @__PURE__ */ a.createElement(t.Provider, {
9
- value: r
10
- }, e);
1
+ import { CalendarDate as n } from "./index181.mjs";
2
+ import { GregorianCalendar as s, getExtendedYear as $, fromExtendedYear as c } from "./index185.mjs";
3
+ const o = -543;
4
+ class u extends s {
5
+ fromJulianDay(e) {
6
+ let r = super.fromJulianDay(e), d = $(r.era, r.year);
7
+ return new n(this, d - o, r.month, r.day);
8
+ }
9
+ toJulianDay(e) {
10
+ return super.toJulianDay(t(e));
11
+ }
12
+ getEras() {
13
+ return [
14
+ "BE"
15
+ ];
16
+ }
17
+ getDaysInMonth(e) {
18
+ return super.getDaysInMonth(t(e));
19
+ }
20
+ balanceDate() {
21
+ }
22
+ constructor(...e) {
23
+ super(...e), this.identifier = "buddhist";
24
+ }
25
+ }
26
+ function t(a) {
27
+ let [e, r] = c(a.year + o);
28
+ return new n(e, r, a.month, a.day);
11
29
  }
12
30
  export {
13
- n as ClearPressResponder
31
+ u as BuddhistCalendar
14
32
  };
package/index191.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index192.js"),u=require("./index193.js"),d=require("./index194.js"),f=require("./index195.js"),l=require("./index196.js"),y=require("./index197.js");function m(s){let t=typeof s[0]=="object"?s.shift():new f.GregorianCalendar,e;if(typeof s[0]=="string")e=s.shift();else{let a=t.getEras();e=a[a.length-1]}let i=s.shift(),n=s.shift(),h=s.shift();return[t,e,i,n,h]}var p=new WeakMap;class c{copy(){return this.era?new c(this.calendar,this.era,this.year,this.month,this.day):new c(this.calendar,this.year,this.month,this.day)}add(t){return r.add(this,t)}subtract(t){return r.subtract(this,t)}set(t){return r.set(this,t)}cycle(t,e,i){return r.cycleDate(this,t,e,i)}toDate(t){return l.toDate(this,t)}toString(){return d.dateToString(this)}compare(t){return u.compareDate(this,t)}constructor(...t){y._(this,p,{writable:!0,value:void 0});let[e,i,n,h,a]=m(t);this.calendar=e,this.era=i,this.year=n,this.month=h,this.day=a,r.constrain(this)}}var v=new WeakMap;class o{copy(){return this.era?new o(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new o(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return r.add(this,t)}subtract(t){return r.subtract(this,t)}set(t){return r.set(r.setTime(this,t),t)}cycle(t,e,i){switch(t){case"era":case"year":case"month":case"day":return r.cycleDate(this,t,e,i);default:return r.cycleTime(this,t,e,i)}}toDate(t,e){return l.toDate(this,t,e)}toString(){return d.dateTimeToString(this)}compare(t){let e=u.compareDate(this,t);return e===0?u.compareTime(this,l.toCalendarDateTime(t)):e}constructor(...t){y._(this,v,{writable:!0,value:void 0});let[e,i,n,h,a]=m(t);this.calendar=e,this.era=i,this.year=n,this.month=h,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,r.constrain(this)}}exports.CalendarDate=c;exports.CalendarDateTime=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index181.js"),o=require("./index185.js"),n=1911;function l(r){return r.era==="minguo"?r.year+n:1-r.year+n}function u(r){let e=r-n;return e>0?["minguo",e]:["before_minguo",1-e]}class c extends o.GregorianCalendar{fromJulianDay(e){let a=super.fromJulianDay(e),t=o.getExtendedYear(a.era,a.year),[s,g]=u(t);return new f.CalendarDate(this,s,g,a.month,a.day)}toJulianDay(e){return super.toJulianDay(i(e))}getEras(){return["before_minguo","minguo"]}balanceDate(e){let[a,t]=u(l(e));e.era=a,e.year=t}isInverseEra(e){return e.era==="before_minguo"}getDaysInMonth(e){return super.getDaysInMonth(i(e))}getYearsInEra(e){return e.era==="before_minguo"?9999:9999-n}constructor(...e){super(...e),this.identifier="roc"}}function i(r){let[e,a]=o.fromExtendedYear(l(r));return new f.CalendarDate(e,a,r.month,r.day)}exports.TaiwanCalendar=c;
package/index191.mjs CHANGED
@@ -1,127 +1,54 @@
1
- import { add as n, subtract as o, set as $, cycleDate as f, constrain as l, setTime as b, cycleTime as x } from "./index192.mjs";
2
- import { compareDate as m, compareTime as v } from "./index193.mjs";
3
- import { dateToString as w, dateTimeToString as D } from "./index194.mjs";
4
- import { GregorianCalendar as T } from "./index195.mjs";
5
- import { toDate as u, toCalendarDateTime as C } from "./index196.mjs";
6
- import { _ as p } from "./index197.mjs";
7
- function y(r) {
8
- let t = typeof r[0] == "object" ? r.shift() : new T(), e;
9
- if (typeof r[0] == "string") e = r.shift();
10
- else {
11
- let s = t.getEras();
12
- e = s[s.length - 1];
13
- }
14
- let a = r.shift(), i = r.shift(), h = r.shift();
15
- return [
16
- t,
17
- e,
18
- a,
19
- i,
20
- h
1
+ import { CalendarDate as f } from "./index181.mjs";
2
+ import { GregorianCalendar as c, getExtendedYear as s, fromExtendedYear as g } from "./index185.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
21
15
  ];
22
16
  }
23
- var S = /* @__PURE__ */ new WeakMap();
24
- class d {
25
- /** Returns a copy of this date. */
26
- copy() {
27
- return this.era ? new d(this.calendar, this.era, this.year, this.month, this.day) : new d(this.calendar, this.year, this.month, this.day);
28
- }
29
- /** Returns a new `CalendarDate` with the given duration added to it. */
30
- add(t) {
31
- return n(this, t);
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);
32
21
  }
33
- /** Returns a new `CalendarDate` with the given duration subtracted from it. */
34
- subtract(t) {
35
- return o(this, t);
22
+ toJulianDay(e) {
23
+ return super.toJulianDay(b(e));
36
24
  }
37
- /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
38
- set(t) {
39
- return $(this, t);
25
+ getEras() {
26
+ return [
27
+ "before_minguo",
28
+ "minguo"
29
+ ];
40
30
  }
41
- /**
42
- * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
43
- * When the resulting value reaches the limits of the field, it wraps around.
44
- */
45
- cycle(t, e, a) {
46
- return f(this, t, e, a);
31
+ balanceDate(e) {
32
+ let [a, t] = o(i(e));
33
+ e.era = a, e.year = t;
47
34
  }
48
- /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
49
- toDate(t) {
50
- return u(this, t);
35
+ isInverseEra(e) {
36
+ return e.era === "before_minguo";
51
37
  }
52
- /** Converts the date to an ISO 8601 formatted string. */
53
- toString() {
54
- return w(this);
38
+ getDaysInMonth(e) {
39
+ return super.getDaysInMonth(b(e));
55
40
  }
56
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
57
- compare(t) {
58
- return m(this, t);
41
+ getYearsInEra(e) {
42
+ return e.era === "before_minguo" ? 9999 : 9999 - n;
59
43
  }
60
- constructor(...t) {
61
- p(this, S, {
62
- writable: !0,
63
- value: void 0
64
- });
65
- let [e, a, i, h, s] = y(t);
66
- this.calendar = e, this.era = a, this.year = i, this.month = h, this.day = s, l(this);
44
+ constructor(...e) {
45
+ super(...e), this.identifier = "roc";
67
46
  }
68
47
  }
69
- var _ = /* @__PURE__ */ new WeakMap();
70
- class c {
71
- /** Returns a copy of this date. */
72
- copy() {
73
- return this.era ? new c(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new c(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
74
- }
75
- /** Returns a new `CalendarDateTime` with the given duration added to it. */
76
- add(t) {
77
- return n(this, t);
78
- }
79
- /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
80
- subtract(t) {
81
- return o(this, t);
82
- }
83
- /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
84
- set(t) {
85
- return $(b(this, t), t);
86
- }
87
- /**
88
- * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
89
- * When the resulting value reaches the limits of the field, it wraps around.
90
- */
91
- cycle(t, e, a) {
92
- switch (t) {
93
- case "era":
94
- case "year":
95
- case "month":
96
- case "day":
97
- return f(this, t, e, a);
98
- default:
99
- return x(this, t, e, a);
100
- }
101
- }
102
- /** Converts the date to a native JavaScript Date object in the given time zone. */
103
- toDate(t, e) {
104
- return u(this, t, e);
105
- }
106
- /** Converts the date to an ISO 8601 formatted string. */
107
- toString() {
108
- return D(this);
109
- }
110
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
111
- compare(t) {
112
- let e = m(this, t);
113
- return e === 0 ? v(this, C(t)) : e;
114
- }
115
- constructor(...t) {
116
- p(this, _, {
117
- writable: !0,
118
- value: void 0
119
- });
120
- let [e, a, i, h, s] = y(t);
121
- this.calendar = e, this.era = a, this.year = i, this.month = h, this.day = s, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, l(this);
122
- }
48
+ function b(r) {
49
+ let [e, a] = g(i(r));
50
+ return new f(e, a, r.month, r.day);
123
51
  }
124
52
  export {
125
- d as CalendarDate,
126
- c as CalendarDateTime
53
+ m as TaiwanCalendar
127
54
  };
package/index192.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function $(n,e){let r=n.copy(),a="hour"in r?Y(r,e):0;f(r,e.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,n),r.month+=e.months||0,s(r),M(r),r.day+=(e.weeks||0)*7,r.day+=e.days||0,r.day+=a,b(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let c=r.calendar.getYearsInEra(r);if(r.year>c){var d,h;let o=(d=(h=r.calendar).isInverseEra)===null||d===void 0?void 0:d.call(h,r);r.year=c,r.month=o?1:r.calendar.getMonthsInYear(r),r.day=o?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let l=r.calendar.getMonthsInYear(r);return r.month>l&&(r.month=l,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function f(n,e){var r,a;!((r=(a=n.calendar).isInverseEra)===null||r===void 0)&&r.call(a,n)&&(e=-e),n.year+=e}function s(n){for(;n.month<1;)f(n,-1),n.month+=n.calendar.getMonthsInYear(n);let e=0;for(;n.month>(e=n.calendar.getMonthsInYear(n));)n.month-=e,f(n,1)}function b(n){for(;n.day<1;)n.month--,s(n),n.day+=n.calendar.getDaysInMonth(n);for(;n.day>n.calendar.getDaysInMonth(n);)n.day-=n.calendar.getDaysInMonth(n),n.month++,s(n)}function M(n){n.month=Math.max(1,Math.min(n.calendar.getMonthsInYear(n),n.month)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day))}function y(n){n.calendar.constrainDate&&n.calendar.constrainDate(n),n.year=Math.max(1,Math.min(n.calendar.getYearsInEra(n),n.year)),M(n)}function u(n){let e={};for(let r in n)typeof n[r]=="number"&&(e[r]=-n[r]);return e}function g(n,e){return $(n,u(e))}function I(n,e){let r=n.copy();return e.era!=null&&(r.era=e.era),e.year!=null&&(r.year=e.year),e.month!=null&&(r.month=e.month),e.day!=null&&(r.day=e.day),y(r),r}function x(n,e){let r=n.copy();return e.hour!=null&&(r.hour=e.hour),e.minute!=null&&(r.minute=e.minute),e.second!=null&&(r.second=e.second),e.millisecond!=null&&(r.millisecond=e.millisecond),m(r),r}function D(n){n.second+=Math.floor(n.millisecond/1e3),n.millisecond=i(n.millisecond,1e3),n.minute+=Math.floor(n.second/60),n.second=i(n.second,60),n.hour+=Math.floor(n.minute/60),n.minute=i(n.minute,60);let e=Math.floor(n.hour/24);return n.hour=i(n.hour,24),e}function m(n){n.millisecond=Math.max(0,Math.min(n.millisecond,1e3)),n.second=Math.max(0,Math.min(n.second,59)),n.minute=Math.max(0,Math.min(n.minute,59)),n.hour=Math.max(0,Math.min(n.hour,23))}function i(n,e){let r=n%e;return r<0&&(r+=e),r}function Y(n,e){return n.hour+=e.hours||0,n.minute+=e.minutes||0,n.second+=e.seconds||0,n.millisecond+=e.milliseconds||0,D(n)}function w(n,e,r,a){let c=n.copy();switch(e){case"era":{let l=n.calendar.getEras(),o=l.indexOf(n.era);if(o<0)throw new Error("Invalid era: "+n.era);o=t(o,r,0,l.length-1,a==null?void 0:a.round),c.era=l[o],y(c);break}case"year":var d,h;!((d=(h=c.calendar).isInverseEra)===null||d===void 0)&&d.call(h,c)&&(r=-r),c.year=t(n.year,r,-1/0,9999,a==null?void 0:a.round),c.year===-1/0&&(c.year=1),c.calendar.balanceYearMonth&&c.calendar.balanceYearMonth(c,n);break;case"month":c.month=t(n.month,r,1,n.calendar.getMonthsInYear(n),a==null?void 0:a.round);break;case"day":c.day=t(n.day,r,1,n.calendar.getDaysInMonth(n),a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return n.calendar.balanceDate&&n.calendar.balanceDate(c),y(c),c}function k(n,e,r,a){let c=n.copy();switch(e){case"hour":{let d=n.hour,h=0,l=23;if((a==null?void 0:a.hourCycle)===12){let o=d>=12;h=o?12:0,l=o?23:11}c.hour=t(d,r,h,l,a==null?void 0:a.round);break}case"minute":c.minute=t(n.minute,r,0,59,a==null?void 0:a.round);break;case"second":c.second=t(n.second,r,0,59,a==null?void 0:a.round);break;case"millisecond":c.millisecond=t(n.millisecond,r,0,999,a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return c}function t(n,e,r,a,c=!1){if(c){n+=Math.sign(e),n<r&&(n=a);let d=Math.abs(e);e>0?n=Math.ceil(n/d)*d:n=Math.floor(n/d)*d,n>a&&(n=r)}else n+=e,n<r?n=a-(r-n-1):n>a&&(n=r+(n-a-1));return n}exports.add=$;exports.constrain=y;exports.constrainTime=m;exports.cycleDate=w;exports.cycleTime=k;exports.invertDuration=u;exports.set=I;exports.setTime=x;exports.subtract=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index181.js"),u=require("./index188.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;
package/index192.mjs CHANGED
@@ -1,137 +1,47 @@
1
- function M(n, a) {
2
- let r = n.copy(), e = "hour" in r ? g(r, a) : 0;
3
- y(r, a.years || 0), r.calendar.balanceYearMonth && r.calendar.balanceYearMonth(r, n), r.month += a.months || 0, s(r), $(r), r.day += (a.weeks || 0) * 7, r.day += a.days || 0, r.day += e, u(r), r.calendar.balanceDate && r.calendar.balanceDate(r), r.year < 1 && (r.year = 1, r.month = 1, r.day = 1);
4
- let c = r.calendar.getYearsInEra(r);
5
- if (r.year > c) {
6
- var d, h;
7
- let o = (d = (h = r.calendar).isInverseEra) === null || d === void 0 ? void 0 : d.call(h, r);
8
- r.year = c, r.month = o ? 1 : r.calendar.getMonthsInYear(r), r.day = o ? 1 : r.calendar.getDaysInMonth(r);
1
+ import { CalendarDate as i } from "./index181.mjs";
2
+ import { mod as c } from "./index188.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);
9
22
  }
10
- r.month < 1 && (r.month = 1, r.day = 1);
11
- let l = r.calendar.getMonthsInYear(r);
12
- return r.month > l && (r.month = l, r.day = r.calendar.getDaysInMonth(r)), r.day = Math.max(1, Math.min(r.calendar.getDaysInMonth(r), r.day)), r;
13
- }
14
- function y(n, a) {
15
- var r, e;
16
- !((r = (e = n.calendar).isInverseEra) === null || r === void 0) && r.call(e, n) && (a = -a), n.year += a;
17
- }
18
- function s(n) {
19
- for (; n.month < 1; )
20
- y(n, -1), n.month += n.calendar.getMonthsInYear(n);
21
- let a = 0;
22
- for (; n.month > (a = n.calendar.getMonthsInYear(n)); )
23
- n.month -= a, y(n, 1);
24
- }
25
- function u(n) {
26
- for (; n.day < 1; )
27
- n.month--, s(n), n.day += n.calendar.getDaysInMonth(n);
28
- for (; n.day > n.calendar.getDaysInMonth(n); )
29
- n.day -= n.calendar.getDaysInMonth(n), n.month++, s(n);
30
- }
31
- function $(n) {
32
- n.month = Math.max(1, Math.min(n.calendar.getMonthsInYear(n), n.month)), n.day = Math.max(1, Math.min(n.calendar.getDaysInMonth(n), n.day));
33
- }
34
- function f(n) {
35
- n.calendar.constrainDate && n.calendar.constrainDate(n), n.year = Math.max(1, Math.min(n.calendar.getYearsInEra(n), n.year)), $(n);
36
- }
37
- function m(n) {
38
- let a = {};
39
- for (let r in n) typeof n[r] == "number" && (a[r] = -n[r]);
40
- return a;
41
- }
42
- function x(n, a) {
43
- return M(n, m(a));
44
- }
45
- function D(n, a) {
46
- let r = n.copy();
47
- return a.era != null && (r.era = a.era), a.year != null && (r.year = a.year), a.month != null && (r.month = a.month), a.day != null && (r.day = a.day), f(r), r;
48
- }
49
- function Y(n, a) {
50
- let r = n.copy();
51
- return a.hour != null && (r.hour = a.hour), a.minute != null && (r.minute = a.minute), a.second != null && (r.second = a.second), a.millisecond != null && (r.millisecond = a.millisecond), I(r), r;
52
- }
53
- function b(n) {
54
- n.second += Math.floor(n.millisecond / 1e3), n.millisecond = i(n.millisecond, 1e3), n.minute += Math.floor(n.second / 60), n.second = i(n.second, 60), n.hour += Math.floor(n.minute / 60), n.minute = i(n.minute, 60);
55
- let a = Math.floor(n.hour / 24);
56
- return n.hour = i(n.hour, 24), a;
57
- }
58
- function I(n) {
59
- n.millisecond = Math.max(0, Math.min(n.millisecond, 1e3)), n.second = Math.max(0, Math.min(n.second, 59)), n.minute = Math.max(0, Math.min(n.minute, 59)), n.hour = Math.max(0, Math.min(n.hour, 23));
60
- }
61
- function i(n, a) {
62
- let r = n % a;
63
- return r < 0 && (r += a), r;
64
- }
65
- function g(n, a) {
66
- return n.hour += a.hours || 0, n.minute += a.minutes || 0, n.second += a.seconds || 0, n.millisecond += a.milliseconds || 0, b(n);
67
- }
68
- function w(n, a, r, e) {
69
- let c = n.copy();
70
- switch (a) {
71
- case "era": {
72
- let l = n.calendar.getEras(), o = l.indexOf(n.era);
73
- if (o < 0) throw new Error("Invalid era: " + n.era);
74
- o = t(o, r, 0, l.length - 1, e == null ? void 0 : e.round), c.era = l[o], f(c);
75
- break;
76
- }
77
- case "year":
78
- var d, h;
79
- !((d = (h = c.calendar).isInverseEra) === null || d === void 0) && d.call(h, c) && (r = -r), c.year = t(n.year, r, -1 / 0, 9999, e == null ? void 0 : e.round), c.year === -1 / 0 && (c.year = 1), c.calendar.balanceYearMonth && c.calendar.balanceYearMonth(c, n);
80
- break;
81
- case "month":
82
- c.month = t(n.month, r, 1, n.calendar.getMonthsInYear(n), e == null ? void 0 : e.round);
83
- break;
84
- case "day":
85
- c.day = t(n.day, r, 1, n.calendar.getDaysInMonth(n), e == null ? void 0 : e.round);
86
- break;
87
- default:
88
- throw new Error("Unsupported field " + a);
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;
89
26
  }
90
- return n.calendar.balanceDate && n.calendar.balanceDate(c), f(c), c;
91
- }
92
- function k(n, a, r, e) {
93
- let c = n.copy();
94
- switch (a) {
95
- case "hour": {
96
- let d = n.hour, h = 0, l = 23;
97
- if ((e == null ? void 0 : e.hourCycle) === 12) {
98
- let o = d >= 12;
99
- h = o ? 12 : 0, l = o ? 23 : 11;
100
- }
101
- c.hour = t(d, r, h, l, e == null ? void 0 : e.round);
102
- break;
103
- }
104
- case "minute":
105
- c.minute = t(n.minute, r, 0, 59, e == null ? void 0 : e.round);
106
- break;
107
- case "second":
108
- c.second = t(n.second, r, 0, 59, e == null ? void 0 : e.round);
109
- break;
110
- case "millisecond":
111
- c.millisecond = t(n.millisecond, r, 0, 999, e == null ? void 0 : e.round);
112
- break;
113
- default:
114
- throw new Error("Unsupported field " + a);
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;
40
+ }
41
+ constructor() {
42
+ this.identifier = "persian";
115
43
  }
116
- return c;
117
- }
118
- function t(n, a, r, e, c = !1) {
119
- if (c) {
120
- n += Math.sign(a), n < r && (n = e);
121
- let d = Math.abs(a);
122
- a > 0 ? n = Math.ceil(n / d) * d : n = Math.floor(n / d) * d, n > e && (n = r);
123
- } else
124
- n += a, n < r ? n = e - (r - n - 1) : n > e && (n = r + (n - e - 1));
125
- return n;
126
44
  }
127
45
  export {
128
- M as add,
129
- f as constrain,
130
- I as constrainTime,
131
- w as cycleDate,
132
- k as cycleTime,
133
- m as invertDuration,
134
- D as set,
135
- Y as setTime,
136
- x as subtract
46
+ u as PersianCalendar
137
47
  };
package/index193.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index196.js"),u=require("./index207.js");function d(e,t){return t=l.toCalendar(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function $(e,t){var a,r,i,n;return(n=(i=(a=e.isEqual)===null||a===void 0?void 0:a.call(e,t))!==null&&i!==void 0?i:(r=t.isEqual)===null||r===void 0?void 0:r.call(t,e))!==null&&n!==void 0?n:e.identifier===t.identifier}function s(e,t,a){let r=e.calendar.toJulianDay(e),i=g(t),n=Math.ceil(r+1-i)%7;return n<0&&(n+=7),n}function m(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function v(e,t){return o(e)-o(t)}function o(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let c=null;function p(){return c==null&&(c=new Intl.DateTimeFormat().resolvedOptions().timeZone),c}const f=new Map;function y(e){if(Intl.Locale){let a=f.get(e);return a||(a=new Intl.Locale(e).maximize().region,a&&f.set(e,a)),a}let t=e.split("-")[1];return t==="u"?void 0:t}function g(e){let t=y(e);return t&&u.weekStartData[t]||0}exports.compareDate=m;exports.compareTime=v;exports.getDayOfWeek=s;exports.getLocalTimeZone=p;exports.isEqualCalendar=$;exports.isSameDay=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index181.js"),t=require("./index185.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;