@genai-fi/base 3.0.2 → 4.0.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.
Files changed (83) hide show
  1. package/README.md +6 -9
  2. package/dist/Button-CGKw9sMz.js +656 -0
  3. package/dist/CircularProgress-C6sMwjDC.js +1275 -0
  4. package/dist/{DefaultPropsProvider-C0Ib4Mye.js → DefaultPropsProvider-D2IJ8Qbs.js} +5 -1
  5. package/dist/{DialogQR-DVWhImXI.js → DialogQR-wJru73YO.js} +10 -5
  6. package/dist/{FlashWifi-CaAOKd3g.js → FlashWifi-CYp0UP0B.js} +1 -1
  7. package/dist/Portal-BqkDy0Wc.js +613 -0
  8. package/dist/SvgLayer-DQQ6Pb5G.js +37 -0
  9. package/dist/assets/IconButtonDot.css +1 -0
  10. package/dist/assets/LangSelect.css +1 -0
  11. package/dist/assets/Loading.css +1 -0
  12. package/dist/assets/PercentageBar.css +1 -0
  13. package/dist/assets/PieScore.css +1 -0
  14. package/dist/assets/SvgLayer.css +1 -0
  15. package/dist/assets/Widget.css +1 -0
  16. package/dist/assets/style.css +1 -1
  17. package/dist/assets/style2.css +1 -0
  18. package/dist/colours.module.css +4 -0
  19. package/dist/components/AlertPara/AlertPara.js +1 -1
  20. package/dist/components/Application/Application.d.ts +10 -0
  21. package/dist/components/Application/Application.js +1610 -0
  22. package/dist/components/BusyButton/BusyButton.js +7 -6
  23. package/dist/components/Button/Button.js +12 -4
  24. package/dist/components/ConnectionStatus/ConnectionStatus.d.ts +1 -5
  25. package/dist/components/ConnectionStatus/ConnectionStatus.js +48 -47
  26. package/dist/components/ConnectionStatus/FlashWifi.js +1 -1
  27. package/dist/components/ContentLoader/ContentError.js +1 -1
  28. package/dist/components/ContentLoader/ContentLoader.js +5 -1
  29. package/dist/components/ContentLoader/ContentProgress.js +1 -1
  30. package/dist/components/IconButtonDot/IconButtonDot.d.ts +7 -0
  31. package/dist/components/IconButtonDot/IconButtonDot.js +22 -0
  32. package/dist/components/IconMenu/IconMenu.d.ts +12 -0
  33. package/dist/components/IconMenu/IconMenu.js +26 -0
  34. package/dist/components/IconMenu/IconMenuInline.d.ts +6 -0
  35. package/dist/components/IconMenu/IconMenuInline.js +12 -0
  36. package/dist/components/IconMenu/Item.d.ts +9 -0
  37. package/dist/components/IconMenu/Item.js +34 -0
  38. package/dist/components/IconMenu/Spacer.d.ts +1 -0
  39. package/dist/components/IconMenu/Spacer.js +11 -0
  40. package/dist/components/IconMenu/context.d.ts +1 -0
  41. package/dist/components/IconMenu/context.js +5 -0
  42. package/dist/components/IconMenu/index.d.ts +4 -0
  43. package/dist/components/IconMenu/index.js +10 -0
  44. package/dist/components/LangSelect/LangSelect.d.ts +12 -0
  45. package/dist/components/LangSelect/LangSelect.js +46 -0
  46. package/dist/components/Loading/Loading.d.ts +7 -0
  47. package/dist/components/Loading/Loading.js +15 -0
  48. package/dist/components/Motd/Motd.js +1 -1
  49. package/dist/components/PercentageBar/PercentageBar.d.ts +7 -0
  50. package/dist/components/PercentageBar/PercentageBar.js +37 -0
  51. package/dist/components/PieScore/PieScore.d.ts +6 -0
  52. package/dist/components/PieScore/PieScore.js +10676 -0
  53. package/dist/components/QRCode/DialogQR.js +9 -4
  54. package/dist/components/QRCode/QRCode.js +1 -1
  55. package/dist/components/Webcam/Webcam.js +3 -3
  56. package/dist/components/WorkflowLayout/Layout.d.ts +7 -0
  57. package/dist/components/WorkflowLayout/Layout.js +44 -0
  58. package/dist/components/WorkflowLayout/SvgLayer.d.ts +14 -0
  59. package/dist/components/WorkflowLayout/SvgLayer.js +5 -0
  60. package/dist/components/WorkflowLayout/Widget.d.ts +19 -0
  61. package/dist/components/WorkflowLayout/Widget.js +7421 -0
  62. package/dist/components/WorkflowLayout/index.d.ts +4 -0
  63. package/dist/components/WorkflowLayout/index.js +11 -0
  64. package/dist/components/WorkflowLayout/lines.d.ts +17 -0
  65. package/dist/components/WorkflowLayout/lines.js +39 -0
  66. package/dist/{createSvgIcon-BfF8yuCp.js → createSvgIcon-DmrVEdN7.js} +2 -2
  67. package/dist/{createTheme-BIcG8YPQ.js → createTheme-a85zdZWm.js} +4 -0
  68. package/dist/hooks/peer.d.ts +25 -2
  69. package/dist/hooks/peer.js +196 -54
  70. package/dist/main.d.ts +6 -0
  71. package/dist/main.js +58 -33
  72. package/dist/react-D_xU5dL6.js +112 -0
  73. package/dist/state/webrtcState.js +5 -4
  74. package/dist/style/theme.js +1 -1
  75. package/dist/style.module-BAnhZ_KJ.js +9 -0
  76. package/dist/style.module-BDpZJv9y.js +26 -0
  77. package/dist/util/Observer.d.ts +7 -0
  78. package/dist/util/Observer.js +9 -0
  79. package/dist/{webrtcState-D0nJpE9Z.js → vanilla-BJxibF1U.js} +83 -85
  80. package/package.json +8 -2
  81. package/dist/Button-DQwRVw4a.js +0 -1918
  82. package/dist/react-D-b-Xrzv.js +0 -98
  83. package/dist/style.module-DSFm2eLD.js +0 -9
@@ -0,0 +1,4 @@
1
+ export { default as WorkflowLayout } from './Layout';
2
+ export { type IConnection, extractNodesFromElements, generateLines } from './lines';
3
+ export { Widget } from './Widget';
4
+ export { default as SvgLayer, type ILine } from './SvgLayer';
@@ -0,0 +1,11 @@
1
+ import { default as r } from "./Layout.js";
2
+ import { extractNodesFromElements as a, generateLines as f } from "./lines.js";
3
+ import { Widget as s } from "./Widget.js";
4
+ import { S as p } from "../../SvgLayer-DQQ6Pb5G.js";
5
+ export {
6
+ p as SvgLayer,
7
+ s as Widget,
8
+ r as WorkflowLayout,
9
+ a as extractNodesFromElements,
10
+ f as generateLines
11
+ };
@@ -0,0 +1,17 @@
1
+ import { ILine } from '../../components/WorkflowLayout/SvgLayer';
2
+ export interface INode {
3
+ x: number;
4
+ y: number;
5
+ width: number;
6
+ height: number;
7
+ id: string;
8
+ }
9
+ export declare function extractNodesFromElements(div: HTMLElement, initial?: Map<string, INode[]>): Map<string, INode[]>;
10
+ export type ConnectionPoint = 'left' | 'right' | 'top' | 'bottom';
11
+ export interface IConnection {
12
+ start: string;
13
+ startPoint: ConnectionPoint;
14
+ end: string;
15
+ endPoint: ConnectionPoint;
16
+ }
17
+ export declare function generateLines(data: Map<string, INode[]>, connections: IConnection[]): ILine[];
@@ -0,0 +1,39 @@
1
+ var d, f;
2
+ const g = ((f = (d = globalThis == null ? void 0 : globalThis.process) == null ? void 0 : d.env) == null ? void 0 : f.NODE_ENV) === "test";
3
+ function a(s, h) {
4
+ var o;
5
+ const n = h || /* @__PURE__ */ new Map();
6
+ for (let r = 0; r < s.children.length; ++r) {
7
+ const i = s.children[r], t = i.getAttribute("data-widget");
8
+ if (t === "container")
9
+ a(i, n);
10
+ else if (t) {
11
+ n.has(t) || n.set(t, []);
12
+ const e = i.offsetWidth, c = i.offsetHeight;
13
+ (g || e > 0 && c > 0) && ((o = n.get(t)) == null || o.push({ x: i.offsetLeft, y: i.offsetTop, width: e, height: c, id: i.id || "noid" }));
14
+ }
15
+ }
16
+ return n;
17
+ }
18
+ function l(s, h) {
19
+ const n = [];
20
+ for (const o of h) {
21
+ const r = s.get(o.start) || [], i = s.get(o.end) || [];
22
+ for (const t of r)
23
+ for (const e of i)
24
+ n.push({
25
+ id1: t.id,
26
+ id2: e.id,
27
+ x1: o.startPoint === "left" ? t.x : o.startPoint === "right" ? t.x + t.width : t.x + t.width / 2,
28
+ x2: o.endPoint === "left" ? e.x : o.endPoint === "right" ? e.x + e.width : e.x + e.width / 2,
29
+ y1: o.startPoint === "top" ? t.y : o.startPoint === "bottom" ? t.y + t.height : t.y + t.height / 2,
30
+ y2: o.endPoint === "top" ? e.y : o.endPoint === "bottom" ? e.y + e.height : e.y + e.height / 2,
31
+ direction: o.startPoint === "top" || o.startPoint === "bottom" ? "vertical" : "horizontal"
32
+ });
33
+ }
34
+ return n;
35
+ }
36
+ export {
37
+ a as extractNodesFromElements,
38
+ l as generateLines
39
+ };
@@ -1,7 +1,7 @@
1
1
  import * as h from "react";
2
2
  import { jsxs as b, jsx as I } from "react/jsx-runtime";
3
- import { g as w, a as z, P as e } from "./createTheme-BIcG8YPQ.js";
4
- import { g as N, u as C, s as O, c as T, a as R, m as E } from "./DefaultPropsProvider-C0Ib4Mye.js";
3
+ import { g as w, a as z, P as e } from "./createTheme-a85zdZWm.js";
4
+ import { g as N, u as C, s as O, c as T, a as R, m as E } from "./DefaultPropsProvider-D2IJ8Qbs.js";
5
5
  function j(o) {
6
6
  return w("MuiSvgIcon", o);
7
7
  }
@@ -2888,8 +2888,12 @@ export {
2888
2888
  yn as b,
2889
2889
  no as c,
2890
2890
  fn as d,
2891
+ Ge as e,
2892
+ de as f,
2891
2893
  pn as g,
2894
+ Z as h,
2892
2895
  fe as i,
2896
+ qn as j,
2893
2897
  Yr as r,
2894
2898
  Ke as s
2895
2899
  };
@@ -1,5 +1,28 @@
1
+ import { PropsWithChildren } from 'react';
1
2
  import { default as Peer2Peer, P2POptions } from '../services/peer2peer/Peer2Peer';
2
- import { Connection, PeerEvent } from '../services/peer2peer/types';
3
+ import { Connection, PeerEvent, PeerStatus } from '../services/peer2peer/types';
4
+ export declare const PeerProvider: import('react').Provider<Peer2Peer<PeerEvent> | null>;
5
+ interface PeerProps extends PropsWithChildren {
6
+ code: string;
7
+ server?: string;
8
+ forceTURN?: boolean;
9
+ forceWebsocket?: boolean;
10
+ host?: string;
11
+ secure?: boolean;
12
+ peerkey: string;
13
+ port?: number;
14
+ disabled?: boolean;
15
+ }
16
+ export declare function Peer<T extends PeerEvent>({ children, code, server, host, secure, peerkey, port, forceTURN, forceWebsocket, disabled, }: PeerProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function usePeerObject<T extends PeerEvent>(): Peer2Peer<T> | null;
18
+ export declare function usePeerSender<T extends PeerEvent>(): (data: T, exclude?: string[]) => void;
19
+ export declare function usePeerStatus(): PeerStatus;
20
+ export declare function usePeerOpen(fn: () => void): void;
21
+ export declare function usePeerClose<T extends PeerEvent>(fn: (conn?: Connection<T>) => void): void;
22
+ export declare function usePeerData<T extends PeerEvent>(fn: (data: T, conn: Connection<T>) => void): void;
23
+ export declare function usePeerEvent<T extends PeerEvent>(event: T['event'], fn: (data: T, conn: Connection<T>) => void): void;
24
+ export declare function usePeerConnect<T extends PeerEvent>(fn: (conn: Connection<T>) => void): void;
25
+ export declare function usePeerError(fn: (err: string) => void): void;
3
26
  interface Callbacks<T extends PeerEvent> {
4
27
  onOpen?: () => void;
5
28
  onConnect?: (conn: Connection<T>) => void;
@@ -16,7 +39,7 @@ interface Props<T extends PeerEvent> extends Callbacks<T>, P2POptions {
16
39
  port?: number;
17
40
  disabled?: boolean;
18
41
  }
19
- export type PeerProps<T extends PeerEvent> = Props<T>;
42
+ /** @deprecated */
20
43
  export default function usePeer<T extends PeerEvent>({ code, server, host, secure, port, key, disabled, onOpen, onClose, onError, onData, onConnect, forceTURN, forceWebsocket, }: Props<T>): {
21
44
  send: ((data: T, exclude?: string[]) => void) | undefined;
22
45
  ready: boolean;
@@ -1,70 +1,212 @@
1
- import { useState as S, useRef as x, useEffect as D } from "react";
2
- import { i as E, w as T } from "../webrtcState-D0nJpE9Z.js";
3
- import V from "../services/peer2peer/Peer2Peer.js";
4
- import { u as q, a as z } from "../react-D-b-Xrzv.js";
5
- function I({
6
- code: u,
7
- server: i,
8
- host: f,
9
- secure: l,
10
- port: d,
11
- key: m,
12
- disabled: p,
1
+ import { jsx as B } from "react/jsx-runtime";
2
+ import { createContext as F, useState as y, useRef as p, useEffect as c, useContext as i } from "react";
3
+ import { iceConfig as E, webrtcActive as O } from "../state/webrtcState.js";
4
+ import R from "../services/peer2peer/Peer2Peer.js";
5
+ import { a as T, u as V } from "../react-D_xU5dL6.js";
6
+ const f = F(null), G = f.Provider;
7
+ function Q({
8
+ children: e,
9
+ code: t,
10
+ server: n,
11
+ host: r,
12
+ secure: o,
13
+ peerkey: s,
14
+ port: a,
15
+ forceTURN: C,
16
+ forceWebsocket: b,
17
+ disabled: S
18
+ }) {
19
+ const [v, w] = y(null), [l, P] = T(O), d = V(E);
20
+ return c(() => {
21
+ if (S) {
22
+ P("disabled");
23
+ return;
24
+ }
25
+ if (l === "unset") return;
26
+ if (l === "disabled") {
27
+ P("unset");
28
+ return;
29
+ }
30
+ if (!t || !d)
31
+ return;
32
+ const x = new R(
33
+ t,
34
+ r || "api2.gen-ai.fi",
35
+ o || !0,
36
+ s,
37
+ a || 443,
38
+ d,
39
+ l === "relay",
40
+ n,
41
+ { forceTURN: C, forceWebsocket: b }
42
+ );
43
+ return w(x), () => {
44
+ x.destroy();
45
+ };
46
+ }, [t, r, o, s, a, n, l, d, C, b, S, P]), /* @__PURE__ */ B(G, { value: v, children: e });
47
+ }
48
+ function W() {
49
+ return i(f);
50
+ }
51
+ const H = () => {
52
+ };
53
+ function X() {
54
+ const e = i(f);
55
+ return e ? e.boundSendAll : H;
56
+ }
57
+ function Y() {
58
+ const e = i(f), [t, n] = y((e == null ? void 0 : e.status) || "connecting");
59
+ return c(() => {
60
+ if (e) {
61
+ const r = (o) => n(o);
62
+ return n(e.status), e.on("status", r), () => {
63
+ e.off("status", r);
64
+ };
65
+ }
66
+ }, [e]), t;
67
+ }
68
+ function Z(e) {
69
+ const t = i(f), n = p(e);
70
+ n.current = e, c(() => {
71
+ if (t) {
72
+ const r = () => n.current();
73
+ return t.on("open", r), () => {
74
+ t.off("open", r);
75
+ };
76
+ }
77
+ }, [t]);
78
+ }
79
+ function _(e) {
80
+ const t = i(f), n = p(e);
81
+ n.current = e, c(() => {
82
+ if (t) {
83
+ const r = (o) => n.current(o);
84
+ return t.on("close", r), () => {
85
+ t.off("close", r);
86
+ };
87
+ }
88
+ }, [t]);
89
+ }
90
+ function $(e) {
91
+ const t = i(f), n = p(e);
92
+ n.current = e, c(() => {
93
+ if (t) {
94
+ const r = (o, s) => n.current(o, s);
95
+ return t.on("data", r), () => {
96
+ t.off("data", r);
97
+ };
98
+ }
99
+ }, [t]);
100
+ }
101
+ function N(e, t) {
102
+ const n = i(f), r = p(t);
103
+ r.current = t, c(() => {
104
+ if (n) {
105
+ const o = (s, a) => {
106
+ s.event === e && r.current(s, a);
107
+ };
108
+ return n.on("data", o), () => {
109
+ n.off("data", o);
110
+ };
111
+ }
112
+ }, [n, e]);
113
+ }
114
+ function U(e) {
115
+ const t = i(f), n = p(e);
116
+ n.current = e, c(() => {
117
+ if (t) {
118
+ const r = (o) => n.current(o);
119
+ return t.on("connect", r), () => {
120
+ t.off("connect", r);
121
+ };
122
+ }
123
+ }, [t]);
124
+ }
125
+ function k(e) {
126
+ const t = i(f), n = p(e);
127
+ n.current = e, c(() => {
128
+ if (t) {
129
+ const r = (o) => n.current(o);
130
+ return t.on("error", r), () => {
131
+ t.off("error", r);
132
+ };
133
+ }
134
+ }, [t]);
135
+ }
136
+ function ee({
137
+ code: e,
138
+ server: t,
139
+ host: n,
140
+ secure: r,
141
+ port: o,
142
+ key: s,
143
+ disabled: a,
13
144
  onOpen: C,
14
145
  onClose: b,
15
- onError: w,
16
- onData: A,
17
- onConnect: P,
18
- forceTURN: g,
19
- forceWebsocket: y
146
+ onError: S,
147
+ onData: v,
148
+ onConnect: w,
149
+ forceTURN: l,
150
+ forceWebsocket: P
20
151
  }) {
21
- const [s, R] = S(), e = x({}), [o, c] = q(T), a = z(E), [j, n] = S("connecting");
22
- return D(() => {
23
- e.current.onClose = b, e.current.onOpen = C, e.current.onConnect = P, e.current.onError = w, e.current.onData = A;
24
- }, [A, C, b, w, P]), D(() => {
25
- if (p) {
26
- n("failed"), c("disabled");
152
+ const [d, x] = y(), u = p({}), [A, j] = T(O), D = V(E), [q, g] = y("connecting");
153
+ return c(() => {
154
+ u.current.onClose = b, u.current.onOpen = C, u.current.onConnect = w, u.current.onError = S, u.current.onData = v;
155
+ }, [v, C, b, S, w]), c(() => {
156
+ if (a) {
157
+ g("failed"), j("disabled");
27
158
  return;
28
159
  } else
29
- n("connecting");
30
- if (o === "unset") return;
31
- if (o === "disabled") {
32
- c("unset");
160
+ g("connecting");
161
+ if (A === "unset") return;
162
+ if (A === "disabled") {
163
+ j("unset");
33
164
  return;
34
165
  }
35
- if (!u) return;
36
- if (!a) {
166
+ if (!e) return;
167
+ if (!D) {
37
168
  setTimeout(() => {
38
- n("failed");
39
- }, 5e3), n("failed");
169
+ g("failed");
170
+ }, 5e3), g("failed");
40
171
  return;
41
172
  }
42
- const t = new V(
43
- u,
44
- f,
45
- l || !1,
46
- m || "peerjs",
47
- d || 443,
48
- a,
49
- o === "relay",
50
- i,
51
- { forceTURN: g, forceWebsocket: y }
173
+ const m = new R(
174
+ e,
175
+ n,
176
+ r || !1,
177
+ s || "peerjs",
178
+ o || 443,
179
+ D,
180
+ A === "relay",
181
+ t,
182
+ { forceTURN: l, forceWebsocket: P }
52
183
  );
53
- return t.on("status", n), t.on("data", (r, v) => {
54
- e.current.onData && e.current.onData(r, v);
55
- }), t.on("close", (r) => {
56
- e.current.onClose && e.current.onClose(r);
57
- }), t.on("connect", (r) => {
58
- e.current.onConnect && e.current.onConnect(r);
59
- }), R(t), () => {
60
- t.destroy();
184
+ return m.on("status", g), m.on("data", (h, z) => {
185
+ u.current.onData && u.current.onData(h, z);
186
+ }), m.on("close", (h) => {
187
+ u.current.onClose && u.current.onClose(h);
188
+ }), m.on("connect", (h) => {
189
+ u.current.onConnect && u.current.onConnect(h);
190
+ }), x(m), () => {
191
+ m.destroy();
61
192
  };
62
- }, [u, i, o, a, f, m, d, l, p, c, g, y]), {
63
- send: s ? s.boundSendAll : void 0,
64
- ready: j === "ready",
65
- peer: s
193
+ }, [e, t, A, D, n, s, o, r, a, j, l, P]), {
194
+ send: d ? d.boundSendAll : void 0,
195
+ ready: q === "ready",
196
+ peer: d
66
197
  };
67
198
  }
68
199
  export {
69
- I as default
200
+ Q as Peer,
201
+ G as PeerProvider,
202
+ ee as default,
203
+ _ as usePeerClose,
204
+ U as usePeerConnect,
205
+ $ as usePeerData,
206
+ k as usePeerError,
207
+ N as usePeerEvent,
208
+ W as usePeerObject,
209
+ Z as usePeerOpen,
210
+ X as usePeerSender,
211
+ Y as usePeerStatus
70
212
  };
package/dist/main.d.ts CHANGED
@@ -19,3 +19,9 @@ 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
21
  export { default as ContentLoader } from './components/ContentLoader/ContentLoader';
22
+ export { WorkflowLayout, type IConnection, Widget, SvgLayer, type ILine, generateLines, extractNodesFromElements, } from './components/WorkflowLayout';
23
+ export { default as LangSelect } from './components/LangSelect/LangSelect';
24
+ export { IconMenu, IconMenuInline, IconMenuItem, Spacer } from './components/IconMenu';
25
+ export { default as PercentageBar } from './components/PercentageBar/PercentageBar';
26
+ export { default as PieScore } from './components/PieScore/PieScore';
27
+ export { default as Application } from './components/Application/Application';
package/dist/main.js CHANGED
@@ -1,49 +1,74 @@
1
1
  import { default as o } from "./components/ConnectionStatus/ConnectionStatus.js";
2
- import { B as t, L as f } from "./Button-DQwRVw4a.js";
3
- import { default as m } from "./hooks/peer.js";
2
+ import { Button as t, LargeButton as f } from "./components/Button/Button.js";
3
+ import { default as s } from "./hooks/peer.js";
4
4
  import { default as u } from "./services/peer2peer/Peer2Peer.js";
5
5
  import { useID as n } from "./hooks/id.js";
6
6
  import { useOnlyOnce as d } from "./hooks/onlyOnce.js";
7
7
  import { default as i } from "./hooks/random.js";
8
8
  import { theme as v } from "./style/theme.js";
9
- import { default as P } from "./util/randomId.js";
10
- import { canvasFromDataTransfer as T, canvasFromFile as b, canvasFromImage as y, canvasFromURL as C, canvasesFromFiles as D, cropTo as I, urlFromDataTransfer as R } from "./util/canvas.js";
11
- import { createZipBlob as g, loadZipFile as A, saveZipFile as O } from "./util/zip.js";
12
- import { useTabActive as h } from "./hooks/useTabActive.js";
13
- import { default as U } from "./components/Spinner/Spinner.js";
14
- import { default as j } from "./components/Privacy/Privacy.js";
15
- import { default as q } from "./components/BusyButton/BusyButton.js";
16
- import { default as z } from "./components/AlertPara/AlertPara.js";
17
- import { default as G } from "./components/QRCode/QRCode.js";
18
- import { default as J } from "./components/Webcam/Webcam.js";
19
- import { default as M } from "./components/ContentLoader/ContentLoader.js";
9
+ import { default as g } from "./util/randomId.js";
10
+ import { canvasFromDataTransfer as P, canvasFromFile as S, canvasFromImage as B, canvasFromURL as y, canvasesFromFiles as T, cropTo as b, urlFromDataTransfer as A } from "./util/canvas.js";
11
+ import { createZipBlob as D, loadZipFile as M, saveZipFile as R } from "./util/zip.js";
12
+ import { useTabActive as Z } from "./hooks/useTabActive.js";
13
+ import { default as h } from "./components/Spinner/Spinner.js";
14
+ import { default as w } from "./components/Privacy/Privacy.js";
15
+ import { default as N } from "./components/BusyButton/BusyButton.js";
16
+ import { default as U } from "./components/AlertPara/AlertPara.js";
17
+ import { default as q } from "./components/QRCode/QRCode.js";
18
+ import { default as G } from "./components/Webcam/Webcam.js";
19
+ import { default as J } from "./components/ContentLoader/ContentLoader.js";
20
+ import { default as V } from "./components/WorkflowLayout/Layout.js";
21
+ import { extractNodesFromElements as Y, generateLines as _ } from "./components/WorkflowLayout/lines.js";
22
+ import { Widget as ee } from "./components/WorkflowLayout/Widget.js";
23
+ import { S as oe } from "./SvgLayer-DQQ6Pb5G.js";
24
+ import { default as te } from "./components/LangSelect/LangSelect.js";
25
+ import { default as me } from "./components/IconMenu/Spacer.js";
26
+ import { default as pe } from "./components/IconMenu/IconMenu.js";
27
+ import { default as le } from "./components/IconMenu/IconMenuInline.js";
28
+ import { default as xe } from "./components/IconMenu/Item.js";
29
+ import { default as ce } from "./components/PercentageBar/PercentageBar.js";
30
+ import { default as Fe } from "./components/PieScore/PieScore.js";
31
+ import { default as Ie } from "./components/Application/Application.js";
20
32
  export {
21
- z as AlertPara,
22
- q as BusyButton,
33
+ U as AlertPara,
34
+ Ie as Application,
35
+ N as BusyButton,
23
36
  t as Button,
24
37
  o as ConnectionStatus,
25
- M as ContentLoader,
38
+ J as ContentLoader,
39
+ pe as IconMenu,
40
+ le as IconMenuInline,
41
+ xe as IconMenuItem,
42
+ te as LangSelect,
26
43
  f as LargeButton,
27
44
  u as Peer2Peer,
28
- j as Privacy,
29
- G as QRCode,
30
- U as Spinner,
31
- J as Webcam,
32
- T as canvasFromDataTransfer,
33
- b as canvasFromFile,
34
- y as canvasFromImage,
35
- C as canvasFromURL,
36
- D as canvasesFromFiles,
37
- g as createZipBlob,
38
- I as cropTo,
39
- A as loadZipFile,
40
- P as randomId,
41
- O as saveZipFile,
45
+ ce as PercentageBar,
46
+ Fe as PieScore,
47
+ w as Privacy,
48
+ q as QRCode,
49
+ me as Spacer,
50
+ h as Spinner,
51
+ oe as SvgLayer,
52
+ G as Webcam,
53
+ ee as Widget,
54
+ V as WorkflowLayout,
55
+ P as canvasFromDataTransfer,
56
+ S as canvasFromFile,
57
+ B as canvasFromImage,
58
+ y as canvasFromURL,
59
+ T as canvasesFromFiles,
60
+ D as createZipBlob,
61
+ b as cropTo,
62
+ Y as extractNodesFromElements,
63
+ _ as generateLines,
64
+ M as loadZipFile,
65
+ g as randomId,
66
+ R as saveZipFile,
42
67
  v as theme,
43
- R as urlFromDataTransfer,
68
+ A as urlFromDataTransfer,
44
69
  n as useID,
45
70
  d as useOnlyOnce,
46
- m as usePeer,
71
+ s as usePeer,
47
72
  i as useRandom,
48
- h as useTabActive
73
+ Z as useTabActive
49
74
  };
@@ -0,0 +1,112 @@
1
+ import _, { useReducer as R, useEffect as A, useDebugValue as S, useRef as x, createElement as y, createContext as C, useCallback as E, useContext as F } from "react";
2
+ import { c as V, g as j, I as h } from "./vanilla-BJxibF1U.js";
3
+ const k = {}, w = C(
4
+ void 0
5
+ );
6
+ function P(t) {
7
+ return F(w) || j();
8
+ }
9
+ function T({
10
+ children: t,
11
+ store: s
12
+ }) {
13
+ const u = x(void 0);
14
+ return !s && !u.current && (u.current = V()), y(
15
+ w.Provider,
16
+ {
17
+ value: s || u.current
18
+ },
19
+ t
20
+ );
21
+ }
22
+ const b = (t) => typeof (t == null ? void 0 : t.then) == "function", g = (t) => {
23
+ t.status || (t.status = "pending", t.then(
24
+ (s) => {
25
+ t.status = "fulfilled", t.value = s;
26
+ },
27
+ (s) => {
28
+ t.status = "rejected", t.reason = s;
29
+ }
30
+ ));
31
+ }, D = _.use || // A shim for older React versions
32
+ ((t) => {
33
+ if (t.status === "pending")
34
+ throw t;
35
+ if (t.status === "fulfilled")
36
+ return t.value;
37
+ throw t.status === "rejected" ? t.reason : (g(t), t);
38
+ }), d = /* @__PURE__ */ new WeakMap(), v = (t, s) => {
39
+ let u = d.get(t);
40
+ return u || (u = new Promise((o, n) => {
41
+ let a = t;
42
+ const l = (e) => (r) => {
43
+ a === e && o(r);
44
+ }, f = (e) => (r) => {
45
+ a === e && n(r);
46
+ }, c = () => {
47
+ try {
48
+ const e = s();
49
+ b(e) ? (d.set(e, u), a = e, e.then(l(e), f(e)), h(e, c)) : o(e);
50
+ } catch (e) {
51
+ n(e);
52
+ }
53
+ };
54
+ t.then(l(t), f(t)), h(t, c);
55
+ }), d.set(t, u)), u;
56
+ };
57
+ function I(t, s) {
58
+ const { delay: u, unstable_promiseStatus: o = !_.use } = {}, n = P(), [[a, l, f], c] = R(
59
+ (r) => {
60
+ const i = n.get(t);
61
+ return Object.is(r[0], i) && r[1] === n && r[2] === t ? r : [i, n, t];
62
+ },
63
+ void 0,
64
+ () => [n.get(t), n, t]
65
+ );
66
+ let e = a;
67
+ if ((l !== n || f !== t) && (c(), e = n.get(t)), A(() => {
68
+ const r = n.sub(t, () => {
69
+ if (o)
70
+ try {
71
+ const i = n.get(t);
72
+ b(i) && g(
73
+ v(i, () => n.get(t))
74
+ );
75
+ } catch {
76
+ }
77
+ if (typeof u == "number") {
78
+ setTimeout(c, u);
79
+ return;
80
+ }
81
+ c();
82
+ });
83
+ return c(), r;
84
+ }, [n, t, u, o]), S(e), b(e)) {
85
+ const r = v(e, () => n.get(t));
86
+ return o && g(r), D(r);
87
+ }
88
+ return e;
89
+ }
90
+ function L(t, s) {
91
+ const u = P();
92
+ return E(
93
+ (...n) => {
94
+ if ((k ? "production" : void 0) !== "production" && !("write" in t))
95
+ throw new Error("not writable atom");
96
+ return u.set(t, ...n);
97
+ },
98
+ [u, t]
99
+ );
100
+ }
101
+ function H(t, s) {
102
+ return [
103
+ I(t),
104
+ // We do wrong type assertion here, which results in throwing an error.
105
+ L(t)
106
+ ];
107
+ }
108
+ export {
109
+ T as P,
110
+ H as a,
111
+ I as u
112
+ };
@@ -1,6 +1,7 @@
1
- import { i, w as t, a as c } from "../webrtcState-D0nJpE9Z.js";
1
+ import { a as t } from "../vanilla-BJxibF1U.js";
2
+ const e = t("disabled"), c = t(void 0), i = t("unset");
2
3
  export {
3
- i as iceConfig,
4
- t as webrtcActive,
5
- c as webrtcCandidate
4
+ c as iceConfig,
5
+ e as webrtcActive,
6
+ i as webrtcCandidate
6
7
  };
@@ -1,4 +1,4 @@
1
- import { c as s } from "../createTheme-BIcG8YPQ.js";
1
+ import { c as s } from "../createTheme-a85zdZWm.js";
2
2
  import '../assets/theme.css';const t = "#008297", a = {
3
3
  primary: t
4
4
  };
@@ -0,0 +1,9 @@
1
+ import './assets/style2.css';const t = "_title_1bpz2_3", e = "_content_1bpz2_8", r = "_errorTitle_1bpz2_18", o = "_errorContent_1bpz2_23", n = {
2
+ title: t,
3
+ content: e,
4
+ errorTitle: r,
5
+ errorContent: o
6
+ };
7
+ export {
8
+ n as s
9
+ };