@ikonai/sdk-react-ui 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/use-ikon-app.d.ts +16 -0
- package/index.js +976 -952
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
5
|
-
var
|
|
1
|
+
import { IkonUiCore as Lt, UiStreamStore as Mt } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as Lo } from "@ikonai/sdk-ui";
|
|
3
|
+
import Ut, { useSyncExternalStore as Ve, useMemo as W, memo as q, useRef as w, useCallback as D, Fragment as xt, useEffect as M, useState as z, createContext as gt, use as Ke } from "react";
|
|
4
|
+
import { createLogger as Ee, getOrCreateDeviceId as be, deriveAuthUrl as Me, parseUrlParams as Dt, clearSessionParamsFromUrl as Ft, isCloudEnvironment as He, extractUserIdFromToken as Bt, deriveBackendType as Je, IkonClient as $t, subscribeToLogEvents as Vt, isDebugModeEnabled as Kt, LogLevel as Xe } from "@ikonai/sdk";
|
|
5
|
+
var ye = { exports: {} }, ae = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -12,10 +12,10 @@ var he = { exports: {} }, se = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
15
|
+
var Ze;
|
|
16
|
+
function Wt() {
|
|
17
|
+
if (Ze) return ae;
|
|
18
|
+
Ze = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
20
|
function r(n, o, s) {
|
|
21
21
|
var i = null;
|
|
@@ -32,9 +32,9 @@ function xt() {
|
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return ae.Fragment = e, ae.jsx = r, ae.jsxs = r, ae;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ce = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -44,24 +44,24 @@ var ie = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
47
|
+
var Qe;
|
|
48
|
+
function Yt() {
|
|
49
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(l) {
|
|
51
51
|
if (l == null) return null;
|
|
52
52
|
if (typeof l == "function")
|
|
53
|
-
return l.$$typeof ===
|
|
53
|
+
return l.$$typeof === L ? null : l.displayName || l.name || null;
|
|
54
54
|
if (typeof l == "string") return l;
|
|
55
55
|
switch (l) {
|
|
56
|
-
case
|
|
56
|
+
case S:
|
|
57
57
|
return "Fragment";
|
|
58
|
-
case p:
|
|
59
|
-
return "Profiler";
|
|
60
58
|
case m:
|
|
59
|
+
return "Profiler";
|
|
60
|
+
case p:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case U:
|
|
63
63
|
return "Suspense";
|
|
64
|
-
case
|
|
64
|
+
case X:
|
|
65
65
|
return "SuspenseList";
|
|
66
66
|
case N:
|
|
67
67
|
return "Activity";
|
|
@@ -72,19 +72,19 @@ function Dt() {
|
|
|
72
72
|
), l.$$typeof) {
|
|
73
73
|
case y:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case
|
|
75
|
+
case A:
|
|
76
76
|
return (l.displayName || "Context") + ".Provider";
|
|
77
77
|
case v:
|
|
78
78
|
return (l._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
80
|
-
var
|
|
81
|
-
return l = l.displayName, l || (l =
|
|
82
|
-
case
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
|
|
79
|
+
case _:
|
|
80
|
+
var b = l.render;
|
|
81
|
+
return l = l.displayName, l || (l = b.displayName || b.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
82
|
+
case Q:
|
|
83
|
+
return b = l.displayName || null, b !== null ? b : t(l.type) || "Memo";
|
|
84
|
+
case k:
|
|
85
|
+
b = l._payload, l = l._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(l(
|
|
87
|
+
return t(l(b));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -96,50 +96,50 @@ function Dt() {
|
|
|
96
96
|
function r(l) {
|
|
97
97
|
try {
|
|
98
98
|
e(l);
|
|
99
|
-
var
|
|
99
|
+
var b = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
b = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var T =
|
|
103
|
+
if (b) {
|
|
104
|
+
b = console;
|
|
105
|
+
var T = b.error, C = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
|
|
106
106
|
return T.call(
|
|
107
|
-
|
|
107
|
+
b,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
109
|
+
C
|
|
110
110
|
), e(l);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function n(l) {
|
|
114
|
-
if (l ===
|
|
115
|
-
if (typeof l == "object" && l !== null && l.$$typeof ===
|
|
114
|
+
if (l === S) return "<>";
|
|
115
|
+
if (typeof l == "object" && l !== null && l.$$typeof === k)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var b = t(l);
|
|
119
|
+
return b ? "<" + b + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function o() {
|
|
125
|
-
var l =
|
|
125
|
+
var l = P.A;
|
|
126
126
|
return l === null ? null : l.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function s() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
131
|
function i(l) {
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
132
|
+
if (F.call(l, "key")) {
|
|
133
|
+
var b = Object.getOwnPropertyDescriptor(l, "key").get;
|
|
134
|
+
if (b && b.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
136
|
return l.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function a(l,
|
|
138
|
+
function a(l, b) {
|
|
139
139
|
function T() {
|
|
140
|
-
|
|
140
|
+
oe || (oe = !0, console.error(
|
|
141
141
|
"%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)",
|
|
142
|
-
|
|
142
|
+
b
|
|
143
143
|
));
|
|
144
144
|
}
|
|
145
145
|
T.isReactWarning = !0, Object.defineProperty(l, "key", {
|
|
@@ -149,17 +149,17 @@ function Dt() {
|
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
151
|
var l = t(this.type);
|
|
152
|
-
return
|
|
152
|
+
return me[l] || (me[l] = !0, console.error(
|
|
153
153
|
"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."
|
|
154
154
|
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
return T =
|
|
158
|
-
$$typeof:
|
|
156
|
+
function d(l, b, T, C, H, $, re, x) {
|
|
157
|
+
return T = $.ref, l = {
|
|
158
|
+
$$typeof: h,
|
|
159
159
|
type: l,
|
|
160
|
-
key:
|
|
161
|
-
props:
|
|
162
|
-
_owner:
|
|
160
|
+
key: b,
|
|
161
|
+
props: $,
|
|
162
|
+
_owner: H
|
|
163
163
|
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(l, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
get: c
|
|
@@ -177,68 +177,68 @@ function Dt() {
|
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
|
-
value:
|
|
180
|
+
value: re
|
|
181
181
|
}), Object.defineProperty(l, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
|
-
value:
|
|
185
|
+
value: x
|
|
186
186
|
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function f(l, b, T, C, H, $, re, x) {
|
|
189
|
+
var I = b.children;
|
|
190
|
+
if (I !== void 0)
|
|
191
|
+
if (C)
|
|
192
|
+
if (G(I)) {
|
|
193
|
+
for (C = 0; C < I.length; C++)
|
|
194
|
+
g(I[C]);
|
|
195
|
+
Object.freeze && Object.freeze(I);
|
|
196
196
|
} else
|
|
197
197
|
console.error(
|
|
198
198
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
199
199
|
);
|
|
200
|
-
else
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
var
|
|
204
|
-
return
|
|
200
|
+
else g(I);
|
|
201
|
+
if (F.call(b, "key")) {
|
|
202
|
+
I = t(l);
|
|
203
|
+
var Y = Object.keys(b).filter(function(ie) {
|
|
204
|
+
return ie !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
C = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ge[I + C] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s {...props} />
|
|
210
210
|
React keys must be passed directly to JSX without using spread:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s key={someKey} {...props} />`,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
),
|
|
213
|
+
C,
|
|
214
|
+
I,
|
|
215
|
+
Y,
|
|
216
|
+
I
|
|
217
|
+
), ge[I + C] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
219
|
+
if (I = null, T !== void 0 && (r(T), I = "" + T), i(b) && (r(b.key), I = "" + b.key), "key" in b) {
|
|
220
220
|
T = {};
|
|
221
|
-
for (var
|
|
222
|
-
|
|
223
|
-
} else T =
|
|
224
|
-
return
|
|
221
|
+
for (var ee in b)
|
|
222
|
+
ee !== "key" && (T[ee] = b[ee]);
|
|
223
|
+
} else T = b;
|
|
224
|
+
return I && a(
|
|
225
225
|
T,
|
|
226
226
|
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
|
|
227
|
-
),
|
|
227
|
+
), d(
|
|
228
228
|
l,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
I,
|
|
230
|
+
$,
|
|
231
|
+
H,
|
|
232
232
|
o(),
|
|
233
233
|
T,
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
re,
|
|
235
|
+
x
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
typeof l == "object" && l !== null && l.$$typeof ===
|
|
238
|
+
function g(l) {
|
|
239
|
+
typeof l == "object" && l !== null && l.$$typeof === h && l._store && (l._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var u =
|
|
241
|
+
var u = Ut, h = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), A = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), P = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, G = Array.isArray, te = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
u = {
|
|
@@ -246,44 +246,44 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
return l();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
249
|
+
var oe, me = {}, pe = u["react-stack-bottom-frame"].bind(
|
|
250
250
|
u,
|
|
251
251
|
s
|
|
252
|
-
)(),
|
|
253
|
-
|
|
254
|
-
var
|
|
255
|
-
return
|
|
252
|
+
)(), se = te(n(s)), ge = {};
|
|
253
|
+
ce.Fragment = S, ce.jsx = function(l, b, T, C, H) {
|
|
254
|
+
var $ = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return f(
|
|
256
256
|
l,
|
|
257
|
-
|
|
257
|
+
b,
|
|
258
258
|
T,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
C,
|
|
261
|
+
H,
|
|
262
|
+
$ ? Error("react-stack-top-frame") : pe,
|
|
263
|
+
$ ? te(n(l)) : se
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
267
|
-
return
|
|
265
|
+
}, ce.jsxs = function(l, b, T, C, H) {
|
|
266
|
+
var $ = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
267
|
+
return f(
|
|
268
268
|
l,
|
|
269
|
-
|
|
269
|
+
b,
|
|
270
270
|
T,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
C,
|
|
273
|
+
H,
|
|
274
|
+
$ ? Error("react-stack-top-frame") : pe,
|
|
275
|
+
$ ? te(n(l)) : se
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ce;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var et;
|
|
281
|
+
function zt() {
|
|
282
|
+
return et || (et = 1, process.env.NODE_ENV === "production" ? ye.exports = Wt() : ye.exports = Yt()), ye.exports;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
285
|
-
function
|
|
286
|
-
const r =
|
|
284
|
+
var E = zt();
|
|
285
|
+
function qt(t, e) {
|
|
286
|
+
const r = Ve(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
289
289
|
const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
|
|
@@ -294,7 +294,7 @@ function Bt(t, e) {
|
|
|
294
294
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
return
|
|
297
|
+
return W(() => {
|
|
298
298
|
const [n, o] = r.split(":");
|
|
299
299
|
return {
|
|
300
300
|
rootViewId: n || void 0,
|
|
@@ -302,16 +302,16 @@ function Bt(t, e) {
|
|
|
302
302
|
};
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const r =
|
|
305
|
+
function Z(t, e) {
|
|
306
|
+
const r = Ve(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
|
-
return
|
|
311
|
+
return W(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
function
|
|
313
|
+
const Gt = Ee("UIRenderer");
|
|
314
|
+
function Ht(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,18 +322,18 @@ function Vt(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Jt(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Xt(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Zt(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Qt(t) {
|
|
337
337
|
if (t.length === 0) return "";
|
|
338
338
|
if (t.length === 1) return t[0].id;
|
|
339
339
|
let e = t[0].id;
|
|
@@ -341,66 +341,66 @@ function Wt(t) {
|
|
|
341
341
|
e += "," + t[r].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
const n =
|
|
346
|
-
() => o.length === 0 ? null : o.map((
|
|
344
|
+
const Ue = q(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = Z(r.store, e), o = n ? Xt(n) : [], s = Qt(o), i = W(
|
|
346
|
+
() => o.length === 0 ? null : o.map((g) => /* @__PURE__ */ E.jsx(t, { nodeId: g.id, context: r }, g.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
349
349
|
);
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ E.jsx(xt, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
|
-
return
|
|
357
|
-
const c =
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
-
},
|
|
360
|
-
function
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */
|
|
362
|
-
}
|
|
363
|
-
function
|
|
356
|
+
return Gt.warn(`No renderer for node type ${n.type}`), null;
|
|
357
|
+
const c = Jt(n), d = c.length > 0 ? c.join(" ") : void 0, f = a;
|
|
358
|
+
return /* @__PURE__ */ E.jsx(f, { nodeId: e, context: r, className: d });
|
|
359
|
+
}, Zt);
|
|
360
|
+
function er(t, e) {
|
|
361
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ E.jsx(Ue, { nodeId: r.id, context: e }, r.id));
|
|
362
|
+
}
|
|
363
|
+
function tr(t, e) {
|
|
364
364
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
const { rootViewId: c, rootNodeId:
|
|
368
|
-
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
const u =
|
|
366
|
+
const rr = q(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: d } = qt(e, n), f = w(s);
|
|
368
|
+
f.current = s;
|
|
369
|
+
const g = w(i);
|
|
370
|
+
g.current = i;
|
|
371
|
+
const u = w(a);
|
|
372
372
|
u.current = a;
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
373
|
+
const h = D((S, p) => {
|
|
374
|
+
if (!S)
|
|
375
375
|
return;
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
}, []), y =
|
|
379
|
-
const
|
|
376
|
+
const m = Ht(p);
|
|
377
|
+
f.current?.(S, m);
|
|
378
|
+
}, []), y = W(() => {
|
|
379
|
+
const S = {
|
|
380
380
|
store: e,
|
|
381
381
|
library: r,
|
|
382
382
|
handlerCache: e.handlerCache,
|
|
383
383
|
// Access payloads from store at call time, not captured snapshot
|
|
384
|
-
getPayload: (
|
|
385
|
-
renderChildren: (
|
|
386
|
-
renderView: (
|
|
387
|
-
const
|
|
388
|
-
return
|
|
384
|
+
getPayload: (p) => e.getSnapshot().payloads.get(p),
|
|
385
|
+
renderChildren: (p) => er(p, S),
|
|
386
|
+
renderView: (p) => {
|
|
387
|
+
const m = e.getSnapshot().views.get(p);
|
|
388
|
+
return m ? /* @__PURE__ */ E.jsx(Ue, { nodeId: m.id, context: S }) : null;
|
|
389
389
|
},
|
|
390
|
-
dispatchAction:
|
|
390
|
+
dispatchAction: h,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
392
392
|
get client() {
|
|
393
|
-
return
|
|
393
|
+
return g.current;
|
|
394
394
|
},
|
|
395
395
|
get video() {
|
|
396
396
|
return u.current;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
|
-
return
|
|
400
|
-
}, [e, r,
|
|
401
|
-
return !c || !
|
|
402
|
-
},
|
|
403
|
-
class
|
|
399
|
+
return S;
|
|
400
|
+
}, [e, r, h]);
|
|
401
|
+
return !c || !d ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(Ue, { nodeId: d, context: y }) });
|
|
402
|
+
}, tr);
|
|
403
|
+
class nr {
|
|
404
404
|
constructor(e, r) {
|
|
405
405
|
if (this.fallback = r, e)
|
|
406
406
|
for (const [n, o] of e)
|
|
@@ -417,41 +417,41 @@ class Jt {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function po(t, e) {
|
|
421
421
|
const r = Object.entries(t);
|
|
422
|
-
return new
|
|
422
|
+
return new nr(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
return
|
|
424
|
+
function go(t) {
|
|
425
|
+
return Ve(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
432
|
-
function
|
|
431
|
+
const xe = "ikon-ui";
|
|
432
|
+
function or(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
const i =
|
|
435
|
+
const yo = q(function({ stores: e, registry: r, category: n = xe, onAction: o, client: s }) {
|
|
436
|
+
const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
|
|
437
437
|
a.current = o;
|
|
438
|
-
const c =
|
|
438
|
+
const c = w(s);
|
|
439
439
|
c.current = s;
|
|
440
|
-
const
|
|
440
|
+
const d = W(
|
|
441
441
|
() => {
|
|
442
|
-
const
|
|
443
|
-
for (const [
|
|
444
|
-
const
|
|
445
|
-
|
|
442
|
+
const f = [];
|
|
443
|
+
for (const [g, u] of e) {
|
|
444
|
+
const h = u.store.getSnapshot();
|
|
445
|
+
or(u.category, n) && (!h.rootViewId || !h.views.has(h.rootViewId) || f.push({ key: g, store: u.store }));
|
|
446
446
|
}
|
|
447
|
-
return
|
|
447
|
+
return f;
|
|
448
448
|
},
|
|
449
449
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
450
450
|
[e, n, i]
|
|
451
451
|
);
|
|
452
|
-
return
|
|
452
|
+
return d.length === 0 ? null : /* @__PURE__ */ E.jsx(E.Fragment, { children: d.map(({ key: f, store: g }) => /* @__PURE__ */ E.jsx(rr, { store: g, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, f)) });
|
|
453
453
|
});
|
|
454
|
-
class
|
|
454
|
+
class sr {
|
|
455
455
|
core;
|
|
456
456
|
ownsCore;
|
|
457
457
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -459,7 +459,7 @@ class Zt {
|
|
|
459
459
|
unsubscribeClears;
|
|
460
460
|
unsubscribeStoreChanges;
|
|
461
461
|
constructor(e) {
|
|
462
|
-
this.core = e?.core ?? new
|
|
462
|
+
this.core = e?.core ?? new Lt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
463
463
|
}
|
|
464
464
|
dispose() {
|
|
465
465
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -509,8 +509,8 @@ class Zt {
|
|
|
509
509
|
if (r)
|
|
510
510
|
return r;
|
|
511
511
|
const n = {
|
|
512
|
-
category:
|
|
513
|
-
store: new
|
|
512
|
+
category: xe,
|
|
513
|
+
store: new Mt()
|
|
514
514
|
};
|
|
515
515
|
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
@@ -518,7 +518,7 @@ class Zt {
|
|
|
518
518
|
const n = this.stores.get(e);
|
|
519
519
|
if (!n)
|
|
520
520
|
return !1;
|
|
521
|
-
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
521
|
+
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? xe;
|
|
522
522
|
return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
|
|
523
523
|
}
|
|
524
524
|
notify(e) {
|
|
@@ -526,13 +526,13 @@ class Zt {
|
|
|
526
526
|
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function ir(t) {
|
|
530
530
|
if (typeof t == "string") {
|
|
531
531
|
const e = t.trim();
|
|
532
532
|
return e.length > 0 ? e : void 0;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function he(t) {
|
|
536
536
|
if (typeof t == "string") {
|
|
537
537
|
const e = t.trim();
|
|
538
538
|
return e.length > 0 ? e : void 0;
|
|
@@ -542,7 +542,7 @@ function de(t) {
|
|
|
542
542
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function We(...t) {
|
|
546
546
|
let e = "";
|
|
547
547
|
for (const r of t)
|
|
548
548
|
if (r) {
|
|
@@ -551,42 +551,42 @@ function Fe(...t) {
|
|
|
551
551
|
}
|
|
552
552
|
return e || void 0;
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
554
|
+
const tt = /* @__PURE__ */ new WeakMap(), ar = {};
|
|
555
|
+
function Ye(t) {
|
|
556
556
|
if (!t)
|
|
557
|
-
return
|
|
558
|
-
const e =
|
|
557
|
+
return ar;
|
|
558
|
+
const e = tt.get(t);
|
|
559
559
|
if (e)
|
|
560
560
|
return e;
|
|
561
561
|
const r = {};
|
|
562
562
|
for (const [n, o] of Object.entries(t))
|
|
563
563
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
564
|
-
return
|
|
564
|
+
return tt.set(t, r), r;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
const t =
|
|
568
|
-
const o =
|
|
569
|
-
return
|
|
566
|
+
function cr() {
|
|
567
|
+
const t = q(function({ nodeId: r, context: n }) {
|
|
568
|
+
const o = Z(n.store, r), s = w(null), i = he(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, d = he(o?.props?.key), f = o?.props?.preciseGeneratedAt;
|
|
569
|
+
return M(() => {
|
|
570
570
|
if (typeof document > "u")
|
|
571
571
|
return;
|
|
572
572
|
const u = s.current;
|
|
573
573
|
if (!u || i && u.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
|
|
574
574
|
return;
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const
|
|
578
|
-
let
|
|
579
|
-
for (;
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
582
|
-
return
|
|
583
|
-
|
|
575
|
+
const h = c !== !0;
|
|
576
|
+
if (h) {
|
|
577
|
+
const m = ((v) => {
|
|
578
|
+
let A = v.parentElement;
|
|
579
|
+
for (; A; ) {
|
|
580
|
+
const U = window.getComputedStyle(A).overflowY;
|
|
581
|
+
if (U === "auto" || U === "scroll" || A.hasAttribute("data-radix-scroll-area-viewport"))
|
|
582
|
+
return A;
|
|
583
|
+
A = A.parentElement;
|
|
584
584
|
}
|
|
585
585
|
return null;
|
|
586
586
|
})(u);
|
|
587
|
-
|
|
588
|
-
const v =
|
|
589
|
-
"scrollBehavior" in document.documentElement.style ?
|
|
587
|
+
m ? requestAnimationFrame(() => {
|
|
588
|
+
const v = m.getBoundingClientRect(), A = u.getBoundingClientRect(), _ = m.scrollTop + (A.bottom - v.bottom) + 16;
|
|
589
|
+
"scrollBehavior" in document.documentElement.style ? m.scrollTo({ top: _, behavior: "smooth" }) : m.scrollTop = _;
|
|
590
590
|
}) : typeof u.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
591
591
|
try {
|
|
592
592
|
u.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
|
|
@@ -598,11 +598,11 @@ function tr() {
|
|
|
598
598
|
const y = document.activeElement;
|
|
599
599
|
if (!(y instanceof HTMLInputElement || y instanceof HTMLTextAreaElement || y?.getAttribute("contenteditable") === "true") && typeof u.focus == "function")
|
|
600
600
|
try {
|
|
601
|
-
u.focus({ preventScroll: !
|
|
601
|
+
u.focus({ preventScroll: !h });
|
|
602
602
|
} catch {
|
|
603
603
|
u.focus();
|
|
604
604
|
}
|
|
605
|
-
}, [c, i,
|
|
605
|
+
}, [c, i, d, f]), o ? /* @__PURE__ */ E.jsx(
|
|
606
606
|
"span",
|
|
607
607
|
{
|
|
608
608
|
ref: s,
|
|
@@ -619,25 +619,25 @@ function tr() {
|
|
|
619
619
|
return t;
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
const t =
|
|
624
|
-
const s =
|
|
622
|
+
function ur() {
|
|
623
|
+
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
624
|
+
const s = Z(n.store, r), i = ir(s?.props?.onInvokeId), a = D(() => {
|
|
625
625
|
i && n.dispatchAction(i);
|
|
626
626
|
}, [i, n]);
|
|
627
627
|
if (!s)
|
|
628
628
|
return null;
|
|
629
|
-
const c =
|
|
629
|
+
const c = Ye(s.props);
|
|
630
630
|
delete c.onInvokeId;
|
|
631
|
-
const
|
|
632
|
-
return /* @__PURE__ */
|
|
631
|
+
const d = We(he(s.props?.className), o), f = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
632
|
+
return /* @__PURE__ */ E.jsx(
|
|
633
633
|
"div",
|
|
634
634
|
{
|
|
635
635
|
...c,
|
|
636
636
|
"data-ikon-node-id": s.id,
|
|
637
|
-
className:
|
|
637
|
+
className: d,
|
|
638
638
|
onClick: i ? a : void 0,
|
|
639
639
|
style: i ? { cursor: "pointer" } : void 0,
|
|
640
|
-
children:
|
|
640
|
+
children: f
|
|
641
641
|
}
|
|
642
642
|
);
|
|
643
643
|
});
|
|
@@ -646,45 +646,45 @@ function rr() {
|
|
|
646
646
|
return t;
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
|
-
function
|
|
650
|
-
const t =
|
|
651
|
-
const s =
|
|
649
|
+
function lr() {
|
|
650
|
+
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
651
|
+
const s = Z(n.store, r);
|
|
652
652
|
if (!s)
|
|
653
653
|
return null;
|
|
654
|
-
const i =
|
|
655
|
-
return /* @__PURE__ */
|
|
654
|
+
const i = Ye(s.props), a = We("relative", he(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
655
|
+
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
656
656
|
});
|
|
657
657
|
return ({ type: e }) => {
|
|
658
658
|
if (e === "std.stack")
|
|
659
659
|
return t;
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
const t =
|
|
664
|
-
const s =
|
|
662
|
+
function dr() {
|
|
663
|
+
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
664
|
+
const s = Z(n.store, r);
|
|
665
665
|
if (!s)
|
|
666
666
|
return null;
|
|
667
|
-
const i =
|
|
668
|
-
return /* @__PURE__ */
|
|
667
|
+
const i = Ye(s.props), a = We("absolute", he(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
668
|
+
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
669
669
|
});
|
|
670
670
|
return ({ type: e }) => {
|
|
671
671
|
if (e === "std.layer")
|
|
672
672
|
return t;
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function fr() {
|
|
676
676
|
return [
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
677
|
+
ur(),
|
|
678
|
+
lr(),
|
|
679
|
+
dr(),
|
|
680
|
+
cr()
|
|
681
681
|
];
|
|
682
682
|
}
|
|
683
|
-
const
|
|
684
|
-
function
|
|
685
|
-
t.registerModule(
|
|
683
|
+
const hr = "base", mr = async () => fr();
|
|
684
|
+
function pr(t) {
|
|
685
|
+
t.registerModule(hr, mr);
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function gr(t) {
|
|
688
688
|
if (typeof t == "string") {
|
|
689
689
|
const e = t.trim();
|
|
690
690
|
return e.length > 0 ? e : void 0;
|
|
@@ -694,19 +694,19 @@ function ur(t) {
|
|
|
694
694
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function yr(...t) {
|
|
698
698
|
const e = [];
|
|
699
699
|
for (const r of t)
|
|
700
700
|
r && r.trim() && e.push(r.trim());
|
|
701
701
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function rt(t) {
|
|
704
704
|
if (typeof t != "string")
|
|
705
705
|
return;
|
|
706
706
|
const e = t.trim();
|
|
707
707
|
return e.length > 0 ? e : void 0;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function Se(t) {
|
|
710
710
|
if (typeof t == "boolean")
|
|
711
711
|
return t;
|
|
712
712
|
if (typeof t == "string") {
|
|
@@ -715,25 +715,25 @@ function me(t) {
|
|
|
715
715
|
if (e === "false") return !1;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
const
|
|
719
|
-
function
|
|
720
|
-
const t =
|
|
718
|
+
const Sr = "std.audio-url-player";
|
|
719
|
+
function br() {
|
|
720
|
+
const t = q(function({
|
|
721
721
|
nodeId: r,
|
|
722
722
|
context: n,
|
|
723
723
|
className: o
|
|
724
724
|
}) {
|
|
725
|
-
const s =
|
|
725
|
+
const s = Z(n.store, r);
|
|
726
726
|
if (!s)
|
|
727
727
|
return null;
|
|
728
|
-
const i =
|
|
729
|
-
return /* @__PURE__ */
|
|
728
|
+
const i = yr(gr(s.props?.className), o), a = rt(s.props?.src), c = rt(s.props?.preload), d = Se(s.props?.controls), f = Se(s.props?.autoplay), g = Se(s.props?.loop), u = Se(s.props?.muted);
|
|
729
|
+
return /* @__PURE__ */ E.jsx(
|
|
730
730
|
"audio",
|
|
731
731
|
{
|
|
732
732
|
src: a,
|
|
733
733
|
...c !== void 0 ? { preload: c } : {},
|
|
734
|
-
...
|
|
735
|
-
...
|
|
736
|
-
...
|
|
734
|
+
...d !== void 0 ? { controls: d } : {},
|
|
735
|
+
...f !== void 0 ? { autoPlay: f } : {},
|
|
736
|
+
...g !== void 0 ? { loop: g } : {},
|
|
737
737
|
...u !== void 0 ? { muted: u } : {},
|
|
738
738
|
"data-ikon-node-id": s.id,
|
|
739
739
|
className: i
|
|
@@ -741,11 +741,11 @@ function fr() {
|
|
|
741
741
|
);
|
|
742
742
|
});
|
|
743
743
|
return ({ type: e }) => {
|
|
744
|
-
if (e ===
|
|
744
|
+
if (e === Sr)
|
|
745
745
|
return t;
|
|
746
746
|
};
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function yt(t) {
|
|
749
749
|
if (typeof t == "string") {
|
|
750
750
|
const e = t.trim();
|
|
751
751
|
return e.length > 0 ? e : void 0;
|
|
@@ -755,13 +755,13 @@ function ft(t) {
|
|
|
755
755
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function St(...t) {
|
|
759
759
|
const e = [];
|
|
760
760
|
for (const r of t)
|
|
761
761
|
r && r.trim() && e.push(r.trim());
|
|
762
762
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function we(t) {
|
|
765
765
|
if (typeof t == "number" && Number.isFinite(t))
|
|
766
766
|
return Math.floor(t);
|
|
767
767
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -770,44 +770,64 @@ function ge(t) {
|
|
|
770
770
|
return Math.floor(e);
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function De(t) {
|
|
774
774
|
if (typeof t != "string")
|
|
775
775
|
return;
|
|
776
776
|
const e = t.trim();
|
|
777
777
|
return e.length > 0 ? e : void 0;
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
function
|
|
781
|
-
const t =
|
|
782
|
-
const s =
|
|
783
|
-
return
|
|
784
|
-
const
|
|
785
|
-
if (!(!
|
|
786
|
-
return
|
|
787
|
-
|
|
779
|
+
const wr = "std.video-canvas", vr = "std.video-url-player";
|
|
780
|
+
function Rr() {
|
|
781
|
+
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
782
|
+
const s = Z(n.store, r), i = w(null), a = w(null), c = n.video, d = n.client, f = d?.isWebRtcEnabled ? d.webRtcVideoStream : null, g = d?.isWebRtcEnabled ? d.webRtcScreenStream : null, u = s ? De(s.props?.streamId) : void 0, h = s ? we(s.props?.width) : void 0, y = s ? we(s.props?.height) : void 0, S = s ? St(yt(s.props?.className), o) : o, p = u?.includes("screen") ? g : f;
|
|
783
|
+
return M(() => {
|
|
784
|
+
const m = i.current;
|
|
785
|
+
if (!(!c || !m || !u || p))
|
|
786
|
+
return c.attachCanvas(u, m), () => {
|
|
787
|
+
c.detachCanvas(u);
|
|
788
788
|
};
|
|
789
|
-
}, [
|
|
789
|
+
}, [c, u, p]), M(() => {
|
|
790
|
+
const m = a.current;
|
|
791
|
+
if (!(!m || !p))
|
|
792
|
+
return m.srcObject = p, () => {
|
|
793
|
+
m.srcObject = null;
|
|
794
|
+
};
|
|
795
|
+
}, [p]), s ? p ? /* @__PURE__ */ E.jsx(
|
|
796
|
+
"video",
|
|
797
|
+
{
|
|
798
|
+
ref: a,
|
|
799
|
+
autoPlay: !0,
|
|
800
|
+
playsInline: !0,
|
|
801
|
+
muted: !0,
|
|
802
|
+
"data-ikon-node-id": s.id,
|
|
803
|
+
"data-ikon-video-stream-id": u,
|
|
804
|
+
className: S,
|
|
805
|
+
...h ? { width: h } : {},
|
|
806
|
+
...y ? { height: y } : {}
|
|
807
|
+
},
|
|
808
|
+
u
|
|
809
|
+
) : /* @__PURE__ */ E.jsx(
|
|
790
810
|
"canvas",
|
|
791
811
|
{
|
|
792
812
|
ref: i,
|
|
793
813
|
"data-ikon-node-id": s.id,
|
|
794
|
-
"data-ikon-video-stream-id":
|
|
795
|
-
className:
|
|
796
|
-
...
|
|
797
|
-
...
|
|
814
|
+
"data-ikon-video-stream-id": u,
|
|
815
|
+
className: S,
|
|
816
|
+
...h ? { width: h } : {},
|
|
817
|
+
...y ? { height: y } : {}
|
|
798
818
|
},
|
|
799
|
-
|
|
819
|
+
u
|
|
800
820
|
) : null;
|
|
801
821
|
});
|
|
802
822
|
return ({ type: e }) => {
|
|
803
|
-
if (e ===
|
|
823
|
+
if (e === wr)
|
|
804
824
|
return t;
|
|
805
825
|
};
|
|
806
826
|
}
|
|
807
|
-
function
|
|
808
|
-
return [
|
|
827
|
+
function Er() {
|
|
828
|
+
return [Rr(), Ar(), br()];
|
|
809
829
|
}
|
|
810
|
-
function
|
|
830
|
+
function ue(t) {
|
|
811
831
|
if (typeof t == "boolean")
|
|
812
832
|
return t;
|
|
813
833
|
if (typeof t == "string") {
|
|
@@ -816,56 +836,56 @@ function ae(t) {
|
|
|
816
836
|
if (e === "false") return !1;
|
|
817
837
|
}
|
|
818
838
|
}
|
|
819
|
-
function
|
|
820
|
-
const t =
|
|
839
|
+
function Ar() {
|
|
840
|
+
const t = q(function({
|
|
821
841
|
nodeId: r,
|
|
822
842
|
context: n,
|
|
823
843
|
className: o
|
|
824
844
|
}) {
|
|
825
|
-
const s =
|
|
845
|
+
const s = Z(n.store, r);
|
|
826
846
|
if (!s)
|
|
827
847
|
return null;
|
|
828
|
-
const i =
|
|
829
|
-
return /* @__PURE__ */
|
|
848
|
+
const i = St(yt(s.props?.className), o), a = De(s.props?.src), c = De(s.props?.poster), d = ue(s.props?.controls), f = ue(s.props?.autoplay), g = ue(s.props?.loop), u = ue(s.props?.muted), h = ue(s.props?.playsInline), y = we(s.props?.width), S = we(s.props?.height), p = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
849
|
+
return /* @__PURE__ */ E.jsx(
|
|
830
850
|
"video",
|
|
831
851
|
{
|
|
832
852
|
src: a,
|
|
833
853
|
poster: c,
|
|
834
|
-
...
|
|
835
|
-
...
|
|
836
|
-
...
|
|
854
|
+
...d !== void 0 ? { controls: d } : {},
|
|
855
|
+
...f !== void 0 ? { autoPlay: f } : {},
|
|
856
|
+
...g !== void 0 ? { loop: g } : {},
|
|
837
857
|
...u !== void 0 ? { muted: u } : {},
|
|
838
|
-
...
|
|
858
|
+
...h !== void 0 ? { playsInline: h } : {},
|
|
839
859
|
...y ? { width: y } : {},
|
|
840
|
-
...
|
|
860
|
+
...S ? { height: S } : {},
|
|
841
861
|
"data-ikon-node-id": s.id,
|
|
842
862
|
className: i,
|
|
843
|
-
children:
|
|
863
|
+
children: p
|
|
844
864
|
}
|
|
845
865
|
);
|
|
846
866
|
});
|
|
847
867
|
return ({ type: e }) => {
|
|
848
|
-
if (e ===
|
|
868
|
+
if (e === vr)
|
|
849
869
|
return t;
|
|
850
870
|
};
|
|
851
871
|
}
|
|
852
|
-
const
|
|
853
|
-
function
|
|
854
|
-
t.registerModule(
|
|
872
|
+
const Tr = "media", kr = async () => Er();
|
|
873
|
+
function Cr(t) {
|
|
874
|
+
t.registerModule(Tr, kr);
|
|
855
875
|
}
|
|
856
|
-
const
|
|
876
|
+
const Ir = `#version 300 es
|
|
857
877
|
in vec4 a_position;
|
|
858
878
|
void main() {
|
|
859
879
|
gl_Position = a_position;
|
|
860
880
|
}
|
|
861
881
|
`;
|
|
862
|
-
function
|
|
882
|
+
function Or(t, e) {
|
|
863
883
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
864
884
|
}
|
|
865
|
-
function
|
|
885
|
+
function _r(t, e) {
|
|
866
886
|
const r = [];
|
|
867
887
|
for (const [n, o] of Object.entries(e)) {
|
|
868
|
-
if (
|
|
888
|
+
if (Or(t, n))
|
|
869
889
|
continue;
|
|
870
890
|
let s;
|
|
871
891
|
switch (o.type) {
|
|
@@ -918,7 +938,7 @@ void main() {
|
|
|
918
938
|
}
|
|
919
939
|
`;
|
|
920
940
|
}
|
|
921
|
-
class
|
|
941
|
+
class Nr {
|
|
922
942
|
gl;
|
|
923
943
|
program = null;
|
|
924
944
|
positionBuffer = null;
|
|
@@ -954,10 +974,10 @@ class Ar {
|
|
|
954
974
|
}
|
|
955
975
|
compile(e, r = {}) {
|
|
956
976
|
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
957
|
-
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER,
|
|
977
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, Ir);
|
|
958
978
|
if (!o)
|
|
959
979
|
return !1;
|
|
960
|
-
const s =
|
|
980
|
+
const s = _r(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
961
981
|
if (!i)
|
|
962
982
|
return n.deleteShader(o), !1;
|
|
963
983
|
const a = n.createProgram();
|
|
@@ -995,46 +1015,46 @@ class Ar {
|
|
|
995
1015
|
this.lastFrameTime = s, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
|
|
996
1016
|
const c = this.uniformLocations.get("iResolution");
|
|
997
1017
|
c && e.uniform3f(c, n, o, 1);
|
|
998
|
-
const
|
|
999
|
-
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1018
|
+
const d = this.uniformLocations.get("iTime");
|
|
1019
|
+
d && e.uniform1f(d, i);
|
|
1020
|
+
const f = this.uniformLocations.get("iTimeDelta");
|
|
1021
|
+
f && e.uniform1f(f, a);
|
|
1022
|
+
const g = this.uniformLocations.get("iFrame");
|
|
1023
|
+
g && e.uniform1i(g, this.frameCount);
|
|
1004
1024
|
const u = this.uniformLocations.get("iMouse");
|
|
1005
1025
|
u && e.uniform4f(u, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1006
|
-
const
|
|
1007
|
-
if (
|
|
1026
|
+
const h = this.uniformLocations.get("iDate");
|
|
1027
|
+
if (h) {
|
|
1008
1028
|
const y = /* @__PURE__ */ new Date();
|
|
1009
|
-
e.uniform4f(
|
|
1029
|
+
e.uniform4f(h, y.getFullYear(), y.getMonth(), y.getDate(), y.getHours() * 3600 + y.getMinutes() * 60 + y.getSeconds() + y.getMilliseconds() / 1e3);
|
|
1010
1030
|
}
|
|
1011
|
-
for (const [y,
|
|
1012
|
-
const
|
|
1013
|
-
if (
|
|
1014
|
-
switch (
|
|
1031
|
+
for (const [y, S] of Object.entries(this.customUniforms)) {
|
|
1032
|
+
const p = this.uniformLocations.get(y);
|
|
1033
|
+
if (p)
|
|
1034
|
+
switch (S.type) {
|
|
1015
1035
|
case "float":
|
|
1016
|
-
e.uniform1f(
|
|
1036
|
+
e.uniform1f(p, S.value);
|
|
1017
1037
|
break;
|
|
1018
1038
|
case "vec2": {
|
|
1019
|
-
const
|
|
1020
|
-
e.uniform2f(
|
|
1039
|
+
const m = S.value;
|
|
1040
|
+
e.uniform2f(p, m[0], m[1]);
|
|
1021
1041
|
break;
|
|
1022
1042
|
}
|
|
1023
1043
|
case "vec3": {
|
|
1024
|
-
const
|
|
1025
|
-
e.uniform3f(
|
|
1044
|
+
const m = S.value;
|
|
1045
|
+
e.uniform3f(p, m[0], m[1], m[2]);
|
|
1026
1046
|
break;
|
|
1027
1047
|
}
|
|
1028
1048
|
case "vec4": {
|
|
1029
|
-
const
|
|
1030
|
-
e.uniform4f(
|
|
1049
|
+
const m = S.value;
|
|
1050
|
+
e.uniform4f(p, m[0], m[1], m[2], m[3]);
|
|
1031
1051
|
break;
|
|
1032
1052
|
}
|
|
1033
1053
|
case "int":
|
|
1034
|
-
e.uniform1i(
|
|
1054
|
+
e.uniform1i(p, S.value);
|
|
1035
1055
|
break;
|
|
1036
1056
|
case "bool":
|
|
1037
|
-
e.uniform1i(
|
|
1057
|
+
e.uniform1i(p, S.value ? 1 : 0);
|
|
1038
1058
|
break;
|
|
1039
1059
|
}
|
|
1040
1060
|
}
|
|
@@ -1048,7 +1068,7 @@ class Ar {
|
|
|
1048
1068
|
this.program && (e.deleteProgram(this.program), this.program = null), this.positionBuffer && (e.deleteBuffer(this.positionBuffer), this.positionBuffer = null), this.vao && (e.deleteVertexArray(this.vao), this.vao = null), this.uniformLocations.clear();
|
|
1049
1069
|
}
|
|
1050
1070
|
}
|
|
1051
|
-
function
|
|
1071
|
+
function Pr(t) {
|
|
1052
1072
|
if (typeof t == "string") {
|
|
1053
1073
|
const e = t.trim();
|
|
1054
1074
|
return e.length > 0 ? e : void 0;
|
|
@@ -1058,13 +1078,13 @@ function Tr(t) {
|
|
|
1058
1078
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1059
1079
|
}
|
|
1060
1080
|
}
|
|
1061
|
-
function
|
|
1081
|
+
function jr(...t) {
|
|
1062
1082
|
const e = [];
|
|
1063
1083
|
for (const r of t)
|
|
1064
1084
|
r && r.trim() && e.push(r.trim());
|
|
1065
1085
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1066
1086
|
}
|
|
1067
|
-
function
|
|
1087
|
+
function Ce(t) {
|
|
1068
1088
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1069
1089
|
return Math.floor(t);
|
|
1070
1090
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1073,10 +1093,10 @@ function Re(t) {
|
|
|
1073
1093
|
return Math.floor(e);
|
|
1074
1094
|
}
|
|
1075
1095
|
}
|
|
1076
|
-
function
|
|
1096
|
+
function Lr(t) {
|
|
1077
1097
|
return typeof t == "string" ? t : "";
|
|
1078
1098
|
}
|
|
1079
|
-
function
|
|
1099
|
+
function Mr(t) {
|
|
1080
1100
|
if (typeof t == "boolean")
|
|
1081
1101
|
return t;
|
|
1082
1102
|
if (typeof t == "string") {
|
|
@@ -1085,7 +1105,7 @@ function Ir(t) {
|
|
|
1085
1105
|
if (e === "false") return !1;
|
|
1086
1106
|
}
|
|
1087
1107
|
}
|
|
1088
|
-
function
|
|
1108
|
+
function Ur(t) {
|
|
1089
1109
|
if (!t || typeof t != "object")
|
|
1090
1110
|
return {};
|
|
1091
1111
|
const e = {}, r = t;
|
|
@@ -1100,7 +1120,7 @@ function _r(t) {
|
|
|
1100
1120
|
}
|
|
1101
1121
|
return e;
|
|
1102
1122
|
}
|
|
1103
|
-
function
|
|
1123
|
+
function xr(t, e) {
|
|
1104
1124
|
const r = Object.keys(t), n = Object.keys(e);
|
|
1105
1125
|
if (r.length !== n.length)
|
|
1106
1126
|
return !1;
|
|
@@ -1121,21 +1141,21 @@ function Or(t, e) {
|
|
|
1121
1141
|
}
|
|
1122
1142
|
return !0;
|
|
1123
1143
|
}
|
|
1124
|
-
const
|
|
1125
|
-
function
|
|
1126
|
-
const t =
|
|
1127
|
-
const s =
|
|
1144
|
+
const Dr = "std.shader-canvas";
|
|
1145
|
+
function Fr() {
|
|
1146
|
+
const t = q(function({ nodeId: r, context: n, className: o }) {
|
|
1147
|
+
const s = Z(n.store, r), i = w(null), a = w(null), c = w(null), d = w(0), f = w(""), g = w({}), u = w({
|
|
1128
1148
|
x: 0,
|
|
1129
1149
|
y: 0,
|
|
1130
1150
|
clickX: 0,
|
|
1131
1151
|
clickY: 0,
|
|
1132
1152
|
isDown: !1
|
|
1133
|
-
}),
|
|
1134
|
-
|
|
1135
|
-
const
|
|
1136
|
-
if (
|
|
1153
|
+
}), h = s ? Lr(s.props?.shaderSource) : "", y = s ? Ce(s.props?.fps) ?? 60 : 60, S = s?.props?.uniforms, p = W(() => Ur(S), [S]), m = s ? Mr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ce(s.props?.width) : void 0, A = s ? Ce(s.props?.height) : void 0, _ = s ? jr(Pr(s.props?.className), o) : o;
|
|
1154
|
+
M(() => {
|
|
1155
|
+
const k = i.current;
|
|
1156
|
+
if (k) {
|
|
1137
1157
|
try {
|
|
1138
|
-
const N = new
|
|
1158
|
+
const N = new Nr(k);
|
|
1139
1159
|
a.current = N;
|
|
1140
1160
|
} catch (N) {
|
|
1141
1161
|
console.error("[ShaderRenderer] Failed to create WebGL2 context:", N);
|
|
@@ -1144,76 +1164,76 @@ function Pr() {
|
|
|
1144
1164
|
a.current && (a.current.destroy(), a.current = null);
|
|
1145
1165
|
};
|
|
1146
1166
|
}
|
|
1147
|
-
}, []),
|
|
1148
|
-
const
|
|
1149
|
-
if (!(!
|
|
1150
|
-
if (
|
|
1151
|
-
|
|
1167
|
+
}, []), M(() => {
|
|
1168
|
+
const k = a.current;
|
|
1169
|
+
if (!(!k || !h) && f.current !== h)
|
|
1170
|
+
if (k.compile(h, p))
|
|
1171
|
+
f.current = h, g.current = p;
|
|
1152
1172
|
else {
|
|
1153
|
-
const
|
|
1154
|
-
console.error("[ShaderRenderer] Shader compilation failed:",
|
|
1173
|
+
const L = k.getError();
|
|
1174
|
+
console.error("[ShaderRenderer] Shader compilation failed:", L);
|
|
1155
1175
|
}
|
|
1156
|
-
}, [
|
|
1157
|
-
const
|
|
1158
|
-
!
|
|
1159
|
-
}, [
|
|
1160
|
-
const
|
|
1161
|
-
if (!
|
|
1162
|
-
const N = 1e3 / y,
|
|
1163
|
-
const
|
|
1164
|
-
|
|
1176
|
+
}, [h, p]), M(() => {
|
|
1177
|
+
const k = a.current;
|
|
1178
|
+
!k || !f.current || xr(g.current, p) || (k.setCustomUniforms(p), g.current = p);
|
|
1179
|
+
}, [p]), M(() => {
|
|
1180
|
+
const k = a.current;
|
|
1181
|
+
if (!k || !f.current) return;
|
|
1182
|
+
const N = 1e3 / y, L = (P) => {
|
|
1183
|
+
const F = P - d.current;
|
|
1184
|
+
F >= N && (d.current = P - F % N, k.draw()), c.current = requestAnimationFrame(L);
|
|
1165
1185
|
};
|
|
1166
|
-
return c.current = requestAnimationFrame(
|
|
1186
|
+
return c.current = requestAnimationFrame(L), () => {
|
|
1167
1187
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1168
1188
|
};
|
|
1169
1189
|
}, [y]);
|
|
1170
|
-
const
|
|
1171
|
-
(
|
|
1172
|
-
if (!
|
|
1173
|
-
const N = i.current,
|
|
1174
|
-
if (!N || !
|
|
1175
|
-
const
|
|
1176
|
-
u.current.x =
|
|
1190
|
+
const U = D(
|
|
1191
|
+
(k) => {
|
|
1192
|
+
if (!m) return;
|
|
1193
|
+
const N = i.current, L = a.current;
|
|
1194
|
+
if (!N || !L) return;
|
|
1195
|
+
const P = N.getBoundingClientRect(), F = k.clientX - P.left, G = P.height - (k.clientY - P.top);
|
|
1196
|
+
u.current.x = F, u.current.y = G, L.setMouse(F, G, u.current.clickX, u.current.clickY);
|
|
1177
1197
|
},
|
|
1178
|
-
[
|
|
1179
|
-
),
|
|
1180
|
-
(
|
|
1181
|
-
if (!
|
|
1182
|
-
const N = i.current,
|
|
1183
|
-
if (!N || !
|
|
1184
|
-
const
|
|
1185
|
-
u.current.isDown = !0, u.current.clickX =
|
|
1198
|
+
[m]
|
|
1199
|
+
), X = D(
|
|
1200
|
+
(k) => {
|
|
1201
|
+
if (!m) return;
|
|
1202
|
+
const N = i.current, L = a.current;
|
|
1203
|
+
if (!N || !L) return;
|
|
1204
|
+
const P = N.getBoundingClientRect(), F = k.clientX - P.left, G = P.height - (k.clientY - P.top);
|
|
1205
|
+
u.current.isDown = !0, u.current.clickX = F, u.current.clickY = G, L.setMouse(F, G, F, G);
|
|
1186
1206
|
},
|
|
1187
|
-
[
|
|
1188
|
-
),
|
|
1189
|
-
|
|
1190
|
-
}, [
|
|
1191
|
-
return s ? /* @__PURE__ */
|
|
1207
|
+
[m]
|
|
1208
|
+
), Q = D(() => {
|
|
1209
|
+
m && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
|
|
1210
|
+
}, [m]);
|
|
1211
|
+
return s ? /* @__PURE__ */ E.jsx(
|
|
1192
1212
|
"canvas",
|
|
1193
1213
|
{
|
|
1194
1214
|
ref: i,
|
|
1195
1215
|
"data-ikon-node-id": s.id,
|
|
1196
|
-
className:
|
|
1216
|
+
className: _,
|
|
1197
1217
|
...v ? { width: v } : {},
|
|
1198
|
-
...
|
|
1199
|
-
onMouseMove:
|
|
1200
|
-
onMouseDown:
|
|
1201
|
-
onMouseUp:
|
|
1202
|
-
onMouseLeave:
|
|
1218
|
+
...A ? { height: A } : {},
|
|
1219
|
+
onMouseMove: U,
|
|
1220
|
+
onMouseDown: X,
|
|
1221
|
+
onMouseUp: Q,
|
|
1222
|
+
onMouseLeave: Q
|
|
1203
1223
|
}
|
|
1204
1224
|
) : null;
|
|
1205
1225
|
});
|
|
1206
1226
|
return ({ type: e }) => {
|
|
1207
|
-
if (e ===
|
|
1227
|
+
if (e === Dr)
|
|
1208
1228
|
return t;
|
|
1209
1229
|
};
|
|
1210
1230
|
}
|
|
1211
|
-
const
|
|
1212
|
-
function
|
|
1213
|
-
t.registerModule(
|
|
1231
|
+
const Br = "shader", $r = async () => Fr();
|
|
1232
|
+
function Vr(t) {
|
|
1233
|
+
t.registerModule(Br, $r);
|
|
1214
1234
|
}
|
|
1215
|
-
const
|
|
1216
|
-
class
|
|
1235
|
+
const nt = Ee("UIRegistry");
|
|
1236
|
+
class Kr {
|
|
1217
1237
|
baseResolvers = [];
|
|
1218
1238
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1219
1239
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1235,15 +1255,15 @@ class Ur {
|
|
|
1235
1255
|
for (const [n, o] of this.moduleLoaders.entries())
|
|
1236
1256
|
if (!this.moduleResolvers.has(n))
|
|
1237
1257
|
try {
|
|
1238
|
-
const s = await o(), i =
|
|
1258
|
+
const s = await o(), i = zr(s);
|
|
1239
1259
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1240
1260
|
} catch (s) {
|
|
1241
|
-
|
|
1261
|
+
nt.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
1242
1262
|
}
|
|
1243
1263
|
const r = [];
|
|
1244
1264
|
for (const n of this.moduleLoaders.keys())
|
|
1245
1265
|
this.moduleResolvers.has(n) && r.push(n);
|
|
1246
|
-
return
|
|
1266
|
+
return qr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1247
1267
|
}
|
|
1248
1268
|
resolve(e) {
|
|
1249
1269
|
for (const r of this.baseResolvers) {
|
|
@@ -1253,7 +1273,7 @@ class Ur {
|
|
|
1253
1273
|
for (const r of this.activeModuleOrder) {
|
|
1254
1274
|
const n = this.moduleResolvers.get(r);
|
|
1255
1275
|
if (!n) {
|
|
1256
|
-
|
|
1276
|
+
nt.warn(`Missing resolvers for module ${r}`);
|
|
1257
1277
|
continue;
|
|
1258
1278
|
}
|
|
1259
1279
|
for (const o of n) {
|
|
@@ -1263,17 +1283,17 @@ class Ur {
|
|
|
1263
1283
|
}
|
|
1264
1284
|
}
|
|
1265
1285
|
}
|
|
1266
|
-
function
|
|
1267
|
-
const t = new
|
|
1268
|
-
return
|
|
1286
|
+
function Wr() {
|
|
1287
|
+
const t = new Kr();
|
|
1288
|
+
return pr(t), Cr(t), Vr(t), t.loadRegisteredModules(), t;
|
|
1269
1289
|
}
|
|
1270
|
-
function
|
|
1290
|
+
function Yr(t) {
|
|
1271
1291
|
return Array.isArray(t) ? t : [t];
|
|
1272
1292
|
}
|
|
1273
|
-
function
|
|
1274
|
-
return t ?
|
|
1293
|
+
function zr(t) {
|
|
1294
|
+
return t ? Yr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1275
1295
|
}
|
|
1276
|
-
function
|
|
1296
|
+
function qr(t, e) {
|
|
1277
1297
|
if (t.length !== e.length)
|
|
1278
1298
|
return !1;
|
|
1279
1299
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1281,7 +1301,7 @@ function Br(t, e) {
|
|
|
1281
1301
|
return !1;
|
|
1282
1302
|
return !0;
|
|
1283
1303
|
}
|
|
1284
|
-
const
|
|
1304
|
+
const Ie = Ee("MotionController"), ot = {
|
|
1285
1305
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1286
1306
|
"ease-in": [0.42, 0, 1, 1],
|
|
1287
1307
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1311,88 +1331,88 @@ const Ee = be("MotionController"), Qe = {
|
|
|
1311
1331
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
1312
1332
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
1313
1333
|
};
|
|
1314
|
-
function
|
|
1334
|
+
function B(t) {
|
|
1315
1335
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1316
1336
|
}
|
|
1317
|
-
function
|
|
1337
|
+
function st(t) {
|
|
1318
1338
|
if (t == null) return;
|
|
1319
1339
|
const e = `${t}`.trim();
|
|
1320
1340
|
if (!e) return;
|
|
1321
1341
|
const r = Number.parseFloat(e);
|
|
1322
1342
|
return Number.isFinite(r) ? r : void 0;
|
|
1323
1343
|
}
|
|
1324
|
-
function
|
|
1344
|
+
function it(t) {
|
|
1325
1345
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1326
1346
|
}
|
|
1327
|
-
function
|
|
1328
|
-
const
|
|
1329
|
-
function
|
|
1330
|
-
return ((3 *
|
|
1347
|
+
function at(t, e, r, n) {
|
|
1348
|
+
const f = new Float32Array(11);
|
|
1349
|
+
function g(p, m, v) {
|
|
1350
|
+
return ((3 * m - 3 * v + 1) * p + (3 * v - 6 * m)) * p * p + 3 * m * p;
|
|
1331
1351
|
}
|
|
1332
|
-
function u(
|
|
1333
|
-
return 3 * (3 *
|
|
1352
|
+
function u(p, m, v) {
|
|
1353
|
+
return 3 * (3 * m - 3 * v + 1) * p * p + 2 * (3 * v - 6 * m) * p + 3 * m;
|
|
1334
1354
|
}
|
|
1335
|
-
function
|
|
1355
|
+
function h(p, m) {
|
|
1336
1356
|
for (let v = 0; v < 4; v += 1) {
|
|
1337
|
-
const
|
|
1338
|
-
if (
|
|
1339
|
-
return
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1357
|
+
const A = u(m, t, r);
|
|
1358
|
+
if (A === 0)
|
|
1359
|
+
return m;
|
|
1360
|
+
const _ = g(m, t, r) - p;
|
|
1361
|
+
m -= _ / A;
|
|
1342
1362
|
}
|
|
1343
|
-
return
|
|
1363
|
+
return m;
|
|
1344
1364
|
}
|
|
1345
|
-
function y(
|
|
1346
|
-
let
|
|
1365
|
+
function y(p, m, v) {
|
|
1366
|
+
let A = 0, _ = 0, U = 0;
|
|
1347
1367
|
do
|
|
1348
|
-
|
|
1349
|
-
while (Math.abs(
|
|
1350
|
-
return
|
|
1351
|
-
}
|
|
1352
|
-
function
|
|
1353
|
-
let
|
|
1354
|
-
const
|
|
1355
|
-
for (; v !==
|
|
1356
|
-
|
|
1368
|
+
_ = m + (v - m) / 2, A = g(_, t, r) - p, A > 0 ? v = _ : m = _;
|
|
1369
|
+
while (Math.abs(A) > 1e-7 && ++U < 10);
|
|
1370
|
+
return _;
|
|
1371
|
+
}
|
|
1372
|
+
function S(p) {
|
|
1373
|
+
let m = 0, v = 1;
|
|
1374
|
+
const A = 10;
|
|
1375
|
+
for (; v !== A && f[v] <= p; v += 1)
|
|
1376
|
+
m += 0.1;
|
|
1357
1377
|
v -= 1;
|
|
1358
|
-
const
|
|
1359
|
-
return
|
|
1378
|
+
const _ = (p - f[v]) / (f[v + 1] - f[v]), U = m + _ * 0.1, X = u(U, t, r);
|
|
1379
|
+
return X >= 1e-3 ? h(p, U) : X === 0 ? U : y(p, m, m + 0.1);
|
|
1360
1380
|
}
|
|
1361
|
-
for (let
|
|
1362
|
-
|
|
1363
|
-
return (
|
|
1381
|
+
for (let p = 0; p < 11; p += 1)
|
|
1382
|
+
f[p] = g(p * 0.1, t, r);
|
|
1383
|
+
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : g(S(p), e, n);
|
|
1364
1384
|
}
|
|
1365
|
-
function
|
|
1385
|
+
function Gr(t) {
|
|
1366
1386
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1367
1387
|
if (!e)
|
|
1368
|
-
return (o) =>
|
|
1388
|
+
return (o) => B(o);
|
|
1369
1389
|
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1370
|
-
return n === "start" || n === "jump-start" ? (o) =>
|
|
1390
|
+
return n === "start" || n === "jump-start" ? (o) => B(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => B(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => B((Math.floor(o * r) + 0.5) / r) : (o) => B(Math.floor(o * r) / r);
|
|
1371
1391
|
}
|
|
1372
|
-
function
|
|
1392
|
+
function Hr(t) {
|
|
1373
1393
|
if (!t)
|
|
1374
|
-
return (r) =>
|
|
1394
|
+
return (r) => B(r);
|
|
1375
1395
|
const e = t.trim().toLowerCase();
|
|
1376
1396
|
if (!e || e === "linear")
|
|
1377
|
-
return (r) =>
|
|
1378
|
-
if (
|
|
1379
|
-
const [r, n, o, s] =
|
|
1380
|
-
return (a) =>
|
|
1397
|
+
return (r) => B(r);
|
|
1398
|
+
if (ot[e]) {
|
|
1399
|
+
const [r, n, o, s] = ot[e], i = at(r, n, o, s);
|
|
1400
|
+
return (a) => B(i(B(a)));
|
|
1381
1401
|
}
|
|
1382
1402
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1383
1403
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1384
1404
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1385
|
-
const [o, s, i, a] = n, c =
|
|
1386
|
-
return (
|
|
1405
|
+
const [o, s, i, a] = n, c = at(o, s, i, a);
|
|
1406
|
+
return (d) => B(c(B(d)));
|
|
1387
1407
|
}
|
|
1388
1408
|
}
|
|
1389
1409
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1390
|
-
const r =
|
|
1391
|
-
return (n) => r(
|
|
1410
|
+
const r = Gr(e);
|
|
1411
|
+
return (n) => r(B(n));
|
|
1392
1412
|
}
|
|
1393
|
-
return (r) =>
|
|
1413
|
+
return (r) => B(r);
|
|
1394
1414
|
}
|
|
1395
|
-
function
|
|
1415
|
+
function Jr(t) {
|
|
1396
1416
|
if (!t)
|
|
1397
1417
|
return;
|
|
1398
1418
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1402,7 +1422,7 @@ function Kr(t) {
|
|
|
1402
1422
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1403
1423
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1404
1424
|
}
|
|
1405
|
-
class
|
|
1425
|
+
class Xr {
|
|
1406
1426
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1407
1427
|
observer;
|
|
1408
1428
|
observeScheduled = !1;
|
|
@@ -1429,7 +1449,7 @@ class Yr {
|
|
|
1429
1449
|
try {
|
|
1430
1450
|
e();
|
|
1431
1451
|
} catch (r) {
|
|
1432
|
-
|
|
1452
|
+
Ie.warn("Failed to cleanup binding listener", r);
|
|
1433
1453
|
}
|
|
1434
1454
|
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);
|
|
1435
1455
|
}
|
|
@@ -1439,7 +1459,7 @@ class Yr {
|
|
|
1439
1459
|
const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1440
1460
|
return n.length === 0 ? void 0 : { bindings: n };
|
|
1441
1461
|
} catch (r) {
|
|
1442
|
-
|
|
1462
|
+
Ie.warn("Failed to parse motion metadata", r);
|
|
1443
1463
|
return;
|
|
1444
1464
|
}
|
|
1445
1465
|
}
|
|
@@ -1447,7 +1467,7 @@ class Yr {
|
|
|
1447
1467
|
const r = e.source?.trim();
|
|
1448
1468
|
if (!r)
|
|
1449
1469
|
return;
|
|
1450
|
-
const n =
|
|
1470
|
+
const n = st(e.min) ?? 0, o = st(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Hr(e.ease), d = Jr(e.map), f = e.targetId?.trim() || void 0;
|
|
1451
1471
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1452
1472
|
source: r.toLowerCase(),
|
|
1453
1473
|
min: n,
|
|
@@ -1455,8 +1475,8 @@ class Yr {
|
|
|
1455
1475
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1456
1476
|
reverse: a,
|
|
1457
1477
|
ease: c,
|
|
1458
|
-
map:
|
|
1459
|
-
targetId:
|
|
1478
|
+
map: d,
|
|
1479
|
+
targetId: f
|
|
1460
1480
|
};
|
|
1461
1481
|
}
|
|
1462
1482
|
ensureObserver() {
|
|
@@ -1505,7 +1525,7 @@ class Yr {
|
|
|
1505
1525
|
const r = this.bindingsByStyle.get(e);
|
|
1506
1526
|
if (!r || typeof document > "u")
|
|
1507
1527
|
return;
|
|
1508
|
-
const n = `.${
|
|
1528
|
+
const n = `.${it(e)}`;
|
|
1509
1529
|
document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
|
|
1510
1530
|
}
|
|
1511
1531
|
applyStyleToElement(e, r, n) {
|
|
@@ -1545,7 +1565,7 @@ class Yr {
|
|
|
1545
1565
|
}
|
|
1546
1566
|
resolveScrollContainer(e, r) {
|
|
1547
1567
|
if (r.targetId) {
|
|
1548
|
-
const n = `[data-ikon-motion-source="${
|
|
1568
|
+
const n = `[data-ikon-motion-source="${it(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
|
|
1549
1569
|
if (o)
|
|
1550
1570
|
return o;
|
|
1551
1571
|
}
|
|
@@ -1555,10 +1575,10 @@ class Yr {
|
|
|
1555
1575
|
const o = r.max - r.min, s = o === 0 ? n > r.min ? 1 : 0 : (n - r.min) / o;
|
|
1556
1576
|
let i = this.applyClamp(s, r.clamp);
|
|
1557
1577
|
r.reverse && (i = 1 - i);
|
|
1558
|
-
const a = r.ease(i), c = Number.isFinite(a) ? a : 0,
|
|
1559
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${
|
|
1560
|
-
const
|
|
1561
|
-
|
|
1578
|
+
const a = r.ease(i), c = Number.isFinite(a) ? a : 0, d = c * 100;
|
|
1579
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${d}`), r.map) {
|
|
1580
|
+
const f = this.applyMap(d, r.map);
|
|
1581
|
+
f !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${f}`);
|
|
1562
1582
|
} else
|
|
1563
1583
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1564
1584
|
}
|
|
@@ -1573,7 +1593,7 @@ class Yr {
|
|
|
1573
1593
|
case "unclamped":
|
|
1574
1594
|
return e;
|
|
1575
1595
|
default:
|
|
1576
|
-
return
|
|
1596
|
+
return B(e);
|
|
1577
1597
|
}
|
|
1578
1598
|
}
|
|
1579
1599
|
applyMap(e, r) {
|
|
@@ -1615,7 +1635,7 @@ class Yr {
|
|
|
1615
1635
|
try {
|
|
1616
1636
|
i();
|
|
1617
1637
|
} catch (a) {
|
|
1618
|
-
|
|
1638
|
+
Ie.warn("Failed to cleanup listener", a);
|
|
1619
1639
|
}
|
|
1620
1640
|
this.globalCleanups.delete(i);
|
|
1621
1641
|
}
|
|
@@ -1660,31 +1680,31 @@ class Yr {
|
|
|
1660
1680
|
}
|
|
1661
1681
|
}
|
|
1662
1682
|
}
|
|
1663
|
-
const
|
|
1664
|
-
function
|
|
1665
|
-
const e =
|
|
1683
|
+
const Oe = new Xr();
|
|
1684
|
+
function Zr(t) {
|
|
1685
|
+
const e = w(/* @__PURE__ */ new Map()), r = D(({ styleId: s, css: i, common: a }) => {
|
|
1666
1686
|
if (!(!s || typeof document > "u")) {
|
|
1667
1687
|
if (i) {
|
|
1668
1688
|
let c = e.current.get(s);
|
|
1669
1689
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1670
1690
|
}
|
|
1671
|
-
|
|
1691
|
+
Oe.registerStyle(s, a);
|
|
1672
1692
|
}
|
|
1673
|
-
}, []), n =
|
|
1693
|
+
}, []), n = D((s) => {
|
|
1674
1694
|
if (!(typeof document > "u"))
|
|
1675
1695
|
for (const i of s) {
|
|
1676
1696
|
const a = e.current.get(i);
|
|
1677
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1697
|
+
a && (a.remove(), e.current.delete(i)), Oe.unregisterStyle(i);
|
|
1678
1698
|
}
|
|
1679
|
-
}, []), o =
|
|
1699
|
+
}, []), o = D(() => {
|
|
1680
1700
|
if (typeof document < "u") {
|
|
1681
1701
|
for (const s of e.current.values())
|
|
1682
1702
|
s.remove();
|
|
1683
1703
|
e.current.clear();
|
|
1684
1704
|
}
|
|
1685
|
-
|
|
1705
|
+
Oe.reset();
|
|
1686
1706
|
}, []);
|
|
1687
|
-
return
|
|
1707
|
+
return M(() => {
|
|
1688
1708
|
if (!t) return;
|
|
1689
1709
|
for (const a of t.getUiStyles())
|
|
1690
1710
|
r(a);
|
|
@@ -1692,9 +1712,9 @@ function zr(t) {
|
|
|
1692
1712
|
return () => {
|
|
1693
1713
|
s?.(), i?.(), o();
|
|
1694
1714
|
};
|
|
1695
|
-
}, [t, o, r, n]),
|
|
1715
|
+
}, [t, o, r, n]), M(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1696
1716
|
}
|
|
1697
|
-
function
|
|
1717
|
+
function Qr(t) {
|
|
1698
1718
|
const e = [];
|
|
1699
1719
|
for (const [r, n] of t) {
|
|
1700
1720
|
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -1702,62 +1722,62 @@ function Wr(t) {
|
|
|
1702
1722
|
}
|
|
1703
1723
|
return e.sort(), e.join(",");
|
|
1704
1724
|
}
|
|
1705
|
-
function
|
|
1706
|
-
const [e, r] =
|
|
1707
|
-
return
|
|
1725
|
+
function en(t) {
|
|
1726
|
+
const [e, r] = z(), n = w("");
|
|
1727
|
+
return M(() => {
|
|
1708
1728
|
if (!t) {
|
|
1709
1729
|
r(void 0), n.current = "";
|
|
1710
1730
|
return;
|
|
1711
1731
|
}
|
|
1712
1732
|
const o = () => {
|
|
1713
|
-
const s = t.getStores(), i =
|
|
1733
|
+
const s = t.getStores(), i = Qr(s);
|
|
1714
1734
|
i !== n.current && (n.current = i, r(s));
|
|
1715
1735
|
};
|
|
1716
1736
|
return o(), t.subscribe(o);
|
|
1717
1737
|
}, [t]), e;
|
|
1718
1738
|
}
|
|
1719
|
-
var
|
|
1720
|
-
function
|
|
1721
|
-
var e =
|
|
1739
|
+
var tn = typeof global == "object" && global && global.Object === Object && global, rn = typeof self == "object" && self && self.Object === Object && self, nn = tn || rn || Function("return this")(), ve = nn.Symbol, bt = Object.prototype, on = bt.hasOwnProperty, sn = bt.toString, le = ve ? ve.toStringTag : void 0;
|
|
1740
|
+
function an(t) {
|
|
1741
|
+
var e = on.call(t, le), r = t[le];
|
|
1722
1742
|
try {
|
|
1723
|
-
t[
|
|
1743
|
+
t[le] = void 0;
|
|
1724
1744
|
var n = !0;
|
|
1725
1745
|
} catch {
|
|
1726
1746
|
}
|
|
1727
|
-
var o =
|
|
1728
|
-
return n && (e ? t[
|
|
1747
|
+
var o = sn.call(t);
|
|
1748
|
+
return n && (e ? t[le] = r : delete t[le]), o;
|
|
1729
1749
|
}
|
|
1730
|
-
var
|
|
1731
|
-
function
|
|
1732
|
-
return
|
|
1750
|
+
var cn = Object.prototype, un = cn.toString;
|
|
1751
|
+
function ln(t) {
|
|
1752
|
+
return un.call(t);
|
|
1733
1753
|
}
|
|
1734
|
-
var
|
|
1735
|
-
function
|
|
1736
|
-
return t == null ? t === void 0 ?
|
|
1754
|
+
var dn = "[object Null]", fn = "[object Undefined]", ct = ve ? ve.toStringTag : void 0;
|
|
1755
|
+
function hn(t) {
|
|
1756
|
+
return t == null ? t === void 0 ? fn : dn : ct && ct in Object(t) ? an(t) : ln(t);
|
|
1737
1757
|
}
|
|
1738
|
-
function
|
|
1758
|
+
function mn(t) {
|
|
1739
1759
|
return t != null && typeof t == "object";
|
|
1740
1760
|
}
|
|
1741
|
-
var
|
|
1742
|
-
function
|
|
1743
|
-
return typeof t == "string" || !
|
|
1761
|
+
var pn = Array.isArray, gn = "[object String]";
|
|
1762
|
+
function yn(t) {
|
|
1763
|
+
return typeof t == "string" || !pn(t) && mn(t) && hn(t) == gn;
|
|
1744
1764
|
}
|
|
1745
|
-
const
|
|
1746
|
-
function
|
|
1765
|
+
const ut = "ikonUiModules";
|
|
1766
|
+
function Fe(t) {
|
|
1747
1767
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1748
1768
|
}
|
|
1749
|
-
function
|
|
1769
|
+
function Sn(t) {
|
|
1750
1770
|
if (!Array.isArray(t))
|
|
1751
1771
|
return;
|
|
1752
1772
|
const e = /* @__PURE__ */ new Set();
|
|
1753
1773
|
for (const r of t) {
|
|
1754
|
-
if (!
|
|
1774
|
+
if (!yn(r)) continue;
|
|
1755
1775
|
const n = r.trim();
|
|
1756
1776
|
n && (e.has(n) || e.add(n));
|
|
1757
1777
|
}
|
|
1758
1778
|
return Array.from(e);
|
|
1759
1779
|
}
|
|
1760
|
-
function
|
|
1780
|
+
function So(t, e) {
|
|
1761
1781
|
if (t === e)
|
|
1762
1782
|
return !0;
|
|
1763
1783
|
if (!t || !e)
|
|
@@ -1769,19 +1789,19 @@ function lo(t, e) {
|
|
|
1769
1789
|
return !1;
|
|
1770
1790
|
return !0;
|
|
1771
1791
|
}
|
|
1772
|
-
function
|
|
1773
|
-
if (!(!
|
|
1774
|
-
return
|
|
1792
|
+
function bn(t) {
|
|
1793
|
+
if (!(!Fe(t) || !Object.prototype.hasOwnProperty.call(t, ut)))
|
|
1794
|
+
return Sn(t[ut]);
|
|
1775
1795
|
}
|
|
1776
|
-
function
|
|
1796
|
+
function bo(...t) {
|
|
1777
1797
|
for (const e of t) {
|
|
1778
|
-
const r =
|
|
1798
|
+
const r = bn(e);
|
|
1779
1799
|
if (r !== void 0)
|
|
1780
1800
|
return r;
|
|
1781
1801
|
}
|
|
1782
1802
|
}
|
|
1783
|
-
function
|
|
1784
|
-
if (!
|
|
1803
|
+
function wo(t) {
|
|
1804
|
+
if (!Fe(t))
|
|
1785
1805
|
return;
|
|
1786
1806
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
1787
1807
|
if (!r)
|
|
@@ -1794,44 +1814,44 @@ function ho(t) {
|
|
|
1794
1814
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
1795
1815
|
for (const c of n) {
|
|
1796
1816
|
if (typeof c == "string") {
|
|
1797
|
-
const
|
|
1798
|
-
if (!
|
|
1817
|
+
const S = c.trim();
|
|
1818
|
+
if (!S || i.has(S))
|
|
1799
1819
|
continue;
|
|
1800
|
-
o.push(
|
|
1820
|
+
o.push(S), i.add(S);
|
|
1801
1821
|
continue;
|
|
1802
1822
|
}
|
|
1803
|
-
if (!
|
|
1823
|
+
if (!Fe(c))
|
|
1804
1824
|
continue;
|
|
1805
|
-
const
|
|
1806
|
-
if (!
|
|
1825
|
+
const d = c, f = Object.keys(d).find((S) => S.toLowerCase() === "name");
|
|
1826
|
+
if (!f)
|
|
1807
1827
|
continue;
|
|
1808
|
-
const
|
|
1809
|
-
if (typeof
|
|
1828
|
+
const g = d[f];
|
|
1829
|
+
if (typeof g != "string")
|
|
1810
1830
|
continue;
|
|
1811
|
-
const u =
|
|
1831
|
+
const u = g.trim();
|
|
1812
1832
|
if (!u)
|
|
1813
1833
|
continue;
|
|
1814
|
-
const
|
|
1834
|
+
const h = Object.keys(d).find((S) => S.toLowerCase() === "javascript"), y = h ? d[h] : void 0;
|
|
1815
1835
|
typeof y == "string" && s.set(u, y), i.has(u) || (o.push(u), i.add(u));
|
|
1816
1836
|
}
|
|
1817
1837
|
if (!o.length && s.size === 0)
|
|
1818
1838
|
return { modules: [] };
|
|
1819
|
-
const a = Array.from(s.entries()).map(([c,
|
|
1839
|
+
const a = Array.from(s.entries()).map(([c, d]) => ({
|
|
1820
1840
|
name: c,
|
|
1821
|
-
javascript:
|
|
1841
|
+
javascript: d
|
|
1822
1842
|
}));
|
|
1823
1843
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
1824
1844
|
}
|
|
1825
|
-
const
|
|
1845
|
+
const R = {
|
|
1826
1846
|
None: 0,
|
|
1827
1847
|
Letter: 1,
|
|
1828
1848
|
Word: 2,
|
|
1829
1849
|
Line: 4,
|
|
1830
1850
|
Paragraph: 8,
|
|
1831
1851
|
Emoji: 16
|
|
1832
|
-
},
|
|
1852
|
+
}, wn = [
|
|
1833
1853
|
{
|
|
1834
|
-
flag:
|
|
1854
|
+
flag: R.Letter,
|
|
1835
1855
|
hints: [
|
|
1836
1856
|
"[data-motion-letter]",
|
|
1837
1857
|
"[data-letter]",
|
|
@@ -1840,7 +1860,7 @@ const E = {
|
|
|
1840
1860
|
]
|
|
1841
1861
|
},
|
|
1842
1862
|
{
|
|
1843
|
-
flag:
|
|
1863
|
+
flag: R.Word,
|
|
1844
1864
|
hints: [
|
|
1845
1865
|
"[data-motion-word]",
|
|
1846
1866
|
"[data-word]",
|
|
@@ -1849,7 +1869,7 @@ const E = {
|
|
|
1849
1869
|
]
|
|
1850
1870
|
},
|
|
1851
1871
|
{
|
|
1852
|
-
flag:
|
|
1872
|
+
flag: R.Line,
|
|
1853
1873
|
hints: [
|
|
1854
1874
|
"[data-motion-line]",
|
|
1855
1875
|
"[data-line]",
|
|
@@ -1858,7 +1878,7 @@ const E = {
|
|
|
1858
1878
|
]
|
|
1859
1879
|
},
|
|
1860
1880
|
{
|
|
1861
|
-
flag:
|
|
1881
|
+
flag: R.Paragraph,
|
|
1862
1882
|
hints: [
|
|
1863
1883
|
"[data-motion-paragraph]",
|
|
1864
1884
|
"[data-paragraph]",
|
|
@@ -1869,7 +1889,7 @@ const E = {
|
|
|
1869
1889
|
]
|
|
1870
1890
|
},
|
|
1871
1891
|
{
|
|
1872
|
-
flag:
|
|
1892
|
+
flag: R.Emoji,
|
|
1873
1893
|
hints: [
|
|
1874
1894
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
1875
1895
|
"[data-motion-emoji]",
|
|
@@ -1878,42 +1898,42 @@ const E = {
|
|
|
1878
1898
|
"[data-emoji]"
|
|
1879
1899
|
]
|
|
1880
1900
|
}
|
|
1881
|
-
],
|
|
1882
|
-
function
|
|
1883
|
-
if (!t || t.length >
|
|
1901
|
+
], Be = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji, vn = R.Letter | R.Word | R.Line | R.Paragraph, lt = /* @__PURE__ */ new Map(), Rn = 16384;
|
|
1902
|
+
function vo(t, e) {
|
|
1903
|
+
if (!t || t.length > Rn)
|
|
1884
1904
|
return t;
|
|
1885
|
-
const r =
|
|
1886
|
-
if (o ===
|
|
1905
|
+
const r = Fn(e), n = ne(r, R.Emoji), o = r & vn;
|
|
1906
|
+
if (o === R.None && !n)
|
|
1887
1907
|
return t;
|
|
1888
1908
|
const s = t.replace(/\r\n/g, `
|
|
1889
1909
|
`).replace(/\r/g, `
|
|
1890
1910
|
`);
|
|
1891
|
-
if (o ===
|
|
1892
|
-
return
|
|
1893
|
-
const i =
|
|
1911
|
+
if (o === R.None)
|
|
1912
|
+
return mt(s);
|
|
1913
|
+
const i = xn(s);
|
|
1894
1914
|
if (i.length === 0)
|
|
1895
|
-
return n ?
|
|
1896
|
-
const a =
|
|
1897
|
-
for (const
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1915
|
+
return n ? mt(s) : t;
|
|
1916
|
+
const a = Dn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
|
|
1917
|
+
for (const f of a) {
|
|
1918
|
+
const g = En(f, r, c);
|
|
1919
|
+
d.push(...g);
|
|
1900
1920
|
}
|
|
1901
|
-
return
|
|
1921
|
+
return d;
|
|
1902
1922
|
}
|
|
1903
|
-
function
|
|
1923
|
+
function En(t, e, r) {
|
|
1904
1924
|
const n = [];
|
|
1905
1925
|
for (const o of t) {
|
|
1906
|
-
const s =
|
|
1926
|
+
const s = An(o, e, r);
|
|
1907
1927
|
n.push(...s);
|
|
1908
1928
|
}
|
|
1909
|
-
if (
|
|
1929
|
+
if (ne(e, R.Paragraph)) {
|
|
1910
1930
|
const o = r.paragraph++;
|
|
1911
1931
|
return [
|
|
1912
|
-
/* @__PURE__ */
|
|
1932
|
+
/* @__PURE__ */ E.jsx(
|
|
1913
1933
|
"span",
|
|
1914
1934
|
{
|
|
1915
1935
|
"data-motion-paragraph": !0,
|
|
1916
|
-
style:
|
|
1936
|
+
style: Ae(o),
|
|
1917
1937
|
children: n
|
|
1918
1938
|
},
|
|
1919
1939
|
`motion-paragraph-${o}`
|
|
@@ -1922,116 +1942,116 @@ function gn(t, e, r) {
|
|
|
1922
1942
|
}
|
|
1923
1943
|
return n;
|
|
1924
1944
|
}
|
|
1925
|
-
function
|
|
1926
|
-
const n =
|
|
1927
|
-
if (
|
|
1945
|
+
function An(t, e, r) {
|
|
1946
|
+
const n = Tn(t.text, e, r), o = [];
|
|
1947
|
+
if (ne(e, R.Line)) {
|
|
1928
1948
|
const s = r.line++;
|
|
1929
1949
|
o.push(
|
|
1930
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Ae(s), children: n }, `motion-line-${s}`)
|
|
1931
1951
|
);
|
|
1932
1952
|
} else
|
|
1933
1953
|
o.push(...n);
|
|
1934
1954
|
for (let s = 0; s < t.breaks; s++)
|
|
1935
|
-
o.push(/* @__PURE__ */
|
|
1955
|
+
o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1936
1956
|
return o;
|
|
1937
1957
|
}
|
|
1938
|
-
function
|
|
1958
|
+
function Tn(t, e, r) {
|
|
1939
1959
|
if (!t)
|
|
1940
1960
|
return [];
|
|
1941
|
-
const n =
|
|
1961
|
+
const n = ne(e, R.Word), o = [], s = /(\s+)/g;
|
|
1942
1962
|
let i = 0, a;
|
|
1943
1963
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1944
1964
|
if (a.index > i) {
|
|
1945
1965
|
const c = t.slice(i, a.index);
|
|
1946
|
-
o.push(
|
|
1966
|
+
o.push(dt(c, r, e, n));
|
|
1947
1967
|
}
|
|
1948
1968
|
o.push(a[0]), i = a.index + a[0].length;
|
|
1949
1969
|
}
|
|
1950
1970
|
if (i < t.length) {
|
|
1951
1971
|
const c = t.slice(i);
|
|
1952
|
-
o.push(
|
|
1972
|
+
o.push(dt(c, r, e, n));
|
|
1953
1973
|
}
|
|
1954
1974
|
return o;
|
|
1955
1975
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const o = e.word++, s =
|
|
1958
|
-
return n ? /* @__PURE__ */
|
|
1976
|
+
function dt(t, e, r, n) {
|
|
1977
|
+
const o = e.word++, s = Cn(t, r, e), i = `motion-word-${o}`, a = kn(o, n);
|
|
1978
|
+
return n ? /* @__PURE__ */ E.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ E.jsx("span", { style: a, children: s }, i);
|
|
1959
1979
|
}
|
|
1960
|
-
function
|
|
1961
|
-
return e ? { ...
|
|
1980
|
+
function kn(t, e) {
|
|
1981
|
+
return e ? { ...Ae(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1962
1982
|
}
|
|
1963
|
-
function
|
|
1983
|
+
function Cn(t, e, r) {
|
|
1964
1984
|
if (!t)
|
|
1965
1985
|
return [];
|
|
1966
|
-
const n =
|
|
1986
|
+
const n = ne(e, R.Letter), o = ne(e, R.Emoji);
|
|
1967
1987
|
if (!n) {
|
|
1968
1988
|
if (!o)
|
|
1969
1989
|
return [t];
|
|
1970
|
-
const a =
|
|
1990
|
+
const a = $e(t);
|
|
1971
1991
|
if (a.length === 0)
|
|
1972
1992
|
return [t];
|
|
1973
|
-
const { nodes: c } =
|
|
1993
|
+
const { nodes: c } = vt(a, r);
|
|
1974
1994
|
return c;
|
|
1975
1995
|
}
|
|
1976
|
-
const s = [], i =
|
|
1996
|
+
const s = [], i = $e(t);
|
|
1977
1997
|
for (const a of i) {
|
|
1978
|
-
const c = r.letter++,
|
|
1998
|
+
const c = r.letter++, d = `motion-letter-${c}`, f = Ae(c);
|
|
1979
1999
|
if (a === `
|
|
1980
2000
|
`) {
|
|
1981
2001
|
s.push(
|
|
1982
|
-
/* @__PURE__ */
|
|
2002
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: f, children: /* @__PURE__ */ E.jsx("br", {}) }, d)
|
|
1983
2003
|
);
|
|
1984
2004
|
continue;
|
|
1985
2005
|
}
|
|
1986
|
-
const u = o &&
|
|
2006
|
+
const u = o && wt(a) ? { "data-motion-emoji": !0 } : void 0, h = a === " " ? " " : a;
|
|
1987
2007
|
s.push(
|
|
1988
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: f, ...u, children: h }, d)
|
|
1989
2009
|
);
|
|
1990
2010
|
}
|
|
1991
2011
|
return s;
|
|
1992
2012
|
}
|
|
1993
|
-
function
|
|
2013
|
+
function $e(t) {
|
|
1994
2014
|
if (!t)
|
|
1995
2015
|
return [];
|
|
1996
|
-
const e =
|
|
1997
|
-
return e ? Array.from(e.segment(t), (r) => r.segment) :
|
|
2016
|
+
const e = In();
|
|
2017
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : On(t);
|
|
1998
2018
|
}
|
|
1999
|
-
let
|
|
2000
|
-
function
|
|
2001
|
-
return
|
|
2019
|
+
let de;
|
|
2020
|
+
function In() {
|
|
2021
|
+
return de !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? de = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : de = null), de;
|
|
2002
2022
|
}
|
|
2003
|
-
function
|
|
2023
|
+
function On(t) {
|
|
2004
2024
|
const e = [], r = Array.from(t);
|
|
2005
2025
|
let n = "";
|
|
2006
2026
|
for (let o = 0; o < r.length; o++) {
|
|
2007
2027
|
const s = r[o], i = r[o + 1];
|
|
2008
|
-
n += s, !(i &&
|
|
2028
|
+
n += s, !(i && _n(s, i)) && (e.push(n), n = "");
|
|
2009
2029
|
}
|
|
2010
2030
|
return n && e.push(n), e;
|
|
2011
2031
|
}
|
|
2012
|
-
function
|
|
2013
|
-
return e ? !!(
|
|
2032
|
+
function _n(t, e) {
|
|
2033
|
+
return e ? !!(ft(t) || ft(e) || jn(e) || Nn(e) || Pn(e) || ht(t) && ht(e)) : !1;
|
|
2014
2034
|
}
|
|
2015
|
-
function
|
|
2035
|
+
function ft(t) {
|
|
2016
2036
|
return t.codePointAt(0) === 8205;
|
|
2017
2037
|
}
|
|
2018
|
-
function
|
|
2038
|
+
function Nn(t) {
|
|
2019
2039
|
const e = t.codePointAt(0);
|
|
2020
2040
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2021
2041
|
}
|
|
2022
|
-
function
|
|
2042
|
+
function Pn(t) {
|
|
2023
2043
|
const e = t.codePointAt(0);
|
|
2024
2044
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2025
2045
|
}
|
|
2026
|
-
function
|
|
2046
|
+
function ht(t) {
|
|
2027
2047
|
const e = t.codePointAt(0);
|
|
2028
2048
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2029
2049
|
}
|
|
2030
|
-
let
|
|
2031
|
-
function
|
|
2032
|
-
return t ? (
|
|
2050
|
+
let _e;
|
|
2051
|
+
function jn(t) {
|
|
2052
|
+
return t ? (_e || (_e = Ln()), _e(t)) : !1;
|
|
2033
2053
|
}
|
|
2034
|
-
function
|
|
2054
|
+
function Ln() {
|
|
2035
2055
|
try {
|
|
2036
2056
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2037
2057
|
return (e) => t.test(e);
|
|
@@ -2042,19 +2062,19 @@ function Cn() {
|
|
|
2042
2062
|
};
|
|
2043
2063
|
}
|
|
2044
2064
|
}
|
|
2045
|
-
let
|
|
2046
|
-
function
|
|
2047
|
-
return t ? (
|
|
2065
|
+
let Ne;
|
|
2066
|
+
function wt(t) {
|
|
2067
|
+
return t ? (Ne || (Ne = Mn()), Ne(t)) : !1;
|
|
2048
2068
|
}
|
|
2049
|
-
function
|
|
2069
|
+
function Mn() {
|
|
2050
2070
|
try {
|
|
2051
2071
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2052
2072
|
return (e) => t.test(e);
|
|
2053
2073
|
} catch {
|
|
2054
|
-
return
|
|
2074
|
+
return Un;
|
|
2055
2075
|
}
|
|
2056
2076
|
}
|
|
2057
|
-
function
|
|
2077
|
+
function Un(t) {
|
|
2058
2078
|
if (!t)
|
|
2059
2079
|
return !1;
|
|
2060
2080
|
for (const e of Array.from(t)) {
|
|
@@ -2064,7 +2084,7 @@ function _n(t) {
|
|
|
2064
2084
|
}
|
|
2065
2085
|
return !1;
|
|
2066
2086
|
}
|
|
2067
|
-
function
|
|
2087
|
+
function xn(t) {
|
|
2068
2088
|
const e = [];
|
|
2069
2089
|
let r = "", n = 0;
|
|
2070
2090
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2078,7 +2098,7 @@ function On(t) {
|
|
|
2078
2098
|
}
|
|
2079
2099
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
2080
2100
|
}
|
|
2081
|
-
function
|
|
2101
|
+
function Dn(t) {
|
|
2082
2102
|
if (t.length === 0)
|
|
2083
2103
|
return [];
|
|
2084
2104
|
const e = [];
|
|
@@ -2087,10 +2107,10 @@ function Nn(t) {
|
|
|
2087
2107
|
r.push(n), n.breaks >= 2 && (e.push(r), r = []);
|
|
2088
2108
|
return r.length > 0 && e.push(r), e;
|
|
2089
2109
|
}
|
|
2090
|
-
function
|
|
2110
|
+
function ne(t, e) {
|
|
2091
2111
|
return (t & e) === e;
|
|
2092
2112
|
}
|
|
2093
|
-
function
|
|
2113
|
+
function Ae(t) {
|
|
2094
2114
|
return {
|
|
2095
2115
|
"--tw-motion-seq-index": t.toString(),
|
|
2096
2116
|
backgroundColor: "inherit",
|
|
@@ -2107,27 +2127,27 @@ function we(t) {
|
|
|
2107
2127
|
WebkitTextFillColor: "inherit"
|
|
2108
2128
|
};
|
|
2109
2129
|
}
|
|
2110
|
-
function
|
|
2130
|
+
function mt(t) {
|
|
2111
2131
|
if (!t)
|
|
2112
2132
|
return t;
|
|
2113
|
-
const e =
|
|
2133
|
+
const e = $e(t);
|
|
2114
2134
|
if (e.length === 0)
|
|
2115
2135
|
return t;
|
|
2116
|
-
const { nodes: r, sawEmoji: n } =
|
|
2136
|
+
const { nodes: r, sawEmoji: n } = vt(e);
|
|
2117
2137
|
return n ? r.length === 1 ? r[0] ?? t : r : t;
|
|
2118
2138
|
}
|
|
2119
|
-
function
|
|
2139
|
+
function vt(t, e) {
|
|
2120
2140
|
const r = [];
|
|
2121
2141
|
let n = "", o = !1, s = e?.emoji ?? 0;
|
|
2122
2142
|
const i = () => {
|
|
2123
2143
|
n && (r.push(n), n = "");
|
|
2124
2144
|
};
|
|
2125
2145
|
for (const a of t) {
|
|
2126
|
-
if (
|
|
2146
|
+
if (wt(a)) {
|
|
2127
2147
|
o = !0, i();
|
|
2128
|
-
const
|
|
2148
|
+
const d = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2129
2149
|
r.push(
|
|
2130
|
-
/* @__PURE__ */
|
|
2150
|
+
/* @__PURE__ */ E.jsx("span", { "data-motion-emoji": !0, children: a }, d)
|
|
2131
2151
|
);
|
|
2132
2152
|
continue;
|
|
2133
2153
|
}
|
|
@@ -2135,56 +2155,56 @@ function gt(t, e) {
|
|
|
2135
2155
|
}
|
|
2136
2156
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2137
2157
|
}
|
|
2138
|
-
function
|
|
2158
|
+
function Fn(t) {
|
|
2139
2159
|
if (!t)
|
|
2140
|
-
return
|
|
2160
|
+
return R.None;
|
|
2141
2161
|
const e = t.trim();
|
|
2142
2162
|
if (!e)
|
|
2143
|
-
return
|
|
2144
|
-
const r =
|
|
2163
|
+
return R.None;
|
|
2164
|
+
const r = lt.get(e);
|
|
2145
2165
|
if (typeof r == "number")
|
|
2146
2166
|
return r;
|
|
2147
2167
|
if (typeof document > "u")
|
|
2148
|
-
return
|
|
2168
|
+
return R.None;
|
|
2149
2169
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2150
2170
|
if (n.length === 0)
|
|
2151
|
-
return
|
|
2152
|
-
const s = n.map((c) => `.${
|
|
2153
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2171
|
+
return R.None;
|
|
2172
|
+
const s = n.map((c) => `.${Bn(c)}`).map(
|
|
2173
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${$n(c)}(?![a-zA-Z0-9_-])`)
|
|
2154
2174
|
);
|
|
2155
|
-
let i =
|
|
2175
|
+
let i = R.None, a = !1;
|
|
2156
2176
|
for (const c of Array.from(document.styleSheets)) {
|
|
2157
|
-
let
|
|
2177
|
+
let d;
|
|
2158
2178
|
try {
|
|
2159
|
-
|
|
2179
|
+
d = c.cssRules;
|
|
2160
2180
|
} catch {
|
|
2161
2181
|
continue;
|
|
2162
2182
|
}
|
|
2163
|
-
const
|
|
2164
|
-
if (
|
|
2183
|
+
const f = Rt(d, s);
|
|
2184
|
+
if (f.mask && (i |= f.mask, i === Be))
|
|
2165
2185
|
break;
|
|
2166
|
-
a ||=
|
|
2186
|
+
a ||= f.sawStyleRule;
|
|
2167
2187
|
}
|
|
2168
|
-
return (i !==
|
|
2188
|
+
return (i !== R.None || a) && lt.set(e, i), i;
|
|
2169
2189
|
}
|
|
2170
|
-
function
|
|
2190
|
+
function Rt(t, e) {
|
|
2171
2191
|
if (!t)
|
|
2172
|
-
return { mask:
|
|
2173
|
-
let r =
|
|
2192
|
+
return { mask: R.None, sawStyleRule: !1 };
|
|
2193
|
+
let r = R.None, n = !1;
|
|
2174
2194
|
for (let o = 0; o < t.length; o++) {
|
|
2175
2195
|
const s = t[o];
|
|
2176
2196
|
if (s) {
|
|
2177
2197
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2178
2198
|
const a = s.selectorText ?? "";
|
|
2179
|
-
if (!a || !e.some((
|
|
2199
|
+
if (!a || !e.some((d) => d.test(a))) continue;
|
|
2180
2200
|
n = !0;
|
|
2181
|
-
for (const
|
|
2182
|
-
|
|
2183
|
-
if (r ===
|
|
2201
|
+
for (const d of wn)
|
|
2202
|
+
d.hints.some((f) => a.includes(f)) && (r |= d.flag);
|
|
2203
|
+
if (r === Be)
|
|
2184
2204
|
return { mask: r, sawStyleRule: !0 };
|
|
2185
2205
|
} else if ("cssRules" in s) {
|
|
2186
|
-
const i =
|
|
2187
|
-
if (i.mask && (r |= i.mask, r ===
|
|
2206
|
+
const i = Rt(s.cssRules, e);
|
|
2207
|
+
if (i.mask && (r |= i.mask, r === Be))
|
|
2188
2208
|
return { mask: r, sawStyleRule: !0 };
|
|
2189
2209
|
n ||= i.sawStyleRule;
|
|
2190
2210
|
}
|
|
@@ -2192,38 +2212,38 @@ function yt(t, e) {
|
|
|
2192
2212
|
}
|
|
2193
2213
|
return { mask: r, sawStyleRule: n };
|
|
2194
2214
|
}
|
|
2195
|
-
function
|
|
2215
|
+
function Bn(t) {
|
|
2196
2216
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2197
2217
|
}
|
|
2198
|
-
function
|
|
2218
|
+
function $n(t) {
|
|
2199
2219
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2200
2220
|
}
|
|
2201
|
-
const
|
|
2202
|
-
function
|
|
2221
|
+
const ze = "ikon_auth_session", Vn = 7 * 24 * 60 * 60 * 1e3;
|
|
2222
|
+
function Te(t) {
|
|
2203
2223
|
try {
|
|
2204
|
-
localStorage.setItem(
|
|
2224
|
+
localStorage.setItem(ze, JSON.stringify(t));
|
|
2205
2225
|
} catch {
|
|
2206
2226
|
console.warn("Failed to save auth session to localStorage");
|
|
2207
2227
|
}
|
|
2208
2228
|
}
|
|
2209
|
-
function
|
|
2229
|
+
function Et() {
|
|
2210
2230
|
try {
|
|
2211
|
-
const t = localStorage.getItem(
|
|
2231
|
+
const t = localStorage.getItem(ze);
|
|
2212
2232
|
if (!t) return null;
|
|
2213
2233
|
const e = JSON.parse(t);
|
|
2214
|
-
return Date.now() - e.authenticatedAt >
|
|
2234
|
+
return Date.now() - e.authenticatedAt > Vn ? (At(), null) : e;
|
|
2215
2235
|
} catch {
|
|
2216
2236
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2217
2237
|
}
|
|
2218
2238
|
}
|
|
2219
|
-
function
|
|
2239
|
+
function At() {
|
|
2220
2240
|
try {
|
|
2221
|
-
localStorage.removeItem(
|
|
2241
|
+
localStorage.removeItem(ze);
|
|
2222
2242
|
} catch {
|
|
2223
2243
|
console.warn("Failed to clear auth session from localStorage");
|
|
2224
2244
|
}
|
|
2225
2245
|
}
|
|
2226
|
-
function
|
|
2246
|
+
function fe(t) {
|
|
2227
2247
|
return {
|
|
2228
2248
|
id: "",
|
|
2229
2249
|
provider: t.provider,
|
|
@@ -2231,8 +2251,8 @@ function le(t) {
|
|
|
2231
2251
|
authenticatedAt: t.authenticatedAt
|
|
2232
2252
|
};
|
|
2233
2253
|
}
|
|
2234
|
-
async function
|
|
2235
|
-
const r =
|
|
2254
|
+
async function Tt(t, e) {
|
|
2255
|
+
const r = be(), n = await fetch(`${e}/anonymous`, {
|
|
2236
2256
|
method: "POST",
|
|
2237
2257
|
headers: { "Content-Type": "application/json" },
|
|
2238
2258
|
body: JSON.stringify({ deviceId: r, space: t })
|
|
@@ -2246,9 +2266,9 @@ async function wt(t, e) {
|
|
|
2246
2266
|
provider: "anonymous",
|
|
2247
2267
|
authenticatedAt: Date.now()
|
|
2248
2268
|
};
|
|
2249
|
-
return
|
|
2269
|
+
return Te(s), s;
|
|
2250
2270
|
}
|
|
2251
|
-
async function
|
|
2271
|
+
async function Ro(t) {
|
|
2252
2272
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
2253
2273
|
method: "POST",
|
|
2254
2274
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2263,22 +2283,22 @@ async function po(t) {
|
|
|
2263
2283
|
throw new Error(i);
|
|
2264
2284
|
}
|
|
2265
2285
|
}
|
|
2266
|
-
function
|
|
2286
|
+
function Kn() {
|
|
2267
2287
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2268
2288
|
return e && r ? { token: e, provider: r } : null;
|
|
2269
2289
|
}
|
|
2270
|
-
function
|
|
2290
|
+
function Wn() {
|
|
2271
2291
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2272
2292
|
return e ? decodeURIComponent(e) : null;
|
|
2273
2293
|
}
|
|
2274
|
-
function
|
|
2294
|
+
function pt() {
|
|
2275
2295
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2276
2296
|
}
|
|
2277
|
-
function
|
|
2297
|
+
function Yn(t, e, r, n) {
|
|
2278
2298
|
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2279
2299
|
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2280
2300
|
}
|
|
2281
|
-
async function
|
|
2301
|
+
async function zn(t) {
|
|
2282
2302
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2283
2303
|
method: "POST",
|
|
2284
2304
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2289,7 +2309,7 @@ async function Fn(t) {
|
|
|
2289
2309
|
}
|
|
2290
2310
|
return e.json();
|
|
2291
2311
|
}
|
|
2292
|
-
async function
|
|
2312
|
+
async function qn(t, e, r) {
|
|
2293
2313
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2294
2314
|
method: "POST",
|
|
2295
2315
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2304,9 +2324,9 @@ async function Bn(t, e, r) {
|
|
|
2304
2324
|
provider: "passkey",
|
|
2305
2325
|
authenticatedAt: Date.now()
|
|
2306
2326
|
};
|
|
2307
|
-
return
|
|
2327
|
+
return Te(s), s;
|
|
2308
2328
|
}
|
|
2309
|
-
async function
|
|
2329
|
+
async function Gn(t, e) {
|
|
2310
2330
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
2311
2331
|
method: "POST",
|
|
2312
2332
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2318,7 +2338,7 @@ async function $n(t, e) {
|
|
|
2318
2338
|
}
|
|
2319
2339
|
return r.json();
|
|
2320
2340
|
}
|
|
2321
|
-
async function
|
|
2341
|
+
async function Hn(t, e) {
|
|
2322
2342
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2323
2343
|
method: "POST",
|
|
2324
2344
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2333,32 +2353,32 @@ async function Vn(t, e) {
|
|
|
2333
2353
|
provider: "passkey",
|
|
2334
2354
|
authenticatedAt: Date.now()
|
|
2335
2355
|
};
|
|
2336
|
-
return
|
|
2356
|
+
return Te(o), o;
|
|
2337
2357
|
}
|
|
2338
|
-
function
|
|
2358
|
+
function J(t) {
|
|
2339
2359
|
const e = new Uint8Array(t);
|
|
2340
2360
|
let r = "";
|
|
2341
2361
|
for (const o of e)
|
|
2342
2362
|
r += String.fromCharCode(o);
|
|
2343
2363
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2344
2364
|
}
|
|
2345
|
-
function
|
|
2365
|
+
function Re(t) {
|
|
2346
2366
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - e.length % 4) % 4, n = e.padEnd(e.length + r, "="), o = atob(n), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
|
|
2347
2367
|
for (let a = 0; a < o.length; a++)
|
|
2348
2368
|
i[a] = o.charCodeAt(a);
|
|
2349
2369
|
return s;
|
|
2350
2370
|
}
|
|
2351
|
-
function
|
|
2352
|
-
return
|
|
2371
|
+
function qe() {
|
|
2372
|
+
return Jn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2353
2373
|
}
|
|
2354
|
-
const
|
|
2374
|
+
const Jn = {
|
|
2355
2375
|
stubThis: (t) => t
|
|
2356
2376
|
};
|
|
2357
|
-
function
|
|
2377
|
+
function kt(t) {
|
|
2358
2378
|
const { id: e } = t;
|
|
2359
2379
|
return {
|
|
2360
2380
|
...t,
|
|
2361
|
-
id:
|
|
2381
|
+
id: Re(e),
|
|
2362
2382
|
/**
|
|
2363
2383
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2364
2384
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2367,13 +2387,13 @@ function vt(t) {
|
|
|
2367
2387
|
transports: t.transports
|
|
2368
2388
|
};
|
|
2369
2389
|
}
|
|
2370
|
-
function
|
|
2390
|
+
function Ct(t) {
|
|
2371
2391
|
return (
|
|
2372
2392
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2373
2393
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
2374
2394
|
);
|
|
2375
2395
|
}
|
|
2376
|
-
class
|
|
2396
|
+
class j extends Error {
|
|
2377
2397
|
constructor({ message: e, code: r, cause: n, name: o }) {
|
|
2378
2398
|
super(e, { cause: n }), Object.defineProperty(this, "code", {
|
|
2379
2399
|
enumerable: !0,
|
|
@@ -2383,20 +2403,20 @@ class P extends Error {
|
|
|
2383
2403
|
}), this.name = o ?? n.name, this.code = r;
|
|
2384
2404
|
}
|
|
2385
2405
|
}
|
|
2386
|
-
function
|
|
2406
|
+
function Xn({ error: t, options: e }) {
|
|
2387
2407
|
const { publicKey: r } = e;
|
|
2388
2408
|
if (!r)
|
|
2389
2409
|
throw Error("options was missing required publicKey property");
|
|
2390
2410
|
if (t.name === "AbortError") {
|
|
2391
2411
|
if (e.signal instanceof AbortSignal)
|
|
2392
|
-
return new
|
|
2412
|
+
return new j({
|
|
2393
2413
|
message: "Registration ceremony was sent an abort signal",
|
|
2394
2414
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2395
2415
|
cause: t
|
|
2396
2416
|
});
|
|
2397
2417
|
} else if (t.name === "ConstraintError") {
|
|
2398
2418
|
if (r.authenticatorSelection?.requireResidentKey === !0)
|
|
2399
|
-
return new
|
|
2419
|
+
return new j({
|
|
2400
2420
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2401
2421
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2402
2422
|
cause: t
|
|
@@ -2405,63 +2425,63 @@ function Yn({ error: t, options: e }) {
|
|
|
2405
2425
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2406
2426
|
e.mediation === "conditional" && r.authenticatorSelection?.userVerification === "required"
|
|
2407
2427
|
)
|
|
2408
|
-
return new
|
|
2428
|
+
return new j({
|
|
2409
2429
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2410
2430
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2411
2431
|
cause: t
|
|
2412
2432
|
});
|
|
2413
2433
|
if (r.authenticatorSelection?.userVerification === "required")
|
|
2414
|
-
return new
|
|
2434
|
+
return new j({
|
|
2415
2435
|
message: "User verification was required but no available authenticator supported it",
|
|
2416
2436
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2417
2437
|
cause: t
|
|
2418
2438
|
});
|
|
2419
2439
|
} else {
|
|
2420
2440
|
if (t.name === "InvalidStateError")
|
|
2421
|
-
return new
|
|
2441
|
+
return new j({
|
|
2422
2442
|
message: "The authenticator was previously registered",
|
|
2423
2443
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2424
2444
|
cause: t
|
|
2425
2445
|
});
|
|
2426
2446
|
if (t.name === "NotAllowedError")
|
|
2427
|
-
return new
|
|
2447
|
+
return new j({
|
|
2428
2448
|
message: t.message,
|
|
2429
2449
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2430
2450
|
cause: t
|
|
2431
2451
|
});
|
|
2432
2452
|
if (t.name === "NotSupportedError")
|
|
2433
|
-
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
2453
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new j({
|
|
2434
2454
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2435
2455
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2436
2456
|
cause: t
|
|
2437
|
-
}) : new
|
|
2457
|
+
}) : new j({
|
|
2438
2458
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2439
2459
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2440
2460
|
cause: t
|
|
2441
2461
|
});
|
|
2442
2462
|
if (t.name === "SecurityError") {
|
|
2443
2463
|
const n = globalThis.location.hostname;
|
|
2444
|
-
if (
|
|
2464
|
+
if (Ct(n)) {
|
|
2445
2465
|
if (r.rp.id !== n)
|
|
2446
|
-
return new
|
|
2466
|
+
return new j({
|
|
2447
2467
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
2448
2468
|
code: "ERROR_INVALID_RP_ID",
|
|
2449
2469
|
cause: t
|
|
2450
2470
|
});
|
|
2451
|
-
} else return new
|
|
2471
|
+
} else return new j({
|
|
2452
2472
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2453
2473
|
code: "ERROR_INVALID_DOMAIN",
|
|
2454
2474
|
cause: t
|
|
2455
2475
|
});
|
|
2456
2476
|
} else if (t.name === "TypeError") {
|
|
2457
2477
|
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
2458
|
-
return new
|
|
2478
|
+
return new j({
|
|
2459
2479
|
message: "User ID was not between 1 and 64 characters",
|
|
2460
2480
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2461
2481
|
cause: t
|
|
2462
2482
|
});
|
|
2463
2483
|
} else if (t.name === "UnknownError")
|
|
2464
|
-
return new
|
|
2484
|
+
return new j({
|
|
2465
2485
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2466
2486
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2467
2487
|
cause: t
|
|
@@ -2469,7 +2489,7 @@ function Yn({ error: t, options: e }) {
|
|
|
2469
2489
|
}
|
|
2470
2490
|
return t;
|
|
2471
2491
|
}
|
|
2472
|
-
class
|
|
2492
|
+
class Zn {
|
|
2473
2493
|
constructor() {
|
|
2474
2494
|
Object.defineProperty(this, "controller", {
|
|
2475
2495
|
enumerable: !0,
|
|
@@ -2493,122 +2513,122 @@ class zn {
|
|
|
2493
2513
|
}
|
|
2494
2514
|
}
|
|
2495
2515
|
}
|
|
2496
|
-
const
|
|
2497
|
-
function
|
|
2498
|
-
if (t && !(
|
|
2516
|
+
const It = new Zn(), Qn = ["cross-platform", "platform"];
|
|
2517
|
+
function Ot(t) {
|
|
2518
|
+
if (t && !(Qn.indexOf(t) < 0))
|
|
2499
2519
|
return t;
|
|
2500
2520
|
}
|
|
2501
|
-
async function
|
|
2521
|
+
async function eo(t) {
|
|
2502
2522
|
!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 });
|
|
2503
2523
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2504
|
-
if (!
|
|
2524
|
+
if (!qe())
|
|
2505
2525
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2506
2526
|
const n = {
|
|
2507
2527
|
...e,
|
|
2508
|
-
challenge:
|
|
2528
|
+
challenge: Re(e.challenge),
|
|
2509
2529
|
user: {
|
|
2510
2530
|
...e.user,
|
|
2511
|
-
id:
|
|
2531
|
+
id: Re(e.user.id)
|
|
2512
2532
|
},
|
|
2513
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2533
|
+
excludeCredentials: e.excludeCredentials?.map(kt)
|
|
2514
2534
|
}, o = {};
|
|
2515
|
-
r && (o.mediation = "conditional"), o.publicKey = n, o.signal =
|
|
2535
|
+
r && (o.mediation = "conditional"), o.publicKey = n, o.signal = It.createNewAbortSignal();
|
|
2516
2536
|
let s;
|
|
2517
2537
|
try {
|
|
2518
2538
|
s = await navigator.credentials.create(o);
|
|
2519
2539
|
} catch (y) {
|
|
2520
|
-
throw
|
|
2540
|
+
throw Xn({ error: y, options: o });
|
|
2521
2541
|
}
|
|
2522
2542
|
if (!s)
|
|
2523
2543
|
throw new Error("Registration was not completed");
|
|
2524
|
-
const { id: i, rawId: a, response: c, type:
|
|
2525
|
-
let
|
|
2526
|
-
typeof c.getTransports == "function" && (
|
|
2527
|
-
let
|
|
2544
|
+
const { id: i, rawId: a, response: c, type: d } = s;
|
|
2545
|
+
let f;
|
|
2546
|
+
typeof c.getTransports == "function" && (f = c.getTransports());
|
|
2547
|
+
let g;
|
|
2528
2548
|
if (typeof c.getPublicKeyAlgorithm == "function")
|
|
2529
2549
|
try {
|
|
2530
|
-
|
|
2550
|
+
g = c.getPublicKeyAlgorithm();
|
|
2531
2551
|
} catch (y) {
|
|
2532
|
-
|
|
2552
|
+
Pe("getPublicKeyAlgorithm()", y);
|
|
2533
2553
|
}
|
|
2534
2554
|
let u;
|
|
2535
2555
|
if (typeof c.getPublicKey == "function")
|
|
2536
2556
|
try {
|
|
2537
2557
|
const y = c.getPublicKey();
|
|
2538
|
-
y !== null && (u =
|
|
2558
|
+
y !== null && (u = J(y));
|
|
2539
2559
|
} catch (y) {
|
|
2540
|
-
|
|
2560
|
+
Pe("getPublicKey()", y);
|
|
2541
2561
|
}
|
|
2542
|
-
let
|
|
2562
|
+
let h;
|
|
2543
2563
|
if (typeof c.getAuthenticatorData == "function")
|
|
2544
2564
|
try {
|
|
2545
|
-
|
|
2565
|
+
h = J(c.getAuthenticatorData());
|
|
2546
2566
|
} catch (y) {
|
|
2547
|
-
|
|
2567
|
+
Pe("getAuthenticatorData()", y);
|
|
2548
2568
|
}
|
|
2549
2569
|
return {
|
|
2550
2570
|
id: i,
|
|
2551
|
-
rawId:
|
|
2571
|
+
rawId: J(a),
|
|
2552
2572
|
response: {
|
|
2553
|
-
attestationObject:
|
|
2554
|
-
clientDataJSON:
|
|
2555
|
-
transports:
|
|
2556
|
-
publicKeyAlgorithm:
|
|
2573
|
+
attestationObject: J(c.attestationObject),
|
|
2574
|
+
clientDataJSON: J(c.clientDataJSON),
|
|
2575
|
+
transports: f,
|
|
2576
|
+
publicKeyAlgorithm: g,
|
|
2557
2577
|
publicKey: u,
|
|
2558
|
-
authenticatorData:
|
|
2578
|
+
authenticatorData: h
|
|
2559
2579
|
},
|
|
2560
|
-
type:
|
|
2580
|
+
type: d,
|
|
2561
2581
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2562
|
-
authenticatorAttachment:
|
|
2582
|
+
authenticatorAttachment: Ot(s.authenticatorAttachment)
|
|
2563
2583
|
};
|
|
2564
2584
|
}
|
|
2565
|
-
function
|
|
2585
|
+
function Pe(t, e) {
|
|
2566
2586
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2567
2587
|
`, e);
|
|
2568
2588
|
}
|
|
2569
|
-
function
|
|
2570
|
-
if (!
|
|
2571
|
-
return
|
|
2589
|
+
function to() {
|
|
2590
|
+
if (!qe())
|
|
2591
|
+
return je.stubThis(new Promise((e) => e(!1)));
|
|
2572
2592
|
const t = globalThis.PublicKeyCredential;
|
|
2573
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2593
|
+
return t?.isConditionalMediationAvailable === void 0 ? je.stubThis(new Promise((e) => e(!1))) : je.stubThis(t.isConditionalMediationAvailable());
|
|
2574
2594
|
}
|
|
2575
|
-
const
|
|
2595
|
+
const je = {
|
|
2576
2596
|
stubThis: (t) => t
|
|
2577
2597
|
};
|
|
2578
|
-
function
|
|
2598
|
+
function ro({ error: t, options: e }) {
|
|
2579
2599
|
const { publicKey: r } = e;
|
|
2580
2600
|
if (!r)
|
|
2581
2601
|
throw Error("options was missing required publicKey property");
|
|
2582
2602
|
if (t.name === "AbortError") {
|
|
2583
2603
|
if (e.signal instanceof AbortSignal)
|
|
2584
|
-
return new
|
|
2604
|
+
return new j({
|
|
2585
2605
|
message: "Authentication ceremony was sent an abort signal",
|
|
2586
2606
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2587
2607
|
cause: t
|
|
2588
2608
|
});
|
|
2589
2609
|
} else {
|
|
2590
2610
|
if (t.name === "NotAllowedError")
|
|
2591
|
-
return new
|
|
2611
|
+
return new j({
|
|
2592
2612
|
message: t.message,
|
|
2593
2613
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2594
2614
|
cause: t
|
|
2595
2615
|
});
|
|
2596
2616
|
if (t.name === "SecurityError") {
|
|
2597
2617
|
const n = globalThis.location.hostname;
|
|
2598
|
-
if (
|
|
2618
|
+
if (Ct(n)) {
|
|
2599
2619
|
if (r.rpId !== n)
|
|
2600
|
-
return new
|
|
2620
|
+
return new j({
|
|
2601
2621
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
2602
2622
|
code: "ERROR_INVALID_RP_ID",
|
|
2603
2623
|
cause: t
|
|
2604
2624
|
});
|
|
2605
|
-
} else return new
|
|
2625
|
+
} else return new j({
|
|
2606
2626
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2607
2627
|
code: "ERROR_INVALID_DOMAIN",
|
|
2608
2628
|
cause: t
|
|
2609
2629
|
});
|
|
2610
2630
|
} else if (t.name === "UnknownError")
|
|
2611
|
-
return new
|
|
2631
|
+
return new j({
|
|
2612
2632
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
2613
2633
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2614
2634
|
cause: t
|
|
@@ -2616,91 +2636,91 @@ function Hn({ error: t, options: e }) {
|
|
|
2616
2636
|
}
|
|
2617
2637
|
return t;
|
|
2618
2638
|
}
|
|
2619
|
-
async function
|
|
2639
|
+
async function no(t) {
|
|
2620
2640
|
!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 });
|
|
2621
2641
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2622
|
-
if (!
|
|
2642
|
+
if (!qe())
|
|
2623
2643
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2624
2644
|
let o;
|
|
2625
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2645
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(kt));
|
|
2626
2646
|
const s = {
|
|
2627
2647
|
...e,
|
|
2628
|
-
challenge:
|
|
2648
|
+
challenge: Re(e.challenge),
|
|
2629
2649
|
allowCredentials: o
|
|
2630
2650
|
}, i = {};
|
|
2631
2651
|
if (r) {
|
|
2632
|
-
if (!await
|
|
2652
|
+
if (!await to())
|
|
2633
2653
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2634
2654
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2635
2655
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
2636
2656
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2637
2657
|
}
|
|
2638
|
-
i.publicKey = s, i.signal =
|
|
2658
|
+
i.publicKey = s, i.signal = It.createNewAbortSignal();
|
|
2639
2659
|
let a;
|
|
2640
2660
|
try {
|
|
2641
2661
|
a = await navigator.credentials.get(i);
|
|
2642
|
-
} catch (
|
|
2643
|
-
throw
|
|
2662
|
+
} catch (h) {
|
|
2663
|
+
throw ro({ error: h, options: i });
|
|
2644
2664
|
}
|
|
2645
2665
|
if (!a)
|
|
2646
2666
|
throw new Error("Authentication was not completed");
|
|
2647
|
-
const { id: c, rawId:
|
|
2667
|
+
const { id: c, rawId: d, response: f, type: g } = a;
|
|
2648
2668
|
let u;
|
|
2649
|
-
return
|
|
2669
|
+
return f.userHandle && (u = J(f.userHandle)), {
|
|
2650
2670
|
id: c,
|
|
2651
|
-
rawId:
|
|
2671
|
+
rawId: J(d),
|
|
2652
2672
|
response: {
|
|
2653
|
-
authenticatorData:
|
|
2654
|
-
clientDataJSON:
|
|
2655
|
-
signature:
|
|
2673
|
+
authenticatorData: J(f.authenticatorData),
|
|
2674
|
+
clientDataJSON: J(f.clientDataJSON),
|
|
2675
|
+
signature: J(f.signature),
|
|
2656
2676
|
userHandle: u
|
|
2657
2677
|
},
|
|
2658
|
-
type:
|
|
2678
|
+
type: g,
|
|
2659
2679
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2660
|
-
authenticatorAttachment:
|
|
2680
|
+
authenticatorAttachment: Ot(a.authenticatorAttachment)
|
|
2661
2681
|
};
|
|
2662
2682
|
}
|
|
2663
|
-
const
|
|
2664
|
-
function
|
|
2665
|
-
const [r, n] =
|
|
2683
|
+
const Ge = gt(null);
|
|
2684
|
+
function Eo({ children: t, config: e }) {
|
|
2685
|
+
const [r, n] = z({
|
|
2666
2686
|
isAuthenticated: !1,
|
|
2667
2687
|
isLoading: !0,
|
|
2668
2688
|
user: null,
|
|
2669
2689
|
error: null
|
|
2670
2690
|
});
|
|
2671
|
-
|
|
2691
|
+
M(() => {
|
|
2672
2692
|
(() => {
|
|
2673
|
-
const
|
|
2674
|
-
if (
|
|
2675
|
-
|
|
2693
|
+
const f = Wn();
|
|
2694
|
+
if (f) {
|
|
2695
|
+
pt(), n({
|
|
2676
2696
|
isAuthenticated: !1,
|
|
2677
2697
|
isLoading: !1,
|
|
2678
2698
|
user: null,
|
|
2679
|
-
error:
|
|
2699
|
+
error: f
|
|
2680
2700
|
});
|
|
2681
2701
|
return;
|
|
2682
2702
|
}
|
|
2683
|
-
const
|
|
2684
|
-
if (
|
|
2685
|
-
const
|
|
2686
|
-
token:
|
|
2687
|
-
provider:
|
|
2703
|
+
const g = Kn();
|
|
2704
|
+
if (g) {
|
|
2705
|
+
const h = {
|
|
2706
|
+
token: g.token,
|
|
2707
|
+
provider: g.provider,
|
|
2688
2708
|
authenticatedAt: Date.now()
|
|
2689
2709
|
};
|
|
2690
|
-
|
|
2710
|
+
Te(h), pt(), n({
|
|
2691
2711
|
isAuthenticated: !0,
|
|
2692
2712
|
isLoading: !1,
|
|
2693
|
-
user:
|
|
2713
|
+
user: fe(h),
|
|
2694
2714
|
error: null
|
|
2695
2715
|
});
|
|
2696
2716
|
return;
|
|
2697
2717
|
}
|
|
2698
|
-
const u =
|
|
2718
|
+
const u = Et();
|
|
2699
2719
|
if (u) {
|
|
2700
2720
|
n({
|
|
2701
2721
|
isAuthenticated: !0,
|
|
2702
2722
|
isLoading: !1,
|
|
2703
|
-
user:
|
|
2723
|
+
user: fe(u),
|
|
2704
2724
|
error: null
|
|
2705
2725
|
});
|
|
2706
2726
|
return;
|
|
@@ -2713,8 +2733,8 @@ function go({ children: t, config: e }) {
|
|
|
2713
2733
|
});
|
|
2714
2734
|
})();
|
|
2715
2735
|
}, []);
|
|
2716
|
-
const o =
|
|
2717
|
-
async (
|
|
2736
|
+
const o = D(
|
|
2737
|
+
async (d) => {
|
|
2718
2738
|
if (!e.spaceId) {
|
|
2719
2739
|
n((u) => ({
|
|
2720
2740
|
...u,
|
|
@@ -2722,78 +2742,78 @@ function go({ children: t, config: e }) {
|
|
|
2722
2742
|
}));
|
|
2723
2743
|
return;
|
|
2724
2744
|
}
|
|
2725
|
-
const
|
|
2726
|
-
if (
|
|
2745
|
+
const f = e.authUrl ?? Me();
|
|
2746
|
+
if (d === "guest") {
|
|
2727
2747
|
n((u) => ({ ...u, isLoading: !0 }));
|
|
2728
2748
|
try {
|
|
2729
|
-
const u = await
|
|
2749
|
+
const u = await Tt(e.spaceId, f);
|
|
2730
2750
|
n({
|
|
2731
2751
|
isAuthenticated: !0,
|
|
2732
2752
|
isLoading: !1,
|
|
2733
|
-
user:
|
|
2753
|
+
user: fe(u),
|
|
2734
2754
|
error: null
|
|
2735
2755
|
});
|
|
2736
2756
|
} catch (u) {
|
|
2737
|
-
n((
|
|
2738
|
-
...
|
|
2757
|
+
n((h) => ({
|
|
2758
|
+
...h,
|
|
2739
2759
|
isLoading: !1,
|
|
2740
2760
|
error: u instanceof Error ? u.message : "Guest login failed"
|
|
2741
2761
|
}));
|
|
2742
2762
|
}
|
|
2743
2763
|
return;
|
|
2744
2764
|
}
|
|
2745
|
-
if (
|
|
2765
|
+
if (d === "passkey") {
|
|
2746
2766
|
n((u) => ({ ...u, isLoading: !0, error: null }));
|
|
2747
2767
|
try {
|
|
2748
|
-
const u = await
|
|
2768
|
+
const u = await Gn(f), h = await no({ optionsJSON: u }), y = await Hn(f, h);
|
|
2749
2769
|
n({
|
|
2750
2770
|
isAuthenticated: !0,
|
|
2751
2771
|
isLoading: !1,
|
|
2752
|
-
user:
|
|
2772
|
+
user: fe(y),
|
|
2753
2773
|
error: null
|
|
2754
2774
|
});
|
|
2755
2775
|
} catch (u) {
|
|
2756
|
-
n((
|
|
2757
|
-
...
|
|
2776
|
+
n((h) => ({
|
|
2777
|
+
...h,
|
|
2758
2778
|
isLoading: !1,
|
|
2759
2779
|
error: u instanceof Error ? u.message : "Passkey login failed"
|
|
2760
2780
|
}));
|
|
2761
2781
|
}
|
|
2762
2782
|
return;
|
|
2763
2783
|
}
|
|
2764
|
-
const
|
|
2765
|
-
window.location.href =
|
|
2784
|
+
const g = Yn(d, e.spaceId, f);
|
|
2785
|
+
window.location.href = g;
|
|
2766
2786
|
},
|
|
2767
2787
|
[e.authUrl, e.spaceId]
|
|
2768
|
-
), s =
|
|
2769
|
-
|
|
2788
|
+
), s = D(() => {
|
|
2789
|
+
At(), n({
|
|
2770
2790
|
isAuthenticated: !1,
|
|
2771
2791
|
isLoading: !1,
|
|
2772
2792
|
user: null,
|
|
2773
2793
|
error: null
|
|
2774
2794
|
});
|
|
2775
|
-
}, []), i =
|
|
2776
|
-
async (
|
|
2777
|
-
const
|
|
2778
|
-
n((
|
|
2795
|
+
}, []), i = D(
|
|
2796
|
+
async (d) => {
|
|
2797
|
+
const f = e.authUrl ?? Me();
|
|
2798
|
+
n((g) => ({ ...g, isLoading: !0, error: null }));
|
|
2779
2799
|
try {
|
|
2780
|
-
const
|
|
2800
|
+
const g = await zn(f), u = await eo({ optionsJSON: g }), h = await qn(f, u, d);
|
|
2781
2801
|
n({
|
|
2782
2802
|
isAuthenticated: !0,
|
|
2783
2803
|
isLoading: !1,
|
|
2784
|
-
user:
|
|
2804
|
+
user: fe(h),
|
|
2785
2805
|
error: null
|
|
2786
2806
|
});
|
|
2787
|
-
} catch (
|
|
2807
|
+
} catch (g) {
|
|
2788
2808
|
n((u) => ({
|
|
2789
2809
|
...u,
|
|
2790
2810
|
isLoading: !1,
|
|
2791
|
-
error:
|
|
2811
|
+
error: g instanceof Error ? g.message : "Passkey registration failed"
|
|
2792
2812
|
}));
|
|
2793
2813
|
}
|
|
2794
2814
|
},
|
|
2795
2815
|
[e.authUrl]
|
|
2796
|
-
), a =
|
|
2816
|
+
), a = D(() => r.user?.token ?? null, [r.user]), c = W(
|
|
2797
2817
|
() => ({
|
|
2798
2818
|
state: r,
|
|
2799
2819
|
login: o,
|
|
@@ -2803,27 +2823,27 @@ function go({ children: t, config: e }) {
|
|
|
2803
2823
|
}),
|
|
2804
2824
|
[r, o, s, a, i]
|
|
2805
2825
|
);
|
|
2806
|
-
return /* @__PURE__ */
|
|
2826
|
+
return /* @__PURE__ */ E.jsx(Ge, { value: c, children: t });
|
|
2807
2827
|
}
|
|
2808
|
-
function
|
|
2809
|
-
const t =
|
|
2828
|
+
function oo() {
|
|
2829
|
+
const t = Ke(Ge);
|
|
2810
2830
|
if (!t)
|
|
2811
2831
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2812
2832
|
return t;
|
|
2813
2833
|
}
|
|
2814
|
-
function
|
|
2815
|
-
return
|
|
2834
|
+
function Ao() {
|
|
2835
|
+
return Ke(Ge);
|
|
2816
2836
|
}
|
|
2817
|
-
function
|
|
2818
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
2819
|
-
return
|
|
2837
|
+
function To(t) {
|
|
2838
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = oo(), s = w(!1);
|
|
2839
|
+
return M(() => {
|
|
2820
2840
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2821
2841
|
return;
|
|
2822
2842
|
const i = new URLSearchParams(window.location.search), a = i.get(r);
|
|
2823
2843
|
if (a === "true" || a === "1" || a === "") {
|
|
2824
2844
|
i.delete(r);
|
|
2825
|
-
const c = i.toString(),
|
|
2826
|
-
window.history.replaceState({}, "",
|
|
2845
|
+
const c = i.toString(), d = window.location.pathname + (c ? `?${c}` : "");
|
|
2846
|
+
window.history.replaceState({}, "", d), s.current = !0, o("guest");
|
|
2827
2847
|
}
|
|
2828
2848
|
}, [r, n.isAuthenticated, n.isLoading, e.methods, o]), {
|
|
2829
2849
|
shouldRenderChildren: n.isAuthenticated,
|
|
@@ -2832,7 +2852,7 @@ function So(t) {
|
|
|
2832
2852
|
error: n.error
|
|
2833
2853
|
};
|
|
2834
2854
|
}
|
|
2835
|
-
function
|
|
2855
|
+
function ko({
|
|
2836
2856
|
connectionState: t,
|
|
2837
2857
|
error: e,
|
|
2838
2858
|
isReady: r,
|
|
@@ -2842,9 +2862,9 @@ function bo({
|
|
|
2842
2862
|
onAction: i,
|
|
2843
2863
|
renderIdle: a,
|
|
2844
2864
|
renderConnecting: c,
|
|
2845
|
-
renderConnectingSlow:
|
|
2846
|
-
renderConnected:
|
|
2847
|
-
renderOffline:
|
|
2865
|
+
renderConnectingSlow: d,
|
|
2866
|
+
renderConnected: f,
|
|
2867
|
+
renderOffline: g,
|
|
2848
2868
|
renderError: u
|
|
2849
2869
|
}) {
|
|
2850
2870
|
switch (t) {
|
|
@@ -2853,10 +2873,10 @@ function bo({
|
|
|
2853
2873
|
case "connecting":
|
|
2854
2874
|
return c();
|
|
2855
2875
|
case "connectingSlow":
|
|
2856
|
-
return
|
|
2876
|
+
return d();
|
|
2857
2877
|
case "connected":
|
|
2858
2878
|
case "reconnecting":
|
|
2859
|
-
return !r || !n || !o ? null :
|
|
2879
|
+
return !r || !n || !o ? null : f({
|
|
2860
2880
|
stores: n,
|
|
2861
2881
|
registry: o,
|
|
2862
2882
|
client: s,
|
|
@@ -2864,169 +2884,173 @@ function bo({
|
|
|
2864
2884
|
isReconnecting: t === "reconnecting"
|
|
2865
2885
|
});
|
|
2866
2886
|
case "offline":
|
|
2867
|
-
return
|
|
2887
|
+
return g();
|
|
2868
2888
|
case "offlineError":
|
|
2869
2889
|
return u(e ?? s?.lastError?.message ?? null);
|
|
2870
2890
|
default:
|
|
2871
2891
|
return null;
|
|
2872
2892
|
}
|
|
2873
2893
|
}
|
|
2874
|
-
const
|
|
2875
|
-
function
|
|
2894
|
+
const Le = Ee("useIkonApp");
|
|
2895
|
+
function so() {
|
|
2876
2896
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2877
2897
|
return window.__IKON_AUTH_CONFIG__;
|
|
2878
2898
|
}
|
|
2879
|
-
function
|
|
2899
|
+
function io() {
|
|
2880
2900
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
2881
2901
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2882
2902
|
}
|
|
2883
|
-
function
|
|
2884
|
-
const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, timeouts: c, audio:
|
|
2885
|
-
|
|
2886
|
-
const [
|
|
2903
|
+
function Co(t) {
|
|
2904
|
+
const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, timeouts: c, audio: d, video: f, mediaSession: g, webRtc: u } = t, h = e === void 0 ? so() ?? null : e, y = r ?? io(), S = w(null), p = w(null), m = w(null), v = w(!1), A = w(d), _ = w(f), U = w(g), X = w(c), Q = w(i), k = w(a), N = w(s), L = w(u);
|
|
2905
|
+
A.current = d, _.current = f, U.current = g, X.current = c, Q.current = i, k.current = a, N.current = s, L.current = u;
|
|
2906
|
+
const [P, F] = z("idle"), [G, te] = z(null), [oe, me] = z(null), [pe, se] = z(null), [ge, l] = z(null), [b, T] = z(null), [C, H] = z(null), [$, re] = z(!1), x = W(() => {
|
|
2887
2907
|
try {
|
|
2888
|
-
const
|
|
2889
|
-
return (
|
|
2908
|
+
const O = Dt();
|
|
2909
|
+
return (O.sessionId || O.channelKey) && Ft(), O;
|
|
2890
2910
|
} catch {
|
|
2891
2911
|
return { parameters: {} };
|
|
2892
2912
|
}
|
|
2893
|
-
}, []),
|
|
2894
|
-
|
|
2895
|
-
!
|
|
2896
|
-
|
|
2897
|
-
}).catch((
|
|
2898
|
-
|
|
2913
|
+
}, []), I = W(() => h?.enabled ? Et() : null, [h?.enabled]), Y = y?.enabled ?? !1, ee = y?.host ?? "localhost", ie = y?.port ?? 8443;
|
|
2914
|
+
M(() => {
|
|
2915
|
+
!Y && He() && h && !h.enabled && h.spaceId && !C && !$ && (re(!0), Tt(h.spaceId, h.authUrl ?? Me()).then((V) => {
|
|
2916
|
+
H(V.token);
|
|
2917
|
+
}).catch((V) => {
|
|
2918
|
+
Le.error("Anonymous auth failed:", V), te(V instanceof Error ? V.message : "Anonymous auth failed");
|
|
2899
2919
|
}).finally(() => {
|
|
2900
2920
|
re(!1);
|
|
2901
2921
|
}));
|
|
2902
|
-
}, [
|
|
2903
|
-
const
|
|
2904
|
-
if (
|
|
2905
|
-
const
|
|
2922
|
+
}, [Y, h, C, $]);
|
|
2923
|
+
const ke = W(() => {
|
|
2924
|
+
if (Y) {
|
|
2925
|
+
const O = I?.token ? Bt(I.token) ?? be() : be();
|
|
2906
2926
|
return {
|
|
2907
2927
|
local: {
|
|
2908
|
-
host:
|
|
2909
|
-
httpsPort:
|
|
2910
|
-
userId:
|
|
2911
|
-
parameters:
|
|
2928
|
+
host: ee,
|
|
2929
|
+
httpsPort: ie,
|
|
2930
|
+
userId: O,
|
|
2931
|
+
parameters: x.parameters
|
|
2912
2932
|
}
|
|
2913
2933
|
};
|
|
2914
2934
|
}
|
|
2915
|
-
return
|
|
2935
|
+
return I?.token && h?.spaceId ? {
|
|
2916
2936
|
sessionToken: {
|
|
2917
|
-
token:
|
|
2918
|
-
spaceId:
|
|
2919
|
-
backendType:
|
|
2920
|
-
sessionId:
|
|
2921
|
-
channelKey:
|
|
2922
|
-
parameters:
|
|
2937
|
+
token: I.token,
|
|
2938
|
+
spaceId: h.spaceId,
|
|
2939
|
+
backendType: Je(),
|
|
2940
|
+
sessionId: x.sessionId,
|
|
2941
|
+
channelKey: x.channelKey,
|
|
2942
|
+
parameters: x.parameters
|
|
2923
2943
|
}
|
|
2924
|
-
} :
|
|
2944
|
+
} : C && h?.spaceId ? {
|
|
2925
2945
|
sessionToken: {
|
|
2926
|
-
token:
|
|
2927
|
-
spaceId:
|
|
2928
|
-
backendType:
|
|
2929
|
-
sessionId:
|
|
2930
|
-
channelKey:
|
|
2931
|
-
parameters:
|
|
2946
|
+
token: C,
|
|
2947
|
+
spaceId: h.spaceId,
|
|
2948
|
+
backendType: Je(),
|
|
2949
|
+
sessionId: x.sessionId,
|
|
2950
|
+
channelKey: x.channelKey,
|
|
2951
|
+
parameters: x.parameters
|
|
2932
2952
|
}
|
|
2933
|
-
} :
|
|
2953
|
+
} : He() ? null : {
|
|
2934
2954
|
local: {
|
|
2935
|
-
host:
|
|
2936
|
-
httpsPort:
|
|
2937
|
-
userId:
|
|
2938
|
-
parameters:
|
|
2955
|
+
host: ee,
|
|
2956
|
+
httpsPort: ie,
|
|
2957
|
+
userId: be(),
|
|
2958
|
+
parameters: x.parameters
|
|
2939
2959
|
}
|
|
2940
2960
|
};
|
|
2941
|
-
}, [
|
|
2942
|
-
|
|
2943
|
-
const
|
|
2944
|
-
|
|
2945
|
-
if (!
|
|
2946
|
-
if (
|
|
2947
|
-
for (const
|
|
2948
|
-
|
|
2949
|
-
o?.(m.current), m.current.loadRegisteredModules().catch((
|
|
2950
|
-
|
|
2961
|
+
}, [Y, ee, ie, I?.token, h?.spaceId, C, x.sessionId, x.channelKey, x.parameters]);
|
|
2962
|
+
Zr(oe);
|
|
2963
|
+
const Nt = en(oe);
|
|
2964
|
+
M(() => {
|
|
2965
|
+
if (!v.current) {
|
|
2966
|
+
if (v.current = !0, m.current = Wr(), n)
|
|
2967
|
+
for (const O of n)
|
|
2968
|
+
O(m.current);
|
|
2969
|
+
o?.(m.current), m.current.loadRegisteredModules().catch((O) => {
|
|
2970
|
+
Le.error("Failed to load UI modules", O);
|
|
2951
2971
|
});
|
|
2952
2972
|
}
|
|
2953
|
-
}, []),
|
|
2954
|
-
if (!
|
|
2955
|
-
const
|
|
2956
|
-
...
|
|
2957
|
-
timeouts:
|
|
2958
|
-
audio:
|
|
2959
|
-
video:
|
|
2960
|
-
mediaSession:
|
|
2961
|
-
|
|
2962
|
-
|
|
2973
|
+
}, []), M(() => {
|
|
2974
|
+
if (!ke) return;
|
|
2975
|
+
const O = new $t({
|
|
2976
|
+
...ke,
|
|
2977
|
+
timeouts: X.current,
|
|
2978
|
+
audio: A.current,
|
|
2979
|
+
video: _.current,
|
|
2980
|
+
mediaSession: U.current,
|
|
2981
|
+
webRtc: L.current ? { enabled: !0 } : void 0,
|
|
2982
|
+
onConnectionStateChange: (K) => {
|
|
2983
|
+
F(K), Q.current?.(K), L.current && K === "connected" && (se(O.webRtcAudioStream), l(O.webRtcVideoStream), T(O.webRtcScreenStream));
|
|
2963
2984
|
},
|
|
2964
|
-
onError: (
|
|
2965
|
-
|
|
2985
|
+
onError: (K) => {
|
|
2986
|
+
te(K.message), k.current?.(K);
|
|
2966
2987
|
},
|
|
2967
2988
|
onJoined: () => {
|
|
2968
|
-
const
|
|
2969
|
-
|
|
2989
|
+
const K = O.globalState?.SessionId;
|
|
2990
|
+
N.current?.(K);
|
|
2970
2991
|
}
|
|
2971
2992
|
});
|
|
2972
|
-
|
|
2973
|
-
const
|
|
2974
|
-
return
|
|
2975
|
-
|
|
2993
|
+
S.current = O;
|
|
2994
|
+
const V = new sr({ client: O });
|
|
2995
|
+
return p.current = V, me(V), O.connect().catch((K) => {
|
|
2996
|
+
Le.error("Connection failed:", K);
|
|
2976
2997
|
}), () => {
|
|
2977
|
-
|
|
2998
|
+
O.disconnect(), S.current = null, V.dispose(), p.current = null, se(null), l(null), T(null);
|
|
2978
2999
|
};
|
|
2979
|
-
}, [
|
|
2980
|
-
const
|
|
2981
|
-
const
|
|
2982
|
-
|
|
2983
|
-
}, []),
|
|
3000
|
+
}, [ke]);
|
|
3001
|
+
const Pt = D((O, V) => {
|
|
3002
|
+
const K = typeof V == "string" ? V : JSON.stringify(V ?? {});
|
|
3003
|
+
S.current?.sendActionCall(O, K);
|
|
3004
|
+
}, []), jt = P === "connected" || P === "reconnecting";
|
|
2984
3005
|
return {
|
|
2985
|
-
connectionState:
|
|
2986
|
-
error:
|
|
2987
|
-
stores:
|
|
2988
|
-
client:
|
|
3006
|
+
connectionState: P,
|
|
3007
|
+
error: G,
|
|
3008
|
+
stores: Nt,
|
|
3009
|
+
client: S.current,
|
|
2989
3010
|
registry: m.current,
|
|
2990
|
-
clientRef:
|
|
2991
|
-
uiRef:
|
|
3011
|
+
clientRef: S,
|
|
3012
|
+
uiRef: p,
|
|
2992
3013
|
registryRef: m,
|
|
2993
|
-
onAction:
|
|
2994
|
-
isReady:
|
|
3014
|
+
onAction: Pt,
|
|
3015
|
+
isReady: jt,
|
|
3016
|
+
webRtcAudioStream: pe,
|
|
3017
|
+
webRtcVideoStream: ge,
|
|
3018
|
+
webRtcScreenStream: b
|
|
2995
3019
|
};
|
|
2996
3020
|
}
|
|
2997
|
-
function
|
|
2998
|
-
const e =
|
|
2999
|
-
return
|
|
3021
|
+
function Io(t) {
|
|
3022
|
+
const e = w(!1);
|
|
3023
|
+
return D(() => {
|
|
3000
3024
|
if (e.current) return;
|
|
3001
3025
|
e.current = !0;
|
|
3002
3026
|
const r = document.createElement("link");
|
|
3003
3027
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
3004
3028
|
}, [t]);
|
|
3005
3029
|
}
|
|
3006
|
-
let
|
|
3007
|
-
function
|
|
3008
|
-
const [r, n] =
|
|
3030
|
+
let ao = 0;
|
|
3031
|
+
function Oo(t = 5, e = 5e3) {
|
|
3032
|
+
const [r, n] = z([]), o = w(/* @__PURE__ */ new Map()), s = D((i) => {
|
|
3009
3033
|
const a = o.current.get(i);
|
|
3010
|
-
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((
|
|
3034
|
+
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((d) => d.id !== i));
|
|
3011
3035
|
}, []);
|
|
3012
|
-
return
|
|
3013
|
-
const i = o.current, a =
|
|
3036
|
+
return M(() => {
|
|
3037
|
+
const i = o.current, a = Vt(
|
|
3014
3038
|
(c) => {
|
|
3015
|
-
if (!
|
|
3039
|
+
if (!Kt())
|
|
3016
3040
|
return;
|
|
3017
|
-
const
|
|
3018
|
-
id:
|
|
3019
|
-
level:
|
|
3041
|
+
const d = `toast-${++ao}`, f = c.level === Xe.ERROR ? "error" : "warn", g = {
|
|
3042
|
+
id: d,
|
|
3043
|
+
level: f,
|
|
3020
3044
|
message: c.message,
|
|
3021
3045
|
component: c.component
|
|
3022
3046
|
};
|
|
3023
|
-
n((
|
|
3047
|
+
n((h) => [...h, g].slice(-t));
|
|
3024
3048
|
const u = setTimeout(() => {
|
|
3025
|
-
s(
|
|
3049
|
+
s(d);
|
|
3026
3050
|
}, e);
|
|
3027
|
-
i.set(
|
|
3051
|
+
i.set(d, u);
|
|
3028
3052
|
},
|
|
3029
|
-
{ minLevel:
|
|
3053
|
+
{ minLevel: Xe.WARN }
|
|
3030
3054
|
);
|
|
3031
3055
|
return () => {
|
|
3032
3056
|
a();
|
|
@@ -3036,100 +3060,100 @@ function Ro(t = 5, e = 5e3) {
|
|
|
3036
3060
|
};
|
|
3037
3061
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
3038
3062
|
}
|
|
3039
|
-
const
|
|
3040
|
-
function
|
|
3063
|
+
const _t = gt(null);
|
|
3064
|
+
function co(t, e) {
|
|
3041
3065
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
3042
3066
|
}
|
|
3043
|
-
function
|
|
3067
|
+
function uo(t, e) {
|
|
3044
3068
|
const n = new URLSearchParams(window.location.search).get("lang");
|
|
3045
3069
|
if (n && t.includes(n))
|
|
3046
3070
|
return n;
|
|
3047
3071
|
const o = navigator.language.split("-")[0];
|
|
3048
3072
|
return t.includes(o) ? o : e && t.includes(e) ? e : "en";
|
|
3049
3073
|
}
|
|
3050
|
-
function
|
|
3051
|
-
return e ?
|
|
3074
|
+
function lo(t, e, r) {
|
|
3075
|
+
return e ? uo(t, r) : r && t.includes(r) ? r : "en";
|
|
3052
3076
|
}
|
|
3053
|
-
function
|
|
3077
|
+
function _o({
|
|
3054
3078
|
children: t,
|
|
3055
3079
|
translations: e,
|
|
3056
3080
|
defaultLanguage: r,
|
|
3057
3081
|
detectLanguage: n = !1
|
|
3058
3082
|
}) {
|
|
3059
|
-
const o = Object.keys(e), s =
|
|
3083
|
+
const o = Object.keys(e), s = lo(o, n, r), i = e[s] ?? e.en, a = W(
|
|
3060
3084
|
() => ({
|
|
3061
|
-
t: (c,
|
|
3062
|
-
const
|
|
3063
|
-
return
|
|
3085
|
+
t: (c, d) => {
|
|
3086
|
+
const f = i[c];
|
|
3087
|
+
return co(f, d);
|
|
3064
3088
|
},
|
|
3065
3089
|
locale: s,
|
|
3066
3090
|
translations: i
|
|
3067
3091
|
}),
|
|
3068
3092
|
[i, s]
|
|
3069
3093
|
);
|
|
3070
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ E.jsx(_t, { value: a, children: t });
|
|
3071
3095
|
}
|
|
3072
|
-
function
|
|
3073
|
-
const t =
|
|
3096
|
+
function No() {
|
|
3097
|
+
const t = Ke(_t);
|
|
3074
3098
|
if (!t)
|
|
3075
3099
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3076
3100
|
return t;
|
|
3077
3101
|
}
|
|
3078
3102
|
export {
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3103
|
+
Eo as AuthProvider,
|
|
3104
|
+
ko as ConnectionStateRenderer,
|
|
3105
|
+
_o as I18nProvider,
|
|
3106
|
+
hr as IKON_UI_BASE_MODULE,
|
|
3107
|
+
Tr as IKON_UI_MEDIA_MODULE,
|
|
3108
|
+
Br as IKON_UI_SHADER_MODULE,
|
|
3109
|
+
Dr as IKON_UI_SHADER_TYPE,
|
|
3110
|
+
xe as IKON_UI_STREAM_CATEGORY,
|
|
3111
|
+
wr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3112
|
+
vr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3113
|
+
sr as IkonUi,
|
|
3114
|
+
Kr as IkonUiRegistry,
|
|
3115
|
+
yo as IkonUiSurface,
|
|
3116
|
+
nr as UiComponentRegistry,
|
|
3117
|
+
rr as UiRenderer,
|
|
3118
|
+
Lo as UiStreamStore,
|
|
3119
|
+
So as areIkonUiModuleListsEqual,
|
|
3120
|
+
Tt as authenticateAnonymous,
|
|
3121
|
+
Yn as buildOAuthRedirectUrl,
|
|
3122
|
+
At as clearAuthSession,
|
|
3123
|
+
pt as clearOAuthParams,
|
|
3124
|
+
fr as createBaseResolvers,
|
|
3125
|
+
po as createComponentLibrary,
|
|
3126
|
+
Wr as createIkonUiRegistry,
|
|
3127
|
+
Er as createMediaResolvers,
|
|
3128
|
+
Fr as createShaderRendererResolver,
|
|
3129
|
+
or as isIkonUiCategoryMatch,
|
|
3130
|
+
Et as loadAuthSession,
|
|
3131
|
+
mr as loadBaseModule,
|
|
3132
|
+
kr as loadMediaModule,
|
|
3133
|
+
$r as loadShaderModule,
|
|
3134
|
+
Sn as normalizeIkonUiModuleList,
|
|
3135
|
+
wo as parseIkonUiInitPayload,
|
|
3136
|
+
Kn as parseOAuthCallback,
|
|
3137
|
+
Wn as parseOAuthError,
|
|
3138
|
+
bn as readIkonUiModules,
|
|
3139
|
+
bo as readIkonUiModulesFromSources,
|
|
3140
|
+
pr as registerBaseModule,
|
|
3141
|
+
Cr as registerMediaModule,
|
|
3142
|
+
Vr as registerShaderModule,
|
|
3143
|
+
er as renderChildren,
|
|
3144
|
+
vo as renderMotionLetters,
|
|
3145
|
+
Te as saveAuthSession,
|
|
3146
|
+
Ro as sendMagicLink,
|
|
3147
|
+
fe as sessionToUser,
|
|
3148
|
+
oo as useAuth,
|
|
3149
|
+
To as useAuthGuard,
|
|
3150
|
+
Ao as useAuthOptional,
|
|
3151
|
+
No as useI18n,
|
|
3152
|
+
Co as useIkonApp,
|
|
3153
|
+
Zr as useIkonStyles,
|
|
3154
|
+
en as useIkonUiStores,
|
|
3155
|
+
Io as useLazyFont,
|
|
3156
|
+
Oo as useToasts,
|
|
3157
|
+
Z as useUiNode,
|
|
3158
|
+
go as useUiStore
|
|
3135
3159
|
};
|