@paperjsx/json-to-xlsx-pro 0.0.1

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 (175) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +61 -0
  3. package/dist/assembly/xlsx-assembler.d.ts +53 -0
  4. package/dist/assembly/xlsx-assembler.d.ts.map +1 -0
  5. package/dist/benchmarks/phase2.d.ts +72 -0
  6. package/dist/benchmarks/phase2.d.ts.map +1 -0
  7. package/dist/benchmarks/phase2.js +14 -0
  8. package/dist/benchmarks/phase2.js.map +7 -0
  9. package/dist/benchmarks/report.d.ts +21 -0
  10. package/dist/benchmarks/report.d.ts.map +1 -0
  11. package/dist/benchmarks/report.js +13 -0
  12. package/dist/benchmarks/report.js.map +7 -0
  13. package/dist/benchmarks/rigorous.d.ts +85 -0
  14. package/dist/benchmarks/rigorous.d.ts.map +1 -0
  15. package/dist/benchmarks/rigorous.js +534 -0
  16. package/dist/benchmarks/rigorous.js.map +7 -0
  17. package/dist/chaos-lab/index.d.ts +69 -0
  18. package/dist/chaos-lab/index.d.ts.map +1 -0
  19. package/dist/chaos-lab/index.js +1696 -0
  20. package/dist/chaos-lab/index.js.map +7 -0
  21. package/dist/chunk-2IVXCH6I.js +1002 -0
  22. package/dist/chunk-2IVXCH6I.js.map +7 -0
  23. package/dist/chunk-IYMS2CLX.js +478 -0
  24. package/dist/chunk-IYMS2CLX.js.map +7 -0
  25. package/dist/chunk-PQSLPEN5.js +290 -0
  26. package/dist/chunk-PQSLPEN5.js.map +7 -0
  27. package/dist/chunk-QDWDSM74.js +142 -0
  28. package/dist/chunk-QDWDSM74.js.map +7 -0
  29. package/dist/chunk-S5RMAWLC.js +25347 -0
  30. package/dist/chunk-S5RMAWLC.js.map +7 -0
  31. package/dist/chunk-Z2JSZFNG.js +308 -0
  32. package/dist/chunk-Z2JSZFNG.js.map +7 -0
  33. package/dist/diagnostics/corruption.d.ts +9 -0
  34. package/dist/diagnostics/corruption.d.ts.map +1 -0
  35. package/dist/diagnostics/workloads.d.ts +6 -0
  36. package/dist/diagnostics/workloads.d.ts.map +1 -0
  37. package/dist/diff/document-diff.d.ts +5 -0
  38. package/dist/diff/document-diff.d.ts.map +1 -0
  39. package/dist/document-diff/src/index.d.ts +50 -0
  40. package/dist/document-diff/src/index.d.ts.map +1 -0
  41. package/dist/errors.d.ts +35 -0
  42. package/dist/errors.d.ts.map +1 -0
  43. package/dist/fixtures/phase1.d.ts +14 -0
  44. package/dist/fixtures/phase1.d.ts.map +1 -0
  45. package/dist/fixtures/phase2.d.ts +9 -0
  46. package/dist/fixtures/phase2.d.ts.map +1 -0
  47. package/dist/fixtures/phase3.d.ts +9 -0
  48. package/dist/fixtures/phase3.d.ts.map +1 -0
  49. package/dist/fixtures/phase4.d.ts +10 -0
  50. package/dist/fixtures/phase4.d.ts.map +1 -0
  51. package/dist/fixtures/phase5.d.ts +9 -0
  52. package/dist/fixtures/phase5.d.ts.map +1 -0
  53. package/dist/formulas/builder.d.ts +91 -0
  54. package/dist/formulas/builder.d.ts.map +1 -0
  55. package/dist/formulas/evaluator.d.ts +25 -0
  56. package/dist/formulas/evaluator.d.ts.map +1 -0
  57. package/dist/formulas/shift.d.ts +14 -0
  58. package/dist/formulas/shift.d.ts.map +1 -0
  59. package/dist/index-pro.d.ts +12 -0
  60. package/dist/index-pro.d.ts.map +1 -0
  61. package/dist/index.d.ts +41 -0
  62. package/dist/index.d.ts.map +1 -0
  63. package/dist/index.js +2167 -0
  64. package/dist/index.js.map +7 -0
  65. package/dist/layout/column-width.d.ts +32 -0
  66. package/dist/layout/column-width.d.ts.map +1 -0
  67. package/dist/layout/row-height.d.ts +3 -0
  68. package/dist/layout/row-height.d.ts.map +1 -0
  69. package/dist/preflight.d.ts +31 -0
  70. package/dist/preflight.d.ts.map +1 -0
  71. package/dist/public-quality-types.d.ts +44 -0
  72. package/dist/public-quality-types.d.ts.map +1 -0
  73. package/dist/quality/accessibility-contract.d.ts +38 -0
  74. package/dist/quality/accessibility-contract.d.ts.map +1 -0
  75. package/dist/quality/accessibility.d.ts +33 -0
  76. package/dist/quality/accessibility.d.ts.map +1 -0
  77. package/dist/quality/shared-quality.d.ts +4 -0
  78. package/dist/quality/shared-quality.d.ts.map +1 -0
  79. package/dist/quality/structural-validation.d.ts +11 -0
  80. package/dist/quality/structural-validation.d.ts.map +1 -0
  81. package/dist/quality/workbook-quality.d.ts +63 -0
  82. package/dist/quality/workbook-quality.d.ts.map +1 -0
  83. package/dist/render-metrics.d.ts +67 -0
  84. package/dist/render-metrics.d.ts.map +1 -0
  85. package/dist/render-plan.d.ts +40 -0
  86. package/dist/render-plan.d.ts.map +1 -0
  87. package/dist/serializers/chart-serializer.d.ts +3 -0
  88. package/dist/serializers/chart-serializer.d.ts.map +1 -0
  89. package/dist/serializers/comment-serializer.d.ts +12 -0
  90. package/dist/serializers/comment-serializer.d.ts.map +1 -0
  91. package/dist/serializers/doc-props-serializer.d.ts +5 -0
  92. package/dist/serializers/doc-props-serializer.d.ts.map +1 -0
  93. package/dist/serializers/drawing-serializer.d.ts +24 -0
  94. package/dist/serializers/drawing-serializer.d.ts.map +1 -0
  95. package/dist/serializers/package-serializer.d.ts +13 -0
  96. package/dist/serializers/package-serializer.d.ts.map +1 -0
  97. package/dist/serializers/pivot-serializer.d.ts +37 -0
  98. package/dist/serializers/pivot-serializer.d.ts.map +1 -0
  99. package/dist/serializers/shared-strings.d.ts +11 -0
  100. package/dist/serializers/shared-strings.d.ts.map +1 -0
  101. package/dist/serializers/sheet-serializer.d.ts +58 -0
  102. package/dist/serializers/sheet-serializer.d.ts.map +1 -0
  103. package/dist/serializers/sheet-xml-builder.d.ts +33 -0
  104. package/dist/serializers/sheet-xml-builder.d.ts.map +1 -0
  105. package/dist/serializers/style-registry.d.ts +2 -0
  106. package/dist/serializers/style-registry.d.ts.map +1 -0
  107. package/dist/serializers/table-serializer.d.ts +20 -0
  108. package/dist/serializers/table-serializer.d.ts.map +1 -0
  109. package/dist/serializers/theme-serializer.d.ts +3 -0
  110. package/dist/serializers/theme-serializer.d.ts.map +1 -0
  111. package/dist/serializers/workbook-serializer.d.ts +16 -0
  112. package/dist/serializers/workbook-serializer.d.ts.map +1 -0
  113. package/dist/serializers/worksheet-rels-serializer.d.ts +7 -0
  114. package/dist/serializers/worksheet-rels-serializer.d.ts.map +1 -0
  115. package/dist/source-js-extension-loader.mjs +44 -0
  116. package/dist/spreadsheet-engine.d.ts +50 -0
  117. package/dist/spreadsheet-engine.d.ts.map +1 -0
  118. package/dist/styles/border-serializer.d.ts +6 -0
  119. package/dist/styles/border-serializer.d.ts.map +1 -0
  120. package/dist/styles/color.d.ts +5 -0
  121. package/dist/styles/color.d.ts.map +1 -0
  122. package/dist/styles/component-registry.d.ts +13 -0
  123. package/dist/styles/component-registry.d.ts.map +1 -0
  124. package/dist/styles/conditional-formatting.d.ts +8 -0
  125. package/dist/styles/conditional-formatting.d.ts.map +1 -0
  126. package/dist/styles/fill-serializer.d.ts +9 -0
  127. package/dist/styles/fill-serializer.d.ts.map +1 -0
  128. package/dist/styles/font-serializer.d.ts +11 -0
  129. package/dist/styles/font-serializer.d.ts.map +1 -0
  130. package/dist/styles/numfmt-registry.d.ts +7 -0
  131. package/dist/styles/numfmt-registry.d.ts.map +1 -0
  132. package/dist/styles/presets.d.ts +190 -0
  133. package/dist/styles/presets.d.ts.map +1 -0
  134. package/dist/styles/style-registry.d.ts +24 -0
  135. package/dist/styles/style-registry.d.ts.map +1 -0
  136. package/dist/styles/style-utils.d.ts +11 -0
  137. package/dist/styles/style-utils.d.ts.map +1 -0
  138. package/dist/template-assembler.d.ts +26 -0
  139. package/dist/template-assembler.d.ts.map +1 -0
  140. package/dist/template-parser.d.ts +96 -0
  141. package/dist/template-parser.d.ts.map +1 -0
  142. package/dist/types/spreadsheet-ast.d.ts +470 -0
  143. package/dist/types/spreadsheet-ast.d.ts.map +1 -0
  144. package/dist/utils/cell-ref.d.ts +21 -0
  145. package/dist/utils/cell-ref.d.ts.map +1 -0
  146. package/dist/utils/date.d.ts +32 -0
  147. package/dist/utils/date.d.ts.map +1 -0
  148. package/dist/utils/hyperlinks.d.ts +16 -0
  149. package/dist/utils/hyperlinks.d.ts.map +1 -0
  150. package/dist/utils/xml.d.ts +7 -0
  151. package/dist/utils/xml.d.ts.map +1 -0
  152. package/dist/validation/spreadsheet-schema.d.ts +1513 -0
  153. package/dist/validation/spreadsheet-schema.d.ts.map +1 -0
  154. package/dist/workers/sheet-serialization-worker-pool.d.ts +32 -0
  155. package/dist/workers/sheet-serialization-worker-pool.d.ts.map +1 -0
  156. package/dist/workers/sheet-serializer-worker.d.ts +2 -0
  157. package/dist/workers/sheet-serializer-worker.d.ts.map +1 -0
  158. package/dist/workers/sheet-serializer-worker.js +2565 -0
  159. package/dist/workers/sheet-serializer-worker.js.map +7 -0
  160. package/dist/worksheet/structure.d.ts +33 -0
  161. package/dist/worksheet/structure.d.ts.map +1 -0
  162. package/dist-pro/benchmarks/phase2.js +1 -0
  163. package/dist-pro/benchmarks/report.js +1 -0
  164. package/dist-pro/benchmarks/rigorous.js +2 -0
  165. package/dist-pro/chaos-lab/index.js +2 -0
  166. package/dist-pro/chunk-FFIHITWB.js +1 -0
  167. package/dist-pro/chunk-INDNGGXB.js +2 -0
  168. package/dist-pro/chunk-K2MQYNU6.js +1 -0
  169. package/dist-pro/chunk-MEZHQFH3.js +2 -0
  170. package/dist-pro/chunk-RB42Q36L.js +1 -0
  171. package/dist-pro/chunk-WYTH4W4N.js +48 -0
  172. package/dist-pro/index.js +3 -0
  173. package/dist-pro/source-js-extension-loader.mjs +44 -0
  174. package/dist-pro/workers/sheet-serializer-worker.js +3 -0
  175. package/package.json +62 -0
package/dist/index.js ADDED
@@ -0,0 +1,2167 @@
1
+ import {
2
+ listPhase3Fixtures,
3
+ listPhase4Fixtures,
4
+ phase3Fixtures,
5
+ phase4Fixtures
6
+ } from "./chunk-Z2JSZFNG.js";
7
+ import {
8
+ validateXlsxStructure
9
+ } from "./chunk-PQSLPEN5.js";
10
+ import {
11
+ FREE_XLSX_CHART_TYPES,
12
+ FormulaEvaluator,
13
+ PRESETS,
14
+ PRESET_NAMES,
15
+ SharedStringTable,
16
+ SheetNameSchema,
17
+ SpreadsheetCellSchema,
18
+ SpreadsheetColumnSchema,
19
+ SpreadsheetDefaultsSchema,
20
+ SpreadsheetDocumentSchema,
21
+ SpreadsheetEngine,
22
+ SpreadsheetMetaSchema,
23
+ SpreadsheetRowSchema,
24
+ SpreadsheetSheetSchema,
25
+ SpreadsheetTemplateAssemblyError,
26
+ SpreadsheetTemplateParseError,
27
+ SpreadsheetValidationError,
28
+ StyleRegistry,
29
+ ThemeConfigSchema,
30
+ absCellRef,
31
+ absRangeRef,
32
+ cellRef,
33
+ colIndexToLetter,
34
+ compileSheetStructure,
35
+ createRenderPlan,
36
+ dateToSerial,
37
+ extractSheetReferences,
38
+ formatSheetRange,
39
+ formatSheetRef,
40
+ getPhase1Fixture,
41
+ listPhase1Fixtures,
42
+ normalizeHyperlink,
43
+ normalizeHyperlinkLocation,
44
+ offsetFormulaRows,
45
+ parseCellRef,
46
+ parseRangeRef,
47
+ phase1Fixtures,
48
+ preflightSpreadsheet,
49
+ rangeRef,
50
+ remediateSpreadsheetAccessibility,
51
+ rowIndexToRowNum,
52
+ shiftFormulaRows,
53
+ validateSpreadsheetAccessibility,
54
+ validateSpreadsheetBuffer,
55
+ validateSpreadsheetDocument
56
+ } from "./chunk-S5RMAWLC.js";
57
+
58
+ // src/formulas/builder.ts
59
+ function toOperand(value) {
60
+ if (typeof value === "string") {
61
+ return value;
62
+ }
63
+ if (typeof value === "number") {
64
+ return String(value);
65
+ }
66
+ if (typeof value === "boolean") {
67
+ return value ? "TRUE" : "FALSE";
68
+ }
69
+ return String(dateToSerial(value));
70
+ }
71
+ function call(name, ...args) {
72
+ return `${name}(${args.map(toOperand).join(",")})`;
73
+ }
74
+ function unaryFunction(name) {
75
+ return (value) => call(name, value);
76
+ }
77
+ function binaryFunction(name) {
78
+ return (left, right) => call(name, left, right);
79
+ }
80
+ function variadicFunction(name) {
81
+ return (...args) => call(name, ...args);
82
+ }
83
+ var F = {
84
+ text(value) {
85
+ return `"${value.replaceAll('"', '""')}"`;
86
+ },
87
+ bool(value) {
88
+ return value ? "TRUE" : "FALSE";
89
+ },
90
+ num(value) {
91
+ return String(value);
92
+ },
93
+ date(value) {
94
+ return String(dateToSerial(value));
95
+ },
96
+ cell(row, col) {
97
+ return cellRef(row, col);
98
+ },
99
+ absCell(row, col) {
100
+ return absCellRef(row, col);
101
+ },
102
+ range(startRow, startCol, endRow, endCol) {
103
+ return rangeRef(startRow, startCol, endRow, endCol);
104
+ },
105
+ absRange(startRow, startCol, endRow, endCol) {
106
+ return absRangeRef(startRow, startCol, endRow, endCol);
107
+ },
108
+ ref(sheetName, startRef, endRef) {
109
+ return endRef ? formatSheetRange(sheetName, startRef, endRef) : formatSheetRef(sheetName, startRef);
110
+ },
111
+ sumSheet(sheetName, startRef, endRef) {
112
+ return call("SUM", formatSheetRange(sheetName, startRef, endRef));
113
+ },
114
+ vlookupSheet(lookupValue, sheetName, tableStart, tableEnd, colIndex, exactMatch = true) {
115
+ return call(
116
+ "VLOOKUP",
117
+ lookupValue,
118
+ formatSheetRange(sheetName, tableStart, tableEnd),
119
+ colIndex,
120
+ !exactMatch
121
+ );
122
+ },
123
+ parens(expression) {
124
+ return `(${toOperand(expression)})`;
125
+ },
126
+ add(left, right) {
127
+ return `${toOperand(left)}+${toOperand(right)}`;
128
+ },
129
+ subtract(left, right) {
130
+ return `${toOperand(left)}-${toOperand(right)}`;
131
+ },
132
+ multiply(left, right) {
133
+ return `${toOperand(left)}*${toOperand(right)}`;
134
+ },
135
+ divide(left, right) {
136
+ return `${toOperand(left)}/${toOperand(right)}`;
137
+ },
138
+ power(left, right) {
139
+ return `${toOperand(left)}^${toOperand(right)}`;
140
+ },
141
+ eq(left, right) {
142
+ return `${toOperand(left)}=${toOperand(right)}`;
143
+ },
144
+ ne(left, right) {
145
+ return `${toOperand(left)}<>${toOperand(right)}`;
146
+ },
147
+ lt(left, right) {
148
+ return `${toOperand(left)}<${toOperand(right)}`;
149
+ },
150
+ lte(left, right) {
151
+ return `${toOperand(left)}<=${toOperand(right)}`;
152
+ },
153
+ gt(left, right) {
154
+ return `${toOperand(left)}>${toOperand(right)}`;
155
+ },
156
+ gte(left, right) {
157
+ return `${toOperand(left)}>=${toOperand(right)}`;
158
+ },
159
+ sum: variadicFunction("SUM"),
160
+ average: variadicFunction("AVERAGE"),
161
+ count: variadicFunction("COUNT"),
162
+ counta: variadicFunction("COUNTA"),
163
+ countblank: variadicFunction("COUNTBLANK"),
164
+ min: variadicFunction("MIN"),
165
+ max: variadicFunction("MAX"),
166
+ sumproduct: variadicFunction("SUMPRODUCT"),
167
+ sumif: variadicFunction("SUMIF"),
168
+ sumifs: variadicFunction("SUMIFS"),
169
+ countif: variadicFunction("COUNTIF"),
170
+ countifs: variadicFunction("COUNTIFS"),
171
+ averageif: variadicFunction("AVERAGEIF"),
172
+ averageifs: variadicFunction("AVERAGEIFS"),
173
+ round: binaryFunction("ROUND"),
174
+ roundup: binaryFunction("ROUNDUP"),
175
+ rounddown: binaryFunction("ROUNDDOWN"),
176
+ abs: unaryFunction("ABS"),
177
+ sqrt: unaryFunction("SQRT"),
178
+ int: unaryFunction("INT"),
179
+ ceiling: variadicFunction("CEILING"),
180
+ floor: variadicFunction("FLOOR"),
181
+ mod: binaryFunction("MOD"),
182
+ if(condition, whenTrue, whenFalse) {
183
+ return call("IF", condition, whenTrue, whenFalse);
184
+ },
185
+ and: variadicFunction("AND"),
186
+ or: variadicFunction("OR"),
187
+ not: unaryFunction("NOT"),
188
+ iferror: binaryFunction("IFERROR"),
189
+ ifna: binaryFunction("IFNA"),
190
+ isblank: unaryFunction("ISBLANK"),
191
+ isnumber: unaryFunction("ISNUMBER"),
192
+ istext: unaryFunction("ISTEXT"),
193
+ len: unaryFunction("LEN"),
194
+ left: variadicFunction("LEFT"),
195
+ right: variadicFunction("RIGHT"),
196
+ mid: variadicFunction("MID"),
197
+ trim: unaryFunction("TRIM"),
198
+ upper: unaryFunction("UPPER"),
199
+ lower: unaryFunction("LOWER"),
200
+ proper: unaryFunction("PROPER"),
201
+ concat: variadicFunction("CONCAT"),
202
+ textjoin: variadicFunction("TEXTJOIN"),
203
+ substitute: variadicFunction("SUBSTITUTE"),
204
+ find: variadicFunction("FIND"),
205
+ search: variadicFunction("SEARCH"),
206
+ vlookup(lookupValue, tableArray, columnIndex, rangeLookup) {
207
+ return call("VLOOKUP", lookupValue, tableArray, columnIndex, rangeLookup);
208
+ },
209
+ hlookup(lookupValue, tableArray, rowIndex, rangeLookup) {
210
+ return call("HLOOKUP", lookupValue, tableArray, rowIndex, rangeLookup);
211
+ },
212
+ index: variadicFunction("INDEX"),
213
+ match: variadicFunction("MATCH"),
214
+ xlookup: variadicFunction("XLOOKUP"),
215
+ choose: variadicFunction("CHOOSE"),
216
+ offset: variadicFunction("OFFSET"),
217
+ row: variadicFunction("ROW"),
218
+ column: variadicFunction("COLUMN"),
219
+ rows: variadicFunction("ROWS"),
220
+ columns: variadicFunction("COLUMNS"),
221
+ today() {
222
+ return call("TODAY");
223
+ },
224
+ now() {
225
+ return call("NOW");
226
+ },
227
+ datevalue: unaryFunction("DATEVALUE"),
228
+ year: unaryFunction("YEAR"),
229
+ month: unaryFunction("MONTH"),
230
+ day: unaryFunction("DAY"),
231
+ eomonth: binaryFunction("EOMONTH"),
232
+ edate: binaryFunction("EDATE")
233
+ };
234
+
235
+ // src/fixtures/phase2.ts
236
+ function createRow(values) {
237
+ return { cells: values };
238
+ }
239
+ var phase2Fixtures = [
240
+ {
241
+ name: "phase2-presets",
242
+ description: "Built-in preset styles across headers, totals, and statuses",
243
+ document: {
244
+ sheets: [
245
+ {
246
+ name: "Presets",
247
+ rows: [
248
+ createRow([{ value: "Preset" }, { value: "Preview" }, { value: "Value" }]),
249
+ createRow([{ value: "header" }, { value: "Revenue", style: "header" }, { value: 42e4, style: "currency" }]),
250
+ createRow([{ value: "headerDark" }, { value: "Costs", style: "headerDark" }, { value: 32e4, style: "currency" }]),
251
+ createRow([{ value: "headerGreen" }, { value: "Margin", style: "headerGreen" }, { value: 0.238, style: "percentage" }]),
252
+ createRow([{ value: "subheader" }, { value: "Pipeline", style: "subheader" }, { value: 18450, style: "integer" }]),
253
+ createRow([{ value: "warning" }, { value: "Delayed", style: "warning" }, { value: "At Risk" }]),
254
+ createRow([{ value: "error" }, { value: "Down", style: "error" }, { value: "Escalate" }]),
255
+ createRow([{ value: "success" }, { value: "Healthy", style: "success" }, { value: "On Track" }]),
256
+ createRow([{ value: "neutral" }, { value: "Pending", style: "neutral" }, { value: "Review" }]),
257
+ createRow([{ value: "total" }, { value: "Grand Total", style: "total" }, { value: 74e4, style: "total" }])
258
+ ]
259
+ }
260
+ ]
261
+ }
262
+ },
263
+ {
264
+ name: "phase2-font-fill-border",
265
+ description: "Fonts, fills, and border styles",
266
+ document: {
267
+ sheets: [
268
+ {
269
+ name: "Styles",
270
+ rows: [
271
+ createRow([
272
+ { value: "Bold", style: { font: { bold: true } } },
273
+ { value: "Italic", style: { font: { italic: true } } },
274
+ { value: "Underline", style: { font: { underline: true } } },
275
+ { value: "Strike", style: { font: { strikethrough: true } } }
276
+ ]),
277
+ createRow([
278
+ { value: "Fill", style: { fill: { color: "#DDEBF7" } } },
279
+ { value: "Border", style: { border: { bottom: { style: "thick", color: "#333333" } } } },
280
+ { value: "Accent", style: { font: { color: "#4472C4" }, fill: { color: "#E2F0D9" } } },
281
+ { value: "Center", style: { alignment: { horizontal: "center", vertical: "center" } } }
282
+ ])
283
+ ]
284
+ }
285
+ ]
286
+ }
287
+ },
288
+ {
289
+ name: "phase2-number-formats",
290
+ description: "Number and date format aliases",
291
+ document: {
292
+ sheets: [
293
+ {
294
+ name: "Formats",
295
+ rows: [
296
+ createRow([{ value: "Currency" }, { value: "Percentage" }, { value: "Date" }, { value: "Datetime" }, { value: "Accounting" }]),
297
+ createRow([
298
+ { value: 420000.5, style: "currency" },
299
+ { value: 0.214, style: "percentage" },
300
+ { value: /* @__PURE__ */ new Date("2026-03-27T00:00:00.000Z"), style: "date" },
301
+ { value: /* @__PURE__ */ new Date("2026-03-27T13:45:00.000Z"), style: "datetime" },
302
+ { value: 420000.5, style: { numberFormat: "accounting" } }
303
+ ])
304
+ ]
305
+ }
306
+ ]
307
+ }
308
+ },
309
+ {
310
+ name: "phase2-alignment-richtext",
311
+ description: "Wrap text, row height growth, and rich text runs",
312
+ document: {
313
+ sheets: [
314
+ {
315
+ name: "Alignment",
316
+ columns: [{ width: 12 }, { width: 18 }],
317
+ rows: [
318
+ createRow([
319
+ { value: "Wrapped text example that should increase row height", style: { alignment: { wrapText: true } } },
320
+ {
321
+ value: [
322
+ { text: "Revenue: ", font: { bold: true } },
323
+ { text: "$420,000", font: { bold: true, color: "#006100" } },
324
+ { text: " (+21.4%)", font: { italic: true, color: "#666666" } }
325
+ ]
326
+ }
327
+ ])
328
+ ]
329
+ }
330
+ ]
331
+ }
332
+ },
333
+ {
334
+ name: "phase2-conditional-formatting",
335
+ description: "Conditional formatting rules across a simple score range",
336
+ document: {
337
+ sheets: [
338
+ {
339
+ name: "CF",
340
+ conditionalFormatting: [
341
+ {
342
+ ref: "B2:B11",
343
+ rules: [
344
+ {
345
+ type: "cellIs",
346
+ operator: "greaterThan",
347
+ formula: "80",
348
+ style: "success"
349
+ },
350
+ {
351
+ type: "colorScale",
352
+ scale: {
353
+ min: { type: "min", color: "#F8696B" },
354
+ mid: { type: "percentile", value: 50, color: "#FFEB84" },
355
+ max: { type: "max", color: "#63BE7B" }
356
+ }
357
+ },
358
+ {
359
+ type: "dataBar",
360
+ color: "#4472C4",
361
+ min: { type: "min" },
362
+ max: { type: "max" }
363
+ }
364
+ ]
365
+ }
366
+ ],
367
+ rows: [
368
+ createRow([{ value: "Name" }, { value: "Score" }]),
369
+ ...Array.from({ length: 10 }, (_unused, index) => createRow([
370
+ { value: `Item ${index + 1}` },
371
+ { value: 10 + index * 10 }
372
+ ]))
373
+ ]
374
+ }
375
+ ]
376
+ }
377
+ },
378
+ {
379
+ name: "phase2-sheet-styling",
380
+ description: "Header row and alternating row styling sugar",
381
+ document: {
382
+ sheets: [
383
+ {
384
+ name: "Sugar",
385
+ styling: {
386
+ headerRow: "header",
387
+ alternateRows: {
388
+ even: "neutral"
389
+ }
390
+ },
391
+ rows: [
392
+ createRow([{ value: "Quarter" }, { value: "Revenue" }, { value: "Growth" }]),
393
+ createRow([{ value: "Q1" }, { value: 42e4, style: "currency" }, { value: 0.214, style: "percentage" }]),
394
+ createRow([{ value: "Q2" }, { value: 51e4, style: "currency" }, { value: 0.235, style: "percentage" }]),
395
+ createRow([{ value: "Q3" }, { value: 63e4, style: "currency" }, { value: 0.238, style: "percentage" }])
396
+ ]
397
+ }
398
+ ]
399
+ }
400
+ }
401
+ ];
402
+ function listPhase2Fixtures() {
403
+ return phase2Fixtures;
404
+ }
405
+
406
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/clone.js
407
+ function cloneRegExp(re) {
408
+ var _a;
409
+ const regexMatch = /^\/(.*)\/([gimyu]*)$/.exec(re.toString());
410
+ if (!regexMatch) {
411
+ throw new Error("Invalid RegExp");
412
+ }
413
+ return new RegExp((_a = regexMatch[1]) !== null && _a !== void 0 ? _a : "", regexMatch[2]);
414
+ }
415
+ function clone(arg) {
416
+ if (typeof arg !== "object") {
417
+ return arg;
418
+ }
419
+ if (arg === null) {
420
+ return null;
421
+ }
422
+ if (Array.isArray(arg)) {
423
+ return arg.map(clone);
424
+ }
425
+ if (arg instanceof Date) {
426
+ return new Date(arg.getTime());
427
+ }
428
+ if (arg instanceof RegExp) {
429
+ return cloneRegExp(arg);
430
+ }
431
+ const cloned = {};
432
+ for (const name in arg) {
433
+ if (Object.prototype.hasOwnProperty.call(arg, name)) {
434
+ cloned[name] = clone(arg[name]);
435
+ }
436
+ }
437
+ return cloned;
438
+ }
439
+
440
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/assertions/arrays.js
441
+ function assertNonEmptyArray(arr, message) {
442
+ if (arr.length === 0) {
443
+ throw new Error(message || "Expected a non-empty array");
444
+ }
445
+ }
446
+ var lastNonEmpty = (arr) => arr[arr.length - 1];
447
+
448
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/contexts/context.js
449
+ var Context = class {
450
+ setResult(result) {
451
+ this.result = result;
452
+ this.hasResult = true;
453
+ return this;
454
+ }
455
+ exit() {
456
+ this.exiting = true;
457
+ return this;
458
+ }
459
+ push(child, name) {
460
+ child.parent = this;
461
+ if (typeof name !== "undefined") {
462
+ child.childName = name;
463
+ }
464
+ child.root = this.root || this;
465
+ child.options = child.options || this.options;
466
+ if (!this.children) {
467
+ this.children = [child];
468
+ this.nextAfterChildren = this.next || null;
469
+ this.next = child;
470
+ } else {
471
+ assertNonEmptyArray(this.children);
472
+ lastNonEmpty(this.children).next = child;
473
+ this.children.push(child);
474
+ }
475
+ child.next = this;
476
+ return this;
477
+ }
478
+ };
479
+
480
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/contexts/diff.js
481
+ var DiffContext = class extends Context {
482
+ constructor(left, right) {
483
+ super();
484
+ this.left = left;
485
+ this.right = right;
486
+ this.pipe = "diff";
487
+ }
488
+ prepareDeltaResult(result) {
489
+ var _a, _b, _c, _d;
490
+ if (typeof result === "object") {
491
+ if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.omitRemovedValues) && Array.isArray(result) && result.length > 1 && (result.length === 2 || // modified
492
+ result[2] === 0 || // deleted
493
+ result[2] === 3)) {
494
+ result[0] = 0;
495
+ }
496
+ if ((_b = this.options) === null || _b === void 0 ? void 0 : _b.cloneDiffValues) {
497
+ const clone2 = typeof ((_c = this.options) === null || _c === void 0 ? void 0 : _c.cloneDiffValues) === "function" ? (_d = this.options) === null || _d === void 0 ? void 0 : _d.cloneDiffValues : clone;
498
+ if (typeof result[0] === "object") {
499
+ result[0] = clone2(result[0]);
500
+ }
501
+ if (typeof result[1] === "object") {
502
+ result[1] = clone2(result[1]);
503
+ }
504
+ }
505
+ }
506
+ return result;
507
+ }
508
+ setResult(result) {
509
+ this.prepareDeltaResult(result);
510
+ return super.setResult(result);
511
+ }
512
+ };
513
+ var diff_default = DiffContext;
514
+
515
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/contexts/patch.js
516
+ var PatchContext = class extends Context {
517
+ constructor(left, delta) {
518
+ super();
519
+ this.left = left;
520
+ this.delta = delta;
521
+ this.pipe = "patch";
522
+ }
523
+ };
524
+ var patch_default = PatchContext;
525
+
526
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/contexts/reverse.js
527
+ var ReverseContext = class extends Context {
528
+ constructor(delta) {
529
+ super();
530
+ this.delta = delta;
531
+ this.pipe = "reverse";
532
+ }
533
+ };
534
+ var reverse_default = ReverseContext;
535
+
536
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/pipe.js
537
+ var Pipe = class {
538
+ constructor(name) {
539
+ this.name = name;
540
+ this.filters = [];
541
+ }
542
+ process(input) {
543
+ if (!this.processor) {
544
+ throw new Error("add this pipe to a processor before using it");
545
+ }
546
+ const debug = this.debug;
547
+ const length = this.filters.length;
548
+ const context = input;
549
+ for (let index = 0; index < length; index++) {
550
+ const filter = this.filters[index];
551
+ if (!filter)
552
+ continue;
553
+ if (debug) {
554
+ this.log(`filter: ${filter.filterName}`);
555
+ }
556
+ filter(context);
557
+ if (typeof context === "object" && context.exiting) {
558
+ context.exiting = false;
559
+ break;
560
+ }
561
+ }
562
+ if (!context.next && this.resultCheck) {
563
+ this.resultCheck(context);
564
+ }
565
+ }
566
+ log(msg) {
567
+ console.log(`[jsondiffpatch] ${this.name} pipe, ${msg}`);
568
+ }
569
+ append(...args) {
570
+ this.filters.push(...args);
571
+ return this;
572
+ }
573
+ prepend(...args) {
574
+ this.filters.unshift(...args);
575
+ return this;
576
+ }
577
+ indexOf(filterName) {
578
+ if (!filterName) {
579
+ throw new Error("a filter name is required");
580
+ }
581
+ for (let index = 0; index < this.filters.length; index++) {
582
+ const filter = this.filters[index];
583
+ if ((filter === null || filter === void 0 ? void 0 : filter.filterName) === filterName) {
584
+ return index;
585
+ }
586
+ }
587
+ throw new Error(`filter not found: ${filterName}`);
588
+ }
589
+ list() {
590
+ return this.filters.map((f) => f.filterName);
591
+ }
592
+ after(filterName, ...params) {
593
+ const index = this.indexOf(filterName);
594
+ this.filters.splice(index + 1, 0, ...params);
595
+ return this;
596
+ }
597
+ before(filterName, ...params) {
598
+ const index = this.indexOf(filterName);
599
+ this.filters.splice(index, 0, ...params);
600
+ return this;
601
+ }
602
+ replace(filterName, ...params) {
603
+ const index = this.indexOf(filterName);
604
+ this.filters.splice(index, 1, ...params);
605
+ return this;
606
+ }
607
+ remove(filterName) {
608
+ const index = this.indexOf(filterName);
609
+ this.filters.splice(index, 1);
610
+ return this;
611
+ }
612
+ clear() {
613
+ this.filters.length = 0;
614
+ return this;
615
+ }
616
+ shouldHaveResult(should) {
617
+ if (should === false) {
618
+ this.resultCheck = null;
619
+ return this;
620
+ }
621
+ if (this.resultCheck) {
622
+ return this;
623
+ }
624
+ this.resultCheck = (context) => {
625
+ if (!context.hasResult) {
626
+ console.log(context);
627
+ const error = new Error(`${this.name} failed`);
628
+ error.noResult = true;
629
+ throw error;
630
+ }
631
+ };
632
+ return this;
633
+ }
634
+ };
635
+ var pipe_default = Pipe;
636
+
637
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/processor.js
638
+ var Processor = class {
639
+ constructor(options) {
640
+ this.selfOptions = options || {};
641
+ this.pipes = {};
642
+ }
643
+ options(options) {
644
+ if (options) {
645
+ this.selfOptions = options;
646
+ }
647
+ return this.selfOptions;
648
+ }
649
+ pipe(name, pipeArg) {
650
+ let pipe = pipeArg;
651
+ if (typeof name === "string") {
652
+ if (typeof pipe === "undefined") {
653
+ return this.pipes[name];
654
+ }
655
+ this.pipes[name] = pipe;
656
+ }
657
+ if (name && name.name) {
658
+ pipe = name;
659
+ if (pipe.processor === this) {
660
+ return pipe;
661
+ }
662
+ this.pipes[pipe.name] = pipe;
663
+ }
664
+ if (!pipe) {
665
+ throw new Error(`pipe is not defined: ${name}`);
666
+ }
667
+ pipe.processor = this;
668
+ return pipe;
669
+ }
670
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
671
+ process(input, pipe) {
672
+ let context = input;
673
+ context.options = this.options();
674
+ let nextPipe = pipe || input.pipe || "default";
675
+ let lastPipe = void 0;
676
+ while (nextPipe) {
677
+ if (typeof context.nextAfterChildren !== "undefined") {
678
+ context.next = context.nextAfterChildren;
679
+ context.nextAfterChildren = null;
680
+ }
681
+ if (typeof nextPipe === "string") {
682
+ nextPipe = this.pipe(nextPipe);
683
+ }
684
+ nextPipe.process(context);
685
+ lastPipe = nextPipe;
686
+ nextPipe = null;
687
+ if (context) {
688
+ if (context.next) {
689
+ context = context.next;
690
+ nextPipe = context.pipe || lastPipe;
691
+ }
692
+ }
693
+ }
694
+ return context.hasResult ? context.result : void 0;
695
+ }
696
+ };
697
+ var processor_default = Processor;
698
+
699
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/filters/lcs.js
700
+ var defaultMatch = (array1, array2, index1, index2) => array1[index1] === array2[index2];
701
+ var lengthMatrix = (array1, array2, match, context) => {
702
+ var _a, _b, _c;
703
+ const len1 = array1.length;
704
+ const len2 = array2.length;
705
+ let x;
706
+ let y;
707
+ const matrix = new Array(len1 + 1);
708
+ for (x = 0; x < len1 + 1; x++) {
709
+ const matrixNewRow = new Array(len2 + 1);
710
+ for (y = 0; y < len2 + 1; y++) {
711
+ matrixNewRow[y] = 0;
712
+ }
713
+ matrix[x] = matrixNewRow;
714
+ }
715
+ matrix.match = match;
716
+ for (x = 1; x < len1 + 1; x++) {
717
+ const matrixRowX = matrix[x];
718
+ if (matrixRowX === void 0) {
719
+ throw new Error("LCS matrix row is undefined");
720
+ }
721
+ const matrixRowBeforeX = matrix[x - 1];
722
+ if (matrixRowBeforeX === void 0) {
723
+ throw new Error("LCS matrix row is undefined");
724
+ }
725
+ for (y = 1; y < len2 + 1; y++) {
726
+ if (match(array1, array2, x - 1, y - 1, context)) {
727
+ matrixRowX[y] = ((_a = matrixRowBeforeX[y - 1]) !== null && _a !== void 0 ? _a : 0) + 1;
728
+ } else {
729
+ matrixRowX[y] = Math.max((_b = matrixRowBeforeX[y]) !== null && _b !== void 0 ? _b : 0, (_c = matrixRowX[y - 1]) !== null && _c !== void 0 ? _c : 0);
730
+ }
731
+ }
732
+ }
733
+ return matrix;
734
+ };
735
+ var backtrack = (matrix, array1, array2, context) => {
736
+ let index1 = array1.length;
737
+ let index2 = array2.length;
738
+ const subsequence = {
739
+ sequence: [],
740
+ indices1: [],
741
+ indices2: []
742
+ };
743
+ while (index1 !== 0 && index2 !== 0) {
744
+ if (matrix.match === void 0) {
745
+ throw new Error("LCS matrix match function is undefined");
746
+ }
747
+ const sameLetter = matrix.match(array1, array2, index1 - 1, index2 - 1, context);
748
+ if (sameLetter) {
749
+ subsequence.sequence.unshift(array1[index1 - 1]);
750
+ subsequence.indices1.unshift(index1 - 1);
751
+ subsequence.indices2.unshift(index2 - 1);
752
+ --index1;
753
+ --index2;
754
+ } else {
755
+ const matrixRowIndex1 = matrix[index1];
756
+ if (matrixRowIndex1 === void 0) {
757
+ throw new Error("LCS matrix row is undefined");
758
+ }
759
+ const valueAtMatrixAbove = matrixRowIndex1[index2 - 1];
760
+ if (valueAtMatrixAbove === void 0) {
761
+ throw new Error("LCS matrix value is undefined");
762
+ }
763
+ const matrixRowBeforeIndex1 = matrix[index1 - 1];
764
+ if (matrixRowBeforeIndex1 === void 0) {
765
+ throw new Error("LCS matrix row is undefined");
766
+ }
767
+ const valueAtMatrixLeft = matrixRowBeforeIndex1[index2];
768
+ if (valueAtMatrixLeft === void 0) {
769
+ throw new Error("LCS matrix value is undefined");
770
+ }
771
+ if (valueAtMatrixAbove > valueAtMatrixLeft) {
772
+ --index2;
773
+ } else {
774
+ --index1;
775
+ }
776
+ }
777
+ }
778
+ return subsequence;
779
+ };
780
+ var get = (array1, array2, match, context) => {
781
+ const innerContext = context || {};
782
+ const matrix = lengthMatrix(array1, array2, match || defaultMatch, innerContext);
783
+ return backtrack(matrix, array1, array2, innerContext);
784
+ };
785
+ var lcs_default = {
786
+ get
787
+ };
788
+
789
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/filters/arrays.js
790
+ var ARRAY_MOVE = 3;
791
+ function arraysHaveMatchByRef(array1, array2, len1, len2) {
792
+ for (let index1 = 0; index1 < len1; index1++) {
793
+ const val1 = array1[index1];
794
+ for (let index2 = 0; index2 < len2; index2++) {
795
+ const val2 = array2[index2];
796
+ if (index1 !== index2 && val1 === val2) {
797
+ return true;
798
+ }
799
+ }
800
+ }
801
+ return false;
802
+ }
803
+ function matchItems(array1, array2, index1, index2, context) {
804
+ const value1 = array1[index1];
805
+ const value2 = array2[index2];
806
+ if (value1 === value2) {
807
+ return true;
808
+ }
809
+ if (typeof value1 !== "object" || typeof value2 !== "object") {
810
+ return false;
811
+ }
812
+ const objectHash = context.objectHash;
813
+ if (!objectHash) {
814
+ return context.matchByPosition && index1 === index2;
815
+ }
816
+ context.hashCache1 = context.hashCache1 || [];
817
+ let hash1 = context.hashCache1[index1];
818
+ if (typeof hash1 === "undefined") {
819
+ context.hashCache1[index1] = hash1 = objectHash(value1, index1);
820
+ }
821
+ if (typeof hash1 === "undefined") {
822
+ return false;
823
+ }
824
+ context.hashCache2 = context.hashCache2 || [];
825
+ let hash2 = context.hashCache2[index2];
826
+ if (typeof hash2 === "undefined") {
827
+ context.hashCache2[index2] = hash2 = objectHash(value2, index2);
828
+ }
829
+ if (typeof hash2 === "undefined") {
830
+ return false;
831
+ }
832
+ return hash1 === hash2;
833
+ }
834
+ var diffFilter = function arraysDiffFilter(context) {
835
+ var _a, _b, _c, _d, _e;
836
+ if (!context.leftIsArray) {
837
+ return;
838
+ }
839
+ const matchContext = {
840
+ objectHash: (_a = context.options) === null || _a === void 0 ? void 0 : _a.objectHash,
841
+ matchByPosition: (_b = context.options) === null || _b === void 0 ? void 0 : _b.matchByPosition
842
+ };
843
+ let commonHead = 0;
844
+ let commonTail = 0;
845
+ let index;
846
+ let index1;
847
+ let index2;
848
+ const array1 = context.left;
849
+ const array2 = context.right;
850
+ const len1 = array1.length;
851
+ const len2 = array2.length;
852
+ let child;
853
+ if (len1 > 0 && len2 > 0 && !matchContext.objectHash && typeof matchContext.matchByPosition !== "boolean") {
854
+ matchContext.matchByPosition = !arraysHaveMatchByRef(array1, array2, len1, len2);
855
+ }
856
+ while (commonHead < len1 && commonHead < len2 && matchItems(array1, array2, commonHead, commonHead, matchContext)) {
857
+ index = commonHead;
858
+ child = new diff_default(array1[index], array2[index]);
859
+ context.push(child, index);
860
+ commonHead++;
861
+ }
862
+ while (commonTail + commonHead < len1 && commonTail + commonHead < len2 && matchItems(array1, array2, len1 - 1 - commonTail, len2 - 1 - commonTail, matchContext)) {
863
+ index1 = len1 - 1 - commonTail;
864
+ index2 = len2 - 1 - commonTail;
865
+ child = new diff_default(array1[index1], array2[index2]);
866
+ context.push(child, index2);
867
+ commonTail++;
868
+ }
869
+ let result;
870
+ if (commonHead + commonTail === len1) {
871
+ if (len1 === len2) {
872
+ context.setResult(void 0).exit();
873
+ return;
874
+ }
875
+ result = result || {
876
+ _t: "a"
877
+ };
878
+ for (index = commonHead; index < len2 - commonTail; index++) {
879
+ result[index] = [array2[index]];
880
+ context.prepareDeltaResult(result[index]);
881
+ }
882
+ context.setResult(result).exit();
883
+ return;
884
+ }
885
+ if (commonHead + commonTail === len2) {
886
+ result = result || {
887
+ _t: "a"
888
+ };
889
+ for (index = commonHead; index < len1 - commonTail; index++) {
890
+ const key = `_${index}`;
891
+ result[key] = [array1[index], 0, 0];
892
+ context.prepareDeltaResult(result[key]);
893
+ }
894
+ context.setResult(result).exit();
895
+ return;
896
+ }
897
+ matchContext.hashCache1 = void 0;
898
+ matchContext.hashCache2 = void 0;
899
+ const trimmed1 = array1.slice(commonHead, len1 - commonTail);
900
+ const trimmed2 = array2.slice(commonHead, len2 - commonTail);
901
+ const seq = lcs_default.get(trimmed1, trimmed2, matchItems, matchContext);
902
+ const removedItems = [];
903
+ result = result || {
904
+ _t: "a"
905
+ };
906
+ for (index = commonHead; index < len1 - commonTail; index++) {
907
+ if (seq.indices1.indexOf(index - commonHead) < 0) {
908
+ const key = `_${index}`;
909
+ result[key] = [array1[index], 0, 0];
910
+ context.prepareDeltaResult(result[key]);
911
+ removedItems.push(index);
912
+ }
913
+ }
914
+ let detectMove = true;
915
+ if (((_c = context.options) === null || _c === void 0 ? void 0 : _c.arrays) && context.options.arrays.detectMove === false) {
916
+ detectMove = false;
917
+ }
918
+ let includeValueOnMove = false;
919
+ if ((_e = (_d = context.options) === null || _d === void 0 ? void 0 : _d.arrays) === null || _e === void 0 ? void 0 : _e.includeValueOnMove) {
920
+ includeValueOnMove = true;
921
+ }
922
+ const removedItemsLength = removedItems.length;
923
+ for (index = commonHead; index < len2 - commonTail; index++) {
924
+ const indexOnArray2 = seq.indices2.indexOf(index - commonHead);
925
+ if (indexOnArray2 < 0) {
926
+ let isMove = false;
927
+ if (detectMove && removedItemsLength > 0) {
928
+ for (let removeItemIndex1 = 0; removeItemIndex1 < removedItemsLength; removeItemIndex1++) {
929
+ index1 = removedItems[removeItemIndex1];
930
+ const resultItem = index1 === void 0 ? void 0 : result[`_${index1}`];
931
+ if (index1 !== void 0 && resultItem && matchItems(trimmed1, trimmed2, index1 - commonHead, index - commonHead, matchContext)) {
932
+ resultItem.splice(1, 2, index, ARRAY_MOVE);
933
+ resultItem.splice(1, 2, index, ARRAY_MOVE);
934
+ if (!includeValueOnMove) {
935
+ resultItem[0] = "";
936
+ }
937
+ index2 = index;
938
+ child = new diff_default(array1[index1], array2[index2]);
939
+ context.push(child, index2);
940
+ removedItems.splice(removeItemIndex1, 1);
941
+ isMove = true;
942
+ break;
943
+ }
944
+ }
945
+ }
946
+ if (!isMove) {
947
+ result[index] = [array2[index]];
948
+ context.prepareDeltaResult(result[index]);
949
+ }
950
+ } else {
951
+ if (seq.indices1[indexOnArray2] === void 0) {
952
+ throw new Error(`Invalid indexOnArray2: ${indexOnArray2}, seq.indices1: ${seq.indices1}`);
953
+ }
954
+ index1 = seq.indices1[indexOnArray2] + commonHead;
955
+ if (seq.indices2[indexOnArray2] === void 0) {
956
+ throw new Error(`Invalid indexOnArray2: ${indexOnArray2}, seq.indices2: ${seq.indices2}`);
957
+ }
958
+ index2 = seq.indices2[indexOnArray2] + commonHead;
959
+ child = new diff_default(array1[index1], array2[index2]);
960
+ context.push(child, index2);
961
+ }
962
+ }
963
+ context.setResult(result).exit();
964
+ };
965
+ diffFilter.filterName = "arrays";
966
+ var compare = {
967
+ numerically(a, b) {
968
+ return a - b;
969
+ },
970
+ numericallyBy(name) {
971
+ return (a, b) => a[name] - b[name];
972
+ }
973
+ };
974
+ var patchFilter = function nestedPatchFilter(context) {
975
+ var _a;
976
+ if (!context.nested) {
977
+ return;
978
+ }
979
+ const nestedDelta = context.delta;
980
+ if (nestedDelta._t !== "a") {
981
+ return;
982
+ }
983
+ let index;
984
+ let index1;
985
+ const delta = nestedDelta;
986
+ const array = context.left;
987
+ let toRemove = [];
988
+ let toInsert = [];
989
+ const toModify = [];
990
+ for (index in delta) {
991
+ if (index !== "_t") {
992
+ if (index[0] === "_") {
993
+ const removedOrMovedIndex = index;
994
+ if (delta[removedOrMovedIndex] !== void 0 && (delta[removedOrMovedIndex][2] === 0 || delta[removedOrMovedIndex][2] === ARRAY_MOVE)) {
995
+ toRemove.push(Number.parseInt(index.slice(1), 10));
996
+ } else {
997
+ throw new Error(`only removal or move can be applied at original array indices, invalid diff type: ${(_a = delta[removedOrMovedIndex]) === null || _a === void 0 ? void 0 : _a[2]}`);
998
+ }
999
+ } else {
1000
+ const numberIndex = index;
1001
+ if (delta[numberIndex].length === 1) {
1002
+ toInsert.push({
1003
+ index: Number.parseInt(numberIndex, 10),
1004
+ value: delta[numberIndex][0]
1005
+ });
1006
+ } else {
1007
+ toModify.push({
1008
+ index: Number.parseInt(numberIndex, 10),
1009
+ delta: delta[numberIndex]
1010
+ });
1011
+ }
1012
+ }
1013
+ }
1014
+ }
1015
+ toRemove = toRemove.sort(compare.numerically);
1016
+ for (index = toRemove.length - 1; index >= 0; index--) {
1017
+ index1 = toRemove[index];
1018
+ if (index1 === void 0)
1019
+ continue;
1020
+ const indexDiff = delta[`_${index1}`];
1021
+ const removedValue = array.splice(index1, 1)[0];
1022
+ if ((indexDiff === null || indexDiff === void 0 ? void 0 : indexDiff[2]) === ARRAY_MOVE) {
1023
+ toInsert.push({
1024
+ index: indexDiff[1],
1025
+ value: removedValue
1026
+ });
1027
+ }
1028
+ }
1029
+ toInsert = toInsert.sort(compare.numericallyBy("index"));
1030
+ const toInsertLength = toInsert.length;
1031
+ for (index = 0; index < toInsertLength; index++) {
1032
+ const insertion = toInsert[index];
1033
+ if (insertion === void 0)
1034
+ continue;
1035
+ array.splice(insertion.index, 0, insertion.value);
1036
+ }
1037
+ const toModifyLength = toModify.length;
1038
+ if (toModifyLength > 0) {
1039
+ for (index = 0; index < toModifyLength; index++) {
1040
+ const modification = toModify[index];
1041
+ if (modification === void 0)
1042
+ continue;
1043
+ const child = new patch_default(array[modification.index], modification.delta);
1044
+ context.push(child, modification.index);
1045
+ }
1046
+ }
1047
+ if (!context.children) {
1048
+ context.setResult(array).exit();
1049
+ return;
1050
+ }
1051
+ context.exit();
1052
+ };
1053
+ patchFilter.filterName = "arrays";
1054
+ var collectChildrenPatchFilter = function collectChildrenPatchFilter2(context) {
1055
+ if (!context || !context.children) {
1056
+ return;
1057
+ }
1058
+ const deltaWithChildren = context.delta;
1059
+ if (deltaWithChildren._t !== "a") {
1060
+ return;
1061
+ }
1062
+ const array = context.left;
1063
+ const length = context.children.length;
1064
+ for (let index = 0; index < length; index++) {
1065
+ const child = context.children[index];
1066
+ if (child === void 0)
1067
+ continue;
1068
+ const arrayIndex = child.childName;
1069
+ array[arrayIndex] = child.result;
1070
+ }
1071
+ context.setResult(array).exit();
1072
+ };
1073
+ collectChildrenPatchFilter.filterName = "arraysCollectChildren";
1074
+ var reverseFilter = function arraysReverseFilter(context) {
1075
+ if (!context.nested) {
1076
+ const nonNestedDelta = context.delta;
1077
+ if (nonNestedDelta[2] === ARRAY_MOVE) {
1078
+ const arrayMoveDelta = nonNestedDelta;
1079
+ context.newName = `_${arrayMoveDelta[1]}`;
1080
+ context.setResult([
1081
+ arrayMoveDelta[0],
1082
+ Number.parseInt(context.childName.substring(1), 10),
1083
+ ARRAY_MOVE
1084
+ ]).exit();
1085
+ }
1086
+ return;
1087
+ }
1088
+ const nestedDelta = context.delta;
1089
+ if (nestedDelta._t !== "a") {
1090
+ return;
1091
+ }
1092
+ const arrayDelta = nestedDelta;
1093
+ for (const name in arrayDelta) {
1094
+ if (name === "_t") {
1095
+ continue;
1096
+ }
1097
+ const child = new reverse_default(arrayDelta[name]);
1098
+ context.push(child, name);
1099
+ }
1100
+ context.exit();
1101
+ };
1102
+ reverseFilter.filterName = "arrays";
1103
+ var reverseArrayDeltaIndex = (delta, index, itemDelta) => {
1104
+ if (typeof index === "string" && index[0] === "_") {
1105
+ return Number.parseInt(index.substring(1), 10);
1106
+ }
1107
+ if (Array.isArray(itemDelta) && itemDelta[2] === 0) {
1108
+ return `_${index}`;
1109
+ }
1110
+ let reverseIndex = +index;
1111
+ for (const deltaIndex in delta) {
1112
+ const deltaItem = delta[deltaIndex];
1113
+ if (Array.isArray(deltaItem)) {
1114
+ if (deltaItem[2] === ARRAY_MOVE) {
1115
+ const moveFromIndex = Number.parseInt(deltaIndex.substring(1), 10);
1116
+ const moveToIndex = deltaItem[1];
1117
+ if (moveToIndex === +index) {
1118
+ return moveFromIndex;
1119
+ }
1120
+ if (moveFromIndex <= reverseIndex && moveToIndex > reverseIndex) {
1121
+ reverseIndex++;
1122
+ } else if (moveFromIndex >= reverseIndex && moveToIndex < reverseIndex) {
1123
+ reverseIndex--;
1124
+ }
1125
+ } else if (deltaItem[2] === 0) {
1126
+ const deleteIndex = Number.parseInt(deltaIndex.substring(1), 10);
1127
+ if (deleteIndex <= reverseIndex) {
1128
+ reverseIndex++;
1129
+ }
1130
+ } else if (deltaItem.length === 1 && Number.parseInt(deltaIndex, 10) <= reverseIndex) {
1131
+ reverseIndex--;
1132
+ }
1133
+ }
1134
+ }
1135
+ return reverseIndex;
1136
+ };
1137
+ var collectChildrenReverseFilter = (context) => {
1138
+ if (!context || !context.children) {
1139
+ return;
1140
+ }
1141
+ const deltaWithChildren = context.delta;
1142
+ if (deltaWithChildren._t !== "a") {
1143
+ return;
1144
+ }
1145
+ const arrayDelta = deltaWithChildren;
1146
+ const length = context.children.length;
1147
+ const delta = {
1148
+ _t: "a"
1149
+ };
1150
+ for (let index = 0; index < length; index++) {
1151
+ const child = context.children[index];
1152
+ if (child === void 0)
1153
+ continue;
1154
+ let name = child.newName;
1155
+ if (typeof name === "undefined") {
1156
+ if (child.childName === void 0) {
1157
+ throw new Error("child.childName is undefined");
1158
+ }
1159
+ name = reverseArrayDeltaIndex(arrayDelta, child.childName, child.result);
1160
+ }
1161
+ if (delta[name] !== child.result) {
1162
+ delta[name] = child.result;
1163
+ }
1164
+ }
1165
+ context.setResult(delta).exit();
1166
+ };
1167
+ collectChildrenReverseFilter.filterName = "arraysCollectChildren";
1168
+
1169
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/filters/dates.js
1170
+ var diffFilter2 = function datesDiffFilter(context) {
1171
+ if (context.left instanceof Date) {
1172
+ if (context.right instanceof Date) {
1173
+ if (context.left.getTime() !== context.right.getTime()) {
1174
+ context.setResult([context.left, context.right]);
1175
+ } else {
1176
+ context.setResult(void 0);
1177
+ }
1178
+ } else {
1179
+ context.setResult([context.left, context.right]);
1180
+ }
1181
+ context.exit();
1182
+ } else if (context.right instanceof Date) {
1183
+ context.setResult([context.left, context.right]).exit();
1184
+ }
1185
+ };
1186
+ diffFilter2.filterName = "dates";
1187
+
1188
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/filters/nested.js
1189
+ var collectChildrenDiffFilter = (context) => {
1190
+ if (!context || !context.children) {
1191
+ return;
1192
+ }
1193
+ const length = context.children.length;
1194
+ let result = context.result;
1195
+ for (let index = 0; index < length; index++) {
1196
+ const child = context.children[index];
1197
+ if (child === void 0)
1198
+ continue;
1199
+ if (typeof child.result === "undefined") {
1200
+ continue;
1201
+ }
1202
+ result = result || {};
1203
+ if (child.childName === void 0) {
1204
+ throw new Error("diff child.childName is undefined");
1205
+ }
1206
+ result[child.childName] = child.result;
1207
+ }
1208
+ if (result && context.leftIsArray) {
1209
+ result._t = "a";
1210
+ }
1211
+ context.setResult(result).exit();
1212
+ };
1213
+ collectChildrenDiffFilter.filterName = "collectChildren";
1214
+ var objectsDiffFilter = (context) => {
1215
+ var _a;
1216
+ if (context.leftIsArray || context.leftType !== "object") {
1217
+ return;
1218
+ }
1219
+ const left = context.left;
1220
+ const right = context.right;
1221
+ const propertyFilter = (_a = context.options) === null || _a === void 0 ? void 0 : _a.propertyFilter;
1222
+ for (const name in left) {
1223
+ if (!Object.prototype.hasOwnProperty.call(left, name)) {
1224
+ continue;
1225
+ }
1226
+ if (propertyFilter && !propertyFilter(name, context)) {
1227
+ continue;
1228
+ }
1229
+ const child = new diff_default(left[name], right[name]);
1230
+ context.push(child, name);
1231
+ }
1232
+ for (const name in right) {
1233
+ if (!Object.prototype.hasOwnProperty.call(right, name)) {
1234
+ continue;
1235
+ }
1236
+ if (propertyFilter && !propertyFilter(name, context)) {
1237
+ continue;
1238
+ }
1239
+ if (typeof left[name] === "undefined") {
1240
+ const child = new diff_default(void 0, right[name]);
1241
+ context.push(child, name);
1242
+ }
1243
+ }
1244
+ if (!context.children || context.children.length === 0) {
1245
+ context.setResult(void 0).exit();
1246
+ return;
1247
+ }
1248
+ context.exit();
1249
+ };
1250
+ objectsDiffFilter.filterName = "objects";
1251
+ var patchFilter2 = function nestedPatchFilter2(context) {
1252
+ if (!context.nested) {
1253
+ return;
1254
+ }
1255
+ const nestedDelta = context.delta;
1256
+ if (nestedDelta._t) {
1257
+ return;
1258
+ }
1259
+ const objectDelta = nestedDelta;
1260
+ for (const name in objectDelta) {
1261
+ const child = new patch_default(context.left[name], objectDelta[name]);
1262
+ context.push(child, name);
1263
+ }
1264
+ context.exit();
1265
+ };
1266
+ patchFilter2.filterName = "objects";
1267
+ var collectChildrenPatchFilter3 = function collectChildrenPatchFilter4(context) {
1268
+ if (!context || !context.children) {
1269
+ return;
1270
+ }
1271
+ const deltaWithChildren = context.delta;
1272
+ if (deltaWithChildren._t) {
1273
+ return;
1274
+ }
1275
+ const object = context.left;
1276
+ const length = context.children.length;
1277
+ for (let index = 0; index < length; index++) {
1278
+ const child = context.children[index];
1279
+ if (child === void 0)
1280
+ continue;
1281
+ const property = child.childName;
1282
+ if (Object.prototype.hasOwnProperty.call(context.left, property) && child.result === void 0) {
1283
+ delete object[property];
1284
+ } else if (object[property] !== child.result) {
1285
+ object[property] = child.result;
1286
+ }
1287
+ }
1288
+ context.setResult(object).exit();
1289
+ };
1290
+ collectChildrenPatchFilter3.filterName = "collectChildren";
1291
+ var reverseFilter2 = function nestedReverseFilter(context) {
1292
+ if (!context.nested) {
1293
+ return;
1294
+ }
1295
+ const nestedDelta = context.delta;
1296
+ if (nestedDelta._t) {
1297
+ return;
1298
+ }
1299
+ const objectDelta = context.delta;
1300
+ for (const name in objectDelta) {
1301
+ const child = new reverse_default(objectDelta[name]);
1302
+ context.push(child, name);
1303
+ }
1304
+ context.exit();
1305
+ };
1306
+ reverseFilter2.filterName = "objects";
1307
+ var collectChildrenReverseFilter2 = (context) => {
1308
+ if (!context || !context.children) {
1309
+ return;
1310
+ }
1311
+ const deltaWithChildren = context.delta;
1312
+ if (deltaWithChildren._t) {
1313
+ return;
1314
+ }
1315
+ const length = context.children.length;
1316
+ const delta = {};
1317
+ for (let index = 0; index < length; index++) {
1318
+ const child = context.children[index];
1319
+ if (child === void 0)
1320
+ continue;
1321
+ const property = child.childName;
1322
+ if (delta[property] !== child.result) {
1323
+ delta[property] = child.result;
1324
+ }
1325
+ }
1326
+ context.setResult(delta).exit();
1327
+ };
1328
+ collectChildrenReverseFilter2.filterName = "collectChildren";
1329
+
1330
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/filters/texts.js
1331
+ var TEXT_DIFF = 2;
1332
+ var DEFAULT_MIN_LENGTH = 60;
1333
+ var cachedDiffPatch = null;
1334
+ function getDiffMatchPatch(options, required) {
1335
+ var _a;
1336
+ if (!cachedDiffPatch) {
1337
+ let instance;
1338
+ if ((_a = options === null || options === void 0 ? void 0 : options.textDiff) === null || _a === void 0 ? void 0 : _a.diffMatchPatch) {
1339
+ instance = new options.textDiff.diffMatchPatch();
1340
+ } else {
1341
+ if (!required) {
1342
+ return null;
1343
+ }
1344
+ const error = new Error("The diff-match-patch library was not provided. Pass the library in through the options or use the `jsondiffpatch/with-text-diffs` entry-point.");
1345
+ error.diff_match_patch_not_found = true;
1346
+ throw error;
1347
+ }
1348
+ cachedDiffPatch = {
1349
+ diff: (txt1, txt2) => instance.patch_toText(instance.patch_make(txt1, txt2)),
1350
+ patch: (txt1, patch) => {
1351
+ const results = instance.patch_apply(instance.patch_fromText(patch), txt1);
1352
+ for (const resultOk of results[1]) {
1353
+ if (!resultOk) {
1354
+ const error = new Error("text patch failed");
1355
+ error.textPatchFailed = true;
1356
+ throw error;
1357
+ }
1358
+ }
1359
+ return results[0];
1360
+ }
1361
+ };
1362
+ }
1363
+ return cachedDiffPatch;
1364
+ }
1365
+ var diffFilter3 = function textsDiffFilter(context) {
1366
+ var _a, _b;
1367
+ if (context.leftType !== "string") {
1368
+ return;
1369
+ }
1370
+ const left = context.left;
1371
+ const right = context.right;
1372
+ const minLength = ((_b = (_a = context.options) === null || _a === void 0 ? void 0 : _a.textDiff) === null || _b === void 0 ? void 0 : _b.minLength) || DEFAULT_MIN_LENGTH;
1373
+ if (left.length < minLength || right.length < minLength) {
1374
+ context.setResult([left, right]).exit();
1375
+ return;
1376
+ }
1377
+ const diffMatchPatch = getDiffMatchPatch(context.options);
1378
+ if (!diffMatchPatch) {
1379
+ context.setResult([left, right]).exit();
1380
+ return;
1381
+ }
1382
+ const diff = diffMatchPatch.diff;
1383
+ context.setResult([diff(left, right), 0, TEXT_DIFF]).exit();
1384
+ };
1385
+ diffFilter3.filterName = "texts";
1386
+ var patchFilter3 = function textsPatchFilter(context) {
1387
+ if (context.nested) {
1388
+ return;
1389
+ }
1390
+ const nonNestedDelta = context.delta;
1391
+ if (nonNestedDelta[2] !== TEXT_DIFF) {
1392
+ return;
1393
+ }
1394
+ const textDiffDelta = nonNestedDelta;
1395
+ const patch = getDiffMatchPatch(context.options, true).patch;
1396
+ context.setResult(patch(context.left, textDiffDelta[0])).exit();
1397
+ };
1398
+ patchFilter3.filterName = "texts";
1399
+ var textDeltaReverse = (delta) => {
1400
+ var _a, _b, _c;
1401
+ const headerRegex = /^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;
1402
+ const lines = delta.split("\n");
1403
+ for (let i = 0; i < lines.length; i++) {
1404
+ const line = lines[i];
1405
+ if (line === void 0)
1406
+ continue;
1407
+ const lineStart = line.slice(0, 1);
1408
+ if (lineStart === "@") {
1409
+ const header = headerRegex.exec(line);
1410
+ if (header !== null) {
1411
+ const lineHeader = i;
1412
+ lines[lineHeader] = `@@ -${header[3]},${header[4]} +${header[1]},${header[2]} @@`;
1413
+ }
1414
+ } else if (lineStart === "+") {
1415
+ lines[i] = `-${(_a = lines[i]) === null || _a === void 0 ? void 0 : _a.slice(1)}`;
1416
+ if (((_b = lines[i - 1]) === null || _b === void 0 ? void 0 : _b.slice(0, 1)) === "+") {
1417
+ const lineTmp = lines[i];
1418
+ lines[i] = lines[i - 1];
1419
+ lines[i - 1] = lineTmp;
1420
+ }
1421
+ } else if (lineStart === "-") {
1422
+ lines[i] = `+${(_c = lines[i]) === null || _c === void 0 ? void 0 : _c.slice(1)}`;
1423
+ }
1424
+ }
1425
+ return lines.join("\n");
1426
+ };
1427
+ var reverseFilter3 = function textsReverseFilter(context) {
1428
+ if (context.nested) {
1429
+ return;
1430
+ }
1431
+ const nonNestedDelta = context.delta;
1432
+ if (nonNestedDelta[2] !== TEXT_DIFF) {
1433
+ return;
1434
+ }
1435
+ const textDiffDelta = nonNestedDelta;
1436
+ context.setResult([textDeltaReverse(textDiffDelta[0]), 0, TEXT_DIFF]).exit();
1437
+ };
1438
+ reverseFilter3.filterName = "texts";
1439
+
1440
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/filters/trivial.js
1441
+ var diffFilter4 = function trivialMatchesDiffFilter(context) {
1442
+ if (context.left === context.right) {
1443
+ context.setResult(void 0).exit();
1444
+ return;
1445
+ }
1446
+ if (typeof context.left === "undefined") {
1447
+ if (typeof context.right === "function") {
1448
+ throw new Error("functions are not supported");
1449
+ }
1450
+ context.setResult([context.right]).exit();
1451
+ return;
1452
+ }
1453
+ if (typeof context.right === "undefined") {
1454
+ context.setResult([context.left, 0, 0]).exit();
1455
+ return;
1456
+ }
1457
+ if (typeof context.left === "function" || typeof context.right === "function") {
1458
+ throw new Error("functions are not supported");
1459
+ }
1460
+ context.leftType = context.left === null ? "null" : typeof context.left;
1461
+ context.rightType = context.right === null ? "null" : typeof context.right;
1462
+ if (context.leftType !== context.rightType) {
1463
+ context.setResult([context.left, context.right]).exit();
1464
+ return;
1465
+ }
1466
+ if (context.leftType === "boolean" || context.leftType === "number") {
1467
+ context.setResult([context.left, context.right]).exit();
1468
+ return;
1469
+ }
1470
+ if (context.leftType === "object") {
1471
+ context.leftIsArray = Array.isArray(context.left);
1472
+ }
1473
+ if (context.rightType === "object") {
1474
+ context.rightIsArray = Array.isArray(context.right);
1475
+ }
1476
+ if (context.leftIsArray !== context.rightIsArray) {
1477
+ context.setResult([context.left, context.right]).exit();
1478
+ return;
1479
+ }
1480
+ if (context.left instanceof RegExp) {
1481
+ if (context.right instanceof RegExp) {
1482
+ context.setResult([context.left.toString(), context.right.toString()]).exit();
1483
+ } else {
1484
+ context.setResult([context.left, context.right]).exit();
1485
+ }
1486
+ }
1487
+ };
1488
+ diffFilter4.filterName = "trivial";
1489
+ var patchFilter4 = function trivialMatchesPatchFilter(context) {
1490
+ if (typeof context.delta === "undefined") {
1491
+ context.setResult(context.left).exit();
1492
+ return;
1493
+ }
1494
+ context.nested = !Array.isArray(context.delta);
1495
+ if (context.nested) {
1496
+ return;
1497
+ }
1498
+ const nonNestedDelta = context.delta;
1499
+ if (nonNestedDelta.length === 1) {
1500
+ context.setResult(nonNestedDelta[0]).exit();
1501
+ return;
1502
+ }
1503
+ if (nonNestedDelta.length === 2) {
1504
+ if (context.left instanceof RegExp) {
1505
+ const regexArgs = /^\/(.*)\/([gimyu]+)$/.exec(nonNestedDelta[1]);
1506
+ if (regexArgs === null || regexArgs === void 0 ? void 0 : regexArgs[1]) {
1507
+ context.setResult(new RegExp(regexArgs[1], regexArgs[2])).exit();
1508
+ return;
1509
+ }
1510
+ }
1511
+ context.setResult(nonNestedDelta[1]).exit();
1512
+ return;
1513
+ }
1514
+ if (nonNestedDelta.length === 3 && nonNestedDelta[2] === 0) {
1515
+ context.setResult(void 0).exit();
1516
+ }
1517
+ };
1518
+ patchFilter4.filterName = "trivial";
1519
+ var reverseFilter4 = function trivialReferseFilter(context) {
1520
+ if (typeof context.delta === "undefined") {
1521
+ context.setResult(context.delta).exit();
1522
+ return;
1523
+ }
1524
+ context.nested = !Array.isArray(context.delta);
1525
+ if (context.nested) {
1526
+ return;
1527
+ }
1528
+ const nonNestedDelta = context.delta;
1529
+ if (nonNestedDelta.length === 1) {
1530
+ context.setResult([nonNestedDelta[0], 0, 0]).exit();
1531
+ return;
1532
+ }
1533
+ if (nonNestedDelta.length === 2) {
1534
+ context.setResult([nonNestedDelta[1], nonNestedDelta[0]]).exit();
1535
+ return;
1536
+ }
1537
+ if (nonNestedDelta.length === 3 && nonNestedDelta[2] === 0) {
1538
+ context.setResult([nonNestedDelta[0]]).exit();
1539
+ }
1540
+ };
1541
+ reverseFilter4.filterName = "trivial";
1542
+
1543
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/diffpatcher.js
1544
+ var DiffPatcher = class {
1545
+ constructor(options) {
1546
+ this.processor = new processor_default(options);
1547
+ this.processor.pipe(new pipe_default("diff").append(collectChildrenDiffFilter, diffFilter4, diffFilter2, diffFilter3, objectsDiffFilter, diffFilter).shouldHaveResult());
1548
+ this.processor.pipe(new pipe_default("patch").append(collectChildrenPatchFilter3, collectChildrenPatchFilter, patchFilter4, patchFilter3, patchFilter2, patchFilter).shouldHaveResult());
1549
+ this.processor.pipe(new pipe_default("reverse").append(collectChildrenReverseFilter2, collectChildrenReverseFilter, reverseFilter4, reverseFilter3, reverseFilter2, reverseFilter).shouldHaveResult());
1550
+ }
1551
+ options(options) {
1552
+ return this.processor.options(options);
1553
+ }
1554
+ diff(left, right) {
1555
+ return this.processor.process(new diff_default(left, right));
1556
+ }
1557
+ patch(left, delta) {
1558
+ return this.processor.process(new patch_default(left, delta));
1559
+ }
1560
+ reverse(delta) {
1561
+ return this.processor.process(new reverse_default(delta));
1562
+ }
1563
+ unpatch(right, delta) {
1564
+ return this.patch(right, this.reverse(delta));
1565
+ }
1566
+ clone(value) {
1567
+ return clone(value);
1568
+ }
1569
+ };
1570
+ var diffpatcher_default = DiffPatcher;
1571
+
1572
+ // ../../node_modules/.pnpm/jsondiffpatch@0.7.3/node_modules/jsondiffpatch/lib/index.js
1573
+ function create(options) {
1574
+ return new diffpatcher_default(options);
1575
+ }
1576
+
1577
+ // ../document-diff/src/index.ts
1578
+ var INTERNAL_FIELD_PREFIX = "__diff";
1579
+ function compareJsonDiffKeys(left, right) {
1580
+ const normalize = (value) => {
1581
+ if (value.startsWith("_")) {
1582
+ return [1, value.slice(1)];
1583
+ }
1584
+ return [0, value];
1585
+ };
1586
+ const [leftPrefix, leftValue] = normalize(left);
1587
+ const [rightPrefix, rightValue] = normalize(right);
1588
+ if (leftPrefix !== rightPrefix) {
1589
+ return leftPrefix - rightPrefix;
1590
+ }
1591
+ const leftNumber = Number(leftValue);
1592
+ const rightNumber = Number(rightValue);
1593
+ if (Number.isFinite(leftNumber) && Number.isFinite(rightNumber)) {
1594
+ return leftNumber - rightNumber;
1595
+ }
1596
+ return left.localeCompare(right);
1597
+ }
1598
+ function classifyArrayDelta(delta) {
1599
+ if (delta.length === 1) {
1600
+ return "added";
1601
+ }
1602
+ if (delta.length >= 3 && delta[1] === 0 && delta[2] === 0) {
1603
+ return "removed";
1604
+ }
1605
+ if (delta.length >= 3 && delta[2] === 3) {
1606
+ return "moved";
1607
+ }
1608
+ return "modified";
1609
+ }
1610
+ function flattenDelta(delta, path = []) {
1611
+ if (!delta || typeof delta !== "object") {
1612
+ return [];
1613
+ }
1614
+ if (Array.isArray(delta)) {
1615
+ return [{ type: classifyArrayDelta(delta), path }];
1616
+ }
1617
+ const deltaRecord = delta;
1618
+ if (deltaRecord._t === "a") {
1619
+ const changes2 = [];
1620
+ for (const key of Object.keys(deltaRecord).filter((candidate) => candidate !== "_t").sort(compareJsonDiffKeys)) {
1621
+ const child = deltaRecord[key];
1622
+ if (key.startsWith("_")) {
1623
+ const oldIndex = Number(key.slice(1));
1624
+ if (Array.isArray(child)) {
1625
+ const childKind = classifyArrayDelta(child);
1626
+ if (childKind === "moved") {
1627
+ changes2.push({
1628
+ type: "moved",
1629
+ path: [...path, Number(child[1])],
1630
+ fromPath: [...path, oldIndex]
1631
+ });
1632
+ } else if (childKind === "removed") {
1633
+ changes2.push({
1634
+ type: "removed",
1635
+ path: [...path, oldIndex]
1636
+ });
1637
+ } else {
1638
+ changes2.push({
1639
+ type: childKind,
1640
+ path: [...path, oldIndex]
1641
+ });
1642
+ }
1643
+ continue;
1644
+ }
1645
+ changes2.push(...flattenDelta(child, [...path, oldIndex]));
1646
+ continue;
1647
+ }
1648
+ const newIndex = Number(key);
1649
+ if (Array.isArray(child) && classifyArrayDelta(child) === "added") {
1650
+ changes2.push({
1651
+ type: "added",
1652
+ path: [...path, newIndex]
1653
+ });
1654
+ continue;
1655
+ }
1656
+ changes2.push(...flattenDelta(child, [...path, newIndex]));
1657
+ }
1658
+ return changes2;
1659
+ }
1660
+ const changes = [];
1661
+ for (const key of Object.keys(deltaRecord).sort()) {
1662
+ const child = deltaRecord[key];
1663
+ if (Array.isArray(child)) {
1664
+ changes.push({
1665
+ type: classifyArrayDelta(child),
1666
+ path: [...path, key]
1667
+ });
1668
+ continue;
1669
+ }
1670
+ changes.push(...flattenDelta(child, [...path, key]));
1671
+ }
1672
+ return changes;
1673
+ }
1674
+ function getValueAtPath(value, path) {
1675
+ let current = value;
1676
+ for (const segment of path) {
1677
+ if (current == null || typeof current !== "object") {
1678
+ return void 0;
1679
+ }
1680
+ if (typeof segment === "number") {
1681
+ if (!Array.isArray(current)) {
1682
+ return void 0;
1683
+ }
1684
+ current = current[segment];
1685
+ continue;
1686
+ }
1687
+ current = current[segment];
1688
+ }
1689
+ return current;
1690
+ }
1691
+ function formatPath(path) {
1692
+ return path.reduce((result, segment) => {
1693
+ if (typeof segment === "number") {
1694
+ return `${result}[${segment}]`;
1695
+ }
1696
+ if (result.length === 0) {
1697
+ return segment;
1698
+ }
1699
+ if (/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(segment)) {
1700
+ return `${result}.${segment}`;
1701
+ }
1702
+ return `${result}[${JSON.stringify(segment)}]`;
1703
+ }, "");
1704
+ }
1705
+ function defaultDescription(type, pathString) {
1706
+ if (type === "added") {
1707
+ return `${pathString} added`;
1708
+ }
1709
+ if (type === "removed") {
1710
+ return `${pathString} removed`;
1711
+ }
1712
+ if (type === "moved") {
1713
+ return `${pathString} moved`;
1714
+ }
1715
+ return `${pathString} modified`;
1716
+ }
1717
+ function defaultSeverity(type) {
1718
+ if (type === "modified") {
1719
+ return "minor";
1720
+ }
1721
+ return "major";
1722
+ }
1723
+ function createEmptyStatistics() {
1724
+ return {
1725
+ added: 0,
1726
+ removed: 0,
1727
+ modified: 0,
1728
+ moved: 0
1729
+ };
1730
+ }
1731
+ function buildStatistics(changes) {
1732
+ const statistics = createEmptyStatistics();
1733
+ for (const change of changes) {
1734
+ statistics[change.type] += 1;
1735
+ }
1736
+ return statistics;
1737
+ }
1738
+ function buildSummary(changes, summaryLabels, options) {
1739
+ if (options?.includeSummary === false) {
1740
+ return "";
1741
+ }
1742
+ if (changes.length === 0) {
1743
+ return "No changes";
1744
+ }
1745
+ const grouped = /* @__PURE__ */ new Map();
1746
+ for (const label of summaryLabels) {
1747
+ grouped.set(label, (grouped.get(label) ?? 0) + 1);
1748
+ }
1749
+ const fragments = [...grouped.entries()].map(([label, count]) => `${count} ${label}`);
1750
+ const noun = changes.length === 1 ? "change" : "changes";
1751
+ return `${changes.length} ${noun}: ${fragments.join(", ")}`;
1752
+ }
1753
+ function shouldSuppressInternalPath(path, fromPath) {
1754
+ const includesInternalField = (segments) => Boolean(segments?.some((segment) => typeof segment === "string" && segment.startsWith(INTERNAL_FIELD_PREFIX)));
1755
+ return includesInternalField(path) || includesInternalField(fromPath);
1756
+ }
1757
+ function defaultSummaryLabel(type) {
1758
+ if (type === "added") {
1759
+ return "item added";
1760
+ }
1761
+ if (type === "removed") {
1762
+ return "item removed";
1763
+ }
1764
+ if (type === "moved") {
1765
+ return "item moved";
1766
+ }
1767
+ return "item modified";
1768
+ }
1769
+ function defaultObjectHash(value, index) {
1770
+ if (!value || typeof value !== "object") {
1771
+ return void 0;
1772
+ }
1773
+ return value.__diffKey ?? (typeof index === "number" ? `__index:${index}` : void 0);
1774
+ }
1775
+ function diffDocuments(before, after, plugin, options) {
1776
+ const normalizedBefore = plugin.normalize(before);
1777
+ const normalizedAfter = plugin.normalize(after);
1778
+ const diffPatch = create({
1779
+ objectHash: defaultObjectHash,
1780
+ arrays: {
1781
+ detectMove: true,
1782
+ includeValueOnMove: false
1783
+ }
1784
+ });
1785
+ const delta = diffPatch.diff(normalizedBefore, normalizedAfter);
1786
+ if (!delta) {
1787
+ return {
1788
+ changes: [],
1789
+ summary: options?.includeSummary === false ? "" : "No changes",
1790
+ statistics: createEmptyStatistics()
1791
+ };
1792
+ }
1793
+ const rawChanges = flattenDelta(delta);
1794
+ const changes = [];
1795
+ const summaryLabels = [];
1796
+ for (const rawChange of rawChanges) {
1797
+ const pathString = formatPath(rawChange.path);
1798
+ const fromPathString = rawChange.fromPath ? formatPath(rawChange.fromPath) : void 0;
1799
+ const context = {
1800
+ type: rawChange.type,
1801
+ path: rawChange.path,
1802
+ pathString,
1803
+ fromPath: rawChange.fromPath,
1804
+ fromPathString,
1805
+ before: rawChange.fromPath ? getValueAtPath(normalizedBefore, rawChange.fromPath) : getValueAtPath(normalizedBefore, rawChange.path),
1806
+ after: getValueAtPath(normalizedAfter, rawChange.path),
1807
+ normalizedBefore,
1808
+ normalizedAfter
1809
+ };
1810
+ if (shouldSuppressInternalPath(rawChange.path, rawChange.fromPath) || plugin.shouldSuppress?.(context)) {
1811
+ continue;
1812
+ }
1813
+ const interpreted = plugin.interpretChange?.(context);
1814
+ if (interpreted === null) {
1815
+ continue;
1816
+ }
1817
+ changes.push({
1818
+ type: rawChange.type,
1819
+ path: pathString,
1820
+ description: interpreted?.description ?? defaultDescription(rawChange.type, pathString),
1821
+ before: context.before,
1822
+ after: context.after,
1823
+ severity: interpreted?.severity ?? defaultSeverity(rawChange.type)
1824
+ });
1825
+ summaryLabels.push(interpreted?.summaryLabel ?? defaultSummaryLabel(rawChange.type));
1826
+ }
1827
+ const statistics = buildStatistics(changes);
1828
+ return {
1829
+ changes,
1830
+ summary: buildSummary(changes, summaryLabels, options),
1831
+ statistics
1832
+ };
1833
+ }
1834
+ function createDiffKey(...parts) {
1835
+ return parts.filter((part) => part !== void 0 && part !== null && part !== "").join(":");
1836
+ }
1837
+
1838
+ // src/diff/document-diff.ts
1839
+ function asRecord(value) {
1840
+ return value && typeof value === "object" ? value : void 0;
1841
+ }
1842
+ function getValueAtPath2(value, path) {
1843
+ let current = value;
1844
+ for (const segment of path) {
1845
+ if (!current || typeof current !== "object") {
1846
+ return void 0;
1847
+ }
1848
+ if (typeof segment === "number") {
1849
+ if (!Array.isArray(current)) {
1850
+ return void 0;
1851
+ }
1852
+ current = current[segment];
1853
+ continue;
1854
+ }
1855
+ current = current[segment];
1856
+ }
1857
+ return current;
1858
+ }
1859
+ function firstNumericAfter(path, segmentName) {
1860
+ const segmentIndex = path.indexOf(segmentName);
1861
+ if (segmentIndex === -1) {
1862
+ return void 0;
1863
+ }
1864
+ const candidate = path[segmentIndex + 1];
1865
+ return typeof candidate === "number" ? candidate : void 0;
1866
+ }
1867
+ function pathIncludes(path, segmentName) {
1868
+ return path.includes(segmentName);
1869
+ }
1870
+ function getSheetName(context) {
1871
+ const sheetIndex = firstNumericAfter(context.path, "sheets");
1872
+ if (sheetIndex === void 0) {
1873
+ return void 0;
1874
+ }
1875
+ const afterSheet = asRecord(context.normalizedAfter.sheets[sheetIndex]);
1876
+ if (typeof afterSheet?.name === "string") {
1877
+ return afterSheet.name;
1878
+ }
1879
+ const beforeSheet = asRecord(context.normalizedBefore.sheets[sheetIndex]);
1880
+ return typeof beforeSheet?.name === "string" ? beforeSheet.name : void 0;
1881
+ }
1882
+ function resolveTableColumnNames(sheet, table) {
1883
+ const range = parseRangeRef(table.ref);
1884
+ const compiled = compileSheetStructure(sheet);
1885
+ const row = compiled.originCells.find((candidate) => candidate.row === range.startRow);
1886
+ return Array.from({ length: range.endCol - range.startCol + 1 }, (_unused, offset) => {
1887
+ const columnDefinition = table.columns?.[offset];
1888
+ const columnIndex = range.startCol + offset;
1889
+ const headerCell = row?.cells.find((cell) => cell.col === columnIndex)?.cell;
1890
+ const cellValue = headerCell?.value;
1891
+ const fallbackName = typeof cellValue === "string" ? cellValue : `Column ${offset + 1}`;
1892
+ return {
1893
+ name: columnDefinition?.name ?? fallbackName,
1894
+ totalsRowLabel: columnDefinition?.totalsRowLabel,
1895
+ totalsRowFunction: columnDefinition?.totalsRowFunction,
1896
+ totalsRowFormula: columnDefinition?.totalsRowFormula
1897
+ };
1898
+ });
1899
+ }
1900
+ function normalizeSheet(sheet) {
1901
+ const compiled = compileSheetStructure(sheet);
1902
+ return {
1903
+ name: sheet.name,
1904
+ state: sheet.state,
1905
+ tabColor: sheet.tabColor,
1906
+ rightToLeft: sheet.rightToLeft,
1907
+ freezePane: sheet.freezePane,
1908
+ autoFilter: compiled.autoFilterRef ?? sheet.autoFilter,
1909
+ protection: sheet.protection,
1910
+ styling: sheet.styling,
1911
+ conditionalFormatting: sheet.conditionalFormatting,
1912
+ columns: sheet.columns,
1913
+ mergeRanges: compiled.mergeRanges.map((range) => ({
1914
+ ref: range.ref,
1915
+ source: range.source,
1916
+ __diffKey: createDiffKey("merge", range.ref)
1917
+ })),
1918
+ tables: (sheet.tables ?? []).map((table) => ({
1919
+ name: table.name,
1920
+ displayName: table.displayName,
1921
+ ref: table.ref,
1922
+ totalsRow: table.totalsRow,
1923
+ columns: resolveTableColumnNames(sheet, table),
1924
+ style: table.style,
1925
+ __diffKey: createDiffKey("table", table.name, table.displayName)
1926
+ })),
1927
+ charts: (sheet.charts ?? []).map((chart) => ({
1928
+ type: chart.type,
1929
+ title: chart.title,
1930
+ series: chart.series,
1931
+ anchor: chart.anchor,
1932
+ width: chart.width,
1933
+ height: chart.height,
1934
+ style: chart.style,
1935
+ __diffKey: createDiffKey("chart", chart.type, chart.title, chart.anchor.from.row, chart.anchor.from.col)
1936
+ })),
1937
+ rows: compiled.originCells.map((row) => ({
1938
+ row: row.row,
1939
+ __diffKey: createDiffKey("row", row.row),
1940
+ cells: row.cells.map((entry) => ({
1941
+ ref: cellRef(entry.row, entry.col),
1942
+ row: entry.row,
1943
+ col: entry.col,
1944
+ value: entry.cell.value,
1945
+ formula: entry.cell.formula,
1946
+ hyperlink: entry.cell.hyperlink,
1947
+ comment: entry.cell.comment,
1948
+ style: entry.cell.style,
1949
+ colSpan: entry.cell.colSpan,
1950
+ rowSpan: entry.cell.rowSpan,
1951
+ __diffKey: createDiffKey("cell", cellRef(entry.row, entry.col))
1952
+ }))
1953
+ }))
1954
+ };
1955
+ }
1956
+ function normalizeSpreadsheetDocument(document) {
1957
+ const parsed = SpreadsheetDocumentSchema.parse(document);
1958
+ return {
1959
+ meta: parsed.meta,
1960
+ theme: parsed.theme,
1961
+ defaults: parsed.defaults,
1962
+ namedRanges: parsed.namedRanges?.map((namedRange) => ({
1963
+ ...namedRange,
1964
+ __diffKey: createDiffKey("named-range", namedRange.name, namedRange.scope)
1965
+ })),
1966
+ sheets: parsed.sheets.map((sheet) => ({
1967
+ ...normalizeSheet(sheet),
1968
+ __diffKey: createDiffKey("sheet", sheet.name)
1969
+ }))
1970
+ };
1971
+ }
1972
+ function findNearestObjectWithField(context, fieldName) {
1973
+ for (let index = context.path.length; index > 0; index -= 1) {
1974
+ const candidatePath = context.path.slice(0, index);
1975
+ const afterValue = asRecord(getValueAtPath2(context.normalizedAfter, candidatePath));
1976
+ if (afterValue && fieldName in afterValue) {
1977
+ return afterValue;
1978
+ }
1979
+ const beforeValue = asRecord(getValueAtPath2(context.normalizedBefore, candidatePath));
1980
+ if (beforeValue && fieldName in beforeValue) {
1981
+ return beforeValue;
1982
+ }
1983
+ }
1984
+ return void 0;
1985
+ }
1986
+ function capitalize(value) {
1987
+ return value.length > 0 ? `${value[0].toUpperCase()}${value.slice(1)}` : value;
1988
+ }
1989
+ function verbPhrase(type) {
1990
+ switch (type) {
1991
+ case "added":
1992
+ return "added";
1993
+ case "removed":
1994
+ return "removed";
1995
+ case "moved":
1996
+ return "moved";
1997
+ default:
1998
+ return "changed";
1999
+ }
2000
+ }
2001
+ function interpretTopLevel(context) {
2002
+ if (context.path[0] === "sheets" && typeof context.path[1] === "number" && context.path.length === 2) {
2003
+ const sheet = asRecord(context.after) ?? asRecord(context.before);
2004
+ const sheetName = typeof sheet?.name === "string" ? sheet.name : `Sheet ${context.path[1] + 1}`;
2005
+ return {
2006
+ description: `Sheet "${sheetName}" ${verbPhrase(context.type)}`,
2007
+ severity: "major",
2008
+ summaryLabel: `sheet ${context.type === "modified" ? "modified" : context.type}`
2009
+ };
2010
+ }
2011
+ if (context.path[0] === "namedRanges") {
2012
+ return {
2013
+ description: "Named range changed",
2014
+ severity: "minor",
2015
+ summaryLabel: "named range modified"
2016
+ };
2017
+ }
2018
+ if (context.path[0] === "meta" || context.path[0] === "theme" || context.path[0] === "defaults") {
2019
+ return {
2020
+ description: `${String(context.path[0])} changed`,
2021
+ severity: "cosmetic",
2022
+ summaryLabel: "workbook styling modified"
2023
+ };
2024
+ }
2025
+ return void 0;
2026
+ }
2027
+ function interpretSpreadsheetChange(context) {
2028
+ const topLevel = interpretTopLevel(context);
2029
+ if (topLevel) {
2030
+ return topLevel;
2031
+ }
2032
+ const sheetName = getSheetName(context);
2033
+ const sheetLabel = sheetName ? `"${sheetName}"` : "workbook";
2034
+ if (sheetName && pathIncludes(context.path, "mergeRanges")) {
2035
+ const mergeRange = findNearestObjectWithField(context, "ref");
2036
+ const ref = typeof mergeRange?.ref === "string" ? mergeRange.ref : "merged range";
2037
+ return {
2038
+ description: `Merged range ${ref} ${verbPhrase(context.type)} in ${sheetLabel}`,
2039
+ severity: "major",
2040
+ summaryLabel: `merged range ${context.type === "modified" ? "modified" : context.type}`
2041
+ };
2042
+ }
2043
+ if (sheetName && pathIncludes(context.path, "tables")) {
2044
+ const table = findNearestObjectWithField(context, "name");
2045
+ const tableName = typeof table?.name === "string" ? table.name : "table";
2046
+ return {
2047
+ description: `Table "${tableName}" ${verbPhrase(context.type)} in ${sheetLabel}`,
2048
+ severity: context.type === "modified" ? "minor" : "major",
2049
+ summaryLabel: `table ${context.type === "modified" ? "modified" : context.type}`
2050
+ };
2051
+ }
2052
+ if (sheetName && pathIncludes(context.path, "charts")) {
2053
+ return {
2054
+ description: `Chart changed in ${sheetLabel}`,
2055
+ severity: context.type === "modified" ? "minor" : "major",
2056
+ summaryLabel: `chart ${context.type === "modified" ? "modified" : context.type}`
2057
+ };
2058
+ }
2059
+ if (sheetName && pathIncludes(context.path, "rows")) {
2060
+ const rowObject = findNearestObjectWithField(context, "row");
2061
+ const cellObject = findNearestObjectWithField(context, "ref");
2062
+ const rowNumber = typeof rowObject?.row === "number" ? rowObject.row + 1 : void 0;
2063
+ const cellName = typeof cellObject?.ref === "string" ? cellObject.ref : void 0;
2064
+ if (cellName) {
2065
+ if (pathIncludes(context.path, "formula")) {
2066
+ return {
2067
+ description: `Formula changed for cell ${cellName} in ${sheetLabel}`,
2068
+ severity: "minor",
2069
+ summaryLabel: "formula modified"
2070
+ };
2071
+ }
2072
+ if (pathIncludes(context.path, "comment")) {
2073
+ return {
2074
+ description: `Comment changed for cell ${cellName} in ${sheetLabel}`,
2075
+ severity: "minor",
2076
+ summaryLabel: "comment modified"
2077
+ };
2078
+ }
2079
+ if (pathIncludes(context.path, "hyperlink")) {
2080
+ return {
2081
+ description: `Hyperlink changed for cell ${cellName} in ${sheetLabel}`,
2082
+ severity: "minor",
2083
+ summaryLabel: "hyperlink modified"
2084
+ };
2085
+ }
2086
+ return {
2087
+ description: `Cell ${cellName} changed in ${sheetLabel}`,
2088
+ severity: "minor",
2089
+ summaryLabel: "cell modified"
2090
+ };
2091
+ }
2092
+ if (rowNumber !== void 0) {
2093
+ return {
2094
+ description: `Row ${rowNumber} ${verbPhrase(context.type)} in ${sheetLabel}`,
2095
+ severity: context.type === "modified" ? "minor" : "major",
2096
+ summaryLabel: `row ${context.type === "modified" ? "modified" : context.type}`
2097
+ };
2098
+ }
2099
+ }
2100
+ return {
2101
+ description: `${capitalize(context.pathString)} ${verbPhrase(context.type)}`,
2102
+ severity: context.type === "modified" ? "minor" : "major",
2103
+ summaryLabel: `sheet content ${context.type === "modified" ? "modified" : context.type}`
2104
+ };
2105
+ }
2106
+ var spreadsheetDiffPlugin = {
2107
+ normalize: normalizeSpreadsheetDocument,
2108
+ interpretChange: interpretSpreadsheetChange
2109
+ };
2110
+ function diffSpreadsheetDocuments(before, after, options) {
2111
+ return diffDocuments(before, after, spreadsheetDiffPlugin, options);
2112
+ }
2113
+ export {
2114
+ F,
2115
+ FREE_XLSX_CHART_TYPES,
2116
+ FormulaEvaluator,
2117
+ PRESETS,
2118
+ PRESET_NAMES,
2119
+ SharedStringTable,
2120
+ SheetNameSchema,
2121
+ SpreadsheetCellSchema,
2122
+ SpreadsheetColumnSchema,
2123
+ SpreadsheetDefaultsSchema,
2124
+ SpreadsheetDocumentSchema,
2125
+ SpreadsheetEngine,
2126
+ SpreadsheetMetaSchema,
2127
+ SpreadsheetRowSchema,
2128
+ SpreadsheetSheetSchema,
2129
+ SpreadsheetTemplateAssemblyError,
2130
+ SpreadsheetTemplateParseError,
2131
+ SpreadsheetValidationError,
2132
+ StyleRegistry,
2133
+ ThemeConfigSchema,
2134
+ absCellRef,
2135
+ absRangeRef,
2136
+ cellRef,
2137
+ colIndexToLetter,
2138
+ createRenderPlan,
2139
+ diffSpreadsheetDocuments,
2140
+ extractSheetReferences,
2141
+ formatSheetRange,
2142
+ formatSheetRef,
2143
+ getPhase1Fixture,
2144
+ listPhase1Fixtures,
2145
+ listPhase2Fixtures,
2146
+ listPhase3Fixtures,
2147
+ listPhase4Fixtures,
2148
+ normalizeHyperlink,
2149
+ normalizeHyperlinkLocation,
2150
+ offsetFormulaRows,
2151
+ parseCellRef,
2152
+ parseRangeRef,
2153
+ phase1Fixtures,
2154
+ phase2Fixtures,
2155
+ phase3Fixtures,
2156
+ phase4Fixtures,
2157
+ preflightSpreadsheet,
2158
+ rangeRef,
2159
+ remediateSpreadsheetAccessibility,
2160
+ rowIndexToRowNum,
2161
+ shiftFormulaRows,
2162
+ validateSpreadsheetAccessibility,
2163
+ validateSpreadsheetBuffer,
2164
+ validateSpreadsheetDocument,
2165
+ validateXlsxStructure
2166
+ };
2167
+ //# sourceMappingURL=index.js.map