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