@convokit/widget 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,43 +1,23 @@
1
1
  # @convokit/widget
2
2
 
3
- Chat UI widgets for your website. The public API is intentionally small **four drop‑in components**:
3
+ > **ConvoKit is currently in early access.** The waitlist is live[join at convokit.dev](https://convokit.dev) to get early access.
4
4
 
5
- | Component | Layout | Integration | You provide |
6
- |-----------|--------|--------------|-------------|
7
- | **PopupWidget** | Bubble (corner) | ConvoKit | `apiKey` (public ConvoKit key) |
8
- | **FullScreenWidget** | Full page | ConvoKit | `apiKey`, optional `onBack` |
9
- | **PopupBackendWidget** | Bubble | Your backend | `apiUrl`, `apiKey`, optional `authToken` |
10
- | **FullScreenBackendWidget** | Full page | Your backend | `apiUrl`, `apiKey`, optional `authToken`, `onBack` |
5
+ Add an AI-powered chat widget to any React or Next.js app in minutes. ConvoKit handles the AI, knowledge base, and conversations — you just drop in a component.
11
6
 
12
- All lower‑level/internal components (`PopupKey`, `FullScreenKey`, `PopupBackend`, `PopupControlled`, etc.) are **not exported** from the package anymore. The four widgets above are what you use in apps.
7
+ **Website:** [convokit.dev](https://convokit.dev)
13
8
 
14
9
  ---
15
10
 
16
- ## What to call and how
11
+ ## Four drop-in components
17
12
 
18
- Use **one import** and **one component** per screen. All of these are from `@convokit/widget`. No separate CSS import needed (styles are in the bundle).
13
+ | Component | Layout | You provide |
14
+ |-----------|--------|-------------|
15
+ | **PopupWidget** | Bubble in corner | `apiKey` (your ConvoKit public key) |
16
+ | **FullScreenWidget** | Full page | `apiKey`, optional `onBack` |
17
+ | **PopupBackendWidget** | Bubble in corner | `apiUrl`, `apiKey` |
18
+ | **FullScreenBackendWidget** | Full page | `apiUrl`, `apiKey`, optional `onBack` |
19
19
 
20
- | What to call | How (minimal) |
21
- |--------------|----------------|
22
- | **PopupWidget** | `<PopupWidget apiKey={key} />` — popup bubble, ConvoKit key. |
23
- | **FullScreenWidget** | `<FullScreenWidget apiKey={key} onBack={() => router.back()} />` — full-page chat, ConvoKit key. |
24
- | **PopupBackendWidget** | `<PopupBackendWidget apiUrl="/api/chat" apiKey={myKey} />` — popup, your backend. |
25
- | **FullScreenBackendWidget** | `<FullScreenBackendWidget apiUrl="/api/chat" apiKey={myKey} onBack={() => router.back()} />` — full-page, your backend. |
26
-
27
- **Optional props (all wrappers):** `title`, `welcomeMessage`, `widgetId`, `primaryColor`. Popup ones also accept `position`. Backend ones accept `authToken`. Full-screen ones accept `backLabel`. PopupWidget / FullScreenWidget also accept `persistMessages`.
28
-
29
- **If you need full control** (your own state/API), use the low-level components with a config object:
30
-
31
- | What to call | How |
32
- |--------------|-----|
33
- | **PopupKey** | `<PopupKey config={keyConfig} />` — config: `KeyConfig` (e.g. `{ key, title, position }`). |
34
- | **FullScreenKey** | `<FullScreenKey config={keyConfig} onBack={fn} backLabel="Back" />` |
35
- | **PopupBackend** | `<PopupBackend config={backendConfig} />` — config: `BackendConfig` (e.g. `{ apiUrl, apiKey }`). |
36
- | **FullScreenBackend** | `<FullScreenBackend config={backendConfig} onBack={fn} backLabel="Back" />` |
37
- | **PopupControlled** | `<PopupControlled config={controlledConfig} />` — you pass `messages`, `onMessagesUpdate`, `onSend`. |
38
- | **FullScreenControlled** | `<FullScreenControlled config={controlledConfig} onBack={fn} backLabel="Back" />` |
39
-
40
- **Types you can import:** `KeyConfig`, `BackendConfig`, `ControlledConfig`, `PopupWidgetProps`, `FullScreenWidgetProps`, `PopupBackendWidgetProps`, `FullScreenBackendWidgetProps`, `ChatMessage`, `ChatHistoryItem`, `ChatResponse`, `ThemeOptions`.
20
+ No separate CSS import needed styles are bundled.
41
21
 
42
22
  ---
43
23
 
@@ -53,66 +33,51 @@ pnpm add @convokit/widget
53
33
 
54
34
  ---
55
35
 
56
- ## Quick start (React / Vite)
36
+ ## Quick start
57
37
 
58
- Add the chat bubble with one import. Styles are included in the bundle.
38
+ ### React / Vite
59
39
 
60
40
  ```tsx
61
- // Any React entry (e.g. App.tsx)
62
41
  import { PopupWidget } from '@convokit/widget';
63
42
 
64
43
  export function App() {
65
44
  return (
66
45
  <div>
67
- {/* Your app UI */}
46
+ {/* your app */}
68
47
  <PopupWidget apiKey={import.meta.env.VITE_CONVOKIT_KEY ?? ''} />
69
48
  </div>
70
49
  );
71
50
  }
72
51
  ```
73
52
 
74
- - **React (CRA / Vite / plain SPA)**: just import and render the widget anywhere in your tree.
75
- - Optional props (all wrappers): `title`, `welcomeMessage`, `widgetId`, `primaryColor`.
76
- - Popup widgets also accept `position`, `persistMessages`. Backend widgets accept `authToken`. Full‑screen widgets accept `onBack` and `backLabel`.
77
-
78
- If the required props are missing (`apiKey` for key‑based widgets, or `apiUrl`/`apiKey` for backend widgets), the widget renders nothing.
53
+ ### Next.js App Router (recommended)
79
54
 
80
- ### Next.js only: one import, no wrapper (recommended)
81
-
82
- If you use **Next.js App Router**, use the Next-specific entry so you don’t write `dynamic()` or a wrapper yourself:
55
+ Use the built-in Next.js entry no need to write `dynamic()` yourself:
83
56
 
84
57
  ```tsx
85
- // app/layout.tsx (or any page)
58
+ // app/layout.tsx
86
59
  import { PopupWidgetNext } from '@convokit/widget/next';
87
60
 
88
61
  export default function Layout({ children }) {
89
62
  return (
90
63
  <html><body>
91
64
  {children}
92
- <PopupWidgetNext />
65
+ <PopupWidgetNext apiKey={process.env.NEXT_PUBLIC_CONVOKIT_KEY ?? ''} />
93
66
  </body></html>
94
67
  );
95
68
  }
96
69
  ```
97
70
 
98
- - **`PopupWidgetNext`** uses `next/dynamic` with `ssr: false` and reads `process.env.NEXT_PUBLIC_CONVOKIT_KEY` if you dont pass `apiKey`.
99
- - Optional: pass `apiKey`, `title`, `welcomeMessage`, `position`, etc. as props.
100
- - You still need **transpilePackages** (and optionally resolve alias for react) in `next.config.js` if you see duplicate-React errors; see “Next.js App Router (avoid duplicate React)” below.
101
-
102
- ### Next.js App Router (avoid duplicate React)
103
-
104
- The widget is client-only (hooks, DOM). In Next.js you must use **one React instance** in the browser. If the widget resolves to a different copy of React than your app, you get errors like `Cannot read properties of undefined (reading 'ReactCurrentDispatcher')`.
71
+ `PopupWidgetNext` uses `next/dynamic` with `ssr: false` automatically and reads `NEXT_PUBLIC_CONVOKIT_KEY` if you don't pass `apiKey`.
105
72
 
106
- **Fix 1 Load the widget only on the client (recommended):** use `next/dynamic` with `ssr: false` so the widget never runs on the server and always uses the client React.
73
+ ### Next.js App Router (manual dynamic import)
107
74
 
108
75
  ```tsx
109
- // app/layout.tsx or a client component
110
76
  'use client';
111
-
112
77
  import dynamic from 'next/dynamic';
113
78
 
114
79
  const PopupWidget = dynamic(
115
- () => import('@convokit/widget').then((mod) => mod.PopupWidget),
80
+ () => import('@convokit/widget').then((m) => m.PopupWidget),
116
81
  { ssr: false }
117
82
  );
118
83
 
@@ -126,150 +91,101 @@ export default function Layout({ children }) {
126
91
  }
127
92
  ```
128
93
 
129
- **Fix 2 — Use the app’s React for the widget:** in `next.config.js`, add `transpilePackages` and (if needed with pnpm) resolve `react` / `react-dom` to a single copy so the widget is bundled with your app’s React.
94
+ ---
130
95
 
131
- ```js
132
- // next.config.js
133
- /** @type {import('next').NextConfig} */
134
- const nextConfig = {
135
- transpilePackages: ['@convokit/widget'],
136
- webpack: (config) => {
137
- config.resolve.alias = {
138
- ...config.resolve.alias,
139
- react: require.resolve('react'),
140
- 'react-dom': require.resolve('react-dom'),
141
- };
142
- return config;
143
- },
144
- };
145
- module.exports = nextConfig;
146
- ```
96
+ ## All four components
147
97
 
148
- Use **Fix 1** for a quick fix; use **Fix 1 + Fix 2** if you still see duplicate-React issues (e.g. with pnpm).
98
+ ```tsx
99
+ // Popup bubble – ConvoKit key
100
+ <PopupWidget apiKey="pk_live_..." />
149
101
 
150
- ### Other drop-in wrappers (all four)
102
+ // Full-page chat ConvoKit key
103
+ <FullScreenWidget apiKey="pk_live_..." onBack={() => router.back()} />
151
104
 
152
- | Wrapper | Use case | Required props |
153
- |---------|----------|-----------------|
154
- | **PopupWidget** | Popup with ConvoKit key | `apiKey` |
155
- | **FullScreenWidget** | Full-page chat with ConvoKit key | `apiKey`, `onBack` (e.g. `() => router.back()`) |
156
- | **PopupBackendWidget** | Popup talking to your backend | `apiUrl`, `apiKey` |
157
- | **FullScreenBackendWidget** | Full-page chat talking to your backend | `apiUrl`, `apiKey`, `onBack` |
105
+ // Popup bubble your own backend
106
+ <PopupBackendWidget apiUrl="/api/chat" apiKey="your-key" />
158
107
 
159
- #### React / Vite examples
108
+ // Full-page chat your own backend
109
+ <FullScreenBackendWidget apiUrl="/api/chat" apiKey="your-key" onBack={() => router.back()} />
110
+ ```
160
111
 
161
- ```tsx
162
- // Full-screen (Key mode)
163
- import { FullScreenWidget } from '@convokit/widget';
112
+ ---
164
113
 
165
- export function ChatPage() {
166
- const apiKey = import.meta.env.VITE_CONVOKIT_KEY ?? '';
167
- return (
168
- <FullScreenWidget
169
- apiKey={apiKey}
170
- onBack={() => {
171
- // e.g. navigate(-1) with react-router
172
- }}
173
- />
174
- );
175
- }
114
+ ## Props
176
115
 
177
- // Popup (your backend)
178
- import { PopupBackendWidget } from '@convokit/widget';
116
+ **All components accept:**
179
117
 
180
- export function App() {
181
- return (
182
- <>
183
- {/* your UI */}
184
- <PopupBackendWidget apiUrl="/api/chat" apiKey={import.meta.env.VITE_BACKEND_KEY ?? ''} />
185
- </>
186
- );
187
- }
118
+ | Prop | Type | Description |
119
+ |------|------|-------------|
120
+ | `title` | `string` | Widget header title |
121
+ | `welcomeMessage` | `string` | First message shown to the user |
122
+ | `widgetId` | `string` | Identifier for the bot / channel |
123
+ | `primaryColor` | `string` | Accent color (hex or CSS color) |
188
124
 
189
- // Full-screen (your backend)
190
- import { FullScreenBackendWidget } from '@convokit/widget';
125
+ **Popup components also accept:**
191
126
 
192
- export function Support() {
193
- return (
194
- <FullScreenBackendWidget
195
- apiUrl="/api/chat"
196
- apiKey={import.meta.env.VITE_BACKEND_KEY ?? ''}
197
- onBack={() => {
198
- // go back / close
199
- }}
200
- />
201
- );
202
- }
203
- ```
127
+ | Prop | Type | Description |
128
+ |------|------|-------------|
129
+ | `position` | `'bottom-right' \| 'bottom-left'` | Bubble position |
130
+ | `persistMessages` | `boolean` | Keep messages across page loads |
204
131
 
205
- #### Next.js (App Router) examples
132
+ **Backend components also accept:**
206
133
 
207
- ```tsx
208
- 'use client';
134
+ | Prop | Type | Description |
135
+ |------|------|-------------|
136
+ | `authToken` | `string` | Bearer token forwarded to your backend |
209
137
 
210
- import dynamic from 'next/dynamic';
138
+ **Full-screen components also accept:**
211
139
 
212
- // Popup with ConvoKit key
213
- const PopupWidget = dynamic(
214
- () => import('@convokit/widget').then((m) => m.PopupWidget),
215
- { ssr: false }
216
- );
140
+ | Prop | Type | Description |
141
+ |------|------|-------------|
142
+ | `onBack` | `() => void` | Called when user taps the back button |
143
+ | `backLabel` | `string` | Label for the back button |
217
144
 
218
- // Full-screen (Key mode)
219
- const FullScreenWidget = dynamic(
220
- () => import('@convokit/widget').then((m) => m.FullScreenWidget),
221
- { ssr: false }
222
- );
145
+ ---
223
146
 
224
- export default function Layout({ children }: { children: React.ReactNode }) {
225
- const apiKey = process.env.NEXT_PUBLIC_CONVOKIT_KEY ?? '';
226
- return (
227
- <html>
228
- <body>
229
- {children}
230
- <PopupWidget apiKey={apiKey} />
231
- </body>
232
- </html>
233
- );
234
- }
147
+ ## Advanced: low-level components
235
148
 
236
- // Full-screen page (Key mode)
237
- export function FullScreenChatPage() {
238
- const apiKey = process.env.NEXT_PUBLIC_CONVOKIT_KEY ?? '';
239
- const router = useRouter();
240
- return (
241
- <FullScreenWidget apiKey={apiKey} onBack={() => router.back()} />
242
- );
243
- }
244
- ```
149
+ If you need full control over state or API calls, use the low-level components directly:
245
150
 
246
- ---
151
+ | Component | Config type |
152
+ |-----------|-------------|
153
+ | `PopupKey` / `FullScreenKey` | `KeyConfig` |
154
+ | `PopupBackend` / `FullScreenBackend` | `BackendConfig` |
155
+ | `PopupControlled` / `FullScreenControlled` | `ControlledConfig` (you pass `messages`, `onMessagesUpdate`, `onSend`) |
156
+
157
+ **Types you can import:** `KeyConfig`, `BackendConfig`, `ControlledConfig`, `PopupWidgetProps`, `FullScreenWidgetProps`, `PopupBackendWidgetProps`, `FullScreenBackendWidgetProps`, `ChatMessage`, `ChatHistoryItem`, `ChatResponse`, `ThemeOptions`.
247
158
 
248
159
  ---
249
160
 
250
- ## Advanced configuration
161
+ ## Fixing duplicate React errors in Next.js
251
162
 
252
- Internally, the widgets are built on config types (**KeyConfig**, **BackendConfig**, **ControlledConfig**, **ThemeOptions**). If you need to dive deeper into those (for example, to match server behavior or migrate from the old low‑level API), see `WIDGET_CONFIG_REFERENCE.md` in this repo.
163
+ If you see `Cannot read properties of undefined (reading 'ReactCurrentDispatcher')`, add this to `next.config.js`:
253
164
 
254
- ---
165
+ ```js
166
+ const nextConfig = {
167
+ transpilePackages: ['@convokit/widget'],
168
+ webpack: (config) => {
169
+ config.resolve.alias = {
170
+ ...config.resolve.alias,
171
+ react: require.resolve('react'),
172
+ 'react-dom': require.resolve('react-dom'),
173
+ };
174
+ return config;
175
+ },
176
+ };
177
+ module.exports = nextConfig;
178
+ ```
255
179
 
256
- ## Development
180
+ ---
257
181
 
258
- Run the demo:
182
+ ## Early access
259
183
 
260
- ```bash
261
- npm run dev
262
- # or
263
- pnpm dev
264
- ```
184
+ ConvoKit is in early access. Get your API key and set up your knowledge base at **[convokit.dev](https://convokit.dev)**.
265
185
 
266
- Build the package:
186
+ The waitlist is live — join now to get early access.
267
187
 
268
- ```bash
269
- npm run build
270
- # or
271
- pnpm build
272
- ```
188
+ ---
273
189
 
274
190
  ## License
275
191
 
@@ -31,7 +31,7 @@ function vi(t) {
31
31
  let e;
32
32
  return () => (e === void 0 && (e = t()), e);
33
33
  }
34
- const ut = /* @__NO_SIDE_EFFECTS__ */ (t) => t, $a = (t, e) => (n) => e(t(n)), Ce = (...t) => t.reduce($a), xe = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
34
+ const ut = /* @__NO_SIDE_EFFECTS__ */ (t) => t, $a = (t, e) => (n) => e(t(n)), Ce = (...t) => t.reduce($a), be = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
35
35
  const i = e - t;
36
36
  return i === 0 ? 1 : (n - t) / i;
37
37
  };
@@ -183,7 +183,7 @@ function ur(t, e) {
183
183
  o[Ue[E]].cancel(S);
184
184
  }, state: s, steps: o };
185
185
  }
186
- const { schedule: I, cancel: It, state: q, steps: bn } = /* @__PURE__ */ ur(typeof requestAnimationFrame < "u" ? requestAnimationFrame : ut, !0);
186
+ const { schedule: I, cancel: It, state: q, steps: xn } = /* @__PURE__ */ ur(typeof requestAnimationFrame < "u" ? requestAnimationFrame : ut, !0);
187
187
  let Ge;
188
188
  function il() {
189
189
  Ge = void 0;
@@ -193,7 +193,7 @@ const nt = {
193
193
  set: (t) => {
194
194
  Ge = t, queueMicrotask(il);
195
195
  }
196
- }, fr = (t) => (e) => typeof e == "string" && e.startsWith(t), hr = /* @__PURE__ */ fr("--"), sl = /* @__PURE__ */ fr("var(--"), bi = (t) => sl(t) ? ol.test(t.split("/*")[0].trim()) : !1, ol = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
196
+ }, fr = (t) => (e) => typeof e == "string" && e.startsWith(t), hr = /* @__PURE__ */ fr("--"), sl = /* @__PURE__ */ fr("var(--"), xi = (t) => sl(t) ? ol.test(t.split("/*")[0].trim()) : !1, ol = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
197
197
  function Ts(t) {
198
198
  return typeof t != "string" ? !1 : t.split("/*")[0].includes("var(--");
199
199
  }
@@ -207,27 +207,27 @@ const ae = {
207
207
  }, je = {
208
208
  ...ae,
209
209
  default: 1
210
- }, we = (t) => Math.round(t * 1e5) / 1e5, xi = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
210
+ }, we = (t) => Math.round(t * 1e5) / 1e5, bi = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
211
211
  function rl(t) {
212
212
  return t == null;
213
213
  }
214
214
  const al = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, Ei = (t, e) => (n) => !!(typeof n == "string" && al.test(n) && n.startsWith(t) || e && !rl(n) && Object.prototype.hasOwnProperty.call(n, e)), dr = (t, e, n) => (i) => {
215
215
  if (typeof i != "string")
216
216
  return i;
217
- const [s, r, o, a] = i.match(xi);
217
+ const [s, r, o, a] = i.match(bi);
218
218
  return {
219
219
  [t]: parseFloat(s),
220
220
  [e]: parseFloat(r),
221
221
  [n]: parseFloat(o),
222
222
  alpha: a !== void 0 ? parseFloat(a) : 1
223
223
  };
224
- }, ll = (t) => wt(0, 255, t), xn = {
224
+ }, ll = (t) => wt(0, 255, t), bn = {
225
225
  ...ae,
226
226
  transform: (t) => Math.round(ll(t))
227
227
  }, jt = {
228
228
  test: /* @__PURE__ */ Ei("rgb", "red"),
229
229
  parse: /* @__PURE__ */ dr("red", "green", "blue"),
230
- transform: ({ red: t, green: e, blue: n, alpha: i = 1 }) => "rgba(" + xn.transform(t) + ", " + xn.transform(e) + ", " + xn.transform(n) + ", " + we(Ee.transform(i)) + ")"
230
+ transform: ({ red: t, green: e, blue: n, alpha: i = 1 }) => "rgba(" + bn.transform(t) + ", " + bn.transform(e) + ", " + bn.transform(n) + ", " + we(Ee.transform(i)) + ")"
231
231
  };
232
232
  function cl(t) {
233
233
  let e = "", n = "", i = "", s = "";
@@ -246,7 +246,7 @@ const Gn = {
246
246
  test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
247
247
  parse: parseFloat,
248
248
  transform: (e) => `${e}${t}`
249
- }), Lt = /* @__PURE__ */ Le("deg"), St = /* @__PURE__ */ Le("%"), b = /* @__PURE__ */ Le("px"), ul = /* @__PURE__ */ Le("vh"), fl = /* @__PURE__ */ Le("vw"), vs = {
249
+ }), Lt = /* @__PURE__ */ Le("deg"), St = /* @__PURE__ */ Le("%"), x = /* @__PURE__ */ Le("px"), ul = /* @__PURE__ */ Le("vh"), fl = /* @__PURE__ */ Le("vw"), vs = {
250
250
  ...St,
251
251
  parse: (t) => St.parse(t) / 100,
252
252
  transform: (t) => St.transform(t * 100)
@@ -265,7 +265,7 @@ const Gn = {
265
265
  }, hl = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
266
266
  function dl(t) {
267
267
  var e, n;
268
- return isNaN(t) && typeof t == "string" && (((e = t.match(xi)) == null ? void 0 : e.length) || 0) + (((n = t.match(hl)) == null ? void 0 : n.length) || 0) > 0;
268
+ return isNaN(t) && typeof t == "string" && (((e = t.match(bi)) == null ? void 0 : e.length) || 0) + (((n = t.match(hl)) == null ? void 0 : n.length) || 0) > 0;
269
269
  }
270
270
  const mr = "number", pr = "color", ml = "var", pl = "var(", Ss = "${}", gl = /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;
271
271
  function Pe(t) {
@@ -347,11 +347,11 @@ const As = (t, e) => {
347
347
  function Al(t, e) {
348
348
  return $n.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
349
349
  }
350
- function bl(t, e) {
350
+ function xl(t, e) {
351
351
  return (n) => N(t, e, n);
352
352
  }
353
353
  function Pi(t) {
354
- return typeof t == "number" ? bl : typeof t == "string" ? bi(t) ? Ze : W.test(t) ? As : Pl : Array.isArray(t) ? Tr : typeof t == "object" ? W.test(t) ? As : xl : Ze;
354
+ return typeof t == "number" ? xl : typeof t == "string" ? xi(t) ? Ze : W.test(t) ? As : Pl : Array.isArray(t) ? Tr : typeof t == "object" ? W.test(t) ? As : bl : Ze;
355
355
  }
356
356
  function Tr(t, e) {
357
357
  const n = [...t], i = n.length, s = t.map((r, o) => Pi(r)(r, e[o]));
@@ -361,7 +361,7 @@ function Tr(t, e) {
361
361
  return n;
362
362
  };
363
363
  }
364
- function xl(t, e) {
364
+ function bl(t, e) {
365
365
  const n = { ...t, ...e }, i = {};
366
366
  for (const s in n)
367
367
  t[s] !== void 0 && e[s] !== void 0 && (i[s] = Pi(t[s])(t[s], e[s]));
@@ -498,7 +498,7 @@ function Yn(t, e) {
498
498
  return t * Math.sqrt(1 - e * e);
499
499
  }
500
500
  const Il = ["duration", "bounce"], Vl = ["stiffness", "damping", "mass"];
501
- function bs(t, e) {
501
+ function xs(t, e) {
502
502
  return e.some((n) => t[n] !== void 0);
503
503
  }
504
504
  function kl(t) {
@@ -510,7 +510,7 @@ function kl(t) {
510
510
  isResolvedFromDuration: !1,
511
511
  ...t
512
512
  };
513
- if (!bs(t, Vl) && bs(t, Il))
513
+ if (!xs(t, Vl) && xs(t, Il))
514
514
  if (t.visualDuration) {
515
515
  const n = t.visualDuration, i = 2 * Math.PI / (n * 1.2), s = i * i, r = 2 * wt(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(s);
516
516
  e = {
@@ -643,7 +643,7 @@ function Nl(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
643
643
  if (l > 1)
644
644
  for (; f < t.length - 2 && !(c < t[f + 1]); f++)
645
645
  ;
646
- const d = /* @__PURE__ */ xe(t[f], t[f + 1], c);
646
+ const d = /* @__PURE__ */ be(t[f], t[f + 1], c);
647
647
  return a[f](d);
648
648
  };
649
649
  return n ? (c) => u(wt(t[0], t[r - 1], c)) : u;
@@ -651,7 +651,7 @@ function Nl(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
651
651
  function Fl(t, e) {
652
652
  const n = t[t.length - 1];
653
653
  for (let i = 1; i <= e; i++) {
654
- const s = /* @__PURE__ */ xe(0, e, i);
654
+ const s = /* @__PURE__ */ be(0, e, i);
655
655
  t.push(N(n, 1, s));
656
656
  }
657
657
  }
@@ -858,7 +858,7 @@ const Wt = (t) => t * 180 / Math.PI, qn = (t) => {
858
858
  skewX: (t) => Wt(Math.atan(t[1])),
859
859
  skewY: (t) => Wt(Math.atan(t[2])),
860
860
  skew: (t) => (Math.abs(t[1]) + Math.abs(t[2])) / 2
861
- }, Zn = (t) => (t = t % 360, t < 0 && (t += 360), t), xs = qn, Es = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), Ps = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), $l = {
861
+ }, Zn = (t) => (t = t % 360, t < 0 && (t += 360), t), bs = qn, Es = (t) => Math.sqrt(t[0] * t[0] + t[1] * t[1]), Ps = (t) => Math.sqrt(t[4] * t[4] + t[5] * t[5]), $l = {
862
862
  x: 12,
863
863
  y: 13,
864
864
  z: 14,
@@ -870,8 +870,8 @@ const Wt = (t) => t * 180 / Math.PI, qn = (t) => {
870
870
  scale: (t) => (Es(t) + Ps(t)) / 2,
871
871
  rotateX: (t) => Zn(Wt(Math.atan2(t[6], t[5]))),
872
872
  rotateY: (t) => Zn(Wt(Math.atan2(-t[2], t[0]))),
873
- rotateZ: xs,
874
- rotate: xs,
873
+ rotateZ: bs,
874
+ rotate: bs,
875
875
  skewX: (t) => Wt(Math.atan(t[4])),
876
876
  skewY: (t) => Wt(Math.atan(t[1])),
877
877
  skew: (t) => (Math.abs(t[1]) + Math.abs(t[4])) / 2
@@ -920,7 +920,7 @@ const le = [
920
920
  "skew",
921
921
  "skewX",
922
922
  "skewY"
923
- ], ce = new Set(le), Ds = (t) => t === ae || t === b, ql = /* @__PURE__ */ new Set(["x", "y", "z"]), Zl = le.filter((t) => !ql.has(t));
923
+ ], ce = new Set(le), Ds = (t) => t === ae || t === x, ql = /* @__PURE__ */ new Set(["x", "y", "z"]), Zl = le.filter((t) => !ql.has(t));
924
924
  function Jl(t) {
925
925
  const e = [];
926
926
  return Zl.forEach((n) => {
@@ -944,7 +944,7 @@ _t.translateX = _t.x;
944
944
  _t.translateY = _t.y;
945
945
  const Kt = /* @__PURE__ */ new Set();
946
946
  let ti = !1, ei = !1, ni = !1;
947
- function br() {
947
+ function xr() {
948
948
  if (ei) {
949
949
  const t = Array.from(Kt).filter((i) => i.needsMeasurement), e = new Set(t.map((i) => i.element)), n = /* @__PURE__ */ new Map();
950
950
  e.forEach((i) => {
@@ -963,20 +963,20 @@ function br() {
963
963
  }
964
964
  ei = !1, ti = !1, Kt.forEach((t) => t.complete(ni)), Kt.clear();
965
965
  }
966
- function xr() {
966
+ function br() {
967
967
  Kt.forEach((t) => {
968
968
  t.readKeyframes(), t.needsMeasurement && (ei = !0);
969
969
  });
970
970
  }
971
971
  function Ql() {
972
- ni = !0, xr(), br(), ni = !1;
972
+ ni = !0, br(), xr(), ni = !1;
973
973
  }
974
974
  class Li {
975
975
  constructor(e, n, i, s, r, o = !1) {
976
976
  this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = i, this.motionValue = s, this.element = r, this.isAsync = o;
977
977
  }
978
978
  scheduleResolve() {
979
- this.state = "scheduled", this.isAsync ? (Kt.add(this), ti || (ti = !0, I.read(xr), I.resolveKeyframes(br))) : (this.readKeyframes(), this.complete());
979
+ this.state = "scheduled", this.isAsync ? (Kt.add(this), ti || (ti = !0, I.read(br), I.resolveKeyframes(xr))) : (this.readKeyframes(), this.complete());
980
980
  }
981
981
  readKeyframes() {
982
982
  const { unresolvedKeyframes: e, name: n, element: i, motionValue: s } = this;
@@ -1360,7 +1360,7 @@ function Rr(t, e, n = 1) {
1360
1360
  const o = r.trim();
1361
1361
  return Go(o) ? parseFloat(o) : o;
1362
1362
  }
1363
- return bi(s) ? Rr(s, e, n + 1) : s;
1363
+ return xi(s) ? Rr(s, e, n + 1) : s;
1364
1364
  }
1365
1365
  const wc = {
1366
1366
  type: "spring",
@@ -1372,14 +1372,14 @@ const wc = {
1372
1372
  stiffness: 550,
1373
1373
  damping: t === 0 ? 2 * Math.sqrt(550) : 30,
1374
1374
  restSpeed: 10
1375
- }), bc = {
1375
+ }), xc = {
1376
1376
  type: "keyframes",
1377
1377
  duration: 0.8
1378
- }, xc = {
1378
+ }, bc = {
1379
1379
  type: "keyframes",
1380
1380
  ease: [0.25, 0.1, 0.35, 1],
1381
1381
  duration: 0.3
1382
- }, Ec = (t, { keyframes: e }) => e.length > 2 ? bc : ce.has(t) ? t.startsWith("scale") ? Ac(e[1]) : wc : xc, Pc = (t) => t !== null;
1382
+ }, Ec = (t, { keyframes: e }) => e.length > 2 ? xc : ce.has(t) ? t.startsWith("scale") ? Ac(e[1]) : wc : bc, Pc = (t) => t !== null;
1383
1383
  function Dc(t, { repeat: e, repeatType: n = "loop" }, i) {
1384
1384
  const s = t.filter(Pc), r = e && n !== "loop" && e % 2 === 1 ? 0 : s.length - 1;
1385
1385
  return s[r];
@@ -1773,7 +1773,7 @@ function Fc(t, e, n = {}) {
1773
1773
  const Bc = {
1774
1774
  test: (t) => t === "auto",
1775
1775
  parse: (t) => t
1776
- }, kr = (t) => (e) => e.test(t), Or = [ae, b, St, Lt, fl, ul, Bc], _s = (t) => Or.find(kr(t));
1776
+ }, kr = (t) => (e) => e.test(t), Or = [ae, x, St, Lt, fl, ul, Bc], _s = (t) => Or.find(kr(t));
1777
1777
  function Uc(t) {
1778
1778
  return typeof t == "number" ? t === 0 : t !== null ? t === "none" || t === "0" || Yo(t) : !0;
1779
1779
  }
@@ -1782,7 +1782,7 @@ function Wc(t) {
1782
1782
  const [e, n] = t.slice(0, -1).split("(");
1783
1783
  if (e === "drop-shadow")
1784
1784
  return t;
1785
- const [i] = n.match(xi) || [];
1785
+ const [i] = n.match(bi) || [];
1786
1786
  if (!i)
1787
1787
  return t;
1788
1788
  const s = n.replace(i, "");
@@ -1810,74 +1810,74 @@ const Hc = /\b([a-z-]*)\(.*?\)/gu, ai = {
1810
1810
  skew: Lt,
1811
1811
  skewX: Lt,
1812
1812
  skewY: Lt,
1813
- distance: b,
1814
- translateX: b,
1815
- translateY: b,
1816
- translateZ: b,
1817
- x: b,
1818
- y: b,
1819
- z: b,
1820
- perspective: b,
1821
- transformPerspective: b,
1813
+ distance: x,
1814
+ translateX: x,
1815
+ translateY: x,
1816
+ translateZ: x,
1817
+ x,
1818
+ y: x,
1819
+ z: x,
1820
+ perspective: x,
1821
+ transformPerspective: x,
1822
1822
  opacity: Ee,
1823
1823
  originX: vs,
1824
1824
  originY: vs,
1825
- originZ: b
1825
+ originZ: x
1826
1826
  }, Oi = {
1827
1827
  // Border props
1828
- borderWidth: b,
1829
- borderTopWidth: b,
1830
- borderRightWidth: b,
1831
- borderBottomWidth: b,
1832
- borderLeftWidth: b,
1833
- borderRadius: b,
1834
- radius: b,
1835
- borderTopLeftRadius: b,
1836
- borderTopRightRadius: b,
1837
- borderBottomRightRadius: b,
1838
- borderBottomLeftRadius: b,
1828
+ borderWidth: x,
1829
+ borderTopWidth: x,
1830
+ borderRightWidth: x,
1831
+ borderBottomWidth: x,
1832
+ borderLeftWidth: x,
1833
+ borderRadius: x,
1834
+ radius: x,
1835
+ borderTopLeftRadius: x,
1836
+ borderTopRightRadius: x,
1837
+ borderBottomRightRadius: x,
1838
+ borderBottomLeftRadius: x,
1839
1839
  // Positioning props
1840
- width: b,
1841
- maxWidth: b,
1842
- height: b,
1843
- maxHeight: b,
1844
- top: b,
1845
- right: b,
1846
- bottom: b,
1847
- left: b,
1848
- inset: b,
1849
- insetBlock: b,
1850
- insetBlockStart: b,
1851
- insetBlockEnd: b,
1852
- insetInline: b,
1853
- insetInlineStart: b,
1854
- insetInlineEnd: b,
1840
+ width: x,
1841
+ maxWidth: x,
1842
+ height: x,
1843
+ maxHeight: x,
1844
+ top: x,
1845
+ right: x,
1846
+ bottom: x,
1847
+ left: x,
1848
+ inset: x,
1849
+ insetBlock: x,
1850
+ insetBlockStart: x,
1851
+ insetBlockEnd: x,
1852
+ insetInline: x,
1853
+ insetInlineStart: x,
1854
+ insetInlineEnd: x,
1855
1855
  // Spacing props
1856
- padding: b,
1857
- paddingTop: b,
1858
- paddingRight: b,
1859
- paddingBottom: b,
1860
- paddingLeft: b,
1861
- paddingBlock: b,
1862
- paddingBlockStart: b,
1863
- paddingBlockEnd: b,
1864
- paddingInline: b,
1865
- paddingInlineStart: b,
1866
- paddingInlineEnd: b,
1867
- margin: b,
1868
- marginTop: b,
1869
- marginRight: b,
1870
- marginBottom: b,
1871
- marginLeft: b,
1872
- marginBlock: b,
1873
- marginBlockStart: b,
1874
- marginBlockEnd: b,
1875
- marginInline: b,
1876
- marginInlineStart: b,
1877
- marginInlineEnd: b,
1856
+ padding: x,
1857
+ paddingTop: x,
1858
+ paddingRight: x,
1859
+ paddingBottom: x,
1860
+ paddingLeft: x,
1861
+ paddingBlock: x,
1862
+ paddingBlockStart: x,
1863
+ paddingBlockEnd: x,
1864
+ paddingInline: x,
1865
+ paddingInlineStart: x,
1866
+ paddingInlineEnd: x,
1867
+ margin: x,
1868
+ marginTop: x,
1869
+ marginRight: x,
1870
+ marginBottom: x,
1871
+ marginLeft: x,
1872
+ marginBlock: x,
1873
+ marginBlockStart: x,
1874
+ marginBlockEnd: x,
1875
+ marginInline: x,
1876
+ marginInlineStart: x,
1877
+ marginInlineEnd: x,
1878
1878
  // Misc
1879
- backgroundPositionX: b,
1880
- backgroundPositionY: b,
1879
+ backgroundPositionX: x,
1880
+ backgroundPositionY: x,
1881
1881
  ...Kc,
1882
1882
  zIndex: Is,
1883
1883
  // SVG
@@ -1927,7 +1927,7 @@ class Yc extends Li {
1927
1927
  super.readKeyframes();
1928
1928
  for (let c = 0; c < e.length; c++) {
1929
1929
  let f = e[c];
1930
- if (typeof f == "string" && (f = f.trim(), bi(f))) {
1930
+ if (typeof f == "string" && (f = f.trim(), xi(f))) {
1931
1931
  const d = Rr(f, n.current);
1932
1932
  d !== void 0 && (e[c] = d), c === e.length - 1 && (this.finalKeyframe = f);
1933
1933
  }
@@ -2548,7 +2548,7 @@ const de = {
2548
2548
  if (!e.target)
2549
2549
  return t;
2550
2550
  if (typeof t == "string")
2551
- if (b.test(t))
2551
+ if (x.test(t))
2552
2552
  t = parseFloat(t);
2553
2553
  else
2554
2554
  return t;
@@ -2626,14 +2626,14 @@ const wu = {
2626
2626
  offset: "strokeDashoffset",
2627
2627
  array: "strokeDasharray"
2628
2628
  };
2629
- function bu(t, e, n = 1, i = 0, s = !0) {
2629
+ function xu(t, e, n = 1, i = 0, s = !0) {
2630
2630
  t.pathLength = 1;
2631
2631
  const r = s ? wu : Au;
2632
- t[r.offset] = b.transform(-i);
2633
- const o = b.transform(e), a = b.transform(n);
2632
+ t[r.offset] = x.transform(-i);
2633
+ const o = x.transform(e), a = x.transform(n);
2634
2634
  t[r.array] = `${o} ${a}`;
2635
2635
  }
2636
- const xu = [
2636
+ const bu = [
2637
2637
  "offsetDistance",
2638
2638
  "offsetPath",
2639
2639
  "offsetRotate",
@@ -2656,9 +2656,9 @@ function ea(t, {
2656
2656
  t.attrs = t.style, t.style = {};
2657
2657
  const { attrs: f, style: d } = t;
2658
2658
  f.transform && (d.transform = f.transform, delete f.transform), (d.transform || f.transformOrigin) && (d.transformOrigin = f.transformOrigin ?? "50% 50%", delete f.transformOrigin), d.transform && (d.transformBox = (c == null ? void 0 : c.transformBox) ?? "fill-box", delete f.transformBox);
2659
- for (const p of xu)
2659
+ for (const p of bu)
2660
2660
  f[p] !== void 0 && (d[p] = f[p], delete f[p]);
2661
- e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), i !== void 0 && (f.scale = i), s !== void 0 && bu(f, s, r, o, !1);
2661
+ e !== void 0 && (f.x = e), n !== void 0 && (f.y = n), i !== void 0 && (f.scale = i), s !== void 0 && xu(f, s, r, o, !1);
2662
2662
  }
2663
2663
  const na = /* @__PURE__ */ new Set([
2664
2664
  "baseFrequency",
@@ -2798,21 +2798,21 @@ function Lu(t) {
2798
2798
  G && (G.liveStyle = !1);
2799
2799
  };
2800
2800
  for (const F in ht) {
2801
- const G = L[F], bt = $[F];
2801
+ const G = L[F], xt = $[F];
2802
2802
  if (p.hasOwnProperty(F))
2803
2803
  continue;
2804
- let xt = !1;
2805
- si(G) && si(bt) ? xt = !ra(G, bt) : xt = G !== bt, xt ? G != null ? At(F) : d.add(F) : G !== void 0 && d.has(F) ? At(F) : w.protectedKeys[F] = !0;
2804
+ let bt = !1;
2805
+ si(G) && si(xt) ? bt = !ra(G, xt) : bt = G !== xt, bt ? G != null ? At(F) : d.add(F) : G !== void 0 && d.has(F) ? At(F) : w.protectedKeys[F] = !0;
2806
2806
  }
2807
2807
  w.prevProp = S, w.prevResolvedValues = L, w.isActive && (p = { ...p, ...L }), i && t.blockInitialAnimation && (v = !1);
2808
2808
  const Q = R && k;
2809
2809
  v && (!Q || _) && f.push(...H.map((F) => {
2810
2810
  const G = { type: T };
2811
2811
  if (typeof F == "string" && i && !Q && t.manuallyAnimateOnMount && t.parent) {
2812
- const { parent: bt } = t, xt = ie(bt, F);
2813
- if (bt.enteringChildren && xt) {
2814
- const { delayChildren: U } = xt.transition || {};
2815
- G.delay = Cr(bt.enteringChildren, t, U);
2812
+ const { parent: xt } = t, bt = ie(xt, F);
2813
+ if (xt.enteringChildren && bt) {
2814
+ const { delayChildren: U } = bt.transition || {};
2815
+ G.delay = Cr(xt.enteringChildren, t, U);
2816
2816
  }
2817
2817
  }
2818
2818
  return {
@@ -2967,7 +2967,7 @@ function Hu(t, e, n) {
2967
2967
  const a = t.x.scale * e.x, l = t.y.scale * e.y;
2968
2968
  return (a !== 1 || l !== 1) && (i += `scale(${a}, ${l})`), i || "none";
2969
2969
  }
2970
- const fa = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], Ku = fa.length, ro = (t) => typeof t == "string" ? parseFloat(t) : t, ao = (t) => typeof t == "number" || b.test(t);
2970
+ const fa = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], Ku = fa.length, ro = (t) => typeof t == "string" ? parseFloat(t) : t, ao = (t) => typeof t == "number" || x.test(t);
2971
2971
  function zu(t, e, n, i, s, r) {
2972
2972
  s ? (t.opacity = N(0, n.opacity ?? 1, Gu(i)), t.opacityExit = N(e.opacity ?? 1, 0, $u(i))) : r && (t.opacity = N(e.opacity ?? 1, n.opacity ?? 1, i));
2973
2973
  for (let o = 0; o < Ku; o++) {
@@ -2984,7 +2984,7 @@ function lo(t, e) {
2984
2984
  }
2985
2985
  const Gu = /* @__PURE__ */ ha(0, 0.5, ir), $u = /* @__PURE__ */ ha(0.5, 0.95, ut);
2986
2986
  function ha(t, e, n) {
2987
- return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */ xe(t, e, i));
2987
+ return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */ be(t, e, i));
2988
2988
  }
2989
2989
  function Yu(t, e, n) {
2990
2990
  const i = J(t) ? t : se(t);
@@ -3217,7 +3217,7 @@ function ma({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
3217
3217
  }
3218
3218
  this.animationCommitId = this.animationId, this.isUpdating ? (this.isUpdating = !1, this.nodes.forEach(af), this.nodes.forEach(ef), this.nodes.forEach(nf)) : this.nodes.forEach(uo), this.clearAllSnapshots();
3219
3219
  const a = nt.now();
3220
- q.delta = wt(0, 1e3 / 60, a - q.timestamp), q.timestamp = a, q.isProcessing = !0, bn.update.process(q), bn.preRender.process(q), bn.render.process(q), q.isProcessing = !1;
3220
+ q.delta = wt(0, 1e3 / 60, a - q.timestamp), q.timestamp = a, q.isProcessing = !0, xn.update.process(q), xn.preRender.process(q), xn.render.process(q), q.isProcessing = !1;
3221
3221
  }
3222
3222
  didUpdate() {
3223
3223
  this.updateScheduled || (this.updateScheduled = !0, Ni.read(this.scheduleUpdate));
@@ -3740,7 +3740,7 @@ const Ta = () => ({
3740
3740
  ...Hi(),
3741
3741
  attrs: {}
3742
3742
  });
3743
- function bf(t, e, n, i) {
3743
+ function xf(t, e, n, i) {
3744
3744
  const s = on(() => {
3745
3745
  const r = Ta();
3746
3746
  return ea(r, e, ia(i), t.transformTemplate, t.style), {
@@ -3754,7 +3754,7 @@ function bf(t, e, n, i) {
3754
3754
  }
3755
3755
  return s;
3756
3756
  }
3757
- const xf = /* @__PURE__ */ new Set([
3757
+ const bf = /* @__PURE__ */ new Set([
3758
3758
  "animate",
3759
3759
  "exit",
3760
3760
  "variants",
@@ -3787,7 +3787,7 @@ const xf = /* @__PURE__ */ new Set([
3787
3787
  "viewport"
3788
3788
  ]);
3789
3789
  function sn(t) {
3790
- return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || xf.has(t);
3790
+ return t.startsWith("while") || t.startsWith("drag") && t !== "draggable" || t.startsWith("layout") || t.startsWith("onTap") || t.startsWith("onPan") || t.startsWith("onLayout") || bf.has(t);
3791
3791
  }
3792
3792
  let va = (t) => !sn(t);
3793
3793
  function Ef(t) {
@@ -3852,7 +3852,7 @@ function Ki(t) {
3852
3852
  );
3853
3853
  }
3854
3854
  function Mf(t, e, n, { latestValues: i }, s, r = !1, o) {
3855
- const l = (o ?? Ki(t) ? bf : Af)(e, i, s, t), u = Pf(e, typeof t == "string", r), c = t !== Ho ? { ...u, ...l, ref: n } : {}, { children: f } = e, d = on(() => J(f) ? f.get() : f, [f]);
3855
+ const l = (o ?? Ki(t) ? xf : Af)(e, i, s, t), u = Pf(e, typeof t == "string", r), c = t !== Ho ? { ...u, ...l, ref: n } : {}, { children: f } = e, d = on(() => J(f) ? f.get() : f, [f]);
3856
3856
  return Wa(t, {
3857
3857
  ...c,
3858
3858
  children: d
@@ -3971,7 +3971,7 @@ function Nf(t, e, n) {
3971
3971
  else o && (o.current = r);
3972
3972
  }, [e]);
3973
3973
  }
3974
- const ba = oe({});
3974
+ const xa = oe({});
3975
3975
  function Se(t) {
3976
3976
  return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
3977
3977
  }
@@ -3988,7 +3988,7 @@ function Bf(t, e, n, i, s, r) {
3988
3988
  reducedMotionConfig: u,
3989
3989
  isSVG: r
3990
3990
  }));
3991
- const f = c.current, d = at(ba);
3991
+ const f = c.current, d = at(xa);
3992
3992
  f && !f.projection && s && (f.type === "html" || f.type === "svg") && Uf(c.current, n, s, d);
3993
3993
  const p = Ht(!1);
3994
3994
  Ko(() => {
@@ -4006,7 +4006,7 @@ function Bf(t, e, n, i, s, r) {
4006
4006
  }
4007
4007
  function Uf(t, e, n, i) {
4008
4008
  const { layoutId: s, layout: r, drag: o, dragConstraints: a, layoutScroll: l, layoutRoot: u, layoutCrossfade: c } = e;
4009
- t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : xa(t.parent)), t.projection.setOptions({
4009
+ t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : ba(t.parent)), t.projection.setOptions({
4010
4010
  layoutId: s,
4011
4011
  layout: r,
4012
4012
  alwaysMeasureLayout: !!o || a && Se(a),
@@ -4025,9 +4025,9 @@ function Uf(t, e, n, i) {
4025
4025
  layoutRoot: u
4026
4026
  });
4027
4027
  }
4028
- function xa(t) {
4028
+ function ba(t) {
4029
4029
  if (t)
4030
- return t.options.allowProjection !== !1 ? t.projection : xa(t.parent);
4030
+ return t.options.allowProjection !== !1 ? t.projection : ba(t.parent);
4031
4031
  }
4032
4032
  function jf(t, { forwardMotionProps: e = !1, type: n } = {}, i, s) {
4033
4033
  i && kf(i);
@@ -4142,7 +4142,7 @@ function _e(t) {
4142
4142
  };
4143
4143
  }
4144
4144
  const qf = (t) => (e) => Fi(e) && t(e, _e(e));
4145
- function be(t, e, n, i) {
4145
+ function xe(t, e, n, i) {
4146
4146
  return Me(t, e, qf(n), i);
4147
4147
  }
4148
4148
  const Ea = ({ current: t }) => t ? t.ownerDocument.defaultView : null, wo = (t, e) => Math.abs(t - e);
@@ -4182,7 +4182,7 @@ class Pa {
4182
4182
  const l = _e(e), u = Vn(l, this.transformPagePoint), { point: c } = u, { timestamp: f } = q;
4183
4183
  this.history = [{ ...c, timestamp: f }];
4184
4184
  const { onSessionStart: d } = n;
4185
- d && d(e, kn(u, this.history)), this.removeListeners = Ce(be(this.contextWindow, "pointermove", this.handlePointerMove), be(this.contextWindow, "pointerup", this.handlePointerUp), be(this.contextWindow, "pointercancel", this.handlePointerUp)), a && this.startScrollTracking(a);
4185
+ d && d(e, kn(u, this.history)), this.removeListeners = Ce(xe(this.contextWindow, "pointermove", this.handlePointerMove), xe(this.contextWindow, "pointerup", this.handlePointerUp), xe(this.contextWindow, "pointercancel", this.handlePointerUp)), a && this.startScrollTracking(a);
4186
4186
  }
4187
4187
  /**
4188
4188
  * Start tracking scroll on ancestors and window.
@@ -4236,14 +4236,14 @@ class Pa {
4236
4236
  function Vn(t, e) {
4237
4237
  return e ? { point: e(t.point) } : t;
4238
4238
  }
4239
- function bo(t, e) {
4239
+ function xo(t, e) {
4240
4240
  return { x: t.x - e.x, y: t.y - e.y };
4241
4241
  }
4242
4242
  function kn({ point: t }, e) {
4243
4243
  return {
4244
4244
  point: t,
4245
- delta: bo(t, Da(e)),
4246
- offset: bo(t, Jf(e)),
4245
+ delta: xo(t, Da(e)),
4246
+ offset: xo(t, Jf(e)),
4247
4247
  velocity: Qf(e, 0.1)
4248
4248
  };
4249
4249
  }
@@ -4274,7 +4274,7 @@ function Qf(t, e) {
4274
4274
  function th(t, { min: e, max: n }, i) {
4275
4275
  return e !== void 0 && t < e ? t = i ? N(e, t, i.min) : Math.max(t, e) : n !== void 0 && t > n && (t = i ? N(n, t, i.max) : Math.min(t, n)), t;
4276
4276
  }
4277
- function xo(t, e, n) {
4277
+ function bo(t, e, n) {
4278
4278
  return {
4279
4279
  min: e !== void 0 ? t.min + e : void 0,
4280
4280
  max: n !== void 0 ? t.max + n - (t.max - t.min) : void 0
@@ -4282,8 +4282,8 @@ function xo(t, e, n) {
4282
4282
  }
4283
4283
  function eh(t, { top: e, left: n, bottom: i, right: s }) {
4284
4284
  return {
4285
- x: xo(t.x, n, s),
4286
- y: xo(t.y, e, i)
4285
+ x: bo(t.x, n, s),
4286
+ y: bo(t.y, e, i)
4287
4287
  };
4288
4288
  }
4289
4289
  function Eo(t, e) {
@@ -4299,7 +4299,7 @@ function nh(t, e) {
4299
4299
  function ih(t, e) {
4300
4300
  let n = 0.5;
4301
4301
  const i = it(t), s = it(e);
4302
- return s > i ? n = /* @__PURE__ */ xe(e.min, e.max - i, t.min) : i > s && (n = /* @__PURE__ */ xe(t.min, t.max - s, e.min)), wt(0, 1, n);
4302
+ return s > i ? n = /* @__PURE__ */ be(e.min, e.max - i, t.min) : i > s && (n = /* @__PURE__ */ be(t.min, t.max - s, e.min)), wt(0, 1, n);
4303
4303
  }
4304
4304
  function sh(t, e) {
4305
4305
  const n = {};
@@ -4527,7 +4527,7 @@ class ah {
4527
4527
  if (!this.visualElement.current)
4528
4528
  return;
4529
4529
  rh.set(this.visualElement, this);
4530
- const e = this.visualElement.current, n = be(e, "pointerdown", (l) => {
4530
+ const e = this.visualElement.current, n = xe(e, "pointerdown", (l) => {
4531
4531
  const { drag: u, dragListener: c = !0 } = this.getProps();
4532
4532
  u && c && !Hr(l.target) && this.start(l);
4533
4533
  }), i = () => {
@@ -4606,7 +4606,7 @@ class uh extends kt {
4606
4606
  };
4607
4607
  }
4608
4608
  mount() {
4609
- this.removePointerDownListener = be(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
4609
+ this.removePointerDownListener = xe(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
4610
4610
  }
4611
4611
  update() {
4612
4612
  this.session && this.session.updateHandlers(this.createPanHandlers());
@@ -4670,7 +4670,7 @@ class hh extends Ga {
4670
4670
  }
4671
4671
  function Ma(t) {
4672
4672
  const [e, n] = fh(), i = at(ar);
4673
- return C(hh, { ...t, layoutGroup: i, switchLayoutGroup: at(ba), isPresent: e, safeToRemove: n });
4673
+ return C(hh, { ...t, layoutGroup: i, switchLayoutGroup: at(xa), isPresent: e, safeToRemove: n });
4674
4674
  }
4675
4675
  const dh = {
4676
4676
  pan: {
@@ -4783,15 +4783,15 @@ class Ah extends kt {
4783
4783
  if (typeof IntersectionObserver > "u")
4784
4784
  return;
4785
4785
  const { props: e, prevProps: n } = this.node;
4786
- ["amount", "margin", "root"].some(bh(e, n)) && this.startObserver();
4786
+ ["amount", "margin", "root"].some(xh(e, n)) && this.startObserver();
4787
4787
  }
4788
4788
  unmount() {
4789
4789
  }
4790
4790
  }
4791
- function bh({ viewport: t = {} }, { viewport: e = {} } = {}) {
4791
+ function xh({ viewport: t = {} }, { viewport: e = {} } = {}) {
4792
4792
  return (n) => t[n] !== e[n];
4793
4793
  }
4794
- const xh = {
4794
+ const bh = {
4795
4795
  inView: {
4796
4796
  Feature: Ah
4797
4797
  },
@@ -4811,14 +4811,14 @@ const xh = {
4811
4811
  }
4812
4812
  }, Ph = {
4813
4813
  ...Xf,
4814
- ...xh,
4814
+ ...bh,
4815
4815
  ...dh,
4816
4816
  ...Eh
4817
4817
  };
4818
4818
  function Dh(t, e) {
4819
4819
  return jf(t, e, Ph, zf);
4820
4820
  }
4821
- const Fn = /* @__PURE__ */ Dh("div"), Lo = "http://localhost:4000/api/widget/chat";
4821
+ const Fn = /* @__PURE__ */ Dh("div"), Lo = "https://proxy.convokit.dev/api/widget/chat";
4822
4822
  function cn(t) {
4823
4823
  let e;
4824
4824
  try {
@@ -5205,10 +5205,10 @@ function Ia() {
5205
5205
  ARIA_ATTR: un,
5206
5206
  IS_SCRIPT_OR_DATA: F,
5207
5207
  ATTR_WHITESPACE: G,
5208
- CUSTOM_ELEMENT: bt
5208
+ CUSTOM_ELEMENT: xt
5209
5209
  } = Bo;
5210
5210
  let {
5211
- IS_ALLOWED_URI: xt
5211
+ IS_ALLOWED_URI: bt
5212
5212
  } = Bo, U = null;
5213
5213
  const $i = M({}, [...ko, ...jn, ...Wn, ...Hn, ...Oo]);
5214
5214
  let Y = null;
@@ -5268,7 +5268,7 @@ function Ia() {
5268
5268
  let h = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
5269
5269
  if (!(qt && qt === h)) {
5270
5270
  if ((!h || typeof h != "object") && (h = {}), h = Tt(h), he = // eslint-disable-next-line unicorn/prefer-includes
5271
- Na.indexOf(h.PARSER_MEDIA_TYPE) === -1 ? Fa : h.PARSER_MEDIA_TYPE, K = he === "application/xhtml+xml" ? Bn : qe, U = pt(h, "ALLOWED_TAGS") ? M({}, h.ALLOWED_TAGS, K) : $i, Y = pt(h, "ALLOWED_ATTR") ? M({}, h.ALLOWED_ATTR, K) : Yi, vn = pt(h, "ALLOWED_NAMESPACES") ? M({}, h.ALLOWED_NAMESPACES, Bn) : ka, yn = pt(h, "ADD_URI_SAFE_ATTR") ? M(Tt(ns), h.ADD_URI_SAFE_ATTR, K) : ns, ts = pt(h, "ADD_DATA_URI_TAGS") ? M(Tt(es), h.ADD_DATA_URI_TAGS, K) : es, gt = pt(h, "FORBID_CONTENTS") ? M({}, h.FORBID_CONTENTS, K) : gn, ue = pt(h, "FORBID_TAGS") ? M({}, h.FORBID_TAGS, K) : Tt({}), fn = pt(h, "FORBID_ATTR") ? M({}, h.FORBID_ATTR, K) : Tt({}), Yt = pt(h, "USE_PROFILES") ? h.USE_PROFILES : !1, Xi = h.ALLOW_ARIA_ATTR !== !1, hn = h.ALLOW_DATA_ATTR !== !1, qi = h.ALLOW_UNKNOWN_PROTOCOLS || !1, Zi = h.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Gt = h.SAFE_FOR_TEMPLATES || !1, Ie = h.SAFE_FOR_XML !== !1, Ot = h.WHOLE_DOCUMENT || !1, $t = h.RETURN_DOM || !1, Ve = h.RETURN_DOM_FRAGMENT || !1, ke = h.RETURN_TRUSTED_TYPE || !1, mn = h.FORCE_BODY || !1, Ji = h.SANITIZE_DOM !== !1, Qi = h.SANITIZE_NAMED_PROPS || !1, pn = h.KEEP_CONTENT !== !1, fe = h.IN_PLACE || !1, xt = h.ALLOWED_URI_REGEXP || La, Xt = h.NAMESPACE || Et, Fe = h.MATHML_TEXT_INTEGRATION_POINTS || Fe, Be = h.HTML_INTEGRATION_POINTS || Be, B = h.CUSTOM_ELEMENT_HANDLING || {}, h.CUSTOM_ELEMENT_HANDLING && is(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (B.tagNameCheck = h.CUSTOM_ELEMENT_HANDLING.tagNameCheck), h.CUSTOM_ELEMENT_HANDLING && is(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (B.attributeNameCheck = h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), h.CUSTOM_ELEMENT_HANDLING && typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Gt && (hn = !1), Ve && ($t = !0), Yt && (U = M({}, Oo), Y = [], Yt.html === !0 && (M(U, ko), M(Y, No)), Yt.svg === !0 && (M(U, jn), M(Y, Kn), M(Y, Ke)), Yt.svgFilters === !0 && (M(U, Wn), M(Y, Kn), M(Y, Ke)), Yt.mathMl === !0 && (M(U, Hn), M(Y, Fo), M(Y, Ke))), h.ADD_TAGS && (typeof h.ADD_TAGS == "function" ? zt.tagCheck = h.ADD_TAGS : (U === $i && (U = Tt(U)), M(U, h.ADD_TAGS, K))), h.ADD_ATTR && (typeof h.ADD_ATTR == "function" ? zt.attributeCheck = h.ADD_ATTR : (Y === Yi && (Y = Tt(Y)), M(Y, h.ADD_ATTR, K))), h.ADD_URI_SAFE_ATTR && M(yn, h.ADD_URI_SAFE_ATTR, K), h.FORBID_CONTENTS && (gt === gn && (gt = Tt(gt)), M(gt, h.FORBID_CONTENTS, K)), h.ADD_FORBID_CONTENTS && (gt === gn && (gt = Tt(gt)), M(gt, h.ADD_FORBID_CONTENTS, K)), pn && (U["#text"] = !0), Ot && M(U, ["html", "head", "body"]), U.table && (M(U, ["tbody"]), delete ue.tbody), h.TRUSTED_TYPES_POLICY) {
5271
+ Na.indexOf(h.PARSER_MEDIA_TYPE) === -1 ? Fa : h.PARSER_MEDIA_TYPE, K = he === "application/xhtml+xml" ? Bn : qe, U = pt(h, "ALLOWED_TAGS") ? M({}, h.ALLOWED_TAGS, K) : $i, Y = pt(h, "ALLOWED_ATTR") ? M({}, h.ALLOWED_ATTR, K) : Yi, vn = pt(h, "ALLOWED_NAMESPACES") ? M({}, h.ALLOWED_NAMESPACES, Bn) : ka, yn = pt(h, "ADD_URI_SAFE_ATTR") ? M(Tt(ns), h.ADD_URI_SAFE_ATTR, K) : ns, ts = pt(h, "ADD_DATA_URI_TAGS") ? M(Tt(es), h.ADD_DATA_URI_TAGS, K) : es, gt = pt(h, "FORBID_CONTENTS") ? M({}, h.FORBID_CONTENTS, K) : gn, ue = pt(h, "FORBID_TAGS") ? M({}, h.FORBID_TAGS, K) : Tt({}), fn = pt(h, "FORBID_ATTR") ? M({}, h.FORBID_ATTR, K) : Tt({}), Yt = pt(h, "USE_PROFILES") ? h.USE_PROFILES : !1, Xi = h.ALLOW_ARIA_ATTR !== !1, hn = h.ALLOW_DATA_ATTR !== !1, qi = h.ALLOW_UNKNOWN_PROTOCOLS || !1, Zi = h.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Gt = h.SAFE_FOR_TEMPLATES || !1, Ie = h.SAFE_FOR_XML !== !1, Ot = h.WHOLE_DOCUMENT || !1, $t = h.RETURN_DOM || !1, Ve = h.RETURN_DOM_FRAGMENT || !1, ke = h.RETURN_TRUSTED_TYPE || !1, mn = h.FORCE_BODY || !1, Ji = h.SANITIZE_DOM !== !1, Qi = h.SANITIZE_NAMED_PROPS || !1, pn = h.KEEP_CONTENT !== !1, fe = h.IN_PLACE || !1, bt = h.ALLOWED_URI_REGEXP || La, Xt = h.NAMESPACE || Et, Fe = h.MATHML_TEXT_INTEGRATION_POINTS || Fe, Be = h.HTML_INTEGRATION_POINTS || Be, B = h.CUSTOM_ELEMENT_HANDLING || {}, h.CUSTOM_ELEMENT_HANDLING && is(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (B.tagNameCheck = h.CUSTOM_ELEMENT_HANDLING.tagNameCheck), h.CUSTOM_ELEMENT_HANDLING && is(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (B.attributeNameCheck = h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), h.CUSTOM_ELEMENT_HANDLING && typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Gt && (hn = !1), Ve && ($t = !0), Yt && (U = M({}, Oo), Y = [], Yt.html === !0 && (M(U, ko), M(Y, No)), Yt.svg === !0 && (M(U, jn), M(Y, Kn), M(Y, Ke)), Yt.svgFilters === !0 && (M(U, Wn), M(Y, Kn), M(Y, Ke)), Yt.mathMl === !0 && (M(U, Hn), M(Y, Fo), M(Y, Ke))), h.ADD_TAGS && (typeof h.ADD_TAGS == "function" ? zt.tagCheck = h.ADD_TAGS : (U === $i && (U = Tt(U)), M(U, h.ADD_TAGS, K))), h.ADD_ATTR && (typeof h.ADD_ATTR == "function" ? zt.attributeCheck = h.ADD_ATTR : (Y === Yi && (Y = Tt(Y)), M(Y, h.ADD_ATTR, K))), h.ADD_URI_SAFE_ATTR && M(yn, h.ADD_URI_SAFE_ATTR, K), h.FORBID_CONTENTS && (gt === gn && (gt = Tt(gt)), M(gt, h.FORBID_CONTENTS, K)), h.ADD_FORBID_CONTENTS && (gt === gn && (gt = Tt(gt)), M(gt, h.ADD_FORBID_CONTENTS, K)), pn && (U["#text"] = !0), Ot && M(U, ["html", "head", "body"]), U.table && (M(U, ["tbody"]), delete ue.tbody), h.TRUSTED_TYPES_POLICY) {
5272
5272
  if (typeof h.TRUSTED_TYPES_POLICY.createHTML != "function")
5273
5273
  throw ge('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
5274
5274
  if (typeof h.TRUSTED_TYPES_POLICY.createScriptURL != "function")
@@ -5284,8 +5284,8 @@ function Ia() {
5284
5284
  namespaceURI: Xt,
5285
5285
  tagName: "template"
5286
5286
  });
5287
- const x = qe(h.tagName), V = qe(g.tagName);
5288
- return vn[h.namespaceURI] ? h.namespaceURI === Ne ? g.namespaceURI === Et ? x === "svg" : g.namespaceURI === Oe ? x === "svg" && (V === "annotation-xml" || Fe[V]) : !!ss[x] : h.namespaceURI === Oe ? g.namespaceURI === Et ? x === "math" : g.namespaceURI === Ne ? x === "math" && Be[V] : !!os[x] : h.namespaceURI === Et ? g.namespaceURI === Ne && !Be[V] || g.namespaceURI === Oe && !Fe[V] ? !1 : !os[x] && (Oa[x] || !ss[x]) : !!(he === "application/xhtml+xml" && vn[h.namespaceURI]) : !1;
5287
+ const b = qe(h.tagName), V = qe(g.tagName);
5288
+ return vn[h.namespaceURI] ? h.namespaceURI === Ne ? g.namespaceURI === Et ? b === "svg" : g.namespaceURI === Oe ? b === "svg" && (V === "annotation-xml" || Fe[V]) : !!ss[b] : h.namespaceURI === Oe ? g.namespaceURI === Et ? b === "math" : g.namespaceURI === Ne ? b === "math" && Be[V] : !!os[b] : h.namespaceURI === Et ? g.namespaceURI === Ne && !Be[V] || g.namespaceURI === Oe && !Fe[V] ? !1 : !os[b] && (Oa[b] || !ss[b]) : !!(he === "application/xhtml+xml" && vn[h.namespaceURI]) : !1;
5289
5289
  }, yt = function(h) {
5290
5290
  me(e.removed, {
5291
5291
  element: h
@@ -5319,12 +5319,12 @@ function Ia() {
5319
5319
  } catch {
5320
5320
  }
5321
5321
  }, rs = function(h) {
5322
- let g = null, x = null;
5322
+ let g = null, b = null;
5323
5323
  if (mn)
5324
5324
  h = "<remove></remove>" + h;
5325
5325
  else {
5326
5326
  const j = Un(h, /^[\r\n\t ]+/);
5327
- x = j && j[0];
5327
+ b = j && j[0];
5328
5328
  }
5329
5329
  he === "application/xhtml+xml" && Xt === Et && (h = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + h + "</body></html>");
5330
5330
  const V = E ? E.createHTML(h) : h;
@@ -5341,7 +5341,7 @@ function Ia() {
5341
5341
  }
5342
5342
  }
5343
5343
  const Z = g.body || g.documentElement;
5344
- return h && x && Z.insertBefore(n.createTextNode(x), Z.childNodes[0] || null), Xt === Et ? _.call(g, Ot ? "html" : "body")[0] : Ot ? g.documentElement : Z;
5344
+ return h && b && Z.insertBefore(n.createTextNode(b), Z.childNodes[0] || null), Xt === Et ? _.call(g, Ot ? "html" : "body")[0] : Ot ? g.documentElement : Z;
5345
5345
  }, as = function(h) {
5346
5346
  return k.call(
5347
5347
  h.ownerDocument || h,
@@ -5356,24 +5356,24 @@ function Ia() {
5356
5356
  return typeof a == "function" && h instanceof a;
5357
5357
  };
5358
5358
  function Pt(P, h, g) {
5359
- He(P, (x) => {
5360
- x.call(e, h, g, qt);
5359
+ He(P, (b) => {
5360
+ b.call(e, h, g, qt);
5361
5361
  });
5362
5362
  }
5363
5363
  const cs = function(h) {
5364
5364
  let g = null;
5365
5365
  if (Pt(L.beforeSanitizeElements, h, null), wn(h))
5366
5366
  return yt(h), !0;
5367
- const x = K(h.nodeName);
5367
+ const b = K(h.nodeName);
5368
5368
  if (Pt(L.uponSanitizeElement, h, {
5369
- tagName: x,
5369
+ tagName: b,
5370
5370
  allowedTags: U
5371
5371
  }), Ie && h.hasChildNodes() && !ls(h.firstElementChild) && tt(/<[/\w!]/g, h.innerHTML) && tt(/<[/\w!]/g, h.textContent) || h.nodeType === Te.progressingInstruction || Ie && h.nodeType === Te.comment && tt(/<[/\w]/g, h.data))
5372
5372
  return yt(h), !0;
5373
- if (!(zt.tagCheck instanceof Function && zt.tagCheck(x)) && (!U[x] || ue[x])) {
5374
- if (!ue[x] && fs(x) && (B.tagNameCheck instanceof RegExp && tt(B.tagNameCheck, x) || B.tagNameCheck instanceof Function && B.tagNameCheck(x)))
5373
+ if (!(zt.tagCheck instanceof Function && zt.tagCheck(b)) && (!U[b] || ue[b])) {
5374
+ if (!ue[b] && fs(b) && (B.tagNameCheck instanceof RegExp && tt(B.tagNameCheck, b) || B.tagNameCheck instanceof Function && B.tagNameCheck(b)))
5375
5375
  return !1;
5376
- if (pn && !gt[x]) {
5376
+ if (pn && !gt[b]) {
5377
5377
  const V = S(h) || h.parentNode, Z = w(h) || h.childNodes;
5378
5378
  if (Z && V) {
5379
5379
  const j = Z.length;
@@ -5385,13 +5385,13 @@ function Ia() {
5385
5385
  }
5386
5386
  return yt(h), !0;
5387
5387
  }
5388
- return h instanceof l && !Ua(h) || (x === "noscript" || x === "noembed" || x === "noframes") && tt(/<\/no(script|embed|frames)/i, h.innerHTML) ? (yt(h), !0) : (Gt && h.nodeType === Te.text && (g = h.textContent, He([$, ht, At], (V) => {
5388
+ return h instanceof l && !Ua(h) || (b === "noscript" || b === "noembed" || b === "noframes") && tt(/<\/no(script|embed|frames)/i, h.innerHTML) ? (yt(h), !0) : (Gt && h.nodeType === Te.text && (g = h.textContent, He([$, ht, At], (V) => {
5389
5389
  g = pe(g, V, " ");
5390
5390
  }), h.textContent !== g && (me(e.removed, {
5391
5391
  element: h.cloneNode()
5392
5392
  }), h.textContent = g)), Pt(L.afterSanitizeElements, h, null), !1);
5393
- }, us = function(h, g, x) {
5394
- if (Ji && (g === "id" || g === "name") && (x in n || x in Ba))
5393
+ }, us = function(h, g, b) {
5394
+ if (Ji && (g === "id" || g === "name") && (b in n || b in Ba))
5395
5395
  return !1;
5396
5396
  if (!(hn && !fn[g] && tt(Q, g))) {
5397
5397
  if (!(Xi && tt(un, g))) {
@@ -5403,13 +5403,13 @@ function Ia() {
5403
5403
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
5404
5404
  !(fs(h) && (B.tagNameCheck instanceof RegExp && tt(B.tagNameCheck, h) || B.tagNameCheck instanceof Function && B.tagNameCheck(h)) && (B.attributeNameCheck instanceof RegExp && tt(B.attributeNameCheck, g) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(g, h)) || // Alternative, second condition checks if it's an `is`-attribute, AND
5405
5405
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
5406
- g === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && tt(B.tagNameCheck, x) || B.tagNameCheck instanceof Function && B.tagNameCheck(x)))
5406
+ g === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && tt(B.tagNameCheck, b) || B.tagNameCheck instanceof Function && B.tagNameCheck(b)))
5407
5407
  ) return !1;
5408
5408
  } else if (!yn[g]) {
5409
- if (!tt(xt, pe(x, G, ""))) {
5410
- if (!((g === "src" || g === "xlink:href" || g === "href") && h !== "script" && Fh(x, "data:") === 0 && ts[h])) {
5411
- if (!(qi && !tt(F, pe(x, G, "")))) {
5412
- if (x)
5409
+ if (!tt(bt, pe(b, G, ""))) {
5410
+ if (!((g === "src" || g === "xlink:href" || g === "href") && h !== "script" && Fh(b, "data:") === 0 && ts[h])) {
5411
+ if (!(qi && !tt(F, pe(b, G, "")))) {
5412
+ if (b)
5413
5413
  return !1;
5414
5414
  }
5415
5415
  }
@@ -5420,7 +5420,7 @@ function Ia() {
5420
5420
  }
5421
5421
  return !0;
5422
5422
  }, fs = function(h) {
5423
- return h !== "annotation-xml" && Un(h, bt);
5423
+ return h !== "annotation-xml" && Un(h, xt);
5424
5424
  }, hs = function(h) {
5425
5425
  Pt(L.beforeSanitizeAttributes, h, null);
5426
5426
  const {
@@ -5428,7 +5428,7 @@ function Ia() {
5428
5428
  } = h;
5429
5429
  if (!g || wn(h))
5430
5430
  return;
5431
- const x = {
5431
+ const b = {
5432
5432
  attrName: "",
5433
5433
  attrValue: "",
5434
5434
  keepAttr: !0,
@@ -5443,7 +5443,7 @@ function Ia() {
5443
5443
  value: Dt
5444
5444
  } = Z, Zt = K(j), An = Dt;
5445
5445
  let X = j === "value" ? An : Bh(An);
5446
- if (x.attrName = Zt, x.attrValue = X, x.keepAttr = !0, x.forceKeepAttr = void 0, Pt(L.uponSanitizeAttribute, h, x), X = x.attrValue, Qi && (Zt === "id" || Zt === "name") && (Nt(j, h), X = Va + X), Ie && tt(/((--!?|])>)|<\/(style|title|textarea)/i, X)) {
5446
+ if (b.attrName = Zt, b.attrValue = X, b.keepAttr = !0, b.forceKeepAttr = void 0, Pt(L.uponSanitizeAttribute, h, b), X = b.attrValue, Qi && (Zt === "id" || Zt === "name") && (Nt(j, h), X = Va + X), Ie && tt(/((--!?|])>)|<\/(style|title|textarea)/i, X)) {
5447
5447
  Nt(j, h);
5448
5448
  continue;
5449
5449
  }
@@ -5451,9 +5451,9 @@ function Ia() {
5451
5451
  Nt(j, h);
5452
5452
  continue;
5453
5453
  }
5454
- if (x.forceKeepAttr)
5454
+ if (b.forceKeepAttr)
5455
5455
  continue;
5456
- if (!x.keepAttr) {
5456
+ if (!b.keepAttr) {
5457
5457
  Nt(j, h);
5458
5458
  continue;
5459
5459
  }
@@ -5490,13 +5490,13 @@ function Ia() {
5490
5490
  Pt(L.afterSanitizeAttributes, h, null);
5491
5491
  }, ja = function P(h) {
5492
5492
  let g = null;
5493
- const x = as(h);
5494
- for (Pt(L.beforeSanitizeShadowDOM, h, null); g = x.nextNode(); )
5493
+ const b = as(h);
5494
+ for (Pt(L.beforeSanitizeShadowDOM, h, null); g = b.nextNode(); )
5495
5495
  Pt(L.uponSanitizeShadowNode, g, null), cs(g), hs(g), g.content instanceof r && P(g.content);
5496
5496
  Pt(L.afterSanitizeShadowDOM, h, null);
5497
5497
  };
5498
5498
  return e.sanitize = function(P) {
5499
- let h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = null, x = null, V = null, Z = null;
5499
+ let h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = null, b = null, V = null, Z = null;
5500
5500
  if (Tn = !P, Tn && (P = "<!-->"), typeof P != "string" && !ls(P))
5501
5501
  if (typeof P.toString == "function") {
5502
5502
  if (P = P.toString(), typeof P != "string")
@@ -5512,7 +5512,7 @@ function Ia() {
5512
5512
  throw ge("root node is forbidden and cannot be sanitized in-place");
5513
5513
  }
5514
5514
  } else if (P instanceof a)
5515
- g = rs("<!---->"), x = g.ownerDocument.importNode(P, !0), x.nodeType === Te.element && x.nodeName === "BODY" || x.nodeName === "HTML" ? g = x : g.appendChild(x);
5515
+ g = rs("<!---->"), b = g.ownerDocument.importNode(P, !0), b.nodeType === Te.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? g = b : g.appendChild(b);
5516
5516
  else {
5517
5517
  if (!$t && !Gt && !Ot && // eslint-disable-next-line unicorn/prefer-includes
5518
5518
  P.indexOf("<") === -1)
@@ -5546,8 +5546,8 @@ function Ia() {
5546
5546
  qt = null, dn = !1;
5547
5547
  }, e.isValidAttribute = function(P, h, g) {
5548
5548
  qt || Sn({});
5549
- const x = K(P), V = K(h);
5550
- return us(x, V, g);
5549
+ const b = K(P), V = K(h);
5550
+ return us(b, V, g);
5551
5551
  }, e.addHook = function(P, h) {
5552
5552
  typeof h == "function" && me(L[P], h);
5553
5553
  }, e.removeHook = function(P, h) {
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.appendChild(document.createTextNode(":root{--convokit-primary: #000;--convokit-header-bg: #000;--convokit-font-family: Inter, system-ui, sans-serif;--convokit-font-size: 14px;--convokit-border-radius: 18px;--convokit-chat-bg: #ffffff;--convokit-user-msg-bg: #000;--convokit-assistant-msg-bg: #f3f4f6;--convokit-input-bg: #ffffff;--convokit-input-border: #d1d5db}.convokit-widget{position:fixed;top:0;left:0;right:0;bottom:0;pointer-events:none;font-family:var(--convokit-font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.convokit-button{width:56px;height:56px;border-radius:50%;border:2px solid var(--convokit-primary);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px #0000001a;z-index:10000;transition:all .2s ease;background:var(--convokit-primary)}.convokit-button:hover{transform:translateY(-2px);box-shadow:0 4px 12px #00000026}.convokit-button:active{transform:translateY(0)}.convokit-button-hidden{opacity:0;transform:scale(0);pointer-events:none;transition:all .2s ease-in-out}.convokit-chat-window{width:380px;height:600px;background:#fff;border-radius:12px;box-shadow:0 4px 16px #0000001a;display:flex;flex-direction:column;overflow:hidden;position:absolute;bottom:0;right:0;z-index:9999;transform-origin:bottom right;border:2px solid #000;overscroll-behavior:contain}.convokit-chat-window-body{width:100%;height:100%;background:#fff;display:flex;flex-direction:column;overflow:hidden}.convokit-chat-wrapper{display:flex;flex-direction:column;flex:1;background:var(--convokit-chat-bg);overflow:hidden}.convokit-header{padding:16px 20px;color:#fff;display:flex;justify-content:space-between;align-items:center;min-height:60px;background:var(--convokit-header-bg);position:relative;border-bottom:2px solid var(--convokit-header-bg)}.convokit-header-subtitle{margin:0;font-size:12px;opacity:.85;line-height:1.3}.convokit-header-left{display:flex;align-items:center;gap:12px;flex:1}.convokit-avatar{display:none}.convokit-header-text{display:flex;flex-direction:column;gap:4px}.convokit-header-text h3{margin:0;font-size:16px;font-weight:600;line-height:1.3}.convokit-header-actions{display:flex;align-items:center;gap:4px}.convokit-header-icon{background:none;border:none;color:#fff;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:opacity .2s ease}.convokit-header-icon:hover{opacity:.7}.convokit-header-icon:active{opacity:.5}.convokit-chat-window-content{display:flex;flex-direction:column;flex:1;overflow:hidden;min-height:0}.convokit-chat-container{display:flex;flex-direction:column;flex:1;padding:16px;border:none;overflow:hidden;background:transparent;overscroll-behavior:contain}.convokit-messages{flex:1;overflow-y:auto;padding:8px 0;display:flex;flex-direction:column;gap:16px;background:transparent;scrollbar-width:none;-ms-overflow-style:none;overscroll-behavior:contain}.convokit-messages::-webkit-scrollbar{display:none}.convokit-welcome{text-align:center;color:#666;padding:20px;font-size:14px}.convokit-message{display:flex;align-items:flex-end;gap:0;max-width:75%}.convokit-message-user{align-self:flex-end}.convokit-message-assistant{align-self:flex-start}.convokit-bot-icon{display:none}.convokit-message-content{padding:10px 14px;border-radius:var(--convokit-border-radius);word-wrap:break-word;font-size:var(--convokit-font-size);line-height:1.5;position:relative}.convokit-message-user .convokit-message-content{background:var(--convokit-user-msg-bg);color:#fff;border-bottom-right-radius:4px}.convokit-message-assistant .convokit-message-content{background:var(--convokit-assistant-msg-bg);color:#000;border-bottom-left-radius:4px}.convokit-message-content strong{font-weight:600}.convokit-message-content em{font-style:italic}.convokit-message-content a{text-decoration:underline}.convokit-typing{display:flex;gap:6px;padding:4px 0;align-items:center}.convokit-typing span{width:8px;height:8px;border-radius:50%;background:#6b7280;animation:typing-bounce 1.4s ease-in-out infinite}.convokit-typing span:nth-child(1){animation-delay:0s}.convokit-typing span:nth-child(2){animation-delay:.2s}.convokit-typing span:nth-child(3){animation-delay:.4s}@keyframes typing-bounce{0%,60%,to{transform:translateY(0)}30%{transform:translateY(-8px)}}.convokit-input-form{display:flex;align-items:center;padding:12px 0 0;gap:8px;flex-shrink:0;background:transparent;border-bottom:none}.convokit-input{flex:1;padding:11px 14px;border:1px solid color-mix(in srgb,var(--convokit-primary) 35%,transparent);background:var(--convokit-input-bg);border-radius:20px;font-size:var(--convokit-font-size);outline:none;color:#000;font-family:var(--convokit-font-family);transition:border-color .2s ease,box-shadow .2s ease}.convokit-input:focus{border-color:var(--convokit-primary);box-shadow:none}.convokit-input::placeholder{color:#9ca3af}.convokit-input:disabled{background:#f9fafb;color:#9ca3af;border-color:#e5e7eb}.convokit-send-button{width:40px;height:40px;border-radius:50%;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--convokit-primary);transition:opacity .2s ease}.convokit-send-button:hover:not(:disabled){opacity:.8}.convokit-send-button:active:not(:disabled){opacity:.6}.convokit-send-button:disabled{opacity:.3;cursor:not-allowed;background:var(--convokit-primary)}.convokit-footer{padding:10px 16px;text-align:center;background:var(--convokit-chat-bg);font-size:11px;color:#6b7280}.convokit-footer a{color:var(--convokit-primary);text-decoration:none;font-weight:500;transition:opacity .2s ease}.convokit-footer a:hover{opacity:.7}.convokit-rating-prompt{padding:16px;border-top:1px solid #e5e7eb;background-color:#f9fafb;border-bottom-left-radius:12px;border-bottom-right-radius:12px}.convokit-rating-question{margin:0 0 12px;font-size:14px;font-weight:500;color:#374151;text-align:center}.convokit-rating-buttons{display:flex;gap:12px;justify-content:center;margin-bottom:12px}.convokit-rating-button{width:48px;height:48px;border-radius:50%;border:2px solid #d1d5db;background-color:#fff;color:#6b7280;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;padding:0}.convokit-rating-button:hover:not(:disabled){border-color:#9ca3af;transform:scale(1.05)}.convokit-rating-button:disabled{opacity:.5;cursor:not-allowed}.convokit-rating-button.convokit-rating-selected{color:#fff;border-width:2px}.convokit-rating-feedback{margin-top:12px;animation:slideDown .3s ease}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.convokit-rating-textarea{width:100%;padding:10px 12px;border:1px solid #d1d5db;border-radius:8px;font-size:14px;font-family:inherit;resize:vertical;min-height:60px;margin-bottom:8px;box-sizing:border-box}.convokit-rating-textarea:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.convokit-rating-textarea:disabled{background-color:#f3f4f6;cursor:not-allowed}.convokit-rating-submit{width:100%;padding:10px 16px;border:none;border-radius:8px;font-size:14px;font-weight:500;color:#fff;cursor:pointer;transition:opacity .2s ease}.convokit-rating-submit:hover:not(:disabled){opacity:.9}.convokit-rating-submit:disabled{opacity:.6;cursor:not-allowed}.convokit-rating-thankyou{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px;animation:fadeIn .3s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.convokit-rating-icon{width:48px;height:48px;border-radius:50%;background-color:#10b981;color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:700;margin-bottom:12px}.convokit-rating-message{margin:0;font-size:14px;font-weight:500;color:#374151}@media (max-width: 480px){.convokit-widget{bottom:10px;right:10px}.convokit-chat-window{width:calc(100vw - 20px);height:calc(100vh - 20px);max-width:calc(100vw - 20px);max-height:calc(100vh - 20px);bottom:0;right:0;border-radius:16px}.convokit-message{max-width:85%}.convokit-header{padding:16px 16px 12px;min-height:64px}.convokit-chat-container{padding:12px}}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { M as L, r as _, f as R, i as $, s as G, c as Y, a as q, g as A, b as U, d as V, e as J } from "./PopupWidget-CGZOe6ZA.js";
3
- import { P as he } from "./PopupWidget-CGZOe6ZA.js";
2
+ import { M as L, r as _, f as R, i as $, s as G, c as Y, a as q, g as A, b as U, d as V, e as J } from "./PopupWidget-CAnOwL1f.js";
3
+ import { P as he } from "./PopupWidget-CAnOwL1f.js";
4
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
5
  import { useState as u, useRef as F, useEffect as N } from "react";
6
6
  const Q = "convokit-widget", X = ({ config: e, onBack: c, backLabel: r = "Back to editor" }) => {
package/dist/next.esm.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  import n from "next/dynamic";
4
4
  const i = n(
5
- () => import("./PopupWidget-CGZOe6ZA.js").then((e) => e.h).then((e) => e.PopupWidget),
5
+ () => import("./PopupWidget-CAnOwL1f.js").then((e) => e.h).then((e) => e.PopupWidget),
6
6
  { ssr: !1 }
7
7
  ), s = () => {
8
8
  var e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convokit/widget",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "AI chat widget for your website",
5
5
  "type": "module",
6
6
  "main": "dist/index.esm.js",