react-semaphor 0.1.602 → 0.1.604

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 (211) hide show
  1. package/dist/activity/index.js +1 -73
  2. package/dist/analytics-protocol/index.js +1 -1451
  3. package/dist/appearance/index.js +1 -12
  4. package/dist/appearance-runtime/index.js +1 -5
  5. package/dist/assistant-context/index.js +1 -11
  6. package/dist/assistant-protocol/index.js +1 -152
  7. package/dist/brand-studio/index.js +4 -1594
  8. package/dist/briefings/index.js +1 -70
  9. package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
  10. package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
  11. package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
  12. package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
  13. package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
  14. package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
  15. package/dist/chunks/attribution-BEFSsbNn.js +1 -0
  16. package/dist/chunks/availability-3AIOf6Z-.js +1 -0
  17. package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
  18. package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
  19. package/dist/chunks/brand-DCaZyRt6.js +1 -0
  20. package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
  21. package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
  22. package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
  23. package/dist/chunks/context-ALdccLHw.js +2 -0
  24. package/dist/chunks/conversation-JMK2kyTK.js +1 -0
  25. package/dist/chunks/dashboard-BX28ld6s.js +1 -0
  26. package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
  27. package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
  28. package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
  29. package/dist/chunks/dates-D-KP8G-z.js +1 -0
  30. package/dist/chunks/edit-DEAK0UZo.js +1 -0
  31. package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
  32. package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
  33. package/dist/chunks/filter-line-CwQrqORc.js +1 -0
  34. package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
  35. package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
  36. package/dist/chunks/index-B-VF1ogs.js +1 -0
  37. package/dist/chunks/index-BE1DfxNs.js +1 -0
  38. package/dist/chunks/index-DViPGDFj.js +1 -0
  39. package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
  40. package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
  41. package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
  42. package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
  43. package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
  44. package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
  45. package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
  46. package/dist/chunks/palette-BzC-CGOc.js +6 -0
  47. package/dist/chunks/pickers-DuBrUht0.js +1 -0
  48. package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
  49. package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
  50. package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
  51. package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
  52. package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
  53. package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
  54. package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
  55. package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
  56. package/dist/chunks/save-DdFUZcbi.js +6 -0
  57. package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
  58. package/dist/chunks/schema-MC0cQSAb.js +4 -0
  59. package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
  60. package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
  61. package/dist/chunks/set-DuJfGkbY.js +1 -0
  62. package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
  63. package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
  64. package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
  65. package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
  66. package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
  67. package/dist/chunks/validators-CqV3Yka1.js +1 -0
  68. package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
  69. package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
  70. package/dist/dashboard/index.js +1 -7
  71. package/dist/dashboard-authoring/index.js +1 -4491
  72. package/dist/format-utils/index.js +1 -424
  73. package/dist/index.js +1 -554
  74. package/dist/layouts/index.js +1 -7
  75. package/dist/live-channel/index.js +1 -124
  76. package/dist/pdf-export-policy/index.js +1 -92
  77. package/dist/pdf-table-layout/index.js +1 -993
  78. package/dist/report-runtime-context/index.js +1 -9
  79. package/dist/shared/index.js +1 -6
  80. package/dist/style.css +1 -1
  81. package/dist/surfboard/index.js +1 -9
  82. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
  83. package/dist/types/index.js +1 -88
  84. package/dist/types/lib/document/document-edits.d.ts +0 -4
  85. package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
  86. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
  87. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  88. package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
  89. package/dist/types/lib/types/common-types.d.ts +0 -2
  90. package/dist/types/lib/types/explorer-types.d.ts +1 -1
  91. package/dist/types/lib/types/semantic-types.d.ts +6 -10
  92. package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
  93. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
  94. package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
  95. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
  96. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
  97. package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
  98. package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
  99. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
  100. package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
  101. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  102. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
  103. package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
  104. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
  105. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
  106. package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
  107. package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
  108. package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
  109. package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
  110. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
  111. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
  112. package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
  113. package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
  114. package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
  115. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
  116. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  117. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
  118. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
  119. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
  120. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  121. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  122. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
  123. package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
  124. package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
  125. package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
  126. package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
  127. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
  128. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
  129. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
  130. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
  131. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
  132. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
  133. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
  134. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
  135. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
  136. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
  137. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
  138. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
  139. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
  140. package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
  141. package/dist/types/shared/format-utils/index.d.ts +1 -0
  142. package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
  143. package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
  144. package/dist/types/shared/temporal/index.d.ts +2 -0
  145. package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
  146. package/dist/types/shared/temporal/temporal.d.ts +27 -0
  147. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
  148. package/dist/usage-events/index.js +1 -285
  149. package/dist/value-format-preferences/index.js +1 -635
  150. package/package.json +6 -2
  151. package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
  152. package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
  153. package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
  154. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
  155. package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
  156. package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
  157. package/dist/chunks/attribution-BvoKvhcj.js +0 -32
  158. package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
  159. package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
  160. package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
  161. package/dist/chunks/brand-BoUV0iHF.js +0 -54
  162. package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
  163. package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
  164. package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
  165. package/dist/chunks/context-BJoEFgNl.js +0 -369
  166. package/dist/chunks/conversation-sQiWYUOb.js +0 -16
  167. package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
  168. package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
  169. package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
  170. package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
  171. package/dist/chunks/dates-Bz-qM5px.js +0 -164
  172. package/dist/chunks/edit-9df1zOWe.js +0 -226
  173. package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
  174. package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
  175. package/dist/chunks/filter-line-BXT6y303.js +0 -703
  176. package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
  177. package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
  178. package/dist/chunks/index-BVKzKl5d.js +0 -90
  179. package/dist/chunks/index-BW0yozjs.js +0 -2795
  180. package/dist/chunks/index-CV_Kzou0.js +0 -595
  181. package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
  182. package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
  183. package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
  184. package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
  185. package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
  186. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
  187. package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
  188. package/dist/chunks/palette-CuA0HlzF.js +0 -23
  189. package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
  190. package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
  191. package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
  192. package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
  193. package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
  194. package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
  195. package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
  196. package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
  197. package/dist/chunks/resolver-DG_tfEpt.js +0 -156
  198. package/dist/chunks/save-BKHlDONy.js +0 -21
  199. package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
  200. package/dist/chunks/schema-C9NPiIru.js +0 -2568
  201. package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
  202. package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
  203. package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
  204. package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
  205. package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
  206. package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
  207. package/dist/chunks/token-types-D_xKgyVS.js +0 -8
  208. package/dist/chunks/upload-Dll_M7XQ.js +0 -15
  209. package/dist/chunks/validators-ClWHpYql.js +0 -3686
  210. package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
  211. package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
@@ -1,949 +0,0 @@
1
- var ft = Object.defineProperty;
2
- var ht = (e, t, r) => t in e ? ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var ne = (e, t, r) => ht(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { z as S } from "zod";
5
- import { e as ct } from "./filter-line-BXT6y303.js";
6
- var E = Uint8Array, I = Uint16Array, pe = Int32Array, xe = new E([
7
- 0,
8
- 0,
9
- 0,
10
- 0,
11
- 0,
12
- 0,
13
- 0,
14
- 0,
15
- 1,
16
- 1,
17
- 1,
18
- 1,
19
- 2,
20
- 2,
21
- 2,
22
- 2,
23
- 3,
24
- 3,
25
- 3,
26
- 3,
27
- 4,
28
- 4,
29
- 4,
30
- 4,
31
- 5,
32
- 5,
33
- 5,
34
- 5,
35
- 0,
36
- /* unused */
37
- 0,
38
- 0,
39
- /* impossible */
40
- 0
41
- ]), de = new E([
42
- 0,
43
- 0,
44
- 0,
45
- 0,
46
- 1,
47
- 1,
48
- 2,
49
- 2,
50
- 3,
51
- 3,
52
- 4,
53
- 4,
54
- 5,
55
- 5,
56
- 6,
57
- 6,
58
- 7,
59
- 7,
60
- 8,
61
- 8,
62
- 9,
63
- 9,
64
- 10,
65
- 10,
66
- 11,
67
- 11,
68
- 12,
69
- 12,
70
- 13,
71
- 13,
72
- /* unused */
73
- 0,
74
- 0
75
- ]), Ie = new E([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Ue = function(e, t) {
76
- for (var r = new I(31), n = 0; n < 31; ++n)
77
- r[n] = t += 1 << e[n - 1];
78
- for (var s = new pe(r[30]), n = 1; n < 30; ++n)
79
- for (var o = r[n]; o < r[n + 1]; ++o)
80
- s[o] = o - r[n] << 5 | n;
81
- return { b: r, r: s };
82
- }, He = Ue(xe, 2), ut = He.b, ve = He.r;
83
- ut[28] = 258, ve[258] = 28;
84
- var mt = Ue(de, 0), Oe = mt.r, we = new I(32768);
85
- for (var v = 0; v < 32768; ++v) {
86
- var J = (v & 43690) >> 1 | (v & 21845) << 1;
87
- J = (J & 52428) >> 2 | (J & 13107) << 2, J = (J & 61680) >> 4 | (J & 3855) << 4, we[v] = ((J & 65280) >> 8 | (J & 255) << 8) >> 1;
88
- }
89
- var te = function(e, t, r) {
90
- for (var n = e.length, s = 0, o = new I(t); s < n; ++s)
91
- e[s] && ++o[e[s] - 1];
92
- var a = new I(t);
93
- for (s = 1; s < t; ++s)
94
- a[s] = a[s - 1] + o[s - 1] << 1;
95
- var f;
96
- if (r) {
97
- f = new I(1 << t);
98
- var i = 15 - t;
99
- for (s = 0; s < n; ++s)
100
- if (e[s])
101
- for (var h = s << 4 | e[s], l = t - e[s], g = a[e[s] - 1]++ << l, m = g | (1 << l) - 1; g <= m; ++g)
102
- f[we[g] >> i] = h;
103
- } else
104
- for (f = new I(n), s = 0; s < n; ++s)
105
- e[s] && (f[s] = we[a[e[s] - 1]++] >> 15 - e[s]);
106
- return f;
107
- }, V = new E(288);
108
- for (var v = 0; v < 144; ++v)
109
- V[v] = 8;
110
- for (var v = 144; v < 256; ++v)
111
- V[v] = 9;
112
- for (var v = 256; v < 280; ++v)
113
- V[v] = 7;
114
- for (var v = 280; v < 288; ++v)
115
- V[v] = 8;
116
- var oe = new E(32);
117
- for (var v = 0; v < 32; ++v)
118
- oe[v] = 5;
119
- var vt = /* @__PURE__ */ te(V, 9, 0), wt = /* @__PURE__ */ te(oe, 5, 0), Je = function(e) {
120
- return (e + 7) / 8 | 0;
121
- }, Ve = function(e, t, r) {
122
- return (r == null || r > e.length) && (r = e.length), new E(e.subarray(t, r));
123
- }, gt = [
124
- "unexpected EOF",
125
- "invalid block type",
126
- "invalid length/literal",
127
- "invalid distance",
128
- "stream finished",
129
- "no stream handler",
130
- ,
131
- // determined by compression function
132
- "no callback",
133
- "invalid UTF-8 data",
134
- "extra field too long",
135
- "date not in range 1980-2099",
136
- "filename too long",
137
- "stream finishing",
138
- "invalid zip data"
139
- // determined by unknown compression method
140
- ], A = function(e, t, r) {
141
- var n = new Error(t || gt[e]);
142
- if (n.code = e, Error.captureStackTrace && Error.captureStackTrace(n, A), !r)
143
- throw n;
144
- return n;
145
- }, U = function(e, t, r) {
146
- r <<= t & 7;
147
- var n = t / 8 | 0;
148
- e[n] |= r, e[n + 1] |= r >> 8;
149
- }, Q = function(e, t, r) {
150
- r <<= t & 7;
151
- var n = t / 8 | 0;
152
- e[n] |= r, e[n + 1] |= r >> 8, e[n + 2] |= r >> 16;
153
- }, me = function(e, t) {
154
- for (var r = [], n = 0; n < e.length; ++n)
155
- e[n] && r.push({ s: n, f: e[n] });
156
- var s = r.length, o = r.slice();
157
- if (!s)
158
- return { t: ae, l: 0 };
159
- if (s == 1) {
160
- var a = new E(r[0].s + 1);
161
- return a[r[0].s] = 1, { t: a, l: 1 };
162
- }
163
- r.sort(function(O, X) {
164
- return O.f - X.f;
165
- }), r.push({ s: -1, f: 25001 });
166
- var f = r[0], i = r[1], h = 0, l = 1, g = 2;
167
- for (r[0] = { s: -1, f: f.f + i.f, l: f, r: i }; l != s - 1; )
168
- f = r[r[h].f < r[g].f ? h++ : g++], i = r[h != l && r[h].f < r[g].f ? h++ : g++], r[l++] = { s: -1, f: f.f + i.f, l: f, r: i };
169
- for (var m = o[0].s, n = 1; n < s; ++n)
170
- o[n].s > m && (m = o[n].s);
171
- var p = new I(m + 1), x = ge(r[l - 1], p, 0);
172
- if (x > t) {
173
- var n = 0, w = 0, d = x - t, b = 1 << d;
174
- for (o.sort(function(X, C) {
175
- return p[C.s] - p[X.s] || X.f - C.f;
176
- }); n < s; ++n) {
177
- var F = o[n].s;
178
- if (p[F] > t)
179
- w += b - (1 << x - p[F]), p[F] = t;
180
- else
181
- break;
182
- }
183
- for (w >>= d; w > 0; ) {
184
- var R = o[n].s;
185
- p[R] < t ? w -= 1 << t - p[R]++ - 1 : ++n;
186
- }
187
- for (; n >= 0 && w; --n) {
188
- var M = o[n].s;
189
- p[M] == t && (--p[M], ++w);
190
- }
191
- x = t;
192
- }
193
- return { t: new E(p), l: x };
194
- }, ge = function(e, t, r) {
195
- return e.s == -1 ? Math.max(ge(e.l, t, r + 1), ge(e.r, t, r + 1)) : t[e.s] = r;
196
- }, Ae = function(e) {
197
- for (var t = e.length; t && !e[--t]; )
198
- ;
199
- for (var r = new I(++t), n = 0, s = e[0], o = 1, a = function(i) {
200
- r[n++] = i;
201
- }, f = 1; f <= t; ++f)
202
- if (e[f] == s && f != t)
203
- ++o;
204
- else {
205
- if (!s && o > 2) {
206
- for (; o > 138; o -= 138)
207
- a(32754);
208
- o > 2 && (a(o > 10 ? o - 11 << 5 | 28690 : o - 3 << 5 | 12305), o = 0);
209
- } else if (o > 3) {
210
- for (a(s), --o; o > 6; o -= 6)
211
- a(8304);
212
- o > 2 && (a(o - 3 << 5 | 8208), o = 0);
213
- }
214
- for (; o--; )
215
- a(s);
216
- o = 1, s = e[f];
217
- }
218
- return { c: r.subarray(0, n), n: t };
219
- }, ee = function(e, t) {
220
- for (var r = 0, n = 0; n < t.length; ++n)
221
- r += e[n] * t[n];
222
- return r;
223
- }, ye = function(e, t, r) {
224
- var n = r.length, s = Je(t + 2);
225
- e[s] = n & 255, e[s + 1] = n >> 8, e[s + 2] = e[s] ^ 255, e[s + 3] = e[s + 1] ^ 255;
226
- for (var o = 0; o < n; ++o)
227
- e[s + o + 4] = r[o];
228
- return (s + 4 + n) * 8;
229
- }, Me = function(e, t, r, n, s, o, a, f, i, h, l) {
230
- U(t, l++, r), ++s[256];
231
- for (var g = me(s, 15), m = g.t, p = g.l, x = me(o, 15), w = x.t, d = x.l, b = Ae(m), F = b.c, R = b.n, M = Ae(w), O = M.c, X = M.n, C = new I(19), u = 0; u < F.length; ++u)
232
- ++C[F[u] & 31];
233
- for (var u = 0; u < O.length; ++u)
234
- ++C[O[u] & 31];
235
- for (var c = me(C, 7), k = c.t, Z = c.l, z = 19; z > 4 && !k[Ie[z - 1]]; --z)
236
- ;
237
- var W = h + 5 << 3, L = ee(s, V) + ee(o, oe) + a, _ = ee(s, m) + ee(o, w) + a + 14 + 3 * z + ee(C, k) + 2 * C[16] + 3 * C[17] + 7 * C[18];
238
- if (i >= 0 && W <= L && W <= _)
239
- return ye(t, l, e.subarray(i, i + h));
240
- var D, T, N, H;
241
- if (U(t, l, 1 + (_ < L)), l += 2, _ < L) {
242
- D = te(m, p, 0), T = m, N = te(w, d, 0), H = w;
243
- var fe = te(k, Z, 0);
244
- U(t, l, R - 257), U(t, l + 5, X - 1), U(t, l + 10, z - 4), l += 14;
245
- for (var u = 0; u < z; ++u)
246
- U(t, l + 3 * u, k[Ie[u]]);
247
- l += 3 * z;
248
- for (var B = [F, O], K = 0; K < 2; ++K)
249
- for (var Y = B[K], u = 0; u < Y.length; ++u) {
250
- var j = Y[u] & 31;
251
- U(t, l, fe[j]), l += k[j], j > 15 && (U(t, l, Y[u] >> 5 & 127), l += Y[u] >> 12);
252
- }
253
- } else
254
- D = vt, T = V, N = wt, H = oe;
255
- for (var u = 0; u < f; ++u) {
256
- var $ = n[u];
257
- if ($ > 255) {
258
- var j = $ >> 18 & 31;
259
- Q(t, l, D[j + 257]), l += T[j + 257], j > 7 && (U(t, l, $ >> 23 & 31), l += xe[j]);
260
- var q = $ & 31;
261
- Q(t, l, N[q]), l += H[q], q > 3 && (Q(t, l, $ >> 5 & 8191), l += de[q]);
262
- } else
263
- Q(t, l, D[$]), l += T[$];
264
- }
265
- return Q(t, l, D[256]), l + T[256];
266
- }, pt = /* @__PURE__ */ new pe([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), ae = /* @__PURE__ */ new E(0), xt = function(e, t, r, n, s, o) {
267
- var a = o.z || e.length, f = new E(n + a + 5 * (1 + Math.ceil(a / 7e3)) + s), i = f.subarray(n, f.length - s), h = o.l, l = (o.r || 0) & 7;
268
- if (t) {
269
- l && (i[0] = o.r >> 3);
270
- for (var g = pt[t - 1], m = g >> 13, p = g & 8191, x = (1 << r) - 1, w = o.p || new I(32768), d = o.h || new I(x + 1), b = Math.ceil(r / 3), F = 2 * b, R = function(ue) {
271
- return (e[ue] ^ e[ue + 1] << b ^ e[ue + 2] << F) & x;
272
- }, M = new pe(25e3), O = new I(288), X = new I(32), C = 0, u = 0, c = o.i || 0, k = 0, Z = o.w || 0, z = 0; c + 2 < a; ++c) {
273
- var W = R(c), L = c & 32767, _ = d[W];
274
- if (w[L] = _, d[W] = L, Z <= c) {
275
- var D = a - c;
276
- if ((C > 7e3 || k > 24576) && (D > 423 || !h)) {
277
- l = Me(e, i, 0, M, O, X, u, k, z, c - z, l), k = C = u = 0, z = c;
278
- for (var T = 0; T < 286; ++T)
279
- O[T] = 0;
280
- for (var T = 0; T < 30; ++T)
281
- X[T] = 0;
282
- }
283
- var N = 2, H = 0, fe = p, B = L - _ & 32767;
284
- if (D > 2 && W == R(c - B))
285
- for (var K = Math.min(m, D) - 1, Y = Math.min(32767, c), j = Math.min(258, D); B <= Y && --fe && L != _; ) {
286
- if (e[c + N] == e[c + N - B]) {
287
- for (var $ = 0; $ < j && e[c + $] == e[c + $ - B]; ++$)
288
- ;
289
- if ($ > N) {
290
- if (N = $, H = B, $ > K)
291
- break;
292
- for (var q = Math.min(B, $ - 2), Ce = 0, T = 0; T < q; ++T) {
293
- var he = c - B + T & 32767, it = w[he], Re = he - it & 32767;
294
- Re > Ce && (Ce = Re, _ = he);
295
- }
296
- }
297
- }
298
- L = _, _ = w[L], B += L - _ & 32767;
299
- }
300
- if (H) {
301
- M[k++] = 268435456 | ve[N] << 18 | Oe[H];
302
- var ke = ve[N] & 31, ze = Oe[H] & 31;
303
- u += xe[ke] + de[ze], ++O[257 + ke], ++X[ze], Z = c + N, ++C;
304
- } else
305
- M[k++] = e[c], ++O[e[c]];
306
- }
307
- }
308
- for (c = Math.max(c, Z); c < a; ++c)
309
- M[k++] = e[c], ++O[e[c]];
310
- l = Me(e, i, h, M, O, X, u, k, z, c - z, l), h || (o.r = l & 7 | i[l / 8 | 0] << 3, l -= 7, o.h = d, o.p = w, o.i = c, o.w = Z);
311
- } else {
312
- for (var c = o.w || 0; c < a + h; c += 65535) {
313
- var ce = c + 65535;
314
- ce >= a && (i[l / 8 | 0] = h, ce = a), l = ye(i, l + 1, e.subarray(c, ce));
315
- }
316
- o.i = a;
317
- }
318
- return Ve(f, 0, n + Je(l) + s);
319
- }, dt = /* @__PURE__ */ function() {
320
- for (var e = new Int32Array(256), t = 0; t < 256; ++t) {
321
- for (var r = t, n = 9; --n; )
322
- r = (r & 1 && -306674912) ^ r >>> 1;
323
- e[t] = r;
324
- }
325
- return e;
326
- }(), yt = function() {
327
- var e = -1;
328
- return {
329
- p: function(t) {
330
- for (var r = e, n = 0; n < t.length; ++n)
331
- r = dt[r & 255 ^ t[n]] ^ r >>> 8;
332
- e = r;
333
- },
334
- d: function() {
335
- return ~e;
336
- }
337
- };
338
- }, Et = function(e, t, r, n, s) {
339
- if (!s && (s = { l: 1 }, t.dictionary)) {
340
- var o = t.dictionary.subarray(-32768), a = new E(o.length + e.length);
341
- a.set(o), a.set(e, o.length), e = a, s.w = o.length;
342
- }
343
- return xt(e, t.level == null ? 6 : t.level, t.mem == null ? s.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(e.length))) * 1.5) : 20 : 12 + t.mem, r, n, s);
344
- }, St = function(e, t) {
345
- var r = {};
346
- for (var n in e)
347
- r[n] = e[n];
348
- for (var n in t)
349
- r[n] = t[n];
350
- return r;
351
- }, y = function(e, t, r) {
352
- for (; r; ++t)
353
- e[t] = r, r >>>= 8;
354
- }, Tt = /* @__PURE__ */ function() {
355
- function e(t, r) {
356
- if (typeof t == "function" && (r = t, t = {}), this.ondata = r, this.o = t || {}, this.s = { l: 0, i: 32768, w: 32768, z: 32768 }, this.b = new E(98304), this.o.dictionary) {
357
- var n = this.o.dictionary.subarray(-32768);
358
- this.b.set(n, 32768 - n.length), this.s.i = 32768 - n.length;
359
- }
360
- }
361
- return e.prototype.p = function(t, r) {
362
- this.ondata(Et(t, this.o, 0, 0, this.s), r);
363
- }, e.prototype.push = function(t, r) {
364
- this.ondata || A(5), this.s.l && A(4);
365
- var n = t.length + this.s.z;
366
- if (n > this.b.length) {
367
- if (n > 2 * this.b.length - 32768) {
368
- var s = new E(n & -32768);
369
- s.set(this.b.subarray(0, this.s.z)), this.b = s;
370
- }
371
- var o = this.b.length - this.s.z;
372
- this.b.set(t.subarray(0, o), this.s.z), this.s.z = this.b.length, this.p(this.b, !1), this.b.set(this.b.subarray(-32768)), this.b.set(t.subarray(o), 32768), this.s.z = t.length - o + 32768, this.s.i = 32766, this.s.w = 32768;
373
- } else
374
- this.b.set(t, this.s.z), this.s.z += t.length;
375
- this.s.l = r & 1, (this.s.z > this.s.w + 8191 || r) && (this.p(this.b, r || !1), this.s.w = this.s.i, this.s.i -= 2), r && (this.s = this.o = {}, this.b = ae);
376
- }, e.prototype.flush = function(t) {
377
- if (this.ondata || A(5), this.s.l && A(4), this.p(this.b, !1), this.s.w = this.s.i, this.s.i -= 2, t) {
378
- var r = new E(6);
379
- r[0] = this.s.r >> 3;
380
- var n = ye(r, this.s.r, ae);
381
- this.s.r = 0, this.ondata(r.subarray(0, n >> 3), !1);
382
- }
383
- }, e;
384
- }(), Xe = typeof TextEncoder < "u" && /* @__PURE__ */ new TextEncoder(), $t = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), bt = 0;
385
- try {
386
- $t.decode(ae, { stream: !0 }), bt = 1;
387
- } catch {
388
- }
389
- function P(e, t) {
390
- var r;
391
- if (Xe)
392
- return Xe.encode(e);
393
- for (var n = e.length, s = new E(e.length + (e.length >> 1)), o = 0, a = function(h) {
394
- s[o++] = h;
395
- }, r = 0; r < n; ++r) {
396
- if (o + 5 > s.length) {
397
- var f = new E(o + 8 + (n - r << 1));
398
- f.set(s), s = f;
399
- }
400
- var i = e.charCodeAt(r);
401
- i < 128 || t ? a(i) : i < 2048 ? (a(192 | i >> 6), a(128 | i & 63)) : i > 55295 && i < 57344 ? (i = 65536 + (i & 1047552) | e.charCodeAt(++r) & 1023, a(240 | i >> 18), a(128 | i >> 12 & 63), a(128 | i >> 6 & 63), a(128 | i & 63)) : (a(224 | i >> 12), a(128 | i >> 6 & 63), a(128 | i & 63));
402
- }
403
- return Ve(s, 0, o);
404
- }
405
- var Ft = function(e) {
406
- return e == 1 ? 3 : e < 6 ? 2 : e == 9 ? 1 : 0;
407
- }, se = function(e) {
408
- var t = 0;
409
- if (e)
410
- for (var r in e) {
411
- var n = e[r].length;
412
- n > 65535 && A(9), t += n + 4;
413
- }
414
- return t;
415
- }, Le = function(e, t, r, n, s, o, a, f) {
416
- var i = n.length, h = r.extra, l = f && f.length, g = se(h);
417
- y(e, t, a != null ? 33639248 : 67324752), t += 4, a != null && (e[t++] = 20, e[t++] = r.os), e[t] = 20, t += 2, e[t++] = r.flag << 1 | (o < 0 && 8), e[t++] = s && 8, e[t++] = r.compression & 255, e[t++] = r.compression >> 8;
418
- var m = new Date(r.mtime == null ? Date.now() : r.mtime), p = m.getFullYear() - 1980;
419
- if ((p < 0 || p > 119) && A(10), y(e, t, p << 25 | m.getMonth() + 1 << 21 | m.getDate() << 16 | m.getHours() << 11 | m.getMinutes() << 5 | m.getSeconds() >> 1), t += 4, o != -1 && (y(e, t, r.crc), y(e, t + 4, o < 0 ? -o - 2 : o), y(e, t + 8, r.size)), y(e, t + 12, i), y(e, t + 14, g), t += 16, a != null && (y(e, t, l), y(e, t + 6, r.attrs), y(e, t + 10, a), t += 14), e.set(n, t), t += i, g)
420
- for (var x in h) {
421
- var w = h[x], d = w.length;
422
- y(e, t, +x), y(e, t + 2, d), e.set(w, t + 4), t += 4 + d;
423
- }
424
- return l && (e.set(f, t), t += l), t;
425
- }, Ct = function(e, t, r, n, s) {
426
- y(e, t, 101010256), y(e, t + 8, r), y(e, t + 10, r), y(e, t + 12, n), y(e, t + 16, s);
427
- }, _e = /* @__PURE__ */ function() {
428
- function e(t) {
429
- this.filename = t, this.c = yt(), this.size = 0, this.compression = 0;
430
- }
431
- return e.prototype.process = function(t, r) {
432
- this.ondata(null, t, r);
433
- }, e.prototype.push = function(t, r) {
434
- this.ondata || A(5), this.c.p(t), this.size += t.length, r && (this.crc = this.c.d()), this.process(t, r || !1);
435
- }, e;
436
- }(), Rt = /* @__PURE__ */ function() {
437
- function e(t, r) {
438
- var n = this;
439
- r || (r = {}), _e.call(this, t), this.d = new Tt(r, function(s, o) {
440
- n.ondata(null, s, o);
441
- }), this.compression = 8, this.flag = Ft(r.level);
442
- }
443
- return e.prototype.process = function(t, r) {
444
- try {
445
- this.d.push(t, r);
446
- } catch (n) {
447
- this.ondata(n, null, r);
448
- }
449
- }, e.prototype.push = function(t, r) {
450
- _e.prototype.push.call(this, t, r);
451
- }, e;
452
- }(), kt = /* @__PURE__ */ function() {
453
- function e(t) {
454
- this.ondata = t, this.u = [], this.d = 1;
455
- }
456
- return e.prototype.add = function(t) {
457
- var r = this;
458
- if (this.ondata || A(5), this.d & 2)
459
- this.ondata(A(4 + (this.d & 1) * 8, 0, 1), null, !1);
460
- else {
461
- var n = P(t.filename), s = n.length, o = t.comment, a = o && P(o), f = s != t.filename.length || a && o.length != a.length, i = s + se(t.extra) + 30;
462
- s > 65535 && this.ondata(A(11, 0, 1), null, !1);
463
- var h = new E(i);
464
- Le(h, 0, t, n, f, -1);
465
- var l = [h], g = function() {
466
- for (var d = 0, b = l; d < b.length; d++) {
467
- var F = b[d];
468
- r.ondata(null, F, !1);
469
- }
470
- l = [];
471
- }, m = this.d;
472
- this.d = 0;
473
- var p = this.u.length, x = St(t, {
474
- f: n,
475
- u: f,
476
- o: a,
477
- t: function() {
478
- t.terminate && t.terminate();
479
- },
480
- r: function() {
481
- if (g(), m) {
482
- var d = r.u[p + 1];
483
- d ? d.r() : r.d = 1;
484
- }
485
- m = 1;
486
- }
487
- }), w = 0;
488
- t.ondata = function(d, b, F) {
489
- if (d)
490
- r.ondata(d, b, F), r.terminate();
491
- else if (w += b.length, l.push(b), F) {
492
- var R = new E(16);
493
- y(R, 0, 134695760), y(R, 4, t.crc), y(R, 8, w), y(R, 12, t.size), l.push(R), x.c = w, x.b = i + w + 16, x.crc = t.crc, x.size = t.size, m && x.r(), m = 1;
494
- } else m && g();
495
- }, this.u.push(x);
496
- }
497
- }, e.prototype.end = function() {
498
- var t = this;
499
- if (this.d & 2) {
500
- this.ondata(A(4 + (this.d & 1) * 8, 0, 1), null, !0);
501
- return;
502
- }
503
- this.d ? this.e() : this.u.push({
504
- r: function() {
505
- t.d & 1 && (t.u.splice(-1, 1), t.e());
506
- },
507
- t: function() {
508
- }
509
- }), this.d = 3;
510
- }, e.prototype.e = function() {
511
- for (var t = 0, r = 0, n = 0, s = 0, o = this.u; s < o.length; s++) {
512
- var a = o[s];
513
- n += 46 + a.f.length + se(a.extra) + (a.o ? a.o.length : 0);
514
- }
515
- for (var f = new E(n + 22), i = 0, h = this.u; i < h.length; i++) {
516
- var a = h[i];
517
- Le(f, t, a, a.f, a.u, -a.c - 2, r, a.o), t += 46 + a.f.length + se(a.extra) + (a.o ? a.o.length : 0), r += a.b;
518
- }
519
- Ct(f, t, this.u.length, n, r), this.ondata(null, f, !0), this.d = 2;
520
- }, e.prototype.terminate = function() {
521
- for (var t = 0, r = this.u; t < r.length; t++) {
522
- var n = r[t];
523
- n.t();
524
- }
525
- this.d = 2;
526
- }, e;
527
- }();
528
- const Ne = 1048576, De = 4 * 1024 ** 3 - 64 * 1024 ** 2, Be = 16384, zt = 32767, It = 31, Ot = 164, At = 6, Mt = new Date(1980, 0, 1), Ee = "http://schemas.openxmlformats.org/spreadsheetml/2006/main", re = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", G = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
529
- `;
530
- class ie extends Error {
531
- constructor(r, n, s) {
532
- super(
533
- r === "size" ? "This export is larger than an Excel file can hold (4 GB of sheet data). Export as CSV instead." : `This export has ${n.toLocaleString("en-US")} ${r}, more than Excel can hold (${s.toLocaleString("en-US")}). Export as CSV instead.`
534
- );
535
- /** `size` counts sheet XML bytes. */
536
- ne(this, "limit");
537
- ne(this, "actual");
538
- ne(this, "max");
539
- this.name = "XlsxLimitError", this.limit = r, this.actual = n, this.max = s;
540
- }
541
- }
542
- const gr = ["excel_row_limit", "excel_column_limit", "excel_size_limit"];
543
- function pr(e) {
544
- return e.limit === "rows" ? "excel_row_limit" : e.limit === "columns" ? "excel_column_limit" : "excel_size_limit";
545
- }
546
- function Se(e) {
547
- if (e > Be) throw new ie("columns", e, Be);
548
- }
549
- function xr(e) {
550
- if (e instanceof ie) return !0;
551
- if (!(e instanceof Error) || e.name !== "XlsxLimitError") return !1;
552
- const t = e;
553
- return (t.limit === "rows" || t.limit === "columns" || t.limit === "size") && typeof t.actual == "number" && typeof t.max == "number";
554
- }
555
- const Ze = "[\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\uD800-\\uDFFF\\uFFFE\\uFFFF]", Xt = new RegExp(Ze), Lt = new RegExp(`([\\uD800-\\uDBFF][\\uDC00-\\uDFFF])|${Ze}`, "g");
556
- function We(e, t) {
557
- if (e.length <= t) return e;
558
- const r = e.charCodeAt(t - 1);
559
- return e.slice(0, r >= 55296 && r <= 56319 ? t - 1 : t);
560
- }
561
- function Ye(e) {
562
- const t = Xt.test(e) ? e.replace(Lt, (r, n) => n ?? "") : e;
563
- return We(t, zt);
564
- }
565
- const _t = /[&<>"\r]|_(?=x[0-9A-Fa-f]{4}_)/, Nt = /[&<>"\r]|_(?=x[0-9A-Fa-f]{4}_)/g, Dt = {
566
- "&": "&amp;",
567
- "<": "&lt;",
568
- ">": "&gt;",
569
- '"': "&quot;",
570
- "\r": "&#13;"
571
- };
572
- function Te(e) {
573
- return _t.test(e) ? e.replace(Nt, (t) => Dt[t] ?? "_x005F_") : e;
574
- }
575
- function qe(e) {
576
- return We(Ye(e).replace(/[[\]:*?/\\]/g, "").trim(), It).trim().replace(/^'+|'+$/g, "").trim() || "Sheet1";
577
- }
578
- function Bt(e) {
579
- const t = e.reduce((r, n) => Math.max(r, n.length), 0);
580
- return Math.min(60, Math.max(8, t) + 2);
581
- }
582
- function Ge(e) {
583
- const t = e.columns.length;
584
- if (e.headerRows.forEach((n, s) => {
585
- if (n.length !== t)
586
- throw new TypeError(
587
- `Header row ${s} has ${n.length} cells; the sheet has ${t} columns.`
588
- );
589
- }), e.widths.length !== t)
590
- throw new TypeError(`The sheet has ${e.widths.length} widths for ${t} columns.`);
591
- const r = /* @__PURE__ */ new Set();
592
- for (const n of e.merges) {
593
- const { row: s, firstColumn: o, lastColumn: a } = n;
594
- if (!([s, o, a].every(Number.isInteger) && s >= 0 && s < e.headerRows.length && o >= 0 && o < a && a < t)) throw new TypeError(`Invalid header merge ${JSON.stringify(n)}.`);
595
- for (let i = o; i <= a; i += 1) {
596
- const h = `${s}:${i}`;
597
- if (r.has(h)) throw new TypeError(`Overlapping header merge ${JSON.stringify(n)}.`);
598
- r.add(h);
599
- }
600
- }
601
- }
602
- function $e(e) {
603
- return Object.freeze({
604
- name: e.name,
605
- columns: Object.freeze(e.columns.map((t) => Object.freeze({ ...t }))),
606
- headerRows: Object.freeze(e.headerRows.map((t) => Object.freeze([...t]))),
607
- merges: Object.freeze(e.merges.map((t) => Object.freeze({ ...t }))),
608
- widths: Object.freeze([...e.widths])
609
- });
610
- }
611
- function jt(e) {
612
- Se(e.columns.length);
613
- const t = e.columns.map(
614
- (n, s) => Bt([
615
- ...e.headerRows.map((o) => o[s] ?? ""),
616
- ...(e.sampleRows ?? []).map(
617
- (o) => o[s] ? ct(o[s]) : ""
618
- )
619
- ])
620
- ), r = {
621
- name: qe(e.title),
622
- columns: e.columns,
623
- headerRows: e.headerRows,
624
- merges: e.merges ?? [],
625
- widths: t
626
- };
627
- return Ge(r), $e(r);
628
- }
629
- let Pt;
630
- function Ut() {
631
- return S.object({
632
- name: S.string(),
633
- columns: S.array(
634
- S.object({
635
- key: S.string(),
636
- label: S.string(),
637
- cellType: S.enum(["number", "date", "boolean", "text", "by_value"]),
638
- numberFormat: S.string().optional()
639
- }).strict()
640
- ),
641
- headerRows: S.array(S.array(S.string())),
642
- merges: S.array(
643
- S.object({
644
- row: S.number().int(),
645
- firstColumn: S.number().int(),
646
- lastColumn: S.number().int()
647
- }).strict()
648
- ),
649
- widths: S.array(S.number().positive())
650
- }).strict();
651
- }
652
- const Ke = () => Pt ?? (Pt = Ut());
653
- function dr(e) {
654
- return JSON.stringify({
655
- name: e.name,
656
- columns: e.columns,
657
- headerRows: e.headerRows,
658
- merges: e.merges,
659
- widths: e.widths
660
- });
661
- }
662
- function Ht(e, t) {
663
- if (t.length !== e.columns.length)
664
- throw new TypeError(`The sheet has ${e.columns.length} columns; ${t.length} were given.`);
665
- return $e({ ...e, columns: [...t] });
666
- }
667
- function yr(e) {
668
- return JSON.stringify(e);
669
- }
670
- function Jt(e) {
671
- const t = Ke().shape.columns.parse(e);
672
- return Se(t.length), t;
673
- }
674
- function Er(e) {
675
- const t = Ke().parse(JSON.parse(e));
676
- if (Se(t.columns.length), qe(t.name) !== t.name)
677
- throw new TypeError(`Invalid sheet name ${JSON.stringify(t.name)}.`);
678
- return Ge(t), $e(t);
679
- }
680
- function Vt(e) {
681
- let t = 2166136261, r = -1623754710;
682
- for (let s = 0; s < e.length; s += 1) {
683
- const o = e.charCodeAt(s);
684
- t = Math.imul(t ^ o, 16777619), r = Math.imul(r ^ o, 1540483477);
685
- }
686
- const n = (s) => (s >>> 0).toString(16).padStart(8, "0");
687
- return n(t) + n(r);
688
- }
689
- function le(e) {
690
- return Vt(
691
- JSON.stringify(
692
- e.map((t) => [
693
- t.key,
694
- t.label,
695
- t.cellType,
696
- t.numberFormat ?? null
697
- ])
698
- )
699
- );
700
- }
701
- const je = 1, Zt = (e) => 2 + 2 * e, Wt = (e) => 3 + 2 * e;
702
- function Pe(e) {
703
- let t = "";
704
- for (let r = e + 1; r > 0; r = Math.floor((r - 1) / 26))
705
- t = String.fromCharCode(65 + (r - 1) % 26) + t;
706
- return t;
707
- }
708
- function Qe(e, t) {
709
- return `<c s="${e}" t="inlineStr"><is><t xml:space="preserve">${Te(Ye(t))}</t></is></c>`;
710
- }
711
- function Yt(e) {
712
- return typeof e == "number" ? String(e) : typeof e == "string" ? e : e.value;
713
- }
714
- function qt(e, t) {
715
- switch (t.kind) {
716
- case "empty":
717
- return `<c s="${e}"/>`;
718
- case "text":
719
- return Qe(e, t.text);
720
- case "number":
721
- return `<c s="${e}"><v>${Yt(t.value)}</v></c>`;
722
- case "date":
723
- return `<c s="${e}"><v>${t.serial}</v></c>`;
724
- case "boolean":
725
- return `<c s="${e}" t="b"><v>${t.value ? 1 : 0}</v></c>`;
726
- }
727
- }
728
- function Gt(e) {
729
- return `<row>${e.map(
730
- (r) => r === "" ? `<c s="${je}"/>` : Qe(je, r)
731
- ).join("")}</row>`;
732
- }
733
- function et(e, t) {
734
- const r = e.columns.length, n = [];
735
- let s = 0;
736
- for (const o of t) {
737
- if (o.cells.length !== r)
738
- throw new TypeError(`A row has ${o.cells.length} cells; the sheet has ${r} columns.`);
739
- const a = o.role === "total" ? Wt : Zt;
740
- let f = "<row>";
741
- for (let i = 0; i < r; i += 1)
742
- f += qt(a(i), o.cells[i]);
743
- n.push(`${f}</row>`), s += 1;
744
- }
745
- return { xml: n.join(""), count: s };
746
- }
747
- function Sr(e, t) {
748
- return et(e, t).xml;
749
- }
750
- function be(e) {
751
- const t = e.headerRows.length, r = t === 0 ? "" : `<sheetViews><sheetView workbookViewId="0"><pane ySplit="${t}" topLeftCell="A${t + 1}" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft"/></sheetView></sheetViews>`, n = e.widths.length === 0 ? "" : `<cols>${e.widths.map((s, o) => `<col min="${o + 1}" max="${o + 1}" width="${s}" customWidth="1"/>`).join("")}</cols>`;
752
- return `${G}<worksheet xmlns="${Ee}" xmlns:r="${re}">${r}${n}<sheetData>${e.headerRows.map(Gt).join("")}`;
753
- }
754
- function tt(e) {
755
- return `</sheetData>${e.merges.length === 0 ? "" : `<mergeCells count="${e.merges.length}">${e.merges.map(
756
- ({ row: r, firstColumn: n, lastColumn: s }) => `<mergeCell ref="${Pe(n)}${r + 1}:${Pe(s)}${r + 1}"/>`
757
- ).join("")}</mergeCells>`}</worksheet>`;
758
- }
759
- function Kt(e) {
760
- const t = /* @__PURE__ */ new Map();
761
- for (const r of e.columns)
762
- r.numberFormat !== void 0 && !t.has(r.numberFormat) && t.set(r.numberFormat, Ot + t.size);
763
- return t;
764
- }
765
- function Qt(e) {
766
- const t = Kt(e), r = t.size === 0 ? "" : `<numFmts count="${t.size}">${[...t].map(([a, f]) => `<numFmt numFmtId="${f}" formatCode="${Te(a)}"/>`).join("")}</numFmts>`, n = (a, f) => `<xf numFmtId="${a}" fontId="${f ? 1 : 0}" fillId="0" borderId="0" xfId="0"${a === 0 ? "" : ' applyNumberFormat="1"'}${f ? ' applyFont="1"' : ""}/>`, s = [n(0, !1), n(0, !0)];
767
- for (const a of e.columns) {
768
- const f = a.numberFormat === void 0 ? 0 : t.get(a.numberFormat) ?? 0;
769
- s.push(n(f, !1), n(f, !0));
770
- }
771
- const o = (a) => `<font>${a ? "<b/>" : ""}<sz val="11"/><name val="Calibri"/><family val="2"/></font>`;
772
- return `${G}<styleSheet xmlns="${Ee}">${r}<fonts count="2">${o(!1)}${o(!0)}</fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${s.length}">${s.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`;
773
- }
774
- const er = `${G}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>`, tr = `${G}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${re}/officeDocument" Target="xl/workbook.xml"/></Relationships>`, rr = `${G}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${re}/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="${re}/styles" Target="styles.xml"/></Relationships>`;
775
- function nr(e) {
776
- return `${G}<workbook xmlns="${Ee}" xmlns:r="${re}"><sheets><sheet name="${Te(e.name)}" sheetId="1" r:id="rId1"/></sheets></workbook>`;
777
- }
778
- function rt(e, t) {
779
- const r = e.headerRows.length + t;
780
- if (r > Ne) throw new ie("rows", r, Ne);
781
- }
782
- function nt(e) {
783
- return P(be(e)).length + P(tt(e)).length;
784
- }
785
- function Fe(e) {
786
- if (e > De) throw new ie("size", e, De);
787
- }
788
- function st(e) {
789
- const t = [], r = new kt((h, l) => {
790
- if (h) throw h;
791
- t.push(l);
792
- }), n = () => t.splice(0, t.length), s = (h) => {
793
- const l = new Rt(h, { level: At });
794
- return l.mtime = Mt, r.add(l), l;
795
- };
796
- let o, a = 0;
797
- const f = (h, l = !1) => {
798
- a += h.length, Fe(a), i().push(h, l);
799
- }, i = () => {
800
- if (!o) throw new Error("The workbook was not started.");
801
- return o;
802
- };
803
- return {
804
- start() {
805
- for (const [h, l] of [
806
- ["[Content_Types].xml", er],
807
- ["_rels/.rels", tr],
808
- ["xl/workbook.xml", nr(e)],
809
- ["xl/_rels/workbook.xml.rels", rr],
810
- ["xl/styles.xml", Qt(e)]
811
- ])
812
- s(h).push(P(l), !0);
813
- return o = s("xl/worksheets/sheet1.xml"), f(P(be(e))), n();
814
- },
815
- push(h) {
816
- const l = typeof h == "string" ? P(h) : h;
817
- return l.length > 0 && f(l), n();
818
- },
819
- finish() {
820
- return f(P(tt(e)), !0), r.end(), n();
821
- },
822
- /** Sheet XML bytes written so far. */
823
- sheetBytes: () => a
824
- };
825
- }
826
- function sr(e) {
827
- const t = new Uint8Array(e.reduce((n, s) => n + s.length, 0));
828
- let r = 0;
829
- for (const n of e)
830
- t.set(n, r), r += n.length;
831
- return t;
832
- }
833
- function or(e, t) {
834
- const { xml: r, count: n } = et(e, t);
835
- rt(e, n);
836
- const s = P(r);
837
- Fe(nt(e) + s.length);
838
- const o = st(e);
839
- return sr([...o.start(), ...o.push(s), ...o.finish()]);
840
- }
841
- async function* ar(e, t, r) {
842
- const n = st(e);
843
- yield* n.start();
844
- for await (const o of t) yield* n.push(o);
845
- const s = n.sheetBytes() - P(be(e)).length;
846
- if (s !== r)
847
- throw new TypeError(`The fragments held ${s} bytes; fragmentBytes said ${r}.`);
848
- yield* n.finish();
849
- }
850
- function Tr(e) {
851
- return rt(e.sheet, e.rowCount), Fe(nt(e.sheet) + e.fragmentBytes), ar(e.sheet, e.fragments, e.fragmentBytes);
852
- }
853
- const ot = 200;
854
- function at(e, t) {
855
- return jt({
856
- title: e ?? "",
857
- columns: t.columns.map((r) => r.xlsx),
858
- headerRows: t.header ? [t.header] : [],
859
- sampleRows: t.rows.slice(0, ot)
860
- });
861
- }
862
- function lt(e, t) {
863
- return [
864
- ...e.map((r) => ({ role: "body", cells: r })),
865
- ...t ? [{ role: "total", cells: t }] : []
866
- ];
867
- }
868
- function lr(e, t, r) {
869
- return or(
870
- at(e, t),
871
- lt(t.rows, r)
872
- );
873
- }
874
- function ir(e) {
875
- return {
876
- columns: e.columns.map((t) => t.xlsx),
877
- pending: e.columns.map((t) => t.xlsxPending === !0)
878
- };
879
- }
880
- function fr(e) {
881
- return JSON.stringify({ columns: e.columns, pending: e.pending });
882
- }
883
- function hr(e) {
884
- const t = JSON.parse(e);
885
- if (!t || typeof t != "object" || Array.isArray(t))
886
- throw new TypeError("Invalid Excel chunk columns.");
887
- const { columns: r, pending: n } = t, s = Jt(r);
888
- if (!Array.isArray(n) || n.length !== s.length || n.some((o) => typeof o != "boolean"))
889
- throw new TypeError("Invalid Excel chunk columns: one pending flag per column is required.");
890
- return { columns: s, pending: n };
891
- }
892
- const cr = (e, t) => le([e]) === le([t]);
893
- function ur(e, t) {
894
- const [r] = t;
895
- if (!r || le(r.columns) !== le(e.columns))
896
- throw new Error("The Excel sheet does not match the first chunk.");
897
- if (t.some((s) => s.columns.length !== e.columns.length))
898
- throw new Error("Chunks wrote different Excel columns.");
899
- const n = e.columns.map((s, o) => {
900
- const a = [];
901
- for (const f of t) {
902
- const i = f.columns[o];
903
- if (i.key !== s.key || i.label !== s.label)
904
- throw new Error("Chunks wrote different Excel columns.");
905
- f.pending[o] || a.push(i);
906
- }
907
- if (a.some((f) => !cr(f, a[0])))
908
- throw new Error(`Chunks wrote different Excel types for column "${s.key}".`);
909
- return a[0] ?? s;
910
- });
911
- return Ht(e, n);
912
- }
913
- const $r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
914
- __proto__: null,
915
- TABLE_EXPORT_SHEET_SAMPLE_ROWS: ot,
916
- defineTableExportSheet: at,
917
- encodeTableExportWorkbook: lr,
918
- parseTableExportSheetColumns: hr,
919
- serializeTableExportSheetColumns: fr,
920
- tableExportJobSheet: ur,
921
- tableExportSheetColumns: ir,
922
- tableExportXlsxRows: lt
923
- }, Symbol.toStringTag, { value: "Module" }));
924
- export {
925
- ot as T,
926
- ie as X,
927
- gr as a,
928
- Se as b,
929
- yr as c,
930
- jt as d,
931
- Jt as e,
932
- le as f,
933
- or as g,
934
- Sr as h,
935
- xr as i,
936
- Tr as j,
937
- at as k,
938
- lr as l,
939
- ir as m,
940
- fr as n,
941
- hr as o,
942
- Er as p,
943
- ur as q,
944
- $r as r,
945
- dr as s,
946
- lt as t,
947
- Ht as w,
948
- pr as x
949
- };