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