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