@instructure/platform-notebook 0.10.1 → 1.1.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/dist/index.js CHANGED
@@ -1,184 +1,182 @@
1
- import { jsx as s, jsxs as T, Fragment as Ye } from "react/jsx-runtime";
2
- import { createContext as Pe, useMemo as re, useContext as _e, useReducer as Fe, useRef as V, useEffect as ee, useState as W, useCallback as K } from "react";
3
- import { createPortal as Ze } from "react-dom";
4
- import { z as c } from "zod";
5
- import Je from "diff-match-patch";
6
- import { useQueryClient as ge, useMutation as pe, useQuery as et } from "@tanstack/react-query";
7
- import { IconQuestionLine as Ne, IconPinLine as be, IconWarningLine as tt, IconNoteLine as nt, IconEditLine as fe, IconTrashLine as le, IconArrowOpenStartLine as ot, IconArrowOpenEndLine as rt, IconArrowStartLine as st } from "@instructure/ui-icons";
8
- import { Menu as te } from "@instructure/ui-menu";
1
+ import { jsx as s, jsxs as E, Fragment as et } from "react/jsx-runtime";
2
+ import { createContext as Be, useMemo as ie, useContext as He, useReducer as je, useRef as J, useEffect as Z, useState as H, useCallback as q } from "react";
3
+ import { createPortal as tt } from "react-dom";
4
+ import { z as d } from "zod";
5
+ import nt from "diff-match-patch";
6
+ import { useQueryClient as be, useMutation as Ee, useQuery as ot } from "@tanstack/react-query";
7
+ import { IconQuestionLine as Se, IconPinLine as Te, IconWarningLine as rt, IconNoteLine as st, IconEditLine as pe, IconTrashLine as ue, IconArrowStartLine as it } from "@instructure/ui-icons";
8
+ import { Menu as ne } from "@instructure/ui-menu";
9
9
  import { View as z } from "@instructure/ui-view";
10
- import { Flex as C } from "@instructure/ui-flex";
11
- import { TruncateText as me } from "@instructure/ui-truncate-text";
12
- import { ScreenReaderContent as Me } from "@instructure/ui-a11y-content";
13
- import { SimpleSelect as we } from "@instructure/ui-simple-select";
14
- import { Heading as ae } from "@instructure/ui-heading";
10
+ import { Flex as S } from "@instructure/ui-flex";
11
+ import { TruncateText as Ne } from "@instructure/ui-truncate-text";
12
+ import { ScreenReaderContent as ze } from "@instructure/ui-a11y-content";
13
+ import { SimpleSelect as De } from "@instructure/ui-simple-select";
14
+ import { Heading as fe } from "@instructure/ui-heading";
15
15
  import { Text as U } from "@instructure/ui-text";
16
- import { CloseButton as it, Button as $, IconButton as Q } from "@instructure/ui-buttons";
17
- import { Tray as lt } from "@instructure/ui-tray";
18
- import { TextArea as He } from "@instructure/ui-text-area";
19
- import { Pill as ke } from "@instructure/ui-pill";
20
- import { Spinner as at } from "@instructure/ui-spinner";
21
- const ct = c.object({
22
- startContainer: c.string(),
23
- endContainer: c.string(),
24
- startOffset: c.number(),
25
- endOffset: c.number()
26
- }), dt = c.object({
27
- start: c.number(),
28
- end: c.number()
29
- }), ye = c.object({
30
- selectedText: c.string(),
31
- hasNoHighlightAnymore: c.boolean().optional(),
32
- textPosition: dt.nullable(),
33
- range: ct.nullable(),
34
- pageLastModifiedAt: c.string()
16
+ import { CloseButton as lt, Button as K, IconButton as re } from "@instructure/ui-buttons";
17
+ import { Tray as at } from "@instructure/ui-tray";
18
+ import { TextArea as $e } from "@instructure/ui-text-area";
19
+ import { Pill as Pe } from "@instructure/ui-pill";
20
+ import { Pagination as ct } from "@instructure/ui-pagination";
21
+ import { Spinner as dt } from "@instructure/ui-spinner";
22
+ const ut = d.object({
23
+ startContainer: d.string(),
24
+ endContainer: d.string(),
25
+ startOffset: d.number(),
26
+ endOffset: d.number()
27
+ }), ft = d.object({
28
+ start: d.number(),
29
+ end: d.number()
30
+ }), ve = d.object({
31
+ selectedText: d.string(),
32
+ hasNoHighlightAnymore: d.boolean().optional(),
33
+ textPosition: ft.nullable(),
34
+ range: ut.nullable(),
35
+ pageLastModifiedAt: d.string()
35
36
  });
36
- var w = /* @__PURE__ */ ((n) => (n.IMPORTANT = "Important", n.CONFUSING = "Confusing", n))(w || {});
37
- const Ee = c.enum([
37
+ var k = /* @__PURE__ */ ((t) => (t.IMPORTANT = "Important", t.CONFUSING = "Confusing", t))(k || {});
38
+ const Ce = d.enum([
38
39
  "Important",
39
40
  "Confusing"
40
41
  /* CONFUSING */
41
- ]), We = c.object({
42
- startCursor: c.string().nullish(),
43
- endCursor: c.string().nullish(),
44
- hasNextPage: c.boolean().nullish(),
45
- hasPreviousPage: c.boolean().nullish()
46
- }), ce = c.object({
47
- id: c.string(),
48
- rootAccountUuid: c.string(),
49
- userId: c.string(),
50
- courseId: c.string(),
51
- objectId: c.string(),
52
- objectType: c.string(),
53
- userText: c.string().optional(),
54
- reaction: c.array(Ee),
55
- highlightData: ye,
56
- createdAt: c.string(),
57
- updatedAt: c.string()
58
- }), ut = c.object({
59
- cursor: c.string(),
60
- node: ce
42
+ ]), mt = d.object({
43
+ totalCount: d.number().nullish(),
44
+ totalNrOfPages: d.number().nullish()
45
+ }), me = d.object({
46
+ id: d.string(),
47
+ rootAccountUuid: d.string(),
48
+ userId: d.string(),
49
+ courseId: d.string(),
50
+ objectId: d.string(),
51
+ objectType: d.string(),
52
+ userText: d.string().optional(),
53
+ reaction: d.array(Ce),
54
+ highlightData: ve,
55
+ createdAt: d.string(),
56
+ updatedAt: d.string()
57
+ }), gt = d.object({
58
+ cursor: d.string(),
59
+ node: me
61
60
  });
62
- c.object({
63
- notes: c.object({
64
- edges: c.array(ut),
65
- nodes: c.array(ce),
66
- pageInfo: We
61
+ d.object({
62
+ notes: d.object({
63
+ edges: d.array(gt),
64
+ nodes: d.array(me),
65
+ pageInfo: mt
67
66
  })
68
67
  });
69
- const ft = c.object({
70
- type: c.string(),
71
- id: c.string()
72
- }), mt = c.object({
73
- courseId: c.string().optional(),
74
- learningObject: ft.optional(),
75
- reactions: c.array(c.string()).optional()
68
+ const ht = d.object({
69
+ type: d.string(),
70
+ id: d.string()
71
+ }), pt = d.object({
72
+ courseId: d.string().optional(),
73
+ learningObject: ht.optional(),
74
+ reactions: d.array(d.string()).optional()
76
75
  }).optional();
77
- c.object({
78
- courseId: c.string().optional(),
79
- filter: mt,
80
- pageParams: We.optional(),
81
- direction: c.enum(["next", "prev"]).optional(),
82
- pageSize: c.number().optional()
76
+ d.object({
77
+ courseId: d.string().optional(),
78
+ filter: pt,
79
+ offset: d.number().optional(),
80
+ pageSize: d.number().optional()
83
81
  });
84
- c.object({
85
- courseId: c.string(),
86
- objectId: c.string(),
87
- objectType: c.string(),
88
- userText: c.string().optional(),
89
- reaction: c.array(Ee),
90
- highlightData: ye
82
+ d.object({
83
+ courseId: d.string(),
84
+ objectId: d.string(),
85
+ objectType: d.string(),
86
+ userText: d.string().optional(),
87
+ reaction: d.array(Ce),
88
+ highlightData: ve
91
89
  });
92
- c.object({
93
- createNote: ce
90
+ d.object({
91
+ createNote: me
94
92
  });
95
- c.object({
96
- id: c.string(),
97
- userText: c.string().optional(),
98
- reaction: c.array(Ee),
99
- highlightData: ye
93
+ d.object({
94
+ id: d.string(),
95
+ userText: d.string().optional(),
96
+ reaction: d.array(Ce),
97
+ highlightData: ve
100
98
  });
101
- c.object({
102
- updateNote: ce
99
+ d.object({
100
+ updateNote: me
103
101
  });
104
- c.object({
105
- deleteNote: c.string()
102
+ d.object({
103
+ deleteNote: d.string()
106
104
  });
107
- var Be = /* @__PURE__ */ ((n) => (n[n.FORWARDS = 1] = "FORWARDS", n[n.BACKWARDS = 2] = "BACKWARDS", n))(Be || {});
108
- class q {
109
- constructor(e, t) {
110
- this.start = e, this.end = t;
105
+ var We = /* @__PURE__ */ ((t) => (t[t.FORWARDS = 1] = "FORWARDS", t[t.BACKWARDS = 2] = "BACKWARDS", t))(We || {});
106
+ class X {
107
+ constructor(e, n) {
108
+ this.start = e, this.end = n;
111
109
  }
112
110
  toRange() {
113
- let e, t;
114
- if (this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, t] = je(this.start.element, this.start.offset, this.end.offset) : (e = this.start.resolve({
111
+ let e, n;
112
+ if (this.start.element === this.end.element && this.start.offset <= this.end.offset ? [e, n] = Ue(this.start.element, this.start.offset, this.end.offset) : (e = this.start.resolve({
115
113
  direction: 1
116
114
  /* FORWARDS */
117
- }), t = this.end.resolve({
115
+ }), n = this.end.resolve({
118
116
  direction: 2
119
117
  /* BACKWARDS */
120
- })), !e || !t)
118
+ })), !e || !n)
121
119
  return null;
122
120
  const o = new Range();
123
- return o.setStart(e.node, e.offset), o.setEnd(t.node, t.offset), o;
121
+ return o.setStart(e.node, e.offset), o.setEnd(n.node, n.offset), o;
124
122
  }
125
123
  static fromRange(e) {
126
- const t = B.fromPoint(e.startContainer, e.startOffset), o = B.fromPoint(e.endContainer, e.endOffset);
127
- return !t || !o ? null : new q(t, o);
124
+ const n = j.fromPoint(e.startContainer, e.startOffset), o = j.fromPoint(e.endContainer, e.endOffset);
125
+ return !n || !o ? null : new X(n, o);
128
126
  }
129
- static fromOffsets(e, t, o) {
130
- return new q(new B(e, t), new B(e, o));
127
+ static fromOffsets(e, n, o) {
128
+ return new X(new j(e, n), new j(e, o));
131
129
  }
132
130
  relativeTo(e) {
133
- return new q(this.start.relativeTo(e), this.end.relativeTo(e));
131
+ return new X(this.start.relativeTo(e), this.end.relativeTo(e));
134
132
  }
135
133
  }
136
- class B {
137
- constructor(e, t) {
138
- t < 0 && console.error("Offset is invalid"), this.element = e, this.offset = t;
134
+ class j {
135
+ constructor(e, n) {
136
+ n < 0 && console.error("Offset is invalid"), this.element = e, this.offset = n;
139
137
  }
140
138
  resolve(e = {}) {
141
139
  try {
142
- return je(this.element, this.offset)[0];
143
- } catch (t) {
140
+ return Ue(this.element, this.offset)[0];
141
+ } catch (n) {
144
142
  if (this.offset === 0 && e.direction !== void 0) {
145
143
  const o = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);
146
144
  o.currentNode = this.element;
147
- const r = e.direction === Be.FORWARDS, i = r ? o.nextNode() : o.previousNode();
145
+ const r = e.direction === We.FORWARDS, i = r ? o.nextNode() : o.previousNode();
148
146
  if (!i)
149
- throw t;
147
+ throw n;
150
148
  return { node: i, offset: r ? 0 : i.data.length };
151
149
  }
152
- throw t;
150
+ throw n;
153
151
  }
154
152
  }
155
- static fromCharOffset(e, t) {
153
+ static fromCharOffset(e, n) {
156
154
  switch (e.nodeType) {
157
155
  case Node.TEXT_NODE:
158
- return B.fromPoint(e, t);
156
+ return j.fromPoint(e, n);
159
157
  case Node.ELEMENT_NODE:
160
- return new B(e, t);
158
+ return new j(e, n);
161
159
  default:
162
160
  return console.error("Node is not an element or text node"), null;
163
161
  }
164
162
  }
165
- static fromPoint(e, t) {
163
+ static fromPoint(e, n) {
166
164
  switch (e.nodeType) {
167
165
  case Node.TEXT_NODE: {
168
- if (t < 0 || t > e.data.length)
166
+ if (n < 0 || n > e.data.length)
169
167
  return console.error("Text node offset is out of range"), null;
170
168
  if (!e.parentElement)
171
169
  return console.error("Text node has no parent"), null;
172
- const o = De(e) + t;
173
- return new B(e.parentElement, o);
170
+ const o = Fe(e) + n;
171
+ return new j(e.parentElement, o);
174
172
  }
175
173
  case Node.ELEMENT_NODE: {
176
- if (t < 0 || t > e.childNodes.length)
174
+ if (n < 0 || n > e.childNodes.length)
177
175
  return console.error("Child node offset is out of range"), null;
178
176
  let o = 0;
179
- for (let r = 0; r < t; r++)
180
- o += ze(e.childNodes[r]);
181
- return new B(e, o);
177
+ for (let r = 0; r < n; r++)
178
+ o += Ge(e.childNodes[r]);
179
+ return new j(e, o);
182
180
  }
183
181
  default:
184
182
  return console.error("Point is not in an element or text node"), null;
@@ -187,48 +185,48 @@ class B {
187
185
  relativeTo(e) {
188
186
  if (!e.contains(this.element))
189
187
  throw new Error("Parent is not an ancestor of current element");
190
- let t = this.element, o = this.offset;
191
- for (; t !== e; )
192
- o += De(t), t.parentElement && (t = t.parentElement);
193
- return new B(t, o);
188
+ let n = this.element, o = this.offset;
189
+ for (; n !== e; )
190
+ o += Fe(n), n.parentElement && (n = n.parentElement);
191
+ return new j(n, o);
194
192
  }
195
193
  }
196
- const ht = (n) => {
197
- const e = n.nodeName.toLowerCase();
194
+ const Nt = (t) => {
195
+ const e = t.nodeName.toLowerCase();
198
196
  return e === "#text" ? "text()" : e;
199
197
  };
200
- function gt(n) {
201
- let e = 0, t = n;
202
- for (; t; )
203
- t.nodeName === n.nodeName && (e += 1), t = t.previousSibling;
198
+ function yt(t) {
199
+ let e = 0, n = t;
200
+ for (; n; )
201
+ n.nodeName === t.nodeName && (e += 1), n = n.previousSibling;
204
202
  return e;
205
203
  }
206
- const pt = (n) => {
207
- const e = ht(n), t = gt(n);
208
- return `${e}[${t}]`;
209
- }, Oe = (n, e) => {
210
- let t = "", o = n;
204
+ const bt = (t) => {
205
+ const e = Nt(t), n = yt(t);
206
+ return `${e}[${n}]`;
207
+ }, Le = (t, e) => {
208
+ let n = "", o = t;
211
209
  for (; o !== e; ) {
212
210
  if (!o) {
213
211
  console.error("Node is not a descendant of root");
214
212
  return;
215
213
  }
216
- t = `${pt(o)}/${t}`, o = o.parentNode;
214
+ n = `${bt(o)}/${n}`, o = o.parentNode;
217
215
  }
218
- return t = `/${t}`, t = t.replace(/\/$/, ""), t;
219
- }, Nt = (n, e, t) => {
216
+ return n = `/${n}`, n = n.replace(/\/$/, ""), n;
217
+ }, Et = (t, e, n) => {
220
218
  const o = e.toUpperCase();
221
219
  let r = -1;
222
- for (let i = 0; i < n.children.length; i++) {
223
- const l = n.children[i];
224
- if (l.nodeName.toUpperCase() === o && (++r, r === t))
220
+ for (let i = 0; i < t.children.length; i++) {
221
+ const l = t.children[i];
222
+ if (l.nodeName.toUpperCase() === o && (++r, r === n))
225
223
  return l;
226
224
  }
227
225
  return null;
228
- }, bt = (n, e) => {
229
- if (!(n.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+])?)+$/) !== null))
226
+ }, St = (t, e) => {
227
+ if (!(t.match(/^(\/[A-Za-z0-9-]+(\[[0-9]+])?)+$/) !== null))
230
228
  return console.error("Expression is not a simple XPath"), null;
231
- const o = n.split("/");
229
+ const o = t.split("/");
232
230
  let r = e;
233
231
  o.shift();
234
232
  for (const i of o) {
@@ -236,71 +234,71 @@ const pt = (n) => {
236
234
  const m = i.indexOf("[");
237
235
  if (m !== -1) {
238
236
  l = i.slice(0, m);
239
- const g = i.slice(m + 1, i.indexOf("]"));
240
- if (a = Number.parseInt(g, 10) - 1, a < 0)
237
+ const h = i.slice(m + 1, i.indexOf("]"));
238
+ if (a = Number.parseInt(h, 10) - 1, a < 0)
241
239
  return null;
242
240
  } else
243
241
  l = i, a = 0;
244
- const d = Nt(r, l, a);
245
- if (!d)
242
+ const c = Et(r, l, a);
243
+ if (!c)
246
244
  return null;
247
- r = d;
245
+ r = c;
248
246
  }
249
247
  return r;
250
- }, Re = (n, e = document.body) => {
248
+ }, Ae = (t, e = document.body) => {
251
249
  try {
252
- return bt(n, e);
250
+ return St(t, e);
253
251
  } catch {
254
- return document.evaluate(`.${n}`, e, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
252
+ return document.evaluate(`.${t}`, e, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
255
253
  }
256
254
  };
257
- class Y {
258
- constructor(e, t) {
259
- this.root = e, this.range = t;
255
+ class ee {
256
+ constructor(e, n) {
257
+ this.root = e, this.range = n;
260
258
  }
261
- static fromRange(e, t) {
262
- return new Y(e, t);
259
+ static fromRange(e, n) {
260
+ return new ee(e, n);
263
261
  }
264
- static fromSelector(e, t) {
265
- if (!(t != null && t.startContainer) || !(t != null && t.endContainer))
262
+ static fromSelector(e, n) {
263
+ if (!(n != null && n.startContainer) || !(n != null && n.endContainer))
266
264
  return console.error("No start or end container in selector"), null;
267
- const o = Re(t.startContainer, e);
265
+ const o = Ae(n.startContainer, e);
268
266
  if (!o)
269
267
  return console.error("Failed to resolve startContainer XPath"), null;
270
- const r = Re(t.endContainer, e);
268
+ const r = Ae(n.endContainer, e);
271
269
  if (!r)
272
270
  return console.error("Failed to resolve endContainer XPath"), null;
273
- const i = B.fromCharOffset(o, t.startOffset), l = B.fromCharOffset(r, t.endOffset);
271
+ const i = j.fromCharOffset(o, n.startOffset), l = j.fromCharOffset(r, n.endOffset);
274
272
  if (!i || !l)
275
273
  return null;
276
- const a = new q(i, l).toRange();
277
- return a ? new Y(e, a) : null;
274
+ const a = new X(i, l).toRange();
275
+ return a ? new ee(e, a) : null;
278
276
  }
279
277
  toRange() {
280
278
  return this.range;
281
279
  }
282
280
  toSelector() {
283
281
  var i;
284
- const e = (i = q.fromRange(this.range)) == null ? void 0 : i.toRange(), t = e && q.fromRange(e), o = t && Oe(t.start.element, this.root), r = t && Oe(t.end.element, this.root);
282
+ const e = (i = X.fromRange(this.range)) == null ? void 0 : i.toRange(), n = e && X.fromRange(e), o = n && Le(n.start.element, this.root), r = n && Le(n.end.element, this.root);
285
283
  return !o || !r ? null : {
286
284
  startContainer: o,
287
- startOffset: t.start.offset,
285
+ startOffset: n.start.offset,
288
286
  endContainer: r,
289
- endOffset: t.end.offset
287
+ endOffset: n.end.offset
290
288
  };
291
289
  }
292
290
  }
293
- class X {
294
- constructor(e, t, o) {
295
- this.root = e, this.start = t, this.end = o;
291
+ class Y {
292
+ constructor(e, n, o) {
293
+ this.root = e, this.start = n, this.end = o;
296
294
  }
297
- static fromRange(e, t) {
295
+ static fromRange(e, n) {
298
296
  var r;
299
- const o = (r = q.fromRange(t)) == null ? void 0 : r.relativeTo(e);
300
- return o ? new X(e, o.start.offset, o.end.offset) : null;
297
+ const o = (r = X.fromRange(n)) == null ? void 0 : r.relativeTo(e);
298
+ return o ? new Y(e, o.start.offset, o.end.offset) : null;
301
299
  }
302
- static fromSelector(e, t) {
303
- return new X(e, t.start, t.end);
300
+ static fromSelector(e, n) {
301
+ return new Y(e, n.start, n.end);
304
302
  }
305
303
  toSelector() {
306
304
  return {
@@ -309,92 +307,93 @@ class X {
309
307
  };
310
308
  }
311
309
  toRange() {
312
- return q.fromOffsets(this.root, this.start, this.end).toRange();
310
+ return X.fromOffsets(this.root, this.start, this.end).toRange();
313
311
  }
314
312
  }
315
- const ze = (n) => {
313
+ const Ge = (t) => {
316
314
  var e;
317
- switch (n.nodeType) {
315
+ switch (t.nodeType) {
318
316
  case Node.ELEMENT_NODE:
319
317
  case Node.TEXT_NODE:
320
- return ((e = n.textContent) == null ? void 0 : e.length) ?? 0;
318
+ return ((e = t.textContent) == null ? void 0 : e.length) ?? 0;
321
319
  default:
322
320
  return 0;
323
321
  }
324
- }, De = (n) => {
325
- let e = n.previousSibling, t = 0;
322
+ }, Fe = (t) => {
323
+ let e = t.previousSibling, n = 0;
326
324
  for (; e; )
327
- t += ze(e), e = e.previousSibling;
328
- return t;
329
- }, je = (n, ...e) => {
330
- let t = e.shift();
331
- const o = n.ownerDocument.createNodeIterator(n, NodeFilter.SHOW_TEXT), r = [];
325
+ n += Ge(e), e = e.previousSibling;
326
+ return n;
327
+ }, Ue = (t, ...e) => {
328
+ let n = e.shift();
329
+ const o = t.ownerDocument.createNodeIterator(t, NodeFilter.SHOW_TEXT), r = [];
332
330
  let i = o.nextNode(), l = null, a = 0;
333
- for (; t !== void 0 && i; )
334
- l = i, a + l.data.length > t ? (r.push({ node: l, offset: t - a }), t = e.shift()) : (i = o.nextNode(), a += l.data.length);
335
- for (; t !== void 0 && l && a === t; )
336
- r.push({ node: l, offset: l.data.length }), t = e.shift();
337
- return t !== void 0 && console.error("Offset exceeds text length"), r;
338
- }, yt = (n, e, t, o) => {
339
- const r = t - e;
340
- return Math.abs(r - o) <= 5 ? X.fromSelector(n, {
331
+ for (; n !== void 0 && i; )
332
+ l = i, a + l.data.length > n ? (r.push({ node: l, offset: n - a }), n = e.shift()) : (i = o.nextNode(), a += l.data.length);
333
+ for (; n !== void 0 && l && a === n; )
334
+ r.push({ node: l, offset: l.data.length }), n = e.shift();
335
+ return n !== void 0 && console.error("Offset exceeds text length"), r;
336
+ }, Tt = (t, e, n, o) => {
337
+ const r = n - e;
338
+ return Math.abs(r - o) <= 5 ? Y.fromSelector(t, {
341
339
  start: e,
342
- end: t
340
+ end: n
343
341
  }) : null;
344
- }, Et = (n, e, t, o) => {
345
- const r = new Je();
342
+ }, vt = (t, e, n, o) => {
343
+ const r = new nt();
346
344
  r.Match_Distance = 5e3;
347
- const i = n.textContent;
345
+ const i = t.textContent;
348
346
  if (!i)
349
347
  return null;
350
348
  if (e.length > 32) {
351
- const l = e.slice(0, 32), a = e.slice(-32), m = o - t;
352
- let d = r.match_main(i, l, t);
353
- const g = r.match_main(i, a, o), h = g + a.length;
354
- if (d === -1 || g === -1)
349
+ const l = e.slice(0, 32), a = e.slice(-32), m = o - n;
350
+ let c = r.match_main(i, l, n);
351
+ const h = r.match_main(i, a, o), g = h + a.length;
352
+ if (c === -1 || h === -1)
355
353
  return null;
356
- const u = h - d, S = Math.abs(u - m);
357
- if ((d > h || S > 5) && (r.Match_Distance = e.length + 100, d = r.match_main(i, l, h), d !== -1 && d < h))
358
- return yt(n, d, h, m);
359
- if (d < h && S <= 5)
360
- return X.fromSelector(n, {
361
- start: d,
362
- end: h
354
+ const u = g - c, p = Math.abs(u - m);
355
+ if ((c > g || p > 5) && (r.Match_Distance = e.length + 100, c = r.match_main(i, l, g), c !== -1 && c < g))
356
+ return Tt(t, c, g, m);
357
+ if (c < g && p <= 5)
358
+ return Y.fromSelector(t, {
359
+ start: c,
360
+ end: g
363
361
  });
364
362
  } else {
365
- const l = r.match_main(i, e, t);
363
+ const l = r.match_main(i, e, n);
366
364
  if (l !== -1)
367
- return X.fromSelector(n, {
365
+ return Y.fromSelector(t, {
368
366
  start: l,
369
367
  end: l + e.length
370
368
  });
371
369
  }
372
370
  return null;
373
- }, St = (n, e) => {
371
+ }, Ct = (t, e) => {
374
372
  if (!e) return null;
375
- const { highlightData: t } = n, { textPosition: o, selectedText: r } = t;
376
- return Et(
373
+ const { highlightData: n } = t, { textPosition: o, selectedText: r } = n;
374
+ return vt(
377
375
  e,
378
376
  r,
379
377
  (o == null ? void 0 : o.start) ?? 0,
380
378
  (o == null ? void 0 : o.end) ?? 0
381
379
  );
382
- }, vt = (n, e, t) => {
380
+ }, It = (t, e, n) => {
383
381
  const o = [], r = [];
384
382
  for (const i of e) {
385
- const l = St(i, n);
383
+ const l = Ct(i, t);
386
384
  if (l) {
387
- const a = l.toRange(), m = a && Y.fromRange(n, a);
385
+ const a = l.toRange(), m = a && ee.fromRange(t, a), c = (a == null ? void 0 : a.toString().trim()) || i.highlightData.selectedText;
388
386
  o.push({
389
387
  id: i.id,
390
388
  reaction: i.reaction,
391
389
  userText: i.userText,
392
390
  highlightData: {
393
391
  ...i.highlightData,
392
+ selectedText: c,
394
393
  hasNoHighlightAnymore: !1,
395
394
  range: (m == null ? void 0 : m.toSelector()) ?? null,
396
395
  textPosition: l.toSelector(),
397
- pageLastModifiedAt: t
396
+ pageLastModifiedAt: n
398
397
  }
399
398
  });
400
399
  } else
@@ -404,377 +403,378 @@ const ze = (n) => {
404
403
  userText: i.userText,
405
404
  highlightData: {
406
405
  ...i.highlightData,
407
- pageLastModifiedAt: t,
406
+ pageLastModifiedAt: n,
408
407
  hasNoHighlightAnymore: !0
409
408
  }
410
409
  }) : r.push(i.id);
411
410
  }
412
411
  return { notesForUpdate: o, noteIdsForDelete: r };
413
- }, Le = (n, e) => {
412
+ }, _e = (t, e) => {
414
413
  var l;
415
414
  if (!e) return;
416
- const { highlightData: t, id: o } = n, { range: r } = t ?? {};
417
- r && ((l = Y.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Rt({ id: o });
418
- }, Tt = (n) => {
419
- const e = document.getElementById(ve(n));
415
+ const { highlightData: n, id: o } = t, { range: r } = n ?? {};
416
+ r && ((l = ee.fromSelector(e, r)) == null ? void 0 : l.toRange()) && Lt({ id: o });
417
+ }, xt = (t) => {
418
+ const e = document.getElementById(xe(t));
420
419
  if (e) {
421
- const t = e.getBoundingClientRect();
422
- t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth) || e.scrollIntoView({ behavior: "smooth", block: "start" });
420
+ const n = e.getBoundingClientRect();
421
+ n.top >= 0 && n.left >= 0 && n.bottom <= (window.innerHeight || document.documentElement.clientHeight) && n.right <= (window.innerWidth || document.documentElement.clientWidth) || e.scrollIntoView({ behavior: "smooth", block: "start" });
423
422
  }
424
- }, se = 90, ie = 172, Ct = (n) => {
425
- const e = n.getClientRects();
423
+ }, ae = 90, ce = 172, wt = (t) => {
424
+ const e = t.getClientRects();
426
425
  if (!e.length)
427
426
  return null;
428
- const t = e[0], o = e[e.length - 1], r = 4, i = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, m = (f) => {
429
- const y = f + ie;
430
- return f >= i && y <= l - i;
431
- }, d = (f) => {
432
- const y = f + se;
433
- return f >= i && y <= a - i;
427
+ const n = e[0], o = e[e.length - 1], r = 4, i = 16, l = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, m = (y) => {
428
+ const T = y + ce;
429
+ return y >= i && T <= l - i;
430
+ }, c = (y) => {
431
+ const T = y + ae;
432
+ return y >= i && T <= a - i;
434
433
  };
435
- let g;
436
- const h = t.right - ie;
437
- if (m(h))
438
- g = h;
434
+ let h;
435
+ const g = n.right - ce;
436
+ if (m(g))
437
+ h = g;
439
438
  else {
440
- const f = t.left;
441
- if (m(f))
442
- g = f;
439
+ const y = n.left;
440
+ if (m(y))
441
+ h = y;
443
442
  else {
444
- const E = (t.left + t.right) / 2 - ie / 2;
445
- m(E) ? g = E : h < i ? g = i : g = l - ie - i;
443
+ const N = (n.left + n.right) / 2 - ce / 2;
444
+ m(N) ? h = N : g < i ? h = i : h = l - ce - i;
446
445
  }
447
446
  }
448
447
  let u;
449
- const S = o.bottom + r;
450
- if (d(S))
451
- u = S;
448
+ const p = o.bottom + r;
449
+ if (c(p))
450
+ u = p;
452
451
  else {
453
- const f = t.top - se - r;
454
- d(f) ? u = f : S + se > a - i ? u = a - se - i : u = i;
452
+ const y = n.top - ae - r;
453
+ c(y) ? u = y : p + ae > a - i ? u = a - ae - i : u = i;
455
454
  }
456
- return { top: u, left: g };
457
- }, It = (n, e) => {
458
- for (const t of e)
459
- if (n.start < t.end && n.end > t.start)
455
+ return { top: u, left: h };
456
+ }, kt = (t, e) => {
457
+ for (const n of e)
458
+ if (t.start < n.end && t.end > n.start)
460
459
  return !0;
461
460
  return !1;
462
- }, Se = (n) => `highlight-wrapper-${n}`, ve = (n) => `${Se(n)}-start`, Ue = (n) => `${Se(n)}-end`, oe = (n) => `[data-highlight-id="${CSS.escape(n)}"]`, Te = (n, e) => {
463
- const t = Number.parseInt(n.slice(1, 3), 16), o = Number.parseInt(n.slice(3, 5), 16), r = Number.parseInt(n.slice(5, 7), 16);
464
- return `rgba(${t}, ${o}, ${r}, ${e})`;
465
- }, xt = (n, e) => {
466
- var t;
461
+ }, Ie = (t) => `highlight-wrapper-${t}`, xe = (t) => `${Ie(t)}-start`, qe = (t) => `${Ie(t)}-end`, se = (t) => `[data-highlight-id="${CSS.escape(t)}"]`, we = (t, e) => {
462
+ const n = Number.parseInt(t.slice(1, 3), 16), o = Number.parseInt(t.slice(3, 5), 16), r = Number.parseInt(t.slice(5, 7), 16);
463
+ return `rgba(${n}, ${o}, ${r}, ${e})`;
464
+ }, Ot = (t, e) => {
465
+ var n;
467
466
  try {
468
- const o = ((t = e.nodeValue) == null ? void 0 : t.length) ?? e.childNodes.length;
469
- return n.comparePoint(e, 0) <= 0 && n.comparePoint(e, o) >= 0;
467
+ const o = ((n = e.nodeValue) == null ? void 0 : n.length) ?? e.childNodes.length;
468
+ return t.comparePoint(e, 0) <= 0 && t.comparePoint(e, o) >= 0;
470
469
  } catch {
471
470
  return !1;
472
471
  }
473
- }, wt = (n) => {
472
+ }, Rt = (t) => {
474
473
  var i;
475
- if (n.collapsed)
474
+ if (t.collapsed)
476
475
  return [];
477
- let e = n.commonAncestorContainer;
476
+ let e = t.commonAncestorContainer;
478
477
  if (e && e.nodeType !== Node.ELEMENT_NODE && (e = e.parentElement), !e)
479
478
  return [];
480
- const t = [], o = (i = e == null ? void 0 : e.ownerDocument) == null ? void 0 : i.createNodeIterator(e, NodeFilter.SHOW_TEXT);
479
+ const n = [], o = (i = e == null ? void 0 : e.ownerDocument) == null ? void 0 : i.createNodeIterator(e, NodeFilter.SHOW_TEXT);
481
480
  let r = (o == null ? void 0 : o.nextNode()) || null;
482
481
  for (; r; ) {
483
- if (!xt(n, r)) {
482
+ if (!Ot(t, r)) {
484
483
  r = (o == null ? void 0 : o.nextNode()) || null;
485
484
  continue;
486
485
  }
487
486
  const l = r;
488
- if (l === n.startContainer && n.startOffset > 0) {
489
- l.splitText(n.startOffset), r = (o == null ? void 0 : o.nextNode()) || null;
487
+ if (l === t.startContainer && t.startOffset > 0) {
488
+ l.splitText(t.startOffset), r = (o == null ? void 0 : o.nextNode()) || null;
490
489
  continue;
491
490
  }
492
- l === n.endContainer && n.endOffset < l.data.length && l.splitText(n.endOffset), t.push(l), r = (o == null ? void 0 : o.nextNode()) || null;
491
+ l === t.endContainer && t.endOffset < l.data.length && l.splitText(t.endOffset), n.push(l), r = (o == null ? void 0 : o.nextNode()) || null;
493
492
  }
494
- return t;
495
- }, kt = (n, e, t) => {
496
- if (n.collapsed) return;
497
- const o = e.id ?? "", r = Se(o);
498
- if (document.getElementById(ve(o))) {
499
- Ot(e, t);
493
+ return n;
494
+ }, Dt = (t, e, n) => {
495
+ if (t.collapsed) return;
496
+ const o = e.id ?? "", r = Ie(o);
497
+ if (document.getElementById(xe(o))) {
498
+ Pt(e, n);
500
499
  return;
501
500
  }
502
- const l = e.type === w.IMPORTANT ? t.colors.importantBackground : t.colors.confusingBackground, m = e.id === e.selectedNoteId ? l : Te(l, 0.5), d = e.type === w.IMPORTANT ? t.colors.importantUnderline : t.colors.confusingUnderline, g = e.type === w.IMPORTANT ? "solid" : "dashed", h = n.toString(), u = document.createElement("span");
503
- u.id = `${r}-start`, u.className = "highlight-marker-start", u.dataset.highlightId = o || "", u.setAttribute("role", "button"), u.setAttribute("tabindex", "0"), u.setAttribute("aria-label", h), u.style.position = "relative", u.style.fontSize = "0", u.style.lineHeight = "0", u.style.width = "0", u.style.height = "0", u.style.margin = "0", u.style.padding = "0", u.style.border = "0";
504
- const S = document.createElement("span");
505
- S.id = Ue(o), S.className = "highlight-marker-end", S.dataset.highlightId = o || "";
506
- const f = n.cloneRange();
507
- f.collapse(!1), f.insertNode(S);
508
- const y = n.cloneRange();
509
- y.collapse(!0), y.insertNode(u);
510
- const E = document.createRange();
511
- E.setStartAfter(u), E.setEndBefore(S);
512
- const M = wt(E).filter((N) => N.textContent && N.textContent.length > 0);
513
- M.forEach((N, I) => {
514
- var Z;
515
- const k = N.parentElement;
516
- if ((k == null ? void 0 : k.dataset.highlightId) === o) return;
517
- const x = I === 0, O = I === M.length - 1, _ = M.length === 1;
518
- let F;
519
- _ ? F = "single" : x ? F = "first" : O ? F = "last" : F = "middle";
520
- const D = document.createElement("span");
521
- D.className = "highlight-content", D.dataset.highlightId = o || "", D.dataset.position = F, D.style.backgroundColor = m, D.style.textDecorationLine = "underline", D.style.textDecorationColor = d, D.style.textDecorationStyle = g, D.style.textDecorationThickness = t.borderWidthSmall, D.style.textUnderlineOffset = t.underlineOffset, D.style.cursor = "pointer", D.addEventListener("click", (R) => {
522
- var b;
523
- R.target.tagName !== "A" && ((b = e.onClick) == null || b.call(e));
524
- }), (Z = N.parentNode) == null || Z.insertBefore(D, N), D.appendChild(N);
525
- }), u.addEventListener("click", (N) => {
501
+ const l = e.type === k.IMPORTANT ? n.colors.importantBackground : n.colors.confusingBackground, m = e.id === e.selectedNoteId ? l : we(l, 0.5), c = e.type === k.IMPORTANT ? n.colors.importantUnderline : n.colors.confusingUnderline, h = e.type === k.IMPORTANT ? "solid" : "dashed", g = t.toString(), u = document.createElement("span");
502
+ u.id = `${r}-start`, u.className = "highlight-marker-start", u.dataset.highlightId = o || "", u.setAttribute("role", "button"), u.setAttribute("tabindex", "0"), u.setAttribute("aria-label", g), u.style.position = "relative", u.style.fontSize = "0", u.style.lineHeight = "0", u.style.width = "0", u.style.height = "0", u.style.margin = "0", u.style.padding = "0", u.style.border = "0";
503
+ const p = document.createElement("span");
504
+ p.id = qe(o), p.className = "highlight-marker-end", p.dataset.highlightId = o || "";
505
+ const y = t.cloneRange();
506
+ y.collapse(!1), y.insertNode(p);
507
+ const T = t.cloneRange();
508
+ T.collapse(!0), T.insertNode(u);
509
+ const N = document.createRange();
510
+ N.setStartAfter(u), N.setEndBefore(p);
511
+ const L = Rt(N).filter((b) => b.textContent && b.textContent.length > 0);
512
+ L.forEach((b, I) => {
513
+ var G;
514
+ const R = b.parentElement;
515
+ if ((R == null ? void 0 : R.dataset.highlightId) === o) return;
516
+ const C = I === 0, B = I === L.length - 1, x = L.length === 1;
517
+ let A;
518
+ x ? A = "single" : C ? A = "first" : B ? A = "last" : A = "middle";
519
+ const w = document.createElement("span");
520
+ w.className = "highlight-content", w.dataset.highlightId = o || "", w.dataset.position = A, w.style.backgroundColor = m, w.style.textDecorationLine = "underline", w.style.textDecorationColor = c, w.style.textDecorationStyle = h, w.style.textDecorationThickness = n.borderWidthSmall, w.style.textUnderlineOffset = n.underlineOffset, w.style.cursor = "pointer", w.addEventListener("click", (te) => {
521
+ var $;
522
+ te.target.tagName !== "A" && (($ = e.onClick) == null || $.call(e));
523
+ }), (G = b.parentNode) == null || G.insertBefore(w, b), w.appendChild(b);
524
+ }), u.addEventListener("click", (b) => {
526
525
  var I;
527
- N.target.tagName !== "A" && ((I = e.onClick) == null || I.call(e));
528
- }), u.addEventListener("keydown", (N) => {
526
+ b.target.tagName !== "A" && ((I = e.onClick) == null || I.call(e));
527
+ }), u.addEventListener("keydown", (b) => {
529
528
  var I;
530
- if (N.key === "Enter" || N.key === " ")
531
- N.preventDefault(), (I = e.onClick) == null || I.call(e);
532
- else if (N.key === "Tab" && !N.shiftKey) {
533
- const k = document.querySelectorAll(oe(o));
534
- for (const x of k) {
535
- const O = x.querySelector("a");
536
- if (O) {
537
- N.preventDefault(), O.focus();
529
+ if (b.key === "Enter" || b.key === " ")
530
+ b.preventDefault(), (I = e.onClick) == null || I.call(e);
531
+ else if (b.key === "Tab" && !b.shiftKey) {
532
+ const R = document.querySelectorAll(se(o));
533
+ for (const C of R) {
534
+ const B = C.querySelector("a");
535
+ if (B) {
536
+ b.preventDefault(), B.focus();
538
537
  break;
539
538
  }
540
539
  }
541
540
  }
542
541
  }), u.addEventListener("focus", () => {
543
542
  document.querySelectorAll(
544
- oe(o)
543
+ se(o)
545
544
  ).forEach((I) => {
546
545
  I.classList.add("highlight-focused");
547
546
  });
548
547
  }), u.addEventListener("blur", () => {
549
548
  document.querySelectorAll(
550
- oe(o)
549
+ se(o)
551
550
  ).forEach((I) => {
552
551
  I.classList.remove("highlight-focused");
553
552
  });
554
553
  });
555
554
  };
556
- function Ot(n, e) {
557
- const t = n.type === w.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, r = n.id === n.selectedNoteId ? t : Te(t, 0.5);
555
+ function Pt(t, e) {
556
+ const n = t.type === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground, r = t.id === t.selectedNoteId ? n : we(n, 0.5);
558
557
  document.querySelectorAll(
559
- oe(n.id ?? "")
558
+ se(t.id ?? "")
560
559
  ).forEach((l) => {
561
560
  l.style.backgroundColor = r;
562
561
  });
563
562
  }
564
- const Rt = (n) => {
565
- const e = n.id ?? "", t = document.getElementById(ve(e)), o = document.getElementById(Ue(e));
563
+ const Lt = (t) => {
564
+ const e = t.id ?? "", n = document.getElementById(xe(e)), o = document.getElementById(qe(e));
566
565
  document.querySelectorAll(
567
- oe(e)
566
+ se(e)
568
567
  ).forEach((i) => {
569
568
  var l;
570
569
  for (; i.firstChild; )
571
570
  (l = i.parentNode) == null || l.insertBefore(i.firstChild, i);
572
571
  i.remove();
573
- }), t == null || t.remove(), o == null || o.remove();
574
- }, ne = {
572
+ }), n == null || n.remove(), o == null || o.remove();
573
+ }, oe = {
575
574
  all: ["notebook"],
576
- notes: (n) => ["notebook", "notes", n]
575
+ notes: (t) => ["notebook", "notes", t]
577
576
  };
578
- function Dt(n) {
579
- const e = ge();
580
- return pe({
581
- mutationFn: (t) => n.createNote(t),
577
+ function At(t) {
578
+ const e = be();
579
+ return Ee({
580
+ mutationFn: (n) => t.createNote(n),
582
581
  onSuccess: () => {
583
- e.invalidateQueries({ queryKey: ne.all });
582
+ e.invalidateQueries({ queryKey: oe.all });
584
583
  }
585
584
  });
586
585
  }
587
- function Lt(n) {
588
- const e = ge();
589
- return pe({
590
- mutationFn: (t) => n.deleteNote(t),
586
+ function Ft(t) {
587
+ const e = be();
588
+ return Ee({
589
+ mutationFn: (n) => t.deleteNote(n),
591
590
  onSuccess: () => {
592
- e.invalidateQueries({ queryKey: ne.all });
591
+ e.invalidateQueries({ queryKey: oe.all });
593
592
  }
594
593
  });
595
594
  }
596
- function $e({
597
- api: n,
595
+ function Ke({
596
+ api: t,
598
597
  enabled: e = !0,
599
- ...t
598
+ ...n
600
599
  }) {
601
- return et({
602
- queryKey: ne.notes(t),
603
- queryFn: () => n.getNotes(t),
600
+ return ot({
601
+ queryKey: oe.notes(n),
602
+ queryFn: () => t.getNotes(n),
604
603
  enabled: e
605
604
  });
606
605
  }
607
- function At(n) {
608
- const e = ge();
609
- return pe({
610
- mutationFn: ({ id: t, input: o }) => n.updateNote(t, o),
611
- onMutate: async ({ id: t, input: o }) => {
612
- await e.cancelQueries({ queryKey: ne.all });
613
- const i = e.getQueryCache().findAll({ queryKey: ne.all }), l = /* @__PURE__ */ new Map();
606
+ function _t(t) {
607
+ const e = be();
608
+ return Ee({
609
+ mutationFn: ({ id: n, input: o }) => t.updateNote(n, o),
610
+ onMutate: async ({ id: n, input: o }) => {
611
+ await e.cancelQueries({ queryKey: oe.all });
612
+ const i = e.getQueryCache().findAll({ queryKey: oe.all }), l = /* @__PURE__ */ new Map();
614
613
  for (const a of i) {
615
614
  const m = a.state.data;
616
615
  m && (l.set(a.queryKey, m), e.setQueryData(a.queryKey, {
617
616
  ...m,
618
617
  notes: m.notes.map(
619
- (d) => d.id === t ? { ...d, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : d
618
+ (c) => c.id === n ? { ...c, ...o, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : c
620
619
  )
621
620
  }));
622
621
  }
623
622
  return { previousData: l };
624
623
  },
625
- onError: (t, o, r) => {
624
+ onError: (n, o, r) => {
626
625
  if (r != null && r.previousData)
627
626
  for (const [i, l] of r.previousData)
628
627
  e.setQueryData(i, l);
629
628
  },
630
629
  onSettled: () => {
631
- e.invalidateQueries({ queryKey: ne.all });
630
+ e.invalidateQueries({ queryKey: oe.all });
632
631
  }
633
632
  });
634
633
  }
635
- const Pt = "Notebook", _t = "Notes", Ft = "Important", Mt = "Unclear", Ht = "Back", Wt = "Edit note", Bt = "Save", zt = "Cancel", jt = "Delete note", Ut = "note", $t = "Add note (optional)", qt = "Remove from Notebook", Gt = "Add a note (optional)", Kt = "Mark important", Xt = "Mark unclear", Qt = "Saved to Notebook.", Vt = "Note updated", Yt = "Note deleted", Zt = "Error saving to Notebook.", Jt = "Error updating note", en = "Note deletion failed", tn = "Loading notes", nn = "Failed to load notes", on = "Start capturing your notes", rn = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", sn = "Nothing here yet", ln = "Adjust your filters or create a new note to get started.", an = "You have no notes for the selected filter", cn = "Previous page", dn = "Next page", un = "All courses", fn = "All notes", mn = "Close Notebook panel", hn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", gn = "The content you highlighted is no longer available.", Ce = {
636
- notebook: Pt,
637
- notes: _t,
638
- important: Ft,
639
- unclear: Mt,
640
- back: Ht,
641
- editNote: Wt,
642
- save: Bt,
643
- cancel: zt,
644
- deleteNote: jt,
645
- note: Ut,
646
- addNotePrompt: $t,
647
- removeFromNotebook: qt,
648
- addNoteOptional: Gt,
649
- markImportant: Kt,
650
- markUnclear: Xt,
651
- savedToNotebook: Qt,
652
- noteUpdated: Vt,
653
- noteDeleted: Yt,
654
- errorSavingNote: Zt,
655
- errorUpdatingNote: Jt,
656
- noteDeletionFailed: en,
657
- loadingNotes: tn,
658
- failedToLoadNotes: nn,
659
- emptyStateHeading: on,
660
- emptyStateDescription: rn,
661
- nothingHereYet: sn,
662
- adjustFiltersOrCreate: ln,
663
- noNotesForFilter: an,
664
- previousPage: cn,
665
- nextPage: dn,
666
- allCourses: un,
667
- allNotes: fn,
668
- closeNotebookPanel: mn,
669
- featureDescription: hn,
670
- highlightUnavailable: gn
671
- }, qe = Pe(null);
672
- function Ge(n, e) {
673
- const t = Ce[n] ?? n;
674
- return e ? t.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : t;
634
+ const Mt = "Notebook", Bt = "Notes", Ht = "Important", jt = "Unclear", zt = "Back", $t = "Edit note", Wt = "Save", Gt = "Cancel", Ut = "Delete note", qt = "note", Kt = "Add note (optional)", Xt = "Remove from Notebook", Qt = "Add a note (optional)", Vt = "Mark important", Yt = "Mark unclear", Zt = "Saved to Notebook.", Jt = "Note updated", en = "Note deleted", tn = "Error saving to Notebook.", nn = "Error updating note", on = "Note deletion failed", rn = "Loading notes", sn = "Failed to load notes", ln = "Start capturing your notes", an = "Your notes from learning materials will appear here. Highlight key ideas, reflections, or questions as you learn—they'll all be saved in your Notebook for easy review later.", cn = "Nothing here yet", dn = "Adjust your filters or create a new note to get started.", un = "You have no notes for the selected filter", fn = "Previous page", mn = "Next page", gn = "All courses", hn = "All notes", pn = "Close Notebook panel", Nn = "To use the Notebook feature, highlight an excerpt from your learning material to flag it as 'confusing' or 'important' and leave an optional note.", yn = "The content you highlighted is no longer available.", ke = {
635
+ notebook: Mt,
636
+ notes: Bt,
637
+ important: Ht,
638
+ unclear: jt,
639
+ back: zt,
640
+ editNote: $t,
641
+ save: Wt,
642
+ cancel: Gt,
643
+ deleteNote: Ut,
644
+ note: qt,
645
+ addNotePrompt: Kt,
646
+ removeFromNotebook: Xt,
647
+ addNoteOptional: Qt,
648
+ markImportant: Vt,
649
+ markUnclear: Yt,
650
+ savedToNotebook: Zt,
651
+ noteUpdated: Jt,
652
+ noteDeleted: en,
653
+ errorSavingNote: tn,
654
+ errorUpdatingNote: nn,
655
+ noteDeletionFailed: on,
656
+ loadingNotes: rn,
657
+ failedToLoadNotes: sn,
658
+ emptyStateHeading: ln,
659
+ emptyStateDescription: an,
660
+ nothingHereYet: cn,
661
+ adjustFiltersOrCreate: dn,
662
+ noNotesForFilter: un,
663
+ previousPage: fn,
664
+ nextPage: mn,
665
+ allCourses: gn,
666
+ allNotes: hn,
667
+ closeNotebookPanel: pn,
668
+ featureDescription: Nn,
669
+ highlightUnavailable: yn
670
+ }, Xe = Be(null);
671
+ function Qe(t, e) {
672
+ const n = ke[t] ?? t;
673
+ return e ? n.replace(/%\{([^}]+)}/g, (o, r) => String(e[r] ?? `%{${r}}`)) : n;
675
674
  }
676
- function pn({
677
- translations: n,
675
+ function bn({
676
+ translations: t,
678
677
  translate: e,
679
- children: t
678
+ children: n
680
679
  }) {
681
- const o = re(
680
+ const o = ie(
682
681
  () => ({
683
- translations: { ...Ce, ...n },
684
- translate: e ?? Ge
682
+ translations: { ...ke, ...t },
683
+ translate: e ?? Qe
685
684
  }),
686
- [n, e]
685
+ [t, e]
687
686
  );
688
- return /* @__PURE__ */ s(qe.Provider, { value: o, children: t });
687
+ return /* @__PURE__ */ s(Xe.Provider, { value: o, children: n });
689
688
  }
690
- function G() {
691
- const n = _e(qe);
692
- return n || { translations: Ce, translate: Ge };
689
+ function Q() {
690
+ const t = He(Xe);
691
+ return t || { translations: ke, translate: Qe };
693
692
  }
694
- const Nn = {
695
- selectedNoteId: null,
693
+ const En = (t) => ({
694
+ selectedNoteId: t ?? null,
696
695
  isNoteEditing: !1,
697
- isTrayOpen: !1
698
- };
699
- function bn(n, e) {
696
+ isTrayOpen: t != null
697
+ });
698
+ function Sn(t, e) {
700
699
  switch (e.type) {
701
700
  case "SELECT_NOTE":
702
701
  return {
703
- ...n,
702
+ ...t,
704
703
  selectedNoteId: e.payload.id,
705
704
  isNoteEditing: e.payload.isEditing
706
705
  };
707
706
  case "CLEAR_SELECTED_NOTE":
708
- return { ...n, selectedNoteId: null, isNoteEditing: !1 };
707
+ return { ...t, selectedNoteId: null, isNoteEditing: !1 };
709
708
  case "SET_EDITING":
710
- return { ...n, isNoteEditing: e.payload };
709
+ return { ...t, isNoteEditing: e.payload };
711
710
  case "OPEN_TRAY":
712
- return { ...n, isTrayOpen: !0 };
711
+ return { ...t, isTrayOpen: !0 };
713
712
  case "CLOSE_TRAY":
714
- return { ...n, isTrayOpen: !1, selectedNoteId: null, isNoteEditing: !1 };
713
+ return { ...t, isTrayOpen: !1, selectedNoteId: null, isNoteEditing: !1 };
715
714
  default:
716
- return n;
715
+ return t;
717
716
  }
718
717
  }
719
- const Ke = Pe(null);
720
- function Qn({
721
- api: n,
718
+ const Ve = Be(null);
719
+ function Jn({
720
+ api: t,
722
721
  currentUserId: e,
723
- objectId: t,
722
+ objectId: n,
724
723
  objectType: o,
725
724
  courseId: r,
726
725
  pageLastModifiedAt: i,
727
726
  onAnalyticsEvent: l,
728
727
  onOpen: a,
729
- translations: m,
730
- translate: d,
728
+ initialNoteId: m,
729
+ translations: c,
730
+ translate: h,
731
731
  children: g
732
732
  }) {
733
- const [h, u] = Fe(bn, Nn), S = V(!1), f = re(
733
+ const [u, p] = je(Sn, En(m)), y = J(m != null), T = ie(
734
734
  () => ({
735
- api: n,
735
+ api: t,
736
736
  currentUserId: e,
737
- objectId: t,
737
+ objectId: n,
738
738
  objectType: o,
739
739
  courseId: r,
740
740
  pageLastModifiedAt: i,
741
741
  onAnalyticsEvent: l,
742
- ...h,
743
- selectNote: (y, E = !1) => u({ type: "SELECT_NOTE", payload: { id: y, isEditing: E } }),
744
- clearSelectedNote: () => u({ type: "CLEAR_SELECTED_NOTE" }),
745
- setEditing: (y) => u({ type: "SET_EDITING", payload: y }),
742
+ ...u,
743
+ selectNote: (N, O = !1) => p({ type: "SELECT_NOTE", payload: { id: N, isEditing: O } }),
744
+ clearSelectedNote: () => p({ type: "CLEAR_SELECTED_NOTE" }),
745
+ setEditing: (N) => p({ type: "SET_EDITING", payload: N }),
746
746
  openTray: () => {
747
- S.current || (S.current = !0, a == null || a()), u({ type: "OPEN_TRAY" });
747
+ y.current || (y.current = !0, a == null || a()), p({ type: "OPEN_TRAY" });
748
748
  },
749
749
  closeTray: () => {
750
- S.current = !1, u({ type: "CLOSE_TRAY" });
750
+ y.current = !1, p({ type: "CLOSE_TRAY" });
751
751
  }
752
752
  }),
753
753
  [
754
- n,
755
- e,
756
754
  t,
755
+ e,
756
+ n,
757
757
  o,
758
758
  r,
759
759
  i,
760
760
  l,
761
761
  a,
762
- h
762
+ u
763
763
  ]
764
764
  );
765
- return /* @__PURE__ */ s(Ke.Provider, { value: f, children: /* @__PURE__ */ s(pn, { translations: m, translate: d, children: g }) });
765
+ return /* @__PURE__ */ s(Ve.Provider, { value: T, children: /* @__PURE__ */ s(bn, { translations: c, translate: h, children: g }) });
766
766
  }
767
- function Xe() {
768
- const n = _e(Ke);
769
- if (!n)
767
+ function Ye() {
768
+ const t = He(Ve);
769
+ if (!t)
770
770
  throw new Error("useNotebook must be used within a NotebookProvider");
771
- return n;
771
+ return t;
772
772
  }
773
- const yn = ({ currentType: n, onSelectReaction: e }) => {
774
- const { translations: t } = G(), o = V(null), r = V(null);
775
- return ee(() => {
776
- n === w.CONFUSING && o.current ? o.current.focus() : n === w.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
777
- }, [n]), /* @__PURE__ */ s(
773
+ const Tn = ({ currentType: t, onSelectReaction: e }) => {
774
+ const { translations: n } = Q(), o = J(null), r = J(null);
775
+ return Z(() => {
776
+ t === k.CONFUSING && o.current ? o.current.focus() : t === k.IMPORTANT && r.current ? r.current.focus() : o.current && o.current.focus();
777
+ }, [t]), /* @__PURE__ */ s(
778
778
  z,
779
779
  {
780
780
  as: "div",
@@ -783,221 +783,225 @@ const yn = ({ currentType: n, onSelectReaction: e }) => {
783
783
  borderColor: "secondary",
784
784
  borderRadius: "medium",
785
785
  shadow: "resting",
786
- children: /* @__PURE__ */ T(te, { children: [
787
- /* @__PURE__ */ T(
788
- te.Item,
786
+ children: /* @__PURE__ */ E(ne, { children: [
787
+ /* @__PURE__ */ E(
788
+ ne.Item,
789
789
  {
790
790
  ref: o,
791
- onClick: () => e(w.CONFUSING),
791
+ onClick: () => e(k.CONFUSING),
792
792
  children: [
793
- /* @__PURE__ */ s(Ne, { size: "x-small" }),
794
- ` ${t.markUnclear}`
793
+ /* @__PURE__ */ s(Se, { size: "x-small" }),
794
+ ` ${n.markUnclear}`
795
795
  ]
796
796
  }
797
797
  ),
798
- /* @__PURE__ */ T(
799
- te.Item,
798
+ /* @__PURE__ */ E(
799
+ ne.Item,
800
800
  {
801
801
  ref: r,
802
- onClick: () => e(w.IMPORTANT),
802
+ onClick: () => e(k.IMPORTANT),
803
803
  children: [
804
- /* @__PURE__ */ s(be, { size: "x-small" }),
805
- ` ${t.markImportant}`
804
+ /* @__PURE__ */ s(Te, { size: "x-small" }),
805
+ ` ${n.markImportant}`
806
806
  ]
807
807
  }
808
808
  )
809
809
  ] })
810
810
  }
811
811
  );
812
- }, de = "notebook-inline-reaction-menu";
813
- function Vn({
814
- containerRef: n,
812
+ }, ge = "notebook-inline-reaction-menu";
813
+ function eo({
814
+ containerRef: t,
815
815
  highlightTheme: e,
816
- debounceTime: t = 500
816
+ debounceTime: n = 500,
817
+ onCreateError: o,
818
+ onUpdateError: r,
819
+ onDeleteError: i
817
820
  }) {
818
821
  const {
819
- api: o,
820
- objectId: r,
821
- objectType: i,
822
- courseId: l,
823
- pageLastModifiedAt: a,
824
- selectedNoteId: m,
825
- selectNote: d,
826
- openTray: g
827
- } = Xe(), { data: h } = $e({
828
- api: o,
822
+ api: l,
823
+ objectId: a,
824
+ objectType: m,
825
+ courseId: c,
826
+ pageLastModifiedAt: h,
827
+ selectedNoteId: g,
828
+ selectNote: u,
829
+ openTray: p
830
+ } = Ye(), { data: y } = Ke({
831
+ api: l,
829
832
  filter: {
830
- learningObject: { type: i, id: r }
833
+ learningObject: { type: m, id: a }
831
834
  },
832
- courseId: l,
835
+ courseId: c,
833
836
  pageSize: 100
834
- }), { mutate: u } = Dt(o), { mutate: S } = At(o), { mutate: f } = Lt(o), y = V([]), [E, H] = W([]), [M, N] = W(null), [I, k] = W(""), [x, O] = W(null), [_, F] = W(!1);
835
- ee(() => {
836
- const R = n.current;
837
- if (!R) return;
838
- const b = R.closest(".user_content") ?? R;
839
- if (b.classList.contains("enhanced")) {
840
- F(!0);
837
+ }), { mutate: T } = At(l), { mutateAsync: N } = _t(l), { mutate: O } = Ft(l), L = J([]), [b, I] = H([]), [R, C] = H(null), [B, x] = H(""), [A, w] = H(null), [G, te] = H(!1);
838
+ Z(() => {
839
+ const D = t.current;
840
+ if (!D) return;
841
+ const f = D.closest(".user_content") ?? D;
842
+ if (f.classList.contains("enhanced")) {
843
+ te(!0);
841
844
  return;
842
845
  }
843
- const P = new MutationObserver((L) => {
844
- for (const p of L)
845
- if (p.type === "attributes" && p.attributeName === "class" && p.target.classList.contains("enhanced")) {
846
- F(!0), P.disconnect();
846
+ const F = new MutationObserver((_) => {
847
+ for (const M of _)
848
+ if (M.type === "attributes" && M.attributeName === "class" && M.target.classList.contains("enhanced")) {
849
+ te(!0), F.disconnect();
847
850
  return;
848
851
  }
849
852
  });
850
- return P.observe(b, { attributes: !0, attributeFilter: ["class"] }), () => P.disconnect();
851
- }, [n]), ee(() => {
852
- if (!_ || !n.current) return;
853
- let b = null;
854
- const P = () => {
855
- b && clearTimeout(b), b = setTimeout(() => {
856
- var xe;
857
- const v = window.getSelection(), A = n.current;
858
- if (!(v != null && v.rangeCount) || !A) return;
859
- const j = v.toString().trim();
860
- if (j === "") return;
861
- const J = v.getRangeAt(0);
862
- if (!A.contains(J.commonAncestorContainer)) return;
863
- const Ie = (xe = X.fromRange(A, J)) == null ? void 0 : xe.toSelector();
864
- Ie && !It(Ie, E) && (N(J.cloneRange()), k(j), O(Ct(J)));
865
- }, t);
866
- }, L = (v) => {
853
+ return F.observe(f, { attributes: !0, attributeFilter: ["class"] }), () => F.disconnect();
854
+ }, [t]), Z(() => {
855
+ if (!G || !t.current) return;
856
+ let f = null;
857
+ const F = () => {
858
+ f && clearTimeout(f), f = setTimeout(() => {
859
+ var Re;
860
+ const v = window.getSelection(), P = t.current;
861
+ if (!(v != null && v.rangeCount) || !P) return;
862
+ const W = v.toString().trim();
863
+ if (W === "") return;
864
+ const V = v.getRangeAt(0);
865
+ if (!P.contains(V.commonAncestorContainer)) return;
866
+ const Oe = (Re = Y.fromRange(P, V)) == null ? void 0 : Re.toSelector();
867
+ Oe && !kt(Oe, b) && (C(V.cloneRange()), x(W), w(wt(V)));
868
+ }, n);
869
+ }, _ = (v) => {
867
870
  if (!(v.target instanceof Node)) return;
868
- const A = document.getElementById(de);
869
- A != null && A.contains(v.target) ? (v.preventDefault(), v.stopImmediatePropagation()) : (O(null), N(null), k(""));
870
- }, p = () => {
871
- O(null), N(null), k("");
871
+ const P = document.getElementById(ge);
872
+ P != null && P.contains(v.target) ? (v.preventDefault(), v.stopImmediatePropagation()) : (w(null), C(null), x(""));
873
+ }, M = () => {
874
+ w(null), C(null), x("");
872
875
  };
873
- return document.addEventListener("selectionchange", P), document.addEventListener("mousedown", L), document.addEventListener("touchstart", L), window.addEventListener("scroll", p, !0), () => {
874
- b && clearTimeout(b), document.removeEventListener("selectionchange", P), document.removeEventListener("mousedown", L), document.removeEventListener("touchstart", L), window.removeEventListener("scroll", p, !0);
876
+ return document.addEventListener("selectionchange", F), document.addEventListener("mousedown", _), document.addEventListener("touchstart", _), window.addEventListener("scroll", M, !0), () => {
877
+ f && clearTimeout(f), document.removeEventListener("selectionchange", F), document.removeEventListener("mousedown", _), document.removeEventListener("touchstart", _), window.removeEventListener("scroll", M, !0);
875
878
  };
876
- }, [_, E, t, n]);
877
- const D = K(
878
- (R) => {
879
- var j;
880
- const b = n.current;
881
- if (!b || !R.highlightData) return null;
882
- const { highlightData: P, reaction: L, id: p } = R, { range: v } = P, A = v && ((j = Y.fromSelector(b, v)) == null ? void 0 : j.toRange());
883
- if (A) {
884
- const J = {
885
- id: p,
886
- selectedNoteId: m,
887
- type: L[0],
879
+ }, [G, b, n, t]);
880
+ const $ = q(
881
+ (D) => {
882
+ var W;
883
+ const f = t.current;
884
+ if (!f || !D.highlightData) return null;
885
+ const { highlightData: F, reaction: _, id: M } = D, { range: v } = F, P = v && ((W = ee.fromSelector(f, v)) == null ? void 0 : W.toRange());
886
+ if (P) {
887
+ const V = {
888
+ id: M,
889
+ selectedNoteId: g,
890
+ type: _[0],
888
891
  onClick: () => {
889
- d(p), g();
892
+ u(M), p();
890
893
  }
891
894
  };
892
- return kt(A, J, e), P.textPosition;
895
+ return Dt(P, V, e), F.textPosition;
893
896
  }
894
897
  return null;
895
898
  },
896
- [n, m, e, d, g]
899
+ [t, g, e, u, p]
897
900
  );
898
- ee(() => {
899
- if (!_ || !h || !n.current) return;
900
- const R = n.current, b = h.notes, P = /* @__PURE__ */ new Set(), L = [], p = [];
901
- if (b.length === 0) {
902
- if (y.current.length > 0) {
903
- for (const v of y.current)
904
- Le(v, R);
905
- y.current = [], H([]);
901
+ Z(() => {
902
+ if (!G || !y || !t.current) return;
903
+ const D = t.current, f = y.notes, F = /* @__PURE__ */ new Set(), _ = [], M = [];
904
+ if (f.length === 0) {
905
+ if (L.current.length > 0) {
906
+ for (const v of L.current)
907
+ _e(v, D);
908
+ L.current = [], I([]);
906
909
  }
907
910
  return;
908
911
  }
909
- if (a && b[0].highlightData.pageLastModifiedAt !== a) {
910
- const { notesForUpdate: v, noteIdsForDelete: A } = vt(
911
- R,
912
- b,
913
- a
912
+ if (h && f[0].highlightData.pageLastModifiedAt !== h) {
913
+ const { notesForUpdate: v, noteIdsForDelete: P } = It(
914
+ D,
915
+ f,
916
+ h
914
917
  );
915
- for (const j of v)
916
- S({ id: j.id, input: j });
917
- for (const j of A)
918
- f(j);
918
+ for (const W of v)
919
+ N({ id: W.id, input: W }).catch((V) => r == null ? void 0 : r(V));
920
+ for (const W of P)
921
+ O(W, { onError: i });
919
922
  } else {
920
- for (const v of b) {
921
- const A = D(v);
922
- P.add(v.id), A && (L.push(v), p.push(A));
923
+ for (const v of f) {
924
+ const P = $(v);
925
+ F.add(v.id), P && (_.push(v), M.push(P));
923
926
  }
924
- for (const v of y.current)
925
- P.has(v.id) || Le(v, R);
926
- H(p), y.current = L, m && Tt(m);
927
+ for (const v of L.current)
928
+ F.has(v.id) || _e(v, D);
929
+ I(M), L.current = _, g && xt(g);
927
930
  }
928
931
  }, [
929
- _,
932
+ G,
933
+ y,
934
+ $,
930
935
  h,
931
- D,
932
- a,
933
- n,
934
- S,
935
- f,
936
- m
936
+ t,
937
+ N,
938
+ O,
939
+ g
937
940
  ]);
938
- const Z = (R) => {
939
- const b = n.current;
940
- if (!M || !b) return;
941
- const P = Y.fromRange(b, M), L = X.fromRange(b, M);
942
- u(
941
+ const le = (D) => {
942
+ const f = t.current;
943
+ if (!R || !f) return;
944
+ const F = ee.fromRange(f, R), _ = Y.fromRange(f, R);
945
+ T(
943
946
  {
944
- courseId: l,
945
- objectId: r,
946
- objectType: i,
947
+ courseId: c,
948
+ objectId: a,
949
+ objectType: m,
947
950
  userText: "",
948
- reaction: [R],
951
+ reaction: [D],
949
952
  highlightData: {
950
- selectedText: I,
951
- textPosition: (L == null ? void 0 : L.toSelector()) ?? null,
952
- range: P.toSelector(),
953
- pageLastModifiedAt: a ?? ""
953
+ selectedText: B,
954
+ textPosition: (_ == null ? void 0 : _.toSelector()) ?? null,
955
+ range: F.toSelector(),
956
+ pageLastModifiedAt: h ?? ""
954
957
  }
955
958
  },
956
959
  {
957
- onSuccess: (p) => {
958
- var A;
959
- const v = p.id;
960
- N(null), k(""), O(null), (A = window.getSelection()) == null || A.removeAllRanges(), d(v), g();
961
- }
960
+ onSuccess: (M) => {
961
+ var P;
962
+ const v = M.id;
963
+ C(null), x(""), w(null), (P = window.getSelection()) == null || P.removeAllRanges(), u(v), p();
964
+ },
965
+ onError: o
962
966
  }
963
967
  );
964
968
  };
965
- return !M || !x ? null : Ze(
969
+ return !R || !A ? null : tt(
966
970
  /* @__PURE__ */ s(
967
971
  "div",
968
972
  {
969
- id: de,
973
+ id: ge,
970
974
  role: "toolbar",
971
975
  style: {
972
976
  position: "fixed",
973
977
  zIndex: 100,
974
- top: x.top,
975
- left: x.left,
978
+ top: A.top,
979
+ left: A.left,
976
980
  whiteSpace: "nowrap"
977
981
  },
978
- onBlur: (R) => {
979
- const b = document.getElementById(de);
980
- b != null && b.contains(R.relatedTarget) || (O(null), N(null), k(""));
982
+ onBlur: (D) => {
983
+ const f = document.getElementById(ge);
984
+ f != null && f.contains(D.relatedTarget) || (w(null), C(null), x(""));
981
985
  },
982
- children: /* @__PURE__ */ s(yn, { onSelectReaction: Z })
986
+ children: /* @__PURE__ */ s(Tn, { onSelectReaction: le })
983
987
  }
984
988
  ),
985
989
  document.body
986
990
  );
987
991
  }
988
- const En = (n, e) => ({
989
- backgroundColor: n === w.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
990
- underlineColor: n === w.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
991
- underlineStyle: n === w.IMPORTANT ? "solid" : "dashed"
992
- }), he = ({
993
- children: n,
994
- type: e = w.IMPORTANT,
995
- isCardActive: t = !0,
992
+ const vn = (t, e) => ({
993
+ backgroundColor: t === k.IMPORTANT ? e.colors.importantBackground : e.colors.confusingBackground,
994
+ underlineColor: t === k.IMPORTANT ? e.colors.importantUnderline : e.colors.confusingUnderline,
995
+ underlineStyle: t === k.IMPORTANT ? "solid" : "dashed"
996
+ }), ye = ({
997
+ children: t,
998
+ type: e = k.IMPORTANT,
999
+ isCardActive: n = !0,
996
1000
  theme: o
997
1001
  }) => {
998
- const r = En(e, o), l = {
1002
+ const r = vn(e, o), l = {
999
1003
  position: "relative",
1000
- backgroundColor: t ? r.backgroundColor : Te(r.backgroundColor, 0.5),
1004
+ backgroundColor: n ? r.backgroundColor : we(r.backgroundColor, 0.5),
1001
1005
  textDecorationLine: "underline",
1002
1006
  textDecorationStyle: r.underlineStyle,
1003
1007
  textDecorationColor: r.underlineColor,
@@ -1005,222 +1009,245 @@ const En = (n, e) => ({
1005
1009
  textUnderlineOffset: o.underlineOffset,
1006
1010
  lineHeight: "normal"
1007
1011
  };
1008
- return /* @__PURE__ */ s("span", { "data-note-highlight": "true", style: l, children: n });
1009
- }, Qe = () => {
1010
- const { translations: n } = G();
1011
- return /* @__PURE__ */ T(C, { gap: "xx-small", alignItems: "start", as: "div", children: [
1012
- /* @__PURE__ */ s(C.Item, { as: "div", children: /* @__PURE__ */ s(tt, { color: "error" }) }),
1013
- /* @__PURE__ */ s(C.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ s(me, { maxLines: 3, children: n.highlightUnavailable }) })
1012
+ return /* @__PURE__ */ s("span", { "data-note-highlight": "true", style: l, children: t });
1013
+ }, Ze = () => {
1014
+ const { translations: t } = Q();
1015
+ return /* @__PURE__ */ E(S, { gap: "xx-small", alignItems: "start", as: "div", children: [
1016
+ /* @__PURE__ */ s(S.Item, { as: "div", children: /* @__PURE__ */ s(rt, { color: "error" }) }),
1017
+ /* @__PURE__ */ s(S.Item, { padding: "xxx-small none", shouldShrink: !0, children: /* @__PURE__ */ s(Ne, { maxLines: 3, children: t.highlightUnavailable }) })
1014
1018
  ] });
1015
- }, Sn = {
1019
+ }, Cn = {
1016
1020
  filter: null,
1017
1021
  courseFilter: null,
1018
- pageParamsWithDirection: {}
1022
+ currentPage: 1,
1023
+ totalPages: void 0
1019
1024
  };
1020
- function vn(n, e) {
1025
+ function de(t, e) {
1026
+ const n = typeof e == "number" ? Math.min(e, t) : t;
1027
+ return Math.max(1, n);
1028
+ }
1029
+ function In(t, e) {
1021
1030
  switch (e.type) {
1022
1031
  case "SET_FILTER":
1023
- return { ...n, filter: e.payload, pageParamsWithDirection: {} };
1032
+ return { ...t, filter: e.payload, currentPage: 1 };
1024
1033
  case "SET_COURSE_FILTER":
1025
- return { ...n, courseFilter: e.payload, pageParamsWithDirection: {} };
1026
- case "SET_PAGE_PARAMS_WITH_DIRECTION":
1027
- return { ...n, pageParamsWithDirection: e.payload };
1034
+ return { ...t, courseFilter: e.payload, currentPage: 1 };
1035
+ case "SET_PAGE":
1036
+ return { ...t, currentPage: de(e.payload, t.totalPages) };
1037
+ case "INCREMENT_PAGE":
1038
+ return { ...t, currentPage: de(t.currentPage + 1, t.totalPages) };
1039
+ case "DECREMENT_PAGE":
1040
+ return { ...t, currentPage: de(t.currentPage - 1, t.totalPages) };
1041
+ case "SET_TOTAL_PAGES":
1042
+ return t.totalPages === e.payload ? t : {
1043
+ ...t,
1044
+ totalPages: e.payload,
1045
+ currentPage: de(t.currentPage, e.payload)
1046
+ };
1028
1047
  default:
1029
- return n;
1048
+ return t;
1030
1049
  }
1031
1050
  }
1032
- function Yn({
1033
- api: n,
1051
+ function to({
1052
+ api: t,
1034
1053
  courseId: e,
1035
- enableCourseFilter: t = !1,
1054
+ enableCourseFilter: n = !1,
1036
1055
  learningObject: o,
1037
1056
  pageSize: r = 16
1038
1057
  }) {
1039
- const [i, l] = Fe(vn, Sn), { filter: a, courseFilter: m, pageParamsWithDirection: d } = i;
1040
- ee(() => {
1041
- Object.keys(d).length > 0 && l({ type: "SET_PAGE_PARAMS_WITH_DIRECTION", payload: {} });
1058
+ const [i, l] = je(In, Cn), { filter: a, courseFilter: m, currentPage: c, totalPages: h } = i;
1059
+ Z(() => {
1060
+ l({ type: "SET_PAGE", payload: 1 });
1042
1061
  }, [r]);
1043
- const g = t ? m : e, { direction: h, pageParams: u } = d, S = h === "next" ? (u == null ? void 0 : u.endCursor) ?? void 0 : h === "prev" ? (u == null ? void 0 : u.startCursor) ?? void 0 : void 0, { data: f, isLoading: y, isError: E } = $e({
1044
- api: n,
1062
+ const g = n ? m : e, u = (c - 1) * r, { data: p, isLoading: y, isError: T } = Ke({
1063
+ api: t,
1045
1064
  filter: {
1046
1065
  ...g ? { courseId: g } : {},
1047
1066
  ...a ? { reactions: [a] } : {},
1048
1067
  ...o ? { learningObject: o } : {}
1049
1068
  },
1050
- cursor: S,
1051
- direction: h,
1069
+ offset: u,
1052
1070
  pageSize: r
1053
- }), H = (f == null ? void 0 : f.notes) ?? [], M = f == null ? void 0 : f.pageInfo, N = K(() => {
1071
+ }), N = (p == null ? void 0 : p.notes) ?? [], O = p == null ? void 0 : p.pageInfo, L = (O == null ? void 0 : O.totalNrOfPages) ?? void 0;
1072
+ Z(() => {
1073
+ l({ type: "SET_TOTAL_PAGES", payload: L });
1074
+ }, [L]);
1075
+ const b = q((x) => {
1076
+ l({ type: "SET_PAGE", payload: x });
1077
+ }, []), I = q(() => {
1054
1078
  l({
1055
- type: "SET_PAGE_PARAMS_WITH_DIRECTION",
1056
- payload: { pageParams: f == null ? void 0 : f.pageInfo, direction: "next" }
1079
+ type: "INCREMENT_PAGE"
1080
+ /* IncrementPage */
1057
1081
  });
1058
- }, [f == null ? void 0 : f.pageInfo]), I = K(() => {
1082
+ }, []), R = q(() => {
1059
1083
  l({
1060
- type: "SET_PAGE_PARAMS_WITH_DIRECTION",
1061
- payload: { pageParams: f == null ? void 0 : f.pageInfo, direction: "prev" }
1084
+ type: "DECREMENT_PAGE"
1085
+ /* DecrementPage */
1062
1086
  });
1063
- }, [f == null ? void 0 : f.pageInfo]), k = K((O) => {
1064
- l({ type: "SET_FILTER", payload: O });
1065
- }, []), x = K((O) => {
1066
- l({ type: "SET_COURSE_FILTER", payload: O });
1087
+ }, []), C = q((x) => {
1088
+ l({ type: "SET_FILTER", payload: x });
1089
+ }, []), B = q((x) => {
1090
+ l({ type: "SET_COURSE_FILTER", payload: x });
1067
1091
  }, []);
1068
1092
  return {
1069
- notes: H,
1070
- pageInfo: M,
1093
+ notes: N,
1094
+ pageInfo: O,
1071
1095
  isLoading: y,
1072
- isError: E,
1096
+ isError: T,
1073
1097
  filter: a,
1074
1098
  courseFilter: m,
1075
- setFilter: k,
1076
- setCourseFilter: x,
1077
- fetchNextPage: N,
1078
- fetchPreviousPage: I
1099
+ currentPage: c,
1100
+ totalPages: h,
1101
+ setFilter: C,
1102
+ setCourseFilter: B,
1103
+ setPage: b,
1104
+ fetchNextPage: I,
1105
+ fetchPreviousPage: R
1079
1106
  };
1080
1107
  }
1081
- const ue = "all";
1082
- function Zn({ filter: n, setFilter: e }) {
1083
- const { translations: t } = G(), o = re(
1108
+ const he = "all";
1109
+ function no({ filter: t, setFilter: e }) {
1110
+ const { translations: n } = Q(), o = ie(
1084
1111
  () => [
1085
- { label: t.allNotes, value: ue },
1086
- { label: t.important, value: w.IMPORTANT },
1087
- { label: t.unclear, value: w.CONFUSING }
1112
+ { label: n.allNotes, value: he },
1113
+ { label: n.important, value: k.IMPORTANT },
1114
+ { label: n.unclear, value: k.CONFUSING }
1088
1115
  ],
1089
- [t]
1090
- ), r = K(
1116
+ [n]
1117
+ ), r = q(
1091
1118
  (l, { value: a }) => {
1092
- e(!a || a === ue ? null : a);
1119
+ e(!a || a === he ? null : a);
1093
1120
  },
1094
1121
  [e]
1095
1122
  );
1096
1123
  return {
1097
- filterElement: re(
1124
+ filterElement: ie(
1098
1125
  () => /* @__PURE__ */ s(
1099
- we,
1126
+ De,
1100
1127
  {
1101
- renderLabel: /* @__PURE__ */ s(Me, { children: t.notes }),
1102
- value: n ?? ue,
1128
+ renderLabel: /* @__PURE__ */ s(ze, { children: n.notes }),
1129
+ value: t ?? he,
1103
1130
  onChange: r,
1104
- children: o.map((l) => /* @__PURE__ */ s(we.Option, { id: l.value, value: l.value, children: l.label }, l.value))
1131
+ children: o.map((l) => /* @__PURE__ */ s(De.Option, { id: l.value, value: l.value, children: l.label }, l.value))
1105
1132
  }
1106
1133
  ),
1107
- [n, o, r, t.notes]
1134
+ [t, o, r, n.notes]
1108
1135
  ),
1109
1136
  reactionFilterOptions: o,
1110
1137
  handleReactionFilterChange: r
1111
1138
  };
1112
1139
  }
1113
- const Tn = ({ hasActiveFilter: n = !1 }) => {
1114
- const { translations: e } = G(), t = n ? e.nothingHereYet : e.emptyStateHeading, o = n ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1115
- return /* @__PURE__ */ s(z, { as: "div", textAlign: "center", children: /* @__PURE__ */ T(C, { direction: "column", alignItems: "center", gap: "small", children: [
1116
- !n && /* @__PURE__ */ s(nt, { size: "medium" }),
1117
- /* @__PURE__ */ s(ae, { level: "h3", children: t }),
1140
+ const xn = ({ hasActiveFilter: t = !1 }) => {
1141
+ const { translations: e } = Q(), n = t ? e.nothingHereYet : e.emptyStateHeading, o = t ? e.adjustFiltersOrCreate : e.emptyStateDescription;
1142
+ return /* @__PURE__ */ s(z, { as: "div", textAlign: "center", children: /* @__PURE__ */ E(S, { direction: "column", alignItems: "center", gap: "small", children: [
1143
+ !t && /* @__PURE__ */ s(st, { size: "medium" }),
1144
+ /* @__PURE__ */ s(fe, { level: "h3", children: n }),
1118
1145
  /* @__PURE__ */ s(U, { color: "secondary", children: o })
1119
1146
  ] }) });
1120
- }, Jn = ({ children: n }) => {
1121
- const { isTrayOpen: e, closeTray: t } = Xe(), { translations: o } = G();
1147
+ }, oo = ({ children: t }) => {
1148
+ const { isTrayOpen: e, closeTray: n } = Ye(), { translations: o } = Q();
1122
1149
  return /* @__PURE__ */ s(
1123
- lt,
1150
+ at,
1124
1151
  {
1125
1152
  label: o.notebook,
1126
1153
  open: e,
1127
- onDismiss: t,
1154
+ onDismiss: n,
1128
1155
  placement: "end",
1129
1156
  size: "regular",
1130
- children: /* @__PURE__ */ T(C, { direction: "column", height: "100vh", children: [
1131
- /* @__PURE__ */ s(C.Item, { children: /* @__PURE__ */ s(z, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ T(C, { justifyItems: "space-between", alignItems: "center", children: [
1132
- /* @__PURE__ */ s(ae, { level: "h3", children: o.notebook }),
1157
+ children: /* @__PURE__ */ E(S, { direction: "column", height: "100vh", children: [
1158
+ /* @__PURE__ */ s(S.Item, { children: /* @__PURE__ */ s(z, { as: "div", padding: "small medium", borderWidth: "0 0 small 0", children: /* @__PURE__ */ E(S, { justifyItems: "space-between", alignItems: "center", children: [
1159
+ /* @__PURE__ */ s(fe, { level: "h3", children: o.notebook }),
1133
1160
  /* @__PURE__ */ s(
1134
- it,
1161
+ lt,
1135
1162
  {
1136
1163
  screenReaderLabel: o.closeNotebookPanel,
1137
- onClick: t,
1164
+ onClick: n,
1138
1165
  size: "small",
1139
1166
  "data-testid": "notebook-tray-close"
1140
1167
  }
1141
1168
  )
1142
1169
  ] }) }) }),
1143
- /* @__PURE__ */ s(C.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: n })
1170
+ /* @__PURE__ */ s(S.Item, { shouldGrow: !0, shouldShrink: !0, overflowY: "auto", overflowX: "hidden", children: t })
1144
1171
  ] })
1145
1172
  }
1146
1173
  );
1147
- }, Cn = {
1148
- [w.IMPORTANT]: {
1174
+ }, wn = {
1175
+ [k.IMPORTANT]: {
1149
1176
  color: "success",
1150
1177
  translationKey: "important",
1151
- icon: /* @__PURE__ */ s(be, { size: "x-small" })
1178
+ icon: /* @__PURE__ */ s(Te, { size: "x-small" })
1152
1179
  },
1153
- [w.CONFUSING]: {
1180
+ [k.CONFUSING]: {
1154
1181
  color: "danger",
1155
1182
  translationKey: "unclear",
1156
- icon: /* @__PURE__ */ s(Ne, { size: "x-small" })
1183
+ icon: /* @__PURE__ */ s(Se, { size: "x-small" })
1157
1184
  }
1158
- }, Ve = ({ type: n, onTypeChange: e, renderAsMenuTrigger: t = !1 }) => {
1159
- const { translations: o } = G(), r = Cn[n], i = o[r.translationKey], [l, a] = W(!1), m = V(null), d = V(null), g = K(
1160
- (h) => {
1161
- e == null || e(h), a(!1);
1185
+ }, Je = ({ type: t, onTypeChange: e, renderAsMenuTrigger: n = !1 }) => {
1186
+ const { translations: o } = Q(), r = wn[t], i = o[r.translationKey], [l, a] = H(!1), m = J(null), c = J(null), h = q(
1187
+ (g) => {
1188
+ e == null || e(g), a(!1);
1162
1189
  },
1163
1190
  [e]
1164
1191
  );
1165
- return t && e ? /* @__PURE__ */ T(
1166
- te,
1192
+ return n && e ? /* @__PURE__ */ E(
1193
+ ne,
1167
1194
  {
1168
1195
  placement: "bottom start",
1169
1196
  show: l,
1170
- onToggle: (h) => a(h),
1197
+ onToggle: (g) => a(g),
1171
1198
  shouldHideOnSelect: !0,
1172
1199
  shouldFocusTriggerOnClose: !0,
1173
- trigger: /* @__PURE__ */ s(ke, { color: r.color, renderIcon: r.icon, children: i }),
1200
+ trigger: /* @__PURE__ */ s(Pe, { color: r.color, renderIcon: r.icon, children: i }),
1174
1201
  children: [
1175
- /* @__PURE__ */ T(te.Item, { ref: m, onClick: () => g(w.CONFUSING), children: [
1176
- /* @__PURE__ */ s(Ne, { size: "x-small" }),
1202
+ /* @__PURE__ */ E(ne.Item, { ref: m, onClick: () => h(k.CONFUSING), children: [
1203
+ /* @__PURE__ */ s(Se, { size: "x-small" }),
1177
1204
  ` ${o.markUnclear}`
1178
1205
  ] }),
1179
- /* @__PURE__ */ T(te.Item, { ref: d, onClick: () => g(w.IMPORTANT), children: [
1180
- /* @__PURE__ */ s(be, { size: "x-small" }),
1206
+ /* @__PURE__ */ E(ne.Item, { ref: c, onClick: () => h(k.IMPORTANT), children: [
1207
+ /* @__PURE__ */ s(Te, { size: "x-small" }),
1181
1208
  ` ${o.markImportant}`
1182
1209
  ] })
1183
1210
  ]
1184
1211
  }
1185
- ) : /* @__PURE__ */ s(z, { display: "inline-flex", children: /* @__PURE__ */ s(ke, { color: r.color, renderIcon: r.icon, children: i }) });
1212
+ ) : /* @__PURE__ */ s(z, { display: "inline-flex", children: /* @__PURE__ */ s(Pe, { color: r.color, renderIcon: r.icon, children: i }) });
1186
1213
  };
1187
- function Ae(n, e) {
1188
- return (n instanceof Date ? n : new Date(n)).toLocaleString(e, {
1214
+ function Me(t, e) {
1215
+ return (t instanceof Date ? t : new Date(t)).toLocaleString(e, {
1189
1216
  year: "numeric",
1190
1217
  month: "short",
1191
1218
  day: "numeric"
1192
1219
  });
1193
1220
  }
1194
- const In = ({
1195
- noteId: n,
1221
+ const kn = ({
1222
+ noteId: t,
1196
1223
  date: e,
1197
- highlight: t,
1224
+ highlight: n,
1198
1225
  note: o,
1199
1226
  type: r,
1200
1227
  onClick: i,
1201
1228
  onDelete: l,
1202
1229
  onSaveNote: a,
1203
1230
  onTypeChange: m,
1204
- isActive: d,
1205
- isPanelView: g = !1,
1206
- courseName: h,
1231
+ isActive: c,
1232
+ isPanelView: h = !1,
1233
+ courseName: g,
1207
1234
  locale: u,
1208
- highlightTheme: S,
1209
- renderLink: f,
1210
- href: y
1235
+ highlightTheme: p,
1236
+ renderLink: y,
1237
+ href: T
1211
1238
  }) => {
1212
- const { translations: E } = G(), [H, M] = W(!1), [N, I] = W(!1), [k, x] = W(o || ""), [O, _] = W(!1), F = V(null), D = K((p) => {
1213
- F.current = p;
1239
+ const { translations: N } = Q(), [O, L] = H(!1), [b, I] = H(!1), [R, C] = H(o || ""), [B, x] = H(!1), A = J(null), w = q((f) => {
1240
+ A.current = f;
1214
1241
  }, []);
1215
- ee(() => {
1216
- var p, v;
1217
- d && ((p = F.current) == null || p.scrollIntoView({ behavior: "smooth", block: "nearest" }), (v = F.current) == null || v.focus());
1218
- }, [d]);
1219
- const Z = r === w.IMPORTANT ? E.important : E.unclear, R = (p) => {
1220
- p.key === "Enter" && (p.preventDefault(), i == null || i());
1221
- }, b = [Z, E.note];
1222
- t && b.push(t), o && b.push(o), e && b.push(Ae(e, u)), h && b.push(h);
1223
- const P = b.join(", "), L = /* @__PURE__ */ T(
1242
+ Z(() => {
1243
+ var f, F;
1244
+ c && ((f = A.current) == null || f.scrollIntoView({ behavior: "smooth", block: "nearest" }), (F = A.current) == null || F.focus());
1245
+ }, [c]);
1246
+ const G = r === k.IMPORTANT ? N.important : N.unclear, te = (f) => {
1247
+ f.key === "Enter" && (f.preventDefault(), i == null || i());
1248
+ }, $ = [G, N.note];
1249
+ n && $.push(n), o && $.push(o), e && $.push(Me(e, u)), g && $.push(g);
1250
+ const le = $.join(", "), D = /* @__PURE__ */ E(
1224
1251
  z,
1225
1252
  {
1226
1253
  as: "div",
@@ -1228,140 +1255,140 @@ const In = ({
1228
1255
  borderRadius: "medium",
1229
1256
  padding: "small",
1230
1257
  position: "relative",
1231
- role: y || N ? void 0 : "button",
1232
- "aria-label": y ? void 0 : P,
1233
- "aria-pressed": y || N ? void 0 : d,
1234
- tabIndex: y || d ? -1 : 0,
1235
- "data-testid": "note-card",
1236
- elementRef: D,
1237
- onClick: d ? void 0 : i,
1238
- onMouseEnter: () => M(!0),
1239
- onMouseLeave: () => M(!1),
1240
- onKeyDown: d ? void 0 : R,
1241
- cursor: N ? "default" : "pointer",
1258
+ role: T || b ? void 0 : "button",
1259
+ "aria-label": T ? void 0 : le,
1260
+ "aria-pressed": T || b ? void 0 : c,
1261
+ tabIndex: T || c ? -1 : 0,
1262
+ "data-testid": `note-card-${t}`,
1263
+ elementRef: w,
1264
+ onClick: c ? void 0 : i,
1265
+ onMouseEnter: () => L(!0),
1266
+ onMouseLeave: () => L(!1),
1267
+ onKeyDown: c ? void 0 : te,
1268
+ cursor: b ? "default" : "pointer",
1242
1269
  children: [
1243
- /* @__PURE__ */ T(C, { direction: "column", gap: "small", children: [
1270
+ /* @__PURE__ */ E(S, { direction: "column", gap: "small", children: [
1244
1271
  /* @__PURE__ */ s(
1245
- Ve,
1272
+ Je,
1246
1273
  {
1247
1274
  type: r,
1248
- onTypeChange: g && m ? (p) => m(n, p) : void 0,
1249
- renderAsMenuTrigger: g && !!m && !!d
1275
+ onTypeChange: h && m ? (f) => m(t, f) : void 0,
1276
+ renderAsMenuTrigger: h && !!m && !!c
1250
1277
  }
1251
1278
  ),
1252
- t ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ s(U, { children: d && g ? /* @__PURE__ */ s(
1253
- he,
1279
+ n ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: /* @__PURE__ */ s(U, { children: c && h ? /* @__PURE__ */ s(
1280
+ ye,
1254
1281
  {
1255
1282
  type: r,
1256
- isCardActive: !!d || H,
1257
- theme: S,
1258
- children: t
1283
+ isCardActive: !!c || O,
1284
+ theme: p,
1285
+ children: n
1259
1286
  }
1260
- ) : /* @__PURE__ */ s(me, { maxLines: 3, truncate: "word", children: /* @__PURE__ */ s(
1261
- he,
1287
+ ) : /* @__PURE__ */ s(Ne, { maxLines: 3, truncate: "word", children: /* @__PURE__ */ s(
1288
+ ye,
1262
1289
  {
1263
1290
  type: r,
1264
- isCardActive: !!d || H,
1265
- theme: S,
1266
- children: t
1291
+ isCardActive: !!c || O,
1292
+ theme: p,
1293
+ children: n
1267
1294
  }
1268
- ) }) }) }) : /* @__PURE__ */ s(Qe, {}),
1269
- /* @__PURE__ */ T(C, { direction: "column", gap: "small", children: [
1270
- N && g ? /* @__PURE__ */ T(C, { direction: "column", gap: "x-small", children: [
1295
+ ) }) }) }) : /* @__PURE__ */ s(Ze, {}),
1296
+ /* @__PURE__ */ E(S, { direction: "column", gap: "small", children: [
1297
+ b && h ? /* @__PURE__ */ E(S, { direction: "column", gap: "x-small", children: [
1271
1298
  /* @__PURE__ */ s(
1272
- He,
1299
+ $e,
1273
1300
  {
1274
- label: /* @__PURE__ */ s(Me, { children: E.editNote }),
1275
- value: k,
1276
- onChange: (p) => x(p.target.value),
1277
- placeholder: E.addNoteOptional
1301
+ label: /* @__PURE__ */ s(ze, { children: N.editNote }),
1302
+ value: R,
1303
+ onChange: (f) => C(f.target.value),
1304
+ placeholder: N.addNoteOptional
1278
1305
  }
1279
1306
  ),
1280
- /* @__PURE__ */ T(C, { gap: "xx-small", children: [
1281
- /* @__PURE__ */ s(C.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1282
- $,
1307
+ /* @__PURE__ */ E(S, { gap: "xx-small", children: [
1308
+ /* @__PURE__ */ s(S.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1309
+ K,
1283
1310
  {
1284
1311
  display: "block",
1285
1312
  size: "small",
1286
- "data-testid": "note-card-cancel",
1313
+ "data-testid": `note-card-${t}-cancel`,
1287
1314
  onClick: () => {
1288
- x(o || ""), I(!1);
1315
+ C(o || ""), I(!1);
1289
1316
  },
1290
- children: E.cancel
1317
+ children: N.cancel
1291
1318
  }
1292
1319
  ) }),
1293
- /* @__PURE__ */ s(C.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1294
- $,
1320
+ /* @__PURE__ */ s(S.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1321
+ K,
1295
1322
  {
1296
1323
  display: "block",
1297
1324
  color: "primary",
1298
1325
  size: "small",
1299
- "data-testid": "note-card-save",
1326
+ "data-testid": `note-card-${t}-save`,
1300
1327
  onClick: () => {
1301
- a == null || a(n, k), I(!1);
1328
+ a == null || a(t, R), I(!1);
1302
1329
  },
1303
- interaction: k.trim() ? "enabled" : "disabled",
1304
- children: E.save
1330
+ interaction: R.trim() ? "enabled" : "disabled",
1331
+ children: N.save
1305
1332
  }
1306
1333
  ) })
1307
1334
  ] })
1308
- ] }) : o ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: d && g ? /* @__PURE__ */ T(U, { children: [
1335
+ ] }) : o ? /* @__PURE__ */ s("div", { style: { wordBreak: "break-word", overflowWrap: "break-word" }, children: c && h ? /* @__PURE__ */ E(U, { children: [
1309
1336
  o,
1310
1337
  " ",
1311
1338
  /* @__PURE__ */ s(
1312
- Q,
1339
+ re,
1313
1340
  {
1314
1341
  size: "small",
1315
1342
  withBackground: !1,
1316
1343
  withBorder: !1,
1317
- screenReaderLabel: E.editNote,
1318
- "data-testid": "note-card-edit",
1319
- onClick: (p) => {
1320
- p.stopPropagation(), I(!0);
1344
+ screenReaderLabel: N.editNote,
1345
+ "data-testid": `note-card-${t}-edit`,
1346
+ onClick: (f) => {
1347
+ f.stopPropagation(), I(!0);
1321
1348
  },
1322
- children: /* @__PURE__ */ s(fe, {})
1349
+ children: /* @__PURE__ */ s(pe, {})
1323
1350
  }
1324
1351
  )
1325
- ] }) : /* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(me, { maxLines: 3, truncate: "word", children: o }) }) }) : g && d ? /* @__PURE__ */ s("div", { children: /* @__PURE__ */ T(U, { color: "secondary", children: [
1326
- E.addNotePrompt,
1352
+ ] }) : /* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(Ne, { maxLines: 3, truncate: "word", children: o }) }) }) : h && c ? /* @__PURE__ */ s("div", { children: /* @__PURE__ */ E(U, { color: "secondary", children: [
1353
+ N.addNotePrompt,
1327
1354
  " ",
1328
1355
  /* @__PURE__ */ s(
1329
- Q,
1356
+ re,
1330
1357
  {
1331
1358
  size: "small",
1332
1359
  withBackground: !1,
1333
1360
  withBorder: !1,
1334
- screenReaderLabel: E.editNote,
1335
- "data-testid": "note-card-edit",
1336
- onClick: (p) => {
1337
- p.stopPropagation(), I(!0);
1361
+ screenReaderLabel: N.editNote,
1362
+ "data-testid": `note-card-${t}-edit`,
1363
+ onClick: (f) => {
1364
+ f.stopPropagation(), I(!0);
1338
1365
  },
1339
- children: /* @__PURE__ */ s(fe, {})
1366
+ children: /* @__PURE__ */ s(pe, {})
1340
1367
  }
1341
1368
  )
1342
1369
  ] }) }) : null,
1343
- /* @__PURE__ */ T(C, { justifyItems: "space-between", alignItems: "center", children: [
1344
- /* @__PURE__ */ s(U, { size: "small", color: "secondary", children: Ae(e, u) }),
1345
- d && l && /* @__PURE__ */ s(
1346
- Q,
1370
+ /* @__PURE__ */ E(S, { justifyItems: "space-between", alignItems: "center", children: [
1371
+ /* @__PURE__ */ s(U, { size: "small", color: "secondary", children: Me(e, u) }),
1372
+ c && l && /* @__PURE__ */ s(
1373
+ re,
1347
1374
  {
1348
1375
  size: "small",
1349
1376
  withBackground: !1,
1350
1377
  withBorder: !1,
1351
1378
  color: "danger",
1352
- screenReaderLabel: E.deleteNote,
1353
- "data-testid": "note-card-delete",
1354
- onClick: (p) => {
1355
- p.stopPropagation(), _(!0);
1379
+ screenReaderLabel: N.deleteNote,
1380
+ "data-testid": `note-card-${t}-delete`,
1381
+ onClick: (f) => {
1382
+ f.stopPropagation(), x(!0);
1356
1383
  },
1357
- children: /* @__PURE__ */ s(le, {})
1384
+ children: /* @__PURE__ */ s(ue, {})
1358
1385
  }
1359
1386
  )
1360
1387
  ] }),
1361
- h && /* @__PURE__ */ s(U, { size: "small", color: "secondary", children: h })
1388
+ g && /* @__PURE__ */ s(U, { size: "small", color: "secondary", children: g })
1362
1389
  ] })
1363
1390
  ] }),
1364
- O && l && /* @__PURE__ */ s(
1391
+ B && l && /* @__PURE__ */ s(
1365
1392
  z,
1366
1393
  {
1367
1394
  as: "div",
@@ -1374,8 +1401,8 @@ const In = ({
1374
1401
  insetInlineStart: "0",
1375
1402
  insetInlineEnd: "0",
1376
1403
  stacking: "above",
1377
- children: /* @__PURE__ */ T(
1378
- C,
1404
+ children: /* @__PURE__ */ E(
1405
+ S,
1379
1406
  {
1380
1407
  direction: "column",
1381
1408
  justifyItems: "center",
@@ -1384,29 +1411,29 @@ const In = ({
1384
1411
  height: "100%",
1385
1412
  children: [
1386
1413
  /* @__PURE__ */ s(
1387
- $,
1414
+ K,
1388
1415
  {
1389
1416
  display: "block",
1390
1417
  color: "danger",
1391
1418
  size: "small",
1392
- renderIcon: /* @__PURE__ */ s(le, {}),
1393
- "data-testid": "note-card-confirm-delete",
1394
- onClick: (p) => {
1395
- p.stopPropagation(), l(n), _(!1);
1419
+ renderIcon: /* @__PURE__ */ s(ue, {}),
1420
+ "data-testid": `note-card-${t}-confirm-delete`,
1421
+ onClick: (f) => {
1422
+ f.stopPropagation(), l(t), x(!1);
1396
1423
  },
1397
- children: E.deleteNote
1424
+ children: N.deleteNote
1398
1425
  }
1399
1426
  ),
1400
1427
  /* @__PURE__ */ s(
1401
- $,
1428
+ K,
1402
1429
  {
1403
1430
  display: "block",
1404
1431
  size: "small",
1405
- "data-testid": "note-card-cancel-delete",
1406
- onClick: (p) => {
1407
- p.stopPropagation(), _(!1);
1432
+ "data-testid": `note-card-${t}-cancel-delete`,
1433
+ onClick: (f) => {
1434
+ f.stopPropagation(), x(!1);
1408
1435
  },
1409
- children: E.cancel
1436
+ children: N.cancel
1410
1437
  }
1411
1438
  )
1412
1439
  ]
@@ -1417,106 +1444,101 @@ const In = ({
1417
1444
  ]
1418
1445
  }
1419
1446
  );
1420
- return y && f ? f({ href: y, children: L, ariaLabel: P }) : L;
1447
+ return T && y ? y({ href: T, children: D, ariaLabel: le }) : D;
1421
1448
  };
1422
- function xn(n, e) {
1423
- const t = Array.from({ length: e }, () => []);
1424
- return n.forEach((o, r) => {
1425
- t[r % e].push(o);
1426
- }), t;
1449
+ function On(t, e) {
1450
+ const n = Array.from({ length: e }, () => []);
1451
+ return t.forEach((o, r) => {
1452
+ n[r % e].push(o);
1453
+ }), n;
1427
1454
  }
1428
- const wn = {
1455
+ const Rn = {
1429
1456
  display: "flex",
1430
1457
  gap: "1rem",
1431
1458
  boxSizing: "border-box",
1432
1459
  width: "100%",
1433
1460
  alignItems: "flex-start"
1434
- }, kn = {
1461
+ }, Dn = {
1435
1462
  display: "flex",
1436
1463
  flexDirection: "column",
1437
1464
  gap: "1rem",
1438
1465
  flex: 1,
1439
1466
  minWidth: 0
1440
- }, eo = ({
1441
- notes: n,
1467
+ }, ro = ({
1468
+ notes: t,
1442
1469
  isLoading: e,
1443
- isError: t,
1444
- pageInfo: o,
1445
- onPreviousPage: r,
1446
- onNextPage: i,
1470
+ isError: n,
1471
+ currentPage: o,
1472
+ totalPages: r,
1473
+ onPageChange: i,
1447
1474
  onNoteSelect: l,
1448
1475
  onNoteDelete: a,
1449
1476
  onNoteSave: m,
1450
- onNoteTypeChange: d,
1451
- selectedNoteId: g,
1452
- hasActiveFilter: h = !1,
1477
+ onNoteTypeChange: c,
1478
+ selectedNoteId: h,
1479
+ hasActiveFilter: g = !1,
1453
1480
  columnCount: u = 1,
1454
- highlightTheme: S,
1455
- locale: f,
1456
- renderNoteLink: y,
1457
- noteHref: E
1481
+ highlightTheme: p,
1482
+ locale: y,
1483
+ renderNoteLink: T,
1484
+ noteHref: N
1458
1485
  }) => {
1459
- const { translations: H } = G(), M = re(
1460
- () => xn(n, u),
1461
- [n, u]
1462
- ), N = (o == null ? void 0 : o.hasNextPage) || (o == null ? void 0 : o.hasPreviousPage);
1463
- return e ? /* @__PURE__ */ s(z, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ s(at, { renderTitle: H.loadingNotes }) }) : t ? /* @__PURE__ */ s(z, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ s(ae, { level: "h4", children: H.failedToLoadNotes }) }) : n.length === 0 ? /* @__PURE__ */ s(z, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ s(Tn, { hasActiveFilter: h }) }) : /* @__PURE__ */ T(Ye, { children: [
1464
- /* @__PURE__ */ s("div", { style: wn, "data-testid": "notes-grid", children: M.map((I, k) => (
1486
+ const { translations: O } = Q(), L = ie(
1487
+ () => On(t, u),
1488
+ [t, u]
1489
+ );
1490
+ if (e)
1491
+ return /* @__PURE__ */ s(z, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-loading", children: /* @__PURE__ */ s(dt, { renderTitle: O.loadingNotes }) });
1492
+ if (n)
1493
+ return /* @__PURE__ */ s(z, { as: "div", textAlign: "center", padding: "large", "data-testid": "notes-error", children: /* @__PURE__ */ s(fe, { level: "h4", children: O.failedToLoadNotes }) });
1494
+ if (t.length === 0)
1495
+ return /* @__PURE__ */ s(z, { as: "div", padding: "large", "data-testid": "empty-notes", children: /* @__PURE__ */ s(xn, { hasActiveFilter: g }) });
1496
+ const b = typeof o == "number" && typeof r == "number" && r > 1 && i !== void 0;
1497
+ return /* @__PURE__ */ E(et, { children: [
1498
+ /* @__PURE__ */ s("div", { style: Rn, "data-testid": "notes-grid", children: L.map((I, R) => (
1465
1499
  // oxlint-disable-next-line react/no-array-index-key -- columns are positional, index is stable
1466
- /* @__PURE__ */ s("div", { style: kn, children: I.map((x) => {
1467
- var O;
1500
+ /* @__PURE__ */ s("div", { style: Dn, children: I.map((C) => {
1501
+ var B;
1468
1502
  return /* @__PURE__ */ s(
1469
- In,
1503
+ kn,
1470
1504
  {
1471
- noteId: x.id,
1472
- date: x.createdAt,
1473
- type: x.reaction[0] ?? w.IMPORTANT,
1474
- highlight: (O = x.highlightData) == null ? void 0 : O.selectedText,
1475
- note: x.userText,
1476
- isActive: g === x.id,
1477
- isPanelView: !!g,
1478
- onClick: l ? () => l(x.id) : void 0,
1479
- onDelete: a ? (_) => a(_) : void 0,
1480
- onSaveNote: m ? (_, F) => m(_, F) : void 0,
1481
- onTypeChange: d ? (_, F) => d(_, F) : void 0,
1482
- highlightTheme: S,
1483
- locale: f,
1484
- renderLink: y,
1485
- href: E ? E(x.id, x) : void 0
1505
+ noteId: C.id,
1506
+ date: C.createdAt,
1507
+ type: C.reaction[0] ?? k.IMPORTANT,
1508
+ highlight: (B = C.highlightData) == null ? void 0 : B.selectedText,
1509
+ note: C.userText,
1510
+ isActive: h === C.id,
1511
+ isPanelView: !!h,
1512
+ onClick: l ? () => l(C.id) : void 0,
1513
+ onDelete: a ? (x) => a(x) : void 0,
1514
+ onSaveNote: m ? (x, A) => m(x, A) : void 0,
1515
+ onTypeChange: c ? (x, A) => c(x, A) : void 0,
1516
+ highlightTheme: p,
1517
+ locale: y,
1518
+ renderLink: T,
1519
+ href: N ? N(C.id, C) : void 0
1486
1520
  },
1487
- x.id
1521
+ C.id
1488
1522
  );
1489
- }) }, k)
1523
+ }) }, R)
1490
1524
  )) }),
1491
- N && /* @__PURE__ */ T(C, { justifyItems: "center", gap: "small", padding: "small", "data-testid": "notes-pagination", children: [
1492
- /* @__PURE__ */ s(
1493
- Q,
1494
- {
1495
- size: "small",
1496
- screenReaderLabel: H.previousPage,
1497
- "data-testid": "notes-prev-page",
1498
- interaction: o != null && o.hasPreviousPage ? "enabled" : "disabled",
1499
- onClick: r,
1500
- children: /* @__PURE__ */ s(ot, {})
1501
- }
1502
- ),
1503
- /* @__PURE__ */ s(
1504
- Q,
1505
- {
1506
- size: "small",
1507
- screenReaderLabel: H.nextPage,
1508
- "data-testid": "notes-next-page",
1509
- interaction: o != null && o.hasNextPage ? "enabled" : "disabled",
1510
- onClick: i,
1511
- children: /* @__PURE__ */ s(rt, {})
1512
- }
1513
- )
1514
- ] })
1525
+ b && /* @__PURE__ */ s(S, { justifyItems: "center", padding: "small", "data-testid": "notes-pagination", children: /* @__PURE__ */ s(S.Item, { children: /* @__PURE__ */ s(
1526
+ ct,
1527
+ {
1528
+ as: "nav",
1529
+ variant: "input",
1530
+ labelNext: O.nextPage,
1531
+ labelPrev: O.previousPage,
1532
+ currentPage: o,
1533
+ totalPageNumber: r,
1534
+ onPageChange: i
1535
+ }
1536
+ ) }) })
1515
1537
  ] });
1516
- }, to = ({
1517
- noteText: n,
1538
+ }, so = ({
1539
+ noteText: t,
1518
1540
  reaction: e,
1519
- highlightText: t,
1541
+ highlightText: n,
1520
1542
  highlightTheme: o,
1521
1543
  onSave: r,
1522
1544
  onDelete: i,
@@ -1524,114 +1546,114 @@ const wn = {
1524
1546
  onBack: a,
1525
1547
  editing: m = !1
1526
1548
  }) => {
1527
- const { translations: d } = G(), [g, h] = W(m), [u, S] = W(n || ""), [f, y] = W(!1);
1528
- return /* @__PURE__ */ T(C, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1529
- t != null ? /* @__PURE__ */ s(z, { as: "div", children: /* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(he, { type: e, isCardActive: !0, theme: o, children: t }) }) }) : /* @__PURE__ */ s(Qe, {}),
1530
- /* @__PURE__ */ s(Ve, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1531
- g ? /* @__PURE__ */ T(C, { direction: "column", gap: "x-small", children: [
1549
+ const { translations: c } = Q(), [h, g] = H(m), [u, p] = H(t || ""), [y, T] = H(!1);
1550
+ return /* @__PURE__ */ E(S, { direction: "column", gap: "small", "data-testid": "single-note", children: [
1551
+ n != null ? /* @__PURE__ */ s(z, { as: "div", children: /* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(ye, { type: e, isCardActive: !0, theme: o, children: n }) }) }) : /* @__PURE__ */ s(Ze, {}),
1552
+ /* @__PURE__ */ s(Je, { type: e, onTypeChange: l, renderAsMenuTrigger: !!l }),
1553
+ h ? /* @__PURE__ */ E(S, { direction: "column", gap: "x-small", children: [
1532
1554
  /* @__PURE__ */ s(
1533
- He,
1555
+ $e,
1534
1556
  {
1535
- label: d.addNoteOptional,
1557
+ label: c.addNoteOptional,
1536
1558
  value: u,
1537
- onChange: (E) => S(E.target.value),
1559
+ onChange: (N) => p(N.target.value),
1538
1560
  resize: "vertical"
1539
1561
  }
1540
1562
  ),
1541
- /* @__PURE__ */ T(C, { gap: "xx-small", children: [
1542
- /* @__PURE__ */ s(C.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1543
- $,
1563
+ /* @__PURE__ */ E(S, { gap: "xx-small", children: [
1564
+ /* @__PURE__ */ s(S.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1565
+ K,
1544
1566
  {
1545
1567
  display: "block",
1546
1568
  size: "small",
1547
1569
  "data-testid": "single-note-cancel",
1548
1570
  onClick: () => {
1549
- S(n || ""), h(!1);
1571
+ p(t || ""), g(!1);
1550
1572
  },
1551
- children: d.cancel
1573
+ children: c.cancel
1552
1574
  }
1553
1575
  ) }),
1554
- /* @__PURE__ */ s(C.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1555
- $,
1576
+ /* @__PURE__ */ s(S.Item, { shouldGrow: !0, children: /* @__PURE__ */ s(
1577
+ K,
1556
1578
  {
1557
1579
  display: "block",
1558
1580
  color: "primary",
1559
1581
  size: "small",
1560
1582
  "data-testid": "single-note-save",
1561
1583
  onClick: () => {
1562
- r(u), h(!1);
1584
+ r(u), g(!1);
1563
1585
  },
1564
- children: d.save
1586
+ children: c.save
1565
1587
  }
1566
1588
  ) })
1567
1589
  ] })
1568
- ] }) : /* @__PURE__ */ T(C, { direction: "column", gap: "small", children: [
1569
- n && /* @__PURE__ */ T(z, { as: "div", children: [
1570
- /* @__PURE__ */ s(ae, { level: "h4", margin: "0 0 xx-small 0", children: d.note }),
1571
- /* @__PURE__ */ s(U, { children: n })
1590
+ ] }) : /* @__PURE__ */ E(S, { direction: "column", gap: "small", children: [
1591
+ t && /* @__PURE__ */ E(z, { as: "div", children: [
1592
+ /* @__PURE__ */ s(fe, { level: "h4", margin: "0 0 xx-small 0", children: c.note }),
1593
+ /* @__PURE__ */ s(U, { children: t })
1572
1594
  ] }),
1573
- /* @__PURE__ */ T(C, { justifyItems: "space-between", children: [
1595
+ /* @__PURE__ */ E(S, { justifyItems: "space-between", children: [
1574
1596
  /* @__PURE__ */ s(
1575
- $,
1597
+ K,
1576
1598
  {
1577
1599
  size: "small",
1578
- renderIcon: /* @__PURE__ */ s(st, {}),
1600
+ renderIcon: /* @__PURE__ */ s(it, {}),
1579
1601
  "data-testid": "single-note-back",
1580
1602
  onClick: () => a == null ? void 0 : a(),
1581
- children: d.back
1603
+ children: c.back
1582
1604
  }
1583
1605
  ),
1584
- /* @__PURE__ */ T(C, { gap: "xx-small", children: [
1606
+ /* @__PURE__ */ E(S, { gap: "xx-small", children: [
1585
1607
  i && /* @__PURE__ */ s(
1586
- Q,
1608
+ re,
1587
1609
  {
1588
1610
  size: "small",
1589
1611
  withBackground: !1,
1590
1612
  withBorder: !1,
1591
1613
  color: "danger",
1592
- screenReaderLabel: d.deleteNote,
1614
+ screenReaderLabel: c.deleteNote,
1593
1615
  "data-testid": "single-note-delete",
1594
- onClick: () => y(!0),
1595
- children: /* @__PURE__ */ s(le, {})
1616
+ onClick: () => T(!0),
1617
+ children: /* @__PURE__ */ s(ue, {})
1596
1618
  }
1597
1619
  ),
1598
1620
  /* @__PURE__ */ s(
1599
- Q,
1621
+ re,
1600
1622
  {
1601
1623
  size: "small",
1602
1624
  withBackground: !1,
1603
1625
  withBorder: !1,
1604
- screenReaderLabel: d.editNote,
1626
+ screenReaderLabel: c.editNote,
1605
1627
  "data-testid": "single-note-edit",
1606
- onClick: () => h(!0),
1607
- children: /* @__PURE__ */ s(fe, {})
1628
+ onClick: () => g(!0),
1629
+ children: /* @__PURE__ */ s(pe, {})
1608
1630
  }
1609
1631
  )
1610
1632
  ] })
1611
1633
  ] }),
1612
- f && i && /* @__PURE__ */ s(z, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ T(C, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1634
+ y && i && /* @__PURE__ */ s(z, { as: "div", background: "primary", padding: "medium", borderRadius: "large", children: /* @__PURE__ */ E(S, { direction: "column", justifyItems: "center", alignItems: "center", gap: "x-small", children: [
1613
1635
  /* @__PURE__ */ s(
1614
- $,
1636
+ K,
1615
1637
  {
1616
1638
  display: "block",
1617
1639
  color: "danger",
1618
1640
  size: "small",
1619
- renderIcon: /* @__PURE__ */ s(le, {}),
1641
+ renderIcon: /* @__PURE__ */ s(ue, {}),
1620
1642
  "data-testid": "single-note-confirm-delete",
1621
1643
  onClick: () => {
1622
- i(), y(!1);
1644
+ i(), T(!1);
1623
1645
  },
1624
- children: d.deleteNote
1646
+ children: c.deleteNote
1625
1647
  }
1626
1648
  ),
1627
1649
  /* @__PURE__ */ s(
1628
- $,
1650
+ K,
1629
1651
  {
1630
1652
  display: "block",
1631
1653
  size: "small",
1632
1654
  "data-testid": "single-note-cancel-delete",
1633
- onClick: () => y(!1),
1634
- children: d.cancel
1655
+ onClick: () => T(!1),
1656
+ children: c.cancel
1635
1657
  }
1636
1658
  )
1637
1659
  ] }) })
@@ -1639,26 +1661,26 @@ const wn = {
1639
1661
  ] });
1640
1662
  };
1641
1663
  export {
1642
- Vn as ContentWithNoteWrapper,
1643
- he as Highlight,
1644
- Qe as HighlightError,
1645
- In as NoteCard,
1646
- Ve as NoteChip,
1647
- yn as NoteReactionMenu,
1648
- Tn as NotebookEmptyState,
1649
- Qn as NotebookProvider,
1650
- pn as NotebookTranslationsProvider,
1651
- Jn as NotebookTray,
1652
- eo as NotesListView,
1653
- w as REACTION_TYPE,
1654
- to as SingleNote,
1655
- Te as createTransparentColor,
1656
- Dt as useCreateNote,
1657
- Lt as useDeleteNote,
1658
- $e as useGetNotes,
1659
- Xe as useNotebook,
1660
- G as useNotebookTranslations,
1661
- Yn as useNotesData,
1662
- Zn as useReactionFilter,
1663
- At as useUpdateNote
1664
+ eo as ContentWithNoteWrapper,
1665
+ ye as Highlight,
1666
+ Ze as HighlightError,
1667
+ kn as NoteCard,
1668
+ Je as NoteChip,
1669
+ Tn as NoteReactionMenu,
1670
+ xn as NotebookEmptyState,
1671
+ Jn as NotebookProvider,
1672
+ bn as NotebookTranslationsProvider,
1673
+ oo as NotebookTray,
1674
+ ro as NotesListView,
1675
+ k as REACTION_TYPE,
1676
+ so as SingleNote,
1677
+ we as createTransparentColor,
1678
+ At as useCreateNote,
1679
+ Ft as useDeleteNote,
1680
+ Ke as useGetNotes,
1681
+ Ye as useNotebook,
1682
+ Q as useNotebookTranslations,
1683
+ to as useNotesData,
1684
+ no as useReactionFilter,
1685
+ _t as useUpdateNote
1664
1686
  };