swh.web 0.14.2__py3-none-any.whl → 0.15.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. swh/web/alter/forms.py +16 -16
  2. swh/web/alter/templates/admin_alteration.html +5 -5
  3. swh/web/alter/templates/alteration_details.html +2 -2
  4. swh/web/alter/templates/assistant_category.html +21 -19
  5. swh/web/alter/templates/assistant_email.html +3 -4
  6. swh/web/alter/templates/assistant_origins.html +1 -2
  7. swh/web/alter/templates/assistant_reasons.html +1 -2
  8. swh/web/alter/templates/assistant_summary.html +3 -4
  9. swh/web/alter/templates/content_policies.html +8 -15
  10. swh/web/alter/templates/includes/swh_legal.html +1 -1
  11. swh/web/alter/tests/test_views.py +2 -2
  12. swh/web/alter/urls.py +1 -1
  13. swh/web/alter/views.py +2 -2
  14. swh/web/browse/assets/browse/browse.css +10 -0
  15. swh/web/browse/assets/browse/sidetabs.js +22 -2
  16. swh/web/browse/templates/includes/sidetabs.html +20 -16
  17. swh/web/browse/templates/includes/snapshot-context.html +3 -1
  18. swh/web/save_code_now/templates/includes/take-new-snapshot.html +1 -1
  19. swh/web/static/css/browse.0a250d3b07ce628588a5.css +2 -0
  20. swh/web/static/css/browse.0a250d3b07ce628588a5.css.map +1 -0
  21. swh/web/static/js/add_forge_now.f8fa8235350a7875b4b2.js.map +1 -1
  22. swh/web/static/js/archive_coverage.71f6961fbdc0d76c313b.js +3 -0
  23. swh/web/static/js/{archive_coverage.b37e2158e800bc69180b.js.LICENSE.txt → archive_coverage.71f6961fbdc0d76c313b.js.LICENSE.txt} +1 -1
  24. swh/web/static/js/archive_coverage.71f6961fbdc0d76c313b.js.map +1 -0
  25. swh/web/static/js/auth.971392ebe3f22c222189.js.map +1 -1
  26. swh/web/static/js/{browse.b150f8992236375f2e9b.js → browse.d5014e5cae44a2cd3e6e.js} +3 -3
  27. swh/web/static/js/browse.d5014e5cae44a2cd3e6e.js.map +1 -0
  28. swh/web/static/js/deposit.060ba94288f399dfe89e.js.map +1 -1
  29. swh/web/static/js/guided_tour.3a7a41181c43663f866b.js.map +1 -1
  30. swh/web/static/js/highlightjs.19cb5fa8879fdc8357d7.js.map +1 -1
  31. swh/web/static/js/mailmap.5dc62b52b8eb18e2e8b0.js.map +1 -1
  32. swh/web/static/js/origin_visits.679992a2a951f67a08bc.js.map +1 -1
  33. swh/web/static/js/pdf.worker.min.js +1 -1
  34. swh/web/static/js/pdfjs.97ecbde9d93314dba75a.js +3 -0
  35. swh/web/static/js/pdfjs.97ecbde9d93314dba75a.js.map +1 -0
  36. swh/web/static/js/revision.c5f4750ef7caee355fd9.js.map +1 -1
  37. swh/web/static/js/save_code_now.3db9c75765eb44fe774a.js.map +1 -1
  38. swh/web/static/js/showdown.8be01722fe56f5a7c2db.js.map +1 -1
  39. swh/web/static/js/vault.8c6e8e445d128eb30488.js.map +1 -1
  40. swh/web/static/js/{vendors.076b42bbe0326fc632ae.js → vendors.532425b092b95d43a1d6.js} +3 -3
  41. swh/web/static/js/vendors.532425b092b95d43a1d6.js.map +1 -0
  42. swh/web/static/js/webapp.5427bd8b32cec7de0951.js +3 -0
  43. swh/web/static/js/{webapp.ec7025df24c9f358f1cc.js.LICENSE.txt → webapp.5427bd8b32cec7de0951.js.LICENSE.txt} +1 -1
  44. swh/web/static/js/webapp.5427bd8b32cec7de0951.js.map +1 -0
  45. swh/web/static/jssources/@iframe-resizer/child/index.umd.js +2 -2
  46. swh/web/static/jssources/@iframe-resizer/parent/index.umd.js +2 -2
  47. swh/web/static/jssources/core-js/internals/array-to-reversed.js +2 -2
  48. swh/web/static/jssources/core-js/internals/array-with.js +2 -2
  49. swh/web/static/jssources/core-js/internals/async-iterator-iteration.js +6 -1
  50. swh/web/static/jssources/core-js/internals/flatten-into-array.js +1 -1
  51. swh/web/static/jssources/core-js/internals/get-iterator-direct.js +1 -1
  52. swh/web/static/jssources/core-js/internals/install-error-cause.js +1 -1
  53. swh/web/static/jssources/core-js/internals/iterator-create-proxy.js +1 -1
  54. swh/web/static/jssources/core-js/internals/set-difference.js +1 -1
  55. swh/web/static/jssources/core-js/internals/set-intersection.js +1 -1
  56. swh/web/static/jssources/core-js/internals/set-is-disjoint-from.js +1 -1
  57. swh/web/static/jssources/core-js/internals/set-is-subset-of.js +1 -1
  58. swh/web/static/jssources/core-js/internals/set-is-superset-of.js +1 -1
  59. swh/web/static/jssources/core-js/internals/set-method-get-keys-before-cloning-detection.js +1 -1
  60. swh/web/static/jssources/core-js/internals/set-symmetric-difference.js +1 -1
  61. swh/web/static/jssources/core-js/internals/set-union.js +1 -1
  62. swh/web/static/jssources/core-js/internals/shared-store.js +2 -2
  63. swh/web/static/jssources/core-js/internals/string-pad.js +0 -1
  64. swh/web/static/jssources/core-js/modules/es.array-buffer.transfer-to-fixed-length.js +1 -1
  65. swh/web/static/jssources/core-js/modules/es.array-buffer.transfer.js +1 -1
  66. swh/web/static/jssources/core-js/modules/es.error.is-error.js +1 -1
  67. swh/web/static/jssources/core-js/modules/es.symbol.constructor.js +1 -1
  68. swh/web/static/jssources/jslicenses.json +1 -1
  69. swh/web/static/jssources/pdfjs-dist/build/pdf.worker.mjs +299 -13
  70. swh/web/static/jssources/pdfjs-dist/legacy/build/pdf.mjs +492 -113
  71. swh/web/static/jssources/swh/web/browse/assets/browse/sidetabs.js +22 -2
  72. swh/web/static/jssources/swh/web/webapp/assets/webapp/webapp-utils.js +10 -0
  73. swh/web/static/webpack-stats.json +73 -73
  74. swh/web/utils/archive.py +12 -0
  75. swh/web/utils/tests/test_archive.py +32 -15
  76. swh/web/vault/templates/includes/vault-common.html +1 -1
  77. swh/web/vault/templates/includes/vault-create-tasks.html +5 -5
  78. swh/web/webapp/assets/webapp/webapp-utils.js +10 -0
  79. swh/web/webapp/templates/includes/footer.html +1 -1
  80. swh/web/webapp/templates/includes/global-modals.html +3 -3
  81. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/METADATA +1 -1
  82. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/RECORD +89 -89
  83. swh/web/static/css/browse.5775e0a313f4ccb8aef5.css +0 -2
  84. swh/web/static/css/browse.5775e0a313f4ccb8aef5.css.map +0 -1
  85. swh/web/static/js/archive_coverage.b37e2158e800bc69180b.js +0 -3
  86. swh/web/static/js/archive_coverage.b37e2158e800bc69180b.js.map +0 -1
  87. swh/web/static/js/browse.b150f8992236375f2e9b.js.map +0 -1
  88. swh/web/static/js/pdfjs.ca88359f90430972e38c.js +0 -3
  89. swh/web/static/js/pdfjs.ca88359f90430972e38c.js.map +0 -1
  90. swh/web/static/js/vendors.076b42bbe0326fc632ae.js.map +0 -1
  91. swh/web/static/js/webapp.ec7025df24c9f358f1cc.js +0 -3
  92. swh/web/static/js/webapp.ec7025df24c9f358f1cc.js.map +0 -1
  93. /swh/web/static/js/{browse.b150f8992236375f2e9b.js.LICENSE.txt → browse.d5014e5cae44a2cd3e6e.js.LICENSE.txt} +0 -0
  94. /swh/web/static/js/{pdfjs.ca88359f90430972e38c.js.LICENSE.txt → pdfjs.97ecbde9d93314dba75a.js.LICENSE.txt} +0 -0
  95. /swh/web/static/js/{vendors.076b42bbe0326fc632ae.js.LICENSE.txt → vendors.532425b092b95d43a1d6.js.LICENSE.txt} +0 -0
  96. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/WHEEL +0 -0
  97. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/licenses/AUTHORS +0 -0
  98. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/licenses/LICENSE +0 -0
  99. {swh_web-0.14.2.dist-info → swh_web-0.15.0.dist-info}/top_level.txt +0 -0
@@ -21,8 +21,8 @@
21
21
  */
22
22
 
23
23
  /**
24
- * pdfjsVersion = 5.3.31
25
- * pdfjsBuild = 47ad820d9
24
+ * pdfjsVersion = 5.3.93
25
+ * pdfjsBuild = cbeef3233
26
26
  */
27
27
 
28
28
  ;// ./src/shared/util.js
@@ -18197,7 +18197,7 @@ class CFFCompiler {
18197
18197
  const numGlyphsLessNotDef = numGlyphs - 1;
18198
18198
  if (isCIDFont) {
18199
18199
  const nLeft = numGlyphsLessNotDef - 1;
18200
- out = new Uint8Array([2, 0, 0, nLeft >> 8 & 0xff, nLeft & 0xff]);
18200
+ out = new Uint8Array([2, 0, 1, nLeft >> 8 & 0xff, nLeft & 0xff]);
18201
18201
  } else {
18202
18202
  const length = 1 + numGlyphsLessNotDef * 2;
18203
18203
  out = new Uint8Array(length);
@@ -32703,7 +32703,8 @@ class PartialEvaluator {
32703
32703
  markedContentData = null,
32704
32704
  disableNormalization = false,
32705
32705
  keepWhiteSpace = false,
32706
- prevRefs = null
32706
+ prevRefs = null,
32707
+ intersector = null
32707
32708
  }) {
32708
32709
  const objId = stream.dict?.objId;
32709
32710
  const seenRefs = new RefSet(prevRefs);
@@ -32780,6 +32781,7 @@ class PartialEvaluator {
32780
32781
  transform = textContentItem.prevTransform,
32781
32782
  fontName = textContentItem.fontName
32782
32783
  }) {
32784
+ intersector?.addExtraChar(" ");
32783
32785
  textContent.items.push({
32784
32786
  str: " ",
32785
32787
  dir: "ltr",
@@ -33086,9 +33088,11 @@ class PartialEvaluator {
33086
33088
  }
33087
33089
  if (!font.vertical) {
33088
33090
  scaledDim *= textState.textHScale;
33091
+ intersector?.addGlyph(getCurrentTextTransform(), scaledDim, 0, glyph.unicode);
33089
33092
  textState.translateTextMatrix(scaledDim, 0);
33090
33093
  textChunk.width += scaledDim;
33091
33094
  } else {
33095
+ intersector?.addGlyph(getCurrentTextTransform(), 0, scaledDim, glyph.unicode);
33092
33096
  textState.translateTextMatrix(0, scaledDim);
33093
33097
  scaledDim = Math.abs(scaledDim);
33094
33098
  textChunk.height += scaledDim;
@@ -33099,8 +33103,11 @@ class PartialEvaluator {
33099
33103
  const glyphUnicode = glyph.unicode;
33100
33104
  if (saveLastChar(glyphUnicode)) {
33101
33105
  textChunk.str.push(" ");
33106
+ intersector?.addExtraChar(" ");
33107
+ }
33108
+ if (!intersector) {
33109
+ textChunk.str.push(glyphUnicode);
33102
33110
  }
33103
- textChunk.str.push(glyphUnicode);
33104
33111
  if (charSpacing) {
33105
33112
  if (!font.vertical) {
33106
33113
  textState.translateTextMatrix(charSpacing * textState.textHScale, 0);
@@ -33111,6 +33118,7 @@ class PartialEvaluator {
33111
33118
  }
33112
33119
  }
33113
33120
  function appendEOL() {
33121
+ intersector?.addExtraChar("\n");
33114
33122
  resetLastChars();
33115
33123
  if (textContentItem.initialized) {
33116
33124
  textContentItem.hasEOL = true;
@@ -33132,6 +33140,7 @@ class PartialEvaluator {
33132
33140
  if (textContentItem.initialized) {
33133
33141
  resetLastChars();
33134
33142
  textContentItem.str.push(" ");
33143
+ intersector?.addExtraChar(" ");
33135
33144
  }
33136
33145
  return false;
33137
33146
  }
@@ -33172,7 +33181,7 @@ class PartialEvaluator {
33172
33181
  if (batch && length < TEXT_CHUNK_BATCH_SIZE) {
33173
33182
  return;
33174
33183
  }
33175
- sink.enqueue(textContent, length);
33184
+ sink?.enqueue(textContent, length);
33176
33185
  textContent.items = [];
33177
33186
  textContent.styles = Object.create(null);
33178
33187
  }
@@ -33180,7 +33189,7 @@ class PartialEvaluator {
33180
33189
  return new Promise(function promiseBody(resolve, reject) {
33181
33190
  const next = function (promise) {
33182
33191
  enqueueChunk(true);
33183
- Promise.all([promise, sink.ready]).then(function () {
33192
+ Promise.all([promise, sink?.ready]).then(function () {
33184
33193
  try {
33185
33194
  promiseBody(resolve, reject);
33186
33195
  } catch (ex) {
@@ -33371,7 +33380,7 @@ class PartialEvaluator {
33371
33380
  sink.enqueue(chunk, size);
33372
33381
  },
33373
33382
  get desiredSize() {
33374
- return sink.desiredSize;
33383
+ return sink.desiredSize ?? 0;
33375
33384
  },
33376
33385
  get ready() {
33377
33386
  return sink.ready;
@@ -33383,7 +33392,7 @@ class PartialEvaluator {
33383
33392
  resources: localResources instanceof Dict ? localResources : resources,
33384
33393
  stateManager: xObjStateManager,
33385
33394
  includeMarkedContent,
33386
- sink: sinkWrapper,
33395
+ sink: sink && sinkWrapper,
33387
33396
  seenStyles,
33388
33397
  viewBox,
33389
33398
  lang,
@@ -33490,7 +33499,7 @@ class PartialEvaluator {
33490
33499
  }
33491
33500
  break;
33492
33501
  }
33493
- if (textContent.items.length >= sink.desiredSize) {
33502
+ if (textContent.items.length >= (sink?.desiredSize ?? 1)) {
33494
33503
  stop = true;
33495
33504
  break;
33496
33505
  }
@@ -35485,6 +35494,67 @@ class FakeUnicodeFont {
35485
35494
  }
35486
35495
  }
35487
35496
 
35497
+ ;// ./src/shared/scripting_utils.js
35498
+ function makeColorComp(n) {
35499
+ return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0");
35500
+ }
35501
+ function scaleAndClamp(x) {
35502
+ return Math.max(0, Math.min(255, 255 * x));
35503
+ }
35504
+ class ColorConverters {
35505
+ static CMYK_G([c, y, m, k]) {
35506
+ return ["G", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];
35507
+ }
35508
+ static G_CMYK([g]) {
35509
+ return ["CMYK", 0, 0, 0, 1 - g];
35510
+ }
35511
+ static G_RGB([g]) {
35512
+ return ["RGB", g, g, g];
35513
+ }
35514
+ static G_rgb([g]) {
35515
+ g = scaleAndClamp(g);
35516
+ return [g, g, g];
35517
+ }
35518
+ static G_HTML([g]) {
35519
+ const G = makeColorComp(g);
35520
+ return `#${G}${G}${G}`;
35521
+ }
35522
+ static RGB_G([r, g, b]) {
35523
+ return ["G", 0.3 * r + 0.59 * g + 0.11 * b];
35524
+ }
35525
+ static RGB_rgb(color) {
35526
+ return color.map(scaleAndClamp);
35527
+ }
35528
+ static RGB_HTML(color) {
35529
+ return `#${color.map(makeColorComp).join("")}`;
35530
+ }
35531
+ static T_HTML() {
35532
+ return "#00000000";
35533
+ }
35534
+ static T_rgb() {
35535
+ return [null];
35536
+ }
35537
+ static CMYK_RGB([c, y, m, k]) {
35538
+ return ["RGB", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)];
35539
+ }
35540
+ static CMYK_rgb([c, y, m, k]) {
35541
+ return [scaleAndClamp(1 - Math.min(1, c + k)), scaleAndClamp(1 - Math.min(1, m + k)), scaleAndClamp(1 - Math.min(1, y + k))];
35542
+ }
35543
+ static CMYK_HTML(components) {
35544
+ const rgb = this.CMYK_RGB(components).slice(1);
35545
+ return this.RGB_HTML(rgb);
35546
+ }
35547
+ static RGB_CMYK([r, g, b]) {
35548
+ const c = 1 - r;
35549
+ const m = 1 - g;
35550
+ const y = 1 - b;
35551
+ const k = Math.min(c, m, y);
35552
+ return ["CMYK", c, m, y, k];
35553
+ }
35554
+ }
35555
+ const DateFormats = ["m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "yy-mm-dd", "mmm-yy", "mmmm-yy", "mmm d, yyyy", "mmmm d, yyyy", "m/d/yy h:MM tt", "m/d/yy HH:MM"];
35556
+ const TimeFormats = ["HH:MM", "h:MM tt", "HH:MM:ss", "h:MM:ss tt"];
35557
+
35488
35558
  ;// ./src/core/name_number_tree.js
35489
35559
 
35490
35560
 
@@ -49161,6 +49231,7 @@ class XFAFactory {
49161
49231
 
49162
49232
 
49163
49233
 
49234
+
49164
49235
  class AnnotationFactory {
49165
49236
  static createGlobals(pdfManager) {
49166
49237
  return Promise.all([pdfManager.ensureCatalog("acroForm"), pdfManager.ensureDoc("xfaDatasets"), pdfManager.ensureCatalog("structTreeRoot"), pdfManager.ensureCatalog("baseUrl"), pdfManager.ensureCatalog("attachments"), pdfManager.ensureCatalog("globalColorSpaceCache")]).then(([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments, globalColorSpaceCache]) => ({
@@ -49885,6 +49956,9 @@ class Annotation {
49885
49956
  async save(evaluator, task, annotationStorage, changes) {
49886
49957
  return null;
49887
49958
  }
49959
+ get overlaysTextContent() {
49960
+ return false;
49961
+ }
49888
49962
  get hasTextContent() {
49889
49963
  return false;
49890
49964
  }
@@ -50839,6 +50913,23 @@ class TextWidgetAnnotation extends WidgetAnnotation {
50839
50913
  this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE);
50840
50914
  this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && !this.data.multiLine && !this.data.password && !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== 0;
50841
50915
  this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL);
50916
+ const {
50917
+ data: {
50918
+ actions
50919
+ }
50920
+ } = this;
50921
+ for (const keystrokeAction of actions?.Keystroke || []) {
50922
+ const m = keystrokeAction.trim().match(/^AF(Date|Time)_Keystroke(?:Ex)?\(['"]?([^'"]+)['"]?\);$/);
50923
+ if (m) {
50924
+ let format = m[2];
50925
+ const num = parseInt(format, 10);
50926
+ if (!isNaN(num) && Math.floor(Math.log10(num)) + 1 === m[2].length) {
50927
+ format = (m[1] === "Date" ? DateFormats : TimeFormats)[num] ?? format;
50928
+ }
50929
+ this.data[m[1] === "Date" ? "dateFormat" : "timeFormat"] = format;
50930
+ break;
50931
+ }
50932
+ }
50842
50933
  }
50843
50934
  get hasTextContent() {
50844
50935
  return !!this.appearance && !this._needAppearances;
@@ -52252,6 +52343,9 @@ class HighlightAnnotation extends MarkupAnnotation {
52252
52343
  this.data.popupRef = null;
52253
52344
  }
52254
52345
  }
52346
+ get overlaysTextContent() {
52347
+ return true;
52348
+ }
52255
52349
  static createNewDict(annotation, xref, {
52256
52350
  apRef,
52257
52351
  ap
@@ -52357,6 +52451,9 @@ class UnderlineAnnotation extends MarkupAnnotation {
52357
52451
  this.data.popupRef = null;
52358
52452
  }
52359
52453
  }
52454
+ get overlaysTextContent() {
52455
+ return true;
52456
+ }
52360
52457
  }
52361
52458
  class SquigglyAnnotation extends MarkupAnnotation {
52362
52459
  constructor(params) {
@@ -52397,6 +52494,9 @@ class SquigglyAnnotation extends MarkupAnnotation {
52397
52494
  this.data.popupRef = null;
52398
52495
  }
52399
52496
  }
52497
+ get overlaysTextContent() {
52498
+ return true;
52499
+ }
52400
52500
  }
52401
52501
  class StrikeOutAnnotation extends MarkupAnnotation {
52402
52502
  constructor(params) {
@@ -52426,6 +52526,9 @@ class StrikeOutAnnotation extends MarkupAnnotation {
52426
52526
  this.data.popupRef = null;
52427
52527
  }
52428
52528
  }
52529
+ get overlaysTextContent() {
52530
+ return true;
52531
+ }
52429
52532
  }
52430
52533
  class StampAnnotation extends MarkupAnnotation {
52431
52534
  #savedHasOwnCanvas = null;
@@ -52768,6 +52871,134 @@ class DatasetReader {
52768
52871
  }
52769
52872
  }
52770
52873
 
52874
+ ;// ./src/core/intersector.js
52875
+ class SingleIntersector {
52876
+ #annotation;
52877
+ #minX = Infinity;
52878
+ #minY = Infinity;
52879
+ #maxX = -Infinity;
52880
+ #maxY = -Infinity;
52881
+ #quadPoints;
52882
+ #text = [];
52883
+ #extraChars = [];
52884
+ #lastIntersectingQuadIndex = -1;
52885
+ #canTakeExtraChars = false;
52886
+ constructor(annotation) {
52887
+ this.#annotation = annotation;
52888
+ const quadPoints = this.#quadPoints = annotation.data.quadPoints;
52889
+ for (let i = 0, ii = quadPoints.length; i < ii; i += 8) {
52890
+ this.#minX = Math.min(this.#minX, quadPoints[i]);
52891
+ this.#maxX = Math.max(this.#maxX, quadPoints[i + 2]);
52892
+ this.#minY = Math.min(this.#minY, quadPoints[i + 5]);
52893
+ this.#maxY = Math.max(this.#maxY, quadPoints[i + 1]);
52894
+ }
52895
+ }
52896
+ overlaps(other) {
52897
+ return !(this.#minX >= other.#maxX || this.#maxX <= other.#minX || this.#minY >= other.#maxY || this.#maxY <= other.#minY);
52898
+ }
52899
+ #intersects(x, y) {
52900
+ if (this.#minX >= x || this.#maxX <= x || this.#minY >= y || this.#maxY <= y) {
52901
+ return false;
52902
+ }
52903
+ const quadPoints = this.#quadPoints;
52904
+ if (quadPoints.length === 8) {
52905
+ return true;
52906
+ }
52907
+ if (this.#lastIntersectingQuadIndex >= 0) {
52908
+ const i = this.#lastIntersectingQuadIndex;
52909
+ if (!(quadPoints[i] >= x || quadPoints[i + 2] <= x || quadPoints[i + 5] >= y || quadPoints[i + 1] <= y)) {
52910
+ return true;
52911
+ }
52912
+ this.#lastIntersectingQuadIndex = -1;
52913
+ }
52914
+ for (let i = 0, ii = quadPoints.length; i < ii; i += 8) {
52915
+ if (!(quadPoints[i] >= x || quadPoints[i + 2] <= x || quadPoints[i + 5] >= y || quadPoints[i + 1] <= y)) {
52916
+ this.#lastIntersectingQuadIndex = i;
52917
+ return true;
52918
+ }
52919
+ }
52920
+ return false;
52921
+ }
52922
+ addGlyph(x, y, glyph) {
52923
+ if (!this.#intersects(x, y)) {
52924
+ this.disableExtraChars();
52925
+ return false;
52926
+ }
52927
+ if (this.#extraChars.length > 0) {
52928
+ this.#text.push(this.#extraChars.join(""));
52929
+ this.#extraChars.length = 0;
52930
+ }
52931
+ this.#text.push(glyph);
52932
+ this.#canTakeExtraChars = true;
52933
+ return true;
52934
+ }
52935
+ addExtraChar(char) {
52936
+ if (this.#canTakeExtraChars) {
52937
+ this.#extraChars.push(char);
52938
+ }
52939
+ }
52940
+ disableExtraChars() {
52941
+ if (!this.#canTakeExtraChars) {
52942
+ return;
52943
+ }
52944
+ this.#canTakeExtraChars = false;
52945
+ this.#extraChars.length = 0;
52946
+ }
52947
+ setText() {
52948
+ this.#annotation.data.overlaidText = this.#text.join("");
52949
+ }
52950
+ }
52951
+ class Intersector {
52952
+ #intersectors = new Map();
52953
+ constructor(annotations) {
52954
+ for (const annotation of annotations) {
52955
+ if (!annotation.data.quadPoints) {
52956
+ continue;
52957
+ }
52958
+ const intersector = new SingleIntersector(annotation);
52959
+ for (const [otherIntersector, overlapping] of this.#intersectors) {
52960
+ if (otherIntersector.overlaps(intersector)) {
52961
+ if (!overlapping) {
52962
+ this.#intersectors.set(otherIntersector, new Set([intersector]));
52963
+ } else {
52964
+ overlapping.add(intersector);
52965
+ }
52966
+ }
52967
+ }
52968
+ this.#intersectors.set(intersector, null);
52969
+ }
52970
+ }
52971
+ addGlyph(transform, width, height, glyph) {
52972
+ const x = transform[4] + width / 2;
52973
+ const y = transform[5] + height / 2;
52974
+ let overlappingIntersectors;
52975
+ for (const [intersector, overlapping] of this.#intersectors) {
52976
+ if (overlappingIntersectors) {
52977
+ if (overlappingIntersectors.has(intersector)) {
52978
+ intersector.addGlyph(x, y, glyph);
52979
+ } else {
52980
+ intersector.disableExtraChars();
52981
+ }
52982
+ continue;
52983
+ }
52984
+ if (!intersector.addGlyph(x, y, glyph)) {
52985
+ continue;
52986
+ }
52987
+ overlappingIntersectors = overlapping;
52988
+ }
52989
+ }
52990
+ addExtraChar(char) {
52991
+ for (const intersector of this.#intersectors.keys()) {
52992
+ intersector.addExtraChar(char);
52993
+ }
52994
+ }
52995
+ setText() {
52996
+ for (const intersector of this.#intersectors.keys()) {
52997
+ intersector.setText();
52998
+ }
52999
+ }
53000
+ }
53001
+
52771
53002
  ;// ./src/core/calculate_sha_other.js
52772
53003
 
52773
53004
  class Word64 {
@@ -54715,6 +54946,7 @@ class XRef {
54715
54946
 
54716
54947
 
54717
54948
 
54949
+
54718
54950
  const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];
54719
54951
  class Page {
54720
54952
  #resourcesPromise = null;
@@ -55094,7 +55326,8 @@ class Page {
55094
55326
  task,
55095
55327
  includeMarkedContent,
55096
55328
  disableNormalization,
55097
- sink
55329
+ sink,
55330
+ intersector = null
55098
55331
  }) {
55099
55332
  const contentStreamPromise = this.getContentStream();
55100
55333
  const resourcesPromise = this.loadResources(RESOURCES_KEYS_TEXT_CONTENT);
@@ -55110,7 +55343,8 @@ class Page {
55110
55343
  disableNormalization,
55111
55344
  sink,
55112
55345
  viewBox: this.view,
55113
- lang
55346
+ lang,
55347
+ intersector
55114
55348
  });
55115
55349
  }
55116
55350
  async getStructTree() {
@@ -55144,6 +55378,7 @@ class Page {
55144
55378
  const intentAny = !!(intent & RenderingIntentFlag.ANY),
55145
55379
  intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY),
55146
55380
  intentPrint = !!(intent & RenderingIntentFlag.PRINT);
55381
+ const highlightedAnnotations = [];
55147
55382
  for (const annotation of annotations) {
55148
55383
  const isVisible = intentAny || intentDisplay && annotation.viewable;
55149
55384
  if (isVisible || intentPrint && annotation.printable) {
@@ -55154,8 +55389,25 @@ class Page {
55154
55389
  textContentPromises.push(annotation.extractTextContent(partialEvaluator, task, [-Infinity, -Infinity, Infinity, Infinity]).catch(function (reason) {
55155
55390
  warn(`getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".`);
55156
55391
  }));
55392
+ } else if (annotation.overlaysTextContent && isVisible) {
55393
+ highlightedAnnotations.push(annotation);
55157
55394
  }
55158
55395
  }
55396
+ if (highlightedAnnotations.length > 0) {
55397
+ const intersector = new Intersector(highlightedAnnotations);
55398
+ textContentPromises.push(this.extractTextContent({
55399
+ handler,
55400
+ task,
55401
+ includeMarkedContent: false,
55402
+ disableNormalization: false,
55403
+ sink: null,
55404
+ viewBox: this.view,
55405
+ lang: null,
55406
+ intersector
55407
+ }).then(() => {
55408
+ intersector.setText();
55409
+ }));
55410
+ }
55159
55411
  await Promise.all(textContentPromises);
55160
55412
  return annotationsData;
55161
55413
  }
@@ -55399,6 +55651,40 @@ class PDFDocument {
55399
55651
  return isSignature && isInvisible;
55400
55652
  });
55401
55653
  }
55654
+ #collectSignatureCertificates(fields, collectedSignatureCertificates, visited = new RefSet()) {
55655
+ if (!Array.isArray(fields)) {
55656
+ return;
55657
+ }
55658
+ for (let field of fields) {
55659
+ if (field instanceof Ref) {
55660
+ if (visited.has(field)) {
55661
+ continue;
55662
+ }
55663
+ visited.put(field);
55664
+ }
55665
+ field = this.xref.fetchIfRef(field);
55666
+ if (!(field instanceof Dict)) {
55667
+ continue;
55668
+ }
55669
+ if (field.has("Kids")) {
55670
+ this.#collectSignatureCertificates(field.get("Kids"), collectedSignatureCertificates, visited);
55671
+ continue;
55672
+ }
55673
+ const isSignature = isName(field.get("FT"), "Sig");
55674
+ if (!isSignature) {
55675
+ continue;
55676
+ }
55677
+ const value = field.get("V");
55678
+ if (!(value instanceof Dict)) {
55679
+ continue;
55680
+ }
55681
+ const subFilter = value.get("SubFilter");
55682
+ if (!(subFilter instanceof Name)) {
55683
+ continue;
55684
+ }
55685
+ collectedSignatureCertificates.add(subFilter.name);
55686
+ }
55687
+ }
55402
55688
  get _xfaStreams() {
55403
55689
  const {
55404
55690
  acroForm
@@ -57180,7 +57466,7 @@ class WorkerMessageHandler {
57180
57466
  docId,
57181
57467
  apiVersion
57182
57468
  } = docParams;
57183
- const workerVersion = "5.3.31";
57469
+ const workerVersion = "5.3.93";
57184
57470
  if (apiVersion !== workerVersion) {
57185
57471
  throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
57186
57472
  }