react-ai-avatar 0.1.0 → 0.1.2

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/lib/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import le, { useRef as O, useEffect as ee, useId as xe, useState as ce, Suspense as he } from "react";
3
- import { u as se, c as de, a as we } from "./useReducedMotion-BDcEizfP.js";
4
- import { S as He, i as Ke } from "./useReducedMotion-BDcEizfP.js";
5
- import { useMotionValue as pe, motion as ae } from "motion/react";
6
- const ve = {
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import le, { useRef as O, useEffect as ee, useId as xe, useState as ae, Suspense as he } from "react";
3
+ import { u as se, c as de, a as Me } from "./useReducedMotion-BDcEizfP.js";
4
+ import { S as et, i as tt } from "./useReducedMotion-BDcEizfP.js";
5
+ import { motion as ce, useMotionValue as pe } from "motion/react";
6
+ const Ae = {
7
7
  idle: "#4b5563",
8
8
  listening: "#3b82f6",
9
9
  thinking: "#8b5cf6",
10
10
  speaking: "#10b981",
11
11
  working: "#f59e0b"
12
12
  };
13
- function Me(i, n) {
14
- const l = se(), o = O(n);
15
- o.current = n;
13
+ function Ne(i, r) {
14
+ const l = se(), c = O(r);
15
+ c.current = r;
16
16
  const a = O({ x: 0, y: 0 });
17
17
  ee(() => {
18
18
  if (l) return;
@@ -23,59 +23,59 @@ function Me(i, n) {
23
23
  }, [l]), ee(() => {
24
24
  const t = i.current;
25
25
  if (t === null || typeof window > "u") return;
26
- const d = (A, D) => D > 0 ? Math.round(A / D) * D : A;
27
- let s = null, h = null, p = null, g = [], r = [], z = [], S = !1, T = 3, V = 9, w = 0, m = 1, F = [], f = [], k = [];
26
+ const d = (A, P) => P > 0 ? Math.round(A / P) * P : A;
27
+ let s = null, h = null, p = null, g = [], n = [], _ = [], W = !1, B = 3, V = 9, w = 0, m = 1, F = [], f = [], k = [];
28
28
  const M = () => {
29
- var $;
30
- s = t.querySelector("#rra-ring"), h = t.querySelector("#rra-mouth"), p = t.querySelector("#rra-think"), g = p ? Array.from(p.querySelectorAll("circle, rect")) : [], r = Array.from(t.querySelectorAll(".rra-pupil")), z = Array.from(t.querySelectorAll(".rra-lid")), S = (h == null ? void 0 : h.tagName.toLowerCase()) === "rect", T = h ? parseFloat(h.getAttribute(S ? "height" : "ry") ?? "3") : 3, V = h ? parseFloat(h.getAttribute(S ? "width" : "rx") ?? "9") : 9, w = h ? parseFloat(h.getAttribute("data-quantize") ?? "0") : 0, F = r.map((Q) => {
31
- const Z = Q.tagName.toLowerCase() === "rect";
29
+ var R;
30
+ s = t.querySelector("#rra-ring"), h = t.querySelector("#rra-mouth"), p = t.querySelector("#rra-think"), g = p ? Array.from(p.querySelectorAll("circle, rect")) : [], n = Array.from(t.querySelectorAll(".rra-pupil")), _ = Array.from(t.querySelectorAll(".rra-lid")), W = (h == null ? void 0 : h.tagName.toLowerCase()) === "rect", B = h ? parseFloat(h.getAttribute(W ? "height" : "ry") ?? "3") : 3, V = h ? parseFloat(h.getAttribute(W ? "width" : "rx") ?? "9") : 9, w = h ? parseFloat(h.getAttribute("data-quantize") ?? "0") : 0, F = n.map((S) => {
31
+ const D = S.tagName.toLowerCase() === "rect";
32
32
  return {
33
- isRect: Z,
34
- x: parseFloat(Q.getAttribute("data-base-x") ?? Q.getAttribute(Z ? "x" : "cx") ?? "0"),
35
- y: parseFloat(Q.getAttribute("data-base-y") ?? Q.getAttribute(Z ? "y" : "cy") ?? "0"),
36
- quantize: parseFloat(Q.getAttribute("data-quantize") ?? "0")
33
+ isRect: D,
34
+ x: parseFloat(S.getAttribute("data-base-x") ?? S.getAttribute(D ? "x" : "cx") ?? "0"),
35
+ y: parseFloat(S.getAttribute("data-base-y") ?? S.getAttribute(D ? "y" : "cy") ?? "0"),
36
+ quantize: parseFloat(S.getAttribute("data-quantize") ?? "0")
37
37
  };
38
- }), f = z.map((Q) => parseFloat(Q.getAttribute("data-max-height") ?? "16")), k = r.map(() => ({ x: 0, y: 0 }));
39
- const A = t.querySelector("svg"), D = parseFloat((($ = A == null ? void 0 : A.getAttribute("viewBox")) == null ? void 0 : $.split(/[\s,]+/)[2]) ?? "200");
40
- m = D > 0 ? D / 200 : 1;
38
+ }), f = _.map((S) => parseFloat(S.getAttribute("data-max-height") ?? "16")), k = n.map(() => ({ x: 0, y: 0 }));
39
+ const A = t.querySelector("svg"), P = parseFloat(((R = A == null ? void 0 : A.getAttribute("viewBox")) == null ? void 0 : R.split(/[\s,]+/)[2]) ?? "200");
40
+ m = P > 0 ? P / 200 : 1;
41
41
  }, y = () => (h ? !h.isConnected : t.querySelector("#rra-mouth") !== null) || (s ? !s.isConnected : t.querySelector("#rra-ring") !== null);
42
42
  M();
43
- let N = null, J = null, v = !1, u = 0, W = 1, I = 1, R = 1500 + Math.random() * 2e3, C = 0, x = !1, q = 0, H = 0, U = 0, P = performance.now();
43
+ let L = null, J = null, v = !1, u = 0, Q = 1, z = 1, $ = 1500 + Math.random() * 2e3, C = 0, x = !1, q = 0, H = 0, U = 0, I = performance.now();
44
44
  const K = (A) => {
45
- const D = Math.min(100, A - P);
46
- P = A, y() && M();
47
- const $ = o.current, { state: Q } = $, Z = { ...ve, ...$.stateColors }, G = ($.maxMouthOpening ?? 30) * m, Y = l ? 0 : $.mouseTrackingIntensity ?? 1, X = $.blinkIntervalMin ?? 2e3, ie = $.blinkIntervalMax ?? 6e3, te = $.blinkDuration ?? 100;
48
- if (s == null || s.setAttribute("stroke", Z[Q]), h) {
49
- const L = Q === "speaking";
50
- L && (!v || J !== $.analyser) && (N = de($.analyser), J = $.analyser, v = !0), L || (v = !1);
51
- let b = 0, E = 1, B = 1;
52
- if (L && N) {
53
- const j = N.read();
54
- b = j.level, j.shape === "e" ? (E = 1.35, B = 0.55) : j.shape === "o" && (E = 0.65, B = 1.35);
45
+ const P = Math.min(100, A - I);
46
+ I = A, y() && M();
47
+ const R = c.current, { state: S } = R, D = { ...Ae, ...R.stateColors }, G = (R.maxMouthOpening ?? 30) * m, Y = l ? 0 : R.mouseTrackingIntensity ?? 1, X = R.blinkIntervalMin ?? 2e3, ie = R.blinkIntervalMax ?? 6e3, te = R.blinkDuration ?? 100;
48
+ if (s == null || s.setAttribute("stroke", D[S]), h) {
49
+ const N = S === "speaking";
50
+ N && (!v || J !== R.analyser) && (L = de(R.analyser), J = R.analyser, v = !0), N || (v = !1);
51
+ let b = 0, E = 1, T = 1;
52
+ if (N && L) {
53
+ const Z = L.read();
54
+ b = Z.level, Z.shape === "e" ? (E = 1.35, T = 0.55) : Z.shape === "o" && (E = 0.65, T = 1.35);
55
55
  }
56
- if (u += (b - u) * 0.3, W += (E - W) * 0.25, I += (B - I) * 0.25, S) {
57
- const j = d(T + u * I * G * 0.4, w);
58
- h.setAttribute("height", String(Math.max(T, j)));
56
+ if (u += (b - u) * 0.3, Q += (E - Q) * 0.25, z += (T - z) * 0.25, W) {
57
+ const Z = d(B + u * z * G * 0.4, w);
58
+ h.setAttribute("height", String(Math.max(B, Z)));
59
59
  } else
60
- h.setAttribute("ry", String(T + u * I * G * 0.4)), h.setAttribute("rx", String(V * (1 + (W - 1) * Math.min(1, u * 2))));
60
+ h.setAttribute("ry", String(B + u * z * G * 0.4)), h.setAttribute("rx", String(V * (1 + (Q - 1) * Math.min(1, u * 2))));
61
61
  }
62
- if (!l && z.length > 0) {
63
- x ? (C += D / te, C >= 2 && (x = !1, C = 0, R = X + Math.random() * Math.max(0, ie - X))) : (R -= D, R <= 0 && (x = !0, C = 0));
64
- const L = x ? 1 - Math.abs(1 - Math.min(2, C)) : 0;
65
- z.forEach((b, E) => b.setAttribute("height", String(L * f[E])));
62
+ if (!l && _.length > 0) {
63
+ x ? (C += P / te, C >= 2 && (x = !1, C = 0, $ = X + Math.random() * Math.max(0, ie - X))) : ($ -= P, $ <= 0 && (x = !0, C = 0));
64
+ const N = x ? 1 - Math.abs(1 - Math.min(2, C)) : 0;
65
+ _.forEach((b, E) => b.setAttribute("height", String(N * f[E])));
66
66
  }
67
- if (r.length > 0) {
68
- let L = a.current.x * 3 * Y, b = a.current.y * 2.2 * Y;
69
- Q === "thinking" ? (L = -2.5, b = -3) : Q === "working" ? (L = 0, b = 3.5) : Q === "listening" && !l && (L += Math.sin(A * 21e-4) * 0.5, b += Math.cos(A * 17e-4) * 0.4), L *= m, b *= m, r.forEach((E, B) => {
70
- const j = F[B];
71
- k[B].x += (L - k[B].x) * 0.12, k[B].y += (b - k[B].y) * 0.12;
72
- const re = j.x + d(k[B].x, j.quantize), ne = j.y + d(k[B].y, j.quantize);
73
- j.isRect ? (E.setAttribute("x", String(re)), E.setAttribute("y", String(ne))) : (E.setAttribute("cx", String(re)), E.setAttribute("cy", String(ne)));
67
+ if (n.length > 0) {
68
+ let N = a.current.x * 3 * Y, b = a.current.y * 2.2 * Y;
69
+ S === "thinking" ? (N = -2.5, b = -3) : S === "working" ? (N = 0, b = 3.5) : S === "listening" && !l && (N += Math.sin(A * 21e-4) * 0.5, b += Math.cos(A * 17e-4) * 0.4), N *= m, b *= m, n.forEach((E, T) => {
70
+ const Z = F[T];
71
+ k[T].x += (N - k[T].x) * 0.12, k[T].y += (b - k[T].y) * 0.12;
72
+ const re = Z.x + d(k[T].x, Z.quantize), ne = Z.y + d(k[T].y, Z.quantize);
73
+ Z.isRect ? (E.setAttribute("x", String(re)), E.setAttribute("y", String(ne))) : (E.setAttribute("cx", String(re)), E.setAttribute("cy", String(ne)));
74
74
  });
75
75
  }
76
- p && (q += ((Q === "thinking" ? 1 : 0) - q) * 0.12, p.setAttribute("opacity", String(q < 0.01 ? 0 : q)), Q === "thinking" && !l ? (H += D * 4e-3, g.forEach((b, E) => {
77
- const B = 0.35 + 0.65 * Math.max(0, Math.sin(H - E * 0.9));
78
- b.setAttribute("opacity", String(B));
76
+ p && (q += ((S === "thinking" ? 1 : 0) - q) * 0.12, p.setAttribute("opacity", String(q < 0.01 ? 0 : q)), S === "thinking" && !l ? (H += P * 4e-3, g.forEach((b, E) => {
77
+ const T = 0.35 + 0.65 * Math.max(0, Math.sin(H - E * 0.9));
78
+ b.setAttribute("opacity", String(T));
79
79
  })) : g.forEach((b) => b.setAttribute("opacity", "1"))), U = requestAnimationFrame(K);
80
80
  };
81
81
  return U = requestAnimationFrame(K), () => cancelAnimationFrame(U);
@@ -83,9 +83,9 @@ function Me(i, n) {
83
83
  }
84
84
  function ue({
85
85
  state: i,
86
- analyser: n,
86
+ analyser: r,
87
87
  size: l = 300,
88
- className: o = "",
88
+ className: c = "",
89
89
  style: a,
90
90
  maxMouthOpening: t,
91
91
  mouseTrackingIntensity: d,
@@ -93,12 +93,12 @@ function ue({
93
93
  blinkIntervalMax: h,
94
94
  blinkDuration: p,
95
95
  stateColors: g,
96
- children: r
96
+ children: n
97
97
  }) {
98
- const z = O(null);
99
- return Me(z, {
98
+ const _ = O(null);
99
+ return Ne(_, {
100
100
  state: i,
101
- analyser: n,
101
+ analyser: r,
102
102
  stateColors: g,
103
103
  maxMouthOpening: t,
104
104
  mouseTrackingIntensity: d,
@@ -108,18 +108,18 @@ function ue({
108
108
  }), /* @__PURE__ */ e(
109
109
  "div",
110
110
  {
111
- ref: z,
112
- className: `relative flex items-center justify-center ${o}`,
111
+ ref: _,
112
+ className: `relative flex items-center justify-center ${c}`,
113
113
  style: { width: l, height: l, ...a },
114
- children: r
114
+ children: n
115
115
  }
116
116
  );
117
117
  }
118
118
  function ge({
119
119
  size: i = 300,
120
- customization: n,
120
+ customization: r,
121
121
  mouthColor: l = "#7a3b2e",
122
- className: o,
122
+ className: c,
123
123
  style: a
124
124
  }) {
125
125
  const {
@@ -129,11 +129,11 @@ function ge({
129
129
  hoodieColor: h = "#3a3e45",
130
130
  bgColor: p = "#88c0b7",
131
131
  glasses: g = !0,
132
- glassesColor: r = "#2c2c2c",
133
- headphones: z = !0,
134
- headphonesColor: S = "#3a3b40"
135
- } = n ?? {};
136
- return /* @__PURE__ */ c(
132
+ glassesColor: n = "#2c2c2c",
133
+ headphones: _ = !0,
134
+ headphonesColor: W = "#3a3b40"
135
+ } = r ?? {};
136
+ return /* @__PURE__ */ o(
137
137
  "svg",
138
138
  {
139
139
  viewBox: "0 0 200 200",
@@ -142,40 +142,40 @@ function ge({
142
142
  xmlns: "http://www.w3.org/2000/svg",
143
143
  role: "img",
144
144
  "aria-label": "Avatar",
145
- className: o,
145
+ className: c,
146
146
  style: a,
147
147
  children: [
148
148
  /* @__PURE__ */ e("circle", { cx: "100", cy: "100", r: "78", fill: p }),
149
149
  /* @__PURE__ */ e("clipPath", { id: "rra-clip", children: /* @__PURE__ */ e("circle", { cx: "100", cy: "100", r: "78" }) }),
150
- /* @__PURE__ */ c("g", { clipPath: "url(#rra-clip)", children: [
150
+ /* @__PURE__ */ o("g", { clipPath: "url(#rra-clip)", children: [
151
151
  /* @__PURE__ */ e("rect", { id: "rra-clothing", x: "48", y: "150", width: "104", height: "60", rx: "20", fill: s }),
152
152
  /* @__PURE__ */ e("path", { id: "rra-hoodie", d: "M52 168 Q52 140 100 140 Q148 140 148 168 L148 210 L52 210 Z", fill: h }),
153
153
  /* @__PURE__ */ e("rect", { id: "rra-neck", x: "88", y: "120", width: "24", height: "28", rx: "10", fill: t, opacity: "0.85" }),
154
154
  /* @__PURE__ */ e("ellipse", { id: "rra-head", cx: "100", cy: "92", rx: "42", ry: "46", fill: t }),
155
155
  /* @__PURE__ */ e("path", { id: "rra-hair", d: "M58 88 Q56 44 100 44 Q144 44 142 88 Q142 70 128 62 Q120 76 100 74 Q80 76 72 62 Q58 70 58 88 Z", fill: d }),
156
- z && /* @__PURE__ */ c("g", { id: "rra-headphones", children: [
157
- /* @__PURE__ */ e("rect", { x: "50", y: "84", width: "12", height: "26", rx: "6", fill: S }),
158
- /* @__PURE__ */ e("rect", { x: "138", y: "84", width: "12", height: "26", rx: "6", fill: S }),
159
- /* @__PURE__ */ e("path", { d: "M56 90 Q56 50 100 50 Q144 50 144 90", fill: "none", stroke: S, strokeWidth: "7", strokeLinecap: "round" })
156
+ _ && /* @__PURE__ */ o("g", { id: "rra-headphones", children: [
157
+ /* @__PURE__ */ e("rect", { x: "50", y: "84", width: "12", height: "26", rx: "6", fill: W }),
158
+ /* @__PURE__ */ e("rect", { x: "138", y: "84", width: "12", height: "26", rx: "6", fill: W }),
159
+ /* @__PURE__ */ e("path", { d: "M56 90 Q56 50 100 50 Q144 50 144 90", fill: "none", stroke: W, strokeWidth: "7", strokeLinecap: "round" })
160
160
  ] }),
161
- /* @__PURE__ */ c("g", { id: "rra-eyeL", children: [
161
+ /* @__PURE__ */ o("g", { id: "rra-eyeL", children: [
162
162
  /* @__PURE__ */ e("ellipse", { cx: "84", cy: "90", rx: "9", ry: "7", fill: "#ffffff" }),
163
163
  /* @__PURE__ */ e("circle", { className: "rra-pupil", "data-base-x": "84", "data-base-y": "90", cx: "84", cy: "90", r: "4", fill: "#2c2c2c" }),
164
164
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "17", x: "74", y: "80", width: "20", height: "0", fill: t })
165
165
  ] }),
166
- /* @__PURE__ */ c("g", { id: "rra-eyeR", children: [
166
+ /* @__PURE__ */ o("g", { id: "rra-eyeR", children: [
167
167
  /* @__PURE__ */ e("ellipse", { cx: "116", cy: "90", rx: "9", ry: "7", fill: "#ffffff" }),
168
168
  /* @__PURE__ */ e("circle", { className: "rra-pupil", "data-base-x": "116", "data-base-y": "90", cx: "116", cy: "90", r: "4", fill: "#2c2c2c" }),
169
169
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "17", x: "106", y: "80", width: "20", height: "0", fill: t })
170
170
  ] }),
171
- g && /* @__PURE__ */ c("g", { id: "rra-glasses", children: [
172
- /* @__PURE__ */ e("rect", { x: "72", y: "82", width: "24", height: "16", rx: "6", fill: "none", stroke: r, strokeWidth: "2.5" }),
173
- /* @__PURE__ */ e("rect", { x: "104", y: "82", width: "24", height: "16", rx: "6", fill: "none", stroke: r, strokeWidth: "2.5" }),
174
- /* @__PURE__ */ e("line", { x1: "96", y1: "90", x2: "104", y2: "90", stroke: r, strokeWidth: "2.5" })
171
+ g && /* @__PURE__ */ o("g", { id: "rra-glasses", children: [
172
+ /* @__PURE__ */ e("rect", { x: "72", y: "82", width: "24", height: "16", rx: "6", fill: "none", stroke: n, strokeWidth: "2.5" }),
173
+ /* @__PURE__ */ e("rect", { x: "104", y: "82", width: "24", height: "16", rx: "6", fill: "none", stroke: n, strokeWidth: "2.5" }),
174
+ /* @__PURE__ */ e("line", { x1: "96", y1: "90", x2: "104", y2: "90", stroke: n, strokeWidth: "2.5" })
175
175
  ] }),
176
176
  /* @__PURE__ */ e("ellipse", { id: "rra-mouth", cx: "100", cy: "112", rx: "9", ry: "3", fill: l })
177
177
  ] }),
178
- /* @__PURE__ */ c("g", { id: "rra-think", opacity: "0", children: [
178
+ /* @__PURE__ */ o("g", { id: "rra-think", opacity: "0", children: [
179
179
  /* @__PURE__ */ e("circle", { cx: "150", cy: "56", r: "4", fill: "#8b5cf6" }),
180
180
  /* @__PURE__ */ e("circle", { cx: "164", cy: "44", r: "5.5", fill: "#8b5cf6" }),
181
181
  /* @__PURE__ */ e("circle", { cx: "181", cy: "30", r: "7", fill: "#8b5cf6" })
@@ -184,18 +184,18 @@ function ge({
184
184
  }
185
185
  );
186
186
  }
187
- function Ae({
187
+ function Le({
188
188
  size: i = 300,
189
- customization: n,
189
+ customization: r,
190
190
  className: l,
191
- style: o
191
+ style: c
192
192
  }) {
193
193
  const {
194
194
  skinColor: a = "#f6c8a8",
195
195
  hairColor: t = "#5b3a23",
196
196
  bgColor: d = "#dbe7f4"
197
- } = n ?? {}, s = xe().replace(/[^a-zA-Z0-9]/g, ""), h = `rra-skin-${s}`, p = `rra-bg-${s}`, g = `rra-hair-${s}`, r = `rra-mouthg-${s}`;
198
- return /* @__PURE__ */ c(
197
+ } = r ?? {}, s = xe().replace(/[^a-zA-Z0-9]/g, ""), h = `rra-skin-${s}`, p = `rra-bg-${s}`, g = `rra-hair-${s}`, n = `rra-mouthg-${s}`;
198
+ return /* @__PURE__ */ o(
199
199
  "svg",
200
200
  {
201
201
  viewBox: "0 0 200 200",
@@ -205,30 +205,30 @@ function Ae({
205
205
  role: "img",
206
206
  "aria-label": "Avatar",
207
207
  className: l,
208
- style: o,
208
+ style: c,
209
209
  children: [
210
- /* @__PURE__ */ c("defs", { children: [
211
- /* @__PURE__ */ c("radialGradient", { id: h, cx: "0.38", cy: "0.32", r: "0.85", children: [
210
+ /* @__PURE__ */ o("defs", { children: [
211
+ /* @__PURE__ */ o("radialGradient", { id: h, cx: "0.38", cy: "0.32", r: "0.85", children: [
212
212
  /* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#ffffff", stopOpacity: "0.55" }),
213
213
  /* @__PURE__ */ e("stop", { offset: "35%", stopColor: a }),
214
214
  /* @__PURE__ */ e("stop", { offset: "100%", stopColor: a, stopOpacity: "1" })
215
215
  ] }),
216
- /* @__PURE__ */ c("radialGradient", { id: p, cx: "0.5", cy: "0.35", r: "0.9", children: [
216
+ /* @__PURE__ */ o("radialGradient", { id: p, cx: "0.5", cy: "0.35", r: "0.9", children: [
217
217
  /* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#ffffff", stopOpacity: "0.9" }),
218
218
  /* @__PURE__ */ e("stop", { offset: "100%", stopColor: d })
219
219
  ] }),
220
- /* @__PURE__ */ c("linearGradient", { id: g, x1: "0", y1: "0", x2: "0", y2: "1", children: [
220
+ /* @__PURE__ */ o("linearGradient", { id: g, x1: "0", y1: "0", x2: "0", y2: "1", children: [
221
221
  /* @__PURE__ */ e("stop", { offset: "0%", stopColor: t, stopOpacity: "0.85" }),
222
222
  /* @__PURE__ */ e("stop", { offset: "100%", stopColor: t })
223
223
  ] }),
224
- /* @__PURE__ */ c("linearGradient", { id: r, x1: "0", y1: "0", x2: "0", y2: "1", children: [
224
+ /* @__PURE__ */ o("linearGradient", { id: n, x1: "0", y1: "0", x2: "0", y2: "1", children: [
225
225
  /* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#7c2f33" }),
226
226
  /* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#52181c" })
227
227
  ] })
228
228
  ] }),
229
229
  /* @__PURE__ */ e("circle", { cx: "100", cy: "100", r: "78", fill: `url(#${p})` }),
230
230
  /* @__PURE__ */ e("clipPath", { id: `rra-memoji-clip-${s}`, children: /* @__PURE__ */ e("circle", { cx: "100", cy: "100", r: "78" }) }),
231
- /* @__PURE__ */ c("g", { clipPath: `url(#rra-memoji-clip-${s})`, children: [
231
+ /* @__PURE__ */ o("g", { clipPath: `url(#rra-memoji-clip-${s})`, children: [
232
232
  /* @__PURE__ */ e("rect", { x: "86", y: "128", width: "28", height: "30", rx: "12", fill: a }),
233
233
  /* @__PURE__ */ e("ellipse", { cx: "100", cy: "178", rx: "52", ry: "28", fill: "#ffffff", opacity: "0.85" }),
234
234
  /* @__PURE__ */ e("ellipse", { id: "rra-head", cx: "100", cy: "94", rx: "44", ry: "48", fill: `url(#${h})` }),
@@ -245,13 +245,13 @@ function Ae({
245
245
  ),
246
246
  /* @__PURE__ */ e("path", { d: "M70 76 Q82 70 92 75", fill: "none", stroke: t, strokeWidth: "4", strokeLinecap: "round", opacity: "0.9" }),
247
247
  /* @__PURE__ */ e("path", { d: "M108 75 Q118 70 130 76", fill: "none", stroke: t, strokeWidth: "4", strokeLinecap: "round", opacity: "0.9" }),
248
- /* @__PURE__ */ c("g", { id: "rra-eyeL", children: [
248
+ /* @__PURE__ */ o("g", { id: "rra-eyeL", children: [
249
249
  /* @__PURE__ */ e("ellipse", { cx: "81", cy: "92", rx: "10.5", ry: "8.5", fill: "#ffffff" }),
250
250
  /* @__PURE__ */ e("circle", { className: "rra-pupil", "data-base-x": "81", "data-base-y": "92", cx: "81", cy: "92", r: "5", fill: "#3d2c20" }),
251
251
  /* @__PURE__ */ e("circle", { cx: "83", cy: "89.5", r: "1.7", fill: "#ffffff", opacity: "0.95" }),
252
252
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "19", x: "69", y: "82", width: "24", height: "0", rx: "3", fill: a })
253
253
  ] }),
254
- /* @__PURE__ */ c("g", { id: "rra-eyeR", children: [
254
+ /* @__PURE__ */ o("g", { id: "rra-eyeR", children: [
255
255
  /* @__PURE__ */ e("ellipse", { cx: "119", cy: "92", rx: "10.5", ry: "8.5", fill: "#ffffff" }),
256
256
  /* @__PURE__ */ e("circle", { className: "rra-pupil", "data-base-x": "119", "data-base-y": "92", cx: "119", cy: "92", r: "5", fill: "#3d2c20" }),
257
257
  /* @__PURE__ */ e("circle", { cx: "121", cy: "89.5", r: "1.7", fill: "#ffffff", opacity: "0.95" }),
@@ -260,9 +260,9 @@ function Ae({
260
260
  /* @__PURE__ */ e("ellipse", { cx: "70", cy: "108", rx: "8", ry: "4.5", fill: "#e98a7a", opacity: "0.35" }),
261
261
  /* @__PURE__ */ e("ellipse", { cx: "130", cy: "108", rx: "8", ry: "4.5", fill: "#e98a7a", opacity: "0.35" }),
262
262
  /* @__PURE__ */ e("path", { d: "M97 100 Q95 108 100 110 Q105 108 103 100", fill: "none", stroke: "#c98f6f", strokeWidth: "2.5", strokeLinecap: "round", opacity: "0.8" }),
263
- /* @__PURE__ */ e("ellipse", { id: "rra-mouth", cx: "100", cy: "120", rx: "9.5", ry: "3.5", fill: `url(#${r})` })
263
+ /* @__PURE__ */ e("ellipse", { id: "rra-mouth", cx: "100", cy: "120", rx: "9.5", ry: "3.5", fill: `url(#${n})` })
264
264
  ] }),
265
- /* @__PURE__ */ c("g", { id: "rra-think", opacity: "0", children: [
265
+ /* @__PURE__ */ o("g", { id: "rra-think", opacity: "0", children: [
266
266
  /* @__PURE__ */ e("circle", { cx: "150", cy: "56", r: "4", fill: "#8b5cf6" }),
267
267
  /* @__PURE__ */ e("circle", { cx: "164", cy: "44", r: "5.5", fill: "#8b5cf6" }),
268
268
  /* @__PURE__ */ e("circle", { cx: "181", cy: "30", r: "7", fill: "#8b5cf6" })
@@ -271,19 +271,19 @@ function Ae({
271
271
  }
272
272
  );
273
273
  }
274
- function Le({
274
+ function Se({
275
275
  size: i = 300,
276
- customization: n,
276
+ customization: r,
277
277
  className: l,
278
- style: o
278
+ style: c
279
279
  }) {
280
280
  const {
281
281
  skinColor: a = "#f0b58a",
282
282
  hairColor: t = "#3a2a1e",
283
283
  clothingColor: d = "#2f6f8f",
284
284
  bgColor: s = "#9ad1c8"
285
- } = n ?? {};
286
- return /* @__PURE__ */ c(
285
+ } = r ?? {};
286
+ return /* @__PURE__ */ o(
287
287
  "svg",
288
288
  {
289
289
  viewBox: "0 0 32 32",
@@ -293,7 +293,7 @@ function Le({
293
293
  role: "img",
294
294
  "aria-label": "Avatar",
295
295
  className: l,
296
- style: { imageRendering: "pixelated", ...o },
296
+ style: { imageRendering: "pixelated", ...c },
297
297
  shapeRendering: "crispEdges",
298
298
  children: [
299
299
  /* @__PURE__ */ e("rect", { x: "2", y: "2", width: "28", height: "28", fill: s }),
@@ -301,26 +301,26 @@ function Le({
301
301
  /* @__PURE__ */ e("rect", { x: "10", y: "25", width: "12", height: "1", fill: d }),
302
302
  /* @__PURE__ */ e("rect", { x: "14", y: "23", width: "4", height: "3", fill: a }),
303
303
  /* @__PURE__ */ e("rect", { id: "rra-head", x: "9", y: "7", width: "14", height: "16", fill: a }),
304
- /* @__PURE__ */ c("g", { id: "rra-hair", children: [
304
+ /* @__PURE__ */ o("g", { id: "rra-hair", children: [
305
305
  /* @__PURE__ */ e("rect", { x: "8", y: "4", width: "16", height: "4", fill: t }),
306
306
  /* @__PURE__ */ e("rect", { x: "8", y: "8", width: "2", height: "5", fill: t }),
307
307
  /* @__PURE__ */ e("rect", { x: "22", y: "8", width: "2", height: "5", fill: t }),
308
308
  /* @__PURE__ */ e("rect", { x: "11", y: "8", width: "3", height: "1", fill: t }),
309
309
  /* @__PURE__ */ e("rect", { x: "17", y: "8", width: "4", height: "1", fill: t })
310
310
  ] }),
311
- /* @__PURE__ */ c("g", { id: "rra-eyeL", children: [
311
+ /* @__PURE__ */ o("g", { id: "rra-eyeL", children: [
312
312
  /* @__PURE__ */ e("rect", { x: "11", y: "12", width: "3", height: "2", fill: "#ffffff" }),
313
313
  /* @__PURE__ */ e("rect", { className: "rra-pupil", "data-base-x": "12", "data-base-y": "12.5", "data-quantize": "1", x: "12", y: "12.5", width: "1", height: "1", fill: "#1c1c1c" }),
314
314
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "2", x: "11", y: "12", width: "3", height: "0", fill: a })
315
315
  ] }),
316
- /* @__PURE__ */ c("g", { id: "rra-eyeR", children: [
316
+ /* @__PURE__ */ o("g", { id: "rra-eyeR", children: [
317
317
  /* @__PURE__ */ e("rect", { x: "18", y: "12", width: "3", height: "2", fill: "#ffffff" }),
318
318
  /* @__PURE__ */ e("rect", { className: "rra-pupil", "data-base-x": "19", "data-base-y": "12.5", "data-quantize": "1", x: "19", y: "12.5", width: "1", height: "1", fill: "#1c1c1c" }),
319
319
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "2", x: "18", y: "12", width: "3", height: "0", fill: a })
320
320
  ] }),
321
321
  /* @__PURE__ */ e("rect", { x: "15", y: "15", width: "2", height: "1", fill: "#d49a72" }),
322
322
  /* @__PURE__ */ e("rect", { id: "rra-mouth", "data-quantize": "1", x: "13", y: "18", width: "6", height: "1", fill: "#5a1f1f" }),
323
- /* @__PURE__ */ c("g", { id: "rra-think", opacity: "0", children: [
323
+ /* @__PURE__ */ o("g", { id: "rra-think", opacity: "0", children: [
324
324
  /* @__PURE__ */ e("rect", { x: "24", y: "9", width: "1", height: "1", fill: "#8b5cf6" }),
325
325
  /* @__PURE__ */ e("rect", { x: "26", y: "7", width: "1.5", height: "1.5", fill: "#8b5cf6" }),
326
326
  /* @__PURE__ */ e("rect", { x: "28", y: "4", width: "2", height: "2", fill: "#8b5cf6" })
@@ -329,11 +329,11 @@ function Le({
329
329
  }
330
330
  );
331
331
  }
332
- function Ne({
332
+ function Qe({
333
333
  size: i = 300,
334
- customization: n,
334
+ customization: r,
335
335
  inkColor: l = "#2f2a26",
336
- className: o,
336
+ className: c,
337
337
  style: a
338
338
  }) {
339
339
  const {
@@ -341,8 +341,8 @@ function Ne({
341
341
  // paper tone by default
342
342
  hairColor: d = "#2f2a26",
343
343
  bgColor: s = "#fffdf8"
344
- } = n ?? {};
345
- return /* @__PURE__ */ c(
344
+ } = r ?? {};
345
+ return /* @__PURE__ */ o(
346
346
  "svg",
347
347
  {
348
348
  viewBox: "0 0 200 200",
@@ -351,12 +351,12 @@ function Ne({
351
351
  xmlns: "http://www.w3.org/2000/svg",
352
352
  role: "img",
353
353
  "aria-label": "Avatar",
354
- className: o,
354
+ className: c,
355
355
  style: a,
356
356
  children: [
357
357
  /* @__PURE__ */ e("circle", { cx: "100", cy: "100", r: "79", fill: s }),
358
358
  /* @__PURE__ */ e("clipPath", { id: "rra-doodle-clip", children: /* @__PURE__ */ e("circle", { cx: "100", cy: "100", r: "79" }) }),
359
- /* @__PURE__ */ c("g", { clipPath: "url(#rra-doodle-clip)", children: [
359
+ /* @__PURE__ */ o("g", { clipPath: "url(#rra-doodle-clip)", children: [
360
360
  /* @__PURE__ */ e("path", { d: "M52 182 Q60 148 100 146 Q140 148 148 182", fill: "#ffffff", stroke: l, strokeWidth: "3", strokeLinecap: "round" }),
361
361
  /* @__PURE__ */ e("path", { d: "M88 150 L86 134 M112 150 L114 134", fill: "none", stroke: l, strokeWidth: "2.5", strokeLinecap: "round" }),
362
362
  /* @__PURE__ */ e(
@@ -375,19 +375,19 @@ function Ne({
375
375
  strokeLinecap: "round"
376
376
  }
377
377
  ),
378
- /* @__PURE__ */ c("g", { id: "rra-hair", fill: "none", stroke: d, strokeWidth: "3", strokeLinecap: "round", children: [
378
+ /* @__PURE__ */ o("g", { id: "rra-hair", fill: "none", stroke: d, strokeWidth: "3", strokeLinecap: "round", children: [
379
379
  /* @__PURE__ */ e("path", { d: "M62 84 Q58 52 88 47 Q72 56 74 64 Q80 50 104 46 Q92 54 96 60 Q106 48 126 52 Q116 58 120 64 Q130 56 140 78 Q132 66 122 68" }),
380
380
  /* @__PURE__ */ e("path", { d: "M66 76 Q70 62 82 58", opacity: "0.7" }),
381
381
  /* @__PURE__ */ e("path", { d: "M118 56 Q130 62 134 76", opacity: "0.7" })
382
382
  ] }),
383
383
  /* @__PURE__ */ e("path", { d: "M70 80 Q80 74 90 78", fill: "none", stroke: l, strokeWidth: "3", strokeLinecap: "round" }),
384
384
  /* @__PURE__ */ e("path", { d: "M110 78 Q120 74 130 80", fill: "none", stroke: l, strokeWidth: "3", strokeLinecap: "round" }),
385
- /* @__PURE__ */ c("g", { id: "rra-eyeL", children: [
385
+ /* @__PURE__ */ o("g", { id: "rra-eyeL", children: [
386
386
  /* @__PURE__ */ e("ellipse", { cx: "82", cy: "92", rx: "9", ry: "7.5", fill: "#ffffff", stroke: l, strokeWidth: "2.5" }),
387
387
  /* @__PURE__ */ e("circle", { className: "rra-pupil", "data-base-x": "82", "data-base-y": "92", cx: "82", cy: "92", r: "3.4", fill: l }),
388
388
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "17", x: "72", y: "83", width: "20", height: "0", fill: t })
389
389
  ] }),
390
- /* @__PURE__ */ c("g", { id: "rra-eyeR", children: [
390
+ /* @__PURE__ */ o("g", { id: "rra-eyeR", children: [
391
391
  /* @__PURE__ */ e("ellipse", { cx: "118", cy: "92", rx: "9", ry: "7.5", fill: "#ffffff", stroke: l, strokeWidth: "2.5" }),
392
392
  /* @__PURE__ */ e("circle", { className: "rra-pupil", "data-base-x": "118", "data-base-y": "92", cx: "118", cy: "92", r: "3.4", fill: l }),
393
393
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "17", x: "108", y: "83", width: "20", height: "0", fill: t })
@@ -396,7 +396,7 @@ function Ne({
396
396
  /* @__PURE__ */ e("ellipse", { id: "rra-mouth", cx: "100", cy: "122", rx: "9", ry: "2.5", fill: "#3a2e28", stroke: l, strokeWidth: "2" }),
397
397
  /* @__PURE__ */ e("path", { d: "M64 106 L70 102 M67 110 L73 106", stroke: l, strokeWidth: "1.5", strokeLinecap: "round", opacity: "0.45" })
398
398
  ] }),
399
- /* @__PURE__ */ c("g", { id: "rra-think", opacity: "0", children: [
399
+ /* @__PURE__ */ o("g", { id: "rra-think", opacity: "0", children: [
400
400
  /* @__PURE__ */ e("circle", { cx: "150", cy: "56", r: "4", fill: "#ffffff", stroke: "#8b5cf6", strokeWidth: "2" }),
401
401
  /* @__PURE__ */ e("circle", { cx: "164", cy: "44", r: "5.5", fill: "#ffffff", stroke: "#8b5cf6", strokeWidth: "2" }),
402
402
  /* @__PURE__ */ e("circle", { cx: "181", cy: "30", r: "7", fill: "#ffffff", stroke: "#8b5cf6", strokeWidth: "2.5" })
@@ -406,9 +406,9 @@ function Ne({
406
406
  );
407
407
  }
408
408
  function fe(i) {
409
- return i.replace(/-([a-z])/g, (n, l) => l.toUpperCase());
409
+ return i.replace(/-([a-z])/g, (r, l) => l.toUpperCase());
410
410
  }
411
- const Qe = [
411
+ const We = [
412
412
  ["pixel-art", "Pixel Art"],
413
413
  ["pixel-art-neutral", "Pixel Art Neutral"],
414
414
  ["lorelei", "Lorelei"],
@@ -417,24 +417,24 @@ const Qe = [
417
417
  ["notionists-neutral", "Notionists Neutral"],
418
418
  ["open-peeps", "Open Peeps"],
419
419
  ["thumbs", "Thumbs"]
420
- ].map(([i, n]) => ({
420
+ ].map(([i, r]) => ({
421
421
  id: i,
422
422
  exportName: fe(i),
423
- label: n,
423
+ label: r,
424
424
  license: "CC0 1.0"
425
425
  }));
426
- function me(i, n) {
427
- const l = /* @__PURE__ */ new Set(), o = /\bid="([^"]+)"/g;
426
+ function me(i, r) {
427
+ const l = /* @__PURE__ */ new Set(), c = /\bid="([^"]+)"/g;
428
428
  let a;
429
- for (; a = o.exec(i); ) l.add(a[1]);
429
+ for (; a = c.exec(i); ) l.add(a[1]);
430
430
  let t = i;
431
431
  for (const d of l) {
432
432
  const s = d.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
433
- t = t.replace(new RegExp(`id="${s}"`, "g"), `id="${n}-${d}"`).replace(new RegExp(`url\\(#${s}\\)`, "g"), `url(#${n}-${d})`).replace(new RegExp(`(xlink:href|href)="#${s}"`, "g"), `$1="#${n}-${d}"`);
433
+ t = t.replace(new RegExp(`id="${s}"`, "g"), `id="${r}-${d}"`).replace(new RegExp(`url\\(#${s}\\)`, "g"), `url(#${r}-${d})`).replace(new RegExp(`(xlink:href|href)="#${s}"`, "g"), `$1="#${r}-${d}"`);
434
434
  }
435
435
  return t;
436
436
  }
437
- const We = {
437
+ const $e = {
438
438
  "pixel-art": { part: "mouth", visemes: ["happy01", "happy11", "happy12"] },
439
439
  "pixel-art-neutral": { part: "mouth", visemes: ["happy01", "happy11", "happy12"] },
440
440
  lorelei: { part: "mouth", visemes: ["happy01", "happy08", "happy06"] },
@@ -468,46 +468,46 @@ const We = {
468
468
  { collection: "pixel-art", seed: "smmje3r6" },
469
469
  { collection: "pixel-art", seed: "wxhz14w1" },
470
470
  { collection: "pixel-art", seed: "uovelmrj" }
471
- ], Se = ye[0].collection, Re = ye[0].seed, Ze = Object.fromEntries(Qe.map((i) => [i.id, i]));
471
+ ], Re = ye[0].collection, Ee = ye[0].seed, Ge = Object.fromEntries(We.map((i) => [i.id, i]));
472
472
  let oe = null;
473
473
  function ke() {
474
474
  return oe || (oe = Promise.all([
475
475
  import("@dicebear/core"),
476
476
  import("@dicebear/collection")
477
- ]).then(([i, n]) => ({
477
+ ]).then(([i, r]) => ({
478
478
  createAvatar: i.createAvatar,
479
- collection: n
479
+ collection: r
480
480
  }))), oe;
481
481
  }
482
- async function $e(i, n, l = {}) {
483
- const { createAvatar: o, collection: a } = await ke(), t = a[fe(String(i))];
482
+ async function Te(i, r, l = {}) {
483
+ const { createAvatar: c, collection: a } = await ke(), t = a[fe(String(i))];
484
484
  if (!t) throw new Error(`Unknown DiceBear style "${i}"`);
485
- return o(t, { seed: n, ...l }).toString();
485
+ return c(t, { seed: r, ...l }).toString();
486
486
  }
487
- function Ee(i, n, l, o, a) {
487
+ function Be(i, r, l, c, a) {
488
488
  const t = [], d = (s, h) => t.push({
489
489
  key: s,
490
- html: me(i(n, { ...l, ...h }).toString(), `${a}-${s}`)
490
+ html: me(i(r, { ...l, ...h }).toString(), `${a}-${s}`)
491
491
  });
492
- if (o.part === "face")
493
- o.visemes.forEach((s, h) => d(`m${h}`, { face: [s] })), o.faceBlink && d("blink", { face: [o.faceBlink] });
492
+ if (c.part === "face")
493
+ c.visemes.forEach((s, h) => d(`m${h}`, { face: [s] })), c.faceBlink && d("blink", { face: [c.faceBlink] });
494
494
  else {
495
- const s = o.blink ? [
496
- ["o", { eyes: [o.blink.open] }],
497
- ["c", { eyes: [o.blink.closed] }]
495
+ const s = c.blink ? [
496
+ ["o", { eyes: [c.blink.open] }],
497
+ ["c", { eyes: [c.blink.closed] }]
498
498
  ] : [["o", {}]];
499
- o.visemes.forEach((h, p) => {
500
- for (const [g, r] of s) d(`m${p}-${g}`, { [o.part]: [h], ...r });
499
+ c.visemes.forEach((h, p) => {
500
+ for (const [g, n] of s) d(`m${p}-${g}`, { [c.part]: [h], ...n });
501
501
  });
502
502
  }
503
503
  return t;
504
504
  }
505
- function Be({
505
+ function Fe({
506
506
  state: i,
507
- analyser: n,
507
+ analyser: r,
508
508
  size: l = 300,
509
- collection: o = Se,
510
- seed: a = Re,
509
+ collection: c = Re,
510
+ seed: a = Ee,
511
511
  backgroundColor: t,
512
512
  radius: d,
513
513
  className: s = "",
@@ -515,88 +515,88 @@ function Be({
515
515
  maxMouthOpening: p = 30,
516
516
  stateColors: g
517
517
  }) {
518
- const r = se(), S = `rra-db-${xe().replace(/[^a-zA-Z0-9]/g, "")}`, T = O(null), V = O(/* @__PURE__ */ new Map()), w = O(null), [m, F] = ce(null), [f, k] = ce(null), [M, y] = ce(null), N = O({ state: i, analyser: n, maxMouthOpening: p });
519
- N.current = { state: i, analyser: n, maxMouthOpening: p };
518
+ const n = se(), W = `rra-db-${xe().replace(/[^a-zA-Z0-9]/g, "")}`, B = O(null), V = O(/* @__PURE__ */ new Map()), w = O(null), [m, F] = ae(null), [f, k] = ae(null), [M, y] = ae(null), L = O({ state: i, analyser: r, maxMouthOpening: p });
519
+ L.current = { state: i, analyser: r, maxMouthOpening: p };
520
520
  const J = (t == null ? void 0 : t.join(",")) ?? "";
521
521
  ee(() => {
522
522
  let u = !1;
523
- return F(null), y(null), ke().then(({ createAvatar: W, collection: I }) => {
523
+ return F(null), y(null), ke().then(({ createAvatar: Q, collection: z }) => {
524
524
  if (u) return;
525
- const R = I[fe(String(o))];
526
- if (!R) {
527
- y(`Unknown DiceBear style "${o}"`);
525
+ const $ = z[fe(String(c))];
526
+ if (!$) {
527
+ y(`Unknown DiceBear style "${c}"`);
528
528
  return;
529
529
  }
530
530
  const C = { seed: a };
531
531
  t && t.length && (C.backgroundColor = t), d != null && (C.radius = d);
532
- const x = We[String(o)] ?? null;
533
- V.current = /* @__PURE__ */ new Map(), x ? (k(x), F(Ee(W, R, C, x, S))) : (k(null), F([{ key: "base", html: me(W(R, C).toString(), `${S}-base`) }]));
534
- }).catch((W) => {
532
+ const x = $e[String(c)] ?? null;
533
+ V.current = /* @__PURE__ */ new Map(), x ? (k(x), F(Be(Q, $, C, x, W))) : (k(null), F([{ key: "base", html: me(Q($, C).toString(), `${W}-base`) }]));
534
+ }).catch((Q) => {
535
535
  if (u) return;
536
- const I = (W == null ? void 0 : W.message) || String(W);
537
- y(/Cannot find module|Failed to (resolve|fetch)|dicebear/i.test(I) ? "missing" : I);
536
+ const z = (Q == null ? void 0 : Q.message) || String(Q);
537
+ y(/Cannot find module|Failed to (resolve|fetch)|dicebear/i.test(z) ? "missing" : z);
538
538
  }), () => {
539
539
  u = !0;
540
540
  };
541
- }, [o, a, d, J]), ee(() => {
542
- const u = T.current;
541
+ }, [c, a, d, J]), ee(() => {
542
+ const u = B.current;
543
543
  if (!u || !m || m.length === 0 || typeof window > "u") return;
544
- const W = V.current, I = !!(f && (f.blink || f.faceBlink));
545
- let R = null, C = null, x = 0, q = 0, H = 1500 + Math.random() * 2500, U = 0, P = !1, K = 0, A = "", D = performance.now();
546
- const $ = (Z) => {
547
- if (Z === A) return;
548
- const G = W.get(Z) ?? W.get(m[0].key);
549
- W.forEach((Y) => {
544
+ const Q = V.current, z = !!(f && (f.blink || f.faceBlink));
545
+ let $ = null, C = null, x = 0, q = 0, H = 1500 + Math.random() * 2500, U = 0, I = !1, K = 0, A = "", P = performance.now();
546
+ const R = (D) => {
547
+ if (D === A) return;
548
+ const G = Q.get(D) ?? Q.get(m[0].key);
549
+ Q.forEach((Y) => {
550
550
  Y.style.visibility = Y === G ? "visible" : "hidden";
551
- }), A = Z;
552
- }, Q = (Z) => {
553
- const G = Math.min(100, Z - D);
554
- D = Z;
555
- const { state: Y, analyser: X, maxMouthOpening: ie } = N.current, te = Y === "speaking", L = ie / 30;
556
- if (te ? ((!R || C !== X) && (R = de(X), C = X), x += (R.read().level - x) * 0.3) : (R = null, C = null, x += (0 - x) * 0.25), I && !r && (P ? (U += G, U >= 160 && (P = !1, H = 1800 + Math.random() * 3500)) : (H -= G, H <= 0 && (P = !0, U = 0))), f) {
551
+ }), A = D;
552
+ }, S = (D) => {
553
+ const G = Math.min(100, D - P);
554
+ P = D;
555
+ const { state: Y, analyser: X, maxMouthOpening: ie } = L.current, te = Y === "speaking", N = ie / 30;
556
+ if (te ? ((!$ || C !== X) && ($ = de(X), C = X), x += ($.read().level - x) * 0.3) : ($ = null, C = null, x += (0 - x) * 0.25), z && !n && (I ? (U += G, U >= 160 && (I = !1, H = 1800 + Math.random() * 3500)) : (H -= G, H <= 0 && (I = !0, U = 0))), f) {
557
557
  let b = K;
558
- if (K === 0 ? x > 0.13 && (b = x > 0.36 ? 2 : 1) : K === 1 ? x > 0.36 ? b = 2 : x < 0.09 && (b = 0) : x < 0.1 ? b = 0 : x < 0.3 && (b = 1), K = te ? b : 0, f.part === "face")
559
- $(P && f.faceBlink ? "blink" : `m${K}`);
558
+ if (K === 0 ? x > 0.07 && (b = x > 0.22 ? 2 : 1) : K === 1 ? x > 0.22 ? b = 2 : x < 0.05 && (b = 0) : x < 0.06 ? b = 0 : x < 0.18 && (b = 1), K = te ? b : 0, f.part === "face")
559
+ R(I && f.faceBlink ? "blink" : `m${K}`);
560
560
  else {
561
- const be = P && f.blink ? "c" : "o";
562
- $(`m${K}-${be}`);
561
+ const ve = I && f.blink ? "c" : "o";
562
+ R(`m${K}-${ve}`);
563
563
  }
564
- let E = 0, B = 0;
565
- r || (q += G * 2e-3, E = Math.sin(q) * 8e-3, Y === "listening" && (B = Math.sin(q * 1.6) * 1.2));
566
- const j = x * 4 * L, re = 1 + x * 0.04 * L + E, ne = 1 - x * 0.02 * L + E;
567
- u.style.transform = `translateY(${(-j + B).toFixed(2)}px) scale(${ne.toFixed(4)}, ${re.toFixed(4)})`;
564
+ let E = 0, T = 0;
565
+ n || (q += G * 2e-3, E = Math.sin(q) * 8e-3, Y === "listening" && (T = Math.sin(q * 1.6) * 1.2));
566
+ const Z = x * 4 * N, re = 1 + x * 0.04 * N + E, ne = 1 - x * 0.02 * N + E;
567
+ u.style.transform = `translateY(${(-Z + T).toFixed(2)}px) scale(${ne.toFixed(4)}, ${re.toFixed(4)})`;
568
568
  } else {
569
569
  let b = 0;
570
- r || (q += G * 2e-3, b = Math.sin(q) * 0.012);
571
- const E = x * 10 * L, B = 1 + x * 0.1 * L + b, j = 1 - x * 0.05 * L + b, re = Y === "thinking" && !r ? -4 : 0;
572
- u.style.transform = `translateY(${(-E).toFixed(2)}px) scale(${j.toFixed(4)}, ${B.toFixed(4)}) rotate(${re}deg)`;
570
+ n || (q += G * 2e-3, b = Math.sin(q) * 0.012);
571
+ const E = x * 10 * N, T = 1 + x * 0.1 * N + b, Z = 1 - x * 0.05 * N + b, re = Y === "thinking" && !n ? -4 : 0;
572
+ u.style.transform = `translateY(${(-E).toFixed(2)}px) scale(${Z.toFixed(4)}, ${T.toFixed(4)}) rotate(${re}deg)`;
573
573
  }
574
- w.current = requestAnimationFrame(Q);
574
+ w.current = requestAnimationFrame(S);
575
575
  };
576
- return u.style.transformOrigin = "center bottom", w.current = requestAnimationFrame(Q), () => {
576
+ return u.style.transformOrigin = "center bottom", w.current = requestAnimationFrame(S), () => {
577
577
  w.current && cancelAnimationFrame(w.current);
578
578
  };
579
- }, [m, f, r]);
579
+ }, [m, f, n]);
580
580
  const v = (g == null ? void 0 : g[i]) ?? "#10b981";
581
- return /* @__PURE__ */ c(
581
+ return /* @__PURE__ */ o(
582
582
  "div",
583
583
  {
584
584
  className: `relative flex items-center justify-center ${s}`,
585
585
  style: { width: l, height: l, ...h },
586
586
  children: [
587
- m && /* @__PURE__ */ e("div", { ref: T, className: "relative w-full h-full", role: "img", "aria-label": "Avatar", children: m.map((u, W) => /* @__PURE__ */ e(
587
+ m && /* @__PURE__ */ e("div", { ref: B, className: "relative w-full h-full", role: "img", "aria-label": "Avatar", children: m.map((u, Q) => /* @__PURE__ */ e(
588
588
  "div",
589
589
  {
590
- ref: (I) => {
591
- I ? V.current.set(u.key, I) : V.current.delete(u.key);
590
+ ref: (z) => {
591
+ z ? V.current.set(u.key, z) : V.current.delete(u.key);
592
592
  },
593
593
  dangerouslySetInnerHTML: { __html: u.html },
594
594
  className: "absolute inset-0 [&>svg]:w-full [&>svg]:h-full",
595
- style: { visibility: W === 0 ? "visible" : "hidden" }
595
+ style: { visibility: Q === 0 ? "visible" : "hidden" }
596
596
  },
597
597
  u.key
598
598
  )) }),
599
- !m && !M && /* @__PURE__ */ c("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
599
+ !m && !M && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
600
600
  /* @__PURE__ */ e(
601
601
  "div",
602
602
  {
@@ -606,12 +606,12 @@ function Be({
606
606
  ),
607
607
  /* @__PURE__ */ e("span", { className: "text-[10px] font-mono font-bold tracking-widest text-zinc-400 animate-pulse", children: "GENERATING AVATAR…" })
608
608
  ] }),
609
- M === "missing" && /* @__PURE__ */ c("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-zinc-950/90 backdrop-blur-md rounded-2xl p-4 text-center", children: [
609
+ M === "missing" && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-zinc-950/90 backdrop-blur-md rounded-2xl p-4 text-center", children: [
610
610
  /* @__PURE__ */ e("span", { className: "text-xs font-mono font-bold text-amber-400 uppercase tracking-wider mb-2", children: "DiceBear not installed" }),
611
611
  /* @__PURE__ */ e("p", { className: "text-[10px] text-zinc-500 max-w-[220px] leading-relaxed mb-2", children: "Install the optional peer dependencies to use this variant:" }),
612
612
  /* @__PURE__ */ e("code", { className: "text-[10px] text-zinc-300 bg-zinc-900 px-2 py-1 rounded border border-zinc-800 break-all", children: "npm i @dicebear/core @dicebear/collection" })
613
613
  ] }),
614
- M && M !== "missing" && /* @__PURE__ */ c("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-zinc-950/90 backdrop-blur-md rounded-2xl p-4 text-center", children: [
614
+ M && M !== "missing" && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-zinc-950/90 backdrop-blur-md rounded-2xl p-4 text-center", children: [
615
615
  /* @__PURE__ */ e("span", { className: "text-xs font-mono font-bold text-red-400 uppercase tracking-wider mb-2", children: "Failed to generate" }),
616
616
  /* @__PURE__ */ e("p", { className: "text-[10px] text-zinc-500 max-w-[220px] leading-relaxed break-all", children: M })
617
617
  ] })
@@ -619,35 +619,113 @@ function Be({
619
619
  }
620
620
  );
621
621
  }
622
- function Te(i, n) {
623
- return n === i ? { type: "none" } : n.length > i.length && n.startsWith(i) ? { type: "push", text: n.slice(i.length) } : { type: "reset", seed: n };
622
+ function be(i) {
623
+ if (!i) return "";
624
+ let r = i;
625
+ r = r.replace(/```[^\n]*\n?([\s\S]*?)```/g, "$1"), r = r.replace(/```[^\n]*\n?/g, ""), r = r.split(`
626
+ `).filter((l) => {
627
+ const c = l.trim();
628
+ if (!c) return !0;
629
+ const a = /^\|.*\|?\s*$/.test(c) && c.includes("|"), t = /^\|?[\s:|-]+\|[\s:|-]*$/.test(c) && c.includes("-");
630
+ return !(a || t);
631
+ }).join(`
632
+ `), r = r.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1"), r = r.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1"), r = r.replace(/`([^`]+)`/g, "$1"), r = r.replace(/^\s{0,3}#{1,6}\s+/gm, ""), r = r.replace(/^\s{0,3}>\s?/gm, ""), r = r.replace(/^\s{0,3}[-*+]\s+/gm, ""), r = r.replace(/^\s{0,3}\d+\.\s+/gm, "");
633
+ for (let l = 0; l < 2; l++)
634
+ r = r.replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/__([^_]+)__/g, "$1").replace(/_([^_]+)_/g, "$1").replace(/~~([^~]+)~~/g, "$1");
635
+ return r = r.replace(/[*_~]{1,3}(?=\s|$)/g, "").replace(/(^|\s)[*_~]{1,3}/g, "$1"), r = r.replace(/^\s{0,3}([-*_])\1{2,}\s*$/gm, ""), r = r.replace(/\s*\n\s*/g, " ").replace(/[ \t]{2,}/g, " "), r.trim();
636
+ }
637
+ function we(i, r = {}) {
638
+ const l = r.maxChars ?? 160, c = i.trim();
639
+ if (c.length <= l) return c;
640
+ const a = c.slice(c.length - l), t = a.search(new RegExp("(?<=[.!?…])\\s+"));
641
+ if (t !== -1 && t < l * 0.6)
642
+ return "…" + a.slice(t).trimStart();
643
+ const d = a.indexOf(" "), s = d === -1 ? 0 : d + 1;
644
+ return "…" + a.slice(s);
624
645
  }
625
- function Fe(i) {
626
- const n = O(null);
627
- n.current === null && (n.current = we());
646
+ function Ce({ text: i, maxChars: r = 160, className: l = "", style: c }) {
647
+ const a = we(be(i ?? ""), { maxChars: r });
648
+ return a ? /* @__PURE__ */ e(
649
+ "div",
650
+ {
651
+ className: `rra-caption w-full flex justify-center pointer-events-none ${l}`,
652
+ style: c,
653
+ children: /* @__PURE__ */ e(
654
+ ce.span,
655
+ {
656
+ initial: { opacity: 0, y: 4 },
657
+ animate: { opacity: 1, y: 0 },
658
+ transition: { duration: 0.18 },
659
+ role: "status",
660
+ "aria-live": "polite",
661
+ className: "inline-block max-w-[640px] text-center text-base md:text-lg font-medium text-zinc-100 leading-relaxed px-5 py-3 rounded-2xl border border-zinc-700/40 break-words",
662
+ style: {
663
+ textShadow: "0px 1px 3px rgba(0,0,0,0.5)",
664
+ background: "rgba(9, 9, 11, 0.8)",
665
+ backdropFilter: "blur(12px)"
666
+ },
667
+ children: a
668
+ },
669
+ a
670
+ )
671
+ }
672
+ ) : null;
673
+ }
674
+ function qe({
675
+ text: i,
676
+ maxChars: r = 220,
677
+ label: l = "Thought process",
678
+ className: c = "",
679
+ style: a
680
+ }) {
681
+ const t = we(be(i ?? ""), { maxChars: r });
682
+ return t ? /* @__PURE__ */ e(
683
+ ce.div,
684
+ {
685
+ initial: { opacity: 0, y: 8, scale: 0.98 },
686
+ animate: { opacity: 1, y: 0, scale: 1 },
687
+ transition: { duration: 0.3 },
688
+ className: `rra-thought w-full max-w-[420px] text-left pointer-events-none ${c}`,
689
+ style: a,
690
+ children: /* @__PURE__ */ o("div", { className: "bg-zinc-900/90 backdrop-blur-xl text-zinc-100 px-5 py-4 rounded-3xl shadow-[0_10px_30px_rgba(139,92,246,0.15)] border border-purple-500/25 text-sm italic break-words", children: [
691
+ /* @__PURE__ */ o("div", { className: "text-purple-400 text-[10px] uppercase tracking-widest font-mono font-bold mb-1 flex items-center gap-1.5", children: [
692
+ /* @__PURE__ */ e("span", { className: "w-1.5 h-1.5 rounded-full bg-purple-400 animate-pulse" }),
693
+ l
694
+ ] }),
695
+ /* @__PURE__ */ e("p", { className: "leading-relaxed text-zinc-200", children: t })
696
+ ] })
697
+ }
698
+ ) : null;
699
+ }
700
+ function _e(i, r) {
701
+ return r === i ? { type: "none" } : r.length > i.length && r.startsWith(i) ? { type: "push", text: r.slice(i.length) } : { type: "reset", seed: r };
702
+ }
703
+ function ze(i) {
704
+ const r = O(null);
705
+ r.current === null && (r.current = Me());
628
706
  const l = O("");
629
707
  return ee(() => {
630
708
  if (i === void 0) return;
631
- const o = n.current, a = Te(l.current, i);
632
- a.type === "push" ? o.push(a.text) : a.type === "reset" && (o.reset(), a.seed && o.push(a.seed)), l.current = i;
633
- }, [i]), i === void 0 ? null : n.current;
709
+ const c = r.current, a = _e(l.current, i);
710
+ a.type === "push" ? c.push(a.text) : a.type === "reset" && (c.reset(), a.seed && c.push(a.seed)), l.current = i;
711
+ }, [i]), i === void 0 ? null : r.current;
634
712
  }
635
- function _(i, n) {
713
+ function j(i, r) {
636
714
  if (!i || !i.startsWith("#")) return i || "transparent";
637
715
  const l = i.replace("#", "");
638
- let o = 0, a = 0, t = 0;
639
- return l.length === 3 ? (o = parseInt(l[0] + l[0], 16), a = parseInt(l[1] + l[1], 16), t = parseInt(l[2] + l[2], 16)) : l.length === 6 && (o = parseInt(l.substring(0, 2), 16), a = parseInt(l.substring(2, 4), 16), t = parseInt(l.substring(4, 6), 16)), `rgba(${o}, ${a}, ${t}, ${n})`;
716
+ let c = 0, a = 0, t = 0;
717
+ return l.length === 3 ? (c = parseInt(l[0] + l[0], 16), a = parseInt(l[1] + l[1], 16), t = parseInt(l[2] + l[2], 16)) : l.length === 6 && (c = parseInt(l.substring(0, 2), 16), a = parseInt(l.substring(2, 4), 16), t = parseInt(l.substring(4, 6), 16)), `rgba(${c}, ${a}, ${t}, ${r})`;
640
718
  }
641
- const Ce = le.lazy(
642
- () => import("./VrmAvatar-CehRzj0J.js").then((i) => ({ default: i.VrmAvatar }))
643
- ), qe = le.lazy(
644
- () => import("./GlbArkitAvatar-Dm9STiyR.js").then((i) => ({ default: i.GlbArkitAvatar }))
719
+ const Ie = le.lazy(
720
+ () => import("./VrmAvatar-Dw0gf27E.js").then((i) => ({ default: i.VrmAvatar }))
721
+ ), Pe = le.lazy(
722
+ () => import("./GlbArkitAvatar-CjfIOQ2P.js").then((i) => ({ default: i.GlbArkitAvatar }))
645
723
  );
646
- function je({
724
+ function Ve({
647
725
  state: i,
648
- analyser: n = null,
726
+ analyser: r = null,
649
727
  speechActivity: l,
650
- streamingText: o,
728
+ streamingText: c,
651
729
  size: a = 280,
652
730
  variant: t = "geometric",
653
731
  children: d,
@@ -655,10 +733,10 @@ function je({
655
733
  glbUrl: h,
656
734
  subtitle: p,
657
735
  thought: g,
658
- tool: r,
659
- showGlow: z = !0,
660
- showStatePill: S = !0,
661
- showThought: T = !0,
736
+ tool: n,
737
+ showGlow: _ = !0,
738
+ showStatePill: W = !0,
739
+ showThought: B = !0,
662
740
  showSubtitle: V = !0,
663
741
  className: w = "",
664
742
  style: m,
@@ -667,32 +745,32 @@ function je({
667
745
  maxMouthOpening: k,
668
746
  blinkIntervalMin: M,
669
747
  blinkIntervalMax: y,
670
- blinkDuration: N,
748
+ blinkDuration: L,
671
749
  mouseTrackingIntensity: J,
672
750
  stateColors: v,
673
751
  stateLabels: u,
674
- customization: W
752
+ customization: Q
675
753
  }) {
676
- const I = Fe(o), R = l ?? I, C = R ?? n, x = {
754
+ const z = ze(c), $ = l ?? z, C = $ ?? r, x = {
677
755
  state: i,
678
756
  analyser: C,
679
757
  size: a,
680
758
  maxMouthOpening: k,
681
759
  blinkIntervalMin: M,
682
760
  blinkIntervalMax: y,
683
- blinkDuration: N,
761
+ blinkDuration: L,
684
762
  mouseTrackingIntensity: J,
685
763
  stateColors: v,
686
- customization: W
764
+ customization: Q
687
765
  };
688
766
  let q;
689
767
  if (t === "vrm")
690
- q = /* @__PURE__ */ e(he, { fallback: null, children: /* @__PURE__ */ e(Ce, { ...x, vrmUrl: s }) });
768
+ q = /* @__PURE__ */ e(he, { fallback: null, children: /* @__PURE__ */ e(Ie, { ...x, vrmUrl: s }) });
691
769
  else if (t === "glb")
692
- q = /* @__PURE__ */ e(he, { fallback: null, children: /* @__PURE__ */ e(qe, { ...x, glbUrl: h }) });
770
+ q = /* @__PURE__ */ e(he, { fallback: null, children: /* @__PURE__ */ e(Pe, { ...x, glbUrl: h }) });
693
771
  else if (t === "dicebear")
694
772
  q = /* @__PURE__ */ e(
695
- Be,
773
+ Fe,
696
774
  {
697
775
  state: i,
698
776
  analyser: C,
@@ -706,16 +784,16 @@ function je({
706
784
  else if (t === "byos")
707
785
  q = /* @__PURE__ */ e(ue, { ...x, children: d });
708
786
  else {
709
- const Z = {
787
+ const D = {
710
788
  geometric: ge,
711
- memoji: Ae,
712
- pixelart: Le,
713
- doodle: Ne
789
+ memoji: Le,
790
+ pixelart: Se,
791
+ doodle: Qe
714
792
  }[t] ?? ge;
715
793
  q = // Keyed by variant so switching presets remounts the runtime cleanly
716
- /* @__PURE__ */ e(ue, { ...x, children: /* @__PURE__ */ e(Z, { size: a, customization: W, state: i }) }, t);
794
+ /* @__PURE__ */ e(ue, { ...x, children: /* @__PURE__ */ e(D, { size: a, customization: Q, state: i }) }, t);
717
795
  }
718
- const H = pe(1), U = pe(0.15), P = O(null), K = se(), A = {
796
+ const H = pe(1), U = pe(0.15), I = O(null), K = se(), A = {
719
797
  idle: (v == null ? void 0 : v.idle) ?? "#4b5563",
720
798
  // gray-600
721
799
  listening: (v == null ? void 0 : v.listening) ?? "#3b82f6",
@@ -726,44 +804,44 @@ function je({
726
804
  // emerald-500
727
805
  working: (v == null ? void 0 : v.working) ?? "#f59e0b"
728
806
  // amber-500
729
- }, D = {
807
+ }, P = {
730
808
  idle: (u == null ? void 0 : u.idle) ?? "Idle",
731
809
  listening: (u == null ? void 0 : u.listening) ?? "Listening",
732
810
  thinking: (u == null ? void 0 : u.thinking) ?? "Thinking...",
733
811
  speaking: (u == null ? void 0 : u.speaking) ?? "Speaking",
734
812
  working: (u == null ? void 0 : u.working) ?? "Working"
735
- }, $ = {
736
- idle: _(A.idle, 0.15),
737
- listening: _(A.listening, 0.35),
738
- thinking: _(A.thinking, 0.4),
739
- speaking: _(A.speaking, 0.45),
740
- working: _(A.working, 0.4)
813
+ }, R = {
814
+ idle: j(A.idle, 0.15),
815
+ listening: j(A.listening, 0.35),
816
+ thinking: j(A.thinking, 0.4),
817
+ speaking: j(A.speaking, 0.45),
818
+ working: j(A.working, 0.4)
741
819
  };
742
820
  return ee(() => {
743
- if (!(n && (i === "speaking" || i === "listening")) && !(!n && R && i === "speaking")) {
744
- H.set(i === "thinking" || i === "working" ? 1.05 : 1), U.set(i === "thinking" || i === "working" ? 0.35 : 0.15), P.current && cancelAnimationFrame(P.current);
821
+ if (!(r && (i === "speaking" || i === "listening")) && !(!r && $ && i === "speaking")) {
822
+ H.set(i === "thinking" || i === "working" ? 1.05 : 1), U.set(i === "thinking" || i === "working" ? 0.35 : 0.15), I.current && cancelAnimationFrame(I.current);
745
823
  return;
746
824
  }
747
- const G = n ? new Uint8Array(n.frequencyBinCount) : null, Y = () => {
825
+ const G = r ? new Uint8Array(r.frequencyBinCount) : null, Y = () => {
748
826
  let X;
749
- if (n && G) {
750
- n.getByteTimeDomainData(G);
827
+ if (r && G) {
828
+ r.getByteTimeDomainData(G);
751
829
  let ie = 0;
752
830
  for (let te = 0; te < G.length; te++) {
753
- const L = Math.abs(G[te] - 128);
754
- L > ie && (ie = L);
831
+ const N = Math.abs(G[te] - 128);
832
+ N > ie && (ie = N);
755
833
  }
756
834
  X = Math.min(1, ie / 128);
757
835
  } else
758
- X = R ? R.sample() : 0;
759
- H.set(1 + X * 0.35), U.set(0.15 + X * 0.35), P.current = requestAnimationFrame(Y);
836
+ X = $ ? $.sample() : 0;
837
+ H.set(1 + X * 0.35), U.set(0.15 + X * 0.35), I.current = requestAnimationFrame(Y);
760
838
  };
761
- return P.current = requestAnimationFrame(Y), () => {
762
- P.current && cancelAnimationFrame(P.current);
839
+ return I.current = requestAnimationFrame(Y), () => {
840
+ I.current && cancelAnimationFrame(I.current);
763
841
  };
764
- }, [n, R, i, H, U]), /* @__PURE__ */ c("div", { className: `relative flex flex-col items-center justify-center ${w}`, style: { width: a, height: a, ...m }, children: [
765
- z && /* @__PURE__ */ e(
766
- ae.div,
842
+ }, [r, $, i, H, U]), /* @__PURE__ */ o("div", { className: `relative flex flex-col items-center justify-center ${w}`, style: { width: a, height: a, ...m }, children: [
843
+ _ && /* @__PURE__ */ e(
844
+ ce.div,
767
845
  {
768
846
  className: "absolute rounded-[1.75rem] pointer-events-none filter blur-2xl",
769
847
  style: {
@@ -776,85 +854,49 @@ function je({
776
854
  }
777
855
  ),
778
856
  /* @__PURE__ */ e("div", { className: "w-full h-full relative flex items-center justify-center z-10", children: q }),
779
- T && g && /* @__PURE__ */ e(
780
- ae.div,
781
- {
782
- initial: { opacity: 0, y: 15, scale: 0.95 },
783
- animate: { opacity: 1, y: 0, scale: 1 },
784
- transition: { duration: 0.3 },
785
- className: "absolute bottom-[108%] left-1/2 -translate-x-1/2 w-[90vw] max-w-[340px] md:max-w-[420px] text-left pointer-events-none z-40",
786
- children: /* @__PURE__ */ c("div", { className: "relative bg-zinc-900/90 backdrop-blur-xl text-zinc-100 px-5 py-4 rounded-3xl shadow-[0_10px_30px_rgba(139,92,246,0.15)] border border-purple-500/25 text-sm italic break-words", children: [
787
- /* @__PURE__ */ c("div", { className: "text-purple-400 text-[10px] uppercase tracking-widest font-mono font-bold mb-1 flex items-center gap-1.5", children: [
788
- /* @__PURE__ */ e("span", { className: "w-1.5 h-1.5 rounded-full bg-purple-400 animate-pulse" }),
789
- "Thought process"
790
- ] }),
791
- /* @__PURE__ */ e("p", { className: "leading-relaxed text-zinc-200", children: g }),
792
- /* @__PURE__ */ e("div", { className: "absolute -bottom-3 left-1/2 -translate-x-1/2 w-4 h-4 bg-zinc-900/90 rounded-full border border-purple-500/20 shadow-md backdrop-blur-md" }),
793
- /* @__PURE__ */ e("div", { className: "absolute -bottom-6 left-[48%] -translate-x-1/2 w-2.5 h-2.5 bg-zinc-900/90 rounded-full border border-purple-500/15 shadow-sm backdrop-blur-md" }),
794
- /* @__PURE__ */ e("div", { className: "absolute -bottom-8 left-[47%] -translate-x-1/2 w-1.5 h-1.5 bg-zinc-900/90 rounded-full border border-purple-500/10 backdrop-blur-md" })
795
- ] })
796
- }
797
- ),
798
- S && /* @__PURE__ */ e(
799
- ae.div,
857
+ B && g && /* @__PURE__ */ e("div", { className: "absolute bottom-[108%] left-1/2 -translate-x-1/2 w-[90vw] max-w-[340px] md:max-w-[420px] z-40", children: /* @__PURE__ */ o("div", { className: "relative", children: [
858
+ /* @__PURE__ */ e(qe, { text: g, className: "max-w-none" }),
859
+ /* @__PURE__ */ e("div", { className: "absolute -bottom-3 left-1/2 -translate-x-1/2 w-4 h-4 bg-zinc-900/90 rounded-full border border-purple-500/20 shadow-md backdrop-blur-md" }),
860
+ /* @__PURE__ */ e("div", { className: "absolute -bottom-6 left-[48%] -translate-x-1/2 w-2.5 h-2.5 bg-zinc-900/90 rounded-full border border-purple-500/15 shadow-sm backdrop-blur-md" }),
861
+ /* @__PURE__ */ e("div", { className: "absolute -bottom-8 left-[47%] -translate-x-1/2 w-1.5 h-1.5 bg-zinc-900/90 rounded-full border border-purple-500/10 backdrop-blur-md" })
862
+ ] }) }),
863
+ W && /* @__PURE__ */ e(
864
+ ce.div,
800
865
  {
801
866
  role: "status",
802
867
  "aria-live": "polite",
803
868
  className: "absolute -bottom-6 px-4 py-1.5 rounded-full text-xs font-bold text-white uppercase tracking-widest shadow-lg z-30 cursor-default select-none border border-white/10",
804
869
  animate: {
805
870
  backgroundColor: A[i],
806
- boxShadow: `0 4px 14px rgba(0,0,0,0.4), 0 0 16px ${$[i]}`
871
+ boxShadow: `0 4px 14px rgba(0,0,0,0.4), 0 0 16px ${R[i]}`
807
872
  },
808
873
  transition: { duration: 0.3 },
809
- children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1.5", children: [
874
+ children: /* @__PURE__ */ o("span", { className: "flex items-center gap-1.5", children: [
810
875
  /* @__PURE__ */ e("span", { className: `w-2 h-2 rounded-full bg-white ${!K && (i === "speaking" || i === "thinking") ? "animate-ping" : ""}` }),
811
- i === "working" && r ? `Working: ${r}` : D[i]
876
+ i === "working" && n ? `Working: ${n}` : P[i]
812
877
  ] })
813
878
  }
814
879
  ),
815
- V && p && /* @__PURE__ */ e(
816
- ae.div,
817
- {
818
- initial: { opacity: 0, y: -10 },
819
- animate: { opacity: 1, y: 0 },
820
- transition: { duration: 0.2 },
821
- className: "absolute top-[115%] left-1/2 -translate-x-1/2 w-[90vw] max-w-[500px] md:max-w-[640px] text-center pointer-events-none z-50 pb-8",
822
- children: /* @__PURE__ */ e(
823
- "span",
824
- {
825
- className: "inline-block px-6 py-4 text-base md:text-lg font-medium text-zinc-100 break-words leading-relaxed shadow-2xl border",
826
- style: {
827
- textShadow: "0px 1px 3px rgba(0,0,0,0.5)",
828
- background: "rgba(9, 9, 11, 0.8)",
829
- // zinc-950 at 0.8
830
- backdropFilter: "blur(12px)",
831
- borderColor: "rgba(63, 63, 70, 0.4)",
832
- borderRadius: "20px"
833
- },
834
- children: p
835
- }
836
- )
837
- }
838
- )
880
+ V && p && /* @__PURE__ */ e("div", { className: "absolute top-[115%] left-1/2 -translate-x-1/2 w-[90vw] max-w-[500px] md:max-w-[640px] z-50 pb-8", children: /* @__PURE__ */ e(Ce, { text: p }) })
839
881
  ] });
840
882
  }
841
- function _e({
883
+ function Ue({
842
884
  size: i = "100%",
843
- customization: n,
885
+ customization: r,
844
886
  state: l,
845
- className: o,
887
+ className: c,
846
888
  style: a
847
889
  }) {
848
890
  const {
849
891
  skinColor: t = "#cf6b34",
850
892
  // fur — also used for the eyelids
851
893
  bgColor: d = "#6fb3bd"
852
- } = n ?? {}, [s, h] = le.useState(
894
+ } = r ?? {}, [s, h] = le.useState(
853
895
  () => Math.random() < 0.5 ? "wires" : "paper"
854
896
  ), p = le.useRef(l);
855
897
  return le.useEffect(() => {
856
898
  l === "working" && p.current !== "working" && h(Math.random() < 0.5 ? "wires" : "paper"), p.current = l;
857
- }, [l]), /* @__PURE__ */ c(
899
+ }, [l]), /* @__PURE__ */ o(
858
900
  "svg",
859
901
  {
860
902
  viewBox: "0 0 200 200",
@@ -863,12 +905,12 @@ function _e({
863
905
  xmlns: "http://www.w3.org/2000/svg",
864
906
  role: "img",
865
907
  "aria-label": "Avatar",
866
- className: o,
908
+ className: c,
867
909
  style: a,
868
910
  children: [
869
911
  /* @__PURE__ */ e("circle", { cx: "100", cy: "100", r: "79", fill: d }),
870
912
  /* @__PURE__ */ e("clipPath", { id: "rra-squirrel-clip", children: /* @__PURE__ */ e("circle", { cx: "100", cy: "100", r: "79" }) }),
871
- /* @__PURE__ */ c("g", { clipPath: "url(#rra-squirrel-clip)", children: [
913
+ /* @__PURE__ */ o("g", { clipPath: "url(#rra-squirrel-clip)", children: [
872
914
  /* @__PURE__ */ e("path", { d: "M150 158 C182 150 188 96 162 66 C150 52 130 52 124 66 C140 70 150 92 146 110 C142 132 132 148 150 158 Z", fill: t }),
873
915
  /* @__PURE__ */ e("path", { d: "M150 150 C172 142 176 100 156 76 C150 90 156 104 152 120 C148 134 140 142 150 150 Z", fill: "#e3a368" }),
874
916
  /* @__PURE__ */ e("path", { d: "M84 118 Q82 140 78 150 L122 150 Q118 140 116 118 Z", fill: t }),
@@ -876,17 +918,17 @@ function _e({
876
918
  /* @__PURE__ */ e("path", { d: "M36 182 Q42 148 72 144 Q86 158 100 158 Q114 158 128 144 Q158 148 164 182 Z", fill: "#2b2f36" }),
877
919
  /* @__PURE__ */ e("path", { d: "M78 146 Q100 156 122 146", fill: "none", stroke: "#3c424b", strokeWidth: "3", strokeLinecap: "round" }),
878
920
  /* @__PURE__ */ e("path", { d: "M88 152 L100 182 L112 152 Z", fill: "#1f6fb0" }),
879
- /* @__PURE__ */ c("g", { stroke: "#6cc0ee", strokeWidth: "1.1", fill: "none", opacity: "0.85", children: [
921
+ /* @__PURE__ */ o("g", { stroke: "#6cc0ee", strokeWidth: "1.1", fill: "none", opacity: "0.85", children: [
880
922
  /* @__PURE__ */ e("path", { d: "M100 158 L100 178 M94 164 L106 164 M97 172 L103 172" }),
881
923
  /* @__PURE__ */ e("circle", { cx: "100", cy: "162", r: "1.4", fill: "#6cc0ee", stroke: "none" })
882
924
  ] }),
883
925
  /* @__PURE__ */ e("path", { d: "M96 150 L94 170 M104 150 L106 170", stroke: "#e9eef2", strokeWidth: "1.6", strokeLinecap: "round", fill: "none" }),
884
- /* @__PURE__ */ c("g", { id: "rra-squirrel-head", transform: l === "thinking" ? "rotate(6 100 120)" : void 0, children: [
926
+ /* @__PURE__ */ o("g", { id: "rra-squirrel-head", transform: l === "thinking" ? "rotate(6 100 120)" : void 0, children: [
885
927
  /* @__PURE__ */ e("path", { d: "M66 80 L58 42 Q74 50 86 72 Z", fill: t }),
886
928
  /* @__PURE__ */ e("path", { d: "M134 80 L142 42 Q126 50 114 72 Z", fill: t }),
887
929
  /* @__PURE__ */ e("path", { d: "M68 74 L63 52 Q72 56 80 70 Z", fill: "#a8451c" }),
888
930
  /* @__PURE__ */ e("path", { d: "M132 74 L137 52 Q128 56 120 70 Z", fill: "#a8451c" }),
889
- /* @__PURE__ */ c("g", { stroke: "#f0d9b8", strokeWidth: "1.4", strokeLinecap: "round", fill: "none", children: [
931
+ /* @__PURE__ */ o("g", { stroke: "#f0d9b8", strokeWidth: "1.4", strokeLinecap: "round", fill: "none", children: [
890
932
  /* @__PURE__ */ e("path", { d: "M60 46 L57 38 M63 47 L62 39 M66 49 L66 41" }),
891
933
  /* @__PURE__ */ e("path", { d: "M140 46 L143 38 M137 47 L138 39 M134 49 L134 41" })
892
934
  ] }),
@@ -895,30 +937,30 @@ function _e({
895
937
  /* @__PURE__ */ e("path", { d: "M138 96 Q146 90 142 100 Q144 108 136 106 Z", fill: t }),
896
938
  /* @__PURE__ */ e("ellipse", { cx: "100", cy: "112", rx: "23", ry: "18", fill: "#ecc090" }),
897
939
  /* @__PURE__ */ e("path", { d: "M64 78 Q60 50 86 46 Q78 54 82 60 Q92 44 110 48 Q102 56 106 60 Q120 50 134 74 Q124 62 112 66 Q100 56 88 66 Q76 64 64 78 Z", fill: "#3a2820" }),
898
- /* @__PURE__ */ c("g", { stroke: "#5a3a22", strokeWidth: "3", strokeLinecap: "round", fill: "none", children: [
940
+ /* @__PURE__ */ o("g", { stroke: "#5a3a22", strokeWidth: "3", strokeLinecap: "round", fill: "none", children: [
899
941
  /* @__PURE__ */ e("path", { d: "M70 80 Q78 75 88 79" }),
900
942
  /* @__PURE__ */ e("path", { d: "M112 79 Q122 75 130 80" })
901
943
  ] }),
902
- /* @__PURE__ */ c("g", { stroke: "#1a1a1a", strokeWidth: "3", fill: "none", children: [
944
+ /* @__PURE__ */ o("g", { stroke: "#1a1a1a", strokeWidth: "3", fill: "none", children: [
903
945
  /* @__PURE__ */ e("path", { d: "M95 92 Q100 89 105 92" }),
904
946
  /* @__PURE__ */ e("path", { d: "M69 90 L60 86" }),
905
947
  /* @__PURE__ */ e("path", { d: "M131 90 L140 86" })
906
948
  ] }),
907
949
  /* @__PURE__ */ e("circle", { cx: "82", cy: "92", r: "13.5", fill: "#fbf7ef", stroke: "#1a1a1a", strokeWidth: "3" }),
908
950
  /* @__PURE__ */ e("circle", { cx: "118", cy: "92", r: "13.5", fill: "#fbf7ef", stroke: "#1a1a1a", strokeWidth: "3" }),
909
- /* @__PURE__ */ c("g", { children: [
951
+ /* @__PURE__ */ o("g", { children: [
910
952
  /* @__PURE__ */ e("ellipse", { cx: "82", cy: "93", rx: "8", ry: "8.5", fill: "#ffffff" }),
911
953
  /* @__PURE__ */ e("g", { transform: l === "thinking" ? "translate(5, 0)" : void 0, children: /* @__PURE__ */ e("circle", { className: "rra-pupil", "data-base-x": 82, "data-base-y": 93, cx: "82", cy: "93", r: "4.6", fill: "#2b1b12" }) }),
912
954
  /* @__PURE__ */ e("circle", { cx: "84", cy: "90", r: "1.5", fill: "#ffffff" }),
913
955
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "18", x: "73", y: "83", width: "18", height: "0", fill: t })
914
956
  ] }),
915
- /* @__PURE__ */ c("g", { children: [
957
+ /* @__PURE__ */ o("g", { children: [
916
958
  /* @__PURE__ */ e("ellipse", { cx: "118", cy: "93", rx: "8", ry: "8.5", fill: "#ffffff" }),
917
959
  /* @__PURE__ */ e("g", { transform: l === "thinking" ? "translate(5, 0)" : void 0, children: /* @__PURE__ */ e("circle", { className: "rra-pupil", "data-base-x": 118, "data-base-y": 93, cx: "118", cy: "93", r: "4.6", fill: "#2b1b12" }) }),
918
960
  /* @__PURE__ */ e("circle", { cx: "120", cy: "90", r: "1.5", fill: "#ffffff" }),
919
961
  /* @__PURE__ */ e("rect", { className: "rra-lid", "data-max-height": "18", x: "109", y: "83", width: "18", height: "0", fill: t })
920
962
  ] }),
921
- l === "working" && s === "wires" && /* @__PURE__ */ c("g", { id: "rra-safety-goggles", children: [
963
+ l === "working" && s === "wires" && /* @__PURE__ */ o("g", { id: "rra-safety-goggles", children: [
922
964
  /* @__PURE__ */ e("path", { d: "M 52 92 C 45 92, 45 96, 40 96 M 148 92 C 155 92, 155 96, 160 96", fill: "none", stroke: "#2d3748", strokeWidth: "4", strokeLinecap: "round" }),
923
965
  /* @__PURE__ */ e("rect", { x: "58", y: "78", width: "84", height: "28", rx: "14", fill: "none", stroke: "#e2e8f0", strokeWidth: "4" }),
924
966
  /* @__PURE__ */ e("rect", { x: "60", y: "80", width: "80", height: "24", rx: "12", fill: "#e0f2fe", fillOpacity: "0.15" }),
@@ -929,7 +971,7 @@ function _e({
929
971
  /* @__PURE__ */ e("path", { d: "M100 113 L100 118", stroke: "#7a4a32", strokeWidth: "1.6", strokeLinecap: "round" }),
930
972
  /* @__PURE__ */ e("ellipse", { id: "rra-mouth", cx: "100", cy: "121", rx: "7", ry: "2.3", fill: "#5a3324" }),
931
973
  /* @__PURE__ */ e("g", { stroke: "#caa074", strokeWidth: "1", strokeLinecap: "round", opacity: "0.8", fill: "none", children: /* @__PURE__ */ e("path", { d: "M80 116 L62 113 M80 120 L62 121 M120 116 L138 113 M120 120 L138 121" }) }),
932
- l === "thinking" && /* @__PURE__ */ c("g", { id: "rra-thinking-hand", children: [
974
+ l === "thinking" && /* @__PURE__ */ o("g", { id: "rra-thinking-hand", children: [
933
975
  /* @__PURE__ */ e(
934
976
  "path",
935
977
  {
@@ -939,20 +981,20 @@ function _e({
939
981
  strokeWidth: "1.2"
940
982
  }
941
983
  ),
942
- /* @__PURE__ */ c("g", { fill: t, stroke: "#b05418", strokeWidth: "1.2", strokeLinejoin: "round", strokeLinecap: "round", children: [
984
+ /* @__PURE__ */ o("g", { fill: t, stroke: "#b05418", strokeWidth: "1.2", strokeLinejoin: "round", strokeLinecap: "round", children: [
943
985
  /* @__PURE__ */ e("path", { d: "M112 144 C110 138, 107 130, 105 124 C104 121, 108 121, 109 124 C111 130, 113 136, 115 141" }),
944
986
  /* @__PURE__ */ e("path", { d: "M115 141 C117 139, 120 140, 119 143 C121 142, 123 144, 121 147 C122 147, 123 149, 121 151 C120 152, 116 150, 115 145" }),
945
987
  /* @__PURE__ */ e("path", { d: "M110 139 C104 139, 96 135, 92 132 C90 130, 93 128, 95 130 C100 133, 106 135, 110 136" })
946
988
  ] })
947
989
  ] })
948
990
  ] }),
949
- l === "working" && s === "wires" && /* @__PURE__ */ c("g", { id: "rra-working-workspace-wires", children: [
991
+ l === "working" && s === "wires" && /* @__PURE__ */ o("g", { id: "rra-working-workspace-wires", children: [
950
992
  /* @__PURE__ */ e("circle", { cx: "100", cy: "162", r: "22", fill: "#fef08a", fillOpacity: "0.25", children: /* @__PURE__ */ e("animate", { attributeName: "opacity", values: "1;0.2;0.9;0.1;0.8;0.3;1", dur: "1.2s", repeatCount: "indefinite" }) }),
951
993
  /* @__PURE__ */ e("rect", { x: "94", y: "172", width: "12", height: "8", fill: "#94a3b8", rx: "1" }),
952
994
  /* @__PURE__ */ e("rect", { x: "96", y: "175", width: "8", height: "2", fill: "#64748b" }),
953
995
  /* @__PURE__ */ e("path", { d: "M92 165 C92 153, 108 153, 108 165 C108 171, 104 172, 104 174 L96 174 C96 172, 92 171, 92 165 Z", fill: "#fef08a", stroke: "#ca8a04", strokeWidth: "1.5", children: /* @__PURE__ */ e("animate", { attributeName: "fill", values: "#fef08a;#fef08a;#78350f;#fef08a;#fef08a;#78350f;#fef08a", dur: "1.2s", repeatCount: "indefinite" }) }),
954
996
  /* @__PURE__ */ e("path", { d: "M97 167 L99 160 L101 160 L103 167", fill: "none", stroke: "#ca8a04", strokeWidth: "1", children: /* @__PURE__ */ e("animate", { attributeName: "stroke", values: "#ca8a04;#ca8a04;#78350f;#ca8a04;#ca8a04;#78350f;#ca8a04", dur: "1.2s", repeatCount: "indefinite" }) }),
955
- /* @__PURE__ */ c("g", { id: "rra-left-arm-cable", children: [
997
+ /* @__PURE__ */ o("g", { id: "rra-left-arm-cable", children: [
956
998
  /* @__PURE__ */ e(
957
999
  "animateTransform",
958
1000
  {
@@ -965,12 +1007,12 @@ function _e({
965
1007
  ),
966
1008
  /* @__PURE__ */ e("path", { d: "M36 182 L55 162 L64 168 L45 182 Z", fill: "#2b2f36", stroke: "#1e293b", strokeWidth: "1" }),
967
1009
  /* @__PURE__ */ e("path", { d: "M 45 180 C 45 165, 80 170, 94 174", fill: "none", stroke: "#ef4444", strokeWidth: "2.5", strokeLinecap: "round" }),
968
- /* @__PURE__ */ c("g", { fill: t, stroke: "#b05418", strokeWidth: "1", children: [
1010
+ /* @__PURE__ */ o("g", { fill: t, stroke: "#b05418", strokeWidth: "1", children: [
969
1011
  /* @__PURE__ */ e("rect", { x: "58", y: "160", width: "10", height: "12", rx: "4", transform: "rotate(-10 63 166)" }),
970
1012
  /* @__PURE__ */ e("rect", { x: "62", y: "163", width: "9", height: "10", rx: "3", transform: "rotate(-15 66.5 168)" })
971
1013
  ] })
972
1014
  ] }),
973
- /* @__PURE__ */ c("g", { id: "rra-right-arm-cable", children: [
1015
+ /* @__PURE__ */ o("g", { id: "rra-right-arm-cable", children: [
974
1016
  /* @__PURE__ */ e(
975
1017
  "animateTransform",
976
1018
  {
@@ -983,13 +1025,13 @@ function _e({
983
1025
  ),
984
1026
  /* @__PURE__ */ e("path", { d: "M164 182 L145 162 L136 168 L155 182 Z", fill: "#2b2f36", stroke: "#1e293b", strokeWidth: "1" }),
985
1027
  /* @__PURE__ */ e("path", { d: "M 155 180 C 155 165, 120 170, 106 174", fill: "none", stroke: "#1e293b", strokeWidth: "2.5", strokeLinecap: "round" }),
986
- /* @__PURE__ */ c("g", { fill: t, stroke: "#b05418", strokeWidth: "1", children: [
1028
+ /* @__PURE__ */ o("g", { fill: t, stroke: "#b05418", strokeWidth: "1", children: [
987
1029
  /* @__PURE__ */ e("rect", { x: "132", y: "160", width: "10", height: "12", rx: "4", transform: "rotate(10 137 166)" }),
988
1030
  /* @__PURE__ */ e("rect", { x: "129", y: "163", width: "9", height: "10", rx: "3", transform: "rotate(15 133.5 168)" })
989
1031
  ] })
990
1032
  ] })
991
1033
  ] }),
992
- l === "working" && s === "paper" && /* @__PURE__ */ c("g", { id: "rra-working-workspace-paper", children: [
1034
+ l === "working" && s === "paper" && /* @__PURE__ */ o("g", { id: "rra-working-workspace-paper", children: [
993
1035
  /* @__PURE__ */ e(
994
1036
  "animateTransform",
995
1037
  {
@@ -1003,20 +1045,20 @@ function _e({
1003
1045
  /* @__PURE__ */ e("path", { d: "M36 182 L54 168 L64 176 L48 182 Z", fill: "#2b2f36", stroke: "#1e293b", strokeWidth: "1" }),
1004
1046
  /* @__PURE__ */ e("path", { d: "M164 182 L146 168 L136 176 L152 182 Z", fill: "#2b2f36", stroke: "#1e293b", strokeWidth: "1" }),
1005
1047
  /* @__PURE__ */ e("path", { d: "M50 118 C 66 120 84 128 100 134 C 116 128 134 120 150 118 L 148 124 C 134 126 116 134 100 150 C 84 134 66 126 52 124 Z", fill: "#f8fafc", stroke: "#d9d2c4", strokeWidth: "1" }),
1006
- /* @__PURE__ */ c("g", { stroke: "#9aa4b2", strokeWidth: "1.1", strokeLinecap: "round", children: [
1048
+ /* @__PURE__ */ o("g", { stroke: "#9aa4b2", strokeWidth: "1.1", strokeLinecap: "round", children: [
1007
1049
  /* @__PURE__ */ e("line", { x1: "60", y1: "124", x2: "92", y2: "137" }),
1008
1050
  /* @__PURE__ */ e("line", { x1: "140", y1: "124", x2: "108", y2: "137" })
1009
1051
  ] }),
1010
1052
  /* @__PURE__ */ e("path", { d: "M100 148 C 84 136 68 130 52 126 L 60 182 C 78 178 90 177 100 176 Z", fill: "#20242b", stroke: "#0f1216", strokeWidth: "1.5" }),
1011
1053
  /* @__PURE__ */ e("path", { d: "M100 148 C 116 136 132 130 148 126 L 140 182 C 122 178 110 177 100 176 Z", fill: "#20242b", stroke: "#0f1216", strokeWidth: "1.5" }),
1012
1054
  /* @__PURE__ */ e("line", { x1: "100", y1: "134", x2: "100", y2: "176", stroke: "#0f1216", strokeWidth: "1.4" }),
1013
- /* @__PURE__ */ c("g", { fill: t, stroke: "#b05418", strokeWidth: "1", children: [
1055
+ /* @__PURE__ */ o("g", { fill: t, stroke: "#b05418", strokeWidth: "1", children: [
1014
1056
  /* @__PURE__ */ e("circle", { cx: "60", cy: "180", r: "7" }),
1015
1057
  /* @__PURE__ */ e("rect", { x: "57", y: "170", width: "7", height: "12", rx: "3" }),
1016
1058
  /* @__PURE__ */ e("rect", { x: "62", y: "172", width: "7", height: "11", rx: "3" }),
1017
1059
  /* @__PURE__ */ e("rect", { x: "67", y: "173", width: "6", height: "10", rx: "3" })
1018
1060
  ] }),
1019
- /* @__PURE__ */ c("g", { fill: t, stroke: "#b05418", strokeWidth: "1", children: [
1061
+ /* @__PURE__ */ o("g", { fill: t, stroke: "#b05418", strokeWidth: "1", children: [
1020
1062
  /* @__PURE__ */ e("circle", { cx: "140", cy: "180", r: "7" }),
1021
1063
  /* @__PURE__ */ e("rect", { x: "136", y: "170", width: "7", height: "12", rx: "3" }),
1022
1064
  /* @__PURE__ */ e("rect", { x: "131", y: "172", width: "7", height: "11", rx: "3" }),
@@ -1024,7 +1066,7 @@ function _e({
1024
1066
  ] })
1025
1067
  ] })
1026
1068
  ] }),
1027
- /* @__PURE__ */ c("g", { id: "rra-think", opacity: "0", children: [
1069
+ /* @__PURE__ */ o("g", { id: "rra-think", opacity: "0", children: [
1028
1070
  /* @__PURE__ */ e("circle", { cx: "150", cy: "54", r: "4", fill: "#ffffff", stroke: "#8b5cf6", strokeWidth: "2" }),
1029
1071
  /* @__PURE__ */ e("circle", { cx: "165", cy: "42", r: "5.5", fill: "#ffffff", stroke: "#8b5cf6", strokeWidth: "2" }),
1030
1072
  /* @__PURE__ */ e("circle", { cx: "182", cy: "28", r: "7", fill: "#ffffff", stroke: "#8b5cf6", strokeWidth: "2.5" })
@@ -1033,21 +1075,21 @@ function _e({
1033
1075
  }
1034
1076
  );
1035
1077
  }
1036
- function Oe({ collection: i, seed: n, size: l = 44, className: o = "" }) {
1037
- const [a, t] = ce(null);
1078
+ function Ye({ collection: i, seed: r, size: l = 44, className: c = "" }) {
1079
+ const [a, t] = ae(null);
1038
1080
  return ee(() => {
1039
1081
  let d = !1;
1040
- return t(null), $e(i, n).then((s) => {
1082
+ return t(null), Te(i, r).then((s) => {
1041
1083
  d || t(s);
1042
1084
  }).catch(() => {
1043
1085
  d || t(null);
1044
1086
  }), () => {
1045
1087
  d = !0;
1046
1088
  };
1047
- }, [i, n]), /* @__PURE__ */ e(
1089
+ }, [i, r]), /* @__PURE__ */ e(
1048
1090
  "div",
1049
1091
  {
1050
- className: `flex items-center justify-center overflow-hidden ${o}`,
1092
+ className: `flex items-center justify-center overflow-hidden ${c}`,
1051
1093
  style: { width: l, height: l },
1052
1094
  "aria-hidden": !0,
1053
1095
  children: a ? /* @__PURE__ */ e(
@@ -1060,11 +1102,11 @@ function Oe({ collection: i, seed: n, size: l = 44, className: o = "" }) {
1060
1102
  }
1061
1103
  );
1062
1104
  }
1063
- function Ge({
1105
+ function He({
1064
1106
  analyser: i,
1065
- state: n,
1107
+ state: r,
1066
1108
  height: l = 80,
1067
- className: o = "",
1109
+ className: c = "",
1068
1110
  style: a,
1069
1111
  stateColors: t
1070
1112
  }) {
@@ -1078,94 +1120,94 @@ function Ge({
1078
1120
  return ee(() => {
1079
1121
  const g = d.current;
1080
1122
  if (!g) return;
1081
- const r = g.getContext("2d");
1082
- if (!r) return;
1083
- const z = () => {
1123
+ const n = g.getContext("2d");
1124
+ if (!n) return;
1125
+ const _ = () => {
1084
1126
  const w = window.devicePixelRatio || 1, m = g.getBoundingClientRect();
1085
- g.width = m.width * w, g.height = m.height * w, r.scale(w, w);
1127
+ g.width = m.width * w, g.height = m.height * w, n.scale(w, w);
1086
1128
  };
1087
- z(), window.addEventListener("resize", z);
1088
- let S = 0, T = new Uint8Array(0);
1089
- i && (i.fftSize = 128, S = i.frequencyBinCount, T = new Uint8Array(S));
1129
+ _(), window.addEventListener("resize", _);
1130
+ let W = 0, B = new Uint8Array(0);
1131
+ i && (i.fftSize = 128, W = i.frequencyBinCount, B = new Uint8Array(W));
1090
1132
  const V = () => {
1091
1133
  const w = g.width / (window.devicePixelRatio || 1), m = g.height / (window.devicePixelRatio || 1);
1092
- r.fillStyle = "rgba(9, 9, 11, 0.2)", r.fillRect(0, 0, w, m), h.current += 0.05;
1134
+ n.fillStyle = "rgba(9, 9, 11, 0.2)", n.fillRect(0, 0, w, m), h.current += 0.05;
1093
1135
  const F = h.current;
1094
- if (n === "speaking" && i) {
1095
- i.getByteFrequencyData(T), r.lineWidth = 3, r.strokeStyle = p.speaking, r.shadowBlur = 15, r.shadowColor = _(p.speaking, 0.6), r.beginPath();
1096
- const f = w / S;
1136
+ if (r === "speaking" && i) {
1137
+ i.getByteFrequencyData(B), n.lineWidth = 3, n.strokeStyle = p.speaking, n.shadowBlur = 15, n.shadowColor = j(p.speaking, 0.6), n.beginPath();
1138
+ const f = w / W;
1097
1139
  let k = 0;
1098
- for (let M = 0; M < S; M++) {
1099
- const y = T[M] / 255, N = m / 2 + Math.sin(M * 0.15 + F * 2) * (y * m * 0.4);
1100
- M === 0 ? r.moveTo(k, N) : r.lineTo(k, N), k += f;
1140
+ for (let M = 0; M < W; M++) {
1141
+ const y = B[M] / 255, L = m / 2 + Math.sin(M * 0.15 + F * 2) * (y * m * 0.4);
1142
+ M === 0 ? n.moveTo(k, L) : n.lineTo(k, L), k += f;
1101
1143
  }
1102
- r.lineTo(w, m / 2), r.stroke(), r.shadowBlur = 0;
1103
- } else if (n === "listening") {
1144
+ n.lineTo(w, m / 2), n.stroke(), n.shadowBlur = 0;
1145
+ } else if (r === "listening") {
1104
1146
  let f = 0;
1105
- if (i && T.length > 0) {
1106
- i.getByteTimeDomainData(T);
1147
+ if (i && B.length > 0) {
1148
+ i.getByteTimeDomainData(B);
1107
1149
  let y = 0;
1108
- for (let N = 0; N < T.length; N++) {
1109
- const J = Math.abs(T[N] - 128);
1150
+ for (let L = 0; L < B.length; L++) {
1151
+ const J = Math.abs(B[L] - 128);
1110
1152
  J > y && (y = J);
1111
1153
  }
1112
1154
  f = Math.min(1, y / 128);
1113
1155
  }
1114
1156
  const k = 4 + f * 36, M = 3 + f * 27;
1115
- r.shadowBlur = 12, r.lineWidth = 2.5, r.strokeStyle = _(p.listening, 0.7), r.shadowColor = _(p.listening, 0.4), r.beginPath();
1157
+ n.shadowBlur = 12, n.lineWidth = 2.5, n.strokeStyle = j(p.listening, 0.7), n.shadowColor = j(p.listening, 0.4), n.beginPath();
1116
1158
  for (let y = 0; y < w; y++) {
1117
- const N = m / 2 + Math.sin(y * 0.02 + F * 1.5) * Math.sin(y * 5e-3) * k;
1118
- y === 0 ? r.moveTo(y, N) : r.lineTo(y, N);
1159
+ const L = m / 2 + Math.sin(y * 0.02 + F * 1.5) * Math.sin(y * 5e-3) * k;
1160
+ y === 0 ? n.moveTo(y, L) : n.lineTo(y, L);
1119
1161
  }
1120
- r.stroke(), r.strokeStyle = _(p.listening, 0.5), r.shadowColor = _(p.listening, 0.3), r.beginPath();
1162
+ n.stroke(), n.strokeStyle = j(p.listening, 0.5), n.shadowColor = j(p.listening, 0.3), n.beginPath();
1121
1163
  for (let y = 0; y < w; y++) {
1122
- const N = m / 2 + Math.sin(y * 0.015 - F * 1.2 + Math.PI) * Math.sin(y * 5e-3) * M;
1123
- y === 0 ? r.moveTo(y, N) : r.lineTo(y, N);
1164
+ const L = m / 2 + Math.sin(y * 0.015 - F * 1.2 + Math.PI) * Math.sin(y * 5e-3) * M;
1165
+ y === 0 ? n.moveTo(y, L) : n.lineTo(y, L);
1124
1166
  }
1125
- r.stroke(), r.shadowBlur = 0;
1126
- } else if (n === "thinking") {
1127
- r.shadowBlur = 10, r.shadowColor = _(p.thinking, 0.4), r.lineWidth = 2, r.strokeStyle = _(p.thinking, 0.7), r.beginPath();
1167
+ n.stroke(), n.shadowBlur = 0;
1168
+ } else if (r === "thinking") {
1169
+ n.shadowBlur = 10, n.shadowColor = j(p.thinking, 0.4), n.lineWidth = 2, n.strokeStyle = j(p.thinking, 0.7), n.beginPath();
1128
1170
  for (let f = 0; f < w; f++) {
1129
1171
  const k = m / 2 + Math.sin(f * 0.03 + F) * 5 + Math.sin(f * 0.01 - F * 0.5) * 8;
1130
- f === 0 ? r.moveTo(f, k) : r.lineTo(f, k);
1172
+ f === 0 ? n.moveTo(f, k) : n.lineTo(f, k);
1131
1173
  }
1132
- r.stroke(), r.shadowBlur = 0;
1133
- } else if (n === "working") {
1134
- r.shadowBlur = 10, r.shadowColor = _(p.working, 0.4), r.lineWidth = 2, r.strokeStyle = _(p.working, 0.7), r.beginPath();
1174
+ n.stroke(), n.shadowBlur = 0;
1175
+ } else if (r === "working") {
1176
+ n.shadowBlur = 10, n.shadowColor = j(p.working, 0.4), n.lineWidth = 2, n.strokeStyle = j(p.working, 0.7), n.beginPath();
1135
1177
  for (let f = 0; f < w; f += 8) {
1136
1178
  const k = m / 2 + Math.sin(f * 0.04 + F * 2.5) * 12 + Math.cos(f * 0.01 - F) * 6, M = m / 2 + Math.round((k - m / 2) / 6) * 6;
1137
- f === 0 ? r.moveTo(f, M) : (r.lineTo(f, M), r.lineTo(Math.min(w, f + 8), M));
1179
+ f === 0 ? n.moveTo(f, M) : (n.lineTo(f, M), n.lineTo(Math.min(w, f + 8), M));
1138
1180
  }
1139
- r.stroke(), r.shadowBlur = 0;
1181
+ n.stroke(), n.shadowBlur = 0;
1140
1182
  } else {
1141
- r.lineWidth = 1.5, r.strokeStyle = _(p.idle, 0.3), r.beginPath();
1183
+ n.lineWidth = 1.5, n.strokeStyle = j(p.idle, 0.3), n.beginPath();
1142
1184
  for (let f = 0; f < w; f++) {
1143
1185
  const k = m / 2 + Math.sin(f * 0.01 + F * 0.2) * 2;
1144
- f === 0 ? r.moveTo(f, k) : r.lineTo(f, k);
1186
+ f === 0 ? n.moveTo(f, k) : n.lineTo(f, k);
1145
1187
  }
1146
- r.stroke();
1188
+ n.stroke();
1147
1189
  }
1148
1190
  s.current = requestAnimationFrame(V);
1149
1191
  };
1150
1192
  return V(), () => {
1151
- window.removeEventListener("resize", z), s.current && cancelAnimationFrame(s.current);
1193
+ window.removeEventListener("resize", _), s.current && cancelAnimationFrame(s.current);
1152
1194
  };
1153
- }, [i, n, t]), /* @__PURE__ */ c("div", { className: `w-full bg-zinc-950/80 border border-zinc-800/40 rounded-xl overflow-hidden p-2 ${o}`, style: a, children: [
1154
- /* @__PURE__ */ c("div", { className: "flex justify-between items-center px-2 mb-1", children: [
1195
+ }, [i, r, t]), /* @__PURE__ */ o("div", { className: `w-full bg-zinc-950/80 border border-zinc-800/40 rounded-xl overflow-hidden p-2 ${c}`, style: a, children: [
1196
+ /* @__PURE__ */ o("div", { className: "flex justify-between items-center px-2 mb-1", children: [
1155
1197
  /* @__PURE__ */ e("span", { className: "text-[10px] text-zinc-500 uppercase tracking-widest font-mono font-bold", children: "Audio Waveform Telemetry" }),
1156
- /* @__PURE__ */ c("span", { className: "flex h-2 w-2 relative", children: [
1198
+ /* @__PURE__ */ o("span", { className: "flex h-2 w-2 relative", children: [
1157
1199
  /* @__PURE__ */ e(
1158
1200
  "span",
1159
1201
  {
1160
1202
  className: "animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",
1161
- style: { backgroundColor: p[n] }
1203
+ style: { backgroundColor: p[r] }
1162
1204
  }
1163
1205
  ),
1164
1206
  /* @__PURE__ */ e(
1165
1207
  "span",
1166
1208
  {
1167
1209
  className: "relative inline-flex rounded-full h-2 w-2",
1168
- style: { backgroundColor: p[n] }
1210
+ style: { backgroundColor: p[r] }
1169
1211
  }
1170
1212
  )
1171
1213
  ] })
@@ -1180,11 +1222,11 @@ function Ge({
1180
1222
  )
1181
1223
  ] });
1182
1224
  }
1183
- function Ve({ analyser: i, enabled: n, onFrame: l, onStop: o }) {
1184
- const a = O(l), t = O(o);
1185
- a.current = l, t.current = o, ee(() => {
1225
+ function Ke({ analyser: i, enabled: r, onFrame: l, onStop: c }) {
1226
+ const a = O(l), t = O(c);
1227
+ a.current = l, t.current = c, ee(() => {
1186
1228
  var p;
1187
- if (!n) {
1229
+ if (!r) {
1188
1230
  (p = t.current) == null || p.call(t);
1189
1231
  return;
1190
1232
  }
@@ -1197,35 +1239,39 @@ function Ve({ analyser: i, enabled: n, onFrame: l, onStop: o }) {
1197
1239
  var g;
1198
1240
  cancelAnimationFrame(s), (g = t.current) == null || g.call(t);
1199
1241
  };
1200
- }, [i, n]);
1242
+ }, [i, r]);
1201
1243
  }
1202
1244
  export {
1203
- Ge as AudioVisualizer,
1245
+ He as AudioVisualizer,
1246
+ Ce as AvatarCaption,
1247
+ qe as AvatarThought,
1204
1248
  ue as ContractAvatar,
1205
- Se as DEFAULT_DICEBEAR_COLLECTION,
1206
- Re as DEFAULT_DICEBEAR_SEED,
1249
+ Re as DEFAULT_DICEBEAR_COLLECTION,
1250
+ Ee as DEFAULT_DICEBEAR_SEED,
1207
1251
  ye as DICEBEAR_FEATURED_FACES,
1208
- We as DICEBEAR_RIGS,
1209
- Qe as DICEBEAR_STYLES,
1210
- Ze as DICEBEAR_STYLE_BY_ID,
1211
- Be as DiceBearAvatar,
1212
- Oe as DiceBearThumb,
1213
- Ne as DoodleAvatar,
1252
+ $e as DICEBEAR_RIGS,
1253
+ We as DICEBEAR_STYLES,
1254
+ Ge as DICEBEAR_STYLE_BY_ID,
1255
+ Fe as DiceBearAvatar,
1256
+ Ye as DiceBearThumb,
1257
+ Qe as DoodleAvatar,
1214
1258
  ge as GeometricAvatar,
1215
- Ae as MemojiAvatar,
1216
- Le as PixelArtAvatar,
1217
- je as RealtimeAvatar,
1218
- He as SPEECH_ACTIVITY_BRAND,
1219
- _e as SquirrelAvatar,
1259
+ Le as MemojiAvatar,
1260
+ Se as PixelArtAvatar,
1261
+ Ve as RealtimeAvatar,
1262
+ et as SPEECH_ACTIVITY_BRAND,
1263
+ Ue as SquirrelAvatar,
1220
1264
  fe as collectionExportName,
1221
1265
  de as createMouthEngine,
1222
- we as createSpeechActivity,
1223
- Ke as isSpeechActivity,
1266
+ Me as createSpeechActivity,
1267
+ tt as isSpeechActivity,
1224
1268
  ke as loadDiceBear,
1225
- $e as renderDiceBearSvg,
1269
+ Te as renderDiceBearSvg,
1226
1270
  me as scopeSvgIds,
1227
- Ve as useAudioMouth,
1228
- Me as useAvatarRuntime,
1271
+ we as tailWindow,
1272
+ be as toPlainText,
1273
+ Ke as useAudioMouth,
1274
+ Ne as useAvatarRuntime,
1229
1275
  se as useReducedMotion,
1230
- Fe as useStreamingTextActivity
1276
+ ze as useStreamingTextActivity
1231
1277
  };