@ikonai/sdk-react-ui 1.0.40 → 1.0.41

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,7 +1,7 @@
1
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";
2
+ import { UiStreamStore as Bo } from "@ikonai/sdk-ui";
3
+ import Lt, { useSyncExternalStore as $e, useMemo as V, memo as Y, useRef as w, useCallback as D, Fragment as jt, useEffect as U, useState as J, createContext as mt, use as Ve } from "react";
4
+ import { createLogger as Re, isInspectModeEnabled as Ut, getOrCreateDeviceId as xt, deriveAuthUrl as Le, parseUrlParams as Dt, clearSessionParamsFromUrl as Ft, isCloudEnvironment as Ge, extractUserIdFromToken as Bt, deriveBackendType as He, IkonClient as $t, AccessDeniedError as Vt, AuthenticationError as Kt, subscribeToLogEvents as Yt, isDebugModeEnabled as zt, LogLevel as Je, getLangParam as Wt } from "@ikonai/sdk";
5
5
  var ge = { exports: {} }, ie = {};
6
6
  /**
7
7
  * @license React
@@ -13,7 +13,7 @@ var ge = { exports: {} }, ie = {};
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
15
  var Xe;
16
- function Wt() {
16
+ function qt() {
17
17
  if (Xe) return ie;
18
18
  Xe = 1;
19
19
  var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
@@ -45,244 +45,244 @@ var ae = {};
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
47
  var Ze;
48
- function qt() {
48
+ function Gt() {
49
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) {
50
+ function t(f) {
51
+ if (f == null) return null;
52
+ if (typeof f == "function")
53
+ return f.$$typeof === x ? null : f.displayName || f.name || null;
54
+ if (typeof f == "string") return f;
55
+ switch (f) {
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 O:
63
63
  return "Suspense";
64
- case Y:
64
+ case K:
65
65
  return "SuspenseList";
66
66
  case _:
67
67
  return "Activity";
68
68
  }
69
- if (typeof d == "object")
70
- switch (typeof d.tag == "number" && console.error(
69
+ if (typeof f == "object")
70
+ switch (typeof f.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
+ ), f.$$typeof) {
73
+ case m:
74
74
  return "Portal";
75
- case A:
76
- return (d.displayName || "Context") + ".Provider";
75
+ case E:
76
+ return (f.displayName || "Context") + ".Provider";
77
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";
78
+ return (f._context.displayName || "Context") + ".Consumer";
84
79
  case T:
85
- S = d._payload, d = d._init;
80
+ var S = f.render;
81
+ return f = f.displayName, f || (f = S.displayName || S.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
82
+ case Q:
83
+ return S = f.displayName || null, S !== null ? S : t(f.type) || "Memo";
84
+ case C:
85
+ S = f._payload, f = f._init;
86
86
  try {
87
- return t(d(S));
87
+ return t(f(S));
88
88
  } catch {
89
89
  }
90
90
  }
91
91
  return null;
92
92
  }
93
- function e(d) {
94
- return "" + d;
93
+ function e(f) {
94
+ return "" + f;
95
95
  }
96
- function r(d) {
96
+ function r(f) {
97
97
  try {
98
- e(d);
98
+ e(f);
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";
106
- return k.call(
105
+ var A = S.error, M = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
106
+ return A.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
+ M
110
+ ), e(f);
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 n(f) {
114
+ if (f === b) return "<>";
115
+ if (typeof f == "object" && f !== null && f.$$typeof === C)
116
116
  return "<...>";
117
117
  try {
118
- var S = t(d);
118
+ var S = t(f);
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 f = P.A;
126
+ return f === null ? null : f.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(f) {
132
+ if (F.call(f, "key")) {
133
+ var S = Object.getOwnPropertyDescriptor(f, "key").get;
134
134
  if (S && S.isReactWarning) return !1;
135
135
  }
136
- return d.key !== void 0;
136
+ return f.key !== void 0;
137
137
  }
138
- function a(d, S) {
139
- function k() {
138
+ function a(f, S) {
139
+ function A() {
140
140
  he || (he = !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", {
146
- get: k,
145
+ A.isReactWarning = !0, Object.defineProperty(f, "key", {
146
+ get: A,
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 f = t(this.type);
152
+ return pe[f] || (pe[f] = !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
+ )), f = this.props.ref, f !== void 0 ? f : 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 h(f, S, A, M, W, I, q, te) {
157
+ return A = I.ref, f = {
158
+ $$typeof: p,
159
+ type: f,
160
160
  key: S,
161
- props: C,
161
+ props: I,
162
162
  _owner: W
163
- }, (k !== void 0 ? k : null) !== null ? Object.defineProperty(d, "ref", {
163
+ }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(f, "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(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._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(f, "_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(f, "_debugStack", {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
180
  value: q
181
- }), Object.defineProperty(d, "_debugTask", {
181
+ }), Object.defineProperty(f, "_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(f.props), Object.freeze(f)), f;
187
187
  }
188
- function l(d, S, k, P, W, C, q, te) {
189
- var O = S.children;
190
- if (O !== void 0)
191
- if (P)
192
- if (z(O)) {
193
- for (P = 0; P < O.length; P++)
194
- u(O[P]);
195
- Object.freeze && Object.freeze(O);
188
+ function d(f, S, A, M, W, I, q, te) {
189
+ var N = S.children;
190
+ if (N !== void 0)
191
+ if (M)
192
+ if (z(N)) {
193
+ for (M = 0; M < N.length; M++)
194
+ l(N[M]);
195
+ Object.freeze && Object.freeze(N);
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(N);
201
201
  if (F.call(S, "key")) {
202
- O = t(d);
202
+ N = t(f);
203
203
  var G = Object.keys(S).filter(function(Te) {
204
204
  return Te !== "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
+ M = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", ee[N + M] || (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,
214
- O,
213
+ M,
214
+ N,
215
215
  G,
216
- O
217
- ), ee[O + P] = !0);
216
+ N
217
+ ), ee[N + M] = !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) {
220
- k = {};
219
+ if (N = null, A !== void 0 && (r(A), N = "" + A), i(S) && (r(S.key), N = "" + S.key), "key" in S) {
220
+ A = {};
221
221
  for (var re in S)
222
- re !== "key" && (k[re] = S[re]);
223
- } else k = S;
224
- return O && a(
225
- k,
226
- typeof d == "function" ? d.displayName || d.name || "Unknown" : d
227
- ), f(
228
- d,
229
- O,
230
- C,
222
+ re !== "key" && (A[re] = S[re]);
223
+ } else A = S;
224
+ return N && a(
225
+ A,
226
+ typeof f == "function" ? f.displayName || f.name || "Unknown" : f
227
+ ), h(
228
+ f,
229
+ N,
230
+ I,
231
231
  W,
232
232
  o(),
233
- k,
233
+ A,
234
234
  q,
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(f) {
239
+ typeof f == "object" && f !== null && f.$$typeof === p && f._store && (f._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 = Lt, p = 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"), v = Symbol.for("react.consumer"), E = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), K = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), x = Symbol.for("react.client.reference"), P = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, z = Array.isArray, ne = 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(f) {
246
+ return f();
247
247
  }
248
248
  };
249
- var he, me = {}, se = h["react-stack-bottom-frame"].bind(
250
- h,
249
+ var he, pe = {}, se = 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 = ne(n(s)), ee = {};
253
+ ae.Fragment = b, ae.jsx = function(f, S, A, M, W) {
254
+ var I = 1e4 > P.recentlyCreatedOwnerStacks++;
255
+ return d(
256
+ f,
257
257
  S,
258
- k,
258
+ A,
259
259
  !1,
260
- P,
260
+ M,
261
261
  W,
262
- C ? Error("react-stack-top-frame") : se,
263
- C ? ne(n(d)) : pe
262
+ I ? Error("react-stack-top-frame") : se,
263
+ I ? ne(n(f)) : me
264
264
  );
265
- }, ae.jsxs = function(d, S, k, P, W) {
266
- var C = 1e4 > N.recentlyCreatedOwnerStacks++;
267
- return l(
268
- d,
265
+ }, ae.jsxs = function(f, S, A, M, W) {
266
+ var I = 1e4 > P.recentlyCreatedOwnerStacks++;
267
+ return d(
268
+ f,
269
269
  S,
270
- k,
270
+ A,
271
271
  !0,
272
- P,
272
+ M,
273
273
  W,
274
- C ? Error("react-stack-top-frame") : se,
275
- C ? ne(n(d)) : pe
274
+ I ? Error("react-stack-top-frame") : se,
275
+ I ? ne(n(f)) : me
276
276
  );
277
277
  };
278
278
  }()), ae;
279
279
  }
280
280
  var Qe;
281
- function Gt() {
282
- return Qe || (Qe = 1, process.env.NODE_ENV === "production" ? ge.exports = Wt() : ge.exports = qt()), ge.exports;
281
+ function Ht() {
282
+ return Qe || (Qe = 1, process.env.NODE_ENV === "production" ? ge.exports = qt() : ge.exports = Gt()), ge.exports;
283
283
  }
284
- var E = Gt();
285
- function Ht(t, e) {
284
+ var R = Ht();
285
+ function Jt(t, e) {
286
286
  const r = $e(
287
287
  (n) => t.subscribe(n),
288
288
  () => {
@@ -310,8 +310,8 @@ function Z(t, e) {
310
310
  );
311
311
  return V(() => t.getNode(e), [t, e, r]);
312
312
  }
313
- const Jt = Ee("UIRenderer");
314
- function Xt(t) {
313
+ const Xt = Re("UIRenderer");
314
+ function Zt(t) {
315
315
  if (t === void 0)
316
316
  return "{}";
317
317
  if (typeof t == "string")
@@ -322,18 +322,18 @@ function Xt(t) {
322
322
  return "{}";
323
323
  }
324
324
  }
325
- function Zt(t) {
325
+ function Qt(t) {
326
326
  const e = t.styleIds;
327
327
  return Array.isArray(e) ? e : [];
328
328
  }
329
- function Qt(t) {
329
+ function er(t) {
330
330
  const e = t.children;
331
331
  return Array.isArray(e) ? e : [];
332
332
  }
333
- function er(t, e) {
333
+ function tr(t, e) {
334
334
  return t.nodeId === e.nodeId && t.context === e.context;
335
335
  }
336
- function tr(t) {
336
+ function rr(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;
@@ -341,66 +341,66 @@ function tr(t) {
341
341
  e += "," + t[r].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 = Y(function t({ nodeId: e, context: r }) {
345
+ const n = Z(r.store, e), o = n ? er(n) : [], s = rr(o), i = V(
346
+ () => o.length === 0 ? null : o.map((l) => /* @__PURE__ */ R.jsx(t, { nodeId: l.id, context: r }, l.id)),
347
347
  // eslint-disable-next-line react-hooks/exhaustive-deps
348
348
  [s, r]
349
349
  );
350
350
  if (!n)
351
351
  return null;
352
352
  if (n.type === "root")
353
- return /* @__PURE__ */ E.jsx(Ut, { children: i }, n.id);
353
+ return /* @__PURE__ */ R.jsx(jt, { children: i }, n.id);
354
354
  const a = r.library.resolve(n);
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
- }
356
+ return Xt.warn(`No renderer for node type ${n.type}`), null;
357
+ const c = Qt(n), h = c.length > 0 ? c.join(" ") : void 0, d = a;
358
+ return /* @__PURE__ */ R.jsx(d, { nodeId: e, context: r, className: h });
359
+ }, tr);
363
360
  function nr(t, e) {
361
+ return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ R.jsx(je, { nodeId: r.id, context: e }, r.id));
362
+ }
363
+ function or(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 sr = Y(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
367
+ const { rootViewId: c, rootNodeId: h } = Jt(e, n), d = w(s);
368
+ d.current = s;
369
+ const l = w(i);
370
+ l.current = i;
371
+ const u = w(a);
372
+ u.current = a;
373
+ const p = 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 = Zt(g);
377
+ d.current?.(b, y);
378
+ }, []), m = V(() => {
379
379
  const b = {
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) => 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) => nr(g, b),
386
+ renderView: (g) => {
387
+ const y = e.getSnapshot().views.get(g);
388
+ return y ? /* @__PURE__ */ R.jsx(je, { nodeId: y.id, context: b }) : 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 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 {
400
+ }, [e, r, p]);
401
+ return !c || !h ? o : /* @__PURE__ */ R.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ R.jsx(je, { nodeId: h, context: m }) });
402
+ }, or);
403
+ class ir {
404
404
  constructor(e, r) {
405
405
  if (this.fallback = r, e)
406
406
  for (const [n, o] of 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) {
420
+ function Eo(t, e) {
421
421
  const r = Object.entries(t);
422
- return new sr(r, e);
422
+ return new ir(r, e);
423
423
  }
424
- function vo(t) {
424
+ function Ro(t) {
425
425
  return $e(
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 ar() {
432
+ const t = Ut();
433
+ return U(() => {
434
+ if (!t)
435
+ return;
436
+ let e = null, r = [];
437
+ const n = document.createElement("div");
438
+ n.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(n);
439
+ function o() {
440
+ e && !r.includes(e) && (e.style.outline = "", e.style.outlineOffset = ""), e = null, n.style.display = "none";
441
+ }
442
+ function s(u) {
443
+ for (const m of r)
444
+ m !== e && (m.style.outline = "", m.style.outlineOffset = "");
445
+ r = [];
446
+ const p = new Set(u);
447
+ for (const m of document.querySelectorAll("[data-ikon-source]")) {
448
+ const b = m.getAttribute("data-ikon-source") ?? "";
449
+ p.has(b) && (m.style.outline = "2px solid #a6e3a1", m.style.outlineOffset = "1px", r.push(m));
450
+ }
451
+ }
452
+ function i(u) {
453
+ const p = u.target.closest?.("[data-ikon-source]");
454
+ if (!p || p === e)
455
+ return;
456
+ o(), e = p, e.style.outline = "2px solid #89b4fa", e.style.outlineOffset = "1px";
457
+ const m = p.getAttribute("data-ikon-source") ?? "";
458
+ n.textContent = m, n.style.display = "block";
459
+ const b = p.getBoundingClientRect();
460
+ n.style.left = `${b.left}px`, n.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 p = u.target.closest?.("[data-ikon-source]");
467
+ if (!p)
468
+ return;
469
+ u.preventDefault(), u.stopPropagation();
470
+ const m = {
471
+ sourceMarker: p.getAttribute("data-ikon-source") ?? "",
472
+ tagName: p.tagName.toLowerCase(),
473
+ textContent: (p.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 h(u, p) {
478
+ return document.elementFromPoint(u, p)?.closest?.("[data-ikon-source]");
479
+ }
480
+ function d(u) {
481
+ if (u === e || (o(), !u))
482
+ return;
483
+ e = u, e.style.outline = `2px solid ${r.includes(u) ? "#a6e3a1" : "#89b4fa"}`, e.style.outlineOffset = "1px";
484
+ const p = u.getAttribute("data-ikon-source") ?? "";
485
+ n.textContent = p, n.style.display = "block";
486
+ const m = u.getBoundingClientRect();
487
+ n.style.left = `${m.left}px`, n.style.top = `${Math.max(0, m.top - 24)}px`;
488
+ }
489
+ function l(u) {
490
+ if (u.data?.type === "ikon-inspect-at") {
491
+ const p = h(u.data.x, u.data.y);
492
+ d(p);
493
+ const m = p?.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 p = h(u.data.x, u.data.y);
501
+ if (p) {
502
+ const m = {
503
+ sourceMarker: p.getAttribute("data-ikon-source") ?? "",
504
+ tagName: p.tagName.toLowerCase(),
505
+ textContent: (p.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 p = h(u.data.x, u.data.y);
512
+ if (p) {
513
+ const m = {
514
+ sourceMarker: p.getAttribute("data-ikon-source") ?? "",
515
+ tagName: p.tagName.toLowerCase(),
516
+ textContent: (p.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: p, y1: m, x2: b, y2: g, append: y } = u.data, v = document.querySelectorAll("[data-ikon-source]"), E = [];
526
+ for (const T of v) {
527
+ const O = T.getBoundingClientRect();
528
+ O.right > p && O.left < b && O.bottom > m && O.top < g && E.push({
529
+ sourceMarker: T.getAttribute("data-ikon-source") ?? "",
530
+ tagName: T.tagName.toLowerCase(),
531
+ textContent: (T.textContent ?? "").trim().substring(0, 200)
532
+ });
533
+ }
534
+ E.length > 0 && window.parent.postMessage({
535
+ type: "ikon-inspect-rect-result",
536
+ payload: { elements: E, 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([]), n.remove();
543
+ };
544
+ }, [t]), null;
545
+ }
546
+ const Ue = "ikon-ui";
547
+ function cr(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 }) {
550
+ const ko = Y(function({ stores: e, registry: r, category: n = Ue, onAction: o, client: s }) {
436
551
  const i = V(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
437
552
  a.current = o;
438
553
  const c = w(s);
439
554
  c.current = s;
440
- const f = V(
555
+ const h = V(
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 d = [];
558
+ for (const [l, u] of e) {
559
+ const p = u.store.getSnapshot();
560
+ cr(u.category, n) && (!p.rootViewId || !p.views.has(p.rootViewId) || d.push({ key: l, store: u.store }));
446
561
  }
447
- return l;
562
+ return d;
448
563
  },
449
564
  // eslint-disable-next-line react-hooks/exhaustive-deps
450
565
  [e, n, 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 h.length === 0 ? null : /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
568
+ /* @__PURE__ */ R.jsx(ar, {}),
569
+ h.map(({ key: d, store: l }) => /* @__PURE__ */ R.jsx(sr, { store: l, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, d))
570
+ ] });
453
571
  });
454
- class ar {
572
+ class ur {
455
573
  core;
456
574
  ownsCore;
457
575
  stores = /* @__PURE__ */ new Map();
@@ -509,7 +627,7 @@ class ar {
509
627
  if (r)
510
628
  return r;
511
629
  const n = {
512
- category: Le,
630
+ category: Ue,
513
631
  store: new Mt()
514
632
  };
515
633
  return this.stores.set(e, n), n;
@@ -518,7 +636,7 @@ class ar {
518
636
  const n = this.stores.get(e);
519
637
  if (!n)
520
638
  return !1;
521
- const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? Le;
639
+ const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? Ue;
522
640
  return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
523
641
  }
524
642
  notify(e) {
@@ -526,7 +644,7 @@ class ar {
526
644
  r(e);
527
645
  }
528
646
  }
529
- function cr(t) {
647
+ function lr(t) {
530
648
  if (typeof t == "string") {
531
649
  const e = t.trim();
532
650
  return e.length > 0 ? e : void 0;
@@ -551,10 +669,10 @@ function Ke(...t) {
551
669
  }
552
670
  return e || void 0;
553
671
  }
554
- const et = /* @__PURE__ */ new WeakMap(), ur = {};
672
+ const et = /* @__PURE__ */ new WeakMap(), dr = {};
555
673
  function Ye(t) {
556
674
  if (!t)
557
- return ur;
675
+ return dr;
558
676
  const e = et.get(t);
559
677
  if (e)
560
678
  return e;
@@ -563,45 +681,45 @@ function Ye(t) {
563
681
  o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
564
682
  return et.set(t, r), r;
565
683
  }
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;
684
+ function fr() {
685
+ const t = Y(function({ nodeId: r, context: n }) {
686
+ 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, h = fe(o?.props?.key), d = o?.props?.preciseGeneratedAt;
569
687
  return U(() => {
570
688
  if (typeof document > "u")
571
689
  return;
572
- const h = s.current;
573
- if (!h || i && h.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
690
+ const u = s.current;
691
+ if (!u || i && u.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
574
692
  return;
575
693
  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;
694
+ const y = ((v) => {
695
+ let E = v.parentElement;
696
+ for (; E; ) {
697
+ const O = window.getComputedStyle(E).overflowY;
698
+ if (O === "auto" || O === "scroll" || E.hasAttribute("data-radix-scroll-area-viewport"))
699
+ return E;
700
+ E = E.parentElement;
583
701
  }
584
702
  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(() => {
703
+ })(u);
704
+ y ? requestAnimationFrame(() => {
705
+ const v = y.getBoundingClientRect(), E = u.getBoundingClientRect(), T = y.scrollTop + (E.bottom - v.bottom) + 16;
706
+ "scrollBehavior" in document.documentElement.style ? y.scrollTo({ top: T, behavior: "smooth" }) : y.scrollTop = T;
707
+ }) : typeof u.scrollIntoView == "function" && requestAnimationFrame(() => {
590
708
  try {
591
- h.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
709
+ u.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
592
710
  } catch {
593
- h.scrollIntoView(!1);
711
+ u.scrollIntoView(!1);
594
712
  }
595
713
  });
596
714
  }
597
- const p = document.activeElement;
598
- if (!(p instanceof HTMLInputElement || p instanceof HTMLTextAreaElement || p?.getAttribute("contenteditable") === "true") && typeof h.focus == "function")
715
+ const m = document.activeElement;
716
+ if (!(m instanceof HTMLInputElement || m instanceof HTMLTextAreaElement || m?.getAttribute("contenteditable") === "true") && typeof u.focus == "function")
599
717
  try {
600
- h.focus({ preventScroll: !0 });
718
+ u.focus({ preventScroll: !0 });
601
719
  } catch {
602
- h.focus();
720
+ u.focus();
603
721
  }
604
- }, [c, i, f, l]), o ? /* @__PURE__ */ E.jsx(
722
+ }, [c, i, h, d]), o ? /* @__PURE__ */ R.jsx(
605
723
  "span",
606
724
  {
607
725
  ref: s,
@@ -619,26 +737,26 @@ function lr() {
619
737
  return t;
620
738
  };
621
739
  }
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(() => {
740
+ function hr() {
741
+ const t = Y(function({ nodeId: r, context: n, className: o }) {
742
+ const s = Z(n.store, r), i = lr(s?.props?.onInvokeId), a = D(() => {
625
743
  i && n.dispatchAction(i);
626
744
  }, [i, n]);
627
745
  if (!s)
628
746
  return null;
629
747
  const c = Ye(s.props);
630
748
  delete c.onInvokeId;
631
- const f = Ke(fe(s.props?.className), o), l = s.children?.length ? n.renderChildren(s.children) : void 0;
632
- return /* @__PURE__ */ E.jsx(
749
+ const h = Ke(fe(s.props?.className), o), d = s.children?.length ? n.renderChildren(s.children) : void 0;
750
+ return /* @__PURE__ */ R.jsx(
633
751
  "div",
634
752
  {
635
753
  ...c,
636
754
  "data-ikon-node-id": s.id,
637
755
  "data-ikon-source": s.sourceMarker,
638
- className: f,
756
+ className: h,
639
757
  onClick: i ? a : void 0,
640
758
  style: i ? { cursor: "pointer" } : void 0,
641
- children: l
759
+ children: d
642
760
  }
643
761
  );
644
762
  });
@@ -647,45 +765,45 @@ function dr() {
647
765
  return t;
648
766
  };
649
767
  }
650
- function fr() {
651
- const t = K(function({ nodeId: r, context: n, className: o }) {
768
+ function pr() {
769
+ const t = Y(function({ nodeId: r, context: n, className: o }) {
652
770
  const s = Z(n.store, r);
653
771
  if (!s)
654
772
  return null;
655
773
  const i = Ye(s.props), a = Ke("relative", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
656
- return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
774
+ return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
657
775
  });
658
776
  return ({ type: e }) => {
659
777
  if (e === "std.stack")
660
778
  return t;
661
779
  };
662
780
  }
663
- function hr() {
664
- const t = K(function({ nodeId: r, context: n, className: o }) {
781
+ function mr() {
782
+ const t = Y(function({ nodeId: r, context: n, className: o }) {
665
783
  const s = Z(n.store, r);
666
784
  if (!s)
667
785
  return null;
668
786
  const i = Ye(s.props), a = Ke("absolute", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
669
- return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
787
+ return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
670
788
  });
671
789
  return ({ type: e }) => {
672
790
  if (e === "std.layer")
673
791
  return t;
674
792
  };
675
793
  }
676
- function mr() {
794
+ function gr() {
677
795
  return [
678
- dr(),
679
- fr(),
680
796
  hr(),
681
- lr()
797
+ pr(),
798
+ mr(),
799
+ fr()
682
800
  ];
683
801
  }
684
- const pr = "base", gr = async () => mr();
685
- function yr(t) {
686
- t.registerModule(pr, gr);
802
+ const yr = "base", br = async () => gr();
803
+ function Sr(t) {
804
+ t.registerModule(yr, br);
687
805
  }
688
- function br(t) {
806
+ function wr(t) {
689
807
  if (typeof t == "string") {
690
808
  const e = t.trim();
691
809
  return e.length > 0 ? e : void 0;
@@ -695,7 +813,7 @@ function br(t) {
695
813
  return e.length > 0 ? e.join(" ") : void 0;
696
814
  }
697
815
  }
698
- function Sr(...t) {
816
+ function vr(...t) {
699
817
  const e = [];
700
818
  for (const r of t)
701
819
  r && r.trim() && e.push(r.trim());
@@ -716,9 +834,9 @@ function ye(t) {
716
834
  if (e === "false") return !1;
717
835
  }
718
836
  }
719
- const wr = "std.audio-url-player";
720
- function vr() {
721
- const t = K(function({
837
+ const Er = "std.audio-url-player";
838
+ function Rr() {
839
+ const t = Y(function({
722
840
  nodeId: r,
723
841
  context: n,
724
842
  className: o
@@ -726,16 +844,16 @@ function vr() {
726
844
  const s = Z(n.store, r);
727
845
  if (!s)
728
846
  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);
730
- return /* @__PURE__ */ E.jsx(
847
+ const i = vr(wr(s.props?.className), o), a = tt(s.props?.src), c = tt(s.props?.preload), h = ye(s.props?.controls), d = ye(s.props?.autoplay), l = ye(s.props?.loop), u = ye(s.props?.muted);
848
+ return /* @__PURE__ */ R.jsx(
731
849
  "audio",
732
850
  {
733
851
  src: a,
734
852
  ...c !== void 0 ? { preload: c } : {},
735
- ...f !== void 0 ? { controls: f } : {},
736
- ...l !== void 0 ? { autoPlay: l } : {},
737
- ...u !== void 0 ? { loop: u } : {},
738
- ...h !== void 0 ? { muted: h } : {},
853
+ ...h !== void 0 ? { controls: h } : {},
854
+ ...d !== void 0 ? { autoPlay: d } : {},
855
+ ...l !== void 0 ? { loop: l } : {},
856
+ ...u !== void 0 ? { muted: u } : {},
739
857
  "data-ikon-node-id": s.id,
740
858
  "data-ikon-source": s.sourceMarker,
741
859
  className: i
@@ -743,7 +861,7 @@ function vr() {
743
861
  );
744
862
  });
745
863
  return ({ type: e }) => {
746
- if (e === wr)
864
+ if (e === Er)
747
865
  return t;
748
866
  };
749
867
  }
@@ -778,23 +896,23 @@ function xe(t) {
778
896
  const e = t.trim();
779
897
  return e.length > 0 ? e : void 0;
780
898
  }
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;
899
+ const kr = "std.video-canvas", Ar = "std.video-url-player";
900
+ function Tr() {
901
+ const t = Y(function({ nodeId: r, context: n, className: o }) {
902
+ const s = Z(n.store, r), i = w(null), a = w(null), c = n.video, h = n.client, d = s ? xe(s.props?.streamId) : void 0, l = s ? Se(s.props?.width) : void 0, u = s ? Se(s.props?.height) : void 0, p = s ? yt(gt(s.props?.className), o) : o, m = h?.isWebRtcEnabled && d ? h.getWebRtcVideoStreamByStreamId(d) : null;
785
903
  return U(() => {
786
904
  const b = i.current;
787
- if (!(!c || !b || !l || p))
788
- return c.attachCanvas(l, b), () => {
789
- c.detachCanvas(l);
905
+ if (!(!c || !b || !d || m))
906
+ return c.attachCanvas(d, b), () => {
907
+ c.detachCanvas(d);
790
908
  };
791
- }, [c, l, p]), U(() => {
909
+ }, [c, d, m]), U(() => {
792
910
  const b = a.current;
793
- if (!(!b || !p))
794
- return b.srcObject = p, () => {
911
+ if (!(!b || !m))
912
+ return b.srcObject = m, () => {
795
913
  b.srcObject = null;
796
914
  };
797
- }, [p]), s ? p ? /* @__PURE__ */ E.jsx(
915
+ }, [m]), s ? m ? /* @__PURE__ */ R.jsx(
798
916
  "video",
799
917
  {
800
918
  ref: a,
@@ -803,33 +921,33 @@ function Ar() {
803
921
  muted: !0,
804
922
  "data-ikon-node-id": s.id,
805
923
  "data-ikon-source": s.sourceMarker,
806
- "data-ikon-video-stream-id": l,
807
- className: y,
808
- ...u ? { width: u } : {},
809
- ...h ? { height: h } : {}
924
+ "data-ikon-video-stream-id": d,
925
+ className: p,
926
+ ...l ? { width: l } : {},
927
+ ...u ? { height: u } : {}
810
928
  },
811
- l
812
- ) : /* @__PURE__ */ E.jsx(
929
+ d
930
+ ) : /* @__PURE__ */ R.jsx(
813
931
  "canvas",
814
932
  {
815
933
  ref: i,
816
934
  "data-ikon-node-id": s.id,
817
935
  "data-ikon-source": s.sourceMarker,
818
- "data-ikon-video-stream-id": l,
819
- className: y,
820
- ...u ? { width: u } : {},
821
- ...h ? { height: h } : {}
936
+ "data-ikon-video-stream-id": d,
937
+ className: p,
938
+ ...l ? { width: l } : {},
939
+ ...u ? { height: u } : {}
822
940
  },
823
- l
941
+ d
824
942
  ) : null;
825
943
  });
826
944
  return ({ type: e }) => {
827
- if (e === Rr)
945
+ if (e === kr)
828
946
  return t;
829
947
  };
830
948
  }
831
- function kr() {
832
- return [Ar(), Tr(), vr()];
949
+ function Cr() {
950
+ return [Tr(), Ir(), Rr()];
833
951
  }
834
952
  function ce(t) {
835
953
  if (typeof t == "boolean")
@@ -840,8 +958,8 @@ function ce(t) {
840
958
  if (e === "false") return !1;
841
959
  }
842
960
  }
843
- function Tr() {
844
- const t = K(function({
961
+ function Ir() {
962
+ const t = Y(function({
845
963
  nodeId: r,
846
964
  context: n,
847
965
  className: o
@@ -849,48 +967,48 @@ function Tr() {
849
967
  const s = Z(n.store, r);
850
968
  if (!s)
851
969
  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;
853
- return /* @__PURE__ */ E.jsx(
970
+ const i = yt(gt(s.props?.className), o), a = xe(s.props?.src), c = xe(s.props?.poster), h = ce(s.props?.controls), d = ce(s.props?.autoplay), l = ce(s.props?.loop), u = ce(s.props?.muted), p = ce(s.props?.playsInline), m = Se(s.props?.width), b = Se(s.props?.height), g = s.children?.length ? n.renderChildren(s.children) : void 0;
971
+ return /* @__PURE__ */ R.jsx(
854
972
  "video",
855
973
  {
856
974
  src: a,
857
975
  poster: c,
858
- ...f !== void 0 ? { controls: f } : {},
859
- ...l !== void 0 ? { autoPlay: l } : {},
860
- ...u !== void 0 ? { loop: u } : {},
861
- ...h !== void 0 ? { muted: h } : {},
862
- ...y !== void 0 ? { playsInline: y } : {},
863
- ...p ? { width: p } : {},
976
+ ...h !== void 0 ? { controls: h } : {},
977
+ ...d !== void 0 ? { autoPlay: d } : {},
978
+ ...l !== void 0 ? { loop: l } : {},
979
+ ...u !== void 0 ? { muted: u } : {},
980
+ ...p !== void 0 ? { playsInline: p } : {},
981
+ ...m ? { width: m } : {},
864
982
  ...b ? { height: b } : {},
865
983
  "data-ikon-node-id": s.id,
866
984
  "data-ikon-source": s.sourceMarker,
867
985
  className: i,
868
- children: m
986
+ children: g
869
987
  }
870
988
  );
871
989
  });
872
990
  return ({ type: e }) => {
873
- if (e === Er)
991
+ if (e === Ar)
874
992
  return t;
875
993
  };
876
994
  }
877
- const Cr = "media", Ir = async () => kr();
878
- function Or(t) {
879
- t.registerModule(Cr, Ir);
995
+ const Or = "media", Nr = async () => Cr();
996
+ function _r(t) {
997
+ t.registerModule(Or, Nr);
880
998
  }
881
- const _r = `#version 300 es
999
+ const Pr = `#version 300 es
882
1000
  in vec4 a_position;
883
1001
  void main() {
884
1002
  gl_Position = a_position;
885
1003
  }
886
1004
  `;
887
- function Nr(t, e) {
1005
+ function Mr(t, e) {
888
1006
  return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
889
1007
  }
890
- function Pr(t, e) {
1008
+ function Lr(t, e) {
891
1009
  const r = [];
892
1010
  for (const [n, o] of Object.entries(e)) {
893
- if (Nr(t, n))
1011
+ if (Mr(t, n))
894
1012
  continue;
895
1013
  let s;
896
1014
  switch (o.type) {
@@ -943,7 +1061,7 @@ void main() {
943
1061
  }
944
1062
  `;
945
1063
  }
946
- class Mr {
1064
+ class jr {
947
1065
  gl;
948
1066
  program = null;
949
1067
  positionBuffer = null;
@@ -979,10 +1097,10 @@ class Mr {
979
1097
  }
980
1098
  compile(e, r = {}) {
981
1099
  this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
982
- const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, _r);
1100
+ const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, Pr);
983
1101
  if (!o)
984
1102
  return !1;
985
- const s = Pr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
1103
+ const s = Lr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
986
1104
  if (!i)
987
1105
  return n.deleteShader(o), !1;
988
1106
  const a = n.createProgram();
@@ -1020,46 +1138,46 @@ class Mr {
1020
1138
  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
1139
  const c = this.uniformLocations.get("iResolution");
1022
1140
  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);
1141
+ const h = this.uniformLocations.get("iTime");
1142
+ h && e.uniform1f(h, i);
1143
+ const d = this.uniformLocations.get("iTimeDelta");
1144
+ d && e.uniform1f(d, a);
1145
+ const l = this.uniformLocations.get("iFrame");
1146
+ l && e.uniform1i(l, this.frameCount);
1147
+ const u = this.uniformLocations.get("iMouse");
1148
+ u && e.uniform4f(u, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
1149
+ const p = this.uniformLocations.get("iDate");
1150
+ if (p) {
1151
+ const m = /* @__PURE__ */ new Date();
1152
+ e.uniform4f(p, m.getFullYear(), m.getMonth(), m.getDate(), m.getHours() * 3600 + m.getMinutes() * 60 + m.getSeconds() + m.getMilliseconds() / 1e3);
1035
1153
  }
1036
- for (const [p, b] of Object.entries(this.customUniforms)) {
1037
- const m = this.uniformLocations.get(p);
1038
- if (m)
1154
+ for (const [m, b] of Object.entries(this.customUniforms)) {
1155
+ const g = this.uniformLocations.get(m);
1156
+ if (g)
1039
1157
  switch (b.type) {
1040
1158
  case "float":
1041
- e.uniform1f(m, b.value);
1159
+ e.uniform1f(g, b.value);
1042
1160
  break;
1043
1161
  case "vec2": {
1044
- const g = b.value;
1045
- e.uniform2f(m, g[0], g[1]);
1162
+ const y = b.value;
1163
+ e.uniform2f(g, y[0], y[1]);
1046
1164
  break;
1047
1165
  }
1048
1166
  case "vec3": {
1049
- const g = b.value;
1050
- e.uniform3f(m, g[0], g[1], g[2]);
1167
+ const y = b.value;
1168
+ e.uniform3f(g, y[0], y[1], y[2]);
1051
1169
  break;
1052
1170
  }
1053
1171
  case "vec4": {
1054
- const g = b.value;
1055
- e.uniform4f(m, g[0], g[1], g[2], g[3]);
1172
+ const y = b.value;
1173
+ e.uniform4f(g, y[0], y[1], y[2], y[3]);
1056
1174
  break;
1057
1175
  }
1058
1176
  case "int":
1059
- e.uniform1i(m, b.value);
1177
+ e.uniform1i(g, b.value);
1060
1178
  break;
1061
1179
  case "bool":
1062
- e.uniform1i(m, b.value ? 1 : 0);
1180
+ e.uniform1i(g, b.value ? 1 : 0);
1063
1181
  break;
1064
1182
  }
1065
1183
  }
@@ -1073,7 +1191,7 @@ class Mr {
1073
1191
  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
1192
  }
1075
1193
  }
1076
- function jr(t) {
1194
+ function Ur(t) {
1077
1195
  if (typeof t == "string") {
1078
1196
  const e = t.trim();
1079
1197
  return e.length > 0 ? e : void 0;
@@ -1083,7 +1201,7 @@ function jr(t) {
1083
1201
  return e.length > 0 ? e.join(" ") : void 0;
1084
1202
  }
1085
1203
  }
1086
- function Ur(...t) {
1204
+ function xr(...t) {
1087
1205
  const e = [];
1088
1206
  for (const r of t)
1089
1207
  r && r.trim() && e.push(r.trim());
@@ -1098,10 +1216,10 @@ function Ce(t) {
1098
1216
  return Math.floor(e);
1099
1217
  }
1100
1218
  }
1101
- function Lr(t) {
1219
+ function Dr(t) {
1102
1220
  return typeof t == "string" ? t : "";
1103
1221
  }
1104
- function xr(t) {
1222
+ function Fr(t) {
1105
1223
  if (typeof t == "boolean")
1106
1224
  return t;
1107
1225
  if (typeof t == "string") {
@@ -1110,7 +1228,7 @@ function xr(t) {
1110
1228
  if (e === "false") return !1;
1111
1229
  }
1112
1230
  }
1113
- function Dr(t) {
1231
+ function Br(t) {
1114
1232
  if (!t || typeof t != "object")
1115
1233
  return {};
1116
1234
  const e = {}, r = t;
@@ -1125,7 +1243,7 @@ function Dr(t) {
1125
1243
  }
1126
1244
  return e;
1127
1245
  }
1128
- function Fr(t, e) {
1246
+ function $r(t, e) {
1129
1247
  const r = Object.keys(t), n = Object.keys(e);
1130
1248
  if (r.length !== n.length)
1131
1249
  return !1;
@@ -1146,21 +1264,21 @@ function Fr(t, e) {
1146
1264
  }
1147
1265
  return !0;
1148
1266
  }
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({
1267
+ const Vr = "std.shadertoy-canvas";
1268
+ function Kr() {
1269
+ const t = Y(function({ nodeId: r, context: n, className: o }) {
1270
+ const s = Z(n.store, r), i = w(null), a = w(null), c = w(null), h = w(0), d = w(""), l = w({}), u = w({
1153
1271
  x: 0,
1154
1272
  y: 0,
1155
1273
  clickX: 0,
1156
1274
  clickY: 0,
1157
1275
  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;
1276
+ }), p = s ? Dr(s.props?.shaderSource) : "", m = s ? Ce(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, g = V(() => Br(b), [b]), y = s ? Fr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ce(s.props?.width) : void 0, E = s ? Ce(s.props?.height) : void 0, T = s ? xr(Ur(s.props?.className), o) : o;
1159
1277
  U(() => {
1160
- const T = i.current;
1161
- if (T) {
1278
+ const C = i.current;
1279
+ if (C) {
1162
1280
  try {
1163
- const _ = new Mr(T);
1281
+ const _ = new jr(C);
1164
1282
  a.current = _;
1165
1283
  } catch (_) {
1166
1284
  console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", _);
@@ -1170,76 +1288,76 @@ function $r() {
1170
1288
  };
1171
1289
  }
1172
1290
  }, []), 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;
1291
+ const C = a.current;
1292
+ if (!(!C || !p) && d.current !== p)
1293
+ if (C.compile(p, g))
1294
+ d.current = p, l.current = g;
1177
1295
  else {
1178
- const x = T.getError();
1296
+ const x = C.getError();
1179
1297
  console.error("[ShadertoyRenderer] Shader compilation failed:", x);
1180
1298
  }
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);
1299
+ }, [p, g]), U(() => {
1300
+ const C = a.current;
1301
+ !C || !d.current || $r(l.current, g) || (C.setCustomUniforms(g), l.current = g);
1302
+ }, [g]), U(() => {
1303
+ const C = a.current;
1304
+ if (!C || !d.current) return;
1305
+ const _ = 1e3 / m, x = (P) => {
1306
+ const F = P - h.current;
1307
+ F >= _ && (h.current = P - F % _, C.draw()), c.current = requestAnimationFrame(x);
1190
1308
  };
1191
1309
  return c.current = requestAnimationFrame(x), () => {
1192
1310
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
1193
1311
  };
1194
- }, [p]);
1195
- const L = D(
1196
- (T) => {
1197
- if (!g) return;
1312
+ }, [m]);
1313
+ const O = D(
1314
+ (C) => {
1315
+ if (!y) return;
1198
1316
  const _ = i.current, x = a.current;
1199
1317
  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);
1318
+ const P = _.getBoundingClientRect(), F = C.clientX - P.left, z = P.height - (C.clientY - P.top);
1319
+ u.current.x = F, u.current.y = z, x.setMouse(F, z, u.current.clickX, u.current.clickY);
1202
1320
  },
1203
- [g]
1204
- ), Y = D(
1205
- (T) => {
1206
- if (!g) return;
1321
+ [y]
1322
+ ), K = D(
1323
+ (C) => {
1324
+ if (!y) return;
1207
1325
  const _ = i.current, x = a.current;
1208
1326
  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);
1327
+ const P = _.getBoundingClientRect(), F = C.clientX - P.left, z = P.height - (C.clientY - P.top);
1328
+ u.current.isDown = !0, u.current.clickX = F, u.current.clickY = z, x.setMouse(F, z, F, z);
1211
1329
  },
1212
- [g]
1330
+ [y]
1213
1331
  ), Q = D(() => {
1214
- g && (h.current.isDown = !1, h.current.clickX = -Math.abs(h.current.clickX));
1215
- }, [g]);
1216
- return s ? /* @__PURE__ */ E.jsx(
1332
+ y && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
1333
+ }, [y]);
1334
+ return s ? /* @__PURE__ */ R.jsx(
1217
1335
  "canvas",
1218
1336
  {
1219
1337
  ref: i,
1220
1338
  "data-ikon-node-id": s.id,
1221
1339
  "data-ikon-source": s.sourceMarker,
1222
- className: I,
1340
+ className: T,
1223
1341
  ...v ? { width: v } : {},
1224
- ...A ? { height: A } : {},
1225
- onMouseMove: L,
1226
- onMouseDown: Y,
1342
+ ...E ? { height: E } : {},
1343
+ onMouseMove: O,
1344
+ onMouseDown: K,
1227
1345
  onMouseUp: Q,
1228
1346
  onMouseLeave: Q
1229
1347
  }
1230
1348
  ) : null;
1231
1349
  });
1232
1350
  return ({ type: e }) => {
1233
- if (e === Br)
1351
+ if (e === Vr)
1234
1352
  return t;
1235
1353
  };
1236
1354
  }
1237
- const Vr = "shadertoy", Kr = async () => $r();
1238
- function Yr(t) {
1239
- t.registerModule(Vr, Kr);
1355
+ const Yr = "shadertoy", zr = async () => Kr();
1356
+ function Wr(t) {
1357
+ t.registerModule(Yr, zr);
1240
1358
  }
1241
- const rt = Ee("UIRegistry");
1242
- class zr {
1359
+ const rt = Re("UIRegistry");
1360
+ class qr {
1243
1361
  baseResolvers = [];
1244
1362
  moduleLoaders = /* @__PURE__ */ new Map();
1245
1363
  moduleResolvers = /* @__PURE__ */ new Map();
@@ -1261,7 +1379,7 @@ class zr {
1261
1379
  for (const [n, o] of this.moduleLoaders.entries())
1262
1380
  if (!this.moduleResolvers.has(n))
1263
1381
  try {
1264
- const s = await o(), i = Gr(s);
1382
+ const s = await o(), i = Jr(s);
1265
1383
  this.moduleResolvers.set(n, i), e = !0;
1266
1384
  } catch (s) {
1267
1385
  rt.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
@@ -1269,7 +1387,7 @@ class zr {
1269
1387
  const r = [];
1270
1388
  for (const n of this.moduleLoaders.keys())
1271
1389
  this.moduleResolvers.has(n) && r.push(n);
1272
- return Hr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
1390
+ return Xr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
1273
1391
  }
1274
1392
  resolve(e) {
1275
1393
  for (const r of this.baseResolvers) {
@@ -1289,17 +1407,17 @@ class zr {
1289
1407
  }
1290
1408
  }
1291
1409
  }
1292
- function Wr() {
1293
- const t = new zr();
1294
- return yr(t), Or(t), Yr(t), t.loadRegisteredModules(), t;
1410
+ function Gr() {
1411
+ const t = new qr();
1412
+ return Sr(t), _r(t), Wr(t), t.loadRegisteredModules(), t;
1295
1413
  }
1296
- function qr(t) {
1414
+ function Hr(t) {
1297
1415
  return Array.isArray(t) ? t : [t];
1298
1416
  }
1299
- function Gr(t) {
1300
- return t ? qr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1417
+ function Jr(t) {
1418
+ return t ? Hr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1301
1419
  }
1302
- function Hr(t, e) {
1420
+ function Xr(t, e) {
1303
1421
  if (t.length !== e.length)
1304
1422
  return !1;
1305
1423
  for (let r = 0; r < t.length; r += 1)
@@ -1307,7 +1425,7 @@ function Hr(t, e) {
1307
1425
  return !1;
1308
1426
  return !0;
1309
1427
  }
1310
- const Ie = Ee("MotionController"), nt = {
1428
+ const Ie = Re("MotionController"), nt = {
1311
1429
  ease: [0.25, 0.1, 0.25, 1],
1312
1430
  "ease-in": [0.42, 0, 1, 1],
1313
1431
  "ease-out": [0, 0, 0.58, 1],
@@ -1351,51 +1469,51 @@ function st(t) {
1351
1469
  return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1352
1470
  }
1353
1471
  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;
1472
+ const d = new Float32Array(11);
1473
+ function l(g, y, v) {
1474
+ return ((3 * y - 3 * v + 1) * g + (3 * v - 6 * y)) * g * g + 3 * y * g;
1357
1475
  }
1358
- function h(m, g, v) {
1359
- return 3 * (3 * g - 3 * v + 1) * m * m + 2 * (3 * v - 6 * g) * m + 3 * g;
1476
+ function u(g, y, v) {
1477
+ return 3 * (3 * y - 3 * v + 1) * g * g + 2 * (3 * v - 6 * y) * g + 3 * y;
1360
1478
  }
1361
- function y(m, g) {
1479
+ function p(g, y) {
1362
1480
  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;
1481
+ const E = u(y, t, r);
1482
+ if (E === 0)
1483
+ return y;
1484
+ const T = l(y, t, r) - g;
1485
+ y -= T / E;
1368
1486
  }
1369
- return g;
1487
+ return y;
1370
1488
  }
1371
- function p(m, g, v) {
1372
- let A = 0, I = 0, L = 0;
1489
+ function m(g, y, v) {
1490
+ let E = 0, T = 0, O = 0;
1373
1491
  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;
1492
+ T = y + (v - y) / 2, E = l(T, t, r) - g, E > 0 ? v = T : y = T;
1493
+ while (Math.abs(E) > 1e-7 && ++O < 10);
1494
+ return T;
1495
+ }
1496
+ function b(g) {
1497
+ let y = 0, v = 1;
1498
+ const E = 10;
1499
+ for (; v !== E && d[v] <= g; v += 1)
1500
+ y += 0.1;
1383
1501
  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);
1502
+ const T = (g - d[v]) / (d[v + 1] - d[v]), O = y + T * 0.1, K = u(O, t, r);
1503
+ return K >= 1e-3 ? p(g, O) : K === 0 ? O : m(g, y, y + 0.1);
1386
1504
  }
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);
1505
+ for (let g = 0; g < 11; g += 1)
1506
+ d[g] = l(g * 0.1, t, r);
1507
+ return (g) => g <= 0 ? 0 : g >= 1 ? 1 : l(b(g), e, n);
1390
1508
  }
1391
- function Jr(t) {
1509
+ function Zr(t) {
1392
1510
  const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
1393
1511
  if (!e)
1394
1512
  return (o) => B(o);
1395
1513
  const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
1396
1514
  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);
1397
1515
  }
1398
- function Xr(t) {
1516
+ function Qr(t) {
1399
1517
  if (!t)
1400
1518
  return (r) => B(r);
1401
1519
  const e = t.trim().toLowerCase();
@@ -1409,16 +1527,16 @@ function Xr(t) {
1409
1527
  const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
1410
1528
  if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
1411
1529
  const [o, s, i, a] = n, c = it(o, s, i, a);
1412
- return (f) => B(c(B(f)));
1530
+ return (h) => B(c(B(h)));
1413
1531
  }
1414
1532
  }
1415
1533
  if (e.startsWith("steps(") && e.endsWith(")")) {
1416
- const r = Jr(e);
1534
+ const r = Zr(e);
1417
1535
  return (n) => r(B(n));
1418
1536
  }
1419
1537
  return (r) => B(r);
1420
1538
  }
1421
- function Zr(t) {
1539
+ function en(t) {
1422
1540
  if (!t)
1423
1541
  return;
1424
1542
  const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
@@ -1428,7 +1546,7 @@ function Zr(t) {
1428
1546
  if (![r, n, o, s].some((i) => !Number.isFinite(i)))
1429
1547
  return { inStart: r, inEnd: n, outStart: o, outEnd: s };
1430
1548
  }
1431
- class Qr {
1549
+ class tn {
1432
1550
  bindingsByStyle = /* @__PURE__ */ new Map();
1433
1551
  observer;
1434
1552
  observeScheduled = !1;
@@ -1473,7 +1591,7 @@ class Qr {
1473
1591
  const r = e.source?.trim();
1474
1592
  if (!r)
1475
1593
  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;
1594
+ 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 = Qr(e.ease), h = en(e.map), d = e.targetId?.trim() || void 0;
1477
1595
  return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
1478
1596
  source: r.toLowerCase(),
1479
1597
  min: n,
@@ -1481,8 +1599,8 @@ class Qr {
1481
1599
  clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
1482
1600
  reverse: a,
1483
1601
  ease: c,
1484
- map: f,
1485
- targetId: l
1602
+ map: h,
1603
+ targetId: d
1486
1604
  };
1487
1605
  }
1488
1606
  ensureObserver() {
@@ -1581,10 +1699,10 @@ class Qr {
1581
1699
  const o = r.max - r.min, s = o === 0 ? n > r.min ? 1 : 0 : (n - r.min) / o;
1582
1700
  let i = this.applyClamp(s, r.clamp);
1583
1701
  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}`);
1702
+ const a = r.ease(i), c = Number.isFinite(a) ? a : 0, h = c * 100;
1703
+ 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", `${h}`), r.map) {
1704
+ const d = this.applyMap(h, r.map);
1705
+ d !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${d}`);
1588
1706
  } else
1589
1707
  e.style.removeProperty("--tw-motion-bind-value");
1590
1708
  }
@@ -1686,8 +1804,8 @@ class Qr {
1686
1804
  }
1687
1805
  }
1688
1806
  }
1689
- const Oe = new Qr();
1690
- function en(t) {
1807
+ const Oe = new tn();
1808
+ function rn(t) {
1691
1809
  const e = w(/* @__PURE__ */ new Map()), r = D(({ styleId: s, css: i, common: a }) => {
1692
1810
  if (!(!s || typeof document > "u")) {
1693
1811
  if (i) {
@@ -1720,7 +1838,7 @@ function en(t) {
1720
1838
  };
1721
1839
  }, [t, o, r, n]), U(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
1722
1840
  }
1723
- function tn(t) {
1841
+ function nn(t) {
1724
1842
  const e = [];
1725
1843
  for (const [r, n] of t) {
1726
1844
  const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
@@ -1728,7 +1846,7 @@ function tn(t) {
1728
1846
  }
1729
1847
  return e.sort(), e.join(",");
1730
1848
  }
1731
- function rn(t) {
1849
+ function on(t) {
1732
1850
  const [e, r] = J(), n = w("");
1733
1851
  return U(() => {
1734
1852
  if (!t) {
@@ -1736,54 +1854,54 @@ function rn(t) {
1736
1854
  return;
1737
1855
  }
1738
1856
  const o = () => {
1739
- const s = t.getStores(), i = tn(s);
1857
+ const s = t.getStores(), i = nn(s);
1740
1858
  i !== n.current && (n.current = i, r(s));
1741
1859
  };
1742
1860
  return o(), t.subscribe(o);
1743
1861
  }, [t]), e;
1744
1862
  }
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];
1863
+ var sn = typeof global == "object" && global && global.Object === Object && global, an = typeof self == "object" && self && self.Object === Object && self, cn = sn || an || Function("return this")(), we = cn.Symbol, bt = Object.prototype, un = bt.hasOwnProperty, ln = bt.toString, ue = we ? we.toStringTag : void 0;
1864
+ function dn(t) {
1865
+ var e = un.call(t, ue), r = t[ue];
1748
1866
  try {
1749
1867
  t[ue] = void 0;
1750
1868
  var n = !0;
1751
1869
  } catch {
1752
1870
  }
1753
- var o = cn.call(t);
1871
+ var o = ln.call(t);
1754
1872
  return n && (e ? t[ue] = r : delete t[ue]), o;
1755
1873
  }
1756
- var ln = Object.prototype, dn = ln.toString;
1757
- function fn(t) {
1758
- return dn.call(t);
1759
- }
1760
- var hn = "[object Null]", mn = "[object Undefined]", at = we ? we.toStringTag : void 0;
1874
+ var fn = Object.prototype, hn = fn.toString;
1761
1875
  function pn(t) {
1762
- return t == null ? t === void 0 ? mn : hn : at && at in Object(t) ? un(t) : fn(t);
1876
+ return hn.call(t);
1763
1877
  }
1764
- function gn(t) {
1878
+ var mn = "[object Null]", gn = "[object Undefined]", at = we ? we.toStringTag : void 0;
1879
+ function yn(t) {
1880
+ return t == null ? t === void 0 ? gn : mn : at && at in Object(t) ? dn(t) : pn(t);
1881
+ }
1882
+ function bn(t) {
1765
1883
  return t != null && typeof t == "object";
1766
1884
  }
1767
- var yn = Array.isArray, bn = "[object String]";
1768
- function Sn(t) {
1769
- return typeof t == "string" || !yn(t) && gn(t) && pn(t) == bn;
1885
+ var Sn = Array.isArray, wn = "[object String]";
1886
+ function vn(t) {
1887
+ return typeof t == "string" || !Sn(t) && bn(t) && yn(t) == wn;
1770
1888
  }
1771
1889
  const ct = "ikonUiModules";
1772
1890
  function De(t) {
1773
1891
  return typeof t == "object" && t !== null && !Array.isArray(t);
1774
1892
  }
1775
- function wn(t) {
1893
+ function En(t) {
1776
1894
  if (!Array.isArray(t))
1777
1895
  return;
1778
1896
  const e = /* @__PURE__ */ new Set();
1779
1897
  for (const r of t) {
1780
- if (!Sn(r)) continue;
1898
+ if (!vn(r)) continue;
1781
1899
  const n = r.trim();
1782
1900
  n && (e.has(n) || e.add(n));
1783
1901
  }
1784
1902
  return Array.from(e);
1785
1903
  }
1786
- function Eo(t, e) {
1904
+ function Ao(t, e) {
1787
1905
  if (t === e)
1788
1906
  return !0;
1789
1907
  if (!t || !e)
@@ -1795,18 +1913,18 @@ function Eo(t, e) {
1795
1913
  return !1;
1796
1914
  return !0;
1797
1915
  }
1798
- function vn(t) {
1916
+ function Rn(t) {
1799
1917
  if (!(!De(t) || !Object.prototype.hasOwnProperty.call(t, ct)))
1800
- return wn(t[ct]);
1918
+ return En(t[ct]);
1801
1919
  }
1802
- function Ao(...t) {
1920
+ function To(...t) {
1803
1921
  for (const e of t) {
1804
- const r = vn(e);
1922
+ const r = Rn(e);
1805
1923
  if (r !== void 0)
1806
1924
  return r;
1807
1925
  }
1808
1926
  }
1809
- function ko(t) {
1927
+ function Co(t) {
1810
1928
  if (!De(t))
1811
1929
  return;
1812
1930
  const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
@@ -1828,36 +1946,36 @@ function ko(t) {
1828
1946
  }
1829
1947
  if (!De(c))
1830
1948
  continue;
1831
- const f = c, l = Object.keys(f).find((b) => b.toLowerCase() === "name");
1832
- if (!l)
1949
+ const h = c, d = Object.keys(h).find((b) => b.toLowerCase() === "name");
1950
+ if (!d)
1833
1951
  continue;
1834
- const u = f[l];
1835
- if (typeof u != "string")
1952
+ const l = h[d];
1953
+ if (typeof l != "string")
1836
1954
  continue;
1837
- const h = u.trim();
1838
- if (!h)
1955
+ const u = l.trim();
1956
+ if (!u)
1839
1957
  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));
1958
+ const p = Object.keys(h).find((b) => b.toLowerCase() === "javascript"), m = p ? h[p] : void 0;
1959
+ typeof m == "string" && s.set(u, m), i.has(u) || (o.push(u), i.add(u));
1842
1960
  }
1843
1961
  if (!o.length && s.size === 0)
1844
1962
  return { modules: [] };
1845
- const a = Array.from(s.entries()).map(([c, f]) => ({
1963
+ const a = Array.from(s.entries()).map(([c, h]) => ({
1846
1964
  name: c,
1847
- javascript: f
1965
+ javascript: h
1848
1966
  }));
1849
1967
  return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
1850
1968
  }
1851
- const R = {
1969
+ const k = {
1852
1970
  None: 0,
1853
1971
  Letter: 1,
1854
1972
  Word: 2,
1855
1973
  Line: 4,
1856
1974
  Paragraph: 8,
1857
1975
  Emoji: 16
1858
- }, Rn = [
1976
+ }, kn = [
1859
1977
  {
1860
- flag: R.Letter,
1978
+ flag: k.Letter,
1861
1979
  hints: [
1862
1980
  "[data-motion-letter]",
1863
1981
  "[data-letter]",
@@ -1866,7 +1984,7 @@ const R = {
1866
1984
  ]
1867
1985
  },
1868
1986
  {
1869
- flag: R.Word,
1987
+ flag: k.Word,
1870
1988
  hints: [
1871
1989
  "[data-motion-word]",
1872
1990
  "[data-word]",
@@ -1875,7 +1993,7 @@ const R = {
1875
1993
  ]
1876
1994
  },
1877
1995
  {
1878
- flag: R.Line,
1996
+ flag: k.Line,
1879
1997
  hints: [
1880
1998
  "[data-motion-line]",
1881
1999
  "[data-line]",
@@ -1884,7 +2002,7 @@ const R = {
1884
2002
  ]
1885
2003
  },
1886
2004
  {
1887
- flag: R.Paragraph,
2005
+ flag: k.Paragraph,
1888
2006
  hints: [
1889
2007
  "[data-motion-paragraph]",
1890
2008
  "[data-paragraph]",
@@ -1895,7 +2013,7 @@ const R = {
1895
2013
  ]
1896
2014
  },
1897
2015
  {
1898
- flag: R.Emoji,
2016
+ flag: k.Emoji,
1899
2017
  hints: [
1900
2018
  ":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
1901
2019
  "[data-motion-emoji]",
@@ -1904,42 +2022,42 @@ const R = {
1904
2022
  "[data-emoji]"
1905
2023
  ]
1906
2024
  }
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)
2025
+ ], Fe = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, An = k.Letter | k.Word | k.Line | k.Paragraph, ut = /* @__PURE__ */ new Map(), Tn = 16384;
2026
+ function Io(t, e) {
2027
+ if (!t || t.length > Tn)
1910
2028
  return t;
1911
- const r = $n(e), n = oe(r, R.Emoji), o = r & En;
1912
- if (o === R.None && !n)
2029
+ const r = Kn(e), n = oe(r, k.Emoji), o = r & An;
2030
+ if (o === k.None && !n)
1913
2031
  return t;
1914
2032
  const s = t.replace(/\r\n/g, `
1915
2033
  `).replace(/\r/g, `
1916
2034
  `);
1917
- if (o === R.None)
2035
+ if (o === k.None)
1918
2036
  return ht(s);
1919
- const i = Fn(s);
2037
+ const i = $n(s);
1920
2038
  if (i.length === 0)
1921
2039
  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);
2040
+ const a = Vn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, h = [];
2041
+ for (const d of a) {
2042
+ const l = Cn(d, r, c);
2043
+ h.push(...l);
1926
2044
  }
1927
- return f;
2045
+ return h;
1928
2046
  }
1929
- function kn(t, e, r) {
2047
+ function Cn(t, e, r) {
1930
2048
  const n = [];
1931
2049
  for (const o of t) {
1932
- const s = Tn(o, e, r);
2050
+ const s = In(o, e, r);
1933
2051
  n.push(...s);
1934
2052
  }
1935
- if (oe(e, R.Paragraph)) {
2053
+ if (oe(e, k.Paragraph)) {
1936
2054
  const o = r.paragraph++;
1937
2055
  return [
1938
- /* @__PURE__ */ E.jsx(
2056
+ /* @__PURE__ */ R.jsx(
1939
2057
  "span",
1940
2058
  {
1941
2059
  "data-motion-paragraph": !0,
1942
- style: Ae(o),
2060
+ style: ke(o),
1943
2061
  children: n
1944
2062
  },
1945
2063
  `motion-paragraph-${o}`
@@ -1948,23 +2066,23 @@ function kn(t, e, r) {
1948
2066
  }
1949
2067
  return n;
1950
2068
  }
1951
- function Tn(t, e, r) {
1952
- const n = Cn(t.text, e, r), o = [];
1953
- if (oe(e, R.Line)) {
2069
+ function In(t, e, r) {
2070
+ const n = On(t.text, e, r), o = [];
2071
+ if (oe(e, k.Line)) {
1954
2072
  const s = r.line++;
1955
2073
  o.push(
1956
- /* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Ae(s), children: n }, `motion-line-${s}`)
2074
+ /* @__PURE__ */ R.jsx("span", { "data-motion-line": !0, style: ke(s), children: n }, `motion-line-${s}`)
1957
2075
  );
1958
2076
  } else
1959
2077
  o.push(...n);
1960
2078
  for (let s = 0; s < t.breaks; s++)
1961
- o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${r.br++}`));
2079
+ o.push(/* @__PURE__ */ R.jsx("br", {}, `motion-break-${r.br++}`));
1962
2080
  return o;
1963
2081
  }
1964
- function Cn(t, e, r) {
2082
+ function On(t, e, r) {
1965
2083
  if (!t)
1966
2084
  return [];
1967
- const n = oe(e, R.Word), o = [], s = /(\s+)/g;
2085
+ const n = oe(e, k.Word), o = [], s = /(\s+)/g;
1968
2086
  let i = 0, a;
1969
2087
  for (; (a = s.exec(t)) !== null; ) {
1970
2088
  if (a.index > i) {
@@ -1980,16 +2098,16 @@ function Cn(t, e, r) {
1980
2098
  return o;
1981
2099
  }
1982
2100
  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);
2101
+ const o = e.word++, s = _n(t, r, e), i = `motion-word-${o}`, a = Nn(o, n);
2102
+ return n ? /* @__PURE__ */ R.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ R.jsx("span", { style: a, children: s }, i);
1985
2103
  }
1986
- function In(t, e) {
1987
- return e ? { ...Ae(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
2104
+ function Nn(t, e) {
2105
+ return e ? { ...ke(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
1988
2106
  }
1989
- function On(t, e, r) {
2107
+ function _n(t, e, r) {
1990
2108
  if (!t)
1991
2109
  return [];
1992
- const n = oe(e, R.Letter), o = oe(e, R.Emoji);
2110
+ const n = oe(e, k.Letter), o = oe(e, k.Emoji);
1993
2111
  if (!n) {
1994
2112
  if (!o)
1995
2113
  return [t];
@@ -2001,17 +2119,17 @@ function On(t, e, r) {
2001
2119
  }
2002
2120
  const s = [], i = Be(t);
2003
2121
  for (const a of i) {
2004
- const c = r.letter++, f = `motion-letter-${c}`, l = Ae(c);
2122
+ const c = r.letter++, h = `motion-letter-${c}`, d = ke(c);
2005
2123
  if (a === `
2006
2124
  `) {
2007
2125
  s.push(
2008
- /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: l, children: /* @__PURE__ */ E.jsx("br", {}) }, f)
2126
+ /* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: d, children: /* @__PURE__ */ R.jsx("br", {}) }, h)
2009
2127
  );
2010
2128
  continue;
2011
2129
  }
2012
- const h = o && St(a) ? { "data-motion-emoji": !0 } : void 0, y = a === " " ? " " : a;
2130
+ const u = o && St(a) ? { "data-motion-emoji": !0 } : void 0, p = a === " " ? " " : a;
2013
2131
  s.push(
2014
- /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: l, ...h, children: y }, f)
2132
+ /* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: d, ...u, children: p }, h)
2015
2133
  );
2016
2134
  }
2017
2135
  return s;
@@ -2019,33 +2137,33 @@ function On(t, e, r) {
2019
2137
  function Be(t) {
2020
2138
  if (!t)
2021
2139
  return [];
2022
- const e = _n();
2023
- return e ? Array.from(e.segment(t), (r) => r.segment) : Nn(t);
2140
+ const e = Pn();
2141
+ return e ? Array.from(e.segment(t), (r) => r.segment) : Mn(t);
2024
2142
  }
2025
2143
  let le;
2026
- function _n() {
2144
+ function Pn() {
2027
2145
  return le !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? le = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : le = null), le;
2028
2146
  }
2029
- function Nn(t) {
2147
+ function Mn(t) {
2030
2148
  const e = [], r = Array.from(t);
2031
2149
  let n = "";
2032
2150
  for (let o = 0; o < r.length; o++) {
2033
2151
  const s = r[o], i = r[o + 1];
2034
- n += s, !(i && Pn(s, i)) && (e.push(n), n = "");
2152
+ n += s, !(i && Ln(s, i)) && (e.push(n), n = "");
2035
2153
  }
2036
2154
  return n && e.push(n), e;
2037
2155
  }
2038
- function Pn(t, e) {
2039
- return e ? !!(dt(t) || dt(e) || Un(e) || Mn(e) || jn(e) || ft(t) && ft(e)) : !1;
2156
+ function Ln(t, e) {
2157
+ return e ? !!(dt(t) || dt(e) || xn(e) || jn(e) || Un(e) || ft(t) && ft(e)) : !1;
2040
2158
  }
2041
2159
  function dt(t) {
2042
2160
  return t.codePointAt(0) === 8205;
2043
2161
  }
2044
- function Mn(t) {
2162
+ function jn(t) {
2045
2163
  const e = t.codePointAt(0);
2046
2164
  return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
2047
2165
  }
2048
- function jn(t) {
2166
+ function Un(t) {
2049
2167
  const e = t.codePointAt(0);
2050
2168
  return e === void 0 ? !1 : e >= 127995 && e <= 127999;
2051
2169
  }
@@ -2053,11 +2171,11 @@ function ft(t) {
2053
2171
  const e = t.codePointAt(0);
2054
2172
  return e === void 0 ? !1 : e >= 127462 && e <= 127487;
2055
2173
  }
2056
- let _e;
2057
- function Un(t) {
2058
- return t ? (_e || (_e = Ln()), _e(t)) : !1;
2174
+ let Ne;
2175
+ function xn(t) {
2176
+ return t ? (Ne || (Ne = Dn()), Ne(t)) : !1;
2059
2177
  }
2060
- function Ln() {
2178
+ function Dn() {
2061
2179
  try {
2062
2180
  const t = new RegExp("\\p{Mark}", "u");
2063
2181
  return (e) => t.test(e);
@@ -2068,19 +2186,19 @@ function Ln() {
2068
2186
  };
2069
2187
  }
2070
2188
  }
2071
- let Ne;
2189
+ let _e;
2072
2190
  function St(t) {
2073
- return t ? (Ne || (Ne = xn()), Ne(t)) : !1;
2191
+ return t ? (_e || (_e = Fn()), _e(t)) : !1;
2074
2192
  }
2075
- function xn() {
2193
+ function Fn() {
2076
2194
  try {
2077
2195
  const t = new RegExp("\\p{Extended_Pictographic}", "u");
2078
2196
  return (e) => t.test(e);
2079
2197
  } catch {
2080
- return Dn;
2198
+ return Bn;
2081
2199
  }
2082
2200
  }
2083
- function Dn(t) {
2201
+ function Bn(t) {
2084
2202
  if (!t)
2085
2203
  return !1;
2086
2204
  for (const e of Array.from(t)) {
@@ -2090,7 +2208,7 @@ function Dn(t) {
2090
2208
  }
2091
2209
  return !1;
2092
2210
  }
2093
- function Fn(t) {
2211
+ function $n(t) {
2094
2212
  const e = [];
2095
2213
  let r = "", n = 0;
2096
2214
  for (let o = 0; o < t.length; o++) {
@@ -2104,7 +2222,7 @@ function Fn(t) {
2104
2222
  }
2105
2223
  return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
2106
2224
  }
2107
- function Bn(t) {
2225
+ function Vn(t) {
2108
2226
  if (t.length === 0)
2109
2227
  return [];
2110
2228
  const e = [];
@@ -2116,7 +2234,7 @@ function Bn(t) {
2116
2234
  function oe(t, e) {
2117
2235
  return (t & e) === e;
2118
2236
  }
2119
- function Ae(t) {
2237
+ function ke(t) {
2120
2238
  return {
2121
2239
  "--tw-motion-seq-index": t.toString(),
2122
2240
  backgroundColor: "inherit",
@@ -2151,9 +2269,9 @@ function wt(t, e) {
2151
2269
  for (const a of t) {
2152
2270
  if (St(a)) {
2153
2271
  o = !0, i();
2154
- const f = `motion-emoji-${e ? e.emoji++ : s++}`;
2272
+ const h = `motion-emoji-${e ? e.emoji++ : s++}`;
2155
2273
  r.push(
2156
- /* @__PURE__ */ E.jsx("span", { "data-motion-emoji": !0, children: a }, f)
2274
+ /* @__PURE__ */ R.jsx("span", { "data-motion-emoji": !0, children: a }, h)
2157
2275
  );
2158
2276
  continue;
2159
2277
  }
@@ -2161,51 +2279,51 @@ function wt(t, e) {
2161
2279
  }
2162
2280
  return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
2163
2281
  }
2164
- function $n(t) {
2282
+ function Kn(t) {
2165
2283
  if (!t)
2166
- return R.None;
2284
+ return k.None;
2167
2285
  const e = t.trim();
2168
2286
  if (!e)
2169
- return R.None;
2287
+ return k.None;
2170
2288
  const r = ut.get(e);
2171
2289
  if (typeof r == "number")
2172
2290
  return r;
2173
2291
  if (typeof document > "u")
2174
- return R.None;
2292
+ return k.None;
2175
2293
  const n = e.split(/\s+/).filter(Boolean);
2176
2294
  if (n.length === 0)
2177
- 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_-])`)
2295
+ return k.None;
2296
+ const s = n.map((c) => `.${Yn(c)}`).map(
2297
+ (c) => new RegExp(`(^|[^a-zA-Z0-9_-])${zn(c)}(?![a-zA-Z0-9_-])`)
2180
2298
  );
2181
- let i = R.None, a = !1;
2299
+ let i = k.None, a = !1;
2182
2300
  for (const c of Array.from(document.styleSheets)) {
2183
- let f;
2301
+ let h;
2184
2302
  try {
2185
- f = c.cssRules;
2303
+ h = c.cssRules;
2186
2304
  } catch {
2187
2305
  continue;
2188
2306
  }
2189
- const l = vt(f, s);
2190
- if (l.mask && (i |= l.mask, i === Fe))
2307
+ const d = vt(h, s);
2308
+ if (d.mask && (i |= d.mask, i === Fe))
2191
2309
  break;
2192
- a ||= l.sawStyleRule;
2310
+ a ||= d.sawStyleRule;
2193
2311
  }
2194
- return (i !== R.None || a) && ut.set(e, i), i;
2312
+ return (i !== k.None || a) && ut.set(e, i), i;
2195
2313
  }
2196
2314
  function vt(t, e) {
2197
2315
  if (!t)
2198
- return { mask: R.None, sawStyleRule: !1 };
2199
- let r = R.None, n = !1;
2316
+ return { mask: k.None, sawStyleRule: !1 };
2317
+ let r = k.None, n = !1;
2200
2318
  for (let o = 0; o < t.length; o++) {
2201
2319
  const s = t[o];
2202
2320
  if (s) {
2203
2321
  if (s.type === CSSRule.STYLE_RULE) {
2204
2322
  const a = s.selectorText ?? "";
2205
- if (!a || !e.some((f) => f.test(a))) continue;
2323
+ if (!a || !e.some((h) => h.test(a))) continue;
2206
2324
  n = !0;
2207
- for (const f of Rn)
2208
- f.hints.some((l) => a.includes(l)) && (r |= f.flag);
2325
+ for (const h of kn)
2326
+ h.hints.some((d) => a.includes(d)) && (r |= h.flag);
2209
2327
  if (r === Fe)
2210
2328
  return { mask: r, sawStyleRule: !0 };
2211
2329
  } else if ("cssRules" in s) {
@@ -2218,36 +2336,36 @@ function vt(t, e) {
2218
2336
  }
2219
2337
  return { mask: r, sawStyleRule: n };
2220
2338
  }
2221
- function Vn(t) {
2339
+ function Yn(t) {
2222
2340
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2223
2341
  }
2224
- function Kn(t) {
2342
+ function zn(t) {
2225
2343
  return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2226
2344
  }
2227
- const ze = "ikon_auth_session", Yn = 7 * 24 * 60 * 60 * 1e3, zn = 60 * 1e3;
2228
- function Wn(t) {
2345
+ const ze = "ikon_auth_session", Wn = 7 * 24 * 60 * 60 * 1e3, qn = 60 * 1e3;
2346
+ function Gn(t) {
2229
2347
  try {
2230
2348
  const e = t.split(".");
2231
2349
  if (e.length !== 3) return !0;
2232
2350
  const r = JSON.parse(atob(e[1]));
2233
- return typeof r.exp != "number" ? !1 : Date.now() >= r.exp * 1e3 - zn;
2351
+ return typeof r.exp != "number" ? !1 : Date.now() >= r.exp * 1e3 - qn;
2234
2352
  } catch {
2235
2353
  return !0;
2236
2354
  }
2237
2355
  }
2238
- function ke(t) {
2356
+ function Ae(t) {
2239
2357
  try {
2240
2358
  localStorage.setItem(ze, JSON.stringify(t));
2241
2359
  } catch {
2242
2360
  console.warn("Failed to save auth session to localStorage");
2243
2361
  }
2244
2362
  }
2245
- function Rt() {
2363
+ function Et() {
2246
2364
  try {
2247
2365
  const t = localStorage.getItem(ze);
2248
2366
  if (!t) return null;
2249
2367
  const e = JSON.parse(t);
2250
- return Date.now() - e.authenticatedAt > Yn || Wn(e.token) ? (ve(), null) : e;
2368
+ return Date.now() - e.authenticatedAt > Wn || Gn(e.token) ? (ve(), null) : e;
2251
2369
  } catch {
2252
2370
  return console.warn("Failed to load auth session from localStorage"), null;
2253
2371
  }
@@ -2267,8 +2385,8 @@ function de(t) {
2267
2385
  authenticatedAt: t.authenticatedAt
2268
2386
  };
2269
2387
  }
2270
- async function Et(t, e) {
2271
- const r = Lt(), n = await fetch(`${e}/anonymous`, {
2388
+ async function Rt(t, e) {
2389
+ const r = xt(), n = await fetch(`${e}/anonymous`, {
2272
2390
  method: "POST",
2273
2391
  headers: { "Content-Type": "application/json" },
2274
2392
  body: JSON.stringify({ deviceId: r, space: t })
@@ -2282,9 +2400,9 @@ async function Et(t, e) {
2282
2400
  provider: "anonymous",
2283
2401
  authenticatedAt: Date.now()
2284
2402
  };
2285
- return ke(s), s;
2403
+ return Ae(s), s;
2286
2404
  }
2287
- async function Co(t) {
2405
+ async function Oo(t) {
2288
2406
  const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
2289
2407
  method: "POST",
2290
2408
  headers: { "Content-Type": "application/json" },
@@ -2299,22 +2417,22 @@ async function Co(t) {
2299
2417
  throw new Error(i);
2300
2418
  }
2301
2419
  }
2302
- function qn() {
2420
+ function Hn() {
2303
2421
  const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
2304
2422
  return e && r ? { token: e, provider: r } : null;
2305
2423
  }
2306
- function Gn() {
2424
+ function Jn() {
2307
2425
  const e = new URLSearchParams(window.location.search).get("error");
2308
2426
  return e ? decodeURIComponent(e) : null;
2309
2427
  }
2310
- function mt() {
2428
+ function pt() {
2311
2429
  window.history.replaceState({}, "", window.location.pathname);
2312
2430
  }
2313
- function Hn(t, e, r, n) {
2431
+ function Xn(t, e, r, n) {
2314
2432
  const o = n ?? window.location.origin + window.location.pathname + window.location.search;
2315
2433
  return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
2316
2434
  }
2317
- async function Jn(t) {
2435
+ async function Zn(t) {
2318
2436
  const e = await fetch(`${t}/passkey/registration/options`, {
2319
2437
  method: "POST",
2320
2438
  headers: { "Content-Type": "application/json" }
@@ -2325,7 +2443,7 @@ async function Jn(t) {
2325
2443
  }
2326
2444
  return e.json();
2327
2445
  }
2328
- async function Xn(t, e, r) {
2446
+ async function Qn(t, e, r) {
2329
2447
  const n = await fetch(`${t}/passkey/registration/verify`, {
2330
2448
  method: "POST",
2331
2449
  headers: { "Content-Type": "application/json" },
@@ -2340,9 +2458,9 @@ async function Xn(t, e, r) {
2340
2458
  provider: "passkey",
2341
2459
  authenticatedAt: Date.now()
2342
2460
  };
2343
- return ke(s), s;
2461
+ return Ae(s), s;
2344
2462
  }
2345
- async function Zn(t, e) {
2463
+ async function eo(t, e) {
2346
2464
  const r = await fetch(`${t}/passkey/authentication/options`, {
2347
2465
  method: "POST",
2348
2466
  headers: { "Content-Type": "application/json" },
@@ -2354,7 +2472,7 @@ async function Zn(t, e) {
2354
2472
  }
2355
2473
  return r.json();
2356
2474
  }
2357
- async function Qn(t, e) {
2475
+ async function to(t, e) {
2358
2476
  const r = await fetch(`${t}/passkey/authentication/verify`, {
2359
2477
  method: "POST",
2360
2478
  headers: { "Content-Type": "application/json" },
@@ -2369,7 +2487,7 @@ async function Qn(t, e) {
2369
2487
  provider: "passkey",
2370
2488
  authenticatedAt: Date.now()
2371
2489
  };
2372
- return ke(o), o;
2490
+ return Ae(o), o;
2373
2491
  }
2374
2492
  function X(t) {
2375
2493
  const e = new Uint8Array(t);
@@ -2378,23 +2496,23 @@ function X(t) {
2378
2496
  r += String.fromCharCode(o);
2379
2497
  return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2380
2498
  }
2381
- function Re(t) {
2499
+ function Ee(t) {
2382
2500
  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);
2383
2501
  for (let a = 0; a < o.length; a++)
2384
2502
  i[a] = o.charCodeAt(a);
2385
2503
  return s;
2386
2504
  }
2387
2505
  function We() {
2388
- return eo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2506
+ return ro.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2389
2507
  }
2390
- const eo = {
2508
+ const ro = {
2391
2509
  stubThis: (t) => t
2392
2510
  };
2393
- function At(t) {
2511
+ function kt(t) {
2394
2512
  const { id: e } = t;
2395
2513
  return {
2396
2514
  ...t,
2397
- id: Re(e),
2515
+ id: Ee(e),
2398
2516
  /**
2399
2517
  * `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
2400
2518
  * transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
@@ -2403,7 +2521,7 @@ function At(t) {
2403
2521
  transports: t.transports
2404
2522
  };
2405
2523
  }
2406
- function kt(t) {
2524
+ function At(t) {
2407
2525
  return (
2408
2526
  // Consider localhost valid as well since it's okay wrt Secure Contexts
2409
2527
  t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
@@ -2419,7 +2537,7 @@ class j extends Error {
2419
2537
  }), this.name = o ?? n.name, this.code = r;
2420
2538
  }
2421
2539
  }
2422
- function to({ error: t, options: e }) {
2540
+ function no({ error: t, options: e }) {
2423
2541
  const { publicKey: r } = e;
2424
2542
  if (!r)
2425
2543
  throw Error("options was missing required publicKey property");
@@ -2477,7 +2595,7 @@ function to({ error: t, options: e }) {
2477
2595
  });
2478
2596
  if (t.name === "SecurityError") {
2479
2597
  const n = globalThis.location.hostname;
2480
- if (kt(n)) {
2598
+ if (At(n)) {
2481
2599
  if (r.rp.id !== n)
2482
2600
  return new j({
2483
2601
  message: `The RP ID "${r.rp.id}" is invalid for this domain`,
@@ -2505,7 +2623,7 @@ function to({ error: t, options: e }) {
2505
2623
  }
2506
2624
  return t;
2507
2625
  }
2508
- class ro {
2626
+ class oo {
2509
2627
  constructor() {
2510
2628
  Object.defineProperty(this, "controller", {
2511
2629
  enumerable: !0,
@@ -2529,58 +2647,58 @@ class ro {
2529
2647
  }
2530
2648
  }
2531
2649
  }
2532
- const Tt = new ro(), no = ["cross-platform", "platform"];
2650
+ const Tt = new oo(), so = ["cross-platform", "platform"];
2533
2651
  function Ct(t) {
2534
- if (t && !(no.indexOf(t) < 0))
2652
+ if (t && !(so.indexOf(t) < 0))
2535
2653
  return t;
2536
2654
  }
2537
- async function oo(t) {
2655
+ async function io(t) {
2538
2656
  !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
2657
  const { optionsJSON: e, useAutoRegister: r = !1 } = t;
2540
2658
  if (!We())
2541
2659
  throw new Error("WebAuthn is not supported in this browser");
2542
2660
  const n = {
2543
2661
  ...e,
2544
- challenge: Re(e.challenge),
2662
+ challenge: Ee(e.challenge),
2545
2663
  user: {
2546
2664
  ...e.user,
2547
- id: Re(e.user.id)
2665
+ id: Ee(e.user.id)
2548
2666
  },
2549
- excludeCredentials: e.excludeCredentials?.map(At)
2667
+ excludeCredentials: e.excludeCredentials?.map(kt)
2550
2668
  }, o = {};
2551
2669
  r && (o.mediation = "conditional"), o.publicKey = n, o.signal = Tt.createNewAbortSignal();
2552
2670
  let s;
2553
2671
  try {
2554
2672
  s = await navigator.credentials.create(o);
2555
- } catch (p) {
2556
- throw to({ error: p, options: o });
2673
+ } catch (m) {
2674
+ throw no({ error: m, options: o });
2557
2675
  }
2558
2676
  if (!s)
2559
2677
  throw new Error("Registration was not completed");
2560
- const { id: i, rawId: a, response: c, type: f } = s;
2678
+ const { id: i, rawId: a, response: c, type: h } = s;
2679
+ let d;
2680
+ typeof c.getTransports == "function" && (d = c.getTransports());
2561
2681
  let l;
2562
- typeof c.getTransports == "function" && (l = c.getTransports());
2563
- let u;
2564
2682
  if (typeof c.getPublicKeyAlgorithm == "function")
2565
2683
  try {
2566
- u = c.getPublicKeyAlgorithm();
2567
- } catch (p) {
2568
- Pe("getPublicKeyAlgorithm()", p);
2684
+ l = c.getPublicKeyAlgorithm();
2685
+ } catch (m) {
2686
+ Pe("getPublicKeyAlgorithm()", m);
2569
2687
  }
2570
- let h;
2688
+ let u;
2571
2689
  if (typeof c.getPublicKey == "function")
2572
2690
  try {
2573
- const p = c.getPublicKey();
2574
- p !== null && (h = X(p));
2575
- } catch (p) {
2576
- Pe("getPublicKey()", p);
2691
+ const m = c.getPublicKey();
2692
+ m !== null && (u = X(m));
2693
+ } catch (m) {
2694
+ Pe("getPublicKey()", m);
2577
2695
  }
2578
- let y;
2696
+ let p;
2579
2697
  if (typeof c.getAuthenticatorData == "function")
2580
2698
  try {
2581
- y = X(c.getAuthenticatorData());
2582
- } catch (p) {
2583
- Pe("getAuthenticatorData()", p);
2699
+ p = X(c.getAuthenticatorData());
2700
+ } catch (m) {
2701
+ Pe("getAuthenticatorData()", m);
2584
2702
  }
2585
2703
  return {
2586
2704
  id: i,
@@ -2588,12 +2706,12 @@ async function oo(t) {
2588
2706
  response: {
2589
2707
  attestationObject: X(c.attestationObject),
2590
2708
  clientDataJSON: X(c.clientDataJSON),
2591
- transports: l,
2592
- publicKeyAlgorithm: u,
2593
- publicKey: h,
2594
- authenticatorData: y
2709
+ transports: d,
2710
+ publicKeyAlgorithm: l,
2711
+ publicKey: u,
2712
+ authenticatorData: p
2595
2713
  },
2596
- type: f,
2714
+ type: h,
2597
2715
  clientExtensionResults: s.getClientExtensionResults(),
2598
2716
  authenticatorAttachment: Ct(s.authenticatorAttachment)
2599
2717
  };
@@ -2602,7 +2720,7 @@ function Pe(t, e) {
2602
2720
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
2603
2721
  `, e);
2604
2722
  }
2605
- function so() {
2723
+ function ao() {
2606
2724
  if (!We())
2607
2725
  return Me.stubThis(new Promise((e) => e(!1)));
2608
2726
  const t = globalThis.PublicKeyCredential;
@@ -2611,7 +2729,7 @@ function so() {
2611
2729
  const Me = {
2612
2730
  stubThis: (t) => t
2613
2731
  };
2614
- function io({ error: t, options: e }) {
2732
+ function co({ error: t, options: e }) {
2615
2733
  const { publicKey: r } = e;
2616
2734
  if (!r)
2617
2735
  throw Error("options was missing required publicKey property");
@@ -2631,7 +2749,7 @@ function io({ error: t, options: e }) {
2631
2749
  });
2632
2750
  if (t.name === "SecurityError") {
2633
2751
  const n = globalThis.location.hostname;
2634
- if (kt(n)) {
2752
+ if (At(n)) {
2635
2753
  if (r.rpId !== n)
2636
2754
  return new j({
2637
2755
  message: `The RP ID "${r.rpId}" is invalid for this domain`,
@@ -2652,20 +2770,20 @@ function io({ error: t, options: e }) {
2652
2770
  }
2653
2771
  return t;
2654
2772
  }
2655
- async function ao(t) {
2773
+ async function uo(t) {
2656
2774
  !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
2775
  const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
2658
2776
  if (!We())
2659
2777
  throw new Error("WebAuthn is not supported in this browser");
2660
2778
  let o;
2661
- e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(At));
2779
+ e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(kt));
2662
2780
  const s = {
2663
2781
  ...e,
2664
- challenge: Re(e.challenge),
2782
+ challenge: Ee(e.challenge),
2665
2783
  allowCredentials: o
2666
2784
  }, i = {};
2667
2785
  if (r) {
2668
- if (!await so())
2786
+ if (!await ao())
2669
2787
  throw Error("Browser does not support WebAuthn autofill");
2670
2788
  if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
2671
2789
  throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
@@ -2675,29 +2793,29 @@ async function ao(t) {
2675
2793
  let a;
2676
2794
  try {
2677
2795
  a = await navigator.credentials.get(i);
2678
- } catch (y) {
2679
- throw io({ error: y, options: i });
2796
+ } catch (p) {
2797
+ throw co({ error: p, options: i });
2680
2798
  }
2681
2799
  if (!a)
2682
2800
  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)), {
2801
+ const { id: c, rawId: h, response: d, type: l } = a;
2802
+ let u;
2803
+ return d.userHandle && (u = X(d.userHandle)), {
2686
2804
  id: c,
2687
- rawId: X(f),
2805
+ rawId: X(h),
2688
2806
  response: {
2689
- authenticatorData: X(l.authenticatorData),
2690
- clientDataJSON: X(l.clientDataJSON),
2691
- signature: X(l.signature),
2692
- userHandle: h
2807
+ authenticatorData: X(d.authenticatorData),
2808
+ clientDataJSON: X(d.clientDataJSON),
2809
+ signature: X(d.signature),
2810
+ userHandle: u
2693
2811
  },
2694
- type: u,
2812
+ type: l,
2695
2813
  clientExtensionResults: a.getClientExtensionResults(),
2696
2814
  authenticatorAttachment: Ct(a.authenticatorAttachment)
2697
2815
  };
2698
2816
  }
2699
- const qe = pt(null);
2700
- function Io({ children: t, config: e }) {
2817
+ const qe = mt(null);
2818
+ function No({ children: t, config: e }) {
2701
2819
  const [r, n] = J({
2702
2820
  isAuthenticated: !1,
2703
2821
  isLoading: !0,
@@ -2706,37 +2824,37 @@ function Io({ children: t, config: e }) {
2706
2824
  });
2707
2825
  U(() => {
2708
2826
  (() => {
2709
- const l = Gn();
2710
- if (l) {
2711
- mt(), n({
2827
+ const d = Jn();
2828
+ if (d) {
2829
+ pt(), n({
2712
2830
  isAuthenticated: !1,
2713
2831
  isLoading: !1,
2714
2832
  user: null,
2715
- error: l
2833
+ error: d
2716
2834
  });
2717
2835
  return;
2718
2836
  }
2719
- const u = qn();
2720
- if (u) {
2721
- const y = {
2722
- token: u.token,
2723
- provider: u.provider,
2837
+ const l = Hn();
2838
+ if (l) {
2839
+ const p = {
2840
+ token: l.token,
2841
+ provider: l.provider,
2724
2842
  authenticatedAt: Date.now()
2725
2843
  };
2726
- ke(y), mt(), n({
2844
+ Ae(p), pt(), n({
2727
2845
  isAuthenticated: !0,
2728
2846
  isLoading: !1,
2729
- user: de(y),
2847
+ user: de(p),
2730
2848
  error: null
2731
2849
  });
2732
2850
  return;
2733
2851
  }
2734
- const h = Rt();
2735
- if (h) {
2852
+ const u = Et();
2853
+ if (u) {
2736
2854
  n({
2737
2855
  isAuthenticated: !0,
2738
2856
  isLoading: !1,
2739
- user: de(h),
2857
+ user: de(u),
2740
2858
  error: null
2741
2859
  });
2742
2860
  return;
@@ -2750,54 +2868,54 @@ function Io({ children: t, config: e }) {
2750
2868
  })();
2751
2869
  }, []);
2752
2870
  const o = D(
2753
- async (f) => {
2871
+ async (h) => {
2754
2872
  if (!e.spaceId) {
2755
- n((u) => ({
2756
- ...u,
2873
+ n((l) => ({
2874
+ ...l,
2757
2875
  error: "Space ID is not configured"
2758
2876
  }));
2759
2877
  return;
2760
2878
  }
2761
- const l = je(e.authUrl);
2762
- if (f === "guest") {
2763
- n((u) => ({ ...u, isLoading: !0 }));
2879
+ const d = Le(e.authUrl);
2880
+ if (h === "guest") {
2881
+ n((l) => ({ ...l, isLoading: !0 }));
2764
2882
  try {
2765
- const u = await Et(e.spaceId, l);
2883
+ const l = await Rt(e.spaceId, d);
2766
2884
  n({
2767
2885
  isAuthenticated: !0,
2768
2886
  isLoading: !1,
2769
- user: de(u),
2887
+ user: de(l),
2770
2888
  error: null
2771
2889
  });
2772
- } catch (u) {
2773
- n((h) => ({
2774
- ...h,
2890
+ } catch (l) {
2891
+ n((u) => ({
2892
+ ...u,
2775
2893
  isLoading: !1,
2776
- error: u instanceof Error ? u.message : "Guest login failed"
2894
+ error: l instanceof Error ? l.message : "Guest login failed"
2777
2895
  }));
2778
2896
  }
2779
2897
  return;
2780
2898
  }
2781
- if (f === "passkey") {
2782
- n((u) => ({ ...u, isLoading: !0, error: null }));
2899
+ if (h === "passkey") {
2900
+ n((l) => ({ ...l, isLoading: !0, error: null }));
2783
2901
  try {
2784
- const u = await Zn(l), h = await ao({ optionsJSON: u }), y = await Qn(l, h);
2902
+ const l = await eo(d), u = await uo({ optionsJSON: l }), p = await to(d, u);
2785
2903
  n({
2786
2904
  isAuthenticated: !0,
2787
2905
  isLoading: !1,
2788
- user: de(y),
2906
+ user: de(p),
2789
2907
  error: null
2790
2908
  });
2791
- } catch (u) {
2792
- n((h) => ({
2793
- ...h,
2909
+ } catch (l) {
2910
+ n((u) => ({
2911
+ ...u,
2794
2912
  isLoading: !1,
2795
- error: u instanceof Error ? u.message : "Passkey login failed"
2913
+ error: l instanceof Error ? l.message : "Passkey login failed"
2796
2914
  }));
2797
2915
  }
2798
2916
  return;
2799
2917
  }
2800
- window.location.href = Hn(f, e.spaceId, l);
2918
+ window.location.href = Xn(h, e.spaceId, d);
2801
2919
  },
2802
2920
  [e.authUrl, e.spaceId]
2803
2921
  ), s = D(() => {
@@ -2808,22 +2926,22 @@ function Io({ children: t, config: e }) {
2808
2926
  error: null
2809
2927
  });
2810
2928
  }, []), i = D(
2811
- async (f) => {
2812
- const l = je(e.authUrl);
2813
- n((u) => ({ ...u, isLoading: !0, error: null }));
2929
+ async (h) => {
2930
+ const d = Le(e.authUrl);
2931
+ n((l) => ({ ...l, isLoading: !0, error: null }));
2814
2932
  try {
2815
- const u = await Jn(l), h = await oo({ optionsJSON: u }), y = await Xn(l, h, f);
2933
+ const l = await Zn(d), u = await io({ optionsJSON: l }), p = await Qn(d, u, h);
2816
2934
  n({
2817
2935
  isAuthenticated: !0,
2818
2936
  isLoading: !1,
2819
- user: de(y),
2937
+ user: de(p),
2820
2938
  error: null
2821
2939
  });
2822
- } catch (u) {
2823
- n((h) => ({
2824
- ...h,
2940
+ } catch (l) {
2941
+ n((u) => ({
2942
+ ...u,
2825
2943
  isLoading: !1,
2826
- error: u instanceof Error ? u.message : "Passkey registration failed"
2944
+ error: l instanceof Error ? l.message : "Passkey registration failed"
2827
2945
  }));
2828
2946
  }
2829
2947
  },
@@ -2838,27 +2956,27 @@ function Io({ children: t, config: e }) {
2838
2956
  }),
2839
2957
  [r, o, s, a, i]
2840
2958
  );
2841
- return /* @__PURE__ */ E.jsx(qe, { value: c, children: t });
2959
+ return /* @__PURE__ */ R.jsx(qe, { value: c, children: t });
2842
2960
  }
2843
- function co() {
2961
+ function lo() {
2844
2962
  const t = Ve(qe);
2845
2963
  if (!t)
2846
2964
  throw new Error("useAuth must be used within an AuthProvider");
2847
2965
  return t;
2848
2966
  }
2849
- function uo() {
2967
+ function fo() {
2850
2968
  return Ve(qe);
2851
2969
  }
2852
- function Oo(t) {
2853
- const { config: e, guestUrlParam: r } = t, { state: n, login: o } = co(), s = w(!1);
2970
+ function _o(t) {
2971
+ const { config: e, guestUrlParam: r } = t, { state: n, login: o } = lo(), s = w(!1);
2854
2972
  return U(() => {
2855
2973
  if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
2856
2974
  return;
2857
2975
  const i = new URLSearchParams(window.location.search), a = i.get(r);
2858
2976
  if (a === "true" || a === "1" || a === "") {
2859
2977
  i.delete(r);
2860
- const c = i.toString(), f = window.location.pathname + (c ? `?${c}` : "");
2861
- window.history.replaceState({}, "", f), s.current = !0, o("guest");
2978
+ const c = i.toString(), h = window.location.pathname + (c ? `?${c}` : "");
2979
+ window.history.replaceState({}, "", h), s.current = !0, o("guest");
2862
2980
  }
2863
2981
  }, [r, n.isAuthenticated, n.isLoading, e.methods, o]), {
2864
2982
  shouldRenderChildren: n.isAuthenticated,
@@ -2867,7 +2985,7 @@ function Oo(t) {
2867
2985
  error: n.error
2868
2986
  };
2869
2987
  }
2870
- function _o({
2988
+ function Po({
2871
2989
  connectionState: t,
2872
2990
  error: e,
2873
2991
  isReady: r,
@@ -2877,138 +2995,138 @@ function _o({
2877
2995
  onAction: i,
2878
2996
  renderIdle: a,
2879
2997
  renderConnecting: c,
2880
- renderConnectingSlow: f,
2881
- renderConnected: l,
2882
- renderOffline: u,
2883
- renderError: h
2998
+ renderConnectingSlow: h,
2999
+ renderConnected: d,
3000
+ renderOffline: l,
3001
+ renderError: u
2884
3002
  }) {
2885
- const y = w(!1);
3003
+ const p = w(!1);
2886
3004
  switch (t) {
2887
3005
  case "idle":
2888
3006
  return a();
2889
3007
  case "connecting":
2890
3008
  return c();
2891
3009
  case "connectingSlow":
2892
- return f();
3010
+ return h();
2893
3011
  case "connected":
2894
3012
  case "reconnecting": {
2895
3013
  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({
3014
+ t === "reconnecting" && (p.current = !0);
3015
+ const m = n.size > 0;
3016
+ return m && (p.current = !1), d({
2899
3017
  stores: n,
2900
3018
  registry: o,
2901
3019
  client: s,
2902
3020
  onAction: i,
2903
- isReconnecting: t === "reconnecting" || y.current && !p
3021
+ isReconnecting: t === "reconnecting" || p.current && !m
2904
3022
  });
2905
3023
  }
2906
3024
  case "offline":
2907
- return y.current = !1, u();
3025
+ return p.current = !1, l();
2908
3026
  case "offlineError":
2909
- return y.current = !1, h(e ?? s?.lastError?.message ?? null);
3027
+ return p.current = !1, u(e ?? s?.lastError?.message ?? null);
2910
3028
  default:
2911
3029
  return null;
2912
3030
  }
2913
3031
  }
2914
- const be = Ee("useIkonApp");
2915
- function lo() {
3032
+ const be = Re("useIkonApp");
3033
+ function ho() {
2916
3034
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
2917
3035
  return window.__IKON_AUTH_CONFIG__;
2918
3036
  }
2919
- function fo() {
3037
+ function po() {
2920
3038
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
2921
3039
  return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
2922
3040
  }
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(() => {
3041
+ function Mo(t) {
3042
+ const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport: h, proxy: d } = t, l = e === void 0 ? ho() ?? null : e, u = po(), p = fo(), m = w(null), b = w(null), g = w(null), y = w(!1), v = w(!1), E = w(o), T = w(n), O = w(s), K = w(i), Q = w(a), C = w(c), _ = w(h), x = w(d);
3043
+ E.current = o, T.current = n, O.current = s, K.current = i, Q.current = a, C.current = c, _.current = h, x.current = d;
3044
+ const [P, F] = J("idle"), [z, ne] = J(null), [he, pe] = J(null), [se, me] = J(null), [ee, f] = J(null), [S, A] = J(!1), [M, W] = J(0), I = V(() => {
2927
3045
  try {
2928
- const M = xt();
2929
- return (M.sessionId || M.channelKey) && Dt(), M;
3046
+ const L = Dt();
3047
+ return (L.sessionId || L.channelKey) && Ft(), L;
2930
3048
  } catch {
2931
3049
  return { parameters: {} };
2932
3050
  }
2933
- }, []), q = V(() => u?.enabled ? Rt() : null, [u?.enabled, P]), te = h?.enabled ?? !1, O = h?.host ?? "localhost", G = h?.port ?? 8443;
3051
+ }, []), q = V(() => l?.enabled ? Et() : null, [l?.enabled, M]), te = u?.enabled ?? !1, N = u?.host ?? "localhost", G = u?.port ?? 8443;
2934
3052
  U(() => {
2935
- !te && Ge() && u && !u.enabled && u.spaceId && !ee && !S && (k(!0), Et(u.spaceId, je(u.authUrl)).then(($) => {
2936
- d($.token);
3053
+ !te && Ge() && l && !l.enabled && l.spaceId && !ee && !S && (A(!0), Rt(l.spaceId, Le(l.authUrl)).then(($) => {
3054
+ f($.token);
2937
3055
  }).catch(($) => {
2938
3056
  be.error("Anonymous auth failed:", $), ne($ instanceof Error ? $.message : "Anonymous auth failed");
2939
3057
  }).finally(() => {
2940
- k(!1);
3058
+ A(!1);
2941
3059
  }));
2942
- }, [te, u, ee, S]);
3060
+ }, [te, l, ee, S]);
2943
3061
  const re = V(() => {
2944
3062
  if (te) {
2945
- const M = q?.token ? Ft(q.token) ?? void 0 : void 0;
3063
+ const L = q?.token ? Bt(q.token) ?? void 0 : void 0;
2946
3064
  return {
2947
3065
  local: {
2948
- host: O,
3066
+ host: N,
2949
3067
  httpsPort: G,
2950
- userId: M,
3068
+ userId: L,
2951
3069
  token: q?.token ?? void 0,
2952
- spaceId: u?.spaceId,
2953
- backendUrl: u?.backendUrl,
2954
- authUrl: u?.authUrl,
2955
- parameters: C.parameters
3070
+ spaceId: l?.spaceId,
3071
+ backendUrl: l?.backendUrl,
3072
+ authUrl: l?.authUrl,
3073
+ parameters: I.parameters
2956
3074
  }
2957
3075
  };
2958
3076
  }
2959
- return q?.token && u?.spaceId ? {
3077
+ return q?.token && l?.spaceId ? {
2960
3078
  sessionToken: {
2961
3079
  token: q.token,
2962
- spaceId: u.spaceId,
3080
+ spaceId: l.spaceId,
2963
3081
  backendType: He(),
2964
- sessionId: C.sessionId,
2965
- channelKey: C.channelKey,
2966
- parameters: C.parameters
3082
+ sessionId: I.sessionId,
3083
+ channelKey: I.channelKey,
3084
+ parameters: I.parameters
2967
3085
  }
2968
- } : ee && u?.spaceId ? {
3086
+ } : ee && l?.spaceId ? {
2969
3087
  sessionToken: {
2970
3088
  token: ee,
2971
- spaceId: u.spaceId,
3089
+ spaceId: l.spaceId,
2972
3090
  backendType: He(),
2973
- sessionId: C.sessionId,
2974
- channelKey: C.channelKey,
2975
- parameters: C.parameters
3091
+ sessionId: I.sessionId,
3092
+ channelKey: I.channelKey,
3093
+ parameters: I.parameters
2976
3094
  }
2977
3095
  } : Ge() ? null : {
2978
3096
  local: {
2979
- host: O,
3097
+ host: N,
2980
3098
  httpsPort: G,
2981
- spaceId: u?.spaceId,
2982
- backendUrl: u?.backendUrl,
2983
- authUrl: u?.authUrl,
2984
- parameters: C.parameters
3099
+ spaceId: l?.spaceId,
3100
+ backendUrl: l?.backendUrl,
3101
+ authUrl: l?.authUrl,
3102
+ parameters: I.parameters
2985
3103
  }
2986
3104
  };
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);
3105
+ }, [te, N, G, q?.token, l?.spaceId, l?.backendUrl, l?.authUrl, ee, I.sessionId, I.channelKey, I.parameters]);
3106
+ rn(se);
3107
+ const Te = on(se);
2990
3108
  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);
3109
+ if (!y.current) {
3110
+ if (y.current = !0, g.current = Gr(), r)
3111
+ for (const L of r)
3112
+ L(g.current);
3113
+ g.current.loadRegisteredModules().catch((L) => {
3114
+ be.error("Failed to load UI modules", L);
2997
3115
  });
2998
3116
  }
2999
3117
  }, []), U(() => {
3000
3118
  if (!re) return;
3001
- const M = new Bt({
3119
+ const L = new $t({
3002
3120
  ...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 } } : {}
3121
+ timeouts: T.current,
3122
+ audio: K.current !== void 0 || E.current ? {
3123
+ enabled: K.current,
3124
+ ...E.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
3007
3125
  } : void 0,
3008
3126
  video: Q.current !== void 0 ? { enabled: Q.current } : void 0,
3009
3127
  mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
3010
- webRtc: L.current ? { enabled: !0 } : void 0,
3011
- websocket: T.current,
3128
+ webRtc: O.current ? { enabled: !0 } : void 0,
3129
+ websocket: C.current,
3012
3130
  webtransport: _.current,
3013
3131
  proxy: x.current,
3014
3132
  onConnectionStateChange: (H) => {
@@ -3018,39 +3136,39 @@ function No(t) {
3018
3136
  ne(H.message);
3019
3137
  }
3020
3138
  });
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);
3139
+ m.current = L;
3140
+ const $ = new ur({ client: L });
3141
+ return b.current = $, me($), L.connect().catch((H) => {
3142
+ if (be.error("Connection failed:", H), H instanceof Vt) {
3143
+ pe(H.reason);
3026
3144
  return;
3027
3145
  }
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)));
3146
+ H instanceof Kt && !v.current && (v.current = !0, be.warn("Auth session appears stale, clearing and retrying"), p ? p.logout() : (ve(), W((_t) => _t + 1)));
3029
3147
  }), () => {
3030
- M.disconnect(), p.current = null, $.dispose(), b.current = null;
3148
+ L.disconnect(), m.current = null, $.dispose(), b.current = null;
3031
3149
  };
3032
3150
  }, [re]);
3033
- const Ot = D((M, $) => {
3151
+ const Ot = D((L, $) => {
3034
3152
  const H = typeof $ == "string" ? $ : JSON.stringify($ ?? {});
3035
- p.current?.sendActionCall(M, H);
3036
- }, []), _t = N === "connected" || N === "reconnecting";
3153
+ m.current?.sendActionCall(L, H);
3154
+ }, []), Nt = P === "connected" || P === "reconnecting";
3037
3155
  return {
3038
- connectionState: N,
3156
+ connectionState: P,
3039
3157
  error: z,
3040
3158
  accessDeniedReason: he,
3041
3159
  stores: Te,
3042
- client: p.current,
3043
- registry: m.current,
3044
- clientRef: p,
3160
+ client: m.current,
3161
+ registry: g.current,
3162
+ clientRef: m,
3045
3163
  uiRef: b,
3046
- registryRef: m,
3164
+ registryRef: g,
3047
3165
  onAction: Ot,
3048
- isReady: _t,
3049
- webRtcVideoStreams: p.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
3050
- webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
3166
+ isReady: Nt,
3167
+ webRtcVideoStreams: m.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
3168
+ webRtcTrackMap: m.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
3051
3169
  };
3052
3170
  }
3053
- function Po(t) {
3171
+ function Lo(t) {
3054
3172
  const e = w(!1);
3055
3173
  return D(() => {
3056
3174
  if (e.current) return;
@@ -3059,28 +3177,28 @@ function Po(t) {
3059
3177
  r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
3060
3178
  }, [t]);
3061
3179
  }
3062
- let ho = 0;
3063
- function Mo(t = 5, e = 5e3) {
3180
+ let mo = 0;
3181
+ function jo(t = 5, e = 5e3) {
3064
3182
  const [r, n] = J([]), o = w(/* @__PURE__ */ new Map()), s = D((i) => {
3065
3183
  const a = o.current.get(i);
3066
- a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
3184
+ a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((h) => h.id !== i));
3067
3185
  }, []);
3068
3186
  return U(() => {
3069
- const i = o.current, a = Kt(
3187
+ const i = o.current, a = Yt(
3070
3188
  (c) => {
3071
- if (!Yt())
3189
+ if (!zt())
3072
3190
  return;
3073
- const f = `toast-${++ho}`, l = c.level === Je.ERROR ? "error" : "warn", u = {
3074
- id: f,
3075
- level: l,
3191
+ const h = `toast-${++mo}`, d = c.level === Je.ERROR ? "error" : "warn", l = {
3192
+ id: h,
3193
+ level: d,
3076
3194
  message: c.message,
3077
3195
  component: c.component
3078
3196
  };
3079
- n((y) => [...y, u].slice(-t));
3080
- const h = setTimeout(() => {
3081
- s(f);
3197
+ n((p) => [...p, l].slice(-t));
3198
+ const u = setTimeout(() => {
3199
+ s(h);
3082
3200
  }, e);
3083
- i.set(f, h);
3201
+ i.set(h, u);
3084
3202
  },
3085
3203
  { minLevel: Je.WARN }
3086
3204
  );
@@ -3092,100 +3210,101 @@ function Mo(t = 5, e = 5e3) {
3092
3210
  };
3093
3211
  }, [t, e, s]), { toasts: r, dismissToast: s };
3094
3212
  }
3095
- const It = pt(null);
3096
- function mo(t, e) {
3213
+ const It = mt(null);
3214
+ function go(t, e) {
3097
3215
  return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
3098
3216
  }
3099
- function po(t, e) {
3100
- const r = zt();
3217
+ function yo(t, e) {
3218
+ const r = Wt();
3101
3219
  if (r && t.includes(r))
3102
3220
  return r;
3103
3221
  const n = navigator.language.split("-")[0];
3104
3222
  return t.includes(n) ? n : e && t.includes(e) ? e : "en";
3105
3223
  }
3106
- function go(t, e, r) {
3107
- return e ? po(t, r) : r && t.includes(r) ? r : "en";
3224
+ function bo(t, e, r) {
3225
+ return e ? yo(t, r) : r && t.includes(r) ? r : "en";
3108
3226
  }
3109
- function jo({
3227
+ function Uo({
3110
3228
  children: t,
3111
3229
  translations: e,
3112
3230
  defaultLanguage: r,
3113
3231
  detectLanguage: n = !1
3114
3232
  }) {
3115
- const o = Object.keys(e), s = go(o, n, r), i = e[s] ?? e.en, a = V(
3233
+ const o = Object.keys(e), s = bo(o, n, r), i = e[s] ?? e.en, a = V(
3116
3234
  () => ({
3117
- t: (c, f) => {
3118
- const l = i[c];
3119
- return mo(l, f);
3235
+ t: (c, h) => {
3236
+ const d = i[c];
3237
+ return go(d, h);
3120
3238
  },
3121
3239
  locale: s,
3122
3240
  translations: i
3123
3241
  }),
3124
3242
  [i, s]
3125
3243
  );
3126
- return /* @__PURE__ */ E.jsx(It, { value: a, children: t });
3244
+ return /* @__PURE__ */ R.jsx(It, { value: a, children: t });
3127
3245
  }
3128
- function Uo() {
3246
+ function xo() {
3129
3247
  const t = Ve(It);
3130
3248
  if (!t)
3131
3249
  throw new Error("useI18n must be used within an I18nProvider");
3132
3250
  return t;
3133
3251
  }
3134
3252
  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,
3253
+ No as AuthProvider,
3254
+ Po as ConnectionStateRenderer,
3255
+ Uo as I18nProvider,
3256
+ yr as IKON_UI_BASE_MODULE,
3257
+ Or as IKON_UI_MEDIA_MODULE,
3258
+ Yr as IKON_UI_SHADERTOY_MODULE,
3259
+ Vr as IKON_UI_SHADERTOY_TYPE,
3260
+ Ue as IKON_UI_STREAM_CATEGORY,
3261
+ kr as IKON_UI_VIDEO_CANVAS_TYPE,
3262
+ Ar as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3263
+ ur as IkonUi,
3264
+ qr as IkonUiRegistry,
3265
+ ko as IkonUiSurface,
3266
+ ar as InspectOverlay,
3267
+ ir as UiComponentRegistry,
3268
+ sr as UiRenderer,
3269
+ Bo as UiStreamStore,
3270
+ Ao as areIkonUiModuleListsEqual,
3271
+ Rt as authenticateAnonymous,
3272
+ Xn as buildOAuthRedirectUrl,
3154
3273
  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,
3274
+ pt as clearOAuthParams,
3275
+ gr as createBaseResolvers,
3276
+ Eo as createComponentLibrary,
3277
+ Gr as createIkonUiRegistry,
3278
+ Cr as createMediaResolvers,
3279
+ Kr as createShadertoyRendererResolver,
3280
+ cr as isIkonUiCategoryMatch,
3281
+ Et as loadAuthSession,
3282
+ br as loadBaseModule,
3283
+ Nr as loadMediaModule,
3284
+ zr as loadShadertoyModule,
3285
+ En as normalizeIkonUiModuleList,
3286
+ Co as parseIkonUiInitPayload,
3287
+ Hn as parseOAuthCallback,
3288
+ Jn as parseOAuthError,
3289
+ Rn as readIkonUiModules,
3290
+ To as readIkonUiModulesFromSources,
3291
+ Sr as registerBaseModule,
3292
+ _r as registerMediaModule,
3293
+ Wr as registerShadertoyModule,
3294
+ nr as renderChildren,
3295
+ Io as renderMotionLetters,
3296
+ Ae as saveAuthSession,
3297
+ Oo as sendMagicLink,
3179
3298
  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,
3299
+ lo as useAuth,
3300
+ _o as useAuthGuard,
3301
+ fo as useAuthOptional,
3302
+ xo as useI18n,
3303
+ Mo as useIkonApp,
3304
+ rn as useIkonStyles,
3305
+ on as useIkonUiStores,
3306
+ Lo as useLazyFont,
3307
+ jo as useToasts,
3189
3308
  Z as useUiNode,
3190
- vo as useUiStore
3309
+ Ro as useUiStore
3191
3310
  };