@ikonai/sdk-react-ui 1.0.57 → 1.0.59
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/connection-state-renderer.d.ts +23 -8
- package/app/ikon-app.d.ts +55 -0
- package/app/index.d.ts +2 -0
- package/app/use-ikon-app.d.ts +6 -0
- package/app/use-ikon-debug.d.ts +41 -0
- package/index.d.ts +1 -1
- package/index.js +1539 -1402
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
5
|
-
var Se = { exports: {} },
|
|
1
|
+
import { IkonUiCore as Vt, UiStreamStore as Kt } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as ws } from "@ikonai/sdk-ui";
|
|
3
|
+
import Yt, { useSyncExternalStore as Ye, useMemo as K, memo as z, useRef as E, useCallback as D, Fragment as zt, useEffect as C, useState as j, use as ze, createContext as bt } from "react";
|
|
4
|
+
import { createLogger as re, isInspectModeEnabled as Wt, getOrCreateDeviceId as Ht, deriveAuthUrl as he, parseUrlParams as qt, clearSessionParamsFromUrl as Gt, isCloudEnvironment as Xe, extractUserIdFromToken as Jt, deriveBackendType as Ze, IkonClient as Xt, AccessDeniedError as Zt, AuthenticationError as Qt, subscribeToLogEvents as en, isDebugModeEnabled as St, LogLevel as Qe, getLangParam as tn } from "@ikonai/sdk";
|
|
5
|
+
var Se = { exports: {} }, ce = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -12,12 +12,12 @@ var Se = { 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 et;
|
|
16
|
+
function nn() {
|
|
17
|
+
if (et) return ce;
|
|
18
|
+
et = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
|
-
function r
|
|
20
|
+
function n(r, o, s) {
|
|
21
21
|
var i = null;
|
|
22
22
|
if (s !== void 0 && (i = "" + s), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
23
23
|
s = {};
|
|
@@ -26,15 +26,15 @@ function Qt() {
|
|
|
26
26
|
} else s = o;
|
|
27
27
|
return o = s.ref, {
|
|
28
28
|
$$typeof: t,
|
|
29
|
-
type:
|
|
29
|
+
type: r,
|
|
30
30
|
key: i,
|
|
31
31
|
ref: o !== void 0 ? o : null,
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return ce.Fragment = e, ce.jsx = n, ce.jsxs = n, ce;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ue = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -44,13 +44,13 @@ 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 tt;
|
|
48
|
+
function rn() {
|
|
49
|
+
return tt || (tt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
50
50
|
function t(d) {
|
|
51
51
|
if (d == null) return null;
|
|
52
52
|
if (typeof d == "function")
|
|
53
|
-
return d.$$typeof ===
|
|
53
|
+
return d.$$typeof === L ? null : d.displayName || d.name || null;
|
|
54
54
|
if (typeof d == "string") return d;
|
|
55
55
|
switch (d) {
|
|
56
56
|
case g:
|
|
@@ -59,32 +59,32 @@ function er() {
|
|
|
59
59
|
return "Profiler";
|
|
60
60
|
case b:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case x:
|
|
63
63
|
return "Suspense";
|
|
64
64
|
case G:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case F:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
69
|
if (typeof d == "object")
|
|
70
70
|
switch (typeof d.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
72
|
), d.$$typeof) {
|
|
73
|
-
case
|
|
73
|
+
case f:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case
|
|
75
|
+
case I:
|
|
76
76
|
return d.displayName || "Context";
|
|
77
77
|
case O:
|
|
78
78
|
return (d._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case P:
|
|
80
|
-
var w = d.render;
|
|
81
|
-
return d = d.displayName, d || (d = w.displayName || w.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
82
|
-
case I:
|
|
83
|
-
return w = d.displayName || null, w !== null ? w : t(d.type) || "Memo";
|
|
84
79
|
case M:
|
|
85
|
-
|
|
80
|
+
var v = d.render;
|
|
81
|
+
return d = d.displayName, d || (d = v.displayName || v.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
82
|
+
case _:
|
|
83
|
+
return v = d.displayName || null, v !== null ? v : t(d.type) || "Memo";
|
|
84
|
+
case P:
|
|
85
|
+
v = d._payload, d = d._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(d(
|
|
87
|
+
return t(d(v));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -93,30 +93,30 @@ function er() {
|
|
|
93
93
|
function e(d) {
|
|
94
94
|
return "" + d;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function n(d) {
|
|
97
97
|
try {
|
|
98
98
|
e(d);
|
|
99
|
-
var
|
|
99
|
+
var v = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
v = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
103
|
+
if (v) {
|
|
104
|
+
v = console;
|
|
105
|
+
var k = v.error, N = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
|
|
106
|
+
return k.call(
|
|
107
|
+
v,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
109
|
+
N
|
|
110
110
|
), e(d);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function r(d) {
|
|
114
114
|
if (d === g) return "<>";
|
|
115
|
-
if (typeof d == "object" && d !== null && d.$$typeof ===
|
|
115
|
+
if (typeof d == "object" && d !== null && d.$$typeof === P)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var v = t(d);
|
|
119
|
+
return v ? "<" + v + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
@@ -129,39 +129,39 @@ function er() {
|
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
131
|
function i(d) {
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
132
|
+
if (Y.call(d, "key")) {
|
|
133
|
+
var v = Object.getOwnPropertyDescriptor(d, "key").get;
|
|
134
|
+
if (v && v.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
136
|
return d.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function a(d,
|
|
139
|
-
function
|
|
140
|
-
|
|
138
|
+
function a(d, v) {
|
|
139
|
+
function k() {
|
|
140
|
+
se || (se = !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
|
+
v
|
|
143
143
|
));
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
get:
|
|
145
|
+
k.isReactWarning = !0, Object.defineProperty(d, "key", {
|
|
146
|
+
get: k,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
function u() {
|
|
151
151
|
var d = t(this.type);
|
|
152
|
-
return
|
|
152
|
+
return ge[d] || (ge[d] = !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
|
)), d = this.props.ref, d !== void 0 ? d : null;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
var
|
|
156
|
+
function h(d, v, k, N, Q, $) {
|
|
157
|
+
var A = k.ref;
|
|
158
158
|
return d = {
|
|
159
159
|
$$typeof: l,
|
|
160
160
|
type: d,
|
|
161
|
-
key:
|
|
162
|
-
props:
|
|
163
|
-
_owner:
|
|
164
|
-
}, (
|
|
161
|
+
key: v,
|
|
162
|
+
props: k,
|
|
163
|
+
_owner: N
|
|
164
|
+
}, (A !== void 0 ? A : null) !== null ? Object.defineProperty(d, "ref", {
|
|
165
165
|
enumerable: !1,
|
|
166
166
|
get: u
|
|
167
167
|
}) : Object.defineProperty(d, "ref", { enumerable: !1, value: null }), d._store = {}, Object.defineProperty(d._store, "validated", {
|
|
@@ -178,69 +178,69 @@ function er() {
|
|
|
178
178
|
configurable: !1,
|
|
179
179
|
enumerable: !1,
|
|
180
180
|
writable: !0,
|
|
181
|
-
value:
|
|
181
|
+
value: Q
|
|
182
182
|
}), Object.defineProperty(d, "_debugTask", {
|
|
183
183
|
configurable: !1,
|
|
184
184
|
enumerable: !1,
|
|
185
185
|
writable: !0,
|
|
186
|
-
value:
|
|
186
|
+
value: $
|
|
187
187
|
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
var
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
for (
|
|
195
|
-
|
|
196
|
-
Object.freeze && Object.freeze(
|
|
189
|
+
function p(d, v, k, N, Q, $) {
|
|
190
|
+
var A = v.children;
|
|
191
|
+
if (A !== void 0)
|
|
192
|
+
if (N)
|
|
193
|
+
if (me(A)) {
|
|
194
|
+
for (N = 0; N < A.length; N++)
|
|
195
|
+
m(A[N]);
|
|
196
|
+
Object.freeze && Object.freeze(A);
|
|
197
197
|
} else
|
|
198
198
|
console.error(
|
|
199
199
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
200
200
|
);
|
|
201
|
-
else
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
var W = Object.keys(
|
|
205
|
-
return
|
|
201
|
+
else m(A);
|
|
202
|
+
if (Y.call(v, "key")) {
|
|
203
|
+
A = t(d);
|
|
204
|
+
var W = Object.keys(v).filter(function(ae) {
|
|
205
|
+
return ae !== "key";
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
N = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", be[A + N] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
208
208
|
`A props object containing a "key" prop is being spread into JSX:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s {...props} />
|
|
211
211
|
React keys must be passed directly to JSX without using spread:
|
|
212
212
|
let props = %s;
|
|
213
213
|
<%s key={someKey} {...props} />`,
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
N,
|
|
215
|
+
A,
|
|
216
216
|
W,
|
|
217
|
-
|
|
218
|
-
),
|
|
217
|
+
A
|
|
218
|
+
), be[A + N] = !0);
|
|
219
219
|
}
|
|
220
|
-
if (
|
|
221
|
-
|
|
222
|
-
for (var
|
|
223
|
-
|
|
224
|
-
} else
|
|
225
|
-
return
|
|
226
|
-
|
|
220
|
+
if (A = null, k !== void 0 && (n(k), A = "" + k), i(v) && (n(v.key), A = "" + v.key), "key" in v) {
|
|
221
|
+
k = {};
|
|
222
|
+
for (var Z in v)
|
|
223
|
+
Z !== "key" && (k[Z] = v[Z]);
|
|
224
|
+
} else k = v;
|
|
225
|
+
return A && a(
|
|
226
|
+
k,
|
|
227
227
|
typeof d == "function" ? d.displayName || d.name || "Unknown" : d
|
|
228
|
-
),
|
|
228
|
+
), h(
|
|
229
229
|
d,
|
|
230
|
-
_,
|
|
231
230
|
A,
|
|
231
|
+
k,
|
|
232
232
|
o(),
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
Q,
|
|
234
|
+
$
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
y(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof ===
|
|
237
|
+
function m(d) {
|
|
238
|
+
y(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof === P && (d._payload.status === "fulfilled" ? y(d._payload.value) && d._payload.value._store && (d._payload.value._store.validated = 1) : d._store && (d._store.validated = 1));
|
|
239
239
|
}
|
|
240
240
|
function y(d) {
|
|
241
241
|
return typeof d == "object" && d !== null && d.$$typeof === l;
|
|
242
242
|
}
|
|
243
|
-
var c =
|
|
243
|
+
var c = Yt, l = Symbol.for("react.transitional.element"), f = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), O = Symbol.for("react.consumer"), I = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), F = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), B = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, me = Array.isArray, oe = console.createTask ? console.createTask : function() {
|
|
244
244
|
return null;
|
|
245
245
|
};
|
|
246
246
|
c = {
|
|
@@ -248,68 +248,68 @@ React keys must be passed directly to JSX without using spread:
|
|
|
248
248
|
return d();
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
var
|
|
251
|
+
var se, ge = {}, ye = c.react_stack_bottom_frame.bind(
|
|
252
252
|
c,
|
|
253
253
|
s
|
|
254
|
-
)(),
|
|
255
|
-
|
|
256
|
-
var
|
|
257
|
-
return
|
|
254
|
+
)(), ie = oe(r(s)), be = {};
|
|
255
|
+
ue.Fragment = g, ue.jsx = function(d, v, k) {
|
|
256
|
+
var N = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
257
|
+
return p(
|
|
258
258
|
d,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
v,
|
|
260
|
+
k,
|
|
261
261
|
!1,
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
N ? Error("react-stack-top-frame") : ye,
|
|
263
|
+
N ? oe(r(d)) : ie
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
267
|
-
return
|
|
265
|
+
}, ue.jsxs = function(d, v, k) {
|
|
266
|
+
var N = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
267
|
+
return p(
|
|
268
268
|
d,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
v,
|
|
270
|
+
k,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
N ? Error("react-stack-top-frame") : ye,
|
|
273
|
+
N ? oe(r(d)) : ie
|
|
274
274
|
);
|
|
275
275
|
};
|
|
276
|
-
})()),
|
|
276
|
+
})()), ue;
|
|
277
277
|
}
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
return
|
|
278
|
+
var nt;
|
|
279
|
+
function on() {
|
|
280
|
+
return nt || (nt = 1, process.env.NODE_ENV === "production" ? Se.exports = nn() : Se.exports = rn()), Se.exports;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
283
|
-
function
|
|
284
|
-
const
|
|
285
|
-
(
|
|
282
|
+
var w = on();
|
|
283
|
+
function sn(t, e) {
|
|
284
|
+
const n = Ye(
|
|
285
|
+
(r) => t.subscribe(r),
|
|
286
286
|
() => {
|
|
287
|
-
const
|
|
287
|
+
const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
|
|
288
288
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
289
289
|
},
|
|
290
290
|
() => {
|
|
291
|
-
const
|
|
291
|
+
const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
|
|
292
292
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
293
293
|
}
|
|
294
294
|
);
|
|
295
|
-
return
|
|
296
|
-
const [
|
|
295
|
+
return K(() => {
|
|
296
|
+
const [r, o] = n.split(":");
|
|
297
297
|
return {
|
|
298
|
-
rootViewId:
|
|
298
|
+
rootViewId: r || void 0,
|
|
299
299
|
rootNodeId: o || void 0
|
|
300
300
|
};
|
|
301
|
-
}, [
|
|
301
|
+
}, [n]);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
const
|
|
305
|
-
(
|
|
303
|
+
function X(t, e) {
|
|
304
|
+
const n = Ye(
|
|
305
|
+
(r) => t.subscribeNode(e, r),
|
|
306
306
|
() => t.getNodeVersion(e),
|
|
307
307
|
() => t.getNodeVersion(e)
|
|
308
308
|
);
|
|
309
|
-
return
|
|
309
|
+
return K(() => t.getNode(e), [t, e, n]);
|
|
310
310
|
}
|
|
311
|
-
const
|
|
312
|
-
function
|
|
311
|
+
const an = re("UIRenderer");
|
|
312
|
+
function cn(t) {
|
|
313
313
|
if (t === void 0)
|
|
314
314
|
return "{}";
|
|
315
315
|
if (typeof t == "string")
|
|
@@ -320,93 +320,93 @@ function or(t) {
|
|
|
320
320
|
return "{}";
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function un(t) {
|
|
324
324
|
const e = t.styleIds;
|
|
325
325
|
return Array.isArray(e) ? e : [];
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function ln(t) {
|
|
328
328
|
const e = t.children;
|
|
329
329
|
return Array.isArray(e) ? e : [];
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function dn(t, e) {
|
|
332
332
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function fn(t) {
|
|
335
335
|
if (t.length === 0) return "";
|
|
336
336
|
if (t.length === 1) return t[0].id;
|
|
337
337
|
let e = t[0].id;
|
|
338
|
-
for (let
|
|
339
|
-
e += "," + t[
|
|
338
|
+
for (let n = 1; n < t.length; n++)
|
|
339
|
+
e += "," + t[n].id;
|
|
340
340
|
return e;
|
|
341
341
|
}
|
|
342
|
-
const
|
|
343
|
-
const
|
|
344
|
-
() => o.length === 0 ? null : o.map((
|
|
342
|
+
const Ue = z(function t({ nodeId: e, context: n }) {
|
|
343
|
+
const r = X(n.store, e), o = r ? ln(r) : [], s = fn(o), i = K(
|
|
344
|
+
() => o.length === 0 ? null : o.map((m) => /* @__PURE__ */ w.jsx(t, { nodeId: m.id, context: n }, m.id)),
|
|
345
345
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
346
|
-
[s,
|
|
346
|
+
[s, n]
|
|
347
347
|
);
|
|
348
|
-
if (!
|
|
348
|
+
if (!r)
|
|
349
349
|
return null;
|
|
350
|
-
if (
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
const a =
|
|
350
|
+
if (r.type === "root")
|
|
351
|
+
return /* @__PURE__ */ w.jsx(zt, { children: i }, r.id);
|
|
352
|
+
const a = n.library.resolve(r);
|
|
353
353
|
if (!a)
|
|
354
|
-
return
|
|
355
|
-
const u =
|
|
356
|
-
return /* @__PURE__ */
|
|
357
|
-
},
|
|
358
|
-
function
|
|
359
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((
|
|
360
|
-
}
|
|
361
|
-
function
|
|
354
|
+
return an.warn(`No renderer for node type ${r.type}`), null;
|
|
355
|
+
const u = un(r), h = u.length > 0 ? u.join(" ") : void 0, p = a;
|
|
356
|
+
return /* @__PURE__ */ w.jsx(p, { nodeId: e, context: n, className: h });
|
|
357
|
+
}, dn);
|
|
358
|
+
function hn(t, e) {
|
|
359
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ w.jsx(Ue, { nodeId: n.id, context: e }, n.id));
|
|
360
|
+
}
|
|
361
|
+
function pn(t, e) {
|
|
362
362
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
365
|
-
const { rootViewId: u, rootNodeId:
|
|
366
|
-
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
const y =
|
|
364
|
+
const mn = z(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
365
|
+
const { rootViewId: u, rootNodeId: h } = sn(e, r), p = E(s);
|
|
366
|
+
p.current = s;
|
|
367
|
+
const m = E(i);
|
|
368
|
+
m.current = i;
|
|
369
|
+
const y = E(a);
|
|
370
370
|
y.current = a;
|
|
371
|
-
const c =
|
|
372
|
-
if (!
|
|
371
|
+
const c = D((f, g) => {
|
|
372
|
+
if (!f)
|
|
373
373
|
return;
|
|
374
|
-
const b =
|
|
375
|
-
|
|
376
|
-
}, []), l =
|
|
377
|
-
const
|
|
374
|
+
const b = cn(g);
|
|
375
|
+
p.current?.(f, b);
|
|
376
|
+
}, []), l = K(() => {
|
|
377
|
+
const f = {
|
|
378
378
|
store: e,
|
|
379
|
-
library:
|
|
379
|
+
library: n,
|
|
380
380
|
handlerCache: e.handlerCache,
|
|
381
381
|
// Access payloads from store at call time, not captured snapshot
|
|
382
382
|
getPayload: (g) => e.getSnapshot().payloads.get(g),
|
|
383
|
-
renderChildren: (g) =>
|
|
383
|
+
renderChildren: (g) => hn(g, f),
|
|
384
384
|
renderView: (g) => {
|
|
385
385
|
const b = e.getSnapshot().views.get(g);
|
|
386
|
-
return b ? /* @__PURE__ */
|
|
386
|
+
return b ? /* @__PURE__ */ w.jsx(Ue, { nodeId: b.id, context: f }) : null;
|
|
387
387
|
},
|
|
388
388
|
dispatchAction: c,
|
|
389
389
|
// Access client/video via refs to avoid context recreation
|
|
390
390
|
get client() {
|
|
391
|
-
return
|
|
391
|
+
return m.current;
|
|
392
392
|
},
|
|
393
393
|
get video() {
|
|
394
394
|
return y.current;
|
|
395
395
|
}
|
|
396
396
|
};
|
|
397
|
-
return
|
|
398
|
-
}, [e,
|
|
399
|
-
return !u || !
|
|
400
|
-
},
|
|
401
|
-
class
|
|
402
|
-
constructor(e,
|
|
403
|
-
if (this.fallback =
|
|
404
|
-
for (const [
|
|
405
|
-
this.renderers.set(
|
|
397
|
+
return f;
|
|
398
|
+
}, [e, n, c]);
|
|
399
|
+
return !u || !h ? o : /* @__PURE__ */ w.jsx("div", { "data-ikon-view-id": u, style: { display: "contents" }, children: /* @__PURE__ */ w.jsx(Ue, { nodeId: h, context: l }) });
|
|
400
|
+
}, pn);
|
|
401
|
+
class gn {
|
|
402
|
+
constructor(e, n) {
|
|
403
|
+
if (this.fallback = n, e)
|
|
404
|
+
for (const [r, o] of e)
|
|
405
|
+
this.renderers.set(r, o);
|
|
406
406
|
}
|
|
407
407
|
renderers = /* @__PURE__ */ new Map();
|
|
408
|
-
register(e,
|
|
409
|
-
this.renderers.set(e,
|
|
408
|
+
register(e, n) {
|
|
409
|
+
this.renderers.set(e, n);
|
|
410
410
|
}
|
|
411
411
|
setFallback(e) {
|
|
412
412
|
this.fallback = e;
|
|
@@ -415,80 +415,80 @@ class fr {
|
|
|
415
415
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
const
|
|
420
|
-
return new
|
|
418
|
+
function ns(t, e) {
|
|
419
|
+
const n = Object.entries(t);
|
|
420
|
+
return new gn(n, e);
|
|
421
421
|
}
|
|
422
|
-
function
|
|
423
|
-
return
|
|
422
|
+
function rs(t) {
|
|
423
|
+
return Ye(
|
|
424
424
|
(e) => t.subscribe(e),
|
|
425
425
|
() => t.getSnapshot(),
|
|
426
426
|
() => t.getSnapshot()
|
|
427
427
|
);
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
const t =
|
|
431
|
-
return
|
|
429
|
+
function yn() {
|
|
430
|
+
const t = Wt();
|
|
431
|
+
return C(() => {
|
|
432
432
|
if (!t)
|
|
433
433
|
return;
|
|
434
|
-
let e = window.parent === window,
|
|
434
|
+
let e = window.parent === window, n = null, r = [];
|
|
435
435
|
const o = document.createElement("div");
|
|
436
436
|
o.style.cssText = "position:fixed;z-index:99999;pointer-events:none;padding:2px 6px;background:#1e1e2e;color:#cdd6f4;font-size:11px;border-radius:4px;border:1px solid #45475a;white-space:nowrap;display:none;font-family:monospace;", document.body.appendChild(o);
|
|
437
437
|
function s() {
|
|
438
|
-
|
|
438
|
+
n && !r.includes(n) && (n.style.outline = "", n.style.outlineOffset = ""), n = null, o.style.display = "none";
|
|
439
439
|
}
|
|
440
440
|
function i(c) {
|
|
441
|
-
for (const
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
for (const f of r)
|
|
442
|
+
f !== n && (f.style.outline = "", f.style.outlineOffset = "");
|
|
443
|
+
r = [];
|
|
444
444
|
const l = new Set(c);
|
|
445
|
-
for (const
|
|
446
|
-
const g =
|
|
447
|
-
l.has(g) && (
|
|
445
|
+
for (const f of document.querySelectorAll("[data-ikon-source]")) {
|
|
446
|
+
const g = f.getAttribute("data-ikon-source") ?? "";
|
|
447
|
+
l.has(g) && (f.style.outline = "2px solid #a6e3a1", f.style.outlineOffset = "1px", r.push(f));
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
function a(c) {
|
|
451
451
|
if (!e)
|
|
452
452
|
return;
|
|
453
453
|
const l = c.target.closest?.("[data-ikon-source]");
|
|
454
|
-
if (!l || l ===
|
|
454
|
+
if (!l || l === n)
|
|
455
455
|
return;
|
|
456
|
-
s(),
|
|
457
|
-
const
|
|
458
|
-
o.textContent =
|
|
456
|
+
s(), n = l, n.style.outline = "2px solid #89b4fa", n.style.outlineOffset = "1px";
|
|
457
|
+
const f = l.getAttribute("data-ikon-source") ?? "";
|
|
458
|
+
o.textContent = f, o.style.display = "block";
|
|
459
459
|
const g = l.getBoundingClientRect();
|
|
460
460
|
o.style.left = `${g.left}px`, o.style.top = `${Math.max(0, g.top - 24)}px`;
|
|
461
461
|
}
|
|
462
462
|
function u(c) {
|
|
463
463
|
if (!e)
|
|
464
464
|
return;
|
|
465
|
-
c.relatedTarget?.closest?.("[data-ikon-source]") !==
|
|
465
|
+
c.relatedTarget?.closest?.("[data-ikon-source]") !== n && s();
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function h(c) {
|
|
468
468
|
if (!e)
|
|
469
469
|
return;
|
|
470
470
|
const l = c.target.closest?.("[data-ikon-source]");
|
|
471
471
|
if (!l)
|
|
472
472
|
return;
|
|
473
473
|
c.preventDefault(), c.stopPropagation();
|
|
474
|
-
const
|
|
474
|
+
const f = {
|
|
475
475
|
sourceMarker: l.getAttribute("data-ikon-source") ?? "",
|
|
476
476
|
tagName: l.tagName.toLowerCase(),
|
|
477
477
|
textContent: (l.textContent ?? "").trim().substring(0, 200)
|
|
478
478
|
};
|
|
479
|
-
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail:
|
|
479
|
+
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: f })), window.parent.postMessage({ type: "ikon-element-selected", payload: f }, "*");
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function p(c, l) {
|
|
482
482
|
return document.elementFromPoint(c, l)?.closest?.("[data-ikon-source]");
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
if (c ===
|
|
484
|
+
function m(c) {
|
|
485
|
+
if (c === n || (s(), !c))
|
|
486
486
|
return;
|
|
487
|
-
|
|
487
|
+
n = c, n.style.outline = `2px solid ${r.includes(c) ? "#a6e3a1" : "#89b4fa"}`, n.style.outlineOffset = "1px";
|
|
488
488
|
const l = c.getAttribute("data-ikon-source") ?? "";
|
|
489
489
|
o.textContent = l, o.style.display = "block";
|
|
490
|
-
const
|
|
491
|
-
o.style.left = `${
|
|
490
|
+
const f = c.getBoundingClientRect();
|
|
491
|
+
o.style.left = `${f.left}px`, o.style.top = `${Math.max(0, f.top - 24)}px`;
|
|
492
492
|
}
|
|
493
493
|
function y(c) {
|
|
494
494
|
if (c.data?.type === "ikon-inspect-mode") {
|
|
@@ -497,90 +497,90 @@ function pr() {
|
|
|
497
497
|
return;
|
|
498
498
|
}
|
|
499
499
|
if (c.data?.type === "ikon-inspect-at") {
|
|
500
|
-
const l =
|
|
501
|
-
|
|
502
|
-
const
|
|
500
|
+
const l = p(c.data.x, c.data.y);
|
|
501
|
+
m(l);
|
|
502
|
+
const f = l?.getAttribute("data-ikon-source") ?? "";
|
|
503
503
|
window.parent.postMessage({
|
|
504
504
|
type: "ikon-inspect-hover-result",
|
|
505
|
-
payload: { sourceMarker:
|
|
505
|
+
payload: { sourceMarker: f }
|
|
506
506
|
}, "*");
|
|
507
507
|
}
|
|
508
508
|
if (c.data?.type === "ikon-inspect-click") {
|
|
509
|
-
const l =
|
|
509
|
+
const l = p(c.data.x, c.data.y);
|
|
510
510
|
if (l) {
|
|
511
|
-
const
|
|
511
|
+
const f = {
|
|
512
512
|
sourceMarker: l.getAttribute("data-ikon-source") ?? "",
|
|
513
513
|
tagName: l.tagName.toLowerCase(),
|
|
514
514
|
textContent: (l.textContent ?? "").trim().substring(0, 200)
|
|
515
515
|
};
|
|
516
|
-
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail:
|
|
516
|
+
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: f })), window.parent.postMessage({ type: "ikon-element-selected", payload: f }, "*");
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
if (c.data?.type === "ikon-inspect-click-add") {
|
|
520
|
-
const l =
|
|
520
|
+
const l = p(c.data.x, c.data.y);
|
|
521
521
|
if (l) {
|
|
522
|
-
const
|
|
522
|
+
const f = {
|
|
523
523
|
sourceMarker: l.getAttribute("data-ikon-source") ?? "",
|
|
524
524
|
tagName: l.tagName.toLowerCase(),
|
|
525
525
|
textContent: (l.textContent ?? "").trim().substring(0, 200)
|
|
526
526
|
};
|
|
527
527
|
window.parent.postMessage({
|
|
528
528
|
type: "ikon-inspect-rect-result",
|
|
529
|
-
payload: { elements: [
|
|
529
|
+
payload: { elements: [f], append: !0 }
|
|
530
530
|
}, "*");
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
if (c.data?.type === "ikon-inspect-rect") {
|
|
534
|
-
const { x1: l, y1:
|
|
535
|
-
for (const
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
sourceMarker:
|
|
539
|
-
tagName:
|
|
540
|
-
textContent: (
|
|
534
|
+
const { x1: l, y1: f, x2: g, y2: b, append: S } = c.data, O = document.querySelectorAll("[data-ikon-source]"), I = [];
|
|
535
|
+
for (const M of O) {
|
|
536
|
+
const x = M.getBoundingClientRect();
|
|
537
|
+
x.right > l && x.left < g && x.bottom > f && x.top < b && I.push({
|
|
538
|
+
sourceMarker: M.getAttribute("data-ikon-source") ?? "",
|
|
539
|
+
tagName: M.tagName.toLowerCase(),
|
|
540
|
+
textContent: (M.textContent ?? "").trim().substring(0, 200)
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
|
|
543
|
+
I.length > 0 && window.parent.postMessage({
|
|
544
544
|
type: "ikon-inspect-rect-result",
|
|
545
|
-
payload: { elements:
|
|
545
|
+
payload: { elements: I, append: S ?? !1 }
|
|
546
546
|
}, "*");
|
|
547
547
|
}
|
|
548
548
|
c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
|
|
549
549
|
}
|
|
550
|
-
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", u, !0), document.addEventListener("click",
|
|
551
|
-
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", u, !0), document.removeEventListener("click",
|
|
550
|
+
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", u, !0), document.addEventListener("click", h, !0), window.addEventListener("message", y), () => {
|
|
551
|
+
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", u, !0), document.removeEventListener("click", h, !0), window.removeEventListener("message", y), s(), i([]), o.remove();
|
|
552
552
|
};
|
|
553
553
|
}, [t]), null;
|
|
554
554
|
}
|
|
555
|
-
const
|
|
556
|
-
function
|
|
555
|
+
const bn = re("IkonUiSurface"), De = "ikon-ui";
|
|
556
|
+
function Sn(t, e) {
|
|
557
557
|
return t === e;
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
const i =
|
|
559
|
+
const wt = z(function({ stores: e, registry: n, category: r = De, onAction: o, client: s }) {
|
|
560
|
+
const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a = E(o);
|
|
561
561
|
a.current = o;
|
|
562
|
-
const u =
|
|
562
|
+
const u = E(s);
|
|
563
563
|
u.current = s;
|
|
564
|
-
const
|
|
564
|
+
const h = K(
|
|
565
565
|
() => {
|
|
566
566
|
const y = [];
|
|
567
567
|
for (const [c, l] of e) {
|
|
568
|
-
const
|
|
569
|
-
|
|
568
|
+
const f = l.store.getSnapshot();
|
|
569
|
+
Sn(l.category, r) && (!f.rootViewId || !f.views.has(f.rootViewId) || y.push({ key: c, store: l.store }));
|
|
570
570
|
}
|
|
571
571
|
return y;
|
|
572
572
|
},
|
|
573
573
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
574
|
-
[e,
|
|
575
|
-
),
|
|
576
|
-
return
|
|
577
|
-
|
|
578
|
-
}, [
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
|
|
574
|
+
[e, r, i]
|
|
575
|
+
), p = E(!1), m = h.length > 0;
|
|
576
|
+
return C(() => {
|
|
577
|
+
m && !p.current && (p.current = !0, bn.debug("First UI render"));
|
|
578
|
+
}, [m]), m ? /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
579
|
+
/* @__PURE__ */ w.jsx(yn, {}),
|
|
580
|
+
h.map(({ key: y, store: c }) => /* @__PURE__ */ w.jsx(mn, { store: c, library: n, onAction: a.current, client: u.current, video: u.current?.media?.video }, y))
|
|
581
581
|
] }) : null;
|
|
582
582
|
});
|
|
583
|
-
class
|
|
583
|
+
class wn {
|
|
584
584
|
core;
|
|
585
585
|
ownsCore;
|
|
586
586
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -588,7 +588,7 @@ class yr {
|
|
|
588
588
|
unsubscribeClears;
|
|
589
589
|
unsubscribeStoreChanges;
|
|
590
590
|
constructor(e) {
|
|
591
|
-
this.core = e?.core ?? new
|
|
591
|
+
this.core = e?.core ?? new Vt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
592
592
|
}
|
|
593
593
|
dispose() {
|
|
594
594
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -614,48 +614,48 @@ class yr {
|
|
|
614
614
|
this.stores.delete(e) && this.notify(e);
|
|
615
615
|
};
|
|
616
616
|
syncStreamSnapshot = (e) => {
|
|
617
|
-
const
|
|
618
|
-
if (!
|
|
617
|
+
const n = this.core.uiStore.getSnapshot(e);
|
|
618
|
+
if (!n || !n.rootViewId) {
|
|
619
619
|
this.handleUiStreamCleared(e);
|
|
620
620
|
return;
|
|
621
621
|
}
|
|
622
|
-
if (!
|
|
622
|
+
if (!n.views.get(n.rootViewId)) {
|
|
623
623
|
this.handleUiStreamCleared(e);
|
|
624
624
|
return;
|
|
625
625
|
}
|
|
626
|
-
const s = this.ensureStoreEntry(e).store.replaceSnapshot(
|
|
626
|
+
const s = this.ensureStoreEntry(e).store.replaceSnapshot(n), i = this.updateCategory(e, n.category);
|
|
627
627
|
(s || i) && this.notify(e);
|
|
628
628
|
};
|
|
629
629
|
syncAllStreams() {
|
|
630
|
-
const e = this.core.uiStore.getSnapshots(),
|
|
631
|
-
for (const
|
|
632
|
-
this.syncStreamSnapshot(
|
|
633
|
-
for (const
|
|
634
|
-
|
|
630
|
+
const e = this.core.uiStore.getSnapshots(), n = /* @__PURE__ */ new Set();
|
|
631
|
+
for (const r of e)
|
|
632
|
+
this.syncStreamSnapshot(r.streamId), n.add(r.streamId);
|
|
633
|
+
for (const r of this.stores.keys())
|
|
634
|
+
n.has(r) || (this.stores.delete(r), this.notify(r));
|
|
635
635
|
}
|
|
636
636
|
ensureStoreEntry(e) {
|
|
637
|
-
const
|
|
638
|
-
if (
|
|
639
|
-
return
|
|
640
|
-
const
|
|
641
|
-
category:
|
|
642
|
-
store: new
|
|
637
|
+
const n = this.stores.get(e);
|
|
638
|
+
if (n)
|
|
639
|
+
return n;
|
|
640
|
+
const r = {
|
|
641
|
+
category: De,
|
|
642
|
+
store: new Kt()
|
|
643
643
|
};
|
|
644
|
-
return this.stores.set(e,
|
|
644
|
+
return this.stores.set(e, r), r;
|
|
645
645
|
}
|
|
646
|
-
updateCategory(e,
|
|
647
|
-
const
|
|
648
|
-
if (!
|
|
646
|
+
updateCategory(e, n) {
|
|
647
|
+
const r = this.stores.get(e);
|
|
648
|
+
if (!r)
|
|
649
649
|
return !1;
|
|
650
|
-
const o =
|
|
651
|
-
return
|
|
650
|
+
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? De;
|
|
651
|
+
return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
|
|
652
652
|
}
|
|
653
653
|
notify(e) {
|
|
654
|
-
for (const
|
|
655
|
-
|
|
654
|
+
for (const n of this.listeners)
|
|
655
|
+
n(e);
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function vn(t) {
|
|
659
659
|
if (typeof t == "string") {
|
|
660
660
|
const e = t.trim();
|
|
661
661
|
return e.length > 0 ? e : void 0;
|
|
@@ -667,67 +667,67 @@ function te(t) {
|
|
|
667
667
|
return e.length > 0 ? e : void 0;
|
|
668
668
|
}
|
|
669
669
|
if (Array.isArray(t)) {
|
|
670
|
-
const e = t.filter((
|
|
670
|
+
const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
|
|
671
671
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function We(...t) {
|
|
675
675
|
let e = "";
|
|
676
|
-
for (const
|
|
677
|
-
if (
|
|
678
|
-
const
|
|
679
|
-
|
|
676
|
+
for (const n of t)
|
|
677
|
+
if (n) {
|
|
678
|
+
const r = n.trim();
|
|
679
|
+
r && (e = e ? e + " " + r : r);
|
|
680
680
|
}
|
|
681
681
|
return e || void 0;
|
|
682
682
|
}
|
|
683
|
-
const
|
|
684
|
-
function
|
|
683
|
+
const rt = /* @__PURE__ */ new WeakMap(), En = {};
|
|
684
|
+
function He(t) {
|
|
685
685
|
if (!t)
|
|
686
|
-
return
|
|
687
|
-
const e =
|
|
686
|
+
return En;
|
|
687
|
+
const e = rt.get(t);
|
|
688
688
|
if (e)
|
|
689
689
|
return e;
|
|
690
|
-
const
|
|
691
|
-
for (const [
|
|
692
|
-
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r
|
|
693
|
-
return
|
|
690
|
+
const n = {};
|
|
691
|
+
for (const [r, o] of Object.entries(t))
|
|
692
|
+
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
693
|
+
return rt.set(t, n), n;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function Rn(t) {
|
|
696
696
|
let e = t.parentElement;
|
|
697
697
|
for (; e; ) {
|
|
698
|
-
const
|
|
699
|
-
if (
|
|
698
|
+
const r = window.getComputedStyle(e).overflowY;
|
|
699
|
+
if (r === "auto" || r === "scroll" || e.hasAttribute("data-radix-scroll-area-viewport"))
|
|
700
700
|
return e;
|
|
701
701
|
e = e.parentElement;
|
|
702
702
|
}
|
|
703
703
|
return null;
|
|
704
704
|
}
|
|
705
|
-
const
|
|
706
|
-
function
|
|
705
|
+
const vt = 1.5;
|
|
706
|
+
function Et(t, e) {
|
|
707
707
|
requestAnimationFrame(() => {
|
|
708
|
-
const
|
|
708
|
+
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * vt ? "auto" : "smooth";
|
|
709
709
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
|
-
const
|
|
713
|
-
function
|
|
714
|
-
return Math.max(t.clientHeight *
|
|
712
|
+
const Fe = "data-ikon-scroll-indicator", kn = 0.15, Re = "data-ikon-at-bottom";
|
|
713
|
+
function Rt(t) {
|
|
714
|
+
return Math.max(t.clientHeight * kn, 20);
|
|
715
715
|
}
|
|
716
|
-
function
|
|
717
|
-
return t.getAttribute(
|
|
716
|
+
function An(t) {
|
|
717
|
+
return t.getAttribute(Re) !== "false";
|
|
718
718
|
}
|
|
719
|
-
function
|
|
720
|
-
t.getAttribute(
|
|
721
|
-
const { scrollTop: e, scrollHeight:
|
|
722
|
-
t.setAttribute(
|
|
719
|
+
function Tn(t) {
|
|
720
|
+
t.getAttribute(Re) === null && (t.setAttribute(Re, "true"), t.addEventListener("scroll", () => {
|
|
721
|
+
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Rt(t);
|
|
722
|
+
t.setAttribute(Re, s ? "true" : "false");
|
|
723
723
|
}, { passive: !0 }));
|
|
724
724
|
}
|
|
725
|
-
function
|
|
726
|
-
const e = t.parentElement ?? t,
|
|
727
|
-
if (
|
|
728
|
-
return
|
|
729
|
-
const
|
|
730
|
-
return
|
|
725
|
+
function Cn(t) {
|
|
726
|
+
const e = t.parentElement ?? t, n = e.querySelector(`[${Fe}]`);
|
|
727
|
+
if (n)
|
|
728
|
+
return n;
|
|
729
|
+
const r = document.createElement("button");
|
|
730
|
+
return r.setAttribute(Fe, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
|
|
731
731
|
position: "absolute",
|
|
732
732
|
bottom: "12px",
|
|
733
733
|
left: "50%",
|
|
@@ -749,29 +749,29 @@ function kr(t) {
|
|
|
749
749
|
transition: "opacity 150ms",
|
|
750
750
|
opacity: "1",
|
|
751
751
|
padding: "0"
|
|
752
|
-
}),
|
|
753
|
-
|
|
754
|
-
}),
|
|
755
|
-
|
|
756
|
-
}), e.appendChild(
|
|
757
|
-
}
|
|
758
|
-
function
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
|
|
752
|
+
}), r.addEventListener("mouseenter", () => {
|
|
753
|
+
r.style.opacity = "1";
|
|
754
|
+
}), r.addEventListener("mouseleave", () => {
|
|
755
|
+
r.style.opacity = "0.9";
|
|
756
|
+
}), e.appendChild(r), r;
|
|
757
|
+
}
|
|
758
|
+
function In(t, e) {
|
|
759
|
+
const n = Cn(t);
|
|
760
|
+
n.style.display = "flex";
|
|
761
|
+
const r = () => {
|
|
762
|
+
Et(t, e), n.style.display = "none";
|
|
763
763
|
}, o = () => {
|
|
764
764
|
const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
|
|
765
|
-
i - s - a <=
|
|
765
|
+
i - s - a <= Rt(t) && (n.style.display = "none");
|
|
766
766
|
};
|
|
767
|
-
return
|
|
768
|
-
|
|
767
|
+
return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
|
|
768
|
+
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
|
-
function
|
|
772
|
-
const t =
|
|
773
|
-
const o =
|
|
774
|
-
return
|
|
771
|
+
function _n() {
|
|
772
|
+
const t = z(function({ nodeId: n, context: r }) {
|
|
773
|
+
const o = X(r.store, n), s = E(null), i = te(o?.props?.targetViewId), a = o?.props?.focusOnly, u = typeof a == "boolean" ? a : void 0, h = te(o?.props?.priority), p = te(o?.props?.key), m = o?.props?.preciseGeneratedAt;
|
|
774
|
+
return C(() => {
|
|
775
775
|
if (typeof document > "u")
|
|
776
776
|
return;
|
|
777
777
|
const c = s.current;
|
|
@@ -779,18 +779,18 @@ function Tr() {
|
|
|
779
779
|
return;
|
|
780
780
|
let l;
|
|
781
781
|
if (u !== !0) {
|
|
782
|
-
const S =
|
|
782
|
+
const S = Rn(c);
|
|
783
783
|
if (S)
|
|
784
|
-
if (
|
|
785
|
-
l =
|
|
784
|
+
if (Tn(S), h === "Polite" && !An(S))
|
|
785
|
+
l = In(S, c);
|
|
786
786
|
else {
|
|
787
|
-
const
|
|
788
|
-
|
|
787
|
+
const x = (S.parentElement ?? S).querySelector(`[${Fe}]`);
|
|
788
|
+
x && (x.style.display = "none"), Et(S, c);
|
|
789
789
|
}
|
|
790
790
|
else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
791
|
-
const O = c.getBoundingClientRect().top,
|
|
791
|
+
const O = c.getBoundingClientRect().top, I = typeof window < "u" ? window.innerHeight : 0, M = Math.abs(O) > I * vt ? "auto" : "smooth";
|
|
792
792
|
try {
|
|
793
|
-
c.scrollIntoView({ behavior:
|
|
793
|
+
c.scrollIntoView({ behavior: M, block: "end", inline: "nearest" });
|
|
794
794
|
} catch {
|
|
795
795
|
c.scrollIntoView(!1);
|
|
796
796
|
}
|
|
@@ -804,7 +804,7 @@ function Tr() {
|
|
|
804
804
|
c.focus();
|
|
805
805
|
}
|
|
806
806
|
return l;
|
|
807
|
-
}, [u,
|
|
807
|
+
}, [u, h, i, p, m]), o ? /* @__PURE__ */ w.jsx(
|
|
808
808
|
"span",
|
|
809
809
|
{
|
|
810
810
|
ref: s,
|
|
@@ -821,26 +821,26 @@ function Tr() {
|
|
|
821
821
|
return t;
|
|
822
822
|
};
|
|
823
823
|
}
|
|
824
|
-
function
|
|
825
|
-
const t =
|
|
826
|
-
const s =
|
|
827
|
-
i &&
|
|
828
|
-
}, [i,
|
|
824
|
+
function On() {
|
|
825
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
826
|
+
const s = X(r.store, n), i = vn(s?.props?.onInvokeId), a = D(() => {
|
|
827
|
+
i && r.dispatchAction(i);
|
|
828
|
+
}, [i, r]);
|
|
829
829
|
if (!s)
|
|
830
830
|
return null;
|
|
831
|
-
const u =
|
|
831
|
+
const u = He(s.props);
|
|
832
832
|
delete u.onInvokeId;
|
|
833
|
-
const
|
|
834
|
-
return /* @__PURE__ */
|
|
833
|
+
const h = We(te(s.props?.className), o), p = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
834
|
+
return /* @__PURE__ */ w.jsx(
|
|
835
835
|
"div",
|
|
836
836
|
{
|
|
837
837
|
...u,
|
|
838
838
|
"data-ikon-node-id": s.id,
|
|
839
839
|
"data-ikon-source": s.sourceMarker,
|
|
840
|
-
className:
|
|
840
|
+
className: h,
|
|
841
841
|
onClick: i ? a : void 0,
|
|
842
842
|
style: i ? { cursor: "pointer" } : void 0,
|
|
843
|
-
children:
|
|
843
|
+
children: p
|
|
844
844
|
}
|
|
845
845
|
);
|
|
846
846
|
});
|
|
@@ -849,61 +849,61 @@ function Cr() {
|
|
|
849
849
|
return t;
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
function
|
|
853
|
-
const t =
|
|
854
|
-
const s =
|
|
852
|
+
function Nn() {
|
|
853
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
854
|
+
const s = X(r.store, n);
|
|
855
855
|
if (!s)
|
|
856
856
|
return null;
|
|
857
|
-
const i =
|
|
858
|
-
return /* @__PURE__ */
|
|
857
|
+
const i = He(s.props), a = We("relative", te(s.props?.className), o), u = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
858
|
+
return /* @__PURE__ */ w.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: u });
|
|
859
859
|
});
|
|
860
860
|
return ({ type: e }) => {
|
|
861
861
|
if (e === "std.stack")
|
|
862
862
|
return t;
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
|
-
function
|
|
866
|
-
const t =
|
|
867
|
-
const s =
|
|
865
|
+
function Mn() {
|
|
866
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
867
|
+
const s = X(r.store, n);
|
|
868
868
|
if (!s)
|
|
869
869
|
return null;
|
|
870
|
-
const i =
|
|
871
|
-
return /* @__PURE__ */
|
|
870
|
+
const i = He(s.props), a = We("absolute", te(s.props?.className), o), u = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
871
|
+
return /* @__PURE__ */ w.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: u });
|
|
872
872
|
});
|
|
873
873
|
return ({ type: e }) => {
|
|
874
874
|
if (e === "std.layer")
|
|
875
875
|
return t;
|
|
876
876
|
};
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function Pn() {
|
|
879
879
|
return [
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
880
|
+
On(),
|
|
881
|
+
Nn(),
|
|
882
|
+
Mn(),
|
|
883
|
+
_n()
|
|
884
884
|
];
|
|
885
885
|
}
|
|
886
|
-
const
|
|
887
|
-
function
|
|
888
|
-
t.registerModule(
|
|
886
|
+
const xn = "base", Ln = async () => Pn();
|
|
887
|
+
function jn(t) {
|
|
888
|
+
t.registerModule(xn, Ln);
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Un(t) {
|
|
891
891
|
if (typeof t == "string") {
|
|
892
892
|
const e = t.trim();
|
|
893
893
|
return e.length > 0 ? e : void 0;
|
|
894
894
|
}
|
|
895
895
|
if (Array.isArray(t)) {
|
|
896
|
-
const e = t.filter((
|
|
896
|
+
const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
|
|
897
897
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
898
898
|
}
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function Dn(...t) {
|
|
901
901
|
const e = [];
|
|
902
|
-
for (const
|
|
903
|
-
|
|
902
|
+
for (const n of t)
|
|
903
|
+
n && n.trim() && e.push(n.trim());
|
|
904
904
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function ot(t) {
|
|
907
907
|
if (typeof t != "string")
|
|
908
908
|
return;
|
|
909
909
|
const e = t.trim();
|
|
@@ -918,58 +918,58 @@ function we(t) {
|
|
|
918
918
|
if (e === "false") return !1;
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
const
|
|
922
|
-
function
|
|
923
|
-
const t =
|
|
924
|
-
nodeId:
|
|
925
|
-
context:
|
|
921
|
+
const Fn = "std.audio-url-player";
|
|
922
|
+
function Bn() {
|
|
923
|
+
const t = z(function({
|
|
924
|
+
nodeId: n,
|
|
925
|
+
context: r,
|
|
926
926
|
className: o
|
|
927
927
|
}) {
|
|
928
|
-
const s =
|
|
929
|
-
if (
|
|
928
|
+
const s = X(r.store, n), i = E(null), a = s ? we(s.props?.autoplay) : void 0, u = s ? ot(s.props?.src) : void 0;
|
|
929
|
+
if (C(() => {
|
|
930
930
|
a && i.current && i.current.play().catch(() => {
|
|
931
931
|
});
|
|
932
932
|
}, [a, u]), !s)
|
|
933
933
|
return null;
|
|
934
|
-
const
|
|
935
|
-
return /* @__PURE__ */
|
|
934
|
+
const h = Dn(Un(s.props?.className), o), p = ot(s.props?.preload), m = we(s.props?.controls), y = we(s.props?.loop), c = we(s.props?.muted);
|
|
935
|
+
return /* @__PURE__ */ w.jsx(
|
|
936
936
|
"audio",
|
|
937
937
|
{
|
|
938
938
|
ref: i,
|
|
939
939
|
src: u,
|
|
940
|
-
...
|
|
941
|
-
...
|
|
940
|
+
...p !== void 0 ? { preload: p } : {},
|
|
941
|
+
...m !== void 0 ? { controls: m } : {},
|
|
942
942
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
943
943
|
...y !== void 0 ? { loop: y } : {},
|
|
944
944
|
...c !== void 0 ? { muted: c } : {},
|
|
945
945
|
"data-ikon-node-id": s.id,
|
|
946
946
|
"data-ikon-source": s.sourceMarker,
|
|
947
|
-
className:
|
|
947
|
+
className: h
|
|
948
948
|
}
|
|
949
949
|
);
|
|
950
950
|
});
|
|
951
951
|
return ({ type: e }) => {
|
|
952
|
-
if (e ===
|
|
952
|
+
if (e === Fn)
|
|
953
953
|
return t;
|
|
954
954
|
};
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function kt(t) {
|
|
957
957
|
if (typeof t == "string") {
|
|
958
958
|
const e = t.trim();
|
|
959
959
|
return e.length > 0 ? e : void 0;
|
|
960
960
|
}
|
|
961
961
|
if (Array.isArray(t)) {
|
|
962
|
-
const e = t.filter((
|
|
962
|
+
const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
|
|
963
963
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function At(...t) {
|
|
967
967
|
const e = [];
|
|
968
|
-
for (const
|
|
969
|
-
|
|
968
|
+
for (const n of t)
|
|
969
|
+
n && n.trim() && e.push(n.trim());
|
|
970
970
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function ke(t) {
|
|
973
973
|
if (typeof t == "number" && Number.isFinite(t))
|
|
974
974
|
return Math.floor(t);
|
|
975
975
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -978,39 +978,39 @@ function Re(t) {
|
|
|
978
978
|
return Math.floor(e);
|
|
979
979
|
}
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function Be(t) {
|
|
982
982
|
if (typeof t != "string")
|
|
983
983
|
return;
|
|
984
984
|
const e = t.trim();
|
|
985
985
|
return e.length > 0 ? e : void 0;
|
|
986
986
|
}
|
|
987
|
-
const
|
|
988
|
-
function
|
|
989
|
-
const t =
|
|
990
|
-
const s =
|
|
991
|
-
|
|
992
|
-
if (!
|
|
993
|
-
const g =
|
|
994
|
-
return
|
|
987
|
+
const $n = "std.video-canvas", Vn = "std.video-url-player";
|
|
988
|
+
function Kn() {
|
|
989
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
990
|
+
const s = X(r.store, n), i = E(null), a = E(null), u = r.video, h = r.client, p = s ? Be(s.props?.streamId) : void 0, m = s ? ke(s.props?.width) : void 0, y = s ? ke(s.props?.height) : void 0, c = s ? At(kt(s.props?.className), o) : o, [, l] = j(0);
|
|
991
|
+
C(() => {
|
|
992
|
+
if (!h?.isWebRtcEnabled) return;
|
|
993
|
+
const g = h.onWebRtcTrackMapChanged;
|
|
994
|
+
return h.onWebRtcTrackMapChanged = (b) => {
|
|
995
995
|
g?.(b), b.kind === "video" && l((S) => S + 1);
|
|
996
996
|
}, () => {
|
|
997
|
-
|
|
997
|
+
h.onWebRtcTrackMapChanged = g;
|
|
998
998
|
};
|
|
999
|
-
}, [
|
|
1000
|
-
const
|
|
1001
|
-
return
|
|
999
|
+
}, [h]);
|
|
1000
|
+
const f = h?.isWebRtcEnabled && p ? h.getWebRtcVideoStreamByStreamId(p) : null;
|
|
1001
|
+
return C(() => {
|
|
1002
1002
|
const g = i.current;
|
|
1003
|
-
if (!(!u || !g || !
|
|
1004
|
-
return u.attachCanvas(
|
|
1005
|
-
u.detachCanvas(
|
|
1003
|
+
if (!(!u || !g || !p || f))
|
|
1004
|
+
return u.attachCanvas(p, g), () => {
|
|
1005
|
+
u.detachCanvas(p);
|
|
1006
1006
|
};
|
|
1007
|
-
}, [u,
|
|
1007
|
+
}, [u, p, f]), C(() => {
|
|
1008
1008
|
const g = a.current;
|
|
1009
|
-
if (!(!g || !
|
|
1010
|
-
return g.srcObject =
|
|
1009
|
+
if (!(!g || !f))
|
|
1010
|
+
return g.srcObject = f, () => {
|
|
1011
1011
|
g.srcObject = null;
|
|
1012
1012
|
};
|
|
1013
|
-
}, [
|
|
1013
|
+
}, [f]), s ? f ? /* @__PURE__ */ w.jsx(
|
|
1014
1014
|
"video",
|
|
1015
1015
|
{
|
|
1016
1016
|
ref: a,
|
|
@@ -1019,35 +1019,35 @@ function Fr() {
|
|
|
1019
1019
|
muted: !0,
|
|
1020
1020
|
"data-ikon-node-id": s.id,
|
|
1021
1021
|
"data-ikon-source": s.sourceMarker,
|
|
1022
|
-
"data-ikon-video-stream-id":
|
|
1022
|
+
"data-ikon-video-stream-id": p,
|
|
1023
1023
|
className: c,
|
|
1024
|
-
...
|
|
1024
|
+
...m ? { width: m } : {},
|
|
1025
1025
|
...y ? { height: y } : {}
|
|
1026
1026
|
},
|
|
1027
|
-
|
|
1028
|
-
) : /* @__PURE__ */
|
|
1027
|
+
p
|
|
1028
|
+
) : /* @__PURE__ */ w.jsx(
|
|
1029
1029
|
"canvas",
|
|
1030
1030
|
{
|
|
1031
1031
|
ref: i,
|
|
1032
1032
|
"data-ikon-node-id": s.id,
|
|
1033
1033
|
"data-ikon-source": s.sourceMarker,
|
|
1034
|
-
"data-ikon-video-stream-id":
|
|
1034
|
+
"data-ikon-video-stream-id": p,
|
|
1035
1035
|
className: c,
|
|
1036
|
-
...
|
|
1036
|
+
...m ? { width: m } : {},
|
|
1037
1037
|
...y ? { height: y } : {}
|
|
1038
1038
|
},
|
|
1039
|
-
|
|
1039
|
+
p
|
|
1040
1040
|
) : null;
|
|
1041
1041
|
});
|
|
1042
1042
|
return ({ type: e }) => {
|
|
1043
|
-
if (e ===
|
|
1043
|
+
if (e === $n)
|
|
1044
1044
|
return t;
|
|
1045
1045
|
};
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1048
|
-
return [
|
|
1047
|
+
function Yn() {
|
|
1048
|
+
return [Kn(), zn(), Bn()];
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function le(t) {
|
|
1051
1051
|
if (typeof t == "boolean")
|
|
1052
1052
|
return t;
|
|
1053
1053
|
if (typeof t == "string") {
|
|
@@ -1056,61 +1056,61 @@ function ce(t) {
|
|
|
1056
1056
|
if (e === "false") return !1;
|
|
1057
1057
|
}
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1060
|
-
const t =
|
|
1061
|
-
nodeId:
|
|
1062
|
-
context:
|
|
1059
|
+
function zn() {
|
|
1060
|
+
const t = z(function({
|
|
1061
|
+
nodeId: n,
|
|
1062
|
+
context: r,
|
|
1063
1063
|
className: o
|
|
1064
1064
|
}) {
|
|
1065
|
-
const s =
|
|
1066
|
-
if (
|
|
1065
|
+
const s = X(r.store, n), i = E(null), a = s ? le(s.props?.autoplay) : void 0, u = s ? Be(s.props?.src) : void 0;
|
|
1066
|
+
if (C(() => {
|
|
1067
1067
|
a && i.current && i.current.play().catch(() => {
|
|
1068
1068
|
});
|
|
1069
1069
|
}, [a, u]), !s)
|
|
1070
1070
|
return null;
|
|
1071
|
-
const
|
|
1072
|
-
return /* @__PURE__ */
|
|
1071
|
+
const h = At(kt(s.props?.className), o), p = Be(s.props?.poster), m = le(s.props?.controls), y = le(s.props?.loop), c = le(s.props?.muted), l = le(s.props?.playsInline), f = ke(s.props?.width), g = ke(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
1072
|
+
return /* @__PURE__ */ w.jsx(
|
|
1073
1073
|
"video",
|
|
1074
1074
|
{
|
|
1075
1075
|
ref: i,
|
|
1076
1076
|
src: u,
|
|
1077
|
-
poster:
|
|
1078
|
-
...
|
|
1077
|
+
poster: p,
|
|
1078
|
+
...m !== void 0 ? { controls: m } : {},
|
|
1079
1079
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
1080
1080
|
...y !== void 0 ? { loop: y } : {},
|
|
1081
1081
|
...c !== void 0 ? { muted: c } : {},
|
|
1082
1082
|
...l !== void 0 ? { playsInline: l } : {},
|
|
1083
|
-
...
|
|
1083
|
+
...f ? { width: f } : {},
|
|
1084
1084
|
...g ? { height: g } : {},
|
|
1085
1085
|
"data-ikon-node-id": s.id,
|
|
1086
1086
|
"data-ikon-source": s.sourceMarker,
|
|
1087
|
-
className:
|
|
1087
|
+
className: h,
|
|
1088
1088
|
children: b
|
|
1089
1089
|
}
|
|
1090
1090
|
);
|
|
1091
1091
|
});
|
|
1092
1092
|
return ({ type: e }) => {
|
|
1093
|
-
if (e ===
|
|
1093
|
+
if (e === Vn)
|
|
1094
1094
|
return t;
|
|
1095
1095
|
};
|
|
1096
1096
|
}
|
|
1097
|
-
const
|
|
1098
|
-
function
|
|
1099
|
-
t.registerModule(
|
|
1097
|
+
const Wn = "media", Hn = async () => Yn();
|
|
1098
|
+
function qn(t) {
|
|
1099
|
+
t.registerModule(Wn, Hn);
|
|
1100
1100
|
}
|
|
1101
|
-
const
|
|
1101
|
+
const Gn = `#version 300 es
|
|
1102
1102
|
in vec4 a_position;
|
|
1103
1103
|
void main() {
|
|
1104
1104
|
gl_Position = a_position;
|
|
1105
1105
|
}
|
|
1106
1106
|
`;
|
|
1107
|
-
function
|
|
1107
|
+
function Jn(t, e) {
|
|
1108
1108
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1111
|
-
const
|
|
1112
|
-
for (const [
|
|
1113
|
-
if (
|
|
1110
|
+
function Xn(t, e) {
|
|
1111
|
+
const n = [];
|
|
1112
|
+
for (const [r, o] of Object.entries(e)) {
|
|
1113
|
+
if (Jn(t, r))
|
|
1114
1114
|
continue;
|
|
1115
1115
|
let s;
|
|
1116
1116
|
switch (o.type) {
|
|
@@ -1135,7 +1135,7 @@ function qr(t, e) {
|
|
|
1135
1135
|
default:
|
|
1136
1136
|
s = "float";
|
|
1137
1137
|
}
|
|
1138
|
-
|
|
1138
|
+
n.push(`uniform ${s} ${r};`);
|
|
1139
1139
|
}
|
|
1140
1140
|
return `#version 300 es
|
|
1141
1141
|
precision highp float;
|
|
@@ -1149,7 +1149,7 @@ uniform vec4 iMouse;
|
|
|
1149
1149
|
uniform vec4 iDate;
|
|
1150
1150
|
|
|
1151
1151
|
// Custom uniforms
|
|
1152
|
-
${
|
|
1152
|
+
${n.join(`
|
|
1153
1153
|
`)}
|
|
1154
1154
|
|
|
1155
1155
|
out vec4 frag_out_color;
|
|
@@ -1163,7 +1163,7 @@ void main() {
|
|
|
1163
1163
|
}
|
|
1164
1164
|
`;
|
|
1165
1165
|
}
|
|
1166
|
-
class
|
|
1166
|
+
class Zn {
|
|
1167
1167
|
gl;
|
|
1168
1168
|
program = null;
|
|
1169
1169
|
positionBuffer = null;
|
|
@@ -1180,72 +1180,72 @@ class Gr {
|
|
|
1180
1180
|
lastError = null;
|
|
1181
1181
|
currentShaderSource = "";
|
|
1182
1182
|
constructor(e) {
|
|
1183
|
-
const
|
|
1183
|
+
const n = e.getContext("webgl2", {
|
|
1184
1184
|
alpha: !1,
|
|
1185
1185
|
antialias: !1,
|
|
1186
1186
|
depth: !1,
|
|
1187
1187
|
stencil: !1,
|
|
1188
1188
|
preserveDrawingBuffer: !1
|
|
1189
1189
|
});
|
|
1190
|
-
if (!
|
|
1190
|
+
if (!n)
|
|
1191
1191
|
throw new Error("WebGL2 is not supported");
|
|
1192
|
-
this.gl =
|
|
1192
|
+
this.gl = n, this.initializeGeometry();
|
|
1193
1193
|
}
|
|
1194
1194
|
initializeGeometry() {
|
|
1195
1195
|
const e = this.gl;
|
|
1196
1196
|
this.vao = e.createVertexArray(), e.bindVertexArray(this.vao), this.positionBuffer = e.createBuffer(), e.bindBuffer(e.ARRAY_BUFFER, this.positionBuffer);
|
|
1197
|
-
const
|
|
1198
|
-
e.bufferData(e.ARRAY_BUFFER,
|
|
1197
|
+
const n = new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]);
|
|
1198
|
+
e.bufferData(e.ARRAY_BUFFER, n, e.STATIC_DRAW), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
|
|
1199
1199
|
}
|
|
1200
|
-
compile(e,
|
|
1201
|
-
this.lastError = null, this.customUniforms =
|
|
1202
|
-
const
|
|
1200
|
+
compile(e, n = {}) {
|
|
1201
|
+
this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
|
|
1202
|
+
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Gn);
|
|
1203
1203
|
if (!o)
|
|
1204
1204
|
return !1;
|
|
1205
|
-
const s =
|
|
1205
|
+
const s = Xn(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
|
|
1206
1206
|
if (!i)
|
|
1207
|
-
return
|
|
1208
|
-
const a =
|
|
1209
|
-
return a ? (
|
|
1207
|
+
return r.deleteShader(o), !1;
|
|
1208
|
+
const a = r.createProgram();
|
|
1209
|
+
return a ? (r.attachShader(a, o), r.attachShader(a, i), r.linkProgram(a), r.deleteShader(o), r.deleteShader(i), r.getProgramParameter(a, r.LINK_STATUS) ? (this.program && r.deleteProgram(this.program), this.program = a, this.cacheUniformLocations(), !0) : (this.lastError = r.getProgramInfoLog(a) || "Program link failed", r.deleteProgram(a), !1)) : (this.lastError = "Failed to create program", r.deleteShader(o), r.deleteShader(i), !1);
|
|
1210
1210
|
}
|
|
1211
1211
|
recompileWithUniforms(e) {
|
|
1212
1212
|
return this.currentShaderSource ? this.compile(this.currentShaderSource, e) : !1;
|
|
1213
1213
|
}
|
|
1214
|
-
compileShader(e,
|
|
1215
|
-
const
|
|
1216
|
-
return o ? (
|
|
1214
|
+
compileShader(e, n) {
|
|
1215
|
+
const r = this.gl, o = r.createShader(e);
|
|
1216
|
+
return o ? (r.shaderSource(o, n), r.compileShader(o), r.getShaderParameter(o, r.COMPILE_STATUS) ? o : (this.lastError = r.getShaderInfoLog(o) || "Shader compilation failed", r.deleteShader(o), null)) : (this.lastError = "Failed to create shader", null);
|
|
1217
1217
|
}
|
|
1218
1218
|
cacheUniformLocations() {
|
|
1219
1219
|
if (!this.program) return;
|
|
1220
1220
|
const e = this.gl;
|
|
1221
1221
|
this.uniformLocations.clear();
|
|
1222
|
-
const
|
|
1223
|
-
for (const
|
|
1224
|
-
this.uniformLocations.set(
|
|
1225
|
-
for (const
|
|
1226
|
-
this.uniformLocations.set(
|
|
1222
|
+
const n = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
|
|
1223
|
+
for (const r of n)
|
|
1224
|
+
this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
|
|
1225
|
+
for (const r of Object.keys(this.customUniforms))
|
|
1226
|
+
this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
|
|
1227
1227
|
}
|
|
1228
1228
|
setCustomUniforms(e) {
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1229
|
+
const n = Object.keys(e).some((o) => !(o in this.customUniforms)), r = Object.keys(this.customUniforms).some((o) => !(o in e));
|
|
1230
|
+
n || r ? this.recompileWithUniforms(e) : this.customUniforms = e;
|
|
1231
1231
|
}
|
|
1232
|
-
setMouse(e,
|
|
1233
|
-
this.mouseX = e, this.mouseY =
|
|
1232
|
+
setMouse(e, n, r, o) {
|
|
1233
|
+
this.mouseX = e, this.mouseY = n, this.mouseClickX = r, this.mouseClickY = o;
|
|
1234
1234
|
}
|
|
1235
1235
|
draw() {
|
|
1236
1236
|
if (!this.program) return;
|
|
1237
|
-
const e = this.gl,
|
|
1238
|
-
(
|
|
1237
|
+
const e = this.gl, n = e.canvas, r = n.clientWidth, o = n.clientHeight;
|
|
1238
|
+
(n.width !== r || n.height !== o) && (n.width = r, n.height = o, e.viewport(0, 0, r, o));
|
|
1239
1239
|
const s = performance.now(), i = (s - this.startTime) / 1e3, a = (s - this.lastFrameTime) / 1e3;
|
|
1240
1240
|
this.lastFrameTime = s, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
|
|
1241
1241
|
const u = this.uniformLocations.get("iResolution");
|
|
1242
|
-
u && e.uniform3f(u,
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1242
|
+
u && e.uniform3f(u, r, o, 1);
|
|
1243
|
+
const h = this.uniformLocations.get("iTime");
|
|
1244
|
+
h && e.uniform1f(h, i);
|
|
1245
|
+
const p = this.uniformLocations.get("iTimeDelta");
|
|
1246
|
+
p && e.uniform1f(p, a);
|
|
1247
|
+
const m = this.uniformLocations.get("iFrame");
|
|
1248
|
+
m && e.uniform1i(m, this.frameCount);
|
|
1249
1249
|
const y = this.uniformLocations.get("iMouse");
|
|
1250
1250
|
y && e.uniform4f(y, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1251
1251
|
const c = this.uniformLocations.get("iDate");
|
|
@@ -1253,33 +1253,33 @@ class Gr {
|
|
|
1253
1253
|
const l = /* @__PURE__ */ new Date();
|
|
1254
1254
|
e.uniform4f(c, l.getFullYear(), l.getMonth(), l.getDate(), l.getHours() * 3600 + l.getMinutes() * 60 + l.getSeconds() + l.getMilliseconds() / 1e3);
|
|
1255
1255
|
}
|
|
1256
|
-
for (const [l,
|
|
1256
|
+
for (const [l, f] of Object.entries(this.customUniforms)) {
|
|
1257
1257
|
const g = this.uniformLocations.get(l);
|
|
1258
1258
|
if (g)
|
|
1259
|
-
switch (
|
|
1259
|
+
switch (f.type) {
|
|
1260
1260
|
case "float":
|
|
1261
|
-
e.uniform1f(g,
|
|
1261
|
+
e.uniform1f(g, f.value);
|
|
1262
1262
|
break;
|
|
1263
1263
|
case "vec2": {
|
|
1264
|
-
const b =
|
|
1264
|
+
const b = f.value;
|
|
1265
1265
|
e.uniform2f(g, b[0], b[1]);
|
|
1266
1266
|
break;
|
|
1267
1267
|
}
|
|
1268
1268
|
case "vec3": {
|
|
1269
|
-
const b =
|
|
1269
|
+
const b = f.value;
|
|
1270
1270
|
e.uniform3f(g, b[0], b[1], b[2]);
|
|
1271
1271
|
break;
|
|
1272
1272
|
}
|
|
1273
1273
|
case "vec4": {
|
|
1274
|
-
const b =
|
|
1274
|
+
const b = f.value;
|
|
1275
1275
|
e.uniform4f(g, b[0], b[1], b[2], b[3]);
|
|
1276
1276
|
break;
|
|
1277
1277
|
}
|
|
1278
1278
|
case "int":
|
|
1279
|
-
e.uniform1i(g,
|
|
1279
|
+
e.uniform1i(g, f.value);
|
|
1280
1280
|
break;
|
|
1281
1281
|
case "bool":
|
|
1282
|
-
e.uniform1i(g,
|
|
1282
|
+
e.uniform1i(g, f.value ? 1 : 0);
|
|
1283
1283
|
break;
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
@@ -1293,23 +1293,23 @@ class Gr {
|
|
|
1293
1293
|
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();
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function Qn(t) {
|
|
1297
1297
|
if (typeof t == "string") {
|
|
1298
1298
|
const e = t.trim();
|
|
1299
1299
|
return e.length > 0 ? e : void 0;
|
|
1300
1300
|
}
|
|
1301
1301
|
if (Array.isArray(t)) {
|
|
1302
|
-
const e = t.filter((
|
|
1302
|
+
const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
|
|
1303
1303
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1304
1304
|
}
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function er(...t) {
|
|
1307
1307
|
const e = [];
|
|
1308
|
-
for (const
|
|
1309
|
-
|
|
1308
|
+
for (const n of t)
|
|
1309
|
+
n && n.trim() && e.push(n.trim());
|
|
1310
1310
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1312
|
+
function Oe(t) {
|
|
1313
1313
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1314
1314
|
return Math.floor(t);
|
|
1315
1315
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1318,10 +1318,10 @@ function Ie(t) {
|
|
|
1318
1318
|
return Math.floor(e);
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
|
-
function
|
|
1321
|
+
function tr(t) {
|
|
1322
1322
|
return typeof t == "string" ? t : "";
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function nr(t) {
|
|
1325
1325
|
if (typeof t == "boolean")
|
|
1326
1326
|
return t;
|
|
1327
1327
|
if (typeof t == "string") {
|
|
@@ -1330,26 +1330,26 @@ function Qr(t) {
|
|
|
1330
1330
|
if (e === "false") return !1;
|
|
1331
1331
|
}
|
|
1332
1332
|
}
|
|
1333
|
-
function
|
|
1333
|
+
function rr(t) {
|
|
1334
1334
|
if (!t || typeof t != "object")
|
|
1335
1335
|
return {};
|
|
1336
|
-
const e = {},
|
|
1337
|
-
for (const [
|
|
1336
|
+
const e = {}, n = t;
|
|
1337
|
+
for (const [r, o] of Object.entries(n)) {
|
|
1338
1338
|
if (!o || typeof o != "object")
|
|
1339
1339
|
continue;
|
|
1340
1340
|
const s = o, i = s.value, a = s.type;
|
|
1341
|
-
i === void 0 || typeof a != "string" || !["float", "vec2", "vec3", "vec4", "int", "bool"].includes(a) || (e[
|
|
1341
|
+
i === void 0 || typeof a != "string" || !["float", "vec2", "vec3", "vec4", "int", "bool"].includes(a) || (e[r] = {
|
|
1342
1342
|
value: i,
|
|
1343
1343
|
type: a
|
|
1344
1344
|
});
|
|
1345
1345
|
}
|
|
1346
1346
|
return e;
|
|
1347
1347
|
}
|
|
1348
|
-
function
|
|
1349
|
-
const
|
|
1350
|
-
if (
|
|
1348
|
+
function or(t, e) {
|
|
1349
|
+
const n = Object.keys(t), r = Object.keys(e);
|
|
1350
|
+
if (n.length !== r.length)
|
|
1351
1351
|
return !1;
|
|
1352
|
-
for (const o of
|
|
1352
|
+
for (const o of n) {
|
|
1353
1353
|
if (!(o in e))
|
|
1354
1354
|
return !1;
|
|
1355
1355
|
const s = t[o], i = e[o];
|
|
@@ -1366,180 +1366,180 @@ function tn(t, e) {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
return !0;
|
|
1368
1368
|
}
|
|
1369
|
-
const
|
|
1370
|
-
function
|
|
1371
|
-
const t =
|
|
1372
|
-
const s =
|
|
1369
|
+
const sr = "std.shadertoy-canvas";
|
|
1370
|
+
function ir() {
|
|
1371
|
+
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
1372
|
+
const s = X(r.store, n), i = E(null), a = E(null), u = E(null), h = E(0), p = E(""), m = E({}), y = E({
|
|
1373
1373
|
x: 0,
|
|
1374
1374
|
y: 0,
|
|
1375
1375
|
clickX: 0,
|
|
1376
1376
|
clickY: 0,
|
|
1377
1377
|
isDown: !1
|
|
1378
|
-
}), c = s ?
|
|
1379
|
-
|
|
1380
|
-
const
|
|
1381
|
-
if (
|
|
1378
|
+
}), c = s ? tr(s.props?.shaderSource) : "", l = s ? Oe(s.props?.fps) ?? 60 : 60, f = s?.props?.uniforms, g = K(() => rr(f), [f]), b = s ? nr(s.props?.enableMouse) ?? !0 : !0, S = s ? Oe(s.props?.width) : void 0, O = s ? Oe(s.props?.height) : void 0, I = s ? er(Qn(s.props?.className), o) : o;
|
|
1379
|
+
C(() => {
|
|
1380
|
+
const _ = i.current;
|
|
1381
|
+
if (_) {
|
|
1382
1382
|
try {
|
|
1383
|
-
const
|
|
1384
|
-
a.current =
|
|
1385
|
-
} catch (
|
|
1386
|
-
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:",
|
|
1383
|
+
const P = new Zn(_);
|
|
1384
|
+
a.current = P;
|
|
1385
|
+
} catch (P) {
|
|
1386
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
1387
1387
|
}
|
|
1388
1388
|
return () => {
|
|
1389
1389
|
a.current && (a.current.destroy(), a.current = null);
|
|
1390
1390
|
};
|
|
1391
1391
|
}
|
|
1392
|
-
}, []),
|
|
1393
|
-
const
|
|
1394
|
-
if (!(!
|
|
1395
|
-
if (
|
|
1396
|
-
|
|
1392
|
+
}, []), C(() => {
|
|
1393
|
+
const _ = a.current;
|
|
1394
|
+
if (!(!_ || !c) && p.current !== c)
|
|
1395
|
+
if (_.compile(c, g))
|
|
1396
|
+
p.current = c, m.current = g;
|
|
1397
1397
|
else {
|
|
1398
|
-
const
|
|
1399
|
-
console.error("[ShadertoyRenderer] Shader compilation failed:",
|
|
1398
|
+
const F = _.getError();
|
|
1399
|
+
console.error("[ShadertoyRenderer] Shader compilation failed:", F);
|
|
1400
1400
|
}
|
|
1401
|
-
}, [c, g]),
|
|
1402
|
-
const
|
|
1403
|
-
!
|
|
1404
|
-
}, [g]),
|
|
1405
|
-
const
|
|
1406
|
-
if (!
|
|
1407
|
-
const
|
|
1408
|
-
const B =
|
|
1409
|
-
B >=
|
|
1401
|
+
}, [c, g]), C(() => {
|
|
1402
|
+
const _ = a.current;
|
|
1403
|
+
!_ || !p.current || or(m.current, g) || (_.setCustomUniforms(g), m.current = g);
|
|
1404
|
+
}, [g]), C(() => {
|
|
1405
|
+
const _ = a.current;
|
|
1406
|
+
if (!_ || !p.current) return;
|
|
1407
|
+
const P = 1e3 / l, F = (L) => {
|
|
1408
|
+
const B = L - h.current;
|
|
1409
|
+
B >= P && (h.current = L - B % P, _.draw()), u.current = requestAnimationFrame(F);
|
|
1410
1410
|
};
|
|
1411
|
-
return u.current = requestAnimationFrame(
|
|
1411
|
+
return u.current = requestAnimationFrame(F), () => {
|
|
1412
1412
|
u.current !== null && (cancelAnimationFrame(u.current), u.current = null);
|
|
1413
1413
|
};
|
|
1414
1414
|
}, [l]);
|
|
1415
|
-
const
|
|
1416
|
-
(
|
|
1415
|
+
const M = D(
|
|
1416
|
+
(_) => {
|
|
1417
1417
|
if (!b) return;
|
|
1418
|
-
const
|
|
1419
|
-
if (!
|
|
1420
|
-
const
|
|
1421
|
-
y.current.x = B, y.current.y =
|
|
1418
|
+
const P = i.current, F = a.current;
|
|
1419
|
+
if (!P || !F) return;
|
|
1420
|
+
const L = P.getBoundingClientRect(), B = _.clientX - L.left, Y = L.height - (_.clientY - L.top);
|
|
1421
|
+
y.current.x = B, y.current.y = Y, F.setMouse(B, Y, y.current.clickX, y.current.clickY);
|
|
1422
1422
|
},
|
|
1423
1423
|
[b]
|
|
1424
|
-
),
|
|
1425
|
-
(
|
|
1424
|
+
), x = D(
|
|
1425
|
+
(_) => {
|
|
1426
1426
|
if (!b) return;
|
|
1427
|
-
const
|
|
1428
|
-
if (!
|
|
1429
|
-
const
|
|
1430
|
-
y.current.isDown = !0, y.current.clickX = B, y.current.clickY =
|
|
1427
|
+
const P = i.current, F = a.current;
|
|
1428
|
+
if (!P || !F) return;
|
|
1429
|
+
const L = P.getBoundingClientRect(), B = _.clientX - L.left, Y = L.height - (_.clientY - L.top);
|
|
1430
|
+
y.current.isDown = !0, y.current.clickX = B, y.current.clickY = Y, F.setMouse(B, Y, B, Y);
|
|
1431
1431
|
},
|
|
1432
1432
|
[b]
|
|
1433
|
-
), G =
|
|
1433
|
+
), G = D(() => {
|
|
1434
1434
|
b && (y.current.isDown = !1, y.current.clickX = -Math.abs(y.current.clickX));
|
|
1435
1435
|
}, [b]);
|
|
1436
|
-
return s ? /* @__PURE__ */
|
|
1436
|
+
return s ? /* @__PURE__ */ w.jsx(
|
|
1437
1437
|
"canvas",
|
|
1438
1438
|
{
|
|
1439
1439
|
ref: i,
|
|
1440
1440
|
"data-ikon-node-id": s.id,
|
|
1441
1441
|
"data-ikon-source": s.sourceMarker,
|
|
1442
|
-
className:
|
|
1442
|
+
className: I,
|
|
1443
1443
|
...S ? { width: S } : {},
|
|
1444
1444
|
...O ? { height: O } : {},
|
|
1445
|
-
onMouseMove:
|
|
1446
|
-
onMouseDown:
|
|
1445
|
+
onMouseMove: M,
|
|
1446
|
+
onMouseDown: x,
|
|
1447
1447
|
onMouseUp: G,
|
|
1448
1448
|
onMouseLeave: G
|
|
1449
1449
|
}
|
|
1450
1450
|
) : null;
|
|
1451
1451
|
});
|
|
1452
1452
|
return ({ type: e }) => {
|
|
1453
|
-
if (e ===
|
|
1453
|
+
if (e === sr)
|
|
1454
1454
|
return t;
|
|
1455
1455
|
};
|
|
1456
1456
|
}
|
|
1457
|
-
const
|
|
1458
|
-
function
|
|
1459
|
-
t.registerModule(
|
|
1457
|
+
const ar = "shadertoy", cr = async () => ir();
|
|
1458
|
+
function ur(t) {
|
|
1459
|
+
t.registerModule(ar, cr);
|
|
1460
1460
|
}
|
|
1461
|
-
const
|
|
1462
|
-
class
|
|
1461
|
+
const st = re("UIRegistry");
|
|
1462
|
+
class lr {
|
|
1463
1463
|
baseResolvers = [];
|
|
1464
1464
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1465
1465
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
1466
1466
|
activeModuleOrder = [];
|
|
1467
1467
|
registerResolvers(e) {
|
|
1468
|
-
const
|
|
1469
|
-
this.baseResolvers.push(...
|
|
1468
|
+
const n = Array.isArray(e) ? e : [e];
|
|
1469
|
+
this.baseResolvers.push(...n.filter(Boolean));
|
|
1470
1470
|
}
|
|
1471
|
-
registerModule(e,
|
|
1472
|
-
const
|
|
1473
|
-
if (!
|
|
1474
|
-
this.moduleLoaders.set(e,
|
|
1471
|
+
registerModule(e, n) {
|
|
1472
|
+
const r = this.moduleLoaders.get(e);
|
|
1473
|
+
if (!r) {
|
|
1474
|
+
this.moduleLoaders.set(e, n);
|
|
1475
1475
|
return;
|
|
1476
1476
|
}
|
|
1477
|
-
|
|
1477
|
+
r !== n && (this.moduleLoaders.set(e, n), this.moduleResolvers.delete(e));
|
|
1478
1478
|
}
|
|
1479
1479
|
async loadRegisteredModules() {
|
|
1480
1480
|
let e = !1;
|
|
1481
|
-
for (const [
|
|
1482
|
-
if (!this.moduleResolvers.has(
|
|
1481
|
+
for (const [r, o] of this.moduleLoaders.entries())
|
|
1482
|
+
if (!this.moduleResolvers.has(r))
|
|
1483
1483
|
try {
|
|
1484
|
-
const s = await o(), i =
|
|
1485
|
-
this.moduleResolvers.set(
|
|
1484
|
+
const s = await o(), i = hr(s);
|
|
1485
|
+
this.moduleResolvers.set(r, i), e = !0;
|
|
1486
1486
|
} catch (s) {
|
|
1487
|
-
|
|
1487
|
+
st.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
1488
1488
|
}
|
|
1489
|
-
const
|
|
1490
|
-
for (const
|
|
1491
|
-
this.moduleResolvers.has(
|
|
1492
|
-
return
|
|
1489
|
+
const n = [];
|
|
1490
|
+
for (const r of this.moduleLoaders.keys())
|
|
1491
|
+
this.moduleResolvers.has(r) && n.push(r);
|
|
1492
|
+
return pr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
|
|
1493
1493
|
}
|
|
1494
1494
|
resolve(e) {
|
|
1495
|
-
for (const
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1498
|
-
}
|
|
1499
|
-
for (const
|
|
1500
|
-
const
|
|
1501
|
-
if (!
|
|
1502
|
-
|
|
1495
|
+
for (const n of this.baseResolvers) {
|
|
1496
|
+
const r = n(e);
|
|
1497
|
+
if (r) return r;
|
|
1498
|
+
}
|
|
1499
|
+
for (const n of this.activeModuleOrder) {
|
|
1500
|
+
const r = this.moduleResolvers.get(n);
|
|
1501
|
+
if (!r) {
|
|
1502
|
+
st.warn(`Missing resolvers for module ${n}`);
|
|
1503
1503
|
continue;
|
|
1504
1504
|
}
|
|
1505
|
-
for (const o of
|
|
1505
|
+
for (const o of r) {
|
|
1506
1506
|
const s = o(e);
|
|
1507
1507
|
if (s) return s;
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1513
|
-
const t = new
|
|
1514
|
-
return
|
|
1512
|
+
function dr() {
|
|
1513
|
+
const t = new lr();
|
|
1514
|
+
return jn(t), qn(t), ur(t), t.loadRegisteredModules(), t;
|
|
1515
1515
|
}
|
|
1516
|
-
function
|
|
1516
|
+
function fr(t) {
|
|
1517
1517
|
return Array.isArray(t) ? t : [t];
|
|
1518
1518
|
}
|
|
1519
|
-
function
|
|
1520
|
-
return t ?
|
|
1519
|
+
function hr(t) {
|
|
1520
|
+
return t ? fr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1521
1521
|
}
|
|
1522
|
-
function
|
|
1522
|
+
function pr(t, e) {
|
|
1523
1523
|
if (t.length !== e.length)
|
|
1524
1524
|
return !1;
|
|
1525
|
-
for (let
|
|
1526
|
-
if (t[
|
|
1525
|
+
for (let n = 0; n < t.length; n += 1)
|
|
1526
|
+
if (t[n] !== e[n])
|
|
1527
1527
|
return !1;
|
|
1528
1528
|
return !0;
|
|
1529
1529
|
}
|
|
1530
|
-
function
|
|
1531
|
-
return /* @__PURE__ */
|
|
1532
|
-
|
|
1530
|
+
function os({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
1531
|
+
return /* @__PURE__ */ w.jsx(
|
|
1532
|
+
wt,
|
|
1533
1533
|
{
|
|
1534
1534
|
stores: e,
|
|
1535
|
-
registry:
|
|
1535
|
+
registry: n,
|
|
1536
1536
|
category: t,
|
|
1537
|
-
client:
|
|
1537
|
+
client: r,
|
|
1538
1538
|
onAction: o
|
|
1539
1539
|
}
|
|
1540
1540
|
);
|
|
1541
1541
|
}
|
|
1542
|
-
const
|
|
1542
|
+
const Ne = re("MotionController"), it = {
|
|
1543
1543
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1544
1544
|
"ease-in": [0.42, 0, 1, 1],
|
|
1545
1545
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1569,22 +1569,22 @@ const _e = fe("MotionController"), ot = {
|
|
|
1569
1569
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
1570
1570
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
1571
1571
|
};
|
|
1572
|
-
function
|
|
1572
|
+
function V(t) {
|
|
1573
1573
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function at(t) {
|
|
1576
1576
|
if (t == null) return;
|
|
1577
1577
|
const e = `${t}`.trim();
|
|
1578
1578
|
if (!e) return;
|
|
1579
|
-
const
|
|
1580
|
-
return Number.isFinite(
|
|
1579
|
+
const n = Number.parseFloat(e);
|
|
1580
|
+
return Number.isFinite(n) ? n : void 0;
|
|
1581
1581
|
}
|
|
1582
|
-
function
|
|
1582
|
+
function ct(t) {
|
|
1583
1583
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1586
|
-
const
|
|
1587
|
-
function
|
|
1585
|
+
function ut(t, e, n, r) {
|
|
1586
|
+
const p = new Float32Array(11);
|
|
1587
|
+
function m(g, b, S) {
|
|
1588
1588
|
return ((3 * b - 3 * S + 1) * g + (3 * S - 6 * b)) * g * g + 3 * b * g;
|
|
1589
1589
|
}
|
|
1590
1590
|
function y(g, b, S) {
|
|
@@ -1592,75 +1592,75 @@ function at(t, e, r, n) {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
function c(g, b) {
|
|
1594
1594
|
for (let S = 0; S < 4; S += 1) {
|
|
1595
|
-
const O = y(b, t,
|
|
1595
|
+
const O = y(b, t, n);
|
|
1596
1596
|
if (O === 0)
|
|
1597
1597
|
return b;
|
|
1598
|
-
const
|
|
1599
|
-
b -=
|
|
1598
|
+
const I = m(b, t, n) - g;
|
|
1599
|
+
b -= I / O;
|
|
1600
1600
|
}
|
|
1601
1601
|
return b;
|
|
1602
1602
|
}
|
|
1603
1603
|
function l(g, b, S) {
|
|
1604
|
-
let O = 0,
|
|
1604
|
+
let O = 0, I = 0, M = 0;
|
|
1605
1605
|
do
|
|
1606
|
-
|
|
1607
|
-
while (Math.abs(O) > 1e-7 && ++
|
|
1608
|
-
return
|
|
1606
|
+
I = b + (S - b) / 2, O = m(I, t, n) - g, O > 0 ? S = I : b = I;
|
|
1607
|
+
while (Math.abs(O) > 1e-7 && ++M < 10);
|
|
1608
|
+
return I;
|
|
1609
1609
|
}
|
|
1610
|
-
function
|
|
1610
|
+
function f(g) {
|
|
1611
1611
|
let b = 0, S = 1;
|
|
1612
1612
|
const O = 10;
|
|
1613
|
-
for (; S !== O &&
|
|
1613
|
+
for (; S !== O && p[S] <= g; S += 1)
|
|
1614
1614
|
b += 0.1;
|
|
1615
1615
|
S -= 1;
|
|
1616
|
-
const
|
|
1617
|
-
return
|
|
1616
|
+
const I = (g - p[S]) / (p[S + 1] - p[S]), M = b + I * 0.1, x = y(M, t, n);
|
|
1617
|
+
return x >= 1e-3 ? c(g, M) : x === 0 ? M : l(g, b, b + 0.1);
|
|
1618
1618
|
}
|
|
1619
1619
|
for (let g = 0; g < 11; g += 1)
|
|
1620
|
-
|
|
1621
|
-
return (g) => g <= 0 ? 0 : g >= 1 ? 1 :
|
|
1620
|
+
p[g] = m(g * 0.1, t, n);
|
|
1621
|
+
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : m(f(g), e, r);
|
|
1622
1622
|
}
|
|
1623
|
-
function
|
|
1623
|
+
function mr(t) {
|
|
1624
1624
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1625
1625
|
if (!e)
|
|
1626
|
-
return (o) =>
|
|
1627
|
-
const
|
|
1628
|
-
return
|
|
1626
|
+
return (o) => V(o);
|
|
1627
|
+
const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
|
|
1628
|
+
return r === "start" || r === "jump-start" ? (o) => V(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => V(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => V((Math.floor(o * n) + 0.5) / n) : (o) => V(Math.floor(o * n) / n);
|
|
1629
1629
|
}
|
|
1630
|
-
function
|
|
1630
|
+
function gr(t) {
|
|
1631
1631
|
if (!t)
|
|
1632
|
-
return (
|
|
1632
|
+
return (n) => V(n);
|
|
1633
1633
|
const e = t.trim().toLowerCase();
|
|
1634
1634
|
if (!e || e === "linear")
|
|
1635
|
-
return (
|
|
1636
|
-
if (
|
|
1637
|
-
const [
|
|
1638
|
-
return (a) =>
|
|
1635
|
+
return (n) => V(n);
|
|
1636
|
+
if (it[e]) {
|
|
1637
|
+
const [n, r, o, s] = it[e], i = ut(n, r, o, s);
|
|
1638
|
+
return (a) => V(i(V(a)));
|
|
1639
1639
|
}
|
|
1640
1640
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1641
|
-
const
|
|
1642
|
-
if (
|
|
1643
|
-
const [o, s, i, a] =
|
|
1644
|
-
return (
|
|
1641
|
+
const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1642
|
+
if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
|
|
1643
|
+
const [o, s, i, a] = r, u = ut(o, s, i, a);
|
|
1644
|
+
return (h) => V(u(V(h)));
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
1647
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1648
|
-
const
|
|
1649
|
-
return (
|
|
1648
|
+
const n = mr(e);
|
|
1649
|
+
return (r) => n(V(r));
|
|
1650
1650
|
}
|
|
1651
|
-
return (
|
|
1651
|
+
return (n) => V(n);
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1653
|
+
function yr(t) {
|
|
1654
1654
|
if (!t)
|
|
1655
1655
|
return;
|
|
1656
1656
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
1657
1657
|
if (!e)
|
|
1658
1658
|
return;
|
|
1659
|
-
const [
|
|
1660
|
-
if (![
|
|
1661
|
-
return { inStart:
|
|
1659
|
+
const [n, r, o, s] = e.slice(1).map((i) => Number.parseFloat(i));
|
|
1660
|
+
if (![n, r, o, s].some((i) => !Number.isFinite(i)))
|
|
1661
|
+
return { inStart: n, inEnd: r, outStart: o, outEnd: s };
|
|
1662
1662
|
}
|
|
1663
|
-
class
|
|
1663
|
+
class br {
|
|
1664
1664
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1665
1665
|
observer;
|
|
1666
1666
|
observeScheduled = !1;
|
|
@@ -1669,15 +1669,15 @@ class gn {
|
|
|
1669
1669
|
elementStates = /* @__PURE__ */ new Map();
|
|
1670
1670
|
styleToElements = /* @__PURE__ */ new Map();
|
|
1671
1671
|
globalCleanups = /* @__PURE__ */ new Set();
|
|
1672
|
-
registerStyle(e,
|
|
1672
|
+
registerStyle(e, n) {
|
|
1673
1673
|
if (!e)
|
|
1674
1674
|
return;
|
|
1675
|
-
const
|
|
1676
|
-
if (!
|
|
1675
|
+
const r = this.parseMetadata(n);
|
|
1676
|
+
if (!r) {
|
|
1677
1677
|
this.bindingsByStyle.delete(e), this.cleanupStyle(e);
|
|
1678
1678
|
return;
|
|
1679
1679
|
}
|
|
1680
|
-
this.bindingsByStyle.set(e,
|
|
1680
|
+
this.bindingsByStyle.set(e, r), this.cleanupStyle(e), this.ensureObserver(), this.scheduleScan(e);
|
|
1681
1681
|
}
|
|
1682
1682
|
unregisterStyle(e) {
|
|
1683
1683
|
e && (this.bindingsByStyle.delete(e), this.cleanupStyle(e), this.pendingScanStyles.delete(e));
|
|
@@ -1686,42 +1686,42 @@ class gn {
|
|
|
1686
1686
|
for (const e of Array.from(this.globalCleanups))
|
|
1687
1687
|
try {
|
|
1688
1688
|
e();
|
|
1689
|
-
} catch (
|
|
1690
|
-
|
|
1689
|
+
} catch (n) {
|
|
1690
|
+
Ne.warn("Failed to cleanup binding listener", n);
|
|
1691
1691
|
}
|
|
1692
1692
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
|
|
1693
1693
|
}
|
|
1694
1694
|
parseMetadata(e) {
|
|
1695
1695
|
if (e)
|
|
1696
1696
|
try {
|
|
1697
|
-
const
|
|
1698
|
-
return
|
|
1699
|
-
} catch (
|
|
1700
|
-
|
|
1697
|
+
const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1698
|
+
return r.length === 0 ? void 0 : { bindings: r };
|
|
1699
|
+
} catch (n) {
|
|
1700
|
+
Ne.warn("Failed to parse motion metadata", n);
|
|
1701
1701
|
return;
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
1704
|
parseBinding(e) {
|
|
1705
|
-
const
|
|
1706
|
-
if (!
|
|
1705
|
+
const n = e.source?.trim();
|
|
1706
|
+
if (!n)
|
|
1707
1707
|
return;
|
|
1708
|
-
const
|
|
1709
|
-
return Number.isNaN(
|
|
1710
|
-
source:
|
|
1711
|
-
min:
|
|
1708
|
+
const r = at(e.min) ?? 0, o = at(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, u = gr(e.ease), h = yr(e.map), p = e.targetId?.trim() || void 0;
|
|
1709
|
+
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1710
|
+
source: n.toLowerCase(),
|
|
1711
|
+
min: r,
|
|
1712
1712
|
max: s,
|
|
1713
1713
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1714
1714
|
reverse: a,
|
|
1715
1715
|
ease: u,
|
|
1716
|
-
map:
|
|
1717
|
-
targetId:
|
|
1716
|
+
map: h,
|
|
1717
|
+
targetId: p
|
|
1718
1718
|
};
|
|
1719
1719
|
}
|
|
1720
1720
|
ensureObserver() {
|
|
1721
1721
|
if (typeof document > "u" || this.observer)
|
|
1722
1722
|
return;
|
|
1723
1723
|
const e = () => {
|
|
1724
|
-
this.observer || typeof document > "u" || (this.observer = new MutationObserver((
|
|
1724
|
+
this.observer || typeof document > "u" || (this.observer = new MutationObserver((n) => this.handleMutations(n)), this.observer.observe(document.body, {
|
|
1725
1725
|
childList: !0,
|
|
1726
1726
|
subtree: !0,
|
|
1727
1727
|
attributes: !0,
|
|
@@ -1739,7 +1739,7 @@ class gn {
|
|
|
1739
1739
|
scheduleScan(e) {
|
|
1740
1740
|
if (typeof document > "u" || (this.pendingScanStyles.add(e), this.scanScheduled))
|
|
1741
1741
|
return;
|
|
1742
|
-
const
|
|
1742
|
+
const n = () => {
|
|
1743
1743
|
if (this.pendingScanStyles.size === 0) {
|
|
1744
1744
|
this.scanScheduled = !1;
|
|
1745
1745
|
return;
|
|
@@ -1748,82 +1748,82 @@ class gn {
|
|
|
1748
1748
|
this.pendingScanStyles.clear(), this.scanScheduled = !1;
|
|
1749
1749
|
for (const s of o)
|
|
1750
1750
|
this.scanExistingNodes(s);
|
|
1751
|
-
},
|
|
1752
|
-
this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(
|
|
1751
|
+
}, r = () => {
|
|
1752
|
+
this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(n) : setTimeout(n, 0);
|
|
1753
1753
|
};
|
|
1754
1754
|
document.readyState === "loading" ? document.addEventListener(
|
|
1755
1755
|
"DOMContentLoaded",
|
|
1756
1756
|
() => {
|
|
1757
|
-
|
|
1757
|
+
r();
|
|
1758
1758
|
},
|
|
1759
1759
|
{ once: !0 }
|
|
1760
|
-
) :
|
|
1760
|
+
) : r();
|
|
1761
1761
|
}
|
|
1762
1762
|
scanExistingNodes(e) {
|
|
1763
|
-
const
|
|
1764
|
-
if (!
|
|
1763
|
+
const n = this.bindingsByStyle.get(e);
|
|
1764
|
+
if (!n || typeof document > "u")
|
|
1765
1765
|
return;
|
|
1766
|
-
const
|
|
1767
|
-
document.querySelectorAll(
|
|
1766
|
+
const r = `.${ct(e)}`;
|
|
1767
|
+
document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
|
|
1768
1768
|
}
|
|
1769
|
-
applyStyleToElement(e,
|
|
1770
|
-
this.ensureStyleState(e,
|
|
1769
|
+
applyStyleToElement(e, n, r) {
|
|
1770
|
+
this.ensureStyleState(e, n) && this.attachBindings(e, n, r);
|
|
1771
1771
|
}
|
|
1772
|
-
ensureStyleState(e,
|
|
1773
|
-
let
|
|
1774
|
-
if (
|
|
1772
|
+
ensureStyleState(e, n) {
|
|
1773
|
+
let r = this.elementStates.get(e);
|
|
1774
|
+
if (r || (r = /* @__PURE__ */ new Map(), this.elementStates.set(e, r)), r.has(n))
|
|
1775
1775
|
return !1;
|
|
1776
|
-
|
|
1777
|
-
let o = this.styleToElements.get(
|
|
1778
|
-
return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(
|
|
1776
|
+
r.set(n, /* @__PURE__ */ new Set());
|
|
1777
|
+
let o = this.styleToElements.get(n);
|
|
1778
|
+
return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(n, o)), o.add(e), !0;
|
|
1779
1779
|
}
|
|
1780
|
-
attachBindings(e,
|
|
1781
|
-
for (const o of
|
|
1782
|
-
this.attachBinding(e,
|
|
1780
|
+
attachBindings(e, n, r) {
|
|
1781
|
+
for (const o of r.bindings)
|
|
1782
|
+
this.attachBinding(e, n, o);
|
|
1783
1783
|
}
|
|
1784
|
-
attachBinding(e,
|
|
1785
|
-
switch (
|
|
1784
|
+
attachBinding(e, n, r) {
|
|
1785
|
+
switch (r.source) {
|
|
1786
1786
|
case "scrolly":
|
|
1787
|
-
this.attachScrollBinding(e,
|
|
1787
|
+
this.attachScrollBinding(e, n, r);
|
|
1788
1788
|
break;
|
|
1789
1789
|
}
|
|
1790
1790
|
}
|
|
1791
|
-
attachScrollBinding(e,
|
|
1792
|
-
const o = this.resolveScrollContainer(e,
|
|
1791
|
+
attachScrollBinding(e, n, r) {
|
|
1792
|
+
const o = this.resolveScrollContainer(e, r);
|
|
1793
1793
|
if (!o)
|
|
1794
1794
|
return;
|
|
1795
1795
|
const s = () => {
|
|
1796
|
-
this.applyBindingValues(e,
|
|
1796
|
+
this.applyBindingValues(e, r, o.scrollTop);
|
|
1797
1797
|
};
|
|
1798
1798
|
s();
|
|
1799
1799
|
const i = new AbortController();
|
|
1800
|
-
o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e,
|
|
1800
|
+
o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e, n, () => i.abort());
|
|
1801
1801
|
const a = () => s();
|
|
1802
|
-
window.addEventListener("resize", a), this.registerCleanup(e,
|
|
1802
|
+
window.addEventListener("resize", a), this.registerCleanup(e, n, () => window.removeEventListener("resize", a));
|
|
1803
1803
|
}
|
|
1804
|
-
resolveScrollContainer(e,
|
|
1805
|
-
if (
|
|
1806
|
-
const
|
|
1804
|
+
resolveScrollContainer(e, n) {
|
|
1805
|
+
if (n.targetId) {
|
|
1806
|
+
const r = `[data-ikon-motion-source="${ct(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
|
|
1807
1807
|
if (o)
|
|
1808
1808
|
return o;
|
|
1809
1809
|
}
|
|
1810
1810
|
return e.closest('[data-ikon-view-type="scroll-view"]');
|
|
1811
1811
|
}
|
|
1812
|
-
applyBindingValues(e,
|
|
1813
|
-
const o =
|
|
1814
|
-
let i = this.applyClamp(s,
|
|
1815
|
-
|
|
1816
|
-
const a =
|
|
1817
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1812
|
+
applyBindingValues(e, n, r) {
|
|
1813
|
+
const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
|
|
1814
|
+
let i = this.applyClamp(s, n.clamp);
|
|
1815
|
+
n.reverse && (i = 1 - i);
|
|
1816
|
+
const a = n.ease(i), u = Number.isFinite(a) ? a : 0, h = u * 100;
|
|
1817
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${u}`), e.style.setProperty("--tw-motion-bind-progress", `${h}`), n.map) {
|
|
1818
|
+
const p = this.applyMap(h, n.map);
|
|
1819
|
+
p !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${p}`);
|
|
1820
1820
|
} else
|
|
1821
1821
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1822
1822
|
}
|
|
1823
|
-
applyClamp(e,
|
|
1823
|
+
applyClamp(e, n) {
|
|
1824
1824
|
if (!Number.isFinite(e))
|
|
1825
1825
|
return 0;
|
|
1826
|
-
switch (
|
|
1826
|
+
switch (n) {
|
|
1827
1827
|
case "freeze-start":
|
|
1828
1828
|
return e < 0 ? 0 : e;
|
|
1829
1829
|
case "freeze-end":
|
|
@@ -1831,265 +1831,265 @@ class gn {
|
|
|
1831
1831
|
case "unclamped":
|
|
1832
1832
|
return e;
|
|
1833
1833
|
default:
|
|
1834
|
-
return
|
|
1834
|
+
return V(e);
|
|
1835
1835
|
}
|
|
1836
1836
|
}
|
|
1837
|
-
applyMap(e,
|
|
1838
|
-
const
|
|
1839
|
-
if (
|
|
1840
|
-
return
|
|
1841
|
-
const o = (e -
|
|
1842
|
-
return
|
|
1837
|
+
applyMap(e, n) {
|
|
1838
|
+
const r = n.inEnd - n.inStart;
|
|
1839
|
+
if (r === 0)
|
|
1840
|
+
return n.outEnd;
|
|
1841
|
+
const o = (e - n.inStart) / r;
|
|
1842
|
+
return n.outStart + o * (n.outEnd - n.outStart);
|
|
1843
1843
|
}
|
|
1844
|
-
registerCleanup(e,
|
|
1845
|
-
const s = this.elementStates.get(e)?.get(
|
|
1846
|
-
s && (s.add(
|
|
1844
|
+
registerCleanup(e, n, r) {
|
|
1845
|
+
const s = this.elementStates.get(e)?.get(n);
|
|
1846
|
+
s && (s.add(r), this.globalCleanups.add(r));
|
|
1847
1847
|
}
|
|
1848
1848
|
cleanupStyle(e) {
|
|
1849
|
-
const
|
|
1850
|
-
if (!
|
|
1849
|
+
const n = this.styleToElements.get(e);
|
|
1850
|
+
if (!n)
|
|
1851
1851
|
return;
|
|
1852
|
-
const
|
|
1853
|
-
for (const o of
|
|
1852
|
+
const r = Array.from(n);
|
|
1853
|
+
for (const o of r)
|
|
1854
1854
|
this.cleanupElementStyle(o, e);
|
|
1855
1855
|
this.styleToElements.delete(e);
|
|
1856
1856
|
}
|
|
1857
1857
|
cleanupElement(e) {
|
|
1858
|
-
const
|
|
1859
|
-
if (!
|
|
1858
|
+
const n = this.elementStates.get(e);
|
|
1859
|
+
if (!n)
|
|
1860
1860
|
return;
|
|
1861
|
-
const
|
|
1862
|
-
for (const o of
|
|
1861
|
+
const r = Array.from(n.keys());
|
|
1862
|
+
for (const o of r)
|
|
1863
1863
|
this.cleanupElementStyle(e, o);
|
|
1864
1864
|
}
|
|
1865
|
-
cleanupElementStyle(e,
|
|
1866
|
-
const
|
|
1867
|
-
if (!
|
|
1865
|
+
cleanupElementStyle(e, n) {
|
|
1866
|
+
const r = this.elementStates.get(e);
|
|
1867
|
+
if (!r)
|
|
1868
1868
|
return;
|
|
1869
|
-
const o =
|
|
1869
|
+
const o = r.get(n);
|
|
1870
1870
|
if (!o)
|
|
1871
1871
|
return;
|
|
1872
1872
|
for (const i of o) {
|
|
1873
1873
|
try {
|
|
1874
1874
|
i();
|
|
1875
1875
|
} catch (a) {
|
|
1876
|
-
|
|
1876
|
+
Ne.warn("Failed to cleanup listener", a);
|
|
1877
1877
|
}
|
|
1878
1878
|
this.globalCleanups.delete(i);
|
|
1879
1879
|
}
|
|
1880
|
-
o.clear(),
|
|
1881
|
-
const s = this.styleToElements.get(
|
|
1882
|
-
s && (s.delete(e), s.size === 0 && this.styleToElements.delete(
|
|
1880
|
+
o.clear(), r.delete(n);
|
|
1881
|
+
const s = this.styleToElements.get(n);
|
|
1882
|
+
s && (s.delete(e), s.size === 0 && this.styleToElements.delete(n)), r.size === 0 && (this.elementStates.delete(e), this.clearBindingProperties(e));
|
|
1883
1883
|
}
|
|
1884
1884
|
clearBindingProperties(e) {
|
|
1885
1885
|
e.style.removeProperty("--tw-motion-bind-source-value"), e.style.removeProperty("--tw-motion-bind-progress"), e.style.removeProperty("--tw-motion-bind-progress-ratio"), e.style.removeProperty("--tw-motion-bind-value");
|
|
1886
1886
|
}
|
|
1887
1887
|
handleMutations(e) {
|
|
1888
|
-
for (const
|
|
1889
|
-
|
|
1888
|
+
for (const n of e)
|
|
1889
|
+
n.type === "childList" ? (n.addedNodes.forEach((r) => this.scanNode(r)), n.removedNodes.forEach((r) => this.cleanupNode(r))) : n.type === "attributes" && n.target instanceof HTMLElement && this.handleClassMutation(n.target);
|
|
1890
1890
|
}
|
|
1891
1891
|
handleClassMutation(e) {
|
|
1892
|
-
const
|
|
1893
|
-
if (!
|
|
1892
|
+
const n = this.elementStates.get(e);
|
|
1893
|
+
if (!n) {
|
|
1894
1894
|
this.processElement(e);
|
|
1895
1895
|
return;
|
|
1896
1896
|
}
|
|
1897
|
-
for (const
|
|
1898
|
-
e.classList.contains(
|
|
1897
|
+
for (const r of n.keys())
|
|
1898
|
+
e.classList.contains(r) || this.cleanupElementStyle(e, r);
|
|
1899
1899
|
this.processElement(e);
|
|
1900
1900
|
}
|
|
1901
1901
|
scanNode(e) {
|
|
1902
1902
|
if (!(e instanceof HTMLElement))
|
|
1903
1903
|
return;
|
|
1904
|
-
this.processElement(e), e.querySelectorAll("[class]").forEach((
|
|
1904
|
+
this.processElement(e), e.querySelectorAll("[class]").forEach((r) => this.processElement(r));
|
|
1905
1905
|
}
|
|
1906
1906
|
cleanupNode(e) {
|
|
1907
1907
|
if (!(e instanceof HTMLElement))
|
|
1908
1908
|
return;
|
|
1909
|
-
this.cleanupElement(e), e.querySelectorAll("[class]").forEach((
|
|
1909
|
+
this.cleanupElement(e), e.querySelectorAll("[class]").forEach((r) => this.cleanupElement(r));
|
|
1910
1910
|
}
|
|
1911
1911
|
processElement(e) {
|
|
1912
1912
|
if (!e.classList || e.classList.length === 0)
|
|
1913
1913
|
return;
|
|
1914
|
-
const
|
|
1915
|
-
for (let
|
|
1916
|
-
const o = r
|
|
1914
|
+
const n = e.classList;
|
|
1915
|
+
for (let r = 0; r < n.length; r++) {
|
|
1916
|
+
const o = n[r], s = this.bindingsByStyle.get(o);
|
|
1917
1917
|
s && this.ensureStyleState(e, o) && this.attachBindings(e, o, s);
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
1920
|
}
|
|
1921
|
-
const
|
|
1922
|
-
function
|
|
1923
|
-
const e =
|
|
1921
|
+
const Me = new br();
|
|
1922
|
+
function Sr(t) {
|
|
1923
|
+
const e = E(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
|
|
1924
1924
|
if (!(!s || typeof document > "u")) {
|
|
1925
1925
|
if (i) {
|
|
1926
1926
|
let u = e.current.get(s);
|
|
1927
1927
|
u || (u = document.createElement("style"), u.setAttribute("data-ikon-style-id", s), document.head.appendChild(u), e.current.set(s, u)), u.textContent = i;
|
|
1928
1928
|
}
|
|
1929
|
-
|
|
1929
|
+
Me.registerStyle(s, a);
|
|
1930
1930
|
}
|
|
1931
|
-
}, []),
|
|
1931
|
+
}, []), r = D((s) => {
|
|
1932
1932
|
if (!(typeof document > "u"))
|
|
1933
1933
|
for (const i of s) {
|
|
1934
1934
|
const a = e.current.get(i);
|
|
1935
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1935
|
+
a && (a.remove(), e.current.delete(i)), Me.unregisterStyle(i);
|
|
1936
1936
|
}
|
|
1937
|
-
}, []), o =
|
|
1937
|
+
}, []), o = D(() => {
|
|
1938
1938
|
if (typeof document < "u") {
|
|
1939
1939
|
for (const s of e.current.values())
|
|
1940
1940
|
s.remove();
|
|
1941
1941
|
e.current.clear();
|
|
1942
1942
|
}
|
|
1943
|
-
|
|
1943
|
+
Me.reset();
|
|
1944
1944
|
}, []);
|
|
1945
|
-
return
|
|
1945
|
+
return C(() => {
|
|
1946
1946
|
if (!t) return;
|
|
1947
1947
|
for (const a of t.getUiStyles())
|
|
1948
|
-
|
|
1949
|
-
const s = t.subscribeToStyles(
|
|
1948
|
+
n(a);
|
|
1949
|
+
const s = t.subscribeToStyles(n), i = t.subscribeToStyleDeletes?.(r);
|
|
1950
1950
|
return () => {
|
|
1951
1951
|
s?.(), i?.(), o();
|
|
1952
1952
|
};
|
|
1953
|
-
}, [t, o,
|
|
1953
|
+
}, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
1954
1954
|
}
|
|
1955
|
-
function
|
|
1955
|
+
function wr(t) {
|
|
1956
1956
|
const e = [];
|
|
1957
|
-
for (const [
|
|
1958
|
-
const o =
|
|
1959
|
-
e.push(`${
|
|
1957
|
+
for (const [n, r] of t) {
|
|
1958
|
+
const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
1959
|
+
e.push(`${n}:${s ? "1" : "0"}`);
|
|
1960
1960
|
}
|
|
1961
1961
|
return e.sort(), e.join(",");
|
|
1962
1962
|
}
|
|
1963
|
-
function
|
|
1964
|
-
const [e,
|
|
1965
|
-
return
|
|
1963
|
+
function vr(t) {
|
|
1964
|
+
const [e, n] = j(), r = E("");
|
|
1965
|
+
return C(() => {
|
|
1966
1966
|
if (!t) {
|
|
1967
|
-
|
|
1967
|
+
n(void 0), r.current = "";
|
|
1968
1968
|
return;
|
|
1969
1969
|
}
|
|
1970
1970
|
const o = () => {
|
|
1971
|
-
const s = t.getStores(), i =
|
|
1972
|
-
i !==
|
|
1971
|
+
const s = t.getStores(), i = wr(s);
|
|
1972
|
+
i !== r.current && (r.current = i, n(s));
|
|
1973
1973
|
};
|
|
1974
1974
|
return o(), t.subscribe(o);
|
|
1975
1975
|
}, [t]), e;
|
|
1976
1976
|
}
|
|
1977
|
-
var
|
|
1978
|
-
function
|
|
1979
|
-
var e =
|
|
1977
|
+
var Er = typeof global == "object" && global && global.Object === Object && global, Rr = typeof self == "object" && self && self.Object === Object && self, kr = Er || Rr || Function("return this")(), Ae = kr.Symbol, Tt = Object.prototype, Ar = Tt.hasOwnProperty, Tr = Tt.toString, de = Ae ? Ae.toStringTag : void 0;
|
|
1978
|
+
function Cr(t) {
|
|
1979
|
+
var e = Ar.call(t, de), n = t[de];
|
|
1980
1980
|
try {
|
|
1981
|
-
t[
|
|
1982
|
-
var
|
|
1981
|
+
t[de] = void 0;
|
|
1982
|
+
var r = !0;
|
|
1983
1983
|
} catch {
|
|
1984
1984
|
}
|
|
1985
|
-
var o =
|
|
1986
|
-
return
|
|
1985
|
+
var o = Tr.call(t);
|
|
1986
|
+
return r && (e ? t[de] = n : delete t[de]), o;
|
|
1987
1987
|
}
|
|
1988
|
-
var
|
|
1989
|
-
function
|
|
1990
|
-
return
|
|
1988
|
+
var Ir = Object.prototype, _r = Ir.toString;
|
|
1989
|
+
function Or(t) {
|
|
1990
|
+
return _r.call(t);
|
|
1991
1991
|
}
|
|
1992
|
-
var
|
|
1993
|
-
function
|
|
1994
|
-
return t == null ? t === void 0 ?
|
|
1992
|
+
var Nr = "[object Null]", Mr = "[object Undefined]", lt = Ae ? Ae.toStringTag : void 0;
|
|
1993
|
+
function Pr(t) {
|
|
1994
|
+
return t == null ? t === void 0 ? Mr : Nr : lt && lt in Object(t) ? Cr(t) : Or(t);
|
|
1995
1995
|
}
|
|
1996
|
-
function
|
|
1996
|
+
function xr(t) {
|
|
1997
1997
|
return t != null && typeof t == "object";
|
|
1998
1998
|
}
|
|
1999
|
-
var
|
|
2000
|
-
function
|
|
2001
|
-
return typeof t == "string" || !
|
|
1999
|
+
var Lr = Array.isArray, jr = "[object String]";
|
|
2000
|
+
function Ur(t) {
|
|
2001
|
+
return typeof t == "string" || !Lr(t) && xr(t) && Pr(t) == jr;
|
|
2002
2002
|
}
|
|
2003
|
-
const
|
|
2004
|
-
function
|
|
2003
|
+
const dt = "ikonUiModules";
|
|
2004
|
+
function $e(t) {
|
|
2005
2005
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2006
2006
|
}
|
|
2007
|
-
function
|
|
2007
|
+
function Dr(t) {
|
|
2008
2008
|
if (!Array.isArray(t))
|
|
2009
2009
|
return;
|
|
2010
2010
|
const e = /* @__PURE__ */ new Set();
|
|
2011
|
-
for (const
|
|
2012
|
-
if (!
|
|
2013
|
-
const
|
|
2014
|
-
|
|
2011
|
+
for (const n of t) {
|
|
2012
|
+
if (!Ur(n)) continue;
|
|
2013
|
+
const r = n.trim();
|
|
2014
|
+
r && (e.has(r) || e.add(r));
|
|
2015
2015
|
}
|
|
2016
2016
|
return Array.from(e);
|
|
2017
2017
|
}
|
|
2018
|
-
function
|
|
2018
|
+
function ss(t, e) {
|
|
2019
2019
|
if (t === e)
|
|
2020
2020
|
return !0;
|
|
2021
2021
|
if (!t || !e)
|
|
2022
2022
|
return !t && !e;
|
|
2023
2023
|
if (t.length !== e.length)
|
|
2024
2024
|
return !1;
|
|
2025
|
-
for (let
|
|
2026
|
-
if (t[
|
|
2025
|
+
for (let n = 0; n < t.length; n += 1)
|
|
2026
|
+
if (t[n] !== e[n])
|
|
2027
2027
|
return !1;
|
|
2028
2028
|
return !0;
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2031
|
-
if (!(
|
|
2032
|
-
return
|
|
2030
|
+
function Fr(t) {
|
|
2031
|
+
if (!(!$e(t) || !Object.prototype.hasOwnProperty.call(t, dt)))
|
|
2032
|
+
return Dr(t[dt]);
|
|
2033
2033
|
}
|
|
2034
|
-
function
|
|
2034
|
+
function is(...t) {
|
|
2035
2035
|
for (const e of t) {
|
|
2036
|
-
const
|
|
2037
|
-
if (
|
|
2038
|
-
return
|
|
2036
|
+
const n = Fr(e);
|
|
2037
|
+
if (n !== void 0)
|
|
2038
|
+
return n;
|
|
2039
2039
|
}
|
|
2040
2040
|
}
|
|
2041
|
-
function
|
|
2042
|
-
if (
|
|
2041
|
+
function as(t) {
|
|
2042
|
+
if (!$e(t))
|
|
2043
2043
|
return;
|
|
2044
|
-
const e = t,
|
|
2045
|
-
if (!
|
|
2044
|
+
const e = t, n = Object.keys(e).find((u) => u.toLowerCase() === "modules");
|
|
2045
|
+
if (!n)
|
|
2046
2046
|
return;
|
|
2047
|
-
const
|
|
2048
|
-
if (
|
|
2047
|
+
const r = e[n];
|
|
2048
|
+
if (r === null)
|
|
2049
2049
|
return { resetToDefault: !0 };
|
|
2050
|
-
if (!Array.isArray(
|
|
2050
|
+
if (!Array.isArray(r))
|
|
2051
2051
|
return;
|
|
2052
2052
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
2053
|
-
for (const u of
|
|
2053
|
+
for (const u of r) {
|
|
2054
2054
|
if (typeof u == "string") {
|
|
2055
|
-
const
|
|
2056
|
-
if (!
|
|
2055
|
+
const f = u.trim();
|
|
2056
|
+
if (!f || i.has(f))
|
|
2057
2057
|
continue;
|
|
2058
|
-
o.push(
|
|
2058
|
+
o.push(f), i.add(f);
|
|
2059
2059
|
continue;
|
|
2060
2060
|
}
|
|
2061
|
-
if (
|
|
2061
|
+
if (!$e(u))
|
|
2062
2062
|
continue;
|
|
2063
|
-
const
|
|
2064
|
-
if (!
|
|
2063
|
+
const h = u, p = Object.keys(h).find((f) => f.toLowerCase() === "name");
|
|
2064
|
+
if (!p)
|
|
2065
2065
|
continue;
|
|
2066
|
-
const
|
|
2067
|
-
if (typeof
|
|
2066
|
+
const m = h[p];
|
|
2067
|
+
if (typeof m != "string")
|
|
2068
2068
|
continue;
|
|
2069
|
-
const y =
|
|
2069
|
+
const y = m.trim();
|
|
2070
2070
|
if (!y)
|
|
2071
2071
|
continue;
|
|
2072
|
-
const c = Object.keys(
|
|
2072
|
+
const c = Object.keys(h).find((f) => f.toLowerCase() === "javascript"), l = c ? h[c] : void 0;
|
|
2073
2073
|
typeof l == "string" && s.set(y, l), i.has(y) || (o.push(y), i.add(y));
|
|
2074
2074
|
}
|
|
2075
2075
|
if (!o.length && s.size === 0)
|
|
2076
2076
|
return { modules: [] };
|
|
2077
|
-
const a = Array.from(s.entries()).map(([u,
|
|
2077
|
+
const a = Array.from(s.entries()).map(([u, h]) => ({
|
|
2078
2078
|
name: u,
|
|
2079
|
-
javascript:
|
|
2079
|
+
javascript: h
|
|
2080
2080
|
}));
|
|
2081
2081
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
2082
2082
|
}
|
|
2083
|
-
const
|
|
2083
|
+
const R = {
|
|
2084
2084
|
None: 0,
|
|
2085
2085
|
Letter: 1,
|
|
2086
2086
|
Word: 2,
|
|
2087
2087
|
Line: 4,
|
|
2088
2088
|
Paragraph: 8,
|
|
2089
2089
|
Emoji: 16
|
|
2090
|
-
},
|
|
2090
|
+
}, Br = [
|
|
2091
2091
|
{
|
|
2092
|
-
flag:
|
|
2092
|
+
flag: R.Letter,
|
|
2093
2093
|
hints: [
|
|
2094
2094
|
"[data-motion-letter]",
|
|
2095
2095
|
"[data-letter]",
|
|
@@ -2098,7 +2098,7 @@ const k = {
|
|
|
2098
2098
|
]
|
|
2099
2099
|
},
|
|
2100
2100
|
{
|
|
2101
|
-
flag:
|
|
2101
|
+
flag: R.Word,
|
|
2102
2102
|
hints: [
|
|
2103
2103
|
"[data-motion-word]",
|
|
2104
2104
|
"[data-word]",
|
|
@@ -2107,7 +2107,7 @@ const k = {
|
|
|
2107
2107
|
]
|
|
2108
2108
|
},
|
|
2109
2109
|
{
|
|
2110
|
-
flag:
|
|
2110
|
+
flag: R.Line,
|
|
2111
2111
|
hints: [
|
|
2112
2112
|
"[data-motion-line]",
|
|
2113
2113
|
"[data-line]",
|
|
@@ -2116,7 +2116,7 @@ const k = {
|
|
|
2116
2116
|
]
|
|
2117
2117
|
},
|
|
2118
2118
|
{
|
|
2119
|
-
flag:
|
|
2119
|
+
flag: R.Paragraph,
|
|
2120
2120
|
hints: [
|
|
2121
2121
|
"[data-motion-paragraph]",
|
|
2122
2122
|
"[data-paragraph]",
|
|
@@ -2127,7 +2127,7 @@ const k = {
|
|
|
2127
2127
|
]
|
|
2128
2128
|
},
|
|
2129
2129
|
{
|
|
2130
|
-
flag:
|
|
2130
|
+
flag: R.Emoji,
|
|
2131
2131
|
hints: [
|
|
2132
2132
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
2133
2133
|
"[data-motion-emoji]",
|
|
@@ -2136,160 +2136,160 @@ const k = {
|
|
|
2136
2136
|
"[data-emoji]"
|
|
2137
2137
|
]
|
|
2138
2138
|
}
|
|
2139
|
-
],
|
|
2140
|
-
function
|
|
2141
|
-
if (!t || t.length >
|
|
2139
|
+
], Ve = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji, $r = R.Letter | R.Word | R.Line | R.Paragraph, ft = /* @__PURE__ */ new Map(), Vr = 16384;
|
|
2140
|
+
function cs(t, e) {
|
|
2141
|
+
if (!t || t.length > Vr)
|
|
2142
2142
|
return t;
|
|
2143
|
-
const
|
|
2144
|
-
if (o ===
|
|
2143
|
+
const n = so(e), r = ne(n, R.Emoji), o = n & $r;
|
|
2144
|
+
if (o === R.None && !r)
|
|
2145
2145
|
return t;
|
|
2146
2146
|
const s = t.replace(/\r\n/g, `
|
|
2147
2147
|
`).replace(/\r/g, `
|
|
2148
2148
|
`);
|
|
2149
|
-
if (o ===
|
|
2150
|
-
return
|
|
2151
|
-
const i =
|
|
2149
|
+
if (o === R.None)
|
|
2150
|
+
return gt(s);
|
|
2151
|
+
const i = ro(s);
|
|
2152
2152
|
if (i.length === 0)
|
|
2153
|
-
return
|
|
2154
|
-
const a =
|
|
2155
|
-
for (const
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2153
|
+
return r ? gt(s) : t;
|
|
2154
|
+
const a = oo(i), u = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, h = [];
|
|
2155
|
+
for (const p of a) {
|
|
2156
|
+
const m = Kr(p, n, u);
|
|
2157
|
+
h.push(...m);
|
|
2158
2158
|
}
|
|
2159
|
-
return
|
|
2159
|
+
return h;
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const
|
|
2161
|
+
function Kr(t, e, n) {
|
|
2162
|
+
const r = [];
|
|
2163
2163
|
for (const o of t) {
|
|
2164
|
-
const s =
|
|
2165
|
-
|
|
2164
|
+
const s = Yr(o, e, n);
|
|
2165
|
+
r.push(...s);
|
|
2166
2166
|
}
|
|
2167
|
-
if (
|
|
2168
|
-
const o =
|
|
2167
|
+
if (ne(e, R.Paragraph)) {
|
|
2168
|
+
const o = n.paragraph++;
|
|
2169
2169
|
return [
|
|
2170
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ w.jsx(
|
|
2171
2171
|
"span",
|
|
2172
2172
|
{
|
|
2173
2173
|
"data-motion-paragraph": !0,
|
|
2174
|
-
style:
|
|
2175
|
-
children:
|
|
2174
|
+
style: Ie(o),
|
|
2175
|
+
children: r
|
|
2176
2176
|
},
|
|
2177
2177
|
`motion-paragraph-${o}`
|
|
2178
2178
|
)
|
|
2179
2179
|
];
|
|
2180
2180
|
}
|
|
2181
|
-
return
|
|
2181
|
+
return r;
|
|
2182
2182
|
}
|
|
2183
|
-
function
|
|
2184
|
-
const
|
|
2185
|
-
if (
|
|
2186
|
-
const s =
|
|
2183
|
+
function Yr(t, e, n) {
|
|
2184
|
+
const r = zr(t.text, e, n), o = [];
|
|
2185
|
+
if (ne(e, R.Line)) {
|
|
2186
|
+
const s = n.line++;
|
|
2187
2187
|
o.push(
|
|
2188
|
-
/* @__PURE__ */
|
|
2188
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-line": !0, style: Ie(s), children: r }, `motion-line-${s}`)
|
|
2189
2189
|
);
|
|
2190
2190
|
} else
|
|
2191
|
-
o.push(...
|
|
2191
|
+
o.push(...r);
|
|
2192
2192
|
for (let s = 0; s < t.breaks; s++)
|
|
2193
|
-
o.push(/* @__PURE__ */
|
|
2193
|
+
o.push(/* @__PURE__ */ w.jsx("br", {}, `motion-break-${n.br++}`));
|
|
2194
2194
|
return o;
|
|
2195
2195
|
}
|
|
2196
|
-
function
|
|
2196
|
+
function zr(t, e, n) {
|
|
2197
2197
|
if (!t)
|
|
2198
2198
|
return [];
|
|
2199
|
-
const
|
|
2199
|
+
const r = ne(e, R.Word), o = [], s = /(\s+)/g;
|
|
2200
2200
|
let i = 0, a;
|
|
2201
2201
|
for (; (a = s.exec(t)) !== null; ) {
|
|
2202
2202
|
if (a.index > i) {
|
|
2203
2203
|
const u = t.slice(i, a.index);
|
|
2204
|
-
o.push(
|
|
2204
|
+
o.push(ht(u, n, e, r));
|
|
2205
2205
|
}
|
|
2206
2206
|
o.push(a[0]), i = a.index + a[0].length;
|
|
2207
2207
|
}
|
|
2208
2208
|
if (i < t.length) {
|
|
2209
2209
|
const u = t.slice(i);
|
|
2210
|
-
o.push(
|
|
2210
|
+
o.push(ht(u, n, e, r));
|
|
2211
2211
|
}
|
|
2212
2212
|
return o;
|
|
2213
2213
|
}
|
|
2214
|
-
function
|
|
2215
|
-
const o = e.word++, s =
|
|
2216
|
-
return
|
|
2214
|
+
function ht(t, e, n, r) {
|
|
2215
|
+
const o = e.word++, s = Hr(t, n, e), i = `motion-word-${o}`, a = Wr(o, r);
|
|
2216
|
+
return r ? /* @__PURE__ */ w.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ w.jsx("span", { style: a, children: s }, i);
|
|
2217
2217
|
}
|
|
2218
|
-
function
|
|
2219
|
-
return e ? { ...
|
|
2218
|
+
function Wr(t, e) {
|
|
2219
|
+
return e ? { ...Ie(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2220
2220
|
}
|
|
2221
|
-
function
|
|
2221
|
+
function Hr(t, e, n) {
|
|
2222
2222
|
if (!t)
|
|
2223
2223
|
return [];
|
|
2224
|
-
const
|
|
2225
|
-
if (!
|
|
2224
|
+
const r = ne(e, R.Letter), o = ne(e, R.Emoji);
|
|
2225
|
+
if (!r) {
|
|
2226
2226
|
if (!o)
|
|
2227
2227
|
return [t];
|
|
2228
|
-
const a =
|
|
2228
|
+
const a = Ke(t);
|
|
2229
2229
|
if (a.length === 0)
|
|
2230
2230
|
return [t];
|
|
2231
|
-
const { nodes: u } =
|
|
2231
|
+
const { nodes: u } = It(a, n);
|
|
2232
2232
|
return u;
|
|
2233
2233
|
}
|
|
2234
|
-
const s = [], i =
|
|
2234
|
+
const s = [], i = Ke(t);
|
|
2235
2235
|
for (const a of i) {
|
|
2236
|
-
const u =
|
|
2236
|
+
const u = n.letter++, h = `motion-letter-${u}`, p = Ie(u);
|
|
2237
2237
|
if (a === `
|
|
2238
2238
|
`) {
|
|
2239
2239
|
s.push(
|
|
2240
|
-
/* @__PURE__ */
|
|
2240
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: p, children: /* @__PURE__ */ w.jsx("br", {}) }, h)
|
|
2241
2241
|
);
|
|
2242
2242
|
continue;
|
|
2243
2243
|
}
|
|
2244
|
-
const y = o &&
|
|
2244
|
+
const y = o && Ct(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
|
|
2245
2245
|
s.push(
|
|
2246
|
-
/* @__PURE__ */
|
|
2246
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: p, ...y, children: c }, h)
|
|
2247
2247
|
);
|
|
2248
2248
|
}
|
|
2249
2249
|
return s;
|
|
2250
2250
|
}
|
|
2251
|
-
function
|
|
2251
|
+
function Ke(t) {
|
|
2252
2252
|
if (!t)
|
|
2253
2253
|
return [];
|
|
2254
|
-
const e =
|
|
2255
|
-
return e ? Array.from(e.segment(t), (
|
|
2254
|
+
const e = qr();
|
|
2255
|
+
return e ? Array.from(e.segment(t), (n) => n.segment) : Gr(t);
|
|
2256
2256
|
}
|
|
2257
|
-
let
|
|
2258
|
-
function
|
|
2259
|
-
return
|
|
2257
|
+
let fe;
|
|
2258
|
+
function qr() {
|
|
2259
|
+
return fe !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? fe = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : fe = null), fe;
|
|
2260
2260
|
}
|
|
2261
|
-
function
|
|
2262
|
-
const e = [],
|
|
2263
|
-
let
|
|
2264
|
-
for (let o = 0; o <
|
|
2265
|
-
const s =
|
|
2266
|
-
|
|
2261
|
+
function Gr(t) {
|
|
2262
|
+
const e = [], n = Array.from(t);
|
|
2263
|
+
let r = "";
|
|
2264
|
+
for (let o = 0; o < n.length; o++) {
|
|
2265
|
+
const s = n[o], i = n[o + 1];
|
|
2266
|
+
r += s, !(i && Jr(s, i)) && (e.push(r), r = "");
|
|
2267
2267
|
}
|
|
2268
|
-
return
|
|
2268
|
+
return r && e.push(r), e;
|
|
2269
2269
|
}
|
|
2270
|
-
function
|
|
2271
|
-
return e ? !!(
|
|
2270
|
+
function Jr(t, e) {
|
|
2271
|
+
return e ? !!(pt(t) || pt(e) || Qr(e) || Xr(e) || Zr(e) || mt(t) && mt(e)) : !1;
|
|
2272
2272
|
}
|
|
2273
|
-
function
|
|
2273
|
+
function pt(t) {
|
|
2274
2274
|
return t.codePointAt(0) === 8205;
|
|
2275
2275
|
}
|
|
2276
|
-
function
|
|
2276
|
+
function Xr(t) {
|
|
2277
2277
|
const e = t.codePointAt(0);
|
|
2278
2278
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2279
2279
|
}
|
|
2280
|
-
function
|
|
2280
|
+
function Zr(t) {
|
|
2281
2281
|
const e = t.codePointAt(0);
|
|
2282
2282
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2283
2283
|
}
|
|
2284
|
-
function
|
|
2284
|
+
function mt(t) {
|
|
2285
2285
|
const e = t.codePointAt(0);
|
|
2286
2286
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2287
2287
|
}
|
|
2288
|
-
let
|
|
2289
|
-
function
|
|
2290
|
-
return t ? (
|
|
2288
|
+
let Pe;
|
|
2289
|
+
function Qr(t) {
|
|
2290
|
+
return t ? (Pe || (Pe = eo()), Pe(t)) : !1;
|
|
2291
2291
|
}
|
|
2292
|
-
function
|
|
2292
|
+
function eo() {
|
|
2293
2293
|
try {
|
|
2294
2294
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2295
2295
|
return (e) => t.test(e);
|
|
@@ -2300,55 +2300,55 @@ function Zn() {
|
|
|
2300
2300
|
};
|
|
2301
2301
|
}
|
|
2302
2302
|
}
|
|
2303
|
-
let
|
|
2304
|
-
function
|
|
2305
|
-
return t ? (
|
|
2303
|
+
let xe;
|
|
2304
|
+
function Ct(t) {
|
|
2305
|
+
return t ? (xe || (xe = to()), xe(t)) : !1;
|
|
2306
2306
|
}
|
|
2307
|
-
function
|
|
2307
|
+
function to() {
|
|
2308
2308
|
try {
|
|
2309
2309
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2310
2310
|
return (e) => t.test(e);
|
|
2311
2311
|
} catch {
|
|
2312
|
-
return
|
|
2312
|
+
return no;
|
|
2313
2313
|
}
|
|
2314
2314
|
}
|
|
2315
|
-
function
|
|
2315
|
+
function no(t) {
|
|
2316
2316
|
if (!t)
|
|
2317
2317
|
return !1;
|
|
2318
2318
|
for (const e of Array.from(t)) {
|
|
2319
|
-
const
|
|
2320
|
-
if (
|
|
2319
|
+
const n = e.codePointAt(0);
|
|
2320
|
+
if (n !== void 0 && (n >= 126976 && n <= 127231 || n >= 127232 && n <= 127487 || n >= 127488 && n <= 127743 || n >= 127744 && n <= 128511 || n >= 128512 && n <= 128591 || n >= 128640 && n <= 128767 || n >= 128768 && n <= 128895 || n >= 128896 && n <= 129023 || n >= 129024 && n <= 129279 || n >= 129280 && n <= 129535 || n >= 129536 && n <= 129791 || n >= 9728 && n <= 9983 || n >= 9984 && n <= 10175 || n === 8205 || n === 65039 || n === 8419))
|
|
2321
2321
|
return !0;
|
|
2322
2322
|
}
|
|
2323
2323
|
return !1;
|
|
2324
2324
|
}
|
|
2325
|
-
function
|
|
2325
|
+
function ro(t) {
|
|
2326
2326
|
const e = [];
|
|
2327
|
-
let
|
|
2327
|
+
let n = "", r = 0;
|
|
2328
2328
|
for (let o = 0; o < t.length; o++) {
|
|
2329
2329
|
const s = t[o];
|
|
2330
2330
|
if (s === `
|
|
2331
2331
|
`) {
|
|
2332
|
-
|
|
2332
|
+
r += 1;
|
|
2333
2333
|
continue;
|
|
2334
2334
|
}
|
|
2335
|
-
|
|
2335
|
+
r > 0 && (e.push({ text: n, breaks: r }), n = "", r = 0), n += s;
|
|
2336
2336
|
}
|
|
2337
|
-
return (
|
|
2337
|
+
return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
|
|
2338
2338
|
}
|
|
2339
|
-
function
|
|
2339
|
+
function oo(t) {
|
|
2340
2340
|
if (t.length === 0)
|
|
2341
2341
|
return [];
|
|
2342
2342
|
const e = [];
|
|
2343
|
-
let
|
|
2344
|
-
for (const
|
|
2345
|
-
|
|
2346
|
-
return
|
|
2343
|
+
let n = [];
|
|
2344
|
+
for (const r of t)
|
|
2345
|
+
n.push(r), r.breaks >= 2 && (e.push(n), n = []);
|
|
2346
|
+
return n.length > 0 && e.push(n), e;
|
|
2347
2347
|
}
|
|
2348
|
-
function
|
|
2348
|
+
function ne(t, e) {
|
|
2349
2349
|
return (t & e) === e;
|
|
2350
2350
|
}
|
|
2351
|
-
function
|
|
2351
|
+
function Ie(t) {
|
|
2352
2352
|
return {
|
|
2353
2353
|
"--tw-motion-seq-index": t.toString(),
|
|
2354
2354
|
backgroundColor: "inherit",
|
|
@@ -2365,128 +2365,128 @@ function Ce(t) {
|
|
|
2365
2365
|
WebkitTextFillColor: "inherit"
|
|
2366
2366
|
};
|
|
2367
2367
|
}
|
|
2368
|
-
function
|
|
2368
|
+
function gt(t) {
|
|
2369
2369
|
if (!t)
|
|
2370
2370
|
return t;
|
|
2371
|
-
const e =
|
|
2371
|
+
const e = Ke(t);
|
|
2372
2372
|
if (e.length === 0)
|
|
2373
2373
|
return t;
|
|
2374
|
-
const { nodes:
|
|
2375
|
-
return
|
|
2374
|
+
const { nodes: n, sawEmoji: r } = It(e);
|
|
2375
|
+
return r ? n.length === 1 ? n[0] ?? t : n : t;
|
|
2376
2376
|
}
|
|
2377
|
-
function
|
|
2378
|
-
const
|
|
2379
|
-
let
|
|
2377
|
+
function It(t, e) {
|
|
2378
|
+
const n = [];
|
|
2379
|
+
let r = "", o = !1, s = e?.emoji ?? 0;
|
|
2380
2380
|
const i = () => {
|
|
2381
|
-
|
|
2381
|
+
r && (n.push(r), r = "");
|
|
2382
2382
|
};
|
|
2383
2383
|
for (const a of t) {
|
|
2384
|
-
if (
|
|
2384
|
+
if (Ct(a)) {
|
|
2385
2385
|
o = !0, i();
|
|
2386
|
-
const
|
|
2387
|
-
|
|
2388
|
-
/* @__PURE__ */
|
|
2386
|
+
const h = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2387
|
+
n.push(
|
|
2388
|
+
/* @__PURE__ */ w.jsx("span", { "data-motion-emoji": !0, children: a }, h)
|
|
2389
2389
|
);
|
|
2390
2390
|
continue;
|
|
2391
2391
|
}
|
|
2392
|
-
|
|
2392
|
+
r += a;
|
|
2393
2393
|
}
|
|
2394
|
-
return i(), o ? { nodes:
|
|
2394
|
+
return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2395
2395
|
}
|
|
2396
|
-
function
|
|
2396
|
+
function so(t) {
|
|
2397
2397
|
if (!t)
|
|
2398
|
-
return
|
|
2398
|
+
return R.None;
|
|
2399
2399
|
const e = t.trim();
|
|
2400
2400
|
if (!e)
|
|
2401
|
-
return
|
|
2402
|
-
const
|
|
2403
|
-
if (typeof
|
|
2404
|
-
return
|
|
2401
|
+
return R.None;
|
|
2402
|
+
const n = ft.get(e);
|
|
2403
|
+
if (typeof n == "number")
|
|
2404
|
+
return n;
|
|
2405
2405
|
if (typeof document > "u")
|
|
2406
|
-
return
|
|
2407
|
-
const
|
|
2408
|
-
if (
|
|
2409
|
-
return
|
|
2410
|
-
const s =
|
|
2411
|
-
(u) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2406
|
+
return R.None;
|
|
2407
|
+
const r = e.split(/\s+/).filter(Boolean);
|
|
2408
|
+
if (r.length === 0)
|
|
2409
|
+
return R.None;
|
|
2410
|
+
const s = r.map((u) => `.${io(u)}`).map(
|
|
2411
|
+
(u) => new RegExp(`(^|[^a-zA-Z0-9_-])${ao(u)}(?![a-zA-Z0-9_-])`)
|
|
2412
2412
|
);
|
|
2413
|
-
let i =
|
|
2413
|
+
let i = R.None, a = !1;
|
|
2414
2414
|
for (const u of Array.from(document.styleSheets)) {
|
|
2415
|
-
let
|
|
2415
|
+
let h;
|
|
2416
2416
|
try {
|
|
2417
|
-
|
|
2417
|
+
h = u.cssRules;
|
|
2418
2418
|
} catch {
|
|
2419
2419
|
continue;
|
|
2420
2420
|
}
|
|
2421
|
-
const
|
|
2422
|
-
if (
|
|
2421
|
+
const p = _t(h, s);
|
|
2422
|
+
if (p.mask && (i |= p.mask, i === Ve))
|
|
2423
2423
|
break;
|
|
2424
|
-
a ||=
|
|
2424
|
+
a ||= p.sawStyleRule;
|
|
2425
2425
|
}
|
|
2426
|
-
return (i !==
|
|
2426
|
+
return (i !== R.None || a) && ft.set(e, i), i;
|
|
2427
2427
|
}
|
|
2428
|
-
function
|
|
2428
|
+
function _t(t, e) {
|
|
2429
2429
|
if (!t)
|
|
2430
|
-
return { mask:
|
|
2431
|
-
let
|
|
2430
|
+
return { mask: R.None, sawStyleRule: !1 };
|
|
2431
|
+
let n = R.None, r = !1;
|
|
2432
2432
|
for (let o = 0; o < t.length; o++) {
|
|
2433
2433
|
const s = t[o];
|
|
2434
2434
|
if (s) {
|
|
2435
2435
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2436
2436
|
const a = s.selectorText ?? "";
|
|
2437
|
-
if (!a || !e.some((
|
|
2438
|
-
|
|
2439
|
-
for (const
|
|
2440
|
-
|
|
2441
|
-
if (
|
|
2442
|
-
return { mask:
|
|
2437
|
+
if (!a || !e.some((h) => h.test(a))) continue;
|
|
2438
|
+
r = !0;
|
|
2439
|
+
for (const h of Br)
|
|
2440
|
+
h.hints.some((p) => a.includes(p)) && (n |= h.flag);
|
|
2441
|
+
if (n === Ve)
|
|
2442
|
+
return { mask: n, sawStyleRule: !0 };
|
|
2443
2443
|
} else if ("cssRules" in s) {
|
|
2444
|
-
const i =
|
|
2445
|
-
if (i.mask && (
|
|
2446
|
-
return { mask:
|
|
2447
|
-
|
|
2444
|
+
const i = _t(s.cssRules, e);
|
|
2445
|
+
if (i.mask && (n |= i.mask, n === Ve))
|
|
2446
|
+
return { mask: n, sawStyleRule: !0 };
|
|
2447
|
+
r ||= i.sawStyleRule;
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
|
-
return { mask:
|
|
2451
|
+
return { mask: n, sawStyleRule: r };
|
|
2452
2452
|
}
|
|
2453
|
-
function
|
|
2453
|
+
function io(t) {
|
|
2454
2454
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2455
2455
|
}
|
|
2456
|
-
function
|
|
2456
|
+
function ao(t) {
|
|
2457
2457
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2458
2458
|
}
|
|
2459
|
-
const
|
|
2460
|
-
function
|
|
2459
|
+
const qe = "ikon_auth_session", co = 10080 * 60 * 1e3, uo = 60 * 1e3;
|
|
2460
|
+
function lo(t) {
|
|
2461
2461
|
try {
|
|
2462
2462
|
const e = t.split(".");
|
|
2463
2463
|
if (e.length !== 3) return !0;
|
|
2464
|
-
const
|
|
2465
|
-
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 -
|
|
2464
|
+
const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
|
|
2465
|
+
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - uo;
|
|
2466
2466
|
} catch {
|
|
2467
2467
|
return !0;
|
|
2468
2468
|
}
|
|
2469
2469
|
}
|
|
2470
2470
|
function pe(t) {
|
|
2471
2471
|
try {
|
|
2472
|
-
localStorage.setItem(
|
|
2472
|
+
localStorage.setItem(qe, JSON.stringify(t));
|
|
2473
2473
|
} catch {
|
|
2474
2474
|
console.warn("Failed to save auth session to localStorage");
|
|
2475
2475
|
}
|
|
2476
2476
|
}
|
|
2477
|
-
function
|
|
2477
|
+
function Ot() {
|
|
2478
2478
|
try {
|
|
2479
|
-
const t = localStorage.getItem(
|
|
2479
|
+
const t = localStorage.getItem(qe);
|
|
2480
2480
|
if (!t) return null;
|
|
2481
2481
|
const e = JSON.parse(t);
|
|
2482
|
-
return Date.now() - e.authenticatedAt >
|
|
2482
|
+
return Date.now() - e.authenticatedAt > co || lo(e.token) ? (Te(), null) : e;
|
|
2483
2483
|
} catch {
|
|
2484
2484
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2485
2485
|
}
|
|
2486
2486
|
}
|
|
2487
|
-
function
|
|
2487
|
+
function Te() {
|
|
2488
2488
|
try {
|
|
2489
|
-
localStorage.removeItem(
|
|
2489
|
+
localStorage.removeItem(qe);
|
|
2490
2490
|
} catch {
|
|
2491
2491
|
console.warn("Failed to clear auth session from localStorage");
|
|
2492
2492
|
}
|
|
@@ -2499,126 +2499,126 @@ function ee(t) {
|
|
|
2499
2499
|
authenticatedAt: t.authenticatedAt
|
|
2500
2500
|
};
|
|
2501
2501
|
}
|
|
2502
|
-
const
|
|
2503
|
-
async function
|
|
2504
|
-
const
|
|
2502
|
+
const Nt = 15e3;
|
|
2503
|
+
async function Mt(t, e) {
|
|
2504
|
+
const n = Ht(), r = await fetch(`${e}/anonymous`, {
|
|
2505
2505
|
method: "POST",
|
|
2506
2506
|
headers: { "Content-Type": "application/json" },
|
|
2507
|
-
body: JSON.stringify({ deviceId:
|
|
2507
|
+
body: JSON.stringify({ deviceId: n, space: t })
|
|
2508
2508
|
});
|
|
2509
|
-
if (!
|
|
2510
|
-
const i = await
|
|
2511
|
-
throw new Error(`Anonymous auth failed: ${
|
|
2509
|
+
if (!r.ok) {
|
|
2510
|
+
const i = await r.text().catch(() => "Unknown error");
|
|
2511
|
+
throw new Error(`Anonymous auth failed: ${r.status} ${i}`);
|
|
2512
2512
|
}
|
|
2513
|
-
const { token: o } = await
|
|
2513
|
+
const { token: o } = await r.json(), s = {
|
|
2514
2514
|
token: o,
|
|
2515
2515
|
provider: "anonymous",
|
|
2516
2516
|
authenticatedAt: Date.now()
|
|
2517
2517
|
};
|
|
2518
2518
|
return pe(s), s;
|
|
2519
2519
|
}
|
|
2520
|
-
async function
|
|
2521
|
-
const
|
|
2520
|
+
async function fo({ email: t, spaceId: e, authUrl: n }) {
|
|
2521
|
+
const r = await fetch(`${n}/email/send`, {
|
|
2522
2522
|
method: "POST",
|
|
2523
2523
|
headers: { "Content-Type": "application/json" },
|
|
2524
2524
|
body: JSON.stringify({
|
|
2525
2525
|
email: t.trim(),
|
|
2526
2526
|
space: e
|
|
2527
2527
|
}),
|
|
2528
|
-
signal: AbortSignal.timeout(
|
|
2528
|
+
signal: AbortSignal.timeout(Nt)
|
|
2529
2529
|
});
|
|
2530
|
-
if (!
|
|
2531
|
-
const o = await
|
|
2530
|
+
if (!r.ok) {
|
|
2531
|
+
const o = await r.text().catch(() => "Failed to send login code");
|
|
2532
2532
|
throw new Error(o);
|
|
2533
2533
|
}
|
|
2534
2534
|
}
|
|
2535
|
-
async function
|
|
2536
|
-
const
|
|
2535
|
+
async function ho({ email: t, code: e, authUrl: n }) {
|
|
2536
|
+
const r = await fetch(`${n}/email/code`, {
|
|
2537
2537
|
method: "POST",
|
|
2538
2538
|
headers: { "Content-Type": "application/json" },
|
|
2539
2539
|
body: JSON.stringify({
|
|
2540
2540
|
email: t.trim(),
|
|
2541
2541
|
code: e.trim()
|
|
2542
2542
|
}),
|
|
2543
|
-
signal: AbortSignal.timeout(
|
|
2543
|
+
signal: AbortSignal.timeout(Nt)
|
|
2544
2544
|
});
|
|
2545
|
-
if (!
|
|
2546
|
-
const i = await
|
|
2545
|
+
if (!r.ok) {
|
|
2546
|
+
const i = await r.text().catch(() => "Invalid code");
|
|
2547
2547
|
throw new Error(i);
|
|
2548
2548
|
}
|
|
2549
|
-
const { token: o } = await
|
|
2549
|
+
const { token: o } = await r.json(), s = {
|
|
2550
2550
|
token: o,
|
|
2551
2551
|
provider: "email",
|
|
2552
2552
|
authenticatedAt: Date.now()
|
|
2553
2553
|
};
|
|
2554
2554
|
return pe(s), s;
|
|
2555
2555
|
}
|
|
2556
|
-
function fo() {
|
|
2557
|
-
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2558
|
-
return e && r ? { token: e, provider: r } : null;
|
|
2559
|
-
}
|
|
2560
2556
|
function po() {
|
|
2557
|
+
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
2558
|
+
return e && n ? { token: e, provider: n } : null;
|
|
2559
|
+
}
|
|
2560
|
+
function mo() {
|
|
2561
2561
|
return new URLSearchParams(window.location.search).get("error");
|
|
2562
2562
|
}
|
|
2563
|
-
function
|
|
2563
|
+
function yt() {
|
|
2564
2564
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2565
2565
|
}
|
|
2566
|
-
function
|
|
2567
|
-
const o =
|
|
2568
|
-
return `${
|
|
2566
|
+
function go(t, e, n, r) {
|
|
2567
|
+
const o = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2568
|
+
return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2569
2569
|
}
|
|
2570
|
-
async function
|
|
2570
|
+
async function yo(t) {
|
|
2571
2571
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2572
2572
|
method: "POST",
|
|
2573
2573
|
headers: { "Content-Type": "application/json" }
|
|
2574
2574
|
});
|
|
2575
2575
|
if (!e.ok) {
|
|
2576
|
-
const
|
|
2577
|
-
throw new Error(
|
|
2576
|
+
const n = await e.text().catch(() => "Failed to get registration options");
|
|
2577
|
+
throw new Error(n);
|
|
2578
2578
|
}
|
|
2579
2579
|
return e.json();
|
|
2580
2580
|
}
|
|
2581
|
-
async function
|
|
2582
|
-
const
|
|
2581
|
+
async function bo(t, e, n) {
|
|
2582
|
+
const r = await fetch(`${t}/passkey/registration/verify`, {
|
|
2583
2583
|
method: "POST",
|
|
2584
2584
|
headers: { "Content-Type": "application/json" },
|
|
2585
|
-
body: JSON.stringify({ response: e, name:
|
|
2585
|
+
body: JSON.stringify({ response: e, name: n })
|
|
2586
2586
|
});
|
|
2587
|
-
if (!
|
|
2588
|
-
const i = await
|
|
2587
|
+
if (!r.ok) {
|
|
2588
|
+
const i = await r.text().catch(() => "Registration verification failed");
|
|
2589
2589
|
throw new Error(i);
|
|
2590
2590
|
}
|
|
2591
|
-
const { token: o } = await
|
|
2591
|
+
const { token: o } = await r.json(), s = {
|
|
2592
2592
|
token: o,
|
|
2593
2593
|
provider: "passkey",
|
|
2594
2594
|
authenticatedAt: Date.now()
|
|
2595
2595
|
};
|
|
2596
2596
|
return pe(s), s;
|
|
2597
2597
|
}
|
|
2598
|
-
async function
|
|
2599
|
-
const
|
|
2598
|
+
async function So(t, e) {
|
|
2599
|
+
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
2600
2600
|
method: "POST",
|
|
2601
2601
|
headers: { "Content-Type": "application/json" },
|
|
2602
2602
|
body: JSON.stringify({ email: e })
|
|
2603
2603
|
});
|
|
2604
|
-
if (!
|
|
2605
|
-
const
|
|
2606
|
-
throw new Error(
|
|
2604
|
+
if (!n.ok) {
|
|
2605
|
+
const r = await n.text().catch(() => "Failed to get authentication options");
|
|
2606
|
+
throw new Error(r);
|
|
2607
2607
|
}
|
|
2608
|
-
return
|
|
2608
|
+
return n.json();
|
|
2609
2609
|
}
|
|
2610
|
-
async function
|
|
2611
|
-
const
|
|
2610
|
+
async function wo(t, e) {
|
|
2611
|
+
const n = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2612
2612
|
method: "POST",
|
|
2613
2613
|
headers: { "Content-Type": "application/json" },
|
|
2614
2614
|
body: JSON.stringify({ response: e })
|
|
2615
2615
|
});
|
|
2616
|
-
if (!
|
|
2617
|
-
const s = await
|
|
2616
|
+
if (!n.ok) {
|
|
2617
|
+
const s = await n.text().catch(() => "Authentication verification failed");
|
|
2618
2618
|
throw new Error(s);
|
|
2619
2619
|
}
|
|
2620
|
-
const { token:
|
|
2621
|
-
token:
|
|
2620
|
+
const { token: r } = await n.json(), o = {
|
|
2621
|
+
token: r,
|
|
2622
2622
|
provider: "passkey",
|
|
2623
2623
|
authenticatedAt: Date.now()
|
|
2624
2624
|
};
|
|
@@ -2626,28 +2626,28 @@ async function bo(t, e) {
|
|
|
2626
2626
|
}
|
|
2627
2627
|
function q(t) {
|
|
2628
2628
|
const e = new Uint8Array(t);
|
|
2629
|
-
let
|
|
2629
|
+
let n = "";
|
|
2630
2630
|
for (const o of e)
|
|
2631
|
-
|
|
2632
|
-
return btoa(
|
|
2631
|
+
n += String.fromCharCode(o);
|
|
2632
|
+
return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2633
2633
|
}
|
|
2634
|
-
function
|
|
2635
|
-
const e = t.replace(/-/g, "+").replace(/_/g, "/"),
|
|
2634
|
+
function Ce(t) {
|
|
2635
|
+
const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - e.length % 4) % 4, r = e.padEnd(e.length + n, "="), o = atob(r), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
|
|
2636
2636
|
for (let a = 0; a < o.length; a++)
|
|
2637
2637
|
i[a] = o.charCodeAt(a);
|
|
2638
2638
|
return s;
|
|
2639
2639
|
}
|
|
2640
|
-
function
|
|
2641
|
-
return
|
|
2640
|
+
function Ge() {
|
|
2641
|
+
return vo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2642
2642
|
}
|
|
2643
|
-
const
|
|
2643
|
+
const vo = {
|
|
2644
2644
|
stubThis: (t) => t
|
|
2645
2645
|
};
|
|
2646
|
-
function
|
|
2646
|
+
function Pt(t) {
|
|
2647
2647
|
const { id: e } = t;
|
|
2648
2648
|
return {
|
|
2649
2649
|
...t,
|
|
2650
|
-
id:
|
|
2650
|
+
id: Ce(e),
|
|
2651
2651
|
/**
|
|
2652
2652
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2653
2653
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2656,102 +2656,102 @@ function _t(t) {
|
|
|
2656
2656
|
transports: t.transports
|
|
2657
2657
|
};
|
|
2658
2658
|
}
|
|
2659
|
-
function
|
|
2659
|
+
function xt(t) {
|
|
2660
2660
|
return (
|
|
2661
2661
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2662
2662
|
t === "localhost" || // Support punycode (ACE) or ascii labels and domains
|
|
2663
2663
|
/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)
|
|
2664
2664
|
);
|
|
2665
2665
|
}
|
|
2666
|
-
class
|
|
2667
|
-
constructor({ message: e, code:
|
|
2668
|
-
super(e, { cause:
|
|
2666
|
+
class U extends Error {
|
|
2667
|
+
constructor({ message: e, code: n, cause: r, name: o }) {
|
|
2668
|
+
super(e, { cause: r }), Object.defineProperty(this, "code", {
|
|
2669
2669
|
enumerable: !0,
|
|
2670
2670
|
configurable: !0,
|
|
2671
2671
|
writable: !0,
|
|
2672
2672
|
value: void 0
|
|
2673
|
-
}), this.name = o ??
|
|
2673
|
+
}), this.name = o ?? r.name, this.code = n;
|
|
2674
2674
|
}
|
|
2675
2675
|
}
|
|
2676
|
-
function
|
|
2677
|
-
const { publicKey:
|
|
2678
|
-
if (!
|
|
2676
|
+
function Eo({ error: t, options: e }) {
|
|
2677
|
+
const { publicKey: n } = e;
|
|
2678
|
+
if (!n)
|
|
2679
2679
|
throw Error("options was missing required publicKey property");
|
|
2680
2680
|
if (t.name === "AbortError") {
|
|
2681
2681
|
if (e.signal instanceof AbortSignal)
|
|
2682
|
-
return new
|
|
2682
|
+
return new U({
|
|
2683
2683
|
message: "Registration ceremony was sent an abort signal",
|
|
2684
2684
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2685
2685
|
cause: t
|
|
2686
2686
|
});
|
|
2687
2687
|
} else if (t.name === "ConstraintError") {
|
|
2688
|
-
if (
|
|
2689
|
-
return new
|
|
2688
|
+
if (n.authenticatorSelection?.requireResidentKey === !0)
|
|
2689
|
+
return new U({
|
|
2690
2690
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2691
2691
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2692
2692
|
cause: t
|
|
2693
2693
|
});
|
|
2694
2694
|
if (
|
|
2695
2695
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2696
|
-
e.mediation === "conditional" &&
|
|
2696
|
+
e.mediation === "conditional" && n.authenticatorSelection?.userVerification === "required"
|
|
2697
2697
|
)
|
|
2698
|
-
return new
|
|
2698
|
+
return new U({
|
|
2699
2699
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2700
2700
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2701
2701
|
cause: t
|
|
2702
2702
|
});
|
|
2703
|
-
if (
|
|
2704
|
-
return new
|
|
2703
|
+
if (n.authenticatorSelection?.userVerification === "required")
|
|
2704
|
+
return new U({
|
|
2705
2705
|
message: "User verification was required but no available authenticator supported it",
|
|
2706
2706
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2707
2707
|
cause: t
|
|
2708
2708
|
});
|
|
2709
2709
|
} else {
|
|
2710
2710
|
if (t.name === "InvalidStateError")
|
|
2711
|
-
return new
|
|
2711
|
+
return new U({
|
|
2712
2712
|
message: "The authenticator was previously registered",
|
|
2713
2713
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2714
2714
|
cause: t
|
|
2715
2715
|
});
|
|
2716
2716
|
if (t.name === "NotAllowedError")
|
|
2717
|
-
return new
|
|
2717
|
+
return new U({
|
|
2718
2718
|
message: t.message,
|
|
2719
2719
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2720
2720
|
cause: t
|
|
2721
2721
|
});
|
|
2722
2722
|
if (t.name === "NotSupportedError")
|
|
2723
|
-
return
|
|
2723
|
+
return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new U({
|
|
2724
2724
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2725
2725
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2726
2726
|
cause: t
|
|
2727
|
-
}) : new
|
|
2727
|
+
}) : new U({
|
|
2728
2728
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2729
2729
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2730
2730
|
cause: t
|
|
2731
2731
|
});
|
|
2732
2732
|
if (t.name === "SecurityError") {
|
|
2733
|
-
const
|
|
2734
|
-
if (
|
|
2735
|
-
if (
|
|
2736
|
-
return new
|
|
2737
|
-
message: `The RP ID "${
|
|
2733
|
+
const r = globalThis.location.hostname;
|
|
2734
|
+
if (xt(r)) {
|
|
2735
|
+
if (n.rp.id !== r)
|
|
2736
|
+
return new U({
|
|
2737
|
+
message: `The RP ID "${n.rp.id}" is invalid for this domain`,
|
|
2738
2738
|
code: "ERROR_INVALID_RP_ID",
|
|
2739
2739
|
cause: t
|
|
2740
2740
|
});
|
|
2741
|
-
} else return new
|
|
2741
|
+
} else return new U({
|
|
2742
2742
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2743
2743
|
code: "ERROR_INVALID_DOMAIN",
|
|
2744
2744
|
cause: t
|
|
2745
2745
|
});
|
|
2746
2746
|
} else if (t.name === "TypeError") {
|
|
2747
|
-
if (
|
|
2748
|
-
return new
|
|
2747
|
+
if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64)
|
|
2748
|
+
return new U({
|
|
2749
2749
|
message: "User ID was not between 1 and 64 characters",
|
|
2750
2750
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2751
2751
|
cause: t
|
|
2752
2752
|
});
|
|
2753
2753
|
} else if (t.name === "UnknownError")
|
|
2754
|
-
return new
|
|
2754
|
+
return new U({
|
|
2755
2755
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2756
2756
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2757
2757
|
cause: t
|
|
@@ -2759,7 +2759,7 @@ function wo({ error: t, options: e }) {
|
|
|
2759
2759
|
}
|
|
2760
2760
|
return t;
|
|
2761
2761
|
}
|
|
2762
|
-
class
|
|
2762
|
+
class Ro {
|
|
2763
2763
|
constructor() {
|
|
2764
2764
|
Object.defineProperty(this, "controller", {
|
|
2765
2765
|
enumerable: !0,
|
|
@@ -2770,8 +2770,8 @@ class vo {
|
|
|
2770
2770
|
}
|
|
2771
2771
|
createNewAbortSignal() {
|
|
2772
2772
|
if (this.controller) {
|
|
2773
|
-
const
|
|
2774
|
-
|
|
2773
|
+
const n = new Error("Cancelling existing WebAuthn API call for new one");
|
|
2774
|
+
n.name = "AbortError", this.controller.abort(n);
|
|
2775
2775
|
}
|
|
2776
2776
|
const e = new AbortController();
|
|
2777
2777
|
return this.controller = e, e.signal;
|
|
@@ -2783,43 +2783,43 @@ class vo {
|
|
|
2783
2783
|
}
|
|
2784
2784
|
}
|
|
2785
2785
|
}
|
|
2786
|
-
const
|
|
2787
|
-
function
|
|
2788
|
-
if (t && !(
|
|
2786
|
+
const Lt = new Ro(), ko = ["cross-platform", "platform"];
|
|
2787
|
+
function jt(t) {
|
|
2788
|
+
if (t && !(ko.indexOf(t) < 0))
|
|
2789
2789
|
return t;
|
|
2790
2790
|
}
|
|
2791
|
-
async function
|
|
2791
|
+
async function Ao(t) {
|
|
2792
2792
|
!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 });
|
|
2793
|
-
const { optionsJSON: e, useAutoRegister:
|
|
2794
|
-
if (!
|
|
2793
|
+
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2794
|
+
if (!Ge())
|
|
2795
2795
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2796
|
-
const
|
|
2796
|
+
const r = {
|
|
2797
2797
|
...e,
|
|
2798
|
-
challenge:
|
|
2798
|
+
challenge: Ce(e.challenge),
|
|
2799
2799
|
user: {
|
|
2800
2800
|
...e.user,
|
|
2801
|
-
id:
|
|
2801
|
+
id: Ce(e.user.id)
|
|
2802
2802
|
},
|
|
2803
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2803
|
+
excludeCredentials: e.excludeCredentials?.map(Pt)
|
|
2804
2804
|
}, o = {};
|
|
2805
|
-
|
|
2805
|
+
n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Lt.createNewAbortSignal();
|
|
2806
2806
|
let s;
|
|
2807
2807
|
try {
|
|
2808
2808
|
s = await navigator.credentials.create(o);
|
|
2809
2809
|
} catch (l) {
|
|
2810
|
-
throw
|
|
2810
|
+
throw Eo({ error: l, options: o });
|
|
2811
2811
|
}
|
|
2812
2812
|
if (!s)
|
|
2813
2813
|
throw new Error("Registration was not completed");
|
|
2814
|
-
const { id: i, rawId: a, response: u, type:
|
|
2815
|
-
let h;
|
|
2816
|
-
typeof u.getTransports == "function" && (h = u.getTransports());
|
|
2814
|
+
const { id: i, rawId: a, response: u, type: h } = s;
|
|
2817
2815
|
let p;
|
|
2816
|
+
typeof u.getTransports == "function" && (p = u.getTransports());
|
|
2817
|
+
let m;
|
|
2818
2818
|
if (typeof u.getPublicKeyAlgorithm == "function")
|
|
2819
2819
|
try {
|
|
2820
|
-
|
|
2820
|
+
m = u.getPublicKeyAlgorithm();
|
|
2821
2821
|
} catch (l) {
|
|
2822
|
-
|
|
2822
|
+
Le("getPublicKeyAlgorithm()", l);
|
|
2823
2823
|
}
|
|
2824
2824
|
let y;
|
|
2825
2825
|
if (typeof u.getPublicKey == "function")
|
|
@@ -2827,14 +2827,14 @@ async function Ro(t) {
|
|
|
2827
2827
|
const l = u.getPublicKey();
|
|
2828
2828
|
l !== null && (y = q(l));
|
|
2829
2829
|
} catch (l) {
|
|
2830
|
-
|
|
2830
|
+
Le("getPublicKey()", l);
|
|
2831
2831
|
}
|
|
2832
2832
|
let c;
|
|
2833
2833
|
if (typeof u.getAuthenticatorData == "function")
|
|
2834
2834
|
try {
|
|
2835
2835
|
c = q(u.getAuthenticatorData());
|
|
2836
2836
|
} catch (l) {
|
|
2837
|
-
|
|
2837
|
+
Le("getAuthenticatorData()", l);
|
|
2838
2838
|
}
|
|
2839
2839
|
return {
|
|
2840
2840
|
id: i,
|
|
@@ -2842,63 +2842,63 @@ async function Ro(t) {
|
|
|
2842
2842
|
response: {
|
|
2843
2843
|
attestationObject: q(u.attestationObject),
|
|
2844
2844
|
clientDataJSON: q(u.clientDataJSON),
|
|
2845
|
-
transports:
|
|
2846
|
-
publicKeyAlgorithm:
|
|
2845
|
+
transports: p,
|
|
2846
|
+
publicKeyAlgorithm: m,
|
|
2847
2847
|
publicKey: y,
|
|
2848
2848
|
authenticatorData: c
|
|
2849
2849
|
},
|
|
2850
|
-
type:
|
|
2850
|
+
type: h,
|
|
2851
2851
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2852
|
-
authenticatorAttachment:
|
|
2852
|
+
authenticatorAttachment: jt(s.authenticatorAttachment)
|
|
2853
2853
|
};
|
|
2854
2854
|
}
|
|
2855
|
-
function
|
|
2855
|
+
function Le(t, e) {
|
|
2856
2856
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2857
2857
|
`, e);
|
|
2858
2858
|
}
|
|
2859
|
-
function
|
|
2860
|
-
if (!
|
|
2861
|
-
return
|
|
2859
|
+
function To() {
|
|
2860
|
+
if (!Ge())
|
|
2861
|
+
return je.stubThis(new Promise((e) => e(!1)));
|
|
2862
2862
|
const t = globalThis.PublicKeyCredential;
|
|
2863
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2863
|
+
return t?.isConditionalMediationAvailable === void 0 ? je.stubThis(new Promise((e) => e(!1))) : je.stubThis(t.isConditionalMediationAvailable());
|
|
2864
2864
|
}
|
|
2865
|
-
const
|
|
2865
|
+
const je = {
|
|
2866
2866
|
stubThis: (t) => t
|
|
2867
2867
|
};
|
|
2868
|
-
function
|
|
2869
|
-
const { publicKey:
|
|
2870
|
-
if (!
|
|
2868
|
+
function Co({ error: t, options: e }) {
|
|
2869
|
+
const { publicKey: n } = e;
|
|
2870
|
+
if (!n)
|
|
2871
2871
|
throw Error("options was missing required publicKey property");
|
|
2872
2872
|
if (t.name === "AbortError") {
|
|
2873
2873
|
if (e.signal instanceof AbortSignal)
|
|
2874
|
-
return new
|
|
2874
|
+
return new U({
|
|
2875
2875
|
message: "Authentication ceremony was sent an abort signal",
|
|
2876
2876
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2877
2877
|
cause: t
|
|
2878
2878
|
});
|
|
2879
2879
|
} else {
|
|
2880
2880
|
if (t.name === "NotAllowedError")
|
|
2881
|
-
return new
|
|
2881
|
+
return new U({
|
|
2882
2882
|
message: t.message,
|
|
2883
2883
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2884
2884
|
cause: t
|
|
2885
2885
|
});
|
|
2886
2886
|
if (t.name === "SecurityError") {
|
|
2887
|
-
const
|
|
2888
|
-
if (
|
|
2889
|
-
if (
|
|
2890
|
-
return new
|
|
2891
|
-
message: `The RP ID "${
|
|
2887
|
+
const r = globalThis.location.hostname;
|
|
2888
|
+
if (xt(r)) {
|
|
2889
|
+
if (n.rpId !== r)
|
|
2890
|
+
return new U({
|
|
2891
|
+
message: `The RP ID "${n.rpId}" is invalid for this domain`,
|
|
2892
2892
|
code: "ERROR_INVALID_RP_ID",
|
|
2893
2893
|
cause: t
|
|
2894
2894
|
});
|
|
2895
|
-
} else return new
|
|
2895
|
+
} else return new U({
|
|
2896
2896
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2897
2897
|
code: "ERROR_INVALID_DOMAIN",
|
|
2898
2898
|
cause: t
|
|
2899
2899
|
});
|
|
2900
2900
|
} else if (t.name === "UnknownError")
|
|
2901
|
-
return new
|
|
2901
|
+
return new U({
|
|
2902
2902
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
2903
2903
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2904
2904
|
cause: t
|
|
@@ -2906,63 +2906,63 @@ function Ao({ error: t, options: e }) {
|
|
|
2906
2906
|
}
|
|
2907
2907
|
return t;
|
|
2908
2908
|
}
|
|
2909
|
-
async function
|
|
2909
|
+
async function Io(t) {
|
|
2910
2910
|
!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 });
|
|
2911
|
-
const { optionsJSON: e, useBrowserAutofill:
|
|
2912
|
-
if (!
|
|
2911
|
+
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
2912
|
+
if (!Ge())
|
|
2913
2913
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2914
2914
|
let o;
|
|
2915
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2915
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(Pt));
|
|
2916
2916
|
const s = {
|
|
2917
2917
|
...e,
|
|
2918
|
-
challenge:
|
|
2918
|
+
challenge: Ce(e.challenge),
|
|
2919
2919
|
allowCredentials: o
|
|
2920
2920
|
}, i = {};
|
|
2921
|
-
if (
|
|
2922
|
-
if (!await
|
|
2921
|
+
if (n) {
|
|
2922
|
+
if (!await To())
|
|
2923
2923
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2924
|
-
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 &&
|
|
2924
|
+
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
2925
2925
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
2926
2926
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2927
2927
|
}
|
|
2928
|
-
i.publicKey = s, i.signal =
|
|
2928
|
+
i.publicKey = s, i.signal = Lt.createNewAbortSignal();
|
|
2929
2929
|
let a;
|
|
2930
2930
|
try {
|
|
2931
2931
|
a = await navigator.credentials.get(i);
|
|
2932
2932
|
} catch (c) {
|
|
2933
|
-
throw
|
|
2933
|
+
throw Co({ error: c, options: i });
|
|
2934
2934
|
}
|
|
2935
2935
|
if (!a)
|
|
2936
2936
|
throw new Error("Authentication was not completed");
|
|
2937
|
-
const { id: u, rawId:
|
|
2937
|
+
const { id: u, rawId: h, response: p, type: m } = a;
|
|
2938
2938
|
let y;
|
|
2939
|
-
return
|
|
2939
|
+
return p.userHandle && (y = q(p.userHandle)), {
|
|
2940
2940
|
id: u,
|
|
2941
|
-
rawId: q(
|
|
2941
|
+
rawId: q(h),
|
|
2942
2942
|
response: {
|
|
2943
|
-
authenticatorData: q(
|
|
2944
|
-
clientDataJSON: q(
|
|
2945
|
-
signature: q(
|
|
2943
|
+
authenticatorData: q(p.authenticatorData),
|
|
2944
|
+
clientDataJSON: q(p.clientDataJSON),
|
|
2945
|
+
signature: q(p.signature),
|
|
2946
2946
|
userHandle: y
|
|
2947
2947
|
},
|
|
2948
|
-
type:
|
|
2948
|
+
type: m,
|
|
2949
2949
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2950
|
-
authenticatorAttachment:
|
|
2950
|
+
authenticatorAttachment: jt(a.authenticatorAttachment)
|
|
2951
2951
|
};
|
|
2952
2952
|
}
|
|
2953
|
-
const
|
|
2954
|
-
function
|
|
2955
|
-
const [
|
|
2953
|
+
const Je = bt(null);
|
|
2954
|
+
function us({ children: t, config: e }) {
|
|
2955
|
+
const [n, r] = j({
|
|
2956
2956
|
isAuthenticated: !1,
|
|
2957
2957
|
isLoading: !0,
|
|
2958
2958
|
user: null,
|
|
2959
2959
|
error: null
|
|
2960
2960
|
});
|
|
2961
|
-
|
|
2961
|
+
C(() => {
|
|
2962
2962
|
(() => {
|
|
2963
|
-
const y =
|
|
2963
|
+
const y = mo();
|
|
2964
2964
|
if (y) {
|
|
2965
|
-
|
|
2965
|
+
yt(), r({
|
|
2966
2966
|
isAuthenticated: !1,
|
|
2967
2967
|
isLoading: !1,
|
|
2968
2968
|
user: null,
|
|
@@ -2970,24 +2970,24 @@ function Wo({ children: t, config: e }) {
|
|
|
2970
2970
|
});
|
|
2971
2971
|
return;
|
|
2972
2972
|
}
|
|
2973
|
-
const c =
|
|
2973
|
+
const c = po();
|
|
2974
2974
|
if (c) {
|
|
2975
|
-
const
|
|
2975
|
+
const f = {
|
|
2976
2976
|
token: c.token,
|
|
2977
2977
|
provider: c.provider,
|
|
2978
2978
|
authenticatedAt: Date.now()
|
|
2979
2979
|
};
|
|
2980
|
-
pe(
|
|
2980
|
+
pe(f), yt(), r({
|
|
2981
2981
|
isAuthenticated: !0,
|
|
2982
2982
|
isLoading: !1,
|
|
2983
|
-
user: ee(
|
|
2983
|
+
user: ee(f),
|
|
2984
2984
|
error: null
|
|
2985
2985
|
});
|
|
2986
2986
|
return;
|
|
2987
2987
|
}
|
|
2988
|
-
const l =
|
|
2988
|
+
const l = Ot();
|
|
2989
2989
|
if (l) {
|
|
2990
|
-
|
|
2990
|
+
r({
|
|
2991
2991
|
isAuthenticated: !0,
|
|
2992
2992
|
isLoading: !1,
|
|
2993
2993
|
user: ee(l),
|
|
@@ -2995,7 +2995,7 @@ function Wo({ children: t, config: e }) {
|
|
|
2995
2995
|
});
|
|
2996
2996
|
return;
|
|
2997
2997
|
}
|
|
2998
|
-
|
|
2998
|
+
r({
|
|
2999
2999
|
isAuthenticated: !1,
|
|
3000
3000
|
isLoading: !1,
|
|
3001
3001
|
user: null,
|
|
@@ -3003,28 +3003,28 @@ function Wo({ children: t, config: e }) {
|
|
|
3003
3003
|
});
|
|
3004
3004
|
})();
|
|
3005
3005
|
}, []);
|
|
3006
|
-
const o =
|
|
3007
|
-
async (
|
|
3006
|
+
const o = D(
|
|
3007
|
+
async (m) => {
|
|
3008
3008
|
if (!e.spaceId) {
|
|
3009
|
-
|
|
3009
|
+
r((c) => ({
|
|
3010
3010
|
...c,
|
|
3011
3011
|
error: "Space ID is not configured"
|
|
3012
3012
|
}));
|
|
3013
3013
|
return;
|
|
3014
3014
|
}
|
|
3015
|
-
const y = await
|
|
3016
|
-
if (
|
|
3017
|
-
|
|
3015
|
+
const y = await he(e.authUrl);
|
|
3016
|
+
if (m === "guest") {
|
|
3017
|
+
r((c) => ({ ...c, isLoading: !0 }));
|
|
3018
3018
|
try {
|
|
3019
|
-
const c = await
|
|
3020
|
-
|
|
3019
|
+
const c = await Mt(e.spaceId, y);
|
|
3020
|
+
r({
|
|
3021
3021
|
isAuthenticated: !0,
|
|
3022
3022
|
isLoading: !1,
|
|
3023
3023
|
user: ee(c),
|
|
3024
3024
|
error: null
|
|
3025
3025
|
});
|
|
3026
3026
|
} catch (c) {
|
|
3027
|
-
|
|
3027
|
+
r((l) => ({
|
|
3028
3028
|
...l,
|
|
3029
3029
|
isLoading: !1,
|
|
3030
3030
|
error: c instanceof Error ? c.message : "Guest login failed"
|
|
@@ -3032,18 +3032,18 @@ function Wo({ children: t, config: e }) {
|
|
|
3032
3032
|
}
|
|
3033
3033
|
return;
|
|
3034
3034
|
}
|
|
3035
|
-
if (
|
|
3036
|
-
|
|
3035
|
+
if (m === "passkey") {
|
|
3036
|
+
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3037
3037
|
try {
|
|
3038
|
-
const c = await
|
|
3039
|
-
|
|
3038
|
+
const c = await So(y), l = await Io({ optionsJSON: c }), f = await wo(y, l);
|
|
3039
|
+
r({
|
|
3040
3040
|
isAuthenticated: !0,
|
|
3041
3041
|
isLoading: !1,
|
|
3042
|
-
user: ee(
|
|
3042
|
+
user: ee(f),
|
|
3043
3043
|
error: null
|
|
3044
3044
|
});
|
|
3045
3045
|
} catch (c) {
|
|
3046
|
-
|
|
3046
|
+
r((l) => ({
|
|
3047
3047
|
...l,
|
|
3048
3048
|
isLoading: !1,
|
|
3049
3049
|
error: c instanceof Error ? c.message : "Passkey login failed"
|
|
@@ -3051,25 +3051,25 @@ function Wo({ children: t, config: e }) {
|
|
|
3051
3051
|
}
|
|
3052
3052
|
return;
|
|
3053
3053
|
}
|
|
3054
|
-
if (
|
|
3054
|
+
if (m === "email")
|
|
3055
3055
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3056
|
-
window.location.href =
|
|
3056
|
+
window.location.href = go(m, e.spaceId, y);
|
|
3057
3057
|
},
|
|
3058
3058
|
[e.authUrl, e.spaceId]
|
|
3059
|
-
), s =
|
|
3060
|
-
async (
|
|
3059
|
+
), s = D(
|
|
3060
|
+
async (m) => {
|
|
3061
3061
|
if (!e.spaceId)
|
|
3062
|
-
throw
|
|
3063
|
-
const y = await
|
|
3064
|
-
await
|
|
3062
|
+
throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3063
|
+
const y = await he(e.authUrl);
|
|
3064
|
+
await fo({ email: m, spaceId: e.spaceId, authUrl: y });
|
|
3065
3065
|
},
|
|
3066
3066
|
[e.authUrl, e.spaceId]
|
|
3067
|
-
), i =
|
|
3068
|
-
async (
|
|
3069
|
-
|
|
3067
|
+
), i = D(
|
|
3068
|
+
async (m, y) => {
|
|
3069
|
+
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3070
3070
|
try {
|
|
3071
|
-
const c = await
|
|
3072
|
-
|
|
3071
|
+
const c = await he(e.authUrl), l = await ho({ email: m, code: y, authUrl: c });
|
|
3072
|
+
r({
|
|
3073
3073
|
isAuthenticated: !0,
|
|
3074
3074
|
isLoading: !1,
|
|
3075
3075
|
user: ee(l),
|
|
@@ -3077,31 +3077,31 @@ function Wo({ children: t, config: e }) {
|
|
|
3077
3077
|
});
|
|
3078
3078
|
} catch (c) {
|
|
3079
3079
|
const l = c instanceof Error ? c.message : "Code verification failed";
|
|
3080
|
-
throw
|
|
3080
|
+
throw r((f) => ({ ...f, isLoading: !1, error: l })), c;
|
|
3081
3081
|
}
|
|
3082
3082
|
},
|
|
3083
3083
|
[e.authUrl]
|
|
3084
|
-
), a =
|
|
3085
|
-
|
|
3084
|
+
), a = D(() => {
|
|
3085
|
+
Te(), r({
|
|
3086
3086
|
isAuthenticated: !1,
|
|
3087
3087
|
isLoading: !1,
|
|
3088
3088
|
user: null,
|
|
3089
3089
|
error: null
|
|
3090
3090
|
});
|
|
3091
|
-
}, []), u =
|
|
3092
|
-
async (
|
|
3093
|
-
const y = await
|
|
3094
|
-
|
|
3091
|
+
}, []), u = D(
|
|
3092
|
+
async (m) => {
|
|
3093
|
+
const y = await he(e.authUrl);
|
|
3094
|
+
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3095
3095
|
try {
|
|
3096
|
-
const c = await
|
|
3097
|
-
|
|
3096
|
+
const c = await yo(y), l = await Ao({ optionsJSON: c }), f = await bo(y, l, m);
|
|
3097
|
+
r({
|
|
3098
3098
|
isAuthenticated: !0,
|
|
3099
3099
|
isLoading: !1,
|
|
3100
|
-
user: ee(
|
|
3100
|
+
user: ee(f),
|
|
3101
3101
|
error: null
|
|
3102
3102
|
});
|
|
3103
3103
|
} catch (c) {
|
|
3104
|
-
|
|
3104
|
+
r((l) => ({
|
|
3105
3105
|
...l,
|
|
3106
3106
|
isLoading: !1,
|
|
3107
3107
|
error: c instanceof Error ? c.message : "Passkey registration failed"
|
|
@@ -3109,259 +3109,272 @@ function Wo({ children: t, config: e }) {
|
|
|
3109
3109
|
}
|
|
3110
3110
|
},
|
|
3111
3111
|
[e.authUrl]
|
|
3112
|
-
),
|
|
3112
|
+
), h = D(() => n.user?.token ?? null, [n.user]), p = K(
|
|
3113
3113
|
() => ({
|
|
3114
|
-
state:
|
|
3114
|
+
state: n,
|
|
3115
3115
|
login: o,
|
|
3116
3116
|
logout: a,
|
|
3117
|
-
getToken:
|
|
3117
|
+
getToken: h,
|
|
3118
3118
|
registerPasskey: u,
|
|
3119
3119
|
requestEmailCode: s,
|
|
3120
3120
|
submitEmailCode: i
|
|
3121
3121
|
}),
|
|
3122
|
-
[
|
|
3122
|
+
[n, o, a, h, u, s, i]
|
|
3123
3123
|
);
|
|
3124
|
-
return /* @__PURE__ */
|
|
3124
|
+
return /* @__PURE__ */ w.jsx(Je, { value: p, children: t });
|
|
3125
3125
|
}
|
|
3126
|
-
function
|
|
3127
|
-
const t =
|
|
3126
|
+
function _o() {
|
|
3127
|
+
const t = ze(Je);
|
|
3128
3128
|
if (!t)
|
|
3129
3129
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3130
3130
|
return t;
|
|
3131
3131
|
}
|
|
3132
|
-
function
|
|
3133
|
-
return
|
|
3132
|
+
function Oo() {
|
|
3133
|
+
return ze(Je);
|
|
3134
3134
|
}
|
|
3135
|
-
function
|
|
3136
|
-
const { config: e, guestUrlParam:
|
|
3137
|
-
return
|
|
3138
|
-
if (!
|
|
3135
|
+
function ls(t) {
|
|
3136
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = _o(), s = E(!1);
|
|
3137
|
+
return C(() => {
|
|
3138
|
+
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
3139
3139
|
return;
|
|
3140
|
-
const i = new URLSearchParams(window.location.search), a = i.get(
|
|
3140
|
+
const i = new URLSearchParams(window.location.search), a = i.get(n);
|
|
3141
3141
|
if (a === "true" || a === "1" || a === "") {
|
|
3142
|
-
i.delete(
|
|
3143
|
-
const u = i.toString(),
|
|
3144
|
-
window.history.replaceState({}, "",
|
|
3145
|
-
}
|
|
3146
|
-
}, [
|
|
3147
|
-
shouldRenderChildren:
|
|
3148
|
-
isCheckingAuth:
|
|
3149
|
-
isAuthenticated:
|
|
3150
|
-
error:
|
|
3142
|
+
i.delete(n);
|
|
3143
|
+
const u = i.toString(), h = window.location.pathname + (u ? `?${u}` : "");
|
|
3144
|
+
window.history.replaceState({}, "", h), s.current = !0, o("guest");
|
|
3145
|
+
}
|
|
3146
|
+
}, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
|
|
3147
|
+
shouldRenderChildren: r.isAuthenticated,
|
|
3148
|
+
isCheckingAuth: r.isLoading,
|
|
3149
|
+
isAuthenticated: r.isAuthenticated,
|
|
3150
|
+
error: r.error
|
|
3151
3151
|
};
|
|
3152
3152
|
}
|
|
3153
|
-
function
|
|
3153
|
+
function ds({
|
|
3154
3154
|
connectionState: t,
|
|
3155
3155
|
error: e,
|
|
3156
|
-
isReady:
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3156
|
+
isReady: n,
|
|
3157
|
+
isConnectingSlow: r,
|
|
3158
|
+
stores: o,
|
|
3159
|
+
registry: s,
|
|
3160
|
+
client: i,
|
|
3161
|
+
onAction: a,
|
|
3162
|
+
// renderIdle prop is intentionally accepted but never invoked — the runtime no longer
|
|
3163
|
+
// emits the deprecated 'idle' state. Kept on the props for source compatibility.
|
|
3164
|
+
renderIdle: u,
|
|
3165
|
+
renderConnecting: h,
|
|
3166
|
+
renderConnectingSlow: p,
|
|
3167
|
+
renderConnected: m,
|
|
3168
|
+
renderOffline: y,
|
|
3169
|
+
renderError: c
|
|
3167
3170
|
}) {
|
|
3168
|
-
const
|
|
3171
|
+
const l = E(!1);
|
|
3169
3172
|
switch (t) {
|
|
3170
|
-
case "
|
|
3171
|
-
return a();
|
|
3173
|
+
case "waitingForExternalConnectUrl":
|
|
3172
3174
|
case "connecting":
|
|
3173
|
-
return
|
|
3174
|
-
case "connectingSlow":
|
|
3175
|
-
return f();
|
|
3175
|
+
return r ? p() : h();
|
|
3176
3176
|
case "connected":
|
|
3177
3177
|
case "reconnecting": {
|
|
3178
|
-
if (!
|
|
3179
|
-
t === "reconnecting" && (
|
|
3180
|
-
const
|
|
3181
|
-
return
|
|
3182
|
-
stores:
|
|
3183
|
-
registry:
|
|
3184
|
-
client:
|
|
3185
|
-
onAction:
|
|
3186
|
-
isReconnecting: t === "reconnecting" ||
|
|
3178
|
+
if (!n || !o || !s) return null;
|
|
3179
|
+
t === "reconnecting" && (l.current = !0);
|
|
3180
|
+
const f = o.size > 0;
|
|
3181
|
+
return f && (l.current = !1), m({
|
|
3182
|
+
stores: o,
|
|
3183
|
+
registry: s,
|
|
3184
|
+
client: i,
|
|
3185
|
+
onAction: a,
|
|
3186
|
+
isReconnecting: t === "reconnecting" || l.current && !f
|
|
3187
3187
|
});
|
|
3188
3188
|
}
|
|
3189
|
-
case "offline":
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
return c
|
|
3189
|
+
case "offline": {
|
|
3190
|
+
l.current = !1;
|
|
3191
|
+
const f = e ?? i?.lastError?.message ?? null;
|
|
3192
|
+
return f ? c(f) : y();
|
|
3193
|
+
}
|
|
3194
|
+
// 'idle' / 'connectingSlow' / 'offlineError' remain in the type union for back-compat
|
|
3195
|
+
// string-equality checks in caller code but are no longer emitted — no case needed.
|
|
3193
3196
|
default:
|
|
3194
3197
|
return null;
|
|
3195
3198
|
}
|
|
3196
3199
|
}
|
|
3197
|
-
const ve =
|
|
3198
|
-
function
|
|
3200
|
+
const ve = re("useIkonApp");
|
|
3201
|
+
function No() {
|
|
3199
3202
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3200
3203
|
return window.__IKON_AUTH_CONFIG__;
|
|
3201
3204
|
}
|
|
3202
|
-
function
|
|
3205
|
+
function Mo() {
|
|
3203
3206
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3204
3207
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3205
3208
|
}
|
|
3206
|
-
function
|
|
3207
|
-
const { authConfig: e, modules:
|
|
3208
|
-
O.current = o,
|
|
3209
|
-
const [
|
|
3209
|
+
function fs(t) {
|
|
3210
|
+
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: u, webtransport: h, proxy: p } = t, m = e === void 0 ? No() ?? null : e, y = Mo(), c = Oo(), l = E(null), f = E(null), g = E(null), b = E(!1), S = E(!1), O = E(o), I = E(r), M = E(s), x = E(i), G = E(a), _ = E(u), P = E(h), F = E(p);
|
|
3211
|
+
O.current = o, I.current = r, M.current = s, x.current = i, G.current = a, _.current = u, P.current = h, F.current = p;
|
|
3212
|
+
const [L, B] = j("connecting"), [Y, me] = j(!1), [oe, se] = j(null), [ge, ye] = j(null), [ie, be] = j(null), [d, v] = j(null), k = E(!1), [N, Q] = j(0), $ = K(() => {
|
|
3210
3213
|
try {
|
|
3211
|
-
const T =
|
|
3212
|
-
return (T.sessionId || T.channelKey) &&
|
|
3214
|
+
const T = qt();
|
|
3215
|
+
return (T.sessionId || T.channelKey) && Gt(), T;
|
|
3213
3216
|
} catch {
|
|
3214
3217
|
return { parameters: {} };
|
|
3215
3218
|
}
|
|
3216
|
-
}, []),
|
|
3217
|
-
!
|
|
3218
|
-
|
|
3219
|
+
}, []), A = K(() => m?.enabled ? Ot() : null, [m?.enabled, N]), W = y?.enabled ?? !1, Z = y?.host ?? "localhost", ae = y?.port ?? 8443;
|
|
3220
|
+
!W && Xe() && m && !m.enabled && m.spaceId && !d && !k.current && (k.current = !0, he(m.authUrl).then((T) => Mt(m.spaceId, T)).then((T) => {
|
|
3221
|
+
v(T.token);
|
|
3219
3222
|
}).catch((T) => {
|
|
3220
|
-
ve.error("Anonymous auth failed:", T),
|
|
3223
|
+
ve.error("Anonymous auth failed:", T), se(T instanceof Error ? T.message : "Anonymous auth failed"), k.current = !1;
|
|
3221
3224
|
}));
|
|
3222
|
-
const
|
|
3223
|
-
if (
|
|
3224
|
-
const T =
|
|
3225
|
+
const _e = K(() => {
|
|
3226
|
+
if (W) {
|
|
3227
|
+
const T = A?.token ? Jt(A.token) ?? void 0 : void 0;
|
|
3225
3228
|
return {
|
|
3226
3229
|
local: {
|
|
3227
|
-
host:
|
|
3228
|
-
httpsPort:
|
|
3230
|
+
host: Z,
|
|
3231
|
+
httpsPort: ae,
|
|
3229
3232
|
userId: T,
|
|
3230
|
-
token:
|
|
3231
|
-
spaceId:
|
|
3232
|
-
backendUrl:
|
|
3233
|
-
authUrl:
|
|
3234
|
-
parameters:
|
|
3233
|
+
token: A?.token ?? void 0,
|
|
3234
|
+
spaceId: m?.spaceId,
|
|
3235
|
+
backendUrl: m?.backendUrl,
|
|
3236
|
+
authUrl: m?.authUrl,
|
|
3237
|
+
parameters: $.parameters
|
|
3235
3238
|
}
|
|
3236
3239
|
};
|
|
3237
3240
|
}
|
|
3238
|
-
return
|
|
3241
|
+
return A?.token && m?.spaceId ? {
|
|
3239
3242
|
sessionToken: {
|
|
3240
|
-
token:
|
|
3241
|
-
spaceId:
|
|
3242
|
-
backendType:
|
|
3243
|
-
sessionId:
|
|
3244
|
-
channelKey:
|
|
3245
|
-
parameters:
|
|
3243
|
+
token: A.token,
|
|
3244
|
+
spaceId: m.spaceId,
|
|
3245
|
+
backendType: Ze(),
|
|
3246
|
+
sessionId: $.sessionId,
|
|
3247
|
+
channelKey: $.channelKey,
|
|
3248
|
+
parameters: $.parameters
|
|
3246
3249
|
}
|
|
3247
|
-
} :
|
|
3250
|
+
} : d && m?.spaceId ? {
|
|
3248
3251
|
sessionToken: {
|
|
3249
|
-
token:
|
|
3250
|
-
spaceId:
|
|
3251
|
-
backendType:
|
|
3252
|
-
sessionId:
|
|
3253
|
-
channelKey:
|
|
3254
|
-
parameters:
|
|
3252
|
+
token: d,
|
|
3253
|
+
spaceId: m.spaceId,
|
|
3254
|
+
backendType: Ze(),
|
|
3255
|
+
sessionId: $.sessionId,
|
|
3256
|
+
channelKey: $.channelKey,
|
|
3257
|
+
parameters: $.parameters
|
|
3255
3258
|
}
|
|
3256
|
-
} :
|
|
3259
|
+
} : Xe() ? null : {
|
|
3257
3260
|
local: {
|
|
3258
|
-
host:
|
|
3259
|
-
httpsPort:
|
|
3260
|
-
spaceId:
|
|
3261
|
-
backendUrl:
|
|
3262
|
-
authUrl:
|
|
3263
|
-
parameters:
|
|
3261
|
+
host: Z,
|
|
3262
|
+
httpsPort: ae,
|
|
3263
|
+
spaceId: m?.spaceId,
|
|
3264
|
+
backendUrl: m?.backendUrl,
|
|
3265
|
+
authUrl: m?.authUrl,
|
|
3266
|
+
parameters: $.parameters
|
|
3264
3267
|
}
|
|
3265
3268
|
};
|
|
3266
|
-
}, [
|
|
3267
|
-
|
|
3268
|
-
const
|
|
3269
|
-
|
|
3269
|
+
}, [W, Z, ae, A?.token, m?.spaceId, m?.backendUrl, m?.authUrl, d, $.sessionId, $.channelKey, $.parameters]);
|
|
3270
|
+
Sr(ie);
|
|
3271
|
+
const Dt = vr(ie);
|
|
3272
|
+
C(() => {
|
|
3270
3273
|
if (!b.current) {
|
|
3271
|
-
if (b.current = !0, g.current =
|
|
3272
|
-
for (const T of
|
|
3274
|
+
if (b.current = !0, g.current = dr(), n)
|
|
3275
|
+
for (const T of n)
|
|
3273
3276
|
T(g.current);
|
|
3274
3277
|
g.current.loadRegisteredModules().catch((T) => {
|
|
3275
3278
|
ve.error("Failed to load UI modules", T);
|
|
3276
3279
|
});
|
|
3277
3280
|
}
|
|
3278
|
-
}, []),
|
|
3279
|
-
if (!
|
|
3280
|
-
const T = new
|
|
3281
|
-
...
|
|
3282
|
-
timeouts:
|
|
3283
|
-
audio:
|
|
3284
|
-
enabled:
|
|
3281
|
+
}, []), C(() => {
|
|
3282
|
+
if (!_e) return;
|
|
3283
|
+
const T = new Xt({
|
|
3284
|
+
..._e,
|
|
3285
|
+
timeouts: I.current,
|
|
3286
|
+
audio: x.current !== void 0 || O.current ? {
|
|
3287
|
+
enabled: x.current,
|
|
3285
3288
|
...O.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
3286
3289
|
} : void 0,
|
|
3287
3290
|
video: G.current !== void 0 ? { enabled: G.current } : void 0,
|
|
3288
3291
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3289
|
-
webRtc:
|
|
3290
|
-
websocket:
|
|
3291
|
-
webtransport:
|
|
3292
|
-
proxy:
|
|
3292
|
+
webRtc: M.current === !1 ? { enabled: !1 } : void 0,
|
|
3293
|
+
websocket: _.current,
|
|
3294
|
+
webtransport: P.current,
|
|
3295
|
+
proxy: F.current,
|
|
3293
3296
|
onConnectionStateChange: (H) => {
|
|
3294
3297
|
B(H);
|
|
3295
3298
|
},
|
|
3296
3299
|
onError: (H) => {
|
|
3297
|
-
|
|
3300
|
+
se(H.message);
|
|
3298
3301
|
}
|
|
3299
3302
|
});
|
|
3300
3303
|
l.current = T;
|
|
3301
|
-
const
|
|
3302
|
-
return
|
|
3303
|
-
if (ve.error("Connection failed:", H), H instanceof
|
|
3304
|
-
|
|
3304
|
+
const J = new wn({ client: T });
|
|
3305
|
+
return f.current = J, be(J), T.connect().catch((H) => {
|
|
3306
|
+
if (ve.error("Connection failed:", H), H instanceof Zt) {
|
|
3307
|
+
ye(H.reason);
|
|
3305
3308
|
return;
|
|
3306
3309
|
}
|
|
3307
|
-
H instanceof
|
|
3310
|
+
H instanceof Qt && !S.current && (S.current = !0, ve.warn("Auth session appears stale, clearing and retrying"), c ? c.logout() : (Te(), Q(($t) => $t + 1)));
|
|
3308
3311
|
}), () => {
|
|
3309
|
-
T.disconnect(), l.current = null,
|
|
3312
|
+
T.disconnect(), l.current = null, J.dispose(), f.current = null;
|
|
3310
3313
|
};
|
|
3311
|
-
}, [
|
|
3312
|
-
const
|
|
3313
|
-
const H = typeof
|
|
3314
|
+
}, [_e]);
|
|
3315
|
+
const Ft = D((T, J) => {
|
|
3316
|
+
const H = typeof J == "string" ? J : JSON.stringify(J ?? {});
|
|
3314
3317
|
l.current?.sendActionCall(T, H);
|
|
3315
|
-
}, [])
|
|
3318
|
+
}, []);
|
|
3319
|
+
C(() => {
|
|
3320
|
+
if (L !== "connecting") {
|
|
3321
|
+
me(!1);
|
|
3322
|
+
return;
|
|
3323
|
+
}
|
|
3324
|
+
const T = l.current?.slowConnectionThresholdMs ?? 5e3, J = setTimeout(() => me(!0), T);
|
|
3325
|
+
return () => clearTimeout(J);
|
|
3326
|
+
}, [L]);
|
|
3327
|
+
const Bt = L === "connected" || L === "reconnecting";
|
|
3316
3328
|
return {
|
|
3317
|
-
connectionState:
|
|
3318
|
-
error:
|
|
3319
|
-
accessDeniedReason:
|
|
3320
|
-
stores:
|
|
3329
|
+
connectionState: L,
|
|
3330
|
+
error: oe,
|
|
3331
|
+
accessDeniedReason: ge,
|
|
3332
|
+
stores: Dt,
|
|
3321
3333
|
client: l.current,
|
|
3322
3334
|
registry: g.current,
|
|
3323
3335
|
clientRef: l,
|
|
3324
|
-
uiRef:
|
|
3336
|
+
uiRef: f,
|
|
3325
3337
|
registryRef: g,
|
|
3326
|
-
onAction:
|
|
3327
|
-
isReady:
|
|
3338
|
+
onAction: Ft,
|
|
3339
|
+
isReady: Bt,
|
|
3340
|
+
isConnectingSlow: Y,
|
|
3328
3341
|
webRtcVideoStreams: l.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3329
3342
|
webRtcTrackMap: l.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3330
3343
|
};
|
|
3331
3344
|
}
|
|
3332
|
-
function
|
|
3333
|
-
const e =
|
|
3334
|
-
return
|
|
3345
|
+
function hs(t) {
|
|
3346
|
+
const e = E(!1);
|
|
3347
|
+
return D(() => {
|
|
3335
3348
|
if (e.current) return;
|
|
3336
3349
|
e.current = !0;
|
|
3337
|
-
const
|
|
3338
|
-
|
|
3350
|
+
const n = document.createElement("link");
|
|
3351
|
+
n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
3339
3352
|
}, [t]);
|
|
3340
3353
|
}
|
|
3341
|
-
let
|
|
3342
|
-
function
|
|
3343
|
-
const [
|
|
3354
|
+
let Po = 0;
|
|
3355
|
+
function xo(t = 5, e = 5e3) {
|
|
3356
|
+
const [n, r] = j([]), o = E(/* @__PURE__ */ new Map()), s = D((i) => {
|
|
3344
3357
|
const a = o.current.get(i);
|
|
3345
|
-
a && (clearTimeout(a), o.current.delete(i)),
|
|
3358
|
+
a && (clearTimeout(a), o.current.delete(i)), r((u) => u.filter((h) => h.id !== i));
|
|
3346
3359
|
}, []);
|
|
3347
|
-
return
|
|
3348
|
-
const i = o.current, a =
|
|
3360
|
+
return C(() => {
|
|
3361
|
+
const i = o.current, a = en(
|
|
3349
3362
|
(u) => {
|
|
3350
|
-
if (!
|
|
3363
|
+
if (!St())
|
|
3351
3364
|
return;
|
|
3352
|
-
const
|
|
3353
|
-
id:
|
|
3354
|
-
level:
|
|
3365
|
+
const h = `toast-${++Po}`, p = u.level === Qe.ERROR ? "error" : "warn", m = {
|
|
3366
|
+
id: h,
|
|
3367
|
+
level: p,
|
|
3355
3368
|
message: u.message,
|
|
3356
3369
|
component: u.component
|
|
3357
3370
|
};
|
|
3358
|
-
|
|
3371
|
+
r((c) => [...c, m].slice(-t));
|
|
3359
3372
|
const y = setTimeout(() => {
|
|
3360
|
-
s(
|
|
3373
|
+
s(h);
|
|
3361
3374
|
}, e);
|
|
3362
|
-
i.set(
|
|
3375
|
+
i.set(h, y);
|
|
3363
3376
|
},
|
|
3364
|
-
{ minLevel:
|
|
3377
|
+
{ minLevel: Qe.WARN }
|
|
3365
3378
|
);
|
|
3366
3379
|
return () => {
|
|
3367
3380
|
a();
|
|
@@ -3369,11 +3382,11 @@ function Xo(t = 5, e = 5e3) {
|
|
|
3369
3382
|
clearTimeout(u);
|
|
3370
3383
|
i.clear();
|
|
3371
3384
|
};
|
|
3372
|
-
}, [t, e, s]), { toasts:
|
|
3385
|
+
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3373
3386
|
}
|
|
3374
|
-
function
|
|
3375
|
-
const [
|
|
3376
|
-
return
|
|
3387
|
+
function Lo(t, e, n) {
|
|
3388
|
+
const [r, o] = j(n);
|
|
3389
|
+
return C(() => {
|
|
3377
3390
|
if (!t)
|
|
3378
3391
|
return;
|
|
3379
3392
|
let s = !0, i = null;
|
|
@@ -3386,11 +3399,11 @@ function Po(t, e, r) {
|
|
|
3386
3399
|
}), () => {
|
|
3387
3400
|
s = !1, i?.();
|
|
3388
3401
|
};
|
|
3389
|
-
}, [t, e]),
|
|
3402
|
+
}, [t, e]), r;
|
|
3390
3403
|
}
|
|
3391
|
-
function
|
|
3392
|
-
const [
|
|
3393
|
-
return
|
|
3404
|
+
function ps(t, e, n) {
|
|
3405
|
+
const [r, o] = j(null);
|
|
3406
|
+
return C(() => {
|
|
3394
3407
|
if (!t)
|
|
3395
3408
|
return;
|
|
3396
3409
|
let s = !0;
|
|
@@ -3401,107 +3414,231 @@ function Zo(t, e, r) {
|
|
|
3401
3414
|
}), () => {
|
|
3402
3415
|
s = !1;
|
|
3403
3416
|
};
|
|
3404
|
-
}, [t, e]),
|
|
3417
|
+
}, [t, e]), Lo(r ? t : null, r ?? "", n);
|
|
3418
|
+
}
|
|
3419
|
+
const Ee = re("IkonDebug"), jo = {
|
|
3420
|
+
Digit1: "connecting",
|
|
3421
|
+
Digit2: "connected",
|
|
3422
|
+
Digit3: "reconnecting",
|
|
3423
|
+
Digit4: "offline",
|
|
3424
|
+
Digit5: "offline",
|
|
3425
|
+
Digit0: "clear"
|
|
3426
|
+
}, Uo = "Digit5", Do = "Digit6", Fo = "Synthetic debug error (Ctrl+Shift+5)", Bo = "Synthetic debug access-denied (Ctrl+Shift+6)", $o = 5e3;
|
|
3427
|
+
function Vo(t) {
|
|
3428
|
+
const e = St(), [n, r] = j(null), [o, s] = j(!1), [i, a] = j(null), [u, h] = j(null), [p, m] = j(!1);
|
|
3429
|
+
return C(() => {
|
|
3430
|
+
if (!e)
|
|
3431
|
+
return;
|
|
3432
|
+
const c = (l) => {
|
|
3433
|
+
if (!l.ctrlKey || !l.shiftKey)
|
|
3434
|
+
return;
|
|
3435
|
+
if (l.code === "KeyE") {
|
|
3436
|
+
l.preventDefault(), m((b) => (Ee.warn(`Empty-stores override: ${b ? "off" : "on"}`), !b));
|
|
3437
|
+
return;
|
|
3438
|
+
}
|
|
3439
|
+
if (l.code === Do) {
|
|
3440
|
+
l.preventDefault(), h(Bo), r(null), a(null), Ee.warn("Forced access denied");
|
|
3441
|
+
return;
|
|
3442
|
+
}
|
|
3443
|
+
const f = jo[l.code];
|
|
3444
|
+
if (f === void 0)
|
|
3445
|
+
return;
|
|
3446
|
+
if (l.preventDefault(), f === "clear") {
|
|
3447
|
+
r(null), a(null), h(null), Ee.warn("Cleared forced state");
|
|
3448
|
+
return;
|
|
3449
|
+
}
|
|
3450
|
+
const g = l.code === Uo;
|
|
3451
|
+
r(f), a(g ? Fo : null), h(null), Ee.warn(`Forced state: ${f}${g ? " (with error)" : ""}`);
|
|
3452
|
+
};
|
|
3453
|
+
return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
3454
|
+
}, [e]), C(() => {
|
|
3455
|
+
if (n !== "connecting") {
|
|
3456
|
+
s(!1);
|
|
3457
|
+
return;
|
|
3458
|
+
}
|
|
3459
|
+
const c = setTimeout(() => s(!0), $o);
|
|
3460
|
+
return () => clearTimeout(c);
|
|
3461
|
+
}, [n]), !e || n === null && !p && u === null ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, debugEnabled: e } : { app: {
|
|
3462
|
+
...t,
|
|
3463
|
+
connectionState: n ?? t.connectionState,
|
|
3464
|
+
isConnectingSlow: n === "connecting" ? o : t.isConnectingSlow,
|
|
3465
|
+
error: n === "offline" && i ? i : n ? null : t.error,
|
|
3466
|
+
stores: p ? /* @__PURE__ */ new Map() : t.stores,
|
|
3467
|
+
accessDeniedReason: u ?? t.accessDeniedReason
|
|
3468
|
+
}, forcedState: n, emptyStores: p, forcedError: i, forcedAccessDenied: u, debugEnabled: e };
|
|
3469
|
+
}
|
|
3470
|
+
function Ko(t, e) {
|
|
3471
|
+
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3472
|
+
}
|
|
3473
|
+
function Yo(t) {
|
|
3474
|
+
return t === void 0 ? null : typeof t == "function" ? t() : t;
|
|
3475
|
+
}
|
|
3476
|
+
function zo(t, e) {
|
|
3477
|
+
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3478
|
+
}
|
|
3479
|
+
function Wo(t, e) {
|
|
3480
|
+
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3481
|
+
}
|
|
3482
|
+
function ms(t) {
|
|
3483
|
+
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, { app: i } = Vo(s), { connectionState: a, isConnectingSlow: u, stores: h, registry: p, client: m, onAction: y, isReady: c, error: l, accessDeniedReason: f } = i, g = E(null);
|
|
3484
|
+
if (c && h && p && (g.current = { stores: h, registry: p, client: m }), f)
|
|
3485
|
+
return Wo(o, f);
|
|
3486
|
+
const b = g.current;
|
|
3487
|
+
let S = null;
|
|
3488
|
+
switch (a) {
|
|
3489
|
+
case "waitingForExternalConnectUrl":
|
|
3490
|
+
case "connecting":
|
|
3491
|
+
S = Ko(e, u);
|
|
3492
|
+
break;
|
|
3493
|
+
case "reconnecting":
|
|
3494
|
+
S = Yo(n);
|
|
3495
|
+
break;
|
|
3496
|
+
case "offline":
|
|
3497
|
+
S = zo(r, l);
|
|
3498
|
+
break;
|
|
3499
|
+
default:
|
|
3500
|
+
S = null;
|
|
3501
|
+
}
|
|
3502
|
+
return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
|
|
3503
|
+
b && /* @__PURE__ */ w.jsx(
|
|
3504
|
+
wt,
|
|
3505
|
+
{
|
|
3506
|
+
stores: b.stores,
|
|
3507
|
+
registry: b.registry,
|
|
3508
|
+
client: b.client,
|
|
3509
|
+
onAction: y
|
|
3510
|
+
}
|
|
3511
|
+
),
|
|
3512
|
+
S,
|
|
3513
|
+
/* @__PURE__ */ w.jsx(Ho, {})
|
|
3514
|
+
] });
|
|
3515
|
+
}
|
|
3516
|
+
function Ho() {
|
|
3517
|
+
const { toasts: t, dismissToast: e } = xo();
|
|
3518
|
+
return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(qo, { toast: n, onDismiss: e }, n.id)) });
|
|
3519
|
+
}
|
|
3520
|
+
function qo({ toast: t, onDismiss: e }) {
|
|
3521
|
+
return /* @__PURE__ */ w.jsxs(
|
|
3522
|
+
"div",
|
|
3523
|
+
{
|
|
3524
|
+
className: `ikon-toast-overlay-chip ikon-toast-overlay-chip--${t.level}`,
|
|
3525
|
+
onClick: () => e(t.id),
|
|
3526
|
+
role: "alert",
|
|
3527
|
+
children: [
|
|
3528
|
+
/* @__PURE__ */ w.jsx("span", { className: "ikon-toast-overlay-icon", children: t.level === "error" ? "🚨" : "⚠️" }),
|
|
3529
|
+
/* @__PURE__ */ w.jsxs("div", { className: "ikon-toast-overlay-content", children: [
|
|
3530
|
+
/* @__PURE__ */ w.jsxs("span", { className: "ikon-toast-overlay-component", children: [
|
|
3531
|
+
"[",
|
|
3532
|
+
t.component,
|
|
3533
|
+
"]"
|
|
3534
|
+
] }),
|
|
3535
|
+
/* @__PURE__ */ w.jsx("span", { className: "ikon-toast-overlay-message", children: t.message })
|
|
3536
|
+
] })
|
|
3537
|
+
]
|
|
3538
|
+
}
|
|
3539
|
+
);
|
|
3405
3540
|
}
|
|
3406
|
-
const
|
|
3407
|
-
function
|
|
3408
|
-
return e ? t.replace(/\{(\w+)\}/g, (
|
|
3541
|
+
const Ut = bt(null);
|
|
3542
|
+
function Go(t, e) {
|
|
3543
|
+
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3409
3544
|
}
|
|
3410
|
-
function
|
|
3411
|
-
const
|
|
3412
|
-
if (
|
|
3413
|
-
return
|
|
3414
|
-
const
|
|
3415
|
-
return t.includes(
|
|
3545
|
+
function Jo(t, e) {
|
|
3546
|
+
const n = tn();
|
|
3547
|
+
if (n && t.includes(n))
|
|
3548
|
+
return n;
|
|
3549
|
+
const r = navigator.language.split("-")[0];
|
|
3550
|
+
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3416
3551
|
}
|
|
3417
|
-
function
|
|
3418
|
-
return e ?
|
|
3552
|
+
function Xo(t, e, n) {
|
|
3553
|
+
return e ? Jo(t, n) : n && t.includes(n) ? n : "en";
|
|
3419
3554
|
}
|
|
3420
|
-
function
|
|
3555
|
+
function gs({
|
|
3421
3556
|
children: t,
|
|
3422
3557
|
translations: e,
|
|
3423
|
-
defaultLanguage:
|
|
3424
|
-
detectLanguage:
|
|
3558
|
+
defaultLanguage: n,
|
|
3559
|
+
detectLanguage: r = !1
|
|
3425
3560
|
}) {
|
|
3426
|
-
const o = Object.keys(e), s =
|
|
3561
|
+
const o = Object.keys(e), s = Xo(o, r, n), i = e[s] ?? e.en, a = K(
|
|
3427
3562
|
() => ({
|
|
3428
|
-
t: (u,
|
|
3429
|
-
const
|
|
3430
|
-
return
|
|
3563
|
+
t: (u, h) => {
|
|
3564
|
+
const p = i[u];
|
|
3565
|
+
return Go(p, h);
|
|
3431
3566
|
},
|
|
3432
3567
|
locale: s,
|
|
3433
3568
|
translations: i
|
|
3434
3569
|
}),
|
|
3435
3570
|
[i, s]
|
|
3436
3571
|
);
|
|
3437
|
-
return /* @__PURE__ */
|
|
3572
|
+
return /* @__PURE__ */ w.jsx(Ut, { value: a, children: t });
|
|
3438
3573
|
}
|
|
3439
|
-
function
|
|
3440
|
-
const t =
|
|
3574
|
+
function ys() {
|
|
3575
|
+
const t = ze(Ut);
|
|
3441
3576
|
if (!t)
|
|
3442
3577
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3443
3578
|
return t;
|
|
3444
3579
|
}
|
|
3445
3580
|
export {
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
po as
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
ur as
|
|
3489
|
-
|
|
3581
|
+
us as AuthProvider,
|
|
3582
|
+
ds as ConnectionStateRenderer,
|
|
3583
|
+
gs as I18nProvider,
|
|
3584
|
+
xn as IKON_UI_BASE_MODULE,
|
|
3585
|
+
Wn as IKON_UI_MEDIA_MODULE,
|
|
3586
|
+
ar as IKON_UI_SHADERTOY_MODULE,
|
|
3587
|
+
sr as IKON_UI_SHADERTOY_TYPE,
|
|
3588
|
+
De as IKON_UI_STREAM_CATEGORY,
|
|
3589
|
+
$n as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3590
|
+
Vn as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3591
|
+
ms as IkonApp,
|
|
3592
|
+
wn as IkonUi,
|
|
3593
|
+
lr as IkonUiRegistry,
|
|
3594
|
+
wt as IkonUiSurface,
|
|
3595
|
+
yn as InspectOverlay,
|
|
3596
|
+
os as ParallaxView,
|
|
3597
|
+
gn as UiComponentRegistry,
|
|
3598
|
+
mn as UiRenderer,
|
|
3599
|
+
ws as UiStreamStore,
|
|
3600
|
+
ss as areIkonUiModuleListsEqual,
|
|
3601
|
+
Mt as authenticateAnonymous,
|
|
3602
|
+
go as buildOAuthRedirectUrl,
|
|
3603
|
+
Te as clearAuthSession,
|
|
3604
|
+
yt as clearOAuthParams,
|
|
3605
|
+
Pn as createBaseResolvers,
|
|
3606
|
+
ns as createComponentLibrary,
|
|
3607
|
+
dr as createIkonUiRegistry,
|
|
3608
|
+
Yn as createMediaResolvers,
|
|
3609
|
+
ir as createShadertoyRendererResolver,
|
|
3610
|
+
Sn as isIkonUiCategoryMatch,
|
|
3611
|
+
Ot as loadAuthSession,
|
|
3612
|
+
Ln as loadBaseModule,
|
|
3613
|
+
Hn as loadMediaModule,
|
|
3614
|
+
cr as loadShadertoyModule,
|
|
3615
|
+
Dr as normalizeIkonUiModuleList,
|
|
3616
|
+
as as parseIkonUiInitPayload,
|
|
3617
|
+
po as parseOAuthCallback,
|
|
3618
|
+
mo as parseOAuthError,
|
|
3619
|
+
Fr as readIkonUiModules,
|
|
3620
|
+
is as readIkonUiModulesFromSources,
|
|
3621
|
+
jn as registerBaseModule,
|
|
3622
|
+
qn as registerMediaModule,
|
|
3623
|
+
ur as registerShadertoyModule,
|
|
3624
|
+
hn as renderChildren,
|
|
3625
|
+
cs as renderMotionLetters,
|
|
3490
3626
|
pe as saveAuthSession,
|
|
3491
|
-
|
|
3627
|
+
fo as sendLoginCode,
|
|
3492
3628
|
ee as sessionToUser,
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3629
|
+
_o as useAuth,
|
|
3630
|
+
ls as useAuthGuard,
|
|
3631
|
+
Oo as useAuthOptional,
|
|
3632
|
+
ys as useI18n,
|
|
3633
|
+
fs as useIkonApp,
|
|
3634
|
+
Vo as useIkonDebug,
|
|
3635
|
+
Lo as useIkonReactive,
|
|
3636
|
+
Sr as useIkonStyles,
|
|
3637
|
+
vr as useIkonUiStores,
|
|
3638
|
+
hs as useLazyFont,
|
|
3639
|
+
ps as useReactive,
|
|
3640
|
+
xo as useToasts,
|
|
3641
|
+
X as useUiNode,
|
|
3642
|
+
rs as useUiStore,
|
|
3643
|
+
ho as verifyLoginCode
|
|
3507
3644
|
};
|