@coristen/widget 0.1.0 → 0.1.1
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 +12 -2
- package/dist/index.d.ts +13 -3
- package/dist/index.js +791 -593
- package/dist/styles.css +1 -1
- package/dist/website-chat.d.ts +3 -1
- package/dist/widget-composer.d.ts +1 -2
- package/package.json +21 -2
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __getProtoOf = Object.getPrototypeOf;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
@@ -204,12 +205,160 @@ __export(exports_env, {
|
|
|
204
205
|
|
|
205
206
|
// src/index.tsx
|
|
206
207
|
import {
|
|
208
|
+
Component,
|
|
207
209
|
useCallback as useCallback13,
|
|
208
|
-
useEffect as
|
|
210
|
+
useEffect as useEffect19,
|
|
209
211
|
useMemo as useMemo21,
|
|
212
|
+
useRef as useRef34,
|
|
210
213
|
useState as useState18
|
|
211
214
|
} from "react";
|
|
212
215
|
import { ConvexProvider, ConvexReactClient } from "convex/react";
|
|
216
|
+
|
|
217
|
+
// src/website-chat.tsx
|
|
218
|
+
import { useEffect as useEffect18, useRef as useRef33, useState as useState17 } from "react";
|
|
219
|
+
import { useMutation, useQuery } from "convex/react";
|
|
220
|
+
|
|
221
|
+
// ../../node_modules/.bun/dither-avatar@1.0.0+0f58469d5b3bd39f/node_modules/dither-avatar/dist/react.mjs
|
|
222
|
+
import { jsx } from "react/jsx-runtime";
|
|
223
|
+
var GRID = 34;
|
|
224
|
+
var SIZE = 200;
|
|
225
|
+
var SCALE = 6;
|
|
226
|
+
var BAYER_4X4 = [
|
|
227
|
+
[0, 8, 2, 10],
|
|
228
|
+
[12, 4, 14, 6],
|
|
229
|
+
[3, 11, 1, 9],
|
|
230
|
+
[15, 7, 13, 5]
|
|
231
|
+
];
|
|
232
|
+
function hashString(str) {
|
|
233
|
+
let h = 0;
|
|
234
|
+
for (let i = 0;i < str.length; i++) {
|
|
235
|
+
h = (h << 5) - h + str.charCodeAt(i) | 0;
|
|
236
|
+
}
|
|
237
|
+
return Math.abs(h);
|
|
238
|
+
}
|
|
239
|
+
function hashMultiple(str, count) {
|
|
240
|
+
const results = [];
|
|
241
|
+
for (let i = 0;i < count; i++) {
|
|
242
|
+
results.push(hashString(str + ":" + i));
|
|
243
|
+
}
|
|
244
|
+
return results;
|
|
245
|
+
}
|
|
246
|
+
function hslToHex(h, s, l) {
|
|
247
|
+
s /= 100;
|
|
248
|
+
l /= 100;
|
|
249
|
+
const k = (n) => (n + h / 30) % 12;
|
|
250
|
+
const a = s * Math.min(l, 1 - l);
|
|
251
|
+
const f = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
|
|
252
|
+
const toHex = (v) => Math.round(v * 255).toString(16).padStart(2, "0");
|
|
253
|
+
return `#${toHex(f(0))}${toHex(f(8))}${toHex(f(4))}`;
|
|
254
|
+
}
|
|
255
|
+
function generateColors(seed) {
|
|
256
|
+
const [hueHash] = hashMultiple(seed, 1);
|
|
257
|
+
const hue = hueHash % 360;
|
|
258
|
+
return {
|
|
259
|
+
fill: hslToHex(hue, 85, 30),
|
|
260
|
+
stroke: hslToHex(hue, 90, 65)
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function generateDensityGrid(seed) {
|
|
264
|
+
const [angleHash, offsetHash] = hashMultiple(seed, 2);
|
|
265
|
+
const angle = angleHash % 360 * (Math.PI / 180);
|
|
266
|
+
const offset = offsetHash % 100 / 100 * 0.4 - 0.2;
|
|
267
|
+
const cosA = Math.cos(angle);
|
|
268
|
+
const sinA = Math.sin(angle);
|
|
269
|
+
const grid = [];
|
|
270
|
+
for (let y = 0;y < GRID; y++) {
|
|
271
|
+
const row = [];
|
|
272
|
+
for (let x = 0;x < GRID; x++) {
|
|
273
|
+
const nx = x / (GRID - 1) * 2 - 1;
|
|
274
|
+
const ny = y / (GRID - 1) * 2 - 1;
|
|
275
|
+
const projected = nx * cosA + ny * sinA;
|
|
276
|
+
const density = (projected + 1 + offset) / 2;
|
|
277
|
+
row.push(Math.max(0, Math.min(1, density)));
|
|
278
|
+
}
|
|
279
|
+
grid.push(row);
|
|
280
|
+
}
|
|
281
|
+
return grid;
|
|
282
|
+
}
|
|
283
|
+
function dither(density) {
|
|
284
|
+
const result = [];
|
|
285
|
+
for (let y = 0;y < GRID; y++) {
|
|
286
|
+
const row = [];
|
|
287
|
+
for (let x = 0;x < GRID; x++) {
|
|
288
|
+
const bayer = BAYER_4X4[y % 4][x % 4] / 16;
|
|
289
|
+
row.push(density[y][x] >= bayer ? 1 : 0);
|
|
290
|
+
}
|
|
291
|
+
result.push(row);
|
|
292
|
+
}
|
|
293
|
+
return result;
|
|
294
|
+
}
|
|
295
|
+
function bitmapToPath(pixels) {
|
|
296
|
+
const parts = [];
|
|
297
|
+
for (let y = 0;y < GRID; y++) {
|
|
298
|
+
const row = pixels[y];
|
|
299
|
+
const segments = [];
|
|
300
|
+
let x = 0;
|
|
301
|
+
while (x < GRID) {
|
|
302
|
+
if (row[x] === 1) {
|
|
303
|
+
const start = x;
|
|
304
|
+
while (x < GRID && row[x] === 1)
|
|
305
|
+
x++;
|
|
306
|
+
segments.push({ start, len: x - start });
|
|
307
|
+
} else {
|
|
308
|
+
x++;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (segments.length === 0)
|
|
312
|
+
continue;
|
|
313
|
+
let pathStr = `M${segments[0].start} ${y}`;
|
|
314
|
+
let cursorX = segments[0].start;
|
|
315
|
+
pathStr += `h${segments[0].len}`;
|
|
316
|
+
cursorX += segments[0].len;
|
|
317
|
+
for (let i = 1;i < segments.length; i++) {
|
|
318
|
+
const gap = segments[i].start - cursorX;
|
|
319
|
+
pathStr += `m${gap} 0h${segments[i].len}`;
|
|
320
|
+
cursorX = segments[i].start + segments[i].len;
|
|
321
|
+
}
|
|
322
|
+
parts.push(pathStr);
|
|
323
|
+
}
|
|
324
|
+
return parts.join("");
|
|
325
|
+
}
|
|
326
|
+
function generateDitherAvatar(seed) {
|
|
327
|
+
const { fill, stroke } = generateColors(seed);
|
|
328
|
+
const density = generateDensityGrid(seed);
|
|
329
|
+
const pixels = dither(density);
|
|
330
|
+
const path = bitmapToPath(pixels);
|
|
331
|
+
const autoScale = SIZE / GRID;
|
|
332
|
+
const effectiveScale = autoScale * (SCALE / 6);
|
|
333
|
+
const halfGrid = GRID / 2;
|
|
334
|
+
const transform = `translate(${SIZE / 2},${SIZE / 2})scale(${effectiveScale})translate(-${halfGrid},-${halfGrid})`;
|
|
335
|
+
return [
|
|
336
|
+
`<svg width="${SIZE}" height="${SIZE}" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">`,
|
|
337
|
+
`<rect width="${SIZE}" height="${SIZE}" fill="${fill}"/>`,
|
|
338
|
+
`<path fill="none" stroke="${stroke}" transform="${transform}" d="${path}"/>`,
|
|
339
|
+
`</svg>`
|
|
340
|
+
].join("");
|
|
341
|
+
}
|
|
342
|
+
function ditherAvatarDataUri(seed) {
|
|
343
|
+
const svg = generateDitherAvatar(seed);
|
|
344
|
+
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
345
|
+
}
|
|
346
|
+
function DitherAvatar({
|
|
347
|
+
seed,
|
|
348
|
+
size = 40,
|
|
349
|
+
className,
|
|
350
|
+
style
|
|
351
|
+
}) {
|
|
352
|
+
const uri = ditherAvatarDataUri(seed);
|
|
353
|
+
return /* @__PURE__ */ jsx("img", {
|
|
354
|
+
src: uri,
|
|
355
|
+
alt: "",
|
|
356
|
+
width: size,
|
|
357
|
+
height: size,
|
|
358
|
+
className,
|
|
359
|
+
style: { borderRadius: "50%", ...style }
|
|
360
|
+
});
|
|
361
|
+
}
|
|
213
362
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/ArrowLeft.es.js
|
|
214
363
|
import * as o2 from "react";
|
|
215
364
|
|
|
@@ -473,447 +622,263 @@ var t = /* @__PURE__ */ new Map([
|
|
|
473
622
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/CaretRight.es.js
|
|
474
623
|
var e8 = t2.forwardRef((o, r) => /* @__PURE__ */ t2.createElement(p, { ref: r, ...o, weights: t }));
|
|
475
624
|
e8.displayName = "CaretRightIcon";
|
|
476
|
-
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/ChatText.es.js
|
|
477
|
-
import * as t3 from "react";
|
|
478
|
-
|
|
479
|
-
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/ChatText.es.js
|
|
480
|
-
import * as a6 from "react";
|
|
481
|
-
var e9 = /* @__PURE__ */ new Map([
|
|
482
|
-
[
|
|
483
|
-
"bold",
|
|
484
|
-
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M216,44H40A20,20,0,0,0,20,64V224A19.82,19.82,0,0,0,31.56,242.1a20.14,20.14,0,0,0,8.49,1.9,19.91,19.91,0,0,0,12.82-4.72l.12-.11L84.47,212H216a20,20,0,0,0,20-20V64A20,20,0,0,0,216,44Zm-4,144H80a11.93,11.93,0,0,0-7.84,2.92L44,215.23V68H212ZM84,108A12,12,0,0,1,96,96h64a12,12,0,1,1,0,24H96A12,12,0,0,1,84,108Zm0,40a12,12,0,0,1,12-12h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,148Z" }))
|
|
485
|
-
],
|
|
486
|
-
[
|
|
487
|
-
"duotone",
|
|
488
|
-
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", {
|
|
489
|
-
d: "M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",
|
|
490
|
-
opacity: "0.2"
|
|
491
|
-
}), /* @__PURE__ */ a6.createElement("path", { d: "M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z" }))
|
|
492
|
-
],
|
|
493
|
-
[
|
|
494
|
-
"fill",
|
|
495
|
-
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM160,152H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z" }))
|
|
496
|
-
],
|
|
497
|
-
[
|
|
498
|
-
"light",
|
|
499
|
-
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M216,50H40A14,14,0,0,0,26,64V224a13.88,13.88,0,0,0,8.09,12.69A14.11,14.11,0,0,0,40,238a13.87,13.87,0,0,0,9-3.31l.06-.05L82.23,206H216a14,14,0,0,0,14-14V64A14,14,0,0,0,216,50Zm2,142a2,2,0,0,1-2,2H80a6,6,0,0,0-3.92,1.46L41.26,225.53A2,2,0,0,1,38,224V64a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Zm-52-80a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,144Z" }))
|
|
500
|
-
],
|
|
501
|
-
[
|
|
502
|
-
"regular",
|
|
503
|
-
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z" }))
|
|
504
|
-
],
|
|
505
|
-
[
|
|
506
|
-
"thin",
|
|
507
|
-
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M216,52H40A12,12,0,0,0,28,64V224a11.89,11.89,0,0,0,6.93,10.88A12.17,12.17,0,0,0,40,236a11.89,11.89,0,0,0,7.69-2.83l0,0L81.49,204H216a12,12,0,0,0,12-12V64A12,12,0,0,0,216,52Zm4,140a4,4,0,0,1-4,4H80a4,4,0,0,0-2.62,1L42.56,227.06A4,4,0,0,1,36,224V64a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Zm-56-80a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,144Z" }))
|
|
508
|
-
]
|
|
509
|
-
]);
|
|
510
|
-
|
|
511
|
-
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/ChatText.es.js
|
|
512
|
-
var e10 = t3.forwardRef((o, a) => /* @__PURE__ */ t3.createElement(p, { ref: a, ...o, weights: e9 }));
|
|
513
|
-
e10.displayName = "ChatTextIcon";
|
|
514
625
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/ClockCounterClockwise.es.js
|
|
515
626
|
import * as o7 from "react";
|
|
516
627
|
|
|
517
628
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/ClockCounterClockwise.es.js
|
|
518
|
-
import * as
|
|
519
|
-
var
|
|
629
|
+
import * as a6 from "react";
|
|
630
|
+
var e9 = /* @__PURE__ */ new Map([
|
|
520
631
|
[
|
|
521
632
|
"bold",
|
|
522
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z" }))
|
|
523
634
|
],
|
|
524
635
|
[
|
|
525
636
|
"duotone",
|
|
526
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z", opacity: "0.2" }), /* @__PURE__ */ a6.createElement("path", { d: "M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z" }))
|
|
527
638
|
],
|
|
528
639
|
[
|
|
529
640
|
"fill",
|
|
530
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z" }))
|
|
531
642
|
],
|
|
532
643
|
[
|
|
533
644
|
"light",
|
|
534
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z" }))
|
|
535
646
|
],
|
|
536
647
|
[
|
|
537
648
|
"regular",
|
|
538
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z" }))
|
|
539
650
|
],
|
|
540
651
|
[
|
|
541
652
|
"thin",
|
|
542
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ a6.createElement(a6.Fragment, null, /* @__PURE__ */ a6.createElement("path", { d: "M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z" }))
|
|
543
654
|
]
|
|
544
655
|
]);
|
|
545
656
|
|
|
546
657
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/ClockCounterClockwise.es.js
|
|
547
|
-
var
|
|
548
|
-
|
|
658
|
+
var e10 = o7.forwardRef((c, r) => /* @__PURE__ */ o7.createElement(p, { ref: r, ...c, weights: e9 }));
|
|
659
|
+
e10.displayName = "ClockCounterClockwiseIcon";
|
|
549
660
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/FileText.es.js
|
|
550
|
-
import * as
|
|
661
|
+
import * as e12 from "react";
|
|
551
662
|
|
|
552
663
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/FileText.es.js
|
|
553
|
-
import * as
|
|
554
|
-
var
|
|
664
|
+
import * as a7 from "react";
|
|
665
|
+
var e11 = /* @__PURE__ */ new Map([
|
|
555
666
|
[
|
|
556
667
|
"bold",
|
|
557
|
-
/* @__PURE__ */
|
|
668
|
+
/* @__PURE__ */ a7.createElement(a7.Fragment, null, /* @__PURE__ */ a7.createElement("path", { d: "M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Zm112-80a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,132Zm0,40a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,172Z" }))
|
|
558
669
|
],
|
|
559
670
|
[
|
|
560
671
|
"duotone",
|
|
561
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ a7.createElement(a7.Fragment, null, /* @__PURE__ */ a7.createElement("path", { d: "M208,88H152V32Z", opacity: "0.2" }), /* @__PURE__ */ a7.createElement("path", { d: "M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z" }))
|
|
562
673
|
],
|
|
563
674
|
[
|
|
564
675
|
"fill",
|
|
565
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ a7.createElement(a7.Fragment, null, /* @__PURE__ */ a7.createElement("path", { d: "M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,176H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm-8-56V44l44,44Z" }))
|
|
566
677
|
],
|
|
567
678
|
[
|
|
568
679
|
"light",
|
|
569
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ a7.createElement(a7.Fragment, null, /* @__PURE__ */ a7.createElement("path", { d: "M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z" }))
|
|
570
681
|
],
|
|
571
682
|
[
|
|
572
683
|
"regular",
|
|
573
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ a7.createElement(a7.Fragment, null, /* @__PURE__ */ a7.createElement("path", { d: "M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Zm-32-80a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,136Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,168Z" }))
|
|
574
685
|
],
|
|
575
686
|
[
|
|
576
687
|
"thin",
|
|
577
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ a7.createElement(a7.Fragment, null, /* @__PURE__ */ a7.createElement("path", { d: "M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Zm-36-84a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,136Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,168Z" }))
|
|
578
689
|
]
|
|
579
690
|
]);
|
|
580
691
|
|
|
581
692
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/FileText.es.js
|
|
582
|
-
var o8 =
|
|
693
|
+
var o8 = e12.forwardRef((t, r) => /* @__PURE__ */ e12.createElement(p, { ref: r, ...t, weights: e11 }));
|
|
583
694
|
o8.displayName = "FileTextIcon";
|
|
584
695
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/Globe.es.js
|
|
585
696
|
import * as o9 from "react";
|
|
586
697
|
|
|
587
698
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/Globe.es.js
|
|
588
|
-
import * as
|
|
589
|
-
var
|
|
699
|
+
import * as a8 from "react";
|
|
700
|
+
var e13 = /* @__PURE__ */ new Map([
|
|
590
701
|
[
|
|
591
702
|
"bold",
|
|
592
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ a8.createElement(a8.Fragment, null, /* @__PURE__ */ a8.createElement("path", { d: "M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z" }))
|
|
593
704
|
],
|
|
594
705
|
[
|
|
595
706
|
"duotone",
|
|
596
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ a8.createElement(a8.Fragment, null, /* @__PURE__ */ a8.createElement("path", { d: "M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z", opacity: "0.2" }), /* @__PURE__ */ a8.createElement("path", { d: "M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z" }))
|
|
597
708
|
],
|
|
598
709
|
[
|
|
599
710
|
"fill",
|
|
600
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ a8.createElement(a8.Fragment, null, /* @__PURE__ */ a8.createElement("path", { d: "M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z" }))
|
|
601
712
|
],
|
|
602
713
|
[
|
|
603
714
|
"light",
|
|
604
|
-
/* @__PURE__ */
|
|
715
|
+
/* @__PURE__ */ a8.createElement(a8.Fragment, null, /* @__PURE__ */ a8.createElement("path", { d: "M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z" }))
|
|
605
716
|
],
|
|
606
717
|
[
|
|
607
718
|
"regular",
|
|
608
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ a8.createElement(a8.Fragment, null, /* @__PURE__ */ a8.createElement("path", { d: "M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z" }))
|
|
609
720
|
],
|
|
610
721
|
[
|
|
611
722
|
"thin",
|
|
612
|
-
/* @__PURE__ */
|
|
723
|
+
/* @__PURE__ */ a8.createElement(a8.Fragment, null, /* @__PURE__ */ a8.createElement("path", { d: "M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z" }))
|
|
613
724
|
]
|
|
614
725
|
]);
|
|
615
726
|
|
|
616
727
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/Globe.es.js
|
|
617
|
-
var
|
|
618
|
-
|
|
728
|
+
var e14 = o9.forwardRef((r, t) => /* @__PURE__ */ o9.createElement(p, { ref: t, ...r, weights: e13 }));
|
|
729
|
+
e14.displayName = "GlobeIcon";
|
|
619
730
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/Image.es.js
|
|
620
|
-
import * as
|
|
731
|
+
import * as e16 from "react";
|
|
621
732
|
|
|
622
733
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/Image.es.js
|
|
623
|
-
import * as
|
|
624
|
-
var
|
|
734
|
+
import * as a9 from "react";
|
|
735
|
+
var e15 = /* @__PURE__ */ new Map([
|
|
625
736
|
[
|
|
626
737
|
"bold",
|
|
627
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ a9.createElement(a9.Fragment, null, /* @__PURE__ */ a9.createElement("path", { d: "M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z" }))
|
|
628
739
|
],
|
|
629
740
|
[
|
|
630
741
|
"duotone",
|
|
631
|
-
/* @__PURE__ */
|
|
742
|
+
/* @__PURE__ */ a9.createElement(a9.Fragment, null, /* @__PURE__ */ a9.createElement("path", {
|
|
632
743
|
d: "M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",
|
|
633
744
|
opacity: "0.2"
|
|
634
|
-
}), /* @__PURE__ */
|
|
745
|
+
}), /* @__PURE__ */ a9.createElement("path", { d: "M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z" }))
|
|
635
746
|
],
|
|
636
747
|
[
|
|
637
748
|
"fill",
|
|
638
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ a9.createElement(a9.Fragment, null, /* @__PURE__ */ a9.createElement("path", { d: "M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z" }))
|
|
639
750
|
],
|
|
640
751
|
[
|
|
641
752
|
"light",
|
|
642
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ a9.createElement(a9.Fragment, null, /* @__PURE__ */ a9.createElement("path", { d: "M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z" }))
|
|
643
754
|
],
|
|
644
755
|
[
|
|
645
756
|
"regular",
|
|
646
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ a9.createElement(a9.Fragment, null, /* @__PURE__ */ a9.createElement("path", { d: "M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z" }))
|
|
647
758
|
],
|
|
648
759
|
[
|
|
649
760
|
"thin",
|
|
650
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ a9.createElement(a9.Fragment, null, /* @__PURE__ */ a9.createElement("path", { d: "M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z" }))
|
|
651
762
|
]
|
|
652
763
|
]);
|
|
653
764
|
|
|
654
765
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/Image.es.js
|
|
655
|
-
var o10 =
|
|
766
|
+
var o10 = e16.forwardRef((a, m) => /* @__PURE__ */ e16.createElement(p, { ref: m, ...a, weights: e15 }));
|
|
656
767
|
o10.displayName = "ImageIcon";
|
|
657
768
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/Paperclip.es.js
|
|
658
|
-
import * as
|
|
769
|
+
import * as e18 from "react";
|
|
659
770
|
|
|
660
771
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/Paperclip.es.js
|
|
661
|
-
import * as
|
|
662
|
-
var
|
|
772
|
+
import * as a10 from "react";
|
|
773
|
+
var e17 = /* @__PURE__ */ new Map([
|
|
663
774
|
[
|
|
664
775
|
"bold",
|
|
665
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ a10.createElement(a10.Fragment, null, /* @__PURE__ */ a10.createElement("path", { d: "M212.48,136.49l-82.06,82a60,60,0,0,1-84.85-84.88l98.16-97.89a40,40,0,0,1,56.56,56.59l-.17.16-95.8,92.22a12,12,0,1,1-16.64-17.3l95.71-92.12a16,16,0,0,0-22.7-22.56L62.53,150.57a36,36,0,0,0,50.93,50.91l82.06-82a12,12,0,0,1,17,17Z" }))
|
|
666
777
|
],
|
|
667
778
|
[
|
|
668
779
|
"duotone",
|
|
669
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ a10.createElement(a10.Fragment, null, /* @__PURE__ */ a10.createElement("path", {
|
|
670
781
|
d: "M180.75,104.75,204,128l-82.06,81.94a48,48,0,0,1-67.88-67.88L153.37,41.37a32,32,0,0,1,45.26,45.26Z",
|
|
671
782
|
opacity: "0.2"
|
|
672
|
-
}), /* @__PURE__ */
|
|
783
|
+
}), /* @__PURE__ */ a10.createElement("path", { d: "M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z" }))
|
|
673
784
|
],
|
|
674
785
|
[
|
|
675
786
|
"fill",
|
|
676
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ a10.createElement(a10.Fragment, null, /* @__PURE__ */ a10.createElement("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,50.34a8,8,0,0,0-11.32,0L87.09,143A24,24,0,1,0,121,177l49.32-50.32a8,8,0,1,1,11.42,11.2l-49.37,50.38a40,40,0,1,1-56.62-56.51L143,63.09A24,24,0,1,1,177,97L109.71,165.6a8,8,0,1,1-11.42-11.2L165.6,85.71a8,8,0,0,0,.06-11.37Z" }))
|
|
677
788
|
],
|
|
678
789
|
[
|
|
679
790
|
"light",
|
|
680
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ a10.createElement(a10.Fragment, null, /* @__PURE__ */ a10.createElement("path", { d: "M208.25,123.76a6,6,0,0,1,0,8.49l-82.06,82a54,54,0,0,1-76.36-76.39L149.1,37.14a38,38,0,1,1,53.77,53.72L103.59,191.54a22,22,0,1,1-31.15-31.09l83.28-84.67a6,6,0,0,1,8.56,8.42L81,168.91a10,10,0,1,0,14.11,14.18L194.35,82.4a26,26,0,1,0-36.74-36.8L58.33,146.28a42,42,0,1,0,59.37,59.44l82.06-82A6,6,0,0,1,208.25,123.76Z" }))
|
|
681
792
|
],
|
|
682
793
|
[
|
|
683
794
|
"regular",
|
|
684
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ a10.createElement(a10.Fragment, null, /* @__PURE__ */ a10.createElement("path", { d: "M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z" }))
|
|
685
796
|
],
|
|
686
797
|
[
|
|
687
798
|
"thin",
|
|
688
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ a10.createElement(a10.Fragment, null, /* @__PURE__ */ a10.createElement("path", { d: "M206.83,125.17a4,4,0,0,1,0,5.66l-82.06,82a52,52,0,0,1-73.54-73.55L150.52,38.55a36,36,0,1,1,50.94,50.9l-99.3,100.69a20,20,0,1,1-28.3-28.27l83.29-84.68a4,4,0,1,1,5.7,5.61L79.54,167.5a12,12,0,1,0,16.95,17L195.78,83.81A28,28,0,1,0,156.2,44.18L56.91,144.87a44,44,0,1,0,62.21,62.26l82-82A4,4,0,0,1,206.83,125.17Z" }))
|
|
689
800
|
]
|
|
690
801
|
]);
|
|
691
802
|
|
|
692
803
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/Paperclip.es.js
|
|
693
|
-
var o11 =
|
|
804
|
+
var o11 = e18.forwardRef((r, a) => /* @__PURE__ */ e18.createElement(p, { ref: a, ...r, weights: e17 }));
|
|
694
805
|
o11.displayName = "PaperclipIcon";
|
|
695
806
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/Plus.es.js
|
|
696
807
|
import * as o12 from "react";
|
|
697
808
|
|
|
698
809
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/Plus.es.js
|
|
699
|
-
import * as
|
|
700
|
-
var
|
|
810
|
+
import * as e19 from "react";
|
|
811
|
+
var a11 = /* @__PURE__ */ new Map([
|
|
701
812
|
[
|
|
702
813
|
"bold",
|
|
703
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ e19.createElement(e19.Fragment, null, /* @__PURE__ */ e19.createElement("path", { d: "M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z" }))
|
|
704
815
|
],
|
|
705
816
|
[
|
|
706
817
|
"duotone",
|
|
707
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ e19.createElement(e19.Fragment, null, /* @__PURE__ */ e19.createElement("path", {
|
|
708
819
|
d: "M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",
|
|
709
820
|
opacity: "0.2"
|
|
710
|
-
}), /* @__PURE__ */
|
|
821
|
+
}), /* @__PURE__ */ e19.createElement("path", { d: "M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z" }))
|
|
711
822
|
],
|
|
712
823
|
[
|
|
713
824
|
"fill",
|
|
714
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ e19.createElement(e19.Fragment, null, /* @__PURE__ */ e19.createElement("path", { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z" }))
|
|
715
826
|
],
|
|
716
827
|
[
|
|
717
828
|
"light",
|
|
718
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ e19.createElement(e19.Fragment, null, /* @__PURE__ */ e19.createElement("path", { d: "M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z" }))
|
|
719
830
|
],
|
|
720
831
|
[
|
|
721
832
|
"regular",
|
|
722
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ e19.createElement(e19.Fragment, null, /* @__PURE__ */ e19.createElement("path", { d: "M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z" }))
|
|
723
834
|
],
|
|
724
835
|
[
|
|
725
836
|
"thin",
|
|
726
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ e19.createElement(e19.Fragment, null, /* @__PURE__ */ e19.createElement("path", { d: "M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z" }))
|
|
727
838
|
]
|
|
728
839
|
]);
|
|
729
840
|
|
|
730
841
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/Plus.es.js
|
|
731
|
-
var
|
|
732
|
-
|
|
842
|
+
var e20 = o12.forwardRef((r, s) => /* @__PURE__ */ o12.createElement(p, { ref: s, ...r, weights: a11 }));
|
|
843
|
+
e20.displayName = "PlusIcon";
|
|
733
844
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/X.es.js
|
|
734
845
|
import * as o13 from "react";
|
|
735
846
|
|
|
736
847
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/X.es.js
|
|
737
|
-
import * as
|
|
738
|
-
var
|
|
848
|
+
import * as e21 from "react";
|
|
849
|
+
var a12 = /* @__PURE__ */ new Map([
|
|
739
850
|
[
|
|
740
851
|
"bold",
|
|
741
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ e21.createElement(e21.Fragment, null, /* @__PURE__ */ e21.createElement("path", { d: "M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z" }))
|
|
742
853
|
],
|
|
743
854
|
[
|
|
744
855
|
"duotone",
|
|
745
|
-
/* @__PURE__ */
|
|
856
|
+
/* @__PURE__ */ e21.createElement(e21.Fragment, null, /* @__PURE__ */ e21.createElement("path", {
|
|
746
857
|
d: "M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",
|
|
747
858
|
opacity: "0.2"
|
|
748
|
-
}), /* @__PURE__ */
|
|
749
|
-
],
|
|
750
|
-
[
|
|
751
|
-
"fill",
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
],
|
|
754
|
-
[
|
|
755
|
-
"light",
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
-
],
|
|
758
|
-
[
|
|
759
|
-
"regular",
|
|
760
|
-
/* @__PURE__ */
|
|
761
|
-
],
|
|
762
|
-
[
|
|
763
|
-
"thin",
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
]
|
|
766
|
-
]);
|
|
767
|
-
|
|
768
|
-
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/X.es.js
|
|
769
|
-
var e24 = o13.forwardRef((r, t) => /* @__PURE__ */ o13.createElement(p, { ref: t, ...r, weights: a13 }));
|
|
770
|
-
e24.displayName = "XIcon";
|
|
771
|
-
// src/website-chat.tsx
|
|
772
|
-
import { useEffect as useEffect17, useState as useState17 } from "react";
|
|
773
|
-
import { useMutation, useQuery } from "convex/react";
|
|
774
|
-
|
|
775
|
-
// ../../node_modules/.bun/dither-avatar@1.0.0+0f58469d5b3bd39f/node_modules/dither-avatar/dist/react.mjs
|
|
776
|
-
import { jsx } from "react/jsx-runtime";
|
|
777
|
-
var GRID = 34;
|
|
778
|
-
var SIZE = 200;
|
|
779
|
-
var SCALE = 6;
|
|
780
|
-
var BAYER_4X4 = [
|
|
781
|
-
[0, 8, 2, 10],
|
|
782
|
-
[12, 4, 14, 6],
|
|
783
|
-
[3, 11, 1, 9],
|
|
784
|
-
[15, 7, 13, 5]
|
|
785
|
-
];
|
|
786
|
-
function hashString(str) {
|
|
787
|
-
let h = 0;
|
|
788
|
-
for (let i = 0;i < str.length; i++) {
|
|
789
|
-
h = (h << 5) - h + str.charCodeAt(i) | 0;
|
|
790
|
-
}
|
|
791
|
-
return Math.abs(h);
|
|
792
|
-
}
|
|
793
|
-
function hashMultiple(str, count) {
|
|
794
|
-
const results = [];
|
|
795
|
-
for (let i = 0;i < count; i++) {
|
|
796
|
-
results.push(hashString(str + ":" + i));
|
|
797
|
-
}
|
|
798
|
-
return results;
|
|
799
|
-
}
|
|
800
|
-
function hslToHex(h, s, l) {
|
|
801
|
-
s /= 100;
|
|
802
|
-
l /= 100;
|
|
803
|
-
const k = (n) => (n + h / 30) % 12;
|
|
804
|
-
const a = s * Math.min(l, 1 - l);
|
|
805
|
-
const f = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
|
|
806
|
-
const toHex = (v) => Math.round(v * 255).toString(16).padStart(2, "0");
|
|
807
|
-
return `#${toHex(f(0))}${toHex(f(8))}${toHex(f(4))}`;
|
|
808
|
-
}
|
|
809
|
-
function generateColors(seed) {
|
|
810
|
-
const [hueHash] = hashMultiple(seed, 1);
|
|
811
|
-
const hue = hueHash % 360;
|
|
812
|
-
return {
|
|
813
|
-
fill: hslToHex(hue, 85, 30),
|
|
814
|
-
stroke: hslToHex(hue, 90, 65)
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
function generateDensityGrid(seed) {
|
|
818
|
-
const [angleHash, offsetHash] = hashMultiple(seed, 2);
|
|
819
|
-
const angle = angleHash % 360 * (Math.PI / 180);
|
|
820
|
-
const offset = offsetHash % 100 / 100 * 0.4 - 0.2;
|
|
821
|
-
const cosA = Math.cos(angle);
|
|
822
|
-
const sinA = Math.sin(angle);
|
|
823
|
-
const grid = [];
|
|
824
|
-
for (let y = 0;y < GRID; y++) {
|
|
825
|
-
const row = [];
|
|
826
|
-
for (let x = 0;x < GRID; x++) {
|
|
827
|
-
const nx = x / (GRID - 1) * 2 - 1;
|
|
828
|
-
const ny = y / (GRID - 1) * 2 - 1;
|
|
829
|
-
const projected = nx * cosA + ny * sinA;
|
|
830
|
-
const density = (projected + 1 + offset) / 2;
|
|
831
|
-
row.push(Math.max(0, Math.min(1, density)));
|
|
832
|
-
}
|
|
833
|
-
grid.push(row);
|
|
834
|
-
}
|
|
835
|
-
return grid;
|
|
836
|
-
}
|
|
837
|
-
function dither(density) {
|
|
838
|
-
const result = [];
|
|
839
|
-
for (let y = 0;y < GRID; y++) {
|
|
840
|
-
const row = [];
|
|
841
|
-
for (let x = 0;x < GRID; x++) {
|
|
842
|
-
const bayer = BAYER_4X4[y % 4][x % 4] / 16;
|
|
843
|
-
row.push(density[y][x] >= bayer ? 1 : 0);
|
|
844
|
-
}
|
|
845
|
-
result.push(row);
|
|
846
|
-
}
|
|
847
|
-
return result;
|
|
848
|
-
}
|
|
849
|
-
function bitmapToPath(pixels) {
|
|
850
|
-
const parts = [];
|
|
851
|
-
for (let y = 0;y < GRID; y++) {
|
|
852
|
-
const row = pixels[y];
|
|
853
|
-
const segments = [];
|
|
854
|
-
let x = 0;
|
|
855
|
-
while (x < GRID) {
|
|
856
|
-
if (row[x] === 1) {
|
|
857
|
-
const start = x;
|
|
858
|
-
while (x < GRID && row[x] === 1)
|
|
859
|
-
x++;
|
|
860
|
-
segments.push({ start, len: x - start });
|
|
861
|
-
} else {
|
|
862
|
-
x++;
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
if (segments.length === 0)
|
|
866
|
-
continue;
|
|
867
|
-
let pathStr = `M${segments[0].start} ${y}`;
|
|
868
|
-
let cursorX = segments[0].start;
|
|
869
|
-
pathStr += `h${segments[0].len}`;
|
|
870
|
-
cursorX += segments[0].len;
|
|
871
|
-
for (let i = 1;i < segments.length; i++) {
|
|
872
|
-
const gap = segments[i].start - cursorX;
|
|
873
|
-
pathStr += `m${gap} 0h${segments[i].len}`;
|
|
874
|
-
cursorX = segments[i].start + segments[i].len;
|
|
875
|
-
}
|
|
876
|
-
parts.push(pathStr);
|
|
877
|
-
}
|
|
878
|
-
return parts.join("");
|
|
879
|
-
}
|
|
880
|
-
function generateDitherAvatar(seed) {
|
|
881
|
-
const { fill, stroke } = generateColors(seed);
|
|
882
|
-
const density = generateDensityGrid(seed);
|
|
883
|
-
const pixels = dither(density);
|
|
884
|
-
const path = bitmapToPath(pixels);
|
|
885
|
-
const autoScale = SIZE / GRID;
|
|
886
|
-
const effectiveScale = autoScale * (SCALE / 6);
|
|
887
|
-
const halfGrid = GRID / 2;
|
|
888
|
-
const transform = `translate(${SIZE / 2},${SIZE / 2})scale(${effectiveScale})translate(-${halfGrid},-${halfGrid})`;
|
|
889
|
-
return [
|
|
890
|
-
`<svg width="${SIZE}" height="${SIZE}" xmlns="http://www.w3.org/2000/svg" shape-rendering="crispEdges">`,
|
|
891
|
-
`<rect width="${SIZE}" height="${SIZE}" fill="${fill}"/>`,
|
|
892
|
-
`<path fill="none" stroke="${stroke}" transform="${transform}" d="${path}"/>`,
|
|
893
|
-
`</svg>`
|
|
894
|
-
].join("");
|
|
895
|
-
}
|
|
896
|
-
function ditherAvatarDataUri(seed) {
|
|
897
|
-
const svg = generateDitherAvatar(seed);
|
|
898
|
-
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
899
|
-
}
|
|
900
|
-
function DitherAvatar({
|
|
901
|
-
seed,
|
|
902
|
-
size = 40,
|
|
903
|
-
className,
|
|
904
|
-
style
|
|
905
|
-
}) {
|
|
906
|
-
const uri = ditherAvatarDataUri(seed);
|
|
907
|
-
return /* @__PURE__ */ jsx("img", {
|
|
908
|
-
src: uri,
|
|
909
|
-
alt: "",
|
|
910
|
-
width: size,
|
|
911
|
-
height: size,
|
|
912
|
-
className,
|
|
913
|
-
style: { borderRadius: "50%", ...style }
|
|
914
|
-
});
|
|
915
|
-
}
|
|
859
|
+
}), /* @__PURE__ */ e21.createElement("path", { d: "M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
|
|
860
|
+
],
|
|
861
|
+
[
|
|
862
|
+
"fill",
|
|
863
|
+
/* @__PURE__ */ e21.createElement(e21.Fragment, null, /* @__PURE__ */ e21.createElement("path", { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
|
|
864
|
+
],
|
|
865
|
+
[
|
|
866
|
+
"light",
|
|
867
|
+
/* @__PURE__ */ e21.createElement(e21.Fragment, null, /* @__PURE__ */ e21.createElement("path", { d: "M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z" }))
|
|
868
|
+
],
|
|
869
|
+
[
|
|
870
|
+
"regular",
|
|
871
|
+
/* @__PURE__ */ e21.createElement(e21.Fragment, null, /* @__PURE__ */ e21.createElement("path", { d: "M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
|
|
872
|
+
],
|
|
873
|
+
[
|
|
874
|
+
"thin",
|
|
875
|
+
/* @__PURE__ */ e21.createElement(e21.Fragment, null, /* @__PURE__ */ e21.createElement("path", { d: "M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z" }))
|
|
876
|
+
]
|
|
877
|
+
]);
|
|
916
878
|
|
|
879
|
+
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/X.es.js
|
|
880
|
+
var e22 = o13.forwardRef((r, t) => /* @__PURE__ */ o13.createElement(p, { ref: t, ...r, weights: a12 }));
|
|
881
|
+
e22.displayName = "XIcon";
|
|
917
882
|
// src/api.ts
|
|
918
883
|
import { makeFunctionReference } from "convex/server";
|
|
919
884
|
var widgetApi = {
|
|
@@ -930,7 +895,11 @@ var widgetApi = {
|
|
|
930
895
|
};
|
|
931
896
|
|
|
932
897
|
// src/widget-composer.tsx
|
|
933
|
-
import {
|
|
898
|
+
import {
|
|
899
|
+
useEffect as useEffect16,
|
|
900
|
+
useRef as useRef30,
|
|
901
|
+
useState as useState14
|
|
902
|
+
} from "react";
|
|
934
903
|
|
|
935
904
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/mergeObjects.mjs
|
|
936
905
|
function mergeObjects(a, b) {
|
|
@@ -1103,7 +1072,6 @@ import * as React4 from "react";
|
|
|
1103
1072
|
|
|
1104
1073
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useRefWithInit.mjs
|
|
1105
1074
|
import * as React from "react";
|
|
1106
|
-
"use client";
|
|
1107
1075
|
var UNINITIALIZED = {};
|
|
1108
1076
|
function useRefWithInit(init, initArg) {
|
|
1109
1077
|
const ref = React.useRef(UNINITIALIZED);
|
|
@@ -2943,7 +2911,6 @@ var SafeReact = {
|
|
|
2943
2911
|
};
|
|
2944
2912
|
|
|
2945
2913
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useStableCallback.mjs
|
|
2946
|
-
"use client";
|
|
2947
2914
|
var useInsertionEffect = SafeReact.useInsertionEffect;
|
|
2948
2915
|
var useSafeInsertionEffect = useInsertionEffect && useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn();
|
|
2949
2916
|
function useStableCallback(callback) {
|
|
@@ -2974,13 +2941,11 @@ var error = createLogOnce("error", "Base UI");
|
|
|
2974
2941
|
|
|
2975
2942
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
|
|
2976
2943
|
import * as React6 from "react";
|
|
2977
|
-
"use client";
|
|
2978
2944
|
var noop = () => {};
|
|
2979
2945
|
var useIsoLayoutEffect = typeof document !== "undefined" ? React6.useLayoutEffect : noop;
|
|
2980
2946
|
|
|
2981
2947
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
|
|
2982
2948
|
import * as React7 from "react";
|
|
2983
|
-
"use client";
|
|
2984
2949
|
var CompositeRootContext = /* @__PURE__ */ React7.createContext(undefined);
|
|
2985
2950
|
if (true)
|
|
2986
2951
|
CompositeRootContext.displayName = "CompositeRootContext";
|
|
@@ -2994,7 +2959,6 @@ function useCompositeRootContext(optional = false) {
|
|
|
2994
2959
|
|
|
2995
2960
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
|
|
2996
2961
|
import * as React8 from "react";
|
|
2997
|
-
"use client";
|
|
2998
2962
|
function useFocusableWhenDisabled(parameters) {
|
|
2999
2963
|
const {
|
|
3000
2964
|
focusableWhenDisabled,
|
|
@@ -3056,7 +3020,6 @@ function dispatchClickWithModifiers(target, sourceEvent, {
|
|
|
3056
3020
|
}
|
|
3057
3021
|
|
|
3058
3022
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/use-button/useButton.mjs
|
|
3059
|
-
"use client";
|
|
3060
3023
|
function useButton(parameters = {}) {
|
|
3061
3024
|
const {
|
|
3062
3025
|
disabled = false,
|
|
@@ -3220,7 +3183,6 @@ function isValidLinkElement(elem) {
|
|
|
3220
3183
|
}
|
|
3221
3184
|
|
|
3222
3185
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/button/Button.mjs
|
|
3223
|
-
"use client";
|
|
3224
3186
|
var Button = /* @__PURE__ */ React10.forwardRef(function Button(componentProps, forwardedRef) {
|
|
3225
3187
|
const {
|
|
3226
3188
|
render,
|
|
@@ -3409,7 +3371,6 @@ function AttachmentGroup({ className, ...props }) {
|
|
|
3409
3371
|
|
|
3410
3372
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/positioner/MenuPositionerContext.mjs
|
|
3411
3373
|
import * as React11 from "react";
|
|
3412
|
-
"use client";
|
|
3413
3374
|
var MenuPositionerContext = /* @__PURE__ */ React11.createContext(undefined);
|
|
3414
3375
|
if (true)
|
|
3415
3376
|
MenuPositionerContext.displayName = "MenuPositionerContext";
|
|
@@ -3423,7 +3384,6 @@ function useMenuPositionerContext(optional) {
|
|
|
3423
3384
|
|
|
3424
3385
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/root/MenuRootContext.mjs
|
|
3425
3386
|
import * as React12 from "react";
|
|
3426
|
-
"use client";
|
|
3427
3387
|
var MenuRootContext = /* @__PURE__ */ React12.createContext(undefined);
|
|
3428
3388
|
if (true)
|
|
3429
3389
|
MenuRootContext.displayName = "MenuRootContext";
|
|
@@ -3523,7 +3483,6 @@ var popupTransitionStateMapping = {
|
|
|
3523
3483
|
|
|
3524
3484
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/context-menu/root/ContextMenuRootContext.mjs
|
|
3525
3485
|
import * as React13 from "react";
|
|
3526
|
-
"use client";
|
|
3527
3486
|
var ContextMenuRootContext = /* @__PURE__ */ React13.createContext(undefined);
|
|
3528
3487
|
if (true)
|
|
3529
3488
|
ContextMenuRootContext.displayName = "ContextMenuRootContext";
|
|
@@ -3554,7 +3513,6 @@ var imperativeAction = "imperative-action";
|
|
|
3554
3513
|
|
|
3555
3514
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/filter-root/MenuFilterContext.mjs
|
|
3556
3515
|
import * as React14 from "react";
|
|
3557
|
-
"use client";
|
|
3558
3516
|
var MenuFilterImplContext = /* @__PURE__ */ React14.createContext(null);
|
|
3559
3517
|
if (true)
|
|
3560
3518
|
MenuFilterImplContext.displayName = "MenuFilterImplContext";
|
|
@@ -3648,7 +3606,6 @@ var voiceOver = apple;
|
|
|
3648
3606
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/platform/env.mjs
|
|
3649
3607
|
var jsdom = /jsdom|happydom/.test(lowerUserAgent);
|
|
3650
3608
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/item/useMenuItemCommonProps.mjs
|
|
3651
|
-
"use client";
|
|
3652
3609
|
function preventMouseDownDefault(event) {
|
|
3653
3610
|
event.preventDefault();
|
|
3654
3611
|
}
|
|
@@ -3727,7 +3684,6 @@ function useMenuItemCommonProps(params) {
|
|
|
3727
3684
|
}
|
|
3728
3685
|
|
|
3729
3686
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/item/useMenuItem.mjs
|
|
3730
|
-
"use client";
|
|
3731
3687
|
var REGULAR_ITEM = {
|
|
3732
3688
|
type: "regular-item"
|
|
3733
3689
|
};
|
|
@@ -3785,7 +3741,6 @@ import * as React18 from "react";
|
|
|
3785
3741
|
|
|
3786
3742
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
|
|
3787
3743
|
import * as React17 from "react";
|
|
3788
|
-
"use client";
|
|
3789
3744
|
var CompositeListContext = /* @__PURE__ */ React17.createContext({
|
|
3790
3745
|
register: () => {},
|
|
3791
3746
|
unregister: () => {},
|
|
@@ -3801,7 +3756,6 @@ function useCompositeListContext() {
|
|
|
3801
3756
|
}
|
|
3802
3757
|
|
|
3803
3758
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
|
|
3804
|
-
"use client";
|
|
3805
3759
|
function useCompositeListItem(params = {}) {
|
|
3806
3760
|
const {
|
|
3807
3761
|
guess,
|
|
@@ -3864,7 +3818,6 @@ import * as React20 from "react";
|
|
|
3864
3818
|
|
|
3865
3819
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useForcedRerendering.mjs
|
|
3866
3820
|
import * as React19 from "react";
|
|
3867
|
-
"use client";
|
|
3868
3821
|
function useForcedRerendering() {
|
|
3869
3822
|
const [, setState] = React19.useState({});
|
|
3870
3823
|
return React19.useCallback(() => {
|
|
@@ -3873,7 +3826,6 @@ function useForcedRerendering() {
|
|
|
3873
3826
|
}
|
|
3874
3827
|
|
|
3875
3828
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useId.mjs
|
|
3876
|
-
"use client";
|
|
3877
3829
|
var globalId = 0;
|
|
3878
3830
|
function useGlobalId(idOverride, prefix = "mui") {
|
|
3879
3831
|
const defaultId = React20.useRef(undefined);
|
|
@@ -3900,7 +3852,6 @@ function useId(idOverride, prefix) {
|
|
|
3900
3852
|
}
|
|
3901
3853
|
|
|
3902
3854
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/useBaseUiId.mjs
|
|
3903
|
-
"use client";
|
|
3904
3855
|
function useBaseUiId(idOverride) {
|
|
3905
3856
|
return useId(idOverride, "base-ui");
|
|
3906
3857
|
}
|
|
@@ -3945,13 +3896,11 @@ import * as React22 from "react";
|
|
|
3945
3896
|
|
|
3946
3897
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useOnMount.mjs
|
|
3947
3898
|
import * as React21 from "react";
|
|
3948
|
-
"use client";
|
|
3949
3899
|
function useOnMount(fn) {
|
|
3950
3900
|
React21.useEffect(fn, EMPTY_ARRAY);
|
|
3951
3901
|
}
|
|
3952
3902
|
|
|
3953
3903
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useAnimationFrame.mjs
|
|
3954
|
-
"use client";
|
|
3955
3904
|
var EMPTY = null;
|
|
3956
3905
|
var LAST_RAF = globalThis.requestAnimationFrame;
|
|
3957
3906
|
|
|
@@ -4034,7 +3983,6 @@ function useAnimationFrame() {
|
|
|
4034
3983
|
}
|
|
4035
3984
|
|
|
4036
3985
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/useTransitionStatus.mjs
|
|
4037
|
-
"use client";
|
|
4038
3986
|
function useTransitionStatus(open, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
|
|
4039
3987
|
const [transitionStatus, setTransitionStatus] = React22.useState(open && enableIdleState ? "idle" : undefined);
|
|
4040
3988
|
const [mounted, setMounted] = React22.useState(open && !animateInitialOpen);
|
|
@@ -4114,7 +4062,6 @@ function getFiniteAnimations(element, options) {
|
|
|
4114
4062
|
}
|
|
4115
4063
|
|
|
4116
4064
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
|
|
4117
|
-
"use client";
|
|
4118
4065
|
var pendingCallbacks = null;
|
|
4119
4066
|
function flushBeforePaint(fn) {
|
|
4120
4067
|
if (!pendingCallbacks) {
|
|
@@ -4198,7 +4145,6 @@ function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false
|
|
|
4198
4145
|
}
|
|
4199
4146
|
|
|
4200
4147
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
|
|
4201
|
-
"use client";
|
|
4202
4148
|
function useOpenChangeComplete(parameters) {
|
|
4203
4149
|
const {
|
|
4204
4150
|
enabled = true,
|
|
@@ -4224,7 +4170,6 @@ function useOpenChangeComplete(parameters) {
|
|
|
4224
4170
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/item/MenuItem.mjs
|
|
4225
4171
|
import * as React24 from "react";
|
|
4226
4172
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4227
|
-
"use client";
|
|
4228
4173
|
var MenuItemPlain = /* @__PURE__ */ React24.forwardRef(function MenuItemPlain(componentProps, forwardedRef) {
|
|
4229
4174
|
const {
|
|
4230
4175
|
render,
|
|
@@ -4313,7 +4258,6 @@ function mergeCleanups(...cleanups) {
|
|
|
4313
4258
|
}
|
|
4314
4259
|
|
|
4315
4260
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useValueAsRef.mjs
|
|
4316
|
-
"use client";
|
|
4317
4261
|
function useValueAsRef(value) {
|
|
4318
4262
|
const latest = useRefWithInit(createLatestRef, value).current;
|
|
4319
4263
|
latest.next = value;
|
|
@@ -4332,7 +4276,6 @@ function createLatestRef(value) {
|
|
|
4332
4276
|
}
|
|
4333
4277
|
|
|
4334
4278
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useTimeout.mjs
|
|
4335
|
-
"use client";
|
|
4336
4279
|
var EMPTY2 = 0;
|
|
4337
4280
|
|
|
4338
4281
|
class Timeout {
|
|
@@ -4394,7 +4337,6 @@ var visuallyHiddenInput = {
|
|
|
4394
4337
|
|
|
4395
4338
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/FocusGuard.mjs
|
|
4396
4339
|
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
4397
|
-
"use client";
|
|
4398
4340
|
var FocusGuard = /* @__PURE__ */ React25.forwardRef(function FocusGuard(props, ref) {
|
|
4399
4341
|
const [role, setRole] = React25.useState();
|
|
4400
4342
|
useIsoLayoutEffect(() => {
|
|
@@ -5192,7 +5134,6 @@ var ownerVisuallyHidden = {
|
|
|
5192
5134
|
|
|
5193
5135
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
|
|
5194
5136
|
import { jsx as _jsx3, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5195
|
-
"use client";
|
|
5196
5137
|
var PortalContext = /* @__PURE__ */ React26.createContext(null);
|
|
5197
5138
|
if (true)
|
|
5198
5139
|
PortalContext.displayName = "PortalContext";
|
|
@@ -5399,7 +5340,6 @@ class FloatingTreeStore {
|
|
|
5399
5340
|
|
|
5400
5341
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
|
|
5401
5342
|
import { jsx as _jsx4 } from "react/jsx-runtime";
|
|
5402
|
-
"use client";
|
|
5403
5343
|
var FloatingNodeContext = /* @__PURE__ */ React27.createContext(null);
|
|
5404
5344
|
if (true)
|
|
5405
5345
|
FloatingNodeContext.displayName = "FloatingNodeContext";
|
|
@@ -5458,7 +5398,6 @@ function FloatingTree(props) {
|
|
|
5458
5398
|
|
|
5459
5399
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/components/FloatingFocusManager.mjs
|
|
5460
5400
|
import { jsx as _jsx5, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
5461
|
-
"use client";
|
|
5462
5401
|
function getEventType(event, lastInteractionType) {
|
|
5463
5402
|
const win = getWindow(getTarget(event));
|
|
5464
5403
|
if (event instanceof win.KeyboardEvent) {
|
|
@@ -5944,7 +5883,6 @@ function FloatingFocusManager(props) {
|
|
|
5944
5883
|
}
|
|
5945
5884
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs
|
|
5946
5885
|
import * as React29 from "react";
|
|
5947
|
-
"use client";
|
|
5948
5886
|
function useClick(store, props = {}) {
|
|
5949
5887
|
const {
|
|
5950
5888
|
enabled = true,
|
|
@@ -6037,7 +5975,6 @@ function useClick(store, props = {}) {
|
|
|
6037
5975
|
}
|
|
6038
5976
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs
|
|
6039
5977
|
import * as React30 from "react";
|
|
6040
|
-
"use client";
|
|
6041
5978
|
function alwaysFalse() {
|
|
6042
5979
|
return false;
|
|
6043
5980
|
}
|
|
@@ -6456,7 +6393,6 @@ function useDismiss(store, props = {}) {
|
|
|
6456
6393
|
} : {}, [enabled, reference, floating]);
|
|
6457
6394
|
}
|
|
6458
6395
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs
|
|
6459
|
-
"use client";
|
|
6460
6396
|
function useSyncedFloatingRootContext(options) {
|
|
6461
6397
|
const {
|
|
6462
6398
|
popupStore,
|
|
@@ -6492,7 +6428,6 @@ function useSyncedFloatingRootContext(options) {
|
|
|
6492
6428
|
}
|
|
6493
6429
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs
|
|
6494
6430
|
import * as React31 from "react";
|
|
6495
|
-
"use client";
|
|
6496
6431
|
var isMacSafari = exports_os.mac && exports_engine.webkit;
|
|
6497
6432
|
function useFocus(store, props = {}) {
|
|
6498
6433
|
const {
|
|
@@ -6621,7 +6556,6 @@ function useFocus(store, props = {}) {
|
|
|
6621
6556
|
import * as React32 from "react";
|
|
6622
6557
|
|
|
6623
6558
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs
|
|
6624
|
-
"use client";
|
|
6625
6559
|
class HoverInteraction {
|
|
6626
6560
|
pointerType = undefined;
|
|
6627
6561
|
interactedInside = false;
|
|
@@ -6724,7 +6658,6 @@ function isHoverOpenEvent(openEventType) {
|
|
|
6724
6658
|
}
|
|
6725
6659
|
|
|
6726
6660
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
|
|
6727
|
-
"use client";
|
|
6728
6661
|
function useHoverFloatingInteraction(store, parameters = {}) {
|
|
6729
6662
|
const {
|
|
6730
6663
|
enabled = true,
|
|
@@ -6863,7 +6796,6 @@ function useHoverFloatingInteraction(store, parameters = {}) {
|
|
|
6863
6796
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs
|
|
6864
6797
|
import * as React33 from "react";
|
|
6865
6798
|
import * as ReactDOM3 from "react-dom";
|
|
6866
|
-
"use client";
|
|
6867
6799
|
var EMPTY_REF = {
|
|
6868
6800
|
current: null
|
|
6869
6801
|
};
|
|
@@ -7145,7 +7077,6 @@ function useHoverReferenceInteraction(store, props = {}) {
|
|
|
7145
7077
|
}
|
|
7146
7078
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs
|
|
7147
7079
|
import * as React34 from "react";
|
|
7148
|
-
"use client";
|
|
7149
7080
|
function isStationaryWebKitPointer(event) {
|
|
7150
7081
|
return exports_engine.webkit && event.movementX === 0 && event.movementY === 0;
|
|
7151
7082
|
}
|
|
@@ -7643,7 +7574,6 @@ function useListNavigation(store, props) {
|
|
|
7643
7574
|
}
|
|
7644
7575
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs
|
|
7645
7576
|
import * as React35 from "react";
|
|
7646
|
-
"use client";
|
|
7647
7577
|
function useTypeahead(store, props) {
|
|
7648
7578
|
const {
|
|
7649
7579
|
listRef,
|
|
@@ -9420,7 +9350,6 @@ var size3 = (options, deps) => {
|
|
|
9420
9350
|
};
|
|
9421
9351
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/toolbar/root/ToolbarRootContext.mjs
|
|
9422
9352
|
import * as React37 from "react";
|
|
9423
|
-
"use client";
|
|
9424
9353
|
var ToolbarRootContext = /* @__PURE__ */ React37.createContext(undefined);
|
|
9425
9354
|
if (true)
|
|
9426
9355
|
ToolbarRootContext.displayName = "ToolbarRootContext";
|
|
@@ -9448,7 +9377,6 @@ function getDisabledMountTransitionStyles(transitionStatus) {
|
|
|
9448
9377
|
|
|
9449
9378
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/submenu-root/MenuSubmenuRootContext.mjs
|
|
9450
9379
|
import * as React38 from "react";
|
|
9451
|
-
"use client";
|
|
9452
9380
|
var MenuSubmenuRootContext = /* @__PURE__ */ React38.createContext(undefined);
|
|
9453
9381
|
if (true)
|
|
9454
9382
|
MenuSubmenuRootContext.displayName = "MenuSubmenuRootContext";
|
|
@@ -9490,7 +9418,6 @@ function resolvePopupLabel(props, activeTriggerElement, activeTriggerId) {
|
|
|
9490
9418
|
|
|
9491
9419
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/popup/MenuPopup.mjs
|
|
9492
9420
|
import { jsx as _jsx6 } from "react/jsx-runtime";
|
|
9493
|
-
"use client";
|
|
9494
9421
|
var MenuPopupPlain = /* @__PURE__ */ React41.forwardRef(function MenuPopupPlain(componentProps, forwardedRef) {
|
|
9495
9422
|
const {
|
|
9496
9423
|
render,
|
|
@@ -9649,7 +9576,6 @@ import * as React43 from "react";
|
|
|
9649
9576
|
|
|
9650
9577
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/portal/MenuPortalContext.mjs
|
|
9651
9578
|
import * as React42 from "react";
|
|
9652
|
-
"use client";
|
|
9653
9579
|
var MenuPortalContext = /* @__PURE__ */ React42.createContext(undefined);
|
|
9654
9580
|
if (true)
|
|
9655
9581
|
MenuPortalContext.displayName = "MenuPortalContext";
|
|
@@ -9663,7 +9589,6 @@ function useMenuPortalContext() {
|
|
|
9663
9589
|
|
|
9664
9590
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/portal/MenuPortal.mjs
|
|
9665
9591
|
import { jsx as _jsx7 } from "react/jsx-runtime";
|
|
9666
|
-
"use client";
|
|
9667
9592
|
var MenuPortal = /* @__PURE__ */ React43.forwardRef(function MenuPortal(props, forwardedRef) {
|
|
9668
9593
|
const {
|
|
9669
9594
|
keepMounted = false,
|
|
@@ -9706,7 +9631,6 @@ import * as React46 from "react";
|
|
|
9706
9631
|
|
|
9707
9632
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs
|
|
9708
9633
|
import * as React44 from "react";
|
|
9709
|
-
"use client";
|
|
9710
9634
|
function useBaseUIFloating(options) {
|
|
9711
9635
|
const {
|
|
9712
9636
|
nodeId,
|
|
@@ -9788,7 +9712,6 @@ function useBaseUIFloating(options) {
|
|
|
9788
9712
|
|
|
9789
9713
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
|
|
9790
9714
|
import * as React45 from "react";
|
|
9791
|
-
"use client";
|
|
9792
9715
|
var DirectionContext = /* @__PURE__ */ React45.createContext(undefined);
|
|
9793
9716
|
if (true)
|
|
9794
9717
|
DirectionContext.displayName = "DirectionContext";
|
|
@@ -9905,7 +9828,6 @@ var anchorHeight = "--anchor-height";
|
|
|
9905
9828
|
var transformOrigin = "--transform-origin";
|
|
9906
9829
|
|
|
9907
9830
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
|
|
9908
|
-
"use client";
|
|
9909
9831
|
var AVAILABLE_WIDTH_VAR = availableWidth;
|
|
9910
9832
|
var AVAILABLE_HEIGHT_VAR = availableHeight;
|
|
9911
9833
|
function getLogicalSide(sideParam, renderedSide, isRtl) {
|
|
@@ -10281,7 +10203,6 @@ function isRef(param) {
|
|
|
10281
10203
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
|
|
10282
10204
|
import * as React47 from "react";
|
|
10283
10205
|
import { jsx as _jsx8 } from "react/jsx-runtime";
|
|
10284
|
-
"use client";
|
|
10285
10206
|
function CompositeList(props) {
|
|
10286
10207
|
const {
|
|
10287
10208
|
children,
|
|
@@ -10523,7 +10444,6 @@ if (true)
|
|
|
10523
10444
|
|
|
10524
10445
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/useTriggerSwitchTransition.mjs
|
|
10525
10446
|
import * as React49 from "react";
|
|
10526
|
-
"use client";
|
|
10527
10447
|
function useTriggerSwitchTransition(parameters) {
|
|
10528
10448
|
const {
|
|
10529
10449
|
store,
|
|
@@ -10571,7 +10491,6 @@ function useTriggerSwitchTransition(parameters) {
|
|
|
10571
10491
|
}
|
|
10572
10492
|
|
|
10573
10493
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/usePositioner.mjs
|
|
10574
|
-
"use client";
|
|
10575
10494
|
function usePositioner(componentProps, state, {
|
|
10576
10495
|
styles,
|
|
10577
10496
|
transitionStatus,
|
|
@@ -10602,7 +10521,6 @@ function usePositioner(componentProps, state, {
|
|
|
10602
10521
|
import * as React50 from "react";
|
|
10603
10522
|
|
|
10604
10523
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useScrollLock.mjs
|
|
10605
|
-
"use client";
|
|
10606
10524
|
var originalHtmlStyles = {};
|
|
10607
10525
|
var originalBodyStyles = {};
|
|
10608
10526
|
var originalHtmlScrollBehavior = "";
|
|
@@ -10822,7 +10740,6 @@ function useScrollLock(enabled = true, referenceElement = null) {
|
|
|
10822
10740
|
}
|
|
10823
10741
|
|
|
10824
10742
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/useAnchoredPopupScrollLock.mjs
|
|
10825
|
-
"use client";
|
|
10826
10743
|
var VIEWPORT_WIDTH_TOLERANCE_PX = 20;
|
|
10827
10744
|
function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {
|
|
10828
10745
|
const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React50.useState(false);
|
|
@@ -10840,7 +10757,6 @@ function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, refer
|
|
|
10840
10757
|
|
|
10841
10758
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/positioner/MenuPositioner.mjs
|
|
10842
10759
|
import { jsx as _jsx10, jsxs as _jsxs3 } from "react/jsx-runtime";
|
|
10843
|
-
"use client";
|
|
10844
10760
|
var MenuPositioner = /* @__PURE__ */ React51.forwardRef(function MenuPositioner(componentProps, forwardedRef) {
|
|
10845
10761
|
const {
|
|
10846
10762
|
anchor: anchorProp,
|
|
@@ -11101,7 +11017,6 @@ function createInstance() {
|
|
|
11101
11017
|
|
|
11102
11018
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menubar/MenubarContext.mjs
|
|
11103
11019
|
import * as React53 from "react";
|
|
11104
|
-
"use client";
|
|
11105
11020
|
var MenubarContext = /* @__PURE__ */ React53.createContext(null);
|
|
11106
11021
|
if (true)
|
|
11107
11022
|
MenubarContext.displayName = "MenubarContext";
|
|
@@ -11118,7 +11033,6 @@ import * as React56 from "react";
|
|
|
11118
11033
|
|
|
11119
11034
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
|
|
11120
11035
|
import * as React54 from "react";
|
|
11121
|
-
"use client";
|
|
11122
11036
|
function useEnhancedClickHandler(handler) {
|
|
11123
11037
|
const lastClickInteractionTypeRef = React54.useRef("");
|
|
11124
11038
|
const handlePointerDown = React54.useCallback((event) => {
|
|
@@ -11148,7 +11062,6 @@ function useEnhancedClickHandler(handler) {
|
|
|
11148
11062
|
|
|
11149
11063
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/useValueChanged.mjs
|
|
11150
11064
|
import * as React55 from "react";
|
|
11151
|
-
"use client";
|
|
11152
11065
|
function useValueChanged(value, onChange) {
|
|
11153
11066
|
const valueRef = React55.useRef(value);
|
|
11154
11067
|
const onChangeCallback = useStableCallback(onChange);
|
|
@@ -11161,7 +11074,6 @@ function useValueChanged(value, onChange) {
|
|
|
11161
11074
|
}
|
|
11162
11075
|
|
|
11163
11076
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
|
|
11164
|
-
"use client";
|
|
11165
11077
|
function useOpenMethodTriggerProps(open, setOpenMethod) {
|
|
11166
11078
|
const handleTriggerClick = useStableCallback((_, interactionType) => {
|
|
11167
11079
|
const isOpen = typeof open === "function" ? open() : open;
|
|
@@ -11373,7 +11285,6 @@ class Store {
|
|
|
11373
11285
|
|
|
11374
11286
|
// ../../node_modules/.bun/@base-ui+utils@0.5.0+a2357f7178ffa785/node_modules/@base-ui/utils/store/ReactStore.mjs
|
|
11375
11287
|
import * as React60 from "react";
|
|
11376
|
-
"use client";
|
|
11377
11288
|
|
|
11378
11289
|
class ReactStore extends Store {
|
|
11379
11290
|
constructor(state, context = {}, selectors) {
|
|
@@ -11487,7 +11398,6 @@ import * as ReactDOM5 from "react-dom";
|
|
|
11487
11398
|
|
|
11488
11399
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs
|
|
11489
11400
|
import * as React61 from "react";
|
|
11490
|
-
"use client";
|
|
11491
11401
|
function useUnmountAfterClose(parameters) {
|
|
11492
11402
|
const {
|
|
11493
11403
|
open,
|
|
@@ -11556,7 +11466,6 @@ function useUnmountAfterClose(parameters) {
|
|
|
11556
11466
|
}
|
|
11557
11467
|
|
|
11558
11468
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
|
|
11559
|
-
"use client";
|
|
11560
11469
|
var FOCUSABLE_POPUP_PROPS = {
|
|
11561
11470
|
tabIndex: -1,
|
|
11562
11471
|
[FOCUSABLE_ATTRIBUTE]: ""
|
|
@@ -12037,7 +11946,6 @@ var popupStoreSelectors = {
|
|
|
12037
11946
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
|
|
12038
11947
|
var import_shim2 = __toESM(require_shim(), 1);
|
|
12039
11948
|
import * as React63 from "react";
|
|
12040
|
-
"use client";
|
|
12041
11949
|
function usePopupHandleStore(handle) {
|
|
12042
11950
|
const subscribe = React63.useCallback((listener) => {
|
|
12043
11951
|
if (handle === undefined) {
|
|
@@ -12221,7 +12129,6 @@ function createInitialState(triggerElements, floatingId, nested = false, initial
|
|
|
12221
12129
|
|
|
12222
12130
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/filter-provider/MenuFilterProviderContext.mjs
|
|
12223
12131
|
import * as React65 from "react";
|
|
12224
|
-
"use client";
|
|
12225
12132
|
var MenuFilterProviderContext = /* @__PURE__ */ React65.createContext(null);
|
|
12226
12133
|
if (true)
|
|
12227
12134
|
MenuFilterProviderContext.displayName = "MenuFilterProviderContext";
|
|
@@ -12236,7 +12143,6 @@ function isKeyboardOpen(reason, event) {
|
|
|
12236
12143
|
|
|
12237
12144
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/root/MenuRoot.mjs
|
|
12238
12145
|
import { jsx as _jsx11, jsxs as _jsxs4 } from "react/jsx-runtime";
|
|
12239
|
-
"use client";
|
|
12240
12146
|
var MenuRootInternal = fastComponent(function MenuRootInternal(props) {
|
|
12241
12147
|
const {
|
|
12242
12148
|
children,
|
|
@@ -12739,7 +12645,6 @@ function getPseudoElementBounds(element) {
|
|
|
12739
12645
|
|
|
12740
12646
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
|
|
12741
12647
|
import * as React67 from "react";
|
|
12742
|
-
"use client";
|
|
12743
12648
|
function useCompositeItem(params = {}) {
|
|
12744
12649
|
const {
|
|
12745
12650
|
highlightItemOnHover,
|
|
@@ -12777,7 +12682,6 @@ function useCompositeItem(params = {}) {
|
|
|
12777
12682
|
}
|
|
12778
12683
|
|
|
12779
12684
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/composite/item/CompositeItem.mjs
|
|
12780
|
-
"use client";
|
|
12781
12685
|
function CompositeItem(componentProps) {
|
|
12782
12686
|
const {
|
|
12783
12687
|
render,
|
|
@@ -12818,7 +12722,6 @@ function findRootOwnerId(node) {
|
|
|
12818
12722
|
|
|
12819
12723
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/popups/useTriggerFocusGuards.mjs
|
|
12820
12724
|
import * as ReactDOM6 from "react-dom";
|
|
12821
|
-
"use client";
|
|
12822
12725
|
function useTriggerFocusGuards(store, triggerElementRef) {
|
|
12823
12726
|
function closeAndFocus(event, direction, positionerElement) {
|
|
12824
12727
|
const guard = event.currentTarget;
|
|
@@ -12846,7 +12749,6 @@ function useTriggerFocusGuards(store, triggerElementRef) {
|
|
|
12846
12749
|
|
|
12847
12750
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/utils/useMixedToggleClickHandler.mjs
|
|
12848
12751
|
import * as React68 from "react";
|
|
12849
|
-
"use client";
|
|
12850
12752
|
function useMixedToggleClickHandler(params) {
|
|
12851
12753
|
const {
|
|
12852
12754
|
enabled = true,
|
|
@@ -12881,7 +12783,6 @@ function useMixedToggleClickHandler(params) {
|
|
|
12881
12783
|
|
|
12882
12784
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/menu/trigger/MenuTrigger.mjs
|
|
12883
12785
|
import { jsx as _jsx12, jsxs as _jsxs5 } from "react/jsx-runtime";
|
|
12884
|
-
"use client";
|
|
12885
12786
|
var MenuTrigger = fastComponentRef(function MenuTrigger(componentProps, forwardedRef) {
|
|
12886
12787
|
const {
|
|
12887
12788
|
render,
|
|
@@ -13115,7 +13016,6 @@ function useMenuParent() {
|
|
|
13115
13016
|
}
|
|
13116
13017
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/separator/Separator.mjs
|
|
13117
13018
|
import * as React70 from "react";
|
|
13118
|
-
"use client";
|
|
13119
13019
|
var Separator = /* @__PURE__ */ React70.forwardRef(function SeparatorComponent(componentProps, forwardedRef) {
|
|
13120
13020
|
const {
|
|
13121
13021
|
className,
|
|
@@ -13141,7 +13041,6 @@ if (true)
|
|
|
13141
13041
|
Separator.displayName = "Separator";
|
|
13142
13042
|
// ../ui/src/components/dropdown-menu.tsx
|
|
13143
13043
|
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
13144
|
-
"use client";
|
|
13145
13044
|
function DropdownMenu({ ...props }) {
|
|
13146
13045
|
return /* @__PURE__ */ jsxDEV3(MenuRoot, {
|
|
13147
13046
|
"data-slot": "dropdown-menu",
|
|
@@ -13160,9 +13059,11 @@ function DropdownMenuContent({
|
|
|
13160
13059
|
side = "bottom",
|
|
13161
13060
|
sideOffset = 4,
|
|
13162
13061
|
className,
|
|
13062
|
+
portalContainer,
|
|
13163
13063
|
...props
|
|
13164
13064
|
}) {
|
|
13165
13065
|
return /* @__PURE__ */ jsxDEV3(MenuPortal, {
|
|
13066
|
+
container: portalContainer,
|
|
13166
13067
|
children: /* @__PURE__ */ jsxDEV3(MenuPositioner, {
|
|
13167
13068
|
className: "isolate z-50 outline-none",
|
|
13168
13069
|
align,
|
|
@@ -13253,7 +13154,6 @@ var fieldValidityMapping = {
|
|
|
13253
13154
|
};
|
|
13254
13155
|
|
|
13255
13156
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
|
|
13256
|
-
"use client";
|
|
13257
13157
|
var DEFAULT_FIELD_ROOT_CONTEXT = {
|
|
13258
13158
|
invalid: undefined,
|
|
13259
13159
|
name: undefined,
|
|
@@ -13302,7 +13202,6 @@ function useFieldRootContext(optional = true) {
|
|
|
13302
13202
|
|
|
13303
13203
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/form-context/FormContext.mjs
|
|
13304
13204
|
import * as React72 from "react";
|
|
13305
|
-
"use client";
|
|
13306
13205
|
var FormContext = /* @__PURE__ */ React72.createContext({
|
|
13307
13206
|
elementRef: {
|
|
13308
13207
|
current: null
|
|
@@ -13327,7 +13226,6 @@ function useFormContext() {
|
|
|
13327
13226
|
|
|
13328
13227
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
|
|
13329
13228
|
import * as React73 from "react";
|
|
13330
|
-
"use client";
|
|
13331
13229
|
var LabelableContext = /* @__PURE__ */ React73.createContext({
|
|
13332
13230
|
controlId: undefined,
|
|
13333
13231
|
registerControlId: NOOP,
|
|
@@ -13348,7 +13246,6 @@ function useLabelableContext() {
|
|
|
13348
13246
|
import * as React75 from "react";
|
|
13349
13247
|
|
|
13350
13248
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/field-root-context/useSetFieldFocused.mjs
|
|
13351
|
-
"use client";
|
|
13352
13249
|
function useSetFieldFocused(disabled, focusTargetRef, onFocusedChange) {
|
|
13353
13250
|
const {
|
|
13354
13251
|
setFocused,
|
|
@@ -13373,7 +13270,6 @@ function useSetFieldFocused(disabled, focusTargetRef, onFocusedChange) {
|
|
|
13373
13270
|
}
|
|
13374
13271
|
|
|
13375
13272
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
|
|
13376
|
-
"use client";
|
|
13377
13273
|
function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {
|
|
13378
13274
|
const {
|
|
13379
13275
|
registerFieldControl
|
|
@@ -13404,7 +13300,6 @@ function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, en
|
|
|
13404
13300
|
|
|
13405
13301
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
|
|
13406
13302
|
import * as React74 from "react";
|
|
13407
|
-
"use client";
|
|
13408
13303
|
function useLabelableId(params = {}) {
|
|
13409
13304
|
const {
|
|
13410
13305
|
id,
|
|
@@ -13456,7 +13351,6 @@ function useLabelableId(params = {}) {
|
|
|
13456
13351
|
}
|
|
13457
13352
|
|
|
13458
13353
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/field/control/FieldControl.mjs
|
|
13459
|
-
"use client";
|
|
13460
13354
|
var FieldControl = /* @__PURE__ */ React75.forwardRef(function FieldControl(componentProps, forwardedRef) {
|
|
13461
13355
|
const {
|
|
13462
13356
|
render,
|
|
@@ -13595,7 +13489,6 @@ if (true)
|
|
|
13595
13489
|
FieldControl.displayName = "FieldControl";
|
|
13596
13490
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/input/Input.mjs
|
|
13597
13491
|
import { jsx as _jsx13 } from "react/jsx-runtime";
|
|
13598
|
-
"use client";
|
|
13599
13492
|
var Input = /* @__PURE__ */ React76.forwardRef(function Input(props, forwardedRef) {
|
|
13600
13493
|
return /* @__PURE__ */ _jsx13(FieldControl, {
|
|
13601
13494
|
ref: forwardedRef,
|
|
@@ -13627,7 +13520,6 @@ function Textarea({ className, ...props }) {
|
|
|
13627
13520
|
|
|
13628
13521
|
// ../ui/src/components/input-group.tsx
|
|
13629
13522
|
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
13630
|
-
"use client";
|
|
13631
13523
|
function InputGroup({ className, ...props }) {
|
|
13632
13524
|
return /* @__PURE__ */ jsxDEV6("div", {
|
|
13633
13525
|
"data-slot": "input-group",
|
|
@@ -13709,35 +13601,37 @@ function InputGroupTextarea({
|
|
|
13709
13601
|
|
|
13710
13602
|
// src/widget-composer.tsx
|
|
13711
13603
|
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
13712
|
-
"use client";
|
|
13713
13604
|
function WidgetComposer({
|
|
13714
13605
|
send,
|
|
13715
13606
|
upload,
|
|
13716
13607
|
sendDisabled = false,
|
|
13717
13608
|
showPoweredBy = false,
|
|
13718
|
-
privacyPolicyUrl,
|
|
13719
13609
|
assetBaseUrl
|
|
13720
13610
|
}) {
|
|
13721
13611
|
const [body, setBody] = useState14("");
|
|
13722
13612
|
const [pending, setPending] = useState14(false);
|
|
13723
|
-
const [
|
|
13613
|
+
const [error, setError] = useState14("");
|
|
13724
13614
|
const [attachments, setAttachments] = useState14([]);
|
|
13725
13615
|
const [uploading, setUploading] = useState14(false);
|
|
13726
13616
|
const fileInput = useRef30(null);
|
|
13617
|
+
const [portalContainer, setPortalContainer] = useState14(null);
|
|
13618
|
+
useEffect16(() => {
|
|
13619
|
+
setPortalContainer(fileInput.current?.closest("[data-coristen-widget]") ?? null);
|
|
13620
|
+
}, []);
|
|
13727
13621
|
async function addFiles(event) {
|
|
13728
13622
|
const files = Array.from(event.target.files ?? []).slice(0, Math.max(0, 5 - attachments.length));
|
|
13729
13623
|
event.target.value = "";
|
|
13730
13624
|
if (!files.length)
|
|
13731
13625
|
return;
|
|
13732
13626
|
setUploading(true);
|
|
13733
|
-
|
|
13627
|
+
setError("");
|
|
13734
13628
|
try {
|
|
13735
13629
|
const uploaded = [];
|
|
13736
13630
|
for (const file of files)
|
|
13737
13631
|
uploaded.push(await upload(file));
|
|
13738
13632
|
setAttachments((current) => [...current, ...uploaded].slice(0, 5));
|
|
13739
|
-
} catch {
|
|
13740
|
-
|
|
13633
|
+
} catch (cause) {
|
|
13634
|
+
setError(cause instanceof Error ? cause.message : "File upload failed. Try again.");
|
|
13741
13635
|
} finally {
|
|
13742
13636
|
setUploading(false);
|
|
13743
13637
|
}
|
|
@@ -13748,13 +13642,13 @@ function WidgetComposer({
|
|
|
13748
13642
|
if (!message && !attachments.length || pending || uploading || sendDisabled)
|
|
13749
13643
|
return;
|
|
13750
13644
|
setPending(true);
|
|
13751
|
-
|
|
13645
|
+
setError("");
|
|
13752
13646
|
try {
|
|
13753
13647
|
await send(message, attachments);
|
|
13754
13648
|
setBody("");
|
|
13755
13649
|
setAttachments([]);
|
|
13756
13650
|
} catch {
|
|
13757
|
-
|
|
13651
|
+
setError("Message could not be sent. Try again.");
|
|
13758
13652
|
} finally {
|
|
13759
13653
|
setPending(false);
|
|
13760
13654
|
}
|
|
@@ -13799,7 +13693,7 @@ function WidgetComposer({
|
|
|
13799
13693
|
type: "button",
|
|
13800
13694
|
"aria-label": `Remove ${attachment.name}`,
|
|
13801
13695
|
onClick: () => setAttachments((current) => current.filter((item) => item.storageId !== attachment.storageId)),
|
|
13802
|
-
children: /* @__PURE__ */ jsxDEV7(
|
|
13696
|
+
children: /* @__PURE__ */ jsxDEV7(e22, {}, undefined, false, undefined, this)
|
|
13803
13697
|
}, undefined, false, undefined, this)
|
|
13804
13698
|
}, undefined, false, undefined, this)
|
|
13805
13699
|
]
|
|
@@ -13855,11 +13749,12 @@ function WidgetComposer({
|
|
|
13855
13749
|
size: "icon-sm",
|
|
13856
13750
|
"aria-label": "More message options"
|
|
13857
13751
|
}, undefined, false, undefined, this),
|
|
13858
|
-
children: /* @__PURE__ */ jsxDEV7(
|
|
13752
|
+
children: /* @__PURE__ */ jsxDEV7(e20, {
|
|
13859
13753
|
className: "size-5"
|
|
13860
13754
|
}, undefined, false, undefined, this)
|
|
13861
13755
|
}, undefined, false, undefined, this),
|
|
13862
13756
|
/* @__PURE__ */ jsxDEV7(DropdownMenuContent, {
|
|
13757
|
+
portalContainer,
|
|
13863
13758
|
align: "start",
|
|
13864
13759
|
side: "top",
|
|
13865
13760
|
className: "w-44 [&_[data-slot=dropdown-menu-item]>svg]:size-5",
|
|
@@ -13886,7 +13781,7 @@ function WidgetComposer({
|
|
|
13886
13781
|
}, undefined, true, undefined, this),
|
|
13887
13782
|
/* @__PURE__ */ jsxDEV7(DropdownMenuItem, {
|
|
13888
13783
|
children: [
|
|
13889
|
-
/* @__PURE__ */ jsxDEV7(
|
|
13784
|
+
/* @__PURE__ */ jsxDEV7(e14, {}, undefined, false, undefined, this),
|
|
13890
13785
|
"Web Search"
|
|
13891
13786
|
]
|
|
13892
13787
|
}, undefined, true, undefined, this)
|
|
@@ -13894,61 +13789,45 @@ function WidgetComposer({
|
|
|
13894
13789
|
}, undefined, true, undefined, this)
|
|
13895
13790
|
]
|
|
13896
13791
|
}, undefined, true, undefined, this),
|
|
13897
|
-
|
|
13792
|
+
showPoweredBy && /* @__PURE__ */ jsxDEV7("div", {
|
|
13898
13793
|
className: "mx-auto flex flex-col items-center text-[10px] leading-tight text-muted-foreground",
|
|
13899
|
-
children:
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
className: "inline-flex items-center gap-1",
|
|
13907
|
-
children: [
|
|
13908
|
-
"Powered by",
|
|
13909
|
-
/* @__PURE__ */ jsxDEV7("span", {
|
|
13910
|
-
className: "relative size-4 shrink-0",
|
|
13911
|
-
children: [
|
|
13912
|
-
/* @__PURE__ */ jsxDEV7("img", {
|
|
13913
|
-
src: `${assetBaseUrl}/brand/coristen-mark-light.png`,
|
|
13914
|
-
alt: "",
|
|
13915
|
-
className: "absolute inset-0 size-full object-contain dark:hidden"
|
|
13916
|
-
}, undefined, false, undefined, this),
|
|
13917
|
-
/* @__PURE__ */ jsxDEV7("img", {
|
|
13918
|
-
src: `${assetBaseUrl}/brand/coristen-mark-dark.png`,
|
|
13919
|
-
alt: "",
|
|
13920
|
-
className: "absolute inset-0 hidden size-full object-contain dark:block"
|
|
13921
|
-
}, undefined, false, undefined, this)
|
|
13922
|
-
]
|
|
13923
|
-
}, undefined, true, undefined, this),
|
|
13924
|
-
/* @__PURE__ */ jsxDEV7("span", {
|
|
13925
|
-
className: "font-medium",
|
|
13926
|
-
children: "Coristen"
|
|
13927
|
-
}, undefined, false, undefined, this)
|
|
13928
|
-
]
|
|
13929
|
-
}, undefined, true, undefined, this)
|
|
13930
|
-
}, undefined, false, undefined, this),
|
|
13931
|
-
privacyPolicyUrl && /* @__PURE__ */ jsxDEV7("span", {
|
|
13794
|
+
children: showPoweredBy && /* @__PURE__ */ jsxDEV7("a", {
|
|
13795
|
+
href: "https://coristen.com",
|
|
13796
|
+
target: "_blank",
|
|
13797
|
+
rel: "noreferrer",
|
|
13798
|
+
className: "transition-colors hover:text-foreground",
|
|
13799
|
+
children: /* @__PURE__ */ jsxDEV7("span", {
|
|
13800
|
+
className: "inline-flex items-center gap-1",
|
|
13932
13801
|
children: [
|
|
13933
|
-
"
|
|
13934
|
-
|
|
13935
|
-
|
|
13936
|
-
|
|
13937
|
-
|
|
13938
|
-
|
|
13939
|
-
|
|
13940
|
-
|
|
13941
|
-
|
|
13942
|
-
|
|
13802
|
+
"Powered by",
|
|
13803
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
13804
|
+
className: "relative size-4 shrink-0",
|
|
13805
|
+
children: [
|
|
13806
|
+
/* @__PURE__ */ jsxDEV7("img", {
|
|
13807
|
+
src: `${assetBaseUrl}/brand/coristen-mark-light.png`,
|
|
13808
|
+
alt: "",
|
|
13809
|
+
className: "absolute inset-0 size-full object-contain dark:hidden"
|
|
13810
|
+
}, undefined, false, undefined, this),
|
|
13811
|
+
/* @__PURE__ */ jsxDEV7("img", {
|
|
13812
|
+
src: `${assetBaseUrl}/brand/coristen-mark-dark.png`,
|
|
13813
|
+
alt: "",
|
|
13814
|
+
className: "absolute inset-0 hidden size-full object-contain dark:block"
|
|
13815
|
+
}, undefined, false, undefined, this)
|
|
13816
|
+
]
|
|
13817
|
+
}, undefined, true, undefined, this),
|
|
13818
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
13819
|
+
className: "font-medium",
|
|
13820
|
+
children: "Coristen"
|
|
13821
|
+
}, undefined, false, undefined, this)
|
|
13943
13822
|
]
|
|
13944
13823
|
}, undefined, true, undefined, this)
|
|
13945
|
-
|
|
13946
|
-
}, undefined,
|
|
13824
|
+
}, undefined, false, undefined, this)
|
|
13825
|
+
}, undefined, false, undefined, this),
|
|
13947
13826
|
/* @__PURE__ */ jsxDEV7(InputGroupButton, {
|
|
13948
13827
|
type: "submit",
|
|
13949
13828
|
variant: "default",
|
|
13950
13829
|
size: "icon-sm",
|
|
13951
|
-
className: showPoweredBy
|
|
13830
|
+
className: showPoweredBy ? undefined : "ml-auto",
|
|
13952
13831
|
"aria-label": "Send message",
|
|
13953
13832
|
disabled: pending || uploading || sendDisabled || !body.trim() && !attachments.length,
|
|
13954
13833
|
children: /* @__PURE__ */ jsxDEV7(r3, {}, undefined, false, undefined, this)
|
|
@@ -13957,10 +13836,10 @@ function WidgetComposer({
|
|
|
13957
13836
|
}, undefined, true, undefined, this)
|
|
13958
13837
|
]
|
|
13959
13838
|
}, undefined, true, undefined, this),
|
|
13960
|
-
|
|
13839
|
+
error && /* @__PURE__ */ jsxDEV7("p", {
|
|
13961
13840
|
role: "alert",
|
|
13962
13841
|
className: "mt-2 text-xs text-destructive",
|
|
13963
|
-
children:
|
|
13842
|
+
children: error
|
|
13964
13843
|
}, undefined, false, undefined, this)
|
|
13965
13844
|
]
|
|
13966
13845
|
}, undefined, true, undefined, this);
|
|
@@ -14177,76 +14056,76 @@ function MessageFooter({ className, ...props }) {
|
|
|
14177
14056
|
import * as o15 from "react";
|
|
14178
14057
|
|
|
14179
14058
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/ArrowCounterClockwise.es.js
|
|
14180
|
-
import * as
|
|
14181
|
-
var
|
|
14059
|
+
import * as a15 from "react";
|
|
14060
|
+
var e24 = /* @__PURE__ */ new Map([
|
|
14182
14061
|
[
|
|
14183
14062
|
"bold",
|
|
14184
|
-
/* @__PURE__ */
|
|
14063
|
+
/* @__PURE__ */ a15.createElement(a15.Fragment, null, /* @__PURE__ */ a15.createElement("path", { d: "M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z" }))
|
|
14185
14064
|
],
|
|
14186
14065
|
[
|
|
14187
14066
|
"duotone",
|
|
14188
|
-
/* @__PURE__ */
|
|
14067
|
+
/* @__PURE__ */ a15.createElement(a15.Fragment, null, /* @__PURE__ */ a15.createElement("path", { d: "M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z", opacity: "0.2" }), /* @__PURE__ */ a15.createElement("path", { d: "M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z" }))
|
|
14189
14068
|
],
|
|
14190
14069
|
[
|
|
14191
14070
|
"fill",
|
|
14192
|
-
/* @__PURE__ */
|
|
14071
|
+
/* @__PURE__ */ a15.createElement(a15.Fragment, null, /* @__PURE__ */ a15.createElement("path", { d: "M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z" }))
|
|
14193
14072
|
],
|
|
14194
14073
|
[
|
|
14195
14074
|
"light",
|
|
14196
|
-
/* @__PURE__ */
|
|
14075
|
+
/* @__PURE__ */ a15.createElement(a15.Fragment, null, /* @__PURE__ */ a15.createElement("path", { d: "M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z" }))
|
|
14197
14076
|
],
|
|
14198
14077
|
[
|
|
14199
14078
|
"regular",
|
|
14200
|
-
/* @__PURE__ */
|
|
14079
|
+
/* @__PURE__ */ a15.createElement(a15.Fragment, null, /* @__PURE__ */ a15.createElement("path", { d: "M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z" }))
|
|
14201
14080
|
],
|
|
14202
14081
|
[
|
|
14203
14082
|
"thin",
|
|
14204
|
-
/* @__PURE__ */
|
|
14083
|
+
/* @__PURE__ */ a15.createElement(a15.Fragment, null, /* @__PURE__ */ a15.createElement("path", { d: "M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z" }))
|
|
14205
14084
|
]
|
|
14206
14085
|
]);
|
|
14207
14086
|
|
|
14208
14087
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/ArrowCounterClockwise.es.js
|
|
14209
|
-
var r8 = o15.forwardRef((e, t) => /* @__PURE__ */ o15.createElement(p, { ref: t, ...e, weights:
|
|
14088
|
+
var r8 = o15.forwardRef((e, t) => /* @__PURE__ */ o15.createElement(p, { ref: t, ...e, weights: e24 }));
|
|
14210
14089
|
r8.displayName = "ArrowCounterClockwiseIcon";
|
|
14211
14090
|
|
|
14212
14091
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/DownloadSimple.es.js
|
|
14213
14092
|
import * as o16 from "react";
|
|
14214
14093
|
|
|
14215
14094
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/DownloadSimple.es.js
|
|
14216
|
-
import * as
|
|
14217
|
-
var
|
|
14095
|
+
import * as a16 from "react";
|
|
14096
|
+
var e25 = /* @__PURE__ */ new Map([
|
|
14218
14097
|
[
|
|
14219
14098
|
"bold",
|
|
14220
|
-
/* @__PURE__ */
|
|
14099
|
+
/* @__PURE__ */ a16.createElement(a16.Fragment, null, /* @__PURE__ */ a16.createElement("path", { d: "M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z" }))
|
|
14221
14100
|
],
|
|
14222
14101
|
[
|
|
14223
14102
|
"duotone",
|
|
14224
|
-
/* @__PURE__ */
|
|
14103
|
+
/* @__PURE__ */ a16.createElement(a16.Fragment, null, /* @__PURE__ */ a16.createElement("path", {
|
|
14225
14104
|
d: "M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",
|
|
14226
14105
|
opacity: "0.2"
|
|
14227
|
-
}), /* @__PURE__ */
|
|
14106
|
+
}), /* @__PURE__ */ a16.createElement("path", { d: "M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z" }))
|
|
14228
14107
|
],
|
|
14229
14108
|
[
|
|
14230
14109
|
"fill",
|
|
14231
|
-
/* @__PURE__ */
|
|
14110
|
+
/* @__PURE__ */ a16.createElement(a16.Fragment, null, /* @__PURE__ */ a16.createElement("path", { d: "M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z" }))
|
|
14232
14111
|
],
|
|
14233
14112
|
[
|
|
14234
14113
|
"light",
|
|
14235
|
-
/* @__PURE__ */
|
|
14114
|
+
/* @__PURE__ */ a16.createElement(a16.Fragment, null, /* @__PURE__ */ a16.createElement("path", { d: "M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z" }))
|
|
14236
14115
|
],
|
|
14237
14116
|
[
|
|
14238
14117
|
"regular",
|
|
14239
|
-
/* @__PURE__ */
|
|
14118
|
+
/* @__PURE__ */ a16.createElement(a16.Fragment, null, /* @__PURE__ */ a16.createElement("path", { d: "M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z" }))
|
|
14240
14119
|
],
|
|
14241
14120
|
[
|
|
14242
14121
|
"thin",
|
|
14243
|
-
/* @__PURE__ */
|
|
14122
|
+
/* @__PURE__ */ a16.createElement(a16.Fragment, null, /* @__PURE__ */ a16.createElement("path", { d: "M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z" }))
|
|
14244
14123
|
]
|
|
14245
14124
|
]);
|
|
14246
14125
|
|
|
14247
14126
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/DownloadSimple.es.js
|
|
14248
|
-
var
|
|
14249
|
-
|
|
14127
|
+
var e26 = o16.forwardRef((a, m) => /* @__PURE__ */ o16.createElement(p, { ref: m, ...a, weights: e25 }));
|
|
14128
|
+
e26.displayName = "DownloadSimpleIcon";
|
|
14250
14129
|
|
|
14251
14130
|
// ../ui/src/components/message-thread.tsx
|
|
14252
14131
|
import { useState as useState16 } from "react";
|
|
@@ -14256,7 +14135,6 @@ import * as React78 from "react";
|
|
|
14256
14135
|
|
|
14257
14136
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs
|
|
14258
14137
|
import * as React77 from "react";
|
|
14259
|
-
"use client";
|
|
14260
14138
|
var DialogRootContext = /* @__PURE__ */ React77.createContext(undefined);
|
|
14261
14139
|
if (true)
|
|
14262
14140
|
DialogRootContext.displayName = "DialogRootContext";
|
|
@@ -14269,7 +14147,6 @@ function useDialogRootContext(optional) {
|
|
|
14269
14147
|
}
|
|
14270
14148
|
|
|
14271
14149
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs
|
|
14272
|
-
"use client";
|
|
14273
14150
|
var DialogBackdrop = /* @__PURE__ */ React78.forwardRef(function DialogBackdrop(componentProps, forwardedRef) {
|
|
14274
14151
|
const {
|
|
14275
14152
|
render,
|
|
@@ -14306,7 +14183,6 @@ if (true)
|
|
|
14306
14183
|
DialogBackdrop.displayName = "DialogBackdrop";
|
|
14307
14184
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/close/DialogClose.mjs
|
|
14308
14185
|
import * as React79 from "react";
|
|
14309
|
-
"use client";
|
|
14310
14186
|
var DialogClose = /* @__PURE__ */ React79.forwardRef(function DialogClose(componentProps, forwardedRef) {
|
|
14311
14187
|
const {
|
|
14312
14188
|
render,
|
|
@@ -14345,7 +14221,6 @@ if (true)
|
|
|
14345
14221
|
DialogClose.displayName = "DialogClose";
|
|
14346
14222
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/description/DialogDescription.mjs
|
|
14347
14223
|
import * as React80 from "react";
|
|
14348
|
-
"use client";
|
|
14349
14224
|
var DialogDescription = /* @__PURE__ */ React80.forwardRef(function DialogDescription(componentProps, forwardedRef) {
|
|
14350
14225
|
const {
|
|
14351
14226
|
render,
|
|
@@ -14371,7 +14246,6 @@ import * as React82 from "react";
|
|
|
14371
14246
|
|
|
14372
14247
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs
|
|
14373
14248
|
import * as React81 from "react";
|
|
14374
|
-
"use client";
|
|
14375
14249
|
var DialogPortalContext = /* @__PURE__ */ React81.createContext(undefined);
|
|
14376
14250
|
if (true)
|
|
14377
14251
|
DialogPortalContext.displayName = "DialogPortalContext";
|
|
@@ -14406,7 +14280,6 @@ var dialogStateAttributesMapping = {
|
|
|
14406
14280
|
|
|
14407
14281
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs
|
|
14408
14282
|
import { jsx as _jsx14 } from "react/jsx-runtime";
|
|
14409
|
-
"use client";
|
|
14410
14283
|
var DialogPopup = /* @__PURE__ */ React82.forwardRef(function DialogPopup(componentProps, forwardedRef) {
|
|
14411
14284
|
const {
|
|
14412
14285
|
render,
|
|
@@ -14488,7 +14361,6 @@ if (true)
|
|
|
14488
14361
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/portal/DialogPortal.mjs
|
|
14489
14362
|
import * as React83 from "react";
|
|
14490
14363
|
import { jsx as _jsx15, jsxs as _jsxs6 } from "react/jsx-runtime";
|
|
14491
|
-
"use client";
|
|
14492
14364
|
var DialogPortal = /* @__PURE__ */ React83.forwardRef(function DialogPortal(props, forwardedRef) {
|
|
14493
14365
|
const {
|
|
14494
14366
|
keepMounted = false,
|
|
@@ -14521,7 +14393,6 @@ import * as React86 from "react";
|
|
|
14521
14393
|
|
|
14522
14394
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/root/useDialogRoot.mjs
|
|
14523
14395
|
import * as React84 from "react";
|
|
14524
|
-
"use client";
|
|
14525
14396
|
function DialogInteractions({
|
|
14526
14397
|
store,
|
|
14527
14398
|
parentContext,
|
|
@@ -14681,7 +14552,6 @@ function createInitialContext2(triggerElements) {
|
|
|
14681
14552
|
|
|
14682
14553
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs
|
|
14683
14554
|
import { jsx as _jsx16, jsxs as _jsxs7 } from "react/jsx-runtime";
|
|
14684
|
-
"use client";
|
|
14685
14555
|
function useRenderDialogRoot(mode, props) {
|
|
14686
14556
|
const {
|
|
14687
14557
|
children,
|
|
@@ -14750,7 +14620,6 @@ function useRenderDialogRoot(mode, props) {
|
|
|
14750
14620
|
}
|
|
14751
14621
|
|
|
14752
14622
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/root/DialogRoot.mjs
|
|
14753
|
-
"use client";
|
|
14754
14623
|
var DialogRoot = fastComponent(function DialogRoot(props) {
|
|
14755
14624
|
return useRenderDialogRoot("dialog", props);
|
|
14756
14625
|
});
|
|
@@ -14758,7 +14627,6 @@ if (true)
|
|
|
14758
14627
|
DialogRoot.displayName = "DialogRoot";
|
|
14759
14628
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/title/DialogTitle.mjs
|
|
14760
14629
|
import * as React87 from "react";
|
|
14761
|
-
"use client";
|
|
14762
14630
|
var DialogTitle = /* @__PURE__ */ React87.forwardRef(function DialogTitle(componentProps, forwardedRef) {
|
|
14763
14631
|
const {
|
|
14764
14632
|
render,
|
|
@@ -14781,7 +14649,6 @@ if (true)
|
|
|
14781
14649
|
DialogTitle.displayName = "DialogTitle";
|
|
14782
14650
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+a2357f7178ffa785/node_modules/@base-ui/react/dialog/trigger/DialogTrigger.mjs
|
|
14783
14651
|
import * as React88 from "react";
|
|
14784
|
-
"use client";
|
|
14785
14652
|
var DialogTrigger = fastComponentRef(function DialogTrigger(componentProps, forwardedRef) {
|
|
14786
14653
|
const {
|
|
14787
14654
|
render,
|
|
@@ -14844,7 +14711,6 @@ if (true)
|
|
|
14844
14711
|
DialogTrigger.displayName = "DialogTrigger";
|
|
14845
14712
|
// ../ui/src/components/dialog.tsx
|
|
14846
14713
|
import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
|
|
14847
|
-
"use client";
|
|
14848
14714
|
function Dialog({ ...props }) {
|
|
14849
14715
|
return /* @__PURE__ */ jsxDEV12(DialogRoot, {
|
|
14850
14716
|
"data-slot": "dialog",
|
|
@@ -14890,7 +14756,7 @@ function DialogContent({
|
|
|
14890
14756
|
/* @__PURE__ */ jsxDEV12(DialogOverlay, {}, undefined, false, undefined, this),
|
|
14891
14757
|
/* @__PURE__ */ jsxDEV12(DialogPopup, {
|
|
14892
14758
|
"data-slot": "dialog-content",
|
|
14893
|
-
className: cn2("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-
|
|
14759
|
+
className: cn2("squircle fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-hidden rounded-(--radius-dialog) bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none ring-inset sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
14894
14760
|
...props,
|
|
14895
14761
|
children: [
|
|
14896
14762
|
children,
|
|
@@ -14902,7 +14768,7 @@ function DialogContent({
|
|
|
14902
14768
|
size: "icon-sm"
|
|
14903
14769
|
}, undefined, false, undefined, this),
|
|
14904
14770
|
children: [
|
|
14905
|
-
/* @__PURE__ */ jsxDEV12(
|
|
14771
|
+
/* @__PURE__ */ jsxDEV12(e22, {}, undefined, false, undefined, this),
|
|
14906
14772
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
14907
14773
|
className: "sr-only",
|
|
14908
14774
|
children: "Close"
|
|
@@ -15104,7 +14970,6 @@ function f(...a) {
|
|
|
15104
14970
|
// ../../node_modules/.bun/@shadcn+react@0.3.1+bbd62a8f21ab0a40/node_modules/@shadcn/react/dist/message-scroller/index.js
|
|
15105
14971
|
import * as f9 from "react";
|
|
15106
14972
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
15107
|
-
"use client";
|
|
15108
14973
|
var _e2 = 8;
|
|
15109
14974
|
var Be = 64;
|
|
15110
14975
|
var Fe2 = 0;
|
|
@@ -15573,41 +15438,40 @@ var er2 = { Provider: ft2, Root: gt2, Viewport: Rt2, Content: pt, Item: mt2, But
|
|
|
15573
15438
|
import * as o17 from "react";
|
|
15574
15439
|
|
|
15575
15440
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/defs/ArrowDown.es.js
|
|
15576
|
-
import * as
|
|
15577
|
-
var
|
|
15441
|
+
import * as e27 from "react";
|
|
15442
|
+
var a17 = /* @__PURE__ */ new Map([
|
|
15578
15443
|
[
|
|
15579
15444
|
"bold",
|
|
15580
|
-
/* @__PURE__ */
|
|
15445
|
+
/* @__PURE__ */ e27.createElement(e27.Fragment, null, /* @__PURE__ */ e27.createElement("path", { d: "M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z" }))
|
|
15581
15446
|
],
|
|
15582
15447
|
[
|
|
15583
15448
|
"duotone",
|
|
15584
|
-
/* @__PURE__ */
|
|
15449
|
+
/* @__PURE__ */ e27.createElement(e27.Fragment, null, /* @__PURE__ */ e27.createElement("path", { d: "M200,144l-72,72L56,144Z", opacity: "0.2" }), /* @__PURE__ */ e27.createElement("path", { d: "M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z" }))
|
|
15585
15450
|
],
|
|
15586
15451
|
[
|
|
15587
15452
|
"fill",
|
|
15588
|
-
/* @__PURE__ */
|
|
15453
|
+
/* @__PURE__ */ e27.createElement(e27.Fragment, null, /* @__PURE__ */ e27.createElement("path", { d: "M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z" }))
|
|
15589
15454
|
],
|
|
15590
15455
|
[
|
|
15591
15456
|
"light",
|
|
15592
|
-
/* @__PURE__ */
|
|
15457
|
+
/* @__PURE__ */ e27.createElement(e27.Fragment, null, /* @__PURE__ */ e27.createElement("path", { d: "M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z" }))
|
|
15593
15458
|
],
|
|
15594
15459
|
[
|
|
15595
15460
|
"regular",
|
|
15596
|
-
/* @__PURE__ */
|
|
15461
|
+
/* @__PURE__ */ e27.createElement(e27.Fragment, null, /* @__PURE__ */ e27.createElement("path", { d: "M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z" }))
|
|
15597
15462
|
],
|
|
15598
15463
|
[
|
|
15599
15464
|
"thin",
|
|
15600
|
-
/* @__PURE__ */
|
|
15465
|
+
/* @__PURE__ */ e27.createElement(e27.Fragment, null, /* @__PURE__ */ e27.createElement("path", { d: "M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z" }))
|
|
15601
15466
|
]
|
|
15602
15467
|
]);
|
|
15603
15468
|
|
|
15604
15469
|
// ../../node_modules/.bun/@phosphor-icons+react@2.1.10+005eabf3d8b6ef06/node_modules/@phosphor-icons/react/dist/csr/ArrowDown.es.js
|
|
15605
|
-
var r9 = o17.forwardRef((e, t) => /* @__PURE__ */ o17.createElement(p, { ref: t, ...e, weights:
|
|
15470
|
+
var r9 = o17.forwardRef((e, t) => /* @__PURE__ */ o17.createElement(p, { ref: t, ...e, weights: a17 }));
|
|
15606
15471
|
r9.displayName = "ArrowDownIcon";
|
|
15607
15472
|
|
|
15608
15473
|
// ../ui/src/components/message-scroller.tsx
|
|
15609
|
-
import { jsxDEV as jsxDEV14, Fragment as
|
|
15610
|
-
"use client";
|
|
15474
|
+
import { jsxDEV as jsxDEV14, Fragment as Fragment20 } from "react/jsx-dev-runtime";
|
|
15611
15475
|
function MessageScrollerProvider(props) {
|
|
15612
15476
|
return /* @__PURE__ */ jsxDEV14(er2.Provider, {
|
|
15613
15477
|
...props
|
|
@@ -15676,7 +15540,7 @@ function MessageScrollerButton({
|
|
|
15676
15540
|
size
|
|
15677
15541
|
}, undefined, false, undefined, this),
|
|
15678
15542
|
...props,
|
|
15679
|
-
children: children ?? /* @__PURE__ */ jsxDEV14(
|
|
15543
|
+
children: children ?? /* @__PURE__ */ jsxDEV14(Fragment20, {
|
|
15680
15544
|
children: [
|
|
15681
15545
|
/* @__PURE__ */ jsxDEV14(r9, {}, undefined, false, undefined, this),
|
|
15682
15546
|
/* @__PURE__ */ jsxDEV14("span", {
|
|
@@ -15690,7 +15554,6 @@ function MessageScrollerButton({
|
|
|
15690
15554
|
|
|
15691
15555
|
// ../ui/src/components/message-thread.tsx
|
|
15692
15556
|
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
15693
|
-
"use client";
|
|
15694
15557
|
function formatFileSize(bytes) {
|
|
15695
15558
|
if (bytes < 1024)
|
|
15696
15559
|
return `${bytes} B`;
|
|
@@ -15724,7 +15587,7 @@ function AttachmentDownload({ attachment }) {
|
|
|
15724
15587
|
setPending(false);
|
|
15725
15588
|
}
|
|
15726
15589
|
},
|
|
15727
|
-
children: /* @__PURE__ */ jsxDEV15(
|
|
15590
|
+
children: /* @__PURE__ */ jsxDEV15(e26, {}, undefined, false, undefined, this)
|
|
15728
15591
|
}, undefined, false, undefined, this),
|
|
15729
15592
|
failed && /* @__PURE__ */ jsxDEV15("span", {
|
|
15730
15593
|
role: "alert",
|
|
@@ -15830,7 +15693,7 @@ function MessageAttachments({
|
|
|
15830
15693
|
size: "icon-sm"
|
|
15831
15694
|
}, undefined, false, undefined, this),
|
|
15832
15695
|
"aria-label": "Close image preview",
|
|
15833
|
-
children: /* @__PURE__ */ jsxDEV15(
|
|
15696
|
+
children: /* @__PURE__ */ jsxDEV15(e22, {}, undefined, false, undefined, this)
|
|
15834
15697
|
}, undefined, false, undefined, this)
|
|
15835
15698
|
]
|
|
15836
15699
|
}, undefined, true, undefined, this),
|
|
@@ -15994,7 +15857,6 @@ function MessageThread({
|
|
|
15994
15857
|
|
|
15995
15858
|
// ../ui/src/components/label.tsx
|
|
15996
15859
|
import { jsxDEV as jsxDEV16 } from "react/jsx-dev-runtime";
|
|
15997
|
-
"use client";
|
|
15998
15860
|
function Label({ className, ...props }) {
|
|
15999
15861
|
return /* @__PURE__ */ jsxDEV16("label", {
|
|
16000
15862
|
"data-slot": "label",
|
|
@@ -16015,7 +15877,6 @@ function Skeleton({ className, ...props }) {
|
|
|
16015
15877
|
|
|
16016
15878
|
// src/website-chat.tsx
|
|
16017
15879
|
import { jsxDEV as jsxDEV18 } from "react/jsx-dev-runtime";
|
|
16018
|
-
"use client";
|
|
16019
15880
|
function browserName(userAgent) {
|
|
16020
15881
|
if (/Edg\//.test(userAgent))
|
|
16021
15882
|
return "Microsoft Edge";
|
|
@@ -16034,10 +15895,23 @@ function WebsiteChat({
|
|
|
16034
15895
|
expanded,
|
|
16035
15896
|
onExpandedChange,
|
|
16036
15897
|
onClose,
|
|
15898
|
+
onSettingsChange,
|
|
15899
|
+
theme,
|
|
16037
15900
|
assetBaseUrl
|
|
16038
15901
|
}) {
|
|
16039
15902
|
const workspaceQuery = useQuery(widgetApi.workspace, { workspaceId });
|
|
16040
|
-
const
|
|
15903
|
+
const sourceWorkspace = workspaceQuery === undefined ? initialSettings : workspaceQuery;
|
|
15904
|
+
const settingsSnapshotRef = useRef33("");
|
|
15905
|
+
useEffect18(() => {
|
|
15906
|
+
if (!workspaceQuery)
|
|
15907
|
+
return;
|
|
15908
|
+
const snapshot = JSON.stringify(workspaceQuery);
|
|
15909
|
+
if (settingsSnapshotRef.current === snapshot)
|
|
15910
|
+
return;
|
|
15911
|
+
settingsSnapshotRef.current = snapshot;
|
|
15912
|
+
onSettingsChange(workspaceQuery);
|
|
15913
|
+
}, [onSettingsChange, workspaceQuery]);
|
|
15914
|
+
const workspace = sourceWorkspace ? { ...sourceWorkspace, theme } : sourceWorkspace;
|
|
16041
15915
|
const open = useMutation(widgetApi.openWebsite);
|
|
16042
15916
|
const start = useMutation(widgetApi.startCustomer);
|
|
16043
15917
|
const send = useMutation(widgetApi.sendCustomer);
|
|
@@ -16047,14 +15921,15 @@ function WebsiteChat({
|
|
|
16047
15921
|
const [visitorId, setVisitorId] = useState17("");
|
|
16048
15922
|
const [conversationId, setConversationId] = useState17();
|
|
16049
15923
|
const [chatStartedAt, setChatStartedAt] = useState17(() => Date.now());
|
|
16050
|
-
const [name, setName] = useState17("");
|
|
16051
15924
|
const [email, setEmail] = useState17("");
|
|
16052
15925
|
const [starting, setStarting] = useState17(false);
|
|
15926
|
+
const [chatError, setChatError] = useState17("");
|
|
15927
|
+
const [pendingFirstMessage, setPendingFirstMessage] = useState17();
|
|
16053
15928
|
const [view, setView] = useState17("chat");
|
|
16054
15929
|
const [context, setContext] = useState17();
|
|
16055
15930
|
const canAccessChat = !!sessionToken;
|
|
16056
15931
|
const profile = useQuery(widgetApi.visitorProfile, visitorId && canAccessChat ? { workspaceId, visitorId, sessionToken } : "skip");
|
|
16057
|
-
|
|
15932
|
+
useEffect18(() => {
|
|
16058
15933
|
const key = `coristen:${workspaceId}`;
|
|
16059
15934
|
const id = localStorage.getItem(key) ?? crypto.randomUUID();
|
|
16060
15935
|
localStorage.setItem(key, id);
|
|
@@ -16072,18 +15947,22 @@ function WebsiteChat({
|
|
|
16072
15947
|
if (!context || !sessionToken || starting)
|
|
16073
15948
|
return;
|
|
16074
15949
|
setStarting(true);
|
|
15950
|
+
setChatError("");
|
|
16075
15951
|
try {
|
|
15952
|
+
const contactName = email.split("@")[0]?.replace(/[._-]+/g, " ").trim() || "Visitor";
|
|
16076
15953
|
const id = await open({
|
|
16077
15954
|
workspaceId,
|
|
16078
15955
|
visitorId,
|
|
16079
15956
|
sessionToken,
|
|
16080
|
-
name,
|
|
15957
|
+
name: contactName,
|
|
16081
15958
|
email,
|
|
16082
15959
|
...context,
|
|
16083
15960
|
newConversation: true
|
|
16084
15961
|
});
|
|
16085
15962
|
setConversationId(id ?? undefined);
|
|
16086
15963
|
setView("chat");
|
|
15964
|
+
} catch {
|
|
15965
|
+
setChatError("We couldn't save your email. Please try again.");
|
|
16087
15966
|
} finally {
|
|
16088
15967
|
setStarting(false);
|
|
16089
15968
|
}
|
|
@@ -16096,6 +15975,7 @@ function WebsiteChat({
|
|
|
16096
15975
|
if (!context || starting)
|
|
16097
15976
|
return;
|
|
16098
15977
|
setStarting(true);
|
|
15978
|
+
setChatError("");
|
|
16099
15979
|
try {
|
|
16100
15980
|
const id = await open({
|
|
16101
15981
|
workspaceId,
|
|
@@ -16108,6 +15988,8 @@ function WebsiteChat({
|
|
|
16108
15988
|
setConversationId(id ?? undefined);
|
|
16109
15989
|
setChatStartedAt(Date.now());
|
|
16110
15990
|
setView("chat");
|
|
15991
|
+
} catch {
|
|
15992
|
+
setChatError("We couldn't start a new conversation. Please try again.");
|
|
16111
15993
|
} finally {
|
|
16112
15994
|
setStarting(false);
|
|
16113
15995
|
}
|
|
@@ -16115,9 +15997,13 @@ function WebsiteChat({
|
|
|
16115
15997
|
const messages = useQuery(widgetApi.customerMessages, conversationId && visitorId && canAccessChat ? { conversationId, visitorId, sessionToken } : "skip");
|
|
16116
15998
|
const conversations = useQuery(widgetApi.visitorConversations, visitorId && canAccessChat ? { workspaceId, visitorId, sessionToken } : "skip");
|
|
16117
15999
|
const latestMessage = messages?.at(-1);
|
|
16118
|
-
|
|
16000
|
+
useEffect18(() => {
|
|
16001
|
+
if (messages !== undefined)
|
|
16002
|
+
setPendingFirstMessage(undefined);
|
|
16003
|
+
}, [messages]);
|
|
16004
|
+
useEffect18(() => {
|
|
16119
16005
|
if (view === "chat" && canAccessChat && conversationId && visitorId && latestMessage?.sender === "merchant") {
|
|
16120
|
-
markRead({ conversationId, visitorId, sessionToken });
|
|
16006
|
+
markRead({ conversationId, visitorId, sessionToken }).catch(() => {});
|
|
16121
16007
|
}
|
|
16122
16008
|
}, [
|
|
16123
16009
|
conversationId,
|
|
@@ -16129,7 +16015,7 @@ function WebsiteChat({
|
|
|
16129
16015
|
canAccessChat,
|
|
16130
16016
|
visitorId
|
|
16131
16017
|
]);
|
|
16132
|
-
|
|
16018
|
+
useEffect18(() => {
|
|
16133
16019
|
const onKeyDown = (event) => {
|
|
16134
16020
|
if (event.key === "Escape" && !event.defaultPrevented)
|
|
16135
16021
|
onClose();
|
|
@@ -16171,7 +16057,7 @@ function WebsiteChat({
|
|
|
16171
16057
|
return /* @__PURE__ */ jsxDEV18("div", {
|
|
16172
16058
|
className: workspace.theme === "dark" ? "dark flex h-full w-full flex-col text-foreground" : "flex h-full w-full flex-col text-foreground",
|
|
16173
16059
|
children: /* @__PURE__ */ jsxDEV18(Card, {
|
|
16174
|
-
className: "squircle relative h-full w-full gap-0 rounded-(--configured-radius) border bg-background text-foreground shadow-none",
|
|
16060
|
+
className: "squircle relative h-full w-full gap-0 rounded-(--configured-radius) border border-black/10 bg-background text-foreground shadow-none dark:border-white/10",
|
|
16175
16061
|
style: {
|
|
16176
16062
|
"--primary": workspace.accentSendIcon ? workspace.theme === "dark" ? headerAccent : accentColor : undefined,
|
|
16177
16063
|
"--primary-foreground": workspace.accentSendIcon && workspace.theme === "dark" ? "#171717" : undefined,
|
|
@@ -16208,7 +16094,7 @@ function WebsiteChat({
|
|
|
16208
16094
|
size: "sm",
|
|
16209
16095
|
onClick: () => setView(view === "chat" ? "history" : "chat"),
|
|
16210
16096
|
children: [
|
|
16211
|
-
view === "chat" ? /* @__PURE__ */ jsxDEV18(
|
|
16097
|
+
view === "chat" ? /* @__PURE__ */ jsxDEV18(e10, {
|
|
16212
16098
|
"data-icon": "inline-start"
|
|
16213
16099
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV18(r2, {
|
|
16214
16100
|
"data-icon": "inline-start"
|
|
@@ -16232,12 +16118,17 @@ function WebsiteChat({
|
|
|
16232
16118
|
"aria-label": "Close chat",
|
|
16233
16119
|
title: "Close chat",
|
|
16234
16120
|
onClick: onClose,
|
|
16235
|
-
children: /* @__PURE__ */ jsxDEV18(
|
|
16121
|
+
children: /* @__PURE__ */ jsxDEV18(e22, {}, undefined, false, undefined, this)
|
|
16236
16122
|
}, undefined, false, undefined, this)
|
|
16237
16123
|
]
|
|
16238
16124
|
}, undefined, true, undefined, this)
|
|
16239
16125
|
]
|
|
16240
16126
|
}, undefined, true, undefined, this),
|
|
16127
|
+
chatError && profile !== null && /* @__PURE__ */ jsxDEV18("p", {
|
|
16128
|
+
role: "alert",
|
|
16129
|
+
className: "mx-4 mb-2 rounded-lg bg-destructive/10 px-3 py-2 text-xs text-destructive",
|
|
16130
|
+
children: chatError
|
|
16131
|
+
}, undefined, false, undefined, this),
|
|
16241
16132
|
/* @__PURE__ */ jsxDEV18(CardContent, {
|
|
16242
16133
|
className: "flex min-h-0 flex-1 overflow-hidden p-0",
|
|
16243
16134
|
children: view === "history" ? /* @__PURE__ */ jsxDEV18("div", {
|
|
@@ -16336,78 +16227,90 @@ function WebsiteChat({
|
|
|
16336
16227
|
className: "h-8 w-full"
|
|
16337
16228
|
}, undefined, false, undefined, this)
|
|
16338
16229
|
]
|
|
16339
|
-
}, undefined, true, undefined, this) : profile === null && !conversationId ? /* @__PURE__ */ jsxDEV18("
|
|
16340
|
-
className: "flex w-full flex-col
|
|
16341
|
-
onSubmit: (event) => void startChat(event),
|
|
16230
|
+
}, undefined, true, undefined, this) : profile === null && !conversationId ? /* @__PURE__ */ jsxDEV18("div", {
|
|
16231
|
+
className: "flex min-h-0 w-full flex-col",
|
|
16342
16232
|
children: [
|
|
16343
|
-
/* @__PURE__ */ jsxDEV18(
|
|
16344
|
-
|
|
16345
|
-
|
|
16346
|
-
|
|
16347
|
-
|
|
16348
|
-
|
|
16349
|
-
|
|
16350
|
-
|
|
16351
|
-
|
|
16352
|
-
|
|
16353
|
-
|
|
16354
|
-
|
|
16355
|
-
|
|
16356
|
-
|
|
16357
|
-
|
|
16358
|
-
|
|
16359
|
-
|
|
16360
|
-
|
|
16361
|
-
children: "Name"
|
|
16362
|
-
}, undefined, false, undefined, this),
|
|
16363
|
-
/* @__PURE__ */ jsxDEV18(Input2, {
|
|
16364
|
-
id: "customer-name",
|
|
16365
|
-
value: name,
|
|
16366
|
-
onChange: (event) => setName(event.target.value),
|
|
16367
|
-
autoComplete: "name",
|
|
16368
|
-
maxLength: 100,
|
|
16369
|
-
required: true
|
|
16370
|
-
}, undefined, false, undefined, this)
|
|
16371
|
-
]
|
|
16372
|
-
}, undefined, true, undefined, this),
|
|
16373
|
-
/* @__PURE__ */ jsxDEV18("div", {
|
|
16374
|
-
className: "space-y-2",
|
|
16233
|
+
/* @__PURE__ */ jsxDEV18(MessageThread, {
|
|
16234
|
+
messages: [
|
|
16235
|
+
{
|
|
16236
|
+
_id: "email-question",
|
|
16237
|
+
_creationTime: chatStartedAt,
|
|
16238
|
+
isAi: true,
|
|
16239
|
+
sender: "merchant",
|
|
16240
|
+
body: "Hi! What email address should we use to reach you?"
|
|
16241
|
+
}
|
|
16242
|
+
],
|
|
16243
|
+
ownSender: "customer",
|
|
16244
|
+
showMetadata: true,
|
|
16245
|
+
ownVariant: "secondary",
|
|
16246
|
+
otherAvatar: agentAvatar
|
|
16247
|
+
}, undefined, false, undefined, this),
|
|
16248
|
+
/* @__PURE__ */ jsxDEV18("form", {
|
|
16249
|
+
className: "shrink-0 space-y-3 p-4",
|
|
16250
|
+
onSubmit: (event) => void startChat(event),
|
|
16375
16251
|
children: [
|
|
16376
|
-
/* @__PURE__ */ jsxDEV18(
|
|
16377
|
-
|
|
16378
|
-
children:
|
|
16252
|
+
/* @__PURE__ */ jsxDEV18("div", {
|
|
16253
|
+
className: "space-y-2",
|
|
16254
|
+
children: [
|
|
16255
|
+
/* @__PURE__ */ jsxDEV18(Label, {
|
|
16256
|
+
htmlFor: "customer-email",
|
|
16257
|
+
children: "Email address"
|
|
16258
|
+
}, undefined, false, undefined, this),
|
|
16259
|
+
/* @__PURE__ */ jsxDEV18(Input2, {
|
|
16260
|
+
id: "customer-email",
|
|
16261
|
+
type: "email",
|
|
16262
|
+
value: email,
|
|
16263
|
+
onChange: (event) => setEmail(event.target.value),
|
|
16264
|
+
autoComplete: "email",
|
|
16265
|
+
placeholder: "you@example.com",
|
|
16266
|
+
maxLength: 254,
|
|
16267
|
+
required: true
|
|
16268
|
+
}, undefined, false, undefined, this)
|
|
16269
|
+
]
|
|
16270
|
+
}, undefined, true, undefined, this),
|
|
16271
|
+
chatError && /* @__PURE__ */ jsxDEV18("p", {
|
|
16272
|
+
role: "alert",
|
|
16273
|
+
className: "text-xs text-destructive",
|
|
16274
|
+
children: chatError
|
|
16379
16275
|
}, undefined, false, undefined, this),
|
|
16380
|
-
/* @__PURE__ */ jsxDEV18(
|
|
16381
|
-
|
|
16382
|
-
|
|
16383
|
-
|
|
16384
|
-
|
|
16385
|
-
autoComplete: "email",
|
|
16386
|
-
maxLength: 254,
|
|
16387
|
-
required: true
|
|
16276
|
+
/* @__PURE__ */ jsxDEV18(Button2, {
|
|
16277
|
+
type: "submit",
|
|
16278
|
+
className: "w-full",
|
|
16279
|
+
disabled: starting || !context,
|
|
16280
|
+
children: starting ? "Continuing..." : "Continue"
|
|
16388
16281
|
}, undefined, false, undefined, this)
|
|
16389
16282
|
]
|
|
16390
|
-
}, undefined, true, undefined, this)
|
|
16391
|
-
/* @__PURE__ */ jsxDEV18(Button2, {
|
|
16392
|
-
type: "submit",
|
|
16393
|
-
disabled: starting || !context,
|
|
16394
|
-
children: starting ? "Starting..." : "Start conversation"
|
|
16395
|
-
}, undefined, false, undefined, this)
|
|
16396
|
-
]
|
|
16397
|
-
}, undefined, true, undefined, this) : conversationId && messages === undefined ? /* @__PURE__ */ jsxDEV18("div", {
|
|
16398
|
-
className: "flex w-full flex-col gap-3 p-4",
|
|
16399
|
-
children: [
|
|
16400
|
-
/* @__PURE__ */ jsxDEV18(Skeleton, {
|
|
16401
|
-
className: "h-9 w-3/4 rounded-xl"
|
|
16402
|
-
}, undefined, false, undefined, this),
|
|
16403
|
-
/* @__PURE__ */ jsxDEV18(Skeleton, {
|
|
16404
|
-
className: "ml-auto h-9 w-1/2 rounded-xl"
|
|
16405
|
-
}, undefined, false, undefined, this),
|
|
16406
|
-
/* @__PURE__ */ jsxDEV18(Skeleton, {
|
|
16407
|
-
className: "h-12 w-4/5 rounded-xl"
|
|
16408
|
-
}, undefined, false, undefined, this)
|
|
16283
|
+
}, undefined, true, undefined, this)
|
|
16409
16284
|
]
|
|
16410
|
-
}, undefined, true, undefined, this) :
|
|
16285
|
+
}, undefined, true, undefined, this) : conversationId && messages === undefined ? /* @__PURE__ */ jsxDEV18(MessageThread, {
|
|
16286
|
+
messages: [
|
|
16287
|
+
{
|
|
16288
|
+
_id: "welcome",
|
|
16289
|
+
_creationTime: chatStartedAt,
|
|
16290
|
+
isAi: true,
|
|
16291
|
+
sender: "merchant",
|
|
16292
|
+
body: workspace.welcomeMessage
|
|
16293
|
+
},
|
|
16294
|
+
...pendingFirstMessage ? [
|
|
16295
|
+
{
|
|
16296
|
+
_id: "pending-first-message",
|
|
16297
|
+
_creationTime: pendingFirstMessage.createdAt,
|
|
16298
|
+
sender: "customer",
|
|
16299
|
+
body: pendingFirstMessage.body,
|
|
16300
|
+
attachments: pendingFirstMessage.attachments
|
|
16301
|
+
}
|
|
16302
|
+
] : []
|
|
16303
|
+
],
|
|
16304
|
+
ownSender: "customer",
|
|
16305
|
+
showMetadata: true,
|
|
16306
|
+
ownVariant: "secondary",
|
|
16307
|
+
ownAvatar: /* @__PURE__ */ jsxDEV18(DitherAvatar, {
|
|
16308
|
+
seed: visitorId,
|
|
16309
|
+
size: 28,
|
|
16310
|
+
className: "size-7"
|
|
16311
|
+
}, undefined, false, undefined, this),
|
|
16312
|
+
otherAvatar: agentAvatar
|
|
16313
|
+
}, undefined, false, undefined, this) : !conversationId || messages?.length === 0 ? /* @__PURE__ */ jsxDEV18(MessageThread, {
|
|
16411
16314
|
messages: [
|
|
16412
16315
|
{
|
|
16413
16316
|
_id: "welcome",
|
|
@@ -16433,12 +16336,13 @@ function WebsiteChat({
|
|
|
16433
16336
|
}, undefined, false, undefined, this),
|
|
16434
16337
|
otherAvatar: agentAvatar,
|
|
16435
16338
|
onRetry: (customerMessageId) => {
|
|
16339
|
+
setChatError("");
|
|
16436
16340
|
retryAgentResponse({
|
|
16437
16341
|
conversationId,
|
|
16438
16342
|
visitorId,
|
|
16439
16343
|
customerMessageId,
|
|
16440
16344
|
sessionToken
|
|
16441
|
-
});
|
|
16345
|
+
}).catch(() => setChatError("The reply couldn't be retried. Please try again."));
|
|
16442
16346
|
}
|
|
16443
16347
|
}, conversationId, false, undefined, this)
|
|
16444
16348
|
}, undefined, false, undefined, this),
|
|
@@ -16451,7 +16355,7 @@ function WebsiteChat({
|
|
|
16451
16355
|
disabled: starting || profile === undefined,
|
|
16452
16356
|
onClick: () => void startNewConversation(),
|
|
16453
16357
|
children: [
|
|
16454
|
-
/* @__PURE__ */ jsxDEV18(
|
|
16358
|
+
/* @__PURE__ */ jsxDEV18(e20, {
|
|
16455
16359
|
"data-icon": "inline-start"
|
|
16456
16360
|
}, undefined, false, undefined, this),
|
|
16457
16361
|
"Start a conversation"
|
|
@@ -16463,7 +16367,6 @@ function WebsiteChat({
|
|
|
16463
16367
|
children: /* @__PURE__ */ jsxDEV18(WidgetComposer, {
|
|
16464
16368
|
sendDisabled: !context,
|
|
16465
16369
|
showPoweredBy: workspace.showPoweredBy,
|
|
16466
|
-
privacyPolicyUrl: workspace.privacyPolicyUrl,
|
|
16467
16370
|
assetBaseUrl,
|
|
16468
16371
|
upload: async (file) => {
|
|
16469
16372
|
if (file.size > workspace.maxAttachmentSizeMb * 1024 * 1024)
|
|
@@ -16519,6 +16422,14 @@ function WebsiteChat({
|
|
|
16519
16422
|
body,
|
|
16520
16423
|
attachments
|
|
16521
16424
|
});
|
|
16425
|
+
setPendingFirstMessage({
|
|
16426
|
+
body,
|
|
16427
|
+
attachments: attachments.map((attachment) => ({
|
|
16428
|
+
...attachment,
|
|
16429
|
+
url: null
|
|
16430
|
+
})),
|
|
16431
|
+
createdAt: Date.now()
|
|
16432
|
+
});
|
|
16522
16433
|
setConversationId(id);
|
|
16523
16434
|
return id;
|
|
16524
16435
|
}
|
|
@@ -16531,49 +16442,177 @@ function WebsiteChat({
|
|
|
16531
16442
|
|
|
16532
16443
|
// src/index.tsx
|
|
16533
16444
|
import { jsxDEV as jsxDEV19 } from "react/jsx-dev-runtime";
|
|
16534
|
-
"use client";
|
|
16535
16445
|
var DEFAULT_API_URL = "https://coristen-three.vercel.app";
|
|
16446
|
+
var HOST_THEME_VARIABLES = [
|
|
16447
|
+
"--background",
|
|
16448
|
+
"--foreground",
|
|
16449
|
+
"--card",
|
|
16450
|
+
"--card-foreground",
|
|
16451
|
+
"--popover",
|
|
16452
|
+
"--popover-foreground",
|
|
16453
|
+
"--primary",
|
|
16454
|
+
"--primary-foreground",
|
|
16455
|
+
"--secondary",
|
|
16456
|
+
"--secondary-foreground",
|
|
16457
|
+
"--muted",
|
|
16458
|
+
"--muted-foreground",
|
|
16459
|
+
"--accent",
|
|
16460
|
+
"--accent-foreground",
|
|
16461
|
+
"--destructive",
|
|
16462
|
+
"--border",
|
|
16463
|
+
"--input",
|
|
16464
|
+
"--ring",
|
|
16465
|
+
"--radius-small",
|
|
16466
|
+
"--radius-medium",
|
|
16467
|
+
"--radius-control",
|
|
16468
|
+
"--radius-card",
|
|
16469
|
+
"--radius-panel",
|
|
16470
|
+
"--radius-dialog",
|
|
16471
|
+
"--radius-display",
|
|
16472
|
+
"--surface-inset-sm",
|
|
16473
|
+
"--surface-inset-md",
|
|
16474
|
+
"--surface-inset-lg"
|
|
16475
|
+
];
|
|
16476
|
+
var DEFAULT_SETTINGS = {
|
|
16477
|
+
name: "Coristen",
|
|
16478
|
+
brandColor: "#171717",
|
|
16479
|
+
welcomeMessage: "",
|
|
16480
|
+
privacyPolicyUrl: "",
|
|
16481
|
+
position: "right",
|
|
16482
|
+
enabled: true,
|
|
16483
|
+
theme: "light",
|
|
16484
|
+
tintedGrayscale: false,
|
|
16485
|
+
accentEnabled: false,
|
|
16486
|
+
accentHeader: false,
|
|
16487
|
+
accentSendIcon: false,
|
|
16488
|
+
radius: "lg",
|
|
16489
|
+
bubbleIcon: "chat-text",
|
|
16490
|
+
bubbleColor: "#171717",
|
|
16491
|
+
bubbleShowText: false,
|
|
16492
|
+
bubbleText: "Chat",
|
|
16493
|
+
bubbleIconPosition: "left",
|
|
16494
|
+
showPoweredBy: true,
|
|
16495
|
+
maxAttachmentSizeMb: 10,
|
|
16496
|
+
allowedAttachmentTypes: []
|
|
16497
|
+
};
|
|
16498
|
+
|
|
16499
|
+
class WidgetErrorBoundary extends Component {
|
|
16500
|
+
state = { error: false };
|
|
16501
|
+
static getDerivedStateFromError() {
|
|
16502
|
+
return { error: true };
|
|
16503
|
+
}
|
|
16504
|
+
componentDidCatch(error, info) {
|
|
16505
|
+
this.props.onError(error);
|
|
16506
|
+
console.error("[Coristen widget] Runtime error", error, info);
|
|
16507
|
+
}
|
|
16508
|
+
render() {
|
|
16509
|
+
if (!this.state.error)
|
|
16510
|
+
return this.props.children;
|
|
16511
|
+
return /* @__PURE__ */ jsxDEV19("div", {
|
|
16512
|
+
className: "flex h-full flex-col items-center justify-center gap-3 bg-background p-6 text-center text-foreground",
|
|
16513
|
+
children: [
|
|
16514
|
+
/* @__PURE__ */ jsxDEV19("div", {
|
|
16515
|
+
children: [
|
|
16516
|
+
/* @__PURE__ */ jsxDEV19("p", {
|
|
16517
|
+
className: "font-medium",
|
|
16518
|
+
children: "Chat couldn't load"
|
|
16519
|
+
}, undefined, false, undefined, this),
|
|
16520
|
+
/* @__PURE__ */ jsxDEV19("p", {
|
|
16521
|
+
className: "mt-1 text-sm text-muted-foreground",
|
|
16522
|
+
children: "Check your connection and try again."
|
|
16523
|
+
}, undefined, false, undefined, this)
|
|
16524
|
+
]
|
|
16525
|
+
}, undefined, true, undefined, this),
|
|
16526
|
+
/* @__PURE__ */ jsxDEV19("div", {
|
|
16527
|
+
className: "flex gap-2",
|
|
16528
|
+
children: [
|
|
16529
|
+
/* @__PURE__ */ jsxDEV19("button", {
|
|
16530
|
+
type: "button",
|
|
16531
|
+
className: "rounded-lg border px-3 py-2 text-sm",
|
|
16532
|
+
onClick: this.props.onClose,
|
|
16533
|
+
children: "Close"
|
|
16534
|
+
}, undefined, false, undefined, this),
|
|
16535
|
+
/* @__PURE__ */ jsxDEV19("button", {
|
|
16536
|
+
type: "button",
|
|
16537
|
+
className: "rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",
|
|
16538
|
+
onClick: this.props.onRetry,
|
|
16539
|
+
children: "Try again"
|
|
16540
|
+
}, undefined, false, undefined, this)
|
|
16541
|
+
]
|
|
16542
|
+
}, undefined, true, undefined, this)
|
|
16543
|
+
]
|
|
16544
|
+
}, undefined, true, undefined, this);
|
|
16545
|
+
}
|
|
16546
|
+
}
|
|
16536
16547
|
function CoristenWidget({
|
|
16537
16548
|
identity,
|
|
16549
|
+
apiKey,
|
|
16538
16550
|
apiUrl = DEFAULT_API_URL,
|
|
16539
16551
|
defaultOpen = false,
|
|
16540
|
-
fontSize
|
|
16541
|
-
appearance
|
|
16552
|
+
fontSize,
|
|
16553
|
+
appearance,
|
|
16554
|
+
onReady,
|
|
16555
|
+
onError
|
|
16542
16556
|
}) {
|
|
16543
16557
|
const baseUrl = apiUrl.replace(/\/$/, "");
|
|
16544
16558
|
const [session, setSession] = useState18();
|
|
16559
|
+
const [remoteSettings, setRemoteSettings] = useState18();
|
|
16545
16560
|
const [open, setOpen] = useState18(defaultOpen);
|
|
16546
16561
|
const [expanded, setExpanded] = useState18(false);
|
|
16547
16562
|
const [reset, setReset] = useState18(0);
|
|
16563
|
+
const [hostTheme, setHostTheme] = useState18({});
|
|
16564
|
+
const [hostDark, setHostDark] = useState18(false);
|
|
16565
|
+
const [launcherPosition, setLauncherPosition] = useState18();
|
|
16566
|
+
const rootRef = useRef34(null);
|
|
16567
|
+
const dragRef = useRef34(undefined);
|
|
16568
|
+
const ignoreLauncherClick = useRef34(false);
|
|
16569
|
+
const onReadyRef = useRef34(onReady);
|
|
16570
|
+
const onErrorRef = useRef34(onError);
|
|
16571
|
+
onReadyRef.current = onReady;
|
|
16572
|
+
onErrorRef.current = onError;
|
|
16548
16573
|
const issueSession = useCallback13(async (previousToken) => {
|
|
16549
|
-
|
|
16550
|
-
|
|
16551
|
-
|
|
16552
|
-
|
|
16553
|
-
|
|
16554
|
-
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
16574
|
+
let publishableKey = apiKey;
|
|
16575
|
+
let identityToken;
|
|
16576
|
+
if (identity) {
|
|
16577
|
+
if (!identity.startsWith("/") || identity.startsWith("//"))
|
|
16578
|
+
throw new Error("Coristen identity must be a same-origin path");
|
|
16579
|
+
const identityResponse = await fetch(identity, {
|
|
16580
|
+
credentials: "include",
|
|
16581
|
+
headers: { accept: "application/json" }
|
|
16582
|
+
});
|
|
16583
|
+
if (!identityResponse.ok) {
|
|
16584
|
+
const error = new Error("Authentication required");
|
|
16585
|
+
error.status = identityResponse.status;
|
|
16586
|
+
throw error;
|
|
16587
|
+
}
|
|
16588
|
+
const credentials = await identityResponse.json();
|
|
16589
|
+
publishableKey = credentials.publishableKey;
|
|
16590
|
+
identityToken = credentials.identityToken;
|
|
16591
|
+
if (!identityToken)
|
|
16592
|
+
throw new Error("Invalid Coristen identity response");
|
|
16593
|
+
}
|
|
16594
|
+
if (!publishableKey?.startsWith("coristen_pk_"))
|
|
16595
|
+
throw new Error("A valid Coristen API key is required");
|
|
16560
16596
|
const response = await fetch(`${baseUrl}/api/widget-session`, {
|
|
16561
16597
|
method: "POST",
|
|
16562
16598
|
headers: { "content-type": "application/json" },
|
|
16563
16599
|
body: JSON.stringify({
|
|
16564
|
-
publishableKey
|
|
16565
|
-
identityToken
|
|
16600
|
+
publishableKey,
|
|
16601
|
+
identityToken,
|
|
16566
16602
|
previousToken
|
|
16567
16603
|
})
|
|
16568
16604
|
});
|
|
16569
|
-
if (!response.ok)
|
|
16570
|
-
|
|
16605
|
+
if (!response.ok) {
|
|
16606
|
+
const error = new Error(await response.text());
|
|
16607
|
+
error.status = response.status;
|
|
16608
|
+
throw error;
|
|
16609
|
+
}
|
|
16571
16610
|
const session = await response.json();
|
|
16572
|
-
if (!session.identity)
|
|
16611
|
+
if (identity && !session.identity)
|
|
16573
16612
|
throw new Error("Verified identity required");
|
|
16574
16613
|
return session;
|
|
16575
|
-
}, [baseUrl, identity]);
|
|
16576
|
-
|
|
16614
|
+
}, [apiKey, baseUrl, identity]);
|
|
16615
|
+
useEffect19(() => {
|
|
16577
16616
|
let active = true;
|
|
16578
16617
|
let timer;
|
|
16579
16618
|
let token = "";
|
|
@@ -16584,11 +16623,18 @@ function CoristenWidget({
|
|
|
16584
16623
|
return;
|
|
16585
16624
|
token = next.token;
|
|
16586
16625
|
setSession(next);
|
|
16626
|
+
onReadyRef.current?.();
|
|
16587
16627
|
timer = window.setTimeout(refresh, Math.max(5000, next.expiresAt - Date.now() - 30000));
|
|
16588
|
-
} catch {
|
|
16628
|
+
} catch (error) {
|
|
16589
16629
|
if (!active)
|
|
16590
16630
|
return;
|
|
16591
|
-
|
|
16631
|
+
const failure = error instanceof Error ? error : new Error("Widget failed to load");
|
|
16632
|
+
setSession((current) => current && current.expiresAt > Date.now() ? current : undefined);
|
|
16633
|
+
onErrorRef.current?.(failure);
|
|
16634
|
+
console.error("[Coristen widget] Failed to initialize", failure);
|
|
16635
|
+
const status = failure.status;
|
|
16636
|
+
if (!status || status === 429 || status >= 500)
|
|
16637
|
+
timer = window.setTimeout(refresh, 5000);
|
|
16592
16638
|
}
|
|
16593
16639
|
};
|
|
16594
16640
|
refresh();
|
|
@@ -16605,59 +16651,203 @@ function CoristenWidget({
|
|
|
16605
16651
|
});
|
|
16606
16652
|
};
|
|
16607
16653
|
}, [baseUrl, issueSession, reset]);
|
|
16608
|
-
|
|
16654
|
+
useEffect19(() => {
|
|
16609
16655
|
const resetIdentity = () => setReset((value) => value + 1);
|
|
16656
|
+
const openWidget = () => setOpen(true);
|
|
16657
|
+
const closeWidget = () => setOpen(false);
|
|
16610
16658
|
window.addEventListener("coristen:reset", resetIdentity);
|
|
16611
|
-
|
|
16659
|
+
window.addEventListener("coristen:open", openWidget);
|
|
16660
|
+
window.addEventListener("coristen:close", closeWidget);
|
|
16661
|
+
return () => {
|
|
16662
|
+
window.removeEventListener("coristen:reset", resetIdentity);
|
|
16663
|
+
window.removeEventListener("coristen:open", openWidget);
|
|
16664
|
+
window.removeEventListener("coristen:close", closeWidget);
|
|
16665
|
+
};
|
|
16666
|
+
}, []);
|
|
16667
|
+
useEffect19(() => {
|
|
16668
|
+
if (session)
|
|
16669
|
+
setRemoteSettings(session.settings);
|
|
16670
|
+
}, [session]);
|
|
16671
|
+
useEffect19(() => {
|
|
16672
|
+
if (!open)
|
|
16673
|
+
return;
|
|
16674
|
+
const close = (event) => {
|
|
16675
|
+
if (!rootRef.current?.contains(event.target))
|
|
16676
|
+
setOpen(false);
|
|
16677
|
+
};
|
|
16678
|
+
document.addEventListener("pointerdown", close);
|
|
16679
|
+
return () => document.removeEventListener("pointerdown", close);
|
|
16680
|
+
}, [open]);
|
|
16681
|
+
useEffect19(() => {
|
|
16682
|
+
if (!launcherPosition)
|
|
16683
|
+
return;
|
|
16684
|
+
const constrain = () => setLauncherPosition((current) => {
|
|
16685
|
+
if (!current)
|
|
16686
|
+
return current;
|
|
16687
|
+
const inset = window.innerWidth < 640 ? 12 : 20;
|
|
16688
|
+
return {
|
|
16689
|
+
left: Math.min(Math.max(current.left, inset), window.innerWidth - 56 - inset),
|
|
16690
|
+
top: Math.min(Math.max(current.top, inset), window.innerHeight - 56 - inset)
|
|
16691
|
+
};
|
|
16692
|
+
});
|
|
16693
|
+
window.addEventListener("resize", constrain);
|
|
16694
|
+
return () => window.removeEventListener("resize", constrain);
|
|
16695
|
+
}, [launcherPosition]);
|
|
16696
|
+
useEffect19(() => {
|
|
16697
|
+
const sync = () => {
|
|
16698
|
+
const computed = getComputedStyle(document.documentElement);
|
|
16699
|
+
setHostDark(document.documentElement.classList.contains("dark"));
|
|
16700
|
+
setHostTheme(Object.fromEntries(HOST_THEME_VARIABLES.flatMap((name) => {
|
|
16701
|
+
const value = computed.getPropertyValue(name).trim();
|
|
16702
|
+
return value ? [[name, value]] : [];
|
|
16703
|
+
})));
|
|
16704
|
+
};
|
|
16705
|
+
sync();
|
|
16706
|
+
const observer = new MutationObserver(sync);
|
|
16707
|
+
observer.observe(document.documentElement, {
|
|
16708
|
+
attributes: true,
|
|
16709
|
+
attributeFilter: ["class", "style"]
|
|
16710
|
+
});
|
|
16711
|
+
return () => observer.disconnect();
|
|
16612
16712
|
}, []);
|
|
16613
16713
|
const client = useMemo21(() => session ? new ConvexReactClient(session.convexUrl) : undefined, [session?.convexUrl]);
|
|
16614
|
-
const settings =
|
|
16615
|
-
|
|
16714
|
+
const settings = {
|
|
16715
|
+
...remoteSettings ?? session?.settings ?? DEFAULT_SETTINGS,
|
|
16716
|
+
...appearance,
|
|
16717
|
+
theme: appearance?.theme ?? (hostDark ? "dark" : "light")
|
|
16718
|
+
};
|
|
16719
|
+
if (!session || !client || settings.enabled === false)
|
|
16616
16720
|
return null;
|
|
16617
16721
|
const side = settings.position === "left" ? "left" : "right";
|
|
16722
|
+
const activeSide = launcherPosition && typeof window !== "undefined" ? launcherPosition.left + 28 < window.innerWidth / 2 ? "left" : "right" : side;
|
|
16723
|
+
const verticalSide = launcherPosition && typeof window !== "undefined" ? launcherPosition.top + 28 < window.innerHeight / 2 ? "top" : "bottom" : "bottom";
|
|
16618
16724
|
const radius = { none: 0, sm: 6, md: 10, lg: 16 }[settings.radius];
|
|
16725
|
+
const placementStyle = launcherPosition ? {
|
|
16726
|
+
left: `${launcherPosition.left}px`,
|
|
16727
|
+
top: `${launcherPosition.top}px`,
|
|
16728
|
+
right: "auto",
|
|
16729
|
+
bottom: "auto"
|
|
16730
|
+
} : side === "left" ? { left: "20px" } : { right: "20px" };
|
|
16619
16731
|
const style = {
|
|
16620
|
-
|
|
16732
|
+
...placementStyle,
|
|
16733
|
+
...hostTheme,
|
|
16621
16734
|
"--coristen-radius": `${radius}px`,
|
|
16622
16735
|
"--coristen-bubble-color": settings.bubbleColor,
|
|
16623
|
-
|
|
16736
|
+
...fontSize ? { "--coristen-font-size": fontSize } : {}
|
|
16737
|
+
};
|
|
16738
|
+
const panelStyle = launcherPosition && typeof window !== "undefined" ? (() => {
|
|
16739
|
+
const inset = window.innerWidth < 640 ? 0 : 20;
|
|
16740
|
+
const width = Math.min(expanded ? 580 : 420, window.innerWidth - inset * 2);
|
|
16741
|
+
const height = Math.min(600, window.innerHeight - inset * 2);
|
|
16742
|
+
return {
|
|
16743
|
+
position: "fixed",
|
|
16744
|
+
right: "auto",
|
|
16745
|
+
bottom: "auto",
|
|
16746
|
+
left: Math.min(Math.max(activeSide === "left" ? launcherPosition.left : launcherPosition.left + 56 - width, inset), window.innerWidth - width - inset),
|
|
16747
|
+
top: Math.min(Math.max(verticalSide === "top" ? launcherPosition.top : launcherPosition.top + 56 - height, inset), window.innerHeight - height - inset)
|
|
16748
|
+
};
|
|
16749
|
+
})() : undefined;
|
|
16750
|
+
const startLauncherDrag = (event) => {
|
|
16751
|
+
if (open || event.button !== 0)
|
|
16752
|
+
return;
|
|
16753
|
+
const bounds = event.currentTarget.getBoundingClientRect();
|
|
16754
|
+
dragRef.current = {
|
|
16755
|
+
pointerId: event.pointerId,
|
|
16756
|
+
startX: event.clientX,
|
|
16757
|
+
startY: event.clientY,
|
|
16758
|
+
left: bounds.left,
|
|
16759
|
+
top: bounds.top,
|
|
16760
|
+
moved: false
|
|
16761
|
+
};
|
|
16762
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
16763
|
+
};
|
|
16764
|
+
const moveLauncher = (event) => {
|
|
16765
|
+
const drag = dragRef.current;
|
|
16766
|
+
if (!drag || drag.pointerId !== event.pointerId)
|
|
16767
|
+
return;
|
|
16768
|
+
if (!drag.moved && Math.hypot(event.clientX - drag.startX, event.clientY - drag.startY) <= 4)
|
|
16769
|
+
return;
|
|
16770
|
+
drag.moved = true;
|
|
16771
|
+
const inset = window.innerWidth < 640 ? 12 : 20;
|
|
16772
|
+
setLauncherPosition({
|
|
16773
|
+
left: Math.min(Math.max(drag.left + event.clientX - drag.startX, inset), window.innerWidth - 56 - inset),
|
|
16774
|
+
top: Math.min(Math.max(drag.top + event.clientY - drag.startY, inset), window.innerHeight - 56 - inset)
|
|
16775
|
+
});
|
|
16776
|
+
};
|
|
16777
|
+
const endLauncherDrag = (event) => {
|
|
16778
|
+
const drag = dragRef.current;
|
|
16779
|
+
if (!drag || drag.pointerId !== event.pointerId)
|
|
16780
|
+
return;
|
|
16781
|
+
if (drag.moved) {
|
|
16782
|
+
ignoreLauncherClick.current = true;
|
|
16783
|
+
const inset = window.innerWidth < 640 ? 12 : 20;
|
|
16784
|
+
setLauncherPosition((current) => current ? {
|
|
16785
|
+
left: current.left + 28 < window.innerWidth / 2 ? inset : window.innerWidth - 56 - inset,
|
|
16786
|
+
top: current.top
|
|
16787
|
+
} : current);
|
|
16788
|
+
}
|
|
16789
|
+
dragRef.current = undefined;
|
|
16624
16790
|
};
|
|
16625
16791
|
return /* @__PURE__ */ jsxDEV19("div", {
|
|
16792
|
+
ref: rootRef,
|
|
16626
16793
|
"data-coristen-widget": "",
|
|
16627
16794
|
"data-open": open || undefined,
|
|
16628
16795
|
"data-expanded": expanded || undefined,
|
|
16796
|
+
"data-position": activeSide,
|
|
16797
|
+
"data-vertical": verticalSide,
|
|
16798
|
+
"data-show-text": settings.bubbleShowText || undefined,
|
|
16629
16799
|
className: settings.theme === "dark" ? "dark" : undefined,
|
|
16630
16800
|
style,
|
|
16631
16801
|
children: [
|
|
16632
|
-
|
|
16802
|
+
session && client && /* @__PURE__ */ jsxDEV19("div", {
|
|
16633
16803
|
className: "coristen-panel",
|
|
16634
16804
|
role: "dialog",
|
|
16635
16805
|
"aria-label": `${settings.name} chat`,
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16639
|
-
|
|
16640
|
-
|
|
16641
|
-
|
|
16642
|
-
|
|
16643
|
-
|
|
16644
|
-
|
|
16645
|
-
|
|
16806
|
+
"aria-hidden": !open,
|
|
16807
|
+
inert: !open,
|
|
16808
|
+
style: panelStyle,
|
|
16809
|
+
children: /* @__PURE__ */ jsxDEV19(WidgetErrorBoundary, {
|
|
16810
|
+
onError: (error) => onErrorRef.current?.(error),
|
|
16811
|
+
onClose: () => setOpen(false),
|
|
16812
|
+
onRetry: () => setReset((value) => value + 1),
|
|
16813
|
+
children: /* @__PURE__ */ jsxDEV19(ConvexProvider, {
|
|
16814
|
+
client,
|
|
16815
|
+
children: /* @__PURE__ */ jsxDEV19(WebsiteChat, {
|
|
16816
|
+
workspaceId: session.workspaceId,
|
|
16817
|
+
initialSettings: settings,
|
|
16818
|
+
sessionToken: session.token,
|
|
16819
|
+
expanded,
|
|
16820
|
+
onExpandedChange: setExpanded,
|
|
16821
|
+
onClose: () => setOpen(false),
|
|
16822
|
+
onSettingsChange: setRemoteSettings,
|
|
16823
|
+
theme: settings.theme,
|
|
16824
|
+
assetBaseUrl: baseUrl
|
|
16825
|
+
}, undefined, false, undefined, this)
|
|
16646
16826
|
}, undefined, false, undefined, this)
|
|
16647
|
-
},
|
|
16827
|
+
}, reset, false, undefined, this)
|
|
16648
16828
|
}, undefined, false, undefined, this),
|
|
16649
16829
|
/* @__PURE__ */ jsxDEV19("button", {
|
|
16650
16830
|
type: "button",
|
|
16651
16831
|
className: "coristen-launcher",
|
|
16652
16832
|
"aria-label": open ? "Close chat" : "Open chat",
|
|
16653
16833
|
"aria-expanded": open,
|
|
16654
|
-
|
|
16834
|
+
"aria-busy": !session,
|
|
16835
|
+
onPointerDown: startLauncherDrag,
|
|
16836
|
+
onPointerMove: moveLauncher,
|
|
16837
|
+
onPointerUp: endLauncherDrag,
|
|
16838
|
+
onPointerCancel: endLauncherDrag,
|
|
16839
|
+
onClick: () => {
|
|
16840
|
+
if (ignoreLauncherClick.current) {
|
|
16841
|
+
ignoreLauncherClick.current = false;
|
|
16842
|
+
return;
|
|
16843
|
+
}
|
|
16844
|
+
setOpen((current) => !current);
|
|
16845
|
+
},
|
|
16655
16846
|
children: [
|
|
16656
|
-
|
|
16657
|
-
src: `${baseUrl}/widget-icons/${settings.bubbleIcon}.svg`,
|
|
16658
|
-
alt: ""
|
|
16659
|
-
|
|
16660
|
-
"aria-hidden": "true"
|
|
16847
|
+
/* @__PURE__ */ jsxDEV19("img", {
|
|
16848
|
+
src: `${baseUrl}/widget-icons/${settings.bubbleIcon || "chat-text"}.svg`,
|
|
16849
|
+
alt: "",
|
|
16850
|
+
draggable: false
|
|
16661
16851
|
}, undefined, false, undefined, this),
|
|
16662
16852
|
settings.bubbleShowText && /* @__PURE__ */ jsxDEV19("span", {
|
|
16663
16853
|
children: settings.bubbleText
|
|
@@ -16668,6 +16858,14 @@ function CoristenWidget({
|
|
|
16668
16858
|
}, undefined, true, undefined, this);
|
|
16669
16859
|
}
|
|
16670
16860
|
var coristenWidget = {
|
|
16861
|
+
open() {
|
|
16862
|
+
if (typeof window !== "undefined")
|
|
16863
|
+
window.dispatchEvent(new Event("coristen:open"));
|
|
16864
|
+
},
|
|
16865
|
+
close() {
|
|
16866
|
+
if (typeof window !== "undefined")
|
|
16867
|
+
window.dispatchEvent(new Event("coristen:close"));
|
|
16868
|
+
},
|
|
16671
16869
|
reset() {
|
|
16672
16870
|
if (typeof window !== "undefined")
|
|
16673
16871
|
window.dispatchEvent(new Event("coristen:reset"));
|