@ikonai/sdk-react-ui 1.0.66 → 1.0.67
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 +6 -0
- package/ikon-ui.d.ts +3 -1
- package/index.js +1184 -1182
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
5
|
-
import { randomUuid as
|
|
6
|
-
var
|
|
1
|
+
import { IkonUiCore as fn, UiStreamStore as hn, prefetchBootSnapshot as pn } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as Qs } from "@ikonai/sdk-ui";
|
|
3
|
+
import mn, { useSyncExternalStore as nt, useMemo as W, memo as Y, useRef as v, useCallback as D, Fragment as gn, useEffect as C, useState as x, use as rt, createContext as Pt, useReducer as yn } from "react";
|
|
4
|
+
import { createLogger as se, isInspectModeEnabled as bn, getOrCreateDeviceId as wn, getSameOriginAuthUrl as Sn, abortSignalTimeout as Lt, deriveAuthUrl as Se, getDebugOverlayParam as En, subscribeToLogEvents as Mt, LogLevel as Xe, parseUrlParams as vn, clearSessionParamsFromUrl as Rn, isCloudEnvironment as lt, extractUserIdFromToken as ut, deriveBackendType as dt, IkonClient as An, AccessDeniedError as Tn, ServerFullError as kn, AuthenticationError as Cn, isDebugModeEnabled as Ut, getLangParam as _n } from "@ikonai/sdk";
|
|
5
|
+
import { randomUuid as ti } from "@ikonai/sdk";
|
|
6
|
+
var Te = { exports: {} }, pe = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.js
|
|
@@ -13,10 +13,10 @@ var Re = { exports: {} }, de = {};
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
16
|
+
var ft;
|
|
17
|
+
function In() {
|
|
18
|
+
if (ft) return pe;
|
|
19
|
+
ft = 1;
|
|
20
20
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
21
21
|
function n(r, o, s) {
|
|
22
22
|
var i = null;
|
|
@@ -33,9 +33,9 @@ function En() {
|
|
|
33
33
|
props: s
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return pe.Fragment = e, pe.jsx = n, pe.jsxs = n, pe;
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var me = {};
|
|
39
39
|
/**
|
|
40
40
|
* @license React
|
|
41
41
|
* react-jsx-runtime.development.js
|
|
@@ -45,15 +45,15 @@ var fe = {};
|
|
|
45
45
|
* This source code is licensed under the MIT license found in the
|
|
46
46
|
* LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
-
return
|
|
51
|
-
function t(
|
|
52
|
-
if (
|
|
53
|
-
if (typeof
|
|
54
|
-
return
|
|
55
|
-
if (typeof
|
|
56
|
-
switch (
|
|
48
|
+
var ht;
|
|
49
|
+
function On() {
|
|
50
|
+
return ht || (ht = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
|
+
function t(h) {
|
|
52
|
+
if (h == null) return null;
|
|
53
|
+
if (typeof h == "function")
|
|
54
|
+
return h.$$typeof === L ? null : h.displayName || h.name || null;
|
|
55
|
+
if (typeof h == "string") return h;
|
|
56
|
+
switch (h) {
|
|
57
57
|
case g:
|
|
58
58
|
return "Fragment";
|
|
59
59
|
case w:
|
|
@@ -62,150 +62,150 @@ function vn() {
|
|
|
62
62
|
return "StrictMode";
|
|
63
63
|
case M:
|
|
64
64
|
return "Suspense";
|
|
65
|
-
case
|
|
65
|
+
case J:
|
|
66
66
|
return "SuspenseList";
|
|
67
|
-
case
|
|
67
|
+
case _:
|
|
68
68
|
return "Activity";
|
|
69
69
|
}
|
|
70
|
-
if (typeof
|
|
71
|
-
switch (typeof
|
|
70
|
+
if (typeof h == "object")
|
|
71
|
+
switch (typeof h.tag == "number" && console.error(
|
|
72
72
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
|
-
),
|
|
74
|
-
case
|
|
73
|
+
), h.$$typeof) {
|
|
74
|
+
case m:
|
|
75
75
|
return "Portal";
|
|
76
76
|
case E:
|
|
77
|
-
return
|
|
78
|
-
case
|
|
79
|
-
return (
|
|
77
|
+
return h.displayName || "Context";
|
|
78
|
+
case R:
|
|
79
|
+
return (h._context.displayName || "Context") + ".Consumer";
|
|
80
80
|
case T:
|
|
81
|
-
var
|
|
82
|
-
return
|
|
83
|
-
case
|
|
84
|
-
return
|
|
85
|
-
case
|
|
86
|
-
|
|
81
|
+
var A = h.render;
|
|
82
|
+
return h = h.displayName, h || (h = A.displayName || A.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
|
|
83
|
+
case Q:
|
|
84
|
+
return A = h.displayName || null, A !== null ? A : t(h.type) || "Memo";
|
|
85
|
+
case X:
|
|
86
|
+
A = h._payload, h = h._init;
|
|
87
87
|
try {
|
|
88
|
-
return t(
|
|
88
|
+
return t(h(A));
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
-
function e(
|
|
95
|
-
return "" +
|
|
94
|
+
function e(h) {
|
|
95
|
+
return "" + h;
|
|
96
96
|
}
|
|
97
|
-
function n(
|
|
97
|
+
function n(h) {
|
|
98
98
|
try {
|
|
99
|
-
e(
|
|
100
|
-
var
|
|
99
|
+
e(h);
|
|
100
|
+
var A = !1;
|
|
101
101
|
} catch {
|
|
102
|
-
|
|
102
|
+
A = !0;
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
return
|
|
108
|
-
|
|
104
|
+
if (A) {
|
|
105
|
+
A = console;
|
|
106
|
+
var N = A.error, P = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
|
107
|
+
return N.call(
|
|
108
|
+
A,
|
|
109
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
110
|
P
|
|
111
|
-
), e(
|
|
111
|
+
), e(h);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function r(
|
|
115
|
-
if (
|
|
116
|
-
if (typeof
|
|
114
|
+
function r(h) {
|
|
115
|
+
if (h === g) return "<>";
|
|
116
|
+
if (typeof h == "object" && h !== null && h.$$typeof === X)
|
|
117
117
|
return "<...>";
|
|
118
118
|
try {
|
|
119
|
-
var
|
|
120
|
-
return
|
|
119
|
+
var A = t(h);
|
|
120
|
+
return A ? "<" + A + ">" : "<...>";
|
|
121
121
|
} catch {
|
|
122
122
|
return "<...>";
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
function o() {
|
|
126
|
-
var
|
|
127
|
-
return
|
|
126
|
+
var h = U.A;
|
|
127
|
+
return h === null ? null : h.getOwner();
|
|
128
128
|
}
|
|
129
129
|
function s() {
|
|
130
130
|
return Error("react-stack-top-frame");
|
|
131
131
|
}
|
|
132
|
-
function i(
|
|
133
|
-
if (
|
|
134
|
-
var
|
|
135
|
-
if (
|
|
132
|
+
function i(h) {
|
|
133
|
+
if (F.call(h, "key")) {
|
|
134
|
+
var A = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
135
|
+
if (A && A.isReactWarning) return !1;
|
|
136
136
|
}
|
|
137
|
-
return
|
|
137
|
+
return h.key !== void 0;
|
|
138
138
|
}
|
|
139
|
-
function a(
|
|
140
|
-
function
|
|
141
|
-
|
|
139
|
+
function a(h, A) {
|
|
140
|
+
function N() {
|
|
141
|
+
K || (K = !0, console.error(
|
|
142
142
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
143
|
-
|
|
143
|
+
A
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
get:
|
|
146
|
+
N.isReactWarning = !0, Object.defineProperty(h, "key", {
|
|
147
|
+
get: N,
|
|
148
148
|
configurable: !0
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
function l() {
|
|
152
|
-
var
|
|
153
|
-
return
|
|
152
|
+
var h = t(this.type);
|
|
153
|
+
return ve[h] || (ve[h] = !0, console.error(
|
|
154
154
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
|
-
)),
|
|
156
|
-
}
|
|
157
|
-
function
|
|
158
|
-
var
|
|
159
|
-
return
|
|
160
|
-
$$typeof:
|
|
161
|
-
type:
|
|
162
|
-
key:
|
|
163
|
-
props:
|
|
155
|
+
)), h = this.props.ref, h !== void 0 ? h : null;
|
|
156
|
+
}
|
|
157
|
+
function f(h, A, N, P, ee, he) {
|
|
158
|
+
var O = N.ref;
|
|
159
|
+
return h = {
|
|
160
|
+
$$typeof: d,
|
|
161
|
+
type: h,
|
|
162
|
+
key: A,
|
|
163
|
+
props: N,
|
|
164
164
|
_owner: P
|
|
165
|
-
}, (
|
|
165
|
+
}, (O !== void 0 ? O : null) !== null ? Object.defineProperty(h, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
get: l
|
|
168
|
-
}) : Object.defineProperty(
|
|
168
|
+
}) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
|
|
169
169
|
configurable: !1,
|
|
170
170
|
enumerable: !1,
|
|
171
171
|
writable: !0,
|
|
172
172
|
value: 0
|
|
173
|
-
}), Object.defineProperty(
|
|
173
|
+
}), Object.defineProperty(h, "_debugInfo", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
176
176
|
writable: !0,
|
|
177
177
|
value: null
|
|
178
|
-
}), Object.defineProperty(
|
|
178
|
+
}), Object.defineProperty(h, "_debugStack", {
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
182
|
value: ee
|
|
183
|
-
}), Object.defineProperty(
|
|
183
|
+
}), Object.defineProperty(h, "_debugTask", {
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
188
|
-
}), Object.freeze && (Object.freeze(
|
|
187
|
+
value: he
|
|
188
|
+
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
|
|
189
189
|
}
|
|
190
|
-
function h
|
|
191
|
-
var
|
|
192
|
-
if (
|
|
190
|
+
function p(h, A, N, P, ee, he) {
|
|
191
|
+
var O = A.children;
|
|
192
|
+
if (O !== void 0)
|
|
193
193
|
if (P)
|
|
194
|
-
if (B(
|
|
195
|
-
for (P = 0; P <
|
|
196
|
-
|
|
197
|
-
Object.freeze && Object.freeze(
|
|
194
|
+
if (B(O)) {
|
|
195
|
+
for (P = 0; P < O.length; P++)
|
|
196
|
+
y(O[P]);
|
|
197
|
+
Object.freeze && Object.freeze(O);
|
|
198
198
|
} else
|
|
199
199
|
console.error(
|
|
200
200
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
201
|
);
|
|
202
|
-
else
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
var
|
|
206
|
-
return
|
|
202
|
+
else y(O);
|
|
203
|
+
if (F.call(A, "key")) {
|
|
204
|
+
O = t(h);
|
|
205
|
+
var Z = Object.keys(A).filter(function(Me) {
|
|
206
|
+
return Me !== "key";
|
|
207
207
|
});
|
|
208
|
-
P = 0 <
|
|
208
|
+
P = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", fe[O + P] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
209
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s {...props} />
|
|
@@ -213,76 +213,76 @@ React keys must be passed directly to JSX without using spread:
|
|
|
213
213
|
let props = %s;
|
|
214
214
|
<%s key={someKey} {...props} />`,
|
|
215
215
|
P,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
),
|
|
216
|
+
O,
|
|
217
|
+
Z,
|
|
218
|
+
O
|
|
219
|
+
), fe[O + P] = !0);
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
for (var
|
|
224
|
-
|
|
225
|
-
} else
|
|
226
|
-
return
|
|
227
|
-
|
|
228
|
-
typeof
|
|
229
|
-
),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
221
|
+
if (O = null, N !== void 0 && (n(N), O = "" + N), i(A) && (n(A.key), O = "" + A.key), "key" in A) {
|
|
222
|
+
N = {};
|
|
223
|
+
for (var te in A)
|
|
224
|
+
te !== "key" && (N[te] = A[te]);
|
|
225
|
+
} else N = A;
|
|
226
|
+
return O && a(
|
|
227
|
+
N,
|
|
228
|
+
typeof h == "function" ? h.displayName || h.name || "Unknown" : h
|
|
229
|
+
), f(
|
|
230
|
+
h,
|
|
231
|
+
O,
|
|
232
|
+
N,
|
|
233
233
|
o(),
|
|
234
234
|
ee,
|
|
235
|
-
|
|
235
|
+
he
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
|
|
238
|
+
function y(h) {
|
|
239
|
+
u(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === X && (h._payload.status === "fulfilled" ? u(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
return typeof
|
|
241
|
+
function u(h) {
|
|
242
|
+
return typeof h == "object" && h !== null && h.$$typeof === d;
|
|
243
243
|
}
|
|
244
|
-
var c =
|
|
244
|
+
var c = mn, d = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), E = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), X = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), U = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, B = Array.isArray, $ = console.createTask ? console.createTask : function() {
|
|
245
245
|
return null;
|
|
246
246
|
};
|
|
247
247
|
c = {
|
|
248
|
-
react_stack_bottom_frame: function(
|
|
249
|
-
return
|
|
248
|
+
react_stack_bottom_frame: function(h) {
|
|
249
|
+
return h();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var
|
|
252
|
+
var K, ve = {}, de = c.react_stack_bottom_frame.bind(
|
|
253
253
|
c,
|
|
254
254
|
s
|
|
255
|
-
)(),
|
|
256
|
-
|
|
257
|
-
var P = 1e4 >
|
|
258
|
-
return
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
255
|
+
)(), Re = $(r(s)), fe = {};
|
|
256
|
+
me.Fragment = g, me.jsx = function(h, A, N) {
|
|
257
|
+
var P = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
258
|
+
return p(
|
|
259
|
+
h,
|
|
260
|
+
A,
|
|
261
|
+
N,
|
|
262
262
|
!1,
|
|
263
|
-
P ? Error("react-stack-top-frame") :
|
|
264
|
-
P ?
|
|
263
|
+
P ? Error("react-stack-top-frame") : de,
|
|
264
|
+
P ? $(r(h)) : Re
|
|
265
265
|
);
|
|
266
|
-
},
|
|
267
|
-
var P = 1e4 >
|
|
268
|
-
return
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
}, me.jsxs = function(h, A, N) {
|
|
267
|
+
var P = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return p(
|
|
269
|
+
h,
|
|
270
|
+
A,
|
|
271
|
+
N,
|
|
272
272
|
!0,
|
|
273
|
-
P ? Error("react-stack-top-frame") :
|
|
274
|
-
P ?
|
|
273
|
+
P ? Error("react-stack-top-frame") : de,
|
|
274
|
+
P ? $(r(h)) : Re
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
|
-
})()),
|
|
277
|
+
})()), me;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
279
|
+
var pt;
|
|
280
|
+
function Nn() {
|
|
281
|
+
return pt || (pt = 1, process.env.NODE_ENV === "production" ? Te.exports = In() : Te.exports = On()), Te.exports;
|
|
282
282
|
}
|
|
283
|
-
var S =
|
|
284
|
-
function
|
|
285
|
-
const n =
|
|
283
|
+
var S = Nn();
|
|
284
|
+
function xn(t, e) {
|
|
285
|
+
const n = nt(
|
|
286
286
|
(r) => t.subscribe(r),
|
|
287
287
|
() => {
|
|
288
288
|
const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
|
|
@@ -301,16 +301,16 @@ function An(t, e) {
|
|
|
301
301
|
};
|
|
302
302
|
}, [n]);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
const n =
|
|
304
|
+
function q(t, e) {
|
|
305
|
+
const n = nt(
|
|
306
306
|
(r) => t.subscribeNode(e, r),
|
|
307
307
|
() => t.getNodeVersion(e),
|
|
308
308
|
() => t.getNodeVersion(e)
|
|
309
309
|
);
|
|
310
310
|
return W(() => t.getNode(e), [t, e, n]);
|
|
311
311
|
}
|
|
312
|
-
const
|
|
313
|
-
function
|
|
312
|
+
const Pn = se("UIRenderer");
|
|
313
|
+
function Ln(t) {
|
|
314
314
|
if (t === void 0)
|
|
315
315
|
return "{}";
|
|
316
316
|
if (typeof t == "string")
|
|
@@ -321,18 +321,18 @@ function kn(t) {
|
|
|
321
321
|
return "{}";
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Mn(t) {
|
|
325
325
|
const e = t.styleIds;
|
|
326
326
|
return Array.isArray(e) ? e : [];
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Un(t) {
|
|
329
329
|
const e = t.children;
|
|
330
330
|
return Array.isArray(e) ? e : [];
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function jn(t, e) {
|
|
333
333
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Dn(t) {
|
|
336
336
|
if (t.length === 0) return "";
|
|
337
337
|
if (t.length === 1) return t[0].id;
|
|
338
338
|
let e = t[0].id;
|
|
@@ -340,66 +340,66 @@ function On(t) {
|
|
|
340
340
|
e += "," + t[n].id;
|
|
341
341
|
return e;
|
|
342
342
|
}
|
|
343
|
-
const
|
|
344
|
-
const r =
|
|
345
|
-
() => o.length === 0 ? null : o.map((
|
|
343
|
+
const He = Y(function t({ nodeId: e, context: n }) {
|
|
344
|
+
const r = q(n.store, e), o = r ? Un(r) : [], s = Dn(o), i = W(
|
|
345
|
+
() => o.length === 0 ? null : o.map((y) => /* @__PURE__ */ S.jsx(t, { nodeId: y.id, context: n }, y.id)),
|
|
346
346
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
347
347
|
[s, n]
|
|
348
348
|
);
|
|
349
349
|
if (!r)
|
|
350
350
|
return null;
|
|
351
351
|
if (r.type === "root")
|
|
352
|
-
return /* @__PURE__ */ S.jsx(
|
|
352
|
+
return /* @__PURE__ */ S.jsx(gn, { children: i }, r.id);
|
|
353
353
|
const a = n.library.resolve(r);
|
|
354
354
|
if (!a)
|
|
355
|
-
return
|
|
356
|
-
const l =
|
|
357
|
-
return /* @__PURE__ */ S.jsx(
|
|
358
|
-
},
|
|
359
|
-
function
|
|
360
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ S.jsx(
|
|
361
|
-
}
|
|
362
|
-
function
|
|
355
|
+
return Pn.warn(`No renderer for node type ${r.type}`), null;
|
|
356
|
+
const l = Mn(r), f = l.length > 0 ? l.join(" ") : void 0, p = a;
|
|
357
|
+
return /* @__PURE__ */ S.jsx(p, { nodeId: e, context: n, className: f });
|
|
358
|
+
}, jn);
|
|
359
|
+
function $n(t, e) {
|
|
360
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ S.jsx(He, { nodeId: n.id, context: e }, n.id));
|
|
361
|
+
}
|
|
362
|
+
function Bn(t, e) {
|
|
363
363
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
364
364
|
}
|
|
365
|
-
const
|
|
366
|
-
const { rootViewId: l, rootNodeId:
|
|
367
|
-
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
const c = D((
|
|
373
|
-
if (!
|
|
365
|
+
const Fn = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
366
|
+
const { rootViewId: l, rootNodeId: f } = xn(e, r), p = v(s);
|
|
367
|
+
p.current = s;
|
|
368
|
+
const y = v(i);
|
|
369
|
+
y.current = i;
|
|
370
|
+
const u = v(a);
|
|
371
|
+
u.current = a;
|
|
372
|
+
const c = D((m, g) => {
|
|
373
|
+
if (!m)
|
|
374
374
|
return;
|
|
375
|
-
const b =
|
|
376
|
-
|
|
377
|
-
}, []),
|
|
378
|
-
const
|
|
375
|
+
const b = Ln(g);
|
|
376
|
+
p.current?.(m, b);
|
|
377
|
+
}, []), d = W(() => {
|
|
378
|
+
const m = {
|
|
379
379
|
store: e,
|
|
380
380
|
library: n,
|
|
381
381
|
handlerCache: e.handlerCache,
|
|
382
382
|
// Access payloads from store at call time, not captured snapshot
|
|
383
383
|
getPayload: (g) => e.getSnapshot().payloads.get(g),
|
|
384
|
-
renderChildren: (g) =>
|
|
384
|
+
renderChildren: (g) => $n(g, m),
|
|
385
385
|
renderView: (g) => {
|
|
386
386
|
const b = e.getSnapshot().views.get(g);
|
|
387
|
-
return b ? /* @__PURE__ */ S.jsx(
|
|
387
|
+
return b ? /* @__PURE__ */ S.jsx(He, { nodeId: b.id, context: m }) : null;
|
|
388
388
|
},
|
|
389
389
|
dispatchAction: c,
|
|
390
390
|
// Access client/video via refs to avoid context recreation
|
|
391
391
|
get client() {
|
|
392
|
-
return
|
|
392
|
+
return y.current;
|
|
393
393
|
},
|
|
394
394
|
get video() {
|
|
395
|
-
return
|
|
395
|
+
return u.current;
|
|
396
396
|
}
|
|
397
397
|
};
|
|
398
|
-
return
|
|
398
|
+
return m;
|
|
399
399
|
}, [e, n, c]);
|
|
400
|
-
return !l || !
|
|
401
|
-
},
|
|
402
|
-
class
|
|
400
|
+
return !l || !f ? o : /* @__PURE__ */ S.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ S.jsx(He, { nodeId: f, context: d }) });
|
|
401
|
+
}, Bn);
|
|
402
|
+
class Vn {
|
|
403
403
|
constructor(e, n) {
|
|
404
404
|
if (this.fallback = n, e)
|
|
405
405
|
for (const [r, o] of e)
|
|
@@ -416,20 +416,20 @@ class Ln {
|
|
|
416
416
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Ms(t, e) {
|
|
420
420
|
const n = Object.entries(t);
|
|
421
|
-
return new
|
|
421
|
+
return new Vn(n, e);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
return
|
|
423
|
+
function Us(t) {
|
|
424
|
+
return nt(
|
|
425
425
|
(e) => t.subscribe(e),
|
|
426
426
|
() => t.getSnapshot(),
|
|
427
427
|
() => t.getSnapshot()
|
|
428
428
|
);
|
|
429
429
|
}
|
|
430
|
-
function
|
|
431
|
-
const t =
|
|
432
|
-
return
|
|
430
|
+
function Wn() {
|
|
431
|
+
const t = bn();
|
|
432
|
+
return C(() => {
|
|
433
433
|
if (!t)
|
|
434
434
|
return;
|
|
435
435
|
let e = window.parent === window, n = null, r = [];
|
|
@@ -439,25 +439,25 @@ function Mn() {
|
|
|
439
439
|
n && !r.includes(n) && (n.style.outline = "", n.style.outlineOffset = ""), n = null, o.style.display = "none";
|
|
440
440
|
}
|
|
441
441
|
function i(c) {
|
|
442
|
-
for (const
|
|
443
|
-
|
|
442
|
+
for (const m of r)
|
|
443
|
+
m !== n && (m.style.outline = "", m.style.outlineOffset = "");
|
|
444
444
|
r = [];
|
|
445
|
-
const
|
|
446
|
-
for (const
|
|
447
|
-
const g =
|
|
448
|
-
|
|
445
|
+
const d = new Set(c);
|
|
446
|
+
for (const m of Array.from(document.querySelectorAll("[data-ikon-source]"))) {
|
|
447
|
+
const g = m.getAttribute("data-ikon-source") ?? "";
|
|
448
|
+
d.has(g) && (m.style.outline = "2px solid #a6e3a1", m.style.outlineOffset = "1px", r.push(m));
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
function a(c) {
|
|
452
452
|
if (!e)
|
|
453
453
|
return;
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
454
|
+
const d = c.target.closest?.("[data-ikon-source]");
|
|
455
|
+
if (!d || d === n)
|
|
456
456
|
return;
|
|
457
|
-
s(), n =
|
|
458
|
-
const
|
|
459
|
-
o.textContent =
|
|
460
|
-
const g =
|
|
457
|
+
s(), n = d, n.style.outline = "2px solid #89b4fa", n.style.outlineOffset = "1px";
|
|
458
|
+
const m = d.getAttribute("data-ikon-source") ?? "";
|
|
459
|
+
o.textContent = m, o.style.display = "block";
|
|
460
|
+
const g = d.getBoundingClientRect();
|
|
461
461
|
o.style.left = `${g.left}px`, o.style.top = `${Math.max(0, g.top - 24)}px`;
|
|
462
462
|
}
|
|
463
463
|
function l(c) {
|
|
@@ -465,77 +465,77 @@ function Mn() {
|
|
|
465
465
|
return;
|
|
466
466
|
c.relatedTarget?.closest?.("[data-ikon-source]") !== n && s();
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function f(c) {
|
|
469
469
|
if (!e)
|
|
470
470
|
return;
|
|
471
|
-
const
|
|
472
|
-
if (!
|
|
471
|
+
const d = c.target.closest?.("[data-ikon-source]");
|
|
472
|
+
if (!d)
|
|
473
473
|
return;
|
|
474
474
|
c.preventDefault(), c.stopPropagation();
|
|
475
|
-
const
|
|
476
|
-
sourceMarker:
|
|
477
|
-
tagName:
|
|
478
|
-
textContent: (
|
|
475
|
+
const m = {
|
|
476
|
+
sourceMarker: d.getAttribute("data-ikon-source") ?? "",
|
|
477
|
+
tagName: d.tagName.toLowerCase(),
|
|
478
|
+
textContent: (d.textContent ?? "").trim().substring(0, 200)
|
|
479
479
|
};
|
|
480
|
-
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail:
|
|
480
|
+
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
|
|
481
481
|
}
|
|
482
|
-
function
|
|
483
|
-
return document.elementFromPoint(c,
|
|
482
|
+
function p(c, d) {
|
|
483
|
+
return document.elementFromPoint(c, d)?.closest?.("[data-ikon-source]");
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function y(c) {
|
|
486
486
|
if (c === n || (s(), !c))
|
|
487
487
|
return;
|
|
488
488
|
n = c, n.style.outline = `2px solid ${r.includes(c) ? "#a6e3a1" : "#89b4fa"}`, n.style.outlineOffset = "1px";
|
|
489
|
-
const
|
|
490
|
-
o.textContent =
|
|
491
|
-
const
|
|
492
|
-
o.style.left = `${
|
|
489
|
+
const d = c.getAttribute("data-ikon-source") ?? "";
|
|
490
|
+
o.textContent = d, o.style.display = "block";
|
|
491
|
+
const m = c.getBoundingClientRect();
|
|
492
|
+
o.style.left = `${m.left}px`, o.style.top = `${Math.max(0, m.top - 24)}px`;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function u(c) {
|
|
495
495
|
if (c.data?.type === "ikon-inspect-mode") {
|
|
496
|
-
const
|
|
497
|
-
!
|
|
496
|
+
const d = !!c.data.enabled;
|
|
497
|
+
!d && e && s(), e = d;
|
|
498
498
|
return;
|
|
499
499
|
}
|
|
500
500
|
if (c.data?.type === "ikon-inspect-at") {
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
const
|
|
501
|
+
const d = p(c.data.x, c.data.y);
|
|
502
|
+
y(d);
|
|
503
|
+
const m = d?.getAttribute("data-ikon-source") ?? "";
|
|
504
504
|
window.parent.postMessage({
|
|
505
505
|
type: "ikon-inspect-hover-result",
|
|
506
|
-
payload: { sourceMarker:
|
|
506
|
+
payload: { sourceMarker: m }
|
|
507
507
|
}, "*");
|
|
508
508
|
}
|
|
509
509
|
if (c.data?.type === "ikon-inspect-click") {
|
|
510
|
-
const
|
|
511
|
-
if (
|
|
512
|
-
const
|
|
513
|
-
sourceMarker:
|
|
514
|
-
tagName:
|
|
515
|
-
textContent: (
|
|
510
|
+
const d = p(c.data.x, c.data.y);
|
|
511
|
+
if (d) {
|
|
512
|
+
const m = {
|
|
513
|
+
sourceMarker: d.getAttribute("data-ikon-source") ?? "",
|
|
514
|
+
tagName: d.tagName.toLowerCase(),
|
|
515
|
+
textContent: (d.textContent ?? "").trim().substring(0, 200)
|
|
516
516
|
};
|
|
517
|
-
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail:
|
|
517
|
+
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
if (c.data?.type === "ikon-inspect-click-add") {
|
|
521
|
-
const
|
|
522
|
-
if (
|
|
523
|
-
const
|
|
524
|
-
sourceMarker:
|
|
525
|
-
tagName:
|
|
526
|
-
textContent: (
|
|
521
|
+
const d = p(c.data.x, c.data.y);
|
|
522
|
+
if (d) {
|
|
523
|
+
const m = {
|
|
524
|
+
sourceMarker: d.getAttribute("data-ikon-source") ?? "",
|
|
525
|
+
tagName: d.tagName.toLowerCase(),
|
|
526
|
+
textContent: (d.textContent ?? "").trim().substring(0, 200)
|
|
527
527
|
};
|
|
528
528
|
window.parent.postMessage({
|
|
529
529
|
type: "ikon-inspect-rect-result",
|
|
530
|
-
payload: { elements: [
|
|
530
|
+
payload: { elements: [m], append: !0 }
|
|
531
531
|
}, "*");
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
if (c.data?.type === "ikon-inspect-rect") {
|
|
535
|
-
const { x1:
|
|
536
|
-
for (const T of Array.from(
|
|
535
|
+
const { x1: d, y1: m, x2: g, y2: b, append: w } = c.data, R = document.querySelectorAll("[data-ikon-source]"), E = [];
|
|
536
|
+
for (const T of Array.from(R)) {
|
|
537
537
|
const M = T.getBoundingClientRect();
|
|
538
|
-
M.right >
|
|
538
|
+
M.right > d && M.left < g && M.bottom > m && M.top < b && E.push({
|
|
539
539
|
sourceMarker: T.getAttribute("data-ikon-source") ?? "",
|
|
540
540
|
tagName: T.tagName.toLowerCase(),
|
|
541
541
|
textContent: (T.textContent ?? "").trim().substring(0, 200)
|
|
@@ -548,40 +548,40 @@ function Mn() {
|
|
|
548
548
|
}
|
|
549
549
|
c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
|
|
550
550
|
}
|
|
551
|
-
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click",
|
|
552
|
-
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click",
|
|
551
|
+
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click", f, !0), window.addEventListener("message", u), () => {
|
|
552
|
+
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click", f, !0), window.removeEventListener("message", u), s(), i([]), o.remove();
|
|
553
553
|
};
|
|
554
554
|
}, [t]), null;
|
|
555
555
|
}
|
|
556
|
-
const
|
|
557
|
-
function
|
|
556
|
+
const Kn = se("IkonUiSurface"), qe = "ikon-ui";
|
|
557
|
+
function Gn(t, e) {
|
|
558
558
|
return t === e;
|
|
559
559
|
}
|
|
560
|
-
const
|
|
561
|
-
const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a =
|
|
560
|
+
const jt = Y(function({ stores: e, registry: n, category: r = qe, onAction: o, client: s }) {
|
|
561
|
+
const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
|
|
562
562
|
a.current = o;
|
|
563
|
-
const l =
|
|
563
|
+
const l = v(s);
|
|
564
564
|
l.current = s;
|
|
565
|
-
const
|
|
565
|
+
const f = W(
|
|
566
566
|
() => {
|
|
567
|
-
const
|
|
568
|
-
for (const [c,
|
|
569
|
-
const
|
|
570
|
-
|
|
567
|
+
const u = [];
|
|
568
|
+
for (const [c, d] of e) {
|
|
569
|
+
const m = d.store.getSnapshot();
|
|
570
|
+
Gn(d.category, r) && (!m.rootViewId || !m.views.has(m.rootViewId) || u.push({ key: c, store: d.store }));
|
|
571
571
|
}
|
|
572
|
-
return
|
|
572
|
+
return u;
|
|
573
573
|
},
|
|
574
574
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
575
575
|
[e, r, i]
|
|
576
|
-
),
|
|
577
|
-
return
|
|
578
|
-
|
|
579
|
-
}, [
|
|
580
|
-
/* @__PURE__ */ S.jsx(
|
|
581
|
-
|
|
576
|
+
), p = v(!1), y = f.length > 0;
|
|
577
|
+
return C(() => {
|
|
578
|
+
y && !p.current && (p.current = !0, Kn.debug("First UI render"));
|
|
579
|
+
}, [y]), y ? /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
|
|
580
|
+
/* @__PURE__ */ S.jsx(Wn, {}),
|
|
581
|
+
f.map(({ key: u, store: c }) => /* @__PURE__ */ S.jsx(Fn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, u))
|
|
582
582
|
] }) : null;
|
|
583
583
|
});
|
|
584
|
-
class
|
|
584
|
+
class Yn {
|
|
585
585
|
core;
|
|
586
586
|
ownsCore;
|
|
587
587
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -589,7 +589,7 @@ class Dn {
|
|
|
589
589
|
unsubscribeClears;
|
|
590
590
|
unsubscribeStoreChanges;
|
|
591
591
|
constructor(e) {
|
|
592
|
-
this.core = e?.core ?? new
|
|
592
|
+
this.core = e?.core ?? new fn({ client: e?.client, cache: e?.cache }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
593
593
|
}
|
|
594
594
|
dispose() {
|
|
595
595
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -639,8 +639,8 @@ class Dn {
|
|
|
639
639
|
if (n)
|
|
640
640
|
return n;
|
|
641
641
|
const r = {
|
|
642
|
-
category:
|
|
643
|
-
store: new
|
|
642
|
+
category: qe,
|
|
643
|
+
store: new hn()
|
|
644
644
|
};
|
|
645
645
|
return this.stores.set(e, r), r;
|
|
646
646
|
}
|
|
@@ -648,7 +648,7 @@ class Dn {
|
|
|
648
648
|
const r = this.stores.get(e);
|
|
649
649
|
if (!r)
|
|
650
650
|
return !1;
|
|
651
|
-
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
651
|
+
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? qe;
|
|
652
652
|
return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
|
|
653
653
|
}
|
|
654
654
|
notify(e) {
|
|
@@ -656,13 +656,13 @@ class Dn {
|
|
|
656
656
|
n(e);
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function zn(t) {
|
|
660
660
|
if (typeof t == "string") {
|
|
661
661
|
const e = t.trim();
|
|
662
662
|
return e.length > 0 ? e : void 0;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function le(t) {
|
|
666
666
|
if (typeof t == "string") {
|
|
667
667
|
const e = t.trim();
|
|
668
668
|
return e.length > 0 ? e : void 0;
|
|
@@ -672,7 +672,7 @@ function ae(t) {
|
|
|
672
672
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function ot(...t) {
|
|
676
676
|
let e = "";
|
|
677
677
|
for (const n of t)
|
|
678
678
|
if (n) {
|
|
@@ -681,19 +681,19 @@ function Qe(...t) {
|
|
|
681
681
|
}
|
|
682
682
|
return e || void 0;
|
|
683
683
|
}
|
|
684
|
-
const
|
|
685
|
-
function
|
|
684
|
+
const mt = /* @__PURE__ */ new WeakMap(), Xn = {};
|
|
685
|
+
function st(t) {
|
|
686
686
|
if (!t)
|
|
687
|
-
return
|
|
688
|
-
const e =
|
|
687
|
+
return Xn;
|
|
688
|
+
const e = mt.get(t);
|
|
689
689
|
if (e)
|
|
690
690
|
return e;
|
|
691
691
|
const n = {};
|
|
692
692
|
for (const [r, o] of Object.entries(t))
|
|
693
693
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
694
|
-
return
|
|
694
|
+
return mt.set(t, n), n;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function Hn(t) {
|
|
697
697
|
let e = t.parentElement;
|
|
698
698
|
for (; e; ) {
|
|
699
699
|
const r = window.getComputedStyle(e).overflowY;
|
|
@@ -703,32 +703,32 @@ function Fn(t) {
|
|
|
703
703
|
}
|
|
704
704
|
return null;
|
|
705
705
|
}
|
|
706
|
-
const
|
|
707
|
-
function
|
|
706
|
+
const Dt = 1.5;
|
|
707
|
+
function $t(t, e) {
|
|
708
708
|
requestAnimationFrame(() => {
|
|
709
|
-
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight *
|
|
709
|
+
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * Dt ? "auto" : "smooth";
|
|
710
710
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
|
-
const
|
|
714
|
-
function
|
|
715
|
-
return Math.max(t.clientHeight *
|
|
713
|
+
const Je = "data-ikon-scroll-indicator", qn = 0.15, Ie = "data-ikon-at-bottom";
|
|
714
|
+
function Bt(t) {
|
|
715
|
+
return Math.max(t.clientHeight * qn, 20);
|
|
716
716
|
}
|
|
717
|
-
function
|
|
718
|
-
return t.getAttribute(
|
|
717
|
+
function Jn(t) {
|
|
718
|
+
return t.getAttribute(Ie) !== "false";
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
t.getAttribute(
|
|
722
|
-
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <=
|
|
723
|
-
t.setAttribute(
|
|
720
|
+
function Zn(t) {
|
|
721
|
+
t.getAttribute(Ie) === null && (t.setAttribute(Ie, "true"), t.addEventListener("scroll", () => {
|
|
722
|
+
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Bt(t);
|
|
723
|
+
t.setAttribute(Ie, s ? "true" : "false");
|
|
724
724
|
}, { passive: !0 }));
|
|
725
725
|
}
|
|
726
|
-
function
|
|
727
|
-
const e = t.parentElement ?? t, n = e.querySelector(`[${
|
|
726
|
+
function Qn(t) {
|
|
727
|
+
const e = t.parentElement ?? t, n = e.querySelector(`[${Je}]`);
|
|
728
728
|
if (n)
|
|
729
729
|
return n;
|
|
730
730
|
const r = document.createElement("button");
|
|
731
|
-
return r.setAttribute(
|
|
731
|
+
return r.setAttribute(Je, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
|
|
732
732
|
position: "absolute",
|
|
733
733
|
bottom: "12px",
|
|
734
734
|
left: "50%",
|
|
@@ -756,40 +756,40 @@ function Gn(t) {
|
|
|
756
756
|
r.style.opacity = "0.9";
|
|
757
757
|
}), e.appendChild(r), r;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
const n =
|
|
759
|
+
function er(t, e) {
|
|
760
|
+
const n = Qn(t);
|
|
761
761
|
n.style.display = "flex";
|
|
762
762
|
const r = () => {
|
|
763
|
-
|
|
763
|
+
$t(t, e), n.style.display = "none";
|
|
764
764
|
}, o = () => {
|
|
765
765
|
const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
|
|
766
|
-
i - s - a <=
|
|
766
|
+
i - s - a <= Bt(t) && (n.style.display = "none");
|
|
767
767
|
};
|
|
768
768
|
return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
|
|
769
769
|
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
770
770
|
};
|
|
771
771
|
}
|
|
772
|
-
function
|
|
773
|
-
const t =
|
|
774
|
-
const o =
|
|
775
|
-
return
|
|
772
|
+
function tr() {
|
|
773
|
+
const t = Y(function({ nodeId: n, context: r }) {
|
|
774
|
+
const o = q(r.store, n), s = v(null), i = le(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, f = le(o?.props?.priority), p = le(o?.props?.key), y = o?.props?.preciseGeneratedAt;
|
|
775
|
+
return C(() => {
|
|
776
776
|
if (typeof document > "u")
|
|
777
777
|
return;
|
|
778
778
|
const c = s.current;
|
|
779
779
|
if (!c || i && c.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
|
|
780
780
|
return;
|
|
781
|
-
let
|
|
781
|
+
let d;
|
|
782
782
|
if (l !== !0) {
|
|
783
|
-
const w =
|
|
783
|
+
const w = Hn(c);
|
|
784
784
|
if (w)
|
|
785
|
-
if (
|
|
786
|
-
|
|
785
|
+
if (Zn(w), f === "Polite" && !Jn(w))
|
|
786
|
+
d = er(w, c);
|
|
787
787
|
else {
|
|
788
|
-
const M = (w.parentElement ?? w).querySelector(`[${
|
|
789
|
-
M && (M.style.display = "none"),
|
|
788
|
+
const M = (w.parentElement ?? w).querySelector(`[${Je}]`);
|
|
789
|
+
M && (M.style.display = "none"), $t(w, c);
|
|
790
790
|
}
|
|
791
791
|
else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
792
|
-
const
|
|
792
|
+
const R = c.getBoundingClientRect().top, E = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > E * Dt ? "auto" : "smooth";
|
|
793
793
|
try {
|
|
794
794
|
c.scrollIntoView({ behavior: T, block: "end", inline: "nearest" });
|
|
795
795
|
} catch {
|
|
@@ -804,8 +804,8 @@ function zn() {
|
|
|
804
804
|
} catch {
|
|
805
805
|
c.focus();
|
|
806
806
|
}
|
|
807
|
-
return
|
|
808
|
-
}, [l,
|
|
807
|
+
return d;
|
|
808
|
+
}, [l, f, i, p, y]), o ? /* @__PURE__ */ S.jsx(
|
|
809
809
|
"span",
|
|
810
810
|
{
|
|
811
811
|
ref: s,
|
|
@@ -822,26 +822,26 @@ function zn() {
|
|
|
822
822
|
return t;
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
const t =
|
|
827
|
-
const s =
|
|
825
|
+
function nr() {
|
|
826
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
827
|
+
const s = q(r.store, n), i = zn(s?.props?.onInvokeId), a = D(() => {
|
|
828
828
|
i && r.dispatchAction(i);
|
|
829
829
|
}, [i, r]);
|
|
830
830
|
if (!s)
|
|
831
831
|
return null;
|
|
832
|
-
const l =
|
|
832
|
+
const l = st(s.props);
|
|
833
833
|
delete l.onInvokeId;
|
|
834
|
-
const
|
|
834
|
+
const f = ot(le(s.props?.className), o), p = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
835
835
|
return /* @__PURE__ */ S.jsx(
|
|
836
836
|
"div",
|
|
837
837
|
{
|
|
838
838
|
...l,
|
|
839
839
|
"data-ikon-node-id": s.id,
|
|
840
840
|
"data-ikon-source": s.sourceMarker,
|
|
841
|
-
className:
|
|
841
|
+
className: f,
|
|
842
842
|
onClick: i ? a : void 0,
|
|
843
843
|
style: i ? { cursor: "pointer" } : void 0,
|
|
844
|
-
children:
|
|
844
|
+
children: p
|
|
845
845
|
}
|
|
846
846
|
);
|
|
847
847
|
});
|
|
@@ -850,12 +850,12 @@ function Xn() {
|
|
|
850
850
|
return t;
|
|
851
851
|
};
|
|
852
852
|
}
|
|
853
|
-
function
|
|
854
|
-
const t =
|
|
855
|
-
const s =
|
|
853
|
+
function rr() {
|
|
854
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
855
|
+
const s = q(r.store, n);
|
|
856
856
|
if (!s)
|
|
857
857
|
return null;
|
|
858
|
-
const i =
|
|
858
|
+
const i = st(s.props), a = ot("relative", le(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
859
859
|
return /* @__PURE__ */ S.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
|
|
860
860
|
});
|
|
861
861
|
return ({ type: e }) => {
|
|
@@ -863,12 +863,12 @@ function Hn() {
|
|
|
863
863
|
return t;
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
|
-
function
|
|
867
|
-
const t =
|
|
868
|
-
const s =
|
|
866
|
+
function or() {
|
|
867
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
868
|
+
const s = q(r.store, n);
|
|
869
869
|
if (!s)
|
|
870
870
|
return null;
|
|
871
|
-
const i =
|
|
871
|
+
const i = st(s.props), a = ot("absolute", le(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
872
872
|
return /* @__PURE__ */ S.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
|
|
873
873
|
});
|
|
874
874
|
return ({ type: e }) => {
|
|
@@ -876,19 +876,19 @@ function qn() {
|
|
|
876
876
|
return t;
|
|
877
877
|
};
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function sr() {
|
|
880
880
|
return [
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
881
|
+
nr(),
|
|
882
|
+
rr(),
|
|
883
|
+
or(),
|
|
884
|
+
tr()
|
|
885
885
|
];
|
|
886
886
|
}
|
|
887
|
-
const
|
|
888
|
-
function
|
|
889
|
-
t.registerModule(
|
|
887
|
+
const ir = "base", ar = async () => sr();
|
|
888
|
+
function cr(t) {
|
|
889
|
+
t.registerModule(ir, ar);
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function lr(t) {
|
|
892
892
|
if (typeof t == "string") {
|
|
893
893
|
const e = t.trim();
|
|
894
894
|
return e.length > 0 ? e : void 0;
|
|
@@ -898,19 +898,19 @@ function tr(t) {
|
|
|
898
898
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function ur(...t) {
|
|
902
902
|
const e = [];
|
|
903
903
|
for (const n of t)
|
|
904
904
|
n && n.trim() && e.push(n.trim());
|
|
905
905
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function gt(t) {
|
|
908
908
|
if (typeof t != "string")
|
|
909
909
|
return;
|
|
910
910
|
const e = t.trim();
|
|
911
911
|
return e.length > 0 ? e : void 0;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function ke(t) {
|
|
914
914
|
if (typeof t == "boolean")
|
|
915
915
|
return t;
|
|
916
916
|
if (typeof t == "string") {
|
|
@@ -919,42 +919,42 @@ function Ae(t) {
|
|
|
919
919
|
if (e === "false") return !1;
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
|
-
const
|
|
923
|
-
function
|
|
924
|
-
const t =
|
|
922
|
+
const dr = "std.audio-url-player";
|
|
923
|
+
function fr() {
|
|
924
|
+
const t = Y(function({
|
|
925
925
|
nodeId: n,
|
|
926
926
|
context: r,
|
|
927
927
|
className: o
|
|
928
928
|
}) {
|
|
929
|
-
const s =
|
|
930
|
-
if (
|
|
929
|
+
const s = q(r.store, n), i = v(null), a = s ? ke(s.props?.autoplay) : void 0, l = s ? gt(s.props?.src) : void 0;
|
|
930
|
+
if (C(() => {
|
|
931
931
|
a && i.current && i.current.play().catch(() => {
|
|
932
932
|
});
|
|
933
933
|
}, [a, l]), !s)
|
|
934
934
|
return null;
|
|
935
|
-
const
|
|
935
|
+
const f = ur(lr(s.props?.className), o), p = gt(s.props?.preload), y = ke(s.props?.controls), u = ke(s.props?.loop), c = ke(s.props?.muted);
|
|
936
936
|
return /* @__PURE__ */ S.jsx(
|
|
937
937
|
"audio",
|
|
938
938
|
{
|
|
939
939
|
ref: i,
|
|
940
940
|
src: l,
|
|
941
|
-
...
|
|
942
|
-
...
|
|
941
|
+
...p !== void 0 ? { preload: p } : {},
|
|
942
|
+
...y !== void 0 ? { controls: y } : {},
|
|
943
943
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
944
|
-
...
|
|
944
|
+
...u !== void 0 ? { loop: u } : {},
|
|
945
945
|
...c !== void 0 ? { muted: c } : {},
|
|
946
946
|
"data-ikon-node-id": s.id,
|
|
947
947
|
"data-ikon-source": s.sourceMarker,
|
|
948
|
-
className:
|
|
948
|
+
className: f
|
|
949
949
|
}
|
|
950
950
|
);
|
|
951
951
|
});
|
|
952
952
|
return ({ type: e }) => {
|
|
953
|
-
if (e ===
|
|
953
|
+
if (e === dr)
|
|
954
954
|
return t;
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function Ft(t) {
|
|
958
958
|
if (typeof t == "string") {
|
|
959
959
|
const e = t.trim();
|
|
960
960
|
return e.length > 0 ? e : void 0;
|
|
@@ -964,13 +964,13 @@ function Mt(t) {
|
|
|
964
964
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function Vt(...t) {
|
|
968
968
|
const e = [];
|
|
969
969
|
for (const n of t)
|
|
970
970
|
n && n.trim() && e.push(n.trim());
|
|
971
971
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function Oe(t) {
|
|
974
974
|
if (typeof t == "number" && Number.isFinite(t))
|
|
975
975
|
return Math.floor(t);
|
|
976
976
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -979,39 +979,39 @@ function _e(t) {
|
|
|
979
979
|
return Math.floor(e);
|
|
980
980
|
}
|
|
981
981
|
}
|
|
982
|
-
function
|
|
982
|
+
function Ze(t) {
|
|
983
983
|
if (typeof t != "string")
|
|
984
984
|
return;
|
|
985
985
|
const e = t.trim();
|
|
986
986
|
return e.length > 0 ? e : void 0;
|
|
987
987
|
}
|
|
988
|
-
const
|
|
989
|
-
function
|
|
990
|
-
const t =
|
|
991
|
-
const s =
|
|
992
|
-
|
|
993
|
-
if (!
|
|
994
|
-
const g =
|
|
995
|
-
return
|
|
996
|
-
g?.(b), b.kind === "video" &&
|
|
988
|
+
const hr = "std.video-canvas", pr = "std.video-url-player";
|
|
989
|
+
function mr() {
|
|
990
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
991
|
+
const s = q(r.store, n), i = v(null), a = v(null), l = r.video, f = r.client, p = s ? Ze(s.props?.streamId) : void 0, y = s ? Oe(s.props?.width) : void 0, u = s ? Oe(s.props?.height) : void 0, c = s ? Vt(Ft(s.props?.className), o) : o, [, d] = x(0);
|
|
992
|
+
C(() => {
|
|
993
|
+
if (!f?.isWebRtcEnabled) return;
|
|
994
|
+
const g = f.onWebRtcTrackMapChanged;
|
|
995
|
+
return f.onWebRtcTrackMapChanged = (b) => {
|
|
996
|
+
g?.(b), b.kind === "video" && d((w) => w + 1);
|
|
997
997
|
}, () => {
|
|
998
|
-
|
|
998
|
+
f.onWebRtcTrackMapChanged = g;
|
|
999
999
|
};
|
|
1000
|
-
}, [
|
|
1001
|
-
const
|
|
1002
|
-
return
|
|
1000
|
+
}, [f]);
|
|
1001
|
+
const m = f?.isWebRtcEnabled && p ? f.getWebRtcVideoStreamByStreamId(p) : null;
|
|
1002
|
+
return C(() => {
|
|
1003
1003
|
const g = i.current;
|
|
1004
|
-
if (!(!l || !g || !
|
|
1005
|
-
return l.attachCanvas(
|
|
1006
|
-
l.detachCanvas(
|
|
1004
|
+
if (!(!l || !g || !p || m))
|
|
1005
|
+
return l.attachCanvas(p, g), () => {
|
|
1006
|
+
l.detachCanvas(p);
|
|
1007
1007
|
};
|
|
1008
|
-
}, [l,
|
|
1008
|
+
}, [l, p, m]), C(() => {
|
|
1009
1009
|
const g = a.current;
|
|
1010
|
-
if (!(!g || !
|
|
1011
|
-
return g.srcObject =
|
|
1010
|
+
if (!(!g || !m))
|
|
1011
|
+
return g.srcObject = m, () => {
|
|
1012
1012
|
g.srcObject = null;
|
|
1013
1013
|
};
|
|
1014
|
-
}, [
|
|
1014
|
+
}, [m]), s ? m ? /* @__PURE__ */ S.jsx(
|
|
1015
1015
|
"video",
|
|
1016
1016
|
{
|
|
1017
1017
|
ref: a,
|
|
@@ -1020,35 +1020,35 @@ function ar() {
|
|
|
1020
1020
|
muted: !0,
|
|
1021
1021
|
"data-ikon-node-id": s.id,
|
|
1022
1022
|
"data-ikon-source": s.sourceMarker,
|
|
1023
|
-
"data-ikon-video-stream-id":
|
|
1023
|
+
"data-ikon-video-stream-id": p,
|
|
1024
1024
|
className: c,
|
|
1025
|
-
...
|
|
1026
|
-
...
|
|
1025
|
+
...y ? { width: y } : {},
|
|
1026
|
+
...u ? { height: u } : {}
|
|
1027
1027
|
},
|
|
1028
|
-
|
|
1028
|
+
p
|
|
1029
1029
|
) : /* @__PURE__ */ S.jsx(
|
|
1030
1030
|
"canvas",
|
|
1031
1031
|
{
|
|
1032
1032
|
ref: i,
|
|
1033
1033
|
"data-ikon-node-id": s.id,
|
|
1034
1034
|
"data-ikon-source": s.sourceMarker,
|
|
1035
|
-
"data-ikon-video-stream-id":
|
|
1035
|
+
"data-ikon-video-stream-id": p,
|
|
1036
1036
|
className: c,
|
|
1037
|
-
...
|
|
1038
|
-
...
|
|
1037
|
+
...y ? { width: y } : {},
|
|
1038
|
+
...u ? { height: u } : {}
|
|
1039
1039
|
},
|
|
1040
|
-
|
|
1040
|
+
p
|
|
1041
1041
|
) : null;
|
|
1042
1042
|
});
|
|
1043
1043
|
return ({ type: e }) => {
|
|
1044
|
-
if (e ===
|
|
1044
|
+
if (e === hr)
|
|
1045
1045
|
return t;
|
|
1046
1046
|
};
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1049
|
-
return [
|
|
1048
|
+
function gr() {
|
|
1049
|
+
return [mr(), yr(), fr()];
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function ge(t) {
|
|
1052
1052
|
if (typeof t == "boolean")
|
|
1053
1053
|
return t;
|
|
1054
1054
|
if (typeof t == "string") {
|
|
@@ -1057,61 +1057,61 @@ function he(t) {
|
|
|
1057
1057
|
if (e === "false") return !1;
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const t =
|
|
1060
|
+
function yr() {
|
|
1061
|
+
const t = Y(function({
|
|
1062
1062
|
nodeId: n,
|
|
1063
1063
|
context: r,
|
|
1064
1064
|
className: o
|
|
1065
1065
|
}) {
|
|
1066
|
-
const s =
|
|
1067
|
-
if (
|
|
1066
|
+
const s = q(r.store, n), i = v(null), a = s ? ge(s.props?.autoplay) : void 0, l = s ? Ze(s.props?.src) : void 0;
|
|
1067
|
+
if (C(() => {
|
|
1068
1068
|
a && i.current && i.current.play().catch(() => {
|
|
1069
1069
|
});
|
|
1070
1070
|
}, [a, l]), !s)
|
|
1071
1071
|
return null;
|
|
1072
|
-
const
|
|
1072
|
+
const f = Vt(Ft(s.props?.className), o), p = Ze(s.props?.poster), y = ge(s.props?.controls), u = ge(s.props?.loop), c = ge(s.props?.muted), d = ge(s.props?.playsInline), m = Oe(s.props?.width), g = Oe(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
1073
1073
|
return /* @__PURE__ */ S.jsx(
|
|
1074
1074
|
"video",
|
|
1075
1075
|
{
|
|
1076
1076
|
ref: i,
|
|
1077
1077
|
src: l,
|
|
1078
|
-
poster:
|
|
1079
|
-
...
|
|
1078
|
+
poster: p,
|
|
1079
|
+
...y !== void 0 ? { controls: y } : {},
|
|
1080
1080
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
1081
|
-
...
|
|
1081
|
+
...u !== void 0 ? { loop: u } : {},
|
|
1082
1082
|
...c !== void 0 ? { muted: c } : {},
|
|
1083
|
-
...
|
|
1084
|
-
...
|
|
1083
|
+
...d !== void 0 ? { playsInline: d } : {},
|
|
1084
|
+
...m ? { width: m } : {},
|
|
1085
1085
|
...g ? { height: g } : {},
|
|
1086
1086
|
"data-ikon-node-id": s.id,
|
|
1087
1087
|
"data-ikon-source": s.sourceMarker,
|
|
1088
|
-
className:
|
|
1088
|
+
className: f,
|
|
1089
1089
|
children: b
|
|
1090
1090
|
}
|
|
1091
1091
|
);
|
|
1092
1092
|
});
|
|
1093
1093
|
return ({ type: e }) => {
|
|
1094
|
-
if (e ===
|
|
1094
|
+
if (e === pr)
|
|
1095
1095
|
return t;
|
|
1096
1096
|
};
|
|
1097
1097
|
}
|
|
1098
|
-
const
|
|
1099
|
-
function
|
|
1100
|
-
t.registerModule(
|
|
1098
|
+
const br = "media", wr = async () => gr();
|
|
1099
|
+
function Sr(t) {
|
|
1100
|
+
t.registerModule(br, wr);
|
|
1101
1101
|
}
|
|
1102
|
-
const
|
|
1102
|
+
const Er = `#version 300 es
|
|
1103
1103
|
in vec4 a_position;
|
|
1104
1104
|
void main() {
|
|
1105
1105
|
gl_Position = a_position;
|
|
1106
1106
|
}
|
|
1107
|
-
`,
|
|
1108
|
-
function
|
|
1107
|
+
`, ie = 4;
|
|
1108
|
+
function vr(t, e) {
|
|
1109
1109
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Rr(t, e) {
|
|
1112
1112
|
const n = [];
|
|
1113
1113
|
for (const [r, o] of Object.entries(e)) {
|
|
1114
|
-
if (
|
|
1114
|
+
if (vr(t, r))
|
|
1115
1115
|
continue;
|
|
1116
1116
|
let s;
|
|
1117
1117
|
switch (o.type) {
|
|
@@ -1172,7 +1172,7 @@ void main() {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
`;
|
|
1174
1174
|
}
|
|
1175
|
-
class
|
|
1175
|
+
class Ar {
|
|
1176
1176
|
gl;
|
|
1177
1177
|
program = null;
|
|
1178
1178
|
positionBuffer = null;
|
|
@@ -1187,8 +1187,8 @@ class gr {
|
|
|
1187
1187
|
mouseClickX = 0;
|
|
1188
1188
|
mouseClickY = 0;
|
|
1189
1189
|
channels = [];
|
|
1190
|
-
channelResolution = new Float32Array(
|
|
1191
|
-
channelTime = new Float32Array(
|
|
1190
|
+
channelResolution = new Float32Array(ie * 3);
|
|
1191
|
+
channelTime = new Float32Array(ie);
|
|
1192
1192
|
lastError = null;
|
|
1193
1193
|
currentShaderSource = "";
|
|
1194
1194
|
constructor(e) {
|
|
@@ -1211,7 +1211,7 @@ class gr {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
initializeChannels() {
|
|
1213
1213
|
const e = this.gl;
|
|
1214
|
-
for (let n = 0; n <
|
|
1214
|
+
for (let n = 0; n < ie; n++) {
|
|
1215
1215
|
const r = e.createTexture();
|
|
1216
1216
|
e.bindTexture(e.TEXTURE_2D, r), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, new Uint8Array([0, 0, 0, 255])), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), this.channels.push({ texture: r, width: 0, height: 0, url: null });
|
|
1217
1217
|
}
|
|
@@ -1221,7 +1221,7 @@ class gr {
|
|
|
1221
1221
|
// settings (vflip on, repeat wrap, mipmap filtering) so copy-pasted ShaderToy texture shaders render
|
|
1222
1222
|
// the same way. Only channels whose URL changed are reloaded.
|
|
1223
1223
|
setChannels(e) {
|
|
1224
|
-
for (let n = 0; n <
|
|
1224
|
+
for (let n = 0; n < ie; n++) {
|
|
1225
1225
|
const r = e[n] ?? null, o = this.channels[n];
|
|
1226
1226
|
if (o.url !== r) {
|
|
1227
1227
|
if (o.url = r, !r) {
|
|
@@ -1247,10 +1247,10 @@ class gr {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
compile(e, n = {}) {
|
|
1249
1249
|
this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
|
|
1250
|
-
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER,
|
|
1250
|
+
const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Er);
|
|
1251
1251
|
if (!o)
|
|
1252
1252
|
return !1;
|
|
1253
|
-
const s =
|
|
1253
|
+
const s = Rr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
|
|
1254
1254
|
if (!i)
|
|
1255
1255
|
return r.deleteShader(o), !1;
|
|
1256
1256
|
const a = r.createProgram();
|
|
@@ -1270,7 +1270,7 @@ class gr {
|
|
|
1270
1270
|
const n = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
|
|
1271
1271
|
for (const r of n)
|
|
1272
1272
|
this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
|
|
1273
|
-
for (let r = 0; r <
|
|
1273
|
+
for (let r = 0; r < ie; r++)
|
|
1274
1274
|
this.uniformLocations.set(`iChannel${r}`, e.getUniformLocation(this.program, `iChannel${r}`));
|
|
1275
1275
|
this.uniformLocations.set("iChannelResolution", e.getUniformLocation(this.program, "iChannelResolution[0]")), this.uniformLocations.set("iChannelTime", e.getUniformLocation(this.program, "iChannelTime[0]"));
|
|
1276
1276
|
for (const r of Object.keys(this.customUniforms))
|
|
@@ -1289,57 +1289,57 @@ class gr {
|
|
|
1289
1289
|
(n.width !== o || n.height !== s) && (n.width = o, n.height = s, e.viewport(0, 0, o, s));
|
|
1290
1290
|
const i = performance.now(), a = (i - this.startTime) / 1e3, l = (i - this.lastFrameTime) / 1e3;
|
|
1291
1291
|
this.lastFrameTime = i, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1292
|
+
const f = this.uniformLocations.get("iResolution");
|
|
1293
|
+
f && e.uniform3f(f, o, s, 1);
|
|
1294
|
+
const p = this.uniformLocations.get("iTime");
|
|
1295
|
+
p && e.uniform1f(p, a);
|
|
1296
|
+
const y = this.uniformLocations.get("iTimeDelta");
|
|
1297
|
+
y && e.uniform1f(y, l);
|
|
1298
|
+
const u = this.uniformLocations.get("iFrame");
|
|
1299
|
+
u && e.uniform1i(u, this.frameCount);
|
|
1300
1300
|
const c = this.uniformLocations.get("iMouse");
|
|
1301
1301
|
c && e.uniform4f(c, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1302
|
-
const
|
|
1303
|
-
if (
|
|
1302
|
+
const d = this.uniformLocations.get("iDate");
|
|
1303
|
+
if (d) {
|
|
1304
1304
|
const b = /* @__PURE__ */ new Date();
|
|
1305
|
-
e.uniform4f(
|
|
1305
|
+
e.uniform4f(d, b.getFullYear(), b.getMonth(), b.getDate(), b.getHours() * 3600 + b.getMinutes() * 60 + b.getSeconds() + b.getMilliseconds() / 1e3);
|
|
1306
1306
|
}
|
|
1307
|
-
for (let b = 0; b <
|
|
1307
|
+
for (let b = 0; b < ie; b++) {
|
|
1308
1308
|
e.activeTexture(e.TEXTURE0 + b), e.bindTexture(e.TEXTURE_2D, this.channels[b].texture);
|
|
1309
1309
|
const w = this.uniformLocations.get(`iChannel${b}`);
|
|
1310
1310
|
w && e.uniform1i(w, b);
|
|
1311
1311
|
}
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1312
|
+
const m = this.uniformLocations.get("iChannelResolution");
|
|
1313
|
+
m && e.uniform3fv(m, this.channelResolution);
|
|
1314
1314
|
const g = this.uniformLocations.get("iChannelTime");
|
|
1315
1315
|
g && e.uniform1fv(g, this.channelTime);
|
|
1316
1316
|
for (const [b, w] of Object.entries(this.customUniforms)) {
|
|
1317
|
-
const
|
|
1318
|
-
if (
|
|
1317
|
+
const R = this.uniformLocations.get(b);
|
|
1318
|
+
if (R)
|
|
1319
1319
|
switch (w.type) {
|
|
1320
1320
|
case "float":
|
|
1321
|
-
e.uniform1f(
|
|
1321
|
+
e.uniform1f(R, w.value);
|
|
1322
1322
|
break;
|
|
1323
1323
|
case "vec2": {
|
|
1324
1324
|
const E = w.value;
|
|
1325
|
-
e.uniform2f(
|
|
1325
|
+
e.uniform2f(R, E[0], E[1]);
|
|
1326
1326
|
break;
|
|
1327
1327
|
}
|
|
1328
1328
|
case "vec3": {
|
|
1329
1329
|
const E = w.value;
|
|
1330
|
-
e.uniform3f(
|
|
1330
|
+
e.uniform3f(R, E[0], E[1], E[2]);
|
|
1331
1331
|
break;
|
|
1332
1332
|
}
|
|
1333
1333
|
case "vec4": {
|
|
1334
1334
|
const E = w.value;
|
|
1335
|
-
e.uniform4f(
|
|
1335
|
+
e.uniform4f(R, E[0], E[1], E[2], E[3]);
|
|
1336
1336
|
break;
|
|
1337
1337
|
}
|
|
1338
1338
|
case "int":
|
|
1339
|
-
e.uniform1i(
|
|
1339
|
+
e.uniform1i(R, w.value);
|
|
1340
1340
|
break;
|
|
1341
1341
|
case "bool":
|
|
1342
|
-
e.uniform1i(
|
|
1342
|
+
e.uniform1i(R, w.value ? 1 : 0);
|
|
1343
1343
|
break;
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
@@ -1356,7 +1356,7 @@ class gr {
|
|
|
1356
1356
|
this.channels = [], this.uniformLocations.clear();
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1359
|
+
function Tr(t) {
|
|
1360
1360
|
if (typeof t == "string") {
|
|
1361
1361
|
const e = t.trim();
|
|
1362
1362
|
return e.length > 0 ? e : void 0;
|
|
@@ -1366,13 +1366,13 @@ function yr(t) {
|
|
|
1366
1366
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1369
|
+
function kr(...t) {
|
|
1370
1370
|
const e = [];
|
|
1371
1371
|
for (const n of t)
|
|
1372
1372
|
n && n.trim() && e.push(n.trim());
|
|
1373
1373
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1375
|
+
function Fe(t) {
|
|
1376
1376
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1377
1377
|
return Math.floor(t);
|
|
1378
1378
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1381,10 +1381,10 @@ function Ue(t) {
|
|
|
1381
1381
|
return Math.floor(e);
|
|
1382
1382
|
}
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function Cr(t) {
|
|
1385
1385
|
return typeof t == "string" ? t : "";
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1387
|
+
function _r(t) {
|
|
1388
1388
|
if (typeof t == "boolean")
|
|
1389
1389
|
return t;
|
|
1390
1390
|
if (typeof t == "string") {
|
|
@@ -1393,7 +1393,7 @@ function Sr(t) {
|
|
|
1393
1393
|
if (e === "false") return !1;
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function Ir(t) {
|
|
1397
1397
|
if (!t || typeof t != "object")
|
|
1398
1398
|
return {};
|
|
1399
1399
|
const e = {}, n = t;
|
|
@@ -1408,10 +1408,10 @@ function Er(t) {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
return e;
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1411
|
+
function Or(t) {
|
|
1412
1412
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1414
|
+
function Nr(t, e) {
|
|
1415
1415
|
const n = Object.keys(t), r = Object.keys(e);
|
|
1416
1416
|
if (n.length !== r.length)
|
|
1417
1417
|
return !1;
|
|
@@ -1432,76 +1432,76 @@ function Rr(t, e) {
|
|
|
1432
1432
|
}
|
|
1433
1433
|
return !0;
|
|
1434
1434
|
}
|
|
1435
|
-
const
|
|
1436
|
-
function
|
|
1437
|
-
const t =
|
|
1438
|
-
const s =
|
|
1435
|
+
const xr = "std.shadertoy-canvas";
|
|
1436
|
+
function Pr() {
|
|
1437
|
+
const t = Y(function({ nodeId: n, context: r, className: o }) {
|
|
1438
|
+
const s = q(r.store, n), i = v(null), a = v(null), l = v(null), f = v(0), p = v(""), y = v({}), u = v({
|
|
1439
1439
|
x: 0,
|
|
1440
1440
|
y: 0,
|
|
1441
1441
|
clickX: 0,
|
|
1442
1442
|
clickY: 0,
|
|
1443
1443
|
isDown: !1
|
|
1444
|
-
}), c = s ?
|
|
1445
|
-
|
|
1446
|
-
const
|
|
1447
|
-
if (
|
|
1444
|
+
}), c = s ? Cr(s.props?.shaderSource) : "", d = s ? Fe(s.props?.fps) ?? 60 : 60, m = s?.props?.uniforms, g = W(() => Ir(m), [m]), b = s?.props?.channels, w = W(() => Or(b), [b]), R = s ? _r(s.props?.enableMouse) ?? !0 : !0, E = s ? Fe(s.props?.width) : void 0, T = s ? Fe(s.props?.height) : void 0, M = s ? kr(Tr(s.props?.className), o) : o;
|
|
1445
|
+
C(() => {
|
|
1446
|
+
const _ = i.current;
|
|
1447
|
+
if (_) {
|
|
1448
1448
|
try {
|
|
1449
|
-
const
|
|
1450
|
-
a.current =
|
|
1451
|
-
} catch (
|
|
1452
|
-
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:",
|
|
1449
|
+
const L = new Ar(_);
|
|
1450
|
+
a.current = L;
|
|
1451
|
+
} catch (L) {
|
|
1452
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", L);
|
|
1453
1453
|
}
|
|
1454
1454
|
return () => {
|
|
1455
1455
|
a.current && (a.current.destroy(), a.current = null);
|
|
1456
1456
|
};
|
|
1457
1457
|
}
|
|
1458
|
-
}, []),
|
|
1459
|
-
const
|
|
1460
|
-
if (!(!
|
|
1461
|
-
if (
|
|
1462
|
-
|
|
1458
|
+
}, []), C(() => {
|
|
1459
|
+
const _ = a.current;
|
|
1460
|
+
if (!(!_ || !c) && p.current !== c)
|
|
1461
|
+
if (_.compile(c, g))
|
|
1462
|
+
p.current = c, y.current = g;
|
|
1463
1463
|
else {
|
|
1464
|
-
const
|
|
1465
|
-
console.error("[ShadertoyRenderer] Shader compilation failed:",
|
|
1464
|
+
const U = _.getError();
|
|
1465
|
+
console.error("[ShadertoyRenderer] Shader compilation failed:", U);
|
|
1466
1466
|
}
|
|
1467
|
-
}, [c, g]),
|
|
1468
|
-
const
|
|
1469
|
-
!
|
|
1470
|
-
}, [g]),
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
}, [w]),
|
|
1474
|
-
const
|
|
1475
|
-
if (!
|
|
1476
|
-
const
|
|
1477
|
-
const B =
|
|
1478
|
-
B >=
|
|
1467
|
+
}, [c, g]), C(() => {
|
|
1468
|
+
const _ = a.current;
|
|
1469
|
+
!_ || !p.current || Nr(y.current, g) || (_.setCustomUniforms(g), y.current = g);
|
|
1470
|
+
}, [g]), C(() => {
|
|
1471
|
+
const _ = a.current;
|
|
1472
|
+
_ && _.setChannels(w);
|
|
1473
|
+
}, [w]), C(() => {
|
|
1474
|
+
const _ = a.current;
|
|
1475
|
+
if (!_ || !p.current) return;
|
|
1476
|
+
const L = 1e3 / d, U = (F) => {
|
|
1477
|
+
const B = F - f.current;
|
|
1478
|
+
B >= L && (f.current = F - B % L, _.draw()), l.current = requestAnimationFrame(U);
|
|
1479
1479
|
};
|
|
1480
|
-
return l.current = requestAnimationFrame(
|
|
1480
|
+
return l.current = requestAnimationFrame(U), () => {
|
|
1481
1481
|
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
1482
1482
|
};
|
|
1483
|
-
}, [
|
|
1484
|
-
const
|
|
1485
|
-
(
|
|
1486
|
-
if (!
|
|
1487
|
-
const
|
|
1488
|
-
if (!
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1483
|
+
}, [d]);
|
|
1484
|
+
const J = D(
|
|
1485
|
+
(_) => {
|
|
1486
|
+
if (!R) return;
|
|
1487
|
+
const L = i.current, U = a.current;
|
|
1488
|
+
if (!L || !U) return;
|
|
1489
|
+
const F = window.devicePixelRatio || 1, B = L.getBoundingClientRect(), $ = (_.clientX - B.left) * F, K = (B.height - (_.clientY - B.top)) * F;
|
|
1490
|
+
u.current.x = $, u.current.y = K, U.setMouse($, K, u.current.clickX, u.current.clickY);
|
|
1491
1491
|
},
|
|
1492
|
-
[
|
|
1493
|
-
),
|
|
1494
|
-
(
|
|
1495
|
-
if (!
|
|
1496
|
-
const
|
|
1497
|
-
if (!
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1492
|
+
[R]
|
|
1493
|
+
), Q = D(
|
|
1494
|
+
(_) => {
|
|
1495
|
+
if (!R) return;
|
|
1496
|
+
const L = i.current, U = a.current;
|
|
1497
|
+
if (!L || !U) return;
|
|
1498
|
+
const F = window.devicePixelRatio || 1, B = L.getBoundingClientRect(), $ = (_.clientX - B.left) * F, K = (B.height - (_.clientY - B.top)) * F;
|
|
1499
|
+
u.current.isDown = !0, u.current.clickX = $, u.current.clickY = K, U.setMouse($, K, $, K);
|
|
1500
1500
|
},
|
|
1501
|
-
[
|
|
1502
|
-
),
|
|
1503
|
-
|
|
1504
|
-
}, [
|
|
1501
|
+
[R]
|
|
1502
|
+
), X = D(() => {
|
|
1503
|
+
R && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
|
|
1504
|
+
}, [R]);
|
|
1505
1505
|
return s ? /* @__PURE__ */ S.jsx(
|
|
1506
1506
|
"canvas",
|
|
1507
1507
|
{
|
|
@@ -1511,24 +1511,24 @@ function Tr() {
|
|
|
1511
1511
|
className: M,
|
|
1512
1512
|
...E ? { width: E } : {},
|
|
1513
1513
|
...T ? { height: T } : {},
|
|
1514
|
-
onMouseMove:
|
|
1515
|
-
onMouseDown:
|
|
1516
|
-
onMouseUp:
|
|
1517
|
-
onMouseLeave:
|
|
1514
|
+
onMouseMove: J,
|
|
1515
|
+
onMouseDown: Q,
|
|
1516
|
+
onMouseUp: X,
|
|
1517
|
+
onMouseLeave: X
|
|
1518
1518
|
}
|
|
1519
1519
|
) : null;
|
|
1520
1520
|
});
|
|
1521
1521
|
return ({ type: e }) => {
|
|
1522
|
-
if (e ===
|
|
1522
|
+
if (e === xr)
|
|
1523
1523
|
return t;
|
|
1524
1524
|
};
|
|
1525
1525
|
}
|
|
1526
|
-
const
|
|
1527
|
-
function
|
|
1528
|
-
t.registerModule(
|
|
1526
|
+
const Lr = "shadertoy", Mr = async () => Pr();
|
|
1527
|
+
function Ur(t) {
|
|
1528
|
+
t.registerModule(Lr, Mr);
|
|
1529
1529
|
}
|
|
1530
|
-
const
|
|
1531
|
-
class
|
|
1530
|
+
const yt = se("UIRegistry");
|
|
1531
|
+
class jr {
|
|
1532
1532
|
baseResolvers = [];
|
|
1533
1533
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1534
1534
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1550,15 +1550,15 @@ class Ir {
|
|
|
1550
1550
|
for (const [r, o] of this.moduleLoaders.entries())
|
|
1551
1551
|
if (!this.moduleResolvers.has(r))
|
|
1552
1552
|
try {
|
|
1553
|
-
const s = await o(), i =
|
|
1553
|
+
const s = await o(), i = Br(s);
|
|
1554
1554
|
this.moduleResolvers.set(r, i), e = !0;
|
|
1555
1555
|
} catch (s) {
|
|
1556
|
-
|
|
1556
|
+
yt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
1557
1557
|
}
|
|
1558
1558
|
const n = [];
|
|
1559
1559
|
for (const r of this.moduleLoaders.keys())
|
|
1560
1560
|
this.moduleResolvers.has(r) && n.push(r);
|
|
1561
|
-
return
|
|
1561
|
+
return Fr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
|
|
1562
1562
|
}
|
|
1563
1563
|
resolve(e) {
|
|
1564
1564
|
for (const n of this.baseResolvers) {
|
|
@@ -1568,7 +1568,7 @@ class Ir {
|
|
|
1568
1568
|
for (const n of this.activeModuleOrder) {
|
|
1569
1569
|
const r = this.moduleResolvers.get(n);
|
|
1570
1570
|
if (!r) {
|
|
1571
|
-
|
|
1571
|
+
yt.warn(`Missing resolvers for module ${n}`);
|
|
1572
1572
|
continue;
|
|
1573
1573
|
}
|
|
1574
1574
|
for (const o of r) {
|
|
@@ -1578,17 +1578,17 @@ class Ir {
|
|
|
1578
1578
|
}
|
|
1579
1579
|
}
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1582
|
-
const t = new
|
|
1583
|
-
return
|
|
1581
|
+
function Dr() {
|
|
1582
|
+
const t = new jr();
|
|
1583
|
+
return cr(t), Sr(t), Ur(t), t.loadRegisteredModules(), t;
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1585
|
+
function $r(t) {
|
|
1586
1586
|
return Array.isArray(t) ? t : [t];
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1589
|
-
return t ?
|
|
1588
|
+
function Br(t) {
|
|
1589
|
+
return t ? $r(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function Fr(t, e) {
|
|
1592
1592
|
if (t.length !== e.length)
|
|
1593
1593
|
return !1;
|
|
1594
1594
|
for (let n = 0; n < t.length; n += 1)
|
|
@@ -1596,9 +1596,9 @@ function Pr(t, e) {
|
|
|
1596
1596
|
return !1;
|
|
1597
1597
|
return !0;
|
|
1598
1598
|
}
|
|
1599
|
-
function
|
|
1599
|
+
function js({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
1600
1600
|
return /* @__PURE__ */ S.jsx(
|
|
1601
|
-
|
|
1601
|
+
jt,
|
|
1602
1602
|
{
|
|
1603
1603
|
stores: e,
|
|
1604
1604
|
registry: n,
|
|
@@ -1608,7 +1608,7 @@ function Is({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
);
|
|
1610
1610
|
}
|
|
1611
|
-
const
|
|
1611
|
+
const Ve = se("MotionController"), bt = {
|
|
1612
1612
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1613
1613
|
"ease-in": [0.42, 0, 1, 1],
|
|
1614
1614
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1638,88 +1638,88 @@ const je = ne("MotionController"), ft = {
|
|
|
1638
1638
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
1639
1639
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
1640
1640
|
};
|
|
1641
|
-
function
|
|
1641
|
+
function V(t) {
|
|
1642
1642
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1643
1643
|
}
|
|
1644
|
-
function
|
|
1644
|
+
function wt(t) {
|
|
1645
1645
|
if (t == null) return;
|
|
1646
1646
|
const e = `${t}`.trim();
|
|
1647
1647
|
if (!e) return;
|
|
1648
1648
|
const n = Number.parseFloat(e);
|
|
1649
1649
|
return Number.isFinite(n) ? n : void 0;
|
|
1650
1650
|
}
|
|
1651
|
-
function
|
|
1651
|
+
function St(t) {
|
|
1652
1652
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const
|
|
1656
|
-
function
|
|
1654
|
+
function Et(t, e, n, r) {
|
|
1655
|
+
const p = new Float32Array(11);
|
|
1656
|
+
function y(g, b, w) {
|
|
1657
1657
|
return ((3 * b - 3 * w + 1) * g + (3 * w - 6 * b)) * g * g + 3 * b * g;
|
|
1658
1658
|
}
|
|
1659
|
-
function
|
|
1659
|
+
function u(g, b, w) {
|
|
1660
1660
|
return 3 * (3 * b - 3 * w + 1) * g * g + 2 * (3 * w - 6 * b) * g + 3 * b;
|
|
1661
1661
|
}
|
|
1662
1662
|
function c(g, b) {
|
|
1663
1663
|
for (let w = 0; w < 4; w += 1) {
|
|
1664
|
-
const
|
|
1665
|
-
if (
|
|
1664
|
+
const R = u(b, t, n);
|
|
1665
|
+
if (R === 0)
|
|
1666
1666
|
return b;
|
|
1667
|
-
const E =
|
|
1668
|
-
b -= E /
|
|
1667
|
+
const E = y(b, t, n) - g;
|
|
1668
|
+
b -= E / R;
|
|
1669
1669
|
}
|
|
1670
1670
|
return b;
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1673
|
-
let
|
|
1672
|
+
function d(g, b, w) {
|
|
1673
|
+
let R = 0, E = 0, T = 0;
|
|
1674
1674
|
do
|
|
1675
|
-
E = b + (w - b) / 2,
|
|
1676
|
-
while (Math.abs(
|
|
1675
|
+
E = b + (w - b) / 2, R = y(E, t, n) - g, R > 0 ? w = E : b = E;
|
|
1676
|
+
while (Math.abs(R) > 1e-7 && ++T < 10);
|
|
1677
1677
|
return E;
|
|
1678
1678
|
}
|
|
1679
|
-
function
|
|
1679
|
+
function m(g) {
|
|
1680
1680
|
let b = 0, w = 1;
|
|
1681
|
-
const
|
|
1682
|
-
for (; w !==
|
|
1681
|
+
const R = 10;
|
|
1682
|
+
for (; w !== R && p[w] <= g; w += 1)
|
|
1683
1683
|
b += 0.1;
|
|
1684
1684
|
w -= 1;
|
|
1685
|
-
const E = (g -
|
|
1686
|
-
return M >= 1e-3 ? c(g, T) : M === 0 ? T :
|
|
1685
|
+
const E = (g - p[w]) / (p[w + 1] - p[w]), T = b + E * 0.1, M = u(T, t, n);
|
|
1686
|
+
return M >= 1e-3 ? c(g, T) : M === 0 ? T : d(g, b, b + 0.1);
|
|
1687
1687
|
}
|
|
1688
1688
|
for (let g = 0; g < 11; g += 1)
|
|
1689
|
-
|
|
1690
|
-
return (g) => g <= 0 ? 0 : g >= 1 ? 1 :
|
|
1689
|
+
p[g] = y(g * 0.1, t, n);
|
|
1690
|
+
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : y(m(g), e, r);
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1692
|
+
function Vr(t) {
|
|
1693
1693
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1694
1694
|
if (!e)
|
|
1695
|
-
return (o) =>
|
|
1695
|
+
return (o) => V(o);
|
|
1696
1696
|
const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
|
|
1697
|
-
return r === "start" || r === "jump-start" ? (o) =>
|
|
1697
|
+
return r === "start" || r === "jump-start" ? (o) => V(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => V(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => V((Math.floor(o * n) + 0.5) / n) : (o) => V(Math.floor(o * n) / n);
|
|
1698
1698
|
}
|
|
1699
|
-
function
|
|
1699
|
+
function Wr(t) {
|
|
1700
1700
|
if (!t)
|
|
1701
|
-
return (n) =>
|
|
1701
|
+
return (n) => V(n);
|
|
1702
1702
|
const e = t.trim().toLowerCase();
|
|
1703
1703
|
if (!e || e === "linear")
|
|
1704
|
-
return (n) =>
|
|
1705
|
-
if (
|
|
1706
|
-
const [n, r, o, s] =
|
|
1707
|
-
return (a) =>
|
|
1704
|
+
return (n) => V(n);
|
|
1705
|
+
if (bt[e]) {
|
|
1706
|
+
const [n, r, o, s] = bt[e], i = Et(n, r, o, s);
|
|
1707
|
+
return (a) => V(i(V(a)));
|
|
1708
1708
|
}
|
|
1709
1709
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1710
1710
|
const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1711
1711
|
if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
|
|
1712
|
-
const [o, s, i, a] = r, l =
|
|
1713
|
-
return (
|
|
1712
|
+
const [o, s, i, a] = r, l = Et(o, s, i, a);
|
|
1713
|
+
return (f) => V(l(V(f)));
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1717
|
-
const n =
|
|
1718
|
-
return (r) => n(
|
|
1717
|
+
const n = Vr(e);
|
|
1718
|
+
return (r) => n(V(r));
|
|
1719
1719
|
}
|
|
1720
|
-
return (n) =>
|
|
1720
|
+
return (n) => V(n);
|
|
1721
1721
|
}
|
|
1722
|
-
function
|
|
1722
|
+
function Kr(t) {
|
|
1723
1723
|
if (!t)
|
|
1724
1724
|
return;
|
|
1725
1725
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1729,7 +1729,7 @@ function Ur(t) {
|
|
|
1729
1729
|
if (![n, r, o, s].some((i) => !Number.isFinite(i)))
|
|
1730
1730
|
return { inStart: n, inEnd: r, outStart: o, outEnd: s };
|
|
1731
1731
|
}
|
|
1732
|
-
class
|
|
1732
|
+
class Gr {
|
|
1733
1733
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1734
1734
|
observer;
|
|
1735
1735
|
observeScheduled = !1;
|
|
@@ -1756,7 +1756,7 @@ class jr {
|
|
|
1756
1756
|
try {
|
|
1757
1757
|
e();
|
|
1758
1758
|
} catch (n) {
|
|
1759
|
-
|
|
1759
|
+
Ve.warn("Failed to cleanup binding listener", n);
|
|
1760
1760
|
}
|
|
1761
1761
|
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);
|
|
1762
1762
|
}
|
|
@@ -1766,7 +1766,7 @@ class jr {
|
|
|
1766
1766
|
const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1767
1767
|
return r.length === 0 ? void 0 : { bindings: r };
|
|
1768
1768
|
} catch (n) {
|
|
1769
|
-
|
|
1769
|
+
Ve.warn("Failed to parse motion metadata", n);
|
|
1770
1770
|
return;
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
@@ -1774,7 +1774,7 @@ class jr {
|
|
|
1774
1774
|
const n = e.source?.trim();
|
|
1775
1775
|
if (!n)
|
|
1776
1776
|
return;
|
|
1777
|
-
const r =
|
|
1777
|
+
const r = wt(e.min) ?? 0, o = wt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = Wr(e.ease), f = Kr(e.map), p = e.targetId?.trim() || void 0;
|
|
1778
1778
|
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1779
1779
|
source: n.toLowerCase(),
|
|
1780
1780
|
min: r,
|
|
@@ -1782,8 +1782,8 @@ class jr {
|
|
|
1782
1782
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1783
1783
|
reverse: a,
|
|
1784
1784
|
ease: l,
|
|
1785
|
-
map:
|
|
1786
|
-
targetId:
|
|
1785
|
+
map: f,
|
|
1786
|
+
targetId: p
|
|
1787
1787
|
};
|
|
1788
1788
|
}
|
|
1789
1789
|
ensureObserver() {
|
|
@@ -1832,7 +1832,7 @@ class jr {
|
|
|
1832
1832
|
const n = this.bindingsByStyle.get(e);
|
|
1833
1833
|
if (!n || typeof document > "u")
|
|
1834
1834
|
return;
|
|
1835
|
-
const r = `.${
|
|
1835
|
+
const r = `.${St(e)}`;
|
|
1836
1836
|
document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
|
|
1837
1837
|
}
|
|
1838
1838
|
applyStyleToElement(e, n, r) {
|
|
@@ -1872,7 +1872,7 @@ class jr {
|
|
|
1872
1872
|
}
|
|
1873
1873
|
resolveScrollContainer(e, n) {
|
|
1874
1874
|
if (n.targetId) {
|
|
1875
|
-
const r = `[data-ikon-motion-source="${
|
|
1875
|
+
const r = `[data-ikon-motion-source="${St(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
|
|
1876
1876
|
if (o)
|
|
1877
1877
|
return o;
|
|
1878
1878
|
}
|
|
@@ -1882,10 +1882,10 @@ class jr {
|
|
|
1882
1882
|
const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
|
|
1883
1883
|
let i = this.applyClamp(s, n.clamp);
|
|
1884
1884
|
n.reverse && (i = 1 - i);
|
|
1885
|
-
const a = n.ease(i), l = Number.isFinite(a) ? a : 0,
|
|
1886
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1885
|
+
const a = n.ease(i), l = Number.isFinite(a) ? a : 0, f = l * 100;
|
|
1886
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${f}`), n.map) {
|
|
1887
|
+
const p = this.applyMap(f, n.map);
|
|
1888
|
+
p !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${p}`);
|
|
1889
1889
|
} else
|
|
1890
1890
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1891
1891
|
}
|
|
@@ -1900,7 +1900,7 @@ class jr {
|
|
|
1900
1900
|
case "unclamped":
|
|
1901
1901
|
return e;
|
|
1902
1902
|
default:
|
|
1903
|
-
return
|
|
1903
|
+
return V(e);
|
|
1904
1904
|
}
|
|
1905
1905
|
}
|
|
1906
1906
|
applyMap(e, n) {
|
|
@@ -1942,7 +1942,7 @@ class jr {
|
|
|
1942
1942
|
try {
|
|
1943
1943
|
i();
|
|
1944
1944
|
} catch (a) {
|
|
1945
|
-
|
|
1945
|
+
Ve.warn("Failed to cleanup listener", a);
|
|
1946
1946
|
}
|
|
1947
1947
|
this.globalCleanups.delete(i);
|
|
1948
1948
|
}
|
|
@@ -1987,21 +1987,21 @@ class jr {
|
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
1989
|
}
|
|
1990
|
-
const
|
|
1991
|
-
function
|
|
1992
|
-
const e =
|
|
1990
|
+
const We = new Gr();
|
|
1991
|
+
function Yr(t) {
|
|
1992
|
+
const e = v(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
|
|
1993
1993
|
if (!(!s || typeof document > "u")) {
|
|
1994
1994
|
if (i) {
|
|
1995
1995
|
let l = e.current.get(s);
|
|
1996
1996
|
l || (l = document.createElement("style"), l.setAttribute("data-ikon-style-id", s), document.head.appendChild(l), e.current.set(s, l)), l.textContent = i;
|
|
1997
1997
|
}
|
|
1998
|
-
|
|
1998
|
+
We.registerStyle(s, a);
|
|
1999
1999
|
}
|
|
2000
2000
|
}, []), r = D((s) => {
|
|
2001
2001
|
if (!(typeof document > "u"))
|
|
2002
2002
|
for (const i of s) {
|
|
2003
2003
|
const a = e.current.get(i);
|
|
2004
|
-
a && (a.remove(), e.current.delete(i)),
|
|
2004
|
+
a && (a.remove(), e.current.delete(i)), We.unregisterStyle(i);
|
|
2005
2005
|
}
|
|
2006
2006
|
}, []), o = D(() => {
|
|
2007
2007
|
if (typeof document < "u") {
|
|
@@ -2009,9 +2009,9 @@ function Dr(t) {
|
|
|
2009
2009
|
s.remove();
|
|
2010
2010
|
e.current.clear();
|
|
2011
2011
|
}
|
|
2012
|
-
|
|
2012
|
+
We.reset();
|
|
2013
2013
|
}, []);
|
|
2014
|
-
return
|
|
2014
|
+
return C(() => {
|
|
2015
2015
|
if (!t) return;
|
|
2016
2016
|
for (const a of t.getUiStyles())
|
|
2017
2017
|
n(a);
|
|
@@ -2019,9 +2019,9 @@ function Dr(t) {
|
|
|
2019
2019
|
return () => {
|
|
2020
2020
|
s?.(), i?.(), o();
|
|
2021
2021
|
};
|
|
2022
|
-
}, [t, o, n, r]),
|
|
2022
|
+
}, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
2023
2023
|
}
|
|
2024
|
-
function
|
|
2024
|
+
function zr(t) {
|
|
2025
2025
|
const e = [];
|
|
2026
2026
|
for (const [n, r] of t) {
|
|
2027
2027
|
const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -2029,62 +2029,62 @@ function $r(t) {
|
|
|
2029
2029
|
}
|
|
2030
2030
|
return e.sort(), e.join(",");
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2033
|
-
const [e, n] =
|
|
2034
|
-
return
|
|
2032
|
+
function Xr(t) {
|
|
2033
|
+
const [e, n] = x(), r = v("");
|
|
2034
|
+
return C(() => {
|
|
2035
2035
|
if (!t) {
|
|
2036
2036
|
n(void 0), r.current = "";
|
|
2037
2037
|
return;
|
|
2038
2038
|
}
|
|
2039
2039
|
const o = () => {
|
|
2040
|
-
const s = t.getStores(), i =
|
|
2040
|
+
const s = t.getStores(), i = zr(s);
|
|
2041
2041
|
i !== r.current && (r.current = i, n(s));
|
|
2042
2042
|
};
|
|
2043
2043
|
return o(), t.subscribe(o);
|
|
2044
2044
|
}, [t]), e;
|
|
2045
2045
|
}
|
|
2046
|
-
var
|
|
2047
|
-
function
|
|
2048
|
-
var e =
|
|
2046
|
+
var Hr = typeof global == "object" && global && global.Object === Object && global, qr = typeof self == "object" && self && self.Object === Object && self, Jr = Hr || qr || Function("return this")(), Ne = Jr.Symbol, Wt = Object.prototype, Zr = Wt.hasOwnProperty, Qr = Wt.toString, ye = Ne ? Ne.toStringTag : void 0;
|
|
2047
|
+
function eo(t) {
|
|
2048
|
+
var e = Zr.call(t, ye), n = t[ye];
|
|
2049
2049
|
try {
|
|
2050
|
-
t[
|
|
2050
|
+
t[ye] = void 0;
|
|
2051
2051
|
var r = !0;
|
|
2052
2052
|
} catch {
|
|
2053
2053
|
}
|
|
2054
|
-
var o =
|
|
2055
|
-
return r && (e ? t[
|
|
2054
|
+
var o = Qr.call(t);
|
|
2055
|
+
return r && (e ? t[ye] = n : delete t[ye]), o;
|
|
2056
2056
|
}
|
|
2057
|
-
var
|
|
2058
|
-
function
|
|
2059
|
-
return
|
|
2057
|
+
var to = Object.prototype, no = to.toString;
|
|
2058
|
+
function ro(t) {
|
|
2059
|
+
return no.call(t);
|
|
2060
2060
|
}
|
|
2061
|
-
var
|
|
2062
|
-
function
|
|
2063
|
-
return t == null ? t === void 0 ?
|
|
2061
|
+
var oo = "[object Null]", so = "[object Undefined]", vt = Ne ? Ne.toStringTag : void 0;
|
|
2062
|
+
function io(t) {
|
|
2063
|
+
return t == null ? t === void 0 ? so : oo : vt && vt in Object(t) ? eo(t) : ro(t);
|
|
2064
2064
|
}
|
|
2065
|
-
function
|
|
2065
|
+
function ao(t) {
|
|
2066
2066
|
return t != null && typeof t == "object";
|
|
2067
2067
|
}
|
|
2068
|
-
var
|
|
2069
|
-
function
|
|
2070
|
-
return typeof t == "string" || !
|
|
2068
|
+
var co = Array.isArray, lo = "[object String]";
|
|
2069
|
+
function uo(t) {
|
|
2070
|
+
return typeof t == "string" || !co(t) && ao(t) && io(t) == lo;
|
|
2071
2071
|
}
|
|
2072
|
-
const
|
|
2073
|
-
function
|
|
2072
|
+
const Rt = "ikonUiModules";
|
|
2073
|
+
function Qe(t) {
|
|
2074
2074
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function fo(t) {
|
|
2077
2077
|
if (!Array.isArray(t))
|
|
2078
2078
|
return;
|
|
2079
2079
|
const e = /* @__PURE__ */ new Set();
|
|
2080
2080
|
for (const n of t) {
|
|
2081
|
-
if (!
|
|
2081
|
+
if (!uo(n)) continue;
|
|
2082
2082
|
const r = n.trim();
|
|
2083
2083
|
r && (e.has(r) || e.add(r));
|
|
2084
2084
|
}
|
|
2085
2085
|
return Array.from(e);
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function Ds(t, e) {
|
|
2088
2088
|
if (t === e)
|
|
2089
2089
|
return !0;
|
|
2090
2090
|
if (!t || !e)
|
|
@@ -2096,19 +2096,19 @@ function Os(t, e) {
|
|
|
2096
2096
|
return !1;
|
|
2097
2097
|
return !0;
|
|
2098
2098
|
}
|
|
2099
|
-
function
|
|
2100
|
-
if (!(!
|
|
2101
|
-
return
|
|
2099
|
+
function ho(t) {
|
|
2100
|
+
if (!(!Qe(t) || !Object.prototype.hasOwnProperty.call(t, Rt)))
|
|
2101
|
+
return fo(t[Rt]);
|
|
2102
2102
|
}
|
|
2103
|
-
function
|
|
2103
|
+
function $s(...t) {
|
|
2104
2104
|
for (const e of t) {
|
|
2105
|
-
const n =
|
|
2105
|
+
const n = ho(e);
|
|
2106
2106
|
if (n !== void 0)
|
|
2107
2107
|
return n;
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2111
|
-
if (!
|
|
2110
|
+
function Bs(t) {
|
|
2111
|
+
if (!Qe(t))
|
|
2112
2112
|
return;
|
|
2113
2113
|
const e = t, n = Object.keys(e).find((l) => l.toLowerCase() === "modules");
|
|
2114
2114
|
if (!n)
|
|
@@ -2121,31 +2121,31 @@ function xs(t) {
|
|
|
2121
2121
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
2122
2122
|
for (const l of r) {
|
|
2123
2123
|
if (typeof l == "string") {
|
|
2124
|
-
const
|
|
2125
|
-
if (!
|
|
2124
|
+
const m = l.trim();
|
|
2125
|
+
if (!m || i.has(m))
|
|
2126
2126
|
continue;
|
|
2127
|
-
o.push(
|
|
2127
|
+
o.push(m), i.add(m);
|
|
2128
2128
|
continue;
|
|
2129
2129
|
}
|
|
2130
|
-
if (!
|
|
2130
|
+
if (!Qe(l))
|
|
2131
2131
|
continue;
|
|
2132
|
-
const
|
|
2133
|
-
if (!
|
|
2132
|
+
const f = l, p = Object.keys(f).find((m) => m.toLowerCase() === "name");
|
|
2133
|
+
if (!p)
|
|
2134
2134
|
continue;
|
|
2135
|
-
const
|
|
2136
|
-
if (typeof
|
|
2135
|
+
const y = f[p];
|
|
2136
|
+
if (typeof y != "string")
|
|
2137
2137
|
continue;
|
|
2138
|
-
const
|
|
2139
|
-
if (!
|
|
2138
|
+
const u = y.trim();
|
|
2139
|
+
if (!u)
|
|
2140
2140
|
continue;
|
|
2141
|
-
const c = Object.keys(
|
|
2142
|
-
typeof
|
|
2141
|
+
const c = Object.keys(f).find((m) => m.toLowerCase() === "javascript"), d = c ? f[c] : void 0;
|
|
2142
|
+
typeof d == "string" && s.set(u, d), i.has(u) || (o.push(u), i.add(u));
|
|
2143
2143
|
}
|
|
2144
2144
|
if (!o.length && s.size === 0)
|
|
2145
2145
|
return { modules: [] };
|
|
2146
|
-
const a = Array.from(s.entries()).map(([l,
|
|
2146
|
+
const a = Array.from(s.entries()).map(([l, f]) => ({
|
|
2147
2147
|
name: l,
|
|
2148
|
-
javascript:
|
|
2148
|
+
javascript: f
|
|
2149
2149
|
}));
|
|
2150
2150
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
2151
2151
|
}
|
|
@@ -2156,7 +2156,7 @@ const k = {
|
|
|
2156
2156
|
Line: 4,
|
|
2157
2157
|
Paragraph: 8,
|
|
2158
2158
|
Emoji: 16
|
|
2159
|
-
},
|
|
2159
|
+
}, po = [
|
|
2160
2160
|
{
|
|
2161
2161
|
flag: k.Letter,
|
|
2162
2162
|
hints: [
|
|
@@ -2205,42 +2205,42 @@ const k = {
|
|
|
2205
2205
|
"[data-emoji]"
|
|
2206
2206
|
]
|
|
2207
2207
|
}
|
|
2208
|
-
],
|
|
2209
|
-
function
|
|
2210
|
-
if (!t || t.length >
|
|
2208
|
+
], et = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, mo = k.Letter | k.Word | k.Line | k.Paragraph, At = /* @__PURE__ */ new Map(), go = 16384;
|
|
2209
|
+
function Fs(t, e) {
|
|
2210
|
+
if (!t || t.length > go)
|
|
2211
2211
|
return t;
|
|
2212
|
-
const n =
|
|
2212
|
+
const n = Po(e), r = ue(n, k.Emoji), o = n & mo;
|
|
2213
2213
|
if (o === k.None && !r)
|
|
2214
2214
|
return t;
|
|
2215
2215
|
const s = t.replace(/\r\n/g, `
|
|
2216
2216
|
`).replace(/\r/g, `
|
|
2217
2217
|
`);
|
|
2218
2218
|
if (o === k.None)
|
|
2219
|
-
return
|
|
2220
|
-
const i =
|
|
2219
|
+
return _t(s);
|
|
2220
|
+
const i = No(s);
|
|
2221
2221
|
if (i.length === 0)
|
|
2222
|
-
return r ?
|
|
2223
|
-
const a =
|
|
2224
|
-
for (const
|
|
2225
|
-
const
|
|
2226
|
-
|
|
2222
|
+
return r ? _t(s) : t;
|
|
2223
|
+
const a = xo(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
2224
|
+
for (const p of a) {
|
|
2225
|
+
const y = yo(p, n, l);
|
|
2226
|
+
f.push(...y);
|
|
2227
2227
|
}
|
|
2228
|
-
return
|
|
2228
|
+
return f;
|
|
2229
2229
|
}
|
|
2230
|
-
function
|
|
2230
|
+
function yo(t, e, n) {
|
|
2231
2231
|
const r = [];
|
|
2232
2232
|
for (const o of t) {
|
|
2233
|
-
const s =
|
|
2233
|
+
const s = bo(o, e, n);
|
|
2234
2234
|
r.push(...s);
|
|
2235
2235
|
}
|
|
2236
|
-
if (
|
|
2236
|
+
if (ue(e, k.Paragraph)) {
|
|
2237
2237
|
const o = n.paragraph++;
|
|
2238
2238
|
return [
|
|
2239
2239
|
/* @__PURE__ */ S.jsx(
|
|
2240
2240
|
"span",
|
|
2241
2241
|
{
|
|
2242
2242
|
"data-motion-paragraph": !0,
|
|
2243
|
-
style:
|
|
2243
|
+
style: Le(o),
|
|
2244
2244
|
children: r
|
|
2245
2245
|
},
|
|
2246
2246
|
`motion-paragraph-${o}`
|
|
@@ -2249,12 +2249,12 @@ function co(t, e, n) {
|
|
|
2249
2249
|
}
|
|
2250
2250
|
return r;
|
|
2251
2251
|
}
|
|
2252
|
-
function
|
|
2253
|
-
const r =
|
|
2254
|
-
if (
|
|
2252
|
+
function bo(t, e, n) {
|
|
2253
|
+
const r = wo(t.text, e, n), o = [];
|
|
2254
|
+
if (ue(e, k.Line)) {
|
|
2255
2255
|
const s = n.line++;
|
|
2256
2256
|
o.push(
|
|
2257
|
-
/* @__PURE__ */ S.jsx("span", { "data-motion-line": !0, style:
|
|
2257
|
+
/* @__PURE__ */ S.jsx("span", { "data-motion-line": !0, style: Le(s), children: r }, `motion-line-${s}`)
|
|
2258
2258
|
);
|
|
2259
2259
|
} else
|
|
2260
2260
|
o.push(...r);
|
|
@@ -2262,103 +2262,103 @@ function lo(t, e, n) {
|
|
|
2262
2262
|
o.push(/* @__PURE__ */ S.jsx("br", {}, `motion-break-${n.br++}`));
|
|
2263
2263
|
return o;
|
|
2264
2264
|
}
|
|
2265
|
-
function
|
|
2265
|
+
function wo(t, e, n) {
|
|
2266
2266
|
if (!t)
|
|
2267
2267
|
return [];
|
|
2268
|
-
const r =
|
|
2268
|
+
const r = ue(e, k.Word), o = [], s = /(\s+)/g;
|
|
2269
2269
|
let i = 0, a;
|
|
2270
2270
|
for (; (a = s.exec(t)) !== null; ) {
|
|
2271
2271
|
if (a.index > i) {
|
|
2272
2272
|
const l = t.slice(i, a.index);
|
|
2273
|
-
o.push(
|
|
2273
|
+
o.push(Tt(l, n, e, r));
|
|
2274
2274
|
}
|
|
2275
2275
|
o.push(a[0]), i = a.index + a[0].length;
|
|
2276
2276
|
}
|
|
2277
2277
|
if (i < t.length) {
|
|
2278
2278
|
const l = t.slice(i);
|
|
2279
|
-
o.push(
|
|
2279
|
+
o.push(Tt(l, n, e, r));
|
|
2280
2280
|
}
|
|
2281
2281
|
return o;
|
|
2282
2282
|
}
|
|
2283
|
-
function
|
|
2284
|
-
const o = e.word++, s =
|
|
2283
|
+
function Tt(t, e, n, r) {
|
|
2284
|
+
const o = e.word++, s = Eo(t, n, e), i = `motion-word-${o}`, a = So(o, r);
|
|
2285
2285
|
return r ? /* @__PURE__ */ S.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ S.jsx("span", { style: a, children: s }, i);
|
|
2286
2286
|
}
|
|
2287
|
-
function
|
|
2288
|
-
return e ? { ...
|
|
2287
|
+
function So(t, e) {
|
|
2288
|
+
return e ? { ...Le(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2290
|
+
function Eo(t, e, n) {
|
|
2291
2291
|
if (!t)
|
|
2292
2292
|
return [];
|
|
2293
|
-
const r =
|
|
2293
|
+
const r = ue(e, k.Letter), o = ue(e, k.Emoji);
|
|
2294
2294
|
if (!r) {
|
|
2295
2295
|
if (!o)
|
|
2296
2296
|
return [t];
|
|
2297
|
-
const a =
|
|
2297
|
+
const a = tt(t);
|
|
2298
2298
|
if (a.length === 0)
|
|
2299
2299
|
return [t];
|
|
2300
|
-
const { nodes: l } =
|
|
2300
|
+
const { nodes: l } = Gt(a, n);
|
|
2301
2301
|
return l;
|
|
2302
2302
|
}
|
|
2303
|
-
const s = [], i =
|
|
2303
|
+
const s = [], i = tt(t);
|
|
2304
2304
|
for (const a of i) {
|
|
2305
|
-
const l = n.letter++,
|
|
2305
|
+
const l = n.letter++, f = `motion-letter-${l}`, p = Le(l);
|
|
2306
2306
|
if (a === `
|
|
2307
2307
|
`) {
|
|
2308
2308
|
s.push(
|
|
2309
|
-
/* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style:
|
|
2309
|
+
/* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: p, children: /* @__PURE__ */ S.jsx("br", {}) }, f)
|
|
2310
2310
|
);
|
|
2311
2311
|
continue;
|
|
2312
2312
|
}
|
|
2313
|
-
const
|
|
2313
|
+
const u = o && Kt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
|
|
2314
2314
|
s.push(
|
|
2315
|
-
/* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style:
|
|
2315
|
+
/* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: p, ...u, children: c }, f)
|
|
2316
2316
|
);
|
|
2317
2317
|
}
|
|
2318
2318
|
return s;
|
|
2319
2319
|
}
|
|
2320
|
-
function
|
|
2320
|
+
function tt(t) {
|
|
2321
2321
|
if (!t)
|
|
2322
2322
|
return [];
|
|
2323
|
-
const e =
|
|
2324
|
-
return e ? Array.from(e.segment(t), (n) => n.segment) :
|
|
2323
|
+
const e = vo();
|
|
2324
|
+
return e ? Array.from(e.segment(t), (n) => n.segment) : Ro(t);
|
|
2325
2325
|
}
|
|
2326
|
-
let
|
|
2327
|
-
function
|
|
2328
|
-
return
|
|
2326
|
+
let be;
|
|
2327
|
+
function vo() {
|
|
2328
|
+
return be !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? be = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : be = null), be;
|
|
2329
2329
|
}
|
|
2330
|
-
function
|
|
2330
|
+
function Ro(t) {
|
|
2331
2331
|
const e = [], n = Array.from(t);
|
|
2332
2332
|
let r = "";
|
|
2333
2333
|
for (let o = 0; o < n.length; o++) {
|
|
2334
2334
|
const s = n[o], i = n[o + 1];
|
|
2335
|
-
r += s, !(i &&
|
|
2335
|
+
r += s, !(i && Ao(s, i)) && (e.push(r), r = "");
|
|
2336
2336
|
}
|
|
2337
2337
|
return r && e.push(r), e;
|
|
2338
2338
|
}
|
|
2339
|
-
function
|
|
2340
|
-
return e ? !!(
|
|
2339
|
+
function Ao(t, e) {
|
|
2340
|
+
return e ? !!(kt(t) || kt(e) || Co(e) || To(e) || ko(e) || Ct(t) && Ct(e)) : !1;
|
|
2341
2341
|
}
|
|
2342
|
-
function
|
|
2342
|
+
function kt(t) {
|
|
2343
2343
|
return t.codePointAt(0) === 8205;
|
|
2344
2344
|
}
|
|
2345
|
-
function
|
|
2345
|
+
function To(t) {
|
|
2346
2346
|
const e = t.codePointAt(0);
|
|
2347
2347
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function ko(t) {
|
|
2350
2350
|
const e = t.codePointAt(0);
|
|
2351
2351
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2352
2352
|
}
|
|
2353
|
-
function
|
|
2353
|
+
function Ct(t) {
|
|
2354
2354
|
const e = t.codePointAt(0);
|
|
2355
2355
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2356
2356
|
}
|
|
2357
|
-
let
|
|
2358
|
-
function
|
|
2359
|
-
return t ? (
|
|
2357
|
+
let Ke;
|
|
2358
|
+
function Co(t) {
|
|
2359
|
+
return t ? (Ke || (Ke = _o()), Ke(t)) : !1;
|
|
2360
2360
|
}
|
|
2361
|
-
function
|
|
2361
|
+
function _o() {
|
|
2362
2362
|
try {
|
|
2363
2363
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2364
2364
|
return (e) => t.test(e);
|
|
@@ -2369,19 +2369,19 @@ function So() {
|
|
|
2369
2369
|
};
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
|
-
let
|
|
2373
|
-
function
|
|
2374
|
-
return t ? (
|
|
2372
|
+
let Ge;
|
|
2373
|
+
function Kt(t) {
|
|
2374
|
+
return t ? (Ge || (Ge = Io()), Ge(t)) : !1;
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function Io() {
|
|
2377
2377
|
try {
|
|
2378
2378
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2379
2379
|
return (e) => t.test(e);
|
|
2380
2380
|
} catch {
|
|
2381
|
-
return
|
|
2381
|
+
return Oo;
|
|
2382
2382
|
}
|
|
2383
2383
|
}
|
|
2384
|
-
function
|
|
2384
|
+
function Oo(t) {
|
|
2385
2385
|
if (!t)
|
|
2386
2386
|
return !1;
|
|
2387
2387
|
for (const e of Array.from(t)) {
|
|
@@ -2391,7 +2391,7 @@ function vo(t) {
|
|
|
2391
2391
|
}
|
|
2392
2392
|
return !1;
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2394
|
+
function No(t) {
|
|
2395
2395
|
const e = [];
|
|
2396
2396
|
let n = "", r = 0;
|
|
2397
2397
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2405,7 +2405,7 @@ function Ro(t) {
|
|
|
2405
2405
|
}
|
|
2406
2406
|
return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2408
|
+
function xo(t) {
|
|
2409
2409
|
if (t.length === 0)
|
|
2410
2410
|
return [];
|
|
2411
2411
|
const e = [];
|
|
@@ -2414,10 +2414,10 @@ function Ao(t) {
|
|
|
2414
2414
|
n.push(r), r.breaks >= 2 && (e.push(n), n = []);
|
|
2415
2415
|
return n.length > 0 && e.push(n), e;
|
|
2416
2416
|
}
|
|
2417
|
-
function
|
|
2417
|
+
function ue(t, e) {
|
|
2418
2418
|
return (t & e) === e;
|
|
2419
2419
|
}
|
|
2420
|
-
function
|
|
2420
|
+
function Le(t) {
|
|
2421
2421
|
return {
|
|
2422
2422
|
"--tw-motion-seq-index": t.toString(),
|
|
2423
2423
|
backgroundColor: "inherit",
|
|
@@ -2434,27 +2434,27 @@ function xe(t) {
|
|
|
2434
2434
|
WebkitTextFillColor: "inherit"
|
|
2435
2435
|
};
|
|
2436
2436
|
}
|
|
2437
|
-
function
|
|
2437
|
+
function _t(t) {
|
|
2438
2438
|
if (!t)
|
|
2439
2439
|
return t;
|
|
2440
|
-
const e =
|
|
2440
|
+
const e = tt(t);
|
|
2441
2441
|
if (e.length === 0)
|
|
2442
2442
|
return t;
|
|
2443
|
-
const { nodes: n, sawEmoji: r } =
|
|
2443
|
+
const { nodes: n, sawEmoji: r } = Gt(e);
|
|
2444
2444
|
return r ? n.length === 1 ? n[0] ?? t : n : t;
|
|
2445
2445
|
}
|
|
2446
|
-
function
|
|
2446
|
+
function Gt(t, e) {
|
|
2447
2447
|
const n = [];
|
|
2448
2448
|
let r = "", o = !1, s = e?.emoji ?? 0;
|
|
2449
2449
|
const i = () => {
|
|
2450
2450
|
r && (n.push(r), r = "");
|
|
2451
2451
|
};
|
|
2452
2452
|
for (const a of t) {
|
|
2453
|
-
if (
|
|
2453
|
+
if (Kt(a)) {
|
|
2454
2454
|
o = !0, i();
|
|
2455
|
-
const
|
|
2455
|
+
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2456
2456
|
n.push(
|
|
2457
|
-
/* @__PURE__ */ S.jsx("span", { "data-motion-emoji": !0, children: a },
|
|
2457
|
+
/* @__PURE__ */ S.jsx("span", { "data-motion-emoji": !0, children: a }, f)
|
|
2458
2458
|
);
|
|
2459
2459
|
continue;
|
|
2460
2460
|
}
|
|
@@ -2462,13 +2462,13 @@ function $t(t, e) {
|
|
|
2462
2462
|
}
|
|
2463
2463
|
return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2464
2464
|
}
|
|
2465
|
-
function
|
|
2465
|
+
function Po(t) {
|
|
2466
2466
|
if (!t)
|
|
2467
2467
|
return k.None;
|
|
2468
2468
|
const e = t.trim();
|
|
2469
2469
|
if (!e)
|
|
2470
2470
|
return k.None;
|
|
2471
|
-
const n =
|
|
2471
|
+
const n = At.get(e);
|
|
2472
2472
|
if (typeof n == "number")
|
|
2473
2473
|
return n;
|
|
2474
2474
|
if (typeof document > "u")
|
|
@@ -2476,25 +2476,25 @@ function To(t) {
|
|
|
2476
2476
|
const r = e.split(/\s+/).filter(Boolean);
|
|
2477
2477
|
if (r.length === 0)
|
|
2478
2478
|
return k.None;
|
|
2479
|
-
const s = r.map((l) => `.${
|
|
2480
|
-
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2479
|
+
const s = r.map((l) => `.${Lo(l)}`).map(
|
|
2480
|
+
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Mo(l)}(?![a-zA-Z0-9_-])`)
|
|
2481
2481
|
);
|
|
2482
2482
|
let i = k.None, a = !1;
|
|
2483
2483
|
for (const l of Array.from(document.styleSheets)) {
|
|
2484
|
-
let
|
|
2484
|
+
let f;
|
|
2485
2485
|
try {
|
|
2486
|
-
|
|
2486
|
+
f = l.cssRules;
|
|
2487
2487
|
} catch {
|
|
2488
2488
|
continue;
|
|
2489
2489
|
}
|
|
2490
|
-
const
|
|
2491
|
-
if (
|
|
2490
|
+
const p = Yt(f, s);
|
|
2491
|
+
if (p.mask && (i |= p.mask, i === et))
|
|
2492
2492
|
break;
|
|
2493
|
-
a ||=
|
|
2493
|
+
a ||= p.sawStyleRule;
|
|
2494
2494
|
}
|
|
2495
|
-
return (i !== k.None || a) &&
|
|
2495
|
+
return (i !== k.None || a) && At.set(e, i), i;
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2497
|
+
function Yt(t, e) {
|
|
2498
2498
|
if (!t)
|
|
2499
2499
|
return { mask: k.None, sawStyleRule: !1 };
|
|
2500
2500
|
let n = k.None, r = !1;
|
|
@@ -2503,15 +2503,15 @@ function Bt(t, e) {
|
|
|
2503
2503
|
if (s) {
|
|
2504
2504
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2505
2505
|
const a = s.selectorText ?? "";
|
|
2506
|
-
if (!a || !e.some((
|
|
2506
|
+
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2507
2507
|
r = !0;
|
|
2508
|
-
for (const
|
|
2509
|
-
|
|
2510
|
-
if (n ===
|
|
2508
|
+
for (const f of po)
|
|
2509
|
+
f.hints.some((p) => a.includes(p)) && (n |= f.flag);
|
|
2510
|
+
if (n === et)
|
|
2511
2511
|
return { mask: n, sawStyleRule: !0 };
|
|
2512
2512
|
} else if ("cssRules" in s) {
|
|
2513
|
-
const i =
|
|
2514
|
-
if (i.mask && (n |= i.mask, n ===
|
|
2513
|
+
const i = Yt(s.cssRules, e);
|
|
2514
|
+
if (i.mask && (n |= i.mask, n === et))
|
|
2515
2515
|
return { mask: n, sawStyleRule: !0 };
|
|
2516
2516
|
r ||= i.sawStyleRule;
|
|
2517
2517
|
}
|
|
@@ -2519,48 +2519,48 @@ function Bt(t, e) {
|
|
|
2519
2519
|
}
|
|
2520
2520
|
return { mask: n, sawStyleRule: r };
|
|
2521
2521
|
}
|
|
2522
|
-
function
|
|
2522
|
+
function Lo(t) {
|
|
2523
2523
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2524
2524
|
}
|
|
2525
|
-
function
|
|
2525
|
+
function Mo(t) {
|
|
2526
2526
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2527
2527
|
}
|
|
2528
|
-
const
|
|
2529
|
-
function
|
|
2528
|
+
const it = "ikon_auth_session", Uo = 10080 * 60 * 1e3, jo = 60 * 1e3;
|
|
2529
|
+
function Do(t) {
|
|
2530
2530
|
try {
|
|
2531
2531
|
const e = t.split(".");
|
|
2532
2532
|
if (e.length !== 3) return !0;
|
|
2533
2533
|
const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
|
|
2534
|
-
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 -
|
|
2534
|
+
return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - jo;
|
|
2535
2535
|
} catch {
|
|
2536
2536
|
return !0;
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function Ee(t) {
|
|
2540
2540
|
try {
|
|
2541
|
-
localStorage.setItem(
|
|
2541
|
+
localStorage.setItem(it, JSON.stringify(t));
|
|
2542
2542
|
} catch {
|
|
2543
2543
|
console.warn("Failed to save auth session to localStorage");
|
|
2544
2544
|
}
|
|
2545
2545
|
}
|
|
2546
|
-
function
|
|
2546
|
+
function zt() {
|
|
2547
2547
|
try {
|
|
2548
|
-
const t = localStorage.getItem(
|
|
2548
|
+
const t = localStorage.getItem(it);
|
|
2549
2549
|
if (!t) return null;
|
|
2550
2550
|
const e = JSON.parse(t);
|
|
2551
|
-
return Date.now() - e.authenticatedAt >
|
|
2551
|
+
return Date.now() - e.authenticatedAt > Uo || Do(e.token) ? (xe(), null) : e;
|
|
2552
2552
|
} catch {
|
|
2553
2553
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2554
2554
|
}
|
|
2555
2555
|
}
|
|
2556
|
-
function
|
|
2556
|
+
function xe() {
|
|
2557
2557
|
try {
|
|
2558
|
-
localStorage.removeItem(
|
|
2558
|
+
localStorage.removeItem(it);
|
|
2559
2559
|
} catch {
|
|
2560
2560
|
console.warn("Failed to clear auth session from localStorage");
|
|
2561
2561
|
}
|
|
2562
2562
|
}
|
|
2563
|
-
function
|
|
2563
|
+
function ae(t) {
|
|
2564
2564
|
return {
|
|
2565
2565
|
id: "",
|
|
2566
2566
|
provider: t.provider,
|
|
@@ -2568,51 +2568,51 @@ function se(t) {
|
|
|
2568
2568
|
authenticatedAt: t.authenticatedAt
|
|
2569
2569
|
};
|
|
2570
2570
|
}
|
|
2571
|
-
const
|
|
2572
|
-
async function
|
|
2571
|
+
const Xt = 15e3, we = se("AuthService");
|
|
2572
|
+
async function It(t) {
|
|
2573
2573
|
try {
|
|
2574
2574
|
return await fetch(t, { method: "GET", mode: "no-cors" }), "no-cors probe SUCCEEDED → origin is reachable; the failure is most likely CORS (missing/!allowed Access-Control headers)";
|
|
2575
2575
|
} catch (e) {
|
|
2576
2576
|
return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
|
|
2577
2577
|
}
|
|
2578
2578
|
}
|
|
2579
|
-
async function
|
|
2580
|
-
const n =
|
|
2579
|
+
async function Ht(t, e) {
|
|
2580
|
+
const n = wn(), r = {
|
|
2581
2581
|
method: "POST",
|
|
2582
2582
|
headers: { "Content-Type": "application/json" },
|
|
2583
2583
|
body: JSON.stringify({ deviceId: n, space: t })
|
|
2584
2584
|
}, o = typeof window < "u" ? window.location.origin : "?", s = `${e}/anonymous`;
|
|
2585
|
-
|
|
2585
|
+
we.info(`Anonymous auth: POST ${s} (space=${t}, origin=${o})`);
|
|
2586
2586
|
let i;
|
|
2587
2587
|
try {
|
|
2588
2588
|
i = await fetch(s, r);
|
|
2589
|
-
} catch (
|
|
2590
|
-
const
|
|
2591
|
-
if (
|
|
2592
|
-
|
|
2589
|
+
} catch (f) {
|
|
2590
|
+
const p = f instanceof Error ? `${f.name}: ${f.message}` : String(f), y = Sn(), u = y ? `${y}/anonymous` : null;
|
|
2591
|
+
if (u && u !== s) {
|
|
2592
|
+
we.warn(`Anonymous auth could not reach ${s} (${p}); falling back to same-origin ${u}`);
|
|
2593
2593
|
try {
|
|
2594
|
-
i = await fetch(
|
|
2594
|
+
i = await fetch(u, r);
|
|
2595
2595
|
} catch (c) {
|
|
2596
|
-
const
|
|
2597
|
-
throw
|
|
2596
|
+
const d = c instanceof Error ? `${c.name}: ${c.message}` : String(c), m = await It(e);
|
|
2597
|
+
throw we.error(`Anonymous auth failed on both direct (${s}: ${p}) and same-origin (${u}: ${d}). ${m}`), new Error(`Anonymous auth unreachable: direct ${s} (${p}) and same-origin ${u} (${d})`);
|
|
2598
2598
|
}
|
|
2599
2599
|
} else {
|
|
2600
|
-
const c = await
|
|
2601
|
-
throw
|
|
2600
|
+
const c = await It(e);
|
|
2601
|
+
throw we.error(`Anonymous auth fetch threw for ${s} — ${p}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${p}). ${c}`);
|
|
2602
2602
|
}
|
|
2603
2603
|
}
|
|
2604
2604
|
if (!i.ok) {
|
|
2605
|
-
const
|
|
2606
|
-
throw
|
|
2605
|
+
const f = await i.text().catch(() => "Unknown error");
|
|
2606
|
+
throw we.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${f}`), new Error(`Anonymous auth failed: ${i.status} ${f}`);
|
|
2607
2607
|
}
|
|
2608
2608
|
const { token: a } = await i.json(), l = {
|
|
2609
2609
|
token: a,
|
|
2610
2610
|
provider: "anonymous",
|
|
2611
2611
|
authenticatedAt: Date.now()
|
|
2612
2612
|
};
|
|
2613
|
-
return
|
|
2613
|
+
return Ee(l), l;
|
|
2614
2614
|
}
|
|
2615
|
-
async function
|
|
2615
|
+
async function $o({ email: t, spaceId: e, authUrl: n }) {
|
|
2616
2616
|
const r = await fetch(`${n}/email/send`, {
|
|
2617
2617
|
method: "POST",
|
|
2618
2618
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2620,14 +2620,14 @@ async function No({ email: t, spaceId: e, authUrl: n }) {
|
|
|
2620
2620
|
email: t.trim(),
|
|
2621
2621
|
space: e
|
|
2622
2622
|
}),
|
|
2623
|
-
signal:
|
|
2623
|
+
signal: Lt(Xt)
|
|
2624
2624
|
});
|
|
2625
2625
|
if (!r.ok) {
|
|
2626
2626
|
const o = await r.text().catch(() => "Failed to send login code");
|
|
2627
2627
|
throw new Error(o);
|
|
2628
2628
|
}
|
|
2629
2629
|
}
|
|
2630
|
-
async function
|
|
2630
|
+
async function Bo({ email: t, code: e, authUrl: n }) {
|
|
2631
2631
|
const r = await fetch(`${n}/email/code`, {
|
|
2632
2632
|
method: "POST",
|
|
2633
2633
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2635,7 +2635,7 @@ async function xo({ email: t, code: e, authUrl: n }) {
|
|
|
2635
2635
|
email: t.trim(),
|
|
2636
2636
|
code: e.trim()
|
|
2637
2637
|
}),
|
|
2638
|
-
signal:
|
|
2638
|
+
signal: Lt(Xt)
|
|
2639
2639
|
});
|
|
2640
2640
|
if (!r.ok) {
|
|
2641
2641
|
const i = await r.text().catch(() => "Invalid code");
|
|
@@ -2646,23 +2646,23 @@ async function xo({ email: t, code: e, authUrl: n }) {
|
|
|
2646
2646
|
provider: "email",
|
|
2647
2647
|
authenticatedAt: Date.now()
|
|
2648
2648
|
};
|
|
2649
|
-
return
|
|
2649
|
+
return Ee(s), s;
|
|
2650
2650
|
}
|
|
2651
|
-
function
|
|
2651
|
+
function Fo() {
|
|
2652
2652
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
2653
2653
|
return e && n ? { token: e, provider: n } : null;
|
|
2654
2654
|
}
|
|
2655
|
-
function
|
|
2655
|
+
function Vo() {
|
|
2656
2656
|
return new URLSearchParams(window.location.search).get("error");
|
|
2657
2657
|
}
|
|
2658
|
-
function
|
|
2658
|
+
function Ot() {
|
|
2659
2659
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2660
2660
|
}
|
|
2661
|
-
function
|
|
2661
|
+
function Wo(t, e, n, r) {
|
|
2662
2662
|
const o = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2663
2663
|
return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2664
2664
|
}
|
|
2665
|
-
async function
|
|
2665
|
+
async function Ko(t) {
|
|
2666
2666
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2667
2667
|
method: "POST",
|
|
2668
2668
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2673,7 +2673,7 @@ async function Uo(t) {
|
|
|
2673
2673
|
}
|
|
2674
2674
|
return e.json();
|
|
2675
2675
|
}
|
|
2676
|
-
async function
|
|
2676
|
+
async function Go(t, e, n) {
|
|
2677
2677
|
const r = await fetch(`${t}/passkey/registration/verify`, {
|
|
2678
2678
|
method: "POST",
|
|
2679
2679
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2688,9 +2688,9 @@ async function jo(t, e, n) {
|
|
|
2688
2688
|
provider: "passkey",
|
|
2689
2689
|
authenticatedAt: Date.now()
|
|
2690
2690
|
};
|
|
2691
|
-
return
|
|
2691
|
+
return Ee(s), s;
|
|
2692
2692
|
}
|
|
2693
|
-
async function
|
|
2693
|
+
async function Yo(t, e) {
|
|
2694
2694
|
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
2695
2695
|
method: "POST",
|
|
2696
2696
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2702,7 +2702,7 @@ async function Do(t, e) {
|
|
|
2702
2702
|
}
|
|
2703
2703
|
return n.json();
|
|
2704
2704
|
}
|
|
2705
|
-
async function
|
|
2705
|
+
async function zo(t, e) {
|
|
2706
2706
|
const n = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2707
2707
|
method: "POST",
|
|
2708
2708
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2717,32 +2717,32 @@ async function $o(t, e) {
|
|
|
2717
2717
|
provider: "passkey",
|
|
2718
2718
|
authenticatedAt: Date.now()
|
|
2719
2719
|
};
|
|
2720
|
-
return
|
|
2720
|
+
return Ee(o), o;
|
|
2721
2721
|
}
|
|
2722
|
-
function
|
|
2722
|
+
function z(t) {
|
|
2723
2723
|
const e = new Uint8Array(t);
|
|
2724
2724
|
let n = "";
|
|
2725
2725
|
for (const o of e)
|
|
2726
2726
|
n += String.fromCharCode(o);
|
|
2727
2727
|
return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2728
2728
|
}
|
|
2729
|
-
function
|
|
2729
|
+
function Pe(t) {
|
|
2730
2730
|
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);
|
|
2731
2731
|
for (let a = 0; a < o.length; a++)
|
|
2732
2732
|
i[a] = o.charCodeAt(a);
|
|
2733
2733
|
return s;
|
|
2734
2734
|
}
|
|
2735
|
-
function
|
|
2736
|
-
return
|
|
2735
|
+
function at() {
|
|
2736
|
+
return Xo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2737
2737
|
}
|
|
2738
|
-
const
|
|
2738
|
+
const Xo = {
|
|
2739
2739
|
stubThis: (t) => t
|
|
2740
2740
|
};
|
|
2741
|
-
function
|
|
2741
|
+
function qt(t) {
|
|
2742
2742
|
const { id: e } = t;
|
|
2743
2743
|
return {
|
|
2744
2744
|
...t,
|
|
2745
|
-
id:
|
|
2745
|
+
id: Pe(e),
|
|
2746
2746
|
/**
|
|
2747
2747
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2748
2748
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2751,7 +2751,7 @@ function Kt(t) {
|
|
|
2751
2751
|
transports: t.transports
|
|
2752
2752
|
};
|
|
2753
2753
|
}
|
|
2754
|
-
function
|
|
2754
|
+
function Jt(t) {
|
|
2755
2755
|
return (
|
|
2756
2756
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2757
2757
|
t === "localhost" || // Support punycode (ACE) or ascii labels and domains
|
|
@@ -2768,7 +2768,7 @@ class j extends Error {
|
|
|
2768
2768
|
}), this.name = o ?? r.name, this.code = n;
|
|
2769
2769
|
}
|
|
2770
2770
|
}
|
|
2771
|
-
function
|
|
2771
|
+
function Ho({ error: t, options: e }) {
|
|
2772
2772
|
const { publicKey: n } = e;
|
|
2773
2773
|
if (!n)
|
|
2774
2774
|
throw Error("options was missing required publicKey property");
|
|
@@ -2826,7 +2826,7 @@ function Fo({ error: t, options: e }) {
|
|
|
2826
2826
|
});
|
|
2827
2827
|
if (t.name === "SecurityError") {
|
|
2828
2828
|
const r = globalThis.location.hostname;
|
|
2829
|
-
if (
|
|
2829
|
+
if (Jt(r)) {
|
|
2830
2830
|
if (n.rp.id !== r)
|
|
2831
2831
|
return new j({
|
|
2832
2832
|
message: `The RP ID "${n.rp.id}" is invalid for this domain`,
|
|
@@ -2854,7 +2854,7 @@ function Fo({ error: t, options: e }) {
|
|
|
2854
2854
|
}
|
|
2855
2855
|
return t;
|
|
2856
2856
|
}
|
|
2857
|
-
class
|
|
2857
|
+
class qo {
|
|
2858
2858
|
constructor() {
|
|
2859
2859
|
Object.defineProperty(this, "controller", {
|
|
2860
2860
|
enumerable: !0,
|
|
@@ -2878,89 +2878,89 @@ class Vo {
|
|
|
2878
2878
|
}
|
|
2879
2879
|
}
|
|
2880
2880
|
}
|
|
2881
|
-
const
|
|
2882
|
-
function
|
|
2883
|
-
if (t && !(
|
|
2881
|
+
const Zt = new qo(), Jo = ["cross-platform", "platform"];
|
|
2882
|
+
function Qt(t) {
|
|
2883
|
+
if (t && !(Jo.indexOf(t) < 0))
|
|
2884
2884
|
return t;
|
|
2885
2885
|
}
|
|
2886
|
-
async function
|
|
2886
|
+
async function Zo(t) {
|
|
2887
2887
|
!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 });
|
|
2888
2888
|
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2889
|
-
if (!
|
|
2889
|
+
if (!at())
|
|
2890
2890
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2891
2891
|
const r = {
|
|
2892
2892
|
...e,
|
|
2893
|
-
challenge:
|
|
2893
|
+
challenge: Pe(e.challenge),
|
|
2894
2894
|
user: {
|
|
2895
2895
|
...e.user,
|
|
2896
|
-
id:
|
|
2896
|
+
id: Pe(e.user.id)
|
|
2897
2897
|
},
|
|
2898
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2898
|
+
excludeCredentials: e.excludeCredentials?.map(qt)
|
|
2899
2899
|
}, o = {};
|
|
2900
|
-
n && (o.mediation = "conditional"), o.publicKey = r, o.signal =
|
|
2900
|
+
n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Zt.createNewAbortSignal();
|
|
2901
2901
|
let s;
|
|
2902
2902
|
try {
|
|
2903
2903
|
s = await navigator.credentials.create(o);
|
|
2904
|
-
} catch (
|
|
2905
|
-
throw
|
|
2904
|
+
} catch (d) {
|
|
2905
|
+
throw Ho({ error: d, options: o });
|
|
2906
2906
|
}
|
|
2907
2907
|
if (!s)
|
|
2908
2908
|
throw new Error("Registration was not completed");
|
|
2909
|
-
const { id: i, rawId: a, response: l, type:
|
|
2910
|
-
let h;
|
|
2911
|
-
typeof l.getTransports == "function" && (h = l.getTransports());
|
|
2909
|
+
const { id: i, rawId: a, response: l, type: f } = s;
|
|
2912
2910
|
let p;
|
|
2911
|
+
typeof l.getTransports == "function" && (p = l.getTransports());
|
|
2912
|
+
let y;
|
|
2913
2913
|
if (typeof l.getPublicKeyAlgorithm == "function")
|
|
2914
2914
|
try {
|
|
2915
|
-
|
|
2916
|
-
} catch (
|
|
2917
|
-
|
|
2915
|
+
y = l.getPublicKeyAlgorithm();
|
|
2916
|
+
} catch (d) {
|
|
2917
|
+
Ye("getPublicKeyAlgorithm()", d);
|
|
2918
2918
|
}
|
|
2919
|
-
let
|
|
2919
|
+
let u;
|
|
2920
2920
|
if (typeof l.getPublicKey == "function")
|
|
2921
2921
|
try {
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2924
|
-
} catch (
|
|
2925
|
-
|
|
2922
|
+
const d = l.getPublicKey();
|
|
2923
|
+
d !== null && (u = z(d));
|
|
2924
|
+
} catch (d) {
|
|
2925
|
+
Ye("getPublicKey()", d);
|
|
2926
2926
|
}
|
|
2927
2927
|
let c;
|
|
2928
2928
|
if (typeof l.getAuthenticatorData == "function")
|
|
2929
2929
|
try {
|
|
2930
|
-
c =
|
|
2931
|
-
} catch (
|
|
2932
|
-
|
|
2930
|
+
c = z(l.getAuthenticatorData());
|
|
2931
|
+
} catch (d) {
|
|
2932
|
+
Ye("getAuthenticatorData()", d);
|
|
2933
2933
|
}
|
|
2934
2934
|
return {
|
|
2935
2935
|
id: i,
|
|
2936
|
-
rawId:
|
|
2936
|
+
rawId: z(a),
|
|
2937
2937
|
response: {
|
|
2938
|
-
attestationObject:
|
|
2939
|
-
clientDataJSON:
|
|
2940
|
-
transports:
|
|
2941
|
-
publicKeyAlgorithm:
|
|
2942
|
-
publicKey:
|
|
2938
|
+
attestationObject: z(l.attestationObject),
|
|
2939
|
+
clientDataJSON: z(l.clientDataJSON),
|
|
2940
|
+
transports: p,
|
|
2941
|
+
publicKeyAlgorithm: y,
|
|
2942
|
+
publicKey: u,
|
|
2943
2943
|
authenticatorData: c
|
|
2944
2944
|
},
|
|
2945
|
-
type:
|
|
2945
|
+
type: f,
|
|
2946
2946
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2947
|
-
authenticatorAttachment:
|
|
2947
|
+
authenticatorAttachment: Qt(s.authenticatorAttachment)
|
|
2948
2948
|
};
|
|
2949
2949
|
}
|
|
2950
|
-
function
|
|
2950
|
+
function Ye(t, e) {
|
|
2951
2951
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2952
2952
|
`, e);
|
|
2953
2953
|
}
|
|
2954
|
-
function
|
|
2955
|
-
if (!
|
|
2956
|
-
return
|
|
2954
|
+
function Qo() {
|
|
2955
|
+
if (!at())
|
|
2956
|
+
return ze.stubThis(new Promise((e) => e(!1)));
|
|
2957
2957
|
const t = globalThis.PublicKeyCredential;
|
|
2958
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2958
|
+
return t?.isConditionalMediationAvailable === void 0 ? ze.stubThis(new Promise((e) => e(!1))) : ze.stubThis(t.isConditionalMediationAvailable());
|
|
2959
2959
|
}
|
|
2960
|
-
const
|
|
2960
|
+
const ze = {
|
|
2961
2961
|
stubThis: (t) => t
|
|
2962
2962
|
};
|
|
2963
|
-
function
|
|
2963
|
+
function es({ error: t, options: e }) {
|
|
2964
2964
|
const { publicKey: n } = e;
|
|
2965
2965
|
if (!n)
|
|
2966
2966
|
throw Error("options was missing required publicKey property");
|
|
@@ -2980,7 +2980,7 @@ function Yo({ error: t, options: e }) {
|
|
|
2980
2980
|
});
|
|
2981
2981
|
if (t.name === "SecurityError") {
|
|
2982
2982
|
const r = globalThis.location.hostname;
|
|
2983
|
-
if (
|
|
2983
|
+
if (Jt(r)) {
|
|
2984
2984
|
if (n.rpId !== r)
|
|
2985
2985
|
return new j({
|
|
2986
2986
|
message: `The RP ID "${n.rpId}" is invalid for this domain`,
|
|
@@ -3001,91 +3001,91 @@ function Yo({ error: t, options: e }) {
|
|
|
3001
3001
|
}
|
|
3002
3002
|
return t;
|
|
3003
3003
|
}
|
|
3004
|
-
async function
|
|
3004
|
+
async function ts(t) {
|
|
3005
3005
|
!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 });
|
|
3006
3006
|
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
3007
|
-
if (!
|
|
3007
|
+
if (!at())
|
|
3008
3008
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3009
3009
|
let o;
|
|
3010
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
3010
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(qt));
|
|
3011
3011
|
const s = {
|
|
3012
3012
|
...e,
|
|
3013
|
-
challenge:
|
|
3013
|
+
challenge: Pe(e.challenge),
|
|
3014
3014
|
allowCredentials: o
|
|
3015
3015
|
}, i = {};
|
|
3016
3016
|
if (n) {
|
|
3017
|
-
if (!await
|
|
3017
|
+
if (!await Qo())
|
|
3018
3018
|
throw Error("Browser does not support WebAuthn autofill");
|
|
3019
3019
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
3020
3020
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
3021
3021
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
3022
3022
|
}
|
|
3023
|
-
i.publicKey = s, i.signal =
|
|
3023
|
+
i.publicKey = s, i.signal = Zt.createNewAbortSignal();
|
|
3024
3024
|
let a;
|
|
3025
3025
|
try {
|
|
3026
3026
|
a = await navigator.credentials.get(i);
|
|
3027
3027
|
} catch (c) {
|
|
3028
|
-
throw
|
|
3028
|
+
throw es({ error: c, options: i });
|
|
3029
3029
|
}
|
|
3030
3030
|
if (!a)
|
|
3031
3031
|
throw new Error("Authentication was not completed");
|
|
3032
|
-
const { id: l, rawId:
|
|
3033
|
-
let
|
|
3034
|
-
return
|
|
3032
|
+
const { id: l, rawId: f, response: p, type: y } = a;
|
|
3033
|
+
let u;
|
|
3034
|
+
return p.userHandle && (u = z(p.userHandle)), {
|
|
3035
3035
|
id: l,
|
|
3036
|
-
rawId:
|
|
3036
|
+
rawId: z(f),
|
|
3037
3037
|
response: {
|
|
3038
|
-
authenticatorData:
|
|
3039
|
-
clientDataJSON:
|
|
3040
|
-
signature:
|
|
3041
|
-
userHandle:
|
|
3038
|
+
authenticatorData: z(p.authenticatorData),
|
|
3039
|
+
clientDataJSON: z(p.clientDataJSON),
|
|
3040
|
+
signature: z(p.signature),
|
|
3041
|
+
userHandle: u
|
|
3042
3042
|
},
|
|
3043
|
-
type:
|
|
3043
|
+
type: y,
|
|
3044
3044
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
3045
|
-
authenticatorAttachment:
|
|
3045
|
+
authenticatorAttachment: Qt(a.authenticatorAttachment)
|
|
3046
3046
|
};
|
|
3047
3047
|
}
|
|
3048
|
-
const
|
|
3049
|
-
function
|
|
3050
|
-
const [n, r] =
|
|
3048
|
+
const ct = Pt(null);
|
|
3049
|
+
function Vs({ children: t, config: e }) {
|
|
3050
|
+
const [n, r] = x({
|
|
3051
3051
|
isAuthenticated: !1,
|
|
3052
3052
|
isLoading: !0,
|
|
3053
3053
|
user: null,
|
|
3054
3054
|
error: null
|
|
3055
3055
|
});
|
|
3056
|
-
|
|
3056
|
+
C(() => {
|
|
3057
3057
|
(() => {
|
|
3058
|
-
const
|
|
3059
|
-
if (
|
|
3060
|
-
|
|
3058
|
+
const u = Vo();
|
|
3059
|
+
if (u) {
|
|
3060
|
+
Ot(), r({
|
|
3061
3061
|
isAuthenticated: !1,
|
|
3062
3062
|
isLoading: !1,
|
|
3063
3063
|
user: null,
|
|
3064
|
-
error:
|
|
3064
|
+
error: u
|
|
3065
3065
|
});
|
|
3066
3066
|
return;
|
|
3067
3067
|
}
|
|
3068
|
-
const c =
|
|
3068
|
+
const c = Fo();
|
|
3069
3069
|
if (c) {
|
|
3070
|
-
const
|
|
3070
|
+
const m = {
|
|
3071
3071
|
token: c.token,
|
|
3072
3072
|
provider: c.provider,
|
|
3073
3073
|
authenticatedAt: Date.now()
|
|
3074
3074
|
};
|
|
3075
|
-
|
|
3075
|
+
Ee(m), Ot(), r({
|
|
3076
3076
|
isAuthenticated: !0,
|
|
3077
3077
|
isLoading: !1,
|
|
3078
|
-
user:
|
|
3078
|
+
user: ae(m),
|
|
3079
3079
|
error: null
|
|
3080
3080
|
});
|
|
3081
3081
|
return;
|
|
3082
3082
|
}
|
|
3083
|
-
const
|
|
3084
|
-
if (
|
|
3083
|
+
const d = zt();
|
|
3084
|
+
if (d) {
|
|
3085
3085
|
r({
|
|
3086
3086
|
isAuthenticated: !0,
|
|
3087
3087
|
isLoading: !1,
|
|
3088
|
-
user:
|
|
3088
|
+
user: ae(d),
|
|
3089
3089
|
error: null
|
|
3090
3090
|
});
|
|
3091
3091
|
return;
|
|
@@ -3099,7 +3099,7 @@ function Ls({ children: t, config: e }) {
|
|
|
3099
3099
|
})();
|
|
3100
3100
|
}, []);
|
|
3101
3101
|
const o = D(
|
|
3102
|
-
async (
|
|
3102
|
+
async (y) => {
|
|
3103
3103
|
if (!e.spaceId) {
|
|
3104
3104
|
r((c) => ({
|
|
3105
3105
|
...c,
|
|
@@ -3107,136 +3107,136 @@ function Ls({ children: t, config: e }) {
|
|
|
3107
3107
|
}));
|
|
3108
3108
|
return;
|
|
3109
3109
|
}
|
|
3110
|
-
const
|
|
3111
|
-
if (
|
|
3110
|
+
const u = await Se(e.authUrl);
|
|
3111
|
+
if (y === "guest") {
|
|
3112
3112
|
r((c) => ({ ...c, isLoading: !0 }));
|
|
3113
3113
|
try {
|
|
3114
|
-
const c = await
|
|
3114
|
+
const c = await Ht(e.spaceId, u);
|
|
3115
3115
|
r({
|
|
3116
3116
|
isAuthenticated: !0,
|
|
3117
3117
|
isLoading: !1,
|
|
3118
|
-
user:
|
|
3118
|
+
user: ae(c),
|
|
3119
3119
|
error: null
|
|
3120
3120
|
});
|
|
3121
3121
|
} catch (c) {
|
|
3122
|
-
r((
|
|
3123
|
-
...
|
|
3122
|
+
r((d) => ({
|
|
3123
|
+
...d,
|
|
3124
3124
|
isLoading: !1,
|
|
3125
3125
|
error: c instanceof Error ? c.message : "Guest login failed"
|
|
3126
3126
|
}));
|
|
3127
3127
|
}
|
|
3128
3128
|
return;
|
|
3129
3129
|
}
|
|
3130
|
-
if (
|
|
3130
|
+
if (y === "passkey") {
|
|
3131
3131
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3132
3132
|
try {
|
|
3133
|
-
const c = await
|
|
3133
|
+
const c = await Yo(u), d = await ts({ optionsJSON: c }), m = await zo(u, d);
|
|
3134
3134
|
r({
|
|
3135
3135
|
isAuthenticated: !0,
|
|
3136
3136
|
isLoading: !1,
|
|
3137
|
-
user:
|
|
3137
|
+
user: ae(m),
|
|
3138
3138
|
error: null
|
|
3139
3139
|
});
|
|
3140
3140
|
} catch (c) {
|
|
3141
|
-
r((
|
|
3142
|
-
...
|
|
3141
|
+
r((d) => ({
|
|
3142
|
+
...d,
|
|
3143
3143
|
isLoading: !1,
|
|
3144
3144
|
error: c instanceof Error ? c.message : "Passkey login failed"
|
|
3145
3145
|
}));
|
|
3146
3146
|
}
|
|
3147
3147
|
return;
|
|
3148
3148
|
}
|
|
3149
|
-
if (
|
|
3149
|
+
if (y === "email")
|
|
3150
3150
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3151
|
-
window.location.href =
|
|
3151
|
+
window.location.href = Wo(y, e.spaceId, u);
|
|
3152
3152
|
},
|
|
3153
3153
|
[e.authUrl, e.spaceId]
|
|
3154
3154
|
), s = D(
|
|
3155
|
-
async (
|
|
3155
|
+
async (y) => {
|
|
3156
3156
|
if (!e.spaceId)
|
|
3157
3157
|
throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3158
|
-
const
|
|
3159
|
-
await
|
|
3158
|
+
const u = await Se(e.authUrl);
|
|
3159
|
+
await $o({ email: y, spaceId: e.spaceId, authUrl: u });
|
|
3160
3160
|
},
|
|
3161
3161
|
[e.authUrl, e.spaceId]
|
|
3162
3162
|
), i = D(
|
|
3163
|
-
async (
|
|
3163
|
+
async (y, u) => {
|
|
3164
3164
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3165
3165
|
try {
|
|
3166
|
-
const c = await
|
|
3166
|
+
const c = await Se(e.authUrl), d = await Bo({ email: y, code: u, authUrl: c });
|
|
3167
3167
|
r({
|
|
3168
3168
|
isAuthenticated: !0,
|
|
3169
3169
|
isLoading: !1,
|
|
3170
|
-
user:
|
|
3170
|
+
user: ae(d),
|
|
3171
3171
|
error: null
|
|
3172
3172
|
});
|
|
3173
3173
|
} catch (c) {
|
|
3174
|
-
const
|
|
3175
|
-
throw r((
|
|
3174
|
+
const d = c instanceof Error ? c.message : "Code verification failed";
|
|
3175
|
+
throw r((m) => ({ ...m, isLoading: !1, error: d })), c;
|
|
3176
3176
|
}
|
|
3177
3177
|
},
|
|
3178
3178
|
[e.authUrl]
|
|
3179
3179
|
), a = D(() => {
|
|
3180
|
-
|
|
3180
|
+
xe(), r({
|
|
3181
3181
|
isAuthenticated: !1,
|
|
3182
3182
|
isLoading: !1,
|
|
3183
3183
|
user: null,
|
|
3184
3184
|
error: null
|
|
3185
3185
|
});
|
|
3186
3186
|
}, []), l = D(
|
|
3187
|
-
async (
|
|
3188
|
-
const
|
|
3187
|
+
async (y) => {
|
|
3188
|
+
const u = await Se(e.authUrl);
|
|
3189
3189
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3190
3190
|
try {
|
|
3191
|
-
const c = await
|
|
3191
|
+
const c = await Ko(u), d = await Zo({ optionsJSON: c }), m = await Go(u, d, y);
|
|
3192
3192
|
r({
|
|
3193
3193
|
isAuthenticated: !0,
|
|
3194
3194
|
isLoading: !1,
|
|
3195
|
-
user:
|
|
3195
|
+
user: ae(m),
|
|
3196
3196
|
error: null
|
|
3197
3197
|
});
|
|
3198
3198
|
} catch (c) {
|
|
3199
|
-
r((
|
|
3200
|
-
...
|
|
3199
|
+
r((d) => ({
|
|
3200
|
+
...d,
|
|
3201
3201
|
isLoading: !1,
|
|
3202
3202
|
error: c instanceof Error ? c.message : "Passkey registration failed"
|
|
3203
3203
|
}));
|
|
3204
3204
|
}
|
|
3205
3205
|
},
|
|
3206
3206
|
[e.authUrl]
|
|
3207
|
-
),
|
|
3207
|
+
), f = D(() => n.user?.token ?? null, [n.user]), p = W(
|
|
3208
3208
|
() => ({
|
|
3209
3209
|
state: n,
|
|
3210
3210
|
login: o,
|
|
3211
3211
|
logout: a,
|
|
3212
|
-
getToken:
|
|
3212
|
+
getToken: f,
|
|
3213
3213
|
registerPasskey: l,
|
|
3214
3214
|
requestEmailCode: s,
|
|
3215
3215
|
submitEmailCode: i
|
|
3216
3216
|
}),
|
|
3217
|
-
[n, o, a,
|
|
3217
|
+
[n, o, a, f, l, s, i]
|
|
3218
3218
|
);
|
|
3219
|
-
return /* @__PURE__ */ S.jsx(
|
|
3219
|
+
return /* @__PURE__ */ S.jsx(ct, { value: p, children: t });
|
|
3220
3220
|
}
|
|
3221
|
-
function
|
|
3222
|
-
const t =
|
|
3221
|
+
function ns() {
|
|
3222
|
+
const t = rt(ct);
|
|
3223
3223
|
if (!t)
|
|
3224
3224
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3225
3225
|
return t;
|
|
3226
3226
|
}
|
|
3227
|
-
function
|
|
3228
|
-
return
|
|
3227
|
+
function rs() {
|
|
3228
|
+
return rt(ct);
|
|
3229
3229
|
}
|
|
3230
|
-
function
|
|
3231
|
-
const { config: e, guestUrlParam: n } = t, { state: r, login: o } =
|
|
3232
|
-
return
|
|
3230
|
+
function Ws(t) {
|
|
3231
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = ns(), s = v(!1);
|
|
3232
|
+
return C(() => {
|
|
3233
3233
|
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
3234
3234
|
return;
|
|
3235
3235
|
const i = new URLSearchParams(window.location.search), a = i.get(n);
|
|
3236
3236
|
if (a === "true" || a === "1" || a === "") {
|
|
3237
3237
|
i.delete(n);
|
|
3238
|
-
const l = i.toString(),
|
|
3239
|
-
window.history.replaceState({}, "",
|
|
3238
|
+
const l = i.toString(), f = window.location.pathname + (l ? `?${l}` : "");
|
|
3239
|
+
window.history.replaceState({}, "", f), s.current = !0, o("guest");
|
|
3240
3240
|
}
|
|
3241
3241
|
}, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
|
|
3242
3242
|
shouldRenderChildren: r.isAuthenticated,
|
|
@@ -3245,17 +3245,17 @@ function Ms(t) {
|
|
|
3245
3245
|
error: r.error
|
|
3246
3246
|
};
|
|
3247
3247
|
}
|
|
3248
|
-
const
|
|
3248
|
+
const en = (() => {
|
|
3249
3249
|
try {
|
|
3250
|
-
return
|
|
3250
|
+
return En();
|
|
3251
3251
|
} catch {
|
|
3252
3252
|
return !1;
|
|
3253
3253
|
}
|
|
3254
|
-
})(),
|
|
3255
|
-
function
|
|
3256
|
-
|
|
3254
|
+
})(), tn = Date.now(), oe = [], os = 300;
|
|
3255
|
+
function Ce(t) {
|
|
3256
|
+
oe.push(`[+${((Date.now() - tn) / 1e3).toFixed(1)}s] ${t}`), oe.length > os && oe.shift();
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function Nt(t) {
|
|
3259
3259
|
if (typeof t == "string")
|
|
3260
3260
|
return t;
|
|
3261
3261
|
if (t instanceof Error)
|
|
@@ -3266,30 +3266,30 @@ function Tt(t) {
|
|
|
3266
3266
|
return String(t);
|
|
3267
3267
|
}
|
|
3268
3268
|
}
|
|
3269
|
-
let
|
|
3270
|
-
function
|
|
3271
|
-
if (
|
|
3269
|
+
let xt = !1;
|
|
3270
|
+
function nn() {
|
|
3271
|
+
if (xt || typeof window > "u")
|
|
3272
3272
|
return;
|
|
3273
|
-
|
|
3273
|
+
xt = !0, window.addEventListener("error", (e) => Ce(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Ce(`unhandledRejection: ${Nt(e.reason)}`));
|
|
3274
3274
|
const t = console;
|
|
3275
3275
|
for (const e of ["error", "warn", "log", "info"]) {
|
|
3276
3276
|
const n = t[e]?.bind(console) ?? (() => {
|
|
3277
3277
|
});
|
|
3278
3278
|
t[e] = (...r) => {
|
|
3279
3279
|
try {
|
|
3280
|
-
|
|
3280
|
+
Ce(`console.${e}: ${r.map(Nt).join(" ")}`);
|
|
3281
3281
|
} catch {
|
|
3282
3282
|
}
|
|
3283
3283
|
n(...r);
|
|
3284
3284
|
};
|
|
3285
3285
|
}
|
|
3286
3286
|
try {
|
|
3287
|
-
|
|
3287
|
+
Mt((e) => Ce(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: Xe.DEBUG });
|
|
3288
3288
|
} catch {
|
|
3289
3289
|
}
|
|
3290
3290
|
}
|
|
3291
|
-
|
|
3292
|
-
function
|
|
3291
|
+
en && nn();
|
|
3292
|
+
function ss() {
|
|
3293
3293
|
let t = !1;
|
|
3294
3294
|
try {
|
|
3295
3295
|
const e = URL.createObjectURL(new Blob([""]));
|
|
@@ -3300,11 +3300,11 @@ function Jo() {
|
|
|
3300
3300
|
}
|
|
3301
3301
|
return t;
|
|
3302
3302
|
}
|
|
3303
|
-
function
|
|
3303
|
+
function is() {
|
|
3304
3304
|
const t = globalThis;
|
|
3305
3305
|
return [
|
|
3306
3306
|
`Worker=${typeof Worker < "u"}`,
|
|
3307
|
-
`moduleWorker=${
|
|
3307
|
+
`moduleWorker=${ss()}`,
|
|
3308
3308
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3309
3309
|
`WebTransport=${typeof t.WebTransport < "u"}`,
|
|
3310
3310
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3317,15 +3317,15 @@ function Zo() {
|
|
|
3317
3317
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3318
3318
|
].join(" ");
|
|
3319
3319
|
}
|
|
3320
|
-
function
|
|
3320
|
+
function as(t) {
|
|
3321
3321
|
return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
|
|
3322
3322
|
}
|
|
3323
|
-
function
|
|
3324
|
-
const n =
|
|
3325
|
-
if (
|
|
3323
|
+
function rn({ state: t = "", forceVisible: e = !1 }) {
|
|
3324
|
+
const n = en || e, r = t === "connected" || t === "reconnecting", [, o] = yn((l) => l + 1, 0), [s, i] = x(!0);
|
|
3325
|
+
if (C(() => {
|
|
3326
3326
|
if (!n)
|
|
3327
3327
|
return;
|
|
3328
|
-
|
|
3328
|
+
nn();
|
|
3329
3329
|
const l = setInterval(o, 1e3);
|
|
3330
3330
|
return () => clearInterval(l);
|
|
3331
3331
|
}, [n]), !n)
|
|
@@ -3339,7 +3339,7 @@ function Jt({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3339
3339
|
style: { position: "fixed", bottom: 8, left: 8, zIndex: 2147483647, background: "#000", color: "#0f0", font: "13px monospace", padding: "6px 10px", border: "1px solid #0f0", borderRadius: 6 },
|
|
3340
3340
|
children: [
|
|
3341
3341
|
"🐞 debug (",
|
|
3342
|
-
|
|
3342
|
+
oe.length,
|
|
3343
3343
|
")"
|
|
3344
3344
|
]
|
|
3345
3345
|
}
|
|
@@ -3350,20 +3350,20 @@ function Jt({ state: t = "", forceVisible: e = !1 }) {
|
|
|
3350
3350
|
"Ikon debug overlay — state: ",
|
|
3351
3351
|
t || "?",
|
|
3352
3352
|
", +",
|
|
3353
|
-
Math.round((Date.now() -
|
|
3353
|
+
Math.round((Date.now() - tn) / 1e3),
|
|
3354
3354
|
"s, ",
|
|
3355
|
-
|
|
3355
|
+
oe.length,
|
|
3356
3356
|
" entries",
|
|
3357
3357
|
r && /* @__PURE__ */ S.jsx("button", { type: "button", onClick: () => i(!0), style: { marginLeft: 12, font: "12px monospace", background: "#0f0", color: "#000", border: "none", borderRadius: 4, padding: "2px 8px" }, children: "hide" })
|
|
3358
3358
|
] }),
|
|
3359
3359
|
/* @__PURE__ */ S.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
|
|
3360
3360
|
/* @__PURE__ */ S.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
|
|
3361
|
-
/* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children:
|
|
3361
|
+
/* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: is() }),
|
|
3362
3362
|
/* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
|
|
3363
|
-
/* @__PURE__ */ S.jsx("div", { children:
|
|
3363
|
+
/* @__PURE__ */ S.jsx("div", { children: oe.length === 0 ? "(nothing captured yet)" : oe.map((l, f) => /* @__PURE__ */ S.jsx("div", { style: { color: as(l), wordBreak: "break-all" }, children: l }, f)) })
|
|
3364
3364
|
] });
|
|
3365
3365
|
}
|
|
3366
|
-
function
|
|
3366
|
+
function Ks({
|
|
3367
3367
|
connectionState: t,
|
|
3368
3368
|
error: e,
|
|
3369
3369
|
isReady: n,
|
|
@@ -3375,34 +3375,34 @@ function Us({
|
|
|
3375
3375
|
// renderIdle prop is intentionally accepted but never invoked — the runtime no longer
|
|
3376
3376
|
// emits the deprecated 'idle' state. Kept on the props for source compatibility.
|
|
3377
3377
|
renderIdle: l,
|
|
3378
|
-
renderConnecting:
|
|
3379
|
-
renderConnectingSlow:
|
|
3380
|
-
renderConnected:
|
|
3381
|
-
renderOffline:
|
|
3378
|
+
renderConnecting: f,
|
|
3379
|
+
renderConnectingSlow: p,
|
|
3380
|
+
renderConnected: y,
|
|
3381
|
+
renderOffline: u,
|
|
3382
3382
|
renderError: c
|
|
3383
3383
|
}) {
|
|
3384
|
-
const
|
|
3384
|
+
const d = v(!1), m = (() => {
|
|
3385
3385
|
switch (t) {
|
|
3386
3386
|
case "waitingForExternalConnectUrl":
|
|
3387
3387
|
case "connecting":
|
|
3388
|
-
return r ?
|
|
3388
|
+
return r ? p() : f();
|
|
3389
3389
|
case "connected":
|
|
3390
3390
|
case "reconnecting": {
|
|
3391
3391
|
if (!n || !o || !s) return null;
|
|
3392
|
-
t === "reconnecting" && (
|
|
3392
|
+
t === "reconnecting" && (d.current = !0);
|
|
3393
3393
|
const g = o.size > 0;
|
|
3394
|
-
return g && (
|
|
3394
|
+
return g && (d.current = !1), y({
|
|
3395
3395
|
stores: o,
|
|
3396
3396
|
registry: s,
|
|
3397
3397
|
client: i,
|
|
3398
3398
|
onAction: a,
|
|
3399
|
-
isReconnecting: t === "reconnecting" ||
|
|
3399
|
+
isReconnecting: t === "reconnecting" || d.current && !g
|
|
3400
3400
|
});
|
|
3401
3401
|
}
|
|
3402
3402
|
case "offline": {
|
|
3403
|
-
|
|
3403
|
+
d.current = !1;
|
|
3404
3404
|
const g = e ?? i?.lastError?.message ?? null;
|
|
3405
|
-
return g ? c(g) :
|
|
3405
|
+
return g ? c(g) : u();
|
|
3406
3406
|
}
|
|
3407
3407
|
// 'idle' / 'connectingSlow' / 'offlineError' remain in the type union for back-compat
|
|
3408
3408
|
// string-equality checks in caller code but are no longer emitted — no case needed.
|
|
@@ -3411,163 +3411,165 @@ function Us({
|
|
|
3411
3411
|
}
|
|
3412
3412
|
})();
|
|
3413
3413
|
return /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
|
|
3414
|
-
|
|
3415
|
-
/* @__PURE__ */ S.jsx(
|
|
3414
|
+
m,
|
|
3415
|
+
/* @__PURE__ */ S.jsx(rn, { state: t })
|
|
3416
3416
|
] });
|
|
3417
3417
|
}
|
|
3418
|
-
const
|
|
3419
|
-
function
|
|
3418
|
+
const _e = se("useIkonApp");
|
|
3419
|
+
function cs() {
|
|
3420
3420
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3421
3421
|
return window.__IKON_AUTH_CONFIG__;
|
|
3422
3422
|
}
|
|
3423
|
-
function
|
|
3423
|
+
function ls() {
|
|
3424
3424
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3425
3425
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3426
3426
|
}
|
|
3427
|
-
function
|
|
3428
|
-
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport:
|
|
3429
|
-
|
|
3430
|
-
const [
|
|
3427
|
+
function Gs(t) {
|
|
3428
|
+
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: f, proxy: p, uiCache: y } = t, u = e === void 0 ? cs() ?? null : e, c = ls(), d = rs(), m = v(null), g = v(null), b = v(null), w = v(!1), R = v(!1), E = v(o), T = v(r), M = v(s), J = v(i), Q = v(a), X = v(l), _ = v(f), L = v(p), U = v(y), F = v("local"), B = v(void 0);
|
|
3429
|
+
E.current = o, T.current = r, M.current = s, J.current = i, Q.current = a, X.current = l, _.current = f, L.current = p, U.current = y;
|
|
3430
|
+
const [$, K] = x("connecting"), [ve, de] = x(!1), [Re, fe] = x(null), [h, A] = x(null), [N, P] = x(!1), [ee, he] = x(null), [O, Z] = x(null), te = v(!1), [Me, sn] = x(0), G = W(() => {
|
|
3431
3431
|
try {
|
|
3432
|
-
const
|
|
3433
|
-
return (
|
|
3432
|
+
const I = vn();
|
|
3433
|
+
return (I.sessionId || I.channelKey) && Rn(), I;
|
|
3434
3434
|
} catch {
|
|
3435
3435
|
return { parameters: {} };
|
|
3436
3436
|
}
|
|
3437
|
-
}, [])
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3437
|
+
}, []);
|
|
3438
|
+
pn();
|
|
3439
|
+
const ne = W(() => u?.enabled ? zt() : null, [u?.enabled, Me]), Ue = c?.enabled ?? !1, je = c?.host ?? "localhost", De = c?.port ?? 8443;
|
|
3440
|
+
!Ue && lt() && u && !u.enabled && u.spaceId && !O && !te.current && (te.current = !0, Se(u.authUrl).then((I) => Ht(u.spaceId, I)).then((I) => {
|
|
3441
|
+
Z(I.token);
|
|
3442
|
+
}).catch((I) => {
|
|
3443
|
+
_e.error("Anonymous auth failed:", I), fe(I instanceof Error ? I.message : "Anonymous auth failed"), te.current = !1;
|
|
3442
3444
|
}));
|
|
3443
|
-
const
|
|
3444
|
-
if (
|
|
3445
|
-
const
|
|
3445
|
+
const $e = W(() => {
|
|
3446
|
+
if (Ue) {
|
|
3447
|
+
const I = ne?.token ? ut(ne.token) ?? void 0 : void 0;
|
|
3446
3448
|
return {
|
|
3447
3449
|
local: {
|
|
3448
|
-
host:
|
|
3449
|
-
httpsPort:
|
|
3450
|
-
userId:
|
|
3451
|
-
token:
|
|
3452
|
-
spaceId:
|
|
3453
|
-
backendUrl:
|
|
3454
|
-
authUrl:
|
|
3455
|
-
parameters:
|
|
3450
|
+
host: je,
|
|
3451
|
+
httpsPort: De,
|
|
3452
|
+
userId: I,
|
|
3453
|
+
token: ne?.token ?? void 0,
|
|
3454
|
+
spaceId: u?.spaceId,
|
|
3455
|
+
backendUrl: u?.backendUrl,
|
|
3456
|
+
authUrl: u?.authUrl,
|
|
3457
|
+
parameters: G.parameters
|
|
3456
3458
|
}
|
|
3457
3459
|
};
|
|
3458
3460
|
}
|
|
3459
|
-
return
|
|
3461
|
+
return ne?.token && u?.spaceId ? {
|
|
3460
3462
|
sessionToken: {
|
|
3461
|
-
token:
|
|
3462
|
-
spaceId:
|
|
3463
|
-
backendType:
|
|
3464
|
-
sessionId:
|
|
3465
|
-
channelKey:
|
|
3466
|
-
parameters:
|
|
3463
|
+
token: ne.token,
|
|
3464
|
+
spaceId: u.spaceId,
|
|
3465
|
+
backendType: dt(),
|
|
3466
|
+
sessionId: G.sessionId,
|
|
3467
|
+
channelKey: G.channelKey,
|
|
3468
|
+
parameters: G.parameters
|
|
3467
3469
|
}
|
|
3468
|
-
} :
|
|
3470
|
+
} : O && u?.spaceId ? {
|
|
3469
3471
|
sessionToken: {
|
|
3470
|
-
token:
|
|
3471
|
-
spaceId:
|
|
3472
|
-
backendType:
|
|
3473
|
-
sessionId:
|
|
3474
|
-
channelKey:
|
|
3475
|
-
parameters:
|
|
3472
|
+
token: O,
|
|
3473
|
+
spaceId: u.spaceId,
|
|
3474
|
+
backendType: dt(),
|
|
3475
|
+
sessionId: G.sessionId,
|
|
3476
|
+
channelKey: G.channelKey,
|
|
3477
|
+
parameters: G.parameters
|
|
3476
3478
|
}
|
|
3477
|
-
} :
|
|
3479
|
+
} : lt() ? null : {
|
|
3478
3480
|
local: {
|
|
3479
|
-
host:
|
|
3480
|
-
httpsPort:
|
|
3481
|
-
spaceId:
|
|
3482
|
-
backendUrl:
|
|
3483
|
-
authUrl:
|
|
3484
|
-
parameters:
|
|
3481
|
+
host: je,
|
|
3482
|
+
httpsPort: De,
|
|
3483
|
+
spaceId: u?.spaceId,
|
|
3484
|
+
backendUrl: u?.backendUrl,
|
|
3485
|
+
authUrl: u?.authUrl,
|
|
3486
|
+
parameters: G.parameters
|
|
3485
3487
|
}
|
|
3486
3488
|
};
|
|
3487
|
-
}, [
|
|
3488
|
-
|
|
3489
|
-
const
|
|
3490
|
-
|
|
3491
|
-
if (!
|
|
3492
|
-
if (
|
|
3493
|
-
for (const
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3489
|
+
}, [Ue, je, De, ne?.token, u?.spaceId, u?.backendUrl, u?.authUrl, O, G.sessionId, G.channelKey, G.parameters]);
|
|
3490
|
+
F.current = u?.spaceId ?? "local", B.current = ne?.token ?? O ?? void 0, Yr(ee);
|
|
3491
|
+
const an = Xr(ee);
|
|
3492
|
+
C(() => {
|
|
3493
|
+
if (!w.current) {
|
|
3494
|
+
if (w.current = !0, b.current = Dr(), n)
|
|
3495
|
+
for (const I of n)
|
|
3496
|
+
I(b.current);
|
|
3497
|
+
b.current.loadRegisteredModules().catch((I) => {
|
|
3498
|
+
_e.error("Failed to load UI modules", I);
|
|
3497
3499
|
});
|
|
3498
3500
|
}
|
|
3499
|
-
}, []),
|
|
3500
|
-
if (
|
|
3501
|
-
const
|
|
3502
|
-
|
|
3503
|
-
timeouts:
|
|
3504
|
-
audio:
|
|
3505
|
-
enabled:
|
|
3506
|
-
...
|
|
3501
|
+
}, []), C(() => {
|
|
3502
|
+
if (!$e) return;
|
|
3503
|
+
const I = new An({
|
|
3504
|
+
...$e,
|
|
3505
|
+
timeouts: T.current,
|
|
3506
|
+
audio: J.current !== void 0 || E.current ? {
|
|
3507
|
+
enabled: J.current,
|
|
3508
|
+
...E.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
3507
3509
|
} : void 0,
|
|
3508
3510
|
video: Q.current !== void 0 ? { enabled: Q.current } : void 0,
|
|
3509
3511
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3510
|
-
webRtc:
|
|
3511
|
-
websocket:
|
|
3512
|
-
webtransport:
|
|
3513
|
-
proxy:
|
|
3514
|
-
onConnectionStateChange: (
|
|
3515
|
-
|
|
3512
|
+
webRtc: M.current === !1 ? { enabled: !1 } : void 0,
|
|
3513
|
+
websocket: X.current,
|
|
3514
|
+
webtransport: _.current,
|
|
3515
|
+
proxy: L.current,
|
|
3516
|
+
onConnectionStateChange: (H) => {
|
|
3517
|
+
K(H);
|
|
3516
3518
|
},
|
|
3517
|
-
onError: (
|
|
3518
|
-
|
|
3519
|
+
onError: (H) => {
|
|
3520
|
+
fe(H.message);
|
|
3519
3521
|
}
|
|
3520
3522
|
});
|
|
3521
|
-
|
|
3522
|
-
const
|
|
3523
|
-
return
|
|
3524
|
-
if (
|
|
3525
|
-
|
|
3523
|
+
m.current = I;
|
|
3524
|
+
const re = U.current ?? !0, Ae = B.current, un = re ? { enabled: !0, appId: F.current, userId: Ae ? ut(Ae) ?? null : null } : void 0, Be = new Yn({ client: I, cache: un });
|
|
3525
|
+
return g.current = Be, he(Be), I.connect().catch((H) => {
|
|
3526
|
+
if (_e.error("Connection failed:", H), H instanceof Tn) {
|
|
3527
|
+
A(H.reason);
|
|
3526
3528
|
return;
|
|
3527
3529
|
}
|
|
3528
|
-
if (
|
|
3529
|
-
|
|
3530
|
+
if (H instanceof kn) {
|
|
3531
|
+
P(!0);
|
|
3530
3532
|
return;
|
|
3531
3533
|
}
|
|
3532
|
-
|
|
3534
|
+
H instanceof Cn && !R.current && (R.current = !0, _e.warn("Auth session appears stale, clearing and retrying"), d ? d.logout() : (xe(), sn((dn) => dn + 1)));
|
|
3533
3535
|
}), () => {
|
|
3534
|
-
|
|
3536
|
+
I.disconnect(), m.current = null, Be.dispose(), g.current = null;
|
|
3535
3537
|
};
|
|
3536
|
-
}, [
|
|
3537
|
-
const
|
|
3538
|
-
const
|
|
3539
|
-
|
|
3538
|
+
}, [$e]);
|
|
3539
|
+
const cn = D((I, re) => {
|
|
3540
|
+
const Ae = typeof re == "string" ? re : JSON.stringify(re ?? {});
|
|
3541
|
+
m.current?.sendActionCall(I, Ae);
|
|
3540
3542
|
}, []);
|
|
3541
|
-
|
|
3542
|
-
if (
|
|
3543
|
-
|
|
3543
|
+
C(() => {
|
|
3544
|
+
if ($ !== "connecting") {
|
|
3545
|
+
de(!1);
|
|
3544
3546
|
return;
|
|
3545
3547
|
}
|
|
3546
|
-
const
|
|
3547
|
-
return () => clearTimeout(
|
|
3548
|
-
}, [
|
|
3549
|
-
const
|
|
3548
|
+
const I = m.current?.slowConnectionThresholdMs ?? 5e3, re = setTimeout(() => de(!0), I);
|
|
3549
|
+
return () => clearTimeout(re);
|
|
3550
|
+
}, [$]);
|
|
3551
|
+
const ln = $ === "connected" || $ === "reconnecting";
|
|
3550
3552
|
return {
|
|
3551
|
-
connectionState:
|
|
3552
|
-
error:
|
|
3553
|
-
accessDeniedReason:
|
|
3554
|
-
isServerFull:
|
|
3555
|
-
stores:
|
|
3556
|
-
client:
|
|
3557
|
-
registry:
|
|
3558
|
-
clientRef:
|
|
3559
|
-
uiRef:
|
|
3560
|
-
registryRef:
|
|
3561
|
-
onAction:
|
|
3562
|
-
isReady:
|
|
3563
|
-
brandingRequired:
|
|
3564
|
-
isConnectingSlow:
|
|
3565
|
-
webRtcVideoStreams:
|
|
3566
|
-
webRtcTrackMap:
|
|
3553
|
+
connectionState: $,
|
|
3554
|
+
error: Re,
|
|
3555
|
+
accessDeniedReason: h,
|
|
3556
|
+
isServerFull: N,
|
|
3557
|
+
stores: an,
|
|
3558
|
+
client: m.current,
|
|
3559
|
+
registry: b.current,
|
|
3560
|
+
clientRef: m,
|
|
3561
|
+
uiRef: g,
|
|
3562
|
+
registryRef: b,
|
|
3563
|
+
onAction: cn,
|
|
3564
|
+
isReady: ln,
|
|
3565
|
+
brandingRequired: m.current?.brandingRequired ?? !1,
|
|
3566
|
+
isConnectingSlow: ve,
|
|
3567
|
+
webRtcVideoStreams: m.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3568
|
+
webRtcTrackMap: m.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3567
3569
|
};
|
|
3568
3570
|
}
|
|
3569
|
-
function
|
|
3570
|
-
const e =
|
|
3571
|
+
function Ys(t) {
|
|
3572
|
+
const e = v(!1);
|
|
3571
3573
|
return D(() => {
|
|
3572
3574
|
if (e.current) return;
|
|
3573
3575
|
e.current = !0;
|
|
@@ -3575,30 +3577,30 @@ function Ds(t) {
|
|
|
3575
3577
|
n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
3576
3578
|
}, [t]);
|
|
3577
3579
|
}
|
|
3578
|
-
let
|
|
3579
|
-
function
|
|
3580
|
-
const [n, r] =
|
|
3580
|
+
let us = 0;
|
|
3581
|
+
function ds(t = 5, e = 5e3) {
|
|
3582
|
+
const [n, r] = x([]), o = v(/* @__PURE__ */ new Map()), s = D((i) => {
|
|
3581
3583
|
const a = o.current.get(i);
|
|
3582
|
-
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((
|
|
3584
|
+
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((f) => f.id !== i));
|
|
3583
3585
|
}, []);
|
|
3584
|
-
return
|
|
3585
|
-
const i = o.current, a =
|
|
3586
|
+
return C(() => {
|
|
3587
|
+
const i = o.current, a = Mt(
|
|
3586
3588
|
(l) => {
|
|
3587
|
-
if (!
|
|
3589
|
+
if (!Ut())
|
|
3588
3590
|
return;
|
|
3589
|
-
const
|
|
3590
|
-
id:
|
|
3591
|
-
level:
|
|
3591
|
+
const f = `toast-${++us}`, p = l.level === Xe.ERROR ? "error" : "warn", y = {
|
|
3592
|
+
id: f,
|
|
3593
|
+
level: p,
|
|
3592
3594
|
message: l.message,
|
|
3593
3595
|
component: l.component
|
|
3594
3596
|
};
|
|
3595
|
-
r((c) => [...c,
|
|
3596
|
-
const
|
|
3597
|
-
s(
|
|
3597
|
+
r((c) => [...c, y].slice(-t));
|
|
3598
|
+
const u = setTimeout(() => {
|
|
3599
|
+
s(f);
|
|
3598
3600
|
}, e);
|
|
3599
|
-
i.set(
|
|
3601
|
+
i.set(f, u);
|
|
3600
3602
|
},
|
|
3601
|
-
{ minLevel:
|
|
3603
|
+
{ minLevel: Xe.WARN }
|
|
3602
3604
|
);
|
|
3603
3605
|
return () => {
|
|
3604
3606
|
a();
|
|
@@ -3608,9 +3610,9 @@ function rs(t = 5, e = 5e3) {
|
|
|
3608
3610
|
};
|
|
3609
3611
|
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3610
3612
|
}
|
|
3611
|
-
function
|
|
3612
|
-
const [r, o] =
|
|
3613
|
-
return
|
|
3613
|
+
function fs(t, e, n) {
|
|
3614
|
+
const [r, o] = x(n);
|
|
3615
|
+
return C(() => {
|
|
3614
3616
|
if (!t)
|
|
3615
3617
|
return;
|
|
3616
3618
|
let s = !0, i = null;
|
|
@@ -3625,9 +3627,9 @@ function os(t, e, n) {
|
|
|
3625
3627
|
};
|
|
3626
3628
|
}, [t, e]), r;
|
|
3627
3629
|
}
|
|
3628
|
-
function
|
|
3629
|
-
const [r, o] =
|
|
3630
|
-
return
|
|
3630
|
+
function zs(t, e, n) {
|
|
3631
|
+
const [r, o] = x(null);
|
|
3632
|
+
return C(() => {
|
|
3631
3633
|
if (!t)
|
|
3632
3634
|
return;
|
|
3633
3635
|
let s = !0;
|
|
@@ -3638,102 +3640,102 @@ function $s(t, e, n) {
|
|
|
3638
3640
|
}), () => {
|
|
3639
3641
|
s = !1;
|
|
3640
3642
|
};
|
|
3641
|
-
}, [t, e]),
|
|
3643
|
+
}, [t, e]), fs(r ? t : null, r ?? "", n);
|
|
3642
3644
|
}
|
|
3643
|
-
const
|
|
3645
|
+
const ce = se("IkonDebug"), hs = {
|
|
3644
3646
|
Digit1: "connecting",
|
|
3645
3647
|
Digit2: "connected",
|
|
3646
3648
|
Digit3: "reconnecting",
|
|
3647
3649
|
Digit4: "offline",
|
|
3648
3650
|
Digit5: "offline",
|
|
3649
3651
|
Digit0: "clear"
|
|
3650
|
-
},
|
|
3651
|
-
function
|
|
3652
|
-
const e =
|
|
3653
|
-
return
|
|
3652
|
+
}, ps = "Digit5", ms = "Digit6", gs = "Synthetic debug error (Ctrl+Shift+5)", ys = "Synthetic debug access-denied (Ctrl+Shift+6)", bs = 5e3;
|
|
3653
|
+
function ws(t) {
|
|
3654
|
+
const e = Ut(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l, f] = x(null), [p, y] = x(!1), [u, c] = x(!1), [d, m] = x(!1);
|
|
3655
|
+
return C(() => {
|
|
3654
3656
|
if (!e)
|
|
3655
3657
|
return;
|
|
3656
3658
|
const b = (w) => {
|
|
3657
3659
|
if (!w.ctrlKey || !w.shiftKey)
|
|
3658
3660
|
return;
|
|
3659
3661
|
if (w.code === "KeyE") {
|
|
3660
|
-
w.preventDefault(),
|
|
3662
|
+
w.preventDefault(), y((T) => (ce.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
|
|
3661
3663
|
return;
|
|
3662
3664
|
}
|
|
3663
3665
|
if (w.code === "Digit7") {
|
|
3664
|
-
w.preventDefault(), c((T) => (
|
|
3666
|
+
w.preventDefault(), c((T) => (ce.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
|
|
3665
3667
|
return;
|
|
3666
3668
|
}
|
|
3667
3669
|
if (w.code === "Digit8") {
|
|
3668
|
-
w.preventDefault(),
|
|
3670
|
+
w.preventDefault(), m((T) => (ce.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
|
|
3669
3671
|
return;
|
|
3670
3672
|
}
|
|
3671
|
-
if (w.code ===
|
|
3672
|
-
w.preventDefault(),
|
|
3673
|
+
if (w.code === ms) {
|
|
3674
|
+
w.preventDefault(), f(ys), r(null), a(null), ce.warn("Forced access denied");
|
|
3673
3675
|
return;
|
|
3674
3676
|
}
|
|
3675
|
-
const
|
|
3676
|
-
if (
|
|
3677
|
+
const R = hs[w.code];
|
|
3678
|
+
if (R === void 0)
|
|
3677
3679
|
return;
|
|
3678
|
-
if (w.preventDefault(),
|
|
3679
|
-
r(null), a(null),
|
|
3680
|
+
if (w.preventDefault(), R === "clear") {
|
|
3681
|
+
r(null), a(null), f(null), ce.warn("Cleared forced state");
|
|
3680
3682
|
return;
|
|
3681
3683
|
}
|
|
3682
|
-
const E = w.code ===
|
|
3683
|
-
r(
|
|
3684
|
+
const E = w.code === ps;
|
|
3685
|
+
r(R), a(E ? gs : null), f(null), ce.warn(`Forced state: ${R}${E ? " (with error)" : ""}`);
|
|
3684
3686
|
};
|
|
3685
3687
|
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3686
|
-
}, [e]),
|
|
3688
|
+
}, [e]), C(() => {
|
|
3687
3689
|
if (n !== "connecting") {
|
|
3688
3690
|
s(!1);
|
|
3689
3691
|
return;
|
|
3690
3692
|
}
|
|
3691
|
-
const b = setTimeout(() => s(!0),
|
|
3693
|
+
const b = setTimeout(() => s(!0), bs);
|
|
3692
3694
|
return () => clearTimeout(b);
|
|
3693
|
-
}, [n]), !e || n === null && !
|
|
3695
|
+
}, [n]), !e || n === null && !p && l === null && !u && !d ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
|
|
3694
3696
|
...t,
|
|
3695
3697
|
connectionState: n ?? t.connectionState,
|
|
3696
3698
|
isConnectingSlow: n === "connecting" ? o : t.isConnectingSlow,
|
|
3697
3699
|
error: n === "offline" && i ? i : n ? null : t.error,
|
|
3698
|
-
stores:
|
|
3700
|
+
stores: p ? /* @__PURE__ */ new Map() : t.stores,
|
|
3699
3701
|
accessDeniedReason: l ?? t.accessDeniedReason
|
|
3700
|
-
}, forcedState: n, emptyStores:
|
|
3702
|
+
}, forcedState: n, emptyStores: p, forcedError: i, forcedAccessDenied: l, forcedBranding: u, forcedDebugOverlay: d, debugEnabled: e };
|
|
3701
3703
|
}
|
|
3702
|
-
function
|
|
3704
|
+
function Ss(t, e) {
|
|
3703
3705
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3704
3706
|
}
|
|
3705
|
-
function
|
|
3707
|
+
function Es(t) {
|
|
3706
3708
|
return t === void 0 ? null : typeof t == "function" ? t() : t;
|
|
3707
3709
|
}
|
|
3708
|
-
function
|
|
3710
|
+
function vs(t, e) {
|
|
3709
3711
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3710
3712
|
}
|
|
3711
|
-
function
|
|
3713
|
+
function Rs(t, e) {
|
|
3712
3714
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3713
3715
|
}
|
|
3714
|
-
function
|
|
3715
|
-
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i =
|
|
3716
|
-
if (
|
|
3717
|
-
return
|
|
3718
|
-
const E =
|
|
3716
|
+
function Xs(t) {
|
|
3717
|
+
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = ws(s), { app: a } = i, { connectionState: l, isConnectingSlow: f, stores: p, registry: y, client: u, onAction: c, isReady: d, error: m, accessDeniedReason: g, brandingRequired: b } = a, w = b || i.forcedBranding, R = v(null);
|
|
3718
|
+
if (p && y && (d || p.size > 0) && (R.current = { stores: p, registry: y, client: u }), g)
|
|
3719
|
+
return Rs(o, g);
|
|
3720
|
+
const E = R.current;
|
|
3719
3721
|
let T = null;
|
|
3720
3722
|
switch (l) {
|
|
3721
3723
|
case "waitingForExternalConnectUrl":
|
|
3722
3724
|
case "connecting":
|
|
3723
|
-
T =
|
|
3725
|
+
T = Ss(e, f);
|
|
3724
3726
|
break;
|
|
3725
3727
|
case "reconnecting":
|
|
3726
|
-
T =
|
|
3728
|
+
T = Es(n);
|
|
3727
3729
|
break;
|
|
3728
3730
|
case "offline":
|
|
3729
|
-
T =
|
|
3731
|
+
T = vs(r, m);
|
|
3730
3732
|
break;
|
|
3731
3733
|
default:
|
|
3732
3734
|
T = null;
|
|
3733
3735
|
}
|
|
3734
3736
|
return /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
|
|
3735
3737
|
E && /* @__PURE__ */ S.jsx(
|
|
3736
|
-
|
|
3738
|
+
jt,
|
|
3737
3739
|
{
|
|
3738
3740
|
stores: E.stores,
|
|
3739
3741
|
registry: E.registry,
|
|
@@ -3742,18 +3744,18 @@ function Bs(t) {
|
|
|
3742
3744
|
}
|
|
3743
3745
|
),
|
|
3744
3746
|
T,
|
|
3745
|
-
w && /* @__PURE__ */ S.jsx(
|
|
3746
|
-
/* @__PURE__ */ S.jsx(
|
|
3747
|
-
/* @__PURE__ */ S.jsx(
|
|
3747
|
+
w && /* @__PURE__ */ S.jsx(Ts, {}),
|
|
3748
|
+
/* @__PURE__ */ S.jsx(ks, {}),
|
|
3749
|
+
/* @__PURE__ */ S.jsx(rn, { state: l, forceVisible: i.forcedDebugOverlay })
|
|
3748
3750
|
] });
|
|
3749
3751
|
}
|
|
3750
|
-
const
|
|
3751
|
-
function
|
|
3752
|
+
const As = "https://ikonai.com";
|
|
3753
|
+
function Ts() {
|
|
3752
3754
|
return /* @__PURE__ */ S.jsxs(
|
|
3753
3755
|
"a",
|
|
3754
3756
|
{
|
|
3755
3757
|
className: "ikon-branding-banner",
|
|
3756
|
-
href:
|
|
3758
|
+
href: As,
|
|
3757
3759
|
target: "_blank",
|
|
3758
3760
|
rel: "noopener noreferrer",
|
|
3759
3761
|
style: {
|
|
@@ -3781,11 +3783,11 @@ function ys() {
|
|
|
3781
3783
|
}
|
|
3782
3784
|
);
|
|
3783
3785
|
}
|
|
3784
|
-
function
|
|
3785
|
-
const { toasts: t, dismissToast: e } =
|
|
3786
|
-
return t.length === 0 ? null : /* @__PURE__ */ S.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ S.jsx(
|
|
3786
|
+
function ks() {
|
|
3787
|
+
const { toasts: t, dismissToast: e } = ds();
|
|
3788
|
+
return t.length === 0 ? null : /* @__PURE__ */ S.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ S.jsx(Cs, { toast: n, onDismiss: e }, n.id)) });
|
|
3787
3789
|
}
|
|
3788
|
-
function
|
|
3790
|
+
function Cs({ toast: t, onDismiss: e }) {
|
|
3789
3791
|
return /* @__PURE__ */ S.jsxs(
|
|
3790
3792
|
"div",
|
|
3791
3793
|
{
|
|
@@ -3806,110 +3808,110 @@ function ws({ toast: t, onDismiss: e }) {
|
|
|
3806
3808
|
}
|
|
3807
3809
|
);
|
|
3808
3810
|
}
|
|
3809
|
-
const
|
|
3810
|
-
function
|
|
3811
|
+
const on = Pt(null);
|
|
3812
|
+
function _s(t, e) {
|
|
3811
3813
|
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3812
3814
|
}
|
|
3813
|
-
function
|
|
3814
|
-
const n =
|
|
3815
|
+
function Is(t, e) {
|
|
3816
|
+
const n = _n();
|
|
3815
3817
|
if (n && t.includes(n))
|
|
3816
3818
|
return n;
|
|
3817
3819
|
const r = navigator.language.split("-")[0];
|
|
3818
3820
|
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3819
3821
|
}
|
|
3820
|
-
function
|
|
3821
|
-
return e ?
|
|
3822
|
+
function Os(t, e, n) {
|
|
3823
|
+
return e ? Is(t, n) : n && t.includes(n) ? n : "en";
|
|
3822
3824
|
}
|
|
3823
|
-
function
|
|
3825
|
+
function Hs({
|
|
3824
3826
|
children: t,
|
|
3825
3827
|
translations: e,
|
|
3826
3828
|
defaultLanguage: n,
|
|
3827
3829
|
detectLanguage: r = !1
|
|
3828
3830
|
}) {
|
|
3829
|
-
const o = Object.keys(e), s =
|
|
3831
|
+
const o = Object.keys(e), s = Os(o, r, n), i = e[s] ?? e.en, a = W(
|
|
3830
3832
|
() => ({
|
|
3831
|
-
t: (l,
|
|
3832
|
-
const
|
|
3833
|
-
return
|
|
3833
|
+
t: (l, f) => {
|
|
3834
|
+
const p = i[l];
|
|
3835
|
+
return _s(p, f);
|
|
3834
3836
|
},
|
|
3835
3837
|
locale: s,
|
|
3836
3838
|
translations: i
|
|
3837
3839
|
}),
|
|
3838
3840
|
[i, s]
|
|
3839
3841
|
);
|
|
3840
|
-
return /* @__PURE__ */ S.jsx(
|
|
3842
|
+
return /* @__PURE__ */ S.jsx(on, { value: a, children: t });
|
|
3841
3843
|
}
|
|
3842
|
-
function
|
|
3843
|
-
const t =
|
|
3844
|
+
function qs() {
|
|
3845
|
+
const t = rt(on);
|
|
3844
3846
|
if (!t)
|
|
3845
3847
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3846
3848
|
return t;
|
|
3847
3849
|
}
|
|
3848
3850
|
export {
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3851
|
+
Vs as AuthProvider,
|
|
3852
|
+
Ks as ConnectionStateRenderer,
|
|
3853
|
+
en as DEBUG_OVERLAY_ENABLED,
|
|
3854
|
+
rn as DebugOverlay,
|
|
3855
|
+
Hs as I18nProvider,
|
|
3856
|
+
ir as IKON_UI_BASE_MODULE,
|
|
3857
|
+
br as IKON_UI_MEDIA_MODULE,
|
|
3858
|
+
Lr as IKON_UI_SHADERTOY_MODULE,
|
|
3859
|
+
xr as IKON_UI_SHADERTOY_TYPE,
|
|
3860
|
+
qe as IKON_UI_STREAM_CATEGORY,
|
|
3861
|
+
hr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3862
|
+
pr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3863
|
+
Xs as IkonApp,
|
|
3864
|
+
Yn as IkonUi,
|
|
3865
|
+
jr as IkonUiRegistry,
|
|
3866
|
+
jt as IkonUiSurface,
|
|
3867
|
+
Wn as InspectOverlay,
|
|
3868
|
+
js as ParallaxView,
|
|
3869
|
+
Vn as UiComponentRegistry,
|
|
3870
|
+
Fn as UiRenderer,
|
|
3871
|
+
Qs as UiStreamStore,
|
|
3872
|
+
Ds as areIkonUiModuleListsEqual,
|
|
3873
|
+
Ht as authenticateAnonymous,
|
|
3874
|
+
Wo as buildOAuthRedirectUrl,
|
|
3875
|
+
xe as clearAuthSession,
|
|
3876
|
+
Ot as clearOAuthParams,
|
|
3877
|
+
sr as createBaseResolvers,
|
|
3878
|
+
Ms as createComponentLibrary,
|
|
3879
|
+
Dr as createIkonUiRegistry,
|
|
3880
|
+
gr as createMediaResolvers,
|
|
3881
|
+
Pr as createShadertoyRendererResolver,
|
|
3882
|
+
Gn as isIkonUiCategoryMatch,
|
|
3883
|
+
zt as loadAuthSession,
|
|
3884
|
+
ar as loadBaseModule,
|
|
3885
|
+
wr as loadMediaModule,
|
|
3886
|
+
Mr as loadShadertoyModule,
|
|
3887
|
+
fo as normalizeIkonUiModuleList,
|
|
3888
|
+
Bs as parseIkonUiInitPayload,
|
|
3889
|
+
Fo as parseOAuthCallback,
|
|
3890
|
+
Vo as parseOAuthError,
|
|
3891
|
+
ti as randomUuid,
|
|
3892
|
+
ho as readIkonUiModules,
|
|
3893
|
+
$s as readIkonUiModulesFromSources,
|
|
3894
|
+
cr as registerBaseModule,
|
|
3895
|
+
Sr as registerMediaModule,
|
|
3896
|
+
Ur as registerShadertoyModule,
|
|
3897
|
+
$n as renderChildren,
|
|
3898
|
+
Fs as renderMotionLetters,
|
|
3899
|
+
Ee as saveAuthSession,
|
|
3900
|
+
$o as sendLoginCode,
|
|
3901
|
+
ae as sessionToUser,
|
|
3902
|
+
ns as useAuth,
|
|
3903
|
+
Ws as useAuthGuard,
|
|
3904
|
+
rs as useAuthOptional,
|
|
3905
|
+
qs as useI18n,
|
|
3906
|
+
Gs as useIkonApp,
|
|
3907
|
+
ws as useIkonDebug,
|
|
3908
|
+
fs as useIkonReactive,
|
|
3909
|
+
Yr as useIkonStyles,
|
|
3910
|
+
Xr as useIkonUiStores,
|
|
3911
|
+
Ys as useLazyFont,
|
|
3912
|
+
zs as useReactive,
|
|
3913
|
+
ds as useToasts,
|
|
3914
|
+
q as useUiNode,
|
|
3915
|
+
Us as useUiStore,
|
|
3916
|
+
Bo as verifyLoginCode
|
|
3915
3917
|
};
|