@ikonai/sdk-react-ui 1.0.71 → 1.0.73
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/ikon-ui.d.ts +3 -0
- package/index.js +391 -369
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IkonUiCore as Sn, UiStreamStore as wn, LiveSnapshotCache as Ut, prefetchBootSnapshot as vn } from "@ikonai/sdk-ui";
|
|
2
|
-
import { UiStreamStore as
|
|
2
|
+
import { UiStreamStore as Fs } from "@ikonai/sdk-ui";
|
|
3
3
|
import En, { useSyncExternalStore as ot, useMemo as W, memo as G, useRef as E, useCallback as j, Fragment as Rn, useEffect as C, useState as x, use as st, createContext as Mt, useReducer as An } from "react";
|
|
4
|
-
import { createLogger as oe, isInspectModeEnabled as Tn, getOrCreateDeviceId as kn, getSameOriginAuthUrl as Cn, abortSignalTimeout as Dt, deriveAuthUrl as ve, getDebugOverlayParam as
|
|
5
|
-
import { randomUuid as
|
|
4
|
+
import { createLogger as oe, isInspectModeEnabled as Tn, getOrCreateDeviceId as kn, getSameOriginAuthUrl as Cn, abortSignalTimeout as Dt, deriveAuthUrl as ve, getDebugOverlayParam as _n, subscribeToLogEvents as jt, LogLevel as Je, parseUrlParams as In, clearSessionParamsFromUrl as On, isCloudEnvironment as ht, extractUserIdFromToken as pt, deriveBackendType as mt, IkonClient as xn, reportConnectTimeline as Nn, AccessDeniedError as Ln, ServerFullError as Pn, AuthenticationError as Un, isDebugModeEnabled as $t, getLangParam as Mn } from "@ikonai/sdk";
|
|
5
|
+
import { randomUuid as Ws } from "@ikonai/sdk";
|
|
6
6
|
var Ce = { exports: {} }, ge = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
@@ -14,7 +14,7 @@ var Ce = { exports: {} }, ge = {};
|
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
16
|
var gt;
|
|
17
|
-
function
|
|
17
|
+
function Dn() {
|
|
18
18
|
if (gt) return ge;
|
|
19
19
|
gt = 1;
|
|
20
20
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
@@ -46,7 +46,7 @@ var ye = {};
|
|
|
46
46
|
* LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
48
|
var yt;
|
|
49
|
-
function
|
|
49
|
+
function jn() {
|
|
50
50
|
return yt || (yt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
51
|
function t(d) {
|
|
52
52
|
if (d == null) return null;
|
|
@@ -64,7 +64,7 @@ function Dn() {
|
|
|
64
64
|
return "Suspense";
|
|
65
65
|
case ee:
|
|
66
66
|
return "SuspenseList";
|
|
67
|
-
case
|
|
67
|
+
case I:
|
|
68
68
|
return "Activity";
|
|
69
69
|
}
|
|
70
70
|
if (typeof d == "object")
|
|
@@ -241,7 +241,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
241
241
|
function m(d) {
|
|
242
242
|
return typeof d == "object" && d !== null && d.$$typeof === u;
|
|
243
243
|
}
|
|
244
|
-
var c = En, u = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), v = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), z = Symbol.for("react.lazy"),
|
|
244
|
+
var c = En, u = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), v = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), P = Symbol.for("react.client.reference"), M = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, $ = Array.isArray, V = console.createTask ? console.createTask : function() {
|
|
245
245
|
return null;
|
|
246
246
|
};
|
|
247
247
|
c = {
|
|
@@ -277,11 +277,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
277
277
|
})()), ye;
|
|
278
278
|
}
|
|
279
279
|
var bt;
|
|
280
|
-
function
|
|
281
|
-
return bt || (bt = 1, process.env.NODE_ENV === "production" ? Ce.exports =
|
|
280
|
+
function $n() {
|
|
281
|
+
return bt || (bt = 1, process.env.NODE_ENV === "production" ? Ce.exports = Dn() : Ce.exports = jn()), Ce.exports;
|
|
282
282
|
}
|
|
283
|
-
var w =
|
|
284
|
-
function
|
|
283
|
+
var w = $n();
|
|
284
|
+
function Bn(t, e) {
|
|
285
285
|
const n = ot(
|
|
286
286
|
(r) => t.subscribe(r),
|
|
287
287
|
() => {
|
|
@@ -309,8 +309,8 @@ function Z(t, e) {
|
|
|
309
309
|
);
|
|
310
310
|
return W(() => t.getNode(e), [t, e, n]);
|
|
311
311
|
}
|
|
312
|
-
const
|
|
313
|
-
function
|
|
312
|
+
const Fn = oe("UIRenderer");
|
|
313
|
+
function Vn(t) {
|
|
314
314
|
if (t === void 0)
|
|
315
315
|
return "{}";
|
|
316
316
|
if (typeof t == "string")
|
|
@@ -321,18 +321,18 @@ function Fn(t) {
|
|
|
321
321
|
return "{}";
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Wn(t) {
|
|
325
325
|
const e = t.styleIds;
|
|
326
326
|
return Array.isArray(e) ? e : [];
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Kn(t) {
|
|
329
329
|
const e = t.children;
|
|
330
330
|
return Array.isArray(e) ? e : [];
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function Yn(t, e) {
|
|
333
333
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Gn(t) {
|
|
336
336
|
if (t.length === 0) return "";
|
|
337
337
|
if (t.length === 1) return t[0].id;
|
|
338
338
|
let e = t[0].id;
|
|
@@ -341,7 +341,7 @@ function Yn(t) {
|
|
|
341
341
|
return e;
|
|
342
342
|
}
|
|
343
343
|
const Ze = G(function t({ nodeId: e, context: n }) {
|
|
344
|
-
const r = Z(n.store, e), o = r ?
|
|
344
|
+
const r = Z(n.store, e), o = r ? Kn(r) : [], s = Gn(o), i = W(
|
|
345
345
|
() => o.length === 0 ? null : o.map((y) => /* @__PURE__ */ w.jsx(t, { nodeId: y.id, context: n }, y.id)),
|
|
346
346
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
347
347
|
[s, n]
|
|
@@ -352,18 +352,18 @@ const Ze = G(function t({ nodeId: e, context: n }) {
|
|
|
352
352
|
return /* @__PURE__ */ w.jsx(Rn, { children: i }, r.id);
|
|
353
353
|
const a = n.library.resolve(r);
|
|
354
354
|
if (!a)
|
|
355
|
-
return
|
|
356
|
-
const l =
|
|
355
|
+
return Fn.warn(`No renderer for node type ${r.type}`), null;
|
|
356
|
+
const l = Wn(r), h = l.length > 0 ? l.join(" ") : void 0, f = a;
|
|
357
357
|
return /* @__PURE__ */ w.jsx(f, { nodeId: e, context: n, className: h });
|
|
358
|
-
},
|
|
359
|
-
function
|
|
358
|
+
}, Yn);
|
|
359
|
+
function zn(t, e) {
|
|
360
360
|
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ w.jsx(Ze, { nodeId: n.id, context: e }, n.id));
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Xn(t, e) {
|
|
363
363
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
364
364
|
}
|
|
365
|
-
const
|
|
366
|
-
const { rootViewId: l, rootNodeId: h } =
|
|
365
|
+
const Hn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
366
|
+
const { rootViewId: l, rootNodeId: h } = Bn(e, r), f = E(s);
|
|
367
367
|
f.current = s;
|
|
368
368
|
const y = E(i);
|
|
369
369
|
y.current = i;
|
|
@@ -372,7 +372,7 @@ const Xn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
372
372
|
const c = j((g, p) => {
|
|
373
373
|
if (!g)
|
|
374
374
|
return;
|
|
375
|
-
const b =
|
|
375
|
+
const b = Vn(p);
|
|
376
376
|
f.current?.(g, b);
|
|
377
377
|
}, []), u = W(() => {
|
|
378
378
|
const g = {
|
|
@@ -381,7 +381,7 @@ const Xn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
381
381
|
handlerCache: e.handlerCache,
|
|
382
382
|
// Access payloads from store at call time, not captured snapshot
|
|
383
383
|
getPayload: (p) => e.getSnapshot().payloads.get(p),
|
|
384
|
-
renderChildren: (p) =>
|
|
384
|
+
renderChildren: (p) => zn(p, g),
|
|
385
385
|
renderView: (p) => {
|
|
386
386
|
const b = e.getSnapshot().views.get(p);
|
|
387
387
|
return b ? /* @__PURE__ */ w.jsx(Ze, { nodeId: b.id, context: g }) : null;
|
|
@@ -398,8 +398,8 @@ const Xn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
398
398
|
return g;
|
|
399
399
|
}, [e, n, c]);
|
|
400
400
|
return !l || !h ? o : /* @__PURE__ */ w.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ w.jsx(Ze, { nodeId: h, context: u }) });
|
|
401
|
-
},
|
|
402
|
-
class
|
|
401
|
+
}, Xn);
|
|
402
|
+
class qn {
|
|
403
403
|
constructor(e, n) {
|
|
404
404
|
if (this.fallback = n, e)
|
|
405
405
|
for (const [r, o] of e)
|
|
@@ -416,18 +416,18 @@ class Hn {
|
|
|
416
416
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function ks(t, e) {
|
|
420
420
|
const n = Object.entries(t);
|
|
421
|
-
return new
|
|
421
|
+
return new qn(n, e);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function Cs(t) {
|
|
424
424
|
return ot(
|
|
425
425
|
(e) => t.subscribe(e),
|
|
426
426
|
() => t.getSnapshot(),
|
|
427
427
|
() => t.getSnapshot()
|
|
428
428
|
);
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function Jn() {
|
|
431
431
|
const t = Tn();
|
|
432
432
|
return C(() => {
|
|
433
433
|
if (!t)
|
|
@@ -553,8 +553,8 @@ function qn() {
|
|
|
553
553
|
};
|
|
554
554
|
}, [t]), null;
|
|
555
555
|
}
|
|
556
|
-
const
|
|
557
|
-
function
|
|
556
|
+
const Zn = oe("IkonUiSurface"), Qe = "ikon-ui";
|
|
557
|
+
function Qn(t, e) {
|
|
558
558
|
return t === e;
|
|
559
559
|
}
|
|
560
560
|
const Bt = G(function({ stores: e, registry: n, category: r = Qe, onAction: o, client: s }) {
|
|
@@ -567,7 +567,7 @@ const Bt = G(function({ stores: e, registry: n, category: r = Qe, onAction: o, c
|
|
|
567
567
|
const m = [];
|
|
568
568
|
for (const [c, u] of e) {
|
|
569
569
|
const g = u.store.getSnapshot();
|
|
570
|
-
|
|
570
|
+
Qn(u.category, r) && (!g.rootViewId || !g.views.has(g.rootViewId) || m.push({ key: c, store: u.store }));
|
|
571
571
|
}
|
|
572
572
|
return m;
|
|
573
573
|
},
|
|
@@ -575,16 +575,23 @@ const Bt = G(function({ stores: e, registry: n, category: r = Qe, onAction: o, c
|
|
|
575
575
|
[e, r, i]
|
|
576
576
|
), f = E(!1), y = h.length > 0;
|
|
577
577
|
return C(() => {
|
|
578
|
-
y && !f.current && (f.current = !0,
|
|
578
|
+
y && !f.current && (f.current = !0, Zn.debug("First UI render"));
|
|
579
579
|
}, [y]), y ? /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
580
|
-
/* @__PURE__ */ w.jsx(
|
|
581
|
-
h.map(({ key: m, store: c }) => /* @__PURE__ */ w.jsx(
|
|
580
|
+
/* @__PURE__ */ w.jsx(Jn, {}),
|
|
581
|
+
h.map(({ key: m, store: c }) => /* @__PURE__ */ w.jsx(Hn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, m))
|
|
582
582
|
] }) : null;
|
|
583
583
|
});
|
|
584
|
-
class
|
|
584
|
+
class er {
|
|
585
585
|
core;
|
|
586
586
|
ownsCore;
|
|
587
587
|
stores = /* @__PURE__ */ new Map();
|
|
588
|
+
// Boot/live-snapshot remap: render the first live update for a new stream into the existing seed
|
|
589
|
+
// stream's surface (React key), so React reconciles skeleton→live in place instead of unmounting
|
|
590
|
+
// the seed and mounting the live (which flashes white on slow devices before the live tree paints).
|
|
591
|
+
liveToSeedSurface = /* @__PURE__ */ new Map();
|
|
592
|
+
// live stream id -> seed surface key
|
|
593
|
+
adoptedSeedSurfaces = /* @__PURE__ */ new Set();
|
|
594
|
+
// seed surface keys taken over by a live stream
|
|
588
595
|
listeners = /* @__PURE__ */ new Set();
|
|
589
596
|
unsubscribeClears;
|
|
590
597
|
unsubscribeStoreChanges;
|
|
@@ -618,21 +625,36 @@ class Qn {
|
|
|
618
625
|
return this.core.subscribeToUiStyleDeletes(e);
|
|
619
626
|
}
|
|
620
627
|
handleUiStreamCleared = (e) => {
|
|
621
|
-
|
|
628
|
+
const n = this.liveToSeedSurface.get(e);
|
|
629
|
+
if (n) {
|
|
630
|
+
this.liveToSeedSurface.delete(e), this.adoptedSeedSurfaces.delete(n), this.stores.delete(n) && this.notify(n);
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
this.adoptedSeedSurfaces.has(e) || this.stores.delete(e) && this.notify(e);
|
|
622
634
|
};
|
|
623
635
|
syncStreamSnapshot = (e) => {
|
|
624
636
|
const n = this.core.uiStore.getSnapshot(e);
|
|
625
|
-
if (!n || !n.rootViewId) {
|
|
637
|
+
if (!n || !n.rootViewId || !n.views.get(n.rootViewId)) {
|
|
626
638
|
this.handleUiStreamCleared(e);
|
|
627
639
|
return;
|
|
628
640
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
const s = this.ensureStoreEntry(e).store.replaceSnapshot(n), i = this.updateCategory(e, n.category);
|
|
634
|
-
(s || i) && this.notify(e);
|
|
641
|
+
const r = this.resolveSurfaceKey(e), s = this.ensureStoreEntry(r).store.replaceSnapshot(n), i = this.updateCategory(r, n.category);
|
|
642
|
+
(s || i) && this.notify(r);
|
|
635
643
|
};
|
|
644
|
+
// Resolve the surface (React key) a stream renders under. A new live stream adopts an existing,
|
|
645
|
+
// un-adopted seed surface so the boot snapshot → live swap reconciles in place rather than
|
|
646
|
+
// remounting (white flash). Seeds and already-mapped streams keep their own key.
|
|
647
|
+
resolveSurfaceKey(e) {
|
|
648
|
+
const n = this.liveToSeedSurface.get(e);
|
|
649
|
+
if (n)
|
|
650
|
+
return n;
|
|
651
|
+
if (this.stores.has(e) || this.core.isSeedStream(e))
|
|
652
|
+
return e;
|
|
653
|
+
for (const r of this.stores.keys())
|
|
654
|
+
if (this.core.isSeedStream(r) && !this.adoptedSeedSurfaces.has(r))
|
|
655
|
+
return this.liveToSeedSurface.set(e, r), this.adoptedSeedSurfaces.add(r), r;
|
|
656
|
+
return e;
|
|
657
|
+
}
|
|
636
658
|
syncAllStreams() {
|
|
637
659
|
const e = this.core.uiStore.getSnapshots(), n = /* @__PURE__ */ new Set();
|
|
638
660
|
for (const r of e)
|
|
@@ -662,7 +684,7 @@ class Qn {
|
|
|
662
684
|
n(e);
|
|
663
685
|
}
|
|
664
686
|
}
|
|
665
|
-
function
|
|
687
|
+
function tr(t) {
|
|
666
688
|
if (typeof t == "string") {
|
|
667
689
|
const e = t.trim();
|
|
668
690
|
return e.length > 0 ? e : void 0;
|
|
@@ -687,10 +709,10 @@ function it(...t) {
|
|
|
687
709
|
}
|
|
688
710
|
return e || void 0;
|
|
689
711
|
}
|
|
690
|
-
const St = /* @__PURE__ */ new WeakMap(),
|
|
712
|
+
const St = /* @__PURE__ */ new WeakMap(), nr = {};
|
|
691
713
|
function at(t) {
|
|
692
714
|
if (!t)
|
|
693
|
-
return
|
|
715
|
+
return nr;
|
|
694
716
|
const e = St.get(t);
|
|
695
717
|
if (e)
|
|
696
718
|
return e;
|
|
@@ -699,7 +721,7 @@ function at(t) {
|
|
|
699
721
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
700
722
|
return St.set(t, n), n;
|
|
701
723
|
}
|
|
702
|
-
function
|
|
724
|
+
function rr(t) {
|
|
703
725
|
let e = t.parentElement;
|
|
704
726
|
for (; e; ) {
|
|
705
727
|
const r = window.getComputedStyle(e).overflowY;
|
|
@@ -716,20 +738,20 @@ function Vt(t, e) {
|
|
|
716
738
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
|
|
717
739
|
});
|
|
718
740
|
}
|
|
719
|
-
const et = "data-ikon-scroll-indicator",
|
|
741
|
+
const et = "data-ikon-scroll-indicator", or = 0.15, xe = "data-ikon-at-bottom";
|
|
720
742
|
function Wt(t) {
|
|
721
|
-
return Math.max(t.clientHeight *
|
|
743
|
+
return Math.max(t.clientHeight * or, 20);
|
|
722
744
|
}
|
|
723
|
-
function
|
|
745
|
+
function sr(t) {
|
|
724
746
|
return t.getAttribute(xe) !== "false";
|
|
725
747
|
}
|
|
726
|
-
function
|
|
748
|
+
function ir(t) {
|
|
727
749
|
t.getAttribute(xe) === null && (t.setAttribute(xe, "true"), t.addEventListener("scroll", () => {
|
|
728
750
|
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Wt(t);
|
|
729
751
|
t.setAttribute(xe, s ? "true" : "false");
|
|
730
752
|
}, { passive: !0 }));
|
|
731
753
|
}
|
|
732
|
-
function
|
|
754
|
+
function ar(t) {
|
|
733
755
|
const e = t.parentElement ?? t, n = e.querySelector(`[${et}]`);
|
|
734
756
|
if (n)
|
|
735
757
|
return n;
|
|
@@ -762,8 +784,8 @@ function ir(t) {
|
|
|
762
784
|
r.style.opacity = "0.9";
|
|
763
785
|
}), e.appendChild(r), r;
|
|
764
786
|
}
|
|
765
|
-
function
|
|
766
|
-
const n =
|
|
787
|
+
function cr(t, e) {
|
|
788
|
+
const n = ar(t);
|
|
767
789
|
n.style.display = "flex";
|
|
768
790
|
const r = () => {
|
|
769
791
|
Vt(t, e), n.style.display = "none";
|
|
@@ -775,7 +797,7 @@ function ar(t, e) {
|
|
|
775
797
|
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
776
798
|
};
|
|
777
799
|
}
|
|
778
|
-
function
|
|
800
|
+
function lr() {
|
|
779
801
|
const t = G(function({ nodeId: n, context: r }) {
|
|
780
802
|
const o = Z(r.store, n), s = E(null), i = de(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, h = de(o?.props?.priority), f = de(o?.props?.key), y = o?.props?.preciseGeneratedAt;
|
|
781
803
|
return C(() => {
|
|
@@ -786,10 +808,10 @@ function cr() {
|
|
|
786
808
|
return;
|
|
787
809
|
let u;
|
|
788
810
|
if (l !== !0) {
|
|
789
|
-
const S =
|
|
811
|
+
const S = rr(c);
|
|
790
812
|
if (S)
|
|
791
|
-
if (
|
|
792
|
-
u =
|
|
813
|
+
if (ir(S), h === "Polite" && !sr(S))
|
|
814
|
+
u = cr(S, c);
|
|
793
815
|
else {
|
|
794
816
|
const U = (S.parentElement ?? S).querySelector(`[${et}]`);
|
|
795
817
|
U && (U.style.display = "none"), Vt(S, c);
|
|
@@ -828,9 +850,9 @@ function cr() {
|
|
|
828
850
|
return t;
|
|
829
851
|
};
|
|
830
852
|
}
|
|
831
|
-
function
|
|
853
|
+
function ur() {
|
|
832
854
|
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
833
|
-
const s = Z(r.store, n), i =
|
|
855
|
+
const s = Z(r.store, n), i = tr(s?.props?.onInvokeId), a = j(() => {
|
|
834
856
|
i && r.dispatchAction(i);
|
|
835
857
|
}, [i, r]);
|
|
836
858
|
if (!s)
|
|
@@ -856,7 +878,7 @@ function lr() {
|
|
|
856
878
|
return t;
|
|
857
879
|
};
|
|
858
880
|
}
|
|
859
|
-
function
|
|
881
|
+
function dr() {
|
|
860
882
|
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
861
883
|
const s = Z(r.store, n);
|
|
862
884
|
if (!s)
|
|
@@ -869,7 +891,7 @@ function ur() {
|
|
|
869
891
|
return t;
|
|
870
892
|
};
|
|
871
893
|
}
|
|
872
|
-
function
|
|
894
|
+
function fr() {
|
|
873
895
|
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
874
896
|
const s = Z(r.store, n);
|
|
875
897
|
if (!s)
|
|
@@ -882,19 +904,19 @@ function dr() {
|
|
|
882
904
|
return t;
|
|
883
905
|
};
|
|
884
906
|
}
|
|
885
|
-
function
|
|
907
|
+
function hr() {
|
|
886
908
|
return [
|
|
887
|
-
lr(),
|
|
888
909
|
ur(),
|
|
889
910
|
dr(),
|
|
890
|
-
|
|
911
|
+
fr(),
|
|
912
|
+
lr()
|
|
891
913
|
];
|
|
892
914
|
}
|
|
893
|
-
const
|
|
894
|
-
function mr(t) {
|
|
895
|
-
t.registerModule(hr, pr);
|
|
896
|
-
}
|
|
915
|
+
const pr = "base", mr = async () => hr();
|
|
897
916
|
function gr(t) {
|
|
917
|
+
t.registerModule(pr, mr);
|
|
918
|
+
}
|
|
919
|
+
function yr(t) {
|
|
898
920
|
if (typeof t == "string") {
|
|
899
921
|
const e = t.trim();
|
|
900
922
|
return e.length > 0 ? e : void 0;
|
|
@@ -904,7 +926,7 @@ function gr(t) {
|
|
|
904
926
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
905
927
|
}
|
|
906
928
|
}
|
|
907
|
-
function
|
|
929
|
+
function br(...t) {
|
|
908
930
|
const e = [];
|
|
909
931
|
for (const n of t)
|
|
910
932
|
n && n.trim() && e.push(n.trim());
|
|
@@ -916,7 +938,7 @@ function wt(t) {
|
|
|
916
938
|
const e = t.trim();
|
|
917
939
|
return e.length > 0 ? e : void 0;
|
|
918
940
|
}
|
|
919
|
-
function
|
|
941
|
+
function _e(t) {
|
|
920
942
|
if (typeof t == "boolean")
|
|
921
943
|
return t;
|
|
922
944
|
if (typeof t == "string") {
|
|
@@ -925,20 +947,20 @@ function Ie(t) {
|
|
|
925
947
|
if (e === "false") return !1;
|
|
926
948
|
}
|
|
927
949
|
}
|
|
928
|
-
const
|
|
929
|
-
function
|
|
950
|
+
const Sr = "std.audio-url-player";
|
|
951
|
+
function wr() {
|
|
930
952
|
const t = G(function({
|
|
931
953
|
nodeId: n,
|
|
932
954
|
context: r,
|
|
933
955
|
className: o
|
|
934
956
|
}) {
|
|
935
|
-
const s = Z(r.store, n), i = E(null), a = s ?
|
|
957
|
+
const s = Z(r.store, n), i = E(null), a = s ? _e(s.props?.autoplay) : void 0, l = s ? wt(s.props?.src) : void 0;
|
|
936
958
|
if (C(() => {
|
|
937
959
|
a && i.current && i.current.play().catch(() => {
|
|
938
960
|
});
|
|
939
961
|
}, [a, l]), !s)
|
|
940
962
|
return null;
|
|
941
|
-
const h = yr(
|
|
963
|
+
const h = br(yr(s.props?.className), o), f = wt(s.props?.preload), y = _e(s.props?.controls), m = _e(s.props?.loop), c = _e(s.props?.muted);
|
|
942
964
|
return /* @__PURE__ */ w.jsx(
|
|
943
965
|
"audio",
|
|
944
966
|
{
|
|
@@ -956,7 +978,7 @@ function Sr() {
|
|
|
956
978
|
);
|
|
957
979
|
});
|
|
958
980
|
return ({ type: e }) => {
|
|
959
|
-
if (e ===
|
|
981
|
+
if (e === Sr)
|
|
960
982
|
return t;
|
|
961
983
|
};
|
|
962
984
|
}
|
|
@@ -991,8 +1013,8 @@ function tt(t) {
|
|
|
991
1013
|
const e = t.trim();
|
|
992
1014
|
return e.length > 0 ? e : void 0;
|
|
993
1015
|
}
|
|
994
|
-
const
|
|
995
|
-
function
|
|
1016
|
+
const vr = "std.video-canvas", Er = "std.video-url-player";
|
|
1017
|
+
function Rr() {
|
|
996
1018
|
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
997
1019
|
const s = Z(r.store, n), i = E(null), a = E(null), l = r.video, h = r.client, f = s ? tt(s.props?.streamId) : void 0, y = s ? Ne(s.props?.width) : void 0, m = s ? Ne(s.props?.height) : void 0, c = s ? Yt(Kt(s.props?.className), o) : o, [, u] = x(0);
|
|
998
1020
|
C(() => {
|
|
@@ -1047,12 +1069,12 @@ function Er() {
|
|
|
1047
1069
|
) : null;
|
|
1048
1070
|
});
|
|
1049
1071
|
return ({ type: e }) => {
|
|
1050
|
-
if (e ===
|
|
1072
|
+
if (e === vr)
|
|
1051
1073
|
return t;
|
|
1052
1074
|
};
|
|
1053
1075
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return [
|
|
1076
|
+
function Ar() {
|
|
1077
|
+
return [Rr(), Tr(), wr()];
|
|
1056
1078
|
}
|
|
1057
1079
|
function be(t) {
|
|
1058
1080
|
if (typeof t == "boolean")
|
|
@@ -1063,7 +1085,7 @@ function be(t) {
|
|
|
1063
1085
|
if (e === "false") return !1;
|
|
1064
1086
|
}
|
|
1065
1087
|
}
|
|
1066
|
-
function
|
|
1088
|
+
function Tr() {
|
|
1067
1089
|
const t = G(function({
|
|
1068
1090
|
nodeId: n,
|
|
1069
1091
|
context: r,
|
|
@@ -1097,13 +1119,13 @@ function Ar() {
|
|
|
1097
1119
|
);
|
|
1098
1120
|
});
|
|
1099
1121
|
return ({ type: e }) => {
|
|
1100
|
-
if (e ===
|
|
1122
|
+
if (e === Er)
|
|
1101
1123
|
return t;
|
|
1102
1124
|
};
|
|
1103
1125
|
}
|
|
1104
|
-
const
|
|
1105
|
-
function
|
|
1106
|
-
t.registerModule(
|
|
1126
|
+
const kr = "media", Cr = async () => Ar();
|
|
1127
|
+
function _r(t) {
|
|
1128
|
+
t.registerModule(kr, Cr);
|
|
1107
1129
|
}
|
|
1108
1130
|
const Ir = `#version 300 es
|
|
1109
1131
|
in vec4 a_position;
|
|
@@ -1111,13 +1133,13 @@ void main() {
|
|
|
1111
1133
|
gl_Position = a_position;
|
|
1112
1134
|
}
|
|
1113
1135
|
`, le = 4;
|
|
1114
|
-
function
|
|
1136
|
+
function Or(t, e) {
|
|
1115
1137
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1116
1138
|
}
|
|
1117
|
-
function
|
|
1139
|
+
function xr(t, e) {
|
|
1118
1140
|
const n = [];
|
|
1119
1141
|
for (const [r, o] of Object.entries(e)) {
|
|
1120
|
-
if (
|
|
1142
|
+
if (Or(t, r))
|
|
1121
1143
|
continue;
|
|
1122
1144
|
let s;
|
|
1123
1145
|
switch (o.type) {
|
|
@@ -1178,7 +1200,7 @@ void main() {
|
|
|
1178
1200
|
}
|
|
1179
1201
|
`;
|
|
1180
1202
|
}
|
|
1181
|
-
class
|
|
1203
|
+
class Nr {
|
|
1182
1204
|
gl;
|
|
1183
1205
|
program = null;
|
|
1184
1206
|
positionBuffer = null;
|
|
@@ -1256,7 +1278,7 @@ class xr {
|
|
|
1256
1278
|
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Ir);
|
|
1257
1279
|
if (!o)
|
|
1258
1280
|
return !1;
|
|
1259
|
-
const s =
|
|
1281
|
+
const s = xr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
|
|
1260
1282
|
if (!i)
|
|
1261
1283
|
return r.deleteShader(o), !1;
|
|
1262
1284
|
const a = r.createProgram();
|
|
@@ -1362,7 +1384,7 @@ class xr {
|
|
|
1362
1384
|
this.channels = [], this.uniformLocations.clear();
|
|
1363
1385
|
}
|
|
1364
1386
|
}
|
|
1365
|
-
function
|
|
1387
|
+
function Lr(t) {
|
|
1366
1388
|
if (typeof t == "string") {
|
|
1367
1389
|
const e = t.trim();
|
|
1368
1390
|
return e.length > 0 ? e : void 0;
|
|
@@ -1372,7 +1394,7 @@ function Nr(t) {
|
|
|
1372
1394
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1373
1395
|
}
|
|
1374
1396
|
}
|
|
1375
|
-
function
|
|
1397
|
+
function Pr(...t) {
|
|
1376
1398
|
const e = [];
|
|
1377
1399
|
for (const n of t)
|
|
1378
1400
|
n && n.trim() && e.push(n.trim());
|
|
@@ -1387,10 +1409,10 @@ function Ke(t) {
|
|
|
1387
1409
|
return Math.floor(e);
|
|
1388
1410
|
}
|
|
1389
1411
|
}
|
|
1390
|
-
function
|
|
1412
|
+
function Ur(t) {
|
|
1391
1413
|
return typeof t == "string" ? t : "";
|
|
1392
1414
|
}
|
|
1393
|
-
function
|
|
1415
|
+
function Mr(t) {
|
|
1394
1416
|
if (typeof t == "boolean")
|
|
1395
1417
|
return t;
|
|
1396
1418
|
if (typeof t == "string") {
|
|
@@ -1399,7 +1421,7 @@ function Ur(t) {
|
|
|
1399
1421
|
if (e === "false") return !1;
|
|
1400
1422
|
}
|
|
1401
1423
|
}
|
|
1402
|
-
function
|
|
1424
|
+
function Dr(t) {
|
|
1403
1425
|
if (!t || typeof t != "object")
|
|
1404
1426
|
return {};
|
|
1405
1427
|
const e = {}, n = t;
|
|
@@ -1414,10 +1436,10 @@ function Mr(t) {
|
|
|
1414
1436
|
}
|
|
1415
1437
|
return e;
|
|
1416
1438
|
}
|
|
1417
|
-
function
|
|
1439
|
+
function jr(t) {
|
|
1418
1440
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
|
|
1419
1441
|
}
|
|
1420
|
-
function
|
|
1442
|
+
function $r(t, e) {
|
|
1421
1443
|
const n = Object.keys(t), r = Object.keys(e);
|
|
1422
1444
|
if (n.length !== r.length)
|
|
1423
1445
|
return !1;
|
|
@@ -1438,8 +1460,8 @@ function jr(t, e) {
|
|
|
1438
1460
|
}
|
|
1439
1461
|
return !0;
|
|
1440
1462
|
}
|
|
1441
|
-
const
|
|
1442
|
-
function
|
|
1463
|
+
const Br = "std.shadertoy-canvas";
|
|
1464
|
+
function Fr() {
|
|
1443
1465
|
const t = G(function({ nodeId: n, context: r, className: o }) {
|
|
1444
1466
|
const s = Z(r.store, n), i = E(null), a = E(null), l = E(null), h = E(0), f = E(""), y = E({}), m = E({
|
|
1445
1467
|
x: 0,
|
|
@@ -1447,12 +1469,12 @@ function Br() {
|
|
|
1447
1469
|
clickX: 0,
|
|
1448
1470
|
clickY: 0,
|
|
1449
1471
|
isDown: !1
|
|
1450
|
-
}), c = s ?
|
|
1472
|
+
}), c = s ? Ur(s.props?.shaderSource) : "", u = s ? Ke(s.props?.fps) ?? 60 : 60, g = s?.props?.uniforms, p = W(() => Dr(g), [g]), b = s?.props?.channels, S = W(() => jr(b), [b]), R = s ? Mr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ke(s.props?.width) : void 0, T = s ? Ke(s.props?.height) : void 0, U = s ? Pr(Lr(s.props?.className), o) : o;
|
|
1451
1473
|
C(() => {
|
|
1452
|
-
const
|
|
1453
|
-
if (
|
|
1474
|
+
const I = i.current;
|
|
1475
|
+
if (I) {
|
|
1454
1476
|
try {
|
|
1455
|
-
const P = new
|
|
1477
|
+
const P = new Nr(I);
|
|
1456
1478
|
a.current = P;
|
|
1457
1479
|
} catch (P) {
|
|
1458
1480
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
@@ -1462,46 +1484,46 @@ function Br() {
|
|
|
1462
1484
|
};
|
|
1463
1485
|
}
|
|
1464
1486
|
}, []), C(() => {
|
|
1465
|
-
const
|
|
1466
|
-
if (!(!
|
|
1467
|
-
if (
|
|
1487
|
+
const I = a.current;
|
|
1488
|
+
if (!(!I || !c) && f.current !== c)
|
|
1489
|
+
if (I.compile(c, p))
|
|
1468
1490
|
f.current = c, y.current = p;
|
|
1469
1491
|
else {
|
|
1470
|
-
const M =
|
|
1492
|
+
const M = I.getError();
|
|
1471
1493
|
console.error("[ShadertoyRenderer] Shader compilation failed:", M);
|
|
1472
1494
|
}
|
|
1473
1495
|
}, [c, p]), C(() => {
|
|
1474
|
-
const
|
|
1475
|
-
!
|
|
1496
|
+
const I = a.current;
|
|
1497
|
+
!I || !f.current || $r(y.current, p) || (I.setCustomUniforms(p), y.current = p);
|
|
1476
1498
|
}, [p]), C(() => {
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1499
|
+
const I = a.current;
|
|
1500
|
+
I && I.setChannels(S);
|
|
1479
1501
|
}, [S]), C(() => {
|
|
1480
|
-
const
|
|
1481
|
-
if (!
|
|
1502
|
+
const I = a.current;
|
|
1503
|
+
if (!I || !f.current) return;
|
|
1482
1504
|
const P = 1e3 / u, M = (B) => {
|
|
1483
1505
|
const $ = B - h.current;
|
|
1484
|
-
$ >= P && (h.current = B - $ % P,
|
|
1506
|
+
$ >= P && (h.current = B - $ % P, I.draw()), l.current = requestAnimationFrame(M);
|
|
1485
1507
|
};
|
|
1486
1508
|
return l.current = requestAnimationFrame(M), () => {
|
|
1487
1509
|
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
1488
1510
|
};
|
|
1489
1511
|
}, [u]);
|
|
1490
1512
|
const ee = j(
|
|
1491
|
-
(
|
|
1513
|
+
(I) => {
|
|
1492
1514
|
if (!R) return;
|
|
1493
1515
|
const P = i.current, M = a.current;
|
|
1494
1516
|
if (!P || !M) return;
|
|
1495
|
-
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (
|
|
1517
|
+
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
|
|
1496
1518
|
m.current.x = V, m.current.y = K, M.setMouse(V, K, m.current.clickX, m.current.clickY);
|
|
1497
1519
|
},
|
|
1498
1520
|
[R]
|
|
1499
1521
|
), te = j(
|
|
1500
|
-
(
|
|
1522
|
+
(I) => {
|
|
1501
1523
|
if (!R) return;
|
|
1502
1524
|
const P = i.current, M = a.current;
|
|
1503
1525
|
if (!P || !M) return;
|
|
1504
|
-
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (
|
|
1526
|
+
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
|
|
1505
1527
|
m.current.isDown = !0, m.current.clickX = V, m.current.clickY = K, M.setMouse(V, K, V, K);
|
|
1506
1528
|
},
|
|
1507
1529
|
[R]
|
|
@@ -1525,16 +1547,16 @@ function Br() {
|
|
|
1525
1547
|
) : null;
|
|
1526
1548
|
});
|
|
1527
1549
|
return ({ type: e }) => {
|
|
1528
|
-
if (e ===
|
|
1550
|
+
if (e === Br)
|
|
1529
1551
|
return t;
|
|
1530
1552
|
};
|
|
1531
1553
|
}
|
|
1532
|
-
const
|
|
1533
|
-
function
|
|
1534
|
-
t.registerModule(
|
|
1554
|
+
const Vr = "shadertoy", Wr = async () => Fr();
|
|
1555
|
+
function Kr(t) {
|
|
1556
|
+
t.registerModule(Vr, Wr);
|
|
1535
1557
|
}
|
|
1536
1558
|
const vt = oe("UIRegistry");
|
|
1537
|
-
class
|
|
1559
|
+
class Yr {
|
|
1538
1560
|
baseResolvers = [];
|
|
1539
1561
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1540
1562
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1556,7 +1578,7 @@ class Kr {
|
|
|
1556
1578
|
for (const [r, o] of this.moduleLoaders.entries())
|
|
1557
1579
|
if (!this.moduleResolvers.has(r))
|
|
1558
1580
|
try {
|
|
1559
|
-
const s = await o(), i =
|
|
1581
|
+
const s = await o(), i = Xr(s);
|
|
1560
1582
|
this.moduleResolvers.set(r, i), e = !0;
|
|
1561
1583
|
} catch (s) {
|
|
1562
1584
|
vt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
@@ -1564,7 +1586,7 @@ class Kr {
|
|
|
1564
1586
|
const n = [];
|
|
1565
1587
|
for (const r of this.moduleLoaders.keys())
|
|
1566
1588
|
this.moduleResolvers.has(r) && n.push(r);
|
|
1567
|
-
return
|
|
1589
|
+
return Hr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
|
|
1568
1590
|
}
|
|
1569
1591
|
resolve(e) {
|
|
1570
1592
|
for (const n of this.baseResolvers) {
|
|
@@ -1584,17 +1606,17 @@ class Kr {
|
|
|
1584
1606
|
}
|
|
1585
1607
|
}
|
|
1586
1608
|
}
|
|
1587
|
-
function
|
|
1588
|
-
const t = new
|
|
1589
|
-
return
|
|
1609
|
+
function Gr() {
|
|
1610
|
+
const t = new Yr();
|
|
1611
|
+
return gr(t), _r(t), Kr(t), t.loadRegisteredModules(), t;
|
|
1590
1612
|
}
|
|
1591
|
-
function
|
|
1613
|
+
function zr(t) {
|
|
1592
1614
|
return Array.isArray(t) ? t : [t];
|
|
1593
1615
|
}
|
|
1594
|
-
function
|
|
1595
|
-
return t ?
|
|
1616
|
+
function Xr(t) {
|
|
1617
|
+
return t ? zr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1596
1618
|
}
|
|
1597
|
-
function
|
|
1619
|
+
function Hr(t, e) {
|
|
1598
1620
|
if (t.length !== e.length)
|
|
1599
1621
|
return !1;
|
|
1600
1622
|
for (let n = 0; n < t.length; n += 1)
|
|
@@ -1602,7 +1624,7 @@ function Xr(t, e) {
|
|
|
1602
1624
|
return !1;
|
|
1603
1625
|
return !0;
|
|
1604
1626
|
}
|
|
1605
|
-
function
|
|
1627
|
+
function _s({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
1606
1628
|
return /* @__PURE__ */ w.jsx(
|
|
1607
1629
|
Bt,
|
|
1608
1630
|
{
|
|
@@ -1695,14 +1717,14 @@ function Tt(t, e, n, r) {
|
|
|
1695
1717
|
f[p] = y(p * 0.1, t, n);
|
|
1696
1718
|
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : y(g(p), e, r);
|
|
1697
1719
|
}
|
|
1698
|
-
function
|
|
1720
|
+
function qr(t) {
|
|
1699
1721
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1700
1722
|
if (!e)
|
|
1701
1723
|
return (o) => F(o);
|
|
1702
1724
|
const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
|
|
1703
1725
|
return r === "start" || r === "jump-start" ? (o) => F(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => F(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => F((Math.floor(o * n) + 0.5) / n) : (o) => F(Math.floor(o * n) / n);
|
|
1704
1726
|
}
|
|
1705
|
-
function
|
|
1727
|
+
function Jr(t) {
|
|
1706
1728
|
if (!t)
|
|
1707
1729
|
return (n) => F(n);
|
|
1708
1730
|
const e = t.trim().toLowerCase();
|
|
@@ -1720,12 +1742,12 @@ function qr(t) {
|
|
|
1720
1742
|
}
|
|
1721
1743
|
}
|
|
1722
1744
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1723
|
-
const n =
|
|
1745
|
+
const n = qr(e);
|
|
1724
1746
|
return (r) => n(F(r));
|
|
1725
1747
|
}
|
|
1726
1748
|
return (n) => F(n);
|
|
1727
1749
|
}
|
|
1728
|
-
function
|
|
1750
|
+
function Zr(t) {
|
|
1729
1751
|
if (!t)
|
|
1730
1752
|
return;
|
|
1731
1753
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1735,7 +1757,7 @@ function Jr(t) {
|
|
|
1735
1757
|
if (![n, r, o, s].some((i) => !Number.isFinite(i)))
|
|
1736
1758
|
return { inStart: n, inEnd: r, outStart: o, outEnd: s };
|
|
1737
1759
|
}
|
|
1738
|
-
class
|
|
1760
|
+
class Qr {
|
|
1739
1761
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1740
1762
|
observer;
|
|
1741
1763
|
observeScheduled = !1;
|
|
@@ -1780,7 +1802,7 @@ class Zr {
|
|
|
1780
1802
|
const n = e.source?.trim();
|
|
1781
1803
|
if (!n)
|
|
1782
1804
|
return;
|
|
1783
|
-
const r = Rt(e.min) ?? 0, o = Rt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l =
|
|
1805
|
+
const r = Rt(e.min) ?? 0, o = Rt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = Jr(e.ease), h = Zr(e.map), f = e.targetId?.trim() || void 0;
|
|
1784
1806
|
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1785
1807
|
source: n.toLowerCase(),
|
|
1786
1808
|
min: r,
|
|
@@ -1993,8 +2015,8 @@ class Zr {
|
|
|
1993
2015
|
}
|
|
1994
2016
|
}
|
|
1995
2017
|
}
|
|
1996
|
-
const Ge = new
|
|
1997
|
-
function
|
|
2018
|
+
const Ge = new Qr();
|
|
2019
|
+
function eo(t) {
|
|
1998
2020
|
const e = E(/* @__PURE__ */ new Map()), n = j(({ styleId: s, css: i, common: a }) => {
|
|
1999
2021
|
if (!(!s || typeof document > "u")) {
|
|
2000
2022
|
if (i) {
|
|
@@ -2027,7 +2049,7 @@ function Qr(t) {
|
|
|
2027
2049
|
};
|
|
2028
2050
|
}, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
2029
2051
|
}
|
|
2030
|
-
function
|
|
2052
|
+
function to(t) {
|
|
2031
2053
|
const e = [];
|
|
2032
2054
|
for (const [n, r] of t) {
|
|
2033
2055
|
const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -2035,7 +2057,7 @@ function eo(t) {
|
|
|
2035
2057
|
}
|
|
2036
2058
|
return e.sort(), e.join(",");
|
|
2037
2059
|
}
|
|
2038
|
-
function
|
|
2060
|
+
function no(t) {
|
|
2039
2061
|
const [e, n] = x(), r = E("");
|
|
2040
2062
|
return C(() => {
|
|
2041
2063
|
if (!t) {
|
|
@@ -2043,7 +2065,7 @@ function to(t) {
|
|
|
2043
2065
|
return;
|
|
2044
2066
|
}
|
|
2045
2067
|
const o = () => {
|
|
2046
|
-
const s = t.getStores(), i =
|
|
2068
|
+
const s = t.getStores(), i = to(s);
|
|
2047
2069
|
i !== r.current && (r.current = i, n(s));
|
|
2048
2070
|
};
|
|
2049
2071
|
return o(), t.subscribe(o);
|
|
@@ -2056,7 +2078,7 @@ const k = {
|
|
|
2056
2078
|
Line: 4,
|
|
2057
2079
|
Paragraph: 8,
|
|
2058
2080
|
Emoji: 16
|
|
2059
|
-
},
|
|
2081
|
+
}, ro = [
|
|
2060
2082
|
{
|
|
2061
2083
|
flag: k.Letter,
|
|
2062
2084
|
hints: [
|
|
@@ -2105,11 +2127,11 @@ const k = {
|
|
|
2105
2127
|
"[data-emoji]"
|
|
2106
2128
|
]
|
|
2107
2129
|
}
|
|
2108
|
-
], nt = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji,
|
|
2130
|
+
], nt = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, oo = k.Letter | k.Word | k.Line | k.Paragraph, kt = /* @__PURE__ */ new Map(), so = 16384;
|
|
2109
2131
|
function Is(t, e) {
|
|
2110
|
-
if (!t || t.length >
|
|
2132
|
+
if (!t || t.length > so)
|
|
2111
2133
|
return t;
|
|
2112
|
-
const n =
|
|
2134
|
+
const n = Ro(e), r = fe(n, k.Emoji), o = n & oo;
|
|
2113
2135
|
if (o === k.None && !r)
|
|
2114
2136
|
return t;
|
|
2115
2137
|
const s = t.replace(/\r\n/g, `
|
|
@@ -2117,20 +2139,20 @@ function Is(t, e) {
|
|
|
2117
2139
|
`);
|
|
2118
2140
|
if (o === k.None)
|
|
2119
2141
|
return Ot(s);
|
|
2120
|
-
const i =
|
|
2142
|
+
const i = vo(s);
|
|
2121
2143
|
if (i.length === 0)
|
|
2122
2144
|
return r ? Ot(s) : t;
|
|
2123
|
-
const a =
|
|
2145
|
+
const a = Eo(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, h = [];
|
|
2124
2146
|
for (const f of a) {
|
|
2125
|
-
const y =
|
|
2147
|
+
const y = io(f, n, l);
|
|
2126
2148
|
h.push(...y);
|
|
2127
2149
|
}
|
|
2128
2150
|
return h;
|
|
2129
2151
|
}
|
|
2130
|
-
function
|
|
2152
|
+
function io(t, e, n) {
|
|
2131
2153
|
const r = [];
|
|
2132
2154
|
for (const o of t) {
|
|
2133
|
-
const s =
|
|
2155
|
+
const s = ao(o, e, n);
|
|
2134
2156
|
r.push(...s);
|
|
2135
2157
|
}
|
|
2136
2158
|
if (fe(e, k.Paragraph)) {
|
|
@@ -2149,8 +2171,8 @@ function so(t, e, n) {
|
|
|
2149
2171
|
}
|
|
2150
2172
|
return r;
|
|
2151
2173
|
}
|
|
2152
|
-
function
|
|
2153
|
-
const r =
|
|
2174
|
+
function ao(t, e, n) {
|
|
2175
|
+
const r = co(t.text, e, n), o = [];
|
|
2154
2176
|
if (fe(e, k.Line)) {
|
|
2155
2177
|
const s = n.line++;
|
|
2156
2178
|
o.push(
|
|
@@ -2162,7 +2184,7 @@ function io(t, e, n) {
|
|
|
2162
2184
|
o.push(/* @__PURE__ */ w.jsx("br", {}, `motion-break-${n.br++}`));
|
|
2163
2185
|
return o;
|
|
2164
2186
|
}
|
|
2165
|
-
function
|
|
2187
|
+
function co(t, e, n) {
|
|
2166
2188
|
if (!t)
|
|
2167
2189
|
return [];
|
|
2168
2190
|
const r = fe(e, k.Word), o = [], s = /(\s+)/g;
|
|
@@ -2181,13 +2203,13 @@ function ao(t, e, n) {
|
|
|
2181
2203
|
return o;
|
|
2182
2204
|
}
|
|
2183
2205
|
function Ct(t, e, n, r) {
|
|
2184
|
-
const o = e.word++, s =
|
|
2206
|
+
const o = e.word++, s = uo(t, n, e), i = `motion-word-${o}`, a = lo(o, r);
|
|
2185
2207
|
return r ? /* @__PURE__ */ w.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ w.jsx("span", { style: a, children: s }, i);
|
|
2186
2208
|
}
|
|
2187
|
-
function
|
|
2209
|
+
function lo(t, e) {
|
|
2188
2210
|
return e ? { ...Ue(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2189
2211
|
}
|
|
2190
|
-
function
|
|
2212
|
+
function uo(t, e, n) {
|
|
2191
2213
|
if (!t)
|
|
2192
2214
|
return [];
|
|
2193
2215
|
const r = fe(e, k.Letter), o = fe(e, k.Emoji);
|
|
@@ -2220,45 +2242,45 @@ function lo(t, e, n) {
|
|
|
2220
2242
|
function rt(t) {
|
|
2221
2243
|
if (!t)
|
|
2222
2244
|
return [];
|
|
2223
|
-
const e =
|
|
2224
|
-
return e ? Array.from(e.segment(t), (n) => n.segment) :
|
|
2245
|
+
const e = fo();
|
|
2246
|
+
return e ? Array.from(e.segment(t), (n) => n.segment) : ho(t);
|
|
2225
2247
|
}
|
|
2226
2248
|
let Se;
|
|
2227
|
-
function
|
|
2249
|
+
function fo() {
|
|
2228
2250
|
return Se !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? Se = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : Se = null), Se;
|
|
2229
2251
|
}
|
|
2230
|
-
function
|
|
2252
|
+
function ho(t) {
|
|
2231
2253
|
const e = [], n = Array.from(t);
|
|
2232
2254
|
let r = "";
|
|
2233
2255
|
for (let o = 0; o < n.length; o++) {
|
|
2234
2256
|
const s = n[o], i = n[o + 1];
|
|
2235
|
-
r += s, !(i &&
|
|
2257
|
+
r += s, !(i && po(s, i)) && (e.push(r), r = "");
|
|
2236
2258
|
}
|
|
2237
2259
|
return r && e.push(r), e;
|
|
2238
2260
|
}
|
|
2239
|
-
function
|
|
2240
|
-
return e ? !!(
|
|
2261
|
+
function po(t, e) {
|
|
2262
|
+
return e ? !!(_t(t) || _t(e) || yo(e) || mo(e) || go(e) || It(t) && It(e)) : !1;
|
|
2241
2263
|
}
|
|
2242
|
-
function
|
|
2264
|
+
function _t(t) {
|
|
2243
2265
|
return t.codePointAt(0) === 8205;
|
|
2244
2266
|
}
|
|
2245
|
-
function
|
|
2267
|
+
function mo(t) {
|
|
2246
2268
|
const e = t.codePointAt(0);
|
|
2247
2269
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2248
2270
|
}
|
|
2249
|
-
function
|
|
2271
|
+
function go(t) {
|
|
2250
2272
|
const e = t.codePointAt(0);
|
|
2251
2273
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2252
2274
|
}
|
|
2253
|
-
function
|
|
2275
|
+
function It(t) {
|
|
2254
2276
|
const e = t.codePointAt(0);
|
|
2255
2277
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2256
2278
|
}
|
|
2257
2279
|
let ze;
|
|
2258
|
-
function
|
|
2259
|
-
return t ? (ze || (ze =
|
|
2280
|
+
function yo(t) {
|
|
2281
|
+
return t ? (ze || (ze = bo()), ze(t)) : !1;
|
|
2260
2282
|
}
|
|
2261
|
-
function
|
|
2283
|
+
function bo() {
|
|
2262
2284
|
try {
|
|
2263
2285
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2264
2286
|
return (e) => t.test(e);
|
|
@@ -2271,17 +2293,17 @@ function yo() {
|
|
|
2271
2293
|
}
|
|
2272
2294
|
let Xe;
|
|
2273
2295
|
function Gt(t) {
|
|
2274
|
-
return t ? (Xe || (Xe =
|
|
2296
|
+
return t ? (Xe || (Xe = So()), Xe(t)) : !1;
|
|
2275
2297
|
}
|
|
2276
|
-
function
|
|
2298
|
+
function So() {
|
|
2277
2299
|
try {
|
|
2278
2300
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2279
2301
|
return (e) => t.test(e);
|
|
2280
2302
|
} catch {
|
|
2281
|
-
return
|
|
2303
|
+
return wo;
|
|
2282
2304
|
}
|
|
2283
2305
|
}
|
|
2284
|
-
function
|
|
2306
|
+
function wo(t) {
|
|
2285
2307
|
if (!t)
|
|
2286
2308
|
return !1;
|
|
2287
2309
|
for (const e of Array.from(t)) {
|
|
@@ -2291,7 +2313,7 @@ function So(t) {
|
|
|
2291
2313
|
}
|
|
2292
2314
|
return !1;
|
|
2293
2315
|
}
|
|
2294
|
-
function
|
|
2316
|
+
function vo(t) {
|
|
2295
2317
|
const e = [];
|
|
2296
2318
|
let n = "", r = 0;
|
|
2297
2319
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2305,7 +2327,7 @@ function wo(t) {
|
|
|
2305
2327
|
}
|
|
2306
2328
|
return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
|
|
2307
2329
|
}
|
|
2308
|
-
function
|
|
2330
|
+
function Eo(t) {
|
|
2309
2331
|
if (t.length === 0)
|
|
2310
2332
|
return [];
|
|
2311
2333
|
const e = [];
|
|
@@ -2362,7 +2384,7 @@ function zt(t, e) {
|
|
|
2362
2384
|
}
|
|
2363
2385
|
return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2364
2386
|
}
|
|
2365
|
-
function
|
|
2387
|
+
function Ro(t) {
|
|
2366
2388
|
if (!t)
|
|
2367
2389
|
return k.None;
|
|
2368
2390
|
const e = t.trim();
|
|
@@ -2376,8 +2398,8 @@ function Eo(t) {
|
|
|
2376
2398
|
const r = e.split(/\s+/).filter(Boolean);
|
|
2377
2399
|
if (r.length === 0)
|
|
2378
2400
|
return k.None;
|
|
2379
|
-
const s = r.map((l) => `.${
|
|
2380
|
-
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2401
|
+
const s = r.map((l) => `.${Ao(l)}`).map(
|
|
2402
|
+
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${To(l)}(?![a-zA-Z0-9_-])`)
|
|
2381
2403
|
);
|
|
2382
2404
|
let i = k.None, a = !1;
|
|
2383
2405
|
for (const l of Array.from(document.styleSheets)) {
|
|
@@ -2405,7 +2427,7 @@ function Xt(t, e) {
|
|
|
2405
2427
|
const a = s.selectorText ?? "";
|
|
2406
2428
|
if (!a || !e.some((h) => h.test(a))) continue;
|
|
2407
2429
|
r = !0;
|
|
2408
|
-
for (const h of
|
|
2430
|
+
for (const h of ro)
|
|
2409
2431
|
h.hints.some((f) => a.includes(f)) && (n |= h.flag);
|
|
2410
2432
|
if (n === nt)
|
|
2411
2433
|
return { mask: n, sawStyleRule: !0 };
|
|
@@ -2419,19 +2441,19 @@ function Xt(t, e) {
|
|
|
2419
2441
|
}
|
|
2420
2442
|
return { mask: n, sawStyleRule: r };
|
|
2421
2443
|
}
|
|
2422
|
-
function
|
|
2444
|
+
function Ao(t) {
|
|
2423
2445
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2424
2446
|
}
|
|
2425
|
-
function
|
|
2447
|
+
function To(t) {
|
|
2426
2448
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2427
2449
|
}
|
|
2428
|
-
const ct = "ikon-auth-session", Ht = "ikon-auth-auto-login-attempted-run",
|
|
2450
|
+
const ct = "ikon-auth-session", Ht = "ikon-auth-auto-login-attempted-run", ko = 10080 * 60 * 1e3, Co = 60 * 1e3;
|
|
2429
2451
|
function qt(t) {
|
|
2430
2452
|
try {
|
|
2431
2453
|
const e = t.split(".");
|
|
2432
2454
|
if (e.length !== 3) return !0;
|
|
2433
2455
|
const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
|
|
2434
|
-
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 -
|
|
2456
|
+
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - Co;
|
|
2435
2457
|
} catch {
|
|
2436
2458
|
return !0;
|
|
2437
2459
|
}
|
|
@@ -2448,7 +2470,7 @@ function Jt() {
|
|
|
2448
2470
|
const t = localStorage.getItem(ct);
|
|
2449
2471
|
if (!t) return null;
|
|
2450
2472
|
const e = JSON.parse(t);
|
|
2451
|
-
return Date.now() - e.authenticatedAt >
|
|
2473
|
+
return Date.now() - e.authenticatedAt > ko || qt(e.token) ? (Le(), null) : e;
|
|
2452
2474
|
} catch {
|
|
2453
2475
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2454
2476
|
}
|
|
@@ -2460,7 +2482,7 @@ function Le() {
|
|
|
2460
2482
|
console.warn("Failed to clear auth session from localStorage");
|
|
2461
2483
|
}
|
|
2462
2484
|
}
|
|
2463
|
-
function
|
|
2485
|
+
function _o(t) {
|
|
2464
2486
|
if (t)
|
|
2465
2487
|
try {
|
|
2466
2488
|
sessionStorage.setItem(Ht, t);
|
|
@@ -2527,7 +2549,7 @@ async function Qt(t, e) {
|
|
|
2527
2549
|
};
|
|
2528
2550
|
return he(l), l;
|
|
2529
2551
|
}
|
|
2530
|
-
async function
|
|
2552
|
+
async function Oo({ email: t, spaceId: e, authUrl: n }) {
|
|
2531
2553
|
const r = await fetch(`${n}/email/send`, {
|
|
2532
2554
|
method: "POST",
|
|
2533
2555
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2542,7 +2564,7 @@ async function _o({ email: t, spaceId: e, authUrl: n }) {
|
|
|
2542
2564
|
throw new Error(o);
|
|
2543
2565
|
}
|
|
2544
2566
|
}
|
|
2545
|
-
async function
|
|
2567
|
+
async function xo({ email: t, code: e, authUrl: n }) {
|
|
2546
2568
|
const r = await fetch(`${n}/email/code`, {
|
|
2547
2569
|
method: "POST",
|
|
2548
2570
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2563,21 +2585,21 @@ async function Oo({ email: t, code: e, authUrl: n }) {
|
|
|
2563
2585
|
};
|
|
2564
2586
|
return he(s), s;
|
|
2565
2587
|
}
|
|
2566
|
-
function
|
|
2588
|
+
function No() {
|
|
2567
2589
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
2568
2590
|
return e && n ? { token: e, provider: n } : null;
|
|
2569
2591
|
}
|
|
2570
|
-
function
|
|
2592
|
+
function Lo() {
|
|
2571
2593
|
return new URLSearchParams(window.location.search).get("error");
|
|
2572
2594
|
}
|
|
2573
2595
|
function Nt() {
|
|
2574
2596
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2575
2597
|
}
|
|
2576
|
-
function
|
|
2598
|
+
function Po(t, e, n, r) {
|
|
2577
2599
|
const o = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2578
2600
|
return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2579
2601
|
}
|
|
2580
|
-
async function
|
|
2602
|
+
async function Uo(t) {
|
|
2581
2603
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2582
2604
|
method: "POST",
|
|
2583
2605
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2588,7 +2610,7 @@ async function Po(t) {
|
|
|
2588
2610
|
}
|
|
2589
2611
|
return e.json();
|
|
2590
2612
|
}
|
|
2591
|
-
async function
|
|
2613
|
+
async function Mo(t, e, n) {
|
|
2592
2614
|
const r = await fetch(`${t}/passkey/registration/verify`, {
|
|
2593
2615
|
method: "POST",
|
|
2594
2616
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2605,7 +2627,7 @@ async function Uo(t, e, n) {
|
|
|
2605
2627
|
};
|
|
2606
2628
|
return he(s), s;
|
|
2607
2629
|
}
|
|
2608
|
-
async function
|
|
2630
|
+
async function Do(t, e) {
|
|
2609
2631
|
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
2610
2632
|
method: "POST",
|
|
2611
2633
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2617,7 +2639,7 @@ async function Mo(t, e) {
|
|
|
2617
2639
|
}
|
|
2618
2640
|
return n.json();
|
|
2619
2641
|
}
|
|
2620
|
-
async function
|
|
2642
|
+
async function jo(t, e) {
|
|
2621
2643
|
const n = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2622
2644
|
method: "POST",
|
|
2623
2645
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2648,9 +2670,9 @@ function Pe(t) {
|
|
|
2648
2670
|
return s;
|
|
2649
2671
|
}
|
|
2650
2672
|
function lt() {
|
|
2651
|
-
return
|
|
2673
|
+
return $o.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2652
2674
|
}
|
|
2653
|
-
const
|
|
2675
|
+
const $o = {
|
|
2654
2676
|
stubThis: (t) => t
|
|
2655
2677
|
};
|
|
2656
2678
|
function en(t) {
|
|
@@ -2683,7 +2705,7 @@ class D extends Error {
|
|
|
2683
2705
|
}), this.name = o ?? r.name, this.code = n;
|
|
2684
2706
|
}
|
|
2685
2707
|
}
|
|
2686
|
-
function
|
|
2708
|
+
function Bo({ error: t, options: e }) {
|
|
2687
2709
|
const { publicKey: n } = e;
|
|
2688
2710
|
if (!n)
|
|
2689
2711
|
throw Error("options was missing required publicKey property");
|
|
@@ -2769,7 +2791,7 @@ function $o({ error: t, options: e }) {
|
|
|
2769
2791
|
}
|
|
2770
2792
|
return t;
|
|
2771
2793
|
}
|
|
2772
|
-
class
|
|
2794
|
+
class Fo {
|
|
2773
2795
|
constructor() {
|
|
2774
2796
|
Object.defineProperty(this, "controller", {
|
|
2775
2797
|
enumerable: !0,
|
|
@@ -2793,12 +2815,12 @@ class Bo {
|
|
|
2793
2815
|
}
|
|
2794
2816
|
}
|
|
2795
2817
|
}
|
|
2796
|
-
const nn = new
|
|
2818
|
+
const nn = new Fo(), Vo = ["cross-platform", "platform"];
|
|
2797
2819
|
function rn(t) {
|
|
2798
|
-
if (t && !(
|
|
2820
|
+
if (t && !(Vo.indexOf(t) < 0))
|
|
2799
2821
|
return t;
|
|
2800
2822
|
}
|
|
2801
|
-
async function
|
|
2823
|
+
async function Wo(t) {
|
|
2802
2824
|
!t.optionsJSON && t.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."), t = { optionsJSON: t });
|
|
2803
2825
|
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2804
2826
|
if (!lt())
|
|
@@ -2817,7 +2839,7 @@ async function Vo(t) {
|
|
|
2817
2839
|
try {
|
|
2818
2840
|
s = await navigator.credentials.create(o);
|
|
2819
2841
|
} catch (u) {
|
|
2820
|
-
throw
|
|
2842
|
+
throw Bo({ error: u, options: o });
|
|
2821
2843
|
}
|
|
2822
2844
|
if (!s)
|
|
2823
2845
|
throw new Error("Registration was not completed");
|
|
@@ -2866,7 +2888,7 @@ function He(t, e) {
|
|
|
2866
2888
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2867
2889
|
`, e);
|
|
2868
2890
|
}
|
|
2869
|
-
function
|
|
2891
|
+
function Ko() {
|
|
2870
2892
|
if (!lt())
|
|
2871
2893
|
return qe.stubThis(new Promise((e) => e(!1)));
|
|
2872
2894
|
const t = globalThis.PublicKeyCredential;
|
|
@@ -2875,7 +2897,7 @@ function Wo() {
|
|
|
2875
2897
|
const qe = {
|
|
2876
2898
|
stubThis: (t) => t
|
|
2877
2899
|
};
|
|
2878
|
-
function
|
|
2900
|
+
function Yo({ error: t, options: e }) {
|
|
2879
2901
|
const { publicKey: n } = e;
|
|
2880
2902
|
if (!n)
|
|
2881
2903
|
throw Error("options was missing required publicKey property");
|
|
@@ -2916,7 +2938,7 @@ function Ko({ error: t, options: e }) {
|
|
|
2916
2938
|
}
|
|
2917
2939
|
return t;
|
|
2918
2940
|
}
|
|
2919
|
-
async function
|
|
2941
|
+
async function Go(t) {
|
|
2920
2942
|
!t.optionsJSON && t.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."), t = { optionsJSON: t });
|
|
2921
2943
|
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
2922
2944
|
if (!lt())
|
|
@@ -2929,7 +2951,7 @@ async function Yo(t) {
|
|
|
2929
2951
|
allowCredentials: o
|
|
2930
2952
|
}, i = {};
|
|
2931
2953
|
if (n) {
|
|
2932
|
-
if (!await
|
|
2954
|
+
if (!await Ko())
|
|
2933
2955
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2934
2956
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
2935
2957
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -2940,7 +2962,7 @@ async function Yo(t) {
|
|
|
2940
2962
|
try {
|
|
2941
2963
|
a = await navigator.credentials.get(i);
|
|
2942
2964
|
} catch (c) {
|
|
2943
|
-
throw
|
|
2965
|
+
throw Yo({ error: c, options: i });
|
|
2944
2966
|
}
|
|
2945
2967
|
if (!a)
|
|
2946
2968
|
throw new Error("Authentication was not completed");
|
|
@@ -2961,7 +2983,7 @@ async function Yo(t) {
|
|
|
2961
2983
|
};
|
|
2962
2984
|
}
|
|
2963
2985
|
const ut = Mt(null);
|
|
2964
|
-
function
|
|
2986
|
+
function Os({ children: t, config: e }) {
|
|
2965
2987
|
const [n, r] = x({
|
|
2966
2988
|
isAuthenticated: !1,
|
|
2967
2989
|
isLoading: !0,
|
|
@@ -2971,8 +2993,8 @@ function _s({ children: t, config: e }) {
|
|
|
2971
2993
|
C(() => {
|
|
2972
2994
|
(() => {
|
|
2973
2995
|
const m = e.devLoginRunId, c = !!m && Io() === m;
|
|
2974
|
-
m &&
|
|
2975
|
-
const u =
|
|
2996
|
+
m && _o(m);
|
|
2997
|
+
const u = Lo();
|
|
2976
2998
|
if (u) {
|
|
2977
2999
|
Nt(), r({
|
|
2978
3000
|
isAuthenticated: !1,
|
|
@@ -2982,7 +3004,7 @@ function _s({ children: t, config: e }) {
|
|
|
2982
3004
|
});
|
|
2983
3005
|
return;
|
|
2984
3006
|
}
|
|
2985
|
-
const g =
|
|
3007
|
+
const g = No();
|
|
2986
3008
|
if (g) {
|
|
2987
3009
|
const b = {
|
|
2988
3010
|
token: g.token,
|
|
@@ -3061,7 +3083,7 @@ function _s({ children: t, config: e }) {
|
|
|
3061
3083
|
if (y === "passkey") {
|
|
3062
3084
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3063
3085
|
try {
|
|
3064
|
-
const c = await
|
|
3086
|
+
const c = await Do(m), u = await Go({ optionsJSON: c }), g = await jo(m, u);
|
|
3065
3087
|
r({
|
|
3066
3088
|
isAuthenticated: !0,
|
|
3067
3089
|
isLoading: !1,
|
|
@@ -3079,7 +3101,7 @@ function _s({ children: t, config: e }) {
|
|
|
3079
3101
|
}
|
|
3080
3102
|
if (y === "email")
|
|
3081
3103
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3082
|
-
window.location.href =
|
|
3104
|
+
window.location.href = Po(y, e.spaceId, m);
|
|
3083
3105
|
},
|
|
3084
3106
|
[e.authUrl, e.spaceId]
|
|
3085
3107
|
), s = j(
|
|
@@ -3087,14 +3109,14 @@ function _s({ children: t, config: e }) {
|
|
|
3087
3109
|
if (!e.spaceId)
|
|
3088
3110
|
throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3089
3111
|
const m = await ve(e.authUrl);
|
|
3090
|
-
await
|
|
3112
|
+
await Oo({ email: y, spaceId: e.spaceId, authUrl: m });
|
|
3091
3113
|
},
|
|
3092
3114
|
[e.authUrl, e.spaceId]
|
|
3093
3115
|
), i = j(
|
|
3094
3116
|
async (y, m) => {
|
|
3095
3117
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3096
3118
|
try {
|
|
3097
|
-
const c = await ve(e.authUrl), u = await
|
|
3119
|
+
const c = await ve(e.authUrl), u = await xo({ email: y, code: m, authUrl: c });
|
|
3098
3120
|
r({
|
|
3099
3121
|
isAuthenticated: !0,
|
|
3100
3122
|
isLoading: !1,
|
|
@@ -3119,7 +3141,7 @@ function _s({ children: t, config: e }) {
|
|
|
3119
3141
|
const m = await ve(e.authUrl);
|
|
3120
3142
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3121
3143
|
try {
|
|
3122
|
-
const c = await
|
|
3144
|
+
const c = await Uo(m), u = await Wo({ optionsJSON: c }), g = await Mo(m, u, y);
|
|
3123
3145
|
r({
|
|
3124
3146
|
isAuthenticated: !0,
|
|
3125
3147
|
isLoading: !1,
|
|
@@ -3149,17 +3171,17 @@ function _s({ children: t, config: e }) {
|
|
|
3149
3171
|
);
|
|
3150
3172
|
return /* @__PURE__ */ w.jsx(ut, { value: f, children: t });
|
|
3151
3173
|
}
|
|
3152
|
-
function
|
|
3174
|
+
function zo() {
|
|
3153
3175
|
const t = st(ut);
|
|
3154
3176
|
if (!t)
|
|
3155
3177
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3156
3178
|
return t;
|
|
3157
3179
|
}
|
|
3158
|
-
function
|
|
3180
|
+
function Xo() {
|
|
3159
3181
|
return st(ut);
|
|
3160
3182
|
}
|
|
3161
|
-
function
|
|
3162
|
-
const { config: e, guestUrlParam: n } = t, { state: r, login: o } =
|
|
3183
|
+
function xs(t) {
|
|
3184
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = zo(), s = E(!1);
|
|
3163
3185
|
return C(() => {
|
|
3164
3186
|
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
3165
3187
|
return;
|
|
@@ -3178,13 +3200,13 @@ function Os(t) {
|
|
|
3178
3200
|
}
|
|
3179
3201
|
const on = (() => {
|
|
3180
3202
|
try {
|
|
3181
|
-
return
|
|
3203
|
+
return _n();
|
|
3182
3204
|
} catch {
|
|
3183
3205
|
return !1;
|
|
3184
3206
|
}
|
|
3185
|
-
})(), sn = Date.now(), re = [],
|
|
3186
|
-
function
|
|
3187
|
-
re.push(`[+${((Date.now() - sn) / 1e3).toFixed(1)}s] ${t}`), re.length >
|
|
3207
|
+
})(), sn = Date.now(), re = [], Ho = 300;
|
|
3208
|
+
function Ie(t) {
|
|
3209
|
+
re.push(`[+${((Date.now() - sn) / 1e3).toFixed(1)}s] ${t}`), re.length > Ho && re.shift();
|
|
3188
3210
|
}
|
|
3189
3211
|
function Lt(t) {
|
|
3190
3212
|
if (typeof t == "string")
|
|
@@ -3201,26 +3223,26 @@ let Pt = !1;
|
|
|
3201
3223
|
function an() {
|
|
3202
3224
|
if (Pt || typeof window > "u")
|
|
3203
3225
|
return;
|
|
3204
|
-
Pt = !0, window.addEventListener("error", (e) =>
|
|
3226
|
+
Pt = !0, window.addEventListener("error", (e) => Ie(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Ie(`unhandledRejection: ${Lt(e.reason)}`));
|
|
3205
3227
|
const t = console;
|
|
3206
3228
|
for (const e of ["error", "warn", "log", "info"]) {
|
|
3207
3229
|
const n = t[e]?.bind(console) ?? (() => {
|
|
3208
3230
|
});
|
|
3209
3231
|
t[e] = (...r) => {
|
|
3210
3232
|
try {
|
|
3211
|
-
|
|
3233
|
+
Ie(`console.${e}: ${r.map(Lt).join(" ")}`);
|
|
3212
3234
|
} catch {
|
|
3213
3235
|
}
|
|
3214
3236
|
n(...r);
|
|
3215
3237
|
};
|
|
3216
3238
|
}
|
|
3217
3239
|
try {
|
|
3218
|
-
jt((e) =>
|
|
3240
|
+
jt((e) => Ie(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: Je.DEBUG });
|
|
3219
3241
|
} catch {
|
|
3220
3242
|
}
|
|
3221
3243
|
}
|
|
3222
3244
|
on && an();
|
|
3223
|
-
function
|
|
3245
|
+
function qo() {
|
|
3224
3246
|
let t = !1;
|
|
3225
3247
|
try {
|
|
3226
3248
|
const e = URL.createObjectURL(new Blob([""]));
|
|
@@ -3231,11 +3253,11 @@ function Ho() {
|
|
|
3231
3253
|
}
|
|
3232
3254
|
return t;
|
|
3233
3255
|
}
|
|
3234
|
-
function
|
|
3256
|
+
function Jo() {
|
|
3235
3257
|
const t = globalThis;
|
|
3236
3258
|
return [
|
|
3237
3259
|
`Worker=${typeof Worker < "u"}`,
|
|
3238
|
-
`moduleWorker=${
|
|
3260
|
+
`moduleWorker=${qo()}`,
|
|
3239
3261
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3240
3262
|
`WebTransport=${typeof t.WebTransport < "u"}`,
|
|
3241
3263
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3248,7 +3270,7 @@ function qo() {
|
|
|
3248
3270
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3249
3271
|
].join(" ");
|
|
3250
3272
|
}
|
|
3251
|
-
function
|
|
3273
|
+
function Zo(t) {
|
|
3252
3274
|
return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
|
|
3253
3275
|
}
|
|
3254
3276
|
function cn({ state: t = "", forceVisible: e = !1 }) {
|
|
@@ -3289,12 +3311,12 @@ function cn({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3289
3311
|
] }),
|
|
3290
3312
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
|
|
3291
3313
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
|
|
3292
|
-
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children:
|
|
3314
|
+
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: Jo() }),
|
|
3293
3315
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
|
|
3294
|
-
/* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l, h) => /* @__PURE__ */ w.jsx("div", { style: { color:
|
|
3316
|
+
/* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l, h) => /* @__PURE__ */ w.jsx("div", { style: { color: Zo(l), wordBreak: "break-all" }, children: l }, h)) })
|
|
3295
3317
|
] });
|
|
3296
3318
|
}
|
|
3297
|
-
function
|
|
3319
|
+
function Ns({
|
|
3298
3320
|
connectionState: t,
|
|
3299
3321
|
error: e,
|
|
3300
3322
|
isReady: n,
|
|
@@ -3347,37 +3369,37 @@ function xs({
|
|
|
3347
3369
|
] });
|
|
3348
3370
|
}
|
|
3349
3371
|
const Oe = oe("useIkonApp");
|
|
3350
|
-
function
|
|
3372
|
+
function Qo() {
|
|
3351
3373
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3352
3374
|
return window.__IKON_AUTH_CONFIG__;
|
|
3353
3375
|
}
|
|
3354
|
-
function
|
|
3376
|
+
function es() {
|
|
3355
3377
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3356
3378
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3357
3379
|
}
|
|
3358
|
-
function
|
|
3359
|
-
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: h, proxy: f, liveSnapshot: y, bootSnapshot: m } = t, c = e === void 0 ?
|
|
3360
|
-
T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a,
|
|
3380
|
+
function Ls(t) {
|
|
3381
|
+
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: h, proxy: f, liveSnapshot: y, bootSnapshot: m } = t, c = e === void 0 ? Qo() ?? null : e, u = es(), g = Xo(), p = E(null), b = E(null), S = E(null), R = E(!1), v = E(!1), T = E(o), U = E(r), ee = E(s), te = E(i), z = E(a), I = E(l), P = E(h), M = E(f), B = E(y), $ = E(m), V = E("local"), K = E(void 0);
|
|
3382
|
+
T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, I.current = l, P.current = h, M.current = f, B.current = y, $.current = m;
|
|
3361
3383
|
const [H, Ee] = x("connecting"), [Re, pe] = x(!1), [d, A] = x(!1), [O, N] = x(null), [se, me] = x(null), [L, Q] = x(!1), [ie, Me] = x(null), [ae, un] = x(null), [De, dt] = x(!1), je = E(!1), [dn, fn] = x(0), Y = W(() => {
|
|
3362
3384
|
try {
|
|
3363
|
-
const
|
|
3364
|
-
return (
|
|
3385
|
+
const _ = In();
|
|
3386
|
+
return (_.sessionId || _.channelKey) && On(), _;
|
|
3365
3387
|
} catch {
|
|
3366
3388
|
return { parameters: {} };
|
|
3367
3389
|
}
|
|
3368
3390
|
}, []);
|
|
3369
3391
|
m !== !1 && vn();
|
|
3370
3392
|
const ce = W(() => c?.enabled ? Jt() : null, [c?.enabled, dn]), Ae = u?.enabled ?? !1, $e = u?.host ?? "localhost", Be = u?.port ?? 8443, Fe = !!c && !c.enabled && !!c.spaceId && (ht() || Ae);
|
|
3371
|
-
Fe && !ae && !De && !je.current && (je.current = !0, ve(c.authUrl).then((
|
|
3372
|
-
un(
|
|
3373
|
-
}).catch((
|
|
3374
|
-
Oe.error("Anonymous auth failed:",
|
|
3393
|
+
Fe && !ae && !De && !je.current && (je.current = !0, ve(c.authUrl).then((_) => Qt(c.spaceId, _)).then((_) => {
|
|
3394
|
+
un(_.token), dt(!0);
|
|
3395
|
+
}).catch((_) => {
|
|
3396
|
+
Oe.error("Anonymous auth failed:", _), je.current = !1, Ae ? dt(!0) : N(_ instanceof Error ? _.message : "Anonymous auth failed");
|
|
3375
3397
|
}));
|
|
3376
3398
|
const Ve = W(() => {
|
|
3377
3399
|
if (Ae) {
|
|
3378
3400
|
if (Fe && !De)
|
|
3379
3401
|
return null;
|
|
3380
|
-
const
|
|
3402
|
+
const _ = ce?.token ?? ae ?? void 0, q = _ ? pt(_) ?? void 0 : void 0;
|
|
3381
3403
|
return {
|
|
3382
3404
|
local: {
|
|
3383
3405
|
host: $e,
|
|
@@ -3420,20 +3442,20 @@ function Ns(t) {
|
|
|
3420
3442
|
}
|
|
3421
3443
|
};
|
|
3422
3444
|
}, [Ae, $e, Be, ce?.token, c?.spaceId, c?.backendUrl, c?.authUrl, ae, Fe, De, Y.sessionId, Y.channelKey, Y.parameters]);
|
|
3423
|
-
V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0,
|
|
3424
|
-
const hn =
|
|
3445
|
+
V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0, eo(ie);
|
|
3446
|
+
const hn = no(ie);
|
|
3425
3447
|
C(() => {
|
|
3426
3448
|
if (!R.current) {
|
|
3427
|
-
if (R.current = !0, S.current =
|
|
3428
|
-
for (const
|
|
3429
|
-
|
|
3430
|
-
S.current.loadRegisteredModules().catch((
|
|
3431
|
-
Oe.error("Failed to load UI modules",
|
|
3449
|
+
if (R.current = !0, S.current = Gr(), n)
|
|
3450
|
+
for (const _ of n)
|
|
3451
|
+
_(S.current);
|
|
3452
|
+
S.current.loadRegisteredModules().catch((_) => {
|
|
3453
|
+
Oe.error("Failed to load UI modules", _);
|
|
3432
3454
|
});
|
|
3433
3455
|
}
|
|
3434
3456
|
}, []), C(() => {
|
|
3435
3457
|
if (!Ve) return;
|
|
3436
|
-
const
|
|
3458
|
+
const _ = new xn({
|
|
3437
3459
|
...Ve,
|
|
3438
3460
|
timeouts: U.current,
|
|
3439
3461
|
audio: te.current !== void 0 || T.current ? {
|
|
@@ -3443,7 +3465,7 @@ function Ns(t) {
|
|
|
3443
3465
|
video: z.current !== void 0 ? { enabled: z.current } : void 0,
|
|
3444
3466
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3445
3467
|
webRtc: ee.current === !1 ? { enabled: !1 } : void 0,
|
|
3446
|
-
websocket:
|
|
3468
|
+
websocket: I.current,
|
|
3447
3469
|
webtransport: P.current,
|
|
3448
3470
|
proxy: M.current,
|
|
3449
3471
|
onConnectionStateChange: (J) => {
|
|
@@ -3453,36 +3475,36 @@ function Ns(t) {
|
|
|
3453
3475
|
N(J.message);
|
|
3454
3476
|
}
|
|
3455
3477
|
});
|
|
3456
|
-
p.current =
|
|
3457
|
-
const q = B.current ?? !0, Te = K.current, ft = Te ? pt(Te) ?? null : null, gn = q && ft ? { enabled: !0, appId: V.current, userId: ft } : void 0, ke = new
|
|
3478
|
+
p.current = _;
|
|
3479
|
+
const q = B.current ?? !0, Te = K.current, ft = Te ? pt(Te) ?? null : null, gn = q && ft ? { enabled: !0, appId: V.current, userId: ft } : void 0, ke = new er({ client: _, liveSnapshot: gn, bootSnapshot: $.current });
|
|
3458
3480
|
b.current = ke, Me(ke), A(!1);
|
|
3459
3481
|
const yn = ke.subscribeToUiUpdates(() => {
|
|
3460
|
-
A(!0);
|
|
3482
|
+
A(!0), Nn();
|
|
3461
3483
|
});
|
|
3462
|
-
return
|
|
3463
|
-
if (Oe.error("Connection failed:", J), J instanceof
|
|
3484
|
+
return _.connect().catch((J) => {
|
|
3485
|
+
if (Oe.error("Connection failed:", J), J instanceof Ln) {
|
|
3464
3486
|
me(J.reason);
|
|
3465
3487
|
return;
|
|
3466
3488
|
}
|
|
3467
|
-
if (J instanceof
|
|
3489
|
+
if (J instanceof Pn) {
|
|
3468
3490
|
Q(!0);
|
|
3469
3491
|
return;
|
|
3470
3492
|
}
|
|
3471
|
-
J instanceof
|
|
3493
|
+
J instanceof Un && !v.current && (v.current = !0, Oe.warn("Auth session appears stale, clearing and retrying"), Ut.clearAll(), g ? g.logout() : (Le(), fn((bn) => bn + 1)));
|
|
3472
3494
|
}), () => {
|
|
3473
|
-
yn(),
|
|
3495
|
+
yn(), _.disconnect(), p.current = null, ke.dispose(), b.current = null;
|
|
3474
3496
|
};
|
|
3475
3497
|
}, [Ve]);
|
|
3476
|
-
const pn = j((
|
|
3498
|
+
const pn = j((_, q) => {
|
|
3477
3499
|
const Te = typeof q == "string" ? q : JSON.stringify(q ?? {});
|
|
3478
|
-
p.current?.sendActionCall(
|
|
3500
|
+
p.current?.sendActionCall(_, Te);
|
|
3479
3501
|
}, []);
|
|
3480
3502
|
C(() => {
|
|
3481
3503
|
if (H !== "connecting") {
|
|
3482
3504
|
pe(!1);
|
|
3483
3505
|
return;
|
|
3484
3506
|
}
|
|
3485
|
-
const
|
|
3507
|
+
const _ = p.current?.slowConnectionThresholdMs ?? 5e3, q = setTimeout(() => pe(!0), _);
|
|
3486
3508
|
return () => clearTimeout(q);
|
|
3487
3509
|
}, [H]);
|
|
3488
3510
|
const mn = H === "connected" || H === "reconnecting", We = d && H !== "offline";
|
|
@@ -3508,7 +3530,7 @@ function Ns(t) {
|
|
|
3508
3530
|
webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3509
3531
|
};
|
|
3510
3532
|
}
|
|
3511
|
-
function
|
|
3533
|
+
function Ps(t) {
|
|
3512
3534
|
const e = E(!1);
|
|
3513
3535
|
return j(() => {
|
|
3514
3536
|
if (e.current) return;
|
|
@@ -3517,8 +3539,8 @@ function Ls(t) {
|
|
|
3517
3539
|
n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
3518
3540
|
}, [t]);
|
|
3519
3541
|
}
|
|
3520
|
-
let
|
|
3521
|
-
function
|
|
3542
|
+
let ts = 0;
|
|
3543
|
+
function ns(t = 5, e = 5e3) {
|
|
3522
3544
|
const [n, r] = x([]), o = E(/* @__PURE__ */ new Map()), s = j((i) => {
|
|
3523
3545
|
const a = o.current.get(i);
|
|
3524
3546
|
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((h) => h.id !== i));
|
|
@@ -3528,7 +3550,7 @@ function ts(t = 5, e = 5e3) {
|
|
|
3528
3550
|
(l) => {
|
|
3529
3551
|
if (!$t())
|
|
3530
3552
|
return;
|
|
3531
|
-
const h = `toast-${++
|
|
3553
|
+
const h = `toast-${++ts}`, f = l.level === Je.ERROR ? "error" : "warn", y = {
|
|
3532
3554
|
id: h,
|
|
3533
3555
|
level: f,
|
|
3534
3556
|
message: l.message,
|
|
@@ -3550,7 +3572,7 @@ function ts(t = 5, e = 5e3) {
|
|
|
3550
3572
|
};
|
|
3551
3573
|
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3552
3574
|
}
|
|
3553
|
-
function
|
|
3575
|
+
function rs(t, e, n) {
|
|
3554
3576
|
const [r, o] = x(n);
|
|
3555
3577
|
return C(() => {
|
|
3556
3578
|
if (!t)
|
|
@@ -3567,7 +3589,7 @@ function ns(t, e, n) {
|
|
|
3567
3589
|
};
|
|
3568
3590
|
}, [t, e]), r;
|
|
3569
3591
|
}
|
|
3570
|
-
function
|
|
3592
|
+
function Us(t, e, n) {
|
|
3571
3593
|
const [r, o] = x(null);
|
|
3572
3594
|
return C(() => {
|
|
3573
3595
|
if (!t)
|
|
@@ -3580,17 +3602,17 @@ function Ps(t, e, n) {
|
|
|
3580
3602
|
}), () => {
|
|
3581
3603
|
s = !1;
|
|
3582
3604
|
};
|
|
3583
|
-
}, [t, e]),
|
|
3605
|
+
}, [t, e]), rs(r ? t : null, r ?? "", n);
|
|
3584
3606
|
}
|
|
3585
|
-
const ue = oe("IkonDebug"),
|
|
3607
|
+
const ue = oe("IkonDebug"), os = {
|
|
3586
3608
|
Digit1: "connecting",
|
|
3587
3609
|
Digit2: "connected",
|
|
3588
3610
|
Digit3: "reconnecting",
|
|
3589
3611
|
Digit4: "offline",
|
|
3590
3612
|
Digit5: "offline",
|
|
3591
3613
|
Digit0: "clear"
|
|
3592
|
-
},
|
|
3593
|
-
function
|
|
3614
|
+
}, ss = "Digit5", is = "Digit6", as = "Synthetic debug error (Ctrl+Shift+5)", cs = "Synthetic debug access-denied (Ctrl+Shift+6)", ls = 5e3;
|
|
3615
|
+
function us(t) {
|
|
3594
3616
|
const e = $t(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l, h] = x(null), [f, y] = x(!1), [m, c] = x(!1), [u, g] = x(!1);
|
|
3595
3617
|
return C(() => {
|
|
3596
3618
|
if (!e)
|
|
@@ -3610,19 +3632,19 @@ function ls(t) {
|
|
|
3610
3632
|
S.preventDefault(), g((T) => (ue.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
|
|
3611
3633
|
return;
|
|
3612
3634
|
}
|
|
3613
|
-
if (S.code ===
|
|
3614
|
-
S.preventDefault(), h(
|
|
3635
|
+
if (S.code === is) {
|
|
3636
|
+
S.preventDefault(), h(cs), r(null), a(null), ue.warn("Forced access denied");
|
|
3615
3637
|
return;
|
|
3616
3638
|
}
|
|
3617
|
-
const R =
|
|
3639
|
+
const R = os[S.code];
|
|
3618
3640
|
if (R === void 0)
|
|
3619
3641
|
return;
|
|
3620
3642
|
if (S.preventDefault(), R === "clear") {
|
|
3621
3643
|
r(null), a(null), h(null), ue.warn("Cleared forced state");
|
|
3622
3644
|
return;
|
|
3623
3645
|
}
|
|
3624
|
-
const v = S.code ===
|
|
3625
|
-
r(R), a(v ?
|
|
3646
|
+
const v = S.code === ss;
|
|
3647
|
+
r(R), a(v ? as : null), h(null), ue.warn(`Forced state: ${R}${v ? " (with error)" : ""}`);
|
|
3626
3648
|
};
|
|
3627
3649
|
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3628
3650
|
}, [e]), C(() => {
|
|
@@ -3630,7 +3652,7 @@ function ls(t) {
|
|
|
3630
3652
|
s(!1);
|
|
3631
3653
|
return;
|
|
3632
3654
|
}
|
|
3633
|
-
const b = setTimeout(() => s(!0),
|
|
3655
|
+
const b = setTimeout(() => s(!0), ls);
|
|
3634
3656
|
return () => clearTimeout(b);
|
|
3635
3657
|
}, [n]), !e || n === null && !f && l === null && !m && !u ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
|
|
3636
3658
|
...t,
|
|
@@ -3641,34 +3663,34 @@ function ls(t) {
|
|
|
3641
3663
|
accessDeniedReason: l ?? t.accessDeniedReason
|
|
3642
3664
|
}, forcedState: n, emptyStores: f, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
|
|
3643
3665
|
}
|
|
3644
|
-
function
|
|
3666
|
+
function ds(t, e) {
|
|
3645
3667
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3646
3668
|
}
|
|
3647
|
-
function
|
|
3669
|
+
function fs(t) {
|
|
3648
3670
|
return t === void 0 ? null : typeof t == "function" ? t() : t;
|
|
3649
3671
|
}
|
|
3650
|
-
function
|
|
3672
|
+
function hs(t, e) {
|
|
3651
3673
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3652
3674
|
}
|
|
3653
|
-
function
|
|
3675
|
+
function ps(t, e) {
|
|
3654
3676
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3655
3677
|
}
|
|
3656
|
-
function
|
|
3657
|
-
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i =
|
|
3678
|
+
function Ms(t) {
|
|
3679
|
+
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = us(s), { app: a } = i, { connectionState: l, isConnectingSlow: h, stores: f, registry: y, client: m, onAction: c, isReady: u, error: g, accessDeniedReason: p, brandingRequired: b } = a, S = b || i.forcedBranding, R = E(null);
|
|
3658
3680
|
if (f && y && (u || f.size > 0) && (R.current = { stores: f, registry: y, client: m }), p)
|
|
3659
|
-
return
|
|
3681
|
+
return ps(o, p);
|
|
3660
3682
|
const v = R.current;
|
|
3661
3683
|
let T = null;
|
|
3662
3684
|
switch (l) {
|
|
3663
3685
|
case "waitingForExternalConnectUrl":
|
|
3664
3686
|
case "connecting":
|
|
3665
|
-
T =
|
|
3687
|
+
T = ds(e, h);
|
|
3666
3688
|
break;
|
|
3667
3689
|
case "reconnecting":
|
|
3668
|
-
T =
|
|
3690
|
+
T = fs(n);
|
|
3669
3691
|
break;
|
|
3670
3692
|
case "offline":
|
|
3671
|
-
T =
|
|
3693
|
+
T = hs(r, g);
|
|
3672
3694
|
break;
|
|
3673
3695
|
default:
|
|
3674
3696
|
T = null;
|
|
@@ -3684,18 +3706,18 @@ function Us(t) {
|
|
|
3684
3706
|
}
|
|
3685
3707
|
),
|
|
3686
3708
|
T,
|
|
3687
|
-
S && /* @__PURE__ */ w.jsx(
|
|
3688
|
-
/* @__PURE__ */ w.jsx(
|
|
3709
|
+
S && /* @__PURE__ */ w.jsx(gs, {}),
|
|
3710
|
+
/* @__PURE__ */ w.jsx(ys, {}),
|
|
3689
3711
|
/* @__PURE__ */ w.jsx(cn, { state: l, forceVisible: i.forcedDebugOverlay })
|
|
3690
3712
|
] });
|
|
3691
3713
|
}
|
|
3692
|
-
const
|
|
3693
|
-
function
|
|
3714
|
+
const ms = "https://ikonai.com";
|
|
3715
|
+
function gs() {
|
|
3694
3716
|
return /* @__PURE__ */ w.jsxs(
|
|
3695
3717
|
"a",
|
|
3696
3718
|
{
|
|
3697
3719
|
className: "ikon-branding-banner",
|
|
3698
|
-
href:
|
|
3720
|
+
href: ms,
|
|
3699
3721
|
target: "_blank",
|
|
3700
3722
|
rel: "noopener noreferrer",
|
|
3701
3723
|
style: {
|
|
@@ -3723,11 +3745,11 @@ function ms() {
|
|
|
3723
3745
|
}
|
|
3724
3746
|
);
|
|
3725
3747
|
}
|
|
3726
|
-
function
|
|
3727
|
-
const { toasts: t, dismissToast: e } =
|
|
3728
|
-
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(
|
|
3748
|
+
function ys() {
|
|
3749
|
+
const { toasts: t, dismissToast: e } = ns();
|
|
3750
|
+
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(bs, { toast: n, onDismiss: e }, n.id)) });
|
|
3729
3751
|
}
|
|
3730
|
-
function
|
|
3752
|
+
function bs({ toast: t, onDismiss: e }) {
|
|
3731
3753
|
return /* @__PURE__ */ w.jsxs(
|
|
3732
3754
|
"div",
|
|
3733
3755
|
{
|
|
@@ -3749,30 +3771,30 @@ function ys({ toast: t, onDismiss: e }) {
|
|
|
3749
3771
|
);
|
|
3750
3772
|
}
|
|
3751
3773
|
const ln = Mt(null);
|
|
3752
|
-
function
|
|
3774
|
+
function Ss(t, e) {
|
|
3753
3775
|
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3754
3776
|
}
|
|
3755
|
-
function
|
|
3756
|
-
const n =
|
|
3777
|
+
function ws(t, e) {
|
|
3778
|
+
const n = Mn();
|
|
3757
3779
|
if (n && t.includes(n))
|
|
3758
3780
|
return n;
|
|
3759
3781
|
const r = navigator.language.split("-")[0];
|
|
3760
3782
|
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3761
3783
|
}
|
|
3762
|
-
function
|
|
3763
|
-
return e ?
|
|
3784
|
+
function vs(t, e, n) {
|
|
3785
|
+
return e ? ws(t, n) : n && t.includes(n) ? n : "en";
|
|
3764
3786
|
}
|
|
3765
|
-
function
|
|
3787
|
+
function Ds({
|
|
3766
3788
|
children: t,
|
|
3767
3789
|
translations: e,
|
|
3768
3790
|
defaultLanguage: n,
|
|
3769
3791
|
detectLanguage: r = !1
|
|
3770
3792
|
}) {
|
|
3771
|
-
const o = Object.keys(e), s =
|
|
3793
|
+
const o = Object.keys(e), s = vs(o, r, n), i = e[s] ?? e.en, a = W(
|
|
3772
3794
|
() => ({
|
|
3773
3795
|
t: (l, h) => {
|
|
3774
3796
|
const f = i[l];
|
|
3775
|
-
return
|
|
3797
|
+
return Ss(f, h);
|
|
3776
3798
|
},
|
|
3777
3799
|
locale: s,
|
|
3778
3800
|
translations: i
|
|
@@ -3781,72 +3803,72 @@ function Ms({
|
|
|
3781
3803
|
);
|
|
3782
3804
|
return /* @__PURE__ */ w.jsx(ln, { value: a, children: t });
|
|
3783
3805
|
}
|
|
3784
|
-
function
|
|
3806
|
+
function js() {
|
|
3785
3807
|
const t = st(ln);
|
|
3786
3808
|
if (!t)
|
|
3787
3809
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3788
3810
|
return t;
|
|
3789
3811
|
}
|
|
3790
3812
|
export {
|
|
3791
|
-
|
|
3792
|
-
|
|
3813
|
+
Os as AuthProvider,
|
|
3814
|
+
Ns as ConnectionStateRenderer,
|
|
3793
3815
|
on as DEBUG_OVERLAY_ENABLED,
|
|
3794
3816
|
cn as DebugOverlay,
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3817
|
+
Ds as I18nProvider,
|
|
3818
|
+
pr as IKON_UI_BASE_MODULE,
|
|
3819
|
+
kr as IKON_UI_MEDIA_MODULE,
|
|
3820
|
+
Vr as IKON_UI_SHADERTOY_MODULE,
|
|
3821
|
+
Br as IKON_UI_SHADERTOY_TYPE,
|
|
3800
3822
|
Qe as IKON_UI_STREAM_CATEGORY,
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3823
|
+
vr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3824
|
+
Er as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3825
|
+
Ms as IkonApp,
|
|
3826
|
+
er as IkonUi,
|
|
3827
|
+
Yr as IkonUiRegistry,
|
|
3806
3828
|
Bt as IkonUiSurface,
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3829
|
+
Jn as InspectOverlay,
|
|
3830
|
+
_s as ParallaxView,
|
|
3831
|
+
qn as UiComponentRegistry,
|
|
3832
|
+
Hn as UiRenderer,
|
|
3833
|
+
Fs as UiStreamStore,
|
|
3812
3834
|
Qt as authenticateAnonymous,
|
|
3813
|
-
|
|
3835
|
+
Po as buildOAuthRedirectUrl,
|
|
3814
3836
|
Le as clearAuthSession,
|
|
3815
3837
|
Nt as clearOAuthParams,
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3838
|
+
hr as createBaseResolvers,
|
|
3839
|
+
ks as createComponentLibrary,
|
|
3840
|
+
Gr as createIkonUiRegistry,
|
|
3841
|
+
Ar as createMediaResolvers,
|
|
3842
|
+
Fr as createShadertoyRendererResolver,
|
|
3843
|
+
Qn as isIkonUiCategoryMatch,
|
|
3822
3844
|
Jt as loadAuthSession,
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3845
|
+
mr as loadBaseModule,
|
|
3846
|
+
Cr as loadMediaModule,
|
|
3847
|
+
Wr as loadShadertoyModule,
|
|
3848
|
+
No as parseOAuthCallback,
|
|
3849
|
+
Lo as parseOAuthError,
|
|
3850
|
+
Ws as randomUuid,
|
|
3851
|
+
gr as registerBaseModule,
|
|
3852
|
+
_r as registerMediaModule,
|
|
3853
|
+
Kr as registerShadertoyModule,
|
|
3854
|
+
zn as renderChildren,
|
|
3833
3855
|
Is as renderMotionLetters,
|
|
3834
3856
|
he as saveAuthSession,
|
|
3835
|
-
|
|
3857
|
+
Oo as sendLoginCode,
|
|
3836
3858
|
ne as sessionToUser,
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3859
|
+
zo as useAuth,
|
|
3860
|
+
xs as useAuthGuard,
|
|
3861
|
+
Xo as useAuthOptional,
|
|
3862
|
+
js as useI18n,
|
|
3863
|
+
Ls as useIkonApp,
|
|
3864
|
+
us as useIkonDebug,
|
|
3865
|
+
rs as useIkonReactive,
|
|
3866
|
+
eo as useIkonStyles,
|
|
3867
|
+
no as useIkonUiStores,
|
|
3868
|
+
Ps as useLazyFont,
|
|
3869
|
+
Us as useReactive,
|
|
3870
|
+
ns as useToasts,
|
|
3849
3871
|
Z as useUiNode,
|
|
3850
|
-
|
|
3851
|
-
|
|
3872
|
+
Cs as useUiStore,
|
|
3873
|
+
xo as verifyLoginCode
|
|
3852
3874
|
};
|