@kopjra/pdf-sentinel 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5120,13 +5120,20 @@ function fv(g, h, u, I, x, y, m, _, O = !0) {
5120
5120
  },
5121
5121
  updateAnnotation: (w) => {
5122
5122
  if (h.current) {
5123
- w = { ...w, originalId: w.id, id: g.current[w.id] || w.id };
5123
+ w = {
5124
+ ...w,
5125
+ originalId: w.id,
5126
+ id: g.current[w.id] || w.id
5127
+ };
5124
5128
  const A = Zu(w);
5125
5129
  h.current.updateAnnotation(A.pageIndex, A.id, { custom: A.custom });
5126
5130
  }
5127
5131
  },
5128
5132
  removeAnnotations: (w) => {
5129
- h.current && h.current.deleteAnnotations(w.map((A) => ({ pageIndex: A.page - 1, id: g.current[A.id] || A.id })));
5133
+ h.current && h.current.deleteAnnotations(w.map((A) => ({
5134
+ pageIndex: A.page - 1,
5135
+ id: g.current[A.id] || A.id
5136
+ })));
5130
5137
  },
5131
5138
  getAnnotationsByPage: async (w) => h.current ? (await h.current.getPageAnnotations({ pageIndex: w - 1 }).toPromise()).map((A) => Et(A, h.current)) : [],
5132
5139
  subscribe: (w) => (u.current.add(w), () => {
@@ -5173,11 +5180,14 @@ const sv = Bs(({
5173
5180
  Yn(() => (I && I(M), () => {
5174
5181
  I && I(null);
5175
5182
  }), [M, I]), Yn(() => {
5176
- if (b && h.length > 0) {
5177
- const B = h.map(($) => ($.originalId = $.id, $.id = js(), en.current[$.originalId] = $.id, {
5178
- annotation: Zu($)
5179
- }));
5180
- b.importAnnotations(B), b.setActiveTool(Zs), J(!0);
5183
+ if (b) {
5184
+ if (h.length > 0) {
5185
+ const B = h.map(($) => ($.originalId = $.id, $.id = js(), en.current[$.originalId] = $.id, {
5186
+ annotation: Zu($)
5187
+ }));
5188
+ b.importAnnotations(B), b.setActiveTool(Zs);
5189
+ }
5190
+ J(!0);
5181
5191
  }
5182
5192
  }, []), Yn(() => {
5183
5193
  if (!(!b || !M || !K || !tn))