@ikonai/sdk-react-ui 1.0.79 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ikon-ui-registry.d.ts +3 -0
- package/index.js +723 -657
- package/package.json +1 -1
- package/renderer/component-library.d.ts +3 -0
- package/renderer/types.d.ts +8 -0
- package/renderer/unresolved-node.spec.d.ts +1 -0
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IkonUiCore as Sn, UiStreamStore as wn, LiveSnapshotCache as Ut, prefetchBootSnapshot as vn } from "@ikonai/sdk-ui";
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import En, { useSyncExternalStore as ot, useMemo as
|
|
4
|
-
import { createLogger as oe, isInspectModeEnabled as
|
|
5
|
-
import { randomUuid as
|
|
2
|
+
import { UiStreamStore as Ys } from "@ikonai/sdk-ui";
|
|
3
|
+
import En, { useSyncExternalStore as ot, useMemo as W, memo as Y, useRef as E, useCallback as j, Fragment as Rn, useState as x, useEffect as T, use as st, createContext as Mt, useReducer as An } from "react";
|
|
4
|
+
import { createLogger as oe, isInspectModeEnabled as kn, getOrCreateDeviceId as Tn, getSameOriginAuthUrl as Cn, abortSignalTimeout as Dt, deriveAuthUrl as ve, getDebugOverlayParam as _n, subscribeToLogEvents as jt, LogLevel as Je, parseUrlParams as In, clearSessionParamsFromUrl as xn, isCloudEnvironment as ht, extractUserIdFromToken as pt, deriveBackendType as mt, IkonClient as On, reportConnectTimeline as Nn, AccessDeniedError as Ln, ServerFullError as Pn, AuthenticationError as Un, isDebugModeEnabled as $t, getLangParam as Mn } from "@ikonai/sdk";
|
|
5
|
+
import { randomUuid as Xs } from "@ikonai/sdk";
|
|
6
6
|
var Ce = { exports: {} }, ge = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
@@ -48,12 +48,12 @@ var ye = {};
|
|
|
48
48
|
var yt;
|
|
49
49
|
function jn() {
|
|
50
50
|
return yt || (yt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
|
-
function t(
|
|
52
|
-
if (
|
|
53
|
-
if (typeof
|
|
54
|
-
return
|
|
55
|
-
if (typeof
|
|
56
|
-
switch (
|
|
51
|
+
function t(f) {
|
|
52
|
+
if (f == null) return null;
|
|
53
|
+
if (typeof f == "function")
|
|
54
|
+
return f.$$typeof === P ? null : f.displayName || f.name || null;
|
|
55
|
+
if (typeof f == "string") return f;
|
|
56
|
+
switch (f) {
|
|
57
57
|
case p:
|
|
58
58
|
return "Fragment";
|
|
59
59
|
case b:
|
|
@@ -67,127 +67,127 @@ function jn() {
|
|
|
67
67
|
case I:
|
|
68
68
|
return "Activity";
|
|
69
69
|
}
|
|
70
|
-
if (typeof
|
|
71
|
-
switch (typeof
|
|
70
|
+
if (typeof f == "object")
|
|
71
|
+
switch (typeof f.tag == "number" && console.error(
|
|
72
72
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
|
-
),
|
|
73
|
+
), f.$$typeof) {
|
|
74
74
|
case y:
|
|
75
75
|
return "Portal";
|
|
76
76
|
case v:
|
|
77
|
-
return
|
|
77
|
+
return f.displayName || "Context";
|
|
78
78
|
case R:
|
|
79
|
-
return (
|
|
80
|
-
case
|
|
81
|
-
var A =
|
|
82
|
-
return
|
|
79
|
+
return (f._context.displayName || "Context") + ".Consumer";
|
|
80
|
+
case k:
|
|
81
|
+
var A = f.render;
|
|
82
|
+
return f = f.displayName, f || (f = A.displayName || A.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
83
83
|
case te:
|
|
84
|
-
return A =
|
|
84
|
+
return A = f.displayName || null, A !== null ? A : t(f.type) || "Memo";
|
|
85
85
|
case z:
|
|
86
|
-
A =
|
|
86
|
+
A = f._payload, f = f._init;
|
|
87
87
|
try {
|
|
88
|
-
return t(
|
|
88
|
+
return t(f(A));
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
-
function e(
|
|
95
|
-
return "" +
|
|
94
|
+
function e(f) {
|
|
95
|
+
return "" + f;
|
|
96
96
|
}
|
|
97
|
-
function n(
|
|
97
|
+
function n(f) {
|
|
98
98
|
try {
|
|
99
|
-
e(
|
|
99
|
+
e(f);
|
|
100
100
|
var A = !1;
|
|
101
101
|
} catch {
|
|
102
102
|
A = !0;
|
|
103
103
|
}
|
|
104
104
|
if (A) {
|
|
105
105
|
A = console;
|
|
106
|
-
var O = A.error, N = typeof Symbol == "function" && Symbol.toStringTag &&
|
|
106
|
+
var O = A.error, N = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
|
|
107
107
|
return O.call(
|
|
108
108
|
A,
|
|
109
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
110
|
N
|
|
111
|
-
), e(
|
|
111
|
+
), e(f);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function r(
|
|
115
|
-
if (
|
|
116
|
-
if (typeof
|
|
114
|
+
function r(f) {
|
|
115
|
+
if (f === p) return "<>";
|
|
116
|
+
if (typeof f == "object" && f !== null && f.$$typeof === z)
|
|
117
117
|
return "<...>";
|
|
118
118
|
try {
|
|
119
|
-
var A = t(
|
|
119
|
+
var A = t(f);
|
|
120
120
|
return A ? "<" + A + ">" : "<...>";
|
|
121
121
|
} catch {
|
|
122
122
|
return "<...>";
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
function o() {
|
|
126
|
-
var
|
|
127
|
-
return
|
|
126
|
+
var f = M.A;
|
|
127
|
+
return f === null ? null : f.getOwner();
|
|
128
128
|
}
|
|
129
129
|
function s() {
|
|
130
130
|
return Error("react-stack-top-frame");
|
|
131
131
|
}
|
|
132
|
-
function i(
|
|
133
|
-
if (B.call(
|
|
134
|
-
var A = Object.getOwnPropertyDescriptor(
|
|
132
|
+
function i(f) {
|
|
133
|
+
if (B.call(f, "key")) {
|
|
134
|
+
var A = Object.getOwnPropertyDescriptor(f, "key").get;
|
|
135
135
|
if (A && A.isReactWarning) return !1;
|
|
136
136
|
}
|
|
137
|
-
return
|
|
137
|
+
return f.key !== void 0;
|
|
138
138
|
}
|
|
139
|
-
function a(
|
|
139
|
+
function a(f, A) {
|
|
140
140
|
function O() {
|
|
141
141
|
K || (K = !0, console.error(
|
|
142
142
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
143
143
|
A
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
O.isReactWarning = !0, Object.defineProperty(
|
|
146
|
+
O.isReactWarning = !0, Object.defineProperty(f, "key", {
|
|
147
147
|
get: O,
|
|
148
148
|
configurable: !0
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
function l() {
|
|
152
|
-
var
|
|
153
|
-
return
|
|
152
|
+
var f = t(this.type);
|
|
153
|
+
return q[f] || (q[f] = !0, console.error(
|
|
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
|
|
157
|
+
function d(f, A, O, N, se, me) {
|
|
158
158
|
var L = O.ref;
|
|
159
|
-
return
|
|
159
|
+
return f = {
|
|
160
160
|
$$typeof: u,
|
|
161
|
-
type:
|
|
161
|
+
type: f,
|
|
162
162
|
key: A,
|
|
163
163
|
props: O,
|
|
164
164
|
_owner: N
|
|
165
|
-
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(
|
|
165
|
+
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(f, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
get: l
|
|
168
|
-
}) : Object.defineProperty(
|
|
168
|
+
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
169
169
|
configurable: !1,
|
|
170
170
|
enumerable: !1,
|
|
171
171
|
writable: !0,
|
|
172
172
|
value: 0
|
|
173
|
-
}), Object.defineProperty(
|
|
173
|
+
}), Object.defineProperty(f, "_debugInfo", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
176
176
|
writable: !0,
|
|
177
177
|
value: null
|
|
178
|
-
}), Object.defineProperty(
|
|
178
|
+
}), Object.defineProperty(f, "_debugStack", {
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
182
|
value: se
|
|
183
|
-
}), Object.defineProperty(
|
|
183
|
+
}), Object.defineProperty(f, "_debugTask", {
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
187
|
value: me
|
|
188
|
-
}), Object.freeze && (Object.freeze(
|
|
188
|
+
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
189
189
|
}
|
|
190
|
-
function f
|
|
190
|
+
function h(f, A, O, N, se, me) {
|
|
191
191
|
var L = A.children;
|
|
192
192
|
if (L !== void 0)
|
|
193
193
|
if (N)
|
|
@@ -201,7 +201,7 @@ function jn() {
|
|
|
201
201
|
);
|
|
202
202
|
else g(L);
|
|
203
203
|
if (B.call(A, "key")) {
|
|
204
|
-
L = t(
|
|
204
|
+
L = t(f);
|
|
205
205
|
var Q = Object.keys(A).filter(function(Me) {
|
|
206
206
|
return Me !== "key";
|
|
207
207
|
});
|
|
@@ -225,9 +225,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
225
225
|
} else O = A;
|
|
226
226
|
return L && a(
|
|
227
227
|
O,
|
|
228
|
-
typeof
|
|
229
|
-
),
|
|
230
|
-
|
|
228
|
+
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
229
|
+
), d(
|
|
230
|
+
f,
|
|
231
231
|
L,
|
|
232
232
|
O,
|
|
233
233
|
o(),
|
|
@@ -235,43 +235,43 @@ React keys must be passed directly to JSX without using spread:
|
|
|
235
235
|
me
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function g(
|
|
239
|
-
m(
|
|
238
|
+
function g(f) {
|
|
239
|
+
m(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === z && (f._payload.status === "fulfilled" ? m(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
240
240
|
}
|
|
241
|
-
function m(
|
|
242
|
-
return typeof
|
|
241
|
+
function m(f) {
|
|
242
|
+
return typeof f == "object" && f !== null && f.$$typeof === u;
|
|
243
243
|
}
|
|
244
|
-
var c = En, u = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), v = Symbol.for("react.context"),
|
|
244
|
+
var c = En, u = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), v = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), P = Symbol.for("react.client.reference"), M = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, $ = Array.isArray, V = console.createTask ? console.createTask : function() {
|
|
245
245
|
return null;
|
|
246
246
|
};
|
|
247
247
|
c = {
|
|
248
|
-
react_stack_bottom_frame: function(
|
|
249
|
-
return
|
|
248
|
+
react_stack_bottom_frame: function(f) {
|
|
249
|
+
return f();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var K,
|
|
252
|
+
var K, q = {}, Ee = c.react_stack_bottom_frame.bind(
|
|
253
253
|
c,
|
|
254
254
|
s
|
|
255
|
-
)(), Re =
|
|
256
|
-
ye.Fragment = p, ye.jsx = function(
|
|
255
|
+
)(), Re = V(r(s)), pe = {};
|
|
256
|
+
ye.Fragment = p, ye.jsx = function(f, A, O) {
|
|
257
257
|
var N = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
258
|
-
return
|
|
259
|
-
|
|
258
|
+
return h(
|
|
259
|
+
f,
|
|
260
260
|
A,
|
|
261
261
|
O,
|
|
262
262
|
!1,
|
|
263
263
|
N ? Error("react-stack-top-frame") : Ee,
|
|
264
|
-
N ?
|
|
264
|
+
N ? V(r(f)) : Re
|
|
265
265
|
);
|
|
266
|
-
}, ye.jsxs = function(
|
|
266
|
+
}, ye.jsxs = function(f, A, O) {
|
|
267
267
|
var N = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
268
|
-
return
|
|
269
|
-
|
|
268
|
+
return h(
|
|
269
|
+
f,
|
|
270
270
|
A,
|
|
271
271
|
O,
|
|
272
272
|
!0,
|
|
273
273
|
N ? Error("react-stack-top-frame") : Ee,
|
|
274
|
-
N ?
|
|
274
|
+
N ? V(r(f)) : Re
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
277
|
})()), ye;
|
|
@@ -293,7 +293,7 @@ function Bn(t, e) {
|
|
|
293
293
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
|
-
return
|
|
296
|
+
return W(() => {
|
|
297
297
|
const [r, o] = n.split(":");
|
|
298
298
|
return {
|
|
299
299
|
rootViewId: r || void 0,
|
|
@@ -301,13 +301,13 @@ function Bn(t, e) {
|
|
|
301
301
|
};
|
|
302
302
|
}, [n]);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function H(t, e) {
|
|
305
305
|
const n = ot(
|
|
306
306
|
(r) => t.subscribeNode(e, r),
|
|
307
307
|
() => t.getNodeVersion(e),
|
|
308
308
|
() => t.getNodeVersion(e)
|
|
309
309
|
);
|
|
310
|
-
return
|
|
310
|
+
return W(() => t.getNode(e), [t, e, n]);
|
|
311
311
|
}
|
|
312
312
|
const Fn = oe("UIRenderer");
|
|
313
313
|
function Wn(t) {
|
|
@@ -325,14 +325,60 @@ function Vn(t) {
|
|
|
325
325
|
const e = t.styleIds;
|
|
326
326
|
return Array.isArray(e) ? e : [];
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
const Kn = 1500;
|
|
329
|
+
function Gn(t) {
|
|
330
|
+
const [e, n] = x(0);
|
|
331
|
+
return T(() => {
|
|
332
|
+
if (t.subscribe)
|
|
333
|
+
return t.subscribe(() => n((r) => r + 1));
|
|
334
|
+
}, [t]), e;
|
|
335
|
+
}
|
|
336
|
+
function Yn({ nodeType: t, nodeId: e, context: n, className: r }) {
|
|
337
|
+
const [o, s] = x(!1), i = H(n.store, e), a = Gn(n.library), l = W(
|
|
338
|
+
() => i ? n.library.resolve(i) : void 0,
|
|
339
|
+
// `revision` is not read here — it is the signal that `resolve` may now return something new.
|
|
340
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
341
|
+
[n.library, i, a]
|
|
342
|
+
);
|
|
343
|
+
if (T(() => {
|
|
344
|
+
const d = setTimeout(() => s(!0), Kn);
|
|
345
|
+
return () => clearTimeout(d);
|
|
346
|
+
}, [t]), T(() => {
|
|
347
|
+
!o || l || Fn.error(
|
|
348
|
+
`No React resolver is registered for node type '${t}', so it renders as an error placeholder instead of the component you expected. A custom node needs all four parts: (1) the React component, (2) a resolver that matches '${t}', (3) a registerModule(...) call for it in app.tsx, and (4) the C# view.AddNode("${t}", ...) extension. Prefer native view.* components where they fit.`
|
|
349
|
+
);
|
|
350
|
+
}, [o, l, t]), l) {
|
|
351
|
+
const d = l;
|
|
352
|
+
return /* @__PURE__ */ w.jsx(d, { nodeId: e, context: n, className: r });
|
|
353
|
+
}
|
|
354
|
+
return o ? /* @__PURE__ */ w.jsx(
|
|
355
|
+
"div",
|
|
356
|
+
{
|
|
357
|
+
"data-ikon-node-id": e,
|
|
358
|
+
"data-ikon-unresolved-node": t,
|
|
359
|
+
role: "alert",
|
|
360
|
+
style: {
|
|
361
|
+
padding: "12px 16px",
|
|
362
|
+
border: "2px dashed #ef4444",
|
|
363
|
+
borderRadius: 8,
|
|
364
|
+
background: "rgba(239, 68, 68, 0.08)",
|
|
365
|
+
color: "#ef4444",
|
|
366
|
+
font: "600 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
367
|
+
whiteSpace: "pre-wrap"
|
|
368
|
+
},
|
|
369
|
+
children: `Unregistered node type: ${t}
|
|
370
|
+
No React resolver is registered for it — register the component's module in app.tsx (see the console for details).`
|
|
371
|
+
}
|
|
372
|
+
) : null;
|
|
373
|
+
}
|
|
374
|
+
function zn(t) {
|
|
329
375
|
const e = t.children;
|
|
330
376
|
return Array.isArray(e) ? e : [];
|
|
331
377
|
}
|
|
332
|
-
function
|
|
378
|
+
function Xn(t, e) {
|
|
333
379
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
334
380
|
}
|
|
335
|
-
function
|
|
381
|
+
function Hn(t) {
|
|
336
382
|
if (t.length === 0) return "";
|
|
337
383
|
if (t.length === 1) return t[0].id;
|
|
338
384
|
let e = t[0].id;
|
|
@@ -340,8 +386,8 @@ function Gn(t) {
|
|
|
340
386
|
e += "," + t[n].id;
|
|
341
387
|
return e;
|
|
342
388
|
}
|
|
343
|
-
const Ze =
|
|
344
|
-
const r =
|
|
389
|
+
const Ze = Y(function t({ nodeId: e, context: n }) {
|
|
390
|
+
const r = H(n.store, e), o = r ? zn(r) : [], s = Hn(o), i = W(
|
|
345
391
|
() => o.length === 0 ? null : o.map((g) => /* @__PURE__ */ w.jsx(t, { nodeId: g.id, context: n }, g.id)),
|
|
346
392
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
347
393
|
[s, n]
|
|
@@ -350,21 +396,21 @@ const Ze = G(function t({ nodeId: e, context: n }) {
|
|
|
350
396
|
return null;
|
|
351
397
|
if (r.type === "root")
|
|
352
398
|
return /* @__PURE__ */ w.jsx(Rn, { children: i }, r.id);
|
|
353
|
-
const a = n.library.resolve(r);
|
|
354
|
-
if (!
|
|
355
|
-
return
|
|
356
|
-
const
|
|
357
|
-
return /* @__PURE__ */ w.jsx(
|
|
358
|
-
},
|
|
359
|
-
function
|
|
399
|
+
const a = Vn(r), l = a.length > 0 ? a.join(" ") : void 0, d = n.library.resolve(r);
|
|
400
|
+
if (!d)
|
|
401
|
+
return /* @__PURE__ */ w.jsx(Yn, { nodeType: r.type, nodeId: r.id, context: n, className: l });
|
|
402
|
+
const h = d;
|
|
403
|
+
return /* @__PURE__ */ w.jsx(h, { nodeId: e, context: n, className: l });
|
|
404
|
+
}, Xn);
|
|
405
|
+
function qn(t, e) {
|
|
360
406
|
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ w.jsx(Ze, { nodeId: n.id, context: e }, n.id));
|
|
361
407
|
}
|
|
362
|
-
function
|
|
408
|
+
function Jn(t, e) {
|
|
363
409
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
364
410
|
}
|
|
365
|
-
const
|
|
366
|
-
const { rootViewId: l, rootNodeId:
|
|
367
|
-
|
|
411
|
+
const Zn = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
412
|
+
const { rootViewId: l, rootNodeId: d } = Bn(e, r), h = E(s);
|
|
413
|
+
h.current = s;
|
|
368
414
|
const g = E(i);
|
|
369
415
|
g.current = i;
|
|
370
416
|
const m = E(a);
|
|
@@ -373,15 +419,15 @@ const Hn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
373
419
|
if (!y)
|
|
374
420
|
return;
|
|
375
421
|
const S = Wn(p);
|
|
376
|
-
|
|
377
|
-
}, []), u =
|
|
422
|
+
h.current?.(y, S);
|
|
423
|
+
}, []), u = W(() => {
|
|
378
424
|
const y = {
|
|
379
425
|
store: e,
|
|
380
426
|
library: n,
|
|
381
427
|
handlerCache: e.handlerCache,
|
|
382
428
|
// Access payloads from store at call time, not captured snapshot
|
|
383
429
|
getPayload: (p) => e.getSnapshot().payloads.get(p),
|
|
384
|
-
renderChildren: (p) =>
|
|
430
|
+
renderChildren: (p) => qn(p, y),
|
|
385
431
|
renderView: (p) => {
|
|
386
432
|
const S = e.getSnapshot().views.get(p);
|
|
387
433
|
return S ? /* @__PURE__ */ w.jsx(Ze, { nodeId: S.id, context: y }) : null;
|
|
@@ -397,39 +443,49 @@ const Hn = G(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
397
443
|
};
|
|
398
444
|
return y;
|
|
399
445
|
}, [e, n, c]);
|
|
400
|
-
return !l || !
|
|
401
|
-
},
|
|
402
|
-
class
|
|
446
|
+
return !l || !d ? o : /* @__PURE__ */ w.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ w.jsx(Ze, { nodeId: d, context: u }) });
|
|
447
|
+
}, Jn);
|
|
448
|
+
class Qn {
|
|
403
449
|
constructor(e, n) {
|
|
404
450
|
if (this.fallback = n, e)
|
|
405
451
|
for (const [r, o] of e)
|
|
406
452
|
this.renderers.set(r, o);
|
|
407
453
|
}
|
|
408
454
|
renderers = /* @__PURE__ */ new Map();
|
|
455
|
+
listeners = /* @__PURE__ */ new Set();
|
|
456
|
+
subscribe(e) {
|
|
457
|
+
return this.listeners.add(e), () => {
|
|
458
|
+
this.listeners.delete(e);
|
|
459
|
+
};
|
|
460
|
+
}
|
|
409
461
|
register(e, n) {
|
|
410
|
-
this.renderers.set(e, n);
|
|
462
|
+
this.renderers.set(e, n), this.notify();
|
|
411
463
|
}
|
|
412
464
|
setFallback(e) {
|
|
413
|
-
this.fallback = e;
|
|
465
|
+
this.fallback = e, this.notify();
|
|
414
466
|
}
|
|
415
467
|
resolve(e) {
|
|
416
468
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
417
469
|
}
|
|
470
|
+
notify() {
|
|
471
|
+
for (const e of this.listeners)
|
|
472
|
+
e();
|
|
473
|
+
}
|
|
418
474
|
}
|
|
419
|
-
function
|
|
475
|
+
function Os(t, e) {
|
|
420
476
|
const n = Object.entries(t);
|
|
421
|
-
return new
|
|
477
|
+
return new Qn(n, e);
|
|
422
478
|
}
|
|
423
|
-
function
|
|
479
|
+
function Ns(t) {
|
|
424
480
|
return ot(
|
|
425
481
|
(e) => t.subscribe(e),
|
|
426
482
|
() => t.getSnapshot(),
|
|
427
483
|
() => t.getSnapshot()
|
|
428
484
|
);
|
|
429
485
|
}
|
|
430
|
-
function
|
|
431
|
-
const t =
|
|
432
|
-
return
|
|
486
|
+
function er() {
|
|
487
|
+
const t = kn();
|
|
488
|
+
return T(() => {
|
|
433
489
|
if (!t)
|
|
434
490
|
return;
|
|
435
491
|
let e = window.parent === window, n = null, r = [];
|
|
@@ -465,7 +521,7 @@ function Jn() {
|
|
|
465
521
|
return;
|
|
466
522
|
c.relatedTarget?.closest?.("[data-ikon-source]") !== n && s();
|
|
467
523
|
}
|
|
468
|
-
function
|
|
524
|
+
function d(c) {
|
|
469
525
|
if (!e)
|
|
470
526
|
return;
|
|
471
527
|
const u = c.target.closest?.("[data-ikon-source]");
|
|
@@ -479,7 +535,7 @@ function Jn() {
|
|
|
479
535
|
};
|
|
480
536
|
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: y })), window.parent.postMessage({ type: "ikon-element-selected", payload: y }, "*");
|
|
481
537
|
}
|
|
482
|
-
function
|
|
538
|
+
function h(c, u) {
|
|
483
539
|
return document.elementFromPoint(c, u)?.closest?.("[data-ikon-source]");
|
|
484
540
|
}
|
|
485
541
|
function g(c) {
|
|
@@ -498,7 +554,7 @@ function Jn() {
|
|
|
498
554
|
return;
|
|
499
555
|
}
|
|
500
556
|
if (c.data?.type === "ikon-inspect-at") {
|
|
501
|
-
const u =
|
|
557
|
+
const u = h(c.data.x, c.data.y);
|
|
502
558
|
g(u);
|
|
503
559
|
const y = u?.getAttribute("data-ikon-source") ?? "";
|
|
504
560
|
window.parent.postMessage({
|
|
@@ -507,7 +563,7 @@ function Jn() {
|
|
|
507
563
|
}, "*");
|
|
508
564
|
}
|
|
509
565
|
if (c.data?.type === "ikon-inspect-click") {
|
|
510
|
-
const u =
|
|
566
|
+
const u = h(c.data.x, c.data.y);
|
|
511
567
|
if (u) {
|
|
512
568
|
const y = {
|
|
513
569
|
sourceMarker: u.getAttribute("data-ikon-source") ?? "",
|
|
@@ -518,7 +574,7 @@ function Jn() {
|
|
|
518
574
|
}
|
|
519
575
|
}
|
|
520
576
|
if (c.data?.type === "ikon-inspect-click-add") {
|
|
521
|
-
const u =
|
|
577
|
+
const u = h(c.data.x, c.data.y);
|
|
522
578
|
if (u) {
|
|
523
579
|
const y = {
|
|
524
580
|
sourceMarker: u.getAttribute("data-ikon-source") ?? "",
|
|
@@ -533,12 +589,12 @@ function Jn() {
|
|
|
533
589
|
}
|
|
534
590
|
if (c.data?.type === "ikon-inspect-rect") {
|
|
535
591
|
const { x1: u, y1: y, x2: p, y2: S, append: b } = c.data, R = document.querySelectorAll("[data-ikon-source]"), v = [];
|
|
536
|
-
for (const
|
|
537
|
-
const U =
|
|
592
|
+
for (const k of Array.from(R)) {
|
|
593
|
+
const U = k.getBoundingClientRect();
|
|
538
594
|
U.right > u && U.left < p && U.bottom > y && U.top < S && v.push({
|
|
539
|
-
sourceMarker:
|
|
540
|
-
tagName:
|
|
541
|
-
textContent: (
|
|
595
|
+
sourceMarker: k.getAttribute("data-ikon-source") ?? "",
|
|
596
|
+
tagName: k.tagName.toLowerCase(),
|
|
597
|
+
textContent: (k.textContent ?? "").trim().substring(0, 200)
|
|
542
598
|
});
|
|
543
599
|
}
|
|
544
600
|
v.length > 0 && window.parent.postMessage({
|
|
@@ -548,40 +604,40 @@ function Jn() {
|
|
|
548
604
|
}
|
|
549
605
|
c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
|
|
550
606
|
}
|
|
551
|
-
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click",
|
|
552
|
-
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click",
|
|
607
|
+
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click", d, !0), window.addEventListener("message", m), () => {
|
|
608
|
+
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click", d, !0), window.removeEventListener("message", m), s(), i([]), o.remove();
|
|
553
609
|
};
|
|
554
610
|
}, [t]), null;
|
|
555
611
|
}
|
|
556
|
-
const
|
|
557
|
-
function
|
|
612
|
+
const tr = oe("IkonUiSurface"), Qe = "ikon-ui";
|
|
613
|
+
function nr(t, e) {
|
|
558
614
|
return t === e;
|
|
559
615
|
}
|
|
560
|
-
const Bt =
|
|
561
|
-
const i =
|
|
616
|
+
const Bt = Y(function({ stores: e, registry: n, category: r = Qe, onAction: o, client: s }) {
|
|
617
|
+
const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = E(o);
|
|
562
618
|
a.current = o;
|
|
563
619
|
const l = E(s);
|
|
564
620
|
l.current = s;
|
|
565
|
-
const
|
|
621
|
+
const d = W(
|
|
566
622
|
() => {
|
|
567
623
|
const m = [];
|
|
568
624
|
for (const [c, u] of e) {
|
|
569
625
|
const y = u.store.getSnapshot();
|
|
570
|
-
|
|
626
|
+
nr(u.category, r) && (!y.rootViewId || !y.views.has(y.rootViewId) || m.push({ key: c, store: u.store }));
|
|
571
627
|
}
|
|
572
628
|
return m;
|
|
573
629
|
},
|
|
574
630
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
575
631
|
[e, r, i]
|
|
576
|
-
),
|
|
577
|
-
return
|
|
578
|
-
g && !
|
|
632
|
+
), h = E(!1), g = d.length > 0;
|
|
633
|
+
return T(() => {
|
|
634
|
+
g && !h.current && (h.current = !0, tr.debug("First UI render"));
|
|
579
635
|
}, [g]), g ? /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
580
|
-
/* @__PURE__ */ w.jsx(
|
|
581
|
-
|
|
636
|
+
/* @__PURE__ */ w.jsx(er, {}),
|
|
637
|
+
d.map(({ key: m, store: c }) => /* @__PURE__ */ w.jsx(Zn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, m))
|
|
582
638
|
] }) : null;
|
|
583
639
|
});
|
|
584
|
-
class
|
|
640
|
+
class rr {
|
|
585
641
|
core;
|
|
586
642
|
ownsCore;
|
|
587
643
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -684,7 +740,7 @@ class er {
|
|
|
684
740
|
n(e);
|
|
685
741
|
}
|
|
686
742
|
}
|
|
687
|
-
function
|
|
743
|
+
function or(t) {
|
|
688
744
|
if (typeof t == "string") {
|
|
689
745
|
const e = t.trim();
|
|
690
746
|
return e.length > 0 ? e : void 0;
|
|
@@ -709,8 +765,8 @@ function it(...t) {
|
|
|
709
765
|
}
|
|
710
766
|
return e || void 0;
|
|
711
767
|
}
|
|
712
|
-
const St = /* @__PURE__ */ new WeakMap(),
|
|
713
|
-
function
|
|
768
|
+
const St = /* @__PURE__ */ new WeakMap(), sr = {};
|
|
769
|
+
function ir(t) {
|
|
714
770
|
const e = {};
|
|
715
771
|
for (const n of t.split(";")) {
|
|
716
772
|
const r = n.indexOf(":");
|
|
@@ -722,13 +778,13 @@ function rr(t) {
|
|
|
722
778
|
}
|
|
723
779
|
return e;
|
|
724
780
|
}
|
|
725
|
-
function
|
|
781
|
+
function ar(t, e) {
|
|
726
782
|
const n = t && typeof t == "object" ? t : void 0;
|
|
727
783
|
return e ? { ...n ?? {}, cursor: e } : n;
|
|
728
784
|
}
|
|
729
785
|
function at(t) {
|
|
730
786
|
if (!t)
|
|
731
|
-
return
|
|
787
|
+
return sr;
|
|
732
788
|
const e = St.get(t);
|
|
733
789
|
if (e)
|
|
734
790
|
return e;
|
|
@@ -736,14 +792,14 @@ function at(t) {
|
|
|
736
792
|
for (const [r, o] of Object.entries(t))
|
|
737
793
|
if (o != null) {
|
|
738
794
|
if (r === "style" && typeof o == "string") {
|
|
739
|
-
n[r] =
|
|
795
|
+
n[r] = ir(o);
|
|
740
796
|
continue;
|
|
741
797
|
}
|
|
742
798
|
(typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
743
799
|
}
|
|
744
800
|
return St.set(t, n), n;
|
|
745
801
|
}
|
|
746
|
-
function
|
|
802
|
+
function cr(t) {
|
|
747
803
|
let e = t.parentElement;
|
|
748
804
|
for (; e; ) {
|
|
749
805
|
const r = window.getComputedStyle(e).overflowY;
|
|
@@ -760,20 +816,20 @@ function Wt(t, e) {
|
|
|
760
816
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
|
|
761
817
|
});
|
|
762
818
|
}
|
|
763
|
-
const et = "data-ikon-scroll-indicator",
|
|
819
|
+
const et = "data-ikon-scroll-indicator", lr = 0.15, Oe = "data-ikon-at-bottom";
|
|
764
820
|
function Vt(t) {
|
|
765
|
-
return Math.max(t.clientHeight *
|
|
821
|
+
return Math.max(t.clientHeight * lr, 20);
|
|
766
822
|
}
|
|
767
|
-
function
|
|
768
|
-
return t.getAttribute(
|
|
823
|
+
function ur(t) {
|
|
824
|
+
return t.getAttribute(Oe) !== "false";
|
|
769
825
|
}
|
|
770
|
-
function
|
|
771
|
-
t.getAttribute(
|
|
826
|
+
function dr(t) {
|
|
827
|
+
t.getAttribute(Oe) === null && (t.setAttribute(Oe, "true"), t.addEventListener("scroll", () => {
|
|
772
828
|
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Vt(t);
|
|
773
|
-
t.setAttribute(
|
|
829
|
+
t.setAttribute(Oe, s ? "true" : "false");
|
|
774
830
|
}, { passive: !0 }));
|
|
775
831
|
}
|
|
776
|
-
function
|
|
832
|
+
function fr(t) {
|
|
777
833
|
const e = t.parentElement ?? t, n = e.querySelector(`[${et}]`);
|
|
778
834
|
if (n)
|
|
779
835
|
return n;
|
|
@@ -806,8 +862,8 @@ function lr(t) {
|
|
|
806
862
|
r.style.opacity = "0.9";
|
|
807
863
|
}), e.appendChild(r), r;
|
|
808
864
|
}
|
|
809
|
-
function
|
|
810
|
-
const n =
|
|
865
|
+
function hr(t, e) {
|
|
866
|
+
const n = fr(t);
|
|
811
867
|
n.style.display = "flex";
|
|
812
868
|
const r = () => {
|
|
813
869
|
Wt(t, e), n.style.display = "none";
|
|
@@ -819,10 +875,10 @@ function ur(t, e) {
|
|
|
819
875
|
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
820
876
|
};
|
|
821
877
|
}
|
|
822
|
-
function
|
|
823
|
-
const t =
|
|
824
|
-
const o =
|
|
825
|
-
return
|
|
878
|
+
function pr() {
|
|
879
|
+
const t = Y(function({ nodeId: n, context: r }) {
|
|
880
|
+
const o = H(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), g = o?.props?.preciseGeneratedAt;
|
|
881
|
+
return T(() => {
|
|
826
882
|
if (typeof document > "u")
|
|
827
883
|
return;
|
|
828
884
|
const c = s.current;
|
|
@@ -830,18 +886,18 @@ function dr() {
|
|
|
830
886
|
return;
|
|
831
887
|
let u;
|
|
832
888
|
if (l !== !0) {
|
|
833
|
-
const b =
|
|
889
|
+
const b = cr(c);
|
|
834
890
|
if (b)
|
|
835
|
-
if (
|
|
836
|
-
u =
|
|
891
|
+
if (dr(b), d === "Polite" && !ur(b))
|
|
892
|
+
u = hr(b, c);
|
|
837
893
|
else {
|
|
838
894
|
const U = (b.parentElement ?? b).querySelector(`[${et}]`);
|
|
839
895
|
U && (U.style.display = "none"), Wt(b, c);
|
|
840
896
|
}
|
|
841
897
|
else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
842
|
-
const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0,
|
|
898
|
+
const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0, k = Math.abs(R) > v * Ft ? "auto" : "smooth";
|
|
843
899
|
try {
|
|
844
|
-
c.scrollIntoView({ behavior:
|
|
900
|
+
c.scrollIntoView({ behavior: k, block: "end", inline: "nearest" });
|
|
845
901
|
} catch {
|
|
846
902
|
c.scrollIntoView(!1);
|
|
847
903
|
}
|
|
@@ -855,7 +911,7 @@ function dr() {
|
|
|
855
911
|
c.focus();
|
|
856
912
|
}
|
|
857
913
|
return u;
|
|
858
|
-
}, [l,
|
|
914
|
+
}, [l, d, i, h, g]), o ? /* @__PURE__ */ w.jsx(
|
|
859
915
|
"span",
|
|
860
916
|
{
|
|
861
917
|
ref: s,
|
|
@@ -872,31 +928,31 @@ function dr() {
|
|
|
872
928
|
return t;
|
|
873
929
|
};
|
|
874
930
|
}
|
|
875
|
-
function
|
|
876
|
-
const t =
|
|
877
|
-
const s =
|
|
931
|
+
function mr() {
|
|
932
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
933
|
+
const s = H(r.store, n), i = or(s?.props?.onInvokeId), a = j(() => {
|
|
878
934
|
i && r.dispatchAction(i);
|
|
879
935
|
}, [i, r]);
|
|
880
936
|
if (!s)
|
|
881
937
|
return null;
|
|
882
938
|
const l = at(s.props);
|
|
883
939
|
delete l.onInvokeId;
|
|
884
|
-
const
|
|
940
|
+
const d = it(de(s.props?.className), o), h = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
885
941
|
return /* @__PURE__ */ w.jsx(
|
|
886
942
|
"div",
|
|
887
943
|
{
|
|
888
944
|
...l,
|
|
889
945
|
"data-ikon-node-id": s.id,
|
|
890
946
|
"data-ikon-source": s.sourceMarker,
|
|
891
|
-
className:
|
|
947
|
+
className: d,
|
|
892
948
|
onClick: i ? a : void 0,
|
|
893
949
|
role: i && !l.role ? "button" : l.role,
|
|
894
950
|
tabIndex: i && l.tabIndex === void 0 ? 0 : l.tabIndex,
|
|
895
951
|
onKeyDown: i ? (g) => {
|
|
896
952
|
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), a());
|
|
897
953
|
} : void 0,
|
|
898
|
-
style:
|
|
899
|
-
children:
|
|
954
|
+
style: ar(l.style, i ? "pointer" : void 0),
|
|
955
|
+
children: h
|
|
900
956
|
}
|
|
901
957
|
);
|
|
902
958
|
});
|
|
@@ -905,9 +961,9 @@ function fr() {
|
|
|
905
961
|
return t;
|
|
906
962
|
};
|
|
907
963
|
}
|
|
908
|
-
function
|
|
909
|
-
const t =
|
|
910
|
-
const s =
|
|
964
|
+
function gr() {
|
|
965
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
966
|
+
const s = H(r.store, n);
|
|
911
967
|
if (!s)
|
|
912
968
|
return null;
|
|
913
969
|
const i = at(s.props), a = it("relative", de(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
@@ -918,9 +974,9 @@ function hr() {
|
|
|
918
974
|
return t;
|
|
919
975
|
};
|
|
920
976
|
}
|
|
921
|
-
function
|
|
922
|
-
const t =
|
|
923
|
-
const s =
|
|
977
|
+
function yr() {
|
|
978
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
979
|
+
const s = H(r.store, n);
|
|
924
980
|
if (!s)
|
|
925
981
|
return null;
|
|
926
982
|
const i = at(s.props), a = it("absolute", de(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
@@ -931,19 +987,19 @@ function pr() {
|
|
|
931
987
|
return t;
|
|
932
988
|
};
|
|
933
989
|
}
|
|
934
|
-
function
|
|
990
|
+
function br() {
|
|
935
991
|
return [
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
992
|
+
mr(),
|
|
993
|
+
gr(),
|
|
994
|
+
yr(),
|
|
995
|
+
pr()
|
|
940
996
|
];
|
|
941
997
|
}
|
|
942
|
-
const
|
|
943
|
-
function
|
|
944
|
-
t.registerModule(
|
|
998
|
+
const Sr = "base", wr = async () => br();
|
|
999
|
+
function vr(t) {
|
|
1000
|
+
t.registerModule(Sr, wr);
|
|
945
1001
|
}
|
|
946
|
-
function
|
|
1002
|
+
function Er(t) {
|
|
947
1003
|
if (typeof t == "string") {
|
|
948
1004
|
const e = t.trim();
|
|
949
1005
|
return e.length > 0 ? e : void 0;
|
|
@@ -953,7 +1009,7 @@ function Sr(t) {
|
|
|
953
1009
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
954
1010
|
}
|
|
955
1011
|
}
|
|
956
|
-
function
|
|
1012
|
+
function Rr(...t) {
|
|
957
1013
|
const e = [];
|
|
958
1014
|
for (const n of t)
|
|
959
1015
|
n && n.trim() && e.push(n.trim());
|
|
@@ -974,38 +1030,38 @@ function _e(t) {
|
|
|
974
1030
|
if (e === "false") return !1;
|
|
975
1031
|
}
|
|
976
1032
|
}
|
|
977
|
-
const
|
|
978
|
-
function
|
|
979
|
-
const t =
|
|
1033
|
+
const Ar = "std.audio-url-player";
|
|
1034
|
+
function kr() {
|
|
1035
|
+
const t = Y(function({
|
|
980
1036
|
nodeId: n,
|
|
981
1037
|
context: r,
|
|
982
1038
|
className: o
|
|
983
1039
|
}) {
|
|
984
|
-
const s =
|
|
985
|
-
if (
|
|
1040
|
+
const s = H(r.store, n), i = E(null), a = s ? _e(s.props?.autoplay) : void 0, l = s ? wt(s.props?.src) : void 0;
|
|
1041
|
+
if (T(() => {
|
|
986
1042
|
a && i.current && i.current.play().catch(() => {
|
|
987
1043
|
});
|
|
988
1044
|
}, [a, l]), !s)
|
|
989
1045
|
return null;
|
|
990
|
-
const
|
|
1046
|
+
const d = Rr(Er(s.props?.className), o), h = wt(s.props?.preload), g = _e(s.props?.controls), m = _e(s.props?.loop), c = _e(s.props?.muted);
|
|
991
1047
|
return /* @__PURE__ */ w.jsx(
|
|
992
1048
|
"audio",
|
|
993
1049
|
{
|
|
994
1050
|
ref: i,
|
|
995
1051
|
src: l,
|
|
996
|
-
...
|
|
1052
|
+
...h !== void 0 ? { preload: h } : {},
|
|
997
1053
|
...g !== void 0 ? { controls: g } : {},
|
|
998
1054
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
999
1055
|
...m !== void 0 ? { loop: m } : {},
|
|
1000
1056
|
...c !== void 0 ? { muted: c } : {},
|
|
1001
1057
|
"data-ikon-node-id": s.id,
|
|
1002
1058
|
"data-ikon-source": s.sourceMarker,
|
|
1003
|
-
className:
|
|
1059
|
+
className: d
|
|
1004
1060
|
}
|
|
1005
1061
|
);
|
|
1006
1062
|
});
|
|
1007
1063
|
return ({ type: e }) => {
|
|
1008
|
-
if (e ===
|
|
1064
|
+
if (e === Ar)
|
|
1009
1065
|
return t;
|
|
1010
1066
|
};
|
|
1011
1067
|
}
|
|
@@ -1019,7 +1075,7 @@ function Kt(t) {
|
|
|
1019
1075
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1020
1076
|
}
|
|
1021
1077
|
}
|
|
1022
|
-
function
|
|
1078
|
+
function Gt(...t) {
|
|
1023
1079
|
const e = [];
|
|
1024
1080
|
for (const n of t)
|
|
1025
1081
|
n && n.trim() && e.push(n.trim());
|
|
@@ -1040,27 +1096,27 @@ function tt(t) {
|
|
|
1040
1096
|
const e = t.trim();
|
|
1041
1097
|
return e.length > 0 ? e : void 0;
|
|
1042
1098
|
}
|
|
1043
|
-
const
|
|
1044
|
-
function
|
|
1045
|
-
const t =
|
|
1046
|
-
const s =
|
|
1047
|
-
|
|
1048
|
-
if (!
|
|
1049
|
-
const p =
|
|
1050
|
-
return
|
|
1099
|
+
const Tr = "std.video-canvas", Cr = "std.video-url-player";
|
|
1100
|
+
function _r() {
|
|
1101
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
1102
|
+
const s = H(r.store, n), i = E(null), a = E(null), l = r.video, d = r.client, h = s ? tt(s.props?.streamId) : void 0, g = s ? Ne(s.props?.width) : void 0, m = s ? Ne(s.props?.height) : void 0, c = s ? Gt(Kt(s.props?.className), o) : o, [, u] = x(0);
|
|
1103
|
+
T(() => {
|
|
1104
|
+
if (!d?.isWebRtcEnabled) return;
|
|
1105
|
+
const p = d.onWebRtcTrackMapChanged;
|
|
1106
|
+
return d.onWebRtcTrackMapChanged = (S) => {
|
|
1051
1107
|
p?.(S), S.kind === "video" && u((b) => b + 1);
|
|
1052
1108
|
}, () => {
|
|
1053
|
-
|
|
1109
|
+
d.onWebRtcTrackMapChanged = p;
|
|
1054
1110
|
};
|
|
1055
|
-
}, [
|
|
1056
|
-
const y =
|
|
1057
|
-
return
|
|
1111
|
+
}, [d]);
|
|
1112
|
+
const y = d?.isWebRtcEnabled && h ? d.getWebRtcVideoStreamByStreamId(h) : null;
|
|
1113
|
+
return T(() => {
|
|
1058
1114
|
const p = i.current;
|
|
1059
|
-
if (!(!l || !p || !
|
|
1060
|
-
return l.attachCanvas(
|
|
1061
|
-
l.detachCanvas(
|
|
1115
|
+
if (!(!l || !p || !h || y))
|
|
1116
|
+
return l.attachCanvas(h, p), () => {
|
|
1117
|
+
l.detachCanvas(h);
|
|
1062
1118
|
};
|
|
1063
|
-
}, [l,
|
|
1119
|
+
}, [l, h, y]), T(() => {
|
|
1064
1120
|
const p = a.current;
|
|
1065
1121
|
if (!(!p || !y))
|
|
1066
1122
|
return p.srcObject = y, () => {
|
|
@@ -1075,33 +1131,33 @@ function Tr() {
|
|
|
1075
1131
|
muted: !0,
|
|
1076
1132
|
"data-ikon-node-id": s.id,
|
|
1077
1133
|
"data-ikon-source": s.sourceMarker,
|
|
1078
|
-
"data-ikon-video-stream-id":
|
|
1134
|
+
"data-ikon-video-stream-id": h,
|
|
1079
1135
|
className: c,
|
|
1080
1136
|
...g ? { width: g } : {},
|
|
1081
1137
|
...m ? { height: m } : {}
|
|
1082
1138
|
},
|
|
1083
|
-
|
|
1139
|
+
h
|
|
1084
1140
|
) : /* @__PURE__ */ w.jsx(
|
|
1085
1141
|
"canvas",
|
|
1086
1142
|
{
|
|
1087
1143
|
ref: i,
|
|
1088
1144
|
"data-ikon-node-id": s.id,
|
|
1089
1145
|
"data-ikon-source": s.sourceMarker,
|
|
1090
|
-
"data-ikon-video-stream-id":
|
|
1146
|
+
"data-ikon-video-stream-id": h,
|
|
1091
1147
|
className: c,
|
|
1092
1148
|
...g ? { width: g } : {},
|
|
1093
1149
|
...m ? { height: m } : {}
|
|
1094
1150
|
},
|
|
1095
|
-
|
|
1151
|
+
h
|
|
1096
1152
|
) : null;
|
|
1097
1153
|
});
|
|
1098
1154
|
return ({ type: e }) => {
|
|
1099
|
-
if (e ===
|
|
1155
|
+
if (e === Tr)
|
|
1100
1156
|
return t;
|
|
1101
1157
|
};
|
|
1102
1158
|
}
|
|
1103
|
-
function
|
|
1104
|
-
return [
|
|
1159
|
+
function Ir() {
|
|
1160
|
+
return [_r(), xr(), kr()];
|
|
1105
1161
|
}
|
|
1106
1162
|
function be(t) {
|
|
1107
1163
|
if (typeof t == "boolean")
|
|
@@ -1112,25 +1168,25 @@ function be(t) {
|
|
|
1112
1168
|
if (e === "false") return !1;
|
|
1113
1169
|
}
|
|
1114
1170
|
}
|
|
1115
|
-
function
|
|
1116
|
-
const t =
|
|
1171
|
+
function xr() {
|
|
1172
|
+
const t = Y(function({
|
|
1117
1173
|
nodeId: n,
|
|
1118
1174
|
context: r,
|
|
1119
1175
|
className: o
|
|
1120
1176
|
}) {
|
|
1121
|
-
const s =
|
|
1122
|
-
if (
|
|
1177
|
+
const s = H(r.store, n), i = E(null), a = s ? be(s.props?.autoplay) : void 0, l = s ? tt(s.props?.src) : void 0;
|
|
1178
|
+
if (T(() => {
|
|
1123
1179
|
a && i.current && i.current.play().catch(() => {
|
|
1124
1180
|
});
|
|
1125
1181
|
}, [a, l]), !s)
|
|
1126
1182
|
return null;
|
|
1127
|
-
const
|
|
1183
|
+
const d = Gt(Kt(s.props?.className), o), h = tt(s.props?.poster), g = be(s.props?.controls), m = be(s.props?.loop), c = be(s.props?.muted), u = be(s.props?.playsInline), y = Ne(s.props?.width), p = Ne(s.props?.height), S = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
1128
1184
|
return /* @__PURE__ */ w.jsx(
|
|
1129
1185
|
"video",
|
|
1130
1186
|
{
|
|
1131
1187
|
ref: i,
|
|
1132
1188
|
src: l,
|
|
1133
|
-
poster:
|
|
1189
|
+
poster: h,
|
|
1134
1190
|
...g !== void 0 ? { controls: g } : {},
|
|
1135
1191
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
1136
1192
|
...m !== void 0 ? { loop: m } : {},
|
|
@@ -1140,33 +1196,33 @@ function Cr() {
|
|
|
1140
1196
|
...p ? { height: p } : {},
|
|
1141
1197
|
"data-ikon-node-id": s.id,
|
|
1142
1198
|
"data-ikon-source": s.sourceMarker,
|
|
1143
|
-
className:
|
|
1199
|
+
className: d,
|
|
1144
1200
|
children: S
|
|
1145
1201
|
}
|
|
1146
1202
|
);
|
|
1147
1203
|
});
|
|
1148
1204
|
return ({ type: e }) => {
|
|
1149
|
-
if (e ===
|
|
1205
|
+
if (e === Cr)
|
|
1150
1206
|
return t;
|
|
1151
1207
|
};
|
|
1152
1208
|
}
|
|
1153
|
-
const
|
|
1154
|
-
function
|
|
1155
|
-
t.registerModule(
|
|
1209
|
+
const Or = "media", Nr = async () => Ir();
|
|
1210
|
+
function Lr(t) {
|
|
1211
|
+
t.registerModule(Or, Nr);
|
|
1156
1212
|
}
|
|
1157
|
-
const
|
|
1213
|
+
const Pr = `#version 300 es
|
|
1158
1214
|
in vec4 a_position;
|
|
1159
1215
|
void main() {
|
|
1160
1216
|
gl_Position = a_position;
|
|
1161
1217
|
}
|
|
1162
1218
|
`, le = 4;
|
|
1163
|
-
function
|
|
1219
|
+
function Ur(t, e) {
|
|
1164
1220
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1165
1221
|
}
|
|
1166
|
-
function
|
|
1222
|
+
function Mr(t, e) {
|
|
1167
1223
|
const n = [];
|
|
1168
1224
|
for (const [r, o] of Object.entries(e)) {
|
|
1169
|
-
if (
|
|
1225
|
+
if (Ur(t, r))
|
|
1170
1226
|
continue;
|
|
1171
1227
|
let s;
|
|
1172
1228
|
switch (o.type) {
|
|
@@ -1227,7 +1283,7 @@ void main() {
|
|
|
1227
1283
|
}
|
|
1228
1284
|
`;
|
|
1229
1285
|
}
|
|
1230
|
-
class
|
|
1286
|
+
class Dr {
|
|
1231
1287
|
gl;
|
|
1232
1288
|
program = null;
|
|
1233
1289
|
positionBuffer = null;
|
|
@@ -1302,10 +1358,10 @@ class Pr {
|
|
|
1302
1358
|
}
|
|
1303
1359
|
compile(e, n = {}) {
|
|
1304
1360
|
this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
|
|
1305
|
-
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER,
|
|
1361
|
+
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Pr);
|
|
1306
1362
|
if (!o)
|
|
1307
1363
|
return !1;
|
|
1308
|
-
const s =
|
|
1364
|
+
const s = Mr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
|
|
1309
1365
|
if (!i)
|
|
1310
1366
|
return r.deleteShader(o), !1;
|
|
1311
1367
|
const a = r.createProgram();
|
|
@@ -1344,10 +1400,10 @@ class Pr {
|
|
|
1344
1400
|
(n.width !== o || n.height !== s) && (n.width = o, n.height = s, e.viewport(0, 0, o, s));
|
|
1345
1401
|
const i = performance.now(), a = (i - this.startTime) / 1e3, l = (i - this.lastFrameTime) / 1e3;
|
|
1346
1402
|
this.lastFrameTime = i, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1403
|
+
const d = this.uniformLocations.get("iResolution");
|
|
1404
|
+
d && e.uniform3f(d, o, s, 1);
|
|
1405
|
+
const h = this.uniformLocations.get("iTime");
|
|
1406
|
+
h && e.uniform1f(h, a);
|
|
1351
1407
|
const g = this.uniformLocations.get("iTimeDelta");
|
|
1352
1408
|
g && e.uniform1f(g, l);
|
|
1353
1409
|
const m = this.uniformLocations.get("iFrame");
|
|
@@ -1411,7 +1467,7 @@ class Pr {
|
|
|
1411
1467
|
this.channels = [], this.uniformLocations.clear();
|
|
1412
1468
|
}
|
|
1413
1469
|
}
|
|
1414
|
-
function
|
|
1470
|
+
function jr(t) {
|
|
1415
1471
|
if (typeof t == "string") {
|
|
1416
1472
|
const e = t.trim();
|
|
1417
1473
|
return e.length > 0 ? e : void 0;
|
|
@@ -1421,7 +1477,7 @@ function Ur(t) {
|
|
|
1421
1477
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1422
1478
|
}
|
|
1423
1479
|
}
|
|
1424
|
-
function
|
|
1480
|
+
function $r(...t) {
|
|
1425
1481
|
const e = [];
|
|
1426
1482
|
for (const n of t)
|
|
1427
1483
|
n && n.trim() && e.push(n.trim());
|
|
@@ -1436,10 +1492,10 @@ function Ke(t) {
|
|
|
1436
1492
|
return Math.floor(e);
|
|
1437
1493
|
}
|
|
1438
1494
|
}
|
|
1439
|
-
function
|
|
1495
|
+
function Br(t) {
|
|
1440
1496
|
return typeof t == "string" ? t : "";
|
|
1441
1497
|
}
|
|
1442
|
-
function
|
|
1498
|
+
function Fr(t) {
|
|
1443
1499
|
if (typeof t == "boolean")
|
|
1444
1500
|
return t;
|
|
1445
1501
|
if (typeof t == "string") {
|
|
@@ -1448,7 +1504,7 @@ function jr(t) {
|
|
|
1448
1504
|
if (e === "false") return !1;
|
|
1449
1505
|
}
|
|
1450
1506
|
}
|
|
1451
|
-
function
|
|
1507
|
+
function Wr(t) {
|
|
1452
1508
|
if (!t || typeof t != "object")
|
|
1453
1509
|
return {};
|
|
1454
1510
|
const e = {}, n = t;
|
|
@@ -1463,10 +1519,10 @@ function $r(t) {
|
|
|
1463
1519
|
}
|
|
1464
1520
|
return e;
|
|
1465
1521
|
}
|
|
1466
|
-
function
|
|
1522
|
+
function Vr(t) {
|
|
1467
1523
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
|
|
1468
1524
|
}
|
|
1469
|
-
function
|
|
1525
|
+
function Kr(t, e) {
|
|
1470
1526
|
const n = Object.keys(t), r = Object.keys(e);
|
|
1471
1527
|
if (n.length !== r.length)
|
|
1472
1528
|
return !1;
|
|
@@ -1487,21 +1543,21 @@ function Fr(t, e) {
|
|
|
1487
1543
|
}
|
|
1488
1544
|
return !0;
|
|
1489
1545
|
}
|
|
1490
|
-
const
|
|
1491
|
-
function
|
|
1492
|
-
const t =
|
|
1493
|
-
const s =
|
|
1546
|
+
const Gr = "std.shadertoy-canvas";
|
|
1547
|
+
function Yr() {
|
|
1548
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
1549
|
+
const s = H(r.store, n), i = E(null), a = E(null), l = E(null), d = E(0), h = E(""), g = E({}), m = E({
|
|
1494
1550
|
x: 0,
|
|
1495
1551
|
y: 0,
|
|
1496
1552
|
clickX: 0,
|
|
1497
1553
|
clickY: 0,
|
|
1498
1554
|
isDown: !1
|
|
1499
|
-
}), c = s ?
|
|
1500
|
-
|
|
1555
|
+
}), c = s ? Br(s.props?.shaderSource) : "", u = s ? Ke(s.props?.fps) ?? 60 : 60, y = s?.props?.uniforms, p = W(() => Wr(y), [y]), S = s?.props?.channels, b = W(() => Vr(S), [S]), R = s ? Fr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ke(s.props?.width) : void 0, k = s ? Ke(s.props?.height) : void 0, U = s ? $r(jr(s.props?.className), o) : o;
|
|
1556
|
+
T(() => {
|
|
1501
1557
|
const I = i.current;
|
|
1502
1558
|
if (I) {
|
|
1503
1559
|
try {
|
|
1504
|
-
const P = new
|
|
1560
|
+
const P = new Dr(I);
|
|
1505
1561
|
a.current = P;
|
|
1506
1562
|
} catch (P) {
|
|
1507
1563
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
@@ -1510,27 +1566,27 @@ function Vr() {
|
|
|
1510
1566
|
a.current && (a.current.destroy(), a.current = null);
|
|
1511
1567
|
};
|
|
1512
1568
|
}
|
|
1513
|
-
}, []),
|
|
1569
|
+
}, []), T(() => {
|
|
1514
1570
|
const I = a.current;
|
|
1515
|
-
if (!(!I || !c) &&
|
|
1571
|
+
if (!(!I || !c) && h.current !== c)
|
|
1516
1572
|
if (I.compile(c, p))
|
|
1517
|
-
|
|
1573
|
+
h.current = c, g.current = p;
|
|
1518
1574
|
else {
|
|
1519
1575
|
const M = I.getError();
|
|
1520
1576
|
console.error("[ShadertoyRenderer] Shader compilation failed:", M);
|
|
1521
1577
|
}
|
|
1522
|
-
}, [c, p]),
|
|
1578
|
+
}, [c, p]), T(() => {
|
|
1523
1579
|
const I = a.current;
|
|
1524
|
-
!I || !
|
|
1525
|
-
}, [p]),
|
|
1580
|
+
!I || !h.current || Kr(g.current, p) || (I.setCustomUniforms(p), g.current = p);
|
|
1581
|
+
}, [p]), T(() => {
|
|
1526
1582
|
const I = a.current;
|
|
1527
1583
|
I && I.setChannels(b);
|
|
1528
|
-
}, [b]),
|
|
1584
|
+
}, [b]), T(() => {
|
|
1529
1585
|
const I = a.current;
|
|
1530
|
-
if (!I || !
|
|
1586
|
+
if (!I || !h.current) return;
|
|
1531
1587
|
const P = 1e3 / u, M = (B) => {
|
|
1532
|
-
const $ = B -
|
|
1533
|
-
$ >= P && (
|
|
1588
|
+
const $ = B - d.current;
|
|
1589
|
+
$ >= P && (d.current = B - $ % P, I.draw()), l.current = requestAnimationFrame(M);
|
|
1534
1590
|
};
|
|
1535
1591
|
return l.current = requestAnimationFrame(M), () => {
|
|
1536
1592
|
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
@@ -1541,8 +1597,8 @@ function Vr() {
|
|
|
1541
1597
|
if (!R) return;
|
|
1542
1598
|
const P = i.current, M = a.current;
|
|
1543
1599
|
if (!P || !M) return;
|
|
1544
|
-
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(),
|
|
1545
|
-
m.current.x =
|
|
1600
|
+
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
|
|
1601
|
+
m.current.x = V, m.current.y = K, M.setMouse(V, K, m.current.clickX, m.current.clickY);
|
|
1546
1602
|
},
|
|
1547
1603
|
[R]
|
|
1548
1604
|
), te = j(
|
|
@@ -1550,8 +1606,8 @@ function Vr() {
|
|
|
1550
1606
|
if (!R) return;
|
|
1551
1607
|
const P = i.current, M = a.current;
|
|
1552
1608
|
if (!P || !M) return;
|
|
1553
|
-
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(),
|
|
1554
|
-
m.current.isDown = !0, m.current.clickX =
|
|
1609
|
+
const B = window.devicePixelRatio || 1, $ = P.getBoundingClientRect(), V = (I.clientX - $.left) * B, K = ($.height - (I.clientY - $.top)) * B;
|
|
1610
|
+
m.current.isDown = !0, m.current.clickX = V, m.current.clickY = K, M.setMouse(V, K, V, K);
|
|
1555
1611
|
},
|
|
1556
1612
|
[R]
|
|
1557
1613
|
), z = j(() => {
|
|
@@ -1565,7 +1621,7 @@ function Vr() {
|
|
|
1565
1621
|
"data-ikon-source": s.sourceMarker,
|
|
1566
1622
|
className: U,
|
|
1567
1623
|
...v ? { width: v } : {},
|
|
1568
|
-
...
|
|
1624
|
+
...k ? { height: k } : {},
|
|
1569
1625
|
onMouseMove: ee,
|
|
1570
1626
|
onMouseDown: te,
|
|
1571
1627
|
onMouseUp: z,
|
|
@@ -1574,23 +1630,29 @@ function Vr() {
|
|
|
1574
1630
|
) : null;
|
|
1575
1631
|
});
|
|
1576
1632
|
return ({ type: e }) => {
|
|
1577
|
-
if (e ===
|
|
1633
|
+
if (e === Gr)
|
|
1578
1634
|
return t;
|
|
1579
1635
|
};
|
|
1580
1636
|
}
|
|
1581
|
-
const
|
|
1582
|
-
function
|
|
1583
|
-
t.registerModule(
|
|
1637
|
+
const zr = "shadertoy", Xr = async () => Yr();
|
|
1638
|
+
function Hr(t) {
|
|
1639
|
+
t.registerModule(zr, Xr);
|
|
1584
1640
|
}
|
|
1585
1641
|
const vt = oe("UIRegistry");
|
|
1586
|
-
class
|
|
1642
|
+
class qr {
|
|
1587
1643
|
baseResolvers = [];
|
|
1588
1644
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1589
1645
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
1646
|
+
listeners = /* @__PURE__ */ new Set();
|
|
1590
1647
|
activeModuleOrder = [];
|
|
1648
|
+
subscribe(e) {
|
|
1649
|
+
return this.listeners.add(e), () => {
|
|
1650
|
+
this.listeners.delete(e);
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1591
1653
|
registerResolvers(e) {
|
|
1592
1654
|
const n = Array.isArray(e) ? e : [e];
|
|
1593
|
-
this.baseResolvers.push(...n.filter(Boolean));
|
|
1655
|
+
this.baseResolvers.push(...n.filter(Boolean)), this.notify();
|
|
1594
1656
|
}
|
|
1595
1657
|
registerModule(e, n) {
|
|
1596
1658
|
const r = this.moduleLoaders.get(e);
|
|
@@ -1605,7 +1667,7 @@ class zr {
|
|
|
1605
1667
|
for (const [r, o] of this.moduleLoaders.entries())
|
|
1606
1668
|
if (!this.moduleResolvers.has(r))
|
|
1607
1669
|
try {
|
|
1608
|
-
const s = await o(), i =
|
|
1670
|
+
const s = await o(), i = Qr(s);
|
|
1609
1671
|
this.moduleResolvers.set(r, i), e = !0;
|
|
1610
1672
|
} catch (s) {
|
|
1611
1673
|
vt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
@@ -1613,7 +1675,7 @@ class zr {
|
|
|
1613
1675
|
const n = [];
|
|
1614
1676
|
for (const r of this.moduleLoaders.keys())
|
|
1615
1677
|
this.moduleResolvers.has(r) && n.push(r);
|
|
1616
|
-
return
|
|
1678
|
+
return eo(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e && this.notify(), e;
|
|
1617
1679
|
}
|
|
1618
1680
|
resolve(e) {
|
|
1619
1681
|
for (const n of this.baseResolvers) {
|
|
@@ -1632,18 +1694,22 @@ class zr {
|
|
|
1632
1694
|
}
|
|
1633
1695
|
}
|
|
1634
1696
|
}
|
|
1697
|
+
notify() {
|
|
1698
|
+
for (const e of this.listeners)
|
|
1699
|
+
e();
|
|
1700
|
+
}
|
|
1635
1701
|
}
|
|
1636
|
-
function
|
|
1637
|
-
const t = new
|
|
1638
|
-
return
|
|
1702
|
+
function Jr() {
|
|
1703
|
+
const t = new qr();
|
|
1704
|
+
return vr(t), Lr(t), Hr(t), t.loadRegisteredModules(), t;
|
|
1639
1705
|
}
|
|
1640
|
-
function
|
|
1706
|
+
function Zr(t) {
|
|
1641
1707
|
return Array.isArray(t) ? t : [t];
|
|
1642
1708
|
}
|
|
1643
|
-
function
|
|
1644
|
-
return t ?
|
|
1709
|
+
function Qr(t) {
|
|
1710
|
+
return t ? Zr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1645
1711
|
}
|
|
1646
|
-
function
|
|
1712
|
+
function eo(t, e) {
|
|
1647
1713
|
if (t.length !== e.length)
|
|
1648
1714
|
return !1;
|
|
1649
1715
|
for (let n = 0; n < t.length; n += 1)
|
|
@@ -1651,7 +1717,7 @@ function Jr(t, e) {
|
|
|
1651
1717
|
return !1;
|
|
1652
1718
|
return !0;
|
|
1653
1719
|
}
|
|
1654
|
-
function
|
|
1720
|
+
function Ls({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
1655
1721
|
return /* @__PURE__ */ w.jsx(
|
|
1656
1722
|
Bt,
|
|
1657
1723
|
{
|
|
@@ -1663,7 +1729,7 @@ function Os({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
|
1663
1729
|
}
|
|
1664
1730
|
);
|
|
1665
1731
|
}
|
|
1666
|
-
const
|
|
1732
|
+
const Ge = oe("MotionController"), Et = {
|
|
1667
1733
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1668
1734
|
"ease-in": [0.42, 0, 1, 1],
|
|
1669
1735
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1706,8 +1772,8 @@ function Rt(t) {
|
|
|
1706
1772
|
function At(t) {
|
|
1707
1773
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1708
1774
|
}
|
|
1709
|
-
function
|
|
1710
|
-
const
|
|
1775
|
+
function kt(t, e, n, r) {
|
|
1776
|
+
const h = new Float32Array(11);
|
|
1711
1777
|
function g(p, S, b) {
|
|
1712
1778
|
return ((3 * S - 3 * b + 1) * p + (3 * b - 6 * S)) * p * p + 3 * S * p;
|
|
1713
1779
|
}
|
|
@@ -1725,56 +1791,56 @@ function Tt(t, e, n, r) {
|
|
|
1725
1791
|
return S;
|
|
1726
1792
|
}
|
|
1727
1793
|
function u(p, S, b) {
|
|
1728
|
-
let R
|
|
1794
|
+
let R, v, k = 0;
|
|
1729
1795
|
do
|
|
1730
1796
|
v = S + (b - S) / 2, R = g(v, t, n) - p, R > 0 ? b = v : S = v;
|
|
1731
|
-
while (Math.abs(R) > 1e-7 && ++
|
|
1797
|
+
while (Math.abs(R) > 1e-7 && ++k < 10);
|
|
1732
1798
|
return v;
|
|
1733
1799
|
}
|
|
1734
1800
|
function y(p) {
|
|
1735
1801
|
let S = 0, b = 1;
|
|
1736
1802
|
const R = 10;
|
|
1737
|
-
for (; b !== R &&
|
|
1803
|
+
for (; b !== R && h[b] <= p; b += 1)
|
|
1738
1804
|
S += 0.1;
|
|
1739
1805
|
b -= 1;
|
|
1740
|
-
const v = (p -
|
|
1741
|
-
return U >= 1e-3 ? c(p,
|
|
1806
|
+
const v = (p - h[b]) / (h[b + 1] - h[b]), k = S + v * 0.1, U = m(k, t, n);
|
|
1807
|
+
return U >= 1e-3 ? c(p, k) : U === 0 ? k : u(p, S, S + 0.1);
|
|
1742
1808
|
}
|
|
1743
1809
|
for (let p = 0; p < 11; p += 1)
|
|
1744
|
-
|
|
1810
|
+
h[p] = g(p * 0.1, t, n);
|
|
1745
1811
|
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : g(y(p), e, r);
|
|
1746
1812
|
}
|
|
1747
|
-
function
|
|
1813
|
+
function to(t) {
|
|
1748
1814
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1749
1815
|
if (!e)
|
|
1750
1816
|
return (o) => F(o);
|
|
1751
1817
|
const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
|
|
1752
1818
|
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);
|
|
1753
1819
|
}
|
|
1754
|
-
function
|
|
1820
|
+
function no(t) {
|
|
1755
1821
|
if (!t)
|
|
1756
1822
|
return (n) => F(n);
|
|
1757
1823
|
const e = t.trim().toLowerCase();
|
|
1758
1824
|
if (!e || e === "linear")
|
|
1759
1825
|
return (n) => F(n);
|
|
1760
1826
|
if (Et[e]) {
|
|
1761
|
-
const [n, r, o, s] = Et[e], i =
|
|
1827
|
+
const [n, r, o, s] = Et[e], i = kt(n, r, o, s);
|
|
1762
1828
|
return (a) => F(i(F(a)));
|
|
1763
1829
|
}
|
|
1764
1830
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1765
1831
|
const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1766
1832
|
if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
|
|
1767
|
-
const [o, s, i, a] = r, l =
|
|
1768
|
-
return (
|
|
1833
|
+
const [o, s, i, a] = r, l = kt(o, s, i, a);
|
|
1834
|
+
return (d) => F(l(F(d)));
|
|
1769
1835
|
}
|
|
1770
1836
|
}
|
|
1771
1837
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1772
|
-
const n =
|
|
1838
|
+
const n = to(e);
|
|
1773
1839
|
return (r) => n(F(r));
|
|
1774
1840
|
}
|
|
1775
1841
|
return (n) => F(n);
|
|
1776
1842
|
}
|
|
1777
|
-
function
|
|
1843
|
+
function ro(t) {
|
|
1778
1844
|
if (!t)
|
|
1779
1845
|
return;
|
|
1780
1846
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1784,7 +1850,7 @@ function eo(t) {
|
|
|
1784
1850
|
if (![n, r, o, s].some((i) => !Number.isFinite(i)))
|
|
1785
1851
|
return { inStart: n, inEnd: r, outStart: o, outEnd: s };
|
|
1786
1852
|
}
|
|
1787
|
-
class
|
|
1853
|
+
class oo {
|
|
1788
1854
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1789
1855
|
observer;
|
|
1790
1856
|
observeScheduled = !1;
|
|
@@ -1811,7 +1877,7 @@ class to {
|
|
|
1811
1877
|
try {
|
|
1812
1878
|
e();
|
|
1813
1879
|
} catch (n) {
|
|
1814
|
-
|
|
1880
|
+
Ge.warn("Failed to cleanup binding listener", n);
|
|
1815
1881
|
}
|
|
1816
1882
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
|
|
1817
1883
|
}
|
|
@@ -1821,7 +1887,7 @@ class to {
|
|
|
1821
1887
|
const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1822
1888
|
return r.length === 0 ? void 0 : { bindings: r };
|
|
1823
1889
|
} catch (n) {
|
|
1824
|
-
|
|
1890
|
+
Ge.warn("Failed to parse motion metadata", n);
|
|
1825
1891
|
return;
|
|
1826
1892
|
}
|
|
1827
1893
|
}
|
|
@@ -1829,7 +1895,7 @@ class to {
|
|
|
1829
1895
|
const n = e.source?.trim();
|
|
1830
1896
|
if (!n)
|
|
1831
1897
|
return;
|
|
1832
|
-
const r = Rt(e.min) ?? 0, o = Rt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l =
|
|
1898
|
+
const r = Rt(e.min) ?? 0, o = Rt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = no(e.ease), d = ro(e.map), h = e.targetId?.trim() || void 0;
|
|
1833
1899
|
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1834
1900
|
source: n.toLowerCase(),
|
|
1835
1901
|
min: r,
|
|
@@ -1837,8 +1903,8 @@ class to {
|
|
|
1837
1903
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1838
1904
|
reverse: a,
|
|
1839
1905
|
ease: l,
|
|
1840
|
-
map:
|
|
1841
|
-
targetId:
|
|
1906
|
+
map: d,
|
|
1907
|
+
targetId: h
|
|
1842
1908
|
};
|
|
1843
1909
|
}
|
|
1844
1910
|
ensureObserver() {
|
|
@@ -1937,10 +2003,10 @@ class to {
|
|
|
1937
2003
|
const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
|
|
1938
2004
|
let i = this.applyClamp(s, n.clamp);
|
|
1939
2005
|
n.reverse && (i = 1 - i);
|
|
1940
|
-
const a = n.ease(i), l = Number.isFinite(a) ? a : 0,
|
|
1941
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${
|
|
1942
|
-
const
|
|
1943
|
-
|
|
2006
|
+
const a = n.ease(i), l = Number.isFinite(a) ? a : 0, d = l * 100;
|
|
2007
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${d}`), n.map) {
|
|
2008
|
+
const h = this.applyMap(d, n.map);
|
|
2009
|
+
h !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${h}`);
|
|
1944
2010
|
} else
|
|
1945
2011
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1946
2012
|
}
|
|
@@ -1997,7 +2063,7 @@ class to {
|
|
|
1997
2063
|
try {
|
|
1998
2064
|
i();
|
|
1999
2065
|
} catch (a) {
|
|
2000
|
-
|
|
2066
|
+
Ge.warn("Failed to cleanup listener", a);
|
|
2001
2067
|
}
|
|
2002
2068
|
this.globalCleanups.delete(i);
|
|
2003
2069
|
}
|
|
@@ -2042,21 +2108,21 @@ class to {
|
|
|
2042
2108
|
}
|
|
2043
2109
|
}
|
|
2044
2110
|
}
|
|
2045
|
-
const
|
|
2046
|
-
function
|
|
2111
|
+
const Ye = new oo();
|
|
2112
|
+
function so(t) {
|
|
2047
2113
|
const e = E(/* @__PURE__ */ new Map()), n = j(({ styleId: s, css: i, common: a }) => {
|
|
2048
2114
|
if (!(!s || typeof document > "u")) {
|
|
2049
2115
|
if (i) {
|
|
2050
2116
|
let l = e.current.get(s);
|
|
2051
2117
|
l || (l = document.createElement("style"), l.setAttribute("data-ikon-style-id", s), document.head.appendChild(l), e.current.set(s, l)), l.textContent = i;
|
|
2052
2118
|
}
|
|
2053
|
-
|
|
2119
|
+
Ye.registerStyle(s, a);
|
|
2054
2120
|
}
|
|
2055
2121
|
}, []), r = j((s) => {
|
|
2056
2122
|
if (!(typeof document > "u"))
|
|
2057
2123
|
for (const i of s) {
|
|
2058
2124
|
const a = e.current.get(i);
|
|
2059
|
-
a && (a.remove(), e.current.delete(i)),
|
|
2125
|
+
a && (a.remove(), e.current.delete(i)), Ye.unregisterStyle(i);
|
|
2060
2126
|
}
|
|
2061
2127
|
}, []), o = j(() => {
|
|
2062
2128
|
if (typeof document < "u") {
|
|
@@ -2064,9 +2130,9 @@ function no(t) {
|
|
|
2064
2130
|
s.remove();
|
|
2065
2131
|
e.current.clear();
|
|
2066
2132
|
}
|
|
2067
|
-
|
|
2133
|
+
Ye.reset();
|
|
2068
2134
|
}, []);
|
|
2069
|
-
return
|
|
2135
|
+
return T(() => {
|
|
2070
2136
|
if (!t) return;
|
|
2071
2137
|
for (const a of t.getUiStyles())
|
|
2072
2138
|
n(a);
|
|
@@ -2074,9 +2140,9 @@ function no(t) {
|
|
|
2074
2140
|
return () => {
|
|
2075
2141
|
s?.(), i?.(), o();
|
|
2076
2142
|
};
|
|
2077
|
-
}, [t, o, n, r]),
|
|
2143
|
+
}, [t, o, n, r]), T(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
2078
2144
|
}
|
|
2079
|
-
function
|
|
2145
|
+
function io(t) {
|
|
2080
2146
|
const e = [];
|
|
2081
2147
|
for (const [n, r] of t) {
|
|
2082
2148
|
const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -2084,30 +2150,30 @@ function ro(t) {
|
|
|
2084
2150
|
}
|
|
2085
2151
|
return e.sort(), e.join(",");
|
|
2086
2152
|
}
|
|
2087
|
-
function
|
|
2153
|
+
function ao(t) {
|
|
2088
2154
|
const [e, n] = x(), r = E("");
|
|
2089
|
-
return
|
|
2155
|
+
return T(() => {
|
|
2090
2156
|
if (!t) {
|
|
2091
2157
|
n(void 0), r.current = "";
|
|
2092
2158
|
return;
|
|
2093
2159
|
}
|
|
2094
2160
|
const o = () => {
|
|
2095
|
-
const s = t.getStores(), i =
|
|
2161
|
+
const s = t.getStores(), i = io(s);
|
|
2096
2162
|
i !== r.current && (r.current = i, n(s));
|
|
2097
2163
|
};
|
|
2098
2164
|
return o(), t.subscribe(o);
|
|
2099
2165
|
}, [t]), e;
|
|
2100
2166
|
}
|
|
2101
|
-
const
|
|
2167
|
+
const C = {
|
|
2102
2168
|
None: 0,
|
|
2103
2169
|
Letter: 1,
|
|
2104
2170
|
Word: 2,
|
|
2105
2171
|
Line: 4,
|
|
2106
2172
|
Paragraph: 8,
|
|
2107
2173
|
Emoji: 16
|
|
2108
|
-
},
|
|
2174
|
+
}, co = [
|
|
2109
2175
|
{
|
|
2110
|
-
flag:
|
|
2176
|
+
flag: C.Letter,
|
|
2111
2177
|
hints: [
|
|
2112
2178
|
"[data-motion-letter]",
|
|
2113
2179
|
"[data-letter]",
|
|
@@ -2116,7 +2182,7 @@ const k = {
|
|
|
2116
2182
|
]
|
|
2117
2183
|
},
|
|
2118
2184
|
{
|
|
2119
|
-
flag:
|
|
2185
|
+
flag: C.Word,
|
|
2120
2186
|
hints: [
|
|
2121
2187
|
"[data-motion-word]",
|
|
2122
2188
|
"[data-word]",
|
|
@@ -2125,7 +2191,7 @@ const k = {
|
|
|
2125
2191
|
]
|
|
2126
2192
|
},
|
|
2127
2193
|
{
|
|
2128
|
-
flag:
|
|
2194
|
+
flag: C.Line,
|
|
2129
2195
|
hints: [
|
|
2130
2196
|
"[data-motion-line]",
|
|
2131
2197
|
"[data-line]",
|
|
@@ -2134,7 +2200,7 @@ const k = {
|
|
|
2134
2200
|
]
|
|
2135
2201
|
},
|
|
2136
2202
|
{
|
|
2137
|
-
flag:
|
|
2203
|
+
flag: C.Paragraph,
|
|
2138
2204
|
hints: [
|
|
2139
2205
|
"[data-motion-paragraph]",
|
|
2140
2206
|
"[data-paragraph]",
|
|
@@ -2145,7 +2211,7 @@ const k = {
|
|
|
2145
2211
|
]
|
|
2146
2212
|
},
|
|
2147
2213
|
{
|
|
2148
|
-
flag:
|
|
2214
|
+
flag: C.Emoji,
|
|
2149
2215
|
hints: [
|
|
2150
2216
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
2151
2217
|
"[data-motion-emoji]",
|
|
@@ -2154,35 +2220,35 @@ const k = {
|
|
|
2154
2220
|
"[data-emoji]"
|
|
2155
2221
|
]
|
|
2156
2222
|
}
|
|
2157
|
-
], nt =
|
|
2158
|
-
function
|
|
2159
|
-
if (!t || t.length >
|
|
2223
|
+
], nt = C.Letter | C.Word | C.Line | C.Paragraph | C.Emoji, lo = C.Letter | C.Word | C.Line | C.Paragraph, Tt = /* @__PURE__ */ new Map(), uo = 16384;
|
|
2224
|
+
function Ps(t, e) {
|
|
2225
|
+
if (!t || t.length > uo)
|
|
2160
2226
|
return t;
|
|
2161
|
-
const n =
|
|
2162
|
-
if (o ===
|
|
2227
|
+
const n = _o(e), r = fe(n, C.Emoji), o = n & lo;
|
|
2228
|
+
if (o === C.None && !r)
|
|
2163
2229
|
return t;
|
|
2164
2230
|
const s = t.replace(/\r\n/g, `
|
|
2165
2231
|
`).replace(/\r/g, `
|
|
2166
2232
|
`);
|
|
2167
|
-
if (o ===
|
|
2168
|
-
return
|
|
2169
|
-
const i =
|
|
2233
|
+
if (o === C.None)
|
|
2234
|
+
return xt(s);
|
|
2235
|
+
const i = To(s);
|
|
2170
2236
|
if (i.length === 0)
|
|
2171
|
-
return r ?
|
|
2172
|
-
const a =
|
|
2173
|
-
for (const
|
|
2174
|
-
const g =
|
|
2175
|
-
|
|
2237
|
+
return r ? xt(s) : t;
|
|
2238
|
+
const a = Co(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
|
|
2239
|
+
for (const h of a) {
|
|
2240
|
+
const g = fo(h, n, l);
|
|
2241
|
+
d.push(...g);
|
|
2176
2242
|
}
|
|
2177
|
-
return
|
|
2243
|
+
return d;
|
|
2178
2244
|
}
|
|
2179
|
-
function
|
|
2245
|
+
function fo(t, e, n) {
|
|
2180
2246
|
const r = [];
|
|
2181
2247
|
for (const o of t) {
|
|
2182
|
-
const s =
|
|
2248
|
+
const s = ho(o, e, n);
|
|
2183
2249
|
r.push(...s);
|
|
2184
2250
|
}
|
|
2185
|
-
if (fe(e,
|
|
2251
|
+
if (fe(e, C.Paragraph)) {
|
|
2186
2252
|
const o = n.paragraph++;
|
|
2187
2253
|
return [
|
|
2188
2254
|
/* @__PURE__ */ w.jsx(
|
|
@@ -2198,9 +2264,9 @@ function co(t, e, n) {
|
|
|
2198
2264
|
}
|
|
2199
2265
|
return r;
|
|
2200
2266
|
}
|
|
2201
|
-
function
|
|
2202
|
-
const r =
|
|
2203
|
-
if (fe(e,
|
|
2267
|
+
function ho(t, e, n) {
|
|
2268
|
+
const r = po(t.text, e, n), o = [];
|
|
2269
|
+
if (fe(e, C.Line)) {
|
|
2204
2270
|
const s = n.line++;
|
|
2205
2271
|
o.push(
|
|
2206
2272
|
/* @__PURE__ */ w.jsx("span", { "data-motion-line": !0, style: Ue(s), children: r }, `motion-line-${s}`)
|
|
@@ -2211,10 +2277,10 @@ function lo(t, e, n) {
|
|
|
2211
2277
|
o.push(/* @__PURE__ */ w.jsx("br", {}, `motion-break-${n.br++}`));
|
|
2212
2278
|
return o;
|
|
2213
2279
|
}
|
|
2214
|
-
function
|
|
2280
|
+
function po(t, e, n) {
|
|
2215
2281
|
if (!t)
|
|
2216
2282
|
return [];
|
|
2217
|
-
const r = fe(e,
|
|
2283
|
+
const r = fe(e, C.Word), o = [], s = /(\s+)/g;
|
|
2218
2284
|
let i = 0, a;
|
|
2219
2285
|
for (; (a = s.exec(t)) !== null; ) {
|
|
2220
2286
|
if (a.index > i) {
|
|
@@ -2230,16 +2296,16 @@ function uo(t, e, n) {
|
|
|
2230
2296
|
return o;
|
|
2231
2297
|
}
|
|
2232
2298
|
function Ct(t, e, n, r) {
|
|
2233
|
-
const o = e.word++, s =
|
|
2299
|
+
const o = e.word++, s = go(t, n, e), i = `motion-word-${o}`, a = mo(o, r);
|
|
2234
2300
|
return r ? /* @__PURE__ */ w.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ w.jsx("span", { style: a, children: s }, i);
|
|
2235
2301
|
}
|
|
2236
|
-
function
|
|
2302
|
+
function mo(t, e) {
|
|
2237
2303
|
return e ? { ...Ue(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2238
2304
|
}
|
|
2239
|
-
function
|
|
2305
|
+
function go(t, e, n) {
|
|
2240
2306
|
if (!t)
|
|
2241
2307
|
return [];
|
|
2242
|
-
const r = fe(e,
|
|
2308
|
+
const r = fe(e, C.Letter), o = fe(e, C.Emoji);
|
|
2243
2309
|
if (!r) {
|
|
2244
2310
|
if (!o)
|
|
2245
2311
|
return [t];
|
|
@@ -2251,17 +2317,17 @@ function ho(t, e, n) {
|
|
|
2251
2317
|
}
|
|
2252
2318
|
const s = [], i = rt(t);
|
|
2253
2319
|
for (const a of i) {
|
|
2254
|
-
const l = n.letter++,
|
|
2320
|
+
const l = n.letter++, d = `motion-letter-${l}`, h = Ue(l);
|
|
2255
2321
|
if (a === `
|
|
2256
2322
|
`) {
|
|
2257
2323
|
s.push(
|
|
2258
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style:
|
|
2324
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: h, children: /* @__PURE__ */ w.jsx("br", {}) }, d)
|
|
2259
2325
|
);
|
|
2260
2326
|
continue;
|
|
2261
2327
|
}
|
|
2262
|
-
const m = o &&
|
|
2328
|
+
const m = o && Yt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
|
|
2263
2329
|
s.push(
|
|
2264
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style:
|
|
2330
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: h, ...m, children: c }, d)
|
|
2265
2331
|
);
|
|
2266
2332
|
}
|
|
2267
2333
|
return s;
|
|
@@ -2269,33 +2335,33 @@ function ho(t, e, n) {
|
|
|
2269
2335
|
function rt(t) {
|
|
2270
2336
|
if (!t)
|
|
2271
2337
|
return [];
|
|
2272
|
-
const e =
|
|
2273
|
-
return e ? Array.from(e.segment(t), (n) => n.segment) :
|
|
2338
|
+
const e = yo();
|
|
2339
|
+
return e ? Array.from(e.segment(t), (n) => n.segment) : bo(t);
|
|
2274
2340
|
}
|
|
2275
2341
|
let Se;
|
|
2276
|
-
function
|
|
2342
|
+
function yo() {
|
|
2277
2343
|
return Se !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? Se = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : Se = null), Se;
|
|
2278
2344
|
}
|
|
2279
|
-
function
|
|
2345
|
+
function bo(t) {
|
|
2280
2346
|
const e = [], n = Array.from(t);
|
|
2281
2347
|
let r = "";
|
|
2282
2348
|
for (let o = 0; o < n.length; o++) {
|
|
2283
2349
|
const s = n[o], i = n[o + 1];
|
|
2284
|
-
r += s, !(i &&
|
|
2350
|
+
r += s, !(i && So(s, i)) && (e.push(r), r = "");
|
|
2285
2351
|
}
|
|
2286
2352
|
return r && e.push(r), e;
|
|
2287
2353
|
}
|
|
2288
|
-
function
|
|
2289
|
-
return e ? !!(_t(t) || _t(e) ||
|
|
2354
|
+
function So(t, e) {
|
|
2355
|
+
return e ? !!(_t(t) || _t(e) || Eo(e) || wo(e) || vo(e) || It(t) && It(e)) : !1;
|
|
2290
2356
|
}
|
|
2291
2357
|
function _t(t) {
|
|
2292
2358
|
return t.codePointAt(0) === 8205;
|
|
2293
2359
|
}
|
|
2294
|
-
function
|
|
2360
|
+
function wo(t) {
|
|
2295
2361
|
const e = t.codePointAt(0);
|
|
2296
2362
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2297
2363
|
}
|
|
2298
|
-
function
|
|
2364
|
+
function vo(t) {
|
|
2299
2365
|
const e = t.codePointAt(0);
|
|
2300
2366
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2301
2367
|
}
|
|
@@ -2304,10 +2370,10 @@ function It(t) {
|
|
|
2304
2370
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2305
2371
|
}
|
|
2306
2372
|
let ze;
|
|
2307
|
-
function
|
|
2308
|
-
return t ? (ze || (ze =
|
|
2373
|
+
function Eo(t) {
|
|
2374
|
+
return t ? (ze || (ze = Ro()), ze(t)) : !1;
|
|
2309
2375
|
}
|
|
2310
|
-
function
|
|
2376
|
+
function Ro() {
|
|
2311
2377
|
try {
|
|
2312
2378
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2313
2379
|
return (e) => t.test(e);
|
|
@@ -2319,18 +2385,18 @@ function wo() {
|
|
|
2319
2385
|
}
|
|
2320
2386
|
}
|
|
2321
2387
|
let Xe;
|
|
2322
|
-
function
|
|
2323
|
-
return t ? (Xe || (Xe =
|
|
2388
|
+
function Yt(t) {
|
|
2389
|
+
return t ? (Xe || (Xe = Ao()), Xe(t)) : !1;
|
|
2324
2390
|
}
|
|
2325
|
-
function
|
|
2391
|
+
function Ao() {
|
|
2326
2392
|
try {
|
|
2327
2393
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2328
2394
|
return (e) => t.test(e);
|
|
2329
2395
|
} catch {
|
|
2330
|
-
return
|
|
2396
|
+
return ko;
|
|
2331
2397
|
}
|
|
2332
2398
|
}
|
|
2333
|
-
function
|
|
2399
|
+
function ko(t) {
|
|
2334
2400
|
if (!t)
|
|
2335
2401
|
return !1;
|
|
2336
2402
|
for (const e of Array.from(t)) {
|
|
@@ -2340,7 +2406,7 @@ function Eo(t) {
|
|
|
2340
2406
|
}
|
|
2341
2407
|
return !1;
|
|
2342
2408
|
}
|
|
2343
|
-
function
|
|
2409
|
+
function To(t) {
|
|
2344
2410
|
const e = [];
|
|
2345
2411
|
let n = "", r = 0;
|
|
2346
2412
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2354,7 +2420,7 @@ function Ro(t) {
|
|
|
2354
2420
|
}
|
|
2355
2421
|
return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
|
|
2356
2422
|
}
|
|
2357
|
-
function
|
|
2423
|
+
function Co(t) {
|
|
2358
2424
|
if (t.length === 0)
|
|
2359
2425
|
return [];
|
|
2360
2426
|
const e = [];
|
|
@@ -2383,7 +2449,7 @@ function Ue(t) {
|
|
|
2383
2449
|
WebkitTextFillColor: "inherit"
|
|
2384
2450
|
};
|
|
2385
2451
|
}
|
|
2386
|
-
function
|
|
2452
|
+
function xt(t) {
|
|
2387
2453
|
if (!t)
|
|
2388
2454
|
return t;
|
|
2389
2455
|
const e = rt(t);
|
|
@@ -2399,11 +2465,11 @@ function zt(t, e) {
|
|
|
2399
2465
|
r && (n.push(r), r = "");
|
|
2400
2466
|
};
|
|
2401
2467
|
for (const a of t) {
|
|
2402
|
-
if (
|
|
2468
|
+
if (Yt(a)) {
|
|
2403
2469
|
o = !0, i();
|
|
2404
|
-
const
|
|
2470
|
+
const d = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2405
2471
|
n.push(
|
|
2406
|
-
/* @__PURE__ */ w.jsx("span", { "data-motion-emoji": !0, children: a },
|
|
2472
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-emoji": !0, children: a }, d)
|
|
2407
2473
|
);
|
|
2408
2474
|
continue;
|
|
2409
2475
|
}
|
|
@@ -2411,51 +2477,51 @@ function zt(t, e) {
|
|
|
2411
2477
|
}
|
|
2412
2478
|
return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2413
2479
|
}
|
|
2414
|
-
function
|
|
2480
|
+
function _o(t) {
|
|
2415
2481
|
if (!t)
|
|
2416
|
-
return
|
|
2482
|
+
return C.None;
|
|
2417
2483
|
const e = t.trim();
|
|
2418
2484
|
if (!e)
|
|
2419
|
-
return
|
|
2420
|
-
const n =
|
|
2485
|
+
return C.None;
|
|
2486
|
+
const n = Tt.get(e);
|
|
2421
2487
|
if (typeof n == "number")
|
|
2422
2488
|
return n;
|
|
2423
2489
|
if (typeof document > "u")
|
|
2424
|
-
return
|
|
2490
|
+
return C.None;
|
|
2425
2491
|
const r = e.split(/\s+/).filter(Boolean);
|
|
2426
2492
|
if (r.length === 0)
|
|
2427
|
-
return
|
|
2428
|
-
const s = r.map((l) => `.${
|
|
2429
|
-
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2493
|
+
return C.None;
|
|
2494
|
+
const s = r.map((l) => `.${Io(l)}`).map(
|
|
2495
|
+
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${xo(l)}(?![a-zA-Z0-9_-])`)
|
|
2430
2496
|
);
|
|
2431
|
-
let i =
|
|
2497
|
+
let i = C.None, a = !1;
|
|
2432
2498
|
for (const l of Array.from(document.styleSheets)) {
|
|
2433
|
-
let
|
|
2499
|
+
let d;
|
|
2434
2500
|
try {
|
|
2435
|
-
|
|
2501
|
+
d = l.cssRules;
|
|
2436
2502
|
} catch {
|
|
2437
2503
|
continue;
|
|
2438
2504
|
}
|
|
2439
|
-
const
|
|
2440
|
-
if (
|
|
2505
|
+
const h = Xt(d, s);
|
|
2506
|
+
if (h.mask && (i |= h.mask, i === nt))
|
|
2441
2507
|
break;
|
|
2442
|
-
a ||=
|
|
2508
|
+
a ||= h.sawStyleRule;
|
|
2443
2509
|
}
|
|
2444
|
-
return (i !==
|
|
2510
|
+
return (i !== C.None || a) && Tt.set(e, i), i;
|
|
2445
2511
|
}
|
|
2446
2512
|
function Xt(t, e) {
|
|
2447
2513
|
if (!t)
|
|
2448
|
-
return { mask:
|
|
2449
|
-
let n =
|
|
2514
|
+
return { mask: C.None, sawStyleRule: !1 };
|
|
2515
|
+
let n = C.None, r = !1;
|
|
2450
2516
|
for (let o = 0; o < t.length; o++) {
|
|
2451
2517
|
const s = t[o];
|
|
2452
2518
|
if (s) {
|
|
2453
2519
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2454
2520
|
const a = s.selectorText ?? "";
|
|
2455
|
-
if (!a || !e.some((
|
|
2521
|
+
if (!a || !e.some((d) => d.test(a))) continue;
|
|
2456
2522
|
r = !0;
|
|
2457
|
-
for (const
|
|
2458
|
-
|
|
2523
|
+
for (const d of co)
|
|
2524
|
+
d.hints.some((h) => a.includes(h)) && (n |= d.flag);
|
|
2459
2525
|
if (n === nt)
|
|
2460
2526
|
return { mask: n, sawStyleRule: !0 };
|
|
2461
2527
|
} else if ("cssRules" in s) {
|
|
@@ -2468,19 +2534,19 @@ function Xt(t, e) {
|
|
|
2468
2534
|
}
|
|
2469
2535
|
return { mask: n, sawStyleRule: r };
|
|
2470
2536
|
}
|
|
2471
|
-
function
|
|
2537
|
+
function Io(t) {
|
|
2472
2538
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2473
2539
|
}
|
|
2474
|
-
function
|
|
2540
|
+
function xo(t) {
|
|
2475
2541
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2476
2542
|
}
|
|
2477
|
-
const ct = "ikon-auth-session", Ht = "ikon-auth-auto-login-attempted-run",
|
|
2543
|
+
const ct = "ikon-auth-session", Ht = "ikon-auth-auto-login-attempted-run", Oo = 10080 * 60 * 1e3, No = 60 * 1e3;
|
|
2478
2544
|
function qt(t) {
|
|
2479
2545
|
try {
|
|
2480
2546
|
const e = t.split(".");
|
|
2481
2547
|
if (e.length !== 3) return !0;
|
|
2482
2548
|
const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
|
|
2483
|
-
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 -
|
|
2549
|
+
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - No;
|
|
2484
2550
|
} catch {
|
|
2485
2551
|
return !0;
|
|
2486
2552
|
}
|
|
@@ -2497,7 +2563,7 @@ function Jt() {
|
|
|
2497
2563
|
const t = localStorage.getItem(ct);
|
|
2498
2564
|
if (!t) return null;
|
|
2499
2565
|
const e = JSON.parse(t);
|
|
2500
|
-
return Date.now() - e.authenticatedAt >
|
|
2566
|
+
return Date.now() - e.authenticatedAt > Oo || qt(e.token) ? (Le(), null) : e;
|
|
2501
2567
|
} catch {
|
|
2502
2568
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2503
2569
|
}
|
|
@@ -2509,7 +2575,7 @@ function Le() {
|
|
|
2509
2575
|
console.warn("Failed to clear auth session from localStorage");
|
|
2510
2576
|
}
|
|
2511
2577
|
}
|
|
2512
|
-
function
|
|
2578
|
+
function Lo(t) {
|
|
2513
2579
|
if (t)
|
|
2514
2580
|
try {
|
|
2515
2581
|
sessionStorage.setItem(Ht, t);
|
|
@@ -2517,7 +2583,7 @@ function Oo(t) {
|
|
|
2517
2583
|
console.warn("Failed to record auto-login attempt in sessionStorage");
|
|
2518
2584
|
}
|
|
2519
2585
|
}
|
|
2520
|
-
function
|
|
2586
|
+
function Po() {
|
|
2521
2587
|
try {
|
|
2522
2588
|
return sessionStorage.getItem(Ht);
|
|
2523
2589
|
} catch {
|
|
@@ -2533,7 +2599,7 @@ function ne(t) {
|
|
|
2533
2599
|
};
|
|
2534
2600
|
}
|
|
2535
2601
|
const Zt = 15e3, we = oe("AuthService");
|
|
2536
|
-
async function
|
|
2602
|
+
async function Ot(t) {
|
|
2537
2603
|
try {
|
|
2538
2604
|
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)";
|
|
2539
2605
|
} catch (e) {
|
|
@@ -2541,7 +2607,7 @@ async function xt(t) {
|
|
|
2541
2607
|
}
|
|
2542
2608
|
}
|
|
2543
2609
|
async function Qt(t, e) {
|
|
2544
|
-
const n =
|
|
2610
|
+
const n = Tn(), r = {
|
|
2545
2611
|
method: "POST",
|
|
2546
2612
|
headers: { "Content-Type": "application/json" },
|
|
2547
2613
|
body: JSON.stringify({ deviceId: n, space: t })
|
|
@@ -2550,24 +2616,24 @@ async function Qt(t, e) {
|
|
|
2550
2616
|
let i;
|
|
2551
2617
|
try {
|
|
2552
2618
|
i = await fetch(s, r);
|
|
2553
|
-
} catch (
|
|
2554
|
-
const
|
|
2619
|
+
} catch (d) {
|
|
2620
|
+
const h = d instanceof Error ? `${d.name}: ${d.message}` : String(d), g = Cn(), m = g ? `${g}/anonymous` : null;
|
|
2555
2621
|
if (m && m !== s) {
|
|
2556
|
-
we.warn(`Anonymous auth could not reach ${s} (${
|
|
2622
|
+
we.warn(`Anonymous auth could not reach ${s} (${h}); falling back to same-origin ${m}`);
|
|
2557
2623
|
try {
|
|
2558
2624
|
i = await fetch(m, r);
|
|
2559
2625
|
} catch (c) {
|
|
2560
|
-
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), y = await
|
|
2561
|
-
throw we.error(`Anonymous auth failed on both direct (${s}: ${
|
|
2626
|
+
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), y = await Ot(e);
|
|
2627
|
+
throw we.error(`Anonymous auth failed on both direct (${s}: ${h}) and same-origin (${m}: ${u}). ${y}`), new Error(`Anonymous auth unreachable: direct ${s} (${h}) and same-origin ${m} (${u})`, { cause: c });
|
|
2562
2628
|
}
|
|
2563
2629
|
} else {
|
|
2564
|
-
const c = await
|
|
2565
|
-
throw we.error(`Anonymous auth fetch threw for ${s} — ${
|
|
2630
|
+
const c = await Ot(e);
|
|
2631
|
+
throw we.error(`Anonymous auth fetch threw for ${s} — ${h}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${h}). ${c}`, { cause: d });
|
|
2566
2632
|
}
|
|
2567
2633
|
}
|
|
2568
2634
|
if (!i.ok) {
|
|
2569
|
-
const
|
|
2570
|
-
throw we.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${
|
|
2635
|
+
const d = await i.text().catch(() => "Unknown error");
|
|
2636
|
+
throw we.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${d}`), new Error(`Anonymous auth failed: ${i.status} ${d}`);
|
|
2571
2637
|
}
|
|
2572
2638
|
const { token: a } = await i.json(), l = {
|
|
2573
2639
|
token: a,
|
|
@@ -2576,7 +2642,7 @@ async function Qt(t, e) {
|
|
|
2576
2642
|
};
|
|
2577
2643
|
return he(l), l;
|
|
2578
2644
|
}
|
|
2579
|
-
async function
|
|
2645
|
+
async function Uo({ email: t, spaceId: e, authUrl: n }) {
|
|
2580
2646
|
const r = await fetch(`${n}/email/send`, {
|
|
2581
2647
|
method: "POST",
|
|
2582
2648
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2591,7 +2657,7 @@ async function No({ email: t, spaceId: e, authUrl: n }) {
|
|
|
2591
2657
|
throw new Error(o);
|
|
2592
2658
|
}
|
|
2593
2659
|
}
|
|
2594
|
-
async function
|
|
2660
|
+
async function Mo({ email: t, code: e, authUrl: n }) {
|
|
2595
2661
|
const r = await fetch(`${n}/email/code`, {
|
|
2596
2662
|
method: "POST",
|
|
2597
2663
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2612,21 +2678,21 @@ async function Lo({ email: t, code: e, authUrl: n }) {
|
|
|
2612
2678
|
};
|
|
2613
2679
|
return he(s), s;
|
|
2614
2680
|
}
|
|
2615
|
-
function
|
|
2681
|
+
function Do() {
|
|
2616
2682
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
2617
2683
|
return e && n ? { token: e, provider: n } : null;
|
|
2618
2684
|
}
|
|
2619
|
-
function
|
|
2685
|
+
function jo() {
|
|
2620
2686
|
return new URLSearchParams(window.location.search).get("error");
|
|
2621
2687
|
}
|
|
2622
2688
|
function Nt() {
|
|
2623
2689
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2624
2690
|
}
|
|
2625
|
-
function
|
|
2691
|
+
function $o(t, e, n, r) {
|
|
2626
2692
|
const o = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2627
2693
|
return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2628
2694
|
}
|
|
2629
|
-
async function
|
|
2695
|
+
async function Bo(t) {
|
|
2630
2696
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2631
2697
|
method: "POST",
|
|
2632
2698
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2637,7 +2703,7 @@ async function Do(t) {
|
|
|
2637
2703
|
}
|
|
2638
2704
|
return e.json();
|
|
2639
2705
|
}
|
|
2640
|
-
async function
|
|
2706
|
+
async function Fo(t, e, n) {
|
|
2641
2707
|
const r = await fetch(`${t}/passkey/registration/verify`, {
|
|
2642
2708
|
method: "POST",
|
|
2643
2709
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2654,7 +2720,7 @@ async function jo(t, e, n) {
|
|
|
2654
2720
|
};
|
|
2655
2721
|
return he(s), s;
|
|
2656
2722
|
}
|
|
2657
|
-
async function
|
|
2723
|
+
async function Wo(t, e) {
|
|
2658
2724
|
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
2659
2725
|
method: "POST",
|
|
2660
2726
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2666,7 +2732,7 @@ async function $o(t, e) {
|
|
|
2666
2732
|
}
|
|
2667
2733
|
return n.json();
|
|
2668
2734
|
}
|
|
2669
|
-
async function
|
|
2735
|
+
async function Vo(t, e) {
|
|
2670
2736
|
const n = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2671
2737
|
method: "POST",
|
|
2672
2738
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2697,9 +2763,9 @@ function Pe(t) {
|
|
|
2697
2763
|
return s;
|
|
2698
2764
|
}
|
|
2699
2765
|
function lt() {
|
|
2700
|
-
return
|
|
2766
|
+
return Ko.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2701
2767
|
}
|
|
2702
|
-
const
|
|
2768
|
+
const Ko = {
|
|
2703
2769
|
stubThis: (t) => t
|
|
2704
2770
|
};
|
|
2705
2771
|
function en(t) {
|
|
@@ -2732,7 +2798,7 @@ class D extends Error {
|
|
|
2732
2798
|
}), this.name = o ?? r.name, this.code = n;
|
|
2733
2799
|
}
|
|
2734
2800
|
}
|
|
2735
|
-
function
|
|
2801
|
+
function Go({ error: t, options: e }) {
|
|
2736
2802
|
const { publicKey: n } = e;
|
|
2737
2803
|
if (!n)
|
|
2738
2804
|
throw Error("options was missing required publicKey property");
|
|
@@ -2818,7 +2884,7 @@ function Wo({ error: t, options: e }) {
|
|
|
2818
2884
|
}
|
|
2819
2885
|
return t;
|
|
2820
2886
|
}
|
|
2821
|
-
class
|
|
2887
|
+
class Yo {
|
|
2822
2888
|
constructor() {
|
|
2823
2889
|
Object.defineProperty(this, "controller", {
|
|
2824
2890
|
enumerable: !0,
|
|
@@ -2842,12 +2908,12 @@ class Vo {
|
|
|
2842
2908
|
}
|
|
2843
2909
|
}
|
|
2844
2910
|
}
|
|
2845
|
-
const nn = new
|
|
2911
|
+
const nn = new Yo(), zo = ["cross-platform", "platform"];
|
|
2846
2912
|
function rn(t) {
|
|
2847
|
-
if (t && !(
|
|
2913
|
+
if (t && !(zo.indexOf(t) < 0))
|
|
2848
2914
|
return t;
|
|
2849
2915
|
}
|
|
2850
|
-
async function
|
|
2916
|
+
async function Xo(t) {
|
|
2851
2917
|
!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 });
|
|
2852
2918
|
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2853
2919
|
if (!lt())
|
|
@@ -2866,13 +2932,13 @@ async function Yo(t) {
|
|
|
2866
2932
|
try {
|
|
2867
2933
|
s = await navigator.credentials.create(o);
|
|
2868
2934
|
} catch (u) {
|
|
2869
|
-
throw
|
|
2935
|
+
throw Go({ error: u, options: o });
|
|
2870
2936
|
}
|
|
2871
2937
|
if (!s)
|
|
2872
2938
|
throw new Error("Registration was not completed");
|
|
2873
|
-
const { id: i, rawId: a, response: l, type:
|
|
2874
|
-
let
|
|
2875
|
-
typeof l.getTransports == "function" && (
|
|
2939
|
+
const { id: i, rawId: a, response: l, type: d } = s;
|
|
2940
|
+
let h;
|
|
2941
|
+
typeof l.getTransports == "function" && (h = l.getTransports());
|
|
2876
2942
|
let g;
|
|
2877
2943
|
if (typeof l.getPublicKeyAlgorithm == "function")
|
|
2878
2944
|
try {
|
|
@@ -2901,12 +2967,12 @@ async function Yo(t) {
|
|
|
2901
2967
|
response: {
|
|
2902
2968
|
attestationObject: X(l.attestationObject),
|
|
2903
2969
|
clientDataJSON: X(l.clientDataJSON),
|
|
2904
|
-
transports:
|
|
2970
|
+
transports: h,
|
|
2905
2971
|
publicKeyAlgorithm: g,
|
|
2906
2972
|
publicKey: m,
|
|
2907
2973
|
authenticatorData: c
|
|
2908
2974
|
},
|
|
2909
|
-
type:
|
|
2975
|
+
type: d,
|
|
2910
2976
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2911
2977
|
authenticatorAttachment: rn(s.authenticatorAttachment)
|
|
2912
2978
|
};
|
|
@@ -2915,7 +2981,7 @@ function He(t, e) {
|
|
|
2915
2981
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2916
2982
|
`, e);
|
|
2917
2983
|
}
|
|
2918
|
-
function
|
|
2984
|
+
function Ho() {
|
|
2919
2985
|
if (!lt())
|
|
2920
2986
|
return qe.stubThis(new Promise((e) => e(!1)));
|
|
2921
2987
|
const t = globalThis.PublicKeyCredential;
|
|
@@ -2924,7 +2990,7 @@ function Go() {
|
|
|
2924
2990
|
const qe = {
|
|
2925
2991
|
stubThis: (t) => t
|
|
2926
2992
|
};
|
|
2927
|
-
function
|
|
2993
|
+
function qo({ error: t, options: e }) {
|
|
2928
2994
|
const { publicKey: n } = e;
|
|
2929
2995
|
if (!n)
|
|
2930
2996
|
throw Error("options was missing required publicKey property");
|
|
@@ -2965,7 +3031,7 @@ function zo({ error: t, options: e }) {
|
|
|
2965
3031
|
}
|
|
2966
3032
|
return t;
|
|
2967
3033
|
}
|
|
2968
|
-
async function
|
|
3034
|
+
async function Jo(t) {
|
|
2969
3035
|
!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 });
|
|
2970
3036
|
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
2971
3037
|
if (!lt())
|
|
@@ -2978,7 +3044,7 @@ async function Xo(t) {
|
|
|
2978
3044
|
allowCredentials: o
|
|
2979
3045
|
}, i = {};
|
|
2980
3046
|
if (n) {
|
|
2981
|
-
if (!await
|
|
3047
|
+
if (!await Ho())
|
|
2982
3048
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2983
3049
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
2984
3050
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -2989,19 +3055,19 @@ async function Xo(t) {
|
|
|
2989
3055
|
try {
|
|
2990
3056
|
a = await navigator.credentials.get(i);
|
|
2991
3057
|
} catch (c) {
|
|
2992
|
-
throw
|
|
3058
|
+
throw qo({ error: c, options: i });
|
|
2993
3059
|
}
|
|
2994
3060
|
if (!a)
|
|
2995
3061
|
throw new Error("Authentication was not completed");
|
|
2996
|
-
const { id: l, rawId:
|
|
3062
|
+
const { id: l, rawId: d, response: h, type: g } = a;
|
|
2997
3063
|
let m;
|
|
2998
|
-
return
|
|
3064
|
+
return h.userHandle && (m = X(h.userHandle)), {
|
|
2999
3065
|
id: l,
|
|
3000
|
-
rawId: X(
|
|
3066
|
+
rawId: X(d),
|
|
3001
3067
|
response: {
|
|
3002
|
-
authenticatorData: X(
|
|
3003
|
-
clientDataJSON: X(
|
|
3004
|
-
signature: X(
|
|
3068
|
+
authenticatorData: X(h.authenticatorData),
|
|
3069
|
+
clientDataJSON: X(h.clientDataJSON),
|
|
3070
|
+
signature: X(h.signature),
|
|
3005
3071
|
userHandle: m
|
|
3006
3072
|
},
|
|
3007
3073
|
type: g,
|
|
@@ -3010,18 +3076,18 @@ async function Xo(t) {
|
|
|
3010
3076
|
};
|
|
3011
3077
|
}
|
|
3012
3078
|
const ut = Mt(null);
|
|
3013
|
-
function
|
|
3079
|
+
function Us({ children: t, config: e }) {
|
|
3014
3080
|
const [n, r] = x({
|
|
3015
3081
|
isAuthenticated: !1,
|
|
3016
3082
|
isLoading: !0,
|
|
3017
3083
|
user: null,
|
|
3018
3084
|
error: null
|
|
3019
3085
|
});
|
|
3020
|
-
|
|
3086
|
+
T(() => {
|
|
3021
3087
|
(() => {
|
|
3022
|
-
const m = e.devLoginRunId, c = !!m &&
|
|
3023
|
-
m &&
|
|
3024
|
-
const u = !!e.devLoginToken && !!m && !c && !qt(e.devLoginToken), y =
|
|
3088
|
+
const m = e.devLoginRunId, c = !!m && Po() === m;
|
|
3089
|
+
m && Lo(m);
|
|
3090
|
+
const u = !!e.devLoginToken && !!m && !c && !qt(e.devLoginToken), y = jo();
|
|
3025
3091
|
if (y) {
|
|
3026
3092
|
Nt(), r({
|
|
3027
3093
|
isAuthenticated: !1,
|
|
@@ -3031,7 +3097,7 @@ function Ns({ children: t, config: e }) {
|
|
|
3031
3097
|
});
|
|
3032
3098
|
return;
|
|
3033
3099
|
}
|
|
3034
|
-
const p =
|
|
3100
|
+
const p = Do();
|
|
3035
3101
|
if (p) {
|
|
3036
3102
|
const b = {
|
|
3037
3103
|
token: p.token,
|
|
@@ -3110,7 +3176,7 @@ function Ns({ children: t, config: e }) {
|
|
|
3110
3176
|
if (g === "passkey") {
|
|
3111
3177
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3112
3178
|
try {
|
|
3113
|
-
const c = await
|
|
3179
|
+
const c = await Wo(m), u = await Jo({ optionsJSON: c }), y = await Vo(m, u);
|
|
3114
3180
|
r({
|
|
3115
3181
|
isAuthenticated: !0,
|
|
3116
3182
|
isLoading: !1,
|
|
@@ -3128,7 +3194,7 @@ function Ns({ children: t, config: e }) {
|
|
|
3128
3194
|
}
|
|
3129
3195
|
if (g === "email")
|
|
3130
3196
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3131
|
-
window.location.href =
|
|
3197
|
+
window.location.href = $o(g, e.spaceId, m);
|
|
3132
3198
|
},
|
|
3133
3199
|
[e.authUrl, e.spaceId]
|
|
3134
3200
|
), s = j(
|
|
@@ -3136,14 +3202,14 @@ function Ns({ children: t, config: e }) {
|
|
|
3136
3202
|
if (!e.spaceId)
|
|
3137
3203
|
throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3138
3204
|
const m = await ve(e.authUrl);
|
|
3139
|
-
await
|
|
3205
|
+
await Uo({ email: g, spaceId: e.spaceId, authUrl: m });
|
|
3140
3206
|
},
|
|
3141
3207
|
[e.authUrl, e.spaceId]
|
|
3142
3208
|
), i = j(
|
|
3143
3209
|
async (g, m) => {
|
|
3144
3210
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3145
3211
|
try {
|
|
3146
|
-
const c = await ve(e.authUrl), u = await
|
|
3212
|
+
const c = await ve(e.authUrl), u = await Mo({ email: g, code: m, authUrl: c });
|
|
3147
3213
|
r({
|
|
3148
3214
|
isAuthenticated: !0,
|
|
3149
3215
|
isLoading: !1,
|
|
@@ -3168,7 +3234,7 @@ function Ns({ children: t, config: e }) {
|
|
|
3168
3234
|
const m = await ve(e.authUrl);
|
|
3169
3235
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3170
3236
|
try {
|
|
3171
|
-
const c = await
|
|
3237
|
+
const c = await Bo(m), u = await Xo({ optionsJSON: c }), y = await Fo(m, u, g);
|
|
3172
3238
|
r({
|
|
3173
3239
|
isAuthenticated: !0,
|
|
3174
3240
|
isLoading: !1,
|
|
@@ -3184,39 +3250,39 @@ function Ns({ children: t, config: e }) {
|
|
|
3184
3250
|
}
|
|
3185
3251
|
},
|
|
3186
3252
|
[e.authUrl]
|
|
3187
|
-
),
|
|
3253
|
+
), d = j(() => n.user?.token ?? null, [n.user]), h = W(
|
|
3188
3254
|
() => ({
|
|
3189
3255
|
state: n,
|
|
3190
3256
|
login: o,
|
|
3191
3257
|
logout: a,
|
|
3192
|
-
getToken:
|
|
3258
|
+
getToken: d,
|
|
3193
3259
|
registerPasskey: l,
|
|
3194
3260
|
requestEmailCode: s,
|
|
3195
3261
|
submitEmailCode: i
|
|
3196
3262
|
}),
|
|
3197
|
-
[n, o, a,
|
|
3263
|
+
[n, o, a, d, l, s, i]
|
|
3198
3264
|
);
|
|
3199
|
-
return /* @__PURE__ */ w.jsx(ut, { value:
|
|
3265
|
+
return /* @__PURE__ */ w.jsx(ut, { value: h, children: t });
|
|
3200
3266
|
}
|
|
3201
|
-
function
|
|
3267
|
+
function Zo() {
|
|
3202
3268
|
const t = st(ut);
|
|
3203
3269
|
if (!t)
|
|
3204
3270
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3205
3271
|
return t;
|
|
3206
3272
|
}
|
|
3207
|
-
function
|
|
3273
|
+
function Qo() {
|
|
3208
3274
|
return st(ut);
|
|
3209
3275
|
}
|
|
3210
|
-
function
|
|
3211
|
-
const { config: e, guestUrlParam: n } = t, { state: r, login: o } =
|
|
3212
|
-
return
|
|
3276
|
+
function Ms(t) {
|
|
3277
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = Zo(), s = E(!1);
|
|
3278
|
+
return T(() => {
|
|
3213
3279
|
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
3214
3280
|
return;
|
|
3215
3281
|
const i = new URLSearchParams(window.location.search), a = i.get(n);
|
|
3216
3282
|
if (a === "true" || a === "1" || a === "") {
|
|
3217
3283
|
i.delete(n);
|
|
3218
|
-
const l = i.toString(),
|
|
3219
|
-
window.history.replaceState({}, "",
|
|
3284
|
+
const l = i.toString(), d = window.location.pathname + (l ? `?${l}` : "");
|
|
3285
|
+
window.history.replaceState({}, "", d), s.current = !0, o("guest");
|
|
3220
3286
|
}
|
|
3221
3287
|
}, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
|
|
3222
3288
|
shouldRenderChildren: r.isAuthenticated,
|
|
@@ -3231,9 +3297,9 @@ const on = (() => {
|
|
|
3231
3297
|
} catch {
|
|
3232
3298
|
return !1;
|
|
3233
3299
|
}
|
|
3234
|
-
})(), sn = Date.now(), re = [],
|
|
3300
|
+
})(), sn = Date.now(), re = [], es = 300;
|
|
3235
3301
|
function Ie(t) {
|
|
3236
|
-
re.push(`[+${((Date.now() - sn) / 1e3).toFixed(1)}s] ${t}`), re.length >
|
|
3302
|
+
re.push(`[+${((Date.now() - sn) / 1e3).toFixed(1)}s] ${t}`), re.length > es && re.shift();
|
|
3237
3303
|
}
|
|
3238
3304
|
function Lt(t) {
|
|
3239
3305
|
if (typeof t == "string")
|
|
@@ -3269,7 +3335,7 @@ function an() {
|
|
|
3269
3335
|
}
|
|
3270
3336
|
}
|
|
3271
3337
|
on && an();
|
|
3272
|
-
function
|
|
3338
|
+
function ts() {
|
|
3273
3339
|
let t = !1;
|
|
3274
3340
|
try {
|
|
3275
3341
|
const e = URL.createObjectURL(new Blob([""]));
|
|
@@ -3280,11 +3346,11 @@ function Zo() {
|
|
|
3280
3346
|
}
|
|
3281
3347
|
return t;
|
|
3282
3348
|
}
|
|
3283
|
-
function
|
|
3349
|
+
function ns() {
|
|
3284
3350
|
const t = globalThis;
|
|
3285
3351
|
return [
|
|
3286
3352
|
`Worker=${typeof Worker < "u"}`,
|
|
3287
|
-
`moduleWorker=${
|
|
3353
|
+
`moduleWorker=${ts()}`,
|
|
3288
3354
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3289
3355
|
`WebTransport=${typeof t.WebTransport < "u"}`,
|
|
3290
3356
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3297,12 +3363,12 @@ function Qo() {
|
|
|
3297
3363
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3298
3364
|
].join(" ");
|
|
3299
3365
|
}
|
|
3300
|
-
function
|
|
3366
|
+
function rs(t) {
|
|
3301
3367
|
return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
|
|
3302
3368
|
}
|
|
3303
3369
|
function cn({ state: t = "", forceVisible: e = !1 }) {
|
|
3304
3370
|
const n = on || e, r = t === "connected" || t === "reconnecting", [, o] = An((l) => l + 1, 0), [s, i] = x(!0);
|
|
3305
|
-
if (
|
|
3371
|
+
if (T(() => {
|
|
3306
3372
|
if (!n)
|
|
3307
3373
|
return;
|
|
3308
3374
|
an();
|
|
@@ -3338,12 +3404,12 @@ function cn({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3338
3404
|
] }),
|
|
3339
3405
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
|
|
3340
3406
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
|
|
3341
|
-
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children:
|
|
3407
|
+
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: ns() }),
|
|
3342
3408
|
/* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
|
|
3343
|
-
/* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l,
|
|
3409
|
+
/* @__PURE__ */ w.jsx("div", { children: re.length === 0 ? "(nothing captured yet)" : re.map((l, d) => /* @__PURE__ */ w.jsx("div", { style: { color: rs(l), wordBreak: "break-all" }, children: l }, d)) })
|
|
3344
3410
|
] });
|
|
3345
3411
|
}
|
|
3346
|
-
function
|
|
3412
|
+
function Ds({
|
|
3347
3413
|
connectionState: t,
|
|
3348
3414
|
error: e,
|
|
3349
3415
|
isReady: n,
|
|
@@ -3355,8 +3421,8 @@ function Ps({
|
|
|
3355
3421
|
// renderIdle prop is intentionally accepted but never invoked — the runtime no longer
|
|
3356
3422
|
// emits the deprecated 'idle' state. Kept on the props for source compatibility.
|
|
3357
3423
|
renderIdle: l,
|
|
3358
|
-
renderConnecting:
|
|
3359
|
-
renderConnectingSlow:
|
|
3424
|
+
renderConnecting: d,
|
|
3425
|
+
renderConnectingSlow: h,
|
|
3360
3426
|
renderConnected: g,
|
|
3361
3427
|
renderOffline: m,
|
|
3362
3428
|
renderError: c
|
|
@@ -3365,7 +3431,7 @@ function Ps({
|
|
|
3365
3431
|
switch (t) {
|
|
3366
3432
|
case "waitingForExternalConnectUrl":
|
|
3367
3433
|
case "connecting":
|
|
3368
|
-
return r ?
|
|
3434
|
+
return r ? h() : d();
|
|
3369
3435
|
case "connected":
|
|
3370
3436
|
case "reconnecting": {
|
|
3371
3437
|
if (!n || !o || !s) return null;
|
|
@@ -3395,48 +3461,48 @@ function Ps({
|
|
|
3395
3461
|
/* @__PURE__ */ w.jsx(cn, { state: t })
|
|
3396
3462
|
] });
|
|
3397
3463
|
}
|
|
3398
|
-
const
|
|
3399
|
-
function
|
|
3464
|
+
const xe = oe("useIkonApp");
|
|
3465
|
+
function os() {
|
|
3400
3466
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3401
3467
|
return window.__IKON_AUTH_CONFIG__;
|
|
3402
3468
|
}
|
|
3403
|
-
function
|
|
3469
|
+
function ss() {
|
|
3404
3470
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3405
3471
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3406
3472
|
}
|
|
3407
|
-
function
|
|
3408
|
-
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport:
|
|
3409
|
-
|
|
3410
|
-
const [
|
|
3473
|
+
function js(t) {
|
|
3474
|
+
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: d, proxy: h, liveSnapshot: g, bootSnapshot: m } = t, c = e === void 0 ? os() ?? null : e, u = ss(), y = Qo(), p = E(null), S = E(null), b = E(null), R = E(!1), v = E(!1), k = E(o), U = E(r), ee = E(s), te = E(i), z = E(a), I = E(l), P = E(d), M = E(h), B = E(g), $ = E(m), V = E("local"), K = E(void 0);
|
|
3475
|
+
k.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, I.current = l, P.current = d, M.current = h, B.current = g, $.current = m;
|
|
3476
|
+
const [q, Ee] = x("connecting"), [Re, pe] = x(!1), [f, A] = x(!1), [O, N] = x(null), [se, me] = x(null), [L, Q] = x(!1), [ie, Me] = x(null), [ae, un] = x(null), [De, dt] = x(!1), je = E(!1), [dn, fn] = x(0), G = W(() => {
|
|
3411
3477
|
try {
|
|
3412
3478
|
const _ = In();
|
|
3413
|
-
return (_.sessionId || _.channelKey) &&
|
|
3479
|
+
return (_.sessionId || _.channelKey) && xn(), _;
|
|
3414
3480
|
} catch {
|
|
3415
3481
|
return { parameters: {} };
|
|
3416
3482
|
}
|
|
3417
3483
|
}, []);
|
|
3418
3484
|
m !== !1 && vn();
|
|
3419
|
-
const ce =
|
|
3485
|
+
const ce = W(() => c?.enabled ? Jt() : null, [c?.enabled, dn]), Ae = u?.enabled ?? !1, $e = u?.host ?? "localhost", Be = u?.port ?? 8443, Fe = !!c && !c.enabled && !!c.spaceId && (ht() || Ae);
|
|
3420
3486
|
Fe && !ae && !De && !je.current && (je.current = !0, ve(c.authUrl).then((_) => Qt(c.spaceId, _)).then((_) => {
|
|
3421
3487
|
un(_.token), dt(!0);
|
|
3422
3488
|
}).catch((_) => {
|
|
3423
|
-
|
|
3489
|
+
xe.error("Anonymous auth failed:", _), je.current = !1, Ae ? dt(!0) : N(_ instanceof Error ? _.message : "Anonymous auth failed");
|
|
3424
3490
|
}));
|
|
3425
|
-
const We =
|
|
3491
|
+
const We = W(() => {
|
|
3426
3492
|
if (Ae) {
|
|
3427
3493
|
if (Fe && !De)
|
|
3428
3494
|
return null;
|
|
3429
|
-
const _ = ce?.token ?? ae ?? void 0,
|
|
3495
|
+
const _ = ce?.token ?? ae ?? void 0, J = _ ? pt(_) ?? void 0 : void 0;
|
|
3430
3496
|
return {
|
|
3431
3497
|
local: {
|
|
3432
3498
|
host: $e,
|
|
3433
3499
|
httpsPort: Be,
|
|
3434
|
-
userId:
|
|
3500
|
+
userId: J,
|
|
3435
3501
|
token: ce?.token ?? void 0,
|
|
3436
3502
|
spaceId: c?.spaceId,
|
|
3437
3503
|
backendUrl: c?.backendUrl,
|
|
3438
3504
|
authUrl: c?.authUrl,
|
|
3439
|
-
parameters:
|
|
3505
|
+
parameters: G.parameters
|
|
3440
3506
|
}
|
|
3441
3507
|
};
|
|
3442
3508
|
}
|
|
@@ -3445,18 +3511,18 @@ function Us(t) {
|
|
|
3445
3511
|
token: ce.token,
|
|
3446
3512
|
spaceId: c.spaceId,
|
|
3447
3513
|
backendType: mt(),
|
|
3448
|
-
sessionId:
|
|
3449
|
-
channelKey:
|
|
3450
|
-
parameters:
|
|
3514
|
+
sessionId: G.sessionId,
|
|
3515
|
+
channelKey: G.channelKey,
|
|
3516
|
+
parameters: G.parameters
|
|
3451
3517
|
}
|
|
3452
3518
|
} : ae && c?.spaceId ? {
|
|
3453
3519
|
sessionToken: {
|
|
3454
3520
|
token: ae,
|
|
3455
3521
|
spaceId: c.spaceId,
|
|
3456
3522
|
backendType: mt(),
|
|
3457
|
-
sessionId:
|
|
3458
|
-
channelKey:
|
|
3459
|
-
parameters:
|
|
3523
|
+
sessionId: G.sessionId,
|
|
3524
|
+
channelKey: G.channelKey,
|
|
3525
|
+
parameters: G.parameters
|
|
3460
3526
|
}
|
|
3461
3527
|
} : ht() ? null : {
|
|
3462
3528
|
local: {
|
|
@@ -3465,29 +3531,29 @@ function Us(t) {
|
|
|
3465
3531
|
spaceId: c?.spaceId,
|
|
3466
3532
|
backendUrl: c?.backendUrl,
|
|
3467
3533
|
authUrl: c?.authUrl,
|
|
3468
|
-
parameters:
|
|
3534
|
+
parameters: G.parameters
|
|
3469
3535
|
}
|
|
3470
3536
|
};
|
|
3471
|
-
}, [Ae, $e, Be, ce?.token, c?.spaceId, c?.backendUrl, c?.authUrl, ae, Fe, De,
|
|
3472
|
-
|
|
3473
|
-
const hn =
|
|
3474
|
-
|
|
3537
|
+
}, [Ae, $e, Be, ce?.token, c?.spaceId, c?.backendUrl, c?.authUrl, ae, Fe, De, G.sessionId, G.channelKey, G.parameters]);
|
|
3538
|
+
V.current = c?.spaceId ?? "local", K.current = ce?.token ?? ae ?? void 0, so(ie);
|
|
3539
|
+
const hn = ao(ie);
|
|
3540
|
+
T(() => {
|
|
3475
3541
|
if (!R.current) {
|
|
3476
|
-
if (R.current = !0, b.current =
|
|
3542
|
+
if (R.current = !0, b.current = Jr(), n)
|
|
3477
3543
|
for (const _ of n)
|
|
3478
3544
|
_(b.current);
|
|
3479
3545
|
b.current.loadRegisteredModules().catch((_) => {
|
|
3480
|
-
|
|
3546
|
+
xe.error("Failed to load UI modules", _);
|
|
3481
3547
|
});
|
|
3482
3548
|
}
|
|
3483
|
-
}, []),
|
|
3549
|
+
}, []), T(() => {
|
|
3484
3550
|
if (!We) return;
|
|
3485
|
-
const _ = new
|
|
3551
|
+
const _ = new On({
|
|
3486
3552
|
...We,
|
|
3487
3553
|
timeouts: U.current,
|
|
3488
|
-
audio: te.current !== void 0 ||
|
|
3554
|
+
audio: te.current !== void 0 || k.current ? {
|
|
3489
3555
|
enabled: te.current,
|
|
3490
|
-
...
|
|
3556
|
+
...k.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
3491
3557
|
} : void 0,
|
|
3492
3558
|
video: z.current !== void 0 ? { enabled: z.current } : void 0,
|
|
3493
3559
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
@@ -3495,50 +3561,50 @@ function Us(t) {
|
|
|
3495
3561
|
websocket: I.current,
|
|
3496
3562
|
webtransport: P.current,
|
|
3497
3563
|
proxy: M.current,
|
|
3498
|
-
onConnectionStateChange: (
|
|
3499
|
-
Ee(
|
|
3564
|
+
onConnectionStateChange: (Z) => {
|
|
3565
|
+
Ee(Z);
|
|
3500
3566
|
},
|
|
3501
|
-
onError: (
|
|
3502
|
-
N(
|
|
3567
|
+
onError: (Z) => {
|
|
3568
|
+
N(Z.message);
|
|
3503
3569
|
}
|
|
3504
3570
|
});
|
|
3505
3571
|
p.current = _;
|
|
3506
|
-
const
|
|
3507
|
-
S.current =
|
|
3508
|
-
const yn =
|
|
3572
|
+
const J = B.current ?? !0, ke = K.current, ft = ke ? pt(ke) ?? null : null, gn = J && ft ? { enabled: !0, appId: V.current, userId: ft } : void 0, Te = new rr({ client: _, liveSnapshot: gn, bootSnapshot: $.current });
|
|
3573
|
+
S.current = Te, Me(Te), A(!1);
|
|
3574
|
+
const yn = Te.subscribeToUiUpdates(() => {
|
|
3509
3575
|
A(!0), Nn();
|
|
3510
3576
|
});
|
|
3511
|
-
return _.connect().catch((
|
|
3512
|
-
if (
|
|
3513
|
-
me(
|
|
3577
|
+
return _.connect().catch((Z) => {
|
|
3578
|
+
if (xe.error("Connection failed:", Z), Z instanceof Ln) {
|
|
3579
|
+
me(Z.reason);
|
|
3514
3580
|
return;
|
|
3515
3581
|
}
|
|
3516
|
-
if (
|
|
3582
|
+
if (Z instanceof Pn) {
|
|
3517
3583
|
Q(!0);
|
|
3518
3584
|
return;
|
|
3519
3585
|
}
|
|
3520
|
-
|
|
3586
|
+
Z instanceof Un && !v.current && (v.current = !0, xe.warn("Auth session appears stale, clearing and retrying"), Ut.clearAll(), y ? y.logout() : (Le(), fn((bn) => bn + 1)));
|
|
3521
3587
|
}), () => {
|
|
3522
|
-
yn(), _.disconnect(), p.current = null,
|
|
3588
|
+
yn(), _.disconnect(), p.current = null, Te.dispose(), S.current = null;
|
|
3523
3589
|
};
|
|
3524
3590
|
}, [We]);
|
|
3525
|
-
const pn = j((_,
|
|
3526
|
-
const
|
|
3527
|
-
p.current?.sendActionCall(_,
|
|
3591
|
+
const pn = j((_, J) => {
|
|
3592
|
+
const ke = typeof J == "string" ? J : JSON.stringify(J ?? {});
|
|
3593
|
+
p.current?.sendActionCall(_, ke);
|
|
3528
3594
|
}, []);
|
|
3529
|
-
|
|
3530
|
-
if (
|
|
3595
|
+
T(() => {
|
|
3596
|
+
if (q !== "connecting") {
|
|
3531
3597
|
pe(!1);
|
|
3532
3598
|
return;
|
|
3533
3599
|
}
|
|
3534
|
-
const _ = p.current?.slowConnectionThresholdMs ?? 5e3,
|
|
3535
|
-
return () => clearTimeout(
|
|
3536
|
-
}, [
|
|
3537
|
-
const mn =
|
|
3538
|
-
return
|
|
3600
|
+
const _ = p.current?.slowConnectionThresholdMs ?? 5e3, J = setTimeout(() => pe(!0), _);
|
|
3601
|
+
return () => clearTimeout(J);
|
|
3602
|
+
}, [q]);
|
|
3603
|
+
const mn = q === "connected" || q === "reconnecting", Ve = f && q !== "offline";
|
|
3604
|
+
return T(() => {
|
|
3539
3605
|
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(Ve));
|
|
3540
3606
|
}, [Ve]), {
|
|
3541
|
-
connectionState:
|
|
3607
|
+
connectionState: q,
|
|
3542
3608
|
error: O,
|
|
3543
3609
|
accessDeniedReason: se,
|
|
3544
3610
|
isServerFull: L,
|
|
@@ -3557,7 +3623,7 @@ function Us(t) {
|
|
|
3557
3623
|
webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3558
3624
|
};
|
|
3559
3625
|
}
|
|
3560
|
-
function
|
|
3626
|
+
function $s(t) {
|
|
3561
3627
|
const e = E(!1);
|
|
3562
3628
|
return j(() => {
|
|
3563
3629
|
if (e.current) return;
|
|
@@ -3566,28 +3632,28 @@ function Ms(t) {
|
|
|
3566
3632
|
n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
3567
3633
|
}, [t]);
|
|
3568
3634
|
}
|
|
3569
|
-
let
|
|
3570
|
-
function
|
|
3635
|
+
let is = 0;
|
|
3636
|
+
function as(t = 5, e = 5e3) {
|
|
3571
3637
|
const [n, r] = x([]), o = E(/* @__PURE__ */ new Map()), s = j((i) => {
|
|
3572
3638
|
const a = o.current.get(i);
|
|
3573
|
-
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((
|
|
3639
|
+
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((d) => d.id !== i));
|
|
3574
3640
|
}, []);
|
|
3575
|
-
return
|
|
3641
|
+
return T(() => {
|
|
3576
3642
|
const i = o.current, a = jt(
|
|
3577
3643
|
(l) => {
|
|
3578
3644
|
if (!$t())
|
|
3579
3645
|
return;
|
|
3580
|
-
const
|
|
3581
|
-
id:
|
|
3582
|
-
level:
|
|
3646
|
+
const d = `toast-${++is}`, h = l.level === Je.ERROR ? "error" : "warn", g = {
|
|
3647
|
+
id: d,
|
|
3648
|
+
level: h,
|
|
3583
3649
|
message: l.message,
|
|
3584
3650
|
component: l.component
|
|
3585
3651
|
};
|
|
3586
3652
|
r((c) => [...c, g].slice(-t));
|
|
3587
3653
|
const m = setTimeout(() => {
|
|
3588
|
-
s(
|
|
3654
|
+
s(d);
|
|
3589
3655
|
}, e);
|
|
3590
|
-
i.set(
|
|
3656
|
+
i.set(d, m);
|
|
3591
3657
|
},
|
|
3592
3658
|
{ minLevel: Je.WARN }
|
|
3593
3659
|
);
|
|
@@ -3599,9 +3665,9 @@ function os(t = 5, e = 5e3) {
|
|
|
3599
3665
|
};
|
|
3600
3666
|
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3601
3667
|
}
|
|
3602
|
-
function
|
|
3668
|
+
function cs(t, e, n) {
|
|
3603
3669
|
const [r, o] = x(n);
|
|
3604
|
-
return
|
|
3670
|
+
return T(() => {
|
|
3605
3671
|
if (!t)
|
|
3606
3672
|
return;
|
|
3607
3673
|
let s = !0, i = null;
|
|
@@ -3616,9 +3682,9 @@ function ss(t, e, n) {
|
|
|
3616
3682
|
};
|
|
3617
3683
|
}, [t, e]), r;
|
|
3618
3684
|
}
|
|
3619
|
-
function
|
|
3685
|
+
function Bs(t, e, n) {
|
|
3620
3686
|
const [r, o] = x(null);
|
|
3621
|
-
return
|
|
3687
|
+
return T(() => {
|
|
3622
3688
|
if (!t)
|
|
3623
3689
|
return;
|
|
3624
3690
|
let s = !0;
|
|
@@ -3629,98 +3695,98 @@ function Ds(t, e, n) {
|
|
|
3629
3695
|
}), () => {
|
|
3630
3696
|
s = !1;
|
|
3631
3697
|
};
|
|
3632
|
-
}, [t, e]),
|
|
3698
|
+
}, [t, e]), cs(r ? t : null, r ?? "", n);
|
|
3633
3699
|
}
|
|
3634
|
-
const ue = oe("IkonDebug"),
|
|
3700
|
+
const ue = oe("IkonDebug"), ls = {
|
|
3635
3701
|
Digit1: "connecting",
|
|
3636
3702
|
Digit2: "connected",
|
|
3637
3703
|
Digit3: "reconnecting",
|
|
3638
3704
|
Digit4: "offline",
|
|
3639
3705
|
Digit5: "offline",
|
|
3640
3706
|
Digit0: "clear"
|
|
3641
|
-
},
|
|
3642
|
-
function
|
|
3643
|
-
const e = $t(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l,
|
|
3644
|
-
return
|
|
3707
|
+
}, us = "Digit5", ds = "Digit6", fs = "Synthetic debug error (Ctrl+Shift+5)", hs = "Synthetic debug access-denied (Ctrl+Shift+6)", ps = 5e3;
|
|
3708
|
+
function ms(t) {
|
|
3709
|
+
const e = $t(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l, d] = x(null), [h, g] = x(!1), [m, c] = x(!1), [u, y] = x(!1);
|
|
3710
|
+
return T(() => {
|
|
3645
3711
|
if (!e)
|
|
3646
3712
|
return;
|
|
3647
3713
|
const S = (b) => {
|
|
3648
3714
|
if (!b.ctrlKey || !b.shiftKey)
|
|
3649
3715
|
return;
|
|
3650
3716
|
if (b.code === "KeyE") {
|
|
3651
|
-
b.preventDefault(), g((
|
|
3717
|
+
b.preventDefault(), g((k) => (ue.warn(`Empty-stores override: ${k ? "off" : "on"}`), !k));
|
|
3652
3718
|
return;
|
|
3653
3719
|
}
|
|
3654
3720
|
if (b.code === "Digit7") {
|
|
3655
|
-
b.preventDefault(), c((
|
|
3721
|
+
b.preventDefault(), c((k) => (ue.warn(`Branding-banner override: ${k ? "off" : "on"}`), !k));
|
|
3656
3722
|
return;
|
|
3657
3723
|
}
|
|
3658
3724
|
if (b.code === "Digit8") {
|
|
3659
|
-
b.preventDefault(), y((
|
|
3725
|
+
b.preventDefault(), y((k) => (ue.warn(`Debug-overlay override: ${k ? "off" : "on"}`), !k));
|
|
3660
3726
|
return;
|
|
3661
3727
|
}
|
|
3662
|
-
if (b.code ===
|
|
3663
|
-
b.preventDefault(),
|
|
3728
|
+
if (b.code === ds) {
|
|
3729
|
+
b.preventDefault(), d(hs), r(null), a(null), ue.warn("Forced access denied");
|
|
3664
3730
|
return;
|
|
3665
3731
|
}
|
|
3666
|
-
const R =
|
|
3732
|
+
const R = ls[b.code];
|
|
3667
3733
|
if (R === void 0)
|
|
3668
3734
|
return;
|
|
3669
3735
|
if (b.preventDefault(), R === "clear") {
|
|
3670
|
-
r(null), a(null),
|
|
3736
|
+
r(null), a(null), d(null), ue.warn("Cleared forced state");
|
|
3671
3737
|
return;
|
|
3672
3738
|
}
|
|
3673
|
-
const v = b.code ===
|
|
3674
|
-
r(R), a(v ?
|
|
3739
|
+
const v = b.code === us;
|
|
3740
|
+
r(R), a(v ? fs : null), d(null), ue.warn(`Forced state: ${R}${v ? " (with error)" : ""}`);
|
|
3675
3741
|
};
|
|
3676
3742
|
return window.addEventListener("keydown", S), () => window.removeEventListener("keydown", S);
|
|
3677
|
-
}, [e]),
|
|
3743
|
+
}, [e]), T(() => {
|
|
3678
3744
|
if (n !== "connecting") {
|
|
3679
3745
|
s(!1);
|
|
3680
3746
|
return;
|
|
3681
3747
|
}
|
|
3682
|
-
const S = setTimeout(() => s(!0),
|
|
3748
|
+
const S = setTimeout(() => s(!0), ps);
|
|
3683
3749
|
return () => clearTimeout(S);
|
|
3684
|
-
}, [n]), !e || n === null && !
|
|
3750
|
+
}, [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: {
|
|
3685
3751
|
...t,
|
|
3686
3752
|
connectionState: n ?? t.connectionState,
|
|
3687
3753
|
isConnectingSlow: n === "connecting" ? o : t.isConnectingSlow,
|
|
3688
3754
|
error: n === "offline" && i ? i : n ? null : t.error,
|
|
3689
|
-
stores:
|
|
3755
|
+
stores: h ? /* @__PURE__ */ new Map() : t.stores,
|
|
3690
3756
|
accessDeniedReason: l ?? t.accessDeniedReason
|
|
3691
|
-
}, forcedState: n, emptyStores:
|
|
3757
|
+
}, forcedState: n, emptyStores: h, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
|
|
3692
3758
|
}
|
|
3693
|
-
function
|
|
3759
|
+
function gs(t, e) {
|
|
3694
3760
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3695
3761
|
}
|
|
3696
|
-
function
|
|
3762
|
+
function ys(t) {
|
|
3697
3763
|
return t === void 0 ? null : typeof t == "function" ? t() : t;
|
|
3698
3764
|
}
|
|
3699
|
-
function
|
|
3765
|
+
function bs(t, e) {
|
|
3700
3766
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3701
3767
|
}
|
|
3702
|
-
function
|
|
3768
|
+
function Ss(t, e) {
|
|
3703
3769
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3704
3770
|
}
|
|
3705
|
-
function
|
|
3706
|
-
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i =
|
|
3707
|
-
if (
|
|
3708
|
-
return
|
|
3771
|
+
function Fs(t) {
|
|
3772
|
+
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = ms(s), { app: a } = i, { connectionState: l, isConnectingSlow: d, stores: h, registry: g, client: m, onAction: c, isReady: u, error: y, accessDeniedReason: p, brandingRequired: S } = a, b = S || i.forcedBranding, R = E(null);
|
|
3773
|
+
if (h && g && (u || h.size > 0) && (R.current = { stores: h, registry: g, client: m }), p)
|
|
3774
|
+
return Ss(o, p);
|
|
3709
3775
|
const v = R.current;
|
|
3710
|
-
let
|
|
3776
|
+
let k;
|
|
3711
3777
|
switch (l) {
|
|
3712
3778
|
case "waitingForExternalConnectUrl":
|
|
3713
3779
|
case "connecting":
|
|
3714
|
-
|
|
3780
|
+
k = gs(e, d);
|
|
3715
3781
|
break;
|
|
3716
3782
|
case "reconnecting":
|
|
3717
|
-
|
|
3783
|
+
k = ys(n);
|
|
3718
3784
|
break;
|
|
3719
3785
|
case "offline":
|
|
3720
|
-
|
|
3786
|
+
k = bs(r, y);
|
|
3721
3787
|
break;
|
|
3722
3788
|
default:
|
|
3723
|
-
|
|
3789
|
+
k = null;
|
|
3724
3790
|
}
|
|
3725
3791
|
return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
3726
3792
|
v && /* @__PURE__ */ w.jsx(
|
|
@@ -3732,19 +3798,19 @@ function js(t) {
|
|
|
3732
3798
|
onAction: c
|
|
3733
3799
|
}
|
|
3734
3800
|
),
|
|
3735
|
-
|
|
3736
|
-
b && /* @__PURE__ */ w.jsx(
|
|
3737
|
-
/* @__PURE__ */ w.jsx(
|
|
3801
|
+
k,
|
|
3802
|
+
b && /* @__PURE__ */ w.jsx(vs, {}),
|
|
3803
|
+
/* @__PURE__ */ w.jsx(Es, {}),
|
|
3738
3804
|
/* @__PURE__ */ w.jsx(cn, { state: l, forceVisible: i.forcedDebugOverlay })
|
|
3739
3805
|
] });
|
|
3740
3806
|
}
|
|
3741
|
-
const
|
|
3742
|
-
function
|
|
3807
|
+
const ws = "https://ikonai.com";
|
|
3808
|
+
function vs() {
|
|
3743
3809
|
return /* @__PURE__ */ w.jsxs(
|
|
3744
3810
|
"a",
|
|
3745
3811
|
{
|
|
3746
3812
|
className: "ikon-branding-banner",
|
|
3747
|
-
href:
|
|
3813
|
+
href: ws,
|
|
3748
3814
|
target: "_blank",
|
|
3749
3815
|
rel: "noopener noreferrer",
|
|
3750
3816
|
style: {
|
|
@@ -3772,11 +3838,11 @@ function bs() {
|
|
|
3772
3838
|
}
|
|
3773
3839
|
);
|
|
3774
3840
|
}
|
|
3775
|
-
function
|
|
3776
|
-
const { toasts: t, dismissToast: e } =
|
|
3777
|
-
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(
|
|
3841
|
+
function Es() {
|
|
3842
|
+
const { toasts: t, dismissToast: e } = as();
|
|
3843
|
+
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(Rs, { toast: n, onDismiss: e }, n.id)) });
|
|
3778
3844
|
}
|
|
3779
|
-
function
|
|
3845
|
+
function Rs({ toast: t, onDismiss: e }) {
|
|
3780
3846
|
return /* @__PURE__ */ w.jsxs(
|
|
3781
3847
|
"div",
|
|
3782
3848
|
{
|
|
@@ -3798,30 +3864,30 @@ function ws({ toast: t, onDismiss: e }) {
|
|
|
3798
3864
|
);
|
|
3799
3865
|
}
|
|
3800
3866
|
const ln = Mt(null);
|
|
3801
|
-
function
|
|
3867
|
+
function As(t, e) {
|
|
3802
3868
|
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3803
3869
|
}
|
|
3804
|
-
function
|
|
3870
|
+
function ks(t, e) {
|
|
3805
3871
|
const n = Mn();
|
|
3806
3872
|
if (n && t.includes(n))
|
|
3807
3873
|
return n;
|
|
3808
3874
|
const r = navigator.language.split("-")[0];
|
|
3809
3875
|
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3810
3876
|
}
|
|
3811
|
-
function
|
|
3812
|
-
return e ?
|
|
3877
|
+
function Ts(t, e, n) {
|
|
3878
|
+
return e ? ks(t, n) : n && t.includes(n) ? n : "en";
|
|
3813
3879
|
}
|
|
3814
|
-
function
|
|
3880
|
+
function Ws({
|
|
3815
3881
|
children: t,
|
|
3816
3882
|
translations: e,
|
|
3817
3883
|
defaultLanguage: n,
|
|
3818
3884
|
detectLanguage: r = !1
|
|
3819
3885
|
}) {
|
|
3820
|
-
const o = Object.keys(e), s =
|
|
3886
|
+
const o = Object.keys(e), s = Ts(o, r, n), i = e[s] ?? e.en, a = W(
|
|
3821
3887
|
() => ({
|
|
3822
|
-
t: (l,
|
|
3823
|
-
const
|
|
3824
|
-
return
|
|
3888
|
+
t: (l, d) => {
|
|
3889
|
+
const h = i[l];
|
|
3890
|
+
return As(h, d);
|
|
3825
3891
|
},
|
|
3826
3892
|
locale: s,
|
|
3827
3893
|
translations: i
|
|
@@ -3830,72 +3896,72 @@ function $s({
|
|
|
3830
3896
|
);
|
|
3831
3897
|
return /* @__PURE__ */ w.jsx(ln, { value: a, children: t });
|
|
3832
3898
|
}
|
|
3833
|
-
function
|
|
3899
|
+
function Vs() {
|
|
3834
3900
|
const t = st(ln);
|
|
3835
3901
|
if (!t)
|
|
3836
3902
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3837
3903
|
return t;
|
|
3838
3904
|
}
|
|
3839
3905
|
export {
|
|
3840
|
-
|
|
3841
|
-
|
|
3906
|
+
Us as AuthProvider,
|
|
3907
|
+
Ds as ConnectionStateRenderer,
|
|
3842
3908
|
on as DEBUG_OVERLAY_ENABLED,
|
|
3843
3909
|
cn as DebugOverlay,
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3910
|
+
Ws as I18nProvider,
|
|
3911
|
+
Sr as IKON_UI_BASE_MODULE,
|
|
3912
|
+
Or as IKON_UI_MEDIA_MODULE,
|
|
3913
|
+
zr as IKON_UI_SHADERTOY_MODULE,
|
|
3914
|
+
Gr as IKON_UI_SHADERTOY_TYPE,
|
|
3849
3915
|
Qe as IKON_UI_STREAM_CATEGORY,
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3916
|
+
Tr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3917
|
+
Cr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3918
|
+
Fs as IkonApp,
|
|
3919
|
+
rr as IkonUi,
|
|
3920
|
+
qr as IkonUiRegistry,
|
|
3855
3921
|
Bt as IkonUiSurface,
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3922
|
+
er as InspectOverlay,
|
|
3923
|
+
Ls as ParallaxView,
|
|
3924
|
+
Qn as UiComponentRegistry,
|
|
3925
|
+
Zn as UiRenderer,
|
|
3926
|
+
Ys as UiStreamStore,
|
|
3861
3927
|
Qt as authenticateAnonymous,
|
|
3862
|
-
|
|
3928
|
+
$o as buildOAuthRedirectUrl,
|
|
3863
3929
|
Le as clearAuthSession,
|
|
3864
3930
|
Nt as clearOAuthParams,
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3931
|
+
br as createBaseResolvers,
|
|
3932
|
+
Os as createComponentLibrary,
|
|
3933
|
+
Jr as createIkonUiRegistry,
|
|
3934
|
+
Ir as createMediaResolvers,
|
|
3935
|
+
Yr as createShadertoyRendererResolver,
|
|
3936
|
+
nr as isIkonUiCategoryMatch,
|
|
3871
3937
|
Jt as loadAuthSession,
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3938
|
+
wr as loadBaseModule,
|
|
3939
|
+
Nr as loadMediaModule,
|
|
3940
|
+
Xr as loadShadertoyModule,
|
|
3941
|
+
Do as parseOAuthCallback,
|
|
3942
|
+
jo as parseOAuthError,
|
|
3943
|
+
Xs as randomUuid,
|
|
3944
|
+
vr as registerBaseModule,
|
|
3945
|
+
Lr as registerMediaModule,
|
|
3946
|
+
Hr as registerShadertoyModule,
|
|
3947
|
+
qn as renderChildren,
|
|
3948
|
+
Ps as renderMotionLetters,
|
|
3883
3949
|
he as saveAuthSession,
|
|
3884
|
-
|
|
3950
|
+
Uo as sendLoginCode,
|
|
3885
3951
|
ne as sessionToUser,
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3952
|
+
Zo as useAuth,
|
|
3953
|
+
Ms as useAuthGuard,
|
|
3954
|
+
Qo as useAuthOptional,
|
|
3955
|
+
Vs as useI18n,
|
|
3956
|
+
js as useIkonApp,
|
|
3957
|
+
ms as useIkonDebug,
|
|
3958
|
+
cs as useIkonReactive,
|
|
3959
|
+
so as useIkonStyles,
|
|
3960
|
+
ao as useIkonUiStores,
|
|
3961
|
+
$s as useLazyFont,
|
|
3962
|
+
Bs as useReactive,
|
|
3963
|
+
as as useToasts,
|
|
3964
|
+
H as useUiNode,
|
|
3965
|
+
Ns as useUiStore,
|
|
3966
|
+
Mo as verifyLoginCode
|
|
3901
3967
|
};
|