@arcteninc/core 0.0.20 → 0.0.21

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/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as f, jsxs as A, Fragment as ee } from "react/jsx-runtime";
2
2
  import * as gt from "react";
3
- import { useImperativeHandle as Ea, createContext as qt, useRef as rt, useLayoutEffect as Ra, useEffect as $, useId as is, useContext as J, useInsertionEffect as yr, useMemo as et, useCallback as vr, Children as Na, isValidElement as Ia, useState as N, Fragment as xr, createElement as La, forwardRef as Oa, Component as ja, memo as Ee, Suspense as Fa, lazy as Ba } from "react";
4
- import { Check as br, X as tn, ChevronDown as $a, ChevronRight as za, Zap as Ua, BrainIcon as Wa, ChevronDownIcon as _a, Plus as Ka, Dock as Ha, PictureInPicture2 as Xa, Maximize2 as Ya, Minimize2 as Ga, Square as qa, ArrowRight as Za, BotMessageSquare as Ja } from "lucide-react";
3
+ import { useImperativeHandle as Ea, createContext as Zt, useRef as rt, useLayoutEffect as Ra, useEffect as $, useId as is, useContext as Q, useInsertionEffect as yr, useMemo as et, useCallback as vr, Children as Na, isValidElement as Ia, useState as N, Fragment as xr, createElement as La, forwardRef as Oa, Component as ja, memo as ke, Suspense as Fa, lazy as Ba } from "react";
4
+ import { Check as br, X as Qe, ChevronDown as $a, ChevronRight as za, Zap as Ua, BrainIcon as Wa, ChevronDownIcon as _a, Plus as Ka, Dock as Ha, PictureInPicture2 as Xa, Maximize2 as Ya, Minimize2 as Ga, Square as qa, ArrowRight as Za, BotMessageSquare as Ja } from "lucide-react";
5
5
  import { useChat as wr } from "@ai-sdk/react";
6
6
  import { lastAssistantMessageIsCompleteWithToolCalls as Tr, DefaultChatTransport as Sr } from "ai";
7
7
  import { Slot as Pr } from "@radix-ui/react-slot";
@@ -14,10 +14,10 @@ import * as el from "acorn";
14
14
  import { useControllableState as Qs } from "@radix-ui/react-use-controllable-state";
15
15
  import * as rs from "@radix-ui/react-collapsible";
16
16
  import { verifyToken as Pf } from "./server.mjs";
17
- function tt(...t) {
17
+ function J(...t) {
18
18
  return tl(Qa(t));
19
19
  }
20
- const te = Cr(
20
+ const Kt = Cr(
21
21
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
22
22
  {
23
23
  variants: {
@@ -43,16 +43,16 @@ const te = Cr(
43
43
  size: "default"
44
44
  }
45
45
  }
46
- ), Pe = gt.forwardRef(({ className: t, variant: e, size: n, asChild: s = !1, ...i }, o) => /* @__PURE__ */ f(
46
+ ), tn = gt.forwardRef(({ className: t, variant: e, size: n, asChild: s = !1, ...i }, o) => /* @__PURE__ */ f(
47
47
  s ? Pr : "button",
48
48
  {
49
49
  ref: o,
50
50
  "data-slot": "button",
51
- className: tt(te({ variant: e, size: n, className: t })),
51
+ className: J(Kt({ variant: e, size: n, className: t })),
52
52
  ...i
53
53
  }
54
54
  ));
55
- Pe.displayName = "Button";
55
+ tn.displayName = "Button";
56
56
  const nl = Cr(
57
57
  "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
58
58
  {
@@ -79,7 +79,7 @@ function vn({
79
79
  n ? Pr : "span",
80
80
  {
81
81
  "data-slot": "badge",
82
- className: tt(nl({ variant: e }), t),
82
+ className: J(nl({ variant: e }), t),
83
83
  ...s
84
84
  }
85
85
  );
@@ -127,7 +127,7 @@ const sl = ({
127
127
  ...o,
128
128
  value: i,
129
129
  ref: a,
130
- className: tt(
130
+ className: J(
131
131
  "flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
132
132
  n
133
133
  ),
@@ -173,7 +173,7 @@ function Wt({
173
173
  {
174
174
  "data-slot": "tooltip-content",
175
175
  sideOffset: e,
176
- className: tt(
176
+ className: J(
177
177
  "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
178
178
  t
179
179
  ),
@@ -190,7 +190,7 @@ function ti({ className: t, ...e }) {
190
190
  "kbd",
191
191
  {
192
192
  "data-slot": "kbd",
193
- className: tt(
193
+ className: J(
194
194
  "bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none",
195
195
  "[&_svg:not([class*='size-'])]:size-3",
196
196
  "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
@@ -200,12 +200,12 @@ function ti({ className: t, ...e }) {
200
200
  }
201
201
  );
202
202
  }
203
- const os = qt({});
203
+ const os = Zt({});
204
204
  function as(t) {
205
205
  const e = rt(null);
206
206
  return e.current === null && (e.current = t()), e.current;
207
207
  }
208
- const ls = typeof window < "u", Mr = ls ? Ra : $, an = /* @__PURE__ */ qt(null);
208
+ const ls = typeof window < "u", Mr = ls ? Ra : $, an = /* @__PURE__ */ Zt(null);
209
209
  function cs(t, e) {
210
210
  t.indexOf(e) === -1 && t.push(e);
211
211
  }
@@ -236,7 +236,7 @@ function ds(t) {
236
236
  let e;
237
237
  return () => (e === void 0 && (e = t()), e);
238
238
  }
239
- const ft = /* @__NO_SIDE_EFFECTS__ */ (t) => t, rl = (t, e) => (n) => e(t(n)), Re = (...t) => t.reduce(rl), Ce = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
239
+ const ft = /* @__NO_SIDE_EFFECTS__ */ (t) => t, rl = (t, e) => (n) => e(t(n)), Ee = (...t) => t.reduce(rl), Pe = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
240
240
  const s = e - t;
241
241
  return s === 0 ? 1 : (n - t) / s;
242
242
  };
@@ -281,13 +281,13 @@ function ll(t, e, n, s, i) {
281
281
  while (Math.abs(o) > ol && ++a < al);
282
282
  return r;
283
283
  }
284
- function Ne(t, e, n, s) {
284
+ function Re(t, e, n, s) {
285
285
  if (t === e && n === s)
286
286
  return ft;
287
287
  const i = (o) => ll(o, 0, 1, t, n);
288
288
  return (o) => o === 0 || o === 1 ? o : Rr(i(o), e, s);
289
289
  }
290
- const Nr = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Ir = (t) => (e) => 1 - t(1 - e), Lr = /* @__PURE__ */ Ne(0.33, 1.53, 0.69, 0.99), ms = /* @__PURE__ */ Ir(Lr), Or = /* @__PURE__ */ Nr(ms), jr = (t) => (t *= 2) < 1 ? 0.5 * ms(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), ps = (t) => 1 - Math.sin(Math.acos(t)), Fr = Ir(ps), Br = Nr(ps), cl = /* @__PURE__ */ Ne(0.42, 0, 1, 1), ul = /* @__PURE__ */ Ne(0, 0, 0.58, 1), $r = /* @__PURE__ */ Ne(0.42, 0, 0.58, 1), dl = (t) => Array.isArray(t) && typeof t[0] != "number", zr = (t) => Array.isArray(t) && typeof t[0] == "number", ni = {
290
+ const Nr = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Ir = (t) => (e) => 1 - t(1 - e), Lr = /* @__PURE__ */ Re(0.33, 1.53, 0.69, 0.99), ms = /* @__PURE__ */ Ir(Lr), Or = /* @__PURE__ */ Nr(ms), jr = (t) => (t *= 2) < 1 ? 0.5 * ms(t) : 0.5 * (2 - Math.pow(2, -10 * (t - 1))), ps = (t) => 1 - Math.sin(Math.acos(t)), Fr = Ir(ps), Br = Nr(ps), cl = /* @__PURE__ */ Re(0.42, 0, 1, 1), ul = /* @__PURE__ */ Re(0, 0, 0.58, 1), $r = /* @__PURE__ */ Re(0.42, 0, 0.58, 1), dl = (t) => Array.isArray(t) && typeof t[0] != "number", zr = (t) => Array.isArray(t) && typeof t[0] == "number", ni = {
291
291
  linear: ft,
292
292
  easeIn: cl,
293
293
  easeInOut: $r,
@@ -303,11 +303,11 @@ const Nr = (t) => (e) => e <= 0.5 ? t(2 * e) / 2 : (2 - t(2 * (1 - e))) / 2, Ir
303
303
  if (zr(t)) {
304
304
  Mt(t.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
305
305
  const [e, n, s, i] = t;
306
- return Ne(e, n, s, i);
306
+ return Re(e, n, s, i);
307
307
  } else if (hl(t))
308
308
  return Mt(ni[t] !== void 0, `Invalid easing type '${t}'`, "invalid-easing-type"), ni[t];
309
309
  return t;
310
- }, We = [
310
+ }, Ue = [
311
311
  "setup",
312
312
  // Compute
313
313
  "read",
@@ -370,38 +370,38 @@ function Ur(t, e) {
370
370
  delta: 0,
371
371
  timestamp: 0,
372
372
  isProcessing: !1
373
- }, o = () => n = !0, r = We.reduce((w, M) => (w[M] = fl(o), w), {}), { setup: a, read: l, resolveKeyframes: u, preUpdate: c, update: d, preRender: h, render: m, postRender: g } = r, y = () => {
373
+ }, o = () => n = !0, r = Ue.reduce((w, M) => (w[M] = fl(o), w), {}), { setup: a, read: l, resolveKeyframes: u, preUpdate: c, update: d, preRender: h, render: m, postRender: g } = r, y = () => {
374
374
  const w = Dt.useManualTiming ? i.timestamp : performance.now();
375
375
  n = !1, Dt.useManualTiming || (i.delta = s ? 1e3 / 60 : Math.max(Math.min(w - i.timestamp, ml), 1)), i.timestamp = w, i.isProcessing = !0, a.process(i), l.process(i), u.process(i), c.process(i), d.process(i), h.process(i), m.process(i), g.process(i), i.isProcessing = !1, n && e && (s = !1, t(y));
376
376
  }, x = () => {
377
377
  n = !0, s = !0, i.isProcessing || t(y);
378
378
  };
379
- return { schedule: We.reduce((w, M) => {
379
+ return { schedule: Ue.reduce((w, M) => {
380
380
  const P = r[M];
381
381
  return w[M] = (E, V = !1, C = !1) => (n || x(), P.schedule(E, V, C)), w;
382
382
  }, {}), cancel: (w) => {
383
- for (let M = 0; M < We.length; M++)
384
- r[We[M]].cancel(w);
383
+ for (let M = 0; M < Ue.length; M++)
384
+ r[Ue[M]].cancel(w);
385
385
  }, state: i, steps: r };
386
386
  }
387
387
  const { schedule: U, cancel: Nt, state: Z, steps: xn } = /* @__PURE__ */ Ur(typeof requestAnimationFrame < "u" ? requestAnimationFrame : ft, !0);
388
- let Ye;
388
+ let Xe;
389
389
  function pl() {
390
- Ye = void 0;
390
+ Xe = void 0;
391
391
  }
392
392
  const lt = {
393
- now: () => (Ye === void 0 && lt.set(Z.isProcessing || Dt.useManualTiming ? Z.timestamp : performance.now()), Ye),
393
+ now: () => (Xe === void 0 && lt.set(Z.isProcessing || Dt.useManualTiming ? Z.timestamp : performance.now()), Xe),
394
394
  set: (t) => {
395
- Ye = t, queueMicrotask(pl);
395
+ Xe = t, queueMicrotask(pl);
396
396
  }
397
397
  }, Wr = (t) => (e) => typeof e == "string" && e.startsWith(t), gs = /* @__PURE__ */ Wr("--"), gl = /* @__PURE__ */ Wr("var(--"), ys = (t) => gl(t) ? yl.test(t.split("/*")[0].trim()) : !1, yl = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, fe = {
398
398
  test: (t) => typeof t == "number",
399
399
  parse: parseFloat,
400
400
  transform: (t) => t
401
- }, Ae = {
401
+ }, Ce = {
402
402
  ...fe,
403
403
  transform: (t) => At(0, 1, t)
404
- }, _e = {
404
+ }, We = {
405
405
  ...fe,
406
406
  default: 1
407
407
  }, be = (t) => Math.round(t * 1e5) / 1e5, vs = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
@@ -421,10 +421,10 @@ const xl = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
421
421
  }, bl = (t) => At(0, 255, t), bn = {
422
422
  ...fe,
423
423
  transform: (t) => Math.round(bl(t))
424
- }, Ht = {
424
+ }, Xt = {
425
425
  test: /* @__PURE__ */ xs("rgb", "red"),
426
426
  parse: /* @__PURE__ */ _r("red", "green", "blue"),
427
- transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + bn.transform(t) + ", " + bn.transform(e) + ", " + bn.transform(n) + ", " + be(Ae.transform(s)) + ")"
427
+ transform: ({ red: t, green: e, blue: n, alpha: s = 1 }) => "rgba(" + bn.transform(t) + ", " + bn.transform(e) + ", " + bn.transform(n) + ", " + be(Ce.transform(s)) + ")"
428
428
  };
429
429
  function wl(t) {
430
430
  let e = "", n = "", s = "", i = "";
@@ -438,23 +438,23 @@ function wl(t) {
438
438
  const Ln = {
439
439
  test: /* @__PURE__ */ xs("#"),
440
440
  parse: wl,
441
- transform: Ht.transform
442
- }, Ie = /* @__NO_SIDE_EFFECTS__ */ (t) => ({
441
+ transform: Xt.transform
442
+ }, Ne = /* @__NO_SIDE_EFFECTS__ */ (t) => ({
443
443
  test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
444
444
  parse: parseFloat,
445
445
  transform: (e) => `${e}${t}`
446
- }), Rt = /* @__PURE__ */ Ie("deg"), Tt = /* @__PURE__ */ Ie("%"), D = /* @__PURE__ */ Ie("px"), Tl = /* @__PURE__ */ Ie("vh"), Sl = /* @__PURE__ */ Ie("vw"), ii = {
446
+ }), Rt = /* @__PURE__ */ Ne("deg"), Tt = /* @__PURE__ */ Ne("%"), D = /* @__PURE__ */ Ne("px"), Tl = /* @__PURE__ */ Ne("vh"), Sl = /* @__PURE__ */ Ne("vw"), ii = {
447
447
  ...Tt,
448
448
  parse: (t) => Tt.parse(t) / 100,
449
449
  transform: (t) => Tt.transform(t * 100)
450
450
  }, ne = {
451
451
  test: /* @__PURE__ */ xs("hsl", "hue"),
452
452
  parse: /* @__PURE__ */ _r("hue", "saturation", "lightness"),
453
- transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + Tt.transform(be(e)) + ", " + Tt.transform(be(n)) + ", " + be(Ae.transform(s)) + ")"
453
+ transform: ({ hue: t, saturation: e, lightness: n, alpha: s = 1 }) => "hsla(" + Math.round(t) + ", " + Tt.transform(be(e)) + ", " + Tt.transform(be(n)) + ", " + be(Ce.transform(s)) + ")"
454
454
  }, q = {
455
- test: (t) => Ht.test(t) || Ln.test(t) || ne.test(t),
456
- parse: (t) => Ht.test(t) ? Ht.parse(t) : ne.test(t) ? ne.parse(t) : Ln.parse(t),
457
- transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? Ht.transform(t) : ne.transform(t),
455
+ test: (t) => Xt.test(t) || Ln.test(t) || ne.test(t),
456
+ parse: (t) => Xt.test(t) ? Xt.parse(t) : ne.test(t) ? ne.parse(t) : Ln.parse(t),
457
+ transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? Xt.transform(t) : ne.transform(t),
458
458
  getAnimatableNone: (t) => {
459
459
  const e = q.parse(t);
460
460
  return e.alpha = 0, q.transform(e);
@@ -464,7 +464,7 @@ function Cl(t) {
464
464
  return isNaN(t) && typeof t == "string" && (t.match(vs)?.length || 0) + (t.match(Pl)?.length || 0) > 0;
465
465
  }
466
466
  const Kr = "number", Hr = "color", Al = "var", Ml = "var(", ri = "${}", Dl = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
467
- function Me(t) {
467
+ function Ae(t) {
468
468
  const e = t.toString(), n = [], s = {
469
469
  color: [],
470
470
  number: [],
@@ -475,10 +475,10 @@ function Me(t) {
475
475
  return { values: n, split: a, indexes: s, types: i };
476
476
  }
477
477
  function Xr(t) {
478
- return Me(t).values;
478
+ return Ae(t).values;
479
479
  }
480
480
  function Yr(t) {
481
- const { split: e, types: n } = Me(t), s = e.length;
481
+ const { split: e, types: n } = Ae(t), s = e.length;
482
482
  return (i) => {
483
483
  let o = "";
484
484
  for (let r = 0; r < s; r++)
@@ -525,7 +525,7 @@ function en(t, e) {
525
525
  const H = (t, e, n) => t + (e - t) * n, Tn = (t, e, n) => {
526
526
  const s = t * t, i = n * (e * e - s) + s;
527
527
  return i < 0 ? 0 : Math.sqrt(i);
528
- }, Rl = [Ln, Ht, ne], Nl = (t) => Rl.find((e) => e.test(t));
528
+ }, Rl = [Ln, Xt, ne], Nl = (t) => Rl.find((e) => e.test(t));
529
529
  function oi(t) {
530
530
  const e = Nl(t);
531
531
  if (he(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !e)
@@ -538,7 +538,7 @@ const ai = (t, e) => {
538
538
  if (!n || !s)
539
539
  return en(t, e);
540
540
  const i = { ...n };
541
- return (o) => (i.red = Tn(n.red, s.red, o), i.green = Tn(n.green, s.green, o), i.blue = Tn(n.blue, s.blue, o), i.alpha = H(n.alpha, s.alpha, o), Ht.transform(i));
541
+ return (o) => (i.red = Tn(n.red, s.red, o), i.green = Tn(n.green, s.green, o), i.blue = Tn(n.blue, s.blue, o), i.alpha = H(n.alpha, s.alpha, o), Xt.transform(i));
542
542
  }, On = /* @__PURE__ */ new Set(["none", "hidden"]);
543
543
  function Il(t, e) {
544
544
  return On.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
@@ -576,8 +576,8 @@ function jl(t, e) {
576
576
  return n;
577
577
  }
578
578
  const Fl = (t, e) => {
579
- const n = It.createTransformer(e), s = Me(t), i = Me(e);
580
- return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? On.has(t) && !i.values.length || On.has(e) && !s.values.length ? Il(t, e) : Re(Gr(jl(s, i), i.values), n) : (he(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), en(t, e));
579
+ const n = It.createTransformer(e), s = Ae(t), i = Ae(e);
580
+ return s.indexes.var.length === i.indexes.var.length && s.indexes.color.length === i.indexes.color.length && s.indexes.number.length >= i.indexes.number.length ? On.has(t) && !i.values.length || On.has(e) && !s.values.length ? Il(t, e) : Ee(Gr(jl(s, i), i.values), n) : (he(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), en(t, e));
581
581
  };
582
582
  function qr(t, e, n) {
583
583
  return typeof t == "number" && typeof e == "number" && typeof n == "number" ? H(t, e, n) : bs(t)(t, e);
@@ -818,7 +818,7 @@ function Yl(t, e, n) {
818
818
  let a = i(t[r], t[r + 1]);
819
819
  if (e) {
820
820
  const l = Array.isArray(e) ? e[r] || ft : e;
821
- a = Re(l, a);
821
+ a = Ee(l, a);
822
822
  }
823
823
  s.push(a);
824
824
  }
@@ -839,7 +839,7 @@ function Gl(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
839
839
  if (l > 1)
840
840
  for (; d < t.length - 2 && !(c < t[d + 1]); d++)
841
841
  ;
842
- const h = /* @__PURE__ */ Ce(t[d], t[d + 1], c);
842
+ const h = /* @__PURE__ */ Pe(t[d], t[d + 1], c);
843
843
  return a[d](h);
844
844
  };
845
845
  return n ? (c) => u(At(t[0], t[o - 1], c)) : u;
@@ -847,7 +847,7 @@ function Gl(t, e, { clamp: n = !0, ease: s, mixer: i } = {}) {
847
847
  function ql(t, e) {
848
848
  const n = t[t.length - 1];
849
849
  for (let s = 1; s <= e; s++) {
850
- const i = /* @__PURE__ */ Ce(0, e, s);
850
+ const i = /* @__PURE__ */ Pe(0, e, s);
851
851
  t.push(H(n, 1, i));
852
852
  }
853
853
  }
@@ -931,7 +931,7 @@ class Ps extends Ss {
931
931
  const { type: n = se, repeat: s = 0, repeatDelay: i = 0, repeatType: o, velocity: r = 0 } = e;
932
932
  let { keyframes: a } = e;
933
933
  const l = n || se;
934
- process.env.NODE_ENV !== "production" && l !== se && Mt(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), l !== se && typeof a[0] != "number" && (this.mixKeyframes = Re(nc, qr(a[0], a[1])), a = [0, 100]);
934
+ process.env.NODE_ENV !== "production" && l !== se && Mt(a.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`, "spring-two-frames"), l !== se && typeof a[0] != "number" && (this.mixKeyframes = Ee(nc, qr(a[0], a[1])), a = [0, 100]);
935
935
  const u = l({ ...e, keyframes: a });
936
936
  o === "mirror" && (this.mirroredGenerator = l({
937
937
  ...e,
@@ -1032,8 +1032,8 @@ function sc(t) {
1032
1032
  for (let e = 1; e < t.length; e++)
1033
1033
  t[e] ?? (t[e] = t[e - 1]);
1034
1034
  }
1035
- const Xt = (t) => t * 180 / Math.PI, Bn = (t) => {
1036
- const e = Xt(Math.atan2(t[1], t[0]));
1035
+ const Yt = (t) => t * 180 / Math.PI, Bn = (t) => {
1036
+ const e = Yt(Math.atan2(t[1], t[0]));
1037
1037
  return $n(e);
1038
1038
  }, ic = {
1039
1039
  x: 4,
@@ -1045,8 +1045,8 @@ const Xt = (t) => t * 180 / Math.PI, Bn = (t) => {
1045
1045
  scale: (t) => (Math.abs(t[0]) + Math.abs(t[3])) / 2,
1046
1046
  rotate: Bn,
1047
1047
  rotateZ: Bn,
1048
- skewX: (t) => Xt(Math.atan(t[1])),
1049
- skewY: (t) => Xt(Math.atan(t[2])),
1048
+ skewX: (t) => Yt(Math.atan(t[1])),
1049
+ skewY: (t) => Yt(Math.atan(t[2])),
1050
1050
  skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
1051
1051
  }, $n = (t) => (t = t % 360, t < 0 && (t += 360), t), ci = Bn, ui = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), di = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), rc = {
1052
1052
  x: 12,
@@ -1058,12 +1058,12 @@ const Xt = (t) => t * 180 / Math.PI, Bn = (t) => {
1058
1058
  scaleX: ui,
1059
1059
  scaleY: di,
1060
1060
  scale: (t) => (ui(t) + di(t)) / 2,
1061
- rotateX: (t) => $n(Xt(Math.atan2(t[6], t[5]))),
1062
- rotateY: (t) => $n(Xt(Math.atan2(-t[2], t[0]))),
1061
+ rotateX: (t) => $n(Yt(Math.atan2(t[6], t[5]))),
1062
+ rotateY: (t) => $n(Yt(Math.atan2(-t[2], t[0]))),
1063
1063
  rotateZ: ci,
1064
1064
  rotate: ci,
1065
- skewX: (t) => Xt(Math.atan(t[4])),
1066
- skewY: (t) => Xt(Math.atan(t[1])),
1065
+ skewX: (t) => Yt(Math.atan(t[4])),
1066
+ skewY: (t) => Yt(Math.atan(t[1])),
1067
1067
  skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
1068
1068
  };
1069
1069
  function zn(t) {
@@ -1118,7 +1118,7 @@ function uc(t) {
1118
1118
  s !== void 0 && (e.push([n, s.get()]), s.set(n.startsWith("scale") ? 1 : 0));
1119
1119
  }), e;
1120
1120
  }
1121
- const Yt = {
1121
+ const Gt = {
1122
1122
  // Dimensions
1123
1123
  width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
1124
1124
  height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
@@ -1130,13 +1130,13 @@ const Yt = {
1130
1130
  x: (t, { transform: e }) => Un(e, "x"),
1131
1131
  y: (t, { transform: e }) => Un(e, "y")
1132
1132
  };
1133
- Yt.translateX = Yt.x;
1134
- Yt.translateY = Yt.y;
1135
- const Gt = /* @__PURE__ */ new Set();
1133
+ Gt.translateX = Gt.x;
1134
+ Gt.translateY = Gt.y;
1135
+ const qt = /* @__PURE__ */ new Set();
1136
1136
  let Wn = !1, _n = !1, Kn = !1;
1137
1137
  function to() {
1138
1138
  if (_n) {
1139
- const t = Array.from(Gt).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
1139
+ const t = Array.from(qt).filter((s) => s.needsMeasurement), e = new Set(t.map((s) => s.element)), n = /* @__PURE__ */ new Map();
1140
1140
  e.forEach((s) => {
1141
1141
  const i = uc(s);
1142
1142
  i.length && (n.set(s, i), s.render());
@@ -1150,10 +1150,10 @@ function to() {
1150
1150
  s.suspendedScrollY !== void 0 && window.scrollTo(0, s.suspendedScrollY);
1151
1151
  });
1152
1152
  }
1153
- _n = !1, Wn = !1, Gt.forEach((t) => t.complete(Kn)), Gt.clear();
1153
+ _n = !1, Wn = !1, qt.forEach((t) => t.complete(Kn)), qt.clear();
1154
1154
  }
1155
1155
  function eo() {
1156
- Gt.forEach((t) => {
1156
+ qt.forEach((t) => {
1157
1157
  t.readKeyframes(), t.needsMeasurement && (_n = !0);
1158
1158
  });
1159
1159
  }
@@ -1165,7 +1165,7 @@ class Cs {
1165
1165
  this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = s, this.motionValue = i, this.element = o, this.isAsync = r;
1166
1166
  }
1167
1167
  scheduleResolve() {
1168
- this.state = "scheduled", this.isAsync ? (Gt.add(this), Wn || (Wn = !0, U.read(eo), U.resolveKeyframes(to))) : (this.readKeyframes(), this.complete());
1168
+ this.state = "scheduled", this.isAsync ? (qt.add(this), Wn || (Wn = !0, U.read(eo), U.resolveKeyframes(to))) : (this.readKeyframes(), this.complete());
1169
1169
  }
1170
1170
  readKeyframes() {
1171
1171
  const { unresolvedKeyframes: e, name: n, element: s, motionValue: i } = this;
@@ -1190,10 +1190,10 @@ class Cs {
1190
1190
  measureEndState() {
1191
1191
  }
1192
1192
  complete(e = !1) {
1193
- this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), Gt.delete(this);
1193
+ this.state = "complete", this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, e), qt.delete(this);
1194
1194
  }
1195
1195
  cancel() {
1196
- this.state === "scheduled" && (Gt.delete(this), this.state = "pending");
1196
+ this.state === "scheduled" && (qt.delete(this), this.state = "pending");
1197
1197
  }
1198
1198
  resume() {
1199
1199
  this.state === "pending" && this.scheduleResolve();
@@ -1579,10 +1579,10 @@ const jc = /\b([a-z-]*)\(.*?\)/gu, Xn = {
1579
1579
  rotateX: Rt,
1580
1580
  rotateY: Rt,
1581
1581
  rotateZ: Rt,
1582
- scale: _e,
1583
- scaleX: _e,
1584
- scaleY: _e,
1585
- scaleZ: _e,
1582
+ scale: We,
1583
+ scaleX: We,
1584
+ scaleY: We,
1585
+ scaleZ: We,
1586
1586
  skew: Rt,
1587
1587
  skewX: Rt,
1588
1588
  skewY: Rt,
@@ -1595,7 +1595,7 @@ const jc = /\b([a-z-]*)\(.*?\)/gu, Xn = {
1595
1595
  z: D,
1596
1596
  perspective: D,
1597
1597
  transformPerspective: D,
1598
- opacity: Ae,
1598
+ opacity: Ce,
1599
1599
  originX: ii,
1600
1600
  originY: ii,
1601
1601
  originZ: D
@@ -1638,8 +1638,8 @@ const jc = /\b([a-z-]*)\(.*?\)/gu, Xn = {
1638
1638
  ...Fc,
1639
1639
  zIndex: yi,
1640
1640
  // SVG
1641
- fillOpacity: Ae,
1642
- strokeOpacity: Ae,
1641
+ fillOpacity: Ce,
1642
+ strokeOpacity: Ce,
1643
1643
  numOctaves: yi
1644
1644
  }, Bc = {
1645
1645
  ...Ms,
@@ -1667,7 +1667,7 @@ function zc(t, e, n) {
1667
1667
  let s = 0, i;
1668
1668
  for (; s < t.length && !i; ) {
1669
1669
  const o = t[s];
1670
- typeof o == "string" && !$c.has(o) && Me(o).values.length && (i = t[s]), s++;
1670
+ typeof o == "string" && !$c.has(o) && Ae(o).values.length && (i = t[s]), s++;
1671
1671
  }
1672
1672
  if (i && n)
1673
1673
  for (const o of e)
@@ -1698,7 +1698,7 @@ class Uc extends Cs {
1698
1698
  const u = e[l];
1699
1699
  typeof u == "string" && (e[l] = parseFloat(u));
1700
1700
  }
1701
- else Yt[s] && (this.needsMeasurement = !0);
1701
+ else Gt[s] && (this.needsMeasurement = !0);
1702
1702
  }
1703
1703
  resolveNoneKeyframes() {
1704
1704
  const { unresolvedKeyframes: e, name: n } = this, s = [];
@@ -1710,7 +1710,7 @@ class Uc extends Cs {
1710
1710
  const { element: e, unresolvedKeyframes: n, name: s } = this;
1711
1711
  if (!e || !e.current)
1712
1712
  return;
1713
- s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Yt[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
1713
+ s === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Gt[s](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
1714
1714
  const i = n[n.length - 1];
1715
1715
  i !== void 0 && e.getValue(s, i).jump(i, !1);
1716
1716
  }
@@ -1721,7 +1721,7 @@ class Uc extends Cs {
1721
1721
  const i = e.getValue(n);
1722
1722
  i && i.jump(this.measuredOrigin, !1);
1723
1723
  const o = s.length - 1, r = s[o];
1724
- s[o] = Yt[n](e.measureViewportBox(), window.getComputedStyle(e.current)), r !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = r), this.removedTransforms?.length && this.removedTransforms.forEach(([a, l]) => {
1724
+ s[o] = Gt[n](e.measureViewportBox(), window.getComputedStyle(e.current)), r !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = r), this.removedTransforms?.length && this.removedTransforms.forEach(([a, l]) => {
1725
1725
  e.getValue(a).set(l);
1726
1726
  }), this.resolveNoneKeyframes();
1727
1727
  }
@@ -1994,7 +1994,7 @@ const yo = (t, e) => e ? t === e ? !0 : yo(t, e.parentElement) : !1, Vs = (t) =>
1994
1994
  function Gc(t) {
1995
1995
  return Yc.has(t.tagName) || t.tabIndex !== -1;
1996
1996
  }
1997
- const Ge = /* @__PURE__ */ new WeakSet();
1997
+ const Ye = /* @__PURE__ */ new WeakSet();
1998
1998
  function bi(t) {
1999
1999
  return (e) => {
2000
2000
  e.key === "Enter" && t(e);
@@ -2008,7 +2008,7 @@ const qc = (t, e) => {
2008
2008
  if (!n)
2009
2009
  return;
2010
2010
  const s = bi(() => {
2011
- if (Ge.has(n))
2011
+ if (Ye.has(n))
2012
2012
  return;
2013
2013
  Pn(n, "down");
2014
2014
  const i = bi(() => {
@@ -2026,9 +2026,9 @@ function Zc(t, e, n = {}) {
2026
2026
  const l = a.currentTarget;
2027
2027
  if (!wi(a))
2028
2028
  return;
2029
- Ge.add(l);
2029
+ Ye.add(l);
2030
2030
  const u = e(l, a), c = (m, g) => {
2031
- window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", h), Ge.has(l) && Ge.delete(l), wi(m) && typeof u == "function" && u(m, { success: g });
2031
+ window.removeEventListener("pointerup", d), window.removeEventListener("pointercancel", h), Ye.has(l) && Ye.delete(l), wi(m) && typeof u == "function" && u(m, { success: g });
2032
2032
  }, d = (m) => {
2033
2033
  c(m, l === window || l === document || n.useGlobalTarget || yo(l, m.target));
2034
2034
  }, h = (m) => {
@@ -2046,7 +2046,7 @@ function vo(t) {
2046
2046
  function Jc(t) {
2047
2047
  return vo(t) && t.tagName === "svg";
2048
2048
  }
2049
- const nt = (t) => !!(t && t.getVelocity), Qc = [...co, q, It], tu = (t) => Qc.find(lo(t)), ks = qt({
2049
+ const nt = (t) => !!(t && t.getVelocity), Qc = [...co, q, It], tu = (t) => Qc.find(lo(t)), ks = Zt({
2050
2050
  transformPagePoint: (t) => t,
2051
2051
  isStatic: !1,
2052
2052
  reducedMotion: "never"
@@ -2100,7 +2100,7 @@ function iu({ children: t, isPresent: e, anchorX: n, root: s }) {
2100
2100
  top: 0,
2101
2101
  left: 0,
2102
2102
  right: 0
2103
- }), { nonce: a } = J(ks), l = nu(o, t?.ref);
2103
+ }), { nonce: a } = Q(ks), l = nu(o, t?.ref);
2104
2104
  return yr(() => {
2105
2105
  const { width: u, height: c, top: d, left: h, right: m } = r.current;
2106
2106
  if (e || !o.current || !u || !c)
@@ -2149,7 +2149,7 @@ function ou() {
2149
2149
  return /* @__PURE__ */ new Map();
2150
2150
  }
2151
2151
  function xo(t = !0) {
2152
- const e = J(an);
2152
+ const e = Q(an);
2153
2153
  if (e === null)
2154
2154
  return [!0, null];
2155
2155
  const { isPresent: n, onExitComplete: s, register: i } = e, o = is();
@@ -2160,7 +2160,7 @@ function xo(t = !0) {
2160
2160
  const r = vr(() => t && s && s(o), [o, s, t]);
2161
2161
  return !n && s ? [!1, r] : [!0];
2162
2162
  }
2163
- const Ke = (t) => t.key || "";
2163
+ const _e = (t) => t.key || "";
2164
2164
  function Si(t) {
2165
2165
  const e = [];
2166
2166
  return Na.forEach(t, (n) => {
@@ -2168,11 +2168,11 @@ function Si(t) {
2168
2168
  }), e;
2169
2169
  }
2170
2170
  const au = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presenceAffectsLayout: i = !0, mode: o = "sync", propagate: r = !1, anchorX: a = "left", root: l }) => {
2171
- const [u, c] = xo(r), d = et(() => Si(t), [t]), h = r && !u ? [] : d.map(Ke), m = rt(!0), g = rt(d), y = as(() => /* @__PURE__ */ new Map()), [x, v] = N(d), [b, w] = N(d);
2171
+ const [u, c] = xo(r), d = et(() => Si(t), [t]), h = r && !u ? [] : d.map(_e), m = rt(!0), g = rt(d), y = as(() => /* @__PURE__ */ new Map()), [x, v] = N(d), [b, w] = N(d);
2172
2172
  Mr(() => {
2173
2173
  m.current = !1, g.current = d;
2174
2174
  for (let E = 0; E < b.length; E++) {
2175
- const V = Ke(b[E]);
2175
+ const V = _e(b[E]);
2176
2176
  h.includes(V) ? y.delete(V) : y.get(V) !== !0 && y.set(V, !1);
2177
2177
  }
2178
2178
  }, [b, h.length, h.join("-")]);
@@ -2180,15 +2180,15 @@ const au = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presen
2180
2180
  if (d !== x) {
2181
2181
  let E = [...d];
2182
2182
  for (let V = 0; V < b.length; V++) {
2183
- const C = b[V], z = Ke(C);
2183
+ const C = b[V], z = _e(C);
2184
2184
  h.includes(z) || (E.splice(V, 0, C), M.push(C));
2185
2185
  }
2186
2186
  return o === "wait" && M.length && (E = M), w(Si(E)), v(d), null;
2187
2187
  }
2188
2188
  process.env.NODE_ENV !== "production" && o === "wait" && b.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
2189
- const { forceRender: P } = J(os);
2189
+ const { forceRender: P } = Q(os);
2190
2190
  return f(ee, { children: b.map((E) => {
2191
- const V = Ke(E), C = r && !u ? !1 : d === b || h.includes(V), z = () => {
2191
+ const V = _e(E), C = r && !u ? !1 : d === b || h.includes(V), z = () => {
2192
2192
  if (y.has(V))
2193
2193
  y.set(V, !0);
2194
2194
  else
@@ -2200,7 +2200,7 @@ const au = ({ children: t, custom: e, initial: n = !0, onExitComplete: s, presen
2200
2200
  };
2201
2201
  return f(ru, { isPresent: C, initial: !m.current || n ? void 0 : !1, custom: e, presenceAffectsLayout: i, mode: o, root: l, onExitComplete: C ? void 0 : z, anchorX: a, children: E }, V);
2202
2202
  }) });
2203
- }, Es = qt({ strict: !1 }), Pi = {
2203
+ }, Es = Zt({ strict: !1 }), Pi = {
2204
2204
  animation: [
2205
2205
  "animate",
2206
2206
  "variants",
@@ -2296,11 +2296,11 @@ function du(t, e, n) {
2296
2296
  t.draggable && i.startsWith("onDrag")) && (s[i] = t[i]);
2297
2297
  return s;
2298
2298
  }
2299
- const ln = /* @__PURE__ */ qt({});
2299
+ const ln = /* @__PURE__ */ Zt({});
2300
2300
  function cn(t) {
2301
2301
  return t !== null && typeof t == "object" && typeof t.start == "function";
2302
2302
  }
2303
- function De(t) {
2303
+ function Me(t) {
2304
2304
  return typeof t == "string" || Array.isArray(t);
2305
2305
  }
2306
2306
  const Rs = [
@@ -2313,7 +2313,7 @@ const Rs = [
2313
2313
  "exit"
2314
2314
  ], Ns = ["initial", ...Rs];
2315
2315
  function un(t) {
2316
- return cn(t.animate) || Ns.some((e) => De(t[e]));
2316
+ return cn(t.animate) || Ns.some((e) => Me(t[e]));
2317
2317
  }
2318
2318
  function wo(t) {
2319
2319
  return !!(un(t) || t.variants);
@@ -2322,26 +2322,26 @@ function hu(t, e) {
2322
2322
  if (un(t)) {
2323
2323
  const { initial: n, animate: s } = t;
2324
2324
  return {
2325
- initial: n === !1 || De(n) ? n : void 0,
2326
- animate: De(s) ? s : void 0
2325
+ initial: n === !1 || Me(n) ? n : void 0,
2326
+ animate: Me(s) ? s : void 0
2327
2327
  };
2328
2328
  }
2329
2329
  return t.inherit !== !1 ? e : {};
2330
2330
  }
2331
2331
  function fu(t) {
2332
- const { initial: e, animate: n } = hu(t, J(ln));
2332
+ const { initial: e, animate: n } = hu(t, Q(ln));
2333
2333
  return et(() => ({ initial: e, animate: n }), [Ci(e), Ci(n)]);
2334
2334
  }
2335
2335
  function Ci(t) {
2336
2336
  return Array.isArray(t) ? t.join(" ") : t;
2337
2337
  }
2338
- const Ve = {};
2338
+ const De = {};
2339
2339
  function mu(t) {
2340
2340
  for (const e in t)
2341
- Ve[e] = t[e], gs(e) && (Ve[e].isCSSVariable = !0);
2341
+ De[e] = t[e], gs(e) && (De[e].isCSSVariable = !0);
2342
2342
  }
2343
2343
  function To(t, { layout: e, layoutId: n }) {
2344
- return pe.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!Ve[t] || t === "opacity");
2344
+ return pe.has(t) || t.startsWith("origin") || (e || n !== void 0) && (!!De[t] || t === "opacity");
2345
2345
  }
2346
2346
  const pu = {
2347
2347
  x: "translateX",
@@ -2534,7 +2534,7 @@ function js(t, e, n, s) {
2534
2534
  }
2535
2535
  return e;
2536
2536
  }
2537
- function qe(t) {
2537
+ function Ge(t) {
2538
2538
  return nt(t) ? t.get() : t;
2539
2539
  }
2540
2540
  function Mu({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, i) {
@@ -2546,7 +2546,7 @@ function Mu({ scrapeMotionValuesFromProps: t, createRenderState: e }, n, s, i) {
2546
2546
  function Du(t, e, n, s) {
2547
2547
  const i = {}, o = s(t, {});
2548
2548
  for (const h in o)
2549
- i[h] = qe(o[h]);
2549
+ i[h] = Ge(o[h]);
2550
2550
  let { initial: r, animate: a } = t;
2551
2551
  const l = un(t), u = wo(t);
2552
2552
  e && u && !l && t.inherit !== !1 && (r === void 0 && (r = e.initial), a === void 0 && (a = e.animate));
@@ -2575,7 +2575,7 @@ function Du(t, e, n, s) {
2575
2575
  return i;
2576
2576
  }
2577
2577
  const Mo = (t) => (e, n) => {
2578
- const s = J(ln), i = J(an), o = () => Mu(t, e, s, i);
2578
+ const s = Q(ln), i = Q(an), o = () => Mu(t, e, s, i);
2579
2579
  return n ? o() : as(o);
2580
2580
  };
2581
2581
  function Fs(t, e, n) {
@@ -2616,9 +2616,9 @@ function Ru(t, e, n) {
2616
2616
  [e]
2617
2617
  );
2618
2618
  }
2619
- const Bs = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Nu = "framerAppearId", Vo = "data-" + Bs(Nu), ko = qt({});
2619
+ const Bs = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), Nu = "framerAppearId", Vo = "data-" + Bs(Nu), ko = Zt({});
2620
2620
  function Iu(t, e, n, s, i) {
2621
- const { visualElement: o } = J(ln), r = J(Es), a = J(an), l = J(ks).reducedMotion, u = rt(null);
2621
+ const { visualElement: o } = Q(ln), r = Q(Es), a = Q(an), l = Q(ks).reducedMotion, u = rt(null);
2622
2622
  s = s || r.renderer, !u.current && s && (u.current = s(t, {
2623
2623
  visualState: e,
2624
2624
  parent: o,
@@ -2627,7 +2627,7 @@ function Iu(t, e, n, s, i) {
2627
2627
  blockInitialAnimation: a ? a.initial === !1 : !1,
2628
2628
  reducedMotionConfig: l
2629
2629
  }));
2630
- const c = u.current, d = J(ko);
2630
+ const c = u.current, d = Q(ko);
2631
2631
  c && !c.projection && i && (c.type === "html" || c.type === "svg") && Lu(u.current, n, i, d);
2632
2632
  const h = rt(!1);
2633
2633
  yr(() => {
@@ -2667,13 +2667,13 @@ function Eo(t) {
2667
2667
  if (t)
2668
2668
  return t.options.allowProjection !== !1 ? t.projection : Eo(t.parent);
2669
2669
  }
2670
- function Ze(t, { forwardMotionProps: e = !1 } = {}, n, s) {
2670
+ function qe(t, { forwardMotionProps: e = !1 } = {}, n, s) {
2671
2671
  n && Yn(n);
2672
2672
  const i = Os(t) ? ku : Vu;
2673
2673
  function o(a, l) {
2674
2674
  let u;
2675
2675
  const c = {
2676
- ...J(ks),
2676
+ ...Q(ks),
2677
2677
  ...a,
2678
2678
  layoutId: Ou(a)
2679
2679
  }, { isStatic: d } = c, h = fu(a), m = i(a, d);
@@ -2689,11 +2689,11 @@ function Ze(t, { forwardMotionProps: e = !1 } = {}, n, s) {
2689
2689
  return r[Eu] = t, r;
2690
2690
  }
2691
2691
  function Ou({ layoutId: t }) {
2692
- const e = J(os).id;
2692
+ const e = Q(os).id;
2693
2693
  return e && t !== void 0 ? e + "-" + t : t;
2694
2694
  }
2695
2695
  function ju(t, e) {
2696
- const n = J(Es).strict;
2696
+ const n = Q(Es).strict;
2697
2697
  if (process.env.NODE_ENV !== "production" && e && n) {
2698
2698
  const s = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
2699
2699
  t.ignoreStrict ? he(!1, s, "lazy-strict-mode") : Mt(!1, s, "lazy-strict-mode");
@@ -2711,15 +2711,15 @@ function Fu(t) {
2711
2711
  }
2712
2712
  function Bu(t, e) {
2713
2713
  if (typeof Proxy > "u")
2714
- return Ze;
2715
- const n = /* @__PURE__ */ new Map(), s = (o, r) => Ze(o, r, t, e), i = (o, r) => (process.env.NODE_ENV !== "production" && fs(!1, "motion() is deprecated. Use motion.create() instead."), s(o, r));
2714
+ return qe;
2715
+ const n = /* @__PURE__ */ new Map(), s = (o, r) => qe(o, r, t, e), i = (o, r) => (process.env.NODE_ENV !== "production" && fs(!1, "motion() is deprecated. Use motion.create() instead."), s(o, r));
2716
2716
  return new Proxy(i, {
2717
2717
  /**
2718
2718
  * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
2719
2719
  * The prop name is passed through as `key` and we can use that to generate a `motion`
2720
2720
  * DOM component with that name.
2721
2721
  */
2722
- get: (o, r) => r === "create" ? s : (n.has(r) || n.set(r, Ze(r, void 0, t, e)), n.get(r))
2722
+ get: (o, r) => r === "create" ? s : (n.has(r) || n.set(r, qe(r, void 0, t, e)), n.get(r))
2723
2723
  });
2724
2724
  }
2725
2725
  function Ro({ top: t, left: e, right: n, bottom: s }) {
@@ -2748,7 +2748,7 @@ function An(t) {
2748
2748
  function Gn({ scale: t, scaleX: e, scaleY: n }) {
2749
2749
  return !An(t) || !An(e) || !An(n);
2750
2750
  }
2751
- function Kt(t) {
2751
+ function Ht(t) {
2752
2752
  return Gn(t) || No(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
2753
2753
  }
2754
2754
  function No(t) {
@@ -2783,7 +2783,7 @@ function Uu(t, e, n, s = !1) {
2783
2783
  l && l.props.style && l.props.style.display === "contents" || (s && o.options.layoutScroll && o.scroll && o !== o.root && oe(t, {
2784
2784
  x: -o.scroll.offset.x,
2785
2785
  y: -o.scroll.offset.y
2786
- }), r && (e.x *= r.x.scale, e.y *= r.y.scale, Io(t, r)), s && Kt(o.latestValues) && oe(t, o.latestValues));
2786
+ }), r && (e.x *= r.x.scale, e.y *= r.y.scale, Io(t, r)), s && Ht(o.latestValues) && oe(t, o.latestValues));
2787
2787
  }
2788
2788
  e.x < ki && e.x > Vi && (e.x = 1), e.y < ki && e.y > Vi && (e.y = 1);
2789
2789
  }
@@ -3366,7 +3366,7 @@ function Ko(t) {
3366
3366
  const e = {};
3367
3367
  for (let n = 0; n < fd; n++) {
3368
3368
  const s = Ns[n], i = t.props[s];
3369
- (De(i) || i === !1) && (e[s] = i);
3369
+ (Me(i) || i === !1) && (e[s] = i);
3370
3370
  }
3371
3371
  return e;
3372
3372
  }
@@ -3391,7 +3391,7 @@ function yd(t) {
3391
3391
  const { props: u } = t, c = Ko(t.parent) || {}, d = [], h = /* @__PURE__ */ new Set();
3392
3392
  let m = {}, g = 1 / 0;
3393
3393
  for (let x = 0; x < pd; x++) {
3394
- const v = md[x], b = n[v], w = u[v] !== void 0 ? u[v] : c[v], M = De(w), P = v === l ? b.isActive : null;
3394
+ const v = md[x], b = n[v], w = u[v] !== void 0 ? u[v] : c[v], M = Me(w), P = v === l ? b.isActive : null;
3395
3395
  P === !1 && (g = x);
3396
3396
  let E = w === c[v] && w !== u[v] && M;
3397
3397
  if (E && s && t.manuallyAnimateOnMount && (E = !1), b.protectedKeys = { ...m }, // If it isn't active and hasn't *just* been set as inactive
@@ -3558,10 +3558,10 @@ const Ho = {
3558
3558
  Feature: wd
3559
3559
  }
3560
3560
  };
3561
- function ke(t, e, n, s = { passive: !0 }) {
3561
+ function Ve(t, e, n, s = { passive: !0 }) {
3562
3562
  return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
3563
3563
  }
3564
- function Le(t) {
3564
+ function Ie(t) {
3565
3565
  return {
3566
3566
  point: {
3567
3567
  x: t.pageX,
@@ -3569,9 +3569,9 @@ function Le(t) {
3569
3569
  }
3570
3570
  };
3571
3571
  }
3572
- const Td = (t) => (e) => Vs(e) && t(e, Le(e));
3572
+ const Td = (t) => (e) => Vs(e) && t(e, Ie(e));
3573
3573
  function we(t, e, n, s) {
3574
- return ke(t, e, Td(n), s);
3574
+ return Ve(t, e, Td(n), s);
3575
3575
  }
3576
3576
  const Xo = 1e-4, Sd = 1 - Xo, Pd = 1 + Xo, Yo = 0.01, Cd = 0 - Yo, Ad = 0 + Yo;
3577
3577
  function ot(t) {
@@ -3630,10 +3630,10 @@ class qo {
3630
3630
  }, !Vs(e))
3631
3631
  return;
3632
3632
  this.dragSnapToOrigin = o, this.handlers = n, this.transformPagePoint = s, this.distanceThreshold = r, this.contextWindow = i || window;
3633
- const a = Le(e), l = Mn(a, this.transformPagePoint), { point: u } = l, { timestamp: c } = Z;
3633
+ const a = Ie(e), l = Mn(a, this.transformPagePoint), { point: u } = l, { timestamp: c } = Z;
3634
3634
  this.history = [{ ...u, timestamp: c }];
3635
3635
  const { onSessionStart: d } = n;
3636
- d && d(e, Dn(l, this.history)), this.removeListeners = Re(we(this.contextWindow, "pointermove", this.handlePointerMove), we(this.contextWindow, "pointerup", this.handlePointerUp), we(this.contextWindow, "pointercancel", this.handlePointerUp));
3636
+ d && d(e, Dn(l, this.history)), this.removeListeners = Ee(we(this.contextWindow, "pointermove", this.handlePointerMove), we(this.contextWindow, "pointerup", this.handlePointerUp), we(this.contextWindow, "pointercancel", this.handlePointerUp));
3637
3637
  }
3638
3638
  updateHandlers(e) {
3639
3639
  this.handlers = e;
@@ -3708,7 +3708,7 @@ function Id(t, e) {
3708
3708
  function Ld(t, e) {
3709
3709
  let n = 0.5;
3710
3710
  const s = ot(t), i = ot(e);
3711
- return i > s ? n = /* @__PURE__ */ Ce(e.min, e.max - s, t.min) : s > i && (n = /* @__PURE__ */ Ce(t.min, t.max - i, e.min)), At(0, 1, n);
3711
+ return i > s ? n = /* @__PURE__ */ Pe(e.min, e.max - s, t.min) : s > i && (n = /* @__PURE__ */ Pe(t.min, t.max - i, e.min)), At(0, 1, n);
3712
3712
  }
3713
3713
  function Od(t, e) {
3714
3714
  const n = {};
@@ -3741,7 +3741,7 @@ class Bd {
3741
3741
  return;
3742
3742
  const o = (d) => {
3743
3743
  const { dragSnapToOrigin: h } = this.getProps();
3744
- h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(Le(d).point);
3744
+ h ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(Ie(d).point);
3745
3745
  }, r = (d, h) => {
3746
3746
  const { drag: m, dragPropagation: g, onDragStart: y } = this.getProps();
3747
3747
  if (m && !g && (this.openDragLock && this.openDragLock(), this.openDragLock = Hc(m), !this.openDragLock))
@@ -3810,7 +3810,7 @@ class Bd {
3810
3810
  }
3811
3811
  updateAxis(e, n, s) {
3812
3812
  const { drag: i } = this.getProps();
3813
- if (!s || !He(e, i, this.currentDirection))
3813
+ if (!s || !Ke(e, i, this.currentDirection))
3814
3814
  return;
3815
3815
  const o = this.getAxisMotionValue(e);
3816
3816
  let r = this.originPoint[e] + s[e];
@@ -3841,7 +3841,7 @@ class Bd {
3841
3841
  }
3842
3842
  startAnimation(e) {
3843
3843
  const { drag: n, dragMomentum: s, dragElastic: i, dragTransition: o, dragSnapToOrigin: r, onDragTransitionEnd: a } = this.getProps(), l = this.constraints || {}, u = dt((c) => {
3844
- if (!He(c, n, this.currentDirection))
3844
+ if (!Ke(c, n, this.currentDirection))
3845
3845
  return;
3846
3846
  let d = l && l[c] || {};
3847
3847
  r && (d = { min: 0, max: 0 });
@@ -3886,7 +3886,7 @@ class Bd {
3886
3886
  snapToCursor(e) {
3887
3887
  dt((n) => {
3888
3888
  const { drag: s } = this.getProps();
3889
- if (!He(n, s, this.currentDirection))
3889
+ if (!Ke(n, s, this.currentDirection))
3890
3890
  return;
3891
3891
  const { projection: i } = this.visualElement, o = this.getAxisMotionValue(n);
3892
3892
  if (i && i.layout) {
@@ -3917,7 +3917,7 @@ class Bd {
3917
3917
  });
3918
3918
  const { transformTemplate: o } = this.visualElement.getProps();
3919
3919
  this.visualElement.current.style.transform = o ? o({}, "") : "none", s.root && s.root.updateScroll(), s.updateLayout(), this.resolveConstraints(), dt((r) => {
3920
- if (!He(r, e, null))
3920
+ if (!Ke(r, e, null))
3921
3921
  return;
3922
3922
  const a = this.getAxisMotionValue(r), { min: l, max: u } = this.constraints[r];
3923
3923
  a.set(H(l, u, i[r]));
@@ -3935,7 +3935,7 @@ class Bd {
3935
3935
  ie(l) && l.current && (this.constraints = this.resolveRefConstraints());
3936
3936
  }, { projection: i } = this.visualElement, o = i.addEventListener("measure", s);
3937
3937
  i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), U.read(s);
3938
- const r = ke(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", (({ delta: l, hasLayoutChanged: u }) => {
3938
+ const r = Ve(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", (({ delta: l, hasLayoutChanged: u }) => {
3939
3939
  this.isDragging && u && (dt((c) => {
3940
3940
  const d = this.getAxisMotionValue(c);
3941
3941
  d && (this.originPoint[c] += l[c].translate, d.set(d.get() + l[c].translate));
@@ -3958,7 +3958,7 @@ class Bd {
3958
3958
  };
3959
3959
  }
3960
3960
  }
3961
- function He(t, e, n) {
3961
+ function Ke(t, e, n) {
3962
3962
  return (e === !0 || e === t) && (n === null || n === t);
3963
3963
  }
3964
3964
  function $d(t, e = 10) {
@@ -4011,7 +4011,7 @@ class Ud extends Lt {
4011
4011
  this.removePointerDownListener(), this.session && this.session.end();
4012
4012
  }
4013
4013
  }
4014
- const Je = {
4014
+ const Ze = {
4015
4015
  /**
4016
4016
  * Global flag as to whether the tree has animated since the last time
4017
4017
  * we resized the window
@@ -4063,7 +4063,7 @@ class _d extends ja {
4063
4063
  }), o.setOptions({
4064
4064
  ...o.options,
4065
4065
  onExitComplete: () => this.safeToRemove()
4066
- })), Je.hasEverUpdated = !0;
4066
+ })), Ze.hasEverUpdated = !0;
4067
4067
  }
4068
4068
  getSnapshotBeforeUpdate(e) {
4069
4069
  const { layoutDependency: n, visualElement: s, drag: i, isPresent: o } = this.props, { projection: r } = s;
@@ -4091,8 +4091,8 @@ class _d extends ja {
4091
4091
  }
4092
4092
  }
4093
4093
  function Jo(t) {
4094
- const [e, n] = xo(), s = J(os);
4095
- return f(_d, { ...t, layoutGroup: s, switchLayoutGroup: J(ko), isPresent: e, safeToRemove: n });
4094
+ const [e, n] = xo(), s = Q(os);
4095
+ return f(_d, { ...t, layoutGroup: s, switchLayoutGroup: Q(ko), isPresent: e, safeToRemove: n });
4096
4096
  }
4097
4097
  const Kd = {
4098
4098
  borderRadius: {
@@ -4153,7 +4153,7 @@ function Gi(t, e) {
4153
4153
  }
4154
4154
  const Jd = /* @__PURE__ */ ta(0, 0.5, Fr), Qd = /* @__PURE__ */ ta(0.5, 0.95, ft);
4155
4155
  function ta(t, e, n) {
4156
- return (s) => s < t ? 0 : s > e ? 1 : n(/* @__PURE__ */ Ce(t, e, s));
4156
+ return (s) => s < t ? 0 : s > e ? 1 : n(/* @__PURE__ */ Pe(t, e, s));
4157
4157
  }
4158
4158
  function qi(t, e) {
4159
4159
  t.min = e.min, t.max = e.max;
@@ -4325,7 +4325,7 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4325
4325
  d = window.innerWidth;
4326
4326
  }), t(r, () => {
4327
4327
  const m = window.innerWidth;
4328
- m !== d && (d = m, this.root.updateBlockedByResize = !0, c && c(), c = Gd(h, 250), Je.hasAnimatedSinceResize && (Je.hasAnimatedSinceResize = !1, this.nodes.forEach(lr)));
4328
+ m !== d && (d = m, this.root.updateBlockedByResize = !0, c && c(), c = Gd(h, 250), Ze.hasAnimatedSinceResize && (Ze.hasAnimatedSinceResize = !1, this.nodes.forEach(lr)));
4329
4329
  });
4330
4330
  }
4331
4331
  a && this.root.registerSharedNode(a, this), this.options.animate !== !1 && u && (a || l) && this.addEventListener("didUpdate", ({ delta: c, hasLayoutChanged: d, hasRelativeLayoutChanged: h, layout: m }) => {
@@ -4452,7 +4452,7 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4452
4452
  if (!i)
4453
4453
  return;
4454
4454
  const r = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, a = this.projectionDelta && !ea(this.projectionDelta), l = this.getTransformTemplate(), u = l ? l(this.latestValues, "") : void 0, c = u !== this.prevTransformTemplateValue;
4455
- r && this.instance && (a || Kt(this.latestValues) || c) && (i(this.instance, u), this.shouldResetTransform = !1, this.scheduleRender());
4455
+ r && this.instance && (a || Ht(this.latestValues) || c) && (i(this.instance, u), this.shouldResetTransform = !1, this.scheduleRender());
4456
4456
  }
4457
4457
  measure(r = !0) {
4458
4458
  const a = this.measurePageBox();
@@ -4494,22 +4494,22 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4494
4494
  !a && c.options.layoutScroll && c.scroll && c !== c.root && oe(l, {
4495
4495
  x: -c.scroll.offset.x,
4496
4496
  y: -c.scroll.offset.y
4497
- }), Kt(c.latestValues) && oe(l, c.latestValues);
4497
+ }), Ht(c.latestValues) && oe(l, c.latestValues);
4498
4498
  }
4499
- return Kt(this.latestValues) && oe(l, this.latestValues), l;
4499
+ return Ht(this.latestValues) && oe(l, this.latestValues), l;
4500
4500
  }
4501
4501
  removeTransform(r) {
4502
4502
  const a = G();
4503
4503
  ut(a, r);
4504
4504
  for (let l = 0; l < this.path.length; l++) {
4505
4505
  const u = this.path[l];
4506
- if (!u.instance || !Kt(u.latestValues))
4506
+ if (!u.instance || !Ht(u.latestValues))
4507
4507
  continue;
4508
4508
  Gn(u.latestValues) && u.updateSnapshot();
4509
4509
  const c = G(), d = u.measurePageBox();
4510
4510
  ut(c, d), tr(a, u.latestValues, u.snapshot ? u.snapshot.layoutBox : void 0, c);
4511
4511
  }
4512
- return Kt(this.latestValues) && tr(a, this.latestValues), a;
4512
+ return Ht(this.latestValues) && tr(a, this.latestValues), a;
4513
4513
  }
4514
4514
  setTargetDelta(r) {
4515
4515
  this.targetDelta = r, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
@@ -4600,7 +4600,7 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4600
4600
  }
4601
4601
  startAnimation(r) {
4602
4602
  this.notifyListeners("animationStart"), this.currentAnimation?.stop(), this.resumingFrom?.currentAnimation?.stop(), this.pendingAnimation && (Nt(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = U.update(() => {
4603
- Je.hasAnimatedSinceResize = !0, this.motionValue || (this.motionValue = ue(0)), this.currentAnimation = Hd(this.motionValue, [0, 1e3], {
4603
+ Ze.hasAnimatedSinceResize = !0, this.motionValue || (this.motionValue = ue(0)), this.currentAnimation = Hd(this.motionValue, [0, 1e3], {
4604
4604
  ...r,
4605
4605
  velocity: 0,
4606
4606
  isSync: !0,
@@ -4696,12 +4696,12 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4696
4696
  }
4697
4697
  const l = this.getTransformTemplate();
4698
4698
  if (this.needsReset) {
4699
- this.needsReset = !1, r.visibility = "", r.opacity = "", r.pointerEvents = qe(a?.pointerEvents) || "", r.transform = l ? l(this.latestValues, "") : "none";
4699
+ this.needsReset = !1, r.visibility = "", r.opacity = "", r.pointerEvents = Ge(a?.pointerEvents) || "", r.transform = l ? l(this.latestValues, "") : "none";
4700
4700
  return;
4701
4701
  }
4702
4702
  const u = this.getLead();
4703
4703
  if (!this.projectionDelta || !this.layout || !u.target) {
4704
- this.options.layoutId && (r.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, r.pointerEvents = qe(a?.pointerEvents) || ""), this.hasProjected && !Kt(this.latestValues) && (r.transform = l ? l({}, "") : "none", this.hasProjected = !1);
4704
+ this.options.layoutId && (r.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, r.pointerEvents = Ge(a?.pointerEvents) || ""), this.hasProjected && !Ht(this.latestValues) && (r.transform = l ? l({}, "") : "none", this.hasProjected = !1);
4705
4705
  return;
4706
4706
  }
4707
4707
  r.visibility = "";
@@ -4711,10 +4711,10 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4711
4711
  l && (d = l(c, d)), r.transform = d;
4712
4712
  const { x: h, y: m } = this.projectionDelta;
4713
4713
  r.transformOrigin = `${h.origin * 100}% ${m.origin * 100}% 0`, u.animationValues ? r.opacity = u === this ? c.opacity ?? this.latestValues.opacity ?? 1 : this.preserveOpacity ? this.latestValues.opacity : c.opacityExit : r.opacity = u === this ? c.opacity !== void 0 ? c.opacity : "" : c.opacityExit !== void 0 ? c.opacityExit : 0;
4714
- for (const g in Ve) {
4714
+ for (const g in De) {
4715
4715
  if (c[g] === void 0)
4716
4716
  continue;
4717
- const { correct: y, applyTo: x, isCSSVariable: v } = Ve[g], b = d === "none" ? c[g] : y(c[g], u);
4717
+ const { correct: y, applyTo: x, isCSSVariable: v } = De[g], b = d === "none" ? c[g] : y(c[g], u);
4718
4718
  if (x) {
4719
4719
  const w = x.length;
4720
4720
  for (let M = 0; M < w; M++)
@@ -4722,7 +4722,7 @@ function ia({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4722
4722
  } else
4723
4723
  v ? this.options.visualElement.renderState.vars[g] = b : r[g] = b;
4724
4724
  }
4725
- this.options.layoutId && (r.pointerEvents = u === this ? qe(a?.pointerEvents) || "" : "none");
4725
+ this.options.layoutId && (r.pointerEvents = u === this ? Ge(a?.pointerEvents) || "" : "none");
4726
4726
  }
4727
4727
  clearSnapshot() {
4728
4728
  this.resumeFrom = this.snapshot = void 0;
@@ -4842,7 +4842,7 @@ function Th(t) {
4842
4842
  return t !== t.root && t.scroll?.wasRoot;
4843
4843
  }
4844
4844
  const Sh = ia({
4845
- attachResizeListener: (t, e) => ke(t, "resize", e),
4845
+ attachResizeListener: (t, e) => Ve(t, "resize", e),
4846
4846
  measureScroll: () => ({
4847
4847
  x: document.documentElement.scrollLeft || document.body.scrollLeft,
4848
4848
  y: document.documentElement.scrollTop || document.body.scrollTop
@@ -4880,7 +4880,7 @@ function mr(t, e, n) {
4880
4880
  const { props: s } = t;
4881
4881
  t.animationState && s.whileHover && t.animationState.setActive("whileHover", n === "Start");
4882
4882
  const i = "onHover" + n, o = s[i];
4883
- o && U.postRender(() => o(e, Le(e)));
4883
+ o && U.postRender(() => o(e, Ie(e)));
4884
4884
  }
4885
4885
  class Ch extends Lt {
4886
4886
  mount() {
@@ -4907,7 +4907,7 @@ class Ah extends Lt {
4907
4907
  !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
4908
4908
  }
4909
4909
  mount() {
4910
- this.unmount = Re(ke(this.node.current, "focus", () => this.onFocus()), ke(this.node.current, "blur", () => this.onBlur()));
4910
+ this.unmount = Ee(Ve(this.node.current, "focus", () => this.onFocus()), Ve(this.node.current, "blur", () => this.onBlur()));
4911
4911
  }
4912
4912
  unmount() {
4913
4913
  }
@@ -4918,7 +4918,7 @@ function pr(t, e, n) {
4918
4918
  return;
4919
4919
  t.animationState && s.whileTap && t.animationState.setActive("whileTap", n === "Start");
4920
4920
  const i = "onTap" + (n === "End" ? "" : n), o = s[i];
4921
- o && U.postRender(() => o(e, Le(e)));
4921
+ o && U.postRender(() => o(e, Ie(e)));
4922
4922
  }
4923
4923
  class Mh extends Lt {
4924
4924
  mount() {
@@ -5014,10 +5014,10 @@ const aa = {
5014
5014
  ...aa
5015
5015
  };
5016
5016
  function la(t, e) {
5017
- return Ze(t, e);
5017
+ return qe(t, e);
5018
5018
  }
5019
- const Xe = /* @__PURE__ */ la("div"), Bh = /* @__PURE__ */ la("p");
5020
- let Qe = null;
5019
+ const He = /* @__PURE__ */ la("div"), Bh = /* @__PURE__ */ la("p");
5020
+ let Je = null;
5021
5021
  function $h() {
5022
5022
  try {
5023
5023
  return require("../../.arcten/tool-types.json")?.functions || null;
@@ -5025,7 +5025,7 @@ function $h() {
5025
5025
  return null;
5026
5026
  }
5027
5027
  }
5028
- Qe = $h();
5028
+ Je = $h();
5029
5029
  function ss(t) {
5030
5030
  let e;
5031
5031
  switch (t.type) {
@@ -5079,8 +5079,8 @@ function zh(t, e) {
5079
5079
  }
5080
5080
  function Uh(t) {
5081
5081
  const e = t.name || "unnamed";
5082
- if (Qe && Qe[e])
5083
- return zh(e, Qe[e]);
5082
+ if (Je && Je[e])
5083
+ return zh(e, Je[e]);
5084
5084
  const { description: n, paramDescriptions: s, paramTypes: i } = Wh(t), { schema: o, def: r } = Kh(t, s, i);
5085
5085
  return {
5086
5086
  name: e,
@@ -5246,7 +5246,7 @@ function Hh({
5246
5246
  ] }),
5247
5247
  /* @__PURE__ */ A("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
5248
5248
  /* @__PURE__ */ A(
5249
- Pe,
5249
+ tn,
5250
5250
  {
5251
5251
  size: "sm",
5252
5252
  variant: "ghost",
@@ -5259,13 +5259,13 @@ function Hh({
5259
5259
  }
5260
5260
  ),
5261
5261
  /* @__PURE__ */ f(
5262
- Pe,
5262
+ tn,
5263
5263
  {
5264
5264
  size: "sm",
5265
5265
  variant: "ghost",
5266
5266
  className: "h-6 px-2 text-xs text-muted-foreground",
5267
5267
  onClick: i,
5268
- children: /* @__PURE__ */ f(tn, { className: "h-3 w-3" })
5268
+ children: /* @__PURE__ */ f(Qe, { className: "h-3 w-3" })
5269
5269
  }
5270
5270
  )
5271
5271
  ] })
@@ -5293,7 +5293,7 @@ function Xh({
5293
5293
  className: `inline-flex items-center gap-1.5 text-xs rounded-md px-2 py-1 transition-colors ${n ? "bg-red-100 dark:bg-red-950/30 text-red-700 dark:text-red-400" : "bg-green-100 dark:bg-green-950/30 text-green-700 dark:text-green-400"} ${l ? "cursor-pointer hover:bg-opacity-80" : ""}`,
5294
5294
  children: [
5295
5295
  l && /* @__PURE__ */ f("span", { className: "transition-transform duration-200", children: i ? /* @__PURE__ */ f($a, { className: "h-3 w-3" }) : /* @__PURE__ */ f(za, { className: "h-3 w-3" }) }),
5296
- n ? /* @__PURE__ */ f(tn, { className: "h-3 w-3" }) : s ? /* @__PURE__ */ f(Ua, { className: "h-3 w-3" }) : /* @__PURE__ */ f(br, { className: "h-3 w-3" }),
5296
+ n ? /* @__PURE__ */ f(Qe, { className: "h-3 w-3" }) : s ? /* @__PURE__ */ f(Ua, { className: "h-3 w-3" }) : /* @__PURE__ */ f(br, { className: "h-3 w-3" }),
5297
5297
  /* @__PURE__ */ A("span", { className: "font-medium", children: [
5298
5298
  n ? "Denied" : s ? "Auto-executed" : "Executed",
5299
5299
  " ",
@@ -5340,11 +5340,11 @@ function qh({
5340
5340
  }
5341
5341
  const Zh = Ba(
5342
5342
  () => import("streamdown").then((t) => ({ default: t.Streamdown }))
5343
- ), zs = Ee(
5343
+ ), zs = ke(
5344
5344
  ({ className: t, ...e }) => typeof window > "u" ? null : /* @__PURE__ */ f(Fa, { fallback: null, children: /* @__PURE__ */ f(
5345
5345
  Zh,
5346
5346
  {
5347
- className: tt(
5347
+ className: J(
5348
5348
  "size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
5349
5349
  t
5350
5350
  ),
@@ -5374,7 +5374,7 @@ const Jh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5374
5374
  o,
5375
5375
  {
5376
5376
  animate: { backgroundPosition: "0% center" },
5377
- className: tt(
5377
+ className: J(
5378
5378
  "relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
5379
5379
  "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",
5380
5380
  n
@@ -5392,12 +5392,12 @@ const Jh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5392
5392
  children: t
5393
5393
  }
5394
5394
  );
5395
- }, tf = Ee(Qh), ua = qt(null), ef = () => {
5396
- const t = J(ua);
5395
+ }, tf = ke(Qh), ua = Zt(null), ef = () => {
5396
+ const t = Q(ua);
5397
5397
  if (!t)
5398
5398
  throw new Error("Reasoning components must be used within Reasoning");
5399
5399
  return t;
5400
- }, nf = 1e3, sf = 1e3, da = Ee(
5400
+ }, nf = 1e3, sf = 1e3, da = ke(
5401
5401
  ({
5402
5402
  className: t,
5403
5403
  isStreaming: e = !1,
@@ -5436,7 +5436,7 @@ const Jh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5436
5436
  children: /* @__PURE__ */ f(
5437
5437
  Yh,
5438
5438
  {
5439
- className: tt("not-prose mb-4", t),
5439
+ className: J("not-prose mb-4", t),
5440
5440
  onOpenChange: x,
5441
5441
  open: l,
5442
5442
  ...a,
@@ -5450,13 +5450,13 @@ const Jh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5450
5450
  "Thought for ",
5451
5451
  e,
5452
5452
  " seconds"
5453
- ] }), ha = Ee(
5453
+ ] }), ha = ke(
5454
5454
  ({ className: t, children: e, ...n }) => {
5455
5455
  const { isStreaming: s, isOpen: i, duration: o } = ef();
5456
5456
  return /* @__PURE__ */ f(
5457
5457
  Gh,
5458
5458
  {
5459
- className: tt(
5459
+ className: J(
5460
5460
  "flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",
5461
5461
  t
5462
5462
  ),
@@ -5467,7 +5467,7 @@ const Jh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5467
5467
  /* @__PURE__ */ f(
5468
5468
  _a,
5469
5469
  {
5470
- className: tt(
5470
+ className: J(
5471
5471
  "size-4 transition-transform",
5472
5472
  i ? "rotate-180" : "rotate-0"
5473
5473
  )
@@ -5477,11 +5477,11 @@ const Jh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5477
5477
  }
5478
5478
  );
5479
5479
  }
5480
- ), fa = Ee(
5480
+ ), fa = ke(
5481
5481
  ({ className: t, children: e, ...n }) => /* @__PURE__ */ f(
5482
5482
  qh,
5483
5483
  {
5484
- className: tt(
5484
+ className: J(
5485
5485
  "mt-4 text-sm",
5486
5486
  "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
5487
5487
  t
@@ -5512,7 +5512,7 @@ function bf({
5512
5512
  apiBaseUrl: g = "https://api.arcten.com",
5513
5513
  user: y
5514
5514
  }) {
5515
- const [x, v] = N(null), b = rt(null), [w, M] = N(null), [P, E] = N(null), V = rt(null), [C, z] = N(u), [O, st] = N(r), [St, Pt] = N(600), [Ot, vt] = N(!1), [j, W] = N(!1), [I, at] = N(!1), [X, Ct] = N({ x: 100, y: 100 }), [Oe, Vt] = N(!1), [jt, je] = N({ x: 0, y: 0 }), [dn, hn] = N(!1), Zt = rt(null), Jt = rt(null), [k, R] = N(""), [Y, ct] = N(null), [it, mt] = N("Thinking..."), [fn, mn] = N(/* @__PURE__ */ new Set()), [ma, pa] = N(""), [Ft, ga] = N([]), [pn, Us] = N(!1), [gn, Ws] = N([]), [_s, yn] = N(() => typeof window < "u" ? crypto.randomUUID() : null), [Qt, Fe] = N(!1), [of, Be] = N(!1), [af, $e] = N([]), Bt = et(() => [...c, ...d], [c, d]), Ks = et(() => ca(Bt), [Bt]), Hs = et(() => {
5515
+ const [x, v] = N(null), b = rt(null), [w, M] = N(null), [P, E] = N(null), V = rt(null), [C, z] = N(u), [O, st] = N(r), [St, Pt] = N(600), [Ot, vt] = N(!1), [j, W] = N(!1), [I, at] = N(!1), [X, Ct] = N({ x: 100, y: 100 }), [Le, Vt] = N(!1), [jt, Oe] = N({ x: 0, y: 0 }), [dn, hn] = N(!1), Jt = rt(null), Qt = rt(null), [k, R] = N(""), [Y, ct] = N(null), [it, mt] = N("Thinking..."), [fn, mn] = N(/* @__PURE__ */ new Set()), [ma, pa] = N(""), [Ft, ga] = N([]), [pn, Us] = N(!1), [gn, Ws] = N([]), [_s, yn] = N(() => typeof window < "u" ? crypto.randomUUID() : null), [te, je] = N(!1), [of, Fe] = N(!1), [af, Be] = N([]), Bt = et(() => [...c, ...d], [c, d]), Ks = et(() => ca(Bt), [Bt]), Hs = et(() => {
5516
5516
  const p = /* @__PURE__ */ new Map();
5517
5517
  return Bt.forEach((S) => p.set(S.name, S)), p;
5518
5518
  }, [Bt]), Xs = et(() => new Set(d.map((p) => p.name)), [d]), Ys = [
@@ -5594,11 +5594,11 @@ function bf({
5594
5594
  const kt = JSON.parse(_), bt = 50, Et = Math.max(
5595
5595
  bt - r,
5596
5596
  Math.min(kt.x, window.innerWidth - bt)
5597
- ), Q = Math.max(
5597
+ ), tt = Math.max(
5598
5598
  0,
5599
5599
  Math.min(kt.y, window.innerHeight - bt)
5600
5600
  );
5601
- Ct({ x: Et, y: Q });
5601
+ Ct({ x: Et, y: tt });
5602
5602
  }
5603
5603
  const B = localStorage.getItem("arcten-sidebar-minimized");
5604
5604
  B && at(JSON.parse(B)), hn(!0);
@@ -5686,7 +5686,7 @@ function bf({
5686
5686
  }, []);
5687
5687
  async function Gs() {
5688
5688
  if (!(!y?.id || !x)) {
5689
- Be(!0);
5689
+ Fe(!0);
5690
5690
  try {
5691
5691
  const S = await (await fetch(`${g}/conversations`, {
5692
5692
  headers: {
@@ -5697,7 +5697,7 @@ function bf({
5697
5697
  } catch (p) {
5698
5698
  console.error("Failed to fetch conversations:", p);
5699
5699
  } finally {
5700
- Be(!1);
5700
+ Fe(!1);
5701
5701
  }
5702
5702
  }
5703
5703
  }
@@ -5710,7 +5710,7 @@ function bf({
5710
5710
  }
5711
5711
  function va() {
5712
5712
  const p = crypto.randomUUID();
5713
- yn(p), Ue([]), $e([]), Fe(!1);
5713
+ yn(p), ze([]), Be([]), je(!1);
5714
5714
  }
5715
5715
  async function xa(p) {
5716
5716
  if (x)
@@ -5726,7 +5726,7 @@ function bf({
5726
5726
  }
5727
5727
  }
5728
5728
  async function ba(p) {
5729
- yn(p.chatId), Fe(!1), Be(!0);
5729
+ yn(p.chatId), je(!1), Fe(!0);
5730
5730
  try {
5731
5731
  const S = await fetch(`${g}/conversations/${p.chatId}/messages`, {
5732
5732
  headers: {
@@ -5736,13 +5736,13 @@ function bf({
5736
5736
  if (!S.ok)
5737
5737
  throw new Error(`Failed to fetch messages: ${S.statusText}`);
5738
5738
  const T = (await S.json()).messages || [];
5739
- Ue(T), $e(T);
5739
+ ze(T), Be(T);
5740
5740
  } catch (S) {
5741
5741
  console.error("Failed to load conversation messages:", S);
5742
5742
  const F = p.messages || [];
5743
- Ue(F), $e(F);
5743
+ ze(F), Be(F);
5744
5744
  } finally {
5745
- Be(!1);
5745
+ Fe(!1);
5746
5746
  }
5747
5747
  }
5748
5748
  const wa = (async (p, S = {}) => {
@@ -5751,7 +5751,7 @@ function bf({
5751
5751
  ...S,
5752
5752
  headers: F
5753
5753
  });
5754
- }), { messages: ge, sendMessage: Ta, status: xt, error: qs, stop: ze, addToolResult: ye, setMessages: Ue } = wr({
5754
+ }), { messages: ge, sendMessage: Ta, status: xt, error: qs, stop: $e, addToolResult: ye, setMessages: ze } = wr({
5755
5755
  id: _s || void 0,
5756
5756
  // Pass AI SDK chat ID
5757
5757
  transport: new Sr({
@@ -5779,7 +5779,7 @@ function bf({
5779
5779
  sendAutomaticallyWhen: Tr
5780
5780
  });
5781
5781
  $(() => {
5782
- C && Jt.current && Jt.current.focus();
5782
+ C && Qt.current && Qt.current.focus();
5783
5783
  }, [C, ge]);
5784
5784
  function Sa() {
5785
5785
  z(!0), localStorage.setItem("arcten-sidebar-expanded", "true");
@@ -5789,20 +5789,20 @@ function bf({
5789
5789
  }
5790
5790
  $(() => {
5791
5791
  }, [C]), $(() => {
5792
- Zt.current && Zt.current.scrollIntoView({ behavior: "smooth" });
5792
+ Jt.current && Jt.current.scrollIntoView({ behavior: "smooth" });
5793
5793
  }, [ge]), $(() => {
5794
5794
  function p(S) {
5795
- S.key === "Escape" && (xt === "streaming" || xt === "submitted") && (S.preventDefault(), ze());
5795
+ S.key === "Escape" && (xt === "streaming" || xt === "submitted") && (S.preventDefault(), $e());
5796
5796
  }
5797
5797
  return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
5798
- }, [xt, ze]);
5798
+ }, [xt, $e]);
5799
5799
  function Ca() {
5800
5800
  const p = crypto.randomUUID();
5801
- yn(p), Ue([]), $e([]), Fe(!1);
5801
+ yn(p), ze([]), Be([]), je(!1);
5802
5802
  }
5803
5803
  function Zs(p) {
5804
5804
  if (p.preventDefault(), !k.trim()) return;
5805
- (xt === "streaming" || xt === "submitted") && ze();
5805
+ (xt === "streaming" || xt === "submitted") && $e();
5806
5806
  const S = Ys[Math.floor(Math.random() * Ys.length)] || "Thinking...";
5807
5807
  mt(S), Ta({ text: k }), R("");
5808
5808
  }
@@ -5841,7 +5841,7 @@ function bf({
5841
5841
  at(!I), localStorage.setItem("arcten-sidebar-minimized", JSON.stringify(!I));
5842
5842
  }
5843
5843
  function ka(p) {
5844
- j && (Vt(!0), je({
5844
+ j && (Vt(!0), Oe({
5845
5845
  x: p.clientX - X.x,
5846
5846
  y: p.clientY - X.y
5847
5847
  }));
@@ -5852,17 +5852,17 @@ function bf({
5852
5852
  Ct((S) => {
5853
5853
  const T = window.innerWidth - 50, _ = window.innerHeight - 50, B = 50 - O, kt = 0, bt = Math.max(B, Math.min(S.x, T)), Et = Math.max(kt, Math.min(S.y, _));
5854
5854
  if (bt !== S.x || Et !== S.y) {
5855
- const Q = { x: bt, y: Et };
5856
- return localStorage.setItem("arcten-sidebar-position", JSON.stringify(Q)), Q;
5855
+ const tt = { x: bt, y: Et };
5856
+ return localStorage.setItem("arcten-sidebar-position", JSON.stringify(tt)), tt;
5857
5857
  }
5858
5858
  return S;
5859
5859
  });
5860
5860
  }
5861
5861
  return window.addEventListener("resize", p), () => window.removeEventListener("resize", p);
5862
5862
  }, [j, O]), $(() => {
5863
- if (!Oe) return;
5863
+ if (!Le) return;
5864
5864
  function p(F) {
5865
- const T = F.clientX - jt.x, _ = F.clientY - jt.y, B = 50, kt = window.innerWidth - B, bt = window.innerHeight - B, Et = B - O, Q = 0, wt = Math.max(Et, Math.min(T, kt)), $t = Math.max(Q, Math.min(_, bt));
5865
+ const T = F.clientX - jt.x, _ = F.clientY - jt.y, B = 50, kt = window.innerWidth - B, bt = window.innerHeight - B, Et = B - O, tt = 0, wt = Math.max(Et, Math.min(T, kt)), $t = Math.max(tt, Math.min(_, bt));
5866
5866
  Ct({ x: wt, y: $t });
5867
5867
  }
5868
5868
  function S() {
@@ -5871,11 +5871,11 @@ function bf({
5871
5871
  return window.addEventListener("mousemove", p), window.addEventListener("mouseup", S), () => {
5872
5872
  window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", S);
5873
5873
  };
5874
- }, [Oe, jt, X, O]), dn ? w ? /* @__PURE__ */ f("div", { className: "fixed right-0 top-0 h-screen w-96 flex items-center justify-center p-4 bg-stone-50 dark:bg-stone-900 border-l border-border", children: /* @__PURE__ */ A("div", { className: "p-4 bg-destructive/10 text-destructive text-sm rounded-lg", children: [
5874
+ }, [Le, jt, X, O]), dn ? w ? /* @__PURE__ */ f("div", { className: "fixed right-0 top-0 h-screen w-96 flex items-center justify-center p-4 bg-stone-50 dark:bg-stone-900 border-l border-border", children: /* @__PURE__ */ A("div", { className: "p-4 bg-destructive/10 text-destructive text-sm rounded-lg", children: [
5875
5875
  "Authentication error: ",
5876
5876
  w
5877
5877
  ] }) }) : x ? /* @__PURE__ */ f(lu, { features: Fh, children: /* @__PURE__ */ f(
5878
- Xe,
5878
+ He,
5879
5879
  {
5880
5880
  id: "arcten-sidebar",
5881
5881
  "data-theme": t,
@@ -5921,7 +5921,7 @@ function bf({
5921
5921
  {
5922
5922
  className: "absolute bottom-0 left-4 right-4 h-3 cursor-move hover:bg-blue-500/20 group",
5923
5923
  onMouseDown: (p) => {
5924
- p.preventDefault(), p.stopPropagation(), Vt(!0), je({
5924
+ p.preventDefault(), p.stopPropagation(), Vt(!0), Oe({
5925
5925
  x: p.clientX - X.x,
5926
5926
  y: p.clientY - X.y
5927
5927
  });
@@ -5962,7 +5962,7 @@ function bf({
5962
5962
  "button",
5963
5963
  {
5964
5964
  type: "button",
5965
- className: tt(te({ variant: "ghost", size: "icon" }), "h-8 w-8"),
5965
+ className: J(Kt({ variant: "ghost", size: "icon" }), "h-8 w-8"),
5966
5966
  onClick: Ca,
5967
5967
  "aria-label": "New chat",
5968
5968
  children: /* @__PURE__ */ f(Ka, { className: "h-4 w-4" })
@@ -5975,7 +5975,7 @@ function bf({
5975
5975
  "button",
5976
5976
  {
5977
5977
  type: "button",
5978
- className: tt(te({ variant: "ghost", size: "icon" }), "h-8 w-8"),
5978
+ className: J(Kt({ variant: "ghost", size: "icon" }), "h-8 w-8"),
5979
5979
  onClick: j ? Va : Da,
5980
5980
  "aria-label": j ? "Dock sidebar" : "Float sidebar",
5981
5981
  children: j ? /* @__PURE__ */ f(Ha, { className: "h-4 w-4" }) : /* @__PURE__ */ f(Xa, { className: "h-4 w-4" })
@@ -5988,10 +5988,10 @@ function bf({
5988
5988
  "button",
5989
5989
  {
5990
5990
  type: "button",
5991
- className: tt(te({ variant: "ghost", size: "icon" }), "h-8 w-8"),
5991
+ className: J(Kt({ variant: "ghost", size: "icon" }), "h-8 w-8"),
5992
5992
  onClick: j ? Js : Pa,
5993
5993
  "aria-label": j ? I ? "Maximize" : "Minimize" : "Close sidebar",
5994
- children: j ? I ? /* @__PURE__ */ f(Ya, { className: "h-4 w-4" }) : /* @__PURE__ */ f(Ga, { className: "h-4 w-4" }) : /* @__PURE__ */ f(tn, { className: "h-4 w-4" })
5994
+ children: j ? I ? /* @__PURE__ */ f(Ya, { className: "h-4 w-4" }) : /* @__PURE__ */ f(Ga, { className: "h-4 w-4" }) : /* @__PURE__ */ f(Qe, { className: "h-4 w-4" })
5995
5995
  }
5996
5996
  ) }),
5997
5997
  /* @__PURE__ */ f(Wt, { children: j ? I ? "Maximize window" : "Minimize to header" : "Close the chat" })
@@ -6001,27 +6001,27 @@ function bf({
6001
6001
  }
6002
6002
  ),
6003
6003
  !I && /* @__PURE__ */ A(ee, { children: [
6004
- y && gn.length > 0 && /* @__PURE__ */ A("div", { className: `border-b border-border ${Qt ? "flex flex-col flex-1" : ""}`, children: [
6004
+ y && gn.length > 0 && /* @__PURE__ */ A("div", { className: `border-b border-border ${te ? "flex flex-col flex-1" : ""}`, children: [
6005
6005
  /* @__PURE__ */ A("div", { className: "flex items-center justify-between px-3 py-1", children: [
6006
6006
  /* @__PURE__ */ f("h3", { className: "text-xs font-semibold text-muted-foreground", children: "Recent chats" }),
6007
6007
  /* @__PURE__ */ f(
6008
- Pe,
6008
+ tn,
6009
6009
  {
6010
6010
  variant: "ghost",
6011
6011
  className: "h-auto px-2 py-1 text-xs text-muted-foreground hover:text-foreground",
6012
6012
  onClick: () => {
6013
- Qt || Gs(), Fe(!Qt);
6013
+ te || Gs(), je(!te);
6014
6014
  },
6015
- children: Qt ? "Show less" : "View all"
6015
+ children: te ? "Show less" : "View all"
6016
6016
  }
6017
6017
  )
6018
6018
  ] }),
6019
- /* @__PURE__ */ f("div", { className: `px-2 pb-2 space-y-0.5 ${Qt ? "flex-1 overflow-y-auto" : ""}`, children: gn.slice(0, Qt ? void 0 : 3).map((p) => /* @__PURE__ */ A("div", { className: "group relative", children: [
6019
+ /* @__PURE__ */ f("div", { className: `px-2 pb-2 space-y-0.5 ${te ? "flex-1 overflow-y-auto" : ""}`, children: gn.slice(0, te ? void 0 : 3).map((p) => /* @__PURE__ */ A("div", { className: "group relative", children: [
6020
6020
  /* @__PURE__ */ A(
6021
- Pe,
6021
+ "button",
6022
6022
  {
6023
- variant: "ghost",
6024
- className: "w-full justify-between h-auto py-1 px-3 font-normal",
6023
+ type: "button",
6024
+ className: J(Kt({ variant: "ghost" }), "w-full justify-between h-auto py-1 px-3 font-normal"),
6025
6025
  onClick: () => ba(p),
6026
6026
  children: [
6027
6027
  /* @__PURE__ */ f("span", { className: "text-xs truncate", children: p.title }),
@@ -6038,7 +6038,7 @@ function bf({
6038
6038
  S.stopPropagation(), xa(p._id);
6039
6039
  },
6040
6040
  "aria-label": "Delete conversation",
6041
- children: /* @__PURE__ */ f(tn, { className: "h-3 w-3" })
6041
+ children: /* @__PURE__ */ f(Qe, { className: "h-3 w-3" })
6042
6042
  }
6043
6043
  )
6044
6044
  ] }, p._id)) })
@@ -6055,7 +6055,7 @@ function bf({
6055
6055
  variant: "secondary",
6056
6056
  className: "cursor-pointer text-xs px-2 py-1 hover:bg-stone-200 dark:hover:bg-stone-700 transition-colors",
6057
6057
  onClick: () => {
6058
- R(p.sampleUsage), Jt.current?.focus();
6058
+ R(p.sampleUsage), Qt.current?.focus();
6059
6059
  },
6060
6060
  children: p.friendlyName
6061
6061
  }
@@ -6133,7 +6133,7 @@ function bf({
6133
6133
  }
6134
6134
  ) : /* @__PURE__ */ f("div", { className: "space-y-2", children: p.parts.map((T, _) => {
6135
6135
  if (T.type?.startsWith("tool-")) {
6136
- const B = T.type?.replace("tool-", "") || "", kt = Ks.find((Q) => Q.name === B), bt = T.state === "input-available", Et = T.state === "output-available";
6136
+ const B = T.type?.replace("tool-", "") || "", kt = Ks.find((tt) => tt.name === B), bt = T.state === "input-available", Et = T.state === "output-available";
6137
6137
  if (bt)
6138
6138
  return Xs.has(B) ? ((async () => {
6139
6139
  if (fn.has(T.toolCallId))
@@ -6157,7 +6157,7 @@ function bf({
6157
6157
  }), console.log("Safe tool error result added:", T.toolCallId);
6158
6158
  }
6159
6159
  })(), null) : /* @__PURE__ */ f(
6160
- Xe,
6160
+ He,
6161
6161
  {
6162
6162
  initial: { opacity: 0, y: 10, filter: "blur(4px)" },
6163
6163
  animate: { opacity: 1, y: 0, filter: "blur(0px)" },
@@ -6174,10 +6174,10 @@ function bf({
6174
6174
  return;
6175
6175
  }
6176
6176
  mn((wt) => new Set(wt).add(T.toolCallId));
6177
- const Q = Hs.get(B);
6178
- if (Q)
6177
+ const tt = Hs.get(B);
6178
+ if (tt)
6179
6179
  try {
6180
- const wt = await Q(...Object.values(T.input || {}));
6180
+ const wt = await tt(...Object.values(T.input || {}));
6181
6181
  ye({
6182
6182
  toolCallId: T.toolCallId,
6183
6183
  tool: B,
@@ -6196,7 +6196,7 @@ function bf({
6196
6196
  console.log("Tool call already being processed:", T.toolCallId);
6197
6197
  return;
6198
6198
  }
6199
- mn((Q) => new Set(Q).add(T.toolCallId)), ye({
6199
+ mn((tt) => new Set(tt).add(T.toolCallId)), ye({
6200
6200
  toolCallId: T.toolCallId,
6201
6201
  tool: B,
6202
6202
  output: "User denied tool execution"
@@ -6208,13 +6208,13 @@ function bf({
6208
6208
  `${T.toolCallId}-${_}`
6209
6209
  );
6210
6210
  if (Et) {
6211
- const Q = T.output === "User denied tool execution";
6211
+ const tt = T.output === "User denied tool execution";
6212
6212
  return /* @__PURE__ */ f(
6213
6213
  Xh,
6214
6214
  {
6215
6215
  toolName: B,
6216
6216
  args: T.input || {},
6217
- isDenied: Q,
6217
+ isDenied: tt,
6218
6218
  isSafe: Xs.has(B)
6219
6219
  },
6220
6220
  `${T.toolCallId}-${_}`
@@ -6248,7 +6248,7 @@ function bf({
6248
6248
  p.id
6249
6249
  );
6250
6250
  }),
6251
- /* @__PURE__ */ f("div", { ref: Zt })
6251
+ /* @__PURE__ */ f("div", { ref: Jt })
6252
6252
  ] }) }),
6253
6253
  qs && /* @__PURE__ */ A("div", { className: "px-4 py-2 bg-destructive/10 text-destructive text-xs", children: [
6254
6254
  "Error: ",
@@ -6256,7 +6256,7 @@ function bf({
6256
6256
  ] }),
6257
6257
  /* @__PURE__ */ A("div", { className: "p-4 border-t border-border relative overflow-visible", children: [
6258
6258
  /* @__PURE__ */ f(au, { mode: "wait", children: (xt === "streaming" || xt === "submitted") && /* @__PURE__ */ A(
6259
- Xe,
6259
+ He,
6260
6260
  {
6261
6261
  initial: { opacity: 0, filter: "blur(4px)", y: 5 },
6262
6262
  animate: { opacity: 1, filter: "blur(0px)", y: 0 },
@@ -6268,7 +6268,7 @@ function bf({
6268
6268
  className: "absolute left-1/2 -translate-x-1/2 -top-6 flex items-center gap-1.5 bg-stone-100 dark:bg-stone-800 px-3 py-1.5 rounded-full shadow-lg border border-border z-50",
6269
6269
  children: [
6270
6270
  /* @__PURE__ */ f(
6271
- Xe,
6271
+ He,
6272
6272
  {
6273
6273
  className: "w-2 h-2 bg-stone-400 dark:bg-stone-600",
6274
6274
  animate: {
@@ -6292,7 +6292,7 @@ function bf({
6292
6292
  /* @__PURE__ */ f(
6293
6293
  Ar,
6294
6294
  {
6295
- ref: Jt,
6295
+ ref: Qt,
6296
6296
  value: k,
6297
6297
  onChange: Aa,
6298
6298
  placeholder: "Ask anything..",
@@ -6309,8 +6309,8 @@ function bf({
6309
6309
  "button",
6310
6310
  {
6311
6311
  type: "button",
6312
- className: tt(te({ variant: "ghost", size: "icon" }), "absolute top-1/2 -translate-y-1/2 right-2 h-8 w-8"),
6313
- onClick: ze,
6312
+ className: J(Kt({ variant: "ghost", size: "icon" }), "absolute top-1/2 -translate-y-1/2 right-2 h-8 w-8"),
6313
+ onClick: $e,
6314
6314
  children: /* @__PURE__ */ f(qa, { className: "h-4 w-4" })
6315
6315
  }
6316
6316
  ) }),
@@ -6323,7 +6323,7 @@ function bf({
6323
6323
  "button",
6324
6324
  {
6325
6325
  type: "submit",
6326
- className: tt(te({ variant: "ghost", size: "icon" }), "absolute top-1/2 -translate-y-1/2 right-2 h-8 w-8"),
6326
+ className: J(Kt({ variant: "ghost", size: "icon" }), "absolute top-1/2 -translate-y-1/2 right-2 h-8 w-8"),
6327
6327
  disabled: !k.trim(),
6328
6328
  children: /* @__PURE__ */ f(Za, { className: "h-4 w-4" })
6329
6329
  }
@@ -6478,7 +6478,7 @@ function wf({
6478
6478
  ...R,
6479
6479
  headers: Y
6480
6480
  });
6481
- }), { messages: I, sendMessage: at, status: X, error: Ct, stop: Oe, addToolResult: Vt, setMessages: jt } = wr({
6481
+ }), { messages: I, sendMessage: at, status: X, error: Ct, stop: Le, addToolResult: Vt, setMessages: jt } = wr({
6482
6482
  id: V || void 0,
6483
6483
  messages: l,
6484
6484
  transport: new Sr({
@@ -6547,7 +6547,7 @@ function wf({
6547
6547
  });
6548
6548
  }
6549
6549
  }, [X, I, Ct, d]);
6550
- async function je() {
6550
+ async function Oe() {
6551
6551
  if (!(!i?.id || !m)) {
6552
6552
  console.log("[useAgent] Fetching conversations for user:", i?.id), O(!0);
6553
6553
  try {
@@ -6565,7 +6565,7 @@ function wf({
6565
6565
  }
6566
6566
  }
6567
6567
  $(() => {
6568
- i?.id && m && je();
6568
+ i?.id && m && Oe();
6569
6569
  }, [JSON.stringify(i), m, t]);
6570
6570
  async function dn(k) {
6571
6571
  C(k), O(!0);
@@ -6593,16 +6593,16 @@ function wf({
6593
6593
  headers: {
6594
6594
  Authorization: `Bearer ${m}`
6595
6595
  }
6596
- }), E(P.filter((R) => R._id !== k)), k === V && Zt();
6596
+ }), E(P.filter((R) => R._id !== k)), k === V && Jt();
6597
6597
  } catch (R) {
6598
6598
  console.error("Failed to delete conversation:", R);
6599
6599
  }
6600
6600
  }
6601
- function Zt() {
6601
+ function Jt() {
6602
6602
  const k = crypto.randomUUID();
6603
6603
  C(k), jt([]), St(/* @__PURE__ */ new Set());
6604
6604
  }
6605
- function Jt(k) {
6605
+ function Qt(k) {
6606
6606
  Vt(k);
6607
6607
  }
6608
6608
  return {
@@ -6611,13 +6611,13 @@ function wf({
6611
6611
  status: X,
6612
6612
  error: Ct,
6613
6613
  sendMessage: at,
6614
- stop: Oe,
6615
- addToolOutput: Jt,
6614
+ stop: Le,
6615
+ addToolOutput: Qt,
6616
6616
  setMessages: jt,
6617
6617
  conversations: P,
6618
6618
  loadConversation: dn,
6619
6619
  deleteConversation: hn,
6620
- startNewConversation: Zt,
6620
+ startNewConversation: Jt,
6621
6621
  isLoadingConversations: z,
6622
6622
  clientToken: m,
6623
6623
  tokenError: x