@genai-fi/base 4.1.3 → 4.2.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.
@@ -0,0 +1,8 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { c as r } from "./createSvgIcon-DQhMxTx4.js";
3
+ const c = r(/* @__PURE__ */ o("path", {
4
+ d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
5
+ }), "Close");
6
+ export {
7
+ c as C
8
+ };
@@ -1 +1 @@
1
- ._outer_1pzwa_1{position:relative;overflow:hidden;border-radius:4px;color:#fff}._outer_1pzwa_1._orange_1pzwa_8{background-color:#c6840c33}._orange_1pzwa_8._progress_1pzwa_11{background-color:#c6840c}._outer_1pzwa_1._purple_1pzwa_15{background-color:#a751c933}._purple_1pzwa_15._progress_1pzwa_11{background-color:#a751c9}._outer_1pzwa_1._blue_1pzwa_22{background-color:#5165c933}._blue_1pzwa_22._progress_1pzwa_11{background-color:#5165c9}._outer_1pzwa_1._green_1pzwa_29{background-color:#53a52733}._green_1pzwa_29._progress_1pzwa_11{background-color:#53a527}._outer_1pzwa_1._red_1pzwa_36{background-color:#db491d33}._red_1pzwa_36._progress_1pzwa_11{background-color:#db491d}._progress_1pzwa_11{position:absolute;left:0;top:0;bottom:0;width:100%;background:#1976d2;transition:width .5s}._label_1pzwa_53{position:relative;font-weight:700;text-align:right;padding:.2rem .5rem;box-sizing:border-box;font-size:12pt;transition:width .5s}
1
+ ._outer_161yr_1{position:relative;overflow:hidden;border-radius:4px;color:#fff}._outer_161yr_1._orange_161yr_8{background-color:#c6840c33}._orange_161yr_8._progress_161yr_11{background-color:#c6840c}._outer_161yr_1._purple_161yr_15{background-color:#a751c933}._purple_161yr_15._progress_161yr_11{background-color:#a751c9}._outer_161yr_1._blue_161yr_22{background-color:#5165c933}._blue_161yr_22._progress_161yr_11{background-color:#5165c9}._outer_161yr_1._green_161yr_29{background-color:#53a52733}._green_161yr_29._progress_161yr_11{background-color:#53a527}._outer_161yr_1._red_161yr_36{background-color:#db491d33}._red_161yr_36._progress_161yr_11{background-color:#db491d}._progress_161yr_11{position:absolute;left:0;top:0;bottom:0;width:100%;background:#1976d2;transition:width .5s,height .5s}._label_161yr_53{position:relative;font-weight:700;text-align:right;padding:.2rem .5rem;box-sizing:border-box;font-size:12pt;transition:width .5s,height .5s}._horizontal_161yr_63{width:100%;min-height:20px}._vertical_161yr_68{width:min-content;height:100%}._vertical_161yr_68 ._label_161yr_53{display:flex;align-items:flex-end}._vertical_161yr_68 ._progress_161yr_11{height:100%;bottom:unset}
@@ -0,0 +1 @@
1
+ ._sidePanel_1j2co_1{background:#fff;display:flex;z-index:2;flex-shrink:0;position:relative;transition:opacity .3s ease-in;opacity:0}._sidePanel_1j2co_1._closed_1j2co_14{opacity:0;transition:width .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-out}._sidePanel_1j2co_1._opening_1j2co_19{opacity:1;transition:width .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-in}._sidePanel_1j2co_1._open_1j2co_19{opacity:1}._resizer_1j2co_28{width:30px;cursor:ew-resize;background-color:transparent;box-sizing:border-box;position:absolute;left:-8px;opacity:1;touch-action:none;-webkit-user-select:none;user-select:none;top:0;bottom:0;z-index:2}._noSelect_1j2co_43{-webkit-user-select:none;user-select:none}._resizerBar_1j2co_47{position:absolute;top:0;left:7px;width:2px;height:100%;background-color:#ddd;touch-action:none;-webkit-user-select:none;user-select:none}._resizer_1j2co_28:hover ._resizerBar_1j2co_47{background-color:#75a4e288}._resizer_1j2co_28._resizing_1j2co_62 ._resizerBar_1j2co_47{background-color:#75a4e2}._resizerHandle_1j2co_66{position:absolute;top:50%;left:2px;width:10px;height:60px;transform:translateY(-50%);background-color:#fff;border-radius:3px;border:2px solid #ddd;box-shadow:0 0 4px #ccc;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHandle_1j2co_66._minimised_1j2co_84{left:-15px;width:20px}._resizerHandle_1j2co_66:focus{outline:2px solid #75a4e2;outline-offset:2px}._resizerHandle_1j2co_66:before{content:"";display:block;width:4px;height:20px;background:radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 2px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 8px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 14px;background-repeat:no-repeat;background-size:4px 4px}._resizer_1j2co_28:hover ._resizerHandle_1j2co_66,._resizer_1j2co_28._resizing_1j2co_62 ._resizerHandle_1j2co_66{border-color:#75a4e2}._expand_1j2co_114{position:absolute;top:2rem;right:0;height:40px;width:30px;background-color:#fff;border-radius:3px;border:2px solid #ddd;cursor:pointer;display:flex;align-items:center;justify-content:center}._content_1j2co_130{flex-grow:1;overflow:auto;min-width:300px!important;position:relative}._closeButton_1j2co_137{position:absolute;top:.5rem;right:.5rem}
@@ -1,8 +1,9 @@
1
1
  interface Props {
2
2
  api: string;
3
+ checkURL?: string;
3
4
  appName: string;
4
5
  visibility?: number;
5
6
  noCheck?: boolean;
6
7
  }
7
- export default function ConnectionStatus({ api, appName, visibility, noCheck }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export default function ConnectionStatus({ api, checkURL, appName, visibility, noCheck }: Props): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,24 +1,24 @@
1
- import { jsx as r, Fragment as I, jsxs as L } from "react/jsx-runtime";
2
- import { iceConfig as W, webrtcActive as q } from "../../state/webrtcState.js";
3
- import { useRef as F, useState as g, useEffect as o } from "react";
4
- import { getRTConfig as P } from "./ice.js";
5
- import { W as R, F as z } from "../../FlashWifi-DkGhdWqj.js";
6
- import { useTranslation as E } from "react-i18next";
7
- import { c as b } from "../../createSvgIcon-DQhMxTx4.js";
8
- import { checkP2P as j } from "./check.js";
9
- import { usePeerObject as x } from "../../hooks/peer.js";
10
- import { a as T } from "../../react-D_xU5dL6.js";
11
- import '../../assets/ConnectionStatus.css';const A = "_containerConnecting_1p4sr_15 _container_1p4sr_3", U = "_containerSuccess_1p4sr_20 _container_1p4sr_3", k = "_containerMedium_1p4sr_25 _container_1p4sr_3", w = "_containerBad_1p4sr_30 _container_1p4sr_3", D = "_message_1p4sr_35", a = {
12
- containerConnecting: A,
13
- containerSuccess: U,
14
- containerMedium: k,
15
- containerBad: w,
16
- message: D
17
- }, O = b(/* @__PURE__ */ r("path", {
1
+ import { jsx as r, Fragment as W, jsxs as q } from "react/jsx-runtime";
2
+ import { iceConfig as F, webrtcActive as L } from "../../state/webrtcState.js";
3
+ import { useRef as P, useState as g, useEffect as o } from "react";
4
+ import { getRTConfig as z } from "./ice.js";
5
+ import { W as E, F as R } from "../../FlashWifi-DkGhdWqj.js";
6
+ import { useTranslation as b } from "react-i18next";
7
+ import { c as j } from "../../createSvgIcon-DQhMxTx4.js";
8
+ import { checkP2P as x } from "./check.js";
9
+ import { usePeerObject as A } from "../../hooks/peer.js";
10
+ import { a as B } from "../../react-D_xU5dL6.js";
11
+ import '../../assets/ConnectionStatus.css';const w = "_containerConnecting_1p4sr_15 _container_1p4sr_3", D = "_containerSuccess_1p4sr_20 _container_1p4sr_3", O = "_containerMedium_1p4sr_25 _container_1p4sr_3", U = "_containerBad_1p4sr_30 _container_1p4sr_3", $ = "_message_1p4sr_35", a = {
12
+ containerConnecting: w,
13
+ containerSuccess: D,
14
+ containerMedium: O,
15
+ containerBad: U,
16
+ message: $
17
+ }, k = j(/* @__PURE__ */ r("path", {
18
18
  d: "M24 8.98C20.93 5.9 16.69 4 12 4S3.07 5.9 0 8.98L12 21v-9h8.99zM19.59 14l-2.09 2.09L15.41 14 14 15.41l2.09 2.09L14 19.59 15.41 21l2.09-2.08L19.59 21 21 19.59l-2.08-2.09L21 15.41z"
19
- }), "SignalWifiBad"), $ = 6e4;
20
- function ee({ api: f, appName: h, visibility: S, noCheck: v }) {
21
- const { t: p } = E(), e = x(), [u, y] = T(W), [C, l] = T(q), m = F(), [n, d] = g("connecting"), [s, _] = g(0), [, B] = g(!1), [c, M] = g(!1), i = n === "ready";
19
+ }), "SignalWifiBad"), N = 6e4;
20
+ function te({ api: f, checkURL: S, appName: h, visibility: v, noCheck: y }) {
21
+ const { t: p } = b(), e = A(), [u, C] = B(F), [M, l] = B(L), m = P(), [n, d] = g("connecting"), [s, _] = g(0), [, I] = g(!1), [c, T] = g(!1), i = n === "ready";
22
22
  return o(() => {
23
23
  if (e)
24
24
  return e.on("status", d), e.on("quality", _), d(e.status), _(e.quality), () => {
@@ -26,48 +26,48 @@ function ee({ api: f, appName: h, visibility: S, noCheck: v }) {
26
26
  };
27
27
  _(0), d("connecting");
28
28
  }, [e]), o(() => {
29
- u || P(f, h, (t) => {
30
- y(t);
29
+ u || z(f, h, (t) => {
30
+ C(t);
31
31
  });
32
- }, [u, y, f, h]), o(() => {
32
+ }, [u, C, f, h]), o(() => {
33
33
  if (n !== "ready") {
34
34
  const t = setTimeout(() => {
35
- M(!0);
36
- }, $);
35
+ T(!0);
36
+ }, N);
37
37
  return () => {
38
38
  clearTimeout(t);
39
39
  };
40
40
  } else
41
- M(!1);
41
+ T(!1);
42
42
  }, [n]), o(() => {
43
- u && C === "unset" && (navigator != null && navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({ video: !0 }).then((t) => {
43
+ u && M === "unset" && (navigator != null && navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({ video: !0 }).then((t) => {
44
44
  m.current = t, l("full");
45
45
  }).catch(() => {
46
46
  l("relay");
47
47
  }) : l("relay"));
48
- }, [u, C, l]), o(() => {
48
+ }, [u, M, l]), o(() => {
49
49
  i && m.current && (m.current.getTracks().forEach(function(t) {
50
50
  t.stop();
51
51
  }), m.current = void 0);
52
52
  }, [i, n]), o(() => {
53
- i && e && !v && e.code && j(f, e.code).then((t) => {
54
- B(t);
53
+ i && e && !y && e.code && x(S || f, e.code).then((t) => {
54
+ I(t);
55
55
  });
56
- }, [i, e, f, v]), /* @__PURE__ */ r(I, { children: (S === void 0 || s <= S) && /* @__PURE__ */ L(
56
+ }, [i, e, f, S, y]), /* @__PURE__ */ r(W, { children: (v === void 0 || s <= v) && /* @__PURE__ */ q(
57
57
  "div",
58
58
  {
59
59
  className: n === "connecting" && !c ? a.containerConnecting : s === 3 ? a.containerSuccess : s === 2 ? a.containerMedium : a.containerBad,
60
60
  children: [
61
61
  !c && s > 0 && /* @__PURE__ */ r(
62
- R,
62
+ E,
63
63
  {
64
64
  fontSize: "large",
65
65
  color: "inherit"
66
66
  }
67
67
  ),
68
- !c && s <= 0 && /* @__PURE__ */ r(z, {}),
68
+ !c && s <= 0 && /* @__PURE__ */ r(R, {}),
69
69
  c && /* @__PURE__ */ r(
70
- O,
70
+ k,
71
71
  {
72
72
  fontSize: "large",
73
73
  color: "inherit"
@@ -79,5 +79,5 @@ function ee({ api: f, appName: h, visibility: S, noCheck: v }) {
79
79
  ) });
80
80
  }
81
81
  export {
82
- ee as default
82
+ te as default
83
83
  };
@@ -1,39 +1,37 @@
1
- import { jsx as r, jsxs as u } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as l, useEffect as d, useMemo as m } from "react";
3
- import { c as _ } from "../../createSvgIcon-DQhMxTx4.js";
3
+ import { C as _ } from "../../Close-BGAFHd7i.js";
4
4
  import { IconButton as a } from "@mui/material";
5
- import '../../assets/Motd.css';const g = "#e04f66", h = "#fd9d32", b = "#e8f0fe", j = "_motd_1rn2j_3", v = "_info_1rn2j_15 _motd_1rn2j_3", w = "_warn_1rn2j_21 _motd_1rn2j_3", C = "_error_1rn2j_26 _motd_1rn2j_3", M = {
5
+ import '../../assets/Motd.css';const g = "#e04f66", b = "#fd9d32", h = "#e8f0fe", j = "_motd_1rn2j_3", v = "_info_1rn2j_15 _motd_1rn2j_3", w = "_warn_1rn2j_21 _motd_1rn2j_3", C = "_error_1rn2j_26 _motd_1rn2j_3", M = {
6
6
  bgColourful3: g,
7
- bgColourful2: h,
8
- bgSubdued1: b,
7
+ bgColourful2: b,
8
+ bgSubdued1: h,
9
9
  motd: j,
10
10
  info: v,
11
11
  warn: w,
12
12
  error: C
13
- }, p = _(/* @__PURE__ */ r("path", {
14
- d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
15
- }), "Close");
16
- function k({ message: t }) {
17
- const [o, i] = l(t || ""), [f, c] = l(!0);
13
+ };
14
+ function k({ message: o }) {
15
+ const [r, i] = l(o || ""), [f, u] = l(!0);
18
16
  d(() => {
19
- t || fetch("undefined/motd").then((s) => {
20
- s.ok && s.json().then((e) => {
21
- e && e.motd && i(e.motd);
17
+ o || fetch("undefined/motd").then((s) => {
18
+ s.ok && s.json().then((t) => {
19
+ t && t.motd && i(t.motd);
22
20
  });
23
21
  }).catch(() => {
24
22
  console.warn("MOTD Failed");
25
23
  });
26
- }, [t]);
27
- const n = m(() => o.startsWith("info:") ? { msg: o.substring(5), level: "info" } : o.startsWith("warn:") ? { msg: o.substring(5), level: "warn" } : o.startsWith("error:") ? { msg: o.substring(6), level: "error" } : { msg: o, level: "info" }, [o]);
28
- return o.length > 0 && f ? /* @__PURE__ */ u("div", { className: M[n.level], children: [
29
- /* @__PURE__ */ r("div", { style: { flexGrow: 1 }, children: n.msg }),
30
- /* @__PURE__ */ r(
24
+ }, [o]);
25
+ const n = m(() => r.startsWith("info:") ? { msg: r.substring(5), level: "info" } : r.startsWith("warn:") ? { msg: r.substring(5), level: "warn" } : r.startsWith("error:") ? { msg: r.substring(6), level: "error" } : { msg: r, level: "info" }, [r]);
26
+ return r.length > 0 && f ? /* @__PURE__ */ c("div", { className: M[n.level], children: [
27
+ /* @__PURE__ */ e("div", { style: { flexGrow: 1 }, children: n.msg }),
28
+ /* @__PURE__ */ e(
31
29
  a,
32
30
  {
33
31
  color: "inherit",
34
- onClick: () => c(!1),
35
- children: /* @__PURE__ */ r(
36
- p,
32
+ onClick: () => u(!1),
33
+ children: /* @__PURE__ */ e(
34
+ _,
37
35
  {
38
36
  fontSize: "large",
39
37
  color: "inherit"
@@ -2,6 +2,10 @@ export type Colours = 'purple' | 'green' | 'blue' | 'red' | 'orange';
2
2
  interface Props {
3
3
  colour: Colours;
4
4
  value: number;
5
+ hideLabel?: boolean;
6
+ orientation?: 'horizontal' | 'vertical';
7
+ thickness?: number;
8
+ style?: React.CSSProperties;
5
9
  }
6
- export default function PercentageBar({ colour, value }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export default function PercentageBar({ colour, value, hideLabel, orientation, thickness, style: cssStyle }: Props): import("react/jsx-runtime").JSX.Element;
7
11
  export {};
@@ -1,37 +1,43 @@
1
- import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
- import '../../assets/PercentageBar.css';const _ = "_outer_1pzwa_1", n = "_orange_1pzwa_8", l = "_progress_1pzwa_11", p = "_purple_1pzwa_15", c = "_blue_1pzwa_22", u = "_green_1pzwa_29", d = "_red_1pzwa_36", g = "_label_1pzwa_53", e = {
3
- outer: _,
4
- orange: n,
5
- progress: l,
6
- purple: p,
7
- blue: c,
1
+ import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
+ import '../../assets/PercentageBar.css';const i = "_outer_161yr_1", p = "_orange_161yr_8", g = "_progress_161yr_11", h = "_purple_161yr_15", d = "_blue_161yr_22", u = "_green_161yr_29", y = "_red_161yr_36", $ = "_label_161yr_53", v = "_horizontal_161yr_63", b = "_vertical_161yr_68", r = {
3
+ outer: i,
4
+ orange: p,
5
+ progress: g,
6
+ purple: h,
7
+ blue: d,
8
8
  green: u,
9
- red: d,
10
- label: g
9
+ red: y,
10
+ label: $,
11
+ horizontal: v,
12
+ vertical: b
11
13
  };
12
- function i({ colour: s, value: t }) {
13
- const r = Math.round(t);
14
- return /* @__PURE__ */ a("div", { className: `${e.outer} ${e[s]}`, children: [
15
- /* @__PURE__ */ o(
16
- "div",
17
- {
18
- className: `${e.progress} ${e[s]}`,
19
- style: { width: `${r}%` }
20
- }
21
- ),
22
- /* @__PURE__ */ a(
23
- "div",
24
- {
25
- className: e.label,
26
- style: { width: `${r}%` },
27
- children: [
28
- r,
29
- "%"
30
- ]
31
- }
32
- )
33
- ] });
14
+ function x({ colour: o, value: a, hideLabel: c, orientation: t, thickness: l, style: _ }) {
15
+ const e = Math.round(a);
16
+ return /* @__PURE__ */ n(
17
+ "div",
18
+ {
19
+ className: `${r.outer} ${r[o]} ${r[t || "horizontal"]}`,
20
+ style: l ? t === "vertical" ? { width: `${l}px`, ..._ } : { height: `${l}px`, ..._ } : _,
21
+ children: [
22
+ /* @__PURE__ */ s(
23
+ "div",
24
+ {
25
+ className: `${r.progress} ${r[o]}`,
26
+ style: t === "vertical" ? { height: `${e}%` } : { width: `${e}%` }
27
+ }
28
+ ),
29
+ !c && /* @__PURE__ */ s(
30
+ "div",
31
+ {
32
+ className: r.label,
33
+ style: t === "vertical" ? { height: `${e}%` } : { width: `${e}%` },
34
+ children: `${e}%`
35
+ }
36
+ )
37
+ ]
38
+ }
39
+ );
34
40
  }
35
41
  export {
36
- i as default
42
+ x as default
37
43
  };
@@ -0,0 +1,9 @@
1
+ import { PropsWithChildren } from 'react';
2
+ interface Props extends PropsWithChildren {
3
+ open?: boolean;
4
+ onClose?: () => void;
5
+ onOpen?: () => void;
6
+ position?: 'left' | 'right';
7
+ }
8
+ export default function SidePanel({ children, open, onClose, onOpen, position }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,117 @@
1
+ import { jsxs as h, jsx as r } from "react/jsx-runtime";
2
+ import { useState as d, useRef as x, useEffect as w } from "react";
3
+ import { C as E } from "../../Close-BGAFHd7i.js";
4
+ import { IconButton as H } from "@mui/material";
5
+ import '../../assets/SidePanel.css';const L = "_sidePanel_1j2co_1", N = "_closed_1j2co_14", P = "_opening_1j2co_19", $ = "_open_1j2co_19", C = "_resizer_1j2co_28", A = "_noSelect_1j2co_43", k = "_resizerBar_1j2co_47", X = "_resizing_1j2co_62", K = "_resizerHandle_1j2co_66", O = "_minimised_1j2co_84", U = "_content_1j2co_130", F = "_closeButton_1j2co_137", e = {
6
+ sidePanel: L,
7
+ closed: N,
8
+ opening: P,
9
+ open: $,
10
+ resizer: C,
11
+ noSelect: A,
12
+ resizerBar: k,
13
+ resizing: X,
14
+ resizerHandle: K,
15
+ minimised: O,
16
+ content: U,
17
+ closeButton: F
18
+ }, g = 30, v = Math.max(300, Math.floor(window.innerWidth * 0.25)), z = "sidePanelWidth";
19
+ function Q({ children: y, open: n, onClose: p, onOpen: M, position: c = "right" }) {
20
+ const [m, i] = d(n ? v : 0), u = x(null), [a, j] = d(!1), [_, I] = d(!1), [D, S] = d(!n), W = x(
21
+ window.sessionStorage.getItem(z) ? Number(window.sessionStorage.getItem(z)) : v
22
+ ), o = Math.floor(window.innerWidth / 2);
23
+ w(() => {
24
+ if (n)
25
+ I(!0), S(!1);
26
+ else {
27
+ i(0);
28
+ const t = setTimeout(() => {
29
+ S(!0);
30
+ }, 300);
31
+ return () => clearTimeout(t);
32
+ }
33
+ }, [n]), w(() => {
34
+ if (_) {
35
+ i(W.current || v);
36
+ const t = setTimeout(() => {
37
+ I(!1);
38
+ }, 300);
39
+ return () => clearTimeout(t);
40
+ }
41
+ }, [_]), w(() => {
42
+ if (a) {
43
+ let t = function(f) {
44
+ if (a && u.current) {
45
+ const T = u.current.getBoundingClientRect(), b = c === "right" ? T.right - f.clientX : f.clientX - T.left, l = Math.max(Math.min(b, o), g);
46
+ l - b > 10 ? i(0) : (W.current = l, i(l), window.sessionStorage.setItem(z, l.toString())), f.preventDefault();
47
+ }
48
+ }, s = function() {
49
+ j(!1);
50
+ };
51
+ return window.addEventListener("pointermove", t, { passive: !1 }), window.addEventListener("pointerup", s), document.body.classList.add(e.noSelect), () => {
52
+ window.removeEventListener("pointermove", t), window.removeEventListener("pointerup", s), document.body.classList.remove(e.noSelect);
53
+ };
54
+ }
55
+ }, [a, c, o]);
56
+ const B = m === 0, R = /* @__PURE__ */ h(
57
+ "div",
58
+ {
59
+ className: `${e.resizer} ${a ? e.resizing : ""}`,
60
+ onPointerDown: () => {
61
+ j(!0), M && M();
62
+ },
63
+ children: [
64
+ /* @__PURE__ */ r("div", { className: e.resizerBar }),
65
+ n && /* @__PURE__ */ r(
66
+ "div",
67
+ {
68
+ className: `${e.resizerHandle} ${B ? e.minimised : ""}`,
69
+ role: "separator",
70
+ "aria-orientation": "vertical",
71
+ "aria-label": "Resize sidebar",
72
+ tabIndex: 0,
73
+ "aria-valuenow": m,
74
+ "aria-valuemin": g,
75
+ "aria-valuemax": o,
76
+ onKeyDown: (t) => {
77
+ t.key === "ArrowRight" ? i((s) => Math.min(o, Math.max(0, s - 50))) : t.key === "ArrowLeft" && i((s) => Math.max(g, Math.min(o, s + 50)));
78
+ }
79
+ }
80
+ )
81
+ ]
82
+ }
83
+ );
84
+ return /* @__PURE__ */ h(
85
+ "section",
86
+ {
87
+ className: `${e.sidePanel} ${n ? e.open : e.closed} ${_ ? e.opening : ""}`,
88
+ style: { width: B ? 0 : m, visibility: D ? "hidden" : void 0 },
89
+ ref: u,
90
+ "aria-hidden": !n,
91
+ children: [
92
+ c === "right" && R,
93
+ /* @__PURE__ */ h("div", { className: e.content, children: [
94
+ p && /* @__PURE__ */ r("div", { className: e.closeButton, children: /* @__PURE__ */ r(
95
+ H,
96
+ {
97
+ onClick: p,
98
+ "data-testid": "sidepanel-close-button",
99
+ children: /* @__PURE__ */ r(
100
+ E,
101
+ {
102
+ fontSize: "medium",
103
+ htmlColor: "#444"
104
+ }
105
+ )
106
+ }
107
+ ) }),
108
+ y
109
+ ] }),
110
+ c === "left" && R
111
+ ]
112
+ }
113
+ );
114
+ }
115
+ export {
116
+ Q as default
117
+ };
package/dist/main.d.ts CHANGED
@@ -18,6 +18,7 @@ export { default as BusyButton } from './components/BusyButton/BusyButton';
18
18
  export { default as AlertPara } from './components/AlertPara/AlertPara';
19
19
  export { default as QRCode } from './components/QRCode/QRCode';
20
20
  export { default as Webcam } from './components/Webcam/Webcam';
21
+ export { default as SidePanel } from './components/SidePanel/SidePanel';
21
22
  export { default as ContentLoader } from './components/ContentLoader/ContentLoader';
22
23
  export { WorkflowLayout, type IConnection, Widget, SvgLayer, type ILine, generateLines, extractNodesFromElements, } from './components/WorkflowLayout';
23
24
  export { default as LangSelect } from './components/LangSelect/LangSelect';
package/dist/main.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { default as o } from "./components/ConnectionStatus/ConnectionStatus.js";
2
2
  import { Button as t, LargeButton as f, VerticalButton as m } from "./components/Button/Button.js";
3
3
  import { default as p } from "./hooks/peer.js";
4
- import { default as l } from "./services/peer2peer/Peer2Peer.js";
4
+ import { default as u } from "./services/peer2peer/Peer2Peer.js";
5
5
  import { useID as x } from "./hooks/id.js";
6
6
  import { useOnlyOnce as c } from "./hooks/onlyOnce.js";
7
7
  import { default as F } from "./hooks/random.js";
8
8
  import { theme as I } from "./style/theme.js";
9
- import { default as B } from "./util/randomId.js";
10
- import { canvasFromDataTransfer as P, canvasFromFile as S, canvasFromImage as y, canvasFromURL as T, canvasesFromFiles as b, cropTo as A, urlFromDataTransfer as C } from "./util/canvas.js";
9
+ import { default as S } from "./util/randomId.js";
10
+ import { canvasFromDataTransfer as B, canvasFromFile as L, canvasFromImage as y, canvasFromURL as T, canvasesFromFiles as b, cropTo as A, urlFromDataTransfer as C } from "./util/canvas.js";
11
11
  import { createZipBlob as M, loadZipFile as R, saveZipFile as W } from "./util/zip.js";
12
12
  import { useTabActive as O } from "./hooks/useTabActive.js";
13
13
  import { default as k } from "./components/Spinner/Spinner.js";
@@ -16,18 +16,19 @@ import { default as Q } from "./components/BusyButton/BusyButton.js";
16
16
  import { default as V } from "./components/AlertPara/AlertPara.js";
17
17
  import { default as q } from "./components/QRCode/QRCode.js";
18
18
  import { default as G } from "./components/Webcam/Webcam.js";
19
- import { default as J } from "./components/ContentLoader/ContentLoader.js";
20
- import { default as X } from "./components/WorkflowLayout/Layout.js";
21
- import { extractNodesFromElements as _, generateLines as $ } from "./components/WorkflowLayout/lines.js";
22
- import { Widget as re } from "./components/WorkflowLayout/Widget.js";
23
- import { S as ae } from "./SvgLayer-DHFiKVQ9.js";
24
- import { default as fe } from "./components/LangSelect/LangSelect.js";
25
- import { default as se } from "./components/IconMenu/Spacer.js";
26
- import { default as ue } from "./components/IconMenu/IconMenu.js";
27
- import { default as ne } from "./components/IconMenu/IconMenuInline.js";
28
- import { default as de } from "./components/IconMenu/Item.js";
29
- import { default as ie } from "./components/PercentageBar/PercentageBar.js";
30
- import { default as ve } from "./components/PieScore/PieScore.js";
19
+ import { default as J } from "./components/SidePanel/SidePanel.js";
20
+ import { default as X } from "./components/ContentLoader/ContentLoader.js";
21
+ import { default as _ } from "./components/WorkflowLayout/Layout.js";
22
+ import { extractNodesFromElements as ee, generateLines as re } from "./components/WorkflowLayout/lines.js";
23
+ import { Widget as ae } from "./components/WorkflowLayout/Widget.js";
24
+ import { S as fe } from "./SvgLayer-DHFiKVQ9.js";
25
+ import { default as se } from "./components/LangSelect/LangSelect.js";
26
+ import { default as le } from "./components/IconMenu/Spacer.js";
27
+ import { default as ne } from "./components/IconMenu/IconMenu.js";
28
+ import { default as de } from "./components/IconMenu/IconMenuInline.js";
29
+ import { default as ie } from "./components/IconMenu/Item.js";
30
+ import { default as ve } from "./components/PercentageBar/PercentageBar.js";
31
+ import { default as Pe } from "./components/PieScore/PieScore.js";
31
32
  import { default as ge } from "./components/Application/Application.js";
32
33
  export {
33
34
  V as AlertPara,
@@ -35,35 +36,36 @@ export {
35
36
  Q as BusyButton,
36
37
  t as Button,
37
38
  o as ConnectionStatus,
38
- J as ContentLoader,
39
- ue as IconMenu,
40
- ne as IconMenuInline,
41
- de as IconMenuItem,
42
- fe as LangSelect,
39
+ X as ContentLoader,
40
+ ne as IconMenu,
41
+ de as IconMenuInline,
42
+ ie as IconMenuItem,
43
+ se as LangSelect,
43
44
  f as LargeButton,
44
- l as Peer2Peer,
45
- ie as PercentageBar,
46
- ve as PieScore,
45
+ u as Peer2Peer,
46
+ ve as PercentageBar,
47
+ Pe as PieScore,
47
48
  E as Privacy,
48
49
  q as QRCode,
49
- se as Spacer,
50
+ J as SidePanel,
51
+ le as Spacer,
50
52
  k as Spinner,
51
- ae as SvgLayer,
53
+ fe as SvgLayer,
52
54
  m as VerticalButton,
53
55
  G as Webcam,
54
- re as Widget,
55
- X as WorkflowLayout,
56
- P as canvasFromDataTransfer,
57
- S as canvasFromFile,
56
+ ae as Widget,
57
+ _ as WorkflowLayout,
58
+ B as canvasFromDataTransfer,
59
+ L as canvasFromFile,
58
60
  y as canvasFromImage,
59
61
  T as canvasFromURL,
60
62
  b as canvasesFromFiles,
61
63
  M as createZipBlob,
62
64
  A as cropTo,
63
- _ as extractNodesFromElements,
64
- $ as generateLines,
65
+ ee as extractNodesFromElements,
66
+ re as generateLines,
65
67
  R as loadZipFile,
66
- B as randomId,
68
+ S as randomId,
67
69
  W as saveZipFile,
68
70
  I as theme,
69
71
  C as urlFromDataTransfer,
@@ -2,13 +2,13 @@ var u = Object.defineProperty;
2
2
  var f = (h, c, e) => c in h ? u(h, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[c] = e;
3
3
  var o = (h, c, e) => f(h, typeof c != "symbol" ? c + "" : c, e);
4
4
  import { E as m } from "../../index-SOhdqzHq.js";
5
- import { createAsym as w } from "../../util/crypto.js";
5
+ import { createAsym as T } from "../../util/crypto.js";
6
6
  import { base64ToBytes as d, bytesToBase64 as l } from "../../util/base64.js";
7
7
  import y from "./error.js";
8
- const T = 1e4;
8
+ const w = 1e4;
9
9
  class K extends m {
10
10
  /** Create a connection. If the dataConnection parameter is missing then it uses the websocket as a relay. */
11
- constructor(e, s, r, t, a) {
11
+ constructor(e, s, r, t, p) {
12
12
  super();
13
13
  o(this, "dataConnection");
14
14
  o(this, "peerInstance");
@@ -27,8 +27,8 @@ class K extends m {
27
27
  clearTimeout(this.connectTimeout), this.connectTimeout = -1, t.peerConnection.getStats().then((i) => {
28
28
  i.forEach((n) => {
29
29
  if (n.type === "candidate-pair" && (n.state === "succeeded" || n.state === "in-progress")) {
30
- const p = i.get(n.remoteCandidateId);
31
- (p == null ? void 0 : p.candidateType) === "relay" ? this._connType = "relay" : p && (this._connType = "p2p");
30
+ const a = i.get(n.remoteCandidateId);
31
+ (a == null ? void 0 : a.candidateType) === "relay" ? this._connType = "relay" : a && (this._connType = "p2p");
32
32
  }
33
33
  }), this._connType === "server" && console.warn("Failed to find p2p candidate", Array.from(i)), this.emit("open", this);
34
34
  });
@@ -39,11 +39,11 @@ class K extends m {
39
39
  }), t.on("error", (i) => {
40
40
  this.emit("error", i, this);
41
41
  }), t.on("iceStateChanged", (i) => {
42
- i === "disconnected" && t.open && t.close(), a && i === "checking" && (t.close(), this.emit("close", this, !1));
42
+ i === "disconnected" && t.open && t.close(), p && i === "checking" && (t.close(), this.emit("close", this, !1));
43
43
  });
44
44
  else {
45
- this._connType = "server", w().then(({ createSymCrypto: n, publicKey: p }) => {
46
- this.createCrypto = n, this.pubKey = p, this.sendCryptoHandshake(), this.emit("crypto");
45
+ this._connType = "server", T().then(({ createSymCrypto: n, publicKey: a }) => {
46
+ this.createCrypto = n, this.pubKey = a, this.sendCryptoHandshake(), this.emit("crypto");
47
47
  }).catch(() => {
48
48
  this.emit("error", { type: "no-crypto" }, this), this.close();
49
49
  });
@@ -56,7 +56,7 @@ class K extends m {
56
56
  }
57
57
  this.initiated && (this.connectTimeout = window.setTimeout(() => {
58
58
  this.connectTimeout = -1, this.open ? console.warn("Timeout, but already open") : (console.warn("Connect timeout", this), this.close(), this.emit("timeout", this));
59
- }, T));
59
+ }, w));
60
60
  }
61
61
  get connectionType() {
62
62
  return this._connType;
@@ -113,8 +113,8 @@ class K extends m {
113
113
  if (!s || !s.data || !s.iv) throw new y("Invalid encrypted packet");
114
114
  const r = await d(s.data), t = await d(s.iv);
115
115
  try {
116
- const a = await this.decrypt(new Uint8Array(r), new Uint8Array(t));
117
- this.emit("data", JSON.parse(a), this);
116
+ const p = await this.decrypt(r, t);
117
+ this.emit("data", JSON.parse(p), this);
118
118
  } catch {
119
119
  console.error("Decryption error");
120
120
  }
@@ -125,7 +125,7 @@ class K extends m {
125
125
  }
126
126
  async sendEncrypted(e) {
127
127
  if (this.encrypt) {
128
- const s = await this.encrypt(JSON.stringify(e)), r = await l(s[0]), t = await l(s[1]), a = JSON.stringify({
128
+ const s = await this.encrypt(JSON.stringify(e)), r = await l(s[0]), t = await l(s[1]), p = JSON.stringify({
129
129
  data: r,
130
130
  iv: t
131
131
  });
@@ -133,7 +133,7 @@ class K extends m {
133
133
  type: "DATA",
134
134
  src: this.peerInstance.id,
135
135
  dst: this.peer,
136
- payload: a
136
+ payload: p
137
137
  });
138
138
  } else
139
139
  throw new y("Failed to send, no key");
@@ -1,7 +1,7 @@
1
1
  export declare function createAsym(): Promise<{
2
2
  createSymCrypto: (rkey: string) => Promise<{
3
- encrypt: (data: string) => Promise<[ArrayBuffer, Uint8Array]>;
4
- decrypt: (data: ArrayBuffer, iv: Uint8Array) => Promise<string>;
3
+ encrypt: (data: string) => Promise<[ArrayBuffer, ArrayBuffer]>;
4
+ decrypt: (data: ArrayBuffer, iv: ArrayBuffer) => Promise<string>;
5
5
  }>;
6
6
  publicKey: string;
7
7
  }>;
@@ -4,7 +4,7 @@ function y(e) {
4
4
  function o(e) {
5
5
  return new TextEncoder().encode(e);
6
6
  }
7
- async function s() {
7
+ async function u() {
8
8
  const e = await crypto.subtle.generateKey(
9
9
  {
10
10
  name: "ECDH",
@@ -36,7 +36,7 @@ async function s() {
36
36
  );
37
37
  return {
38
38
  encrypt: async (c) => {
39
- const t = crypto.getRandomValues(new Uint8Array(12));
39
+ const t = crypto.getRandomValues(new Uint8Array(12)).buffer;
40
40
  return [await crypto.subtle.encrypt({ name: "AES-GCM", iv: t }, a, o(c)), t];
41
41
  },
42
42
  decrypt: async (c, t) => y(await crypto.subtle.decrypt({ name: "AES-GCM", iv: t }, a, c))
@@ -46,5 +46,5 @@ async function s() {
46
46
  };
47
47
  }
48
48
  export {
49
- s as createAsym
49
+ u as createAsym
50
50
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/base",
3
- "version": "4.1.3",
3
+ "version": "4.2.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -50,7 +50,10 @@
50
50
  "devDependencies": {
51
51
  "@emotion/react": "^11.14.0",
52
52
  "@emotion/styled": "^11.14.0",
53
- "@ladle/react": "^5.0.3",
53
+ "@eslint/compat": "^2.0.0",
54
+ "@eslint/eslintrc": "^3.3.1",
55
+ "@eslint/js": "^9.39.1",
56
+ "@ladle/react": "^5.1.1",
54
57
  "@mui/icons-material": "^7.3.1",
55
58
  "@mui/material": "^7.3.1",
56
59
  "@mui/x-charts": "^8.5.2",
@@ -62,15 +65,16 @@
62
65
  "@types/qrcode": "^1.5.5",
63
66
  "@types/react": "^18.3.3",
64
67
  "@types/react-dom": "^18.3.0",
65
- "@typescript-eslint/eslint-plugin": "^7.13.1",
66
- "@typescript-eslint/parser": "^7.13.1",
68
+ "@typescript-eslint/eslint-plugin": "^8.48.0",
69
+ "@typescript-eslint/parser": "^8.48.0",
67
70
  "@vitejs/plugin-react-swc": "^3.5.0",
68
71
  "@vitest/coverage-v8": "^3.0.4",
69
- "eslint": "^8.57.0",
70
- "eslint-plugin-react": "^7.34.3",
71
- "eslint-plugin-react-hooks": "^4.6.2",
72
- "eslint-plugin-react-refresh": "^0.4.7",
72
+ "eslint": "^9.39.1",
73
+ "eslint-plugin-react": "^7.37.5",
74
+ "eslint-plugin-react-hooks": "^7.0.1",
75
+ "eslint-plugin-react-refresh": "^0.4.24",
73
76
  "glob": "^11.0.0",
77
+ "globals": "^16.5.0",
74
78
  "jsdom": "^26.1.0",
75
79
  "react": "^19.1.1",
76
80
  "react-dom": "^19.1.1",