@ikonai/sdk-react-ui 1.3.5 → 1.3.7
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/index.js +648 -630
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IkonUiCore as e, LiveSnapshotCache as t, UiStreamStore as n, UiStreamStore as r, isPrerenderVisible as i, prefetchBootSnapshot as a } from "@ikonai/sdk-ui";
|
|
2
|
-
import { AccessDeniedError as o, AppStartupFailedError as s, AuthenticationError as c, IKON_INSPECT_MODE_CHANGED_EVENT as l, IkonClient as u, LogLevel as d, PKCE_URL_PARAM as f, ProvisioningTimeoutError as p, ServerFullError as m, ServerUnavailableError as h, SessionNotFoundError as g, abortSignalTimeout as _, adoptPkceVerifierFromUrl as v, clearLoginPrompt as y, createLogger as b, createPkceChallenge as x, deriveAuthUrl as S, deriveBackendType as ee, deriveCrossOriginAuthUrl as te, extractUserIdFromToken as ne, getDebugOverlayParam as re, getLangParam as ie, getLoginPromptState as C, getOrCreateDeviceId as ae, getSameOriginAuthUrl as w, isCloudEnvironment as oe, isDebugModeEnabled as se, isEmbedded as T, isInspectModeEnabled as ce, parseUrlParams as le, randomUuid as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { Fragment as
|
|
2
|
+
import { AccessDeniedError as o, AppStartupFailedError as s, AuthenticationError as c, IKON_INSPECT_MODE_CHANGED_EVENT as l, IkonClient as u, LogLevel as d, PKCE_URL_PARAM as f, ProvisioningTimeoutError as p, ServerFullError as m, ServerUnavailableError as h, SessionNotFoundError as g, abortSignalTimeout as _, adoptPkceVerifierFromUrl as v, clearLoginPrompt as y, createLogger as b, createPkceChallenge as x, deriveAuthUrl as S, deriveBackendType as ee, deriveCrossOriginAuthUrl as te, extractUserIdFromToken as ne, getDebugOverlayParam as re, getLangParam as ie, getLoginPromptState as C, getOrCreateDeviceId as ae, getSameOriginAuthUrl as w, isCloudEnvironment as oe, isDebugModeEnabled as se, isEmbedded as T, isInspectModeEnabled as ce, onEmbeddedOAuthResult as E, parseUrlParams as le, randomUuid as ue, reportConnectTimeline as de, restorePkceVerifier as fe, setLoginPromptRequired as pe, startEmbeddedOAuthSignIn as me, subscribeLoginPrompt as he, subscribeToLogEvents as ge, takePkceVerifier as _e } from "@ikonai/sdk";
|
|
3
|
+
import { Fragment as ve, createContext as ye, memo as D, use as be, useCallback as O, useEffect as k, useLayoutEffect as xe, useMemo as A, useReducer as Se, useRef as j, useState as M, useSyncExternalStore as N } from "react";
|
|
4
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
5
5
|
//#region src/renderer/use-root-view.ts
|
|
6
|
-
function
|
|
6
|
+
function Ce(e, t) {
|
|
7
7
|
let n = N((t) => e.subscribe(t), () => {
|
|
8
8
|
let n = e.getSnapshot(), r = t ?? n.rootViewId, i = r ? n.views.get(r) : void 0;
|
|
9
9
|
return `${r ?? ""}:${i?.id ?? ""}`;
|
|
@@ -21,7 +21,7 @@ function Se(e, t) {
|
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/renderer/use-ui-node.ts
|
|
24
|
-
function
|
|
24
|
+
function L(e, t) {
|
|
25
25
|
let n = N((n) => e.subscribeNode(t, n), () => e.getNodeVersion(t), () => e.getNodeVersion(t));
|
|
26
26
|
return A(() => e.getNode(t), [
|
|
27
27
|
e,
|
|
@@ -31,8 +31,8 @@ function I(e, t) {
|
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/renderer/ui-renderer.tsx
|
|
34
|
-
var
|
|
35
|
-
function
|
|
34
|
+
var we = b("UIRenderer");
|
|
35
|
+
function Te(e) {
|
|
36
36
|
if (e === void 0) return "{}";
|
|
37
37
|
if (typeof e == "string") return e;
|
|
38
38
|
try {
|
|
@@ -41,37 +41,37 @@ function we(e) {
|
|
|
41
41
|
return "{}";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ee(e) {
|
|
45
45
|
let t = e.styleIds;
|
|
46
46
|
return Array.isArray(t) ? t : [];
|
|
47
47
|
}
|
|
48
|
-
var
|
|
49
|
-
function
|
|
48
|
+
var De = 1500;
|
|
49
|
+
function Oe(e) {
|
|
50
50
|
let [t, n] = M(0);
|
|
51
51
|
return k(() => {
|
|
52
52
|
if (e.subscribe) return e.subscribe(() => n((e) => e + 1));
|
|
53
53
|
}, [e]), t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
let [i, a] = M(!1), o =
|
|
55
|
+
function ke({ nodeType: e, nodeId: t, context: n, className: r }) {
|
|
56
|
+
let [i, a] = M(!1), o = L(n.store, t), s = Oe(n.library), c = A(() => o ? n.library.resolve(o) : void 0, [
|
|
57
57
|
n.library,
|
|
58
58
|
o,
|
|
59
59
|
s
|
|
60
60
|
]);
|
|
61
61
|
return k(() => {
|
|
62
|
-
let e = setTimeout(() => a(!0),
|
|
62
|
+
let e = setTimeout(() => a(!0), De);
|
|
63
63
|
return () => clearTimeout(e);
|
|
64
64
|
}, [e]), k(() => {
|
|
65
|
-
!i || c ||
|
|
65
|
+
!i || c || we.error(`No React resolver is registered for node type '${e}', so it renders as an error placeholder instead of the component you expected. A custom node needs all four parts: (1) the React component, (2) a resolver that matches '${e}', (3) a registerModule(...) call for it in app.tsx, and (4) the C# view.AddNode("${e}", ...) extension. Prefer native view.* components where they fit.`);
|
|
66
66
|
}, [
|
|
67
67
|
i,
|
|
68
68
|
c,
|
|
69
69
|
e
|
|
70
|
-
]), c ? /* @__PURE__ */
|
|
70
|
+
]), c ? /* @__PURE__ */ F(c, {
|
|
71
71
|
nodeId: t,
|
|
72
72
|
context: n,
|
|
73
73
|
className: r
|
|
74
|
-
}) : i ? /* @__PURE__ */
|
|
74
|
+
}) : i ? /* @__PURE__ */ F("div", {
|
|
75
75
|
"data-ikon-node-id": t,
|
|
76
76
|
"data-ikon-unresolved-node": e,
|
|
77
77
|
role: "alert",
|
|
@@ -87,50 +87,50 @@ function Oe({ nodeType: e, nodeId: t, context: n, className: r }) {
|
|
|
87
87
|
children: `Unregistered node type: ${e}\nNo React resolver is registered for it — register the component's module in app.tsx (see the console for details).`
|
|
88
88
|
}) : null;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Ae(e) {
|
|
91
91
|
let t = e.children;
|
|
92
92
|
return Array.isArray(t) ? t : [];
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function je(e, t) {
|
|
95
95
|
return e.nodeId === t.nodeId && e.context === t.context;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Me(e) {
|
|
98
98
|
if (e.length === 0) return "";
|
|
99
99
|
if (e.length === 1) return e[0].id;
|
|
100
100
|
let t = e[0].id;
|
|
101
101
|
for (let n = 1; n < e.length; n++) t += "," + e[n].id;
|
|
102
102
|
return t;
|
|
103
103
|
}
|
|
104
|
-
var
|
|
105
|
-
let r =
|
|
104
|
+
var Ne = D(function e({ nodeId: t, context: n }) {
|
|
105
|
+
let r = L(n.store, t), i = r ? Ae(r) : [], a = Me(i), o = A(() => i.length === 0 ? null : i.map((t) => /* @__PURE__ */ F(e, {
|
|
106
106
|
nodeId: t.id,
|
|
107
107
|
context: n
|
|
108
108
|
}, t.id)), [a, n]);
|
|
109
109
|
if (!r) return null;
|
|
110
|
-
if (r.type === "root") return /* @__PURE__ */
|
|
111
|
-
let s =
|
|
112
|
-
return l ? /* @__PURE__ */
|
|
110
|
+
if (r.type === "root") return /* @__PURE__ */ F(ve, { children: o }, r.id);
|
|
111
|
+
let s = Ee(r), c = s.length > 0 ? s.join(" ") : void 0, l = n.library.resolve(r);
|
|
112
|
+
return l ? /* @__PURE__ */ F(l, {
|
|
113
113
|
nodeId: t,
|
|
114
114
|
context: n,
|
|
115
115
|
className: c
|
|
116
|
-
}) : /* @__PURE__ */
|
|
116
|
+
}) : /* @__PURE__ */ F(ke, {
|
|
117
117
|
nodeType: r.type,
|
|
118
118
|
nodeId: r.id,
|
|
119
119
|
context: n,
|
|
120
120
|
className: c
|
|
121
121
|
});
|
|
122
|
-
},
|
|
123
|
-
function
|
|
124
|
-
return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */
|
|
122
|
+
}, je);
|
|
123
|
+
function Pe(e, t) {
|
|
124
|
+
return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */ F(Ne, {
|
|
125
125
|
nodeId: e.id,
|
|
126
126
|
context: t
|
|
127
127
|
}, e.id));
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Fe(e, t) {
|
|
130
130
|
return e.store === t.store && e.library === t.library && e.viewId === t.viewId && e.emptyFallback === t.emptyFallback;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
133
|
-
let { rootViewId: s, rootNodeId: c } =
|
|
132
|
+
var Ie = D(function({ store: e, library: t, viewId: n, emptyFallback: r = null, onAction: i, client: a, video: o }) {
|
|
133
|
+
let { rootViewId: s, rootNodeId: c } = Ce(e, n), l = j(i);
|
|
134
134
|
l.current = i;
|
|
135
135
|
let u = j(a);
|
|
136
136
|
u.current = a;
|
|
@@ -138,7 +138,7 @@ var Fe = D(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
|
|
|
138
138
|
d.current = o;
|
|
139
139
|
let f = O((e, t) => {
|
|
140
140
|
if (!e) return;
|
|
141
|
-
let n =
|
|
141
|
+
let n = Te(t);
|
|
142
142
|
l.current?.(e, n);
|
|
143
143
|
}, []), p = A(() => {
|
|
144
144
|
let n = {
|
|
@@ -146,10 +146,10 @@ var Fe = D(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
|
|
|
146
146
|
library: t,
|
|
147
147
|
handlerCache: e.handlerCache,
|
|
148
148
|
getPayload: (t) => e.getSnapshot().payloads.get(t),
|
|
149
|
-
renderChildren: (e) =>
|
|
149
|
+
renderChildren: (e) => Pe(e, n),
|
|
150
150
|
renderView: (t) => {
|
|
151
151
|
let r = e.getSnapshot().views.get(t);
|
|
152
|
-
return r ? /* @__PURE__ */
|
|
152
|
+
return r ? /* @__PURE__ */ F(Ne, {
|
|
153
153
|
nodeId: r.id,
|
|
154
154
|
context: n
|
|
155
155
|
}) : null;
|
|
@@ -168,15 +168,15 @@ var Fe = D(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
|
|
|
168
168
|
t,
|
|
169
169
|
f
|
|
170
170
|
]);
|
|
171
|
-
return !s || !c ? r : /* @__PURE__ */
|
|
171
|
+
return !s || !c ? r : /* @__PURE__ */ F("div", {
|
|
172
172
|
"data-ikon-view-id": s,
|
|
173
173
|
style: { display: "contents" },
|
|
174
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ F(Ne, {
|
|
175
175
|
nodeId: c,
|
|
176
176
|
context: p
|
|
177
177
|
})
|
|
178
178
|
});
|
|
179
|
-
},
|
|
179
|
+
}, Fe), R = class {
|
|
180
180
|
fallback;
|
|
181
181
|
renderers = /* @__PURE__ */ new Map();
|
|
182
182
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -202,16 +202,16 @@ var Fe = D(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
|
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
204
|
function Le(e, t) {
|
|
205
|
-
return new
|
|
205
|
+
return new R(Object.entries(e), t);
|
|
206
206
|
}
|
|
207
207
|
//#endregion
|
|
208
208
|
//#region src/renderer/use-ui-store.ts
|
|
209
|
-
function
|
|
209
|
+
function Re(e) {
|
|
210
210
|
return N((t) => e.subscribe(t), () => e.getSnapshot(), () => e.getSnapshot());
|
|
211
211
|
}
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/inspect/inspect-overlay.tsx
|
|
214
|
-
function
|
|
214
|
+
function ze() {
|
|
215
215
|
let [e, t] = M(ce), n = j(!1);
|
|
216
216
|
return k(() => {
|
|
217
217
|
if (e) return;
|
|
@@ -351,11 +351,11 @@ function Re() {
|
|
|
351
351
|
}
|
|
352
352
|
//#endregion
|
|
353
353
|
//#region src/surface.tsx
|
|
354
|
-
var
|
|
355
|
-
function
|
|
354
|
+
var Be = b("IkonUiSurface"), Ve = "ikon-ui";
|
|
355
|
+
function He(e, t) {
|
|
356
356
|
return e === t;
|
|
357
357
|
}
|
|
358
|
-
var
|
|
358
|
+
var z = D(function({ stores: e, registry: t, category: n = Ve, onAction: r, client: i }) {
|
|
359
359
|
let a = A(() => Array.from(e.keys()).sort().join(","), [e]), o = j(r);
|
|
360
360
|
o.current = r;
|
|
361
361
|
let s = j(i);
|
|
@@ -364,7 +364,7 @@ var He = D(function({ stores: e, registry: t, category: n = Be, onAction: r, cli
|
|
|
364
364
|
let t = [];
|
|
365
365
|
for (let [r, i] of e) {
|
|
366
366
|
let e = i.store.getSnapshot();
|
|
367
|
-
|
|
367
|
+
He(i.category, n) && (!e.rootViewId || !e.views.has(e.rootViewId) || t.push({
|
|
368
368
|
key: r,
|
|
369
369
|
store: i.store
|
|
370
370
|
}));
|
|
@@ -376,8 +376,8 @@ var He = D(function({ stores: e, registry: t, category: n = Be, onAction: r, cli
|
|
|
376
376
|
a
|
|
377
377
|
]), l = j(!1), u = c.length > 0;
|
|
378
378
|
return k(() => {
|
|
379
|
-
u && !l.current && (l.current = !0,
|
|
380
|
-
}, [u]), u ? /* @__PURE__ */
|
|
379
|
+
u && !l.current && (l.current = !0, Be.debug("First UI render"));
|
|
380
|
+
}, [u]), u ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(ze, {}), c.map(({ key: e, store: n }) => /* @__PURE__ */ F(Ie, {
|
|
381
381
|
store: n,
|
|
382
382
|
library: t,
|
|
383
383
|
onAction: o.current,
|
|
@@ -456,7 +456,7 @@ var He = D(function({ stores: e, registry: t, category: n = Be, onAction: r, cli
|
|
|
456
456
|
let t = this.stores.get(e);
|
|
457
457
|
if (t) return t;
|
|
458
458
|
let n = {
|
|
459
|
-
category:
|
|
459
|
+
category: Ve,
|
|
460
460
|
store: new r()
|
|
461
461
|
};
|
|
462
462
|
return this.stores.set(e, n), n;
|
|
@@ -482,7 +482,7 @@ function We(e) {
|
|
|
482
482
|
return t.length > 0 ? t : void 0;
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function B(e) {
|
|
486
486
|
if (typeof e == "string") {
|
|
487
487
|
let t = e.trim();
|
|
488
488
|
return t.length > 0 ? t : void 0;
|
|
@@ -500,7 +500,7 @@ function Ge(...e) {
|
|
|
500
500
|
}
|
|
501
501
|
return t || void 0;
|
|
502
502
|
}
|
|
503
|
-
var
|
|
503
|
+
var Ke = /* @__PURE__ */ new WeakMap(), V = {};
|
|
504
504
|
function qe(e) {
|
|
505
505
|
let t = {};
|
|
506
506
|
for (let n of e.split(";")) {
|
|
@@ -513,16 +513,16 @@ function qe(e) {
|
|
|
513
513
|
}
|
|
514
514
|
return t;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Je(e, t) {
|
|
517
517
|
let n = e && typeof e == "object" ? e : void 0;
|
|
518
518
|
return t ? {
|
|
519
519
|
...n ?? {},
|
|
520
520
|
cursor: t
|
|
521
521
|
} : n;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
if (!e) return
|
|
525
|
-
let t =
|
|
523
|
+
function Ye(e) {
|
|
524
|
+
if (!e) return V;
|
|
525
|
+
let t = Ke.get(e);
|
|
526
526
|
if (t) return t;
|
|
527
527
|
let n = {};
|
|
528
528
|
for (let [t, r] of Object.entries(e)) if (r != null) {
|
|
@@ -532,9 +532,9 @@ function V(e) {
|
|
|
532
532
|
}
|
|
533
533
|
(typeof r == "string" || typeof r == "number" || typeof r == "boolean") && (n[t] = r);
|
|
534
534
|
}
|
|
535
|
-
return
|
|
535
|
+
return Ke.set(e, n), n;
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function Xe(e) {
|
|
538
538
|
let t = e.parentElement;
|
|
539
539
|
for (; t;) {
|
|
540
540
|
let e = window.getComputedStyle(t).overflowY;
|
|
@@ -543,34 +543,34 @@ function Je(e) {
|
|
|
543
543
|
}
|
|
544
544
|
return null;
|
|
545
545
|
}
|
|
546
|
-
var
|
|
547
|
-
function
|
|
546
|
+
var Ze = 1.5;
|
|
547
|
+
function Qe(e, t) {
|
|
548
548
|
requestAnimationFrame(() => {
|
|
549
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = e.scrollTop + (r.bottom - n.bottom) + 16, a = Math.abs(i - e.scrollTop) > e.clientHeight *
|
|
549
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = e.scrollTop + (r.bottom - n.bottom) + 16, a = Math.abs(i - e.scrollTop) > e.clientHeight * Ze ? "auto" : "smooth";
|
|
550
550
|
"scrollBehavior" in document.documentElement.style ? e.scrollTo({
|
|
551
551
|
top: i,
|
|
552
552
|
behavior: a
|
|
553
553
|
}) : e.scrollTop = i;
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
|
-
var
|
|
557
|
-
function
|
|
558
|
-
return Math.max(e.clientHeight *
|
|
556
|
+
var $e = "data-ikon-scroll-indicator", et = .15, H = "data-ikon-at-bottom";
|
|
557
|
+
function tt(e) {
|
|
558
|
+
return Math.max(e.clientHeight * et, 20);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
return e.getAttribute(
|
|
560
|
+
function nt(e) {
|
|
561
|
+
return e.getAttribute(H) !== "false";
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
e.getAttribute(
|
|
565
|
-
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e, i = n - t - r <=
|
|
566
|
-
e.setAttribute(
|
|
563
|
+
function rt(e) {
|
|
564
|
+
e.getAttribute(H) === null && (e.setAttribute(H, "true"), e.addEventListener("scroll", () => {
|
|
565
|
+
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e, i = n - t - r <= tt(e);
|
|
566
|
+
e.setAttribute(H, i ? "true" : "false");
|
|
567
567
|
}, { passive: !0 }));
|
|
568
568
|
}
|
|
569
|
-
function
|
|
570
|
-
let t = e.parentElement ?? e, n = t.querySelector(`[${
|
|
569
|
+
function it(e) {
|
|
570
|
+
let t = e.parentElement ?? e, n = t.querySelector(`[${$e}]`);
|
|
571
571
|
if (n) return n;
|
|
572
572
|
let r = document.createElement("button");
|
|
573
|
-
return r.setAttribute(
|
|
573
|
+
return r.setAttribute($e, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
|
|
574
574
|
position: "absolute",
|
|
575
575
|
bottom: "12px",
|
|
576
576
|
left: "50%",
|
|
@@ -598,36 +598,36 @@ function nt(e) {
|
|
|
598
598
|
r.style.opacity = "0.9";
|
|
599
599
|
}), t.appendChild(r), r;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
602
|
-
let n =
|
|
601
|
+
function at(e, t) {
|
|
602
|
+
let n = it(e);
|
|
603
603
|
n.style.display = "flex";
|
|
604
604
|
let r = () => {
|
|
605
|
-
|
|
605
|
+
Qe(e, t), n.style.display = "none";
|
|
606
606
|
}, i = () => {
|
|
607
607
|
let { scrollTop: t, scrollHeight: r, clientHeight: i } = e;
|
|
608
|
-
r - t - i <=
|
|
608
|
+
r - t - i <= tt(e) && (n.style.display = "none");
|
|
609
609
|
};
|
|
610
610
|
return n.addEventListener("click", r), e.addEventListener("scroll", i, { passive: !0 }), () => {
|
|
611
611
|
n.removeEventListener("click", r), e.removeEventListener("scroll", i);
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function ot() {
|
|
615
615
|
let e = D(function({ nodeId: e, context: t }) {
|
|
616
|
-
let n =
|
|
616
|
+
let n = L(t.store, e), r = j(null), i = B(n?.props?.targetViewId), a = n?.props?.focusOnly, o = typeof a == "boolean" ? a : void 0, s = B(n?.props?.priority), c = B(n?.props?.key), l = n?.props?.preciseGeneratedAt;
|
|
617
617
|
return k(() => {
|
|
618
618
|
if (typeof document > "u") return;
|
|
619
619
|
let e = r.current;
|
|
620
620
|
if (!e || i && e.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i) return;
|
|
621
621
|
let t;
|
|
622
622
|
if (o !== !0) {
|
|
623
|
-
let n =
|
|
624
|
-
if (n) if (
|
|
623
|
+
let n = Xe(e);
|
|
624
|
+
if (n) if (rt(n), s === "Polite" && !nt(n)) t = at(n, e);
|
|
625
625
|
else {
|
|
626
|
-
let t = (n.parentElement ?? n).querySelector(`[${
|
|
627
|
-
t && (t.style.display = "none"),
|
|
626
|
+
let t = (n.parentElement ?? n).querySelector(`[${$e}]`);
|
|
627
|
+
t && (t.style.display = "none"), Qe(n, e);
|
|
628
628
|
}
|
|
629
629
|
else typeof e.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
630
|
-
let t = e.getBoundingClientRect().top, n = typeof window < "u" ? window.innerHeight : 0, r = Math.abs(t) > n *
|
|
630
|
+
let t = e.getBoundingClientRect().top, n = typeof window < "u" ? window.innerHeight : 0, r = Math.abs(t) > n * Ze ? "auto" : "smooth";
|
|
631
631
|
try {
|
|
632
632
|
e.scrollIntoView({
|
|
633
633
|
behavior: r,
|
|
@@ -652,7 +652,7 @@ function it() {
|
|
|
652
652
|
i,
|
|
653
653
|
c,
|
|
654
654
|
l
|
|
655
|
-
]), n ? /* @__PURE__ */
|
|
655
|
+
]), n ? /* @__PURE__ */ F("span", {
|
|
656
656
|
ref: r,
|
|
657
657
|
"data-ikon-node-id": n.id,
|
|
658
658
|
"data-ikon-source": n.sourceMarker,
|
|
@@ -670,16 +670,16 @@ function it() {
|
|
|
670
670
|
if (t === "std.focus-hint") return e;
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function st() {
|
|
674
674
|
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
675
|
-
let r =
|
|
675
|
+
let r = L(t.store, e), i = We(r?.props?.onInvokeId), a = O(() => {
|
|
676
676
|
i && t.dispatchAction(i);
|
|
677
677
|
}, [i, t]);
|
|
678
678
|
if (!r) return null;
|
|
679
|
-
let o =
|
|
679
|
+
let o = Ye(r.props);
|
|
680
680
|
delete o.onInvokeId;
|
|
681
|
-
let s = Ge(
|
|
682
|
-
return /* @__PURE__ */
|
|
681
|
+
let s = Ge(B(r.props?.className), n), c = r.children?.length ? t.renderChildren(r.children) : void 0;
|
|
682
|
+
return /* @__PURE__ */ F("div", {
|
|
683
683
|
...o,
|
|
684
684
|
"data-ikon-node-id": r.id,
|
|
685
685
|
"data-ikon-source": r.sourceMarker,
|
|
@@ -690,7 +690,7 @@ function at() {
|
|
|
690
690
|
onKeyDown: i ? (e) => {
|
|
691
691
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
|
|
692
692
|
} : void 0,
|
|
693
|
-
style:
|
|
693
|
+
style: Je(o.style, i ? "pointer" : void 0),
|
|
694
694
|
children: c
|
|
695
695
|
});
|
|
696
696
|
});
|
|
@@ -698,12 +698,12 @@ function at() {
|
|
|
698
698
|
if (t === "std.div") return e;
|
|
699
699
|
};
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function ct() {
|
|
702
702
|
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
703
|
-
let r =
|
|
703
|
+
let r = L(t.store, e);
|
|
704
704
|
if (!r) return null;
|
|
705
|
-
let i =
|
|
706
|
-
return /* @__PURE__ */
|
|
705
|
+
let i = Ye(r.props), a = Ge("relative", B(r.props?.className), n), o = r.children?.length ? t.renderChildren(r.children) : void 0;
|
|
706
|
+
return /* @__PURE__ */ F("div", {
|
|
707
707
|
...i,
|
|
708
708
|
"data-ikon-node-id": r.id,
|
|
709
709
|
"data-ikon-source": r.sourceMarker,
|
|
@@ -715,12 +715,12 @@ function ot() {
|
|
|
715
715
|
if (t === "std.stack") return e;
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function lt() {
|
|
719
719
|
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
720
|
-
let r =
|
|
720
|
+
let r = L(t.store, e);
|
|
721
721
|
if (!r) return null;
|
|
722
|
-
let i =
|
|
723
|
-
return /* @__PURE__ */
|
|
722
|
+
let i = Ye(r.props), a = Ge("absolute", B(r.props?.className), n), o = r.children?.length ? t.renderChildren(r.children) : void 0;
|
|
723
|
+
return /* @__PURE__ */ F("div", {
|
|
724
724
|
...i,
|
|
725
725
|
"data-ikon-node-id": r.id,
|
|
726
726
|
"data-ikon-source": r.sourceMarker,
|
|
@@ -732,23 +732,23 @@ function st() {
|
|
|
732
732
|
if (t === "std.layer") return e;
|
|
733
733
|
};
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function ut() {
|
|
736
736
|
return [
|
|
737
|
-
at(),
|
|
738
|
-
ot(),
|
|
739
737
|
st(),
|
|
740
|
-
|
|
738
|
+
ct(),
|
|
739
|
+
lt(),
|
|
740
|
+
ot()
|
|
741
741
|
];
|
|
742
742
|
}
|
|
743
743
|
//#endregion
|
|
744
744
|
//#region src/base/base-module.ts
|
|
745
|
-
var
|
|
746
|
-
function
|
|
747
|
-
e.registerModule(
|
|
745
|
+
var dt = "base", ft = async () => ut();
|
|
746
|
+
function pt(e) {
|
|
747
|
+
e.registerModule(dt, ft);
|
|
748
748
|
}
|
|
749
749
|
//#endregion
|
|
750
750
|
//#region src/media/audio-player.tsx
|
|
751
|
-
function
|
|
751
|
+
function mt(e) {
|
|
752
752
|
if (typeof e == "string") {
|
|
753
753
|
let t = e.trim();
|
|
754
754
|
return t.length > 0 ? t : void 0;
|
|
@@ -758,17 +758,17 @@ function ft(e) {
|
|
|
758
758
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function ht(...e) {
|
|
762
762
|
let t = [];
|
|
763
763
|
for (let n of e) n && n.trim() && t.push(n.trim());
|
|
764
764
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function gt(e) {
|
|
767
767
|
if (typeof e != "string") return;
|
|
768
768
|
let t = e.trim();
|
|
769
769
|
return t.length > 0 ? t : void 0;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function _t(e) {
|
|
772
772
|
if (typeof e == "boolean") return e;
|
|
773
773
|
if (typeof e == "string") {
|
|
774
774
|
let t = e.trim().toLowerCase();
|
|
@@ -776,14 +776,14 @@ function ht(e) {
|
|
|
776
776
|
if (t === "false") return !1;
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function vt() {
|
|
780
780
|
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
781
|
-
let r =
|
|
781
|
+
let r = L(t.store, e), i = j(null), a = r ? _t(r.props?.autoplay) : void 0, o = r ? gt(r.props?.src) : void 0;
|
|
782
782
|
if (k(() => {
|
|
783
783
|
a && i.current && i.current.play().catch(() => {});
|
|
784
784
|
}, [a, o]), !r) return null;
|
|
785
|
-
let s =
|
|
786
|
-
return /* @__PURE__ */
|
|
785
|
+
let s = ht(mt(r.props?.className), n), c = gt(r.props?.preload), l = _t(r.props?.controls), u = _t(r.props?.loop), d = _t(r.props?.muted);
|
|
786
|
+
return /* @__PURE__ */ F("audio", {
|
|
787
787
|
ref: i,
|
|
788
788
|
src: o,
|
|
789
789
|
...c === void 0 ? {} : { preload: c },
|
|
@@ -802,7 +802,7 @@ function gt() {
|
|
|
802
802
|
}
|
|
803
803
|
//#endregion
|
|
804
804
|
//#region src/media/video-canvas.tsx
|
|
805
|
-
function
|
|
805
|
+
function yt(e) {
|
|
806
806
|
if (typeof e == "string") {
|
|
807
807
|
let t = e.trim();
|
|
808
808
|
return t.length > 0 ? t : void 0;
|
|
@@ -812,27 +812,27 @@ function _t(e) {
|
|
|
812
812
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function bt(...e) {
|
|
816
816
|
let t = [];
|
|
817
817
|
for (let n of e) n && n.trim() && t.push(n.trim());
|
|
818
818
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function xt(e) {
|
|
821
821
|
if (typeof e == "number" && Number.isFinite(e)) return Math.floor(e);
|
|
822
822
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
823
823
|
let t = Number(e);
|
|
824
824
|
if (Number.isFinite(t)) return Math.floor(t);
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function St(e) {
|
|
828
828
|
if (typeof e != "string") return;
|
|
829
829
|
let t = e.trim();
|
|
830
830
|
return t.length > 0 ? t : void 0;
|
|
831
831
|
}
|
|
832
|
-
var
|
|
833
|
-
function
|
|
832
|
+
var Ct = b("IkonVideoCanvas"), wt = 100, Tt = 50, Et = "std.video-canvas", Dt = "std.video-url-player";
|
|
833
|
+
function Ot() {
|
|
834
834
|
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
835
|
-
let r =
|
|
835
|
+
let r = L(t.store, e), i = j(null), a = j(null), o = t.client, s = r ? St(r.props?.streamId) : void 0, c = r ? xt(r.props?.width) : void 0, l = r ? xt(r.props?.height) : void 0, u = r ? bt(yt(r.props?.className), n) : n, [, d] = M(0);
|
|
836
836
|
k(() => {
|
|
837
837
|
if (!o?.isWebRtcEnabled) return;
|
|
838
838
|
let e = o.onWebRtcTrackMapChanged;
|
|
@@ -850,15 +850,15 @@ function Et() {
|
|
|
850
850
|
if (n) return;
|
|
851
851
|
let i = t.video ?? t.client?.media?.video;
|
|
852
852
|
if (!i) {
|
|
853
|
-
if (a++ >=
|
|
854
|
-
|
|
853
|
+
if (a++ >= Tt) {
|
|
854
|
+
Ct.warn(`Gave up attaching the canvas for stream ${s}: video playback never became available`);
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
|
-
r = setTimeout(o,
|
|
857
|
+
r = setTimeout(o, wt);
|
|
858
858
|
return;
|
|
859
859
|
}
|
|
860
860
|
i.attachCanvas(s, e).catch((e) => {
|
|
861
|
-
|
|
861
|
+
Ct.error(`Failed to attach the canvas for stream ${s}, it will stay blank: ${String(e)}`);
|
|
862
862
|
});
|
|
863
863
|
};
|
|
864
864
|
return o(), () => {
|
|
@@ -873,7 +873,7 @@ function Et() {
|
|
|
873
873
|
if (!(!e || !f)) return e.srcObject = f, () => {
|
|
874
874
|
e.srcObject = null;
|
|
875
875
|
};
|
|
876
|
-
}, [f]), r ? f ? /* @__PURE__ */
|
|
876
|
+
}, [f]), r ? f ? /* @__PURE__ */ F("video", {
|
|
877
877
|
ref: a,
|
|
878
878
|
autoPlay: !0,
|
|
879
879
|
playsInline: !0,
|
|
@@ -884,7 +884,7 @@ function Et() {
|
|
|
884
884
|
className: u,
|
|
885
885
|
...c ? { width: c } : {},
|
|
886
886
|
...l ? { height: l } : {}
|
|
887
|
-
}, s) : /* @__PURE__ */
|
|
887
|
+
}, s) : /* @__PURE__ */ F("canvas", {
|
|
888
888
|
ref: i,
|
|
889
889
|
"data-ikon-node-id": r.id,
|
|
890
890
|
"data-ikon-source": r.sourceMarker,
|
|
@@ -898,14 +898,14 @@ function Et() {
|
|
|
898
898
|
if (t === "std.video-canvas") return e;
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function kt() {
|
|
902
902
|
return [
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
903
|
+
Ot(),
|
|
904
|
+
jt(),
|
|
905
|
+
vt()
|
|
906
906
|
];
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function At(e) {
|
|
909
909
|
if (typeof e == "boolean") return e;
|
|
910
910
|
if (typeof e == "string") {
|
|
911
911
|
let t = e.trim().toLowerCase();
|
|
@@ -913,14 +913,14 @@ function Ot(e) {
|
|
|
913
913
|
if (t === "false") return !1;
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function jt() {
|
|
917
917
|
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
918
|
-
let r =
|
|
918
|
+
let r = L(t.store, e), i = j(null), a = r ? At(r.props?.autoplay) : void 0, o = r ? St(r.props?.src) : void 0;
|
|
919
919
|
if (k(() => {
|
|
920
920
|
a && i.current && i.current.play().catch(() => {});
|
|
921
921
|
}, [a, o]), !r) return null;
|
|
922
|
-
let s =
|
|
923
|
-
return /* @__PURE__ */
|
|
922
|
+
let s = bt(yt(r.props?.className), n), c = St(r.props?.poster), l = At(r.props?.controls), u = At(r.props?.loop), d = At(r.props?.muted), f = At(r.props?.playsInline), p = xt(r.props?.width), m = xt(r.props?.height), h = r.children?.length ? t.renderChildren(r.children) : void 0;
|
|
923
|
+
return /* @__PURE__ */ F("video", {
|
|
924
924
|
ref: i,
|
|
925
925
|
src: o,
|
|
926
926
|
poster: c,
|
|
@@ -943,20 +943,20 @@ function kt() {
|
|
|
943
943
|
}
|
|
944
944
|
//#endregion
|
|
945
945
|
//#region src/media/media-module.ts
|
|
946
|
-
var
|
|
947
|
-
function
|
|
948
|
-
e.registerModule(
|
|
946
|
+
var Mt = "media", Nt = async () => kt();
|
|
947
|
+
function Pt(e) {
|
|
948
|
+
e.registerModule(Mt, Nt);
|
|
949
949
|
}
|
|
950
950
|
//#endregion
|
|
951
951
|
//#region src/shadertoy/shadertoy-gl.ts
|
|
952
|
-
var
|
|
953
|
-
function
|
|
952
|
+
var Ft = "#version 300 es\nin vec4 a_position;\nvoid main() {\n gl_Position = a_position;\n}\n", It = 4;
|
|
953
|
+
function Lt(e, t) {
|
|
954
954
|
return RegExp(`\\buniform\\s+\\w+\\s+${t}\\s*;`, "g").test(e);
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function Rt(e, t) {
|
|
957
957
|
let n = [];
|
|
958
958
|
for (let [r, i] of Object.entries(t)) {
|
|
959
|
-
if (
|
|
959
|
+
if (Lt(e, r)) continue;
|
|
960
960
|
let t;
|
|
961
961
|
switch (i.type) {
|
|
962
962
|
case "float":
|
|
@@ -1014,7 +1014,7 @@ void main() {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
`;
|
|
1016
1016
|
}
|
|
1017
|
-
var
|
|
1017
|
+
var zt = class {
|
|
1018
1018
|
gl;
|
|
1019
1019
|
program = null;
|
|
1020
1020
|
positionBuffer = null;
|
|
@@ -1030,7 +1030,7 @@ var Lt = class {
|
|
|
1030
1030
|
mouseClickY = 0;
|
|
1031
1031
|
channels = [];
|
|
1032
1032
|
channelResolution = /* @__PURE__ */ new Float32Array(12);
|
|
1033
|
-
channelTime = new Float32Array(
|
|
1033
|
+
channelTime = new Float32Array(It);
|
|
1034
1034
|
lastError = null;
|
|
1035
1035
|
currentShaderSource = "";
|
|
1036
1036
|
constructor(e) {
|
|
@@ -1065,7 +1065,7 @@ var Lt = class {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
initializeChannels() {
|
|
1067
1067
|
let e = this.gl;
|
|
1068
|
-
for (let t = 0; t <
|
|
1068
|
+
for (let t = 0; t < It; t++) {
|
|
1069
1069
|
let t = e.createTexture();
|
|
1070
1070
|
e.bindTexture(e.TEXTURE_2D, t), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, new Uint8Array([
|
|
1071
1071
|
0,
|
|
@@ -1082,7 +1082,7 @@ var Lt = class {
|
|
|
1082
1082
|
e.bindTexture(e.TEXTURE_2D, null);
|
|
1083
1083
|
}
|
|
1084
1084
|
setChannels(e) {
|
|
1085
|
-
for (let t = 0; t <
|
|
1085
|
+
for (let t = 0; t < It; t++) {
|
|
1086
1086
|
let n = e[t] ?? null, r = this.channels[t];
|
|
1087
1087
|
if (r.url !== n) {
|
|
1088
1088
|
if (r.url = n, !n) {
|
|
@@ -1113,9 +1113,9 @@ var Lt = class {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
compile(e, t = {}) {
|
|
1115
1115
|
this.lastError = null, this.customUniforms = t, this.currentShaderSource = e;
|
|
1116
|
-
let n = this.gl, r = this.compileShader(n.VERTEX_SHADER,
|
|
1116
|
+
let n = this.gl, r = this.compileShader(n.VERTEX_SHADER, Ft);
|
|
1117
1117
|
if (!r) return !1;
|
|
1118
|
-
let i =
|
|
1118
|
+
let i = Rt(e, t), a = this.compileShader(n.FRAGMENT_SHADER, i);
|
|
1119
1119
|
if (!a) return n.deleteShader(r), !1;
|
|
1120
1120
|
let o = n.createProgram();
|
|
1121
1121
|
return o ? (n.attachShader(o, r), n.attachShader(o, a), n.linkProgram(o), n.deleteShader(r), n.deleteShader(a), n.getProgramParameter(o, n.LINK_STATUS) ? (this.program && n.deleteProgram(this.program), this.program = o, this.cacheUniformLocations(), !0) : (this.lastError = n.getProgramInfoLog(o) || "Program link failed", n.deleteProgram(o), !1)) : (this.lastError = "Failed to create program", n.deleteShader(r), n.deleteShader(a), !1);
|
|
@@ -1139,7 +1139,7 @@ var Lt = class {
|
|
|
1139
1139
|
"iMouse",
|
|
1140
1140
|
"iDate"
|
|
1141
1141
|
]) this.uniformLocations.set(t, e.getUniformLocation(this.program, t));
|
|
1142
|
-
for (let t = 0; t <
|
|
1142
|
+
for (let t = 0; t < It; t++) this.uniformLocations.set(`iChannel${t}`, e.getUniformLocation(this.program, `iChannel${t}`));
|
|
1143
1143
|
this.uniformLocations.set("iChannelResolution", e.getUniformLocation(this.program, "iChannelResolution[0]")), this.uniformLocations.set("iChannelTime", e.getUniformLocation(this.program, "iChannelTime[0]"));
|
|
1144
1144
|
for (let t of Object.keys(this.customUniforms)) this.uniformLocations.set(t, e.getUniformLocation(this.program, t));
|
|
1145
1145
|
}
|
|
@@ -1171,7 +1171,7 @@ var Lt = class {
|
|
|
1171
1171
|
let t = /* @__PURE__ */ new Date();
|
|
1172
1172
|
e.uniform4f(p, t.getFullYear(), t.getMonth(), t.getDate(), t.getHours() * 3600 + t.getMinutes() * 60 + t.getSeconds() + t.getMilliseconds() / 1e3);
|
|
1173
1173
|
}
|
|
1174
|
-
for (let t = 0; t <
|
|
1174
|
+
for (let t = 0; t < It; t++) {
|
|
1175
1175
|
e.activeTexture(e.TEXTURE0 + t), e.bindTexture(e.TEXTURE_2D, this.channels[t].texture);
|
|
1176
1176
|
let n = this.uniformLocations.get(`iChannel${t}`);
|
|
1177
1177
|
n && e.uniform1i(n, t);
|
|
@@ -1221,7 +1221,7 @@ var Lt = class {
|
|
|
1221
1221
|
};
|
|
1222
1222
|
//#endregion
|
|
1223
1223
|
//#region src/shadertoy/shadertoy-renderer.tsx
|
|
1224
|
-
function
|
|
1224
|
+
function Bt(e) {
|
|
1225
1225
|
if (typeof e == "string") {
|
|
1226
1226
|
let t = e.trim();
|
|
1227
1227
|
return t.length > 0 ? t : void 0;
|
|
@@ -1231,22 +1231,22 @@ function Rt(e) {
|
|
|
1231
1231
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function Vt(...e) {
|
|
1235
1235
|
let t = [];
|
|
1236
1236
|
for (let n of e) n && n.trim() && t.push(n.trim());
|
|
1237
1237
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function Ht(e) {
|
|
1240
1240
|
if (typeof e == "number" && Number.isFinite(e)) return Math.floor(e);
|
|
1241
1241
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
1242
1242
|
let t = Number(e);
|
|
1243
1243
|
if (Number.isFinite(t)) return Math.floor(t);
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function Ut(e) {
|
|
1247
1247
|
return typeof e == "string" ? e : "";
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function Wt(e) {
|
|
1250
1250
|
if (typeof e == "boolean") return e;
|
|
1251
1251
|
if (typeof e == "string") {
|
|
1252
1252
|
let t = e.trim().toLowerCase();
|
|
@@ -1254,7 +1254,7 @@ function Ht(e) {
|
|
|
1254
1254
|
if (t === "false") return !1;
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function Gt(e) {
|
|
1258
1258
|
if (!e || typeof e != "object") return {};
|
|
1259
1259
|
let t = {}, n = e;
|
|
1260
1260
|
for (let [e, r] of Object.entries(n)) {
|
|
@@ -1274,10 +1274,10 @@ function Ut(e) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
return t;
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function Kt(e) {
|
|
1278
1278
|
return Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : null) : [];
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function qt(e, t) {
|
|
1281
1281
|
let n = Object.keys(e), r = Object.keys(t);
|
|
1282
1282
|
if (n.length !== r.length) return !1;
|
|
1283
1283
|
for (let r of n) {
|
|
@@ -1291,21 +1291,21 @@ function Gt(e, t) {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
return !0;
|
|
1293
1293
|
}
|
|
1294
|
-
var
|
|
1295
|
-
function
|
|
1294
|
+
var Jt = "std.shadertoy-canvas";
|
|
1295
|
+
function Yt() {
|
|
1296
1296
|
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
1297
|
-
let r =
|
|
1297
|
+
let r = L(t.store, e), i = j(null), a = j(null), o = j(null), s = j(0), c = j(""), l = j({}), u = j({
|
|
1298
1298
|
x: 0,
|
|
1299
1299
|
y: 0,
|
|
1300
1300
|
clickX: 0,
|
|
1301
1301
|
clickY: 0,
|
|
1302
1302
|
isDown: !1
|
|
1303
|
-
}), d = r ?
|
|
1303
|
+
}), d = r ? Ut(r.props?.shaderSource) : "", f = r ? Ht(r.props?.fps) ?? 60 : 60, p = r?.props?.uniforms, m = A(() => Gt(p), [p]), h = r?.props?.channels, g = A(() => Kt(h), [h]), _ = r ? Wt(r.props?.enableMouse) ?? !0 : !0, v = r ? Ht(r.props?.width) : void 0, y = r ? Ht(r.props?.height) : void 0, b = r ? Vt(Bt(r.props?.className), n) : n;
|
|
1304
1304
|
k(() => {
|
|
1305
1305
|
let e = i.current;
|
|
1306
1306
|
if (e) {
|
|
1307
1307
|
try {
|
|
1308
|
-
let t = new
|
|
1308
|
+
let t = new zt(e);
|
|
1309
1309
|
a.current = t;
|
|
1310
1310
|
} catch (e) {
|
|
1311
1311
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", e);
|
|
@@ -1323,7 +1323,7 @@ function qt() {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
}, [d, m]), k(() => {
|
|
1325
1325
|
let e = a.current;
|
|
1326
|
-
!e || !c.current ||
|
|
1326
|
+
!e || !c.current || qt(l.current, m) || (e.setCustomUniforms(m), l.current = m);
|
|
1327
1327
|
}, [m]), k(() => {
|
|
1328
1328
|
let e = a.current;
|
|
1329
1329
|
e && e.setChannels(g);
|
|
@@ -1353,7 +1353,7 @@ function qt() {
|
|
|
1353
1353
|
}, [_]), ee = O(() => {
|
|
1354
1354
|
_ && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
|
|
1355
1355
|
}, [_]);
|
|
1356
|
-
return r ? /* @__PURE__ */
|
|
1356
|
+
return r ? /* @__PURE__ */ F("canvas", {
|
|
1357
1357
|
ref: i,
|
|
1358
1358
|
"data-ikon-node-id": r.id,
|
|
1359
1359
|
"data-ikon-source": r.sourceMarker,
|
|
@@ -1372,13 +1372,13 @@ function qt() {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
//#endregion
|
|
1374
1374
|
//#region src/shadertoy/shadertoy-module.ts
|
|
1375
|
-
var
|
|
1376
|
-
function
|
|
1377
|
-
e.registerModule(
|
|
1375
|
+
var Xt = "shadertoy", Zt = async () => Yt();
|
|
1376
|
+
function Qt(e) {
|
|
1377
|
+
e.registerModule(Xt, Zt);
|
|
1378
1378
|
}
|
|
1379
1379
|
//#endregion
|
|
1380
1380
|
//#region src/ikon-ui-registry.ts
|
|
1381
|
-
var
|
|
1381
|
+
var $t = b("UIRegistry"), en = class {
|
|
1382
1382
|
baseResolvers = [];
|
|
1383
1383
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1384
1384
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1404,14 +1404,14 @@ var Zt = b("UIRegistry"), Qt = class {
|
|
|
1404
1404
|
async loadRegisteredModules() {
|
|
1405
1405
|
let e = !1;
|
|
1406
1406
|
for (let [t, n] of this.moduleLoaders.entries()) if (!this.moduleResolvers.has(t)) try {
|
|
1407
|
-
let r =
|
|
1407
|
+
let r = rn(await n());
|
|
1408
1408
|
this.moduleResolvers.set(t, r), e = !0;
|
|
1409
1409
|
} catch (e) {
|
|
1410
|
-
|
|
1410
|
+
$t.error(`[IkonUiRegistry] Failed to load module '${t}'.`, e);
|
|
1411
1411
|
}
|
|
1412
1412
|
let t = [];
|
|
1413
1413
|
for (let e of this.moduleLoaders.keys()) this.moduleResolvers.has(e) && t.push(e);
|
|
1414
|
-
return
|
|
1414
|
+
return an(t, this.activeModuleOrder) || (this.activeModuleOrder = t, e = !0), e && this.notify(), e;
|
|
1415
1415
|
}
|
|
1416
1416
|
resolve(e) {
|
|
1417
1417
|
for (let t of this.baseResolvers) {
|
|
@@ -1421,7 +1421,7 @@ var Zt = b("UIRegistry"), Qt = class {
|
|
|
1421
1421
|
for (let t of this.activeModuleOrder) {
|
|
1422
1422
|
let n = this.moduleResolvers.get(t);
|
|
1423
1423
|
if (!n) {
|
|
1424
|
-
|
|
1424
|
+
$t.warn(`Missing resolvers for module ${t}`);
|
|
1425
1425
|
continue;
|
|
1426
1426
|
}
|
|
1427
1427
|
for (let t of n) {
|
|
@@ -1434,25 +1434,25 @@ var Zt = b("UIRegistry"), Qt = class {
|
|
|
1434
1434
|
for (let e of this.listeners) e();
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
1437
|
-
function
|
|
1438
|
-
let e = new
|
|
1439
|
-
return
|
|
1437
|
+
function tn() {
|
|
1438
|
+
let e = new en();
|
|
1439
|
+
return pt(e), Pt(e), Qt(e), e.loadRegisteredModules(), e;
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1441
|
+
function nn(e) {
|
|
1442
1442
|
return Array.isArray(e) ? e : [e];
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1445
|
-
return e ?
|
|
1444
|
+
function rn(e) {
|
|
1445
|
+
return e ? nn(e).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1446
1446
|
}
|
|
1447
|
-
function
|
|
1447
|
+
function an(e, t) {
|
|
1448
1448
|
if (e.length !== t.length) return !1;
|
|
1449
1449
|
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
1450
1450
|
return !0;
|
|
1451
1451
|
}
|
|
1452
1452
|
//#endregion
|
|
1453
1453
|
//#region src/parallax-view.tsx
|
|
1454
|
-
function
|
|
1455
|
-
return /* @__PURE__ */
|
|
1454
|
+
function on({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
|
|
1455
|
+
return /* @__PURE__ */ F(z, {
|
|
1456
1456
|
stores: t,
|
|
1457
1457
|
registry: n,
|
|
1458
1458
|
category: e,
|
|
@@ -1462,7 +1462,7 @@ function rn({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
|
|
|
1462
1462
|
}
|
|
1463
1463
|
//#endregion
|
|
1464
1464
|
//#region src/motion/motion-controller.ts
|
|
1465
|
-
var
|
|
1465
|
+
var sn = b("MotionController"), cn = {
|
|
1466
1466
|
ease: [
|
|
1467
1467
|
.25,
|
|
1468
1468
|
.1,
|
|
@@ -1635,17 +1635,17 @@ var an = b("MotionController"), on = {
|
|
|
1635
1635
|
function U(e) {
|
|
1636
1636
|
return e <= 0 ? 0 : e >= 1 ? 1 : e;
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1638
|
+
function ln(e) {
|
|
1639
1639
|
if (e == null) return;
|
|
1640
1640
|
let t = e.trim();
|
|
1641
1641
|
if (!t) return;
|
|
1642
1642
|
let n = Number.parseFloat(t);
|
|
1643
1643
|
return Number.isFinite(n) ? n : void 0;
|
|
1644
1644
|
}
|
|
1645
|
-
function
|
|
1645
|
+
function un(e) {
|
|
1646
1646
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1647
1647
|
}
|
|
1648
|
-
function
|
|
1648
|
+
function dn(e, t, n, r) {
|
|
1649
1649
|
let i = 1 / 10, a = /* @__PURE__ */ new Float32Array(11);
|
|
1650
1650
|
function o(e, t, n) {
|
|
1651
1651
|
return ((3 * t - 3 * n + 1) * e + (3 * n - 6 * t)) * e * e + 3 * t * e;
|
|
@@ -1679,34 +1679,34 @@ function ln(e, t, n, r) {
|
|
|
1679
1679
|
for (let t = 0; t < 11; t += 1) a[t] = o(t * i, e, n);
|
|
1680
1680
|
return (e) => e <= 0 ? 0 : e >= 1 ? 1 : o(u(e), t, r);
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1682
|
+
function fn(e) {
|
|
1683
1683
|
let t = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(e);
|
|
1684
1684
|
if (!t) return (e) => U(e);
|
|
1685
1685
|
let n = Math.max(1, parseInt(t[1], 10)), r = (t[2] ?? "end").toLowerCase();
|
|
1686
1686
|
return r === "start" || r === "jump-start" ? (e) => U(Math.ceil(e * n) / n) : r === "none" || r === "jump-none" ? (e) => U(Math.round(e * n) / n) : r === "both" || r === "jump-both" ? (e) => U((Math.floor(e * n) + .5) / n) : (e) => U(Math.floor(e * n) / n);
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1688
|
+
function pn(e) {
|
|
1689
1689
|
if (!e) return (e) => U(e);
|
|
1690
1690
|
let t = e.trim().toLowerCase();
|
|
1691
1691
|
if (!t || t === "linear") return (e) => U(e);
|
|
1692
|
-
if (
|
|
1693
|
-
let [e, n, r, i] =
|
|
1692
|
+
if (cn[t]) {
|
|
1693
|
+
let [e, n, r, i] = cn[t], a = dn(e, n, r, i);
|
|
1694
1694
|
return (e) => U(a(U(e)));
|
|
1695
1695
|
}
|
|
1696
1696
|
if (t.startsWith("cubic-bezier(") && t.endsWith(")")) {
|
|
1697
1697
|
let e = t.slice(13, -1).split(",").map((e) => Number.parseFloat(e.trim()));
|
|
1698
1698
|
if (e.length === 4 && e.every((e) => Number.isFinite(e))) {
|
|
1699
|
-
let [t, n, r, i] = e, a =
|
|
1699
|
+
let [t, n, r, i] = e, a = dn(t, n, r, i);
|
|
1700
1700
|
return (e) => U(a(U(e)));
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
1703
1703
|
if (t.startsWith("steps(") && t.endsWith(")")) {
|
|
1704
|
-
let e =
|
|
1704
|
+
let e = fn(t);
|
|
1705
1705
|
return (t) => e(U(t));
|
|
1706
1706
|
}
|
|
1707
1707
|
return (e) => U(e);
|
|
1708
1708
|
}
|
|
1709
|
-
function
|
|
1709
|
+
function mn(e) {
|
|
1710
1710
|
if (!e) return;
|
|
1711
1711
|
let t = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(e);
|
|
1712
1712
|
if (!t) return;
|
|
@@ -1723,7 +1723,7 @@ function fn(e) {
|
|
|
1723
1723
|
outEnd: a
|
|
1724
1724
|
};
|
|
1725
1725
|
}
|
|
1726
|
-
var
|
|
1726
|
+
var hn = new class {
|
|
1727
1727
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1728
1728
|
observer;
|
|
1729
1729
|
observeScheduled = !1;
|
|
@@ -1748,7 +1748,7 @@ var pn = new class {
|
|
|
1748
1748
|
for (let e of Array.from(this.globalCleanups)) try {
|
|
1749
1749
|
e();
|
|
1750
1750
|
} catch (e) {
|
|
1751
|
-
|
|
1751
|
+
sn.warn("Failed to cleanup binding listener", e);
|
|
1752
1752
|
}
|
|
1753
1753
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer &&= (this.observer.disconnect(), void 0);
|
|
1754
1754
|
}
|
|
@@ -1757,14 +1757,14 @@ var pn = new class {
|
|
|
1757
1757
|
let t = (JSON.parse(e).motionBindings ?? []).map((e) => this.parseBinding(e)).filter((e) => e !== void 0);
|
|
1758
1758
|
return t.length === 0 ? void 0 : { bindings: t };
|
|
1759
1759
|
} catch (e) {
|
|
1760
|
-
|
|
1760
|
+
sn.warn("Failed to parse motion metadata", e);
|
|
1761
1761
|
return;
|
|
1762
1762
|
}
|
|
1763
1763
|
}
|
|
1764
1764
|
parseBinding(e) {
|
|
1765
1765
|
let t = e.source?.trim();
|
|
1766
1766
|
if (!t) return;
|
|
1767
|
-
let n =
|
|
1767
|
+
let n = ln(e.min) ?? 0, r = ln(e.max), i = r === void 0 ? n + 100 : r, a = (e.clamp ?? "clamp").trim().toLowerCase(), o = !!e.reverse, s = pn(e.ease), c = mn(e.map), l = e.targetId?.trim() || void 0;
|
|
1768
1768
|
if (!(Number.isNaN(n) || Number.isNaN(i))) return {
|
|
1769
1769
|
source: t.toLowerCase(),
|
|
1770
1770
|
min: n,
|
|
@@ -1810,7 +1810,7 @@ var pn = new class {
|
|
|
1810
1810
|
scanExistingNodes(e) {
|
|
1811
1811
|
let t = this.bindingsByStyle.get(e);
|
|
1812
1812
|
if (!t || typeof document > "u") return;
|
|
1813
|
-
let n = `.${
|
|
1813
|
+
let n = `.${un(e)}`;
|
|
1814
1814
|
document.querySelectorAll(n).forEach((n) => this.applyStyleToElement(n, e, t));
|
|
1815
1815
|
}
|
|
1816
1816
|
applyStyleToElement(e, t, n) {
|
|
@@ -1846,7 +1846,7 @@ var pn = new class {
|
|
|
1846
1846
|
}
|
|
1847
1847
|
resolveScrollContainer(e, t) {
|
|
1848
1848
|
if (t.targetId) {
|
|
1849
|
-
let e = `[data-ikon-motion-source="${
|
|
1849
|
+
let e = `[data-ikon-motion-source="${un(t.targetId)}"]`, n = typeof document < "u" ? document.querySelector(e) : null;
|
|
1850
1850
|
if (n) return n;
|
|
1851
1851
|
}
|
|
1852
1852
|
return e.closest("[data-ikon-view-type=\"scroll-view\"]");
|
|
@@ -1901,7 +1901,7 @@ var pn = new class {
|
|
|
1901
1901
|
try {
|
|
1902
1902
|
e();
|
|
1903
1903
|
} catch (e) {
|
|
1904
|
-
|
|
1904
|
+
sn.warn("Failed to cleanup listener", e);
|
|
1905
1905
|
}
|
|
1906
1906
|
this.globalCleanups.delete(e);
|
|
1907
1907
|
}
|
|
@@ -1941,26 +1941,26 @@ var pn = new class {
|
|
|
1941
1941
|
}();
|
|
1942
1942
|
//#endregion
|
|
1943
1943
|
//#region src/use-ikon-styles.ts
|
|
1944
|
-
function
|
|
1944
|
+
function gn(e) {
|
|
1945
1945
|
let t = j(/* @__PURE__ */ new Map()), n = O(({ styleId: e, css: n, common: r }) => {
|
|
1946
1946
|
if (!(!e || typeof document > "u")) {
|
|
1947
1947
|
if (n) {
|
|
1948
1948
|
let r = t.current.get(e);
|
|
1949
1949
|
r || (r = document.createElement("style"), r.setAttribute("data-ikon-style-id", e), document.head.appendChild(r), t.current.set(e, r)), r.textContent = n;
|
|
1950
1950
|
}
|
|
1951
|
-
|
|
1951
|
+
hn.registerStyle(e, r);
|
|
1952
1952
|
}
|
|
1953
1953
|
}, []), r = O((e) => {
|
|
1954
1954
|
if (!(typeof document > "u")) for (let n of e) {
|
|
1955
1955
|
let e = t.current.get(n);
|
|
1956
|
-
e && (e.remove(), t.current.delete(n)),
|
|
1956
|
+
e && (e.remove(), t.current.delete(n)), hn.unregisterStyle(n);
|
|
1957
1957
|
}
|
|
1958
1958
|
}, []), i = O(() => {
|
|
1959
1959
|
if (typeof document < "u") {
|
|
1960
1960
|
for (let e of t.current.values()) e.remove();
|
|
1961
1961
|
t.current.clear();
|
|
1962
1962
|
}
|
|
1963
|
-
|
|
1963
|
+
hn.reset();
|
|
1964
1964
|
}, []);
|
|
1965
1965
|
return k(() => {
|
|
1966
1966
|
if (!e) return;
|
|
@@ -1982,7 +1982,7 @@ function mn(e) {
|
|
|
1982
1982
|
}
|
|
1983
1983
|
//#endregion
|
|
1984
1984
|
//#region src/use-ikon-ui-stores.ts
|
|
1985
|
-
function
|
|
1985
|
+
function _n(e) {
|
|
1986
1986
|
let t = [];
|
|
1987
1987
|
for (let [n, r] of e) {
|
|
1988
1988
|
let e = r.store.getSnapshot(), i = e.rootViewId && e.views.has(e.rootViewId);
|
|
@@ -1990,7 +1990,7 @@ function hn(e) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
return t.sort(), t.join(",");
|
|
1992
1992
|
}
|
|
1993
|
-
function
|
|
1993
|
+
function vn(e) {
|
|
1994
1994
|
let [t, n] = M(), r = j("");
|
|
1995
1995
|
return k(() => {
|
|
1996
1996
|
if (!e) {
|
|
@@ -1998,7 +1998,7 @@ function gn(e) {
|
|
|
1998
1998
|
return;
|
|
1999
1999
|
}
|
|
2000
2000
|
let t = () => {
|
|
2001
|
-
let t = e.getStores(), i =
|
|
2001
|
+
let t = e.getStores(), i = _n(t);
|
|
2002
2002
|
i !== r.current && (r.current = i, n(t));
|
|
2003
2003
|
};
|
|
2004
2004
|
return t(), e.subscribe(t);
|
|
@@ -2013,7 +2013,7 @@ var W = {
|
|
|
2013
2013
|
Line: 4,
|
|
2014
2014
|
Paragraph: 8,
|
|
2015
2015
|
Emoji: 16
|
|
2016
|
-
},
|
|
2016
|
+
}, yn = [
|
|
2017
2017
|
{
|
|
2018
2018
|
flag: W.Letter,
|
|
2019
2019
|
hints: [
|
|
@@ -2062,16 +2062,16 @@ var W = {
|
|
|
2062
2062
|
"[data-emoji]"
|
|
2063
2063
|
]
|
|
2064
2064
|
}
|
|
2065
|
-
],
|
|
2066
|
-
function
|
|
2067
|
-
if (!e || e.length >
|
|
2068
|
-
let n =
|
|
2065
|
+
], bn = W.Letter | W.Word | W.Line | W.Paragraph | W.Emoji, xn = W.Letter | W.Word | W.Line | W.Paragraph, Sn = /* @__PURE__ */ new Map(), Cn = 16384;
|
|
2066
|
+
function wn(e, t) {
|
|
2067
|
+
if (!e || e.length > Cn) return e;
|
|
2068
|
+
let n = Qn(t), r = G(n, W.Emoji), i = n & xn;
|
|
2069
2069
|
if (i === W.None && !r) return e;
|
|
2070
2070
|
let a = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
2071
|
-
if (i === W.None) return
|
|
2072
|
-
let o =
|
|
2073
|
-
if (o.length === 0) return r ?
|
|
2074
|
-
let s =
|
|
2071
|
+
if (i === W.None) return Xn(a);
|
|
2072
|
+
let o = qn(a);
|
|
2073
|
+
if (o.length === 0) return r ? Xn(a) : e;
|
|
2074
|
+
let s = Jn(o), c = {
|
|
2075
2075
|
letter: 0,
|
|
2076
2076
|
word: 0,
|
|
2077
2077
|
line: 0,
|
|
@@ -2080,96 +2080,96 @@ function Sn(e, t) {
|
|
|
2080
2080
|
emoji: 0
|
|
2081
2081
|
}, l = [];
|
|
2082
2082
|
for (let e of s) {
|
|
2083
|
-
let t =
|
|
2083
|
+
let t = Tn(e, n, c);
|
|
2084
2084
|
l.push(...t);
|
|
2085
2085
|
}
|
|
2086
2086
|
return l;
|
|
2087
2087
|
}
|
|
2088
|
-
function
|
|
2088
|
+
function Tn(e, t, n) {
|
|
2089
2089
|
let r = [];
|
|
2090
2090
|
for (let i of e) {
|
|
2091
|
-
let e =
|
|
2091
|
+
let e = En(i, t, n);
|
|
2092
2092
|
r.push(...e);
|
|
2093
2093
|
}
|
|
2094
2094
|
if (G(t, W.Paragraph)) {
|
|
2095
2095
|
let e = n.paragraph++;
|
|
2096
|
-
return [/* @__PURE__ */
|
|
2096
|
+
return [/* @__PURE__ */ F("span", {
|
|
2097
2097
|
"data-motion-paragraph": !0,
|
|
2098
|
-
style:
|
|
2098
|
+
style: Yn(e),
|
|
2099
2099
|
children: r
|
|
2100
2100
|
}, `motion-paragraph-${e}`)];
|
|
2101
2101
|
}
|
|
2102
2102
|
return r;
|
|
2103
2103
|
}
|
|
2104
|
-
function
|
|
2105
|
-
let r =
|
|
2104
|
+
function En(e, t, n) {
|
|
2105
|
+
let r = Dn(e.text, t, n), i = [];
|
|
2106
2106
|
if (G(t, W.Line)) {
|
|
2107
2107
|
let e = n.line++;
|
|
2108
|
-
i.push(/* @__PURE__ */
|
|
2108
|
+
i.push(/* @__PURE__ */ F("span", {
|
|
2109
2109
|
"data-motion-line": !0,
|
|
2110
|
-
style:
|
|
2110
|
+
style: Yn(e),
|
|
2111
2111
|
children: r
|
|
2112
2112
|
}, `motion-line-${e}`));
|
|
2113
2113
|
} else i.push(...r);
|
|
2114
|
-
for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */
|
|
2114
|
+
for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */ F("br", {}, `motion-break-${n.br++}`));
|
|
2115
2115
|
return i;
|
|
2116
2116
|
}
|
|
2117
|
-
function
|
|
2117
|
+
function Dn(e, t, n) {
|
|
2118
2118
|
if (!e) return [];
|
|
2119
2119
|
let r = G(t, W.Word), i = [], a = /(\s+)/g, o = 0, s;
|
|
2120
2120
|
for (; (s = a.exec(e)) !== null;) {
|
|
2121
2121
|
if (s.index > o) {
|
|
2122
2122
|
let a = e.slice(o, s.index);
|
|
2123
|
-
i.push(
|
|
2123
|
+
i.push(On(a, n, t, r));
|
|
2124
2124
|
}
|
|
2125
2125
|
i.push(s[0]), o = s.index + s[0].length;
|
|
2126
2126
|
}
|
|
2127
2127
|
if (o < e.length) {
|
|
2128
2128
|
let a = e.slice(o);
|
|
2129
|
-
i.push(
|
|
2129
|
+
i.push(On(a, n, t, r));
|
|
2130
2130
|
}
|
|
2131
2131
|
return i;
|
|
2132
2132
|
}
|
|
2133
|
-
function
|
|
2134
|
-
let i = t.word++, a =
|
|
2135
|
-
return r ? /* @__PURE__ */
|
|
2133
|
+
function On(e, t, n, r) {
|
|
2134
|
+
let i = t.word++, a = An(e, n, t), o = `motion-word-${i}`, s = kn(i, r);
|
|
2135
|
+
return r ? /* @__PURE__ */ F("span", {
|
|
2136
2136
|
"data-motion-word": !0,
|
|
2137
2137
|
style: s,
|
|
2138
2138
|
children: a
|
|
2139
|
-
}, o) : /* @__PURE__ */
|
|
2139
|
+
}, o) : /* @__PURE__ */ F("span", {
|
|
2140
2140
|
style: s,
|
|
2141
2141
|
children: a
|
|
2142
2142
|
}, o);
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2144
|
+
function kn(e, t) {
|
|
2145
2145
|
return t ? {
|
|
2146
|
-
...
|
|
2146
|
+
...Yn(e),
|
|
2147
2147
|
whiteSpace: "nowrap"
|
|
2148
2148
|
} : { whiteSpace: "nowrap" };
|
|
2149
2149
|
}
|
|
2150
|
-
function
|
|
2150
|
+
function An(e, t, n) {
|
|
2151
2151
|
if (!e) return [];
|
|
2152
2152
|
let r = G(t, W.Letter), i = G(t, W.Emoji);
|
|
2153
2153
|
if (!r) {
|
|
2154
2154
|
if (!i) return [e];
|
|
2155
|
-
let t =
|
|
2155
|
+
let t = jn(e);
|
|
2156
2156
|
if (t.length === 0) return [e];
|
|
2157
|
-
let { nodes: r } =
|
|
2157
|
+
let { nodes: r } = Zn(t, n);
|
|
2158
2158
|
return r;
|
|
2159
2159
|
}
|
|
2160
|
-
let a = [], o =
|
|
2160
|
+
let a = [], o = jn(e);
|
|
2161
2161
|
for (let e of o) {
|
|
2162
|
-
let t = n.letter++, r = `motion-letter-${t}`, o =
|
|
2162
|
+
let t = n.letter++, r = `motion-letter-${t}`, o = Yn(t);
|
|
2163
2163
|
if (e === "\n") {
|
|
2164
|
-
a.push(/* @__PURE__ */
|
|
2164
|
+
a.push(/* @__PURE__ */ F("span", {
|
|
2165
2165
|
"data-motion-letter": !0,
|
|
2166
2166
|
style: o,
|
|
2167
|
-
children: /* @__PURE__ */
|
|
2167
|
+
children: /* @__PURE__ */ F("br", {})
|
|
2168
2168
|
}, r));
|
|
2169
2169
|
continue;
|
|
2170
2170
|
}
|
|
2171
|
-
let s = i &&
|
|
2172
|
-
a.push(/* @__PURE__ */
|
|
2171
|
+
let s = i && Wn(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
|
|
2172
|
+
a.push(/* @__PURE__ */ F("span", {
|
|
2173
2173
|
"data-motion-letter": !0,
|
|
2174
2174
|
style: o,
|
|
2175
2175
|
...s,
|
|
@@ -2178,46 +2178,46 @@ function On(e, t, n) {
|
|
|
2178
2178
|
}
|
|
2179
2179
|
return a;
|
|
2180
2180
|
}
|
|
2181
|
-
function
|
|
2181
|
+
function jn(e) {
|
|
2182
2182
|
if (!e) return [];
|
|
2183
|
-
let t =
|
|
2184
|
-
return t ? Array.from(t.segment(e), (e) => e.segment) :
|
|
2183
|
+
let t = Nn();
|
|
2184
|
+
return t ? Array.from(t.segment(e), (e) => e.segment) : Pn(e);
|
|
2185
2185
|
}
|
|
2186
|
-
var
|
|
2187
|
-
function
|
|
2188
|
-
return
|
|
2186
|
+
var Mn;
|
|
2187
|
+
function Nn() {
|
|
2188
|
+
return Mn === void 0 && (Mn = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null), Mn;
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2190
|
+
function Pn(e) {
|
|
2191
2191
|
let t = [], n = Array.from(e), r = "";
|
|
2192
2192
|
for (let e = 0; e < n.length; e++) {
|
|
2193
2193
|
let i = n[e], a = n[e + 1];
|
|
2194
|
-
r += i, !(a &&
|
|
2194
|
+
r += i, !(a && Fn(i, a)) && (t.push(r), r = "");
|
|
2195
2195
|
}
|
|
2196
2196
|
return r && t.push(r), t;
|
|
2197
2197
|
}
|
|
2198
|
-
function
|
|
2199
|
-
return t ? !!(
|
|
2198
|
+
function Fn(e, t) {
|
|
2199
|
+
return t ? !!(In(e) || In(t) || Vn(t) || Ln(t) || Rn(t) || zn(e) && zn(t)) : !1;
|
|
2200
2200
|
}
|
|
2201
|
-
function
|
|
2201
|
+
function In(e) {
|
|
2202
2202
|
return e.codePointAt(0) === 8205;
|
|
2203
2203
|
}
|
|
2204
|
-
function
|
|
2204
|
+
function Ln(e) {
|
|
2205
2205
|
let t = e.codePointAt(0);
|
|
2206
2206
|
return t === void 0 ? !1 : t >= 65024 && t <= 65039 || t >= 917760 && t <= 917999;
|
|
2207
2207
|
}
|
|
2208
|
-
function
|
|
2208
|
+
function Rn(e) {
|
|
2209
2209
|
let t = e.codePointAt(0);
|
|
2210
2210
|
return t !== void 0 && t >= 127995 && t <= 127999;
|
|
2211
2211
|
}
|
|
2212
|
-
function
|
|
2212
|
+
function zn(e) {
|
|
2213
2213
|
let t = e.codePointAt(0);
|
|
2214
2214
|
return t !== void 0 && t >= 127462 && t <= 127487;
|
|
2215
2215
|
}
|
|
2216
|
-
var
|
|
2217
|
-
function
|
|
2218
|
-
return e ? (
|
|
2216
|
+
var Bn;
|
|
2217
|
+
function Vn(e) {
|
|
2218
|
+
return e ? (Bn ||= Hn(), Bn(e)) : !1;
|
|
2219
2219
|
}
|
|
2220
|
-
function
|
|
2220
|
+
function Hn() {
|
|
2221
2221
|
try {
|
|
2222
2222
|
let e = /\p{Mark}/u;
|
|
2223
2223
|
return (t) => e.test(t);
|
|
@@ -2228,19 +2228,19 @@ function Bn() {
|
|
|
2228
2228
|
};
|
|
2229
2229
|
}
|
|
2230
2230
|
}
|
|
2231
|
-
var
|
|
2232
|
-
function
|
|
2233
|
-
return e ? (
|
|
2231
|
+
var Un;
|
|
2232
|
+
function Wn(e) {
|
|
2233
|
+
return e ? (Un ||= Gn(), Un(e)) : !1;
|
|
2234
2234
|
}
|
|
2235
|
-
function
|
|
2235
|
+
function Gn() {
|
|
2236
2236
|
try {
|
|
2237
2237
|
let e = /\p{Extended_Pictographic}/u;
|
|
2238
2238
|
return (t) => e.test(t);
|
|
2239
2239
|
} catch {
|
|
2240
|
-
return
|
|
2240
|
+
return Kn;
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
|
-
function
|
|
2243
|
+
function Kn(e) {
|
|
2244
2244
|
if (!e) return !1;
|
|
2245
2245
|
for (let t of Array.from(e)) {
|
|
2246
2246
|
let e = t.codePointAt(0);
|
|
@@ -2248,7 +2248,7 @@ function Wn(e) {
|
|
|
2248
2248
|
}
|
|
2249
2249
|
return !1;
|
|
2250
2250
|
}
|
|
2251
|
-
function
|
|
2251
|
+
function qn(e) {
|
|
2252
2252
|
let t = [], n = "", r = 0;
|
|
2253
2253
|
for (let i = 0; i < e.length; i++) {
|
|
2254
2254
|
let a = e[i];
|
|
@@ -2266,7 +2266,7 @@ function Gn(e) {
|
|
|
2266
2266
|
breaks: r
|
|
2267
2267
|
}), t;
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2269
|
+
function Jn(e) {
|
|
2270
2270
|
if (e.length === 0) return [];
|
|
2271
2271
|
let t = [], n = [];
|
|
2272
2272
|
for (let r of e) n.push(r), r.breaks >= 2 && (t.push(n), n = []);
|
|
@@ -2275,7 +2275,7 @@ function Kn(e) {
|
|
|
2275
2275
|
function G(e, t) {
|
|
2276
2276
|
return (e & t) === t;
|
|
2277
2277
|
}
|
|
2278
|
-
function
|
|
2278
|
+
function Yn(e) {
|
|
2279
2279
|
return {
|
|
2280
2280
|
"--tw-motion-seq-index": e.toString(),
|
|
2281
2281
|
backgroundColor: "inherit",
|
|
@@ -2292,22 +2292,22 @@ function qn(e) {
|
|
|
2292
2292
|
WebkitTextFillColor: "inherit"
|
|
2293
2293
|
};
|
|
2294
2294
|
}
|
|
2295
|
-
function
|
|
2295
|
+
function Xn(e) {
|
|
2296
2296
|
if (!e) return e;
|
|
2297
|
-
let t =
|
|
2297
|
+
let t = jn(e);
|
|
2298
2298
|
if (t.length === 0) return e;
|
|
2299
|
-
let { nodes: n, sawEmoji: r } =
|
|
2299
|
+
let { nodes: n, sawEmoji: r } = Zn(t);
|
|
2300
2300
|
return r ? n.length === 1 ? n[0] ?? e : n : e;
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2302
|
+
function Zn(e, t) {
|
|
2303
2303
|
let n = [], r = "", i = !1, a = t?.emoji ?? 0, o = () => {
|
|
2304
2304
|
r &&= (n.push(r), "");
|
|
2305
2305
|
};
|
|
2306
2306
|
for (let s of e) {
|
|
2307
|
-
if (
|
|
2307
|
+
if (Wn(s)) {
|
|
2308
2308
|
i = !0, o();
|
|
2309
2309
|
let e = `motion-emoji-${t ? t.emoji++ : a++}`;
|
|
2310
|
-
n.push(/* @__PURE__ */
|
|
2310
|
+
n.push(/* @__PURE__ */ F("span", {
|
|
2311
2311
|
"data-motion-emoji": !0,
|
|
2312
2312
|
children: s
|
|
2313
2313
|
}, e));
|
|
@@ -2323,16 +2323,16 @@ function Yn(e, t) {
|
|
|
2323
2323
|
sawEmoji: !1
|
|
2324
2324
|
};
|
|
2325
2325
|
}
|
|
2326
|
-
function
|
|
2326
|
+
function Qn(e) {
|
|
2327
2327
|
if (!e) return W.None;
|
|
2328
2328
|
let t = e.trim();
|
|
2329
2329
|
if (!t) return W.None;
|
|
2330
|
-
let n =
|
|
2330
|
+
let n = Sn.get(t);
|
|
2331
2331
|
if (typeof n == "number") return n;
|
|
2332
2332
|
if (typeof document > "u") return W.None;
|
|
2333
2333
|
let r = t.split(/\s+/).filter(Boolean);
|
|
2334
2334
|
if (r.length === 0) return W.None;
|
|
2335
|
-
let i = r.map((e) => `.${
|
|
2335
|
+
let i = r.map((e) => `.${er(e)}`).map((e) => RegExp(`(^|[^a-zA-Z0-9_-])${tr(e)}(?![a-zA-Z0-9_-])`)), a = W.None, o = !1;
|
|
2336
2336
|
for (let e of Array.from(document.styleSheets)) {
|
|
2337
2337
|
let t;
|
|
2338
2338
|
try {
|
|
@@ -2340,13 +2340,13 @@ function Xn(e) {
|
|
|
2340
2340
|
} catch {
|
|
2341
2341
|
continue;
|
|
2342
2342
|
}
|
|
2343
|
-
let n =
|
|
2344
|
-
if (n.mask && (a |= n.mask, a ===
|
|
2343
|
+
let n = $n(t, i);
|
|
2344
|
+
if (n.mask && (a |= n.mask, a === bn)) break;
|
|
2345
2345
|
o ||= n.sawStyleRule;
|
|
2346
2346
|
}
|
|
2347
|
-
return (a !== W.None || o) &&
|
|
2347
|
+
return (a !== W.None || o) && Sn.set(t, a), a;
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function $n(e, t) {
|
|
2350
2350
|
if (!e) return {
|
|
2351
2351
|
mask: W.None,
|
|
2352
2352
|
sawStyleRule: !1
|
|
@@ -2359,14 +2359,14 @@ function Zn(e, t) {
|
|
|
2359
2359
|
let e = a.selectorText ?? "";
|
|
2360
2360
|
if (!e || !t.some((t) => t.test(e))) continue;
|
|
2361
2361
|
r = !0;
|
|
2362
|
-
for (let t of
|
|
2363
|
-
if (n ===
|
|
2362
|
+
for (let t of yn) t.hints.some((t) => e.includes(t)) && (n |= t.flag);
|
|
2363
|
+
if (n === bn) return {
|
|
2364
2364
|
mask: n,
|
|
2365
2365
|
sawStyleRule: !0
|
|
2366
2366
|
};
|
|
2367
2367
|
} else if ("cssRules" in a) {
|
|
2368
|
-
let e =
|
|
2369
|
-
if (e.mask && (n |= e.mask, n ===
|
|
2368
|
+
let e = $n(a.cssRules, t);
|
|
2369
|
+
if (e.mask && (n |= e.mask, n === bn)) return {
|
|
2370
2370
|
mask: n,
|
|
2371
2371
|
sawStyleRule: !0
|
|
2372
2372
|
};
|
|
@@ -2379,101 +2379,101 @@ function Zn(e, t) {
|
|
|
2379
2379
|
sawStyleRule: r
|
|
2380
2380
|
};
|
|
2381
2381
|
}
|
|
2382
|
-
function
|
|
2382
|
+
function er(e) {
|
|
2383
2383
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2384
2384
|
}
|
|
2385
|
-
function
|
|
2385
|
+
function tr(e) {
|
|
2386
2386
|
return e.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2387
2387
|
}
|
|
2388
2388
|
//#endregion
|
|
2389
2389
|
//#region src/auth/storage.ts
|
|
2390
|
-
var
|
|
2391
|
-
function
|
|
2390
|
+
var nr = "ikon-auth-session", rr = "ikon-auth-refreshable", ir = "ikon-auth-auto-login-attempted-run", ar = 6048e5, or = 6e4;
|
|
2391
|
+
function sr(e) {
|
|
2392
2392
|
try {
|
|
2393
2393
|
let t = e.split(".");
|
|
2394
2394
|
if (t.length !== 3) return !0;
|
|
2395
2395
|
let n = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), i = JSON.parse(atob(r));
|
|
2396
|
-
return typeof i.exp == "number" && Date.now() >= i.exp * 1e3 -
|
|
2396
|
+
return typeof i.exp == "number" && Date.now() >= i.exp * 1e3 - or;
|
|
2397
2397
|
} catch {
|
|
2398
2398
|
return !0;
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
2401
|
function K(e) {
|
|
2402
2402
|
try {
|
|
2403
|
-
localStorage.setItem(
|
|
2403
|
+
localStorage.setItem(nr, JSON.stringify(e));
|
|
2404
2404
|
} catch {
|
|
2405
2405
|
console.warn("Failed to save auth session to localStorage");
|
|
2406
2406
|
}
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2408
|
+
function cr() {
|
|
2409
2409
|
try {
|
|
2410
|
-
let e = localStorage.getItem(
|
|
2410
|
+
let e = localStorage.getItem(nr);
|
|
2411
2411
|
if (!e) return null;
|
|
2412
2412
|
let t = JSON.parse(e);
|
|
2413
|
-
return Date.now() - t.authenticatedAt >
|
|
2413
|
+
return Date.now() - t.authenticatedAt > ar || sr(t.token) ? (hr(), null) : t;
|
|
2414
2414
|
} catch {
|
|
2415
2415
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2416
2416
|
}
|
|
2417
2417
|
}
|
|
2418
|
-
function
|
|
2418
|
+
function lr(e) {
|
|
2419
2419
|
try {
|
|
2420
|
-
localStorage.removeItem(
|
|
2420
|
+
localStorage.removeItem(nr), localStorage.setItem(rr, JSON.stringify(e));
|
|
2421
2421
|
} catch {
|
|
2422
2422
|
console.warn("Failed to save the auth session marker to localStorage");
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
2425
|
-
function
|
|
2425
|
+
function ur() {
|
|
2426
2426
|
try {
|
|
2427
|
-
let e = localStorage.getItem(
|
|
2427
|
+
let e = localStorage.getItem(rr);
|
|
2428
2428
|
if (!e) return null;
|
|
2429
2429
|
let t = JSON.parse(e);
|
|
2430
|
-
return Date.now() - t.renewedAt >
|
|
2430
|
+
return Date.now() - t.renewedAt > ar ? (fr(), null) : t;
|
|
2431
2431
|
} catch {
|
|
2432
2432
|
return console.warn("Failed to load the auth session marker from localStorage"), null;
|
|
2433
2433
|
}
|
|
2434
2434
|
}
|
|
2435
|
-
function
|
|
2436
|
-
let e =
|
|
2437
|
-
e &&
|
|
2435
|
+
function dr() {
|
|
2436
|
+
let e = ur();
|
|
2437
|
+
e && lr({
|
|
2438
2438
|
...e,
|
|
2439
2439
|
renewedAt: Date.now()
|
|
2440
2440
|
});
|
|
2441
2441
|
}
|
|
2442
|
-
function
|
|
2442
|
+
function fr() {
|
|
2443
2443
|
try {
|
|
2444
|
-
localStorage.removeItem(
|
|
2444
|
+
localStorage.removeItem(rr);
|
|
2445
2445
|
} catch {
|
|
2446
2446
|
console.warn("Failed to clear the auth session marker from localStorage");
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
function
|
|
2450
|
-
|
|
2449
|
+
function pr() {
|
|
2450
|
+
cr()?.provider === "anonymous" && hr(), ur()?.provider === "anonymous" && fr();
|
|
2451
2451
|
}
|
|
2452
|
-
function
|
|
2452
|
+
function mr() {
|
|
2453
2453
|
try {
|
|
2454
2454
|
let e = typeof window < "u" ? new URLSearchParams(window.location.search) : void 0;
|
|
2455
2455
|
if (e?.get("ikon_token") || e?.get("ikon_code")) return !0;
|
|
2456
2456
|
} catch {}
|
|
2457
|
-
let e =
|
|
2457
|
+
let e = cr()?.provider ?? ur()?.provider;
|
|
2458
2458
|
return e !== void 0 && e !== "anonymous";
|
|
2459
2459
|
}
|
|
2460
|
-
function
|
|
2460
|
+
function hr() {
|
|
2461
2461
|
try {
|
|
2462
|
-
localStorage.removeItem(
|
|
2462
|
+
localStorage.removeItem(nr);
|
|
2463
2463
|
} catch {
|
|
2464
2464
|
console.warn("Failed to clear auth session from localStorage");
|
|
2465
2465
|
}
|
|
2466
2466
|
}
|
|
2467
|
-
function
|
|
2467
|
+
function gr(e) {
|
|
2468
2468
|
if (e) try {
|
|
2469
|
-
sessionStorage.setItem(
|
|
2469
|
+
sessionStorage.setItem(ir, e);
|
|
2470
2470
|
} catch {
|
|
2471
2471
|
console.warn("Failed to record auto-login attempt in sessionStorage");
|
|
2472
2472
|
}
|
|
2473
2473
|
}
|
|
2474
|
-
function
|
|
2474
|
+
function _r() {
|
|
2475
2475
|
try {
|
|
2476
|
-
return sessionStorage.getItem(
|
|
2476
|
+
return sessionStorage.getItem(ir);
|
|
2477
2477
|
} catch {
|
|
2478
2478
|
return null;
|
|
2479
2479
|
}
|
|
@@ -2489,8 +2489,8 @@ function q(e) {
|
|
|
2489
2489
|
}
|
|
2490
2490
|
//#endregion
|
|
2491
2491
|
//#region src/auth/auth-service.ts
|
|
2492
|
-
var
|
|
2493
|
-
async function
|
|
2492
|
+
var vr = 15e3, yr = 15e3, J = b("AuthService");
|
|
2493
|
+
async function br(e) {
|
|
2494
2494
|
try {
|
|
2495
2495
|
return await fetch(e, {
|
|
2496
2496
|
method: "GET",
|
|
@@ -2500,9 +2500,9 @@ async function vr(e) {
|
|
|
2500
2500
|
return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
|
|
2501
2501
|
}
|
|
2502
2502
|
}
|
|
2503
|
-
var
|
|
2504
|
-
function
|
|
2505
|
-
if (e.headers.get(
|
|
2503
|
+
var xr = "x-ikon-auth-service";
|
|
2504
|
+
function Sr(e) {
|
|
2505
|
+
if (e.headers.get(xr) !== null) return !1;
|
|
2506
2506
|
if (e.status === 404 || e.status === 405) return !0;
|
|
2507
2507
|
let t = e.headers.get("content-type") ?? "";
|
|
2508
2508
|
return e.status === 200 && t.includes("text/html");
|
|
@@ -2514,20 +2514,20 @@ async function Y(e, t, n) {
|
|
|
2514
2514
|
} catch (i) {
|
|
2515
2515
|
let a = i instanceof Error ? `${i.name}: ${i.message}` : String(i);
|
|
2516
2516
|
if (!s) {
|
|
2517
|
-
let n = await
|
|
2517
|
+
let n = await br(e);
|
|
2518
2518
|
throw J.error(`Auth request ${t} could not reach ${r} — ${a}. ${n}`), Error(`Auth request could not reach ${r} (${a}). ${n}`, { cause: i });
|
|
2519
2519
|
}
|
|
2520
2520
|
J.warn(`Auth request ${t} could not reach ${r} (${a}); falling back to ${s}`);
|
|
2521
2521
|
try {
|
|
2522
2522
|
return await fetch(s, n);
|
|
2523
2523
|
} catch (n) {
|
|
2524
|
-
let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await
|
|
2524
|
+
let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await br(e);
|
|
2525
2525
|
throw J.error(`Auth request ${t} failed on both ${r} (${a}) and ${s} (${i}). ${o}`), Error(`Auth request unreachable: ${r} (${a}) and ${s} (${i})`, { cause: n });
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
|
-
return a && s !== null &&
|
|
2528
|
+
return a && s !== null && Sr(c) ? (J.warn(`Auth request ${t} got a non-auth-service answer from ${r} (${c.status}); this LB has no /ikon/auth route, falling back to ${s}`), fetch(s, n)) : c;
|
|
2529
2529
|
}
|
|
2530
|
-
async function
|
|
2530
|
+
async function Cr(e, t, n) {
|
|
2531
2531
|
let r = ae(), i = n === "guest" ? "anonymous" : n, a = {
|
|
2532
2532
|
method: "POST",
|
|
2533
2533
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2550,7 +2550,7 @@ async function xr(e, t, n) {
|
|
|
2550
2550
|
};
|
|
2551
2551
|
return K(l), l;
|
|
2552
2552
|
}
|
|
2553
|
-
async function
|
|
2553
|
+
async function wr({ email: e, spaceId: t, authUrl: n }) {
|
|
2554
2554
|
let r = await Y(n, "/email/send", {
|
|
2555
2555
|
method: "POST",
|
|
2556
2556
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2558,14 +2558,14 @@ async function Sr({ email: e, spaceId: t, authUrl: n }) {
|
|
|
2558
2558
|
email: e.trim(),
|
|
2559
2559
|
space: t
|
|
2560
2560
|
}),
|
|
2561
|
-
signal: _(
|
|
2561
|
+
signal: _(vr)
|
|
2562
2562
|
});
|
|
2563
2563
|
if (!r.ok) {
|
|
2564
2564
|
let e = await r.text().catch(() => "Failed to send login code");
|
|
2565
2565
|
throw Error(e);
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
|
-
async function
|
|
2568
|
+
async function Tr({ email: e, code: t, authUrl: n }) {
|
|
2569
2569
|
let r = await Y(n, "/email/code", {
|
|
2570
2570
|
method: "POST",
|
|
2571
2571
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2573,7 +2573,7 @@ async function Cr({ email: e, code: t, authUrl: n }) {
|
|
|
2573
2573
|
email: e.trim(),
|
|
2574
2574
|
code: t.trim()
|
|
2575
2575
|
}),
|
|
2576
|
-
signal: _(
|
|
2576
|
+
signal: _(vr)
|
|
2577
2577
|
});
|
|
2578
2578
|
if (!r.ok) {
|
|
2579
2579
|
let e = await r.text().catch(() => "Invalid code");
|
|
@@ -2586,22 +2586,22 @@ async function Cr({ email: e, code: t, authUrl: n }) {
|
|
|
2586
2586
|
};
|
|
2587
2587
|
return K(a), a;
|
|
2588
2588
|
}
|
|
2589
|
-
function
|
|
2589
|
+
function Er() {
|
|
2590
2590
|
let e = new URLSearchParams(window.location.search), t = e.get("ikon_token"), n = e.get("ikon_provider");
|
|
2591
2591
|
return t && n ? {
|
|
2592
2592
|
token: t,
|
|
2593
2593
|
provider: n
|
|
2594
2594
|
} : null;
|
|
2595
2595
|
}
|
|
2596
|
-
function
|
|
2596
|
+
function Dr() {
|
|
2597
2597
|
let e = new URLSearchParams(window.location.search), t = e.get("ikon_code"), n = e.get("ikon_provider");
|
|
2598
2598
|
return t && n ? {
|
|
2599
2599
|
code: t,
|
|
2600
2600
|
provider: n
|
|
2601
2601
|
} : null;
|
|
2602
2602
|
}
|
|
2603
|
-
async function
|
|
2604
|
-
let r =
|
|
2603
|
+
async function Or(e, t, n) {
|
|
2604
|
+
let r = _e();
|
|
2605
2605
|
if (!r) throw Error("This sign-in was started in a different browser or tab");
|
|
2606
2606
|
let i = await Y(await S(n), "/oauth/exchange", {
|
|
2607
2607
|
method: "POST",
|
|
@@ -2611,7 +2611,7 @@ async function Er(e, t, n) {
|
|
|
2611
2611
|
codeVerifier: r,
|
|
2612
2612
|
supportsRefresh: !0
|
|
2613
2613
|
}),
|
|
2614
|
-
signal: _(
|
|
2614
|
+
signal: _(vr)
|
|
2615
2615
|
});
|
|
2616
2616
|
if (!i.ok) throw Error("Could not complete the sign-in");
|
|
2617
2617
|
let { token: a, expiresAt: o } = await i.json(), s = {
|
|
@@ -2620,20 +2620,20 @@ async function Er(e, t, n) {
|
|
|
2620
2620
|
authenticatedAt: Date.now(),
|
|
2621
2621
|
expiresAt: o
|
|
2622
2622
|
};
|
|
2623
|
-
return o ?
|
|
2623
|
+
return o ? lr({
|
|
2624
2624
|
provider: t,
|
|
2625
2625
|
authenticatedAt: s.authenticatedAt,
|
|
2626
2626
|
renewedAt: s.authenticatedAt
|
|
2627
2627
|
}) : K(s), s;
|
|
2628
2628
|
}
|
|
2629
|
-
async function
|
|
2629
|
+
async function kr(e) {
|
|
2630
2630
|
let t = w();
|
|
2631
2631
|
if (t === null) return null;
|
|
2632
2632
|
let n;
|
|
2633
2633
|
try {
|
|
2634
2634
|
n = await fetch(`${t}/session/refresh`, {
|
|
2635
2635
|
method: "POST",
|
|
2636
|
-
signal: _(
|
|
2636
|
+
signal: _(yr)
|
|
2637
2637
|
});
|
|
2638
2638
|
} catch (e) {
|
|
2639
2639
|
let n = e instanceof Error ? `${e.name}: ${e.message}` : String(e);
|
|
@@ -2649,25 +2649,25 @@ async function Dr(e) {
|
|
|
2649
2649
|
expiresAt: i
|
|
2650
2650
|
};
|
|
2651
2651
|
}
|
|
2652
|
-
function
|
|
2652
|
+
function Ar() {
|
|
2653
2653
|
let e = new URLSearchParams(window.location.search), t = e.get("error");
|
|
2654
2654
|
return t ? {
|
|
2655
2655
|
code: t,
|
|
2656
2656
|
provider: e.get("ikon_provider")
|
|
2657
2657
|
} : null;
|
|
2658
2658
|
}
|
|
2659
|
-
function
|
|
2659
|
+
function jr() {
|
|
2660
2660
|
return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("ikon-signed-out");
|
|
2661
2661
|
}
|
|
2662
|
-
var
|
|
2662
|
+
var Mr = {
|
|
2663
2663
|
google: "Google",
|
|
2664
2664
|
facebook: "Facebook",
|
|
2665
2665
|
apple: "Apple",
|
|
2666
2666
|
microsoft: "Microsoft",
|
|
2667
2667
|
signicat: "eID"
|
|
2668
2668
|
};
|
|
2669
|
-
function
|
|
2670
|
-
let r = t ?
|
|
2669
|
+
function Nr(e, t, n) {
|
|
2670
|
+
let r = t ? Mr[t] ?? t : "this provider";
|
|
2671
2671
|
switch (e) {
|
|
2672
2672
|
case "account_exists_unverified_email": {
|
|
2673
2673
|
let e = `This email address already has an account on this app that uses a different sign-in method. For security, ${r} sign-in can't be connected to it automatically.`;
|
|
@@ -2678,7 +2678,7 @@ function jr(e, t, n) {
|
|
|
2678
2678
|
default: return e;
|
|
2679
2679
|
}
|
|
2680
2680
|
}
|
|
2681
|
-
function
|
|
2681
|
+
function Pr() {
|
|
2682
2682
|
let e = new URLSearchParams(window.location.search);
|
|
2683
2683
|
for (let t of [
|
|
2684
2684
|
"ikon_token",
|
|
@@ -2690,11 +2690,11 @@ function Mr() {
|
|
|
2690
2690
|
let t = e.toString();
|
|
2691
2691
|
window.history.replaceState({}, "", t.length > 0 ? `${window.location.pathname}?${t}` : window.location.pathname);
|
|
2692
2692
|
}
|
|
2693
|
-
async function
|
|
2693
|
+
async function Fr(e, t, n, r) {
|
|
2694
2694
|
let i = r ?? window.location.origin + window.location.pathname + window.location.search, a = await x(), o = a ? `&code_challenge=${encodeURIComponent(a)}` : "";
|
|
2695
2695
|
return `${n}/oauth/${e}?space=${encodeURIComponent(t)}&return=${encodeURIComponent(i)}${o}`;
|
|
2696
2696
|
}
|
|
2697
|
-
async function
|
|
2697
|
+
async function Ir(e) {
|
|
2698
2698
|
let t = await Y(e, "/passkey/registration/options", {
|
|
2699
2699
|
method: "POST",
|
|
2700
2700
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2705,7 +2705,7 @@ async function Pr(e) {
|
|
|
2705
2705
|
}
|
|
2706
2706
|
return t.json();
|
|
2707
2707
|
}
|
|
2708
|
-
async function
|
|
2708
|
+
async function Lr(e, t, n) {
|
|
2709
2709
|
let r = await Y(e, "/passkey/registration/verify", {
|
|
2710
2710
|
method: "POST",
|
|
2711
2711
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2725,7 +2725,7 @@ async function Fr(e, t, n) {
|
|
|
2725
2725
|
};
|
|
2726
2726
|
return K(a), a;
|
|
2727
2727
|
}
|
|
2728
|
-
async function
|
|
2728
|
+
async function Rr(e, t) {
|
|
2729
2729
|
let n = await Y(e, "/passkey/authentication/options", {
|
|
2730
2730
|
method: "POST",
|
|
2731
2731
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2737,7 +2737,7 @@ async function Ir(e, t) {
|
|
|
2737
2737
|
}
|
|
2738
2738
|
return n.json();
|
|
2739
2739
|
}
|
|
2740
|
-
async function
|
|
2740
|
+
async function zr(e, t) {
|
|
2741
2741
|
let n = await Y(e, "/passkey/authentication/verify", {
|
|
2742
2742
|
method: "POST",
|
|
2743
2743
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2754,12 +2754,12 @@ async function Lr(e, t) {
|
|
|
2754
2754
|
};
|
|
2755
2755
|
return K(i), i;
|
|
2756
2756
|
}
|
|
2757
|
-
async function
|
|
2757
|
+
async function Br(e, t) {
|
|
2758
2758
|
try {
|
|
2759
2759
|
await Y(await S(t), "/logout", {
|
|
2760
2760
|
method: "POST",
|
|
2761
2761
|
headers: { Authorization: `Bearer ${e}` },
|
|
2762
|
-
signal: _(
|
|
2762
|
+
signal: _(vr)
|
|
2763
2763
|
});
|
|
2764
2764
|
} catch {}
|
|
2765
2765
|
}
|
|
@@ -2772,30 +2772,30 @@ function X(e) {
|
|
|
2772
2772
|
}
|
|
2773
2773
|
//#endregion
|
|
2774
2774
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/base64URLStringToBuffer.js
|
|
2775
|
-
function
|
|
2775
|
+
function Vr(e) {
|
|
2776
2776
|
let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - t.length % 4) % 4, r = t.padEnd(t.length + n, "="), i = atob(r), a = new ArrayBuffer(i.length), o = new Uint8Array(a);
|
|
2777
2777
|
for (let e = 0; e < i.length; e++) o[e] = i.charCodeAt(e);
|
|
2778
2778
|
return a;
|
|
2779
2779
|
}
|
|
2780
2780
|
//#endregion
|
|
2781
2781
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthn.js
|
|
2782
|
-
function
|
|
2783
|
-
return
|
|
2782
|
+
function Hr() {
|
|
2783
|
+
return Ur.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2784
2784
|
}
|
|
2785
|
-
var
|
|
2785
|
+
var Ur = { stubThis: (e) => e };
|
|
2786
2786
|
//#endregion
|
|
2787
2787
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js
|
|
2788
|
-
function
|
|
2788
|
+
function Wr(e) {
|
|
2789
2789
|
let { id: t } = e;
|
|
2790
2790
|
return {
|
|
2791
2791
|
...e,
|
|
2792
|
-
id:
|
|
2792
|
+
id: Vr(t),
|
|
2793
2793
|
transports: e.transports
|
|
2794
2794
|
};
|
|
2795
2795
|
}
|
|
2796
2796
|
//#endregion
|
|
2797
2797
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/isValidDomain.js
|
|
2798
|
-
function
|
|
2798
|
+
function Gr(e) {
|
|
2799
2799
|
return e === "localhost" || /^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e);
|
|
2800
2800
|
}
|
|
2801
2801
|
//#endregion
|
|
@@ -2812,7 +2812,7 @@ var Z = class extends Error {
|
|
|
2812
2812
|
};
|
|
2813
2813
|
//#endregion
|
|
2814
2814
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyRegistrationError.js
|
|
2815
|
-
function
|
|
2815
|
+
function Kr({ error: e, options: t }) {
|
|
2816
2816
|
let { publicKey: n } = t;
|
|
2817
2817
|
if (!n) throw Error("options was missing required publicKey property");
|
|
2818
2818
|
if (e.name === "AbortError") {
|
|
@@ -2858,7 +2858,7 @@ function Wr({ error: e, options: t }) {
|
|
|
2858
2858
|
});
|
|
2859
2859
|
else if (e.name === "SecurityError") {
|
|
2860
2860
|
let t = globalThis.location.hostname;
|
|
2861
|
-
if (!
|
|
2861
|
+
if (!Gr(t)) return new Z({
|
|
2862
2862
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2863
2863
|
code: "ERROR_INVALID_DOMAIN",
|
|
2864
2864
|
cause: e
|
|
@@ -2881,7 +2881,7 @@ function Wr({ error: e, options: t }) {
|
|
|
2881
2881
|
});
|
|
2882
2882
|
return e;
|
|
2883
2883
|
}
|
|
2884
|
-
var
|
|
2884
|
+
var qr = new class {
|
|
2885
2885
|
constructor() {
|
|
2886
2886
|
Object.defineProperty(this, "controller", {
|
|
2887
2887
|
enumerable: !0,
|
|
@@ -2904,31 +2904,31 @@ var Gr = new class {
|
|
|
2904
2904
|
e.name = "AbortError", this.controller.abort(e), this.controller = void 0;
|
|
2905
2905
|
}
|
|
2906
2906
|
}
|
|
2907
|
-
}(),
|
|
2908
|
-
function
|
|
2909
|
-
if (e && !(
|
|
2907
|
+
}(), Jr = ["cross-platform", "platform"];
|
|
2908
|
+
function Yr(e) {
|
|
2909
|
+
if (e && !(Jr.indexOf(e) < 0)) return e;
|
|
2910
2910
|
}
|
|
2911
2911
|
//#endregion
|
|
2912
2912
|
//#region ../../node_modules/@simplewebauthn/browser/esm/methods/startRegistration.js
|
|
2913
|
-
async function
|
|
2913
|
+
async function Xr(e) {
|
|
2914
2914
|
!e.optionsJSON && e.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
|
|
2915
2915
|
let { optionsJSON: t, useAutoRegister: n = !1 } = e;
|
|
2916
|
-
if (!
|
|
2916
|
+
if (!Hr()) throw Error("WebAuthn is not supported in this browser");
|
|
2917
2917
|
let r = {
|
|
2918
2918
|
...t,
|
|
2919
|
-
challenge:
|
|
2919
|
+
challenge: Vr(t.challenge),
|
|
2920
2920
|
user: {
|
|
2921
2921
|
...t.user,
|
|
2922
|
-
id:
|
|
2922
|
+
id: Vr(t.user.id)
|
|
2923
2923
|
},
|
|
2924
|
-
excludeCredentials: t.excludeCredentials?.map(
|
|
2924
|
+
excludeCredentials: t.excludeCredentials?.map(Wr)
|
|
2925
2925
|
}, i = {};
|
|
2926
|
-
n && (i.mediation = "conditional"), i.publicKey = r, i.signal =
|
|
2926
|
+
n && (i.mediation = "conditional"), i.publicKey = r, i.signal = qr.createNewAbortSignal();
|
|
2927
2927
|
let a;
|
|
2928
2928
|
try {
|
|
2929
2929
|
a = await navigator.credentials.create(i);
|
|
2930
2930
|
} catch (e) {
|
|
2931
|
-
throw
|
|
2931
|
+
throw Kr({
|
|
2932
2932
|
error: e,
|
|
2933
2933
|
options: i
|
|
2934
2934
|
});
|
|
@@ -2940,20 +2940,20 @@ async function Jr(e) {
|
|
|
2940
2940
|
if (typeof c.getPublicKeyAlgorithm == "function") try {
|
|
2941
2941
|
d = c.getPublicKeyAlgorithm();
|
|
2942
2942
|
} catch (e) {
|
|
2943
|
-
|
|
2943
|
+
Zr("getPublicKeyAlgorithm()", e);
|
|
2944
2944
|
}
|
|
2945
2945
|
let f;
|
|
2946
2946
|
if (typeof c.getPublicKey == "function") try {
|
|
2947
2947
|
let e = c.getPublicKey();
|
|
2948
2948
|
e !== null && (f = X(e));
|
|
2949
2949
|
} catch (e) {
|
|
2950
|
-
|
|
2950
|
+
Zr("getPublicKey()", e);
|
|
2951
2951
|
}
|
|
2952
2952
|
let p;
|
|
2953
2953
|
if (typeof c.getAuthenticatorData == "function") try {
|
|
2954
2954
|
p = X(c.getAuthenticatorData());
|
|
2955
2955
|
} catch (e) {
|
|
2956
|
-
|
|
2956
|
+
Zr("getAuthenticatorData()", e);
|
|
2957
2957
|
}
|
|
2958
2958
|
return {
|
|
2959
2959
|
id: o,
|
|
@@ -2968,23 +2968,23 @@ async function Jr(e) {
|
|
|
2968
2968
|
},
|
|
2969
2969
|
type: l,
|
|
2970
2970
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2971
|
-
authenticatorAttachment:
|
|
2971
|
+
authenticatorAttachment: Yr(a.authenticatorAttachment)
|
|
2972
2972
|
};
|
|
2973
2973
|
}
|
|
2974
|
-
function
|
|
2974
|
+
function Zr(e, t) {
|
|
2975
2975
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`, t);
|
|
2976
2976
|
}
|
|
2977
2977
|
//#endregion
|
|
2978
2978
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthnAutofill.js
|
|
2979
|
-
function
|
|
2980
|
-
if (!
|
|
2979
|
+
function Qr() {
|
|
2980
|
+
if (!Hr()) return $r.stubThis(new Promise((e) => e(!1)));
|
|
2981
2981
|
let e = globalThis.PublicKeyCredential;
|
|
2982
|
-
return e?.isConditionalMediationAvailable === void 0 ?
|
|
2982
|
+
return e?.isConditionalMediationAvailable === void 0 ? $r.stubThis(new Promise((e) => e(!1))) : $r.stubThis(e.isConditionalMediationAvailable());
|
|
2983
2983
|
}
|
|
2984
|
-
var
|
|
2984
|
+
var $r = { stubThis: (e) => e };
|
|
2985
2985
|
//#endregion
|
|
2986
2986
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js
|
|
2987
|
-
function
|
|
2987
|
+
function ei({ error: e, options: t }) {
|
|
2988
2988
|
let { publicKey: n } = t;
|
|
2989
2989
|
if (!n) throw Error("options was missing required publicKey property");
|
|
2990
2990
|
if (e.name === "AbortError") {
|
|
@@ -3000,7 +3000,7 @@ function Qr({ error: e, options: t }) {
|
|
|
3000
3000
|
});
|
|
3001
3001
|
else if (e.name === "SecurityError") {
|
|
3002
3002
|
let t = globalThis.location.hostname;
|
|
3003
|
-
if (!
|
|
3003
|
+
if (!Gr(t)) return new Z({
|
|
3004
3004
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
3005
3005
|
code: "ERROR_INVALID_DOMAIN",
|
|
3006
3006
|
cause: e
|
|
@@ -3019,28 +3019,28 @@ function Qr({ error: e, options: t }) {
|
|
|
3019
3019
|
}
|
|
3020
3020
|
//#endregion
|
|
3021
3021
|
//#region ../../node_modules/@simplewebauthn/browser/esm/methods/startAuthentication.js
|
|
3022
|
-
async function
|
|
3022
|
+
async function ti(e) {
|
|
3023
3023
|
!e.optionsJSON && e.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
|
|
3024
3024
|
let { optionsJSON: t, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = e;
|
|
3025
|
-
if (!
|
|
3025
|
+
if (!Hr()) throw Error("WebAuthn is not supported in this browser");
|
|
3026
3026
|
let i;
|
|
3027
|
-
t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(
|
|
3027
|
+
t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(Wr));
|
|
3028
3028
|
let a = {
|
|
3029
3029
|
...t,
|
|
3030
|
-
challenge:
|
|
3030
|
+
challenge: Vr(t.challenge),
|
|
3031
3031
|
allowCredentials: i
|
|
3032
3032
|
}, o = {};
|
|
3033
3033
|
if (n) {
|
|
3034
|
-
if (!await
|
|
3034
|
+
if (!await Qr()) throw Error("Browser does not support WebAuthn autofill");
|
|
3035
3035
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r) throw Error("No <input> with \"webauthn\" as the only or last value in its `autocomplete` attribute was detected");
|
|
3036
3036
|
o.mediation = "conditional", a.allowCredentials = [];
|
|
3037
3037
|
}
|
|
3038
|
-
o.publicKey = a, o.signal =
|
|
3038
|
+
o.publicKey = a, o.signal = qr.createNewAbortSignal();
|
|
3039
3039
|
let s;
|
|
3040
3040
|
try {
|
|
3041
3041
|
s = await navigator.credentials.get(o);
|
|
3042
3042
|
} catch (e) {
|
|
3043
|
-
throw
|
|
3043
|
+
throw ei({
|
|
3044
3044
|
error: e,
|
|
3045
3045
|
options: o
|
|
3046
3046
|
});
|
|
@@ -3058,13 +3058,13 @@ async function $r(e) {
|
|
|
3058
3058
|
},
|
|
3059
3059
|
type: d,
|
|
3060
3060
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
3061
|
-
authenticatorAttachment:
|
|
3061
|
+
authenticatorAttachment: Yr(s.authenticatorAttachment)
|
|
3062
3062
|
};
|
|
3063
3063
|
}
|
|
3064
3064
|
//#endregion
|
|
3065
3065
|
//#region src/auth/auth-context.tsx
|
|
3066
|
-
var
|
|
3067
|
-
function
|
|
3066
|
+
var ni = ye(null), ri = 12e4;
|
|
3067
|
+
function ii({ children: e, config: n }) {
|
|
3068
3068
|
let [r, i] = M({
|
|
3069
3069
|
isAuthenticated: !1,
|
|
3070
3070
|
isLoading: !0,
|
|
@@ -3074,9 +3074,9 @@ function ni({ children: e, config: n }) {
|
|
|
3074
3074
|
if (!c.current) {
|
|
3075
3075
|
c.current = !0;
|
|
3076
3076
|
try {
|
|
3077
|
-
let t = await
|
|
3077
|
+
let t = await kr(e);
|
|
3078
3078
|
if (t === null) {
|
|
3079
|
-
|
|
3079
|
+
fr(), i({
|
|
3080
3080
|
isAuthenticated: !1,
|
|
3081
3081
|
isLoading: !1,
|
|
3082
3082
|
user: null,
|
|
@@ -3084,7 +3084,7 @@ function ni({ children: e, config: n }) {
|
|
|
3084
3084
|
});
|
|
3085
3085
|
return;
|
|
3086
3086
|
}
|
|
3087
|
-
|
|
3087
|
+
dr(), i({
|
|
3088
3088
|
isAuthenticated: !0,
|
|
3089
3089
|
isLoading: !1,
|
|
3090
3090
|
user: q(t),
|
|
@@ -3098,24 +3098,24 @@ function ni({ children: e, config: n }) {
|
|
|
3098
3098
|
k(() => {
|
|
3099
3099
|
(() => {
|
|
3100
3100
|
if (s.current) return;
|
|
3101
|
-
let e = n.devLoginRunId, t = !!e &&
|
|
3102
|
-
e && !
|
|
3103
|
-
let r = !!n.devLoginToken && !!e && !t && !
|
|
3104
|
-
o ||
|
|
3105
|
-
let c =
|
|
3101
|
+
let e = n.devLoginRunId, t = !!e && _r() === e;
|
|
3102
|
+
e && !jr() && gr(e);
|
|
3103
|
+
let r = !!n.devLoginToken && !!e && !t && !sr(n.devLoginToken) && !jr();
|
|
3104
|
+
o || pr();
|
|
3105
|
+
let c = Ar();
|
|
3106
3106
|
if (c) {
|
|
3107
|
-
|
|
3107
|
+
Pr(), i({
|
|
3108
3108
|
isAuthenticated: !1,
|
|
3109
3109
|
isLoading: !1,
|
|
3110
3110
|
user: null,
|
|
3111
|
-
error:
|
|
3111
|
+
error: Nr(c.code, c.provider, { emailSignInAvailable: a })
|
|
3112
3112
|
});
|
|
3113
3113
|
return;
|
|
3114
3114
|
}
|
|
3115
3115
|
v();
|
|
3116
|
-
let l =
|
|
3116
|
+
let l = Dr();
|
|
3117
3117
|
if (l) {
|
|
3118
|
-
s.current = !0,
|
|
3118
|
+
s.current = !0, Pr(), Or(l.code, l.provider, n.authUrl).then((e) => {
|
|
3119
3119
|
i({
|
|
3120
3120
|
isAuthenticated: !0,
|
|
3121
3121
|
isLoading: !1,
|
|
@@ -3132,14 +3132,14 @@ function ni({ children: e, config: n }) {
|
|
|
3132
3132
|
});
|
|
3133
3133
|
return;
|
|
3134
3134
|
}
|
|
3135
|
-
let u =
|
|
3135
|
+
let u = Er();
|
|
3136
3136
|
if (u) {
|
|
3137
3137
|
let e = {
|
|
3138
3138
|
token: u.token,
|
|
3139
3139
|
provider: u.provider,
|
|
3140
3140
|
authenticatedAt: Date.now()
|
|
3141
3141
|
};
|
|
3142
|
-
K(e),
|
|
3142
|
+
K(e), Pr(), i({
|
|
3143
3143
|
isAuthenticated: !0,
|
|
3144
3144
|
isLoading: !1,
|
|
3145
3145
|
user: q(e),
|
|
@@ -3147,11 +3147,11 @@ function ni({ children: e, config: n }) {
|
|
|
3147
3147
|
});
|
|
3148
3148
|
return;
|
|
3149
3149
|
}
|
|
3150
|
-
let d =
|
|
3150
|
+
let d = ur();
|
|
3151
3151
|
if (d) {
|
|
3152
|
-
s.current = !0,
|
|
3152
|
+
s.current = !0, kr(d).then((e) => {
|
|
3153
3153
|
if (e === null) {
|
|
3154
|
-
|
|
3154
|
+
fr(), i({
|
|
3155
3155
|
isAuthenticated: !1,
|
|
3156
3156
|
isLoading: !1,
|
|
3157
3157
|
user: null,
|
|
@@ -3159,7 +3159,7 @@ function ni({ children: e, config: n }) {
|
|
|
3159
3159
|
});
|
|
3160
3160
|
return;
|
|
3161
3161
|
}
|
|
3162
|
-
|
|
3162
|
+
dr(), i({
|
|
3163
3163
|
isAuthenticated: !0,
|
|
3164
3164
|
isLoading: !1,
|
|
3165
3165
|
user: q(e),
|
|
@@ -3175,7 +3175,7 @@ function ni({ children: e, config: n }) {
|
|
|
3175
3175
|
});
|
|
3176
3176
|
return;
|
|
3177
3177
|
}
|
|
3178
|
-
let f =
|
|
3178
|
+
let f = cr();
|
|
3179
3179
|
if (f && !(r && f.provider === "anonymous")) {
|
|
3180
3180
|
i({
|
|
3181
3181
|
isAuthenticated: !0,
|
|
@@ -3213,11 +3213,29 @@ function ni({ children: e, config: n }) {
|
|
|
3213
3213
|
a,
|
|
3214
3214
|
o
|
|
3215
3215
|
]), k(() => {
|
|
3216
|
+
if (n.spaceId) return E(n.spaceId, (e) => {
|
|
3217
|
+
s.current = !0, e.codeVerifier && fe(e.codeVerifier), Or(e.code, e.provider, n.authUrl).then((e) => {
|
|
3218
|
+
i({
|
|
3219
|
+
isAuthenticated: !0,
|
|
3220
|
+
isLoading: !1,
|
|
3221
|
+
user: q(e),
|
|
3222
|
+
error: null
|
|
3223
|
+
});
|
|
3224
|
+
}).catch((e) => {
|
|
3225
|
+
i({
|
|
3226
|
+
isAuthenticated: !1,
|
|
3227
|
+
isLoading: !1,
|
|
3228
|
+
user: null,
|
|
3229
|
+
error: e instanceof Error ? e.message : "Could not complete the sign-in"
|
|
3230
|
+
});
|
|
3231
|
+
});
|
|
3232
|
+
});
|
|
3233
|
+
}, [n.spaceId, n.authUrl]), k(() => {
|
|
3216
3234
|
let e = r.user?.expiresAt;
|
|
3217
3235
|
if (!e) return;
|
|
3218
|
-
let t =
|
|
3236
|
+
let t = ur();
|
|
3219
3237
|
if (!t) return;
|
|
3220
|
-
let n = Date.parse(e) -
|
|
3238
|
+
let n = Date.parse(e) - ri, i = setTimeout(() => void l(t), Math.max(0, n - Date.now())), a = () => {
|
|
3221
3239
|
document.visibilityState === "visible" && Date.now() >= n && l(t);
|
|
3222
3240
|
};
|
|
3223
3241
|
return document.addEventListener("visibilitychange", a), () => {
|
|
@@ -3249,7 +3267,7 @@ function ni({ children: e, config: n }) {
|
|
|
3249
3267
|
isLoading: !0
|
|
3250
3268
|
}));
|
|
3251
3269
|
try {
|
|
3252
|
-
let r = await
|
|
3270
|
+
let r = await Cr(n.spaceId, t, e);
|
|
3253
3271
|
i({
|
|
3254
3272
|
isAuthenticated: !0,
|
|
3255
3273
|
isLoading: !1,
|
|
@@ -3272,7 +3290,7 @@ function ni({ children: e, config: n }) {
|
|
|
3272
3290
|
error: null
|
|
3273
3291
|
}));
|
|
3274
3292
|
try {
|
|
3275
|
-
let e = await
|
|
3293
|
+
let e = await ti({ optionsJSON: await Rr(t) }), n = await zr(t, e);
|
|
3276
3294
|
i({
|
|
3277
3295
|
isAuthenticated: !0,
|
|
3278
3296
|
isLoading: !1,
|
|
@@ -3290,21 +3308,21 @@ function ni({ children: e, config: n }) {
|
|
|
3290
3308
|
}
|
|
3291
3309
|
if (e === "email") throw Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3292
3310
|
if (T()) {
|
|
3293
|
-
await
|
|
3311
|
+
await me(e, n.spaceId) || i((e) => ({
|
|
3294
3312
|
...e,
|
|
3295
3313
|
isLoading: !1,
|
|
3296
3314
|
error: "The sign-in window did not complete. Allow pop-ups for this site and try again."
|
|
3297
3315
|
}));
|
|
3298
3316
|
return;
|
|
3299
3317
|
}
|
|
3300
|
-
window.location.href = await
|
|
3318
|
+
window.location.href = await Fr(e, n.spaceId, t);
|
|
3301
3319
|
}, [n.authUrl, n.spaceId]), d = O(async (e) => {
|
|
3302
3320
|
if (!n.spaceId) throw i((e) => ({
|
|
3303
3321
|
...e,
|
|
3304
3322
|
error: "Space ID is not configured"
|
|
3305
3323
|
})), Error("Space ID is not configured");
|
|
3306
3324
|
let t = await S(n.authUrl);
|
|
3307
|
-
await
|
|
3325
|
+
await wr({
|
|
3308
3326
|
email: e,
|
|
3309
3327
|
spaceId: n.spaceId,
|
|
3310
3328
|
authUrl: t
|
|
@@ -3316,7 +3334,7 @@ function ni({ children: e, config: n }) {
|
|
|
3316
3334
|
error: null
|
|
3317
3335
|
}));
|
|
3318
3336
|
try {
|
|
3319
|
-
let r = await
|
|
3337
|
+
let r = await Tr({
|
|
3320
3338
|
email: e,
|
|
3321
3339
|
code: t,
|
|
3322
3340
|
authUrl: await S(n.authUrl)
|
|
@@ -3337,7 +3355,7 @@ function ni({ children: e, config: n }) {
|
|
|
3337
3355
|
}
|
|
3338
3356
|
}, [n.authUrl]), p = O(() => {
|
|
3339
3357
|
let e = r.user?.token;
|
|
3340
|
-
e &&
|
|
3358
|
+
e && Br(e, n.authUrl), hr(), fr(), t.clearAll(), i({
|
|
3341
3359
|
isAuthenticated: !1,
|
|
3342
3360
|
isLoading: !1,
|
|
3343
3361
|
user: null,
|
|
@@ -3351,7 +3369,7 @@ function ni({ children: e, config: n }) {
|
|
|
3351
3369
|
error: null
|
|
3352
3370
|
}));
|
|
3353
3371
|
try {
|
|
3354
|
-
let n = await
|
|
3372
|
+
let n = await Lr(t, await Xr({ optionsJSON: await Ir(t) }), e);
|
|
3355
3373
|
i({
|
|
3356
3374
|
isAuthenticated: !0,
|
|
3357
3375
|
isLoading: !1,
|
|
@@ -3382,37 +3400,37 @@ function ni({ children: e, config: n }) {
|
|
|
3382
3400
|
d,
|
|
3383
3401
|
f
|
|
3384
3402
|
]);
|
|
3385
|
-
return /* @__PURE__ */
|
|
3403
|
+
return /* @__PURE__ */ F(ni, {
|
|
3386
3404
|
value: g,
|
|
3387
3405
|
children: e
|
|
3388
3406
|
});
|
|
3389
3407
|
}
|
|
3390
|
-
function
|
|
3391
|
-
let e =
|
|
3408
|
+
function ai() {
|
|
3409
|
+
let e = be(ni);
|
|
3392
3410
|
if (!e) throw Error("useAuth must be used within an AuthProvider");
|
|
3393
3411
|
return e;
|
|
3394
3412
|
}
|
|
3395
|
-
function
|
|
3396
|
-
return
|
|
3413
|
+
function oi() {
|
|
3414
|
+
return be(ni);
|
|
3397
3415
|
}
|
|
3398
3416
|
//#endregion
|
|
3399
3417
|
//#region src/auth/oauth-continuation.ts
|
|
3400
|
-
var
|
|
3401
|
-
function
|
|
3418
|
+
var si = "ikon-oauth", ci = "ikon-oauth-continue", li = "ikon-oauth-continue-attempts", ui = 5, di = 6e5;
|
|
3419
|
+
function fi() {
|
|
3402
3420
|
if (typeof window > "u") return !1;
|
|
3403
|
-
let e = new URL(window.location.href).searchParams.get(
|
|
3404
|
-
return e ? (
|
|
3421
|
+
let e = new URL(window.location.href).searchParams.get(si);
|
|
3422
|
+
return e ? (vi(e), !0) : _i() !== null;
|
|
3405
3423
|
}
|
|
3406
|
-
function
|
|
3407
|
-
return
|
|
3424
|
+
function pi() {
|
|
3425
|
+
return mi() !== null;
|
|
3408
3426
|
}
|
|
3409
|
-
function
|
|
3410
|
-
return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ??
|
|
3427
|
+
function mi() {
|
|
3428
|
+
return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? _i();
|
|
3411
3429
|
}
|
|
3412
|
-
async function
|
|
3413
|
-
let t =
|
|
3430
|
+
async function hi(e) {
|
|
3431
|
+
let t = mi();
|
|
3414
3432
|
if (!t) return !1;
|
|
3415
|
-
if (!e) return
|
|
3433
|
+
if (!e) return gi() < ui ? (console.warn("[ikon] Waiting for the signed-in session before continuing the authorization that sent you here."), !1) : (Q(), console.warn("[ikon] Gave up continuing the authorization that sent you here: no signed-in session became readable. Start the connection again from the application."), !1);
|
|
3416
3434
|
try {
|
|
3417
3435
|
let n = await fetch("/ikon/oauth/continue", {
|
|
3418
3436
|
method: "POST",
|
|
@@ -3429,27 +3447,27 @@ async function pi(e) {
|
|
|
3429
3447
|
return !1;
|
|
3430
3448
|
}
|
|
3431
3449
|
}
|
|
3432
|
-
function
|
|
3450
|
+
function gi() {
|
|
3433
3451
|
try {
|
|
3434
|
-
let e = Number(sessionStorage.getItem(
|
|
3435
|
-
return sessionStorage.setItem(
|
|
3452
|
+
let e = Number(sessionStorage.getItem(li) ?? "0") + 1;
|
|
3453
|
+
return sessionStorage.setItem(li, String(e)), e;
|
|
3436
3454
|
} catch {
|
|
3437
|
-
return
|
|
3455
|
+
return ui;
|
|
3438
3456
|
}
|
|
3439
3457
|
}
|
|
3440
|
-
function
|
|
3458
|
+
function _i() {
|
|
3441
3459
|
try {
|
|
3442
|
-
let e = sessionStorage.getItem(
|
|
3460
|
+
let e = sessionStorage.getItem(ci);
|
|
3443
3461
|
if (!e) return null;
|
|
3444
3462
|
let { id: t, at: n } = JSON.parse(e);
|
|
3445
|
-
return !t || typeof n != "number" || Date.now() - n >
|
|
3463
|
+
return !t || typeof n != "number" || Date.now() - n > di ? (Q(), null) : t;
|
|
3446
3464
|
} catch {
|
|
3447
3465
|
return Q(), null;
|
|
3448
3466
|
}
|
|
3449
3467
|
}
|
|
3450
|
-
function
|
|
3468
|
+
function vi(e) {
|
|
3451
3469
|
try {
|
|
3452
|
-
sessionStorage.setItem(
|
|
3470
|
+
sessionStorage.setItem(ci, JSON.stringify({
|
|
3453
3471
|
id: e,
|
|
3454
3472
|
at: Date.now()
|
|
3455
3473
|
}));
|
|
@@ -3457,27 +3475,27 @@ function gi(e) {
|
|
|
3457
3475
|
}
|
|
3458
3476
|
function Q() {
|
|
3459
3477
|
try {
|
|
3460
|
-
sessionStorage.removeItem(
|
|
3478
|
+
sessionStorage.removeItem(ci), sessionStorage.removeItem(li);
|
|
3461
3479
|
} catch {}
|
|
3462
3480
|
try {
|
|
3463
3481
|
let e = new URL(window.location.href);
|
|
3464
|
-
e.searchParams.has("ikon-oauth") && (e.searchParams.delete(
|
|
3482
|
+
e.searchParams.has("ikon-oauth") && (e.searchParams.delete(si), window.history.replaceState(null, "", e.toString()));
|
|
3465
3483
|
} catch {}
|
|
3466
3484
|
}
|
|
3467
3485
|
//#endregion
|
|
3468
3486
|
//#region src/auth/use-auth-guard.ts
|
|
3469
|
-
function
|
|
3470
|
-
let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } =
|
|
3487
|
+
function yi(e) {
|
|
3488
|
+
let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } = ai(), o = j(!1), s = j(!1), c = N(he, C, C), l = c.required;
|
|
3471
3489
|
k(() => {
|
|
3472
|
-
|
|
3490
|
+
fi() && pe("An application is asking to act as you. Sign in to review what it wants.");
|
|
3473
3491
|
}, []), k(() => {
|
|
3474
3492
|
if (!(!l || !r.isAuthenticated || !r.user || r.user.provider === "anonymous")) {
|
|
3475
|
-
if (!
|
|
3493
|
+
if (!pi()) {
|
|
3476
3494
|
y();
|
|
3477
3495
|
return;
|
|
3478
3496
|
}
|
|
3479
|
-
s.current || (s.current = !0,
|
|
3480
|
-
(e || !
|
|
3497
|
+
s.current || (s.current = !0, hi(a()).then((e) => {
|
|
3498
|
+
(e || !pi()) && y();
|
|
3481
3499
|
}).finally(() => {
|
|
3482
3500
|
s.current = !1;
|
|
3483
3501
|
}));
|
|
@@ -3492,7 +3510,7 @@ function _i(e) {
|
|
|
3492
3510
|
let e = t.methods.includes("global") ? "global" : t.methods.includes("guest") ? "guest" : null;
|
|
3493
3511
|
if (!e) return;
|
|
3494
3512
|
let a = new URLSearchParams(window.location.search), s = a.get(n);
|
|
3495
|
-
if (s === "true" || s === "1" || s === "" ||
|
|
3513
|
+
if (s === "true" || s === "1" || s === "" || jr()) {
|
|
3496
3514
|
a.delete(n);
|
|
3497
3515
|
let t = a.toString(), r = window.location.pathname + (t ? `?${t}` : "");
|
|
3498
3516
|
window.history.replaceState({}, "", r), o.current = !0, i(e);
|
|
@@ -3517,17 +3535,17 @@ function _i(e) {
|
|
|
3517
3535
|
}
|
|
3518
3536
|
//#endregion
|
|
3519
3537
|
//#region src/debug/debug-overlay.tsx
|
|
3520
|
-
var
|
|
3538
|
+
var bi = (() => {
|
|
3521
3539
|
try {
|
|
3522
3540
|
return re();
|
|
3523
3541
|
} catch {
|
|
3524
3542
|
return !1;
|
|
3525
3543
|
}
|
|
3526
|
-
})(),
|
|
3527
|
-
function
|
|
3528
|
-
$.push(`[+${((Date.now() -
|
|
3544
|
+
})(), xi = Date.now(), $ = [], Si = 300;
|
|
3545
|
+
function Ci(e) {
|
|
3546
|
+
$.push(`[+${((Date.now() - xi) / 1e3).toFixed(1)}s] ${e}`), $.length > Si && $.shift();
|
|
3529
3547
|
}
|
|
3530
|
-
function
|
|
3548
|
+
function wi(e) {
|
|
3531
3549
|
if (typeof e == "string") return e;
|
|
3532
3550
|
if (e instanceof Error) return `${e.name}: ${e.message}`;
|
|
3533
3551
|
try {
|
|
@@ -3536,10 +3554,10 @@ function Si(e) {
|
|
|
3536
3554
|
return String(e);
|
|
3537
3555
|
}
|
|
3538
3556
|
}
|
|
3539
|
-
var
|
|
3540
|
-
function
|
|
3541
|
-
if (
|
|
3542
|
-
|
|
3557
|
+
var Ti = !1;
|
|
3558
|
+
function Ei() {
|
|
3559
|
+
if (Ti || typeof window > "u") return;
|
|
3560
|
+
Ti = !0, window.addEventListener("error", (e) => Ci(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Ci(`unhandledRejection: ${wi(e.reason)}`));
|
|
3543
3561
|
let e = console;
|
|
3544
3562
|
for (let t of [
|
|
3545
3563
|
"error",
|
|
@@ -3550,17 +3568,17 @@ function wi() {
|
|
|
3550
3568
|
let n = e[t]?.bind(console) ?? (() => void 0);
|
|
3551
3569
|
e[t] = (...e) => {
|
|
3552
3570
|
try {
|
|
3553
|
-
|
|
3571
|
+
Ci(`console.${t}: ${e.map(wi).join(" ")}`);
|
|
3554
3572
|
} catch {}
|
|
3555
3573
|
n(...e);
|
|
3556
3574
|
};
|
|
3557
3575
|
}
|
|
3558
3576
|
try {
|
|
3559
|
-
|
|
3577
|
+
ge((e) => Ci(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: d.DEBUG });
|
|
3560
3578
|
} catch {}
|
|
3561
3579
|
}
|
|
3562
|
-
|
|
3563
|
-
function
|
|
3580
|
+
bi && Ei();
|
|
3581
|
+
function Di() {
|
|
3564
3582
|
let e = !1;
|
|
3565
3583
|
try {
|
|
3566
3584
|
let t = URL.createObjectURL(new Blob([""]));
|
|
@@ -3570,11 +3588,11 @@ function Ti() {
|
|
|
3570
3588
|
} catch {}
|
|
3571
3589
|
return e;
|
|
3572
3590
|
}
|
|
3573
|
-
function
|
|
3591
|
+
function Oi() {
|
|
3574
3592
|
let e = globalThis;
|
|
3575
3593
|
return [
|
|
3576
3594
|
`Worker=${typeof Worker < "u"}`,
|
|
3577
|
-
`moduleWorker=${
|
|
3595
|
+
`moduleWorker=${Di()}`,
|
|
3578
3596
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3579
3597
|
`WebTransport=${e.WebTransport !== void 0}`,
|
|
3580
3598
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3587,17 +3605,17 @@ function Ei() {
|
|
|
3587
3605
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3588
3606
|
].join(" ");
|
|
3589
3607
|
}
|
|
3590
|
-
function
|
|
3608
|
+
function ki(e) {
|
|
3591
3609
|
return /ERROR|error:|Rejection/.test(e) ? "#f88" : /WARN|warn:/.test(e) ? "#fc6" : "#9d9";
|
|
3592
3610
|
}
|
|
3593
|
-
function
|
|
3594
|
-
let n =
|
|
3611
|
+
function Ai({ state: e = "", forceVisible: t = !1 }) {
|
|
3612
|
+
let n = bi || t, r = e === "connected" || e === "reconnecting", [, i] = Se((e) => e + 1, 0), [a, o] = M(!0);
|
|
3595
3613
|
return k(() => {
|
|
3596
3614
|
if (!n) return;
|
|
3597
|
-
|
|
3615
|
+
Ei();
|
|
3598
3616
|
let e = setInterval(i, 1e3);
|
|
3599
3617
|
return () => clearInterval(e);
|
|
3600
|
-
}, [n]), n ? r && a ? /* @__PURE__ */
|
|
3618
|
+
}, [n]), n ? r && a ? /* @__PURE__ */ I("button", {
|
|
3601
3619
|
type: "button",
|
|
3602
3620
|
onClick: () => o(!1),
|
|
3603
3621
|
style: {
|
|
@@ -3617,7 +3635,7 @@ function Oi({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3617
3635
|
$.length,
|
|
3618
3636
|
")"
|
|
3619
3637
|
]
|
|
3620
|
-
}) : /* @__PURE__ */
|
|
3638
|
+
}) : /* @__PURE__ */ I("div", {
|
|
3621
3639
|
style: {
|
|
3622
3640
|
...r ? {
|
|
3623
3641
|
position: "fixed",
|
|
@@ -3638,7 +3656,7 @@ function Oi({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3638
3656
|
zIndex: 2147483647
|
|
3639
3657
|
},
|
|
3640
3658
|
children: [
|
|
3641
|
-
/* @__PURE__ */
|
|
3659
|
+
/* @__PURE__ */ I("div", {
|
|
3642
3660
|
style: {
|
|
3643
3661
|
color: "#fff",
|
|
3644
3662
|
fontSize: "18px",
|
|
@@ -3648,11 +3666,11 @@ function Oi({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3648
3666
|
"Ikon debug overlay — state: ",
|
|
3649
3667
|
e || "?",
|
|
3650
3668
|
", +",
|
|
3651
|
-
Math.round((Date.now() -
|
|
3669
|
+
Math.round((Date.now() - xi) / 1e3),
|
|
3652
3670
|
"s, ",
|
|
3653
3671
|
$.length,
|
|
3654
3672
|
" entries",
|
|
3655
|
-
r && /* @__PURE__ */
|
|
3673
|
+
r && /* @__PURE__ */ F("button", {
|
|
3656
3674
|
type: "button",
|
|
3657
3675
|
onClick: () => o(!0),
|
|
3658
3676
|
style: {
|
|
@@ -3668,7 +3686,7 @@ function Oi({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3668
3686
|
})
|
|
3669
3687
|
]
|
|
3670
3688
|
}),
|
|
3671
|
-
/* @__PURE__ */
|
|
3689
|
+
/* @__PURE__ */ F("div", {
|
|
3672
3690
|
style: {
|
|
3673
3691
|
color: "#9cf",
|
|
3674
3692
|
wordBreak: "break-all",
|
|
@@ -3676,7 +3694,7 @@ function Oi({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3676
3694
|
},
|
|
3677
3695
|
children: typeof window < "u" ? window.location.href : ""
|
|
3678
3696
|
}),
|
|
3679
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ F("div", {
|
|
3680
3698
|
style: {
|
|
3681
3699
|
color: "#ff0",
|
|
3682
3700
|
wordBreak: "break-all",
|
|
@@ -3684,23 +3702,23 @@ function Oi({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3684
3702
|
},
|
|
3685
3703
|
children: typeof navigator < "u" ? navigator.userAgent : "no navigator"
|
|
3686
3704
|
}),
|
|
3687
|
-
/* @__PURE__ */
|
|
3705
|
+
/* @__PURE__ */ F("div", {
|
|
3688
3706
|
style: {
|
|
3689
3707
|
color: "#8cf",
|
|
3690
3708
|
marginBottom: "4px"
|
|
3691
3709
|
},
|
|
3692
|
-
children:
|
|
3710
|
+
children: Oi()
|
|
3693
3711
|
}),
|
|
3694
|
-
/* @__PURE__ */
|
|
3712
|
+
/* @__PURE__ */ F("div", {
|
|
3695
3713
|
style: {
|
|
3696
3714
|
color: "#8cf",
|
|
3697
3715
|
marginBottom: "10px"
|
|
3698
3716
|
},
|
|
3699
3717
|
children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : ""
|
|
3700
3718
|
}),
|
|
3701
|
-
/* @__PURE__ */
|
|
3719
|
+
/* @__PURE__ */ F("div", { children: $.length === 0 ? "(nothing captured yet)" : $.map((e, t) => /* @__PURE__ */ F("div", {
|
|
3702
3720
|
style: {
|
|
3703
|
-
color:
|
|
3721
|
+
color: ki(e),
|
|
3704
3722
|
wordBreak: "break-all"
|
|
3705
3723
|
},
|
|
3706
3724
|
children: e
|
|
@@ -3710,7 +3728,7 @@ function Oi({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3710
3728
|
}
|
|
3711
3729
|
//#endregion
|
|
3712
3730
|
//#region src/app/connection-state-renderer.tsx
|
|
3713
|
-
function
|
|
3731
|
+
function ji({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, stores: i, registry: a, client: o, onAction: s, renderIdle: c, renderConnecting: l, renderConnectingSlow: u, renderConnected: d, renderOffline: f, renderError: p }) {
|
|
3714
3732
|
let m = j(!1), h = (() => {
|
|
3715
3733
|
switch (e) {
|
|
3716
3734
|
case "waitingForExternalConnectUrl":
|
|
@@ -3736,124 +3754,124 @@ function ki({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, sto
|
|
|
3736
3754
|
default: return null;
|
|
3737
3755
|
}
|
|
3738
3756
|
})();
|
|
3739
|
-
return /* @__PURE__ */
|
|
3757
|
+
return /* @__PURE__ */ I(P, { children: [h, /* @__PURE__ */ F(Ai, { state: e })] });
|
|
3740
3758
|
}
|
|
3741
3759
|
//#endregion
|
|
3742
3760
|
//#region src/app/boot-snapshot-variant.ts
|
|
3743
|
-
function
|
|
3761
|
+
function Mi(e, t) {
|
|
3744
3762
|
return e === !1 ? !1 : t ? "signed-in" : "guest";
|
|
3745
3763
|
}
|
|
3746
3764
|
//#endregion
|
|
3747
3765
|
//#region src/app/use-ikon-app.ts
|
|
3748
|
-
var
|
|
3749
|
-
function
|
|
3766
|
+
var Ni = b("useIkonApp");
|
|
3767
|
+
function Pi() {
|
|
3750
3768
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__) return window.__IKON_AUTH_CONFIG__;
|
|
3751
3769
|
}
|
|
3752
|
-
function
|
|
3770
|
+
function Fi() {
|
|
3753
3771
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__) return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3754
3772
|
}
|
|
3755
|
-
function
|
|
3773
|
+
function Ii(e, t) {
|
|
3756
3774
|
return {
|
|
3757
3775
|
...e,
|
|
3758
3776
|
...t ?? {}
|
|
3759
3777
|
};
|
|
3760
3778
|
}
|
|
3761
|
-
function
|
|
3762
|
-
let { authConfig: n, modules: r, parameters: l, timeouts: d, backgroundAudio: f, webRtc: _, audio: v, video: y, websocket: b, webtransport: x, proxy: te, liveSnapshot: re, bootSnapshot: ie } = e, C = n === void 0 ?
|
|
3763
|
-
pe.current = f, me.current = d, he.current = _, ge.current = v, _e.current = y,
|
|
3764
|
-
let [
|
|
3779
|
+
function Li(e) {
|
|
3780
|
+
let { authConfig: n, modules: r, parameters: l, timeouts: d, backgroundAudio: f, webRtc: _, audio: v, video: y, websocket: b, webtransport: x, proxy: te, liveSnapshot: re, bootSnapshot: ie } = e, C = n === void 0 ? Pi() ?? null : n, ae = Fi(), w = oi(), se = !!w && w.state.isLoading, T = j(null), ce = j(null), E = j(null), ue = j(!1), fe = j(!1), pe = j(f), me = j(d), he = j(_), ge = j(v), _e = j(y), ve = j(b), ye = j(x), D = j(te), be = j(re), xe = j(ie), Se = j("local"), N = j(void 0);
|
|
3781
|
+
pe.current = f, me.current = d, he.current = _, ge.current = v, _e.current = y, ve.current = b, ye.current = x, D.current = te, be.current = re, xe.current = ie;
|
|
3782
|
+
let [P, F] = M("connecting"), [I, Ce] = M(!1), [L, we] = M(!1), [Te, Ee] = M(null), [De, Oe] = M(null), [ke, Ae] = M(!1), [je, Me] = M(!1), [Ne, Pe] = M(!1), [Fe, Ie] = M(null), [R, Le] = M(null), [Re, ze] = M(!1), Be = j(!1), [Ve, He] = M(0), z = A(() => {
|
|
3765
3783
|
try {
|
|
3766
3784
|
return le();
|
|
3767
3785
|
} catch {
|
|
3768
3786
|
return { parameters: {} };
|
|
3769
3787
|
}
|
|
3770
|
-
}, []),
|
|
3771
|
-
|
|
3772
|
-
let
|
|
3788
|
+
}, []), We = JSON.stringify(l ?? {}), B = A(() => Ii(z.parameters, l), [z.parameters, We]), Ge = (C?.methods?.length ?? 0) > 0, Ke = Mi(ie, Ge && mr());
|
|
3789
|
+
Ke !== !1 && !i() && a(Ke);
|
|
3790
|
+
let V = A(() => {
|
|
3773
3791
|
if (!C?.spaceId) return null;
|
|
3774
3792
|
let e = w?.state.user;
|
|
3775
3793
|
return e ? {
|
|
3776
3794
|
token: e.token,
|
|
3777
3795
|
provider: e.provider,
|
|
3778
3796
|
authenticatedAt: e.authenticatedAt
|
|
3779
|
-
} :
|
|
3797
|
+
} : cr();
|
|
3780
3798
|
}, [
|
|
3781
3799
|
C?.spaceId,
|
|
3782
|
-
|
|
3800
|
+
Ve,
|
|
3783
3801
|
w?.state.isLoading,
|
|
3784
3802
|
w?.state.isAuthenticated,
|
|
3785
3803
|
w?.state.user?.token
|
|
3786
|
-
]),
|
|
3787
|
-
Xe && !
|
|
3788
|
-
|
|
3804
|
+
]), qe = ae?.enabled ?? !1, Je = ae?.host ?? "localhost", Ye = ae?.port ?? 8443, Xe = !se && !!C && !V && !C.requireSignIn && !!C.spaceId && (oe() || qe);
|
|
3805
|
+
Xe && !R && !Re && !Be.current && (Be.current = !0, S(C.authUrl).then((e) => Cr(C.spaceId, e)).then((e) => {
|
|
3806
|
+
Le(e.token), ze(!0);
|
|
3789
3807
|
}).catch((e) => {
|
|
3790
|
-
|
|
3808
|
+
Ni.error("Anonymous auth failed:", e), Be.current = !1, qe ? ze(!0) : Ee(e instanceof Error ? e.message : "Anonymous auth failed");
|
|
3791
3809
|
}));
|
|
3792
|
-
let
|
|
3810
|
+
let Ze = A(() => {
|
|
3793
3811
|
if (se) return null;
|
|
3794
|
-
if (
|
|
3795
|
-
if (Xe && !
|
|
3796
|
-
let e =
|
|
3812
|
+
if (qe) {
|
|
3813
|
+
if (Xe && !Re) return null;
|
|
3814
|
+
let e = V?.token ?? R ?? void 0, t = e ? ne(e) ?? void 0 : void 0;
|
|
3797
3815
|
return { local: {
|
|
3798
3816
|
host: Je,
|
|
3799
3817
|
httpsPort: Ye,
|
|
3800
3818
|
userId: t,
|
|
3801
|
-
token:
|
|
3819
|
+
token: V?.token ?? void 0,
|
|
3802
3820
|
identityToken: e,
|
|
3803
3821
|
spaceId: C?.spaceId,
|
|
3804
3822
|
backendUrl: C?.backendUrl,
|
|
3805
3823
|
authUrl: C?.authUrl,
|
|
3806
|
-
parameters:
|
|
3824
|
+
parameters: B
|
|
3807
3825
|
} };
|
|
3808
3826
|
}
|
|
3809
|
-
return
|
|
3810
|
-
token:
|
|
3827
|
+
return V?.token && C?.spaceId ? { sessionToken: {
|
|
3828
|
+
token: V.token,
|
|
3811
3829
|
spaceId: C.spaceId,
|
|
3812
3830
|
backendType: ee(),
|
|
3813
|
-
sessionIdentityHash:
|
|
3814
|
-
parameters:
|
|
3815
|
-
} } :
|
|
3816
|
-
token:
|
|
3831
|
+
sessionIdentityHash: z.sessionIdentityHash,
|
|
3832
|
+
parameters: B
|
|
3833
|
+
} } : R && C?.spaceId ? { sessionToken: {
|
|
3834
|
+
token: R,
|
|
3817
3835
|
spaceId: C.spaceId,
|
|
3818
3836
|
backendType: ee(),
|
|
3819
|
-
sessionIdentityHash:
|
|
3820
|
-
parameters:
|
|
3837
|
+
sessionIdentityHash: z.sessionIdentityHash,
|
|
3838
|
+
parameters: B
|
|
3821
3839
|
} } : oe() ? null : { local: {
|
|
3822
3840
|
host: Je,
|
|
3823
3841
|
httpsPort: Ye,
|
|
3824
3842
|
spaceId: C?.spaceId,
|
|
3825
3843
|
backendUrl: C?.backendUrl,
|
|
3826
3844
|
authUrl: C?.authUrl,
|
|
3827
|
-
parameters:
|
|
3845
|
+
parameters: B
|
|
3828
3846
|
} };
|
|
3829
3847
|
}, [
|
|
3830
3848
|
se,
|
|
3831
|
-
|
|
3849
|
+
qe,
|
|
3832
3850
|
Je,
|
|
3833
3851
|
Ye,
|
|
3834
|
-
|
|
3852
|
+
V?.token,
|
|
3835
3853
|
C?.spaceId,
|
|
3836
3854
|
C?.backendUrl,
|
|
3837
3855
|
C?.authUrl,
|
|
3838
|
-
|
|
3856
|
+
R,
|
|
3839
3857
|
Xe,
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3858
|
+
Re,
|
|
3859
|
+
z.sessionIdentityHash,
|
|
3860
|
+
B
|
|
3843
3861
|
]);
|
|
3844
|
-
|
|
3845
|
-
let
|
|
3862
|
+
Se.current = C?.spaceId ?? "local", N.current = V?.token ?? R ?? void 0, gn(Fe);
|
|
3863
|
+
let Qe = vn(Fe);
|
|
3846
3864
|
k(() => {
|
|
3847
|
-
if (!
|
|
3848
|
-
if (
|
|
3865
|
+
if (!ue.current) {
|
|
3866
|
+
if (ue.current = !0, E.current = tn(), r) for (let e of r) e(E.current);
|
|
3849
3867
|
E.current.loadRegisteredModules().catch((e) => {
|
|
3850
|
-
|
|
3868
|
+
Ni.error("Failed to load UI modules", e);
|
|
3851
3869
|
});
|
|
3852
3870
|
}
|
|
3853
3871
|
}, []), k(() => {
|
|
3854
|
-
if (!
|
|
3872
|
+
if (!Ze) return;
|
|
3855
3873
|
let e = new u({
|
|
3856
|
-
...
|
|
3874
|
+
...Ze,
|
|
3857
3875
|
timeouts: me.current,
|
|
3858
3876
|
audio: ge.current !== void 0 || pe.current ? {
|
|
3859
3877
|
enabled: ge.current,
|
|
@@ -3868,85 +3886,85 @@ function Fi(e) {
|
|
|
3868
3886
|
artist: document.title || void 0
|
|
3869
3887
|
},
|
|
3870
3888
|
webRtc: he.current === !1 ? { enabled: !1 } : void 0,
|
|
3871
|
-
websocket:
|
|
3872
|
-
webtransport:
|
|
3873
|
-
proxy:
|
|
3889
|
+
websocket: ve.current,
|
|
3890
|
+
webtransport: ye.current,
|
|
3891
|
+
proxy: D.current,
|
|
3874
3892
|
onConnectionStateChange: (e) => {
|
|
3875
|
-
|
|
3893
|
+
F(e);
|
|
3876
3894
|
},
|
|
3877
3895
|
onError: (e) => {
|
|
3878
|
-
|
|
3896
|
+
Ee(e.message);
|
|
3879
3897
|
}
|
|
3880
3898
|
});
|
|
3881
3899
|
T.current = e;
|
|
3882
|
-
let n = be.current ?? !0, r =
|
|
3900
|
+
let n = be.current ?? !0, r = N.current, i = r ? ne(r) ?? null : null, a = n && i ? {
|
|
3883
3901
|
enabled: !0,
|
|
3884
|
-
appId:
|
|
3902
|
+
appId: Se.current,
|
|
3885
3903
|
userId: i
|
|
3886
|
-
} : void 0, l =
|
|
3904
|
+
} : void 0, l = V != null && V.provider !== "anonymous", d = Ge && (l || mr()), f = new Ue({
|
|
3887
3905
|
client: e,
|
|
3888
3906
|
liveSnapshot: a,
|
|
3889
|
-
bootSnapshot:
|
|
3907
|
+
bootSnapshot: Mi(xe.current, d)
|
|
3890
3908
|
});
|
|
3891
|
-
ce.current = f,
|
|
3909
|
+
ce.current = f, Ie(f), we(!1);
|
|
3892
3910
|
let _ = f.subscribeToUiUpdates(() => {
|
|
3893
|
-
|
|
3911
|
+
we(!0), de();
|
|
3894
3912
|
});
|
|
3895
3913
|
return e.connect().catch((e) => {
|
|
3896
|
-
if (
|
|
3897
|
-
|
|
3914
|
+
if (Ni.error("Connection failed:", e), e instanceof o) {
|
|
3915
|
+
Oe(e.reason);
|
|
3898
3916
|
return;
|
|
3899
3917
|
}
|
|
3900
3918
|
if (e instanceof m) {
|
|
3901
|
-
|
|
3919
|
+
Ae(!0);
|
|
3902
3920
|
return;
|
|
3903
3921
|
}
|
|
3904
3922
|
if (e instanceof g) {
|
|
3905
|
-
|
|
3923
|
+
Me(!0);
|
|
3906
3924
|
return;
|
|
3907
3925
|
}
|
|
3908
3926
|
if (!(e instanceof h)) {
|
|
3909
3927
|
if (e instanceof s) {
|
|
3910
|
-
|
|
3928
|
+
Pe(!0);
|
|
3911
3929
|
return;
|
|
3912
3930
|
}
|
|
3913
|
-
e instanceof p || e instanceof c && !fe.current && (fe.current = !0,
|
|
3931
|
+
e instanceof p || e instanceof c && !fe.current && (fe.current = !0, Ni.warn("Auth session appears stale, clearing and retrying"), t.clearAll(), w ? w.logout() : (hr(), He((e) => e + 1)));
|
|
3914
3932
|
}
|
|
3915
3933
|
}), () => {
|
|
3916
3934
|
_(), e.disconnect(), T.current = null, f.dispose(), ce.current = null;
|
|
3917
3935
|
};
|
|
3918
|
-
}, [
|
|
3919
|
-
let
|
|
3936
|
+
}, [Ze]);
|
|
3937
|
+
let $e = O((e, t) => {
|
|
3920
3938
|
let n = typeof t == "string" ? t : JSON.stringify(t ?? {});
|
|
3921
3939
|
T.current?.sendActionCall(e, n);
|
|
3922
3940
|
}, []);
|
|
3923
3941
|
k(() => {
|
|
3924
|
-
if (
|
|
3942
|
+
if (P !== "connecting") {
|
|
3925
3943
|
Ce(!1);
|
|
3926
3944
|
return;
|
|
3927
3945
|
}
|
|
3928
3946
|
let e = T.current?.slowConnectionThresholdMs ?? 5e3, t = setTimeout(() => Ce(!0), e);
|
|
3929
3947
|
return () => clearTimeout(t);
|
|
3930
|
-
}, [
|
|
3931
|
-
let
|
|
3948
|
+
}, [P]);
|
|
3949
|
+
let et = P === "connected" || P === "reconnecting", H = L && P !== "offline";
|
|
3932
3950
|
return k(() => {
|
|
3933
|
-
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(
|
|
3934
|
-
}, [
|
|
3935
|
-
connectionState:
|
|
3936
|
-
error:
|
|
3937
|
-
accessDeniedReason:
|
|
3938
|
-
isServerFull:
|
|
3939
|
-
isSessionExpired:
|
|
3940
|
-
isStartupFailed:
|
|
3941
|
-
stores:
|
|
3951
|
+
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(H));
|
|
3952
|
+
}, [H]), {
|
|
3953
|
+
connectionState: P,
|
|
3954
|
+
error: Te,
|
|
3955
|
+
accessDeniedReason: De,
|
|
3956
|
+
isServerFull: ke,
|
|
3957
|
+
isSessionExpired: je,
|
|
3958
|
+
isStartupFailed: Ne,
|
|
3959
|
+
stores: Qe,
|
|
3942
3960
|
client: T.current,
|
|
3943
3961
|
registry: E.current,
|
|
3944
3962
|
clientRef: T,
|
|
3945
3963
|
uiRef: ce,
|
|
3946
3964
|
registryRef: E,
|
|
3947
|
-
onAction:
|
|
3948
|
-
isReady:
|
|
3949
|
-
isLive:
|
|
3965
|
+
onAction: $e,
|
|
3966
|
+
isReady: et,
|
|
3967
|
+
isLive: H,
|
|
3950
3968
|
brandingRequired: T.current?.brandingRequired ?? !1,
|
|
3951
3969
|
isConnectingSlow: I,
|
|
3952
3970
|
webRtcVideoStreams: T.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
@@ -3955,16 +3973,16 @@ function Fi(e) {
|
|
|
3955
3973
|
}
|
|
3956
3974
|
//#endregion
|
|
3957
3975
|
//#region src/hooks/use-toasts.ts
|
|
3958
|
-
var
|
|
3959
|
-
function
|
|
3976
|
+
var Ri = 0;
|
|
3977
|
+
function zi(e = 5, t = 5e3) {
|
|
3960
3978
|
let [n, r] = M([]), i = j(/* @__PURE__ */ new Map()), a = O((e) => {
|
|
3961
3979
|
let t = i.current.get(e);
|
|
3962
3980
|
t && (clearTimeout(t), i.current.delete(e)), r((t) => t.filter((t) => t.id !== e));
|
|
3963
3981
|
}, []);
|
|
3964
3982
|
return k(() => {
|
|
3965
|
-
let n = i.current, o =
|
|
3983
|
+
let n = i.current, o = ge((i) => {
|
|
3966
3984
|
if (!se()) return;
|
|
3967
|
-
let o = `toast-${++
|
|
3985
|
+
let o = `toast-${++Ri}`, s = {
|
|
3968
3986
|
id: o,
|
|
3969
3987
|
level: i.level === d.ERROR ? "error" : "warn",
|
|
3970
3988
|
message: i.message,
|
|
@@ -3992,7 +4010,7 @@ function Li(e = 5, t = 5e3) {
|
|
|
3992
4010
|
}
|
|
3993
4011
|
//#endregion
|
|
3994
4012
|
//#region src/hooks/use-ikon-reactive.ts
|
|
3995
|
-
function
|
|
4013
|
+
function Bi(e, t, n) {
|
|
3996
4014
|
let [r, i] = M(n);
|
|
3997
4015
|
return k(() => {
|
|
3998
4016
|
if (!e) return;
|
|
@@ -4010,7 +4028,7 @@ function Ri(e, t, n) {
|
|
|
4010
4028
|
}
|
|
4011
4029
|
//#endregion
|
|
4012
4030
|
//#region src/hooks/use-reactive.ts
|
|
4013
|
-
function
|
|
4031
|
+
function Vi(e, t, n) {
|
|
4014
4032
|
let [r, i] = M(null);
|
|
4015
4033
|
return k(() => {
|
|
4016
4034
|
if (!e) return;
|
|
@@ -4022,48 +4040,48 @@ function zi(e, t, n) {
|
|
|
4022
4040
|
}), () => {
|
|
4023
4041
|
n = !1;
|
|
4024
4042
|
};
|
|
4025
|
-
}, [e, t]),
|
|
4043
|
+
}, [e, t]), Bi(r ? e : null, r ?? "", n);
|
|
4026
4044
|
}
|
|
4027
4045
|
//#endregion
|
|
4028
4046
|
//#region src/app/use-ikon-debug.ts
|
|
4029
|
-
var
|
|
4047
|
+
var Hi = b("IkonDebug"), Ui = {
|
|
4030
4048
|
Digit1: "connecting",
|
|
4031
4049
|
Digit2: "connected",
|
|
4032
4050
|
Digit3: "reconnecting",
|
|
4033
4051
|
Digit4: "offline",
|
|
4034
4052
|
Digit5: "offline",
|
|
4035
4053
|
Digit0: "clear"
|
|
4036
|
-
},
|
|
4037
|
-
function
|
|
4054
|
+
}, Wi = "Digit5", Gi = "Digit6", Ki = "Synthetic debug error (Ctrl+Shift+5)", qi = "Synthetic debug access-denied (Ctrl+Shift+6)", Ji = 5e3;
|
|
4055
|
+
function Yi(e) {
|
|
4038
4056
|
let t = se(), [n, r] = M(null), [i, a] = M(!1), [o, s] = M(null), [c, l] = M(null), [u, d] = M(!1), [f, p] = M(!1), [m, h] = M(!1);
|
|
4039
4057
|
return k(() => {
|
|
4040
4058
|
if (!t) return;
|
|
4041
4059
|
let e = (e) => {
|
|
4042
4060
|
if (!e.ctrlKey || !e.shiftKey) return;
|
|
4043
4061
|
if (e.code === "KeyE") {
|
|
4044
|
-
e.preventDefault(), d((e) => (
|
|
4062
|
+
e.preventDefault(), d((e) => (Hi.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
|
|
4045
4063
|
return;
|
|
4046
4064
|
}
|
|
4047
4065
|
if (e.code === "Digit7") {
|
|
4048
|
-
e.preventDefault(), p((e) => (
|
|
4066
|
+
e.preventDefault(), p((e) => (Hi.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
|
|
4049
4067
|
return;
|
|
4050
4068
|
}
|
|
4051
4069
|
if (e.code === "Digit8") {
|
|
4052
|
-
e.preventDefault(), h((e) => (
|
|
4070
|
+
e.preventDefault(), h((e) => (Hi.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
|
|
4053
4071
|
return;
|
|
4054
4072
|
}
|
|
4055
|
-
if (e.code ===
|
|
4056
|
-
e.preventDefault(), l(
|
|
4073
|
+
if (e.code === Gi) {
|
|
4074
|
+
e.preventDefault(), l(qi), r(null), s(null), Hi.warn("Forced access denied");
|
|
4057
4075
|
return;
|
|
4058
4076
|
}
|
|
4059
|
-
let t =
|
|
4077
|
+
let t = Ui[e.code];
|
|
4060
4078
|
if (t === void 0) return;
|
|
4061
4079
|
if (e.preventDefault(), t === "clear") {
|
|
4062
|
-
r(null), s(null), l(null),
|
|
4080
|
+
r(null), s(null), l(null), Hi.warn("Cleared forced state");
|
|
4063
4081
|
return;
|
|
4064
4082
|
}
|
|
4065
|
-
let n = e.code ===
|
|
4066
|
-
r(t), s(n ?
|
|
4083
|
+
let n = e.code === Wi;
|
|
4084
|
+
r(t), s(n ? Ki : null), l(null), Hi.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
|
|
4067
4085
|
};
|
|
4068
4086
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
4069
4087
|
}, [t]), k(() => {
|
|
@@ -4071,7 +4089,7 @@ function qi(e) {
|
|
|
4071
4089
|
a(!1);
|
|
4072
4090
|
return;
|
|
4073
4091
|
}
|
|
4074
|
-
let e = setTimeout(() => a(!0),
|
|
4092
|
+
let e = setTimeout(() => a(!0), Ji);
|
|
4075
4093
|
return () => clearTimeout(e);
|
|
4076
4094
|
}, [n]), !t || n === null && !u && c === null && !f && !m ? {
|
|
4077
4095
|
app: e,
|
|
@@ -4102,64 +4120,64 @@ function qi(e) {
|
|
|
4102
4120
|
}
|
|
4103
4121
|
//#endregion
|
|
4104
4122
|
//#region src/app/ikon-app.tsx
|
|
4105
|
-
function
|
|
4123
|
+
function Xi(e, t) {
|
|
4106
4124
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
4107
4125
|
}
|
|
4108
|
-
function
|
|
4126
|
+
function Zi(e) {
|
|
4109
4127
|
return e === void 0 ? null : typeof e == "function" ? e() : e;
|
|
4110
4128
|
}
|
|
4111
|
-
function
|
|
4129
|
+
function Qi(e, t) {
|
|
4112
4130
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
4113
4131
|
}
|
|
4114
|
-
function
|
|
4132
|
+
function $i(e, t) {
|
|
4115
4133
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
4116
4134
|
}
|
|
4117
|
-
function
|
|
4118
|
-
let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o =
|
|
4135
|
+
function ea(e) {
|
|
4136
|
+
let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o = Yi(a), { app: s } = o, { connectionState: c, isConnectingSlow: l, stores: u, registry: d, client: f, onAction: p, isReady: m, error: h, accessDeniedReason: g, brandingRequired: _ } = s, v = _ || o.forcedBranding, y = j(null);
|
|
4119
4137
|
u && d && (m || u.size > 0) && (y.current = {
|
|
4120
4138
|
stores: u,
|
|
4121
4139
|
registry: d,
|
|
4122
4140
|
client: f
|
|
4123
4141
|
});
|
|
4124
4142
|
let b = y.current != null || !!g;
|
|
4125
|
-
if (
|
|
4143
|
+
if (xe(() => {
|
|
4126
4144
|
!b || typeof document > "u" || document.querySelectorAll("[data-ikon-prerender]").forEach((e) => e.remove());
|
|
4127
|
-
}, [b]), g) return
|
|
4145
|
+
}, [b]), g) return $i(i, g);
|
|
4128
4146
|
let x = y.current, S;
|
|
4129
4147
|
switch (c) {
|
|
4130
4148
|
case "waitingForExternalConnectUrl":
|
|
4131
4149
|
case "connecting":
|
|
4132
|
-
S =
|
|
4150
|
+
S = Xi(t, l);
|
|
4133
4151
|
break;
|
|
4134
4152
|
case "reconnecting":
|
|
4135
|
-
S =
|
|
4153
|
+
S = Zi(n);
|
|
4136
4154
|
break;
|
|
4137
4155
|
case "offline":
|
|
4138
|
-
S =
|
|
4156
|
+
S = Qi(r, h);
|
|
4139
4157
|
break;
|
|
4140
4158
|
default: S = null;
|
|
4141
4159
|
}
|
|
4142
|
-
return /* @__PURE__ */
|
|
4143
|
-
x && /* @__PURE__ */
|
|
4160
|
+
return /* @__PURE__ */ I(P, { children: [
|
|
4161
|
+
x && /* @__PURE__ */ F(z, {
|
|
4144
4162
|
stores: x.stores,
|
|
4145
4163
|
registry: x.registry,
|
|
4146
4164
|
client: x.client,
|
|
4147
4165
|
onAction: p
|
|
4148
4166
|
}),
|
|
4149
4167
|
S,
|
|
4150
|
-
v && /* @__PURE__ */
|
|
4151
|
-
/* @__PURE__ */
|
|
4152
|
-
/* @__PURE__ */
|
|
4168
|
+
v && /* @__PURE__ */ F(na, {}),
|
|
4169
|
+
/* @__PURE__ */ F(ra, {}),
|
|
4170
|
+
/* @__PURE__ */ F(Ai, {
|
|
4153
4171
|
state: c,
|
|
4154
4172
|
forceVisible: o.forcedDebugOverlay
|
|
4155
4173
|
})
|
|
4156
4174
|
] });
|
|
4157
4175
|
}
|
|
4158
|
-
var
|
|
4159
|
-
function
|
|
4160
|
-
return /* @__PURE__ */
|
|
4176
|
+
var ta = "https://ikonai.com";
|
|
4177
|
+
function na() {
|
|
4178
|
+
return /* @__PURE__ */ I("a", {
|
|
4161
4179
|
className: "ikon-branding-banner",
|
|
4162
|
-
href:
|
|
4180
|
+
href: ta,
|
|
4163
4181
|
target: "_blank",
|
|
4164
4182
|
rel: "noopener noreferrer",
|
|
4165
4183
|
style: {
|
|
@@ -4180,43 +4198,43 @@ function ea() {
|
|
|
4180
4198
|
boxShadow: "0 -1px 8px rgba(0, 0, 0, 0.25)",
|
|
4181
4199
|
pointerEvents: "auto"
|
|
4182
4200
|
},
|
|
4183
|
-
children: [/* @__PURE__ */
|
|
4201
|
+
children: [/* @__PURE__ */ F("span", {
|
|
4184
4202
|
style: { opacity: .75 },
|
|
4185
4203
|
children: "Powered by"
|
|
4186
|
-
}), /* @__PURE__ */
|
|
4204
|
+
}), /* @__PURE__ */ F("span", {
|
|
4187
4205
|
style: { fontWeight: 700 },
|
|
4188
4206
|
children: "Ikon"
|
|
4189
4207
|
})]
|
|
4190
4208
|
});
|
|
4191
4209
|
}
|
|
4192
|
-
function
|
|
4193
|
-
let { toasts: e, dismissToast: t } =
|
|
4194
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
4210
|
+
function ra() {
|
|
4211
|
+
let { toasts: e, dismissToast: t } = zi();
|
|
4212
|
+
return e.length === 0 ? null : /* @__PURE__ */ F("div", {
|
|
4195
4213
|
className: "ikon-toast-overlay",
|
|
4196
|
-
children: e.map((e) => /* @__PURE__ */
|
|
4214
|
+
children: e.map((e) => /* @__PURE__ */ F(ia, {
|
|
4197
4215
|
toast: e,
|
|
4198
4216
|
onDismiss: t
|
|
4199
4217
|
}, e.id))
|
|
4200
4218
|
});
|
|
4201
4219
|
}
|
|
4202
|
-
function
|
|
4203
|
-
return /* @__PURE__ */
|
|
4220
|
+
function ia({ toast: e, onDismiss: t }) {
|
|
4221
|
+
return /* @__PURE__ */ I("div", {
|
|
4204
4222
|
className: `ikon-toast-overlay-chip ikon-toast-overlay-chip--${e.level}`,
|
|
4205
4223
|
onClick: () => t(e.id),
|
|
4206
4224
|
role: "alert",
|
|
4207
|
-
children: [/* @__PURE__ */
|
|
4225
|
+
children: [/* @__PURE__ */ F("span", {
|
|
4208
4226
|
className: "ikon-toast-overlay-icon",
|
|
4209
4227
|
children: e.level === "error" ? "🚨" : "⚠️"
|
|
4210
|
-
}), /* @__PURE__ */
|
|
4228
|
+
}), /* @__PURE__ */ I("div", {
|
|
4211
4229
|
className: "ikon-toast-overlay-content",
|
|
4212
|
-
children: [/* @__PURE__ */
|
|
4230
|
+
children: [/* @__PURE__ */ I("span", {
|
|
4213
4231
|
className: "ikon-toast-overlay-component",
|
|
4214
4232
|
children: [
|
|
4215
4233
|
"[",
|
|
4216
4234
|
e.component,
|
|
4217
4235
|
"]"
|
|
4218
4236
|
]
|
|
4219
|
-
}), /* @__PURE__ */
|
|
4237
|
+
}), /* @__PURE__ */ F("span", {
|
|
4220
4238
|
className: "ikon-toast-overlay-message",
|
|
4221
4239
|
children: e.message
|
|
4222
4240
|
})]
|
|
@@ -4225,37 +4243,37 @@ function na({ toast: e, onDismiss: t }) {
|
|
|
4225
4243
|
}
|
|
4226
4244
|
//#endregion
|
|
4227
4245
|
//#region src/i18n/i18n.tsx
|
|
4228
|
-
var
|
|
4229
|
-
function
|
|
4246
|
+
var aa = ye(null);
|
|
4247
|
+
function oa(e, t) {
|
|
4230
4248
|
return t ? e.replace(/\{(\w+)\}/g, (e, n) => t[n] ?? `{${n}}`) : e;
|
|
4231
4249
|
}
|
|
4232
|
-
function
|
|
4250
|
+
function sa(e, t) {
|
|
4233
4251
|
let n = ie();
|
|
4234
4252
|
if (n && e.includes(n)) return n;
|
|
4235
4253
|
let r = navigator.language.split("-")[0];
|
|
4236
4254
|
return e.includes(r) ? r : t && e.includes(t) ? t : "en";
|
|
4237
4255
|
}
|
|
4238
|
-
function
|
|
4239
|
-
return t ?
|
|
4256
|
+
function ca(e, t, n) {
|
|
4257
|
+
return t ? sa(e, n) : n && e.includes(n) ? n : "en";
|
|
4240
4258
|
}
|
|
4241
|
-
function
|
|
4242
|
-
let i =
|
|
4259
|
+
function la({ children: e, translations: t, defaultLanguage: n, detectLanguage: r = !1 }) {
|
|
4260
|
+
let i = ca(Object.keys(t), r, n), a = t[i] ?? t.en, o = A(() => ({
|
|
4243
4261
|
t: (e, t) => {
|
|
4244
4262
|
let n = a[e];
|
|
4245
|
-
return
|
|
4263
|
+
return oa(n, t);
|
|
4246
4264
|
},
|
|
4247
4265
|
locale: i,
|
|
4248
4266
|
translations: a
|
|
4249
4267
|
}), [a, i]);
|
|
4250
|
-
return /* @__PURE__ */
|
|
4268
|
+
return /* @__PURE__ */ F(aa, {
|
|
4251
4269
|
value: o,
|
|
4252
4270
|
children: e
|
|
4253
4271
|
});
|
|
4254
4272
|
}
|
|
4255
|
-
function
|
|
4256
|
-
let e =
|
|
4273
|
+
function ua() {
|
|
4274
|
+
let e = be(aa);
|
|
4257
4275
|
if (!e) throw Error("useI18n must be used within an I18nProvider");
|
|
4258
4276
|
return e;
|
|
4259
4277
|
}
|
|
4260
4278
|
//#endregion
|
|
4261
|
-
export {
|
|
4279
|
+
export { ii as AuthProvider, ji as ConnectionStateRenderer, bi as DEBUG_OVERLAY_ENABLED, Ai as DebugOverlay, la as I18nProvider, dt as IKON_UI_BASE_MODULE, Mt as IKON_UI_MEDIA_MODULE, Xt as IKON_UI_SHADERTOY_MODULE, Jt as IKON_UI_SHADERTOY_TYPE, Ve as IKON_UI_STREAM_CATEGORY, Et as IKON_UI_VIDEO_CANVAS_TYPE, Dt as IKON_UI_VIDEO_URL_PLAYER_TYPE, ea as IkonApp, Ue as IkonUi, en as IkonUiRegistry, z as IkonUiSurface, ze as InspectOverlay, on as ParallaxView, R as UiComponentRegistry, Ie as UiRenderer, n as UiStreamStore, Cr as authenticateAnonymous, Fr as buildOAuthRedirectUrl, hr as clearAuthSession, Pr as clearOAuthParams, ut as createBaseResolvers, Le as createComponentLibrary, tn as createIkonUiRegistry, kt as createMediaResolvers, Yt as createShadertoyRendererResolver, He as isIkonUiCategoryMatch, cr as loadAuthSession, ft as loadBaseModule, Nt as loadMediaModule, Zt as loadShadertoyModule, Er as parseOAuthCallback, Ar as parseOAuthError, ue as randomUuid, pt as registerBaseModule, Pt as registerMediaModule, Qt as registerShadertoyModule, Pe as renderChildren, wn as renderMotionLetters, K as saveAuthSession, wr as sendLoginCode, q as sessionToUser, ai as useAuth, yi as useAuthGuard, oi as useAuthOptional, ua as useI18n, Li as useIkonApp, Yi as useIkonDebug, Bi as useIkonReactive, gn as useIkonStyles, vn as useIkonUiStores, Vi as useReactive, zi as useToasts, L as useUiNode, Re as useUiStore, Tr as verifyLoginCode };
|