@ikonai/sdk-react-ui 1.0.5 → 1.0.7

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.
Files changed (2) hide show
  1. package/index.js +297 -281
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { IkonUiCore as kt, UiStreamStore as Tt } from "@ikonai/sdk-ui";
2
2
  import { UiStreamStore as ho } from "@ikonai/sdk-ui";
3
- import Ct, { useSyncExternalStore as De, useMemo as z, memo as q, useRef as w, useCallback as B, Fragment as It, useEffect as F, useState as ee, createContext as lt, use as Fe } from "react";
4
- import { createLogger as be, getOrCreateDeviceId as pe, deriveAuthUrl as _e, parseUrlParams as Ot, isCloudEnvironment as Ye, extractUserIdFromToken as Nt, deriveBackendType as We, IkonClient as _t } from "@ikonai/sdk";
3
+ import Ct, { useSyncExternalStore as De, useMemo as Y, memo as q, useRef as w, useCallback as $, Fragment as It, useEffect as F, useState as ee, createContext as lt, use as Fe } from "react";
4
+ import { createLogger as be, getOrCreateDeviceId as pe, deriveAuthUrl as _e, parseUrlParams as Ot, isCloudEnvironment as ze, extractUserIdFromToken as Nt, deriveBackendType as We, IkonClient as _t } from "@ikonai/sdk";
5
5
  var me = { exports: {} }, ie = {};
6
6
  /**
7
7
  * @license React
@@ -53,11 +53,11 @@ function jt() {
53
53
  return u.$$typeof === M ? null : u.displayName || u.name || null;
54
54
  if (typeof u == "string") return u;
55
55
  switch (u) {
56
- case b:
56
+ case S:
57
57
  return "Fragment";
58
- case p:
58
+ case g:
59
59
  return "Profiler";
60
- case m:
60
+ case h:
61
61
  return "StrictMode";
62
62
  case V:
63
63
  return "Suspense";
@@ -70,21 +70,21 @@ function jt() {
70
70
  switch (typeof u.tag == "number" && console.error(
71
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
72
  ), u.$$typeof) {
73
- case S:
73
+ case b:
74
74
  return "Portal";
75
75
  case P:
76
76
  return (u.displayName || "Context") + ".Provider";
77
77
  case A:
78
78
  return (u._context.displayName || "Context") + ".Consumer";
79
79
  case j:
80
- var g = u.render;
81
- return u = u.displayName, u || (u = g.displayName || g.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
80
+ var y = u.render;
81
+ return u = u.displayName, u || (u = y.displayName || y.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
82
82
  case Z:
83
- return g = u.displayName || null, g !== null ? g : t(u.type) || "Memo";
83
+ return y = u.displayName || null, y !== null ? y : t(u.type) || "Memo";
84
84
  case k:
85
- g = u._payload, u = u._init;
85
+ y = u._payload, u = u._init;
86
86
  try {
87
- return t(u(g));
87
+ return t(u(y));
88
88
  } catch {
89
89
  }
90
90
  }
@@ -96,27 +96,27 @@ function jt() {
96
96
  function r(u) {
97
97
  try {
98
98
  e(u);
99
- var g = !1;
99
+ var y = !1;
100
100
  } catch {
101
- g = !0;
101
+ y = !0;
102
102
  }
103
- if (g) {
104
- g = console;
105
- var R = g.error, T = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
103
+ if (y) {
104
+ y = console;
105
+ var R = y.error, T = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
106
106
  return R.call(
107
- g,
107
+ y,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
109
  T
110
110
  ), e(u);
111
111
  }
112
112
  }
113
113
  function n(u) {
114
- if (u === b) return "<>";
114
+ if (u === S) return "<>";
115
115
  if (typeof u == "object" && u !== null && u.$$typeof === k)
116
116
  return "<...>";
117
117
  try {
118
- var g = t(u);
119
- return g ? "<" + g + ">" : "<...>";
118
+ var y = t(u);
119
+ return y ? "<" + y + ">" : "<...>";
120
120
  } catch {
121
121
  return "<...>";
122
122
  }
@@ -130,16 +130,16 @@ function jt() {
130
130
  }
131
131
  function i(u) {
132
132
  if (L.call(u, "key")) {
133
- var g = Object.getOwnPropertyDescriptor(u, "key").get;
134
- if (g && g.isReactWarning) return !1;
133
+ var y = Object.getOwnPropertyDescriptor(u, "key").get;
134
+ if (y && y.isReactWarning) return !1;
135
135
  }
136
136
  return u.key !== void 0;
137
137
  }
138
- function a(u, g) {
138
+ function a(u, y) {
139
139
  function R() {
140
140
  ne || (ne = !0, console.error(
141
141
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142
- g
142
+ y
143
143
  ));
144
144
  }
145
145
  R.isReactWarning = !0, Object.defineProperty(u, "key", {
@@ -153,11 +153,11 @@ function jt() {
153
153
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
154
  )), u = this.props.ref, u !== void 0 ? u : null;
155
155
  }
156
- function f(u, g, R, T, K, x, Q, se) {
156
+ function f(u, y, R, T, K, x, Q, se) {
157
157
  return R = x.ref, u = {
158
- $$typeof: y,
158
+ $$typeof: p,
159
159
  type: u,
160
- key: g,
160
+ key: y,
161
161
  props: x,
162
162
  _owner: K
163
163
  }, (R !== void 0 ? R : null) !== null ? Object.defineProperty(u, "ref", {
@@ -185,22 +185,22 @@ function jt() {
185
185
  value: se
186
186
  }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
187
187
  }
188
- function l(u, g, R, T, K, x, Q, se) {
189
- var O = g.children;
188
+ function l(u, y, R, T, K, x, Q, se) {
189
+ var O = y.children;
190
190
  if (O !== void 0)
191
191
  if (T)
192
- if (Y(O)) {
192
+ if (z(O)) {
193
193
  for (T = 0; T < O.length; T++)
194
- h(O[T]);
194
+ m(O[T]);
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 h(O);
201
- if (L.call(g, "key")) {
200
+ else m(O);
201
+ if (L.call(y, "key")) {
202
202
  O = t(u);
203
- var H = Object.keys(g).filter(function(U) {
203
+ var H = Object.keys(y).filter(function(U) {
204
204
  return U !== "key";
205
205
  });
206
206
  T = 0 < H.length ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}", oe[O + T] || (H = 0 < H.length ? "{" + H.join(": ..., ") + ": ...}" : "{}", console.error(
@@ -216,11 +216,11 @@ React keys must be passed directly to JSX without using spread:
216
216
  O
217
217
  ), oe[O + T] = !0);
218
218
  }
219
- if (O = null, R !== void 0 && (r(R), O = "" + R), i(g) && (r(g.key), O = "" + g.key), "key" in g) {
219
+ if (O = null, R !== void 0 && (r(R), O = "" + R), i(y) && (r(y.key), O = "" + y.key), "key" in y) {
220
220
  R = {};
221
- for (var N in g)
222
- N !== "key" && (R[N] = g[N]);
223
- } else R = g;
221
+ for (var N in y)
222
+ N !== "key" && (R[N] = y[N]);
223
+ } else R = y;
224
224
  return O && a(
225
225
  R,
226
226
  typeof u == "function" ? u.displayName || u.name || "Unknown" : u
@@ -235,10 +235,10 @@ React keys must be passed directly to JSX without using spread:
235
235
  se
236
236
  );
237
237
  }
238
- function h(u) {
239
- typeof u == "object" && u !== null && u.$$typeof === y && u._store && (u._store.validated = 1);
238
+ function m(u) {
239
+ typeof u == "object" && u !== null && u.$$typeof === p && u._store && (u._store.validated = 1);
240
240
  }
241
- var d = Ct, y = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), P = Symbol.for("react.context"), j = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), C = Symbol.for("react.activity"), M = Symbol.for("react.client.reference"), I = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, Y = Array.isArray, te = console.createTask ? console.createTask : function() {
241
+ var d = Ct, p = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), P = Symbol.for("react.context"), j = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), C = Symbol.for("react.activity"), M = Symbol.for("react.client.reference"), I = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, z = Array.isArray, te = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
244
  d = {
@@ -250,11 +250,11 @@ React keys must be passed directly to JSX without using spread:
250
250
  d,
251
251
  s
252
252
  )(), he = te(n(s)), oe = {};
253
- ae.Fragment = b, ae.jsx = function(u, g, R, T, K) {
253
+ ae.Fragment = S, ae.jsx = function(u, y, R, T, K) {
254
254
  var x = 1e4 > I.recentlyCreatedOwnerStacks++;
255
255
  return l(
256
256
  u,
257
- g,
257
+ y,
258
258
  R,
259
259
  !1,
260
260
  T,
@@ -262,11 +262,11 @@ React keys must be passed directly to JSX without using spread:
262
262
  x ? Error("react-stack-top-frame") : G,
263
263
  x ? te(n(u)) : he
264
264
  );
265
- }, ae.jsxs = function(u, g, R, T, K) {
265
+ }, ae.jsxs = function(u, y, R, T, K) {
266
266
  var x = 1e4 > I.recentlyCreatedOwnerStacks++;
267
267
  return l(
268
268
  u,
269
- g,
269
+ y,
270
270
  R,
271
271
  !0,
272
272
  T,
@@ -294,7 +294,7 @@ function Ut(t, e) {
294
294
  return `${o ?? ""}:${s?.id ?? ""}`;
295
295
  }
296
296
  );
297
- return z(() => {
297
+ return Y(() => {
298
298
  const [n, o] = r.split(":");
299
299
  return {
300
300
  rootViewId: n || void 0,
@@ -308,7 +308,7 @@ function X(t, e) {
308
308
  () => t.getNodeVersion(e),
309
309
  () => t.getNodeVersion(e)
310
310
  );
311
- return z(() => t.getNode(e), [t, e, r]);
311
+ return Y(() => t.getNode(e), [t, e, r]);
312
312
  }
313
313
  const Lt = be("UIRenderer");
314
314
  function xt(t) {
@@ -330,10 +330,10 @@ function Ft(t) {
330
330
  const e = t.children;
331
331
  return Array.isArray(e) ? e : [];
332
332
  }
333
- function $t(t, e) {
333
+ function Bt(t, e) {
334
334
  return t.nodeId === e.nodeId && t.context === e.context;
335
335
  }
336
- function Bt(t) {
336
+ function $t(t) {
337
337
  if (t.length === 0) return "";
338
338
  if (t.length === 1) return t[0].id;
339
339
  let e = t[0].id;
@@ -342,8 +342,8 @@ function Bt(t) {
342
342
  return e;
343
343
  }
344
344
  const Pe = q(function t({ nodeId: e, context: r }) {
345
- const n = X(r.store, e), o = n ? Ft(n) : [], s = Bt(o), i = z(
346
- () => o.length === 0 ? null : o.map((h) => /* @__PURE__ */ E.jsx(t, { nodeId: h.id, context: r }, h.id)),
345
+ const n = X(r.store, e), o = n ? Ft(n) : [], s = $t(o), i = Y(
346
+ () => o.length === 0 ? null : o.map((m) => /* @__PURE__ */ E.jsx(t, { nodeId: m.id, context: r }, m.id)),
347
347
  // eslint-disable-next-line react-hooks/exhaustive-deps
348
348
  [s, r]
349
349
  );
@@ -356,51 +356,51 @@ const Pe = q(function t({ nodeId: e, context: r }) {
356
356
  return Lt.warn(`No renderer for node type ${n.type}`), null;
357
357
  const c = Dt(n), f = c.length > 0 ? c.join(" ") : void 0, l = a;
358
358
  return /* @__PURE__ */ E.jsx(l, { nodeId: e, context: r, className: f });
359
- }, $t);
359
+ }, Bt);
360
360
  function Vt(t, e) {
361
361
  return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ E.jsx(Pe, { nodeId: r.id, context: e }, r.id));
362
362
  }
363
363
  function Kt(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 zt = q(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
366
+ const Yt = q(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
367
367
  const { rootViewId: c, rootNodeId: f } = Ut(e, n), l = w(s);
368
368
  l.current = s;
369
- const h = w(i);
370
- h.current = i;
369
+ const m = w(i);
370
+ m.current = i;
371
371
  const d = w(a);
372
372
  d.current = a;
373
- const y = B((b, m) => {
374
- if (!b)
373
+ const p = $((S, h) => {
374
+ if (!S)
375
375
  return;
376
- const p = xt(m);
377
- l.current?.(b, p);
378
- }, []), S = z(() => {
379
- const b = {
376
+ const g = xt(h);
377
+ l.current?.(S, g);
378
+ }, []), b = Y(() => {
379
+ const S = {
380
380
  store: e,
381
381
  library: r,
382
382
  handlerCache: e.handlerCache,
383
383
  // Access payloads from store at call time, not captured snapshot
384
- getPayload: (m) => e.getSnapshot().payloads.get(m),
385
- renderChildren: (m) => Vt(m, b),
386
- renderView: (m) => {
387
- const p = e.getSnapshot().views.get(m);
388
- return p ? /* @__PURE__ */ E.jsx(Pe, { nodeId: p.id, context: b }) : null;
384
+ getPayload: (h) => e.getSnapshot().payloads.get(h),
385
+ renderChildren: (h) => Vt(h, S),
386
+ renderView: (h) => {
387
+ const g = e.getSnapshot().views.get(h);
388
+ return g ? /* @__PURE__ */ E.jsx(Pe, { nodeId: g.id, context: S }) : null;
389
389
  },
390
- dispatchAction: y,
390
+ dispatchAction: p,
391
391
  // Access client/video via refs to avoid context recreation
392
392
  get client() {
393
- return h.current;
393
+ return m.current;
394
394
  },
395
395
  get video() {
396
396
  return d.current;
397
397
  }
398
398
  };
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(Pe, { nodeId: f, context: S }) });
399
+ return S;
400
+ }, [e, r, p]);
401
+ return !c || !f ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(Pe, { nodeId: f, context: b }) });
402
402
  }, Kt);
403
- class Yt {
403
+ class zt {
404
404
  constructor(e, r) {
405
405
  if (this.fallback = r, e)
406
406
  for (const [n, o] of e)
@@ -419,7 +419,7 @@ class Yt {
419
419
  }
420
420
  function Jn(t, e) {
421
421
  const r = Object.entries(t);
422
- return new Yt(r, e);
422
+ return new zt(r, e);
423
423
  }
424
424
  function Gn(t) {
425
425
  return De(
@@ -433,23 +433,23 @@ function Wt(t, e) {
433
433
  return t === e;
434
434
  }
435
435
  const Hn = q(function({ stores: e, registry: r, category: n = je, onAction: o, client: s }) {
436
- const i = z(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
436
+ const i = Y(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
437
437
  a.current = o;
438
438
  const c = w(s);
439
439
  c.current = s;
440
- const f = z(
440
+ const f = Y(
441
441
  () => {
442
442
  const l = [];
443
- for (const [h, d] of e) {
444
- const y = d.store.getSnapshot();
445
- Wt(d.category, n) && (!y.rootViewId || !y.views.has(y.rootViewId) || l.push({ key: h, store: d.store }));
443
+ for (const [m, d] of e) {
444
+ const p = d.store.getSnapshot();
445
+ Wt(d.category, n) && (!p.rootViewId || !p.views.has(p.rootViewId) || l.push({ key: m, store: d.store }));
446
446
  }
447
447
  return l;
448
448
  },
449
449
  // eslint-disable-next-line react-hooks/exhaustive-deps
450
450
  [e, n, i]
451
451
  );
452
- return f.length === 0 ? null : /* @__PURE__ */ E.jsx(E.Fragment, { children: f.map(({ key: l, store: h }) => /* @__PURE__ */ E.jsx(zt, { store: h, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, l)) });
452
+ return f.length === 0 ? null : /* @__PURE__ */ E.jsx(E.Fragment, { children: f.map(({ key: l, store: m }) => /* @__PURE__ */ E.jsx(Yt, { store: m, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, l)) });
453
453
  });
454
454
  class qt {
455
455
  core;
@@ -536,7 +536,7 @@ function we(t) {
536
536
  return e.length > 0 ? e.join(" ") : void 0;
537
537
  }
538
538
  }
539
- function $e(...t) {
539
+ function Be(...t) {
540
540
  let e = "";
541
541
  for (const r of t)
542
542
  if (r) {
@@ -546,7 +546,7 @@ function $e(...t) {
546
546
  return e || void 0;
547
547
  }
548
548
  const He = /* @__PURE__ */ new WeakMap(), Jt = {};
549
- function Be(t) {
549
+ function $e(t) {
550
550
  if (!t)
551
551
  return Jt;
552
552
  const e = He.get(t);
@@ -566,16 +566,32 @@ function Gt() {
566
566
  const l = s.current;
567
567
  if (!l || i && l.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
568
568
  return;
569
- const h = c !== !0;
570
- if (h && typeof l.scrollIntoView == "function")
571
- try {
572
- l.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
573
- } catch {
574
- l.scrollIntoView();
575
- }
569
+ const m = c !== !0;
570
+ if (m) {
571
+ const p = ((b) => {
572
+ let S = b.parentElement;
573
+ for (; S; ) {
574
+ const g = window.getComputedStyle(S).overflowY;
575
+ if (g === "auto" || g === "scroll" || S.hasAttribute("data-radix-scroll-area-viewport"))
576
+ return S;
577
+ S = S.parentElement;
578
+ }
579
+ return null;
580
+ })(l);
581
+ p ? requestAnimationFrame(() => {
582
+ const b = p.getBoundingClientRect(), S = l.getBoundingClientRect(), h = p.scrollTop + (S.bottom - b.bottom) + 16;
583
+ "scrollBehavior" in document.documentElement.style ? p.scrollTo({ top: h, behavior: "smooth" }) : p.scrollTop = h;
584
+ }) : typeof l.scrollIntoView == "function" && requestAnimationFrame(() => {
585
+ try {
586
+ l.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
587
+ } catch {
588
+ l.scrollIntoView(!1);
589
+ }
590
+ });
591
+ }
576
592
  if (typeof l.focus == "function")
577
593
  try {
578
- l.focus({ preventScroll: !h });
594
+ l.focus({ preventScroll: !m });
579
595
  } catch {
580
596
  l.focus();
581
597
  }
@@ -601,7 +617,7 @@ function Ht() {
601
617
  const s = X(n.store, r);
602
618
  if (!s)
603
619
  return null;
604
- const i = Be(s.props), a = $e(we(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
620
+ const i = $e(s.props), a = Be(we(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
605
621
  return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
606
622
  });
607
623
  return ({ type: e }) => {
@@ -614,7 +630,7 @@ function Xt() {
614
630
  const s = X(n.store, r);
615
631
  if (!s)
616
632
  return null;
617
- const i = Be(s.props), a = $e("relative", we(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
633
+ const i = $e(s.props), a = Be("relative", we(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
618
634
  return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
619
635
  });
620
636
  return ({ type: e }) => {
@@ -627,7 +643,7 @@ function Zt() {
627
643
  const s = X(n.store, r);
628
644
  if (!s)
629
645
  return null;
630
- const i = Be(s.props), a = $e("absolute", we(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
646
+ const i = $e(s.props), a = Be("absolute", we(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
631
647
  return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
632
648
  });
633
649
  return ({ type: e }) => {
@@ -681,7 +697,7 @@ function Me(t) {
681
697
  const nr = "std.video-canvas", or = "std.video-url-player";
682
698
  function sr() {
683
699
  const t = q(function({ nodeId: r, context: n, className: o }) {
684
- const s = X(n.store, r), i = w(null), a = n.video, c = s ? Me(s.props?.streamId) : void 0, f = s ? ge(s.props?.width) : void 0, l = s ? ge(s.props?.height) : void 0, h = s ? ft(dt(s.props?.className), o) : o;
700
+ const s = X(n.store, r), i = w(null), a = n.video, c = s ? Me(s.props?.streamId) : void 0, f = s ? ge(s.props?.width) : void 0, l = s ? ge(s.props?.height) : void 0, m = s ? ft(dt(s.props?.className), o) : o;
685
701
  return F(() => {
686
702
  const d = i.current;
687
703
  if (!(!a || !d || !c))
@@ -694,7 +710,7 @@ function sr() {
694
710
  ref: i,
695
711
  "data-ikon-node-id": s.id,
696
712
  "data-ikon-video-stream-id": c,
697
- className: h,
713
+ className: m,
698
714
  ...f ? { width: f } : {},
699
715
  ...l ? { height: l } : {}
700
716
  },
@@ -727,7 +743,7 @@ function ar() {
727
743
  const s = X(n.store, r);
728
744
  if (!s)
729
745
  return null;
730
- const i = ft(dt(s.props?.className), o), a = Me(s.props?.src), c = Me(s.props?.poster), f = ce(s.props?.controls), l = ce(s.props?.autoplay), h = ce(s.props?.loop), d = ce(s.props?.muted), y = ce(s.props?.playsInline), S = ge(s.props?.width), b = ge(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
746
+ const i = ft(dt(s.props?.className), o), a = Me(s.props?.src), c = Me(s.props?.poster), f = ce(s.props?.controls), l = ce(s.props?.autoplay), m = ce(s.props?.loop), d = ce(s.props?.muted), p = ce(s.props?.playsInline), b = ge(s.props?.width), S = ge(s.props?.height), h = s.children?.length ? n.renderChildren(s.children) : void 0;
731
747
  return /* @__PURE__ */ E.jsx(
732
748
  "video",
733
749
  {
@@ -735,14 +751,14 @@ function ar() {
735
751
  poster: c,
736
752
  ...f !== void 0 ? { controls: f } : {},
737
753
  ...l !== void 0 ? { autoPlay: l } : {},
738
- ...h !== void 0 ? { loop: h } : {},
754
+ ...m !== void 0 ? { loop: m } : {},
739
755
  ...d !== void 0 ? { muted: d } : {},
740
- ...y !== void 0 ? { playsInline: y } : {},
741
- ...S ? { width: S } : {},
742
- ...b ? { height: b } : {},
756
+ ...p !== void 0 ? { playsInline: p } : {},
757
+ ...b ? { width: b } : {},
758
+ ...S ? { height: S } : {},
743
759
  "data-ikon-node-id": s.id,
744
760
  className: i,
745
- children: m
761
+ children: h
746
762
  }
747
763
  );
748
764
  });
@@ -901,42 +917,42 @@ class mr {
901
917
  f && e.uniform1f(f, i);
902
918
  const l = this.uniformLocations.get("iTimeDelta");
903
919
  l && e.uniform1f(l, a);
904
- const h = this.uniformLocations.get("iFrame");
905
- h && e.uniform1i(h, this.frameCount);
920
+ const m = this.uniformLocations.get("iFrame");
921
+ m && e.uniform1i(m, this.frameCount);
906
922
  const d = this.uniformLocations.get("iMouse");
907
923
  d && e.uniform4f(d, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
908
- const y = this.uniformLocations.get("iDate");
909
- if (y) {
910
- const S = /* @__PURE__ */ new Date();
911
- e.uniform4f(y, S.getFullYear(), S.getMonth(), S.getDate(), S.getHours() * 3600 + S.getMinutes() * 60 + S.getSeconds() + S.getMilliseconds() / 1e3);
924
+ const p = this.uniformLocations.get("iDate");
925
+ if (p) {
926
+ const b = /* @__PURE__ */ new Date();
927
+ e.uniform4f(p, b.getFullYear(), b.getMonth(), b.getDate(), b.getHours() * 3600 + b.getMinutes() * 60 + b.getSeconds() + b.getMilliseconds() / 1e3);
912
928
  }
913
- for (const [S, b] of Object.entries(this.customUniforms)) {
914
- const m = this.uniformLocations.get(S);
915
- if (m)
916
- switch (b.type) {
929
+ for (const [b, S] of Object.entries(this.customUniforms)) {
930
+ const h = this.uniformLocations.get(b);
931
+ if (h)
932
+ switch (S.type) {
917
933
  case "float":
918
- e.uniform1f(m, b.value);
934
+ e.uniform1f(h, S.value);
919
935
  break;
920
936
  case "vec2": {
921
- const p = b.value;
922
- e.uniform2f(m, p[0], p[1]);
937
+ const g = S.value;
938
+ e.uniform2f(h, g[0], g[1]);
923
939
  break;
924
940
  }
925
941
  case "vec3": {
926
- const p = b.value;
927
- e.uniform3f(m, p[0], p[1], p[2]);
942
+ const g = S.value;
943
+ e.uniform3f(h, g[0], g[1], g[2]);
928
944
  break;
929
945
  }
930
946
  case "vec4": {
931
- const p = b.value;
932
- e.uniform4f(m, p[0], p[1], p[2], p[3]);
947
+ const g = S.value;
948
+ e.uniform4f(h, g[0], g[1], g[2], g[3]);
933
949
  break;
934
950
  }
935
951
  case "int":
936
- e.uniform1i(m, b.value);
952
+ e.uniform1i(h, S.value);
937
953
  break;
938
954
  case "bool":
939
- e.uniform1i(m, b.value ? 1 : 0);
955
+ e.uniform1i(h, S.value ? 1 : 0);
940
956
  break;
941
957
  }
942
958
  }
@@ -1026,13 +1042,13 @@ function wr(t, e) {
1026
1042
  const vr = "std.shader-canvas";
1027
1043
  function Rr() {
1028
1044
  const t = q(function({ nodeId: r, context: n, className: o }) {
1029
- const s = X(n.store, r), i = w(null), a = w(null), c = w(null), f = w(0), l = w(""), h = w({}), d = w({
1045
+ const s = X(n.store, r), i = w(null), a = w(null), c = w(null), f = w(0), l = w(""), m = w({}), d = w({
1030
1046
  x: 0,
1031
1047
  y: 0,
1032
1048
  clickX: 0,
1033
1049
  clickY: 0,
1034
1050
  isDown: !1
1035
- }), y = s ? yr(s.props?.shaderSource) : "", S = s ? Ee(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, m = z(() => br(b), [b]), p = s ? Sr(s.props?.enableMouse) ?? !0 : !0, A = s ? Ee(s.props?.width) : void 0, P = s ? Ee(s.props?.height) : void 0, j = s ? gr(pr(s.props?.className), o) : o;
1051
+ }), p = s ? yr(s.props?.shaderSource) : "", b = s ? Ee(s.props?.fps) ?? 60 : 60, S = s?.props?.uniforms, h = Y(() => br(S), [S]), g = s ? Sr(s.props?.enableMouse) ?? !0 : !0, A = s ? Ee(s.props?.width) : void 0, P = s ? Ee(s.props?.height) : void 0, j = s ? gr(pr(s.props?.className), o) : o;
1036
1052
  F(() => {
1037
1053
  const k = i.current;
1038
1054
  if (k) {
@@ -1048,48 +1064,48 @@ function Rr() {
1048
1064
  }
1049
1065
  }, []), F(() => {
1050
1066
  const k = a.current;
1051
- if (!(!k || !y) && l.current !== y)
1052
- if (k.compile(y, m))
1053
- l.current = y, h.current = m;
1067
+ if (!(!k || !p) && l.current !== p)
1068
+ if (k.compile(p, h))
1069
+ l.current = p, m.current = h;
1054
1070
  else {
1055
1071
  const M = k.getError();
1056
1072
  console.error("[ShaderRenderer] Shader compilation failed:", M);
1057
1073
  }
1058
- }, [y, m]), F(() => {
1074
+ }, [p, h]), F(() => {
1059
1075
  const k = a.current;
1060
- !k || !l.current || wr(h.current, m) || (k.setCustomUniforms(m), h.current = m);
1061
- }, [m]), F(() => {
1076
+ !k || !l.current || wr(m.current, h) || (k.setCustomUniforms(h), m.current = h);
1077
+ }, [h]), F(() => {
1062
1078
  const k = a.current;
1063
1079
  if (!k || !l.current) return;
1064
- const C = 1e3 / S, M = (I) => {
1080
+ const C = 1e3 / b, M = (I) => {
1065
1081
  const L = I - f.current;
1066
1082
  L >= C && (f.current = I - L % C, k.draw()), c.current = requestAnimationFrame(M);
1067
1083
  };
1068
1084
  return c.current = requestAnimationFrame(M), () => {
1069
1085
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
1070
1086
  };
1071
- }, [S]);
1072
- const V = B(
1087
+ }, [b]);
1088
+ const V = $(
1073
1089
  (k) => {
1074
- if (!p) return;
1090
+ if (!g) return;
1075
1091
  const C = i.current, M = a.current;
1076
1092
  if (!C || !M) return;
1077
- const I = C.getBoundingClientRect(), L = k.clientX - I.left, Y = I.height - (k.clientY - I.top);
1078
- d.current.x = L, d.current.y = Y, M.setMouse(L, Y, d.current.clickX, d.current.clickY);
1093
+ const I = C.getBoundingClientRect(), L = k.clientX - I.left, z = I.height - (k.clientY - I.top);
1094
+ d.current.x = L, d.current.y = z, M.setMouse(L, z, d.current.clickX, d.current.clickY);
1079
1095
  },
1080
- [p]
1081
- ), J = B(
1096
+ [g]
1097
+ ), J = $(
1082
1098
  (k) => {
1083
- if (!p) return;
1099
+ if (!g) return;
1084
1100
  const C = i.current, M = a.current;
1085
1101
  if (!C || !M) return;
1086
- const I = C.getBoundingClientRect(), L = k.clientX - I.left, Y = I.height - (k.clientY - I.top);
1087
- d.current.isDown = !0, d.current.clickX = L, d.current.clickY = Y, M.setMouse(L, Y, L, Y);
1102
+ const I = C.getBoundingClientRect(), L = k.clientX - I.left, z = I.height - (k.clientY - I.top);
1103
+ d.current.isDown = !0, d.current.clickX = L, d.current.clickY = z, M.setMouse(L, z, L, z);
1088
1104
  },
1089
- [p]
1090
- ), Z = B(() => {
1091
- p && (d.current.isDown = !1, d.current.clickX = -Math.abs(d.current.clickX));
1092
- }, [p]);
1105
+ [g]
1106
+ ), Z = $(() => {
1107
+ g && (d.current.isDown = !1, d.current.clickX = -Math.abs(d.current.clickX));
1108
+ }, [g]);
1093
1109
  return s ? /* @__PURE__ */ E.jsx(
1094
1110
  "canvas",
1095
1111
  {
@@ -1228,41 +1244,41 @@ function et(t) {
1228
1244
  }
1229
1245
  function tt(t, e, r, n) {
1230
1246
  const l = new Float32Array(11);
1231
- function h(m, p, A) {
1232
- return ((3 * p - 3 * A + 1) * m + (3 * A - 6 * p)) * m * m + 3 * p * m;
1247
+ function m(h, g, A) {
1248
+ return ((3 * g - 3 * A + 1) * h + (3 * A - 6 * g)) * h * h + 3 * g * h;
1233
1249
  }
1234
- function d(m, p, A) {
1235
- return 3 * (3 * p - 3 * A + 1) * m * m + 2 * (3 * A - 6 * p) * m + 3 * p;
1250
+ function d(h, g, A) {
1251
+ return 3 * (3 * g - 3 * A + 1) * h * h + 2 * (3 * A - 6 * g) * h + 3 * g;
1236
1252
  }
1237
- function y(m, p) {
1253
+ function p(h, g) {
1238
1254
  for (let A = 0; A < 4; A += 1) {
1239
- const P = d(p, t, r);
1255
+ const P = d(g, t, r);
1240
1256
  if (P === 0)
1241
- return p;
1242
- const j = h(p, t, r) - m;
1243
- p -= j / P;
1257
+ return g;
1258
+ const j = m(g, t, r) - h;
1259
+ g -= j / P;
1244
1260
  }
1245
- return p;
1261
+ return g;
1246
1262
  }
1247
- function S(m, p, A) {
1263
+ function b(h, g, A) {
1248
1264
  let P = 0, j = 0, V = 0;
1249
1265
  do
1250
- j = p + (A - p) / 2, P = h(j, t, r) - m, P > 0 ? A = j : p = j;
1266
+ j = g + (A - g) / 2, P = m(j, t, r) - h, P > 0 ? A = j : g = j;
1251
1267
  while (Math.abs(P) > 1e-7 && ++V < 10);
1252
1268
  return j;
1253
1269
  }
1254
- function b(m) {
1255
- let p = 0, A = 1;
1270
+ function S(h) {
1271
+ let g = 0, A = 1;
1256
1272
  const P = 10;
1257
- for (; A !== P && l[A] <= m; A += 1)
1258
- p += 0.1;
1273
+ for (; A !== P && l[A] <= h; A += 1)
1274
+ g += 0.1;
1259
1275
  A -= 1;
1260
- const j = (m - l[A]) / (l[A + 1] - l[A]), V = p + j * 0.1, J = d(V, t, r);
1261
- return J >= 1e-3 ? y(m, V) : J === 0 ? V : S(m, p, p + 0.1);
1276
+ const j = (h - l[A]) / (l[A + 1] - l[A]), V = g + j * 0.1, J = d(V, t, r);
1277
+ return J >= 1e-3 ? p(h, V) : J === 0 ? V : b(h, g, g + 0.1);
1262
1278
  }
1263
- for (let m = 0; m < 11; m += 1)
1264
- l[m] = h(m * 0.1, t, r);
1265
- return (m) => m <= 0 ? 0 : m >= 1 ? 1 : h(b(m), e, n);
1279
+ for (let h = 0; h < 11; h += 1)
1280
+ l[h] = m(h * 0.1, t, r);
1281
+ return (h) => h <= 0 ? 0 : h >= 1 ? 1 : m(S(h), e, n);
1266
1282
  }
1267
1283
  function _r(t) {
1268
1284
  const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
@@ -1564,7 +1580,7 @@ class Mr {
1564
1580
  }
1565
1581
  const ke = new Mr();
1566
1582
  function Ur(t) {
1567
- const e = w(/* @__PURE__ */ new Map()), r = B(({ styleId: s, css: i, common: a }) => {
1583
+ const e = w(/* @__PURE__ */ new Map()), r = $(({ styleId: s, css: i, common: a }) => {
1568
1584
  if (!(!s || typeof document > "u")) {
1569
1585
  if (i) {
1570
1586
  let c = e.current.get(s);
@@ -1572,13 +1588,13 @@ function Ur(t) {
1572
1588
  }
1573
1589
  ke.registerStyle(s, a);
1574
1590
  }
1575
- }, []), n = B((s) => {
1591
+ }, []), n = $((s) => {
1576
1592
  if (!(typeof document > "u"))
1577
1593
  for (const i of s) {
1578
1594
  const a = e.current.get(i);
1579
1595
  a && (a.remove(), e.current.delete(i)), ke.unregisterStyle(i);
1580
1596
  }
1581
- }, []), o = B(() => {
1597
+ }, []), o = $(() => {
1582
1598
  if (typeof document < "u") {
1583
1599
  for (const s of e.current.values())
1584
1600
  s.remove();
@@ -1618,9 +1634,9 @@ function xr(t) {
1618
1634
  return o(), t.subscribe(o);
1619
1635
  }, [t]), e;
1620
1636
  }
1621
- var Dr = typeof global == "object" && global && global.Object === Object && global, Fr = typeof self == "object" && self && self.Object === Object && self, $r = Dr || Fr || Function("return this")(), ye = $r.Symbol, ht = Object.prototype, Br = ht.hasOwnProperty, Vr = ht.toString, ue = ye ? ye.toStringTag : void 0;
1637
+ var Dr = typeof global == "object" && global && global.Object === Object && global, Fr = typeof self == "object" && self && self.Object === Object && self, Br = Dr || Fr || Function("return this")(), ye = Br.Symbol, ht = Object.prototype, $r = ht.hasOwnProperty, Vr = ht.toString, ue = ye ? ye.toStringTag : void 0;
1622
1638
  function Kr(t) {
1623
- var e = Br.call(t, ue), r = t[ue];
1639
+ var e = $r.call(t, ue), r = t[ue];
1624
1640
  try {
1625
1641
  t[ue] = void 0;
1626
1642
  var n = !0;
@@ -1629,9 +1645,9 @@ function Kr(t) {
1629
1645
  var o = Vr.call(t);
1630
1646
  return n && (e ? t[ue] = r : delete t[ue]), o;
1631
1647
  }
1632
- var zr = Object.prototype, Yr = zr.toString;
1648
+ var Yr = Object.prototype, zr = Yr.toString;
1633
1649
  function Wr(t) {
1634
- return Yr.call(t);
1650
+ return zr.call(t);
1635
1651
  }
1636
1652
  var qr = "[object Null]", Jr = "[object Undefined]", rt = ye ? ye.toStringTag : void 0;
1637
1653
  function Gr(t) {
@@ -1696,25 +1712,25 @@ function Qn(t) {
1696
1712
  const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
1697
1713
  for (const c of n) {
1698
1714
  if (typeof c == "string") {
1699
- const b = c.trim();
1700
- if (!b || i.has(b))
1715
+ const S = c.trim();
1716
+ if (!S || i.has(S))
1701
1717
  continue;
1702
- o.push(b), i.add(b);
1718
+ o.push(S), i.add(S);
1703
1719
  continue;
1704
1720
  }
1705
1721
  if (!Ue(c))
1706
1722
  continue;
1707
- const f = c, l = Object.keys(f).find((b) => b.toLowerCase() === "name");
1723
+ const f = c, l = Object.keys(f).find((S) => S.toLowerCase() === "name");
1708
1724
  if (!l)
1709
1725
  continue;
1710
- const h = f[l];
1711
- if (typeof h != "string")
1726
+ const m = f[l];
1727
+ if (typeof m != "string")
1712
1728
  continue;
1713
- const d = h.trim();
1729
+ const d = m.trim();
1714
1730
  if (!d)
1715
1731
  continue;
1716
- const y = Object.keys(f).find((b) => b.toLowerCase() === "javascript"), S = y ? f[y] : void 0;
1717
- typeof S == "string" && s.set(d, S), i.has(d) || (o.push(d), i.add(d));
1732
+ const p = Object.keys(f).find((S) => S.toLowerCase() === "javascript"), b = p ? f[p] : void 0;
1733
+ typeof b == "string" && s.set(d, b), i.has(d) || (o.push(d), i.add(d));
1718
1734
  }
1719
1735
  if (!o.length && s.size === 0)
1720
1736
  return { modules: [] };
@@ -1797,8 +1813,8 @@ function eo(t, e) {
1797
1813
  return n ? ct(s) : t;
1798
1814
  const a = vn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
1799
1815
  for (const l of a) {
1800
- const h = sn(l, r, c);
1801
- f.push(...h);
1816
+ const m = sn(l, r, c);
1817
+ f.push(...m);
1802
1818
  }
1803
1819
  return f;
1804
1820
  }
@@ -1885,9 +1901,9 @@ function ln(t, e, r) {
1885
1901
  );
1886
1902
  continue;
1887
1903
  }
1888
- const d = o && mt(a) ? { "data-motion-emoji": !0 } : void 0, y = a === " " ? " " : a;
1904
+ const d = o && mt(a) ? { "data-motion-emoji": !0 } : void 0, p = a === " " ? " " : a;
1889
1905
  s.push(
1890
- /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: l, ...d, children: y }, f)
1906
+ /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: l, ...d, children: p }, f)
1891
1907
  );
1892
1908
  }
1893
1909
  return s;
@@ -2418,35 +2434,35 @@ async function xn(t) {
2418
2434
  let s;
2419
2435
  try {
2420
2436
  s = await navigator.credentials.create(o);
2421
- } catch (S) {
2422
- throw Mn({ error: S, options: o });
2437
+ } catch (b) {
2438
+ throw Mn({ error: b, options: o });
2423
2439
  }
2424
2440
  if (!s)
2425
2441
  throw new Error("Registration was not completed");
2426
2442
  const { id: i, rawId: a, response: c, type: f } = s;
2427
2443
  let l;
2428
2444
  typeof c.getTransports == "function" && (l = c.getTransports());
2429
- let h;
2445
+ let m;
2430
2446
  if (typeof c.getPublicKeyAlgorithm == "function")
2431
2447
  try {
2432
- h = c.getPublicKeyAlgorithm();
2433
- } catch (S) {
2434
- Ie("getPublicKeyAlgorithm()", S);
2448
+ m = c.getPublicKeyAlgorithm();
2449
+ } catch (b) {
2450
+ Ie("getPublicKeyAlgorithm()", b);
2435
2451
  }
2436
2452
  let d;
2437
2453
  if (typeof c.getPublicKey == "function")
2438
2454
  try {
2439
- const S = c.getPublicKey();
2440
- S !== null && (d = W(S));
2441
- } catch (S) {
2442
- Ie("getPublicKey()", S);
2455
+ const b = c.getPublicKey();
2456
+ b !== null && (d = W(b));
2457
+ } catch (b) {
2458
+ Ie("getPublicKey()", b);
2443
2459
  }
2444
- let y;
2460
+ let p;
2445
2461
  if (typeof c.getAuthenticatorData == "function")
2446
2462
  try {
2447
- y = W(c.getAuthenticatorData());
2448
- } catch (S) {
2449
- Ie("getAuthenticatorData()", S);
2463
+ p = W(c.getAuthenticatorData());
2464
+ } catch (b) {
2465
+ Ie("getAuthenticatorData()", b);
2450
2466
  }
2451
2467
  return {
2452
2468
  id: i,
@@ -2455,9 +2471,9 @@ async function xn(t) {
2455
2471
  attestationObject: W(c.attestationObject),
2456
2472
  clientDataJSON: W(c.clientDataJSON),
2457
2473
  transports: l,
2458
- publicKeyAlgorithm: h,
2474
+ publicKeyAlgorithm: m,
2459
2475
  publicKey: d,
2460
- authenticatorData: y
2476
+ authenticatorData: p
2461
2477
  },
2462
2478
  type: f,
2463
2479
  clientExtensionResults: s.getClientExtensionResults(),
@@ -2518,7 +2534,7 @@ function Fn({ error: t, options: e }) {
2518
2534
  }
2519
2535
  return t;
2520
2536
  }
2521
- async function $n(t) {
2537
+ async function Bn(t) {
2522
2538
  !t.optionsJSON && t.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
2523
2539
  const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
2524
2540
  if (!Ke())
@@ -2541,12 +2557,12 @@ async function $n(t) {
2541
2557
  let a;
2542
2558
  try {
2543
2559
  a = await navigator.credentials.get(i);
2544
- } catch (y) {
2545
- throw Fn({ error: y, options: i });
2560
+ } catch (p) {
2561
+ throw Fn({ error: p, options: i });
2546
2562
  }
2547
2563
  if (!a)
2548
2564
  throw new Error("Authentication was not completed");
2549
- const { id: c, rawId: f, response: l, type: h } = a;
2565
+ const { id: c, rawId: f, response: l, type: m } = a;
2550
2566
  let d;
2551
2567
  return l.userHandle && (d = W(l.userHandle)), {
2552
2568
  id: c,
@@ -2557,12 +2573,12 @@ async function $n(t) {
2557
2573
  signature: W(l.signature),
2558
2574
  userHandle: d
2559
2575
  },
2560
- type: h,
2576
+ type: m,
2561
2577
  clientExtensionResults: a.getClientExtensionResults(),
2562
2578
  authenticatorAttachment: Et(a.authenticatorAttachment)
2563
2579
  };
2564
2580
  }
2565
- const ze = lt(null);
2581
+ const Ye = lt(null);
2566
2582
  function ro({ children: t, config: e }) {
2567
2583
  const [r, n] = ee({
2568
2584
  isAuthenticated: !1,
@@ -2582,17 +2598,17 @@ function ro({ children: t, config: e }) {
2582
2598
  });
2583
2599
  return;
2584
2600
  }
2585
- const h = Tn();
2586
- if (h) {
2587
- const y = {
2588
- token: h.token,
2589
- provider: h.provider,
2601
+ const m = Tn();
2602
+ if (m) {
2603
+ const p = {
2604
+ token: m.token,
2605
+ provider: m.provider,
2590
2606
  authenticatedAt: Date.now()
2591
2607
  };
2592
- Re(y), ut(), n({
2608
+ Re(p), ut(), n({
2593
2609
  isAuthenticated: !0,
2594
2610
  isLoading: !1,
2595
- user: de(y),
2611
+ user: de(p),
2596
2612
  error: null
2597
2613
  });
2598
2614
  return;
@@ -2615,7 +2631,7 @@ function ro({ children: t, config: e }) {
2615
2631
  });
2616
2632
  })();
2617
2633
  }, []);
2618
- const o = B(
2634
+ const o = $(
2619
2635
  async (f) => {
2620
2636
  if (!e.spaceId) {
2621
2637
  n((d) => ({
@@ -2636,8 +2652,8 @@ function ro({ children: t, config: e }) {
2636
2652
  error: null
2637
2653
  });
2638
2654
  } catch (d) {
2639
- n((y) => ({
2640
- ...y,
2655
+ n((p) => ({
2656
+ ...p,
2641
2657
  isLoading: !1,
2642
2658
  error: d instanceof Error ? d.message : "Guest login failed"
2643
2659
  }));
@@ -2647,55 +2663,55 @@ function ro({ children: t, config: e }) {
2647
2663
  if (f === "passkey") {
2648
2664
  n((d) => ({ ...d, isLoading: !0, error: null }));
2649
2665
  try {
2650
- const d = await _n(l), y = await $n({ optionsJSON: d }), S = await Pn(l, y);
2666
+ const d = await _n(l), p = await Bn({ optionsJSON: d }), b = await Pn(l, p);
2651
2667
  n({
2652
2668
  isAuthenticated: !0,
2653
2669
  isLoading: !1,
2654
- user: de(S),
2670
+ user: de(b),
2655
2671
  error: null
2656
2672
  });
2657
2673
  } catch (d) {
2658
- n((y) => ({
2659
- ...y,
2674
+ n((p) => ({
2675
+ ...p,
2660
2676
  isLoading: !1,
2661
2677
  error: d instanceof Error ? d.message : "Passkey login failed"
2662
2678
  }));
2663
2679
  }
2664
2680
  return;
2665
2681
  }
2666
- const h = In(f, e.spaceId, l);
2667
- window.location.href = h;
2682
+ const m = In(f, e.spaceId, l);
2683
+ window.location.href = m;
2668
2684
  },
2669
2685
  [e.authUrl, e.spaceId]
2670
- ), s = B(() => {
2686
+ ), s = $(() => {
2671
2687
  St(), n({
2672
2688
  isAuthenticated: !1,
2673
2689
  isLoading: !1,
2674
2690
  user: null,
2675
2691
  error: null
2676
2692
  });
2677
- }, []), i = B(
2693
+ }, []), i = $(
2678
2694
  async (f) => {
2679
2695
  const l = e.authUrl ?? _e();
2680
- n((h) => ({ ...h, isLoading: !0, error: null }));
2696
+ n((m) => ({ ...m, isLoading: !0, error: null }));
2681
2697
  try {
2682
- const h = await On(l), d = await xn({ optionsJSON: h }), y = await Nn(l, d, f);
2698
+ const m = await On(l), d = await xn({ optionsJSON: m }), p = await Nn(l, d, f);
2683
2699
  n({
2684
2700
  isAuthenticated: !0,
2685
2701
  isLoading: !1,
2686
- user: de(y),
2702
+ user: de(p),
2687
2703
  error: null
2688
2704
  });
2689
- } catch (h) {
2705
+ } catch (m) {
2690
2706
  n((d) => ({
2691
2707
  ...d,
2692
2708
  isLoading: !1,
2693
- error: h instanceof Error ? h.message : "Passkey registration failed"
2709
+ error: m instanceof Error ? m.message : "Passkey registration failed"
2694
2710
  }));
2695
2711
  }
2696
2712
  },
2697
2713
  [e.authUrl]
2698
- ), a = B(() => r.user?.token ?? null, [r.user]), c = z(
2714
+ ), a = $(() => r.user?.token ?? null, [r.user]), c = Y(
2699
2715
  () => ({
2700
2716
  state: r,
2701
2717
  login: o,
@@ -2705,19 +2721,19 @@ function ro({ children: t, config: e }) {
2705
2721
  }),
2706
2722
  [r, o, s, a, i]
2707
2723
  );
2708
- return /* @__PURE__ */ E.jsx(ze, { value: c, children: t });
2724
+ return /* @__PURE__ */ E.jsx(Ye, { value: c, children: t });
2709
2725
  }
2710
- function Bn() {
2711
- const t = Fe(ze);
2726
+ function $n() {
2727
+ const t = Fe(Ye);
2712
2728
  if (!t)
2713
2729
  throw new Error("useAuth must be used within an AuthProvider");
2714
2730
  return t;
2715
2731
  }
2716
2732
  function no() {
2717
- return Fe(ze);
2733
+ return Fe(Ye);
2718
2734
  }
2719
2735
  function oo(t) {
2720
- const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Bn(), s = w(!1);
2736
+ const { config: e, guestUrlParam: r } = t, { state: n, login: o } = $n(), s = w(!1);
2721
2737
  return F(() => {
2722
2738
  if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
2723
2739
  return;
@@ -2746,7 +2762,7 @@ function so({
2746
2762
  renderConnecting: c,
2747
2763
  renderConnectingSlow: f,
2748
2764
  renderConnected: l,
2749
- renderOffline: h,
2765
+ renderOffline: m,
2750
2766
  renderError: d
2751
2767
  }) {
2752
2768
  switch (t) {
@@ -2766,7 +2782,7 @@ function so({
2766
2782
  isReconnecting: t === "reconnecting"
2767
2783
  });
2768
2784
  case "offline":
2769
- return h();
2785
+ return m();
2770
2786
  case "offlineError":
2771
2787
  return d(e ?? s?.lastError?.message ?? null);
2772
2788
  default:
@@ -2775,17 +2791,17 @@ function so({
2775
2791
  }
2776
2792
  const Ne = be("useIkonApp");
2777
2793
  function io(t) {
2778
- const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, updateUrlOnJoin: c = !0, timeouts: f, audio: l, video: h, mediaSession: d, debug: y } = t, S = w(null), b = w(null), m = w(null), p = w(!1), A = w(l), P = w(h), j = w(d), V = w(y), J = w(f), Z = w(i), k = w(a), C = w(s), M = w(c);
2779
- A.current = l, P.current = h, j.current = d, V.current = y, J.current = f, Z.current = i, k.current = a, C.current = s, M.current = c;
2780
- const [I, L] = ee("idle"), [Y, te] = ee(null), [ne, fe] = ee(null), [G, he] = ee(null), [oe, u] = ee(!1), g = z(() => {
2794
+ const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, updateUrlOnJoin: c = !0, timeouts: f, audio: l, video: m, mediaSession: d, debug: p } = t, b = w(null), S = w(null), h = w(null), g = w(!1), A = w(l), P = w(m), j = w(d), V = w(p), J = w(f), Z = w(i), k = w(a), C = w(s), M = w(c);
2795
+ A.current = l, P.current = m, j.current = d, V.current = p, J.current = f, Z.current = i, k.current = a, C.current = s, M.current = c;
2796
+ const [I, L] = ee("idle"), [z, te] = ee(null), [ne, fe] = ee(null), [G, he] = ee(null), [oe, u] = ee(!1), y = Y(() => {
2781
2797
  try {
2782
2798
  return Ot();
2783
2799
  } catch {
2784
2800
  return { parameters: {} };
2785
2801
  }
2786
- }, []), R = z(() => e?.enabled ? yt() : null, [e?.enabled]), T = r?.enabled ?? !1, K = r?.host ?? "localhost", x = r?.httpsPort ?? 8443;
2802
+ }, []), R = Y(() => e?.enabled ? yt() : null, [e?.enabled]), T = r?.enabled ?? !1, K = r?.host ?? "localhost", x = r?.httpsPort ?? 8443;
2787
2803
  F(() => {
2788
- !T && Ye() && e && !e.enabled && e.spaceId && !G && !oe && (u(!0), bt(e.spaceId, e.authUrl ?? _e()).then((U) => {
2804
+ !T && ze() && e && !e.enabled && e.spaceId && !G && !oe && (u(!0), bt(e.spaceId, e.authUrl ?? _e()).then((U) => {
2789
2805
  he(U.token);
2790
2806
  }).catch((U) => {
2791
2807
  Ne.error("Anonymous auth failed:", U), te(U instanceof Error ? U.message : "Anonymous auth failed");
@@ -2793,7 +2809,7 @@ function io(t) {
2793
2809
  u(!1);
2794
2810
  }));
2795
2811
  }, [T, e, G, oe]);
2796
- const Q = z(() => {
2812
+ const Q = Y(() => {
2797
2813
  if (T) {
2798
2814
  const N = R?.token ? Nt(R.token) ?? pe() : pe();
2799
2815
  return {
@@ -2801,7 +2817,7 @@ function io(t) {
2801
2817
  host: K,
2802
2818
  httpsPort: x,
2803
2819
  userId: N,
2804
- parameters: g.parameters
2820
+ parameters: y.parameters
2805
2821
  }
2806
2822
  };
2807
2823
  }
@@ -2810,36 +2826,36 @@ function io(t) {
2810
2826
  token: R.token,
2811
2827
  spaceId: e.spaceId,
2812
2828
  backendType: We(),
2813
- sessionId: g.sessionId,
2814
- channelKey: g.channelKey,
2815
- parameters: g.parameters
2829
+ sessionId: y.sessionId,
2830
+ channelKey: y.channelKey,
2831
+ parameters: y.parameters
2816
2832
  }
2817
2833
  } : G && e?.spaceId ? {
2818
2834
  sessionToken: {
2819
2835
  token: G,
2820
2836
  spaceId: e.spaceId,
2821
2837
  backendType: We(),
2822
- sessionId: g.sessionId,
2823
- channelKey: g.channelKey,
2824
- parameters: g.parameters
2838
+ sessionId: y.sessionId,
2839
+ channelKey: y.channelKey,
2840
+ parameters: y.parameters
2825
2841
  }
2826
- } : Ye() ? null : {
2842
+ } : ze() ? null : {
2827
2843
  local: {
2828
2844
  host: K,
2829
2845
  httpsPort: x,
2830
2846
  userId: pe(),
2831
- parameters: g.parameters
2847
+ parameters: y.parameters
2832
2848
  }
2833
2849
  };
2834
- }, [T, K, x, R?.token, e?.spaceId, G, g.sessionId, g.channelKey, g.parameters]);
2850
+ }, [T, K, x, R?.token, e?.spaceId, G, y.sessionId, y.channelKey, y.parameters]);
2835
2851
  Ur(ne);
2836
2852
  const se = xr(ne);
2837
2853
  F(() => {
2838
- if (!p.current) {
2839
- if (p.current = !0, m.current = Cr(), n)
2854
+ if (!g.current) {
2855
+ if (g.current = !0, h.current = Cr(), n)
2840
2856
  for (const N of n)
2841
- N(m.current);
2842
- o?.(m.current), m.current.loadRegisteredModules().catch((N) => {
2857
+ N(h.current);
2858
+ o?.(h.current), h.current.loadRegisteredModules().catch((N) => {
2843
2859
  Ne.error("Failed to load UI modules", N);
2844
2860
  });
2845
2861
  }
@@ -2852,45 +2868,45 @@ function io(t) {
2852
2868
  audio: A.current,
2853
2869
  video: P.current,
2854
2870
  mediaSession: j.current,
2855
- onConnectionStateChange: ($) => {
2856
- L($), Z.current?.($);
2871
+ onConnectionStateChange: (B) => {
2872
+ L(B), Z.current?.(B);
2857
2873
  },
2858
- onError: ($) => {
2859
- te($.message), k.current?.($);
2874
+ onError: (B) => {
2875
+ te(B.message), k.current?.(B);
2860
2876
  },
2861
2877
  onJoined: () => {
2862
- const $ = N.globalState?.SessionId;
2863
- M.current && $ && window.history.replaceState(null, "", `/s/${$}${window.location.search}`), C.current?.($);
2878
+ const B = N.globalState?.SessionId;
2879
+ M.current && B && window.history.replaceState(null, "", `/s/${B}${window.location.search}`), C.current?.(B);
2864
2880
  }
2865
2881
  });
2866
- S.current = N;
2882
+ b.current = N;
2867
2883
  const U = new qt({ client: N });
2868
- return b.current = U, fe(U), N.connect().catch(($) => {
2869
- Ne.error("Connection failed:", $);
2884
+ return S.current = U, fe(U), N.connect().catch((B) => {
2885
+ Ne.error("Connection failed:", B);
2870
2886
  }), () => {
2871
- N.disconnect(), S.current = null, U.dispose(), b.current = null;
2887
+ N.disconnect(), b.current = null, U.dispose(), S.current = null;
2872
2888
  };
2873
2889
  }, [Q]);
2874
- const O = B((N, U) => {
2875
- const $ = typeof U == "string" ? U : JSON.stringify(U ?? {});
2876
- S.current?.sendActionCall(N, $);
2890
+ const O = $((N, U) => {
2891
+ const B = typeof U == "string" ? U : JSON.stringify(U ?? {});
2892
+ b.current?.sendActionCall(N, B);
2877
2893
  }, []), H = I === "connected" || I === "reconnecting";
2878
2894
  return {
2879
2895
  connectionState: I,
2880
- error: Y,
2896
+ error: z,
2881
2897
  stores: se,
2882
- client: S.current,
2883
- registry: m.current,
2884
- clientRef: S,
2885
- uiRef: b,
2886
- registryRef: m,
2898
+ client: b.current,
2899
+ registry: h.current,
2900
+ clientRef: b,
2901
+ uiRef: S,
2902
+ registryRef: h,
2887
2903
  onAction: O,
2888
2904
  isReady: H
2889
2905
  };
2890
2906
  }
2891
2907
  function ao(t) {
2892
2908
  const e = w(!1);
2893
- return B(() => {
2909
+ return $(() => {
2894
2910
  if (e.current) return;
2895
2911
  e.current = !0;
2896
2912
  const r = document.createElement("link");
@@ -2908,7 +2924,7 @@ function Kn(t, e) {
2908
2924
  const o = navigator.language.split("-")[0];
2909
2925
  return t.includes(o) ? o : e && t.includes(e) ? e : "en";
2910
2926
  }
2911
- function zn(t, e, r) {
2927
+ function Yn(t, e, r) {
2912
2928
  return e ? Kn(t, r) : r && t.includes(r) ? r : "en";
2913
2929
  }
2914
2930
  function co({
@@ -2917,7 +2933,7 @@ function co({
2917
2933
  defaultLanguage: r,
2918
2934
  detectLanguage: n = !1
2919
2935
  }) {
2920
- const o = Object.keys(e), s = zn(o, n, r), i = e[s] ?? e.en, a = z(
2936
+ const o = Object.keys(e), s = Yn(o, n, r), i = e[s] ?? e.en, a = Y(
2921
2937
  () => ({
2922
2938
  t: (c, f) => {
2923
2939
  const l = i[c];
@@ -2950,8 +2966,8 @@ export {
2950
2966
  qt as IkonUi,
2951
2967
  Tr as IkonUiRegistry,
2952
2968
  Hn as IkonUiSurface,
2953
- Yt as UiComponentRegistry,
2954
- zt as UiRenderer,
2969
+ zt as UiComponentRegistry,
2970
+ Yt as UiRenderer,
2955
2971
  ho as UiStreamStore,
2956
2972
  Xn as areIkonUiModuleListsEqual,
2957
2973
  bt as authenticateAnonymous,
@@ -2982,7 +2998,7 @@ export {
2982
2998
  Re as saveAuthSession,
2983
2999
  to as sendMagicLink,
2984
3000
  de as sessionToUser,
2985
- Bn as useAuth,
3001
+ $n as useAuth,
2986
3002
  oo as useAuthGuard,
2987
3003
  no as useAuthOptional,
2988
3004
  uo as useI18n,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonai/sdk-react-ui",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",