@ikonai/sdk-react-ui 0.0.28 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { IkonUICore as Xe, UiStreamStore as He } from "@ikonai/sdk-ui";
2
- import { UiStreamStore as zr } from "@ikonai/sdk-ui";
3
- import Je, { useSyncExternalStore as Ke, Fragment as Ze, useMemo as Qe, memo as _, useRef as Le, useEffect as Y, useCallback as Se } from "react";
4
- import { createLogger as ue } from "@ikonai/sdk";
5
- var q = { exports: {} }, x = {};
1
+ import { IkonUICore as Je, UiStreamStore as Ze } from "@ikonai/sdk-ui";
2
+ import { UiStreamStore as Gr } from "@ikonai/sdk-ui";
3
+ import Qe, { useSyncExternalStore as pe, useMemo as x, memo as j, useRef as I, useCallback as ae, Fragment as et, useEffect as q, useState as tt } from "react";
4
+ import { createLogger as he } from "@ikonai/sdk";
5
+ var K = { exports: {} }, F = {};
6
6
  /**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
@@ -12,10 +12,10 @@ var q = { exports: {} }, x = {};
12
12
  * This source code is licensed under the MIT license found in the
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
- var be;
16
- function et() {
17
- if (be) return x;
18
- be = 1;
15
+ var Re;
16
+ function rt() {
17
+ if (Re) return F;
18
+ Re = 1;
19
19
  var r = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
20
20
  function t(n, o, s) {
21
21
  var i = null;
@@ -32,9 +32,9 @@ function et() {
32
32
  props: s
33
33
  };
34
34
  }
35
- return x.Fragment = e, x.jsx = t, x.jsxs = t, x;
35
+ return F.Fragment = e, F.jsx = t, F.jsxs = t, F;
36
36
  }
37
- var U = {};
37
+ var V = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,47 +44,47 @@ var U = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var ve;
48
- function tt() {
49
- return ve || (ve = 1, process.env.NODE_ENV !== "production" && function() {
47
+ var ke;
48
+ function nt() {
49
+ return ke || (ke = 1, process.env.NODE_ENV !== "production" && function() {
50
50
  function r(a) {
51
51
  if (a == null) return null;
52
52
  if (typeof a == "function")
53
- return a.$$typeof === qe ? null : a.displayName || a.name || null;
53
+ return a.$$typeof === Ke ? null : a.displayName || a.name || null;
54
54
  if (typeof a == "string") return a;
55
55
  switch (a) {
56
- case E:
56
+ case S:
57
57
  return "Fragment";
58
58
  case y:
59
59
  return "Profiler";
60
- case h:
60
+ case f:
61
61
  return "StrictMode";
62
- case M:
62
+ case P:
63
63
  return "Suspense";
64
- case W:
64
+ case G:
65
65
  return "SuspenseList";
66
- case We:
66
+ case Ge:
67
67
  return "Activity";
68
68
  }
69
69
  if (typeof a == "object")
70
70
  switch (typeof a.tag == "number" && console.error(
71
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
72
  ), a.$$typeof) {
73
- case A:
73
+ case N:
74
74
  return "Portal";
75
- case C:
75
+ case A:
76
76
  return (a.displayName || "Context") + ".Provider";
77
- case v:
77
+ case E:
78
78
  return (a._context.displayName || "Context") + ".Consumer";
79
- case T:
80
- var f = a.render;
81
- return a = a.displayName, a || (a = f.displayName || f.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
82
- case De:
83
- return f = a.displayName || null, f !== null ? f : r(a.type) || "Memo";
84
- case de:
85
- f = a._payload, a = a._init;
79
+ case C:
80
+ var m = a.render;
81
+ return a = a.displayName, a || (a = m.displayName || m.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
82
+ case Ye:
83
+ return m = a.displayName || null, m !== null ? m : r(a.type) || "Memo";
84
+ case ge:
85
+ m = a._payload, a = a._init;
86
86
  try {
87
- return r(a(f));
87
+ return r(a(m));
88
88
  } catch {
89
89
  }
90
90
  }
@@ -96,73 +96,73 @@ function tt() {
96
96
  function t(a) {
97
97
  try {
98
98
  e(a);
99
- var f = !1;
99
+ var m = !1;
100
100
  } catch {
101
- f = !0;
101
+ m = !0;
102
102
  }
103
- if (f) {
104
- f = console;
105
- var b = f.error, w = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
106
- return b.call(
107
- f,
103
+ if (m) {
104
+ m = console;
105
+ var v = m.error, R = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
106
+ return v.call(
107
+ m,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- w
109
+ R
110
110
  ), e(a);
111
111
  }
112
112
  }
113
113
  function n(a) {
114
- if (a === E) return "<>";
115
- if (typeof a == "object" && a !== null && a.$$typeof === de)
114
+ if (a === S) return "<>";
115
+ if (typeof a == "object" && a !== null && a.$$typeof === ge)
116
116
  return "<...>";
117
117
  try {
118
- var f = r(a);
119
- return f ? "<" + f + ">" : "<...>";
118
+ var m = r(a);
119
+ return m ? "<" + m + ">" : "<...>";
120
120
  } catch {
121
121
  return "<...>";
122
122
  }
123
123
  }
124
124
  function o() {
125
- var a = J.A;
125
+ var a = Z.A;
126
126
  return a === null ? null : a.getOwner();
127
127
  }
128
128
  function s() {
129
129
  return Error("react-stack-top-frame");
130
130
  }
131
131
  function i(a) {
132
- if (fe.call(a, "key")) {
133
- var f = Object.getOwnPropertyDescriptor(a, "key").get;
134
- if (f && f.isReactWarning) return !1;
132
+ if (ye.call(a, "key")) {
133
+ var m = Object.getOwnPropertyDescriptor(a, "key").get;
134
+ if (m && m.isReactWarning) return !1;
135
135
  }
136
136
  return a.key !== void 0;
137
137
  }
138
- function c(a, f) {
139
- function b() {
140
- me || (me = !0, console.error(
138
+ function c(a, m) {
139
+ function v() {
140
+ Se || (Se = !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
- f
142
+ m
143
143
  ));
144
144
  }
145
- b.isReactWarning = !0, Object.defineProperty(a, "key", {
146
- get: b,
145
+ v.isReactWarning = !0, Object.defineProperty(a, "key", {
146
+ get: v,
147
147
  configurable: !0
148
148
  });
149
149
  }
150
- function l() {
150
+ function u() {
151
151
  var a = r(this.type);
152
- return pe[a] || (pe[a] = !0, console.error(
152
+ return be[a] || (be[a] = !0, console.error(
153
153
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
154
  )), a = this.props.ref, a !== void 0 ? a : null;
155
155
  }
156
- function u(a, f, b, w, O, j, Z, Q) {
157
- return b = j.ref, a = {
158
- $$typeof: k,
156
+ function d(a, m, v, R, _, O, ee, te) {
157
+ return v = O.ref, a = {
158
+ $$typeof: w,
159
159
  type: a,
160
- key: f,
161
- props: j,
162
- _owner: O
163
- }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(a, "ref", {
160
+ key: m,
161
+ props: O,
162
+ _owner: _
163
+ }, (v !== void 0 ? v : null) !== null ? Object.defineProperty(a, "ref", {
164
164
  enumerable: !1,
165
- get: l
165
+ get: u
166
166
  }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
167
167
  configurable: !1,
168
168
  enumerable: !1,
@@ -177,120 +177,141 @@ function tt() {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
- value: Z
180
+ value: ee
181
181
  }), Object.defineProperty(a, "_debugTask", {
182
182
  configurable: !1,
183
183
  enumerable: !1,
184
184
  writable: !0,
185
- value: Q
185
+ value: te
186
186
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
187
187
  }
188
- function d(a, f, b, w, O, j, Z, Q) {
189
- var R = f.children;
190
- if (R !== void 0)
191
- if (w)
192
- if (Ye(R)) {
193
- for (w = 0; w < R.length; w++)
194
- m(R[w]);
195
- Object.freeze && Object.freeze(R);
188
+ function l(a, m, v, R, _, O, ee, te) {
189
+ var k = m.children;
190
+ if (k !== void 0)
191
+ if (R)
192
+ if (Xe(k)) {
193
+ for (R = 0; R < k.length; R++)
194
+ p(k[R]);
195
+ Object.freeze && Object.freeze(k);
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 m(R);
201
- if (fe.call(f, "key")) {
202
- R = r(a);
203
- var I = Object.keys(f).filter(function(Ge) {
204
- return Ge !== "key";
200
+ else p(k);
201
+ if (ye.call(m, "key")) {
202
+ k = r(a);
203
+ var L = Object.keys(m).filter(function(He) {
204
+ return He !== "key";
205
205
  });
206
- w = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", ye[R + w] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ R = 0 < L.length ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}", we[k + R] || (L = 0 < L.length ? "{" + L.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
- w,
214
213
  R,
215
- I,
216
- R
217
- ), ye[R + w] = !0);
214
+ k,
215
+ L,
216
+ k
217
+ ), we[k + R] = !0);
218
218
  }
219
- if (R = null, b !== void 0 && (t(b), R = "" + b), i(f) && (t(f.key), R = "" + f.key), "key" in f) {
220
- b = {};
221
- for (var ee in f)
222
- ee !== "key" && (b[ee] = f[ee]);
223
- } else b = f;
224
- return R && c(
225
- b,
219
+ if (k = null, v !== void 0 && (t(v), k = "" + v), i(m) && (t(m.key), k = "" + m.key), "key" in m) {
220
+ v = {};
221
+ for (var re in m)
222
+ re !== "key" && (v[re] = m[re]);
223
+ } else v = m;
224
+ return k && c(
225
+ v,
226
226
  typeof a == "function" ? a.displayName || a.name || "Unknown" : a
227
- ), u(
227
+ ), d(
228
228
  a,
229
- R,
230
- j,
229
+ k,
231
230
  O,
231
+ _,
232
232
  o(),
233
- b,
234
- Z,
235
- Q
233
+ v,
234
+ ee,
235
+ te
236
236
  );
237
237
  }
238
- function m(a) {
239
- typeof a == "object" && a !== null && a.$$typeof === k && a._store && (a._store.validated = 1);
238
+ function p(a) {
239
+ typeof a == "object" && a !== null && a.$$typeof === w && a._store && (a._store.validated = 1);
240
240
  }
241
- var g = Je, k = Symbol.for("react.transitional.element"), A = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), C = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), De = Symbol.for("react.memo"), de = Symbol.for("react.lazy"), We = Symbol.for("react.activity"), qe = Symbol.for("react.client.reference"), J = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, fe = Object.prototype.hasOwnProperty, Ye = Array.isArray, K = console.createTask ? console.createTask : function() {
241
+ var h = Qe, w = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), E = Symbol.for("react.consumer"), A = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), Ye = Symbol.for("react.memo"), ge = Symbol.for("react.lazy"), Ge = Symbol.for("react.activity"), Ke = Symbol.for("react.client.reference"), Z = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ye = Object.prototype.hasOwnProperty, Xe = Array.isArray, Q = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- g = {
244
+ h = {
245
245
  "react-stack-bottom-frame": function(a) {
246
246
  return a();
247
247
  }
248
248
  };
249
- var me, pe = {}, he = g["react-stack-bottom-frame"].bind(
250
- g,
249
+ var Se, be = {}, ve = h["react-stack-bottom-frame"].bind(
250
+ h,
251
251
  s
252
- )(), ge = K(n(s)), ye = {};
253
- U.Fragment = E, U.jsx = function(a, f, b, w, O) {
254
- var j = 1e4 > J.recentlyCreatedOwnerStacks++;
255
- return d(
252
+ )(), Ee = Q(n(s)), we = {};
253
+ V.Fragment = S, V.jsx = function(a, m, v, R, _) {
254
+ var O = 1e4 > Z.recentlyCreatedOwnerStacks++;
255
+ return l(
256
256
  a,
257
- f,
258
- b,
257
+ m,
258
+ v,
259
259
  !1,
260
- w,
261
- O,
262
- j ? Error("react-stack-top-frame") : he,
263
- j ? K(n(a)) : ge
260
+ R,
261
+ _,
262
+ O ? Error("react-stack-top-frame") : ve,
263
+ O ? Q(n(a)) : Ee
264
264
  );
265
- }, U.jsxs = function(a, f, b, w, O) {
266
- var j = 1e4 > J.recentlyCreatedOwnerStacks++;
267
- return d(
265
+ }, V.jsxs = function(a, m, v, R, _) {
266
+ var O = 1e4 > Z.recentlyCreatedOwnerStacks++;
267
+ return l(
268
268
  a,
269
- f,
270
- b,
269
+ m,
270
+ v,
271
271
  !0,
272
- w,
273
- O,
274
- j ? Error("react-stack-top-frame") : he,
275
- j ? K(n(a)) : ge
272
+ R,
273
+ _,
274
+ O ? Error("react-stack-top-frame") : ve,
275
+ O ? Q(n(a)) : Ee
276
276
  );
277
277
  };
278
- }()), U;
279
- }
280
- var Ee;
281
- function rt() {
282
- return Ee || (Ee = 1, process.env.NODE_ENV === "production" ? q.exports = et() : q.exports = tt()), q.exports;
278
+ }()), V;
279
+ }
280
+ var Ne;
281
+ function ot() {
282
+ return Ne || (Ne = 1, process.env.NODE_ENV === "production" ? K.exports = rt() : K.exports = nt()), K.exports;
283
+ }
284
+ var b = ot();
285
+ function st(r, e) {
286
+ const t = pe(
287
+ (n) => r.subscribe(n),
288
+ () => {
289
+ const n = r.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
290
+ return `${o ?? ""}:${s?.id ?? ""}`;
291
+ },
292
+ () => {
293
+ const n = r.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
294
+ return `${o ?? ""}:${s?.id ?? ""}`;
295
+ }
296
+ );
297
+ return x(() => {
298
+ const [n, o] = t.split(":");
299
+ return {
300
+ rootViewId: n || void 0,
301
+ rootNodeId: o || void 0
302
+ };
303
+ }, [t]);
283
304
  }
284
- var S = rt();
285
- function nt(r) {
286
- return Ke(
287
- (e) => r.subscribe(e),
288
- () => r.getSnapshot(),
289
- () => r.getSnapshot()
305
+ function M(r, e) {
306
+ const t = pe(
307
+ (n) => r.subscribeNode(e, n),
308
+ () => r.getNodeVersion(e),
309
+ () => r.getNodeVersion(e)
290
310
  );
311
+ return x(() => r.getNode(e), [r, e, t]);
291
312
  }
292
- const ot = ue("UIRenderer");
293
- function st(r) {
313
+ const it = he("UIRenderer");
314
+ function at(r) {
294
315
  if (r === void 0)
295
316
  return "{}";
296
317
  if (typeof r == "string")
@@ -301,79 +322,85 @@ function st(r) {
301
322
  return "{}";
302
323
  }
303
324
  }
304
- function xe(r) {
305
- const e = at(r), t = it(r);
306
- return e === r.children && t === r.styleIds ? r : {
307
- ...r,
308
- ...e !== r.children ? { children: e } : {},
309
- ...t !== r.styleIds ? { styleIds: t } : {}
310
- };
311
- }
312
- function it(r) {
325
+ function ct(r) {
313
326
  const e = r.styleIds;
314
327
  return Array.isArray(e) ? e : [];
315
328
  }
316
- function at(r) {
329
+ function ut(r) {
317
330
  const e = r.children;
318
331
  return Array.isArray(e) ? e : [];
319
332
  }
320
- function ct({ node: r, renderer: e, library: t, context: n, className: o }) {
321
- const s = xe(r), i = s.children.map((l) => $(l, t, n)), c = e;
322
- return /* @__PURE__ */ S.jsx(
323
- c,
324
- {
325
- node: s,
326
- context: n,
327
- children: i,
328
- className: o,
329
- styleIds: s.styleIds
330
- }
331
- );
333
+ function lt(r, e) {
334
+ return r.nodeId === e.nodeId && r.context === e.context;
332
335
  }
333
- function $(r, e, t) {
334
- const n = xe(r), o = n.children;
335
- if (n.type === "root")
336
- return /* @__PURE__ */ S.jsx(Ze, { children: o.map((l) => $(l, e, t)) }, n.id);
337
- const s = e.resolve(n);
338
- if (!s)
339
- return ot.warn(`No renderer for node type ${n.type}`), null;
340
- const i = n.styleIds, c = i.length > 0 ? i.join(" ") : void 0;
341
- return /* @__PURE__ */ S.jsx(
342
- ct,
343
- {
344
- node: n,
345
- renderer: s,
346
- library: e,
347
- context: t,
348
- className: c
349
- },
350
- n.id
351
- );
352
- }
353
- function lt({ store: r, library: e, viewId: t, emptyFallback: n = null, onAction: o, client: s, video: i }) {
354
- const c = nt(r), l = t ?? c.rootViewId;
355
- if (!l) return n;
356
- const u = c.views.get(l);
357
- if (!u) return n;
358
- const d = {
359
- getPayload: (m) => c.payloads.get(m),
360
- renderChildren: (m) => Array.isArray(m) ? m.map((g) => $(g, e, d)) : [],
361
- renderView: (m) => {
362
- const g = c.views.get(m);
363
- return g ? $(g, e, d) : null;
364
- },
365
- dispatchAction: (m, g) => {
366
- if (!m)
367
- return;
368
- const k = st(g);
369
- o?.(m, k);
370
- },
371
- client: s,
372
- video: i
373
- };
374
- return /* @__PURE__ */ S.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: $(u, e, d) });
336
+ function dt(r) {
337
+ if (r.length === 0) return "";
338
+ if (r.length === 1) return r[0].id;
339
+ let e = r[0].id;
340
+ for (let t = 1; t < r.length; t++)
341
+ e += "," + r[t].id;
342
+ return e;
375
343
  }
376
- class ut {
344
+ const ce = j(function r({ nodeId: e, context: t }) {
345
+ const n = M(t.store, e), o = n ? ut(n) : [], s = dt(o), i = x(
346
+ () => o.length === 0 ? null : o.map((p) => /* @__PURE__ */ b.jsx(r, { nodeId: p.id, context: t }, p.id)),
347
+ // eslint-disable-next-line react-hooks/exhaustive-deps
348
+ [s, t]
349
+ );
350
+ if (!n)
351
+ return null;
352
+ if (n.type === "root")
353
+ return /* @__PURE__ */ b.jsx(et, { children: i }, n.id);
354
+ const c = t.library.resolve(n);
355
+ if (!c)
356
+ return it.warn(`No renderer for node type ${n.type}`), null;
357
+ const u = ct(n), d = u.length > 0 ? u.join(" ") : void 0, l = c;
358
+ return /* @__PURE__ */ b.jsx(l, { nodeId: e, context: t, className: d });
359
+ }, lt);
360
+ function ft(r, e) {
361
+ return !Array.isArray(r) || r.length === 0 ? null : r.map((t) => /* @__PURE__ */ b.jsx(ce, { nodeId: t.id, context: e }, t.id));
362
+ }
363
+ function mt(r, e) {
364
+ return r.store === e.store && r.library === e.library && r.viewId === e.viewId && r.emptyFallback === e.emptyFallback;
365
+ }
366
+ const pt = j(function({ store: e, library: t, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: c }) {
367
+ const { rootViewId: u, rootNodeId: d } = st(e, n), l = I(s);
368
+ l.current = s;
369
+ const p = I(i);
370
+ p.current = i;
371
+ const h = I(c);
372
+ h.current = c;
373
+ const w = ae((S, f) => {
374
+ if (!S)
375
+ return;
376
+ const y = at(f);
377
+ l.current?.(S, y);
378
+ }, []), N = x(() => {
379
+ const S = {
380
+ store: e,
381
+ library: t,
382
+ handlerCache: e.handlerCache,
383
+ // Access payloads from store at call time, not captured snapshot
384
+ getPayload: (f) => e.getSnapshot().payloads.get(f),
385
+ renderChildren: (f) => ft(f, S),
386
+ renderView: (f) => {
387
+ const y = e.getSnapshot().views.get(f);
388
+ return y ? /* @__PURE__ */ b.jsx(ce, { nodeId: y.id, context: S }) : null;
389
+ },
390
+ dispatchAction: w,
391
+ // Access client/video via refs to avoid context recreation
392
+ get client() {
393
+ return p.current;
394
+ },
395
+ get video() {
396
+ return h.current;
397
+ }
398
+ };
399
+ return S;
400
+ }, [e, t, w]);
401
+ return !u || !d ? o : /* @__PURE__ */ b.jsx("div", { "data-ikon-view-id": u, style: { display: "contents" }, children: /* @__PURE__ */ b.jsx(ce, { nodeId: d, context: N }) });
402
+ }, mt);
403
+ class ht {
377
404
  constructor(e, t) {
378
405
  if (this.fallback = t, e)
379
406
  for (const [n, o] of e)
@@ -390,28 +417,60 @@ class ut {
390
417
  return this.renderers.get(e.type) ?? this.fallback;
391
418
  }
392
419
  }
393
- function Cr(r, e) {
420
+ function Pr(r, e) {
394
421
  const t = Object.entries(r);
395
- return new ut(t, e);
422
+ return new ht(t, e);
396
423
  }
397
- const se = "ikon-ui";
398
- function dt(r, e) {
399
- return r === e;
424
+ function Lr(r) {
425
+ return pe(
426
+ (e) => r.subscribe(e),
427
+ () => r.getSnapshot(),
428
+ () => r.getSnapshot()
429
+ );
400
430
  }
401
- function jr({ stores: r, library: e, category: t = se, version: n, onAction: o, client: s, video: i }) {
402
- const c = Qe(() => {
403
- const l = [];
404
- for (const [u, d] of r) {
405
- if (!dt(d.category, t))
406
- continue;
407
- const m = d.store.getSnapshot();
408
- !m.rootViewId || !m.views.has(m.rootViewId) || l.push({ key: u, store: d.store });
409
- }
410
- return l;
411
- }, [r, t, n]);
412
- return c.length === 0 ? null : /* @__PURE__ */ S.jsx(S.Fragment, { children: c.map(({ key: l, store: u }) => /* @__PURE__ */ S.jsx(lt, { store: u, library: e, onAction: o, client: s, video: i }, l)) });
431
+ const ue = "ikon-ui";
432
+ function gt(r, e) {
433
+ return r === e;
413
434
  }
414
- class Ar {
435
+ const xr = j(function({
436
+ stores: e,
437
+ library: t,
438
+ category: n = ue,
439
+ onAction: o,
440
+ client: s,
441
+ video: i
442
+ }) {
443
+ const c = x(() => Array.from(e.keys()).sort().join(","), [e]), u = I(o);
444
+ u.current = o;
445
+ const d = I(s);
446
+ d.current = s;
447
+ const l = I(i);
448
+ l.current = i;
449
+ const p = x(
450
+ () => {
451
+ const h = [];
452
+ for (const [w, N] of e) {
453
+ const S = N.store.getSnapshot();
454
+ gt(N.category, n) && (!S.rootViewId || !S.views.has(S.rootViewId) || h.push({ key: w, store: N.store }));
455
+ }
456
+ return h;
457
+ },
458
+ // eslint-disable-next-line react-hooks/exhaustive-deps
459
+ [e, n, c]
460
+ );
461
+ return p.length === 0 ? null : /* @__PURE__ */ b.jsx(b.Fragment, { children: p.map(({ key: h, store: w }) => /* @__PURE__ */ b.jsx(
462
+ pt,
463
+ {
464
+ store: w,
465
+ library: t,
466
+ onAction: u.current,
467
+ client: d.current,
468
+ video: l.current
469
+ },
470
+ h
471
+ )) });
472
+ });
473
+ class Ur {
415
474
  core;
416
475
  ownsCore;
417
476
  stores = /* @__PURE__ */ new Map();
@@ -419,13 +478,13 @@ class Ar {
419
478
  unsubscribeClears;
420
479
  unsubscribeStoreChanges;
421
480
  constructor(e) {
422
- this.core = e?.core ?? new Xe({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
481
+ this.core = e?.core ?? new Je({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
423
482
  }
424
483
  dispose() {
425
484
  this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
426
485
  }
427
486
  getStores() {
428
- return this.stores;
487
+ return new Map(this.stores);
429
488
  }
430
489
  getUiStyles() {
431
490
  return this.core.getUiStyles();
@@ -466,8 +525,8 @@ class Ar {
466
525
  if (t)
467
526
  return t;
468
527
  const n = {
469
- category: se,
470
- store: new He()
528
+ category: ue,
529
+ store: new Ze()
471
530
  };
472
531
  return this.stores.set(e, n), n;
473
532
  }
@@ -475,7 +534,7 @@ class Ar {
475
534
  const n = this.stores.get(e);
476
535
  if (!n)
477
536
  return !1;
478
- const o = t ?? this.core.uiStore.getSnapshot(e)?.category ?? se;
537
+ const o = t ?? this.core.uiStore.getSnapshot(e)?.category ?? ue;
479
538
  return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
480
539
  }
481
540
  notify(e) {
@@ -483,7 +542,7 @@ class Ar {
483
542
  t(e);
484
543
  }
485
544
  }
486
- function L(r) {
545
+ function $(r) {
487
546
  if (typeof r == "string") {
488
547
  const e = r.trim();
489
548
  return e.length > 0 ? e : void 0;
@@ -493,31 +552,38 @@ function L(r) {
493
552
  return e.length > 0 ? e.join(" ") : void 0;
494
553
  }
495
554
  }
496
- function V(...r) {
497
- const e = [];
555
+ function W(...r) {
556
+ let e = "";
498
557
  for (const t of r)
499
- t && t.trim() && e.push(t.trim());
500
- return e.length > 0 ? e.join(" ") : void 0;
558
+ if (t) {
559
+ const n = t.trim();
560
+ n && (e = e ? e + " " + n : n);
561
+ }
562
+ return e || void 0;
501
563
  }
502
- function D(r) {
564
+ const Te = /* @__PURE__ */ new WeakMap(), yt = {};
565
+ function Y(r) {
503
566
  if (!r)
504
- return {};
505
- const e = {};
506
- for (const [t, n] of Object.entries(r))
507
- n != null && (typeof n == "string" || typeof n == "number" || typeof n == "boolean") && (e[t] = n);
508
- return e;
567
+ return yt;
568
+ const e = Te.get(r);
569
+ if (e)
570
+ return e;
571
+ const t = {};
572
+ for (const [n, o] of Object.entries(r))
573
+ o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (t[n] = o);
574
+ return Te.set(r, t), t;
509
575
  }
510
- function ft() {
511
- const r = _(function({ node: t }) {
512
- const n = L(t.props?.targetViewId), o = t.props?.focusOnly, s = typeof o == "boolean" ? o : void 0, i = Le(null);
513
- return Y(() => {
576
+ function St() {
577
+ const r = j(function({ nodeId: t, context: n }) {
578
+ const o = M(n.store, t), s = I(null), i = $(o?.props?.targetViewId), c = o?.props?.focusOnly, u = typeof c == "boolean" ? c : void 0;
579
+ return q(() => {
514
580
  if (typeof document > "u")
515
581
  return;
516
- const l = i.current;
517
- if (!l || n && l.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== n)
582
+ const l = s.current;
583
+ if (!l || i && l.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
518
584
  return;
519
- const u = s !== !0;
520
- if (u && typeof l.scrollIntoView == "function")
585
+ const p = u !== !0;
586
+ if (p && typeof l.scrollIntoView == "function")
521
587
  try {
522
588
  l.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
523
589
  } catch {
@@ -525,48 +591,54 @@ function ft() {
525
591
  }
526
592
  if (typeof l.focus == "function")
527
593
  try {
528
- l.focus({ preventScroll: !u });
594
+ l.focus({ preventScroll: !p });
529
595
  } catch {
530
596
  l.focus();
531
597
  }
532
- }, [s, n]), /* @__PURE__ */ S.jsx(
598
+ }, [u, i]), o ? /* @__PURE__ */ b.jsx(
533
599
  "span",
534
600
  {
535
- ref: i,
601
+ ref: s,
536
602
  "aria-hidden": "true",
537
- "data-ikon-node-id": t.id,
603
+ "data-ikon-node-id": o.id,
538
604
  "data-ikon-focus-hint": "true",
539
605
  tabIndex: -1,
540
606
  style: { display: "block", width: 0, height: 0, overflow: "hidden" }
541
607
  }
542
- );
608
+ ) : null;
543
609
  });
544
610
  return ({ type: e }) => {
545
611
  if (e === "common.focus-hint")
546
612
  return r;
547
613
  };
548
614
  }
549
- function mt() {
550
- const r = _(function({ node: t, context: n, className: o }) {
551
- const s = D(t.props), i = V(L(t.props?.className), o), c = t.children?.length ? n.renderChildren(t.children) : void 0;
552
- return /* @__PURE__ */ S.jsx("div", { ...s, "data-ikon-node-id": t.id, className: i, children: c });
615
+ function bt() {
616
+ const r = j(function({ nodeId: t, context: n, className: o }) {
617
+ const s = M(n.store, t);
618
+ if (!s)
619
+ return null;
620
+ const i = Y(s.props), c = W($(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
621
+ return /* @__PURE__ */ b.jsx("div", { ...i, "data-ikon-node-id": s.id, className: c, children: u });
553
622
  });
554
623
  return ({ type: e }) => {
555
624
  if (e === "common.div")
556
625
  return r;
557
626
  };
558
627
  }
559
- function pt() {
560
- const r = _(function({ node: t, context: n, className: o }) {
561
- const s = D(t.props), i = V(L(t.props?.className), o), c = t.children?.length ? n.renderChildren(t.children) : void 0;
562
- return /* @__PURE__ */ S.jsx(
628
+ function vt() {
629
+ const r = j(function({ nodeId: t, context: n, className: o }) {
630
+ const s = M(n.store, t);
631
+ if (!s)
632
+ return null;
633
+ const i = Y(s.props), c = W($(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
634
+ return /* @__PURE__ */ b.jsx(
563
635
  "form",
564
636
  {
565
- ...s,
566
- "data-ikon-node-id": t.id,
567
- className: i,
568
- onSubmit: (l) => l.preventDefault(),
569
- children: c
637
+ ...i,
638
+ "data-ikon-node-id": s.id,
639
+ className: c,
640
+ onSubmit: (d) => d.preventDefault(),
641
+ children: u
570
642
  }
571
643
  );
572
644
  });
@@ -575,18 +647,21 @@ function pt() {
575
647
  return r;
576
648
  };
577
649
  }
578
- function ht() {
579
- const r = _(function({ node: t, context: n, className: o }) {
580
- const s = D(t.props), i = V(L(t.props?.className), o), c = t.children?.length ? n.renderChildren(t.children) : void 0;
581
- return /* @__PURE__ */ S.jsx(
650
+ function Et() {
651
+ const r = j(function({ nodeId: t, context: n, className: o }) {
652
+ const s = M(n.store, t);
653
+ if (!s)
654
+ return null;
655
+ const i = Y(s.props), c = W($(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
656
+ return /* @__PURE__ */ b.jsx(
582
657
  "div",
583
658
  {
584
- ...s,
585
- "data-ikon-node-id": t.id,
659
+ ...i,
660
+ "data-ikon-node-id": s.id,
586
661
  "data-ikon-view-type": "scroll-view",
587
662
  "data-ikon-scroll-container": "true",
588
- className: i,
589
- children: c
663
+ className: c,
664
+ children: u
590
665
  }
591
666
  );
592
667
  });
@@ -595,41 +670,47 @@ function ht() {
595
670
  return r;
596
671
  };
597
672
  }
598
- function gt() {
599
- const r = _(function({ node: t, context: n, className: o }) {
600
- const s = D(t.props), i = V("relative", L(t.props?.className), o), c = t.children?.length ? n.renderChildren(t.children) : void 0;
601
- return /* @__PURE__ */ S.jsx("div", { ...s, "data-ikon-node-id": t.id, className: i, children: c });
673
+ function wt() {
674
+ const r = j(function({ nodeId: t, context: n, className: o }) {
675
+ const s = M(n.store, t);
676
+ if (!s)
677
+ return null;
678
+ const i = Y(s.props), c = W("relative", $(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
679
+ return /* @__PURE__ */ b.jsx("div", { ...i, "data-ikon-node-id": s.id, className: c, children: u });
602
680
  });
603
681
  return ({ type: e }) => {
604
682
  if (e === "common.stack")
605
683
  return r;
606
684
  };
607
685
  }
608
- function yt() {
609
- const r = _(function({ node: t, context: n, className: o }) {
610
- const s = D(t.props), i = V("absolute", L(t.props?.className), o), c = t.children?.length ? n.renderChildren(t.children) : void 0;
611
- return /* @__PURE__ */ S.jsx("div", { ...s, "data-ikon-node-id": t.id, className: i, children: c });
686
+ function Rt() {
687
+ const r = j(function({ nodeId: t, context: n, className: o }) {
688
+ const s = M(n.store, t);
689
+ if (!s)
690
+ return null;
691
+ const i = Y(s.props), c = W("absolute", $(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
692
+ return /* @__PURE__ */ b.jsx("div", { ...i, "data-ikon-node-id": s.id, className: c, children: u });
612
693
  });
613
694
  return ({ type: e }) => {
614
695
  if (e === "common.layer")
615
696
  return r;
616
697
  };
617
698
  }
618
- function St() {
699
+ function kt() {
619
700
  return [
620
- mt(),
621
- pt(),
622
- ht(),
623
- gt(),
624
- yt(),
625
- ft()
701
+ bt(),
702
+ vt(),
703
+ Et(),
704
+ wt(),
705
+ Rt(),
706
+ St()
626
707
  ];
627
708
  }
628
- const bt = "base", vt = async () => St();
629
- function Et(r) {
630
- r.registerModule(bt, vt);
709
+ const Nt = "base", Tt = async () => kt();
710
+ function Ct(r) {
711
+ r.registerModule(Nt, Tt);
631
712
  }
632
- function Ue(r) {
713
+ function Ve(r) {
633
714
  if (typeof r == "string") {
634
715
  const e = r.trim();
635
716
  return e.length > 0 ? e : void 0;
@@ -639,13 +720,13 @@ function Ue(r) {
639
720
  return e.length > 0 ? e.join(" ") : void 0;
640
721
  }
641
722
  }
642
- function ze(...r) {
723
+ function Be(...r) {
643
724
  const e = [];
644
725
  for (const t of r)
645
726
  t && t.trim() && e.push(t.trim());
646
727
  return e.length > 0 ? e.join(" ") : void 0;
647
728
  }
648
- function G(r) {
729
+ function X(r) {
649
730
  if (typeof r == "number" && Number.isFinite(r))
650
731
  return Math.floor(r);
651
732
  if (typeof r == "string" && r.trim().length > 0) {
@@ -654,43 +735,43 @@ function G(r) {
654
735
  return Math.floor(e);
655
736
  }
656
737
  }
657
- function ie(r) {
738
+ function le(r) {
658
739
  if (typeof r != "string")
659
740
  return;
660
741
  const e = r.trim();
661
742
  return e.length > 0 ? e : void 0;
662
743
  }
663
- const wt = "media.video-canvas", Rt = "media.video-url-player";
664
- function kt() {
665
- const r = _(function({ node: t, context: n, className: o }) {
666
- const s = ie(t.props?.streamId), i = G(t.props?.width), c = G(t.props?.height), l = ze(Ue(t.props?.className), o), u = Le(null), d = n.video;
667
- return Y(() => {
668
- const m = u.current;
669
- if (!(!d || !m || !s))
670
- return d.attachCanvas(s, m), () => {
671
- d.detachCanvas(s);
744
+ const jt = "media.video-canvas", At = "media.video-url-player";
745
+ function Ot() {
746
+ const r = j(function({ nodeId: t, context: n, className: o }) {
747
+ const s = M(n.store, t), i = I(null), c = n.video, u = s ? le(s.props?.streamId) : void 0, d = s ? X(s.props?.width) : void 0, l = s ? X(s.props?.height) : void 0, p = s ? Be(Ve(s.props?.className), o) : o;
748
+ return q(() => {
749
+ const h = i.current;
750
+ if (!(!c || !h || !u))
751
+ return c.attachCanvas(u, h), () => {
752
+ c.detachCanvas(u);
672
753
  };
673
- }, [d, s]), /* @__PURE__ */ S.jsx(
754
+ }, [c, u]), s ? /* @__PURE__ */ b.jsx(
674
755
  "canvas",
675
756
  {
676
- ref: u,
677
- "data-ikon-node-id": t.id,
678
- "data-ikon-video-stream-id": s,
679
- className: l,
680
- ...i ? { width: i } : {},
681
- ...c ? { height: c } : {}
757
+ ref: i,
758
+ "data-ikon-node-id": s.id,
759
+ "data-ikon-video-stream-id": u,
760
+ className: p,
761
+ ...d ? { width: d } : {},
762
+ ...l ? { height: l } : {}
682
763
  }
683
- );
764
+ ) : null;
684
765
  });
685
766
  return ({ type: e }) => {
686
- if (e === wt)
767
+ if (e === jt)
687
768
  return r;
688
769
  };
689
770
  }
690
- function Nt() {
691
- return [kt(), Tt()];
771
+ function It() {
772
+ return [Ot(), Mt()];
692
773
  }
693
- function z(r) {
774
+ function B(r) {
694
775
  if (typeof r == "boolean")
695
776
  return r;
696
777
  if (typeof r == "string") {
@@ -699,42 +780,45 @@ function z(r) {
699
780
  if (e === "false") return !1;
700
781
  }
701
782
  }
702
- function Tt() {
703
- const r = _(function({
704
- node: t,
783
+ function Mt() {
784
+ const r = j(function({
785
+ nodeId: t,
705
786
  context: n,
706
787
  className: o
707
788
  }) {
708
- const s = ze(Ue(t.props?.className), o), i = ie(t.props?.src), c = ie(t.props?.poster), l = z(t.props?.controls), u = z(t.props?.autoplay), d = z(t.props?.loop), m = z(t.props?.muted), g = z(t.props?.playsInline), k = G(t.props?.width), A = G(t.props?.height), E = t.children?.length ? n.renderChildren(t.children) : void 0;
709
- return /* @__PURE__ */ S.jsx(
789
+ const s = M(n.store, t);
790
+ if (!s)
791
+ return null;
792
+ const i = Be(Ve(s.props?.className), o), c = le(s.props?.src), u = le(s.props?.poster), d = B(s.props?.controls), l = B(s.props?.autoplay), p = B(s.props?.loop), h = B(s.props?.muted), w = B(s.props?.playsInline), N = X(s.props?.width), S = X(s.props?.height), f = s.children?.length ? n.renderChildren(s.children) : void 0;
793
+ return /* @__PURE__ */ b.jsx(
710
794
  "video",
711
795
  {
712
- src: i,
713
- poster: c,
714
- ...l !== void 0 ? { controls: l } : {},
715
- ...u !== void 0 ? { autoPlay: u } : {},
716
- ...d !== void 0 ? { loop: d } : {},
717
- ...m !== void 0 ? { muted: m } : {},
718
- ...g !== void 0 ? { playsInline: g } : {},
719
- ...k ? { width: k } : {},
720
- ...A ? { height: A } : {},
721
- "data-ikon-node-id": t.id,
722
- className: s,
723
- children: E
796
+ src: c,
797
+ poster: u,
798
+ ...d !== void 0 ? { controls: d } : {},
799
+ ...l !== void 0 ? { autoPlay: l } : {},
800
+ ...p !== void 0 ? { loop: p } : {},
801
+ ...h !== void 0 ? { muted: h } : {},
802
+ ...w !== void 0 ? { playsInline: w } : {},
803
+ ...N ? { width: N } : {},
804
+ ...S ? { height: S } : {},
805
+ "data-ikon-node-id": s.id,
806
+ className: i,
807
+ children: f
724
808
  }
725
809
  );
726
810
  });
727
811
  return ({ type: e }) => {
728
- if (e === Rt)
812
+ if (e === At)
729
813
  return r;
730
814
  };
731
815
  }
732
- const Ct = "media", jt = async () => Nt();
733
- function At(r) {
734
- r.registerModule(Ct, jt);
816
+ const _t = "media", Pt = async () => It();
817
+ function Lt(r) {
818
+ r.registerModule(_t, Pt);
735
819
  }
736
- const we = ue("UIRegistry");
737
- class Ot {
820
+ const Ce = he("UIRegistry");
821
+ class xt {
738
822
  baseResolvers = [];
739
823
  moduleLoaders = /* @__PURE__ */ new Map();
740
824
  moduleResolvers = /* @__PURE__ */ new Map();
@@ -756,15 +840,15 @@ class Ot {
756
840
  for (const [n, o] of this.moduleLoaders.entries())
757
841
  if (!this.moduleResolvers.has(n))
758
842
  try {
759
- const s = await o(), i = Mt(s);
843
+ const s = await o(), i = $t(s);
760
844
  this.moduleResolvers.set(n, i), e = !0;
761
845
  } catch (s) {
762
- we.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
846
+ Ce.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
763
847
  }
764
848
  const t = [];
765
849
  for (const n of this.moduleLoaders.keys())
766
850
  this.moduleResolvers.has(n) && t.push(n);
767
- return It(t, this.activeModuleOrder) || (this.activeModuleOrder = t, e = !0), e;
851
+ return Ft(t, this.activeModuleOrder) || (this.activeModuleOrder = t, e = !0), e;
768
852
  }
769
853
  resolve(e) {
770
854
  for (const t of this.baseResolvers) {
@@ -774,7 +858,7 @@ class Ot {
774
858
  for (const t of this.activeModuleOrder) {
775
859
  const n = this.moduleResolvers.get(t);
776
860
  if (!n) {
777
- we.warn(`Missing resolvers for module ${t}`);
861
+ Ce.warn(`Missing resolvers for module ${t}`);
778
862
  continue;
779
863
  }
780
864
  for (const o of n) {
@@ -784,17 +868,17 @@ class Ot {
784
868
  }
785
869
  }
786
870
  }
787
- function Or() {
788
- const r = new Ot();
789
- return Et(r), At(r), r.loadRegisteredModules(), r;
871
+ function $r() {
872
+ const r = new xt();
873
+ return Ct(r), Lt(r), r.loadRegisteredModules(), r;
790
874
  }
791
- function _t(r) {
875
+ function Ut(r) {
792
876
  return Array.isArray(r) ? r : [r];
793
877
  }
794
- function Mt(r) {
795
- return r ? _t(r).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
878
+ function $t(r) {
879
+ return r ? Ut(r).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
796
880
  }
797
- function It(r, e) {
881
+ function Ft(r, e) {
798
882
  if (r.length !== e.length)
799
883
  return !1;
800
884
  for (let t = 0; t < r.length; t += 1)
@@ -802,7 +886,7 @@ function It(r, e) {
802
886
  return !1;
803
887
  return !0;
804
888
  }
805
- const te = ue("MotionController"), Re = {
889
+ const ne = he("MotionController"), je = {
806
890
  ease: [0.25, 0.1, 0.25, 1],
807
891
  "ease-in": [0.42, 0, 1, 1],
808
892
  "ease-out": [0, 0, 0.58, 1],
@@ -832,88 +916,88 @@ const te = ue("MotionController"), Re = {
832
916
  "ease-out-back": [0.175, 0.885, 0.32, 1.275],
833
917
  "ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
834
918
  };
835
- function N(r) {
919
+ function T(r) {
836
920
  return r <= 0 ? 0 : r >= 1 ? 1 : r;
837
921
  }
838
- function ke(r) {
922
+ function Ae(r) {
839
923
  if (r == null) return;
840
924
  const e = `${r}`.trim();
841
925
  if (!e) return;
842
926
  const t = Number.parseFloat(e);
843
927
  return Number.isFinite(t) ? t : void 0;
844
928
  }
845
- function Ne(r) {
929
+ function Oe(r) {
846
930
  return typeof CSS < "u" && CSS.escape ? CSS.escape(r) : r.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
847
931
  }
848
- function Te(r, e, t, n) {
849
- const d = new Float32Array(11);
850
- function m(h, y, v) {
851
- return ((3 * y - 3 * v + 1) * h + (3 * v - 6 * y)) * h * h + 3 * y * h;
932
+ function Ie(r, e, t, n) {
933
+ const l = new Float32Array(11);
934
+ function p(f, y, E) {
935
+ return ((3 * y - 3 * E + 1) * f + (3 * E - 6 * y)) * f * f + 3 * y * f;
852
936
  }
853
- function g(h, y, v) {
854
- return 3 * (3 * y - 3 * v + 1) * h * h + 2 * (3 * v - 6 * y) * h + 3 * y;
937
+ function h(f, y, E) {
938
+ return 3 * (3 * y - 3 * E + 1) * f * f + 2 * (3 * E - 6 * y) * f + 3 * y;
855
939
  }
856
- function k(h, y) {
857
- for (let v = 0; v < 4; v += 1) {
858
- const C = g(y, r, t);
859
- if (C === 0)
940
+ function w(f, y) {
941
+ for (let E = 0; E < 4; E += 1) {
942
+ const A = h(y, r, t);
943
+ if (A === 0)
860
944
  return y;
861
- const T = m(y, r, t) - h;
862
- y -= T / C;
945
+ const C = p(y, r, t) - f;
946
+ y -= C / A;
863
947
  }
864
948
  return y;
865
949
  }
866
- function A(h, y, v) {
867
- let C = 0, T = 0, M = 0;
950
+ function N(f, y, E) {
951
+ let A = 0, C = 0, P = 0;
868
952
  do
869
- T = y + (v - y) / 2, C = m(T, r, t) - h, C > 0 ? v = T : y = T;
870
- while (Math.abs(C) > 1e-7 && ++M < 10);
871
- return T;
872
- }
873
- function E(h) {
874
- let y = 0, v = 1;
875
- const C = 10;
876
- for (; v !== C && d[v] <= h; v += 1)
953
+ C = y + (E - y) / 2, A = p(C, r, t) - f, A > 0 ? E = C : y = C;
954
+ while (Math.abs(A) > 1e-7 && ++P < 10);
955
+ return C;
956
+ }
957
+ function S(f) {
958
+ let y = 0, E = 1;
959
+ const A = 10;
960
+ for (; E !== A && l[E] <= f; E += 1)
877
961
  y += 0.1;
878
- v -= 1;
879
- const T = (h - d[v]) / (d[v + 1] - d[v]), M = y + T * 0.1, W = g(M, r, t);
880
- return W >= 1e-3 ? k(h, M) : W === 0 ? M : A(h, y, y + 0.1);
962
+ E -= 1;
963
+ const C = (f - l[E]) / (l[E + 1] - l[E]), P = y + C * 0.1, G = h(P, r, t);
964
+ return G >= 1e-3 ? w(f, P) : G === 0 ? P : N(f, y, y + 0.1);
881
965
  }
882
- for (let h = 0; h < 11; h += 1)
883
- d[h] = m(h * 0.1, r, t);
884
- return (h) => h <= 0 ? 0 : h >= 1 ? 1 : m(E(h), e, n);
966
+ for (let f = 0; f < 11; f += 1)
967
+ l[f] = p(f * 0.1, r, t);
968
+ return (f) => f <= 0 ? 0 : f >= 1 ? 1 : p(S(f), e, n);
885
969
  }
886
- function Pt(r) {
970
+ function Vt(r) {
887
971
  const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(r);
888
972
  if (!e)
889
- return (o) => N(o);
973
+ return (o) => T(o);
890
974
  const t = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
891
- return n === "start" || n === "jump-start" ? (o) => N(Math.ceil(o * t) / t) : n === "none" || n === "jump-none" ? (o) => N(Math.round(o * t) / t) : n === "both" || n === "jump-both" ? (o) => N((Math.floor(o * t) + 0.5) / t) : (o) => N(Math.floor(o * t) / t);
975
+ return n === "start" || n === "jump-start" ? (o) => T(Math.ceil(o * t) / t) : n === "none" || n === "jump-none" ? (o) => T(Math.round(o * t) / t) : n === "both" || n === "jump-both" ? (o) => T((Math.floor(o * t) + 0.5) / t) : (o) => T(Math.floor(o * t) / t);
892
976
  }
893
- function Lt(r) {
977
+ function Bt(r) {
894
978
  if (!r)
895
- return (t) => N(t);
979
+ return (t) => T(t);
896
980
  const e = r.trim().toLowerCase();
897
981
  if (!e || e === "linear")
898
- return (t) => N(t);
899
- if (Re[e]) {
900
- const [t, n, o, s] = Re[e], i = Te(t, n, o, s);
901
- return (c) => N(i(N(c)));
982
+ return (t) => T(t);
983
+ if (je[e]) {
984
+ const [t, n, o, s] = je[e], i = Ie(t, n, o, s);
985
+ return (c) => T(i(T(c)));
902
986
  }
903
987
  if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
904
988
  const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
905
989
  if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
906
- const [o, s, i, c] = n, l = Te(o, s, i, c);
907
- return (u) => N(l(N(u)));
990
+ const [o, s, i, c] = n, u = Ie(o, s, i, c);
991
+ return (d) => T(u(T(d)));
908
992
  }
909
993
  }
910
994
  if (e.startsWith("steps(") && e.endsWith(")")) {
911
- const t = Pt(e);
912
- return (n) => t(N(n));
995
+ const t = Vt(e);
996
+ return (n) => t(T(n));
913
997
  }
914
- return (t) => N(t);
998
+ return (t) => T(t);
915
999
  }
916
- function xt(r) {
1000
+ function zt(r) {
917
1001
  if (!r)
918
1002
  return;
919
1003
  const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(r);
@@ -923,7 +1007,7 @@ function xt(r) {
923
1007
  if (![t, n, o, s].some((i) => !Number.isFinite(i)))
924
1008
  return { inStart: t, inEnd: n, outStart: o, outEnd: s };
925
1009
  }
926
- class Ut {
1010
+ class Dt {
927
1011
  bindingsByStyle = /* @__PURE__ */ new Map();
928
1012
  observer;
929
1013
  observeScheduled = !1;
@@ -947,7 +1031,7 @@ class Ut {
947
1031
  try {
948
1032
  e();
949
1033
  } catch (t) {
950
- te.warn("Failed to cleanup binding listener", t);
1034
+ ne.warn("Failed to cleanup binding listener", t);
951
1035
  }
952
1036
  this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
953
1037
  }
@@ -957,7 +1041,7 @@ class Ut {
957
1041
  const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
958
1042
  return n.length === 0 ? void 0 : { bindings: n };
959
1043
  } catch (t) {
960
- te.warn("Failed to parse motion metadata", t);
1044
+ ne.warn("Failed to parse motion metadata", t);
961
1045
  return;
962
1046
  }
963
1047
  }
@@ -965,16 +1049,16 @@ class Ut {
965
1049
  const t = e.source?.trim();
966
1050
  if (!t)
967
1051
  return;
968
- const n = ke(e.min) ?? 0, o = ke(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), c = !!e.reverse, l = Lt(e.ease), u = xt(e.map), d = e.targetId?.trim() || void 0;
1052
+ const n = Ae(e.min) ?? 0, o = Ae(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), c = !!e.reverse, u = Bt(e.ease), d = zt(e.map), l = e.targetId?.trim() || void 0;
969
1053
  return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
970
1054
  source: t.toLowerCase(),
971
1055
  min: n,
972
1056
  max: s,
973
1057
  clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
974
1058
  reverse: c,
975
- ease: l,
976
- map: u,
977
- targetId: d
1059
+ ease: u,
1060
+ map: d,
1061
+ targetId: l
978
1062
  };
979
1063
  }
980
1064
  ensureObserver() {
@@ -1023,7 +1107,7 @@ class Ut {
1023
1107
  const t = this.bindingsByStyle.get(e);
1024
1108
  if (!t || typeof document > "u")
1025
1109
  return;
1026
- const n = `.${Ne(e)}`;
1110
+ const n = `.${Oe(e)}`;
1027
1111
  document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, t));
1028
1112
  }
1029
1113
  applyStyleToElement(e, t, n) {
@@ -1063,7 +1147,7 @@ class Ut {
1063
1147
  }
1064
1148
  resolveScrollContainer(e, t) {
1065
1149
  if (t.targetId) {
1066
- const n = `[data-ikon-motion-source="${Ne(t.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
1150
+ const n = `[data-ikon-motion-source="${Oe(t.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
1067
1151
  if (o)
1068
1152
  return o;
1069
1153
  }
@@ -1073,10 +1157,10 @@ class Ut {
1073
1157
  const o = t.max - t.min, s = o === 0 ? n > t.min ? 1 : 0 : (n - t.min) / o;
1074
1158
  let i = this.applyClamp(s, t.clamp);
1075
1159
  t.reverse && (i = 1 - i);
1076
- const c = t.ease(i), l = Number.isFinite(c) ? c : 0, u = l * 100;
1077
- if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${u}`), t.map) {
1078
- const d = this.applyMap(u, t.map);
1079
- d !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${d}`);
1160
+ const c = t.ease(i), u = Number.isFinite(c) ? c : 0, d = u * 100;
1161
+ if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${u}`), e.style.setProperty("--tw-motion-bind-progress", `${d}`), t.map) {
1162
+ const l = this.applyMap(d, t.map);
1163
+ l !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${l}`);
1080
1164
  } else
1081
1165
  e.style.removeProperty("--tw-motion-bind-value");
1082
1166
  }
@@ -1091,7 +1175,7 @@ class Ut {
1091
1175
  case "unclamped":
1092
1176
  return e;
1093
1177
  default:
1094
- return N(e);
1178
+ return T(e);
1095
1179
  }
1096
1180
  }
1097
1181
  applyMap(e, t) {
@@ -1133,7 +1217,7 @@ class Ut {
1133
1217
  try {
1134
1218
  i();
1135
1219
  } catch (c) {
1136
- te.warn("Failed to cleanup listener", c);
1220
+ ne.warn("Failed to cleanup listener", c);
1137
1221
  }
1138
1222
  this.globalCleanups.delete(i);
1139
1223
  }
@@ -1177,16 +1261,16 @@ class Ut {
1177
1261
  }
1178
1262
  }
1179
1263
  }
1180
- const Ce = new Ut(), re = "ikon-ds";
1181
- function _r(r) {
1182
- const e = Se(({ styleId: n, css: o, common: s }) => {
1264
+ const Me = new Dt(), oe = "ikon-ds";
1265
+ function Fr(r) {
1266
+ const e = ae(({ styleId: n, css: o, common: s }) => {
1183
1267
  if (!n || typeof document > "u") return;
1184
- let i = document.getElementById(re);
1185
- i || (i = document.createElement("style"), i.id = re, document.head.appendChild(i)), o && (i.innerHTML += o), Ce.registerStyle(n, s);
1186
- }, []), t = Se(() => {
1187
- typeof document < "u" && document.getElementById(re)?.remove(), Ce.reset();
1268
+ let i = document.getElementById(oe);
1269
+ i || (i = document.createElement("style"), i.id = oe, document.head.appendChild(i)), o && (i.innerHTML += o), Me.registerStyle(n, s);
1270
+ }, []), t = ae(() => {
1271
+ typeof document < "u" && document.getElementById(oe)?.remove(), Me.reset();
1188
1272
  }, []);
1189
- return Y(() => {
1273
+ return q(() => {
1190
1274
  if (!r) return;
1191
1275
  for (const o of r.getUiStyles())
1192
1276
  e(o);
@@ -1194,50 +1278,72 @@ function _r(r) {
1194
1278
  return () => {
1195
1279
  n?.(), t();
1196
1280
  };
1197
- }, [r, t, e]), Y(() => () => t(), [t]), { setStyle: e, reset: t };
1281
+ }, [r, t, e]), q(() => () => t(), [t]), { setStyle: e, reset: t };
1282
+ }
1283
+ function qt(r) {
1284
+ const e = [];
1285
+ for (const [t, n] of r) {
1286
+ const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
1287
+ e.push(`${t}:${s ? "1" : "0"}`);
1288
+ }
1289
+ return e.sort(), e.join(",");
1290
+ }
1291
+ function Vr(r) {
1292
+ const [e, t] = tt(), n = I("");
1293
+ return q(() => {
1294
+ if (!r) {
1295
+ t(void 0), n.current = "";
1296
+ return;
1297
+ }
1298
+ const o = () => {
1299
+ const s = r.getStores(), i = qt(s);
1300
+ i !== n.current && (n.current = i, t(s));
1301
+ };
1302
+ return o(), r.subscribe(o);
1303
+ }, [r]), e;
1198
1304
  }
1199
- var zt = typeof global == "object" && global && global.Object === Object && global, Bt = typeof self == "object" && self && self.Object === Object && self, Ft = zt || Bt || Function("return this")(), X = Ft.Symbol, Be = Object.prototype, $t = Be.hasOwnProperty, Vt = Be.toString, B = X ? X.toStringTag : void 0;
1200
- function Dt(r) {
1201
- var e = $t.call(r, B), t = r[B];
1305
+ var Wt = typeof global == "object" && global && global.Object === Object && global, Yt = typeof self == "object" && self && self.Object === Object && self, Gt = Wt || Yt || Function("return this")(), H = Gt.Symbol, ze = Object.prototype, Kt = ze.hasOwnProperty, Xt = ze.toString, z = H ? H.toStringTag : void 0;
1306
+ function Ht(r) {
1307
+ var e = Kt.call(r, z), t = r[z];
1202
1308
  try {
1203
- r[B] = void 0;
1309
+ r[z] = void 0;
1204
1310
  var n = !0;
1205
1311
  } catch {
1206
1312
  }
1207
- var o = Vt.call(r);
1208
- return n && (e ? r[B] = t : delete r[B]), o;
1313
+ var o = Xt.call(r);
1314
+ return n && (e ? r[z] = t : delete r[z]), o;
1209
1315
  }
1210
- var Wt = Object.prototype, qt = Wt.toString;
1211
- function Yt(r) {
1212
- return qt.call(r);
1316
+ var Jt = Object.prototype, Zt = Jt.toString;
1317
+ function Qt(r) {
1318
+ return Zt.call(r);
1213
1319
  }
1214
- var Gt = "[object Null]", Xt = "[object Undefined]", je = X ? X.toStringTag : void 0;
1215
- function Ht(r) {
1216
- return r == null ? r === void 0 ? Xt : Gt : je && je in Object(r) ? Dt(r) : Yt(r);
1320
+ var er = "[object Null]", tr = "[object Undefined]", _e = H ? H.toStringTag : void 0;
1321
+ function rr(r) {
1322
+ return r == null ? r === void 0 ? tr : er : _e && _e in Object(r) ? Ht(r) : Qt(r);
1217
1323
  }
1218
- function Jt(r) {
1324
+ function nr(r) {
1219
1325
  return r != null && typeof r == "object";
1220
1326
  }
1221
- var Kt = Array.isArray, Zt = "[object String]";
1222
- function Qt(r) {
1223
- return typeof r == "string" || !Kt(r) && Jt(r) && Ht(r) == Zt;
1327
+ var or = Array.isArray, sr = "[object String]";
1328
+ function ir(r) {
1329
+ return typeof r == "string" || !or(r) && nr(r) && rr(r) == sr;
1224
1330
  }
1225
- const Ae = "ikonUiModules";
1226
- function ae(r) {
1331
+ const Pe = "ikonUiModules";
1332
+ function de(r) {
1227
1333
  return typeof r == "object" && r !== null && !Array.isArray(r);
1228
1334
  }
1229
- function er(r) {
1335
+ function ar(r) {
1230
1336
  if (!Array.isArray(r))
1231
1337
  return;
1232
1338
  const e = /* @__PURE__ */ new Set();
1233
1339
  for (const t of r) {
1234
- if (!Qt(t)) continue;
1340
+ if (!ir(t)) continue;
1235
1341
  const n = t.trim();
1236
1342
  n && (e.has(n) || e.add(n));
1237
1343
  }
1238
1344
  return Array.from(e);
1239
1345
  }
1240
- function Mr(r, e) {
1346
+ function Br(r, e) {
1241
1347
  if (r === e)
1242
1348
  return !0;
1243
1349
  if (!r || !e)
@@ -1249,21 +1355,21 @@ function Mr(r, e) {
1249
1355
  return !1;
1250
1356
  return !0;
1251
1357
  }
1252
- function tr(r) {
1253
- if (!(!ae(r) || !Object.prototype.hasOwnProperty.call(r, Ae)))
1254
- return er(r[Ae]);
1358
+ function cr(r) {
1359
+ if (!(!de(r) || !Object.prototype.hasOwnProperty.call(r, Pe)))
1360
+ return ar(r[Pe]);
1255
1361
  }
1256
- function Ir(...r) {
1362
+ function zr(...r) {
1257
1363
  for (const e of r) {
1258
- const t = tr(e);
1364
+ const t = cr(e);
1259
1365
  if (t !== void 0)
1260
1366
  return t;
1261
1367
  }
1262
1368
  }
1263
- function Pr(r) {
1264
- if (!ae(r))
1369
+ function Dr(r) {
1370
+ if (!de(r))
1265
1371
  return;
1266
- const e = r, t = Object.keys(e).find((l) => l.toLowerCase() === "modules");
1372
+ const e = r, t = Object.keys(e).find((u) => u.toLowerCase() === "modules");
1267
1373
  if (!t)
1268
1374
  return;
1269
1375
  const n = e[t];
@@ -1272,46 +1378,46 @@ function Pr(r) {
1272
1378
  if (!Array.isArray(n))
1273
1379
  return;
1274
1380
  const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
1275
- for (const l of n) {
1276
- if (typeof l == "string") {
1277
- const E = l.trim();
1278
- if (!E || i.has(E))
1381
+ for (const u of n) {
1382
+ if (typeof u == "string") {
1383
+ const S = u.trim();
1384
+ if (!S || i.has(S))
1279
1385
  continue;
1280
- o.push(E), i.add(E);
1386
+ o.push(S), i.add(S);
1281
1387
  continue;
1282
1388
  }
1283
- if (!ae(l))
1389
+ if (!de(u))
1284
1390
  continue;
1285
- const u = l, d = Object.keys(u).find((E) => E.toLowerCase() === "name");
1286
- if (!d)
1391
+ const d = u, l = Object.keys(d).find((S) => S.toLowerCase() === "name");
1392
+ if (!l)
1287
1393
  continue;
1288
- const m = u[d];
1289
- if (typeof m != "string")
1394
+ const p = d[l];
1395
+ if (typeof p != "string")
1290
1396
  continue;
1291
- const g = m.trim();
1292
- if (!g)
1397
+ const h = p.trim();
1398
+ if (!h)
1293
1399
  continue;
1294
- const k = Object.keys(u).find((E) => E.toLowerCase() === "javascript"), A = k ? u[k] : void 0;
1295
- typeof A == "string" && s.set(g, A), i.has(g) || (o.push(g), i.add(g));
1400
+ const w = Object.keys(d).find((S) => S.toLowerCase() === "javascript"), N = w ? d[w] : void 0;
1401
+ typeof N == "string" && s.set(h, N), i.has(h) || (o.push(h), i.add(h));
1296
1402
  }
1297
1403
  if (!o.length && s.size === 0)
1298
1404
  return { modules: [] };
1299
- const c = Array.from(s.entries()).map(([l, u]) => ({
1300
- name: l,
1301
- javascript: u
1405
+ const c = Array.from(s.entries()).map(([u, d]) => ({
1406
+ name: u,
1407
+ javascript: d
1302
1408
  }));
1303
1409
  return c.length > 0 ? { modules: o, inlineModules: c } : { modules: o };
1304
1410
  }
1305
- const p = {
1411
+ const g = {
1306
1412
  None: 0,
1307
1413
  Letter: 1,
1308
1414
  Word: 2,
1309
1415
  Line: 4,
1310
1416
  Paragraph: 8,
1311
1417
  Emoji: 16
1312
- }, rr = [
1418
+ }, ur = [
1313
1419
  {
1314
- flag: p.Letter,
1420
+ flag: g.Letter,
1315
1421
  hints: [
1316
1422
  "[data-motion-letter]",
1317
1423
  "[data-letter]",
@@ -1320,7 +1426,7 @@ const p = {
1320
1426
  ]
1321
1427
  },
1322
1428
  {
1323
- flag: p.Word,
1429
+ flag: g.Word,
1324
1430
  hints: [
1325
1431
  "[data-motion-word]",
1326
1432
  "[data-word]",
@@ -1329,7 +1435,7 @@ const p = {
1329
1435
  ]
1330
1436
  },
1331
1437
  {
1332
- flag: p.Line,
1438
+ flag: g.Line,
1333
1439
  hints: [
1334
1440
  "[data-motion-line]",
1335
1441
  "[data-line]",
@@ -1338,7 +1444,7 @@ const p = {
1338
1444
  ]
1339
1445
  },
1340
1446
  {
1341
- flag: p.Paragraph,
1447
+ flag: g.Paragraph,
1342
1448
  hints: [
1343
1449
  "[data-motion-paragraph]",
1344
1450
  "[data-paragraph]",
@@ -1349,7 +1455,7 @@ const p = {
1349
1455
  ]
1350
1456
  },
1351
1457
  {
1352
- flag: p.Emoji,
1458
+ flag: g.Emoji,
1353
1459
  hints: [
1354
1460
  ":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
1355
1461
  "[data-motion-emoji]",
@@ -1358,42 +1464,42 @@ const p = {
1358
1464
  "[data-emoji]"
1359
1465
  ]
1360
1466
  }
1361
- ], ce = p.Letter | p.Word | p.Line | p.Paragraph | p.Emoji, nr = p.Letter | p.Word | p.Line | p.Paragraph, Oe = /* @__PURE__ */ new Map(), or = 16384;
1362
- function Lr(r, e) {
1363
- if (!r || r.length > or)
1467
+ ], fe = g.Letter | g.Word | g.Line | g.Paragraph | g.Emoji, lr = g.Letter | g.Word | g.Line | g.Paragraph, Le = /* @__PURE__ */ new Map(), dr = 16384;
1468
+ function qr(r, e) {
1469
+ if (!r || r.length > dr)
1364
1470
  return r;
1365
- const t = Er(e), n = P(t, p.Emoji), o = t & nr;
1366
- if (o === p.None && !n)
1471
+ const t = jr(e), n = U(t, g.Emoji), o = t & lr;
1472
+ if (o === g.None && !n)
1367
1473
  return r;
1368
1474
  const s = r.replace(/\r\n/g, `
1369
1475
  `).replace(/\r/g, `
1370
1476
  `);
1371
- if (o === p.None)
1372
- return Pe(s);
1373
- const i = br(s);
1477
+ if (o === g.None)
1478
+ return Fe(s);
1479
+ const i = Tr(s);
1374
1480
  if (i.length === 0)
1375
- return n ? Pe(s) : r;
1376
- const c = vr(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, u = [];
1377
- for (const d of c) {
1378
- const m = sr(d, t, l);
1379
- u.push(...m);
1481
+ return n ? Fe(s) : r;
1482
+ const c = Cr(i), u = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
1483
+ for (const l of c) {
1484
+ const p = fr(l, t, u);
1485
+ d.push(...p);
1380
1486
  }
1381
- return u;
1487
+ return d;
1382
1488
  }
1383
- function sr(r, e, t) {
1489
+ function fr(r, e, t) {
1384
1490
  const n = [];
1385
1491
  for (const o of r) {
1386
- const s = ir(o, e, t);
1492
+ const s = mr(o, e, t);
1387
1493
  n.push(...s);
1388
1494
  }
1389
- if (P(e, p.Paragraph)) {
1495
+ if (U(e, g.Paragraph)) {
1390
1496
  const o = t.paragraph++;
1391
1497
  return [
1392
- /* @__PURE__ */ S.jsx(
1498
+ /* @__PURE__ */ b.jsx(
1393
1499
  "span",
1394
1500
  {
1395
1501
  "data-motion-paragraph": !0,
1396
- style: H(o),
1502
+ style: J(o),
1397
1503
  children: n
1398
1504
  },
1399
1505
  `motion-paragraph-${o}`
@@ -1402,116 +1508,116 @@ function sr(r, e, t) {
1402
1508
  }
1403
1509
  return n;
1404
1510
  }
1405
- function ir(r, e, t) {
1406
- const n = ar(r.text, e, t), o = [];
1407
- if (P(e, p.Line)) {
1511
+ function mr(r, e, t) {
1512
+ const n = pr(r.text, e, t), o = [];
1513
+ if (U(e, g.Line)) {
1408
1514
  const s = t.line++;
1409
1515
  o.push(
1410
- /* @__PURE__ */ S.jsx("span", { "data-motion-line": !0, style: H(s), children: n }, `motion-line-${s}`)
1516
+ /* @__PURE__ */ b.jsx("span", { "data-motion-line": !0, style: J(s), children: n }, `motion-line-${s}`)
1411
1517
  );
1412
1518
  } else
1413
1519
  o.push(...n);
1414
1520
  for (let s = 0; s < r.breaks; s++)
1415
- o.push(/* @__PURE__ */ S.jsx("br", {}, `motion-break-${t.br++}`));
1521
+ o.push(/* @__PURE__ */ b.jsx("br", {}, `motion-break-${t.br++}`));
1416
1522
  return o;
1417
1523
  }
1418
- function ar(r, e, t) {
1524
+ function pr(r, e, t) {
1419
1525
  if (!r)
1420
1526
  return [];
1421
- const n = P(e, p.Word), o = [], s = /(\s+)/g;
1527
+ const n = U(e, g.Word), o = [], s = /(\s+)/g;
1422
1528
  let i = 0, c;
1423
1529
  for (; (c = s.exec(r)) !== null; ) {
1424
1530
  if (c.index > i) {
1425
- const l = r.slice(i, c.index);
1426
- o.push(_e(l, t, e, n));
1531
+ const u = r.slice(i, c.index);
1532
+ o.push(xe(u, t, e, n));
1427
1533
  }
1428
1534
  o.push(c[0]), i = c.index + c[0].length;
1429
1535
  }
1430
1536
  if (i < r.length) {
1431
- const l = r.slice(i);
1432
- o.push(_e(l, t, e, n));
1537
+ const u = r.slice(i);
1538
+ o.push(xe(u, t, e, n));
1433
1539
  }
1434
1540
  return o;
1435
1541
  }
1436
- function _e(r, e, t, n) {
1437
- const o = e.word++, s = lr(r, t, e), i = `motion-word-${o}`, c = cr(o, n);
1438
- return n ? /* @__PURE__ */ S.jsx("span", { "data-motion-word": !0, style: c, children: s }, i) : /* @__PURE__ */ S.jsx("span", { style: c, children: s }, i);
1542
+ function xe(r, e, t, n) {
1543
+ const o = e.word++, s = gr(r, t, e), i = `motion-word-${o}`, c = hr(o, n);
1544
+ return n ? /* @__PURE__ */ b.jsx("span", { "data-motion-word": !0, style: c, children: s }, i) : /* @__PURE__ */ b.jsx("span", { style: c, children: s }, i);
1439
1545
  }
1440
- function cr(r, e) {
1441
- return e ? { ...H(r), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
1546
+ function hr(r, e) {
1547
+ return e ? { ...J(r), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
1442
1548
  }
1443
- function lr(r, e, t) {
1549
+ function gr(r, e, t) {
1444
1550
  if (!r)
1445
1551
  return [];
1446
- const n = P(e, p.Letter), o = P(e, p.Emoji);
1552
+ const n = U(e, g.Letter), o = U(e, g.Emoji);
1447
1553
  if (!n) {
1448
1554
  if (!o)
1449
1555
  return [r];
1450
- const c = le(r);
1556
+ const c = me(r);
1451
1557
  if (c.length === 0)
1452
1558
  return [r];
1453
- const { nodes: l } = $e(c, t);
1454
- return l;
1559
+ const { nodes: u } = qe(c, t);
1560
+ return u;
1455
1561
  }
1456
- const s = [], i = le(r);
1562
+ const s = [], i = me(r);
1457
1563
  for (const c of i) {
1458
- const l = t.letter++, u = `motion-letter-${l}`, d = H(l);
1564
+ const u = t.letter++, d = `motion-letter-${u}`, l = J(u);
1459
1565
  if (c === `
1460
1566
  `) {
1461
1567
  s.push(
1462
- /* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: d, children: /* @__PURE__ */ S.jsx("br", {}) }, u)
1568
+ /* @__PURE__ */ b.jsx("span", { "data-motion-letter": !0, style: l, children: /* @__PURE__ */ b.jsx("br", {}) }, d)
1463
1569
  );
1464
1570
  continue;
1465
1571
  }
1466
- const g = o && Fe(c) ? { "data-motion-emoji": !0 } : void 0, k = c === " " ? " " : c;
1572
+ const h = o && De(c) ? { "data-motion-emoji": !0 } : void 0, w = c === " " ? " " : c;
1467
1573
  s.push(
1468
- /* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: d, ...g, children: k }, u)
1574
+ /* @__PURE__ */ b.jsx("span", { "data-motion-letter": !0, style: l, ...h, children: w }, d)
1469
1575
  );
1470
1576
  }
1471
1577
  return s;
1472
1578
  }
1473
- function le(r) {
1579
+ function me(r) {
1474
1580
  if (!r)
1475
1581
  return [];
1476
- const e = ur();
1477
- return e ? Array.from(e.segment(r), (t) => t.segment) : dr(r);
1582
+ const e = yr();
1583
+ return e ? Array.from(e.segment(r), (t) => t.segment) : Sr(r);
1478
1584
  }
1479
- let F;
1480
- function ur() {
1481
- return F !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? F = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : F = null), F;
1585
+ let D;
1586
+ function yr() {
1587
+ return D !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? D = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : D = null), D;
1482
1588
  }
1483
- function dr(r) {
1589
+ function Sr(r) {
1484
1590
  const e = [], t = Array.from(r);
1485
1591
  let n = "";
1486
1592
  for (let o = 0; o < t.length; o++) {
1487
1593
  const s = t[o], i = t[o + 1];
1488
- n += s, !(i && fr(s, i)) && (e.push(n), n = "");
1594
+ n += s, !(i && br(s, i)) && (e.push(n), n = "");
1489
1595
  }
1490
1596
  return n && e.push(n), e;
1491
1597
  }
1492
- function fr(r, e) {
1493
- return e ? !!(Me(r) || Me(e) || hr(e) || mr(e) || pr(e) || Ie(r) && Ie(e)) : !1;
1598
+ function br(r, e) {
1599
+ return e ? !!(Ue(r) || Ue(e) || wr(e) || vr(e) || Er(e) || $e(r) && $e(e)) : !1;
1494
1600
  }
1495
- function Me(r) {
1601
+ function Ue(r) {
1496
1602
  return r.codePointAt(0) === 8205;
1497
1603
  }
1498
- function mr(r) {
1604
+ function vr(r) {
1499
1605
  const e = r.codePointAt(0);
1500
1606
  return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
1501
1607
  }
1502
- function pr(r) {
1608
+ function Er(r) {
1503
1609
  const e = r.codePointAt(0);
1504
1610
  return e === void 0 ? !1 : e >= 127995 && e <= 127999;
1505
1611
  }
1506
- function Ie(r) {
1612
+ function $e(r) {
1507
1613
  const e = r.codePointAt(0);
1508
1614
  return e === void 0 ? !1 : e >= 127462 && e <= 127487;
1509
1615
  }
1510
- let ne;
1511
- function hr(r) {
1512
- return r ? (ne || (ne = gr()), ne(r)) : !1;
1616
+ let se;
1617
+ function wr(r) {
1618
+ return r ? (se || (se = Rr()), se(r)) : !1;
1513
1619
  }
1514
- function gr() {
1620
+ function Rr() {
1515
1621
  try {
1516
1622
  const r = new RegExp("\\p{Mark}", "u");
1517
1623
  return (e) => r.test(e);
@@ -1522,19 +1628,19 @@ function gr() {
1522
1628
  };
1523
1629
  }
1524
1630
  }
1525
- let oe;
1526
- function Fe(r) {
1527
- return r ? (oe || (oe = yr()), oe(r)) : !1;
1631
+ let ie;
1632
+ function De(r) {
1633
+ return r ? (ie || (ie = kr()), ie(r)) : !1;
1528
1634
  }
1529
- function yr() {
1635
+ function kr() {
1530
1636
  try {
1531
1637
  const r = new RegExp("\\p{Extended_Pictographic}", "u");
1532
1638
  return (e) => r.test(e);
1533
1639
  } catch {
1534
- return Sr;
1640
+ return Nr;
1535
1641
  }
1536
1642
  }
1537
- function Sr(r) {
1643
+ function Nr(r) {
1538
1644
  if (!r)
1539
1645
  return !1;
1540
1646
  for (const e of Array.from(r)) {
@@ -1544,7 +1650,7 @@ function Sr(r) {
1544
1650
  }
1545
1651
  return !1;
1546
1652
  }
1547
- function br(r) {
1653
+ function Tr(r) {
1548
1654
  const e = [];
1549
1655
  let t = "", n = 0;
1550
1656
  for (let o = 0; o < r.length; o++) {
@@ -1558,7 +1664,7 @@ function br(r) {
1558
1664
  }
1559
1665
  return (n > 0 || t.length > 0) && e.push({ text: t, breaks: n }), e;
1560
1666
  }
1561
- function vr(r) {
1667
+ function Cr(r) {
1562
1668
  if (r.length === 0)
1563
1669
  return [];
1564
1670
  const e = [];
@@ -1567,10 +1673,10 @@ function vr(r) {
1567
1673
  t.push(n), n.breaks >= 2 && (e.push(t), t = []);
1568
1674
  return t.length > 0 && e.push(t), e;
1569
1675
  }
1570
- function P(r, e) {
1676
+ function U(r, e) {
1571
1677
  return (r & e) === e;
1572
1678
  }
1573
- function H(r) {
1679
+ function J(r) {
1574
1680
  return {
1575
1681
  "--tw-motion-seq-index": r.toString(),
1576
1682
  backgroundColor: "inherit",
@@ -1587,27 +1693,27 @@ function H(r) {
1587
1693
  WebkitTextFillColor: "inherit"
1588
1694
  };
1589
1695
  }
1590
- function Pe(r) {
1696
+ function Fe(r) {
1591
1697
  if (!r)
1592
1698
  return r;
1593
- const e = le(r);
1699
+ const e = me(r);
1594
1700
  if (e.length === 0)
1595
1701
  return r;
1596
- const { nodes: t, sawEmoji: n } = $e(e);
1702
+ const { nodes: t, sawEmoji: n } = qe(e);
1597
1703
  return n ? t.length === 1 ? t[0] ?? r : t : r;
1598
1704
  }
1599
- function $e(r, e) {
1705
+ function qe(r, e) {
1600
1706
  const t = [];
1601
1707
  let n = "", o = !1, s = e?.emoji ?? 0;
1602
1708
  const i = () => {
1603
1709
  n && (t.push(n), n = "");
1604
1710
  };
1605
1711
  for (const c of r) {
1606
- if (Fe(c)) {
1712
+ if (De(c)) {
1607
1713
  o = !0, i();
1608
- const u = `motion-emoji-${e ? e.emoji++ : s++}`;
1714
+ const d = `motion-emoji-${e ? e.emoji++ : s++}`;
1609
1715
  t.push(
1610
- /* @__PURE__ */ S.jsx("span", { "data-motion-emoji": !0, children: c }, u)
1716
+ /* @__PURE__ */ b.jsx("span", { "data-motion-emoji": !0, children: c }, d)
1611
1717
  );
1612
1718
  continue;
1613
1719
  }
@@ -1615,56 +1721,56 @@ function $e(r, e) {
1615
1721
  }
1616
1722
  return i(), o ? { nodes: t, sawEmoji: !0 } : { nodes: [r.join("")], sawEmoji: !1 };
1617
1723
  }
1618
- function Er(r) {
1724
+ function jr(r) {
1619
1725
  if (!r)
1620
- return p.None;
1726
+ return g.None;
1621
1727
  const e = r.trim();
1622
1728
  if (!e)
1623
- return p.None;
1624
- const t = Oe.get(e);
1729
+ return g.None;
1730
+ const t = Le.get(e);
1625
1731
  if (typeof t == "number")
1626
1732
  return t;
1627
1733
  if (typeof document > "u")
1628
- return p.None;
1734
+ return g.None;
1629
1735
  const n = e.split(/\s+/).filter(Boolean);
1630
1736
  if (n.length === 0)
1631
- return p.None;
1632
- const s = n.map((l) => `.${wr(l)}`).map(
1633
- (l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Rr(l)}(?![a-zA-Z0-9_-])`)
1737
+ return g.None;
1738
+ const s = n.map((u) => `.${Ar(u)}`).map(
1739
+ (u) => new RegExp(`(^|[^a-zA-Z0-9_-])${Or(u)}(?![a-zA-Z0-9_-])`)
1634
1740
  );
1635
- let i = p.None, c = !1;
1636
- for (const l of Array.from(document.styleSheets)) {
1637
- let u;
1741
+ let i = g.None, c = !1;
1742
+ for (const u of Array.from(document.styleSheets)) {
1743
+ let d;
1638
1744
  try {
1639
- u = l.cssRules;
1745
+ d = u.cssRules;
1640
1746
  } catch {
1641
1747
  continue;
1642
1748
  }
1643
- const d = Ve(u, s);
1644
- if (d.mask && (i |= d.mask, i === ce))
1749
+ const l = We(d, s);
1750
+ if (l.mask && (i |= l.mask, i === fe))
1645
1751
  break;
1646
- c ||= d.sawStyleRule;
1752
+ c ||= l.sawStyleRule;
1647
1753
  }
1648
- return (i !== p.None || c) && Oe.set(e, i), i;
1754
+ return (i !== g.None || c) && Le.set(e, i), i;
1649
1755
  }
1650
- function Ve(r, e) {
1756
+ function We(r, e) {
1651
1757
  if (!r)
1652
- return { mask: p.None, sawStyleRule: !1 };
1653
- let t = p.None, n = !1;
1758
+ return { mask: g.None, sawStyleRule: !1 };
1759
+ let t = g.None, n = !1;
1654
1760
  for (let o = 0; o < r.length; o++) {
1655
1761
  const s = r[o];
1656
1762
  if (s) {
1657
1763
  if (s.type === CSSRule.STYLE_RULE) {
1658
1764
  const c = s.selectorText ?? "";
1659
- if (!c || !e.some((u) => u.test(c))) continue;
1765
+ if (!c || !e.some((d) => d.test(c))) continue;
1660
1766
  n = !0;
1661
- for (const u of rr)
1662
- u.hints.some((d) => c.includes(d)) && (t |= u.flag);
1663
- if (t === ce)
1767
+ for (const d of ur)
1768
+ d.hints.some((l) => c.includes(l)) && (t |= d.flag);
1769
+ if (t === fe)
1664
1770
  return { mask: t, sawStyleRule: !0 };
1665
1771
  } else if ("cssRules" in s) {
1666
- const i = Ve(s.cssRules, e);
1667
- if (i.mask && (t |= i.mask, t === ce))
1772
+ const i = We(s.cssRules, e);
1773
+ if (i.mask && (t |= i.mask, t === fe))
1668
1774
  return { mask: t, sawStyleRule: !0 };
1669
1775
  n ||= i.sawStyleRule;
1670
1776
  }
@@ -1672,39 +1778,42 @@ function Ve(r, e) {
1672
1778
  }
1673
1779
  return { mask: t, sawStyleRule: n };
1674
1780
  }
1675
- function wr(r) {
1781
+ function Ar(r) {
1676
1782
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(r) : r.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1677
1783
  }
1678
- function Rr(r) {
1784
+ function Or(r) {
1679
1785
  return r.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
1680
1786
  }
1681
1787
  export {
1682
- bt as IKON_UI_BASE_MODULE,
1683
- Ct as IKON_UI_MEDIA_MODULE,
1684
- se as IKON_UI_STREAM_CATEGORY,
1685
- wt as IKON_UI_VIDEO_CANVAS_TYPE,
1686
- Rt as IKON_UI_VIDEO_URL_PLAYER_TYPE,
1687
- Ar as IkonUi,
1688
- Ot as IkonUiRegistry,
1689
- jr as IkonUiSurface,
1690
- ut as UiComponentRegistry,
1691
- lt as UiRenderer,
1692
- zr as UiStreamStore,
1693
- Mr as areIkonUiModuleListsEqual,
1694
- St as createBaseResolvers,
1695
- Cr as createComponentLibrary,
1696
- Or as createIkonUiRegistry,
1697
- Nt as createMediaResolvers,
1698
- dt as isIkonUiCategoryMatch,
1699
- vt as loadBaseModule,
1700
- jt as loadMediaModule,
1701
- er as normalizeIkonUiModuleList,
1702
- Pr as parseIkonUiInitPayload,
1703
- tr as readIkonUiModules,
1704
- Ir as readIkonUiModulesFromSources,
1705
- Et as registerBaseModule,
1706
- At as registerMediaModule,
1707
- Lr as renderMotionLetters,
1708
- _r as useIkonStyles,
1709
- nt as useUiStore
1788
+ Nt as IKON_UI_BASE_MODULE,
1789
+ _t as IKON_UI_MEDIA_MODULE,
1790
+ ue as IKON_UI_STREAM_CATEGORY,
1791
+ jt as IKON_UI_VIDEO_CANVAS_TYPE,
1792
+ At as IKON_UI_VIDEO_URL_PLAYER_TYPE,
1793
+ Ur as IkonUi,
1794
+ xt as IkonUiRegistry,
1795
+ xr as IkonUiSurface,
1796
+ ht as UiComponentRegistry,
1797
+ pt as UiRenderer,
1798
+ Gr as UiStreamStore,
1799
+ Br as areIkonUiModuleListsEqual,
1800
+ kt as createBaseResolvers,
1801
+ Pr as createComponentLibrary,
1802
+ $r as createIkonUiRegistry,
1803
+ It as createMediaResolvers,
1804
+ gt as isIkonUiCategoryMatch,
1805
+ Tt as loadBaseModule,
1806
+ Pt as loadMediaModule,
1807
+ ar as normalizeIkonUiModuleList,
1808
+ Dr as parseIkonUiInitPayload,
1809
+ cr as readIkonUiModules,
1810
+ zr as readIkonUiModulesFromSources,
1811
+ Ct as registerBaseModule,
1812
+ Lt as registerMediaModule,
1813
+ ft as renderChildren,
1814
+ qr as renderMotionLetters,
1815
+ Fr as useIkonStyles,
1816
+ Vr as useIkonUiStores,
1817
+ M as useUiNode,
1818
+ Lr as useUiStore
1710
1819
  };