@ikonai/sdk-react-ui 1.0.40 → 1.0.42

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