@instructure/platform-notebook 0.6.0 → 0.9.1

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