@pixerate/editor 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -1
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/dist/agent/index.cjs +10 -9
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +4 -3
- package/dist/agent/index.js.map +1 -1
- package/dist/canvas/index.cjs +3173 -340
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +617 -4
- package/dist/canvas/index.d.ts +617 -4
- package/dist/canvas/index.js +3105 -272
- package/dist/canvas/index.js.map +1 -1
- package/dist/chunk-4BVP64JJ.cjs +1406 -0
- package/dist/chunk-4BVP64JJ.cjs.map +1 -0
- package/dist/{chunk-XNORY7M6.cjs → chunk-7WISYZFO.cjs} +105 -50
- package/dist/chunk-7WISYZFO.cjs.map +1 -0
- package/dist/{chunk-OLZJXL4R.cjs → chunk-AL6JMGWW.cjs} +59 -25
- package/dist/chunk-AL6JMGWW.cjs.map +1 -0
- package/dist/chunk-BVP3TSLH.cjs +69 -0
- package/dist/chunk-BVP3TSLH.cjs.map +1 -0
- package/dist/{chunk-MCSJFWAO.cjs → chunk-C7P22VIP.cjs} +670 -96
- package/dist/chunk-C7P22VIP.cjs.map +1 -0
- package/dist/{chunk-PGNZKFQS.js → chunk-ECCCYKGL.js} +76 -21
- package/dist/chunk-ECCCYKGL.js.map +1 -0
- package/dist/{chunk-3CN2WD3X.js → chunk-FH6F67DN.js} +646 -72
- package/dist/chunk-FH6F67DN.js.map +1 -0
- package/dist/chunk-HRMEDT2L.js +1406 -0
- package/dist/chunk-HRMEDT2L.js.map +1 -0
- package/dist/{chunk-ITBSKI26.js → chunk-IXHSYOVY.js} +941 -9
- package/dist/chunk-IXHSYOVY.js.map +1 -0
- package/dist/{chunk-FODNLX5N.js → chunk-NAXVVS5I.js} +38 -4
- package/dist/chunk-NAXVVS5I.js.map +1 -0
- package/dist/chunk-O5RYH2PG.js +69 -0
- package/dist/chunk-O5RYH2PG.js.map +1 -0
- package/dist/{chunk-SBCZ6RN5.cjs → chunk-PO6A6QQH.cjs} +1039 -107
- package/dist/chunk-PO6A6QQH.cjs.map +1 -0
- package/dist/{chunk-3LV6RRPH.js → chunk-QGYDWPRM.js} +2 -2
- package/dist/{chunk-U5KWZU4X.js → chunk-RR7F5GUM.js} +2632 -129
- package/dist/chunk-RR7F5GUM.js.map +1 -0
- package/dist/{chunk-5S3Z4PPF.js → chunk-UAKDG62Z.js} +232 -25
- package/dist/chunk-UAKDG62Z.js.map +1 -0
- package/dist/{chunk-SML64VJG.cjs → chunk-V3CHHWOE.cjs} +4 -4
- package/dist/{chunk-SML64VJG.cjs.map → chunk-V3CHHWOE.cjs.map} +1 -1
- package/dist/chunk-WSQKHXW7.cjs +5726 -0
- package/dist/chunk-WSQKHXW7.cjs.map +1 -0
- package/dist/{chunk-D27YFC46.cjs → chunk-X4N4WUKB.cjs} +267 -60
- package/dist/chunk-X4N4WUKB.cjs.map +1 -0
- package/dist/commands/index.cjs +74 -1
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +34 -1
- package/dist/commands/index.d.ts +34 -1
- package/dist/commands/index.js +73 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/compare/index.cjs +3 -3
- package/dist/compare/index.d.cts +1 -1
- package/dist/compare/index.d.ts +1 -1
- package/dist/compare/index.js +2 -2
- package/dist/controller-BIJiNoVs.d.cts +1842 -0
- package/dist/controller-BIJiNoVs.d.ts +1842 -0
- package/dist/{documents-BQjzJNe2.d.ts → documents-CHT1U5Vs.d.ts} +10 -0
- package/dist/{documents-KRTPhvst.d.cts → documents-Gp7wb0Me.d.cts} +10 -0
- package/dist/extensions/index.cjs +53 -6
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +12 -4
- package/dist/extensions/index.d.ts +12 -4
- package/dist/extensions/index.js +53 -6
- package/dist/generation/index.cjs +1013 -69
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.d.cts +474 -13
- package/dist/generation/index.d.ts +474 -13
- package/dist/generation/index.js +976 -32
- package/dist/generation/index.js.map +1 -1
- package/dist/image-editor/index.cjs +3385 -1275
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +693 -128
- package/dist/image-editor/index.d.ts +693 -128
- package/dist/image-editor/index.js +3325 -1215
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{index-fJrlkJCd.d.ts → index-7a6bHTLy.d.ts} +494 -5
- package/dist/{index-BhJBSm2d.d.cts → index-Csd5qI8u.d.cts} +494 -5
- package/dist/index.cjs +1491 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +110 -19
- package/dist/index.d.ts +110 -19
- package/dist/index.js +1464 -18
- package/dist/index.js.map +1 -1
- package/dist/mention-text-CDnCFd3c.d.cts +53 -0
- package/dist/mention-text-CDnCFd3c.d.ts +53 -0
- package/dist/model-C1zApQM8.d.cts +219 -0
- package/dist/model-C1zApQM8.d.ts +219 -0
- package/dist/persistence/index.d.cts +3 -120
- package/dist/persistence/index.d.ts +3 -120
- package/dist/{registry-GJI4gToU.d.cts → registry-CEgwXED1.d.cts} +12 -1
- package/dist/{registry-GJI4gToU.d.ts → registry-CEgwXED1.d.ts} +12 -1
- package/dist/serializers/index.cjs +12 -4
- package/dist/serializers/index.cjs.map +1 -1
- package/dist/serializers/index.d.cts +39 -12
- package/dist/serializers/index.d.ts +39 -12
- package/dist/serializers/index.js +12 -4
- package/dist/spreadsheet/index.cjs +127 -3
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +431 -11
- package/dist/spreadsheet/index.d.ts +431 -11
- package/dist/spreadsheet/index.js +127 -3
- package/dist/storage-BpFfspHm.d.cts +120 -0
- package/dist/storage-BpFfspHm.d.ts +120 -0
- package/dist/tokens/index.cjs +115 -0
- package/dist/tokens/index.cjs.map +1 -0
- package/dist/tokens/index.d.cts +212 -0
- package/dist/tokens/index.d.ts +212 -0
- package/dist/tokens/index.js +115 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/{track-changes-BK5sVf4_.d.cts → track-changes-D_VAPELi.d.cts} +95 -11
- package/dist/{track-changes-CDjCrwKe.d.ts → track-changes-Db_fGEvx.d.ts} +95 -11
- package/package.json +6 -1
- package/dist/chunk-3CN2WD3X.js.map +0 -1
- package/dist/chunk-5S3Z4PPF.js.map +0 -1
- package/dist/chunk-D27YFC46.cjs.map +0 -1
- package/dist/chunk-FODNLX5N.js.map +0 -1
- package/dist/chunk-ITBSKI26.js.map +0 -1
- package/dist/chunk-MA2F5KHF.cjs +0 -3223
- package/dist/chunk-MA2F5KHF.cjs.map +0 -1
- package/dist/chunk-MCSJFWAO.cjs.map +0 -1
- package/dist/chunk-OLZJXL4R.cjs.map +0 -1
- package/dist/chunk-PGNZKFQS.js.map +0 -1
- package/dist/chunk-SBCZ6RN5.cjs.map +0 -1
- package/dist/chunk-U5KWZU4X.js.map +0 -1
- package/dist/chunk-XNORY7M6.cjs.map +0 -1
- package/dist/controller-BhLLAoi8.d.cts +0 -1000
- package/dist/controller-BhLLAoi8.d.ts +0 -1000
- /package/dist/{chunk-3LV6RRPH.js.map → chunk-QGYDWPRM.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -160,13 +160,31 @@ var _chunkFD4LPFAEcjs = require('./chunk-FD4LPFAE.cjs');
|
|
|
160
160
|
|
|
161
161
|
|
|
162
162
|
|
|
163
|
-
var _chunkSBCZ6RN5cjs = require('./chunk-SBCZ6RN5.cjs');
|
|
164
163
|
|
|
165
164
|
|
|
166
165
|
|
|
167
166
|
|
|
168
167
|
|
|
169
|
-
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
var _chunkPO6A6QQHcjs = require('./chunk-PO6A6QQH.cjs');
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
var _chunkAL6JMGWWcjs = require('./chunk-AL6JMGWW.cjs');
|
|
170
188
|
|
|
171
189
|
|
|
172
190
|
|
|
@@ -201,7 +219,37 @@ require('./chunk-JACER6TE.cjs');
|
|
|
201
219
|
|
|
202
220
|
|
|
203
221
|
|
|
204
|
-
var
|
|
222
|
+
var _chunkV3CHHWOEcjs = require('./chunk-V3CHHWOE.cjs');
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
205
253
|
|
|
206
254
|
|
|
207
255
|
|
|
@@ -259,7 +307,36 @@ var _chunkSML64VJGcjs = require('./chunk-SML64VJG.cjs');
|
|
|
259
307
|
|
|
260
308
|
|
|
261
309
|
|
|
262
|
-
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
var _chunkWSQKHXW7cjs = require('./chunk-WSQKHXW7.cjs');
|
|
263
340
|
|
|
264
341
|
|
|
265
342
|
|
|
@@ -292,8 +369,16 @@ var _chunkG2I4QJOTcjs = require('./chunk-G2I4QJOT.cjs');
|
|
|
292
369
|
|
|
293
370
|
|
|
294
371
|
|
|
372
|
+
var _chunk7WISYZFOcjs = require('./chunk-7WISYZFO.cjs');
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
var _chunkBVP3TSLHcjs = require('./chunk-BVP3TSLH.cjs');
|
|
379
|
+
|
|
380
|
+
|
|
295
381
|
|
|
296
|
-
var _chunkXNORY7M6cjs = require('./chunk-XNORY7M6.cjs');
|
|
297
382
|
|
|
298
383
|
|
|
299
384
|
|
|
@@ -317,9 +402,9 @@ var _chunkXNORY7M6cjs = require('./chunk-XNORY7M6.cjs');
|
|
|
317
402
|
|
|
318
403
|
|
|
319
404
|
|
|
320
|
-
var _chunkD27YFC46cjs = require('./chunk-D27YFC46.cjs');
|
|
321
405
|
|
|
322
406
|
|
|
407
|
+
var _chunkX4N4WUKBcjs = require('./chunk-X4N4WUKB.cjs');
|
|
323
408
|
|
|
324
409
|
|
|
325
410
|
|
|
@@ -360,7 +445,12 @@ var _chunkD27YFC46cjs = require('./chunk-D27YFC46.cjs');
|
|
|
360
445
|
|
|
361
446
|
|
|
362
447
|
|
|
363
|
-
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
var _chunkC7P22VIPcjs = require('./chunk-C7P22VIP.cjs');
|
|
364
454
|
|
|
365
455
|
// src/controller.ts
|
|
366
456
|
var _core = require('@tiptap/core');
|
|
@@ -393,18 +483,18 @@ var EditorController = class {
|
|
|
393
483
|
this.onMarkdownChange = onMarkdownChange;
|
|
394
484
|
this.onTokensChange = onTokensChange;
|
|
395
485
|
this.onSelectionChange = onSelectionChange;
|
|
396
|
-
const initialContent = plainTextMode && typeof content === "string" ?
|
|
486
|
+
const initialContent = plainTextMode && typeof content === "string" ? _chunk7WISYZFOcjs.plainTextToTipTapHtml.call(void 0, content) : markdownMode && typeof content === "string" ? _chunk7WISYZFOcjs.markdownToTipTapHtml.call(void 0, content) : content;
|
|
397
487
|
this.editor = new (0, _core.Editor)({
|
|
398
488
|
element: element || void 0,
|
|
399
489
|
content: initialContent,
|
|
400
490
|
extensions,
|
|
401
491
|
...editorOptions,
|
|
402
492
|
onUpdate: (props) => {
|
|
403
|
-
_optionalChain([editorOptions, 'access',
|
|
493
|
+
_optionalChain([editorOptions, 'access', _2 => _2.onUpdate, 'optionalCall', _3 => _3(props)]);
|
|
404
494
|
this.handleUpdate();
|
|
405
495
|
},
|
|
406
496
|
onSelectionUpdate: (props) => {
|
|
407
|
-
_optionalChain([editorOptions, 'access',
|
|
497
|
+
_optionalChain([editorOptions, 'access', _4 => _4.onSelectionUpdate, 'optionalCall', _5 => _5(props)]);
|
|
408
498
|
this.handleSelectionUpdate();
|
|
409
499
|
}
|
|
410
500
|
});
|
|
@@ -414,9 +504,9 @@ var EditorController = class {
|
|
|
414
504
|
this.baselineContent = this.getCurrentContentString();
|
|
415
505
|
}
|
|
416
506
|
enforcePlainTextClipboard() {
|
|
417
|
-
const richClipboard = _optionalChain([this, 'access',
|
|
507
|
+
const richClipboard = _optionalChain([this, 'access', _6 => _6.editor, 'access', _7 => _7.storage, 'optionalAccess', _8 => _8.richClipboard]);
|
|
418
508
|
if (richClipboard) richClipboard.plainTextMode = true;
|
|
419
|
-
const fileImport = _optionalChain([this, 'access',
|
|
509
|
+
const fileImport = _optionalChain([this, 'access', _9 => _9.editor, 'access', _10 => _10.extensionManager, 'optionalAccess', _11 => _11.extensions, 'access', _12 => _12.find, 'call', _13 => _13(
|
|
420
510
|
(ext) => ext.name === "fileImport"
|
|
421
511
|
)]);
|
|
422
512
|
if (fileImport) fileImport.options.asPlainText = true;
|
|
@@ -424,9 +514,9 @@ var EditorController = class {
|
|
|
424
514
|
editorProps: {
|
|
425
515
|
...this.editor.options.editorProps,
|
|
426
516
|
clipboardTextParser: (text, context, _plain, view) => {
|
|
427
|
-
const schema = _optionalChain([context, 'optionalAccess',
|
|
517
|
+
const schema = _optionalChain([context, 'optionalAccess', _14 => _14.doc, 'optionalAccess', _15 => _15.type, 'optionalAccess', _16 => _16.schema]) || _optionalChain([context, 'optionalAccess', _17 => _17.schema]) || _optionalChain([view, 'optionalAccess', _18 => _18.state, 'optionalAccess', _19 => _19.schema]) || this.editor.schema;
|
|
428
518
|
if (!schema) return _model.Slice.empty;
|
|
429
|
-
return
|
|
519
|
+
return _chunk7WISYZFOcjs.plainTextToSlice.call(void 0, text, schema);
|
|
430
520
|
}
|
|
431
521
|
}
|
|
432
522
|
});
|
|
@@ -434,7 +524,7 @@ var EditorController = class {
|
|
|
434
524
|
handleUpdate() {
|
|
435
525
|
if (this.plainTextMode || this.onPlainTextChange || this.onTokensChange) {
|
|
436
526
|
const text = this.getPlainText();
|
|
437
|
-
_optionalChain([this, 'access',
|
|
527
|
+
_optionalChain([this, 'access', _20 => _20.onPlainTextChange, 'optionalCall', _21 => _21(text)]);
|
|
438
528
|
if (this.onTokensChange) {
|
|
439
529
|
const tokens = _chunkFD4LPFAEcjs.tokenizePrompt.call(void 0, text);
|
|
440
530
|
this.onTokensChange(tokens);
|
|
@@ -442,7 +532,7 @@ var EditorController = class {
|
|
|
442
532
|
}
|
|
443
533
|
if (this.markdownMode || this.onMarkdownChange) {
|
|
444
534
|
const markdown = this.getMarkdown();
|
|
445
|
-
_optionalChain([this, 'access',
|
|
535
|
+
_optionalChain([this, 'access', _22 => _22.onMarkdownChange, 'optionalCall', _23 => _23(markdown)]);
|
|
446
536
|
}
|
|
447
537
|
}
|
|
448
538
|
handleSelectionUpdate() {
|
|
@@ -452,20 +542,20 @@ var EditorController = class {
|
|
|
452
542
|
}
|
|
453
543
|
}
|
|
454
544
|
getPlainText() {
|
|
455
|
-
return
|
|
545
|
+
return _chunk7WISYZFOcjs.getEditorText.call(void 0, this.editor);
|
|
456
546
|
}
|
|
457
547
|
setPlainText(text, emitUpdate = true) {
|
|
458
|
-
const html =
|
|
548
|
+
const html = _chunk7WISYZFOcjs.plainTextToTipTapHtml.call(void 0, text);
|
|
459
549
|
this.editor.commands.setContent(html, emitUpdate);
|
|
460
550
|
}
|
|
461
551
|
getMarkdown() {
|
|
462
|
-
return
|
|
552
|
+
return _chunk7WISYZFOcjs.getEditorMarkdown.call(void 0, this.editor);
|
|
463
553
|
}
|
|
464
554
|
setMarkdown(markdown, emitUpdate = true) {
|
|
465
|
-
if (_optionalChain([this, 'access',
|
|
555
|
+
if (_optionalChain([this, 'access', _24 => _24.editor, 'access', _25 => _25.storage, 'optionalAccess', _26 => _26.markdown, 'optionalAccess', _27 => _27.parser])) {
|
|
466
556
|
this.editor.commands.setContent(markdown, emitUpdate);
|
|
467
557
|
} else {
|
|
468
|
-
const html =
|
|
558
|
+
const html = _chunk7WISYZFOcjs.markdownToTipTapHtml.call(void 0, markdown);
|
|
469
559
|
this.editor.commands.setContent(html, emitUpdate);
|
|
470
560
|
}
|
|
471
561
|
}
|
|
@@ -475,7 +565,7 @@ var EditorController = class {
|
|
|
475
565
|
*/
|
|
476
566
|
insertPlainText(from, to, text) {
|
|
477
567
|
const { state, view } = this.editor;
|
|
478
|
-
const tr = text.includes("\n") || text.includes("\r") ? state.tr.replace(from, to,
|
|
568
|
+
const tr = text.includes("\n") || text.includes("\r") ? state.tr.replace(from, to, _chunk7WISYZFOcjs.plainTextToSlice.call(void 0, text, state.schema)) : text ? state.tr.insertText(text, from, to) : state.tr.delete(from, to);
|
|
479
569
|
view.dispatch(tr.scrollIntoView());
|
|
480
570
|
}
|
|
481
571
|
/** Inserts text literally at the selection; HTML in `text` is not parsed. */
|
|
@@ -524,7 +614,7 @@ function pickImportFiles(options = {}) {
|
|
|
524
614
|
return new Promise((resolve) => {
|
|
525
615
|
const input = document.createElement("input");
|
|
526
616
|
input.type = "file";
|
|
527
|
-
input.accept = _nullishCoalesce(options.accept, () => (
|
|
617
|
+
input.accept = _nullishCoalesce(options.accept, () => ( _chunkPO6A6QQHcjs.defaultImportRegistry.accept("document")));
|
|
528
618
|
input.multiple = _nullishCoalesce(options.multiple, () => ( true));
|
|
529
619
|
input.style.display = "none";
|
|
530
620
|
const finish = (files) => {
|
|
@@ -552,7 +642,7 @@ var FileImportController = (_class = class {
|
|
|
552
642
|
}
|
|
553
643
|
/** `accept` attribute value for document imports. */
|
|
554
644
|
get accept() {
|
|
555
|
-
return (_nullishCoalesce(this.options.registry, () => (
|
|
645
|
+
return (_nullishCoalesce(this.options.registry, () => ( _chunkPO6A6QQHcjs.defaultImportRegistry))).accept("document");
|
|
556
646
|
}
|
|
557
647
|
__init4() {this.getState = () => this.state}
|
|
558
648
|
__init5() {this.subscribe = (listener) => {
|
|
@@ -574,12 +664,12 @@ var FileImportController = (_class = class {
|
|
|
574
664
|
this.setState({ isImporting: true, error: null });
|
|
575
665
|
let error = null;
|
|
576
666
|
try {
|
|
577
|
-
const outcomes = await
|
|
667
|
+
const outcomes = await _chunkPO6A6QQHcjs.importFilesIntoEditor.call(void 0, target, list, {
|
|
578
668
|
...this.options,
|
|
579
669
|
at,
|
|
580
670
|
onError: (err, file) => {
|
|
581
671
|
error = err;
|
|
582
|
-
_optionalChain([this, 'access',
|
|
672
|
+
_optionalChain([this, 'access', _31 => _31.options, 'access', _32 => _32.onError, 'optionalCall', _33 => _33(err, file)]);
|
|
583
673
|
}
|
|
584
674
|
});
|
|
585
675
|
this.pending--;
|
|
@@ -600,10 +690,1026 @@ var FileImportController = (_class = class {
|
|
|
600
690
|
function createFileImportController(getTarget, options) {
|
|
601
691
|
return new FileImportController(getTarget, options);
|
|
602
692
|
}
|
|
693
|
+
function summarizeImportStructure(outcomes) {
|
|
694
|
+
const reports = outcomes.map((outcome) => _optionalChain([outcome, 'access', _34 => _34.result, 'optionalAccess', _35 => _35.structure])).filter((report) => !!report);
|
|
695
|
+
if (!reports.length) return null;
|
|
696
|
+
const modes = new Set(reports.map((report) => report.mode));
|
|
697
|
+
const sum = (pick) => reports.reduce((total, report) => total + pick(report), 0);
|
|
698
|
+
return {
|
|
699
|
+
files: reports.length,
|
|
700
|
+
mode: modes.size > 1 ? "mixed" : reports[0].mode,
|
|
701
|
+
headings: sum((r) => r.counts.headings),
|
|
702
|
+
lists: sum((r) => r.counts.lists),
|
|
703
|
+
tables: sum((r) => r.counts.tables),
|
|
704
|
+
paragraphs: sum((r) => r.counts.paragraphs),
|
|
705
|
+
multiColumnPages: sum((r) => r.multiColumnPages),
|
|
706
|
+
confidence: Math.round(sum((r) => r.confidence) / reports.length * 100) / 100
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// src/import/pdf-layout.ts
|
|
711
|
+
var MAX_COLS = 63;
|
|
712
|
+
var MAX_TABLE_ROWS = 2e3;
|
|
713
|
+
var MAX_RULES = 2e3;
|
|
714
|
+
var MAX_DEPTH = 4;
|
|
715
|
+
var BULLET_GLYPH_RE = /^[•◦▪▫●○■□‣⁃∙·➢►▶✓✔❖]\s*/;
|
|
716
|
+
var BULLET_DASH_RE = /^[-–—*]\s+/;
|
|
717
|
+
var ORDERED_RE = /^(?:\((\d{1,3}|[a-zA-Z]|[ivxlcIVXLC]{1,6})\)|(\d{1,3}|[a-zA-Z]|[ivxlcIVXLC]{1,6})[.)])\s+/;
|
|
718
|
+
var MARKER_ONLY_RE = /^(?:[•◦▪▫●○■□‣⁃∙·➢►▶✓✔❖]|\(?(?:\d{1,3}|[a-zA-Z]|[ivxlcIVXLC]{1,6})[.)])$/;
|
|
719
|
+
var PAGE_NUMBER_RE = /^(?:page\s+)?(?:\d{1,4}|[ivxlcdm]{1,7})(?:\s*(?:of|\/)\s*\d{1,4})?$/i;
|
|
720
|
+
var DASHED_PAGE_NUMBER_RE = /^[-–—]\s*\d{1,4}\s*[-–—]$/;
|
|
721
|
+
var SENTENCE_END_RE = /[.!?:;]["'”’)\]]?$/;
|
|
722
|
+
var BOLD_FONT_RE = /bold|black|heavy|semibold|demi/i;
|
|
723
|
+
var ITALIC_FONT_RE = /italic|oblique/i;
|
|
724
|
+
function minOf(list, fn) {
|
|
725
|
+
let min = Infinity;
|
|
726
|
+
for (const item of list) min = Math.min(min, fn(item));
|
|
727
|
+
return min;
|
|
728
|
+
}
|
|
729
|
+
function maxOf(list, fn) {
|
|
730
|
+
let max = -Infinity;
|
|
731
|
+
for (const item of list) max = Math.max(max, fn(item));
|
|
732
|
+
return max;
|
|
733
|
+
}
|
|
734
|
+
function lowerBound(values, target) {
|
|
735
|
+
let lo = 0;
|
|
736
|
+
let hi = values.length;
|
|
737
|
+
while (lo < hi) {
|
|
738
|
+
const mid = lo + hi >> 1;
|
|
739
|
+
if (values[mid] < target) lo = mid + 1;
|
|
740
|
+
else hi = mid;
|
|
741
|
+
}
|
|
742
|
+
return lo;
|
|
743
|
+
}
|
|
744
|
+
function median(values) {
|
|
745
|
+
if (!values.length) return 0;
|
|
746
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
747
|
+
const mid = sorted.length >> 1;
|
|
748
|
+
return sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
|
|
749
|
+
}
|
|
750
|
+
var countWords = (text) => {
|
|
751
|
+
let words = 0;
|
|
752
|
+
let inWord = false;
|
|
753
|
+
for (let i = 0; i < text.length; i++) {
|
|
754
|
+
const space = text.charCodeAt(i) <= 32;
|
|
755
|
+
if (!space && !inWord) words++;
|
|
756
|
+
inWord = !space;
|
|
757
|
+
}
|
|
758
|
+
return words;
|
|
759
|
+
};
|
|
760
|
+
var collapse = (text) => text.replace(/\s+/g, " ").trim();
|
|
761
|
+
function runSize(run) {
|
|
762
|
+
if (run.fontSize && run.fontSize > 0) return run.fontSize;
|
|
763
|
+
if (run.height && run.height > 0) return run.height;
|
|
764
|
+
return 10;
|
|
765
|
+
}
|
|
766
|
+
function buildFragments(runs) {
|
|
767
|
+
const items = runs.filter((run) => typeof run.text === "string" && run.text.trim() !== "" && Number.isFinite(run.x) && Number.isFinite(run.y)).map((run) => {
|
|
768
|
+
const size = runSize(run);
|
|
769
|
+
const width = run.width !== void 0 && run.width >= 0 ? run.width : run.text.length * size * 0.5;
|
|
770
|
+
return {
|
|
771
|
+
text: run.text,
|
|
772
|
+
x0: run.x,
|
|
773
|
+
x1: run.x + width,
|
|
774
|
+
y: run.y,
|
|
775
|
+
size,
|
|
776
|
+
bold: _nullishCoalesce(run.bold, () => ( BOLD_FONT_RE.test(_nullishCoalesce(run.fontName, () => ( ""))))),
|
|
777
|
+
italic: _nullishCoalesce(run.italic, () => ( ITALIC_FONT_RE.test(_nullishCoalesce(run.fontName, () => ( "")))))
|
|
778
|
+
};
|
|
779
|
+
});
|
|
780
|
+
items.sort((a, b) => b.y - a.y || a.x0 - b.x0);
|
|
781
|
+
const frags = [];
|
|
782
|
+
let i = 0;
|
|
783
|
+
while (i < items.length) {
|
|
784
|
+
const anchor = items[i];
|
|
785
|
+
let j = i + 1;
|
|
786
|
+
while (j < items.length && anchor.y - items[j].y <= Math.max(1, Math.min(anchor.size, items[j].size) * 0.5)) j++;
|
|
787
|
+
const row = items.slice(i, j).sort((a, b) => a.x0 - b.x0);
|
|
788
|
+
i = j;
|
|
789
|
+
let current = null;
|
|
790
|
+
const finish = () => {
|
|
791
|
+
if (!current) return;
|
|
792
|
+
let best = "";
|
|
793
|
+
let bestChars = -1;
|
|
794
|
+
current.styleChars.forEach((chars, key) => {
|
|
795
|
+
if (chars > bestChars) {
|
|
796
|
+
best = key;
|
|
797
|
+
bestChars = chars;
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
const [size, bold, italic] = best.split("|");
|
|
801
|
+
current.size = Number(size);
|
|
802
|
+
current.bold = bold === "1";
|
|
803
|
+
current.italic = italic === "1";
|
|
804
|
+
current.text = collapse(current.text);
|
|
805
|
+
current.words = countWords(current.text);
|
|
806
|
+
current.top = current.y + current.size * 0.8;
|
|
807
|
+
current.bottom = current.y - current.size * 0.2;
|
|
808
|
+
if (current.text) frags.push(current);
|
|
809
|
+
current = null;
|
|
810
|
+
};
|
|
811
|
+
for (const item of row) {
|
|
812
|
+
if (current) {
|
|
813
|
+
const gap = item.x0 - current.x1;
|
|
814
|
+
const em = Math.max(current.size, item.size);
|
|
815
|
+
const markerOnly = MARKER_ONLY_RE.test(collapse(current.text));
|
|
816
|
+
if (gap > em * (markerOnly ? 6 : 1)) finish();
|
|
817
|
+
}
|
|
818
|
+
if (!current) {
|
|
819
|
+
current = {
|
|
820
|
+
text: item.text,
|
|
821
|
+
x0: item.x0,
|
|
822
|
+
x1: item.x1,
|
|
823
|
+
y: item.y,
|
|
824
|
+
top: 0,
|
|
825
|
+
bottom: 0,
|
|
826
|
+
size: item.size,
|
|
827
|
+
bold: item.bold,
|
|
828
|
+
italic: item.italic,
|
|
829
|
+
words: 0,
|
|
830
|
+
styleChars: /* @__PURE__ */ new Map()
|
|
831
|
+
};
|
|
832
|
+
} else {
|
|
833
|
+
const gap = item.x0 - current.x1;
|
|
834
|
+
if (gap > Math.max(current.size, item.size) * 0.15 && !/\s$/.test(current.text) && !/^\s/.test(item.text)) {
|
|
835
|
+
current.text += " ";
|
|
836
|
+
}
|
|
837
|
+
current.text += item.text;
|
|
838
|
+
current.x1 = Math.max(current.x1, item.x1);
|
|
839
|
+
}
|
|
840
|
+
const key = `${Math.round(item.size * 2) / 2}|${item.bold ? 1 : 0}|${item.italic ? 1 : 0}`;
|
|
841
|
+
current.styleChars.set(key, (_nullishCoalesce(current.styleChars.get(key), () => ( 0))) + item.text.trim().length);
|
|
842
|
+
}
|
|
843
|
+
finish();
|
|
844
|
+
}
|
|
845
|
+
return frags;
|
|
846
|
+
}
|
|
847
|
+
function baselineRows(frags) {
|
|
848
|
+
const rows = [];
|
|
849
|
+
for (const frag of frags) {
|
|
850
|
+
const row = rows[rows.length - 1];
|
|
851
|
+
if (row && Math.abs(row[0].y - frag.y) <= Math.max(1, Math.min(row[0].size, frag.size) * 0.5)) row.push(frag);
|
|
852
|
+
else rows.push([frag]);
|
|
853
|
+
}
|
|
854
|
+
return rows;
|
|
855
|
+
}
|
|
856
|
+
var edgeKey = (row) => collapse(row.map((f) => f.text).join(" ")).toLowerCase().replace(/\d+/g, "#");
|
|
857
|
+
function removeHeadersAndFooters(pages) {
|
|
858
|
+
const removed = { headers: 0, footers: 0, pageNumbers: 0 };
|
|
859
|
+
const pageRows = pages.map((frags) => baselineRows([...frags].sort((a, b) => b.y - a.y || a.x0 - b.x0)));
|
|
860
|
+
const counts = /* @__PURE__ */ new Map();
|
|
861
|
+
const candidates = [];
|
|
862
|
+
pageRows.forEach((rows, page) => {
|
|
863
|
+
const n = rows.length;
|
|
864
|
+
const picks = [];
|
|
865
|
+
for (let k = 0; k < Math.min(2, n); k++) picks.push([k, "top"]);
|
|
866
|
+
for (let k = Math.max(Math.min(2, n), n - 2); k < n; k++) picks.push([k, "bottom"]);
|
|
867
|
+
for (const [index, edge] of picks) {
|
|
868
|
+
const row = rows[index];
|
|
869
|
+
const extreme = edge === "top" ? index === 0 : index === n - 1;
|
|
870
|
+
const neighbour = edge === "top" ? rows[index + 1] : rows[index - 1];
|
|
871
|
+
const gap = neighbour ? Math.abs(row[0].y - neighbour[0].y) / row[0].size : Infinity;
|
|
872
|
+
candidates.push({ page, row, edge, extreme, gap });
|
|
873
|
+
const key = `${edge}:${edgeKey(row)}`;
|
|
874
|
+
if (!counts.has(key)) counts.set(key, /* @__PURE__ */ new Set());
|
|
875
|
+
counts.get(key).add(page);
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
const minPages = Math.max(2, Math.ceil(pages.length * 0.5));
|
|
879
|
+
const drop = /* @__PURE__ */ new Set();
|
|
880
|
+
for (const candidate of candidates) {
|
|
881
|
+
const text = collapse(candidate.row.map((f) => f.text).join(" "));
|
|
882
|
+
const isPageNumber = candidate.extreme && (PAGE_NUMBER_RE.test(text) || DASHED_PAGE_NUMBER_RE.test(text));
|
|
883
|
+
const repeated = (_nullishCoalesce(_optionalChain([counts, 'access', _36 => _36.get, 'call', _37 => _37(`${candidate.edge}:${edgeKey(candidate.row)}`), 'optionalAccess', _38 => _38.size]), () => ( 0))) >= minPages;
|
|
884
|
+
let kind = null;
|
|
885
|
+
if (isPageNumber && (pages.length > 1 || candidate.gap > 2.5)) kind = "pageNumbers";
|
|
886
|
+
else if (repeated && pages.length > 1) kind = candidate.edge === "top" ? "headers" : "footers";
|
|
887
|
+
if (!kind || candidate.row.some((f) => drop.has(f))) continue;
|
|
888
|
+
candidate.row.forEach((f) => drop.add(f));
|
|
889
|
+
removed[kind]++;
|
|
890
|
+
}
|
|
891
|
+
if (drop.size) {
|
|
892
|
+
pages.forEach((frags, index) => {
|
|
893
|
+
pages[index] = frags.filter((f) => !drop.has(f));
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
return removed;
|
|
897
|
+
}
|
|
898
|
+
function splitRules(rules) {
|
|
899
|
+
const h = [];
|
|
900
|
+
const v = [];
|
|
901
|
+
for (const rule of rules.slice(0, MAX_RULES)) {
|
|
902
|
+
const { x1, y1, x2, y2 } = rule;
|
|
903
|
+
if (![x1, y1, x2, y2].every(Number.isFinite)) continue;
|
|
904
|
+
const dx = Math.abs(x2 - x1);
|
|
905
|
+
const dy = Math.abs(y2 - y1);
|
|
906
|
+
if (dy <= 1.5 && dx >= 6) h.push({ y: (y1 + y2) / 2, x0: Math.min(x1, x2), x1: Math.max(x1, x2) });
|
|
907
|
+
else if (dx <= 1.5 && dy >= 6) v.push({ x: (x1 + x2) / 2, y0: Math.min(y1, y2), y1: Math.max(y1, y2) });
|
|
908
|
+
}
|
|
909
|
+
return { h, v };
|
|
910
|
+
}
|
|
911
|
+
function clusterValues(values, tol) {
|
|
912
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
913
|
+
const out = [];
|
|
914
|
+
for (const value of sorted) {
|
|
915
|
+
const cluster = out[out.length - 1];
|
|
916
|
+
if (cluster && value - cluster.last <= tol) {
|
|
917
|
+
cluster.sum += value;
|
|
918
|
+
cluster.n++;
|
|
919
|
+
cluster.last = value;
|
|
920
|
+
} else out.push({ sum: value, n: 1, last: value });
|
|
921
|
+
}
|
|
922
|
+
return out.map((c) => c.sum / c.n);
|
|
923
|
+
}
|
|
924
|
+
function find(parent, i) {
|
|
925
|
+
while (parent[i] !== i) {
|
|
926
|
+
parent[i] = parent[parent[i]];
|
|
927
|
+
i = parent[i];
|
|
928
|
+
}
|
|
929
|
+
return i;
|
|
930
|
+
}
|
|
931
|
+
var cellText = (frags, dehyphenate, stats) => {
|
|
932
|
+
const sorted = [...frags].sort((a, b) => b.y - a.y || a.x0 - b.x0);
|
|
933
|
+
let text = "";
|
|
934
|
+
let lastY = Infinity;
|
|
935
|
+
for (const frag of sorted) {
|
|
936
|
+
if (!text) text = frag.text;
|
|
937
|
+
else if (Math.abs(lastY - frag.y) > frag.size * 0.5) text = joinLines(text, frag.text, dehyphenate, stats);
|
|
938
|
+
else text += ` ${frag.text}`;
|
|
939
|
+
lastY = frag.y;
|
|
940
|
+
}
|
|
941
|
+
return collapse(text);
|
|
942
|
+
};
|
|
943
|
+
var NUMERIC_RE = /^[-+−(]?[$€£¥]?\s?\d[\d,.\s]*%?\)?$/;
|
|
944
|
+
function headerRowCount(rowFrags) {
|
|
945
|
+
if (rowFrags.length < 2) return 0;
|
|
946
|
+
const cells = (row) => row.filter((cell) => cell.length > 0);
|
|
947
|
+
const first = cells(rowFrags[0]);
|
|
948
|
+
if (!first.length) return 0;
|
|
949
|
+
const rest = rowFrags.slice(1).flatMap(cells);
|
|
950
|
+
const allBold = (list) => list.length > 0 && list.every((cell) => cell.every((f) => f.bold));
|
|
951
|
+
if (allBold(first) && !allBold(rest)) return 1;
|
|
952
|
+
const numeric = (cell) => NUMERIC_RE.test(collapse(cell.map((f) => f.text).join(" ")));
|
|
953
|
+
if (first.every((cell) => !numeric(cell))) {
|
|
954
|
+
const columns = rowFrags[0].length;
|
|
955
|
+
for (let c = 0; c < columns; c++) {
|
|
956
|
+
const body = rowFrags.slice(1).map((row) => row[c]).filter((cell) => cell && cell.length > 0);
|
|
957
|
+
if (rowFrags[0][c].length && body.length >= 2 && body.every(numeric)) return 1;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
const firstSize = maxOf(first.flat(), (f) => f.size);
|
|
961
|
+
const restSize = median(rest.flat().map((f) => f.size));
|
|
962
|
+
if (restSize > 0 && firstSize >= restSize * 1.1) return 1;
|
|
963
|
+
return 0;
|
|
964
|
+
}
|
|
965
|
+
function ruledTables(frags, rules, page, dehyphenate, stats) {
|
|
966
|
+
const consumed = /* @__PURE__ */ new Set();
|
|
967
|
+
const atoms = [];
|
|
968
|
+
const { h, v } = splitRules(rules);
|
|
969
|
+
if (h.length < 2) return { atoms, consumed };
|
|
970
|
+
const n = h.length + v.length;
|
|
971
|
+
const parent = Array.from({ length: n }, (_, i) => i);
|
|
972
|
+
const union = (a, b) => {
|
|
973
|
+
const ra = find(parent, a);
|
|
974
|
+
const rb = find(parent, b);
|
|
975
|
+
if (ra !== rb) parent[ra] = rb;
|
|
976
|
+
};
|
|
977
|
+
const tol = 2;
|
|
978
|
+
const vOrder = v.map((_, i) => i).sort((a, b) => v[a].x - v[b].x);
|
|
979
|
+
const vxs = vOrder.map((i) => v[i].x);
|
|
980
|
+
h.forEach((seg, hi) => {
|
|
981
|
+
let lo = 0;
|
|
982
|
+
let hiIdx = vxs.length;
|
|
983
|
+
while (lo < hiIdx) {
|
|
984
|
+
const mid = lo + hiIdx >> 1;
|
|
985
|
+
if (vxs[mid] < seg.x0 - tol) lo = mid + 1;
|
|
986
|
+
else hiIdx = mid;
|
|
987
|
+
}
|
|
988
|
+
for (let k = lo; k < vxs.length && vxs[k] <= seg.x1 + tol; k++) {
|
|
989
|
+
const vs = v[vOrder[k]];
|
|
990
|
+
if (seg.y >= vs.y0 - tol && seg.y <= vs.y1 + tol) union(hi, h.length + vOrder[k]);
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
const hOrder = h.map((_, i) => i).sort((a, b) => h[a].x0 - h[b].x0 || h[a].x1 - h[b].x1 || h[b].y - h[a].y);
|
|
994
|
+
for (let k = 1; k < hOrder.length; k++) {
|
|
995
|
+
const a = h[hOrder[k - 1]];
|
|
996
|
+
const b = h[hOrder[k]];
|
|
997
|
+
if (Math.abs(a.x0 - b.x0) <= 4 && Math.abs(a.x1 - b.x1) <= 4) union(hOrder[k - 1], hOrder[k]);
|
|
998
|
+
}
|
|
999
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1000
|
+
h.forEach((seg, i) => {
|
|
1001
|
+
const root = find(parent, i);
|
|
1002
|
+
if (!groups.has(root)) groups.set(root, { h: [], v: [] });
|
|
1003
|
+
groups.get(root).h.push(seg);
|
|
1004
|
+
});
|
|
1005
|
+
v.forEach((seg, i) => {
|
|
1006
|
+
const root = find(parent, h.length + i);
|
|
1007
|
+
_optionalChain([groups, 'access', _39 => _39.get, 'call', _40 => _40(root), 'optionalAccess', _41 => _41.v, 'access', _42 => _42.push, 'call', _43 => _43(seg)]);
|
|
1008
|
+
});
|
|
1009
|
+
const byY = [...frags].sort((a, b) => a.y - b.y);
|
|
1010
|
+
const ys = byY.map((f) => f.y);
|
|
1011
|
+
const inRange = (y0, y1) => {
|
|
1012
|
+
let lo = 0;
|
|
1013
|
+
let hi = ys.length;
|
|
1014
|
+
while (lo < hi) {
|
|
1015
|
+
const mid = lo + hi >> 1;
|
|
1016
|
+
if (ys[mid] < y0) lo = mid + 1;
|
|
1017
|
+
else hi = mid;
|
|
1018
|
+
}
|
|
1019
|
+
const out = [];
|
|
1020
|
+
for (let k = lo; k < ys.length && ys[k] <= y1; k++) out.push(byY[k]);
|
|
1021
|
+
return out;
|
|
1022
|
+
};
|
|
1023
|
+
groups.forEach((group) => {
|
|
1024
|
+
const hys = clusterValues(group.h.map((s) => s.y), 1.5).sort((a, b) => b - a);
|
|
1025
|
+
if (hys.length < 2) return;
|
|
1026
|
+
const x0 = Math.min(...group.h.map((s) => s.x0), ...group.v.map((s) => s.x));
|
|
1027
|
+
const x1 = Math.max(...group.h.map((s) => s.x1), ...group.v.map((s) => s.x));
|
|
1028
|
+
const top = Math.max(hys[0], ...group.v.map((s) => s.y1));
|
|
1029
|
+
const bottom = Math.min(hys[hys.length - 1], ...group.v.map((s) => s.y0));
|
|
1030
|
+
const inside = inRange(bottom, top).filter((f) => {
|
|
1031
|
+
if (consumed.has(f)) return false;
|
|
1032
|
+
const cx = (f.x0 + f.x1) / 2;
|
|
1033
|
+
return cx >= x0 - 1 && cx <= x1 + 1;
|
|
1034
|
+
});
|
|
1035
|
+
if (inside.length < 2) return;
|
|
1036
|
+
const vxsGroup = clusterValues(group.v.map((s) => s.x), 1.5);
|
|
1037
|
+
let table = null;
|
|
1038
|
+
if (vxsGroup.length >= 3 || vxsGroup.length >= 2 && hys.length >= 3 && vxsGroup.some((x) => x > x0 + 4 && x < x1 - 4)) {
|
|
1039
|
+
table = gridTable(inside, group, hys, vxsGroup, x0, x1, top, bottom, page, dehyphenate, stats);
|
|
1040
|
+
}
|
|
1041
|
+
if (!table) {
|
|
1042
|
+
const result = alignedTable(inside, page, 2, dehyphenate, stats, hys.length >= 3 ? hys[1] : void 0);
|
|
1043
|
+
if (result && !result.leftover.length && !result.before.length) table = { ...result.table, ruled: true, confidence: 0.85 };
|
|
1044
|
+
}
|
|
1045
|
+
if (!table) return;
|
|
1046
|
+
inside.forEach((f) => consumed.add(f));
|
|
1047
|
+
atoms.push({
|
|
1048
|
+
text: "",
|
|
1049
|
+
x0,
|
|
1050
|
+
x1,
|
|
1051
|
+
y: bottom,
|
|
1052
|
+
top,
|
|
1053
|
+
bottom,
|
|
1054
|
+
size: median(inside.map((f) => f.size)),
|
|
1055
|
+
bold: false,
|
|
1056
|
+
italic: false,
|
|
1057
|
+
words: 0,
|
|
1058
|
+
table
|
|
1059
|
+
});
|
|
1060
|
+
});
|
|
1061
|
+
return { atoms, consumed };
|
|
1062
|
+
}
|
|
1063
|
+
function gridTable(inside, group, hys, vxsIn, x0, x1, top, bottom, page, dehyphenate, stats) {
|
|
1064
|
+
const xs = [...vxsIn];
|
|
1065
|
+
if (xs[0] > x0 + 4) xs.unshift(x0);
|
|
1066
|
+
if (xs[xs.length - 1] < x1 - 4) xs.push(x1);
|
|
1067
|
+
const rowsY = [...hys];
|
|
1068
|
+
if (rowsY[0] < top - 4) rowsY.unshift(top);
|
|
1069
|
+
if (rowsY[rowsY.length - 1] > bottom + 4) rowsY.push(bottom);
|
|
1070
|
+
const cols = xs.length - 1;
|
|
1071
|
+
const rows = rowsY.length - 1;
|
|
1072
|
+
if (cols < 2 || rows < 1 || cols > MAX_COLS || rows > MAX_TABLE_ROWS) return null;
|
|
1073
|
+
const grid = Array.from({ length: rows }, () => Array.from({ length: cols }, () => []));
|
|
1074
|
+
const ascRows = [...rowsY].reverse();
|
|
1075
|
+
for (const frag of inside) {
|
|
1076
|
+
const x = frag.x0 + Math.min(2, (frag.x1 - frag.x0) / 2);
|
|
1077
|
+
const c = lowerBound(xs, x + 1e-9) - 1;
|
|
1078
|
+
const yProbe = frag.y + frag.size * 0.3;
|
|
1079
|
+
const r = rows - (lowerBound(ascRows, yProbe + 1e-9) - 1) - 1;
|
|
1080
|
+
if (c >= 0 && c < cols && r >= 0 && r < rows) grid[r][c].push(frag);
|
|
1081
|
+
}
|
|
1082
|
+
const filled = grid.flat().filter((cell) => cell.length).length;
|
|
1083
|
+
if (filled < 2 || rows < 2 && cols < 2) return null;
|
|
1084
|
+
const vAt = xs.map(() => []);
|
|
1085
|
+
for (const seg of group.v) {
|
|
1086
|
+
const k = lowerBound(xs, seg.x - 2);
|
|
1087
|
+
if (k < xs.length && Math.abs(xs[k] - seg.x) <= 2) vAt[k].push(seg);
|
|
1088
|
+
}
|
|
1089
|
+
const hAt = rowsY.map(() => []);
|
|
1090
|
+
for (const seg of group.h) {
|
|
1091
|
+
const k = rows - lowerBound(ascRows, seg.y - 2);
|
|
1092
|
+
if (k >= 0 && k <= rows && Math.abs(rowsY[k] - seg.y) <= 2) hAt[k].push(seg);
|
|
1093
|
+
}
|
|
1094
|
+
const hasV = (k, y) => vAt[k].some((s) => y >= s.y0 - 2 && y <= s.y1 + 2);
|
|
1095
|
+
const hasH = (k, x) => hAt[k].some((s) => x >= s.x0 - 2 && x <= s.x1 + 2);
|
|
1096
|
+
const covered = grid.map((row) => row.map(() => false));
|
|
1097
|
+
const header = headerRowCount(grid);
|
|
1098
|
+
const out = [];
|
|
1099
|
+
for (let r = 0; r < rows; r++) {
|
|
1100
|
+
const midY = (rowsY[r] + rowsY[r + 1]) / 2;
|
|
1101
|
+
const row = [];
|
|
1102
|
+
for (let c = 0; c < cols; c++) {
|
|
1103
|
+
if (covered[r][c]) continue;
|
|
1104
|
+
let colSpan = 1;
|
|
1105
|
+
while (c + colSpan < cols && !hasV(c + colSpan, midY) && !grid[r][c + colSpan].length && !covered[r][c + colSpan]) colSpan++;
|
|
1106
|
+
let rowSpan = 1;
|
|
1107
|
+
const midX = (xs[c] + xs[c + colSpan]) / 2;
|
|
1108
|
+
while (r + rowSpan < rows && !hasH(r + rowSpan, midX) && !covered[r + rowSpan].slice(c, c + colSpan).some(Boolean) && grid[r + rowSpan].slice(c, c + colSpan).every((cell) => !cell.length)) {
|
|
1109
|
+
rowSpan++;
|
|
1110
|
+
}
|
|
1111
|
+
for (let rr = r; rr < r + rowSpan; rr++) for (let cc = c; cc < c + colSpan; cc++) covered[rr][cc] = true;
|
|
1112
|
+
row.push({ text: cellText(grid[r][c], dehyphenate, stats), colSpan, rowSpan, header: r < header });
|
|
1113
|
+
}
|
|
1114
|
+
out.push(row);
|
|
1115
|
+
}
|
|
1116
|
+
return { type: "table", page, confidence: 0.95, ruled: true, rows: out, columns: cols, headerRows: header };
|
|
1117
|
+
}
|
|
1118
|
+
function alignedTable(frags, page, minRows, dehyphenate, stats, headerRuleY) {
|
|
1119
|
+
const sorted = [...frags].sort((a, b) => b.y - a.y || a.x0 - b.x0);
|
|
1120
|
+
let rows = baselineRows(sorted).map((row) => row.sort((a, b) => a.x0 - b.x0));
|
|
1121
|
+
if (rows.length < minRows) return null;
|
|
1122
|
+
const multi = rows.filter((row) => row.length >= 2);
|
|
1123
|
+
if (multi.length < Math.min(minRows, 2)) return null;
|
|
1124
|
+
const spans = multi.flat().map((f) => [f.x0, f.x1]).sort((a, b) => a[0] - b[0]);
|
|
1125
|
+
const merged = [];
|
|
1126
|
+
for (const [a, b] of spans) {
|
|
1127
|
+
const last = merged[merged.length - 1];
|
|
1128
|
+
if (last && a <= last[1] + 1) last[1] = Math.max(last[1], b);
|
|
1129
|
+
else merged.push([a, b]);
|
|
1130
|
+
}
|
|
1131
|
+
if (merged.length < 2 || merged.length > MAX_COLS) return null;
|
|
1132
|
+
const edges = merged.map((m) => m[0]);
|
|
1133
|
+
const cols = merged.length;
|
|
1134
|
+
const colOf = (x) => {
|
|
1135
|
+
let c = 0;
|
|
1136
|
+
while (c + 1 < cols && x >= merged[c + 1][0] - 1) c++;
|
|
1137
|
+
return c;
|
|
1138
|
+
};
|
|
1139
|
+
const spanOf = (f, c) => {
|
|
1140
|
+
let span = 1;
|
|
1141
|
+
while (c + span < cols && f.x1 > merged[c + span][0] + 2) span++;
|
|
1142
|
+
return span;
|
|
1143
|
+
};
|
|
1144
|
+
const rowIsCells = (row) => {
|
|
1145
|
+
if (row.length >= 2) return true;
|
|
1146
|
+
const f = row[0];
|
|
1147
|
+
const c = colOf(f.x0);
|
|
1148
|
+
return spanOf(f, c) >= 2 && f.words <= 8 && Math.abs(f.x0 - edges[c]) <= Math.max(4, f.size * 0.6);
|
|
1149
|
+
};
|
|
1150
|
+
const before = [];
|
|
1151
|
+
const leftover = [];
|
|
1152
|
+
let first = 0;
|
|
1153
|
+
let end = rows.length;
|
|
1154
|
+
while (first < end && !rowIsCells(rows[first])) first++;
|
|
1155
|
+
while (end > first && !rowIsCells(rows[end - 1])) end--;
|
|
1156
|
+
rows.slice(0, first).forEach((row) => before.push(...row));
|
|
1157
|
+
rows.slice(end).forEach((row) => leftover.push(...row));
|
|
1158
|
+
rows = rows.slice(first, end);
|
|
1159
|
+
if (rows.length < minRows || rows.length > MAX_TABLE_ROWS) return null;
|
|
1160
|
+
const grid = [];
|
|
1161
|
+
const spansGrid = [];
|
|
1162
|
+
let prevRow = null;
|
|
1163
|
+
for (const row of rows) {
|
|
1164
|
+
const cells = Array.from({ length: cols }, () => []);
|
|
1165
|
+
const spanRow = Array.from({ length: cols }, () => 1);
|
|
1166
|
+
for (const f of row) {
|
|
1167
|
+
const c = colOf(f.x0);
|
|
1168
|
+
cells[c].push(f);
|
|
1169
|
+
spanRow[c] = Math.max(spanRow[c], row.length === 1 ? spanOf(f, c) : 1);
|
|
1170
|
+
}
|
|
1171
|
+
const continuation = prevRow !== null && grid.length > 0 && cells[0].length === 0 && grid[grid.length - 1][0].length > 0 && cells.every((cell, c) => !cell.length || grid[grid.length - 1][c].length > 0) && minOf(prevRow, (f) => f.bottom) - maxOf(row, (f) => f.top) < row[0].size * 0.5;
|
|
1172
|
+
if (continuation) {
|
|
1173
|
+
cells.forEach((cell, c) => grid[grid.length - 1][c].push(...cell));
|
|
1174
|
+
} else {
|
|
1175
|
+
grid.push(cells);
|
|
1176
|
+
spansGrid.push(spanRow);
|
|
1177
|
+
}
|
|
1178
|
+
prevRow = row;
|
|
1179
|
+
}
|
|
1180
|
+
if (grid.length < minRows) return null;
|
|
1181
|
+
const full = grid.filter((cells) => cells.filter((c) => c.length).length >= 2).length;
|
|
1182
|
+
if (full / grid.length < 0.6) return null;
|
|
1183
|
+
const cellsWithText = grid.flat().filter((c) => c.length);
|
|
1184
|
+
const meanWords = cellsWithText.reduce((sum, cell) => sum + cell.reduce((s, f) => s + f.words, 0), 0) / cellsWithText.length;
|
|
1185
|
+
if (meanWords > 12) return null;
|
|
1186
|
+
let header = headerRowCount(grid);
|
|
1187
|
+
if (headerRuleY !== void 0) {
|
|
1188
|
+
const above = rows.filter((row) => row[0].y > headerRuleY).length;
|
|
1189
|
+
if (above > 0 && above < grid.length) header = Math.max(header, Math.min(above, grid.length - 1));
|
|
1190
|
+
}
|
|
1191
|
+
const out = grid.map((cells, r) => {
|
|
1192
|
+
const row = [];
|
|
1193
|
+
for (let c = 0; c < cols; ) {
|
|
1194
|
+
const span = Math.min(spansGrid[r][c], cols - c);
|
|
1195
|
+
row.push({ text: cellText(cells[c], dehyphenate, stats), colSpan: span, rowSpan: 1, header: r < header });
|
|
1196
|
+
c += span;
|
|
1197
|
+
}
|
|
1198
|
+
return row;
|
|
1199
|
+
});
|
|
1200
|
+
const confidence = Math.min(
|
|
1201
|
+
0.9,
|
|
1202
|
+
0.5 + (grid.length >= 5 ? 0.1 : 0) + (cols >= 3 ? 0.1 : 0) + 0.2 * (full / grid.length) - (cols === 2 ? 0.05 : 0)
|
|
1203
|
+
);
|
|
1204
|
+
return {
|
|
1205
|
+
table: { type: "table", page, confidence, ruled: false, rows: out, columns: cols, headerRows: header },
|
|
1206
|
+
leftover,
|
|
1207
|
+
before
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
function readingOrder(items, body, detectColumns, depth, columnPages) {
|
|
1211
|
+
const byTop = [...items].sort((a, b) => b.top - a.top || a.x0 - b.x0);
|
|
1212
|
+
if (!detectColumns || items.length < 2 || depth > MAX_DEPTH) return [{ kind: "flow", items: byTop }];
|
|
1213
|
+
const left = minOf(items, (f) => f.x0);
|
|
1214
|
+
const right = maxOf(items, (f) => f.x1);
|
|
1215
|
+
const width = right - left;
|
|
1216
|
+
const isNarrow = (f) => f.x1 - f.x0 < width * 0.55;
|
|
1217
|
+
const narrow = items.filter(isNarrow);
|
|
1218
|
+
const minGutter = Math.max(body * 0.9, 6);
|
|
1219
|
+
const allowed = Math.max(1, Math.floor(narrow.length * 0.08));
|
|
1220
|
+
const events = [];
|
|
1221
|
+
for (const f of narrow) events.push([f.x0, 1], [f.x1, -1]);
|
|
1222
|
+
events.sort((a, b) => a[0] - b[0] || a[1] - b[1]);
|
|
1223
|
+
const candidates = [];
|
|
1224
|
+
let depthNow = 0;
|
|
1225
|
+
let seenContent = false;
|
|
1226
|
+
let start = null;
|
|
1227
|
+
for (const [x, delta] of events) {
|
|
1228
|
+
depthNow += delta;
|
|
1229
|
+
if (depthNow > allowed) {
|
|
1230
|
+
if (start !== null && seenContent && x - start >= minGutter) candidates.push([start, x]);
|
|
1231
|
+
start = null;
|
|
1232
|
+
seenContent = true;
|
|
1233
|
+
} else if (start === null) start = x;
|
|
1234
|
+
}
|
|
1235
|
+
const ends = narrow.map((f) => f.x1).sort((a, b) => a - b);
|
|
1236
|
+
const starts = narrow.map((f) => f.x0).sort((a, b) => a - b);
|
|
1237
|
+
const gutters = [];
|
|
1238
|
+
for (const [a, b] of candidates) {
|
|
1239
|
+
const endBelow = lowerBound(ends, b) - 1;
|
|
1240
|
+
const left2 = endBelow >= 0 && ends[endBelow] > a ? ends[endBelow] : a;
|
|
1241
|
+
const startAbove = lowerBound(starts, a + 1e-9);
|
|
1242
|
+
const right2 = startAbove < starts.length && starts[startAbove] < b ? starts[startAbove] : b;
|
|
1243
|
+
if (right2 - left2 < minGutter) continue;
|
|
1244
|
+
const onLeft = lowerBound(ends, left2 + 1e-6);
|
|
1245
|
+
const onRight = starts.length - lowerBound(starts, right2 - 1e-6);
|
|
1246
|
+
const strays = narrow.length - onLeft - onRight;
|
|
1247
|
+
if (strays < Math.min(onLeft, onRight)) gutters.push([left2, right2]);
|
|
1248
|
+
}
|
|
1249
|
+
if (!gutters.length) return [{ kind: "flow", items: byTop }];
|
|
1250
|
+
const gutterEnds = gutters.map((g) => g[1]);
|
|
1251
|
+
const crosses = (f) => {
|
|
1252
|
+
const k = lowerBound(gutterEnds, f.x0 + 1 + 1e-9);
|
|
1253
|
+
return k < gutters.length && f.x1 > gutters[k][0] + 1 && f.x0 < gutters[k][1] - 1;
|
|
1254
|
+
};
|
|
1255
|
+
const columnOf = (f) => lowerBound(gutterEnds, f.x0 + 1 + 1e-9);
|
|
1256
|
+
const bands = [];
|
|
1257
|
+
for (const f of byTop) {
|
|
1258
|
+
const spanning = crosses(f);
|
|
1259
|
+
const band = bands[bands.length - 1];
|
|
1260
|
+
if (band && band.spanning === spanning) band.items.push(f);
|
|
1261
|
+
else bands.push({ spanning, items: [f] });
|
|
1262
|
+
}
|
|
1263
|
+
const segments = [];
|
|
1264
|
+
let sealed = false;
|
|
1265
|
+
const pushFlow = (list) => {
|
|
1266
|
+
if (!list.length) return;
|
|
1267
|
+
const last = segments[segments.length - 1];
|
|
1268
|
+
if (last && last.kind === "flow" && !sealed) last.items.push(...list);
|
|
1269
|
+
else segments.push({ kind: "flow", items: list });
|
|
1270
|
+
sealed = false;
|
|
1271
|
+
};
|
|
1272
|
+
let multiColumn = false;
|
|
1273
|
+
const isShortSpan = (f) => !f.table && isNarrow(f) && f.words <= 8;
|
|
1274
|
+
for (const band of bands) {
|
|
1275
|
+
const last = segments[segments.length - 1];
|
|
1276
|
+
if (band.spanning) {
|
|
1277
|
+
const lead = band.items[0];
|
|
1278
|
+
if (last && last.kind === "grid" && isShortSpan(lead) && minOf(last.items, (f) => f.bottom) - lead.top <= lead.size * 2) {
|
|
1279
|
+
last.items.push(lead);
|
|
1280
|
+
pushFlow(band.items.slice(1));
|
|
1281
|
+
} else pushFlow(band.items);
|
|
1282
|
+
continue;
|
|
1283
|
+
}
|
|
1284
|
+
const columns = Array.from({ length: gutters.length + 1 }, () => []);
|
|
1285
|
+
band.items.forEach((f) => columns[columnOf(f)].push(f));
|
|
1286
|
+
const used = columns.filter((c) => c.length);
|
|
1287
|
+
if (used.length < 2) {
|
|
1288
|
+
pushFlow(band.items);
|
|
1289
|
+
continue;
|
|
1290
|
+
}
|
|
1291
|
+
const prose = used.every((col) => {
|
|
1292
|
+
const text = col.filter((f) => !f.table);
|
|
1293
|
+
if (text.length < 2) return text.length === 0;
|
|
1294
|
+
const colLeft = minOf(text, (f) => f.x0);
|
|
1295
|
+
const colRight = maxOf(text, (f) => f.x1);
|
|
1296
|
+
const fill = text.reduce((sum, f) => sum + (f.x1 - f.x0), 0) / text.length / Math.max(1, colRight - colLeft);
|
|
1297
|
+
const words = text.reduce((sum, f) => sum + f.words, 0) / text.length;
|
|
1298
|
+
return fill >= 0.55 && words >= 3;
|
|
1299
|
+
});
|
|
1300
|
+
const tops = used.map((col) => [minOf(col, (f) => f.bottom), maxOf(col, (f) => f.top)]);
|
|
1301
|
+
const overlapping = tops.every(([b, t], i) => i === 0 || Math.min(t, tops[0][1]) - Math.max(b, tops[0][0]) > 0);
|
|
1302
|
+
if (prose && overlapping) {
|
|
1303
|
+
multiColumn = true;
|
|
1304
|
+
for (const col of used) segments.push(...readingOrder(col, body, detectColumns, depth + 1, columnPages));
|
|
1305
|
+
sealed = true;
|
|
1306
|
+
continue;
|
|
1307
|
+
}
|
|
1308
|
+
const pulled = [];
|
|
1309
|
+
if (last && last.kind === "flow" && !sealed) {
|
|
1310
|
+
const tail = last.items[last.items.length - 1];
|
|
1311
|
+
if (isShortSpan(tail) && tail.bottom - maxOf(band.items, (f) => f.top) <= tail.size * 2) {
|
|
1312
|
+
pulled.push(last.items.pop());
|
|
1313
|
+
if (!last.items.length) segments.pop();
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
const prevSegment = segments[segments.length - 1];
|
|
1317
|
+
if (prevSegment && prevSegment.kind === "grid" && (pulled.length || prevSegment === last)) {
|
|
1318
|
+
prevSegment.items.push(...pulled, ...band.items);
|
|
1319
|
+
} else segments.push({ kind: "grid", items: [...pulled, ...band.items] });
|
|
1320
|
+
sealed = false;
|
|
1321
|
+
}
|
|
1322
|
+
if (multiColumn && depth === 0) columnPages.count++;
|
|
1323
|
+
return segments;
|
|
1324
|
+
}
|
|
1325
|
+
function flowLines(items, page) {
|
|
1326
|
+
const lines = [];
|
|
1327
|
+
const sorted = [...items].sort((a, b) => b.top - a.top || a.x0 - b.x0);
|
|
1328
|
+
for (const f of sorted) {
|
|
1329
|
+
if (f.table) {
|
|
1330
|
+
lines.push({ text: "", x0: f.x0, x1: f.x1, y: f.y, top: f.top, size: f.size, bold: false, page, table: f.table });
|
|
1331
|
+
continue;
|
|
1332
|
+
}
|
|
1333
|
+
const last = lines[lines.length - 1];
|
|
1334
|
+
if (last && !last.table && Math.abs(last.y - f.y) <= Math.min(last.size, f.size) * 0.5) {
|
|
1335
|
+
last.text = `${last.text} ${f.text}`;
|
|
1336
|
+
last.x0 = Math.min(last.x0, f.x0);
|
|
1337
|
+
last.x1 = Math.max(last.x1, f.x1);
|
|
1338
|
+
} else {
|
|
1339
|
+
lines.push({ text: f.text, x0: f.x0, x1: f.x1, y: f.y, top: f.top, size: f.size, bold: f.bold, page });
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
return lines;
|
|
1343
|
+
}
|
|
1344
|
+
function joinLines(prev, next, dehyphenate, stats) {
|
|
1345
|
+
if (prev.endsWith("\xAD")) {
|
|
1346
|
+
stats.dehyphenated++;
|
|
1347
|
+
return prev.slice(0, -1) + next;
|
|
1348
|
+
}
|
|
1349
|
+
if (dehyphenate && /[A-Za-zÀ-ɏ]-$/.test(prev) && /^[a-zß-ɏ]/.test(next)) {
|
|
1350
|
+
stats.dehyphenated++;
|
|
1351
|
+
return prev.slice(0, -1) + next;
|
|
1352
|
+
}
|
|
1353
|
+
return `${prev} ${next}`;
|
|
1354
|
+
}
|
|
1355
|
+
function listMarker(text) {
|
|
1356
|
+
const glyph = BULLET_GLYPH_RE.exec(text);
|
|
1357
|
+
if (glyph) return { kind: "glyph", rest: text.slice(glyph[0].length), ordered: false };
|
|
1358
|
+
const dash = BULLET_DASH_RE.exec(text);
|
|
1359
|
+
if (dash) return { kind: "dash", rest: text.slice(dash[0].length), ordered: false };
|
|
1360
|
+
const ordered = ORDERED_RE.exec(text);
|
|
1361
|
+
if (ordered) {
|
|
1362
|
+
const token = _nullishCoalesce(ordered[1], () => ( ordered[2]));
|
|
1363
|
+
const kind = /^\d+$/.test(token) ? "num" : /^[ivxlc]{2,}$/i.test(token) || /^i$/i.test(token) ? "roman" : "alpha";
|
|
1364
|
+
return { kind, rest: text.slice(ordered[0].length), ordered: true, value: kind === "num" ? Number(token) : void 0 };
|
|
1365
|
+
}
|
|
1366
|
+
return null;
|
|
1367
|
+
}
|
|
1368
|
+
function headingStyle(line, next, segRight, ctx) {
|
|
1369
|
+
if (!ctx.options.detectHeadings || line.table) return null;
|
|
1370
|
+
const text = line.text;
|
|
1371
|
+
const words = countWords(text);
|
|
1372
|
+
if (text.length > 200 || words > 25 || !/\p{L}/u.test(text)) return null;
|
|
1373
|
+
if (words > 15 && SENTENCE_END_RE.test(text)) return null;
|
|
1374
|
+
const ratio = line.size / ctx.body;
|
|
1375
|
+
if (ratio >= 1.15) {
|
|
1376
|
+
const confidence = Math.min(0.95, 0.6 + (ratio - 1.15) * 0.8 + (line.bold ? 0.1 : 0));
|
|
1377
|
+
return { key: Math.round(line.size * 2) / 2 + (line.bold ? 0.25 : 0), confidence, boldOnly: false };
|
|
1378
|
+
}
|
|
1379
|
+
const runsOn = !!next && !next.table && next.bold && Math.abs(next.size - line.size) < 0.5 && line.x1 >= segRight - 2 * line.size;
|
|
1380
|
+
if (line.bold && !ctx.boldBody && !runsOn && ratio >= 0.95 && text.length <= 100 && !/[.,;]$/.test(text)) {
|
|
1381
|
+
return { key: Math.round(line.size * 2) / 2 + 0.25, confidence: 0.6, boldOnly: true };
|
|
1382
|
+
}
|
|
1383
|
+
return null;
|
|
1384
|
+
}
|
|
1385
|
+
function buildBlocks(lines, ctx) {
|
|
1386
|
+
const textLines = lines.filter((l) => !l.table);
|
|
1387
|
+
const segLeft = textLines.length ? minOf(textLines, (l) => l.x0) : 0;
|
|
1388
|
+
const segRight = textLines.length ? maxOf(textLines, (l) => l.x1) : 0;
|
|
1389
|
+
const kindCounts = /* @__PURE__ */ new Map();
|
|
1390
|
+
const markers = lines.map((line) => {
|
|
1391
|
+
if (!ctx.options.detectLists || line.table) return null;
|
|
1392
|
+
const marker = listMarker(line.text);
|
|
1393
|
+
if (marker) kindCounts.set(marker.kind, (_nullishCoalesce(kindCounts.get(marker.kind), () => ( 0))) + 1);
|
|
1394
|
+
return marker;
|
|
1395
|
+
});
|
|
1396
|
+
let list = null;
|
|
1397
|
+
let listStack = [];
|
|
1398
|
+
let lastItemLine = null;
|
|
1399
|
+
let para = null;
|
|
1400
|
+
let heading = null;
|
|
1401
|
+
const closeAll = () => {
|
|
1402
|
+
if (para) {
|
|
1403
|
+
const last = para.lines[para.lines.length - 1];
|
|
1404
|
+
const ended = SENTENCE_END_RE.test(last.text) || last.x1 < segRight - 3 * last.size;
|
|
1405
|
+
ctx.open = ended ? null : { block: para.block, size: last.size, lastText: para.block.text };
|
|
1406
|
+
} else ctx.open = null;
|
|
1407
|
+
para = null;
|
|
1408
|
+
list = null;
|
|
1409
|
+
listStack = [];
|
|
1410
|
+
lastItemLine = null;
|
|
1411
|
+
heading = null;
|
|
1412
|
+
};
|
|
1413
|
+
lines.forEach((line, index) => {
|
|
1414
|
+
const prev = index > 0 ? lines[index - 1] : null;
|
|
1415
|
+
if (line.table) {
|
|
1416
|
+
closeAll();
|
|
1417
|
+
ctx.open = null;
|
|
1418
|
+
ctx.blocks.push(line.table);
|
|
1419
|
+
return;
|
|
1420
|
+
}
|
|
1421
|
+
const style = headingStyle(line, lines[index + 1], segRight, ctx);
|
|
1422
|
+
if (style) {
|
|
1423
|
+
if (heading && heading.key === style.key && heading.lines < 3 && prev === heading.line && prev.y - line.y <= line.size * 1.6) {
|
|
1424
|
+
heading.block.text = joinLines(heading.block.text, line.text, ctx.options.dehyphenate, ctx.stats);
|
|
1425
|
+
heading.line = line;
|
|
1426
|
+
heading.lines++;
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1429
|
+
closeAll();
|
|
1430
|
+
ctx.open = null;
|
|
1431
|
+
const block2 = { type: "heading", level: 1, text: line.text, page: line.page, confidence: style.confidence };
|
|
1432
|
+
ctx.blocks.push(block2);
|
|
1433
|
+
ctx.headings.push({ block: block2, key: style.key, boldOnly: style.boldOnly });
|
|
1434
|
+
heading = { block: block2, line, key: style.key, lines: 1 };
|
|
1435
|
+
return;
|
|
1436
|
+
}
|
|
1437
|
+
heading = null;
|
|
1438
|
+
const marker = markers[index];
|
|
1439
|
+
const validMarker = marker && (marker.kind === "glyph" || (_nullishCoalesce(kindCounts.get(marker.kind), () => ( 0))) >= 2) && marker.rest.trim() !== "";
|
|
1440
|
+
if (validMarker) {
|
|
1441
|
+
const gapOk = lastItemLine && lastItemLine.y - line.y <= Math.max(ctx.pitch(line.size) * 2.2, line.size * 2.4);
|
|
1442
|
+
if (!list || !gapOk) {
|
|
1443
|
+
closeAll();
|
|
1444
|
+
ctx.open = null;
|
|
1445
|
+
list = { type: "list", page: line.page, confidence: 0.6, items: [] };
|
|
1446
|
+
ctx.blocks.push(list);
|
|
1447
|
+
listStack = [line.x0];
|
|
1448
|
+
}
|
|
1449
|
+
const tol = line.size * 0.5;
|
|
1450
|
+
while (listStack.length > 1 && line.x0 < listStack[listStack.length - 1] - tol) listStack.pop();
|
|
1451
|
+
if (line.x0 > listStack[listStack.length - 1] + tol) listStack.push(line.x0);
|
|
1452
|
+
else listStack[listStack.length - 1] = Math.min(listStack[listStack.length - 1], line.x0);
|
|
1453
|
+
const prevDepth = list.items.length ? list.items[list.items.length - 1].depth : -1;
|
|
1454
|
+
const depth = Math.min(listStack.length - 1, prevDepth + 1);
|
|
1455
|
+
const item = {
|
|
1456
|
+
text: collapse(marker.rest),
|
|
1457
|
+
depth,
|
|
1458
|
+
ordered: marker.ordered
|
|
1459
|
+
};
|
|
1460
|
+
if (marker.value !== void 0) item.start = marker.value;
|
|
1461
|
+
list.items.push(item);
|
|
1462
|
+
list.confidence = Math.min(0.95, (marker.kind === "glyph" ? 0.75 : 0.6) + 0.05 * list.items.length);
|
|
1463
|
+
lastItemLine = line;
|
|
1464
|
+
para = null;
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
if (list && lastItemLine && prev) {
|
|
1468
|
+
const markerX = listStack[listStack.length - 1];
|
|
1469
|
+
const continues = line.x0 > markerX + line.size * 0.3 && line.x0 <= markerX + line.size * 5 && prev.y - line.y <= ctx.pitch(line.size) * ctx.options.paragraphGap;
|
|
1470
|
+
if (continues) {
|
|
1471
|
+
const item = list.items[list.items.length - 1];
|
|
1472
|
+
item.text = joinLines(item.text, line.text, ctx.options.dehyphenate, ctx.stats);
|
|
1473
|
+
lastItemLine = line;
|
|
1474
|
+
return;
|
|
1475
|
+
}
|
|
1476
|
+
closeAll();
|
|
1477
|
+
}
|
|
1478
|
+
if (!para && ctx.open && index === 0 && /^[a-z]/.test(line.text) && Math.abs(ctx.open.size - line.size) <= line.size * 0.12) {
|
|
1479
|
+
ctx.open.block.text = joinLines(ctx.open.block.text, line.text, ctx.options.dehyphenate, ctx.stats);
|
|
1480
|
+
para = { block: ctx.open.block, lines: [line] };
|
|
1481
|
+
ctx.open = null;
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
if (para && prev && !prev.table) {
|
|
1485
|
+
const last = para.lines[para.lines.length - 1];
|
|
1486
|
+
const gap = last.y - line.y;
|
|
1487
|
+
const sameSize = Math.abs(last.size - line.size) <= last.size * 0.12;
|
|
1488
|
+
const closeEnough = gap > 0 && gap <= ctx.pitch(line.size) * ctx.options.paragraphGap;
|
|
1489
|
+
const indentEm = line.size * 0.8;
|
|
1490
|
+
const indented = line.x0 - segLeft >= indentEm && last.x0 - segLeft < indentEm && line.x0 - segLeft < line.size * 8;
|
|
1491
|
+
const shortEnded = last.x1 < segRight - 3 * last.size && SENTENCE_END_RE.test(last.text);
|
|
1492
|
+
if (sameSize && closeEnough && !indented && !shortEnded) {
|
|
1493
|
+
para.block.text = joinLines(para.block.text, line.text, ctx.options.dehyphenate, ctx.stats);
|
|
1494
|
+
para.lines.push(line);
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
closeAll();
|
|
1499
|
+
ctx.open = null;
|
|
1500
|
+
const block = { type: "paragraph", text: line.text, page: line.page };
|
|
1501
|
+
ctx.blocks.push(block);
|
|
1502
|
+
para = { block, lines: [line] };
|
|
1503
|
+
});
|
|
1504
|
+
closeAll();
|
|
1505
|
+
}
|
|
1506
|
+
function assignHeadingLevels(headings) {
|
|
1507
|
+
const keys = Array.from(new Set(headings.map((h) => h.key))).sort((a, b) => b - a);
|
|
1508
|
+
const levelOf = new Map(keys.map((key, i) => [key, Math.min(6, i + 1)]));
|
|
1509
|
+
headings.forEach((h) => {
|
|
1510
|
+
h.block.level = levelOf.get(h.key);
|
|
1511
|
+
});
|
|
1512
|
+
}
|
|
1513
|
+
var DEFAULTS = {
|
|
1514
|
+
paragraphGap: 1.4,
|
|
1515
|
+
removeHeadersAndFooters: true,
|
|
1516
|
+
detectColumns: true,
|
|
1517
|
+
detectHeadings: true,
|
|
1518
|
+
detectLists: true,
|
|
1519
|
+
detectTables: true,
|
|
1520
|
+
dehyphenate: true
|
|
1521
|
+
};
|
|
1522
|
+
function analyzePdfLayout(pages, options = {}) {
|
|
1523
|
+
const opts = { ...DEFAULTS };
|
|
1524
|
+
Object.keys(options).forEach((key) => {
|
|
1525
|
+
if (options[key] !== void 0) opts[key] = options[key];
|
|
1526
|
+
});
|
|
1527
|
+
const fragPages = pages.map((page) => buildFragments(_nullishCoalesce(page.runs, () => ( []))));
|
|
1528
|
+
const removed = opts.removeHeadersAndFooters ? removeHeadersAndFooters(fragPages) : { headers: 0, footers: 0, pageNumbers: 0 };
|
|
1529
|
+
const bySize = /* @__PURE__ */ new Map();
|
|
1530
|
+
let boldChars = 0;
|
|
1531
|
+
let totalChars = 0;
|
|
1532
|
+
fragPages.flat().forEach((f) => {
|
|
1533
|
+
const key = Math.round(f.size * 2) / 2;
|
|
1534
|
+
bySize.set(key, (_nullishCoalesce(bySize.get(key), () => ( 0))) + f.text.length);
|
|
1535
|
+
});
|
|
1536
|
+
let body = 10;
|
|
1537
|
+
let bodyChars = -1;
|
|
1538
|
+
bySize.forEach((chars, size) => {
|
|
1539
|
+
if (chars > bodyChars) {
|
|
1540
|
+
body = size;
|
|
1541
|
+
bodyChars = chars;
|
|
1542
|
+
}
|
|
1543
|
+
});
|
|
1544
|
+
fragPages.flat().forEach((f) => {
|
|
1545
|
+
if (Math.abs(f.size - body) <= body * 0.05) {
|
|
1546
|
+
totalChars += f.text.length;
|
|
1547
|
+
if (f.bold) boldChars += f.text.length;
|
|
1548
|
+
}
|
|
1549
|
+
});
|
|
1550
|
+
const pitches = /* @__PURE__ */ new Map();
|
|
1551
|
+
fragPages.forEach((frags) => {
|
|
1552
|
+
const rows = baselineRows([...frags].sort((a, b) => b.y - a.y || a.x0 - b.x0));
|
|
1553
|
+
for (let k = 1; k < rows.length; k++) {
|
|
1554
|
+
const a = rows[k - 1][0];
|
|
1555
|
+
const b = rows[k][0];
|
|
1556
|
+
if (Math.abs(a.size - b.size) > 0.5) continue;
|
|
1557
|
+
const d = a.y - b.y;
|
|
1558
|
+
if (d > 0 && d < a.size * 3) {
|
|
1559
|
+
const key = Math.round(b.size * 2) / 2;
|
|
1560
|
+
if (!pitches.has(key)) pitches.set(key, []);
|
|
1561
|
+
pitches.get(key).push(d);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
});
|
|
1565
|
+
const pitchMedians = /* @__PURE__ */ new Map();
|
|
1566
|
+
pitches.forEach((values, key) => pitchMedians.set(key, median(values)));
|
|
1567
|
+
const stats = { dehyphenated: 0 };
|
|
1568
|
+
const ctx = {
|
|
1569
|
+
body,
|
|
1570
|
+
boldBody: totalChars > 0 && boldChars / totalChars > 0.5,
|
|
1571
|
+
pitch: (size) => {
|
|
1572
|
+
const known = pitchMedians.get(Math.round(size * 2) / 2);
|
|
1573
|
+
return known && known >= size * 0.9 ? known : size * 1.2;
|
|
1574
|
+
},
|
|
1575
|
+
options: opts,
|
|
1576
|
+
stats,
|
|
1577
|
+
blocks: [],
|
|
1578
|
+
headings: [],
|
|
1579
|
+
open: null
|
|
1580
|
+
};
|
|
1581
|
+
const columnPages = { count: 0 };
|
|
1582
|
+
const items = [];
|
|
1583
|
+
fragPages.forEach((frags, pageIndex) => {
|
|
1584
|
+
const page = pageIndex + 1;
|
|
1585
|
+
let flowFrags = frags;
|
|
1586
|
+
const atoms = [];
|
|
1587
|
+
if (opts.detectTables && _optionalChain([pages, 'access', _44 => _44[pageIndex], 'access', _45 => _45.rules, 'optionalAccess', _46 => _46.length])) {
|
|
1588
|
+
const ruled = ruledTables(frags, pages[pageIndex].rules, page, opts.dehyphenate, stats);
|
|
1589
|
+
flowFrags = frags.filter((f) => !ruled.consumed.has(f));
|
|
1590
|
+
atoms.push(...ruled.atoms);
|
|
1591
|
+
}
|
|
1592
|
+
const before = columnPages.count;
|
|
1593
|
+
const segments = readingOrder([...flowFrags, ...atoms], body, opts.detectColumns, 0, columnPages);
|
|
1594
|
+
if (columnPages.count > before) items.push({ type: "columns", page, confidence: 0.8, detail: "multi-column layout" });
|
|
1595
|
+
const units = [];
|
|
1596
|
+
let carry = [];
|
|
1597
|
+
for (const segment of segments) {
|
|
1598
|
+
if (segment.kind === "grid" && opts.detectTables) {
|
|
1599
|
+
const result = alignedTable(segment.items.filter((f) => !f.table), page, 3, opts.dehyphenate, stats);
|
|
1600
|
+
if (result) {
|
|
1601
|
+
const last = units[units.length - 1];
|
|
1602
|
+
if (result.before.length && last && last.kind === "flow") last.items.push(...carry, ...result.before);
|
|
1603
|
+
else if (result.before.length || carry.length) units.push({ kind: "flow", items: [...carry, ...result.before] });
|
|
1604
|
+
units.push({ kind: "table", table: result.table });
|
|
1605
|
+
carry = [...segment.items.filter((f) => f.table), ...result.leftover];
|
|
1606
|
+
continue;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
units.push({ kind: "flow", items: [...carry, ...segment.items] });
|
|
1610
|
+
carry = [];
|
|
1611
|
+
}
|
|
1612
|
+
if (carry.length) units.push({ kind: "flow", items: carry });
|
|
1613
|
+
for (const unit of units) {
|
|
1614
|
+
if (unit.kind === "table") {
|
|
1615
|
+
ctx.open = null;
|
|
1616
|
+
ctx.blocks.push(unit.table);
|
|
1617
|
+
} else buildBlocks(flowLines(unit.items, page), ctx);
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
assignHeadingLevels(ctx.headings);
|
|
1621
|
+
const counts = { headings: 0, lists: 0, tables: 0, paragraphs: 0 };
|
|
1622
|
+
const confidences = [];
|
|
1623
|
+
ctx.blocks.forEach((block) => {
|
|
1624
|
+
if (block.type === "heading") {
|
|
1625
|
+
counts.headings++;
|
|
1626
|
+
confidences.push(block.confidence);
|
|
1627
|
+
items.push({ type: "heading", page: block.page, confidence: block.confidence, detail: `H${block.level} "${truncate(block.text)}"` });
|
|
1628
|
+
} else if (block.type === "list") {
|
|
1629
|
+
counts.lists++;
|
|
1630
|
+
confidences.push(block.confidence);
|
|
1631
|
+
const depth = maxOf(block.items, (i) => i.depth) + 1;
|
|
1632
|
+
items.push({
|
|
1633
|
+
type: "list",
|
|
1634
|
+
page: block.page,
|
|
1635
|
+
confidence: block.confidence,
|
|
1636
|
+
detail: `${_optionalChain([block, 'access', _47 => _47.items, 'access', _48 => _48[0], 'optionalAccess', _49 => _49.ordered]) ? "numbered" : "bulleted"} list, ${block.items.length} items${depth > 1 ? `, ${depth} levels` : ""}`
|
|
1637
|
+
});
|
|
1638
|
+
} else if (block.type === "table") {
|
|
1639
|
+
counts.tables++;
|
|
1640
|
+
confidences.push(block.confidence);
|
|
1641
|
+
items.push({
|
|
1642
|
+
type: "table",
|
|
1643
|
+
page: block.page,
|
|
1644
|
+
confidence: block.confidence,
|
|
1645
|
+
detail: `${block.rows.length}\xD7${block.columns} table${block.ruled ? " (ruled)" : ""}${block.headerRows ? ", header row" : ""}`
|
|
1646
|
+
});
|
|
1647
|
+
} else counts.paragraphs++;
|
|
1648
|
+
});
|
|
1649
|
+
items.sort((a, b) => a.page - b.page);
|
|
1650
|
+
return {
|
|
1651
|
+
blocks: ctx.blocks,
|
|
1652
|
+
report: {
|
|
1653
|
+
mode: "structured",
|
|
1654
|
+
pages: pages.length,
|
|
1655
|
+
counts,
|
|
1656
|
+
multiColumnPages: columnPages.count,
|
|
1657
|
+
confidence: confidences.length ? Math.round(confidences.reduce((a, b) => a + b, 0) / confidences.length * 100) / 100 : 1,
|
|
1658
|
+
items,
|
|
1659
|
+
removed,
|
|
1660
|
+
dehyphenated: stats.dehyphenated
|
|
1661
|
+
}
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
var truncate = (text) => text.length > 60 ? `${text.slice(0, 57)}\u2026` : text;
|
|
1665
|
+
function listHtml(items) {
|
|
1666
|
+
let html = "";
|
|
1667
|
+
const stack = [];
|
|
1668
|
+
for (const item of items) {
|
|
1669
|
+
const level = item.depth + 1;
|
|
1670
|
+
while (stack.length > level) html += `</li></${stack.pop()}>`;
|
|
1671
|
+
const tag = item.ordered ? "ol" : "ul";
|
|
1672
|
+
if (stack.length === level) {
|
|
1673
|
+
if (stack[stack.length - 1] !== tag) {
|
|
1674
|
+
html += `</li></${stack.pop()}>`;
|
|
1675
|
+
} else html += "</li>";
|
|
1676
|
+
}
|
|
1677
|
+
while (stack.length < level) {
|
|
1678
|
+
const start = item.ordered && item.start !== void 0 && item.start !== 1 ? ` start="${item.start}"` : "";
|
|
1679
|
+
html += `<${tag}${start}>`;
|
|
1680
|
+
stack.push(tag);
|
|
1681
|
+
}
|
|
1682
|
+
html += `<li><p>${_chunk7WISYZFOcjs.escapeHtml.call(void 0, item.text)}</p>`;
|
|
1683
|
+
}
|
|
1684
|
+
while (stack.length) html += `</li></${stack.pop()}>`;
|
|
1685
|
+
return html;
|
|
1686
|
+
}
|
|
1687
|
+
function pdfLayoutBlocksToHtml(blocks) {
|
|
1688
|
+
let html = "";
|
|
1689
|
+
for (const block of blocks) {
|
|
1690
|
+
if (block.type === "heading") html += `<h${block.level}>${_chunk7WISYZFOcjs.escapeHtml.call(void 0, block.text)}</h${block.level}>`;
|
|
1691
|
+
else if (block.type === "paragraph") html += `<p>${_chunk7WISYZFOcjs.escapeHtml.call(void 0, block.text)}</p>`;
|
|
1692
|
+
else if (block.type === "list") html += listHtml(block.items);
|
|
1693
|
+
else {
|
|
1694
|
+
html += "<table><tbody>";
|
|
1695
|
+
for (const row of block.rows) {
|
|
1696
|
+
html += "<tr>";
|
|
1697
|
+
for (const cell of row) {
|
|
1698
|
+
const tag = cell.header ? "th" : "td";
|
|
1699
|
+
const attrs = `${cell.colSpan > 1 ? ` colspan="${cell.colSpan}"` : ""}${cell.rowSpan > 1 ? ` rowspan="${cell.rowSpan}"` : ""}`;
|
|
1700
|
+
html += `<${tag}${attrs}><p>${_chunk7WISYZFOcjs.escapeHtml.call(void 0, cell.text)}</p></${tag}>`;
|
|
1701
|
+
}
|
|
1702
|
+
html += "</tr>";
|
|
1703
|
+
}
|
|
1704
|
+
html += "</tbody></table>";
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
return html || "<p></p>";
|
|
1708
|
+
}
|
|
603
1709
|
|
|
604
1710
|
// src/import/pdf.ts
|
|
605
1711
|
var isTextItem = (item) => typeof item.str === "string";
|
|
606
|
-
function
|
|
1712
|
+
function median2(values) {
|
|
607
1713
|
if (!values.length) return 0;
|
|
608
1714
|
const sorted = [...values].sort((a, b) => a - b);
|
|
609
1715
|
const mid = sorted.length >> 1;
|
|
@@ -615,9 +1721,9 @@ function groupLines(items) {
|
|
|
615
1721
|
let breakNext = false;
|
|
616
1722
|
for (const item of items) {
|
|
617
1723
|
if (!isTextItem(item)) continue;
|
|
618
|
-
const x = _nullishCoalesce(_optionalChain([item, 'access',
|
|
619
|
-
const y = _nullishCoalesce(_optionalChain([item, 'access',
|
|
620
|
-
const height = item.height || Math.abs(_nullishCoalesce(_optionalChain([item, 'access',
|
|
1724
|
+
const x = _nullishCoalesce(_optionalChain([item, 'access', _50 => _50.transform, 'optionalAccess', _51 => _51[4]]), () => ( 0));
|
|
1725
|
+
const y = _nullishCoalesce(_optionalChain([item, 'access', _52 => _52.transform, 'optionalAccess', _53 => _53[5]]), () => ( (_nullishCoalesce(_optionalChain([current, 'optionalAccess', _54 => _54.y]), () => ( 0)))));
|
|
1726
|
+
const height = item.height || Math.abs(_nullishCoalesce(_optionalChain([item, 'access', _55 => _55.transform, 'optionalAccess', _56 => _56[3]]), () => ( 0))) || _optionalChain([current, 'optionalAccess', _57 => _57.height]) || 10;
|
|
621
1727
|
const tolerance = Math.max(1, height * 0.5);
|
|
622
1728
|
if (!item.str) {
|
|
623
1729
|
if (item.hasEOL) {
|
|
@@ -646,7 +1752,7 @@ function pdfTextItemsToParagraphs(items, options = {}) {
|
|
|
646
1752
|
const gap = lines[i - 1].y - lines[i].y;
|
|
647
1753
|
if (gap > 0) gaps.push(gap);
|
|
648
1754
|
}
|
|
649
|
-
const typical =
|
|
1755
|
+
const typical = median2(gaps);
|
|
650
1756
|
const factor = _nullishCoalesce(options.paragraphGap, () => ( 1.4));
|
|
651
1757
|
const paragraphs = [];
|
|
652
1758
|
let current = [];
|
|
@@ -673,6 +1779,228 @@ function pdfTextItemsToParagraphs(items, options = {}) {
|
|
|
673
1779
|
flush();
|
|
674
1780
|
return paragraphs;
|
|
675
1781
|
}
|
|
1782
|
+
function pdfTextItemsToRuns(items, font) {
|
|
1783
|
+
const runs = [];
|
|
1784
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1785
|
+
for (const item of items) {
|
|
1786
|
+
if (!isTextItem(item) || !item.str.trim()) continue;
|
|
1787
|
+
const t = _nullishCoalesce(item.transform, () => ( []));
|
|
1788
|
+
const fontSize = Math.hypot(_nullishCoalesce(t[2], () => ( 0)), _nullishCoalesce(t[3], () => ( 0))) || item.height || 10;
|
|
1789
|
+
let info;
|
|
1790
|
+
if (item.fontName && font) {
|
|
1791
|
+
if (!cache.has(item.fontName)) cache.set(item.fontName, font(item.fontName));
|
|
1792
|
+
info = cache.get(item.fontName);
|
|
1793
|
+
}
|
|
1794
|
+
runs.push({
|
|
1795
|
+
text: item.str,
|
|
1796
|
+
x: _nullishCoalesce(t[4], () => ( 0)),
|
|
1797
|
+
y: _nullishCoalesce(t[5], () => ( 0)),
|
|
1798
|
+
width: item.width,
|
|
1799
|
+
fontSize,
|
|
1800
|
+
fontName: _nullishCoalesce(_optionalChain([info, 'optionalAccess', _58 => _58.name]), () => ( item.fontName)),
|
|
1801
|
+
bold: _optionalChain([info, 'optionalAccess', _59 => _59.bold]),
|
|
1802
|
+
italic: _optionalChain([info, 'optionalAccess', _60 => _60.italic])
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
return runs;
|
|
1806
|
+
}
|
|
1807
|
+
var DEFAULT_OPS = {
|
|
1808
|
+
save: 10,
|
|
1809
|
+
restore: 11,
|
|
1810
|
+
transform: 12,
|
|
1811
|
+
moveTo: 13,
|
|
1812
|
+
lineTo: 14,
|
|
1813
|
+
curveTo: 15,
|
|
1814
|
+
curveTo2: 16,
|
|
1815
|
+
curveTo3: 17,
|
|
1816
|
+
closePath: 18,
|
|
1817
|
+
rectangle: 19,
|
|
1818
|
+
stroke: 20,
|
|
1819
|
+
closeStroke: 21,
|
|
1820
|
+
fill: 22,
|
|
1821
|
+
eoFill: 23,
|
|
1822
|
+
fillStroke: 24,
|
|
1823
|
+
eoFillStroke: 25,
|
|
1824
|
+
closeFillStroke: 26,
|
|
1825
|
+
closeEOFillStroke: 27,
|
|
1826
|
+
endPath: 28,
|
|
1827
|
+
constructPath: 91
|
|
1828
|
+
};
|
|
1829
|
+
var DRAW_OPS = { moveTo: 0, lineTo: 1, curveTo: 2, quadraticCurveTo: 3, closePath: 4 };
|
|
1830
|
+
var MAX_PAGE_RULES = 5e3;
|
|
1831
|
+
var IDENTITY = [1, 0, 0, 1, 0, 0];
|
|
1832
|
+
var multiply = (m, c) => [
|
|
1833
|
+
m[0] * c[0] + m[1] * c[2],
|
|
1834
|
+
m[0] * c[1] + m[1] * c[3],
|
|
1835
|
+
m[2] * c[0] + m[3] * c[2],
|
|
1836
|
+
m[2] * c[1] + m[3] * c[3],
|
|
1837
|
+
m[4] * c[0] + m[5] * c[2] + c[4],
|
|
1838
|
+
m[4] * c[1] + m[5] * c[3] + c[5]
|
|
1839
|
+
];
|
|
1840
|
+
var apply = (m, x, y) => [m[0] * x + m[2] * y + m[4], m[1] * x + m[3] * y + m[5]];
|
|
1841
|
+
function pdfOperatorListToRules(list, opsTable) {
|
|
1842
|
+
const OPS = { ...DEFAULT_OPS, ..._nullishCoalesce(opsTable, () => ( {})) };
|
|
1843
|
+
const stroking = /* @__PURE__ */ new Set([OPS.stroke, OPS.closeStroke, OPS.fillStroke, OPS.eoFillStroke, OPS.closeFillStroke, OPS.closeEOFillStroke]);
|
|
1844
|
+
const filling = /* @__PURE__ */ new Set([OPS.fill, OPS.eoFill, OPS.fillStroke, OPS.eoFillStroke, OPS.closeFillStroke, OPS.closeEOFillStroke]);
|
|
1845
|
+
const rules = [];
|
|
1846
|
+
const stack = [];
|
|
1847
|
+
let ctm = IDENTITY;
|
|
1848
|
+
let lines = [];
|
|
1849
|
+
let rects = [];
|
|
1850
|
+
const num = (value) => typeof value === "number" && Number.isFinite(value) ? value : NaN;
|
|
1851
|
+
const addLine = (x1, y1, x2, y2) => {
|
|
1852
|
+
const [a, b] = apply(ctm, x1, y1);
|
|
1853
|
+
const [c, d] = apply(ctm, x2, y2);
|
|
1854
|
+
lines.push([a, b, c, d]);
|
|
1855
|
+
};
|
|
1856
|
+
const addRect = (x, y, w, h) => {
|
|
1857
|
+
const corners = [apply(ctm, x, y), apply(ctm, x + w, y), apply(ctm, x + w, y + h), apply(ctm, x, y + h)];
|
|
1858
|
+
const xs = corners.map((p) => p[0]);
|
|
1859
|
+
const ys = corners.map((p) => p[1]);
|
|
1860
|
+
rects.push([Math.min(...xs), Math.min(...ys), Math.max(...xs), Math.max(...ys)]);
|
|
1861
|
+
};
|
|
1862
|
+
const paint = (op) => {
|
|
1863
|
+
const stroke = stroking.has(op);
|
|
1864
|
+
const fill = filling.has(op);
|
|
1865
|
+
if (stroke) {
|
|
1866
|
+
for (const [x1, y1, x2, y2] of lines) rules.push({ x1, y1, x2, y2 });
|
|
1867
|
+
for (const [x0, y0, x1, y1] of rects) {
|
|
1868
|
+
rules.push({ x1: x0, y1: y0, x2: x1, y2: y0 }, { x1: x0, y1, x2: x1, y2: y1 });
|
|
1869
|
+
rules.push({ x1: x0, y1: y0, x2: x0, y2: y1 }, { x1, y1: y0, x2: x1, y2: y1 });
|
|
1870
|
+
}
|
|
1871
|
+
} else if (fill) {
|
|
1872
|
+
for (const [x0, y0, x1, y1] of rects) {
|
|
1873
|
+
if (y1 - y0 <= 2 && x1 - x0 > 2) rules.push({ x1: x0, y1: (y0 + y1) / 2, x2: x1, y2: (y0 + y1) / 2 });
|
|
1874
|
+
else if (x1 - x0 <= 2 && y1 - y0 > 2) rules.push({ x1: (x0 + x1) / 2, y1: y0, x2: (x0 + x1) / 2, y2: y1 });
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
lines = [];
|
|
1878
|
+
rects = [];
|
|
1879
|
+
};
|
|
1880
|
+
const readPath = (subOps, subArgs) => {
|
|
1881
|
+
let k = 0;
|
|
1882
|
+
let cx = 0;
|
|
1883
|
+
let cy = 0;
|
|
1884
|
+
let sx = 0;
|
|
1885
|
+
let sy = 0;
|
|
1886
|
+
for (let i = 0; i < subOps.length; i++) {
|
|
1887
|
+
const op = subOps[i];
|
|
1888
|
+
if (op === OPS.moveTo) {
|
|
1889
|
+
cx = sx = num(subArgs[k++]);
|
|
1890
|
+
cy = sy = num(subArgs[k++]);
|
|
1891
|
+
} else if (op === OPS.lineTo) {
|
|
1892
|
+
const x = num(subArgs[k++]);
|
|
1893
|
+
const y = num(subArgs[k++]);
|
|
1894
|
+
addLine(cx, cy, x, y);
|
|
1895
|
+
cx = x;
|
|
1896
|
+
cy = y;
|
|
1897
|
+
} else if (op === OPS.rectangle) {
|
|
1898
|
+
addRect(num(subArgs[k++]), num(subArgs[k++]), num(subArgs[k++]), num(subArgs[k++]));
|
|
1899
|
+
} else if (op === OPS.curveTo) {
|
|
1900
|
+
k += 4;
|
|
1901
|
+
cx = num(subArgs[k++]);
|
|
1902
|
+
cy = num(subArgs[k++]);
|
|
1903
|
+
} else if (op === OPS.curveTo2 || op === OPS.curveTo3) {
|
|
1904
|
+
k += 2;
|
|
1905
|
+
cx = num(subArgs[k++]);
|
|
1906
|
+
cy = num(subArgs[k++]);
|
|
1907
|
+
} else if (op === OPS.closePath) {
|
|
1908
|
+
if (cx !== sx || cy !== sy) addLine(cx, cy, sx, sy);
|
|
1909
|
+
cx = sx;
|
|
1910
|
+
cy = sy;
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
const readDrawBuffer = (data) => {
|
|
1915
|
+
let cx = 0;
|
|
1916
|
+
let cy = 0;
|
|
1917
|
+
let sx = 0;
|
|
1918
|
+
let sy = 0;
|
|
1919
|
+
for (let k = 0; k < data.length; ) {
|
|
1920
|
+
const code = data[k++];
|
|
1921
|
+
if (code === DRAW_OPS.moveTo) {
|
|
1922
|
+
cx = sx = data[k++];
|
|
1923
|
+
cy = sy = data[k++];
|
|
1924
|
+
} else if (code === DRAW_OPS.lineTo) {
|
|
1925
|
+
const x = data[k++];
|
|
1926
|
+
const y = data[k++];
|
|
1927
|
+
addLine(cx, cy, x, y);
|
|
1928
|
+
cx = x;
|
|
1929
|
+
cy = y;
|
|
1930
|
+
} else if (code === DRAW_OPS.curveTo) {
|
|
1931
|
+
k += 4;
|
|
1932
|
+
cx = data[k++];
|
|
1933
|
+
cy = data[k++];
|
|
1934
|
+
} else if (code === DRAW_OPS.quadraticCurveTo) {
|
|
1935
|
+
k += 2;
|
|
1936
|
+
cx = data[k++];
|
|
1937
|
+
cy = data[k++];
|
|
1938
|
+
} else if (code === DRAW_OPS.closePath) {
|
|
1939
|
+
if (cx !== sx || cy !== sy) addLine(cx, cy, sx, sy);
|
|
1940
|
+
cx = sx;
|
|
1941
|
+
cy = sy;
|
|
1942
|
+
} else break;
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
for (let i = 0; i < list.fnArray.length && rules.length < MAX_PAGE_RULES; i++) {
|
|
1946
|
+
const fn = list.fnArray[i];
|
|
1947
|
+
const args = list.argsArray[i];
|
|
1948
|
+
if (fn === OPS.save) stack.push(ctm);
|
|
1949
|
+
else if (fn === OPS.restore) ctm = _nullishCoalesce(stack.pop(), () => ( IDENTITY));
|
|
1950
|
+
else if (fn === OPS.transform && args && args.length >= 6) {
|
|
1951
|
+
const m = Array.from({ length: 6 }, (_, k) => num(args[k]));
|
|
1952
|
+
if (m.every(Number.isFinite)) ctm = multiply(m, ctm);
|
|
1953
|
+
} else if (fn === OPS.constructPath && args) {
|
|
1954
|
+
const first = args[0];
|
|
1955
|
+
if (typeof first === "number") {
|
|
1956
|
+
const buffers = args[1];
|
|
1957
|
+
const data = _optionalChain([buffers, 'optionalAccess', _61 => _61[0]]);
|
|
1958
|
+
if (data && typeof data.length === "number") readDrawBuffer(data);
|
|
1959
|
+
paint(first);
|
|
1960
|
+
} else if (first && typeof first.length === "number") {
|
|
1961
|
+
readPath(first, _nullishCoalesce(args[1], () => ( [])));
|
|
1962
|
+
}
|
|
1963
|
+
} else if (stroking.has(fn) || filling.has(fn)) paint(fn);
|
|
1964
|
+
else if (fn === OPS.endPath) {
|
|
1965
|
+
lines = [];
|
|
1966
|
+
rects = [];
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
return rules.filter((rule) => [rule.x1, rule.y1, rule.x2, rule.y2].every(Number.isFinite));
|
|
1970
|
+
}
|
|
1971
|
+
function fontResolver(page, content) {
|
|
1972
|
+
return (fontName) => {
|
|
1973
|
+
let info;
|
|
1974
|
+
try {
|
|
1975
|
+
if (page.commonObjs && (!page.commonObjs.has || page.commonObjs.has(fontName))) {
|
|
1976
|
+
const font = page.commonObjs.get(fontName);
|
|
1977
|
+
if (font && typeof font === "object") {
|
|
1978
|
+
info = {
|
|
1979
|
+
name: typeof font.name === "string" ? font.name : void 0,
|
|
1980
|
+
bold: font.bold || font.black ? true : void 0,
|
|
1981
|
+
italic: font.italic ? true : void 0
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
} catch (e) {
|
|
1986
|
+
}
|
|
1987
|
+
const family = _optionalChain([content, 'access', _62 => _62.styles, 'optionalAccess', _63 => _63[fontName], 'optionalAccess', _64 => _64.fontFamily]);
|
|
1988
|
+
if (!_optionalChain([info, 'optionalAccess', _65 => _65.name]) && family) info = { ...info, name: family };
|
|
1989
|
+
return info;
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1992
|
+
function plainReport(paragraphs, pages) {
|
|
1993
|
+
return {
|
|
1994
|
+
mode: "plain",
|
|
1995
|
+
pages,
|
|
1996
|
+
counts: { headings: 0, lists: 0, tables: 0, paragraphs },
|
|
1997
|
+
multiColumnPages: 0,
|
|
1998
|
+
confidence: 1,
|
|
1999
|
+
items: [],
|
|
2000
|
+
removed: { headers: 0, footers: 0, pageNumbers: 0 },
|
|
2001
|
+
dehyphenated: 0
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
676
2004
|
function createPdfImportAdapter(pdfjs, options = {}) {
|
|
677
2005
|
return {
|
|
678
2006
|
id: _nullishCoalesce(options.id, () => ( "pdf")),
|
|
@@ -681,22 +2009,47 @@ function createPdfImportAdapter(pdfjs, options = {}) {
|
|
|
681
2009
|
extensions: [".pdf"],
|
|
682
2010
|
target: "document",
|
|
683
2011
|
async import(_input, context) {
|
|
2012
|
+
const call = context.options && typeof context.options === "object" ? context.options : {};
|
|
2013
|
+
const opts = { ...options, ...call, layout: { ...options.layout, ...call.layout } };
|
|
2014
|
+
const structured = opts.structure !== false;
|
|
684
2015
|
const data = new Uint8Array((await context.readArrayBuffer()).slice(0));
|
|
685
|
-
const doc = await pdfjs.getDocument({ ...
|
|
2016
|
+
const doc = await pdfjs.getDocument({ ...opts.documentParams, data }).promise;
|
|
686
2017
|
const paragraphs = [];
|
|
2018
|
+
const layoutPages = [];
|
|
2019
|
+
let pages = 0;
|
|
687
2020
|
try {
|
|
688
|
-
|
|
2021
|
+
pages = Math.min(doc.numPages, _nullishCoalesce(opts.maxPages, () => ( Infinity)));
|
|
689
2022
|
for (let n = 1; n <= pages; n++) {
|
|
690
2023
|
const page = await doc.getPage(n);
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
2024
|
+
if (!structured) {
|
|
2025
|
+
const content = await page.getTextContent();
|
|
2026
|
+
paragraphs.push(...pdfTextItemsToParagraphs(content.items, opts));
|
|
2027
|
+
} else {
|
|
2028
|
+
let rules = [];
|
|
2029
|
+
if (opts.rulingLines !== false && typeof page.getOperatorList === "function") {
|
|
2030
|
+
try {
|
|
2031
|
+
rules = pdfOperatorListToRules(await page.getOperatorList(), pdfjs.OPS);
|
|
2032
|
+
} catch (e2) {
|
|
2033
|
+
rules = [];
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
const content = await page.getTextContent();
|
|
2037
|
+
layoutPages.push({ runs: pdfTextItemsToRuns(content.items, fontResolver(page, content)), rules });
|
|
2038
|
+
}
|
|
2039
|
+
_optionalChain([page, 'access', _66 => _66.cleanup, 'optionalCall', _67 => _67()]);
|
|
694
2040
|
}
|
|
695
2041
|
} finally {
|
|
696
|
-
await _optionalChain([doc, 'access',
|
|
2042
|
+
await _optionalChain([doc, 'access', _68 => _68.destroy, 'optionalCall', _69 => _69()]);
|
|
2043
|
+
}
|
|
2044
|
+
if (!structured) {
|
|
2045
|
+
const text = paragraphs.join("\n");
|
|
2046
|
+
return { html: _chunkV3CHHWOEcjs.plainTextToParagraphHtml.call(void 0, text), text, structure: plainReport(paragraphs.length, pages) };
|
|
697
2047
|
}
|
|
698
|
-
const
|
|
699
|
-
|
|
2048
|
+
const layout = { ...opts.layout };
|
|
2049
|
+
if (layout.paragraphGap === void 0 && opts.paragraphGap !== void 0) layout.paragraphGap = opts.paragraphGap;
|
|
2050
|
+
const { blocks, report } = analyzePdfLayout(layoutPages, layout);
|
|
2051
|
+
const html = _chunkV3CHHWOEcjs.sanitizeImportedHtml.call(void 0, pdfLayoutBlocksToHtml(blocks));
|
|
2052
|
+
return { html, text: _chunk7WISYZFOcjs.htmlToPlainText.call(void 0, html), structure: report };
|
|
700
2053
|
}
|
|
701
2054
|
};
|
|
702
2055
|
}
|
|
@@ -730,8 +2083,8 @@ function createZipImportAdapter(options = {}) {
|
|
|
730
2083
|
extensions: [".zip"],
|
|
731
2084
|
target: "document",
|
|
732
2085
|
async import(_input, context) {
|
|
733
|
-
const registry = _nullishCoalesce(_nullishCoalesce(options.registry, () => ( context.registry)), () => (
|
|
734
|
-
const zip = await
|
|
2086
|
+
const registry = _nullishCoalesce(_nullishCoalesce(options.registry, () => ( context.registry)), () => ( _chunkPO6A6QQHcjs.defaultImportRegistry));
|
|
2087
|
+
const zip = await _chunkPO6A6QQHcjs.readZip.call(void 0, await context.readArrayBuffer(), {
|
|
735
2088
|
maxTotalSize: 100 * 1024 * 1024,
|
|
736
2089
|
maxEntries: 5e3,
|
|
737
2090
|
...options.zip
|
|
@@ -765,7 +2118,7 @@ function createZipImportAdapter(options = {}) {
|
|
|
765
2118
|
});
|
|
766
2119
|
const title = zipEntryTitle(name);
|
|
767
2120
|
if (options.headings !== false) {
|
|
768
|
-
html += `<h${level}>${
|
|
2121
|
+
html += `<h${level}>${_chunk7WISYZFOcjs.escapeHtml.call(void 0, title)}</h${level}>`;
|
|
769
2122
|
text += `${text ? "\n" : ""}${title}
|
|
770
2123
|
`;
|
|
771
2124
|
} else if (text) {
|
|
@@ -775,13 +2128,13 @@ function createZipImportAdapter(options = {}) {
|
|
|
775
2128
|
text += outcome.result.text;
|
|
776
2129
|
files.push({ name, adapterId: adapter.id });
|
|
777
2130
|
} catch (error) {
|
|
778
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
2131
|
+
const code = _optionalChain([error, 'optionalAccess', _70 => _70.code]);
|
|
779
2132
|
if (code === "too_large") throw error;
|
|
780
2133
|
skipped.push({ name, reason: error instanceof Error ? error.message : String(error) });
|
|
781
2134
|
}
|
|
782
2135
|
}
|
|
783
2136
|
if (!files.length) {
|
|
784
|
-
throw new (0,
|
|
2137
|
+
throw new (0, _chunkPO6A6QQHcjs.ImportError)("invalid_file", "The archive contains no importable documents.", {
|
|
785
2138
|
fileName: context.fileName
|
|
786
2139
|
});
|
|
787
2140
|
}
|
|
@@ -1139,5 +2492,98 @@ var zipImportAdapter = createZipImportAdapter();
|
|
|
1139
2492
|
|
|
1140
2493
|
|
|
1141
2494
|
|
|
1142
|
-
exports.Autocorrect = _chunkSBCZ6RN5cjs.Autocorrect; exports.BLOCK_CHANGE_ATTRIBUTE = _chunkD27YFC46cjs.BLOCK_CHANGE_ATTRIBUTE; exports.BUILT_IN_IMPORT_ADAPTERS = _chunkSBCZ6RN5cjs.BUILT_IN_IMPORT_ADAPTERS; exports.Bookmark = _chunkSBCZ6RN5cjs.Bookmark; exports.COMMENT_MARK_NAME = _chunkSBCZ6RN5cjs.COMMENT_MARK_NAME; exports.ColorHighlighter = _chunkSBCZ6RN5cjs.ColorHighlighter; exports.CommentStore = _chunkD27YFC46cjs.CommentStore; exports.Comments = _chunkSBCZ6RN5cjs.Comments; exports.CrossReference = _chunkSBCZ6RN5cjs.CrossReference; exports.DEFAULT_AUTOCORRECT_EXCEPTIONS = _chunkSBCZ6RN5cjs.DEFAULT_AUTOCORRECT_EXCEPTIONS; exports.DEFAULT_COLUMN_WIDTH = _chunkMA2F5KHFcjs.DEFAULT_COLUMN_WIDTH; exports.DEFAULT_DOCX_MAX_IMAGE_SIZE = _chunkSBCZ6RN5cjs.DEFAULT_DOCX_MAX_IMAGE_SIZE; exports.DEFAULT_ROW_HEIGHT = _chunkMA2F5KHFcjs.DEFAULT_ROW_HEIGHT; exports.DEFAULT_ZIP_MAX_ENTRIES = _chunkSBCZ6RN5cjs.DEFAULT_ZIP_MAX_ENTRIES; exports.DEFAULT_ZIP_MAX_TOTAL_SIZE = _chunkSBCZ6RN5cjs.DEFAULT_ZIP_MAX_TOTAL_SIZE; exports.DELETION_MARK_NAME = _chunkD27YFC46cjs.DELETION_MARK_NAME; exports.DOCX_MIME_TYPES = _chunkSBCZ6RN5cjs.DOCX_MIME_TYPES; exports.DataSourceBinder = _chunkMA2F5KHFcjs.DataSourceBinder; exports.DependencyGraph = _chunkMA2F5KHFcjs.DependencyGraph; exports.DirtyTracker = _chunkG2I4QJOTcjs.DirtyTracker; exports.DocumentCompare = _chunkSBCZ6RN5cjs.DocumentCompare; exports.EMPTY_FIND_REPLACE_SNAPSHOT = _chunkSBCZ6RN5cjs.EMPTY_FIND_REPLACE_SNAPSHOT; exports.EditorController = EditorController; exports.FIELD_ALIASES = _chunkP3RQ5UJEcjs.FIELD_ALIASES; exports.FIND_OPTION_TOGGLES = _chunkSBCZ6RN5cjs.FIND_OPTION_TOGGLES; exports.FIND_PARAGRAPH_MARK = _chunkSBCZ6RN5cjs.FIND_PARAGRAPH_MARK; exports.FORMAT_CHANGE_MARK_NAME = _chunkD27YFC46cjs.FORMAT_CHANGE_MARK_NAME; exports.FORMULA_ERRORS = _chunkMCSJFWAOcjs.FORMULA_ERRORS; exports.FileImport = _chunkSBCZ6RN5cjs.FileImport; exports.FileImportController = FileImportController; exports.FindReplace = _chunkSBCZ6RN5cjs.FindReplace; exports.FindReplaceStore = _chunkSBCZ6RN5cjs.FindReplaceStore; exports.FontSize = _chunkSBCZ6RN5cjs.FontSize; exports.Footnote = _chunkSBCZ6RN5cjs.Footnote; exports.FootnoteReference = _chunkSBCZ6RN5cjs.FootnoteReference; exports.Footnotes = _chunkSBCZ6RN5cjs.Footnotes; exports.FormulaEvaluator = _chunkMCSJFWAOcjs.FormulaEvaluator; exports.FormulaParser = _chunkMCSJFWAOcjs.FormulaParser; exports.GradientText = _chunkSBCZ6RN5cjs.GradientText; exports.HistoryManager = _chunkG2I4QJOTcjs.HistoryManager; exports.INSERTION_MARK_NAME = _chunkD27YFC46cjs.INSERTION_MARK_NAME; exports.INSTRUCTION_REGEX = _chunkMKA3AHLVcjs.INSTRUCTION_REGEX; exports.Image = _chunkSBCZ6RN5cjs.Image; exports.ImportAdapterRegistry = _chunkSBCZ6RN5cjs.ImportAdapterRegistry; exports.ImportError = _chunkSBCZ6RN5cjs.ImportError; exports.LoadingNode = _chunkSBCZ6RN5cjs.LoadingNode; exports.MARKDOWN_MENTION_SPLIT_REGEX = _chunkXNORY7M6cjs.MARKDOWN_MENTION_SPLIT_REGEX; exports.MAX_DATA_SOURCE_FIELDS = _chunkP3RQ5UJEcjs.MAX_DATA_SOURCE_FIELDS; exports.MAX_DATA_SOURCE_RECORDS = _chunkP3RQ5UJEcjs.MAX_DATA_SOURCE_RECORDS; exports.MAX_FIND_PATTERN_LENGTH = _chunkSBCZ6RN5cjs.MAX_FIND_PATTERN_LENGTH; exports.MAX_FORMULA_ARRAY_SIZE = _chunkMCSJFWAOcjs.MAX_FORMULA_ARRAY_SIZE; exports.MAX_MERGE_LENGTH = _chunkP3RQ5UJEcjs.MAX_MERGE_LENGTH; exports.MAX_MERGE_OUTPUTS = _chunkP3RQ5UJEcjs.MAX_MERGE_OUTPUTS; exports.MAX_NUMBER_FORMAT_CODE_CHARS = _chunkMCSJFWAOcjs.MAX_NUMBER_FORMAT_CODE_CHARS; exports.MENTION_REGEX = _chunkXNORY7M6cjs.MENTION_REGEX; exports.Markdown = _chunkSBCZ6RN5cjs.Markdown; exports.Mention = _chunkSBCZ6RN5cjs.Mention; exports.NUMBER_FORMAT_PRESETS = _chunkMA2F5KHFcjs.NUMBER_FORMAT_PRESETS; exports.NumberFormat = _chunkMCSJFWAOcjs.NumberFormat; exports.Outline = _chunkSBCZ6RN5cjs.Outline; exports.PIXERATE_DOCUMENT_MIME = _chunkSML64VJGcjs.PIXERATE_DOCUMENT_MIME; exports.RichClipboard = _chunkSBCZ6RN5cjs.RichClipboard; exports.SMILIE_REPLACEMENTS = _chunkSBCZ6RN5cjs.SMILIE_REPLACEMENTS; exports.SPREADSHEET_CLIPBOARD_MIME = _chunkMA2F5KHFcjs.SPREADSHEET_CLIPBOARD_MIME; exports.SPREADSHEET_IMPORT_ADAPTERS = _chunkMA2F5KHFcjs.SPREADSHEET_IMPORT_ADAPTERS; exports.SPREADSHEET_TABLE_ACTIONS = _chunkMA2F5KHFcjs.SPREADSHEET_TABLE_ACTIONS; exports.SlashCommands = _chunkSBCZ6RN5cjs.SlashCommands; exports.SmilieReplacer = _chunkSBCZ6RN5cjs.SmilieReplacer; exports.SpreadsheetController = _chunkMA2F5KHFcjs.SpreadsheetController; exports.TEMPLATE_DEPTH_ERROR = _chunkFD4LPFAEcjs.TEMPLATE_DEPTH_ERROR; exports.TEMPLATE_LOOP_ERROR = _chunkFD4LPFAEcjs.TEMPLATE_LOOP_ERROR; exports.TEMPLATE_REGEX = _chunkMKA3AHLVcjs.TEMPLATE_REGEX; exports.TRACK_CHANGES_SKIP_META = _chunkD27YFC46cjs.TRACK_CHANGES_SKIP_META; exports.TableOfContents = _chunkSBCZ6RN5cjs.TableOfContents; exports.TemplateSuggestions = _chunkSBCZ6RN5cjs.TemplateSuggestions; exports.TrackChanges = _chunkD27YFC46cjs.TrackChanges; exports.TrackChangesStore = _chunkD27YFC46cjs.TrackChangesStore; exports.TrackedDeletion = _chunkD27YFC46cjs.TrackedDeletion; exports.TrackedFormatChange = _chunkD27YFC46cjs.TrackedFormatChange; exports.TrackedInsertion = _chunkD27YFC46cjs.TrackedInsertion; exports.VARIABLE_REGEX = _chunkMKA3AHLVcjs.VARIABLE_REGEX; exports.WHOLE_COLUMN_END_ROW = _chunkMCSJFWAOcjs.WHOLE_COLUMN_END_ROW; exports.ZipArchive = _chunkSBCZ6RN5cjs.ZipArchive; exports.ZipError = _chunkSBCZ6RN5cjs.ZipError; exports.aggregateValues = _chunkMA2F5KHFcjs.aggregateValues; exports.applyDocumentComparison = _chunkSBCZ6RN5cjs.applyDocumentComparison; exports.applyFormulaSuggestion = _chunkMA2F5KHFcjs.applyFormulaSuggestion; exports.applyReplacements = _chunkSBCZ6RN5cjs.applyReplacements; exports.autocorrectPluginKey = _chunkSBCZ6RN5cjs.autocorrectPluginKey; exports.bindDirtyToHistory = _chunkG2I4QJOTcjs.bindDirtyToHistory; exports.bindSpreadsheetTableActions = _chunkMA2F5KHFcjs.bindSpreadsheetTableActions; exports.buildOutlineTree = _chunkSBCZ6RN5cjs.buildOutlineTree; exports.buildSpreadsheetView = _chunkMA2F5KHFcjs.buildSpreadsheetView; exports.builtinNumberFormat = _chunkMCSJFWAOcjs.builtinNumberFormat; exports.builtinNumberFormatId = _chunkMCSJFWAOcjs.builtinNumberFormatId; exports.capitalizeSentenceRules = _chunkSBCZ6RN5cjs.capitalizeSentenceRules; exports.cellFormatForNumberFormat = _chunkMA2F5KHFcjs.cellFormatForNumberFormat; exports.checkFormulaArgumentCount = _chunkMCSJFWAOcjs.checkFormulaArgumentCount; exports.clampMenuPosition = _chunkMA2F5KHFcjs.clampMenuPosition; exports.clearNumberFormatCache = _chunkMCSJFWAOcjs.clearNumberFormatCache; exports.colNameToIndex = _chunkMCSJFWAOcjs.colNameToIndex; exports.columnDependencyKey = _chunkMA2F5KHFcjs.columnDependencyKey; exports.commentsPluginKey = _chunkSBCZ6RN5cjs.commentsPluginKey; exports.compactVariableValues = _chunkP3RQ5UJEcjs.compactVariableValues; exports.compareCellValues = _chunkMA2F5KHFcjs.compareCellValues; exports.compareConditionValues = _chunkMKA3AHLVcjs.compareConditionValues; exports.compareDocuments = _chunkOLZJXL4Rcjs.compareDocuments; exports.compareHtml = _chunkOLZJXL4Rcjs.compareHtml; exports.compareInEditor = _chunkSBCZ6RN5cjs.compareInEditor; exports.compareNumbers = _chunkMCSJFWAOcjs.compareNumbers; exports.compareValues = _chunkMCSJFWAOcjs.compareValues; exports.compileFindPattern = _chunkSBCZ6RN5cjs.compileFindPattern; exports.computeFillTarget = _chunkMA2F5KHFcjs.computeFillTarget; exports.computeOutline = _chunkSBCZ6RN5cjs.computeOutline; exports.computeRowGroups = _chunkMA2F5KHFcjs.computeRowGroups; exports.conditionSubject = _chunkMKA3AHLVcjs.conditionSubject; exports.createCommentStore = _chunkD27YFC46cjs.createCommentStore; exports.createDirtyTracker = _chunkG2I4QJOTcjs.createDirtyTracker; exports.createDocxImportAdapter = _chunkSBCZ6RN5cjs.createDocxImportAdapter; exports.createEditor = createEditor; exports.createFileImportController = createFileImportController; exports.createFindReplaceCommands = _chunkSBCZ6RN5cjs.createFindReplaceCommands; exports.createHistoryManager = _chunkG2I4QJOTcjs.createHistoryManager; exports.createImportAdapterRegistry = _chunkSBCZ6RN5cjs.createImportAdapterRegistry; exports.createImportContext = _chunkSBCZ6RN5cjs.createImportContext; exports.createMentionExtension = _chunkSBCZ6RN5cjs.createMentionExtension; exports.createOutlineStore = _chunkSBCZ6RN5cjs.createOutlineStore; exports.createPdfImportAdapter = createPdfImportAdapter; exports.createReviewId = _chunkD27YFC46cjs.createReviewId; exports.createRichTextPreset = _chunkSBCZ6RN5cjs.createRichTextPreset; exports.createSearchBudget = _chunkSBCZ6RN5cjs.createSearchBudget; exports.createSpreadsheetClipboardData = _chunkMA2F5KHFcjs.createSpreadsheetClipboardData; exports.createZipImportAdapter = createZipImportAdapter; exports.crossReferencePluginKey = _chunkSBCZ6RN5cjs.crossReferencePluginKey; exports.csvImportAdapter = _chunkMA2F5KHFcjs.csvImportAdapter; exports.dateValueToSerial = _chunkMCSJFWAOcjs.dateValueToSerial; exports.defaultAutocorrectRules = _chunkSBCZ6RN5cjs.defaultAutocorrectRules; exports.defaultImportRegistry = _chunkSBCZ6RN5cjs.defaultImportRegistry; exports.defaultIsEqual = _chunkG2I4QJOTcjs.defaultIsEqual; exports.describeBlockChange = _chunkD27YFC46cjs.describeBlockChange; exports.describeConditionalTag = _chunkMKA3AHLVcjs.describeConditionalTag; exports.describeFormatChange = _chunkD27YFC46cjs.describeFormatChange; exports.describeFormulaError = _chunkMCSJFWAOcjs.describeFormulaError; exports.detectDelimiter = _chunkP3RQ5UJEcjs.detectDelimiter; exports.diffChanges = _chunkOLZJXL4Rcjs.diffChanges; exports.diffSequences = _chunkOLZJXL4Rcjs.diffSequences; exports.documentStructureCommandItems = _chunkSBCZ6RN5cjs.documentStructureCommandItems; exports.docxImportAdapter = _chunkSBCZ6RN5cjs.docxImportAdapter; exports.docxToDocumentImport = _chunkSBCZ6RN5cjs.docxToDocumentImport; exports.escapeCsvField = _chunkTNNJXF46cjs.escapeCsvField; exports.escapeHtml = _chunkXNORY7M6cjs.escapeHtml; exports.escapeVariableText = _chunkMKA3AHLVcjs.escapeVariableText; exports.evaluateCondition = _chunkMKA3AHLVcjs.evaluateCondition; exports.evaluateConditionExpression = _chunkMKA3AHLVcjs.evaluateConditionExpression; exports.evaluatePromptTokens = _chunkFD4LPFAEcjs.evaluatePromptTokens; exports.expandReplacement = _chunkSBCZ6RN5cjs.expandReplacement; exports.extractCellDependencies = _chunkMA2F5KHFcjs.extractCellDependencies; exports.extractInstructionNames = _chunkP3RQ5UJEcjs.extractInstructionNames; exports.extractMentions = _chunkXNORY7M6cjs.extractMentions; exports.extractMentionsFromDoc = _chunkXNORY7M6cjs.extractMentionsFromDoc; exports.extractTemplateNames = _chunkP3RQ5UJEcjs.extractTemplateNames; exports.extractVariableNames = _chunkP3RQ5UJEcjs.extractVariableNames; exports.extractVariables = _chunkP3RQ5UJEcjs.extractVariables; exports.fileImportPluginKey = _chunkSBCZ6RN5cjs.fileImportPluginKey; exports.fillSeries = _chunkMA2F5KHFcjs.fillSeries; exports.findAllMatches = _chunkSBCZ6RN5cjs.findAllMatches; exports.findAutocorrection = _chunkSBCZ6RN5cjs.findAutocorrection; exports.findCommentRanges = _chunkSBCZ6RN5cjs.findCommentRanges; exports.findHexColors = _chunkSBCZ6RN5cjs.findHexColors; exports.findImportAdapter = _chunkSBCZ6RN5cjs.findImportAdapter; exports.findReplacePluginKey = _chunkSBCZ6RN5cjs.findReplacePluginKey; exports.foldCodePoint = _chunkSBCZ6RN5cjs.foldCodePoint; exports.footnotesMarkdownIt = _chunkSBCZ6RN5cjs.footnotesMarkdownIt; exports.footnotesPluginKey = _chunkSBCZ6RN5cjs.footnotesPluginKey; exports.formatCellDisplay = _chunkMA2F5KHFcjs.formatCellDisplay; exports.formatCellForDisplay = _chunkMA2F5KHFcjs.formatCellForDisplay; exports.formatComparisonOperand = _chunkMKA3AHLVcjs.formatComparisonOperand; exports.formatConditionalTag = _chunkMKA3AHLVcjs.formatConditionalTag; exports.formatFindStatus = _chunkSBCZ6RN5cjs.formatFindStatus; exports.formatGeneralFit = _chunkMCSJFWAOcjs.formatGeneralFit; exports.formatNumberFormatValue = _chunkMCSJFWAOcjs.formatNumberFormatValue; exports.formatReviewTime = _chunkD27YFC46cjs.formatReviewTime; exports.formatTextFunction = _chunkMCSJFWAOcjs.formatTextFunction; exports.formatValueWithCode = _chunkMA2F5KHFcjs.formatValueWithCode; exports.fractionRules = _chunkSBCZ6RN5cjs.fractionRules; exports.getActiveHeading = _chunkSBCZ6RN5cjs.getActiveHeading; exports.getBookmarks = _chunkSBCZ6RN5cjs.getBookmarks; exports.getClipboardData = _chunkSML64VJGcjs.getClipboardData; exports.getCommentAnchors = _chunkSBCZ6RN5cjs.getCommentAnchors; exports.getCommentAuthor = _chunkSBCZ6RN5cjs.getCommentAuthor; exports.getCommentIdsAt = _chunkSBCZ6RN5cjs.getCommentIdsAt; exports.getCommentStore = _chunkSBCZ6RN5cjs.getCommentStore; exports.getCrossReferenceTargets = _chunkSBCZ6RN5cjs.getCrossReferenceTargets; exports.getDocumentStructureCommandItems = _chunkSBCZ6RN5cjs.getDocumentStructureCommandItems; exports.getEditorMarkdown = _chunkXNORY7M6cjs.getEditorMarkdown; exports.getEditorText = _chunkXNORY7M6cjs.getEditorText; exports.getFillDirection = _chunkMA2F5KHFcjs.getFillDirection; exports.getFindReplaceState = _chunkSBCZ6RN5cjs.getFindReplaceState; exports.getFindReplaceStore = _chunkSBCZ6RN5cjs.getFindReplaceStore; exports.getFootnotes = _chunkSBCZ6RN5cjs.getFootnotes; exports.getFormulaArgumentSpecIndex = _chunkMCSJFWAOcjs.getFormulaArgumentSpecIndex; exports.getFormulaCaretContext = _chunkMA2F5KHFcjs.getFormulaCaretContext; exports.getFormulaFunction = _chunkMCSJFWAOcjs.getFormulaFunction; exports.getFormulaHints = _chunkMA2F5KHFcjs.getFormulaHints; exports.getFormulaSignature = _chunkMCSJFWAOcjs.getFormulaSignature; exports.getFormulaSignatureParts = _chunkMCSJFWAOcjs.getFormulaSignatureParts; exports.getImportAccept = _chunkSBCZ6RN5cjs.getImportAccept; exports.getLatestVersion = _chunkFD4LPFAEcjs.getLatestVersion; exports.getOutline = _chunkSBCZ6RN5cjs.getOutline; exports.getPromptDiagnostics = _chunkFD4LPFAEcjs.getPromptDiagnostics; exports.getRowSection = _chunkMA2F5KHFcjs.getRowSection; exports.getSchemaSignature = _chunkSML64VJGcjs.getSchemaSignature; exports.getSpreadsheetMenuItems = _chunkMA2F5KHFcjs.getSpreadsheetMenuItems; exports.getSuppliedValue = _chunkMKA3AHLVcjs.getSuppliedValue; exports.getTableOfContentsEntries = _chunkSBCZ6RN5cjs.getTableOfContentsEntries; exports.getTableSections = _chunkMA2F5KHFcjs.getTableSections; exports.getTemplateBody = _chunkFD4LPFAEcjs.getTemplateBody; exports.getTrackChangesStore = _chunkD27YFC46cjs.getTrackChangesStore; exports.getTrackedChangeAt = _chunkD27YFC46cjs.getTrackedChangeAt; exports.getTrackedChanges = _chunkD27YFC46cjs.getTrackedChanges; exports.getVariableFormFields = _chunkP3RQ5UJEcjs.getVariableFormFields; exports.handleImageInsertion = _chunkSBCZ6RN5cjs.handleImageInsertion; exports.htmlImportAdapter = _chunkSBCZ6RN5cjs.htmlImportAdapter; exports.htmlToPlainText = _chunkXNORY7M6cjs.htmlToPlainText; exports.htmlToSlice = _chunkSBCZ6RN5cjs.htmlToSlice; exports.imagePastePluginKey = _chunkSBCZ6RN5cjs.imagePastePluginKey; exports.importFile = _chunkSBCZ6RN5cjs.importFile; exports.importFileIntoSpreadsheet = _chunkMA2F5KHFcjs.importFileIntoSpreadsheet; exports.importFilesIntoEditor = _chunkSBCZ6RN5cjs.importFilesIntoEditor; exports.indexToColName = _chunkMCSJFWAOcjs.indexToColName; exports.insertImageNode = _chunkSBCZ6RN5cjs.insertImageNode; exports.insertImportedDocument = _chunkSBCZ6RN5cjs.insertImportedDocument; exports.instructionRegex = _chunkMKA3AHLVcjs.instructionRegex; exports.isBlankValue = _chunkMA2F5KHFcjs.isBlankValue; exports.isFormulaError = _chunkMCSJFWAOcjs.isFormulaError; exports.isGeneralNumberFormat = _chunkMA2F5KHFcjs.isGeneralNumberFormat; exports.isInsidePromptToken = _chunkSBCZ6RN5cjs.isInsidePromptToken; exports.isPromptValueSet = _chunkMKA3AHLVcjs.isPromptValueSet; exports.isSingleCellRange = _chunkMA2F5KHFcjs.isSingleCellRange; exports.isTrackChangesEnabled = _chunkD27YFC46cjs.isTrackChangesEnabled; exports.isUnsafeZipPath = _chunkSBCZ6RN5cjs.isUnsafeZipPath; exports.listFormulaFunctions = _chunkMCSJFWAOcjs.listFormulaFunctions; exports.mapFormulaReferences = _chunkMA2F5KHFcjs.mapFormulaReferences; exports.mapRawOffsetToResolved = _chunkP3RQ5UJEcjs.mapRawOffsetToResolved; exports.mapResolvedOffsetToRaw = _chunkP3RQ5UJEcjs.mapResolvedOffsetToRaw; exports.markdownImportAdapter = _chunkSBCZ6RN5cjs.markdownImportAdapter; exports.markdownToTipTapHtml = _chunkXNORY7M6cjs.markdownToTipTapHtml; exports.matchConditionalTags = _chunkMKA3AHLVcjs.matchConditionalTags; exports.matchFields = _chunkP3RQ5UJEcjs.matchFields; exports.matchesFilterRule = _chunkMA2F5KHFcjs.matchesFilterRule; exports.mergeRecords = _chunkP3RQ5UJEcjs.mergeRecords; exports.navigateToHeading = _chunkSBCZ6RN5cjs.navigateToHeading; exports.normalizeFieldKey = _chunkP3RQ5UJEcjs.normalizeFieldKey; exports.normalizeFieldNames = _chunkP3RQ5UJEcjs.normalizeFieldNames; exports.normalizeRange = _chunkMA2F5KHFcjs.normalizeRange; exports.numberFormatColorToCss = _chunkMCSJFWAOcjs.numberFormatColorToCss; exports.numberFormatForCellFormat = _chunkMA2F5KHFcjs.numberFormatForCellFormat; exports.numberToText = _chunkMCSJFWAOcjs.numberToText; exports.offsetFormulaReferences = _chunkMA2F5KHFcjs.offsetFormulaReferences; exports.outlinePluginKey = _chunkSBCZ6RN5cjs.outlinePluginKey; exports.parseCellInput = _chunkMCSJFWAOcjs.parseCellInput; exports.parseCellReference = _chunkMCSJFWAOcjs.parseCellReference; exports.parseComparison = _chunkMKA3AHLVcjs.parseComparison; exports.parseConditionExpression = _chunkMKA3AHLVcjs.parseConditionExpression; exports.parseCriteria = _chunkMCSJFWAOcjs.parseCriteria; exports.parseCsv = _chunkTNNJXF46cjs.parseCsv; exports.parseDataSource = _chunkP3RQ5UJEcjs.parseDataSource; exports.parseFormula = _chunkMCSJFWAOcjs.parseFormula; exports.parseHtmlTable = _chunkMA2F5KHFcjs.parseHtmlTable; exports.parseMentionSegments = _chunkXNORY7M6cjs.parseMentionSegments; exports.parseNumberText = _chunkMCSJFWAOcjs.parseNumberText; exports.parseRange = _chunkMCSJFWAOcjs.parseRange; exports.parseReplacement = _chunkSBCZ6RN5cjs.parseReplacement; exports.parseRichClipboardPayload = _chunkSML64VJGcjs.parseRichClipboardPayload; exports.parseTsv = _chunkTNNJXF46cjs.parseTsv; exports.parseVariableBody = _chunkMKA3AHLVcjs.parseVariableBody; exports.pdfTextItemsToParagraphs = pdfTextItemsToParagraphs; exports.pickImportFiles = pickImportFiles; exports.plainTextImportAdapter = _chunkSBCZ6RN5cjs.plainTextImportAdapter; exports.plainTextToParagraphHtml = _chunkSML64VJGcjs.plainTextToParagraphHtml; exports.plainTextToSlice = _chunkXNORY7M6cjs.plainTextToSlice; exports.plainTextToTipTapHtml = _chunkXNORY7M6cjs.plainTextToTipTapHtml; exports.preprocessMarkdownFileLinks = _chunkXNORY7M6cjs.preprocessMarkdownFileLinks; exports.preprocessMarkdownMentions = _chunkXNORY7M6cjs.preprocessMarkdownMentions; exports.rangeContains = _chunkMA2F5KHFcjs.rangeContains; exports.rangeContainsRange = _chunkMA2F5KHFcjs.rangeContainsRange; exports.rangesIntersect = _chunkMA2F5KHFcjs.rangesIntersect; exports.readRichClipboard = _chunkSML64VJGcjs.readRichClipboard; exports.readSpreadsheetClipboard = _chunkMA2F5KHFcjs.readSpreadsheetClipboard; exports.readZip = _chunkSBCZ6RN5cjs.readZip; exports.rebaseClipboardRows = _chunkMA2F5KHFcjs.rebaseClipboardRows; exports.recordToValues = _chunkP3RQ5UJEcjs.recordToValues; exports.registerFormulaFunction = _chunkMCSJFWAOcjs.registerFormulaFunction; exports.registerImportAdapter = _chunkSBCZ6RN5cjs.registerImportAdapter; exports.registerSpreadsheetImportAdapters = _chunkMA2F5KHFcjs.registerSpreadsheetImportAdapters; exports.remapFormulaReferences = _chunkMA2F5KHFcjs.remapFormulaReferences; exports.removeImageNode = _chunkSBCZ6RN5cjs.removeImageNode; exports.resolvePrompt = _chunkFD4LPFAEcjs.resolvePrompt; exports.resolveTemplates = _chunkP3RQ5UJEcjs.resolveTemplates; exports.resolveTemplatesWithMapping = _chunkP3RQ5UJEcjs.resolveTemplatesWithMapping; exports.resolveTrackedChanges = _chunkD27YFC46cjs.resolveTrackedChanges; exports.resolveVariables = _chunkP3RQ5UJEcjs.resolveVariables; exports.richClipboardPluginKey = _chunkSBCZ6RN5cjs.richClipboardPluginKey; exports.roundFloat = _chunkMA2F5KHFcjs.roundFloat; exports.rowPassesFilters = _chunkMA2F5KHFcjs.rowPassesFilters; exports.rtfImportAdapter = _chunkSBCZ6RN5cjs.rtfImportAdapter; exports.rtfToPlainText = _chunkSML64VJGcjs.rtfToPlainText; exports.runSpreadsheetMenuItem = _chunkMA2F5KHFcjs.runSpreadsheetMenuItem; exports.sanitizeHtml = _chunkXNORY7M6cjs.sanitizeHtml; exports.sanitizeImportedHtml = _chunkSML64VJGcjs.sanitizeImportedHtml; exports.searchDocument = _chunkSBCZ6RN5cjs.searchDocument; exports.searchFormulaFunctions = _chunkMCSJFWAOcjs.searchFormulaFunctions; exports.serialFromYmd = _chunkMCSJFWAOcjs.serialFromYmd; exports.serializeCsv = _chunkTNNJXF46cjs.serializeCsv; exports.serializeHtmlTable = _chunkMA2F5KHFcjs.serializeHtmlTable; exports.serializeMergeOutputs = _chunkP3RQ5UJEcjs.serializeMergeOutputs; exports.serializeRichClipboardPayload = _chunkSML64VJGcjs.serializeRichClipboardPayload; exports.serializeTsv = _chunkTNNJXF46cjs.serializeTsv; exports.shiftFormulaReferences = _chunkMA2F5KHFcjs.shiftFormulaReferences; exports.smartQuoteRules = _chunkSBCZ6RN5cjs.smartQuoteRules; exports.smilieAutocorrectRules = _chunkSBCZ6RN5cjs.smilieAutocorrectRules; exports.sortCompareValues = _chunkMCSJFWAOcjs.sortCompareValues; exports.sortZipEntryNames = sortZipEntryNames; exports.stripMarkdownCode = _chunkXNORY7M6cjs.stripMarkdownCode; exports.symbolRules = _chunkSBCZ6RN5cjs.symbolRules; exports.syncFootnotes = _chunkSBCZ6RN5cjs.syncFootnotes; exports.tableOfContentsMarkdownIt = _chunkSBCZ6RN5cjs.tableOfContentsMarkdownIt; exports.tableOfContentsPluginKey = _chunkSBCZ6RN5cjs.tableOfContentsPluginKey; exports.templateRegex = _chunkMKA3AHLVcjs.templateRegex; exports.toNumber = _chunkMA2F5KHFcjs.toNumber; exports.tokenizeFormula = _chunkMCSJFWAOcjs.tokenizeFormula; exports.tokenizePrompt = _chunkFD4LPFAEcjs.tokenizePrompt; exports.tokenizePromptWithDiagnostics = _chunkFD4LPFAEcjs.tokenizePromptWithDiagnostics; exports.trackChangesPluginKey = _chunkD27YFC46cjs.trackChangesPluginKey; exports.tsvImportAdapter = _chunkMA2F5KHFcjs.tsvImportAdapter; exports.twoInitialCapitalsRules = _chunkSBCZ6RN5cjs.twoInitialCapitalsRules; exports.unescapeVariableText = _chunkMKA3AHLVcjs.unescapeVariableText; exports.unregisterFormulaFunction = _chunkMCSJFWAOcjs.unregisterFormulaFunction; exports.unregisterImportAdapter = _chunkSBCZ6RN5cjs.unregisterImportAdapter; exports.updateImageSrc = _chunkSBCZ6RN5cjs.updateImageSrc; exports.validateFindPattern = _chunkSBCZ6RN5cjs.validateFindPattern; exports.variableRegex = _chunkMKA3AHLVcjs.variableRegex; exports.wildcardToRegExp = _chunkMCSJFWAOcjs.wildcardToRegExp; exports.withoutDirty = _chunkG2I4QJOTcjs.withoutDirty; exports.writeRichClipboard = _chunkSBCZ6RN5cjs.writeRichClipboard; exports.zipCrc32 = _chunkSBCZ6RN5cjs.zipCrc32; exports.zipEntryTitle = zipEntryTitle; exports.zipImportAdapter = zipImportAdapter;
|
|
2495
|
+
|
|
2496
|
+
|
|
2497
|
+
|
|
2498
|
+
|
|
2499
|
+
|
|
2500
|
+
|
|
2501
|
+
|
|
2502
|
+
|
|
2503
|
+
|
|
2504
|
+
|
|
2505
|
+
|
|
2506
|
+
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
|
|
2520
|
+
|
|
2521
|
+
|
|
2522
|
+
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+
|
|
2528
|
+
|
|
2529
|
+
|
|
2530
|
+
|
|
2531
|
+
|
|
2532
|
+
|
|
2533
|
+
|
|
2534
|
+
|
|
2535
|
+
|
|
2536
|
+
|
|
2537
|
+
|
|
2538
|
+
|
|
2539
|
+
|
|
2540
|
+
|
|
2541
|
+
|
|
2542
|
+
|
|
2543
|
+
|
|
2544
|
+
|
|
2545
|
+
|
|
2546
|
+
|
|
2547
|
+
|
|
2548
|
+
|
|
2549
|
+
|
|
2550
|
+
|
|
2551
|
+
|
|
2552
|
+
|
|
2553
|
+
|
|
2554
|
+
|
|
2555
|
+
|
|
2556
|
+
|
|
2557
|
+
|
|
2558
|
+
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
|
|
2564
|
+
|
|
2565
|
+
|
|
2566
|
+
|
|
2567
|
+
|
|
2568
|
+
|
|
2569
|
+
|
|
2570
|
+
|
|
2571
|
+
|
|
2572
|
+
|
|
2573
|
+
|
|
2574
|
+
|
|
2575
|
+
|
|
2576
|
+
|
|
2577
|
+
|
|
2578
|
+
|
|
2579
|
+
|
|
2580
|
+
|
|
2581
|
+
|
|
2582
|
+
|
|
2583
|
+
|
|
2584
|
+
|
|
2585
|
+
|
|
2586
|
+
|
|
2587
|
+
|
|
2588
|
+
exports.Autocorrect = _chunkPO6A6QQHcjs.Autocorrect; exports.BLOCK_CHANGE_ATTRIBUTE = _chunkX4N4WUKBcjs.BLOCK_CHANGE_ATTRIBUTE; exports.BUILT_IN_IMPORT_ADAPTERS = _chunkPO6A6QQHcjs.BUILT_IN_IMPORT_ADAPTERS; exports.Bookmark = _chunkPO6A6QQHcjs.Bookmark; exports.CHARACTER_STYLE_MARK_NAME = _chunkPO6A6QQHcjs.CHARACTER_STYLE_MARK_NAME; exports.COMMENT_MARK_NAME = _chunkPO6A6QQHcjs.COMMENT_MARK_NAME; exports.CONDITIONAL_FORMAT_ICON_SETS = _chunkWSQKHXW7cjs.CONDITIONAL_FORMAT_ICON_SETS; exports.CONDITIONAL_FORMAT_PRESETS = _chunkWSQKHXW7cjs.CONDITIONAL_FORMAT_PRESETS; exports.CONDITIONAL_FORMAT_STYLE_PRESETS = _chunkWSQKHXW7cjs.CONDITIONAL_FORMAT_STYLE_PRESETS; exports.CONDITIONAL_FORMAT_TIME_PERIODS = _chunkWSQKHXW7cjs.CONDITIONAL_FORMAT_TIME_PERIODS; exports.CharacterStyle = _chunkPO6A6QQHcjs.CharacterStyle; exports.ColorHighlighter = _chunkPO6A6QQHcjs.ColorHighlighter; exports.CommentStore = _chunkX4N4WUKBcjs.CommentStore; exports.Comments = _chunkPO6A6QQHcjs.Comments; exports.ConditionalFormatEngine = _chunkWSQKHXW7cjs.ConditionalFormatEngine; exports.CrossReference = _chunkPO6A6QQHcjs.CrossReference; exports.DATA_VALIDATION_ERROR_STYLE_OPTIONS = _chunkWSQKHXW7cjs.DATA_VALIDATION_ERROR_STYLE_OPTIONS; exports.DATA_VALIDATION_OPERATOR_OPTIONS = _chunkWSQKHXW7cjs.DATA_VALIDATION_OPERATOR_OPTIONS; exports.DATA_VALIDATION_TYPE_OPTIONS = _chunkWSQKHXW7cjs.DATA_VALIDATION_TYPE_OPTIONS; exports.DEFAULT_AUTOCORRECT_EXCEPTIONS = _chunkPO6A6QQHcjs.DEFAULT_AUTOCORRECT_EXCEPTIONS; exports.DEFAULT_COLUMN_WIDTH = _chunkWSQKHXW7cjs.DEFAULT_COLUMN_WIDTH; exports.DEFAULT_CONDITIONAL_FORMAT_STYLE = _chunkWSQKHXW7cjs.DEFAULT_CONDITIONAL_FORMAT_STYLE; exports.DEFAULT_DATA_VALIDATION_MESSAGE = _chunkWSQKHXW7cjs.DEFAULT_DATA_VALIDATION_MESSAGE; exports.DEFAULT_DATA_VALIDATION_TITLE = _chunkWSQKHXW7cjs.DEFAULT_DATA_VALIDATION_TITLE; exports.DEFAULT_DOCX_MAX_IMAGE_SIZE = _chunkPO6A6QQHcjs.DEFAULT_DOCX_MAX_IMAGE_SIZE; exports.DEFAULT_ROW_HEIGHT = _chunkWSQKHXW7cjs.DEFAULT_ROW_HEIGHT; exports.DEFAULT_STYLES = _chunkPO6A6QQHcjs.DEFAULT_STYLES; exports.DEFAULT_ZIP_MAX_ENTRIES = _chunkPO6A6QQHcjs.DEFAULT_ZIP_MAX_ENTRIES; exports.DEFAULT_ZIP_MAX_TOTAL_SIZE = _chunkPO6A6QQHcjs.DEFAULT_ZIP_MAX_TOTAL_SIZE; exports.DELETION_MARK_NAME = _chunkX4N4WUKBcjs.DELETION_MARK_NAME; exports.DOCX_MIME_TYPES = _chunkPO6A6QQHcjs.DOCX_MIME_TYPES; exports.DataSourceBinder = _chunkWSQKHXW7cjs.DataSourceBinder; exports.DependencyGraph = _chunkWSQKHXW7cjs.DependencyGraph; exports.DirtyTracker = _chunkG2I4QJOTcjs.DirtyTracker; exports.DocumentCompare = _chunkPO6A6QQHcjs.DocumentCompare; exports.EMPTY_CONDITIONAL_FORMAT_OVERLAY = _chunkWSQKHXW7cjs.EMPTY_CONDITIONAL_FORMAT_OVERLAY; exports.EMPTY_FIND_REPLACE_SNAPSHOT = _chunkPO6A6QQHcjs.EMPTY_FIND_REPLACE_SNAPSHOT; exports.EditorController = EditorController; exports.FIELD_ALIASES = _chunkP3RQ5UJEcjs.FIELD_ALIASES; exports.FIND_OPTION_TOGGLES = _chunkPO6A6QQHcjs.FIND_OPTION_TOGGLES; exports.FIND_PARAGRAPH_MARK = _chunkPO6A6QQHcjs.FIND_PARAGRAPH_MARK; exports.FORMAT_CHANGE_MARK_NAME = _chunkX4N4WUKBcjs.FORMAT_CHANGE_MARK_NAME; exports.FORMULA_ERRORS = _chunkC7P22VIPcjs.FORMULA_ERRORS; exports.FileImport = _chunkPO6A6QQHcjs.FileImport; exports.FileImportController = FileImportController; exports.FindReplace = _chunkPO6A6QQHcjs.FindReplace; exports.FindReplaceStore = _chunkPO6A6QQHcjs.FindReplaceStore; exports.FontSize = _chunkPO6A6QQHcjs.FontSize; exports.Footnote = _chunkPO6A6QQHcjs.Footnote; exports.FootnoteReference = _chunkPO6A6QQHcjs.FootnoteReference; exports.Footnotes = _chunkPO6A6QQHcjs.Footnotes; exports.FormulaEvaluator = _chunkC7P22VIPcjs.FormulaEvaluator; exports.FormulaLambda = _chunkC7P22VIPcjs.FormulaLambda; exports.FormulaParser = _chunkC7P22VIPcjs.FormulaParser; exports.GradientText = _chunkPO6A6QQHcjs.GradientText; exports.HistoryManager = _chunkG2I4QJOTcjs.HistoryManager; exports.INSERTION_MARK_NAME = _chunkX4N4WUKBcjs.INSERTION_MARK_NAME; exports.INSTRUCTION_REGEX = _chunkMKA3AHLVcjs.INSTRUCTION_REGEX; exports.Image = _chunkPO6A6QQHcjs.Image; exports.ImportAdapterRegistry = _chunkPO6A6QQHcjs.ImportAdapterRegistry; exports.ImportError = _chunkPO6A6QQHcjs.ImportError; exports.LoadingNode = _chunkPO6A6QQHcjs.LoadingNode; exports.MARKDOWN_MENTION_SPLIT_REGEX = _chunk7WISYZFOcjs.MARKDOWN_MENTION_SPLIT_REGEX; exports.MAX_DATA_SOURCE_FIELDS = _chunkP3RQ5UJEcjs.MAX_DATA_SOURCE_FIELDS; exports.MAX_DATA_SOURCE_RECORDS = _chunkP3RQ5UJEcjs.MAX_DATA_SOURCE_RECORDS; exports.MAX_DEFINED_NAME_LENGTH = _chunkWSQKHXW7cjs.MAX_DEFINED_NAME_LENGTH; exports.MAX_FIND_PATTERN_LENGTH = _chunkPO6A6QQHcjs.MAX_FIND_PATTERN_LENGTH; exports.MAX_FORMULA_ARRAY_SIZE = _chunkC7P22VIPcjs.MAX_FORMULA_ARRAY_SIZE; exports.MAX_LAMBDA_DEPTH = _chunkC7P22VIPcjs.MAX_LAMBDA_DEPTH; exports.MAX_MERGE_LENGTH = _chunkP3RQ5UJEcjs.MAX_MERGE_LENGTH; exports.MAX_MERGE_OUTPUTS = _chunkP3RQ5UJEcjs.MAX_MERGE_OUTPUTS; exports.MAX_NUMBER_FORMAT_CODE_CHARS = _chunkC7P22VIPcjs.MAX_NUMBER_FORMAT_CODE_CHARS; exports.MAX_SHEET_NAME_LENGTH = _chunkWSQKHXW7cjs.MAX_SHEET_NAME_LENGTH; exports.MENTION_REGEX = _chunkBVP3TSLHcjs.MENTION_REGEX; exports.MOVE_FROM_CLASS = _chunkX4N4WUKBcjs.MOVE_FROM_CLASS; exports.MOVE_ID_ATTRIBUTE = _chunkX4N4WUKBcjs.MOVE_ID_ATTRIBUTE; exports.MOVE_TO_CLASS = _chunkX4N4WUKBcjs.MOVE_TO_CLASS; exports.Markdown = _chunkPO6A6QQHcjs.Markdown; exports.Mention = _chunkPO6A6QQHcjs.Mention; exports.NORMAL_STYLE_ID = _chunkPO6A6QQHcjs.NORMAL_STYLE_ID; exports.NUMBER_FORMAT_PRESETS = _chunkWSQKHXW7cjs.NUMBER_FORMAT_PRESETS; exports.NumberFormat = _chunkC7P22VIPcjs.NumberFormat; exports.Outline = _chunkPO6A6QQHcjs.Outline; exports.PIXERATE_DOCUMENT_MIME = _chunkV3CHHWOEcjs.PIXERATE_DOCUMENT_MIME; exports.ParagraphStyles = _chunkPO6A6QQHcjs.ParagraphStyles; exports.RichClipboard = _chunkPO6A6QQHcjs.RichClipboard; exports.SMILIE_REPLACEMENTS = _chunkPO6A6QQHcjs.SMILIE_REPLACEMENTS; exports.SPREADSHEET_CLIPBOARD_MIME = _chunkWSQKHXW7cjs.SPREADSHEET_CLIPBOARD_MIME; exports.SPREADSHEET_IMPORT_ADAPTERS = _chunkWSQKHXW7cjs.SPREADSHEET_IMPORT_ADAPTERS; exports.SPREADSHEET_TABLE_ACTIONS = _chunkWSQKHXW7cjs.SPREADSHEET_TABLE_ACTIONS; exports.STYLE_ID_ATTRIBUTE = _chunkPO6A6QQHcjs.STYLE_ID_ATTRIBUTE; exports.SlashCommands = _chunkPO6A6QQHcjs.SlashCommands; exports.SmilieReplacer = _chunkPO6A6QQHcjs.SmilieReplacer; exports.SpreadsheetController = _chunkWSQKHXW7cjs.SpreadsheetController; exports.StyleRegistry = _chunkPO6A6QQHcjs.StyleRegistry; exports.TEMPLATE_DEPTH_ERROR = _chunkFD4LPFAEcjs.TEMPLATE_DEPTH_ERROR; exports.TEMPLATE_LOOP_ERROR = _chunkFD4LPFAEcjs.TEMPLATE_LOOP_ERROR; exports.TEMPLATE_REGEX = _chunkMKA3AHLVcjs.TEMPLATE_REGEX; exports.TRACK_CHANGES_SKIP_META = _chunkX4N4WUKBcjs.TRACK_CHANGES_SKIP_META; exports.TableOfContents = _chunkPO6A6QQHcjs.TableOfContents; exports.TemplateSuggestions = _chunkPO6A6QQHcjs.TemplateSuggestions; exports.TrackChanges = _chunkX4N4WUKBcjs.TrackChanges; exports.TrackChangesStore = _chunkX4N4WUKBcjs.TrackChangesStore; exports.TrackedDeletion = _chunkX4N4WUKBcjs.TrackedDeletion; exports.TrackedFormatChange = _chunkX4N4WUKBcjs.TrackedFormatChange; exports.TrackedInsertion = _chunkX4N4WUKBcjs.TrackedInsertion; exports.VARIABLE_REGEX = _chunkMKA3AHLVcjs.VARIABLE_REGEX; exports.WHOLE_COLUMN_END_ROW = _chunkC7P22VIPcjs.WHOLE_COLUMN_END_ROW; exports.ZipArchive = _chunkPO6A6QQHcjs.ZipArchive; exports.ZipError = _chunkPO6A6QQHcjs.ZipError; exports.adjustRangeForStructuralChange = _chunkWSQKHXW7cjs.adjustRangeForStructuralChange; exports.adjustRangesForStructuralChange = _chunkWSQKHXW7cjs.adjustRangesForStructuralChange; exports.aggregateValues = _chunkWSQKHXW7cjs.aggregateValues; exports.analyzePdfLayout = analyzePdfLayout; exports.applyDocumentComparison = _chunkPO6A6QQHcjs.applyDocumentComparison; exports.applyFormulaSuggestion = _chunkWSQKHXW7cjs.applyFormulaSuggestion; exports.applyReplacements = _chunkPO6A6QQHcjs.applyReplacements; exports.autocorrectPluginKey = _chunkPO6A6QQHcjs.autocorrectPluginKey; exports.bindDirtyToHistory = _chunkG2I4QJOTcjs.bindDirtyToHistory; exports.bindSpreadsheetTableActions = _chunkWSQKHXW7cjs.bindSpreadsheetTableActions; exports.blendConditionalFormatColors = _chunkWSQKHXW7cjs.blendConditionalFormatColors; exports.buildOutlineTree = _chunkPO6A6QQHcjs.buildOutlineTree; exports.buildSpreadsheetView = _chunkWSQKHXW7cjs.buildSpreadsheetView; exports.builtinNumberFormat = _chunkC7P22VIPcjs.builtinNumberFormat; exports.builtinNumberFormatId = _chunkC7P22VIPcjs.builtinNumberFormatId; exports.capitalizeSentenceRules = _chunkPO6A6QQHcjs.capitalizeSentenceRules; exports.captureSelectionFormat = _chunkPO6A6QQHcjs.captureSelectionFormat; exports.cellFormatForNumberFormat = _chunkWSQKHXW7cjs.cellFormatForNumberFormat; exports.checkFormulaArgumentCount = _chunkC7P22VIPcjs.checkFormulaArgumentCount; exports.clampMenuPosition = _chunkWSQKHXW7cjs.clampMenuPosition; exports.clearNumberFormatCache = _chunkC7P22VIPcjs.clearNumberFormatCache; exports.colNameToIndex = _chunkC7P22VIPcjs.colNameToIndex; exports.columnDependencyKey = _chunkWSQKHXW7cjs.columnDependencyKey; exports.commentsPluginKey = _chunkPO6A6QQHcjs.commentsPluginKey; exports.compactVariableValues = _chunkP3RQ5UJEcjs.compactVariableValues; exports.compareCellValues = _chunkWSQKHXW7cjs.compareCellValues; exports.compareConditionValues = _chunkMKA3AHLVcjs.compareConditionValues; exports.compareDocuments = _chunkAL6JMGWWcjs.compareDocuments; exports.compareHtml = _chunkAL6JMGWWcjs.compareHtml; exports.compareInEditor = _chunkPO6A6QQHcjs.compareInEditor; exports.compareNumbers = _chunkC7P22VIPcjs.compareNumbers; exports.compareValues = _chunkC7P22VIPcjs.compareValues; exports.compileFindPattern = _chunkPO6A6QQHcjs.compileFindPattern; exports.computeFillTarget = _chunkWSQKHXW7cjs.computeFillTarget; exports.computeOutline = _chunkPO6A6QQHcjs.computeOutline; exports.computeRowGroups = _chunkWSQKHXW7cjs.computeRowGroups; exports.conditionSubject = _chunkMKA3AHLVcjs.conditionSubject; exports.conditionalFormatContrastColor = _chunkWSQKHXW7cjs.conditionalFormatContrastColor; exports.conditionalFormatIconCount = _chunkWSQKHXW7cjs.conditionalFormatIconCount; exports.conditionalFormatNumber = _chunkWSQKHXW7cjs.conditionalFormatNumber; exports.conditionalFormatStyleString = _chunkWSQKHXW7cjs.conditionalFormatStyleString; exports.copySheetName = _chunkWSQKHXW7cjs.copySheetName; exports.createCommentStore = _chunkX4N4WUKBcjs.createCommentStore; exports.createConditionalFormatRule = _chunkWSQKHXW7cjs.createConditionalFormatRule; exports.createDirtyTracker = _chunkG2I4QJOTcjs.createDirtyTracker; exports.createDocxImportAdapter = _chunkPO6A6QQHcjs.createDocxImportAdapter; exports.createEditor = createEditor; exports.createFileImportController = createFileImportController; exports.createFindReplaceCommands = _chunkPO6A6QQHcjs.createFindReplaceCommands; exports.createHistoryManager = _chunkG2I4QJOTcjs.createHistoryManager; exports.createImportAdapterRegistry = _chunkPO6A6QQHcjs.createImportAdapterRegistry; exports.createImportContext = _chunkPO6A6QQHcjs.createImportContext; exports.createMentionExtension = _chunkPO6A6QQHcjs.createMentionExtension; exports.createOutlineStore = _chunkPO6A6QQHcjs.createOutlineStore; exports.createParagraphStylesStore = _chunkPO6A6QQHcjs.createParagraphStylesStore; exports.createPdfImportAdapter = createPdfImportAdapter; exports.createReviewId = _chunkX4N4WUKBcjs.createReviewId; exports.createRichTextPreset = _chunkPO6A6QQHcjs.createRichTextPreset; exports.createSearchBudget = _chunkPO6A6QQHcjs.createSearchBudget; exports.createSpreadsheetClipboardData = _chunkWSQKHXW7cjs.createSpreadsheetClipboardData; exports.createStyleRegistry = _chunkPO6A6QQHcjs.createStyleRegistry; exports.createZipImportAdapter = createZipImportAdapter; exports.crossReferencePluginKey = _chunkPO6A6QQHcjs.crossReferencePluginKey; exports.csvImportAdapter = _chunkWSQKHXW7cjs.csvImportAdapter; exports.dateValueToSerial = _chunkC7P22VIPcjs.dateValueToSerial; exports.defaultAutocorrectRules = _chunkPO6A6QQHcjs.defaultAutocorrectRules; exports.defaultIconThresholds = _chunkWSQKHXW7cjs.defaultIconThresholds; exports.defaultImportRegistry = _chunkPO6A6QQHcjs.defaultImportRegistry; exports.defaultIsEqual = _chunkG2I4QJOTcjs.defaultIsEqual; exports.deleteSheetInFormula = _chunkWSQKHXW7cjs.deleteSheetInFormula; exports.describeBlockChange = _chunkX4N4WUKBcjs.describeBlockChange; exports.describeConditionalFormat = _chunkWSQKHXW7cjs.describeConditionalFormat; exports.describeConditionalTag = _chunkMKA3AHLVcjs.describeConditionalTag; exports.describeDataValidation = _chunkWSQKHXW7cjs.describeDataValidation; exports.describeFormatChange = _chunkX4N4WUKBcjs.describeFormatChange; exports.describeFormulaError = _chunkC7P22VIPcjs.describeFormulaError; exports.detectDelimiter = _chunkP3RQ5UJEcjs.detectDelimiter; exports.diffChanges = _chunkAL6JMGWWcjs.diffChanges; exports.diffSequences = _chunkAL6JMGWWcjs.diffSequences; exports.documentStructureCommandItems = _chunkPO6A6QQHcjs.documentStructureCommandItems; exports.docxImportAdapter = _chunkPO6A6QQHcjs.docxImportAdapter; exports.docxToDocumentImport = _chunkPO6A6QQHcjs.docxToDocumentImport; exports.escapeCsvField = _chunkTNNJXF46cjs.escapeCsvField; exports.escapeHtml = _chunk7WISYZFOcjs.escapeHtml; exports.escapeVariableText = _chunkMKA3AHLVcjs.escapeVariableText; exports.evaluateCondition = _chunkMKA3AHLVcjs.evaluateCondition; exports.evaluateConditionExpression = _chunkMKA3AHLVcjs.evaluateConditionExpression; exports.evaluateConditionalFormats = _chunkWSQKHXW7cjs.evaluateConditionalFormats; exports.evaluatePromptTokens = _chunkFD4LPFAEcjs.evaluatePromptTokens; exports.expandReplacement = _chunkPO6A6QQHcjs.expandReplacement; exports.extractCellDependencies = _chunkWSQKHXW7cjs.extractCellDependencies; exports.extractInstructionNames = _chunkP3RQ5UJEcjs.extractInstructionNames; exports.extractMentions = _chunk7WISYZFOcjs.extractMentions; exports.extractMentionsFromDoc = _chunk7WISYZFOcjs.extractMentionsFromDoc; exports.extractNameDependencies = _chunkWSQKHXW7cjs.extractNameDependencies; exports.extractTemplateNames = _chunkP3RQ5UJEcjs.extractTemplateNames; exports.extractVariableNames = _chunkP3RQ5UJEcjs.extractVariableNames; exports.extractVariables = _chunkP3RQ5UJEcjs.extractVariables; exports.fileImportPluginKey = _chunkPO6A6QQHcjs.fileImportPluginKey; exports.fillSeries = _chunkWSQKHXW7cjs.fillSeries; exports.findAllMatches = _chunkPO6A6QQHcjs.findAllMatches; exports.findAutocorrection = _chunkPO6A6QQHcjs.findAutocorrection; exports.findCommentRanges = _chunkPO6A6QQHcjs.findCommentRanges; exports.findDataValidation = _chunkWSQKHXW7cjs.findDataValidation; exports.findHexColors = _chunkPO6A6QQHcjs.findHexColors; exports.findImportAdapter = _chunkPO6A6QQHcjs.findImportAdapter; exports.findInvalidCells = _chunkWSQKHXW7cjs.findInvalidCells; exports.findReplacePluginKey = _chunkPO6A6QQHcjs.findReplacePluginKey; exports.findTextMentions = _chunkBVP3TSLHcjs.findTextMentions; exports.foldCodePoint = _chunkPO6A6QQHcjs.foldCodePoint; exports.footnotesMarkdownIt = _chunkPO6A6QQHcjs.footnotesMarkdownIt; exports.footnotesPluginKey = _chunkPO6A6QQHcjs.footnotesPluginKey; exports.forEachRangeCell = _chunkWSQKHXW7cjs.forEachRangeCell; exports.formatCellDisplay = _chunkWSQKHXW7cjs.formatCellDisplay; exports.formatCellForDisplay = _chunkWSQKHXW7cjs.formatCellForDisplay; exports.formatComparisonOperand = _chunkMKA3AHLVcjs.formatComparisonOperand; exports.formatConditionalTag = _chunkMKA3AHLVcjs.formatConditionalTag; exports.formatFindStatus = _chunkPO6A6QQHcjs.formatFindStatus; exports.formatGeneralFit = _chunkC7P22VIPcjs.formatGeneralFit; exports.formatMentionText = _chunkBVP3TSLHcjs.formatMentionText; exports.formatNumberFormatValue = _chunkC7P22VIPcjs.formatNumberFormatValue; exports.formatReviewTime = _chunkX4N4WUKBcjs.formatReviewTime; exports.formatRuleRanges = _chunkWSQKHXW7cjs.formatRuleRanges; exports.formatSheetPrefix = _chunkWSQKHXW7cjs.formatSheetPrefix; exports.formatTextFunction = _chunkC7P22VIPcjs.formatTextFunction; exports.formatValueWithCode = _chunkWSQKHXW7cjs.formatValueWithCode; exports.formulaIdentifiers = _chunkWSQKHXW7cjs.formulaIdentifiers; exports.fractionRules = _chunkPO6A6QQHcjs.fractionRules; exports.getActiveHeading = _chunkPO6A6QQHcjs.getActiveHeading; exports.getBookmarks = _chunkPO6A6QQHcjs.getBookmarks; exports.getClipboardData = _chunkV3CHHWOEcjs.getClipboardData; exports.getCommentAnchors = _chunkPO6A6QQHcjs.getCommentAnchors; exports.getCommentAuthor = _chunkPO6A6QQHcjs.getCommentAuthor; exports.getCommentIdsAt = _chunkPO6A6QQHcjs.getCommentIdsAt; exports.getCommentStore = _chunkPO6A6QQHcjs.getCommentStore; exports.getConditionalFormatCss = _chunkWSQKHXW7cjs.getConditionalFormatCss; exports.getConditionalFormatIcon = _chunkWSQKHXW7cjs.getConditionalFormatIcon; exports.getCrossReferenceTargets = _chunkPO6A6QQHcjs.getCrossReferenceTargets; exports.getDataBarCss = _chunkWSQKHXW7cjs.getDataBarCss; exports.getDocumentStructureCommandItems = _chunkPO6A6QQHcjs.getDocumentStructureCommandItems; exports.getEditorMarkdown = _chunk7WISYZFOcjs.getEditorMarkdown; exports.getEditorText = _chunk7WISYZFOcjs.getEditorText; exports.getFillDirection = _chunkWSQKHXW7cjs.getFillDirection; exports.getFindReplaceState = _chunkPO6A6QQHcjs.getFindReplaceState; exports.getFindReplaceStore = _chunkPO6A6QQHcjs.getFindReplaceStore; exports.getFootnotes = _chunkPO6A6QQHcjs.getFootnotes; exports.getFormulaArgumentSpecIndex = _chunkC7P22VIPcjs.getFormulaArgumentSpecIndex; exports.getFormulaCaretContext = _chunkWSQKHXW7cjs.getFormulaCaretContext; exports.getFormulaFunction = _chunkC7P22VIPcjs.getFormulaFunction; exports.getFormulaHints = _chunkWSQKHXW7cjs.getFormulaHints; exports.getFormulaSignature = _chunkC7P22VIPcjs.getFormulaSignature; exports.getFormulaSignatureParts = _chunkC7P22VIPcjs.getFormulaSignatureParts; exports.getImportAccept = _chunkPO6A6QQHcjs.getImportAccept; exports.getLatestVersion = _chunkFD4LPFAEcjs.getLatestVersion; exports.getMentionNodes = _chunkPO6A6QQHcjs.getMentionNodes; exports.getNameManagerRows = _chunkWSQKHXW7cjs.getNameManagerRows; exports.getOutline = _chunkPO6A6QQHcjs.getOutline; exports.getParagraphStyleAt = _chunkPO6A6QQHcjs.getParagraphStyleAt; exports.getPromptDiagnostics = _chunkFD4LPFAEcjs.getPromptDiagnostics; exports.getRowSection = _chunkWSQKHXW7cjs.getRowSection; exports.getSchemaSignature = _chunkV3CHHWOEcjs.getSchemaSignature; exports.getSheetTabMenuItems = _chunkWSQKHXW7cjs.getSheetTabMenuItems; exports.getSpreadsheetMenuItems = _chunkWSQKHXW7cjs.getSpreadsheetMenuItems; exports.getStyleRegistry = _chunkPO6A6QQHcjs.getStyleRegistry; exports.getSuppliedValue = _chunkMKA3AHLVcjs.getSuppliedValue; exports.getTableOfContentsEntries = _chunkPO6A6QQHcjs.getTableOfContentsEntries; exports.getTableSections = _chunkWSQKHXW7cjs.getTableSections; exports.getTemplateBody = _chunkFD4LPFAEcjs.getTemplateBody; exports.getTrackChangesStore = _chunkX4N4WUKBcjs.getTrackChangesStore; exports.getTrackedChangeAt = _chunkX4N4WUKBcjs.getTrackedChangeAt; exports.getTrackedChanges = _chunkX4N4WUKBcjs.getTrackedChanges; exports.getValidationListValues = _chunkWSQKHXW7cjs.getValidationListValues; exports.getVariableFormFields = _chunkP3RQ5UJEcjs.getVariableFormFields; exports.handleImageInsertion = _chunkPO6A6QQHcjs.handleImageInsertion; exports.htmlImportAdapter = _chunkPO6A6QQHcjs.htmlImportAdapter; exports.htmlToPlainText = _chunk7WISYZFOcjs.htmlToPlainText; exports.htmlToSlice = _chunkPO6A6QQHcjs.htmlToSlice; exports.imagePastePluginKey = _chunkPO6A6QQHcjs.imagePastePluginKey; exports.importFile = _chunkPO6A6QQHcjs.importFile; exports.importFileIntoSpreadsheet = _chunkWSQKHXW7cjs.importFileIntoSpreadsheet; exports.importFilesIntoEditor = _chunkPO6A6QQHcjs.importFilesIntoEditor; exports.indexToColName = _chunkC7P22VIPcjs.indexToColName; exports.insertImageNode = _chunkPO6A6QQHcjs.insertImageNode; exports.insertImportedDocument = _chunkPO6A6QQHcjs.insertImportedDocument; exports.instructionRegex = _chunkMKA3AHLVcjs.instructionRegex; exports.isBlankValue = _chunkWSQKHXW7cjs.isBlankValue; exports.isFormulaError = _chunkC7P22VIPcjs.isFormulaError; exports.isFormulaLambda = _chunkC7P22VIPcjs.isFormulaLambda; exports.isGeneralNumberFormat = _chunkWSQKHXW7cjs.isGeneralNumberFormat; exports.isInsidePromptToken = _chunkPO6A6QQHcjs.isInsidePromptToken; exports.isLambdaDefinition = _chunkWSQKHXW7cjs.isLambdaDefinition; exports.isMoveSized = _chunkX4N4WUKBcjs.isMoveSized; exports.isParagraphStyleAvailable = _chunkPO6A6QQHcjs.isParagraphStyleAvailable; exports.isPromptValueSet = _chunkMKA3AHLVcjs.isPromptValueSet; exports.isSingleCellRange = _chunkWSQKHXW7cjs.isSingleCellRange; exports.isTrackChangesEnabled = _chunkX4N4WUKBcjs.isTrackChangesEnabled; exports.isUnsafeZipPath = _chunkPO6A6QQHcjs.isUnsafeZipPath; exports.isValidStyleId = _chunkPO6A6QQHcjs.isValidStyleId; exports.listFormulaFunctions = _chunkC7P22VIPcjs.listFormulaFunctions; exports.mapFormulaReferences = _chunkWSQKHXW7cjs.mapFormulaReferences; exports.mapRawOffsetToResolved = _chunkP3RQ5UJEcjs.mapRawOffsetToResolved; exports.mapResolvedOffsetToRaw = _chunkP3RQ5UJEcjs.mapResolvedOffsetToRaw; exports.markdownImportAdapter = _chunkPO6A6QQHcjs.markdownImportAdapter; exports.markdownToTipTapHtml = _chunk7WISYZFOcjs.markdownToTipTapHtml; exports.matchConditionalTags = _chunkMKA3AHLVcjs.matchConditionalTags; exports.matchFields = _chunkP3RQ5UJEcjs.matchFields; exports.matchesFilterRule = _chunkWSQKHXW7cjs.matchesFilterRule; exports.matchesTimePeriod = _chunkWSQKHXW7cjs.matchesTimePeriod; exports.mergeRecords = _chunkP3RQ5UJEcjs.mergeRecords; exports.navigateToHeading = _chunkPO6A6QQHcjs.navigateToHeading; exports.nextSheetName = _chunkWSQKHXW7cjs.nextSheetName; exports.normalizeFieldKey = _chunkP3RQ5UJEcjs.normalizeFieldKey; exports.normalizeFieldNames = _chunkP3RQ5UJEcjs.normalizeFieldNames; exports.normalizeRange = _chunkWSQKHXW7cjs.normalizeRange; exports.numberFormatColorToCss = _chunkC7P22VIPcjs.numberFormatColorToCss; exports.numberFormatForCellFormat = _chunkWSQKHXW7cjs.numberFormatForCellFormat; exports.numberToText = _chunkC7P22VIPcjs.numberToText; exports.offsetFormulaReferences = _chunkWSQKHXW7cjs.offsetFormulaReferences; exports.outlinePluginKey = _chunkPO6A6QQHcjs.outlinePluginKey; exports.paragraphStylesPluginKey = _chunkPO6A6QQHcjs.paragraphStylesPluginKey; exports.parseCellInput = _chunkC7P22VIPcjs.parseCellInput; exports.parseCellReference = _chunkC7P22VIPcjs.parseCellReference; exports.parseComparison = _chunkMKA3AHLVcjs.parseComparison; exports.parseConditionExpression = _chunkMKA3AHLVcjs.parseConditionExpression; exports.parseCriteria = _chunkC7P22VIPcjs.parseCriteria; exports.parseCsv = _chunkTNNJXF46cjs.parseCsv; exports.parseDataSource = _chunkP3RQ5UJEcjs.parseDataSource; exports.parseFormula = _chunkC7P22VIPcjs.parseFormula; exports.parseHtmlTable = _chunkWSQKHXW7cjs.parseHtmlTable; exports.parseMentionSegments = _chunk7WISYZFOcjs.parseMentionSegments; exports.parseNumberText = _chunkC7P22VIPcjs.parseNumberText; exports.parseRange = _chunkC7P22VIPcjs.parseRange; exports.parseReplacement = _chunkPO6A6QQHcjs.parseReplacement; exports.parseRichClipboardPayload = _chunkV3CHHWOEcjs.parseRichClipboardPayload; exports.parseRuleRanges = _chunkWSQKHXW7cjs.parseRuleRanges; exports.parseTsv = _chunkTNNJXF46cjs.parseTsv; exports.parseVariableBody = _chunkMKA3AHLVcjs.parseVariableBody; exports.pdfLayoutBlocksToHtml = pdfLayoutBlocksToHtml; exports.pdfOperatorListToRules = pdfOperatorListToRules; exports.pdfTextItemsToParagraphs = pdfTextItemsToParagraphs; exports.pdfTextItemsToRuns = pdfTextItemsToRuns; exports.pickImportFiles = pickImportFiles; exports.plainTextImportAdapter = _chunkPO6A6QQHcjs.plainTextImportAdapter; exports.plainTextToParagraphHtml = _chunkV3CHHWOEcjs.plainTextToParagraphHtml; exports.plainTextToSlice = _chunk7WISYZFOcjs.plainTextToSlice; exports.plainTextToTipTapHtml = _chunk7WISYZFOcjs.plainTextToTipTapHtml; exports.preprocessMarkdownFileLinks = _chunk7WISYZFOcjs.preprocessMarkdownFileLinks; exports.preprocessMarkdownMentions = _chunk7WISYZFOcjs.preprocessMarkdownMentions; exports.quoteSheetName = _chunkWSQKHXW7cjs.quoteSheetName; exports.rangeContains = _chunkWSQKHXW7cjs.rangeContains; exports.rangeContainsRange = _chunkWSQKHXW7cjs.rangeContainsRange; exports.rangesContain = _chunkWSQKHXW7cjs.rangesContain; exports.rangesIntersect = _chunkWSQKHXW7cjs.rangesIntersect; exports.readRichClipboard = _chunkV3CHHWOEcjs.readRichClipboard; exports.readSpreadsheetClipboard = _chunkWSQKHXW7cjs.readSpreadsheetClipboard; exports.readZip = _chunkPO6A6QQHcjs.readZip; exports.rebaseClipboardRows = _chunkWSQKHXW7cjs.rebaseClipboardRows; exports.recordToValues = _chunkP3RQ5UJEcjs.recordToValues; exports.registerFormulaFunction = _chunkC7P22VIPcjs.registerFormulaFunction; exports.registerImportAdapter = _chunkPO6A6QQHcjs.registerImportAdapter; exports.registerSpreadsheetImportAdapters = _chunkWSQKHXW7cjs.registerSpreadsheetImportAdapters; exports.remapFormulaReferences = _chunkWSQKHXW7cjs.remapFormulaReferences; exports.removeImageNode = _chunkPO6A6QQHcjs.removeImageNode; exports.renameNameInFormula = _chunkWSQKHXW7cjs.renameNameInFormula; exports.renameSheetInFormula = _chunkWSQKHXW7cjs.renameSheetInFormula; exports.resolvePrompt = _chunkFD4LPFAEcjs.resolvePrompt; exports.resolveTemplates = _chunkP3RQ5UJEcjs.resolveTemplates; exports.resolveTemplatesWithMapping = _chunkP3RQ5UJEcjs.resolveTemplatesWithMapping; exports.resolveTrackedChanges = _chunkX4N4WUKBcjs.resolveTrackedChanges; exports.resolveVariables = _chunkP3RQ5UJEcjs.resolveVariables; exports.richClipboardPluginKey = _chunkPO6A6QQHcjs.richClipboardPluginKey; exports.roundFloat = _chunkWSQKHXW7cjs.roundFloat; exports.rowPassesFilters = _chunkWSQKHXW7cjs.rowPassesFilters; exports.rtfImportAdapter = _chunkPO6A6QQHcjs.rtfImportAdapter; exports.rtfToPlainText = _chunkV3CHHWOEcjs.rtfToPlainText; exports.ruleAnchor = _chunkWSQKHXW7cjs.ruleAnchor; exports.ruleFormulaAt = _chunkWSQKHXW7cjs.ruleFormulaAt; exports.runSpreadsheetMenuItem = _chunkWSQKHXW7cjs.runSpreadsheetMenuItem; exports.safeCSSValue = _chunkPO6A6QQHcjs.safeCSSValue; exports.sanitizeHtml = _chunk7WISYZFOcjs.sanitizeHtml; exports.sanitizeImportedHtml = _chunkV3CHHWOEcjs.sanitizeImportedHtml; exports.searchDocument = _chunkPO6A6QQHcjs.searchDocument; exports.searchFormulaFunctions = _chunkC7P22VIPcjs.searchFormulaFunctions; exports.serialFromYmd = _chunkC7P22VIPcjs.serialFromYmd; exports.serializeCsv = _chunkTNNJXF46cjs.serializeCsv; exports.serializeHtmlTable = _chunkWSQKHXW7cjs.serializeHtmlTable; exports.serializeMergeOutputs = _chunkP3RQ5UJEcjs.serializeMergeOutputs; exports.serializeRichClipboardPayload = _chunkV3CHHWOEcjs.serializeRichClipboardPayload; exports.serializeTsv = _chunkTNNJXF46cjs.serializeTsv; exports.setMentionRoleAt = _chunkPO6A6QQHcjs.setMentionRoleAt; exports.setMentionRoleInText = _chunkBVP3TSLHcjs.setMentionRoleInText; exports.sheetDropIndex = _chunkWSQKHXW7cjs.sheetDropIndex; exports.sheetNameNeedsQuotes = _chunkWSQKHXW7cjs.sheetNameNeedsQuotes; exports.shiftFormulaReferences = _chunkWSQKHXW7cjs.shiftFormulaReferences; exports.shiftRuleFormula = _chunkWSQKHXW7cjs.shiftRuleFormula; exports.smartQuoteRules = _chunkPO6A6QQHcjs.smartQuoteRules; exports.smilieAutocorrectRules = _chunkPO6A6QQHcjs.smilieAutocorrectRules; exports.sortCompareValues = _chunkC7P22VIPcjs.sortCompareValues; exports.sortZipEntryNames = sortZipEntryNames; exports.stripMarkdownCode = _chunk7WISYZFOcjs.stripMarkdownCode; exports.subtractRange = _chunkWSQKHXW7cjs.subtractRange; exports.subtractRangeFromRanges = _chunkWSQKHXW7cjs.subtractRangeFromRanges; exports.summarizeImportStructure = summarizeImportStructure; exports.symbolRules = _chunkPO6A6QQHcjs.symbolRules; exports.syncFootnotes = _chunkPO6A6QQHcjs.syncFootnotes; exports.tableOfContentsMarkdownIt = _chunkPO6A6QQHcjs.tableOfContentsMarkdownIt; exports.tableOfContentsPluginKey = _chunkPO6A6QQHcjs.tableOfContentsPluginKey; exports.templateRegex = _chunkMKA3AHLVcjs.templateRegex; exports.toNumber = _chunkWSQKHXW7cjs.toNumber; exports.tokenizeFormula = _chunkC7P22VIPcjs.tokenizeFormula; exports.tokenizePrompt = _chunkFD4LPFAEcjs.tokenizePrompt; exports.tokenizePromptWithDiagnostics = _chunkFD4LPFAEcjs.tokenizePromptWithDiagnostics; exports.trackChangesPluginKey = _chunkX4N4WUKBcjs.trackChangesPluginKey; exports.trackedChangeLabel = _chunkX4N4WUKBcjs.trackedChangeLabel; exports.tsvImportAdapter = _chunkWSQKHXW7cjs.tsvImportAdapter; exports.twoInitialCapitalsRules = _chunkPO6A6QQHcjs.twoInitialCapitalsRules; exports.unescapeVariableText = _chunkMKA3AHLVcjs.unescapeVariableText; exports.unregisterFormulaFunction = _chunkC7P22VIPcjs.unregisterFormulaFunction; exports.unregisterImportAdapter = _chunkPO6A6QQHcjs.unregisterImportAdapter; exports.updateImageSrc = _chunkPO6A6QQHcjs.updateImageSrc; exports.validateCellInput = _chunkWSQKHXW7cjs.validateCellInput; exports.validateDefinedName = _chunkWSQKHXW7cjs.validateDefinedName; exports.validateFindPattern = _chunkPO6A6QQHcjs.validateFindPattern; exports.validateSheetName = _chunkWSQKHXW7cjs.validateSheetName; exports.variableRegex = _chunkMKA3AHLVcjs.variableRegex; exports.wildcardToRegExp = _chunkC7P22VIPcjs.wildcardToRegExp; exports.withoutDirty = _chunkG2I4QJOTcjs.withoutDirty; exports.writeRichClipboard = _chunkPO6A6QQHcjs.writeRichClipboard; exports.zipCrc32 = _chunkPO6A6QQHcjs.zipCrc32; exports.zipEntryTitle = zipEntryTitle; exports.zipImportAdapter = zipImportAdapter;
|
|
1143
2589
|
//# sourceMappingURL=index.cjs.map
|