@ikonai/sdk-react-ui 1.0.69 → 1.0.70
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/app/use-ikon-app.d.ts +5 -3
- package/auth/storage.d.ts +14 -0
- package/auth/types.d.ts +15 -2
- package/index.js +614 -583
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
5
|
-
import { randomUuid as
|
|
6
|
-
var Ie = { exports: {} },
|
|
1
|
+
import { IkonUiCore as Tn, UiStreamStore as kn, LiveSnapshotCache as Bt, prefetchBootSnapshot as Cn } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as hi } from "@ikonai/sdk-ui";
|
|
3
|
+
import In, { useSyncExternalStore as at, useMemo as W, memo as Y, useRef as E, useCallback as D, Fragment as _n, useEffect as C, useState as N, use as ct, createContext as Ft, useReducer as On } from "react";
|
|
4
|
+
import { createLogger as oe, isInspectModeEnabled as Nn, getOrCreateDeviceId as xn, getSameOriginAuthUrl as Ln, abortSignalTimeout as Vt, deriveAuthUrl as Ee, getDebugOverlayParam as Pn, subscribeToLogEvents as Wt, LogLevel as Qe, parseUrlParams as Un, clearSessionParamsFromUrl as Mn, isCloudEnvironment as gt, extractUserIdFromToken as yt, deriveBackendType as bt, IkonClient as jn, AccessDeniedError as Dn, ServerFullError as $n, AuthenticationError as Bn, isDebugModeEnabled as Kt, getLangParam as Fn } from "@ikonai/sdk";
|
|
5
|
+
import { randomUuid as mi } from "@ikonai/sdk";
|
|
6
|
+
var Ie = { exports: {} }, ge = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.js
|
|
@@ -14,8 +14,8 @@ var Ie = { exports: {} }, me = {};
|
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
16
|
var St;
|
|
17
|
-
function
|
|
18
|
-
if (St) return
|
|
17
|
+
function Vn() {
|
|
18
|
+
if (St) return ge;
|
|
19
19
|
St = 1;
|
|
20
20
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
21
21
|
function n(r, o, s) {
|
|
@@ -33,9 +33,9 @@ function Bn() {
|
|
|
33
33
|
props: s
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return ge.Fragment = e, ge.jsx = n, ge.jsxs = n, ge;
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var ye = {};
|
|
39
39
|
/**
|
|
40
40
|
* @license React
|
|
41
41
|
* react-jsx-runtime.development.js
|
|
@@ -46,19 +46,19 @@ var ge = {};
|
|
|
46
46
|
* LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
48
|
var wt;
|
|
49
|
-
function
|
|
49
|
+
function Wn() {
|
|
50
50
|
return wt || (wt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
51
|
function t(f) {
|
|
52
52
|
if (f == null) return null;
|
|
53
53
|
if (typeof f == "function")
|
|
54
|
-
return f.$$typeof ===
|
|
54
|
+
return f.$$typeof === P ? null : f.displayName || f.name || null;
|
|
55
55
|
if (typeof f == "string") return f;
|
|
56
56
|
switch (f) {
|
|
57
57
|
case p:
|
|
58
58
|
return "Fragment";
|
|
59
|
-
case b:
|
|
60
|
-
return "Profiler";
|
|
61
59
|
case S:
|
|
60
|
+
return "Profiler";
|
|
61
|
+
case b:
|
|
62
62
|
return "StrictMode";
|
|
63
63
|
case U:
|
|
64
64
|
return "Suspense";
|
|
@@ -154,15 +154,15 @@ function Fn() {
|
|
|
154
154
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
155
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
156
156
|
}
|
|
157
|
-
function d(f, A, O, x,
|
|
158
|
-
var
|
|
157
|
+
function d(f, A, O, x, se, me) {
|
|
158
|
+
var L = O.ref;
|
|
159
159
|
return f = {
|
|
160
160
|
$$typeof: u,
|
|
161
161
|
type: f,
|
|
162
162
|
key: A,
|
|
163
163
|
props: O,
|
|
164
164
|
_owner: x
|
|
165
|
-
}, (
|
|
165
|
+
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(f, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
get: l
|
|
168
168
|
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
@@ -179,33 +179,33 @@ function Fn() {
|
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
|
-
value:
|
|
182
|
+
value: se
|
|
183
183
|
}), Object.defineProperty(f, "_debugTask", {
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: me
|
|
188
188
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
189
189
|
}
|
|
190
|
-
function h(f, A, O, x,
|
|
191
|
-
var
|
|
192
|
-
if (
|
|
190
|
+
function h(f, A, O, x, se, me) {
|
|
191
|
+
var L = A.children;
|
|
192
|
+
if (L !== void 0)
|
|
193
193
|
if (x)
|
|
194
|
-
if ($(
|
|
195
|
-
for (x = 0; x <
|
|
196
|
-
y(
|
|
197
|
-
Object.freeze && Object.freeze(
|
|
194
|
+
if ($(L)) {
|
|
195
|
+
for (x = 0; x < L.length; x++)
|
|
196
|
+
y(L[x]);
|
|
197
|
+
Object.freeze && Object.freeze(L);
|
|
198
198
|
} else
|
|
199
199
|
console.error(
|
|
200
200
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
201
|
);
|
|
202
|
-
else y(
|
|
202
|
+
else y(L);
|
|
203
203
|
if (B.call(A, "key")) {
|
|
204
|
-
|
|
204
|
+
L = t(f);
|
|
205
205
|
var Q = Object.keys(A).filter(function(De) {
|
|
206
206
|
return De !== "key";
|
|
207
207
|
});
|
|
208
|
-
x = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
208
|
+
x = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", pe[L + x] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
209
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s {...props} />
|
|
@@ -213,26 +213,26 @@ React keys must be passed directly to JSX without using spread:
|
|
|
213
213
|
let props = %s;
|
|
214
214
|
<%s key={someKey} {...props} />`,
|
|
215
215
|
x,
|
|
216
|
-
|
|
216
|
+
L,
|
|
217
217
|
Q,
|
|
218
|
-
|
|
219
|
-
),
|
|
218
|
+
L
|
|
219
|
+
), pe[L + x] = !0);
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
221
|
+
if (L = null, O !== void 0 && (n(O), L = "" + O), i(A) && (n(A.key), L = "" + A.key), "key" in A) {
|
|
222
222
|
O = {};
|
|
223
|
-
for (var
|
|
224
|
-
|
|
223
|
+
for (var ie in A)
|
|
224
|
+
ie !== "key" && (O[ie] = A[ie]);
|
|
225
225
|
} else O = A;
|
|
226
|
-
return
|
|
226
|
+
return L && a(
|
|
227
227
|
O,
|
|
228
228
|
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
229
229
|
), d(
|
|
230
230
|
f,
|
|
231
|
-
|
|
231
|
+
L,
|
|
232
232
|
O,
|
|
233
233
|
o(),
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
se,
|
|
235
|
+
me
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function y(f) {
|
|
@@ -241,7 +241,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
241
241
|
function m(f) {
|
|
242
242
|
return typeof f == "object" && f !== null && f.$$typeof === u;
|
|
243
243
|
}
|
|
244
|
-
var c =
|
|
244
|
+
var c = In, 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"), _ = 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 = {
|
|
@@ -252,8 +252,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
252
252
|
var K, H = {}, Re = c.react_stack_bottom_frame.bind(
|
|
253
253
|
c,
|
|
254
254
|
s
|
|
255
|
-
)(), Ae = V(r(s)),
|
|
256
|
-
|
|
255
|
+
)(), Ae = V(r(s)), pe = {};
|
|
256
|
+
ye.Fragment = p, ye.jsx = function(f, A, O) {
|
|
257
257
|
var x = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
258
258
|
return h(
|
|
259
259
|
f,
|
|
@@ -263,7 +263,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
263
263
|
x ? Error("react-stack-top-frame") : Re,
|
|
264
264
|
x ? V(r(f)) : Ae
|
|
265
265
|
);
|
|
266
|
-
},
|
|
266
|
+
}, ye.jsxs = function(f, A, O) {
|
|
267
267
|
var x = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
268
268
|
return h(
|
|
269
269
|
f,
|
|
@@ -274,14 +274,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
274
274
|
x ? V(r(f)) : Ae
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
|
-
})()),
|
|
277
|
+
})()), ye;
|
|
278
278
|
}
|
|
279
279
|
var vt;
|
|
280
|
-
function
|
|
281
|
-
return vt || (vt = 1, process.env.NODE_ENV === "production" ? Ie.exports =
|
|
280
|
+
function Kn() {
|
|
281
|
+
return vt || (vt = 1, process.env.NODE_ENV === "production" ? Ie.exports = Vn() : Ie.exports = Wn()), Ie.exports;
|
|
282
282
|
}
|
|
283
|
-
var w =
|
|
284
|
-
function
|
|
283
|
+
var w = Kn();
|
|
284
|
+
function Gn(t, e) {
|
|
285
285
|
const n = at(
|
|
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 Yn = oe("UIRenderer");
|
|
313
|
+
function zn(t) {
|
|
314
314
|
if (t === void 0)
|
|
315
315
|
return "{}";
|
|
316
316
|
if (typeof t == "string")
|
|
@@ -321,18 +321,18 @@ function Gn(t) {
|
|
|
321
321
|
return "{}";
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Xn(t) {
|
|
325
325
|
const e = t.styleIds;
|
|
326
326
|
return Array.isArray(e) ? e : [];
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Hn(t) {
|
|
329
329
|
const e = t.children;
|
|
330
330
|
return Array.isArray(e) ? e : [];
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function qn(t, e) {
|
|
333
333
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Jn(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 Hn(t) {
|
|
|
341
341
|
return e;
|
|
342
342
|
}
|
|
343
343
|
const et = Y(function t({ nodeId: e, context: n }) {
|
|
344
|
-
const r = Z(n.store, e), o = r ?
|
|
344
|
+
const r = Z(n.store, e), o = r ? Hn(r) : [], s = Jn(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]
|
|
@@ -349,21 +349,21 @@ const et = Y(function t({ nodeId: e, context: n }) {
|
|
|
349
349
|
if (!r)
|
|
350
350
|
return null;
|
|
351
351
|
if (r.type === "root")
|
|
352
|
-
return /* @__PURE__ */ w.jsx(
|
|
352
|
+
return /* @__PURE__ */ w.jsx(_n, { children: i }, r.id);
|
|
353
353
|
const a = n.library.resolve(r);
|
|
354
354
|
if (!a)
|
|
355
|
-
return
|
|
356
|
-
const l =
|
|
355
|
+
return Yn.warn(`No renderer for node type ${r.type}`), null;
|
|
356
|
+
const l = Xn(r), d = l.length > 0 ? l.join(" ") : void 0, h = a;
|
|
357
357
|
return /* @__PURE__ */ w.jsx(h, { nodeId: e, context: n, className: d });
|
|
358
|
-
},
|
|
359
|
-
function
|
|
358
|
+
}, qn);
|
|
359
|
+
function Zn(t, e) {
|
|
360
360
|
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ w.jsx(et, { nodeId: n.id, context: e }, n.id));
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Qn(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: d } =
|
|
365
|
+
const er = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
366
|
+
const { rootViewId: l, rootNodeId: d } = Gn(e, r), h = E(s);
|
|
367
367
|
h.current = s;
|
|
368
368
|
const y = E(i);
|
|
369
369
|
y.current = i;
|
|
@@ -372,8 +372,8 @@ const Zn = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
372
372
|
const c = D((g, p) => {
|
|
373
373
|
if (!g)
|
|
374
374
|
return;
|
|
375
|
-
const
|
|
376
|
-
h.current?.(g,
|
|
375
|
+
const b = zn(p);
|
|
376
|
+
h.current?.(g, b);
|
|
377
377
|
}, []), u = W(() => {
|
|
378
378
|
const g = {
|
|
379
379
|
store: e,
|
|
@@ -381,10 +381,10 @@ const Zn = Y(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
|
-
const
|
|
387
|
-
return
|
|
386
|
+
const b = e.getSnapshot().views.get(p);
|
|
387
|
+
return b ? /* @__PURE__ */ w.jsx(et, { nodeId: b.id, context: g }) : null;
|
|
388
388
|
},
|
|
389
389
|
dispatchAction: c,
|
|
390
390
|
// Access client/video via refs to avoid context recreation
|
|
@@ -398,8 +398,8 @@ const Zn = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
398
398
|
return g;
|
|
399
399
|
}, [e, n, c]);
|
|
400
400
|
return !l || !d ? o : /* @__PURE__ */ w.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ w.jsx(et, { nodeId: d, context: u }) });
|
|
401
|
-
},
|
|
402
|
-
class
|
|
401
|
+
}, Qn);
|
|
402
|
+
class tr {
|
|
403
403
|
constructor(e, n) {
|
|
404
404
|
if (this.fallback = n, e)
|
|
405
405
|
for (const [r, o] of e)
|
|
@@ -416,19 +416,19 @@ class Qn {
|
|
|
416
416
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Hs(t, e) {
|
|
420
420
|
const n = Object.entries(t);
|
|
421
|
-
return new
|
|
421
|
+
return new tr(n, e);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function qs(t) {
|
|
424
424
|
return at(
|
|
425
425
|
(e) => t.subscribe(e),
|
|
426
426
|
() => t.getSnapshot(),
|
|
427
427
|
() => t.getSnapshot()
|
|
428
428
|
);
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
const t =
|
|
430
|
+
function nr() {
|
|
431
|
+
const t = Nn();
|
|
432
432
|
return C(() => {
|
|
433
433
|
if (!t)
|
|
434
434
|
return;
|
|
@@ -532,10 +532,10 @@ function er() {
|
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
if (c.data?.type === "ikon-inspect-rect") {
|
|
535
|
-
const { x1: u, y1: g, x2: p, y2:
|
|
535
|
+
const { x1: u, y1: g, x2: p, y2: b, append: S } = c.data, R = document.querySelectorAll("[data-ikon-source]"), v = [];
|
|
536
536
|
for (const T of Array.from(R)) {
|
|
537
537
|
const U = T.getBoundingClientRect();
|
|
538
|
-
U.right > u && U.left < p && U.bottom > g && U.top <
|
|
538
|
+
U.right > u && U.left < p && U.bottom > g && U.top < b && v.push({
|
|
539
539
|
sourceMarker: T.getAttribute("data-ikon-source") ?? "",
|
|
540
540
|
tagName: T.tagName.toLowerCase(),
|
|
541
541
|
textContent: (T.textContent ?? "").trim().substring(0, 200)
|
|
@@ -543,7 +543,7 @@ function er() {
|
|
|
543
543
|
}
|
|
544
544
|
v.length > 0 && window.parent.postMessage({
|
|
545
545
|
type: "ikon-inspect-rect-result",
|
|
546
|
-
payload: { elements: v, append:
|
|
546
|
+
payload: { elements: v, append: S ?? !1 }
|
|
547
547
|
}, "*");
|
|
548
548
|
}
|
|
549
549
|
c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
|
|
@@ -553,8 +553,8 @@ function er() {
|
|
|
553
553
|
};
|
|
554
554
|
}, [t]), null;
|
|
555
555
|
}
|
|
556
|
-
const
|
|
557
|
-
function
|
|
556
|
+
const rr = oe("IkonUiSurface"), tt = "ikon-ui";
|
|
557
|
+
function or(t, e) {
|
|
558
558
|
return t === e;
|
|
559
559
|
}
|
|
560
560
|
const Gt = Y(function({ stores: e, registry: n, category: r = tt, onAction: o, client: s }) {
|
|
@@ -567,7 +567,7 @@ const Gt = Y(function({ stores: e, registry: n, category: r = tt, onAction: o, c
|
|
|
567
567
|
const m = [];
|
|
568
568
|
for (const [c, u] of e) {
|
|
569
569
|
const g = u.store.getSnapshot();
|
|
570
|
-
|
|
570
|
+
or(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,13 +575,13 @@ const Gt = Y(function({ stores: e, registry: n, category: r = tt, onAction: o, c
|
|
|
575
575
|
[e, r, i]
|
|
576
576
|
), h = E(!1), y = d.length > 0;
|
|
577
577
|
return C(() => {
|
|
578
|
-
y && !h.current && (h.current = !0,
|
|
578
|
+
y && !h.current && (h.current = !0, rr.debug("First UI render"));
|
|
579
579
|
}, [y]), y ? /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
580
|
-
/* @__PURE__ */ w.jsx(
|
|
581
|
-
d.map(({ key: m, store: c }) => /* @__PURE__ */ w.jsx(
|
|
580
|
+
/* @__PURE__ */ w.jsx(nr, {}),
|
|
581
|
+
d.map(({ key: m, store: c }) => /* @__PURE__ */ w.jsx(er, { 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 sr {
|
|
585
585
|
core;
|
|
586
586
|
ownsCore;
|
|
587
587
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -589,7 +589,7 @@ class rr {
|
|
|
589
589
|
unsubscribeClears;
|
|
590
590
|
unsubscribeStoreChanges;
|
|
591
591
|
constructor(e) {
|
|
592
|
-
this.core = e?.core ?? new
|
|
592
|
+
this.core = e?.core ?? new Tn({ client: e?.client, liveSnapshot: e?.liveSnapshot, bootSnapshot: e?.bootSnapshot }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
593
593
|
}
|
|
594
594
|
dispose() {
|
|
595
595
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -646,7 +646,7 @@ class rr {
|
|
|
646
646
|
return n;
|
|
647
647
|
const r = {
|
|
648
648
|
category: tt,
|
|
649
|
-
store: new
|
|
649
|
+
store: new kn()
|
|
650
650
|
};
|
|
651
651
|
return this.stores.set(e, r), r;
|
|
652
652
|
}
|
|
@@ -662,7 +662,7 @@ class rr {
|
|
|
662
662
|
n(e);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function ir(t) {
|
|
666
666
|
if (typeof t == "string") {
|
|
667
667
|
const e = t.trim();
|
|
668
668
|
return e.length > 0 ? e : void 0;
|
|
@@ -687,10 +687,10 @@ function lt(...t) {
|
|
|
687
687
|
}
|
|
688
688
|
return e || void 0;
|
|
689
689
|
}
|
|
690
|
-
const Et = /* @__PURE__ */ new WeakMap(),
|
|
690
|
+
const Et = /* @__PURE__ */ new WeakMap(), ar = {};
|
|
691
691
|
function ut(t) {
|
|
692
692
|
if (!t)
|
|
693
|
-
return
|
|
693
|
+
return ar;
|
|
694
694
|
const e = Et.get(t);
|
|
695
695
|
if (e)
|
|
696
696
|
return e;
|
|
@@ -699,7 +699,7 @@ function ut(t) {
|
|
|
699
699
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
700
700
|
return Et.set(t, n), n;
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function cr(t) {
|
|
703
703
|
let e = t.parentElement;
|
|
704
704
|
for (; e; ) {
|
|
705
705
|
const r = window.getComputedStyle(e).overflowY;
|
|
@@ -716,20 +716,20 @@ function zt(t, e) {
|
|
|
716
716
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
|
|
717
717
|
});
|
|
718
718
|
}
|
|
719
|
-
const nt = "data-ikon-scroll-indicator",
|
|
719
|
+
const nt = "data-ikon-scroll-indicator", lr = 0.15, xe = "data-ikon-at-bottom";
|
|
720
720
|
function Xt(t) {
|
|
721
|
-
return Math.max(t.clientHeight *
|
|
721
|
+
return Math.max(t.clientHeight * lr, 20);
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function ur(t) {
|
|
724
724
|
return t.getAttribute(xe) !== "false";
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function dr(t) {
|
|
727
727
|
t.getAttribute(xe) === null && (t.setAttribute(xe, "true"), t.addEventListener("scroll", () => {
|
|
728
728
|
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Xt(t);
|
|
729
729
|
t.setAttribute(xe, s ? "true" : "false");
|
|
730
730
|
}, { passive: !0 }));
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function fr(t) {
|
|
733
733
|
const e = t.parentElement ?? t, n = e.querySelector(`[${nt}]`);
|
|
734
734
|
if (n)
|
|
735
735
|
return n;
|
|
@@ -762,8 +762,8 @@ function ur(t) {
|
|
|
762
762
|
r.style.opacity = "0.9";
|
|
763
763
|
}), e.appendChild(r), r;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
const n =
|
|
765
|
+
function hr(t, e) {
|
|
766
|
+
const n = fr(t);
|
|
767
767
|
n.style.display = "flex";
|
|
768
768
|
const r = () => {
|
|
769
769
|
zt(t, e), n.style.display = "none";
|
|
@@ -775,7 +775,7 @@ function dr(t, e) {
|
|
|
775
775
|
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function pr() {
|
|
779
779
|
const t = Y(function({ nodeId: n, context: r }) {
|
|
780
780
|
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, d = de(o?.props?.priority), h = de(o?.props?.key), y = o?.props?.preciseGeneratedAt;
|
|
781
781
|
return C(() => {
|
|
@@ -786,13 +786,13 @@ function fr() {
|
|
|
786
786
|
return;
|
|
787
787
|
let u;
|
|
788
788
|
if (l !== !0) {
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
791
|
-
if (
|
|
792
|
-
u =
|
|
789
|
+
const S = cr(c);
|
|
790
|
+
if (S)
|
|
791
|
+
if (dr(S), d === "Polite" && !ur(S))
|
|
792
|
+
u = hr(S, c);
|
|
793
793
|
else {
|
|
794
|
-
const U = (
|
|
795
|
-
U && (U.style.display = "none"), zt(
|
|
794
|
+
const U = (S.parentElement ?? S).querySelector(`[${nt}]`);
|
|
795
|
+
U && (U.style.display = "none"), zt(S, c);
|
|
796
796
|
}
|
|
797
797
|
else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
798
798
|
const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > v * Yt ? "auto" : "smooth";
|
|
@@ -828,9 +828,9 @@ function fr() {
|
|
|
828
828
|
return t;
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function mr() {
|
|
832
832
|
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
833
|
-
const s = Z(r.store, n), i =
|
|
833
|
+
const s = Z(r.store, n), i = ir(s?.props?.onInvokeId), a = D(() => {
|
|
834
834
|
i && r.dispatchAction(i);
|
|
835
835
|
}, [i, r]);
|
|
836
836
|
if (!s)
|
|
@@ -856,7 +856,7 @@ function hr() {
|
|
|
856
856
|
return t;
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function gr() {
|
|
860
860
|
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
861
861
|
const s = Z(r.store, n);
|
|
862
862
|
if (!s)
|
|
@@ -869,7 +869,7 @@ function pr() {
|
|
|
869
869
|
return t;
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function yr() {
|
|
873
873
|
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
874
874
|
const s = Z(r.store, n);
|
|
875
875
|
if (!s)
|
|
@@ -882,19 +882,19 @@ function mr() {
|
|
|
882
882
|
return t;
|
|
883
883
|
};
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function br() {
|
|
886
886
|
return [
|
|
887
|
-
hr(),
|
|
888
|
-
pr(),
|
|
889
887
|
mr(),
|
|
890
|
-
|
|
888
|
+
gr(),
|
|
889
|
+
yr(),
|
|
890
|
+
pr()
|
|
891
891
|
];
|
|
892
892
|
}
|
|
893
|
-
const
|
|
894
|
-
function
|
|
895
|
-
t.registerModule(
|
|
893
|
+
const Sr = "base", wr = async () => br();
|
|
894
|
+
function vr(t) {
|
|
895
|
+
t.registerModule(Sr, wr);
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Er(t) {
|
|
898
898
|
if (typeof t == "string") {
|
|
899
899
|
const e = t.trim();
|
|
900
900
|
return e.length > 0 ? e : void 0;
|
|
@@ -904,7 +904,7 @@ function wr(t) {
|
|
|
904
904
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function Rr(...t) {
|
|
908
908
|
const e = [];
|
|
909
909
|
for (const n of t)
|
|
910
910
|
n && n.trim() && e.push(n.trim());
|
|
@@ -925,8 +925,8 @@ function _e(t) {
|
|
|
925
925
|
if (e === "false") return !1;
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
|
-
const
|
|
929
|
-
function
|
|
928
|
+
const Ar = "std.audio-url-player";
|
|
929
|
+
function Tr() {
|
|
930
930
|
const t = Y(function({
|
|
931
931
|
nodeId: n,
|
|
932
932
|
context: r,
|
|
@@ -938,7 +938,7 @@ function Rr() {
|
|
|
938
938
|
});
|
|
939
939
|
}, [a, l]), !s)
|
|
940
940
|
return null;
|
|
941
|
-
const d =
|
|
941
|
+
const d = Rr(Er(s.props?.className), o), h = Rt(s.props?.preload), y = _e(s.props?.controls), m = _e(s.props?.loop), c = _e(s.props?.muted);
|
|
942
942
|
return /* @__PURE__ */ w.jsx(
|
|
943
943
|
"audio",
|
|
944
944
|
{
|
|
@@ -956,7 +956,7 @@ function Rr() {
|
|
|
956
956
|
);
|
|
957
957
|
});
|
|
958
958
|
return ({ type: e }) => {
|
|
959
|
-
if (e ===
|
|
959
|
+
if (e === Ar)
|
|
960
960
|
return t;
|
|
961
961
|
};
|
|
962
962
|
}
|
|
@@ -976,7 +976,7 @@ function qt(...t) {
|
|
|
976
976
|
n && n.trim() && e.push(n.trim());
|
|
977
977
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function Le(t) {
|
|
980
980
|
if (typeof t == "number" && Number.isFinite(t))
|
|
981
981
|
return Math.floor(t);
|
|
982
982
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -991,15 +991,15 @@ function rt(t) {
|
|
|
991
991
|
const e = t.trim();
|
|
992
992
|
return e.length > 0 ? e : void 0;
|
|
993
993
|
}
|
|
994
|
-
const
|
|
995
|
-
function
|
|
994
|
+
const kr = "std.video-canvas", Cr = "std.video-url-player";
|
|
995
|
+
function Ir() {
|
|
996
996
|
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
997
|
-
const s = Z(r.store, n), i = E(null), a = E(null), l = r.video, d = r.client, h = s ? rt(s.props?.streamId) : void 0, y = s ?
|
|
997
|
+
const s = Z(r.store, n), i = E(null), a = E(null), l = r.video, d = r.client, h = s ? rt(s.props?.streamId) : void 0, y = s ? Le(s.props?.width) : void 0, m = s ? Le(s.props?.height) : void 0, c = s ? qt(Ht(s.props?.className), o) : o, [, u] = N(0);
|
|
998
998
|
C(() => {
|
|
999
999
|
if (!d?.isWebRtcEnabled) return;
|
|
1000
1000
|
const p = d.onWebRtcTrackMapChanged;
|
|
1001
|
-
return d.onWebRtcTrackMapChanged = (
|
|
1002
|
-
p?.(
|
|
1001
|
+
return d.onWebRtcTrackMapChanged = (b) => {
|
|
1002
|
+
p?.(b), b.kind === "video" && u((S) => S + 1);
|
|
1003
1003
|
}, () => {
|
|
1004
1004
|
d.onWebRtcTrackMapChanged = p;
|
|
1005
1005
|
};
|
|
@@ -1047,14 +1047,14 @@ function kr() {
|
|
|
1047
1047
|
) : null;
|
|
1048
1048
|
});
|
|
1049
1049
|
return ({ type: e }) => {
|
|
1050
|
-
if (e ===
|
|
1050
|
+
if (e === kr)
|
|
1051
1051
|
return t;
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return [
|
|
1054
|
+
function _r() {
|
|
1055
|
+
return [Ir(), Or(), Tr()];
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function be(t) {
|
|
1058
1058
|
if (typeof t == "boolean")
|
|
1059
1059
|
return t;
|
|
1060
1060
|
if (typeof t == "string") {
|
|
@@ -1063,19 +1063,19 @@ function ye(t) {
|
|
|
1063
1063
|
if (e === "false") return !1;
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function Or() {
|
|
1067
1067
|
const t = Y(function({
|
|
1068
1068
|
nodeId: n,
|
|
1069
1069
|
context: r,
|
|
1070
1070
|
className: o
|
|
1071
1071
|
}) {
|
|
1072
|
-
const s = Z(r.store, n), i = E(null), a = s ?
|
|
1072
|
+
const s = Z(r.store, n), i = E(null), a = s ? be(s.props?.autoplay) : void 0, l = s ? rt(s.props?.src) : void 0;
|
|
1073
1073
|
if (C(() => {
|
|
1074
1074
|
a && i.current && i.current.play().catch(() => {
|
|
1075
1075
|
});
|
|
1076
1076
|
}, [a, l]), !s)
|
|
1077
1077
|
return null;
|
|
1078
|
-
const d = qt(Ht(s.props?.className), o), h = rt(s.props?.poster), y =
|
|
1078
|
+
const d = qt(Ht(s.props?.className), o), h = rt(s.props?.poster), y = be(s.props?.controls), m = be(s.props?.loop), c = be(s.props?.muted), u = be(s.props?.playsInline), g = Le(s.props?.width), p = Le(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
1079
1079
|
return /* @__PURE__ */ w.jsx(
|
|
1080
1080
|
"video",
|
|
1081
1081
|
{
|
|
@@ -1092,32 +1092,32 @@ function Ir() {
|
|
|
1092
1092
|
"data-ikon-node-id": s.id,
|
|
1093
1093
|
"data-ikon-source": s.sourceMarker,
|
|
1094
1094
|
className: d,
|
|
1095
|
-
children:
|
|
1095
|
+
children: b
|
|
1096
1096
|
}
|
|
1097
1097
|
);
|
|
1098
1098
|
});
|
|
1099
1099
|
return ({ type: e }) => {
|
|
1100
|
-
if (e ===
|
|
1100
|
+
if (e === Cr)
|
|
1101
1101
|
return t;
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
|
-
const
|
|
1105
|
-
function
|
|
1106
|
-
t.registerModule(
|
|
1104
|
+
const Nr = "media", xr = async () => _r();
|
|
1105
|
+
function Lr(t) {
|
|
1106
|
+
t.registerModule(Nr, xr);
|
|
1107
1107
|
}
|
|
1108
|
-
const
|
|
1108
|
+
const Pr = `#version 300 es
|
|
1109
1109
|
in vec4 a_position;
|
|
1110
1110
|
void main() {
|
|
1111
1111
|
gl_Position = a_position;
|
|
1112
1112
|
}
|
|
1113
|
-
`,
|
|
1114
|
-
function
|
|
1113
|
+
`, le = 4;
|
|
1114
|
+
function Ur(t, e) {
|
|
1115
1115
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Mr(t, e) {
|
|
1118
1118
|
const n = [];
|
|
1119
1119
|
for (const [r, o] of Object.entries(e)) {
|
|
1120
|
-
if (
|
|
1120
|
+
if (Ur(t, r))
|
|
1121
1121
|
continue;
|
|
1122
1122
|
let s;
|
|
1123
1123
|
switch (o.type) {
|
|
@@ -1178,7 +1178,7 @@ void main() {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
`;
|
|
1180
1180
|
}
|
|
1181
|
-
class
|
|
1181
|
+
class jr {
|
|
1182
1182
|
gl;
|
|
1183
1183
|
program = null;
|
|
1184
1184
|
positionBuffer = null;
|
|
@@ -1193,8 +1193,8 @@ class Ur {
|
|
|
1193
1193
|
mouseClickX = 0;
|
|
1194
1194
|
mouseClickY = 0;
|
|
1195
1195
|
channels = [];
|
|
1196
|
-
channelResolution = new Float32Array(
|
|
1197
|
-
channelTime = new Float32Array(
|
|
1196
|
+
channelResolution = new Float32Array(le * 3);
|
|
1197
|
+
channelTime = new Float32Array(le);
|
|
1198
1198
|
lastError = null;
|
|
1199
1199
|
currentShaderSource = "";
|
|
1200
1200
|
constructor(e) {
|
|
@@ -1217,7 +1217,7 @@ class Ur {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
initializeChannels() {
|
|
1219
1219
|
const e = this.gl;
|
|
1220
|
-
for (let n = 0; n <
|
|
1220
|
+
for (let n = 0; n < le; n++) {
|
|
1221
1221
|
const r = e.createTexture();
|
|
1222
1222
|
e.bindTexture(e.TEXTURE_2D, r), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, new Uint8Array([0, 0, 0, 255])), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), this.channels.push({ texture: r, width: 0, height: 0, url: null });
|
|
1223
1223
|
}
|
|
@@ -1227,7 +1227,7 @@ class Ur {
|
|
|
1227
1227
|
// settings (vflip on, repeat wrap, mipmap filtering) so copy-pasted ShaderToy texture shaders render
|
|
1228
1228
|
// the same way. Only channels whose URL changed are reloaded.
|
|
1229
1229
|
setChannels(e) {
|
|
1230
|
-
for (let n = 0; n <
|
|
1230
|
+
for (let n = 0; n < le; n++) {
|
|
1231
1231
|
const r = e[n] ?? null, o = this.channels[n];
|
|
1232
1232
|
if (o.url !== r) {
|
|
1233
1233
|
if (o.url = r, !r) {
|
|
@@ -1253,10 +1253,10 @@ class Ur {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
compile(e, n = {}) {
|
|
1255
1255
|
this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
|
|
1256
|
-
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER,
|
|
1256
|
+
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Pr);
|
|
1257
1257
|
if (!o)
|
|
1258
1258
|
return !1;
|
|
1259
|
-
const s =
|
|
1259
|
+
const s = Mr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
|
|
1260
1260
|
if (!i)
|
|
1261
1261
|
return r.deleteShader(o), !1;
|
|
1262
1262
|
const a = r.createProgram();
|
|
@@ -1276,7 +1276,7 @@ class Ur {
|
|
|
1276
1276
|
const n = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
|
|
1277
1277
|
for (const r of n)
|
|
1278
1278
|
this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
|
|
1279
|
-
for (let r = 0; r <
|
|
1279
|
+
for (let r = 0; r < le; r++)
|
|
1280
1280
|
this.uniformLocations.set(`iChannel${r}`, e.getUniformLocation(this.program, `iChannel${r}`));
|
|
1281
1281
|
this.uniformLocations.set("iChannelResolution", e.getUniformLocation(this.program, "iChannelResolution[0]")), this.uniformLocations.set("iChannelTime", e.getUniformLocation(this.program, "iChannelTime[0]"));
|
|
1282
1282
|
for (const r of Object.keys(this.customUniforms))
|
|
@@ -1307,45 +1307,45 @@ class Ur {
|
|
|
1307
1307
|
c && e.uniform4f(c, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1308
1308
|
const u = this.uniformLocations.get("iDate");
|
|
1309
1309
|
if (u) {
|
|
1310
|
-
const
|
|
1311
|
-
e.uniform4f(u,
|
|
1310
|
+
const b = /* @__PURE__ */ new Date();
|
|
1311
|
+
e.uniform4f(u, b.getFullYear(), b.getMonth(), b.getDate(), b.getHours() * 3600 + b.getMinutes() * 60 + b.getSeconds() + b.getMilliseconds() / 1e3);
|
|
1312
1312
|
}
|
|
1313
|
-
for (let
|
|
1314
|
-
e.activeTexture(e.TEXTURE0 +
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1313
|
+
for (let b = 0; b < le; b++) {
|
|
1314
|
+
e.activeTexture(e.TEXTURE0 + b), e.bindTexture(e.TEXTURE_2D, this.channels[b].texture);
|
|
1315
|
+
const S = this.uniformLocations.get(`iChannel${b}`);
|
|
1316
|
+
S && e.uniform1i(S, b);
|
|
1317
1317
|
}
|
|
1318
1318
|
const g = this.uniformLocations.get("iChannelResolution");
|
|
1319
1319
|
g && e.uniform3fv(g, this.channelResolution);
|
|
1320
1320
|
const p = this.uniformLocations.get("iChannelTime");
|
|
1321
1321
|
p && e.uniform1fv(p, this.channelTime);
|
|
1322
|
-
for (const [
|
|
1323
|
-
const R = this.uniformLocations.get(
|
|
1322
|
+
for (const [b, S] of Object.entries(this.customUniforms)) {
|
|
1323
|
+
const R = this.uniformLocations.get(b);
|
|
1324
1324
|
if (R)
|
|
1325
|
-
switch (
|
|
1325
|
+
switch (S.type) {
|
|
1326
1326
|
case "float":
|
|
1327
|
-
e.uniform1f(R,
|
|
1327
|
+
e.uniform1f(R, S.value);
|
|
1328
1328
|
break;
|
|
1329
1329
|
case "vec2": {
|
|
1330
|
-
const v =
|
|
1330
|
+
const v = S.value;
|
|
1331
1331
|
e.uniform2f(R, v[0], v[1]);
|
|
1332
1332
|
break;
|
|
1333
1333
|
}
|
|
1334
1334
|
case "vec3": {
|
|
1335
|
-
const v =
|
|
1335
|
+
const v = S.value;
|
|
1336
1336
|
e.uniform3f(R, v[0], v[1], v[2]);
|
|
1337
1337
|
break;
|
|
1338
1338
|
}
|
|
1339
1339
|
case "vec4": {
|
|
1340
|
-
const v =
|
|
1340
|
+
const v = S.value;
|
|
1341
1341
|
e.uniform4f(R, v[0], v[1], v[2], v[3]);
|
|
1342
1342
|
break;
|
|
1343
1343
|
}
|
|
1344
1344
|
case "int":
|
|
1345
|
-
e.uniform1i(R,
|
|
1345
|
+
e.uniform1i(R, S.value);
|
|
1346
1346
|
break;
|
|
1347
1347
|
case "bool":
|
|
1348
|
-
e.uniform1i(R,
|
|
1348
|
+
e.uniform1i(R, S.value ? 1 : 0);
|
|
1349
1349
|
break;
|
|
1350
1350
|
}
|
|
1351
1351
|
}
|
|
@@ -1362,7 +1362,7 @@ class Ur {
|
|
|
1362
1362
|
this.channels = [], this.uniformLocations.clear();
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1365
|
+
function Dr(t) {
|
|
1366
1366
|
if (typeof t == "string") {
|
|
1367
1367
|
const e = t.trim();
|
|
1368
1368
|
return e.length > 0 ? e : void 0;
|
|
@@ -1372,7 +1372,7 @@ function Mr(t) {
|
|
|
1372
1372
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1373
1373
|
}
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1375
|
+
function $r(...t) {
|
|
1376
1376
|
const e = [];
|
|
1377
1377
|
for (const n of t)
|
|
1378
1378
|
n && n.trim() && e.push(n.trim());
|
|
@@ -1387,10 +1387,10 @@ function Ye(t) {
|
|
|
1387
1387
|
return Math.floor(e);
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Br(t) {
|
|
1391
1391
|
return typeof t == "string" ? t : "";
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1393
|
+
function Fr(t) {
|
|
1394
1394
|
if (typeof t == "boolean")
|
|
1395
1395
|
return t;
|
|
1396
1396
|
if (typeof t == "string") {
|
|
@@ -1399,7 +1399,7 @@ function $r(t) {
|
|
|
1399
1399
|
if (e === "false") return !1;
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1402
|
+
function Vr(t) {
|
|
1403
1403
|
if (!t || typeof t != "object")
|
|
1404
1404
|
return {};
|
|
1405
1405
|
const e = {}, n = t;
|
|
@@ -1414,10 +1414,10 @@ function Br(t) {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
return e;
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function Wr(t) {
|
|
1418
1418
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1420
|
+
function Kr(t, e) {
|
|
1421
1421
|
const n = Object.keys(t), r = Object.keys(e);
|
|
1422
1422
|
if (n.length !== r.length)
|
|
1423
1423
|
return !1;
|
|
@@ -1438,8 +1438,8 @@ function Vr(t, e) {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
return !0;
|
|
1440
1440
|
}
|
|
1441
|
-
const
|
|
1442
|
-
function
|
|
1441
|
+
const Gr = "std.shadertoy-canvas";
|
|
1442
|
+
function Yr() {
|
|
1443
1443
|
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
1444
1444
|
const s = Z(r.store, n), i = E(null), a = E(null), l = E(null), d = E(0), h = E(""), y = E({}), m = E({
|
|
1445
1445
|
x: 0,
|
|
@@ -1447,15 +1447,15 @@ function Kr() {
|
|
|
1447
1447
|
clickX: 0,
|
|
1448
1448
|
clickY: 0,
|
|
1449
1449
|
isDown: !1
|
|
1450
|
-
}), c = s ?
|
|
1450
|
+
}), c = s ? Br(s.props?.shaderSource) : "", u = s ? Ye(s.props?.fps) ?? 60 : 60, g = s?.props?.uniforms, p = W(() => Vr(g), [g]), b = s?.props?.channels, S = W(() => Wr(b), [b]), R = s ? Fr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ye(s.props?.width) : void 0, T = s ? Ye(s.props?.height) : void 0, U = s ? $r(Dr(s.props?.className), o) : o;
|
|
1451
1451
|
C(() => {
|
|
1452
1452
|
const _ = i.current;
|
|
1453
1453
|
if (_) {
|
|
1454
1454
|
try {
|
|
1455
|
-
const
|
|
1456
|
-
a.current =
|
|
1457
|
-
} catch (
|
|
1458
|
-
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:",
|
|
1455
|
+
const P = new jr(_);
|
|
1456
|
+
a.current = P;
|
|
1457
|
+
} catch (P) {
|
|
1458
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
1459
1459
|
}
|
|
1460
1460
|
return () => {
|
|
1461
1461
|
a.current && (a.current.destroy(), a.current = null);
|
|
@@ -1472,16 +1472,16 @@ function Kr() {
|
|
|
1472
1472
|
}
|
|
1473
1473
|
}, [c, p]), C(() => {
|
|
1474
1474
|
const _ = a.current;
|
|
1475
|
-
!_ || !h.current ||
|
|
1475
|
+
!_ || !h.current || Kr(y.current, p) || (_.setCustomUniforms(p), y.current = p);
|
|
1476
1476
|
}, [p]), C(() => {
|
|
1477
1477
|
const _ = a.current;
|
|
1478
|
-
_ && _.setChannels(
|
|
1479
|
-
}, [
|
|
1478
|
+
_ && _.setChannels(S);
|
|
1479
|
+
}, [S]), C(() => {
|
|
1480
1480
|
const _ = a.current;
|
|
1481
1481
|
if (!_ || !h.current) return;
|
|
1482
|
-
const
|
|
1482
|
+
const P = 1e3 / u, M = (B) => {
|
|
1483
1483
|
const $ = B - d.current;
|
|
1484
|
-
$ >=
|
|
1484
|
+
$ >= P && (d.current = B - $ % P, _.draw()), l.current = requestAnimationFrame(M);
|
|
1485
1485
|
};
|
|
1486
1486
|
return l.current = requestAnimationFrame(M), () => {
|
|
1487
1487
|
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
@@ -1490,18 +1490,18 @@ function Kr() {
|
|
|
1490
1490
|
const ee = D(
|
|
1491
1491
|
(_) => {
|
|
1492
1492
|
if (!R) return;
|
|
1493
|
-
const
|
|
1494
|
-
if (!
|
|
1495
|
-
const B = window.devicePixelRatio || 1, $ =
|
|
1493
|
+
const P = i.current, M = a.current;
|
|
1494
|
+
if (!P || !M) return;
|
|
1495
|
+
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (_.clientX - $.left) * B, K = ($.height - (_.clientY - $.top)) * B;
|
|
1496
1496
|
m.current.x = V, m.current.y = K, M.setMouse(V, K, m.current.clickX, m.current.clickY);
|
|
1497
1497
|
},
|
|
1498
1498
|
[R]
|
|
1499
1499
|
), te = D(
|
|
1500
1500
|
(_) => {
|
|
1501
1501
|
if (!R) return;
|
|
1502
|
-
const
|
|
1503
|
-
if (!
|
|
1504
|
-
const B = window.devicePixelRatio || 1, $ =
|
|
1502
|
+
const P = i.current, M = a.current;
|
|
1503
|
+
if (!P || !M) return;
|
|
1504
|
+
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (_.clientX - $.left) * B, K = ($.height - (_.clientY - $.top)) * B;
|
|
1505
1505
|
m.current.isDown = !0, m.current.clickX = V, m.current.clickY = K, M.setMouse(V, K, V, K);
|
|
1506
1506
|
},
|
|
1507
1507
|
[R]
|
|
@@ -1525,16 +1525,16 @@ function Kr() {
|
|
|
1525
1525
|
) : null;
|
|
1526
1526
|
});
|
|
1527
1527
|
return ({ type: e }) => {
|
|
1528
|
-
if (e ===
|
|
1528
|
+
if (e === Gr)
|
|
1529
1529
|
return t;
|
|
1530
1530
|
};
|
|
1531
1531
|
}
|
|
1532
|
-
const
|
|
1533
|
-
function
|
|
1534
|
-
t.registerModule(
|
|
1532
|
+
const zr = "shadertoy", Xr = async () => Yr();
|
|
1533
|
+
function Hr(t) {
|
|
1534
|
+
t.registerModule(zr, Xr);
|
|
1535
1535
|
}
|
|
1536
|
-
const At =
|
|
1537
|
-
class
|
|
1536
|
+
const At = oe("UIRegistry");
|
|
1537
|
+
class qr {
|
|
1538
1538
|
baseResolvers = [];
|
|
1539
1539
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1540
1540
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1556,7 +1556,7 @@ class Xr {
|
|
|
1556
1556
|
for (const [r, o] of this.moduleLoaders.entries())
|
|
1557
1557
|
if (!this.moduleResolvers.has(r))
|
|
1558
1558
|
try {
|
|
1559
|
-
const s = await o(), i =
|
|
1559
|
+
const s = await o(), i = Qr(s);
|
|
1560
1560
|
this.moduleResolvers.set(r, i), e = !0;
|
|
1561
1561
|
} catch (s) {
|
|
1562
1562
|
At.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
@@ -1564,7 +1564,7 @@ class Xr {
|
|
|
1564
1564
|
const n = [];
|
|
1565
1565
|
for (const r of this.moduleLoaders.keys())
|
|
1566
1566
|
this.moduleResolvers.has(r) && n.push(r);
|
|
1567
|
-
return
|
|
1567
|
+
return eo(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
|
|
1568
1568
|
}
|
|
1569
1569
|
resolve(e) {
|
|
1570
1570
|
for (const n of this.baseResolvers) {
|
|
@@ -1584,17 +1584,17 @@ class Xr {
|
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1588
|
-
const t = new
|
|
1589
|
-
return
|
|
1587
|
+
function Jr() {
|
|
1588
|
+
const t = new qr();
|
|
1589
|
+
return vr(t), Lr(t), Hr(t), t.loadRegisteredModules(), t;
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function Zr(t) {
|
|
1592
1592
|
return Array.isArray(t) ? t : [t];
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1595
|
-
return t ?
|
|
1594
|
+
function Qr(t) {
|
|
1595
|
+
return t ? Zr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1597
|
+
function eo(t, e) {
|
|
1598
1598
|
if (t.length !== e.length)
|
|
1599
1599
|
return !1;
|
|
1600
1600
|
for (let n = 0; n < t.length; n += 1)
|
|
@@ -1602,7 +1602,7 @@ function Zr(t, e) {
|
|
|
1602
1602
|
return !1;
|
|
1603
1603
|
return !0;
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function Js({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
1606
1606
|
return /* @__PURE__ */ w.jsx(
|
|
1607
1607
|
Gt,
|
|
1608
1608
|
{
|
|
@@ -1614,7 +1614,7 @@ function Xs({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
);
|
|
1616
1616
|
}
|
|
1617
|
-
const ze =
|
|
1617
|
+
const ze = oe("MotionController"), Tt = {
|
|
1618
1618
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1619
1619
|
"ease-in": [0.42, 0, 1, 1],
|
|
1620
1620
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1659,50 +1659,50 @@ function Ct(t) {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
function It(t, e, n, r) {
|
|
1661
1661
|
const h = new Float32Array(11);
|
|
1662
|
-
function y(p,
|
|
1663
|
-
return ((3 *
|
|
1662
|
+
function y(p, b, S) {
|
|
1663
|
+
return ((3 * b - 3 * S + 1) * p + (3 * S - 6 * b)) * p * p + 3 * b * p;
|
|
1664
1664
|
}
|
|
1665
|
-
function m(p,
|
|
1666
|
-
return 3 * (3 *
|
|
1665
|
+
function m(p, b, S) {
|
|
1666
|
+
return 3 * (3 * b - 3 * S + 1) * p * p + 2 * (3 * S - 6 * b) * p + 3 * b;
|
|
1667
1667
|
}
|
|
1668
|
-
function c(p,
|
|
1669
|
-
for (let
|
|
1670
|
-
const R = m(
|
|
1668
|
+
function c(p, b) {
|
|
1669
|
+
for (let S = 0; S < 4; S += 1) {
|
|
1670
|
+
const R = m(b, t, n);
|
|
1671
1671
|
if (R === 0)
|
|
1672
|
-
return
|
|
1673
|
-
const v = y(
|
|
1674
|
-
|
|
1672
|
+
return b;
|
|
1673
|
+
const v = y(b, t, n) - p;
|
|
1674
|
+
b -= v / R;
|
|
1675
1675
|
}
|
|
1676
|
-
return
|
|
1676
|
+
return b;
|
|
1677
1677
|
}
|
|
1678
|
-
function u(p,
|
|
1678
|
+
function u(p, b, S) {
|
|
1679
1679
|
let R = 0, v = 0, T = 0;
|
|
1680
1680
|
do
|
|
1681
|
-
v =
|
|
1681
|
+
v = b + (S - b) / 2, R = y(v, t, n) - p, R > 0 ? S = v : b = v;
|
|
1682
1682
|
while (Math.abs(R) > 1e-7 && ++T < 10);
|
|
1683
1683
|
return v;
|
|
1684
1684
|
}
|
|
1685
1685
|
function g(p) {
|
|
1686
|
-
let
|
|
1686
|
+
let b = 0, S = 1;
|
|
1687
1687
|
const R = 10;
|
|
1688
|
-
for (;
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
const v = (p - h[
|
|
1692
|
-
return U >= 1e-3 ? c(p, T) : U === 0 ? T : u(p,
|
|
1688
|
+
for (; S !== R && h[S] <= p; S += 1)
|
|
1689
|
+
b += 0.1;
|
|
1690
|
+
S -= 1;
|
|
1691
|
+
const v = (p - h[S]) / (h[S + 1] - h[S]), T = b + v * 0.1, U = m(T, t, n);
|
|
1692
|
+
return U >= 1e-3 ? c(p, T) : U === 0 ? T : u(p, b, b + 0.1);
|
|
1693
1693
|
}
|
|
1694
1694
|
for (let p = 0; p < 11; p += 1)
|
|
1695
1695
|
h[p] = y(p * 0.1, t, n);
|
|
1696
1696
|
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : y(g(p), e, r);
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1698
|
+
function to(t) {
|
|
1699
1699
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1700
1700
|
if (!e)
|
|
1701
1701
|
return (o) => F(o);
|
|
1702
1702
|
const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
|
|
1703
1703
|
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
1704
|
}
|
|
1705
|
-
function
|
|
1705
|
+
function no(t) {
|
|
1706
1706
|
if (!t)
|
|
1707
1707
|
return (n) => F(n);
|
|
1708
1708
|
const e = t.trim().toLowerCase();
|
|
@@ -1720,12 +1720,12 @@ function eo(t) {
|
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1723
|
-
const n =
|
|
1723
|
+
const n = to(e);
|
|
1724
1724
|
return (r) => n(F(r));
|
|
1725
1725
|
}
|
|
1726
1726
|
return (n) => F(n);
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function ro(t) {
|
|
1729
1729
|
if (!t)
|
|
1730
1730
|
return;
|
|
1731
1731
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1735,7 +1735,7 @@ function to(t) {
|
|
|
1735
1735
|
if (![n, r, o, s].some((i) => !Number.isFinite(i)))
|
|
1736
1736
|
return { inStart: n, inEnd: r, outStart: o, outEnd: s };
|
|
1737
1737
|
}
|
|
1738
|
-
class
|
|
1738
|
+
class oo {
|
|
1739
1739
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1740
1740
|
observer;
|
|
1741
1741
|
observeScheduled = !1;
|
|
@@ -1780,7 +1780,7 @@ class no {
|
|
|
1780
1780
|
const n = e.source?.trim();
|
|
1781
1781
|
if (!n)
|
|
1782
1782
|
return;
|
|
1783
|
-
const r = kt(e.min) ?? 0, o = kt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l =
|
|
1783
|
+
const r = kt(e.min) ?? 0, o = kt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = no(e.ease), d = ro(e.map), h = e.targetId?.trim() || void 0;
|
|
1784
1784
|
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1785
1785
|
source: n.toLowerCase(),
|
|
1786
1786
|
min: r,
|
|
@@ -1993,8 +1993,8 @@ class no {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
1995
|
}
|
|
1996
|
-
const Xe = new
|
|
1997
|
-
function
|
|
1996
|
+
const Xe = new oo();
|
|
1997
|
+
function so(t) {
|
|
1998
1998
|
const e = E(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
|
|
1999
1999
|
if (!(!s || typeof document > "u")) {
|
|
2000
2000
|
if (i) {
|
|
@@ -2027,7 +2027,7 @@ function ro(t) {
|
|
|
2027
2027
|
};
|
|
2028
2028
|
}, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2030
|
+
function io(t) {
|
|
2031
2031
|
const e = [];
|
|
2032
2032
|
for (const [n, r] of t) {
|
|
2033
2033
|
const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -2035,7 +2035,7 @@ function oo(t) {
|
|
|
2035
2035
|
}
|
|
2036
2036
|
return e.sort(), e.join(",");
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function ao(t) {
|
|
2039
2039
|
const [e, n] = N(), r = E("");
|
|
2040
2040
|
return C(() => {
|
|
2041
2041
|
if (!t) {
|
|
@@ -2043,54 +2043,54 @@ function so(t) {
|
|
|
2043
2043
|
return;
|
|
2044
2044
|
}
|
|
2045
2045
|
const o = () => {
|
|
2046
|
-
const s = t.getStores(), i =
|
|
2046
|
+
const s = t.getStores(), i = io(s);
|
|
2047
2047
|
i !== r.current && (r.current = i, n(s));
|
|
2048
2048
|
};
|
|
2049
2049
|
return o(), t.subscribe(o);
|
|
2050
2050
|
}, [t]), e;
|
|
2051
2051
|
}
|
|
2052
|
-
var
|
|
2053
|
-
function
|
|
2054
|
-
var e =
|
|
2052
|
+
var co = typeof global == "object" && global && global.Object === Object && global, lo = typeof self == "object" && self && self.Object === Object && self, uo = co || lo || Function("return this")(), Pe = uo.Symbol, Jt = Object.prototype, fo = Jt.hasOwnProperty, ho = Jt.toString, Se = Pe ? Pe.toStringTag : void 0;
|
|
2053
|
+
function po(t) {
|
|
2054
|
+
var e = fo.call(t, Se), n = t[Se];
|
|
2055
2055
|
try {
|
|
2056
|
-
t[
|
|
2056
|
+
t[Se] = void 0;
|
|
2057
2057
|
var r = !0;
|
|
2058
2058
|
} catch {
|
|
2059
2059
|
}
|
|
2060
|
-
var o =
|
|
2061
|
-
return r && (e ? t[
|
|
2060
|
+
var o = ho.call(t);
|
|
2061
|
+
return r && (e ? t[Se] = n : delete t[Se]), o;
|
|
2062
2062
|
}
|
|
2063
|
-
var
|
|
2064
|
-
function
|
|
2065
|
-
return
|
|
2063
|
+
var mo = Object.prototype, go = mo.toString;
|
|
2064
|
+
function yo(t) {
|
|
2065
|
+
return go.call(t);
|
|
2066
2066
|
}
|
|
2067
|
-
var
|
|
2068
|
-
function
|
|
2069
|
-
return t == null ? t === void 0 ?
|
|
2067
|
+
var bo = "[object Null]", So = "[object Undefined]", _t = Pe ? Pe.toStringTag : void 0;
|
|
2068
|
+
function wo(t) {
|
|
2069
|
+
return t == null ? t === void 0 ? So : bo : _t && _t in Object(t) ? po(t) : yo(t);
|
|
2070
2070
|
}
|
|
2071
|
-
function
|
|
2071
|
+
function vo(t) {
|
|
2072
2072
|
return t != null && typeof t == "object";
|
|
2073
2073
|
}
|
|
2074
|
-
var
|
|
2075
|
-
function
|
|
2076
|
-
return typeof t == "string" || !
|
|
2074
|
+
var Eo = Array.isArray, Ro = "[object String]";
|
|
2075
|
+
function Ao(t) {
|
|
2076
|
+
return typeof t == "string" || !Eo(t) && vo(t) && wo(t) == Ro;
|
|
2077
2077
|
}
|
|
2078
|
-
const Ot = "
|
|
2078
|
+
const Ot = "ikon-ui-modules";
|
|
2079
2079
|
function ot(t) {
|
|
2080
2080
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2081
2081
|
}
|
|
2082
|
-
function
|
|
2082
|
+
function To(t) {
|
|
2083
2083
|
if (!Array.isArray(t))
|
|
2084
2084
|
return;
|
|
2085
2085
|
const e = /* @__PURE__ */ new Set();
|
|
2086
2086
|
for (const n of t) {
|
|
2087
|
-
if (!
|
|
2087
|
+
if (!Ao(n)) continue;
|
|
2088
2088
|
const r = n.trim();
|
|
2089
2089
|
r && (e.has(r) || e.add(r));
|
|
2090
2090
|
}
|
|
2091
2091
|
return Array.from(e);
|
|
2092
2092
|
}
|
|
2093
|
-
function
|
|
2093
|
+
function Zs(t, e) {
|
|
2094
2094
|
if (t === e)
|
|
2095
2095
|
return !0;
|
|
2096
2096
|
if (!t || !e)
|
|
@@ -2102,18 +2102,18 @@ function Hs(t, e) {
|
|
|
2102
2102
|
return !1;
|
|
2103
2103
|
return !0;
|
|
2104
2104
|
}
|
|
2105
|
-
function
|
|
2105
|
+
function ko(t) {
|
|
2106
2106
|
if (!(!ot(t) || !Object.prototype.hasOwnProperty.call(t, Ot)))
|
|
2107
|
-
return
|
|
2107
|
+
return To(t[Ot]);
|
|
2108
2108
|
}
|
|
2109
|
-
function
|
|
2109
|
+
function Qs(...t) {
|
|
2110
2110
|
for (const e of t) {
|
|
2111
|
-
const n =
|
|
2111
|
+
const n = ko(e);
|
|
2112
2112
|
if (n !== void 0)
|
|
2113
2113
|
return n;
|
|
2114
2114
|
}
|
|
2115
2115
|
}
|
|
2116
|
-
function
|
|
2116
|
+
function ei(t) {
|
|
2117
2117
|
if (!ot(t))
|
|
2118
2118
|
return;
|
|
2119
2119
|
const e = t, n = Object.keys(e).find((l) => l.toLowerCase() === "modules");
|
|
@@ -2162,7 +2162,7 @@ const k = {
|
|
|
2162
2162
|
Line: 4,
|
|
2163
2163
|
Paragraph: 8,
|
|
2164
2164
|
Emoji: 16
|
|
2165
|
-
},
|
|
2165
|
+
}, Co = [
|
|
2166
2166
|
{
|
|
2167
2167
|
flag: k.Letter,
|
|
2168
2168
|
hints: [
|
|
@@ -2211,11 +2211,11 @@ const k = {
|
|
|
2211
2211
|
"[data-emoji]"
|
|
2212
2212
|
]
|
|
2213
2213
|
}
|
|
2214
|
-
], st = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji,
|
|
2215
|
-
function
|
|
2216
|
-
if (!t || t.length >
|
|
2214
|
+
], st = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, Io = k.Letter | k.Word | k.Line | k.Paragraph, Nt = /* @__PURE__ */ new Map(), _o = 16384;
|
|
2215
|
+
function ti(t, e) {
|
|
2216
|
+
if (!t || t.length > _o)
|
|
2217
2217
|
return t;
|
|
2218
|
-
const n =
|
|
2218
|
+
const n = Yo(e), r = fe(n, k.Emoji), o = n & Io;
|
|
2219
2219
|
if (o === k.None && !r)
|
|
2220
2220
|
return t;
|
|
2221
2221
|
const s = t.replace(/\r\n/g, `
|
|
@@ -2223,20 +2223,20 @@ function Zs(t, e) {
|
|
|
2223
2223
|
`);
|
|
2224
2224
|
if (o === k.None)
|
|
2225
2225
|
return Ut(s);
|
|
2226
|
-
const i =
|
|
2226
|
+
const i = Ko(s);
|
|
2227
2227
|
if (i.length === 0)
|
|
2228
2228
|
return r ? Ut(s) : t;
|
|
2229
|
-
const a =
|
|
2229
|
+
const a = Go(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
|
|
2230
2230
|
for (const h of a) {
|
|
2231
|
-
const y =
|
|
2231
|
+
const y = Oo(h, n, l);
|
|
2232
2232
|
d.push(...y);
|
|
2233
2233
|
}
|
|
2234
2234
|
return d;
|
|
2235
2235
|
}
|
|
2236
|
-
function
|
|
2236
|
+
function Oo(t, e, n) {
|
|
2237
2237
|
const r = [];
|
|
2238
2238
|
for (const o of t) {
|
|
2239
|
-
const s =
|
|
2239
|
+
const s = No(o, e, n);
|
|
2240
2240
|
r.push(...s);
|
|
2241
2241
|
}
|
|
2242
2242
|
if (fe(e, k.Paragraph)) {
|
|
@@ -2255,8 +2255,8 @@ function Io(t, e, n) {
|
|
|
2255
2255
|
}
|
|
2256
2256
|
return r;
|
|
2257
2257
|
}
|
|
2258
|
-
function
|
|
2259
|
-
const r =
|
|
2258
|
+
function No(t, e, n) {
|
|
2259
|
+
const r = xo(t.text, e, n), o = [];
|
|
2260
2260
|
if (fe(e, k.Line)) {
|
|
2261
2261
|
const s = n.line++;
|
|
2262
2262
|
o.push(
|
|
@@ -2268,7 +2268,7 @@ function _o(t, e, n) {
|
|
|
2268
2268
|
o.push(/* @__PURE__ */ w.jsx("br", {}, `motion-break-${n.br++}`));
|
|
2269
2269
|
return o;
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function xo(t, e, n) {
|
|
2272
2272
|
if (!t)
|
|
2273
2273
|
return [];
|
|
2274
2274
|
const r = fe(e, k.Word), o = [], s = /(\s+)/g;
|
|
@@ -2287,13 +2287,13 @@ function Oo(t, e, n) {
|
|
|
2287
2287
|
return o;
|
|
2288
2288
|
}
|
|
2289
2289
|
function xt(t, e, n, r) {
|
|
2290
|
-
const o = e.word++, s =
|
|
2290
|
+
const o = e.word++, s = Po(t, n, e), i = `motion-word-${o}`, a = Lo(o, r);
|
|
2291
2291
|
return r ? /* @__PURE__ */ w.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ w.jsx("span", { style: a, children: s }, i);
|
|
2292
2292
|
}
|
|
2293
|
-
function
|
|
2293
|
+
function Lo(t, e) {
|
|
2294
2294
|
return e ? { ...je(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2295
2295
|
}
|
|
2296
|
-
function
|
|
2296
|
+
function Po(t, e, n) {
|
|
2297
2297
|
if (!t)
|
|
2298
2298
|
return [];
|
|
2299
2299
|
const r = fe(e, k.Letter), o = fe(e, k.Emoji);
|
|
@@ -2326,45 +2326,45 @@ function xo(t, e, n) {
|
|
|
2326
2326
|
function it(t) {
|
|
2327
2327
|
if (!t)
|
|
2328
2328
|
return [];
|
|
2329
|
-
const e =
|
|
2330
|
-
return e ? Array.from(e.segment(t), (n) => n.segment) :
|
|
2329
|
+
const e = Uo();
|
|
2330
|
+
return e ? Array.from(e.segment(t), (n) => n.segment) : Mo(t);
|
|
2331
2331
|
}
|
|
2332
|
-
let
|
|
2333
|
-
function
|
|
2334
|
-
return
|
|
2332
|
+
let we;
|
|
2333
|
+
function Uo() {
|
|
2334
|
+
return we !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? we = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : we = null), we;
|
|
2335
2335
|
}
|
|
2336
|
-
function
|
|
2336
|
+
function Mo(t) {
|
|
2337
2337
|
const e = [], n = Array.from(t);
|
|
2338
2338
|
let r = "";
|
|
2339
2339
|
for (let o = 0; o < n.length; o++) {
|
|
2340
2340
|
const s = n[o], i = n[o + 1];
|
|
2341
|
-
r += s, !(i &&
|
|
2341
|
+
r += s, !(i && jo(s, i)) && (e.push(r), r = "");
|
|
2342
2342
|
}
|
|
2343
2343
|
return r && e.push(r), e;
|
|
2344
2344
|
}
|
|
2345
|
-
function
|
|
2346
|
-
return e ? !!(
|
|
2345
|
+
function jo(t, e) {
|
|
2346
|
+
return e ? !!(Lt(t) || Lt(e) || Bo(e) || Do(e) || $o(e) || Pt(t) && Pt(e)) : !1;
|
|
2347
2347
|
}
|
|
2348
|
-
function
|
|
2348
|
+
function Lt(t) {
|
|
2349
2349
|
return t.codePointAt(0) === 8205;
|
|
2350
2350
|
}
|
|
2351
|
-
function
|
|
2351
|
+
function Do(t) {
|
|
2352
2352
|
const e = t.codePointAt(0);
|
|
2353
2353
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2354
2354
|
}
|
|
2355
|
-
function
|
|
2355
|
+
function $o(t) {
|
|
2356
2356
|
const e = t.codePointAt(0);
|
|
2357
2357
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2358
2358
|
}
|
|
2359
|
-
function
|
|
2359
|
+
function Pt(t) {
|
|
2360
2360
|
const e = t.codePointAt(0);
|
|
2361
2361
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2362
2362
|
}
|
|
2363
2363
|
let He;
|
|
2364
|
-
function
|
|
2365
|
-
return t ? (He || (He =
|
|
2364
|
+
function Bo(t) {
|
|
2365
|
+
return t ? (He || (He = Fo()), He(t)) : !1;
|
|
2366
2366
|
}
|
|
2367
|
-
function
|
|
2367
|
+
function Fo() {
|
|
2368
2368
|
try {
|
|
2369
2369
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2370
2370
|
return (e) => t.test(e);
|
|
@@ -2377,17 +2377,17 @@ function $o() {
|
|
|
2377
2377
|
}
|
|
2378
2378
|
let qe;
|
|
2379
2379
|
function Zt(t) {
|
|
2380
|
-
return t ? (qe || (qe =
|
|
2380
|
+
return t ? (qe || (qe = Vo()), qe(t)) : !1;
|
|
2381
2381
|
}
|
|
2382
|
-
function
|
|
2382
|
+
function Vo() {
|
|
2383
2383
|
try {
|
|
2384
2384
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2385
2385
|
return (e) => t.test(e);
|
|
2386
2386
|
} catch {
|
|
2387
|
-
return
|
|
2387
|
+
return Wo;
|
|
2388
2388
|
}
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2390
|
+
function Wo(t) {
|
|
2391
2391
|
if (!t)
|
|
2392
2392
|
return !1;
|
|
2393
2393
|
for (const e of Array.from(t)) {
|
|
@@ -2397,7 +2397,7 @@ function Fo(t) {
|
|
|
2397
2397
|
}
|
|
2398
2398
|
return !1;
|
|
2399
2399
|
}
|
|
2400
|
-
function
|
|
2400
|
+
function Ko(t) {
|
|
2401
2401
|
const e = [];
|
|
2402
2402
|
let n = "", r = 0;
|
|
2403
2403
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2411,7 +2411,7 @@ function Vo(t) {
|
|
|
2411
2411
|
}
|
|
2412
2412
|
return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
|
|
2413
2413
|
}
|
|
2414
|
-
function
|
|
2414
|
+
function Go(t) {
|
|
2415
2415
|
if (t.length === 0)
|
|
2416
2416
|
return [];
|
|
2417
2417
|
const e = [];
|
|
@@ -2468,7 +2468,7 @@ function Qt(t, e) {
|
|
|
2468
2468
|
}
|
|
2469
2469
|
return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2471
|
+
function Yo(t) {
|
|
2472
2472
|
if (!t)
|
|
2473
2473
|
return k.None;
|
|
2474
2474
|
const e = t.trim();
|
|
@@ -2482,8 +2482,8 @@ function Ko(t) {
|
|
|
2482
2482
|
const r = e.split(/\s+/).filter(Boolean);
|
|
2483
2483
|
if (r.length === 0)
|
|
2484
2484
|
return k.None;
|
|
2485
|
-
const s = r.map((l) => `.${
|
|
2486
|
-
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2485
|
+
const s = r.map((l) => `.${zo(l)}`).map(
|
|
2486
|
+
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Xo(l)}(?![a-zA-Z0-9_-])`)
|
|
2487
2487
|
);
|
|
2488
2488
|
let i = k.None, a = !1;
|
|
2489
2489
|
for (const l of Array.from(document.styleSheets)) {
|
|
@@ -2511,7 +2511,7 @@ function en(t, e) {
|
|
|
2511
2511
|
const a = s.selectorText ?? "";
|
|
2512
2512
|
if (!a || !e.some((d) => d.test(a))) continue;
|
|
2513
2513
|
r = !0;
|
|
2514
|
-
for (const d of
|
|
2514
|
+
for (const d of Co)
|
|
2515
2515
|
d.hints.some((h) => a.includes(h)) && (n |= d.flag);
|
|
2516
2516
|
if (n === st)
|
|
2517
2517
|
return { mask: n, sawStyleRule: !0 };
|
|
@@ -2525,36 +2525,36 @@ function en(t, e) {
|
|
|
2525
2525
|
}
|
|
2526
2526
|
return { mask: n, sawStyleRule: r };
|
|
2527
2527
|
}
|
|
2528
|
-
function
|
|
2528
|
+
function zo(t) {
|
|
2529
2529
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2530
2530
|
}
|
|
2531
|
-
function
|
|
2531
|
+
function Xo(t) {
|
|
2532
2532
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2533
2533
|
}
|
|
2534
|
-
const dt = "
|
|
2535
|
-
function
|
|
2534
|
+
const dt = "ikon-auth-session", tn = "ikon-auth-auto-login-attempted-run", Ho = 10080 * 60 * 1e3, qo = 60 * 1e3;
|
|
2535
|
+
function nn(t) {
|
|
2536
2536
|
try {
|
|
2537
2537
|
const e = t.split(".");
|
|
2538
2538
|
if (e.length !== 3) return !0;
|
|
2539
2539
|
const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
|
|
2540
|
-
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 -
|
|
2540
|
+
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - qo;
|
|
2541
2541
|
} catch {
|
|
2542
2542
|
return !0;
|
|
2543
2543
|
}
|
|
2544
2544
|
}
|
|
2545
|
-
function
|
|
2545
|
+
function he(t) {
|
|
2546
2546
|
try {
|
|
2547
2547
|
localStorage.setItem(dt, JSON.stringify(t));
|
|
2548
2548
|
} catch {
|
|
2549
2549
|
console.warn("Failed to save auth session to localStorage");
|
|
2550
2550
|
}
|
|
2551
2551
|
}
|
|
2552
|
-
function
|
|
2552
|
+
function rn() {
|
|
2553
2553
|
try {
|
|
2554
2554
|
const t = localStorage.getItem(dt);
|
|
2555
2555
|
if (!t) return null;
|
|
2556
2556
|
const e = JSON.parse(t);
|
|
2557
|
-
return Date.now() - e.authenticatedAt >
|
|
2557
|
+
return Date.now() - e.authenticatedAt > Ho || nn(e.token) ? (Ue(), null) : e;
|
|
2558
2558
|
} catch {
|
|
2559
2559
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2560
2560
|
}
|
|
@@ -2566,7 +2566,22 @@ function Ue() {
|
|
|
2566
2566
|
console.warn("Failed to clear auth session from localStorage");
|
|
2567
2567
|
}
|
|
2568
2568
|
}
|
|
2569
|
-
function
|
|
2569
|
+
function Jo(t) {
|
|
2570
|
+
if (t)
|
|
2571
|
+
try {
|
|
2572
|
+
sessionStorage.setItem(tn, t);
|
|
2573
|
+
} catch {
|
|
2574
|
+
console.warn("Failed to record auto-login attempt in sessionStorage");
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
function Zo() {
|
|
2578
|
+
try {
|
|
2579
|
+
return sessionStorage.getItem(tn);
|
|
2580
|
+
} catch {
|
|
2581
|
+
return null;
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
function ne(t) {
|
|
2570
2585
|
return {
|
|
2571
2586
|
id: "",
|
|
2572
2587
|
provider: t.provider,
|
|
@@ -2574,7 +2589,7 @@ function le(t) {
|
|
|
2574
2589
|
authenticatedAt: t.authenticatedAt
|
|
2575
2590
|
};
|
|
2576
2591
|
}
|
|
2577
|
-
const
|
|
2592
|
+
const on = 15e3, ve = oe("AuthService");
|
|
2578
2593
|
async function Mt(t) {
|
|
2579
2594
|
try {
|
|
2580
2595
|
return await fetch(t, { method: "GET", mode: "no-cors" }), "no-cors probe SUCCEEDED → origin is reachable; the failure is most likely CORS (missing/!allowed Access-Control headers)";
|
|
@@ -2582,43 +2597,43 @@ async function Mt(t) {
|
|
|
2582
2597
|
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)`;
|
|
2583
2598
|
}
|
|
2584
2599
|
}
|
|
2585
|
-
async function
|
|
2586
|
-
const n =
|
|
2600
|
+
async function sn(t, e) {
|
|
2601
|
+
const n = xn(), r = {
|
|
2587
2602
|
method: "POST",
|
|
2588
2603
|
headers: { "Content-Type": "application/json" },
|
|
2589
2604
|
body: JSON.stringify({ deviceId: n, space: t })
|
|
2590
2605
|
}, o = typeof window < "u" ? window.location.origin : "?", s = `${e}/anonymous`;
|
|
2591
|
-
|
|
2606
|
+
ve.info(`Anonymous auth: POST ${s} (space=${t}, origin=${o})`);
|
|
2592
2607
|
let i;
|
|
2593
2608
|
try {
|
|
2594
2609
|
i = await fetch(s, r);
|
|
2595
2610
|
} catch (d) {
|
|
2596
|
-
const h = d instanceof Error ? `${d.name}: ${d.message}` : String(d), y =
|
|
2611
|
+
const h = d instanceof Error ? `${d.name}: ${d.message}` : String(d), y = Ln(), m = y ? `${y}/anonymous` : null;
|
|
2597
2612
|
if (m && m !== s) {
|
|
2598
|
-
|
|
2613
|
+
ve.warn(`Anonymous auth could not reach ${s} (${h}); falling back to same-origin ${m}`);
|
|
2599
2614
|
try {
|
|
2600
2615
|
i = await fetch(m, r);
|
|
2601
2616
|
} catch (c) {
|
|
2602
2617
|
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), g = await Mt(e);
|
|
2603
|
-
throw
|
|
2618
|
+
throw ve.error(`Anonymous auth failed on both direct (${s}: ${h}) and same-origin (${m}: ${u}). ${g}`), new Error(`Anonymous auth unreachable: direct ${s} (${h}) and same-origin ${m} (${u})`);
|
|
2604
2619
|
}
|
|
2605
2620
|
} else {
|
|
2606
2621
|
const c = await Mt(e);
|
|
2607
|
-
throw
|
|
2622
|
+
throw ve.error(`Anonymous auth fetch threw for ${s} — ${h}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${h}). ${c}`);
|
|
2608
2623
|
}
|
|
2609
2624
|
}
|
|
2610
2625
|
if (!i.ok) {
|
|
2611
2626
|
const d = await i.text().catch(() => "Unknown error");
|
|
2612
|
-
throw
|
|
2627
|
+
throw ve.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${d}`), new Error(`Anonymous auth failed: ${i.status} ${d}`);
|
|
2613
2628
|
}
|
|
2614
2629
|
const { token: a } = await i.json(), l = {
|
|
2615
2630
|
token: a,
|
|
2616
2631
|
provider: "anonymous",
|
|
2617
2632
|
authenticatedAt: Date.now()
|
|
2618
2633
|
};
|
|
2619
|
-
return
|
|
2634
|
+
return he(l), l;
|
|
2620
2635
|
}
|
|
2621
|
-
async function
|
|
2636
|
+
async function Qo({ email: t, spaceId: e, authUrl: n }) {
|
|
2622
2637
|
const r = await fetch(`${n}/email/send`, {
|
|
2623
2638
|
method: "POST",
|
|
2624
2639
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2626,14 +2641,14 @@ async function qo({ email: t, spaceId: e, authUrl: n }) {
|
|
|
2626
2641
|
email: t.trim(),
|
|
2627
2642
|
space: e
|
|
2628
2643
|
}),
|
|
2629
|
-
signal: Vt(
|
|
2644
|
+
signal: Vt(on)
|
|
2630
2645
|
});
|
|
2631
2646
|
if (!r.ok) {
|
|
2632
2647
|
const o = await r.text().catch(() => "Failed to send login code");
|
|
2633
2648
|
throw new Error(o);
|
|
2634
2649
|
}
|
|
2635
2650
|
}
|
|
2636
|
-
async function
|
|
2651
|
+
async function es({ email: t, code: e, authUrl: n }) {
|
|
2637
2652
|
const r = await fetch(`${n}/email/code`, {
|
|
2638
2653
|
method: "POST",
|
|
2639
2654
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2641,7 +2656,7 @@ async function Jo({ email: t, code: e, authUrl: n }) {
|
|
|
2641
2656
|
email: t.trim(),
|
|
2642
2657
|
code: e.trim()
|
|
2643
2658
|
}),
|
|
2644
|
-
signal: Vt(
|
|
2659
|
+
signal: Vt(on)
|
|
2645
2660
|
});
|
|
2646
2661
|
if (!r.ok) {
|
|
2647
2662
|
const i = await r.text().catch(() => "Invalid code");
|
|
@@ -2652,23 +2667,23 @@ async function Jo({ email: t, code: e, authUrl: n }) {
|
|
|
2652
2667
|
provider: "email",
|
|
2653
2668
|
authenticatedAt: Date.now()
|
|
2654
2669
|
};
|
|
2655
|
-
return
|
|
2670
|
+
return he(s), s;
|
|
2656
2671
|
}
|
|
2657
|
-
function
|
|
2672
|
+
function ts() {
|
|
2658
2673
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
2659
2674
|
return e && n ? { token: e, provider: n } : null;
|
|
2660
2675
|
}
|
|
2661
|
-
function
|
|
2676
|
+
function ns() {
|
|
2662
2677
|
return new URLSearchParams(window.location.search).get("error");
|
|
2663
2678
|
}
|
|
2664
2679
|
function jt() {
|
|
2665
2680
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2666
2681
|
}
|
|
2667
|
-
function
|
|
2682
|
+
function rs(t, e, n, r) {
|
|
2668
2683
|
const o = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2669
2684
|
return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2670
2685
|
}
|
|
2671
|
-
async function
|
|
2686
|
+
async function os(t) {
|
|
2672
2687
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2673
2688
|
method: "POST",
|
|
2674
2689
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2679,7 +2694,7 @@ async function ts(t) {
|
|
|
2679
2694
|
}
|
|
2680
2695
|
return e.json();
|
|
2681
2696
|
}
|
|
2682
|
-
async function
|
|
2697
|
+
async function ss(t, e, n) {
|
|
2683
2698
|
const r = await fetch(`${t}/passkey/registration/verify`, {
|
|
2684
2699
|
method: "POST",
|
|
2685
2700
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2694,9 +2709,9 @@ async function ns(t, e, n) {
|
|
|
2694
2709
|
provider: "passkey",
|
|
2695
2710
|
authenticatedAt: Date.now()
|
|
2696
2711
|
};
|
|
2697
|
-
return
|
|
2712
|
+
return he(s), s;
|
|
2698
2713
|
}
|
|
2699
|
-
async function
|
|
2714
|
+
async function is(t, e) {
|
|
2700
2715
|
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
2701
2716
|
method: "POST",
|
|
2702
2717
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2708,7 +2723,7 @@ async function rs(t, e) {
|
|
|
2708
2723
|
}
|
|
2709
2724
|
return n.json();
|
|
2710
2725
|
}
|
|
2711
|
-
async function
|
|
2726
|
+
async function as(t, e) {
|
|
2712
2727
|
const n = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2713
2728
|
method: "POST",
|
|
2714
2729
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2723,7 +2738,7 @@ async function os(t, e) {
|
|
|
2723
2738
|
provider: "passkey",
|
|
2724
2739
|
authenticatedAt: Date.now()
|
|
2725
2740
|
};
|
|
2726
|
-
return
|
|
2741
|
+
return he(o), o;
|
|
2727
2742
|
}
|
|
2728
2743
|
function X(t) {
|
|
2729
2744
|
const e = new Uint8Array(t);
|
|
@@ -2739,12 +2754,12 @@ function Me(t) {
|
|
|
2739
2754
|
return s;
|
|
2740
2755
|
}
|
|
2741
2756
|
function ft() {
|
|
2742
|
-
return
|
|
2757
|
+
return cs.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2743
2758
|
}
|
|
2744
|
-
const
|
|
2759
|
+
const cs = {
|
|
2745
2760
|
stubThis: (t) => t
|
|
2746
2761
|
};
|
|
2747
|
-
function
|
|
2762
|
+
function an(t) {
|
|
2748
2763
|
const { id: e } = t;
|
|
2749
2764
|
return {
|
|
2750
2765
|
...t,
|
|
@@ -2757,7 +2772,7 @@ function on(t) {
|
|
|
2757
2772
|
transports: t.transports
|
|
2758
2773
|
};
|
|
2759
2774
|
}
|
|
2760
|
-
function
|
|
2775
|
+
function cn(t) {
|
|
2761
2776
|
return (
|
|
2762
2777
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2763
2778
|
t === "localhost" || // Support punycode (ACE) or ascii labels and domains
|
|
@@ -2774,7 +2789,7 @@ class j extends Error {
|
|
|
2774
2789
|
}), this.name = o ?? r.name, this.code = n;
|
|
2775
2790
|
}
|
|
2776
2791
|
}
|
|
2777
|
-
function
|
|
2792
|
+
function ls({ error: t, options: e }) {
|
|
2778
2793
|
const { publicKey: n } = e;
|
|
2779
2794
|
if (!n)
|
|
2780
2795
|
throw Error("options was missing required publicKey property");
|
|
@@ -2832,7 +2847,7 @@ function is({ error: t, options: e }) {
|
|
|
2832
2847
|
});
|
|
2833
2848
|
if (t.name === "SecurityError") {
|
|
2834
2849
|
const r = globalThis.location.hostname;
|
|
2835
|
-
if (
|
|
2850
|
+
if (cn(r)) {
|
|
2836
2851
|
if (n.rp.id !== r)
|
|
2837
2852
|
return new j({
|
|
2838
2853
|
message: `The RP ID "${n.rp.id}" is invalid for this domain`,
|
|
@@ -2860,7 +2875,7 @@ function is({ error: t, options: e }) {
|
|
|
2860
2875
|
}
|
|
2861
2876
|
return t;
|
|
2862
2877
|
}
|
|
2863
|
-
class
|
|
2878
|
+
class us {
|
|
2864
2879
|
constructor() {
|
|
2865
2880
|
Object.defineProperty(this, "controller", {
|
|
2866
2881
|
enumerable: !0,
|
|
@@ -2884,12 +2899,12 @@ class as {
|
|
|
2884
2899
|
}
|
|
2885
2900
|
}
|
|
2886
2901
|
}
|
|
2887
|
-
const
|
|
2888
|
-
function
|
|
2889
|
-
if (t && !(
|
|
2902
|
+
const ln = new us(), ds = ["cross-platform", "platform"];
|
|
2903
|
+
function un(t) {
|
|
2904
|
+
if (t && !(ds.indexOf(t) < 0))
|
|
2890
2905
|
return t;
|
|
2891
2906
|
}
|
|
2892
|
-
async function
|
|
2907
|
+
async function fs(t) {
|
|
2893
2908
|
!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 });
|
|
2894
2909
|
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2895
2910
|
if (!ft())
|
|
@@ -2901,14 +2916,14 @@ async function ls(t) {
|
|
|
2901
2916
|
...e.user,
|
|
2902
2917
|
id: Me(e.user.id)
|
|
2903
2918
|
},
|
|
2904
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2919
|
+
excludeCredentials: e.excludeCredentials?.map(an)
|
|
2905
2920
|
}, o = {};
|
|
2906
|
-
n && (o.mediation = "conditional"), o.publicKey = r, o.signal =
|
|
2921
|
+
n && (o.mediation = "conditional"), o.publicKey = r, o.signal = ln.createNewAbortSignal();
|
|
2907
2922
|
let s;
|
|
2908
2923
|
try {
|
|
2909
2924
|
s = await navigator.credentials.create(o);
|
|
2910
2925
|
} catch (u) {
|
|
2911
|
-
throw
|
|
2926
|
+
throw ls({ error: u, options: o });
|
|
2912
2927
|
}
|
|
2913
2928
|
if (!s)
|
|
2914
2929
|
throw new Error("Registration was not completed");
|
|
@@ -2950,14 +2965,14 @@ async function ls(t) {
|
|
|
2950
2965
|
},
|
|
2951
2966
|
type: d,
|
|
2952
2967
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2953
|
-
authenticatorAttachment:
|
|
2968
|
+
authenticatorAttachment: un(s.authenticatorAttachment)
|
|
2954
2969
|
};
|
|
2955
2970
|
}
|
|
2956
2971
|
function Je(t, e) {
|
|
2957
2972
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2958
2973
|
`, e);
|
|
2959
2974
|
}
|
|
2960
|
-
function
|
|
2975
|
+
function hs() {
|
|
2961
2976
|
if (!ft())
|
|
2962
2977
|
return Ze.stubThis(new Promise((e) => e(!1)));
|
|
2963
2978
|
const t = globalThis.PublicKeyCredential;
|
|
@@ -2966,7 +2981,7 @@ function us() {
|
|
|
2966
2981
|
const Ze = {
|
|
2967
2982
|
stubThis: (t) => t
|
|
2968
2983
|
};
|
|
2969
|
-
function
|
|
2984
|
+
function ps({ error: t, options: e }) {
|
|
2970
2985
|
const { publicKey: n } = e;
|
|
2971
2986
|
if (!n)
|
|
2972
2987
|
throw Error("options was missing required publicKey property");
|
|
@@ -2986,7 +3001,7 @@ function ds({ error: t, options: e }) {
|
|
|
2986
3001
|
});
|
|
2987
3002
|
if (t.name === "SecurityError") {
|
|
2988
3003
|
const r = globalThis.location.hostname;
|
|
2989
|
-
if (
|
|
3004
|
+
if (cn(r)) {
|
|
2990
3005
|
if (n.rpId !== r)
|
|
2991
3006
|
return new j({
|
|
2992
3007
|
message: `The RP ID "${n.rpId}" is invalid for this domain`,
|
|
@@ -3007,31 +3022,31 @@ function ds({ error: t, options: e }) {
|
|
|
3007
3022
|
}
|
|
3008
3023
|
return t;
|
|
3009
3024
|
}
|
|
3010
|
-
async function
|
|
3025
|
+
async function ms(t) {
|
|
3011
3026
|
!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 });
|
|
3012
3027
|
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
3013
3028
|
if (!ft())
|
|
3014
3029
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3015
3030
|
let o;
|
|
3016
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
3031
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(an));
|
|
3017
3032
|
const s = {
|
|
3018
3033
|
...e,
|
|
3019
3034
|
challenge: Me(e.challenge),
|
|
3020
3035
|
allowCredentials: o
|
|
3021
3036
|
}, i = {};
|
|
3022
3037
|
if (n) {
|
|
3023
|
-
if (!await
|
|
3038
|
+
if (!await hs())
|
|
3024
3039
|
throw Error("Browser does not support WebAuthn autofill");
|
|
3025
3040
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
3026
3041
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
3027
3042
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
3028
3043
|
}
|
|
3029
|
-
i.publicKey = s, i.signal =
|
|
3044
|
+
i.publicKey = s, i.signal = ln.createNewAbortSignal();
|
|
3030
3045
|
let a;
|
|
3031
3046
|
try {
|
|
3032
3047
|
a = await navigator.credentials.get(i);
|
|
3033
3048
|
} catch (c) {
|
|
3034
|
-
throw
|
|
3049
|
+
throw ps({ error: c, options: i });
|
|
3035
3050
|
}
|
|
3036
3051
|
if (!a)
|
|
3037
3052
|
throw new Error("Authentication was not completed");
|
|
@@ -3048,11 +3063,11 @@ async function fs(t) {
|
|
|
3048
3063
|
},
|
|
3049
3064
|
type: y,
|
|
3050
3065
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
3051
|
-
authenticatorAttachment:
|
|
3066
|
+
authenticatorAttachment: un(a.authenticatorAttachment)
|
|
3052
3067
|
};
|
|
3053
3068
|
}
|
|
3054
3069
|
const ht = Ft(null);
|
|
3055
|
-
function
|
|
3070
|
+
function ni({ children: t, config: e }) {
|
|
3056
3071
|
const [n, r] = N({
|
|
3057
3072
|
isAuthenticated: !1,
|
|
3058
3073
|
isLoading: !0,
|
|
@@ -3061,37 +3076,53 @@ function Qs({ children: t, config: e }) {
|
|
|
3061
3076
|
});
|
|
3062
3077
|
C(() => {
|
|
3063
3078
|
(() => {
|
|
3064
|
-
const m =
|
|
3065
|
-
|
|
3079
|
+
const m = e.devLoginRunId, c = !!m && Zo() === m;
|
|
3080
|
+
m && Jo(m);
|
|
3081
|
+
const u = ns();
|
|
3082
|
+
if (u) {
|
|
3066
3083
|
jt(), r({
|
|
3067
3084
|
isAuthenticated: !1,
|
|
3068
3085
|
isLoading: !1,
|
|
3069
3086
|
user: null,
|
|
3070
|
-
error:
|
|
3087
|
+
error: u
|
|
3071
3088
|
});
|
|
3072
3089
|
return;
|
|
3073
3090
|
}
|
|
3074
|
-
const
|
|
3075
|
-
if (
|
|
3076
|
-
const
|
|
3077
|
-
token:
|
|
3078
|
-
provider:
|
|
3091
|
+
const g = ts();
|
|
3092
|
+
if (g) {
|
|
3093
|
+
const b = {
|
|
3094
|
+
token: g.token,
|
|
3095
|
+
provider: g.provider,
|
|
3079
3096
|
authenticatedAt: Date.now()
|
|
3080
3097
|
};
|
|
3081
|
-
|
|
3098
|
+
he(b), jt(), r({
|
|
3082
3099
|
isAuthenticated: !0,
|
|
3083
3100
|
isLoading: !1,
|
|
3084
|
-
user:
|
|
3101
|
+
user: ne(b),
|
|
3085
3102
|
error: null
|
|
3086
3103
|
});
|
|
3087
3104
|
return;
|
|
3088
3105
|
}
|
|
3089
|
-
const
|
|
3090
|
-
if (
|
|
3106
|
+
const p = rn();
|
|
3107
|
+
if (p) {
|
|
3091
3108
|
r({
|
|
3092
3109
|
isAuthenticated: !0,
|
|
3093
3110
|
isLoading: !1,
|
|
3094
|
-
user:
|
|
3111
|
+
user: ne(p),
|
|
3112
|
+
error: null
|
|
3113
|
+
});
|
|
3114
|
+
return;
|
|
3115
|
+
}
|
|
3116
|
+
if (e.devLoginToken && m && !c && !nn(e.devLoginToken)) {
|
|
3117
|
+
const b = {
|
|
3118
|
+
token: e.devLoginToken,
|
|
3119
|
+
provider: "dev",
|
|
3120
|
+
authenticatedAt: Date.now()
|
|
3121
|
+
};
|
|
3122
|
+
he(b), r({
|
|
3123
|
+
isAuthenticated: !0,
|
|
3124
|
+
isLoading: !1,
|
|
3125
|
+
user: ne(b),
|
|
3095
3126
|
error: null
|
|
3096
3127
|
});
|
|
3097
3128
|
return;
|
|
@@ -3103,7 +3134,7 @@ function Qs({ children: t, config: e }) {
|
|
|
3103
3134
|
error: null
|
|
3104
3135
|
});
|
|
3105
3136
|
})();
|
|
3106
|
-
}, []);
|
|
3137
|
+
}, [e.devLoginToken, e.devLoginRunId]);
|
|
3107
3138
|
const o = D(
|
|
3108
3139
|
async (y) => {
|
|
3109
3140
|
if (!e.spaceId) {
|
|
@@ -3113,15 +3144,15 @@ function Qs({ children: t, config: e }) {
|
|
|
3113
3144
|
}));
|
|
3114
3145
|
return;
|
|
3115
3146
|
}
|
|
3116
|
-
const m = await
|
|
3147
|
+
const m = await Ee(e.authUrl);
|
|
3117
3148
|
if (y === "guest") {
|
|
3118
3149
|
r((c) => ({ ...c, isLoading: !0 }));
|
|
3119
3150
|
try {
|
|
3120
|
-
const c = await
|
|
3151
|
+
const c = await sn(e.spaceId, m);
|
|
3121
3152
|
r({
|
|
3122
3153
|
isAuthenticated: !0,
|
|
3123
3154
|
isLoading: !1,
|
|
3124
|
-
user:
|
|
3155
|
+
user: ne(c),
|
|
3125
3156
|
error: null
|
|
3126
3157
|
});
|
|
3127
3158
|
} catch (c) {
|
|
@@ -3136,11 +3167,11 @@ function Qs({ children: t, config: e }) {
|
|
|
3136
3167
|
if (y === "passkey") {
|
|
3137
3168
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3138
3169
|
try {
|
|
3139
|
-
const c = await
|
|
3170
|
+
const c = await is(m), u = await ms({ optionsJSON: c }), g = await as(m, u);
|
|
3140
3171
|
r({
|
|
3141
3172
|
isAuthenticated: !0,
|
|
3142
3173
|
isLoading: !1,
|
|
3143
|
-
user:
|
|
3174
|
+
user: ne(g),
|
|
3144
3175
|
error: null
|
|
3145
3176
|
});
|
|
3146
3177
|
} catch (c) {
|
|
@@ -3154,26 +3185,26 @@ function Qs({ children: t, config: e }) {
|
|
|
3154
3185
|
}
|
|
3155
3186
|
if (y === "email")
|
|
3156
3187
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3157
|
-
window.location.href =
|
|
3188
|
+
window.location.href = rs(y, e.spaceId, m);
|
|
3158
3189
|
},
|
|
3159
3190
|
[e.authUrl, e.spaceId]
|
|
3160
3191
|
), s = D(
|
|
3161
3192
|
async (y) => {
|
|
3162
3193
|
if (!e.spaceId)
|
|
3163
3194
|
throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3164
|
-
const m = await
|
|
3165
|
-
await
|
|
3195
|
+
const m = await Ee(e.authUrl);
|
|
3196
|
+
await Qo({ email: y, spaceId: e.spaceId, authUrl: m });
|
|
3166
3197
|
},
|
|
3167
3198
|
[e.authUrl, e.spaceId]
|
|
3168
3199
|
), i = D(
|
|
3169
3200
|
async (y, m) => {
|
|
3170
3201
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3171
3202
|
try {
|
|
3172
|
-
const c = await
|
|
3203
|
+
const c = await Ee(e.authUrl), u = await es({ email: y, code: m, authUrl: c });
|
|
3173
3204
|
r({
|
|
3174
3205
|
isAuthenticated: !0,
|
|
3175
3206
|
isLoading: !1,
|
|
3176
|
-
user:
|
|
3207
|
+
user: ne(u),
|
|
3177
3208
|
error: null
|
|
3178
3209
|
});
|
|
3179
3210
|
} catch (c) {
|
|
@@ -3191,14 +3222,14 @@ function Qs({ children: t, config: e }) {
|
|
|
3191
3222
|
});
|
|
3192
3223
|
}, []), l = D(
|
|
3193
3224
|
async (y) => {
|
|
3194
|
-
const m = await
|
|
3225
|
+
const m = await Ee(e.authUrl);
|
|
3195
3226
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3196
3227
|
try {
|
|
3197
|
-
const c = await
|
|
3228
|
+
const c = await os(m), u = await fs({ optionsJSON: c }), g = await ss(m, u, y);
|
|
3198
3229
|
r({
|
|
3199
3230
|
isAuthenticated: !0,
|
|
3200
3231
|
isLoading: !1,
|
|
3201
|
-
user:
|
|
3232
|
+
user: ne(g),
|
|
3202
3233
|
error: null
|
|
3203
3234
|
});
|
|
3204
3235
|
} catch (c) {
|
|
@@ -3224,17 +3255,17 @@ function Qs({ children: t, config: e }) {
|
|
|
3224
3255
|
);
|
|
3225
3256
|
return /* @__PURE__ */ w.jsx(ht, { value: h, children: t });
|
|
3226
3257
|
}
|
|
3227
|
-
function
|
|
3258
|
+
function gs() {
|
|
3228
3259
|
const t = ct(ht);
|
|
3229
3260
|
if (!t)
|
|
3230
3261
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3231
3262
|
return t;
|
|
3232
3263
|
}
|
|
3233
|
-
function
|
|
3264
|
+
function ys() {
|
|
3234
3265
|
return ct(ht);
|
|
3235
3266
|
}
|
|
3236
|
-
function
|
|
3237
|
-
const { config: e, guestUrlParam: n } = t, { state: r, login: o } =
|
|
3267
|
+
function ri(t) {
|
|
3268
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = gs(), s = E(!1);
|
|
3238
3269
|
return C(() => {
|
|
3239
3270
|
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
3240
3271
|
return;
|
|
@@ -3251,15 +3282,15 @@ function ei(t) {
|
|
|
3251
3282
|
error: r.error
|
|
3252
3283
|
};
|
|
3253
3284
|
}
|
|
3254
|
-
const
|
|
3285
|
+
const dn = (() => {
|
|
3255
3286
|
try {
|
|
3256
|
-
return
|
|
3287
|
+
return Pn();
|
|
3257
3288
|
} catch {
|
|
3258
3289
|
return !1;
|
|
3259
3290
|
}
|
|
3260
|
-
})(),
|
|
3291
|
+
})(), fn = Date.now(), re = [], bs = 300;
|
|
3261
3292
|
function Oe(t) {
|
|
3262
|
-
|
|
3293
|
+
re.push(`[+${((Date.now() - fn) / 1e3).toFixed(1)}s] ${t}`), re.length > bs && re.shift();
|
|
3263
3294
|
}
|
|
3264
3295
|
function Dt(t) {
|
|
3265
3296
|
if (typeof t == "string")
|
|
@@ -3273,7 +3304,7 @@ function Dt(t) {
|
|
|
3273
3304
|
}
|
|
3274
3305
|
}
|
|
3275
3306
|
let $t = !1;
|
|
3276
|
-
function
|
|
3307
|
+
function hn() {
|
|
3277
3308
|
if ($t || typeof window > "u")
|
|
3278
3309
|
return;
|
|
3279
3310
|
$t = !0, window.addEventListener("error", (e) => Oe(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Oe(`unhandledRejection: ${Dt(e.reason)}`));
|
|
@@ -3294,8 +3325,8 @@ function dn() {
|
|
|
3294
3325
|
} catch {
|
|
3295
3326
|
}
|
|
3296
3327
|
}
|
|
3297
|
-
|
|
3298
|
-
function
|
|
3328
|
+
dn && hn();
|
|
3329
|
+
function Ss() {
|
|
3299
3330
|
let t = !1;
|
|
3300
3331
|
try {
|
|
3301
3332
|
const e = URL.createObjectURL(new Blob([""]));
|
|
@@ -3306,11 +3337,11 @@ function gs() {
|
|
|
3306
3337
|
}
|
|
3307
3338
|
return t;
|
|
3308
3339
|
}
|
|
3309
|
-
function
|
|
3340
|
+
function ws() {
|
|
3310
3341
|
const t = globalThis;
|
|
3311
3342
|
return [
|
|
3312
3343
|
`Worker=${typeof Worker < "u"}`,
|
|
3313
|
-
`moduleWorker=${
|
|
3344
|
+
`moduleWorker=${Ss()}`,
|
|
3314
3345
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3315
3346
|
`WebTransport=${typeof t.WebTransport < "u"}`,
|
|
3316
3347
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3323,15 +3354,15 @@ function ys() {
|
|
|
3323
3354
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3324
3355
|
].join(" ");
|
|
3325
3356
|
}
|
|
3326
|
-
function
|
|
3357
|
+
function vs(t) {
|
|
3327
3358
|
return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
|
|
3328
3359
|
}
|
|
3329
|
-
function
|
|
3330
|
-
const n =
|
|
3360
|
+
function pn({ state: t = "", forceVisible: e = !1 }) {
|
|
3361
|
+
const n = dn || e, r = t === "connected" || t === "reconnecting", [, o] = On((l) => l + 1, 0), [s, i] = N(!0);
|
|
3331
3362
|
if (C(() => {
|
|
3332
3363
|
if (!n)
|
|
3333
3364
|
return;
|
|
3334
|
-
|
|
3365
|
+
hn();
|
|
3335
3366
|
const l = setInterval(o, 1e3);
|
|
3336
3367
|
return () => clearInterval(l);
|
|
3337
3368
|
}, [n]), !n)
|
|
@@ -3345,7 +3376,7 @@ function fn({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3345
3376
|
style: { position: "fixed", bottom: 8, left: 8, zIndex: 2147483647, background: "#000", color: "#0f0", font: "13px monospace", padding: "6px 10px", border: "1px solid #0f0", borderRadius: 6 },
|
|
3346
3377
|
children: [
|
|
3347
3378
|
"🐞 debug (",
|
|
3348
|
-
|
|
3379
|
+
re.length,
|
|
3349
3380
|
")"
|
|
3350
3381
|
]
|
|
3351
3382
|
}
|
|
@@ -3356,20 +3387,20 @@ function fn({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3356
3387
|
"Ikon debug overlay — state: ",
|
|
3357
3388
|
t || "?",
|
|
3358
3389
|
", +",
|
|
3359
|
-
Math.round((Date.now() -
|
|
3390
|
+
Math.round((Date.now() - fn) / 1e3),
|
|
3360
3391
|
"s, ",
|
|
3361
|
-
|
|
3392
|
+
re.length,
|
|
3362
3393
|
" entries",
|
|
3363
3394
|
r && /* @__PURE__ */ w.jsx("button", { type: "button", onClick: () => i(!0), style: { marginLeft: 12, font: "12px monospace", background: "#0f0", color: "#000", border: "none", borderRadius: 4, padding: "2px 8px" }, children: "hide" })
|
|
3364
3395
|
] }),
|
|
3365
3396
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
|
|
3366
3397
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
|
|
3367
|
-
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children:
|
|
3398
|
+
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: ws() }),
|
|
3368
3399
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
|
|
3369
|
-
/* @__PURE__ */ w.jsx("div", { children:
|
|
3400
|
+
/* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l, d) => /* @__PURE__ */ w.jsx("div", { style: { color: vs(l), wordBreak: "break-all" }, children: l }, d)) })
|
|
3370
3401
|
] });
|
|
3371
3402
|
}
|
|
3372
|
-
function
|
|
3403
|
+
function oi({
|
|
3373
3404
|
connectionState: t,
|
|
3374
3405
|
error: e,
|
|
3375
3406
|
isReady: n,
|
|
@@ -3418,33 +3449,33 @@ function ti({
|
|
|
3418
3449
|
})();
|
|
3419
3450
|
return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
3420
3451
|
g,
|
|
3421
|
-
/* @__PURE__ */ w.jsx(
|
|
3452
|
+
/* @__PURE__ */ w.jsx(pn, { state: t })
|
|
3422
3453
|
] });
|
|
3423
3454
|
}
|
|
3424
|
-
const Ne =
|
|
3425
|
-
function
|
|
3455
|
+
const Ne = oe("useIkonApp");
|
|
3456
|
+
function Es() {
|
|
3426
3457
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3427
3458
|
return window.__IKON_AUTH_CONFIG__;
|
|
3428
3459
|
}
|
|
3429
|
-
function
|
|
3460
|
+
function Rs() {
|
|
3430
3461
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3431
3462
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3432
3463
|
}
|
|
3433
|
-
function
|
|
3434
|
-
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: d, proxy: h, liveSnapshot: y, bootSnapshot: m } = t, c = e === void 0 ?
|
|
3435
|
-
T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, _.current = l,
|
|
3436
|
-
const [H, Re] = N("connecting"), [Ae,
|
|
3464
|
+
function si(t) {
|
|
3465
|
+
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: d, proxy: h, liveSnapshot: y, bootSnapshot: m } = t, c = e === void 0 ? Es() ?? null : e, u = Rs(), g = ys(), 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), _ = E(l), P = E(d), M = E(h), B = E(y), $ = E(m), V = E("local"), K = E(void 0);
|
|
3466
|
+
T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, _.current = l, P.current = d, M.current = h, B.current = y, $.current = m;
|
|
3467
|
+
const [H, Re] = N("connecting"), [Ae, pe] = N(!1), [f, A] = N(!1), [O, x] = N(null), [se, me] = N(null), [L, Q] = N(!1), [ie, De] = N(null), [ae, gn] = N(null), [$e, pt] = N(!1), Be = E(!1), [yn, bn] = N(0), G = W(() => {
|
|
3437
3468
|
try {
|
|
3438
|
-
const I =
|
|
3439
|
-
return (I.sessionId || I.channelKey) &&
|
|
3469
|
+
const I = Un();
|
|
3470
|
+
return (I.sessionId || I.channelKey) && Mn(), I;
|
|
3440
3471
|
} catch {
|
|
3441
3472
|
return { parameters: {} };
|
|
3442
3473
|
}
|
|
3443
3474
|
}, []);
|
|
3444
|
-
m !== !1 &&
|
|
3445
|
-
const
|
|
3446
|
-
We && !
|
|
3447
|
-
|
|
3475
|
+
m !== !1 && Cn();
|
|
3476
|
+
const ce = W(() => c?.enabled ? rn() : null, [c?.enabled, yn]), Te = u?.enabled ?? !1, Fe = u?.host ?? "localhost", Ve = u?.port ?? 8443, We = !!c && !c.enabled && !!c.spaceId && (gt() || Te);
|
|
3477
|
+
We && !ae && !$e && !Be.current && (Be.current = !0, Ee(c.authUrl).then((I) => sn(c.spaceId, I)).then((I) => {
|
|
3478
|
+
gn(I.token), pt(!0);
|
|
3448
3479
|
}).catch((I) => {
|
|
3449
3480
|
Ne.error("Anonymous auth failed:", I), Be.current = !1, Te ? pt(!0) : x(I instanceof Error ? I.message : "Anonymous auth failed");
|
|
3450
3481
|
}));
|
|
@@ -3452,13 +3483,13 @@ function ni(t) {
|
|
|
3452
3483
|
if (Te) {
|
|
3453
3484
|
if (We && !$e)
|
|
3454
3485
|
return null;
|
|
3455
|
-
const I =
|
|
3486
|
+
const I = ce?.token ?? ae ?? void 0, q = I ? yt(I) ?? void 0 : void 0;
|
|
3456
3487
|
return {
|
|
3457
3488
|
local: {
|
|
3458
3489
|
host: Fe,
|
|
3459
3490
|
httpsPort: Ve,
|
|
3460
3491
|
userId: q,
|
|
3461
|
-
token:
|
|
3492
|
+
token: ce?.token ?? void 0,
|
|
3462
3493
|
spaceId: c?.spaceId,
|
|
3463
3494
|
backendUrl: c?.backendUrl,
|
|
3464
3495
|
authUrl: c?.authUrl,
|
|
@@ -3466,18 +3497,18 @@ function ni(t) {
|
|
|
3466
3497
|
}
|
|
3467
3498
|
};
|
|
3468
3499
|
}
|
|
3469
|
-
return
|
|
3500
|
+
return ce?.token && c?.spaceId ? {
|
|
3470
3501
|
sessionToken: {
|
|
3471
|
-
token:
|
|
3502
|
+
token: ce.token,
|
|
3472
3503
|
spaceId: c.spaceId,
|
|
3473
3504
|
backendType: bt(),
|
|
3474
3505
|
sessionId: G.sessionId,
|
|
3475
3506
|
channelKey: G.channelKey,
|
|
3476
3507
|
parameters: G.parameters
|
|
3477
3508
|
}
|
|
3478
|
-
} :
|
|
3509
|
+
} : ae && c?.spaceId ? {
|
|
3479
3510
|
sessionToken: {
|
|
3480
|
-
token:
|
|
3511
|
+
token: ae,
|
|
3481
3512
|
spaceId: c.spaceId,
|
|
3482
3513
|
backendType: bt(),
|
|
3483
3514
|
sessionId: G.sessionId,
|
|
@@ -3494,21 +3525,21 @@ function ni(t) {
|
|
|
3494
3525
|
parameters: G.parameters
|
|
3495
3526
|
}
|
|
3496
3527
|
};
|
|
3497
|
-
}, [Te, Fe, Ve,
|
|
3498
|
-
V.current = c?.spaceId ?? "local", K.current =
|
|
3499
|
-
const
|
|
3528
|
+
}, [Te, Fe, Ve, ce?.token, c?.spaceId, c?.backendUrl, c?.authUrl, ae, We, $e, G.sessionId, G.channelKey, G.parameters]);
|
|
3529
|
+
V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0, so(ie);
|
|
3530
|
+
const Sn = ao(ie);
|
|
3500
3531
|
C(() => {
|
|
3501
3532
|
if (!R.current) {
|
|
3502
|
-
if (R.current = !0,
|
|
3533
|
+
if (R.current = !0, S.current = Jr(), n)
|
|
3503
3534
|
for (const I of n)
|
|
3504
|
-
I(
|
|
3505
|
-
|
|
3535
|
+
I(S.current);
|
|
3536
|
+
S.current.loadRegisteredModules().catch((I) => {
|
|
3506
3537
|
Ne.error("Failed to load UI modules", I);
|
|
3507
3538
|
});
|
|
3508
3539
|
}
|
|
3509
3540
|
}, []), C(() => {
|
|
3510
3541
|
if (!Ke) return;
|
|
3511
|
-
const I = new
|
|
3542
|
+
const I = new jn({
|
|
3512
3543
|
...Ke,
|
|
3513
3544
|
timeouts: U.current,
|
|
3514
3545
|
audio: te.current !== void 0 || T.current ? {
|
|
@@ -3519,7 +3550,7 @@ function ni(t) {
|
|
|
3519
3550
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3520
3551
|
webRtc: ee.current === !1 ? { enabled: !1 } : void 0,
|
|
3521
3552
|
websocket: _.current,
|
|
3522
|
-
webtransport:
|
|
3553
|
+
webtransport: P.current,
|
|
3523
3554
|
proxy: M.current,
|
|
3524
3555
|
onConnectionStateChange: (J) => {
|
|
3525
3556
|
Re(J);
|
|
@@ -3529,53 +3560,53 @@ function ni(t) {
|
|
|
3529
3560
|
}
|
|
3530
3561
|
});
|
|
3531
3562
|
p.current = I;
|
|
3532
|
-
const q = B.current ?? !0, ke = K.current, mt = ke ? yt(ke) ?? null : null,
|
|
3533
|
-
|
|
3534
|
-
const
|
|
3563
|
+
const q = B.current ?? !0, ke = K.current, mt = ke ? yt(ke) ?? null : null, En = q && mt ? { enabled: !0, appId: V.current, userId: mt } : void 0, Ce = new sr({ client: I, liveSnapshot: En, bootSnapshot: $.current });
|
|
3564
|
+
b.current = Ce, De(Ce), A(!1);
|
|
3565
|
+
const Rn = Ce.subscribeToUiUpdates(() => {
|
|
3535
3566
|
A(!0);
|
|
3536
3567
|
});
|
|
3537
3568
|
return I.connect().catch((J) => {
|
|
3538
|
-
if (Ne.error("Connection failed:", J), J instanceof
|
|
3539
|
-
|
|
3569
|
+
if (Ne.error("Connection failed:", J), J instanceof Dn) {
|
|
3570
|
+
me(J.reason);
|
|
3540
3571
|
return;
|
|
3541
3572
|
}
|
|
3542
|
-
if (J instanceof
|
|
3573
|
+
if (J instanceof $n) {
|
|
3543
3574
|
Q(!0);
|
|
3544
3575
|
return;
|
|
3545
3576
|
}
|
|
3546
|
-
J instanceof
|
|
3577
|
+
J instanceof Bn && !v.current && (v.current = !0, Ne.warn("Auth session appears stale, clearing and retrying"), Bt.clearAll(), g ? g.logout() : (Ue(), bn((An) => An + 1)));
|
|
3547
3578
|
}), () => {
|
|
3548
|
-
|
|
3579
|
+
Rn(), I.disconnect(), p.current = null, Ce.dispose(), b.current = null;
|
|
3549
3580
|
};
|
|
3550
3581
|
}, [Ke]);
|
|
3551
|
-
const
|
|
3582
|
+
const wn = D((I, q) => {
|
|
3552
3583
|
const ke = typeof q == "string" ? q : JSON.stringify(q ?? {});
|
|
3553
3584
|
p.current?.sendActionCall(I, ke);
|
|
3554
3585
|
}, []);
|
|
3555
3586
|
C(() => {
|
|
3556
3587
|
if (H !== "connecting") {
|
|
3557
|
-
|
|
3588
|
+
pe(!1);
|
|
3558
3589
|
return;
|
|
3559
3590
|
}
|
|
3560
|
-
const I = p.current?.slowConnectionThresholdMs ?? 5e3, q = setTimeout(() =>
|
|
3591
|
+
const I = p.current?.slowConnectionThresholdMs ?? 5e3, q = setTimeout(() => pe(!0), I);
|
|
3561
3592
|
return () => clearTimeout(q);
|
|
3562
3593
|
}, [H]);
|
|
3563
|
-
const
|
|
3594
|
+
const vn = H === "connected" || H === "reconnecting", Ge = f && H !== "offline";
|
|
3564
3595
|
return C(() => {
|
|
3565
3596
|
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(Ge));
|
|
3566
3597
|
}, [Ge]), {
|
|
3567
3598
|
connectionState: H,
|
|
3568
3599
|
error: O,
|
|
3569
|
-
accessDeniedReason:
|
|
3570
|
-
isServerFull:
|
|
3571
|
-
stores:
|
|
3600
|
+
accessDeniedReason: se,
|
|
3601
|
+
isServerFull: L,
|
|
3602
|
+
stores: Sn,
|
|
3572
3603
|
client: p.current,
|
|
3573
|
-
registry:
|
|
3604
|
+
registry: S.current,
|
|
3574
3605
|
clientRef: p,
|
|
3575
|
-
uiRef:
|
|
3576
|
-
registryRef:
|
|
3577
|
-
onAction:
|
|
3578
|
-
isReady:
|
|
3606
|
+
uiRef: b,
|
|
3607
|
+
registryRef: S,
|
|
3608
|
+
onAction: wn,
|
|
3609
|
+
isReady: vn,
|
|
3579
3610
|
isLive: Ge,
|
|
3580
3611
|
brandingRequired: p.current?.brandingRequired ?? !1,
|
|
3581
3612
|
isConnectingSlow: Ae,
|
|
@@ -3583,7 +3614,7 @@ function ni(t) {
|
|
|
3583
3614
|
webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3584
3615
|
};
|
|
3585
3616
|
}
|
|
3586
|
-
function
|
|
3617
|
+
function ii(t) {
|
|
3587
3618
|
const e = E(!1);
|
|
3588
3619
|
return D(() => {
|
|
3589
3620
|
if (e.current) return;
|
|
@@ -3592,8 +3623,8 @@ function ri(t) {
|
|
|
3592
3623
|
n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
3593
3624
|
}, [t]);
|
|
3594
3625
|
}
|
|
3595
|
-
let
|
|
3596
|
-
function
|
|
3626
|
+
let As = 0;
|
|
3627
|
+
function Ts(t = 5, e = 5e3) {
|
|
3597
3628
|
const [n, r] = N([]), o = E(/* @__PURE__ */ new Map()), s = D((i) => {
|
|
3598
3629
|
const a = o.current.get(i);
|
|
3599
3630
|
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((d) => d.id !== i));
|
|
@@ -3603,7 +3634,7 @@ function Es(t = 5, e = 5e3) {
|
|
|
3603
3634
|
(l) => {
|
|
3604
3635
|
if (!Kt())
|
|
3605
3636
|
return;
|
|
3606
|
-
const d = `toast-${++
|
|
3637
|
+
const d = `toast-${++As}`, h = l.level === Qe.ERROR ? "error" : "warn", y = {
|
|
3607
3638
|
id: d,
|
|
3608
3639
|
level: h,
|
|
3609
3640
|
message: l.message,
|
|
@@ -3625,7 +3656,7 @@ function Es(t = 5, e = 5e3) {
|
|
|
3625
3656
|
};
|
|
3626
3657
|
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3627
3658
|
}
|
|
3628
|
-
function
|
|
3659
|
+
function ks(t, e, n) {
|
|
3629
3660
|
const [r, o] = N(n);
|
|
3630
3661
|
return C(() => {
|
|
3631
3662
|
if (!t)
|
|
@@ -3642,7 +3673,7 @@ function Rs(t, e, n) {
|
|
|
3642
3673
|
};
|
|
3643
3674
|
}, [t, e]), r;
|
|
3644
3675
|
}
|
|
3645
|
-
function
|
|
3676
|
+
function ai(t, e, n) {
|
|
3646
3677
|
const [r, o] = N(null);
|
|
3647
3678
|
return C(() => {
|
|
3648
3679
|
if (!t)
|
|
@@ -3655,58 +3686,58 @@ function oi(t, e, n) {
|
|
|
3655
3686
|
}), () => {
|
|
3656
3687
|
s = !1;
|
|
3657
3688
|
};
|
|
3658
|
-
}, [t, e]),
|
|
3689
|
+
}, [t, e]), ks(r ? t : null, r ?? "", n);
|
|
3659
3690
|
}
|
|
3660
|
-
const ue =
|
|
3691
|
+
const ue = oe("IkonDebug"), Cs = {
|
|
3661
3692
|
Digit1: "connecting",
|
|
3662
3693
|
Digit2: "connected",
|
|
3663
3694
|
Digit3: "reconnecting",
|
|
3664
3695
|
Digit4: "offline",
|
|
3665
3696
|
Digit5: "offline",
|
|
3666
3697
|
Digit0: "clear"
|
|
3667
|
-
},
|
|
3668
|
-
function
|
|
3698
|
+
}, Is = "Digit5", _s = "Digit6", Os = "Synthetic debug error (Ctrl+Shift+5)", Ns = "Synthetic debug access-denied (Ctrl+Shift+6)", xs = 5e3;
|
|
3699
|
+
function Ls(t) {
|
|
3669
3700
|
const e = Kt(), [n, r] = N(null), [o, s] = N(!1), [i, a] = N(null), [l, d] = N(null), [h, y] = N(!1), [m, c] = N(!1), [u, g] = N(!1);
|
|
3670
3701
|
return C(() => {
|
|
3671
3702
|
if (!e)
|
|
3672
3703
|
return;
|
|
3673
|
-
const
|
|
3674
|
-
if (!
|
|
3704
|
+
const b = (S) => {
|
|
3705
|
+
if (!S.ctrlKey || !S.shiftKey)
|
|
3675
3706
|
return;
|
|
3676
|
-
if (
|
|
3677
|
-
|
|
3707
|
+
if (S.code === "KeyE") {
|
|
3708
|
+
S.preventDefault(), y((T) => (ue.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
|
|
3678
3709
|
return;
|
|
3679
3710
|
}
|
|
3680
|
-
if (
|
|
3681
|
-
|
|
3711
|
+
if (S.code === "Digit7") {
|
|
3712
|
+
S.preventDefault(), c((T) => (ue.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
|
|
3682
3713
|
return;
|
|
3683
3714
|
}
|
|
3684
|
-
if (
|
|
3685
|
-
|
|
3715
|
+
if (S.code === "Digit8") {
|
|
3716
|
+
S.preventDefault(), g((T) => (ue.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
|
|
3686
3717
|
return;
|
|
3687
3718
|
}
|
|
3688
|
-
if (
|
|
3689
|
-
|
|
3719
|
+
if (S.code === _s) {
|
|
3720
|
+
S.preventDefault(), d(Ns), r(null), a(null), ue.warn("Forced access denied");
|
|
3690
3721
|
return;
|
|
3691
3722
|
}
|
|
3692
|
-
const R =
|
|
3723
|
+
const R = Cs[S.code];
|
|
3693
3724
|
if (R === void 0)
|
|
3694
3725
|
return;
|
|
3695
|
-
if (
|
|
3726
|
+
if (S.preventDefault(), R === "clear") {
|
|
3696
3727
|
r(null), a(null), d(null), ue.warn("Cleared forced state");
|
|
3697
3728
|
return;
|
|
3698
3729
|
}
|
|
3699
|
-
const v =
|
|
3700
|
-
r(R), a(v ?
|
|
3730
|
+
const v = S.code === Is;
|
|
3731
|
+
r(R), a(v ? Os : null), d(null), ue.warn(`Forced state: ${R}${v ? " (with error)" : ""}`);
|
|
3701
3732
|
};
|
|
3702
|
-
return window.addEventListener("keydown",
|
|
3733
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3703
3734
|
}, [e]), C(() => {
|
|
3704
3735
|
if (n !== "connecting") {
|
|
3705
3736
|
s(!1);
|
|
3706
3737
|
return;
|
|
3707
3738
|
}
|
|
3708
|
-
const
|
|
3709
|
-
return () => clearTimeout(
|
|
3739
|
+
const b = setTimeout(() => s(!0), xs);
|
|
3740
|
+
return () => clearTimeout(b);
|
|
3710
3741
|
}, [n]), !e || n === null && !h && l === null && !m && !u ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
|
|
3711
3742
|
...t,
|
|
3712
3743
|
connectionState: n ?? t.connectionState,
|
|
@@ -3716,34 +3747,34 @@ function Os(t) {
|
|
|
3716
3747
|
accessDeniedReason: l ?? t.accessDeniedReason
|
|
3717
3748
|
}, forcedState: n, emptyStores: h, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
|
|
3718
3749
|
}
|
|
3719
|
-
function
|
|
3750
|
+
function Ps(t, e) {
|
|
3720
3751
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3721
3752
|
}
|
|
3722
|
-
function
|
|
3753
|
+
function Us(t) {
|
|
3723
3754
|
return t === void 0 ? null : typeof t == "function" ? t() : t;
|
|
3724
3755
|
}
|
|
3725
|
-
function
|
|
3756
|
+
function Ms(t, e) {
|
|
3726
3757
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3727
3758
|
}
|
|
3728
|
-
function
|
|
3759
|
+
function js(t, e) {
|
|
3729
3760
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3730
3761
|
}
|
|
3731
|
-
function
|
|
3732
|
-
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i =
|
|
3762
|
+
function ci(t) {
|
|
3763
|
+
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = Ls(s), { app: a } = i, { connectionState: l, isConnectingSlow: d, stores: h, registry: y, client: m, onAction: c, isReady: u, error: g, accessDeniedReason: p, brandingRequired: b } = a, S = b || i.forcedBranding, R = E(null);
|
|
3733
3764
|
if (h && y && (u || h.size > 0) && (R.current = { stores: h, registry: y, client: m }), p)
|
|
3734
|
-
return
|
|
3765
|
+
return js(o, p);
|
|
3735
3766
|
const v = R.current;
|
|
3736
3767
|
let T = null;
|
|
3737
3768
|
switch (l) {
|
|
3738
3769
|
case "waitingForExternalConnectUrl":
|
|
3739
3770
|
case "connecting":
|
|
3740
|
-
T =
|
|
3771
|
+
T = Ps(e, d);
|
|
3741
3772
|
break;
|
|
3742
3773
|
case "reconnecting":
|
|
3743
|
-
T =
|
|
3774
|
+
T = Us(n);
|
|
3744
3775
|
break;
|
|
3745
3776
|
case "offline":
|
|
3746
|
-
T =
|
|
3777
|
+
T = Ms(r, g);
|
|
3747
3778
|
break;
|
|
3748
3779
|
default:
|
|
3749
3780
|
T = null;
|
|
@@ -3759,18 +3790,18 @@ function si(t) {
|
|
|
3759
3790
|
}
|
|
3760
3791
|
),
|
|
3761
3792
|
T,
|
|
3762
|
-
|
|
3763
|
-
/* @__PURE__ */ w.jsx(
|
|
3764
|
-
/* @__PURE__ */ w.jsx(
|
|
3793
|
+
S && /* @__PURE__ */ w.jsx($s, {}),
|
|
3794
|
+
/* @__PURE__ */ w.jsx(Bs, {}),
|
|
3795
|
+
/* @__PURE__ */ w.jsx(pn, { state: l, forceVisible: i.forcedDebugOverlay })
|
|
3765
3796
|
] });
|
|
3766
3797
|
}
|
|
3767
|
-
const
|
|
3768
|
-
function
|
|
3798
|
+
const Ds = "https://ikonai.com";
|
|
3799
|
+
function $s() {
|
|
3769
3800
|
return /* @__PURE__ */ w.jsxs(
|
|
3770
3801
|
"a",
|
|
3771
3802
|
{
|
|
3772
3803
|
className: "ikon-branding-banner",
|
|
3773
|
-
href:
|
|
3804
|
+
href: Ds,
|
|
3774
3805
|
target: "_blank",
|
|
3775
3806
|
rel: "noopener noreferrer",
|
|
3776
3807
|
style: {
|
|
@@ -3798,11 +3829,11 @@ function Ms() {
|
|
|
3798
3829
|
}
|
|
3799
3830
|
);
|
|
3800
3831
|
}
|
|
3801
|
-
function
|
|
3802
|
-
const { toasts: t, dismissToast: e } =
|
|
3803
|
-
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(
|
|
3832
|
+
function Bs() {
|
|
3833
|
+
const { toasts: t, dismissToast: e } = Ts();
|
|
3834
|
+
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(Fs, { toast: n, onDismiss: e }, n.id)) });
|
|
3804
3835
|
}
|
|
3805
|
-
function
|
|
3836
|
+
function Fs({ toast: t, onDismiss: e }) {
|
|
3806
3837
|
return /* @__PURE__ */ w.jsxs(
|
|
3807
3838
|
"div",
|
|
3808
3839
|
{
|
|
@@ -3823,110 +3854,110 @@ function Ds({ toast: t, onDismiss: e }) {
|
|
|
3823
3854
|
}
|
|
3824
3855
|
);
|
|
3825
3856
|
}
|
|
3826
|
-
const
|
|
3827
|
-
function
|
|
3857
|
+
const mn = Ft(null);
|
|
3858
|
+
function Vs(t, e) {
|
|
3828
3859
|
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3829
3860
|
}
|
|
3830
|
-
function
|
|
3831
|
-
const n =
|
|
3861
|
+
function Ws(t, e) {
|
|
3862
|
+
const n = Fn();
|
|
3832
3863
|
if (n && t.includes(n))
|
|
3833
3864
|
return n;
|
|
3834
3865
|
const r = navigator.language.split("-")[0];
|
|
3835
3866
|
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3836
3867
|
}
|
|
3837
|
-
function
|
|
3838
|
-
return e ?
|
|
3868
|
+
function Ks(t, e, n) {
|
|
3869
|
+
return e ? Ws(t, n) : n && t.includes(n) ? n : "en";
|
|
3839
3870
|
}
|
|
3840
|
-
function
|
|
3871
|
+
function li({
|
|
3841
3872
|
children: t,
|
|
3842
3873
|
translations: e,
|
|
3843
3874
|
defaultLanguage: n,
|
|
3844
3875
|
detectLanguage: r = !1
|
|
3845
3876
|
}) {
|
|
3846
|
-
const o = Object.keys(e), s =
|
|
3877
|
+
const o = Object.keys(e), s = Ks(o, r, n), i = e[s] ?? e.en, a = W(
|
|
3847
3878
|
() => ({
|
|
3848
3879
|
t: (l, d) => {
|
|
3849
3880
|
const h = i[l];
|
|
3850
|
-
return
|
|
3881
|
+
return Vs(h, d);
|
|
3851
3882
|
},
|
|
3852
3883
|
locale: s,
|
|
3853
3884
|
translations: i
|
|
3854
3885
|
}),
|
|
3855
3886
|
[i, s]
|
|
3856
3887
|
);
|
|
3857
|
-
return /* @__PURE__ */ w.jsx(
|
|
3888
|
+
return /* @__PURE__ */ w.jsx(mn, { value: a, children: t });
|
|
3858
3889
|
}
|
|
3859
|
-
function
|
|
3860
|
-
const t = ct(
|
|
3890
|
+
function ui() {
|
|
3891
|
+
const t = ct(mn);
|
|
3861
3892
|
if (!t)
|
|
3862
3893
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3863
3894
|
return t;
|
|
3864
3895
|
}
|
|
3865
3896
|
export {
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3897
|
+
ni as AuthProvider,
|
|
3898
|
+
oi as ConnectionStateRenderer,
|
|
3899
|
+
dn as DEBUG_OVERLAY_ENABLED,
|
|
3900
|
+
pn as DebugOverlay,
|
|
3901
|
+
li as I18nProvider,
|
|
3902
|
+
Sr as IKON_UI_BASE_MODULE,
|
|
3903
|
+
Nr as IKON_UI_MEDIA_MODULE,
|
|
3904
|
+
zr as IKON_UI_SHADERTOY_MODULE,
|
|
3905
|
+
Gr as IKON_UI_SHADERTOY_TYPE,
|
|
3875
3906
|
tt as IKON_UI_STREAM_CATEGORY,
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3907
|
+
kr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3908
|
+
Cr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3909
|
+
ci as IkonApp,
|
|
3910
|
+
sr as IkonUi,
|
|
3911
|
+
qr as IkonUiRegistry,
|
|
3881
3912
|
Gt as IkonUiSurface,
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3913
|
+
nr as InspectOverlay,
|
|
3914
|
+
Js as ParallaxView,
|
|
3915
|
+
tr as UiComponentRegistry,
|
|
3916
|
+
er as UiRenderer,
|
|
3917
|
+
hi as UiStreamStore,
|
|
3918
|
+
Zs as areIkonUiModuleListsEqual,
|
|
3919
|
+
sn as authenticateAnonymous,
|
|
3920
|
+
rs as buildOAuthRedirectUrl,
|
|
3890
3921
|
Ue as clearAuthSession,
|
|
3891
3922
|
jt as clearOAuthParams,
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3923
|
+
br as createBaseResolvers,
|
|
3924
|
+
Hs as createComponentLibrary,
|
|
3925
|
+
Jr as createIkonUiRegistry,
|
|
3926
|
+
_r as createMediaResolvers,
|
|
3927
|
+
Yr as createShadertoyRendererResolver,
|
|
3928
|
+
or as isIkonUiCategoryMatch,
|
|
3929
|
+
rn as loadAuthSession,
|
|
3930
|
+
wr as loadBaseModule,
|
|
3931
|
+
xr as loadMediaModule,
|
|
3932
|
+
Xr as loadShadertoyModule,
|
|
3933
|
+
To as normalizeIkonUiModuleList,
|
|
3934
|
+
ei as parseIkonUiInitPayload,
|
|
3935
|
+
ts as parseOAuthCallback,
|
|
3936
|
+
ns as parseOAuthError,
|
|
3937
|
+
mi as randomUuid,
|
|
3938
|
+
ko as readIkonUiModules,
|
|
3939
|
+
Qs as readIkonUiModulesFromSources,
|
|
3940
|
+
vr as registerBaseModule,
|
|
3941
|
+
Lr as registerMediaModule,
|
|
3942
|
+
Hr as registerShadertoyModule,
|
|
3943
|
+
Zn as renderChildren,
|
|
3944
|
+
ti as renderMotionLetters,
|
|
3945
|
+
he as saveAuthSession,
|
|
3946
|
+
Qo as sendLoginCode,
|
|
3947
|
+
ne as sessionToUser,
|
|
3948
|
+
gs as useAuth,
|
|
3949
|
+
ri as useAuthGuard,
|
|
3950
|
+
ys as useAuthOptional,
|
|
3951
|
+
ui as useI18n,
|
|
3952
|
+
si as useIkonApp,
|
|
3953
|
+
Ls as useIkonDebug,
|
|
3954
|
+
ks as useIkonReactive,
|
|
3955
|
+
so as useIkonStyles,
|
|
3956
|
+
ao as useIkonUiStores,
|
|
3957
|
+
ii as useLazyFont,
|
|
3958
|
+
ai as useReactive,
|
|
3959
|
+
Ts as useToasts,
|
|
3929
3960
|
Z as useUiNode,
|
|
3930
|
-
|
|
3931
|
-
|
|
3961
|
+
qs as useUiStore,
|
|
3962
|
+
es as verifyLoginCode
|
|
3932
3963
|
};
|