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