@eloquentai/chat-sdk 0.36.0-dev.1 → 0.36.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/hooks/use-chat.d.ts +4 -0
- package/dist/components/chat/hooks/use-message-events.d.ts +3 -1
- package/dist/components/chat/hooks/use-new-message-sound.d.ts +17 -0
- package/dist/components/chat-interface/types.d.ts +3 -0
- package/dist/index.mjs +1540 -1419
- package/dist/index.mjs.map +1 -1
- package/dist/lib/eloquent-ai-api-client.d.ts +2 -0
- package/dist/lib/notification-sound.d.ts +6 -0
- package/dist/{skeleton-BGsnxX4m.js → skeleton-CNz9cQ6u.js} +1457 -1412
- package/dist/skeleton-CNz9cQ6u.js.map +1 -0
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/skeleton-BGsnxX4m.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { L as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { useState as _, useEffect as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import
|
|
2
|
+
import { L as Tt, c as Qe, u as Mt, g as at, X as Pt, i as At, A as Ot, d as V, e as De, f as Ut, h as jt, r as Dt, t as $t, j as Bt, N as et, k as Oe, l as Lt, H as Nt, w as it, m as Zt, s as Kt, n as Vt, o as Ht, E as Wt, p as Ft, S as Jt, C as Gt, T as Yt } from "./skeleton-CNz9cQ6u.js";
|
|
3
|
+
import { jsx as x, jsxs as ze, Fragment as st } from "react/jsx-runtime";
|
|
4
|
+
import { useState as _, useEffect as Z, useMemo as Je, useCallback as w, useRef as N } from "react";
|
|
5
|
+
import { createPortal as Ge } from "react-dom";
|
|
6
|
+
import Xt from "react-dom/client";
|
|
7
7
|
try {
|
|
8
|
-
let
|
|
9
|
-
|
|
8
|
+
let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
|
|
9
|
+
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "b2a12f8f-024a-4e80-8da3-3c6de79a0de4", e._sentryDebugIdIdentifier = "sentry-dbid-b2a12f8f-024a-4e80-8da3-3c6de79a0de4");
|
|
10
10
|
} catch {
|
|
11
11
|
}
|
|
12
12
|
if (typeof window < "u") {
|
|
13
|
-
const
|
|
14
|
-
import("./index-hFbiYJI3.js").then(({ init:
|
|
15
|
-
|
|
13
|
+
const e = "development";
|
|
14
|
+
import("./index-hFbiYJI3.js").then(({ init: t }) => {
|
|
15
|
+
t({
|
|
16
16
|
dsn: void 0,
|
|
17
|
-
environment:
|
|
17
|
+
environment: e,
|
|
18
18
|
sendDefaultPii: !1,
|
|
19
19
|
debug: !1,
|
|
20
20
|
enabled: !0,
|
|
@@ -33,69 +33,69 @@ if (typeof window < "u") {
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
const Le = '/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--eloq-aura-angle:0deg}}}@layer theme{:root,:host{--eloq-font-sans:system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--eloq-font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--eloq-color-red-50:oklch(97.1% .013 17.38);--eloq-color-red-200:oklch(88.5% .062 18.334);--eloq-color-red-400:oklch(70.4% .191 22.216);--eloq-color-red-500:oklch(63.7% .237 25.331);--eloq-color-red-800:oklch(44.4% .177 26.899);--eloq-color-amber-50:oklch(98.7% .022 95.277);--eloq-color-amber-200:oklch(92.4% .12 95.746);--eloq-color-amber-400:oklch(82.8% .189 84.429);--eloq-color-amber-500:oklch(76.9% .188 70.08);--eloq-color-amber-800:oklch(47.3% .137 46.201);--eloq-color-yellow-400:oklch(85.2% .199 91.936);--eloq-color-green-50:oklch(98.2% .018 155.826);--eloq-color-green-200:oklch(92.5% .084 155.995);--eloq-color-green-400:oklch(79.2% .209 151.711);--eloq-color-green-500:oklch(72.3% .219 149.579);--eloq-color-green-800:oklch(44.8% .119 151.328);--eloq-color-blue-50:oklch(97% .014 254.604);--eloq-color-blue-200:oklch(88.2% .059 254.128);--eloq-color-blue-400:oklch(70.7% .165 254.624);--eloq-color-blue-500:oklch(62.3% .214 259.815);--eloq-color-blue-800:oklch(42.4% .199 265.638);--eloq-color-gray-200:oklch(92.8% .006 264.531);--eloq-color-gray-300:oklch(87.2% .01 258.338);--eloq-color-gray-400:oklch(70.7% .022 261.325);--eloq-color-gray-500:oklch(55.1% .027 264.364);--eloq-color-gray-600:oklch(44.6% .03 256.802);--eloq-color-black:#000;--eloq-color-white:#fff;--eloq-spacing:.25rem;--eloq-container-xs:20rem;--eloq-text-xs:.75rem;--eloq-text-xs--line-height:calc(1 / .75);--eloq-text-sm:.875rem;--eloq-text-sm--line-height:calc(1.25 / .875);--eloq-text-base:1rem;--eloq-text-base--line-height: 1.5 ;--eloq-text-2xl:1.5rem;--eloq-text-2xl--line-height:calc(2 / 1.5);--eloq-font-weight-medium:500;--eloq-font-weight-semibold:600;--eloq-tracking-tight:-.025em;--eloq-leading-relaxed:1.625;--eloq-radius-md:calc(var(--radius) - 2px);--eloq-radius-lg:var(--radius);--eloq-radius-xl:.75rem;--eloq-radius-2xl:1rem;--eloq-radius-3xl:1.5rem;--eloq-drop-shadow-lg:0 4px 4px #00000026;--eloq-drop-shadow-xl:0 9px 7px #0000001a;--eloq-ease-out:cubic-bezier(0, 0, .2, 1);--eloq-animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--eloq-default-transition-duration:.15s;--eloq-default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--eloq-default-font-family:var(--eloq-font-sans);--eloq-default-mono-font-family:var(--eloq-font-mono);--eloq-animate-panel-in:panel-in .35s cubic-bezier(.16, 1, .3, 1) both;--eloq-animate-panel-out:panel-out .25s cubic-bezier(.4, 0, 1, 1) both;--eloq-animate-thinking-dot:thinking-dot 1.2s ease-in-out infinite;--eloq-animate-thinking-shimmer:thinking-shimmer 1.8s linear infinite;--eloq-animate-regenerating:regenerating-sweep 1.2s linear infinite;--eloq-animate-text-in:text-in .35s ease-out both;--eloq-animate-message-in:message-in .3s ease-out both;--eloq-animate-slide-up-in:slide-up-in .3s ease-out both}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--eloq-default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--eloq-default-font-feature-settings,normal);font-variation-settings:var(--eloq-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--eloq-default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--eloq-default-mono-font-feature-settings,normal);font-variation-settings:var(--eloq-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--background:0 0% 100%;--foreground:0 0% 3.9%;--card:0 0% 100%;--card-foreground:0 0% 3.9%;--popover:0 0% 100%;--popover-foreground:0 0% 3.9%;--primary:267 56% 46%;--primary-foreground:0 0% 98%;--secondary:0 0% 96.1%;--secondary-foreground:0 0% 9%;--muted:0 0% 96.1%;--muted-foreground:0 0% 45.1%;--accent:0 0% 96.1%;--accent-foreground:0 0% 9%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:0 0% 89.8%;--input:0 0% 89.8%;--ring:0 0% 3.9%;--cream:37.5 44% 96.5%;--chart-1:12 76% 61%;--chart-2:173 58% 39%;--chart-3:197 37% 24%;--chart-4:43 74% 66%;--chart-5:27 87% 67%;--radius:.5rem}.dark{--background:262 50% 10%;--foreground:262 5% 90%;--card:262 50% 10%;--card-foreground:262 5% 90%;--popover:262 50% 5%;--popover-foreground:262 5% 90%;--primary:262 62% 70%;--primary-foreground:0 0% 100%;--primary-dark:262 62% 60%;--secondary:262 30% 30%;--secondary-foreground:0 0% 100%;--secondary-dark:262 30% 20%;--secondary-light:262 30% 40%;--tertiary:267 56% 46%;--tertiary-foreground:0 0% 100%;--tertiary-dark:267 38% 25%;--tertiary-light:263 100% 85%;--muted:224 30% 25%;--muted-foreground:262 5% 90%;--accent:224 30% 25%;--accent-foreground:262 5% 100%;--accent-dark:224 30% 15%;--destructive:0 100% 30%;--destructive-foreground:262 5% 90%;--border:0 0% 30%;--input:262 30% 25%;--ring:262 62% 71%;--cream:257 28% 20%;--radius:.5rem;--sidebar-background:var(--background);--sidebar-foreground:var(--foreground);--sidebar-primary:var(--primary);--sidebar-primary-foreground:var(--primary-foreground);--sidebar-accent:var(--accent);--sidebar-accent-foreground:var(--accent-foreground);--sidebar-border:var(--border);--sidebar-ring:var(--ring)}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}}@layer components;@layer utilities{.eloq\\:pointer-events-none{pointer-events:none}.eloq\\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.eloq\\:absolute{position:absolute}.eloq\\:relative{position:relative}.eloq\\:inset-0{inset:0}.eloq\\:inset-x-0{inset-inline:0}.eloq\\:top-0{top:0}.eloq\\:top-0\\.5{top:calc(var(--eloq-spacing) * .5)}.eloq\\:-right-\\[9px\\]{right:-9px}.eloq\\:right-0\\.5{right:calc(var(--eloq-spacing) * .5)}.eloq\\:right-2{right:calc(var(--eloq-spacing) * 2)}.eloq\\:right-16{right:calc(var(--eloq-spacing) * 16)}.eloq\\:bottom-0{bottom:0}.eloq\\:bottom-1{bottom:var(--eloq-spacing)}.eloq\\:bottom-2{bottom:calc(var(--eloq-spacing) * 2)}.eloq\\:bottom-10{bottom:calc(var(--eloq-spacing) * 10)}.eloq\\:left-0{left:0}.eloq\\:left-2{left:calc(var(--eloq-spacing) * 2)}.eloq\\:left-\\[calc\\(50\\%-0\\.75rem\\)\\]{left:calc(50% - .75rem)}.eloq\\:z-10{z-index:10}.eloq\\:z-20{z-index:20}.eloq\\:z-30{z-index:30}.eloq\\:m-0{margin:0}.eloq\\:m-auto{margin:auto}.eloq\\:mx-1{margin-inline:var(--eloq-spacing)}.eloq\\:mx-auto{margin-inline:auto}.eloq\\:my-2{margin-block:calc(var(--eloq-spacing) * 2)}.eloq\\:my-4{margin-block:calc(var(--eloq-spacing) * 4)}.eloq\\:-mt-2{margin-top:calc(var(--eloq-spacing) * -2)}.eloq\\:-mt-6{margin-top:calc(var(--eloq-spacing) * -6)}.eloq\\:-mt-20{margin-top:calc(var(--eloq-spacing) * -20)}.eloq\\:mt-1{margin-top:var(--eloq-spacing)}.eloq\\:mt-2{margin-top:calc(var(--eloq-spacing) * 2)}.eloq\\:mt-10{margin-top:calc(var(--eloq-spacing) * 10)}.eloq\\:mr-1{margin-right:var(--eloq-spacing)}.eloq\\:mr-\\[2px\\]{margin-right:2px}.eloq\\:mb-1{margin-bottom:var(--eloq-spacing)}.eloq\\:mb-3{margin-bottom:calc(var(--eloq-spacing) * 3)}.eloq\\:mb-4{margin-bottom:calc(var(--eloq-spacing) * 4)}.eloq\\:mb-10{margin-bottom:calc(var(--eloq-spacing) * 10)}.eloq\\:ml-0{margin-left:0}.eloq\\:ml-1{margin-left:var(--eloq-spacing)}.eloq\\:ml-5{margin-left:calc(var(--eloq-spacing) * 5)}.eloq\\:box-content{box-sizing:content-box}.eloq\\:block{display:block}.eloq\\:flex{display:flex}.eloq\\:hidden{display:none}.eloq\\:inline-flex{display:inline-flex}.eloq\\:aspect-square{aspect-ratio:1}.eloq\\:h-1{height:var(--eloq-spacing)}.eloq\\:h-2\\.5{height:calc(var(--eloq-spacing) * 2.5)}.eloq\\:h-3{height:calc(var(--eloq-spacing) * 3)}.eloq\\:h-4{height:calc(var(--eloq-spacing) * 4)}.eloq\\:h-5{height:calc(var(--eloq-spacing) * 5)}.eloq\\:h-6{height:calc(var(--eloq-spacing) * 6)}.eloq\\:h-8{height:calc(var(--eloq-spacing) * 8)}.eloq\\:h-10{height:calc(var(--eloq-spacing) * 10)}.eloq\\:h-12{height:calc(var(--eloq-spacing) * 12)}.eloq\\:h-14{height:calc(var(--eloq-spacing) * 14)}.eloq\\:h-16{height:calc(var(--eloq-spacing) * 16)}.eloq\\:h-\\[0\\.42em\\]{height:.42em}.eloq\\:h-\\[160px\\]{height:160px}.eloq\\:h-\\[220px\\]{height:220px}.eloq\\:h-\\[560px\\]{height:560px}.eloq\\:h-\\[600px\\]{height:600px}.eloq\\:h-full{height:100%}.eloq\\:max-h-\\[132px\\]{max-height:132px}.eloq\\:min-h-\\[48px\\]{min-height:48px}.eloq\\:min-h-\\[80px\\]{min-height:80px}.eloq\\:w-2\\.5{width:calc(var(--eloq-spacing) * 2.5)}.eloq\\:w-2\\/3{width:66.6667%}.eloq\\:w-3{width:calc(var(--eloq-spacing) * 3)}.eloq\\:w-4{width:calc(var(--eloq-spacing) * 4)}.eloq\\:w-5{width:calc(var(--eloq-spacing) * 5)}.eloq\\:w-6{width:calc(var(--eloq-spacing) * 6)}.eloq\\:w-8{width:calc(var(--eloq-spacing) * 8)}.eloq\\:w-10{width:calc(var(--eloq-spacing) * 10)}.eloq\\:w-12{width:calc(var(--eloq-spacing) * 12)}.eloq\\:w-14{width:calc(var(--eloq-spacing) * 14)}.eloq\\:w-16{width:calc(var(--eloq-spacing) * 16)}.eloq\\:w-24{width:calc(var(--eloq-spacing) * 24)}.eloq\\:w-32{width:calc(var(--eloq-spacing) * 32)}.eloq\\:w-48{width:calc(var(--eloq-spacing) * 48)}.eloq\\:w-\\[0\\.42em\\]{width:.42em}.eloq\\:w-\\[70\\%\\]{width:70%}.eloq\\:w-\\[320px\\]{width:320px}.eloq\\:w-\\[340px\\]{width:340px}.eloq\\:w-\\[348px\\]{width:348px}.eloq\\:w-\\[380px\\]{width:380px}.eloq\\:w-\\[420px\\]{width:420px}.eloq\\:w-full{width:100%}.eloq\\:max-w-\\[75\\%\\]{max-width:75%}.eloq\\:max-w-\\[88\\%\\]{max-width:88%}.eloq\\:max-w-full{max-width:100%}.eloq\\:max-w-xs{max-width:var(--eloq-container-xs)}.eloq\\:min-w-0{min-width:0}.eloq\\:min-w-min{min-width:min-content}.eloq\\:flex-1{flex:1}.eloq\\:flex-none{flex:none}.eloq\\:flex-shrink-0,.eloq\\:shrink-0{flex-shrink:0}.eloq\\:flex-grow{flex-grow:1}.eloq\\:origin-bottom-right{transform-origin:100% 100%}.eloq\\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.eloq\\:translate-x-8{--tw-translate-x:calc(var(--eloq-spacing) * 8);translate:var(--tw-translate-x) var(--tw-translate-y)}.eloq\\:scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.eloq\\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.eloq\\:-scale-x-100{--tw-scale-x: -100% ;scale:var(--tw-scale-x) var(--tw-scale-y)}.eloq\\:scale-\\[0\\.05\\]{scale:.05}.eloq\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.eloq\\:animate-message-in{animation:var(--eloq-animate-message-in)}.eloq\\:animate-panel-in{animation:var(--eloq-animate-panel-in)}.eloq\\:animate-panel-out{animation:var(--eloq-animate-panel-out)}.eloq\\:animate-pulse{animation:var(--eloq-animate-pulse)}.eloq\\:animate-regenerating{animation:var(--eloq-animate-regenerating)}.eloq\\:animate-slide-up-in{animation:var(--eloq-animate-slide-up-in)}.eloq\\:animate-text-in{animation:var(--eloq-animate-text-in)}.eloq\\:animate-thinking-dot{animation:var(--eloq-animate-thinking-dot)}.eloq\\:animate-thinking-shimmer{animation:var(--eloq-animate-thinking-shimmer)}.eloq\\:cursor-default{cursor:default}.eloq\\:cursor-grab{cursor:grab}.eloq\\:cursor-pointer{cursor:pointer}.eloq\\:touch-none{touch-action:none}.eloq\\:resize-none{resize:none}.eloq\\:list-decimal{list-style-type:decimal}.eloq\\:list-disc{list-style-type:disc}.eloq\\:flex-col{flex-direction:column}.eloq\\:flex-row{flex-direction:row}.eloq\\:flex-wrap{flex-wrap:wrap}.eloq\\:items-center{align-items:center}.eloq\\:items-end{align-items:flex-end}.eloq\\:items-start{align-items:flex-start}.eloq\\:justify-between{justify-content:space-between}.eloq\\:justify-center{justify-content:center}.eloq\\:justify-end{justify-content:flex-end}.eloq\\:justify-start{justify-content:flex-start}.eloq\\:gap-1{gap:var(--eloq-spacing)}.eloq\\:gap-1\\.5{gap:calc(var(--eloq-spacing) * 1.5)}.eloq\\:gap-2{gap:calc(var(--eloq-spacing) * 2)}.eloq\\:gap-3{gap:calc(var(--eloq-spacing) * 3)}.eloq\\:gap-\\[0\\.25em\\]{gap:.25em}:where(.eloq\\:space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block:0}:where(.eloq\\:space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--eloq-spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--eloq-spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--eloq-spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--eloq-spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--eloq-spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--eloq-spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--eloq-spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--eloq-spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--eloq-spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--eloq-spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(var(--eloq-spacing) * var(--tw-space-x-reverse));margin-inline-end:calc(var(--eloq-spacing) * calc(1 - var(--tw-space-x-reverse)))}:where(.eloq\\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--eloq-spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--eloq-spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.eloq\\:space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--eloq-spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--eloq-spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}.eloq\\:self-end{align-self:flex-end}.eloq\\:self-stretch{align-self:stretch}.eloq\\:overflow-hidden{overflow:hidden}.eloq\\:overflow-x-auto{overflow-x:auto}.eloq\\:rounded-2xl{border-radius:var(--eloq-radius-2xl)}.eloq\\:rounded-3xl{border-radius:var(--eloq-radius-3xl)}.eloq\\:rounded-\\[inherit\\]{border-radius:inherit}.eloq\\:rounded-full{border-radius:3.40282e38px}.eloq\\:rounded-lg{border-radius:var(--eloq-radius-lg)}.eloq\\:rounded-md{border-radius:var(--eloq-radius-md)}.eloq\\:rounded-none{border-radius:0}.eloq\\:rounded-xl{border-radius:var(--eloq-radius-xl)}.eloq\\:rounded-t-2xl{border-top-left-radius:var(--eloq-radius-2xl);border-top-right-radius:var(--eloq-radius-2xl)}.eloq\\:border{border-style:var(--tw-border-style);border-width:1px}.eloq\\:border-0{border-style:var(--tw-border-style);border-width:0}.eloq\\:border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.eloq\\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.eloq\\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.eloq\\:border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.eloq\\:border-dashed{--tw-border-style:dashed;border-style:dashed}.eloq\\:border-amber-400{border-color:var(--eloq-color-amber-400)}.eloq\\:border-blue-500{border-color:var(--eloq-color-blue-500)}.eloq\\:border-border{border-color:hsl(var(--border))}.eloq\\:border-green-500{border-color:var(--eloq-color-green-500)}.eloq\\:border-input{border-color:hsl(var(--input))}.eloq\\:border-red-500{border-color:var(--eloq-color-red-500)}.eloq\\:border-t-transparent{border-top-color:#0000}.eloq\\:border-l-transparent{border-left-color:#0000}.eloq\\:bg-\\[\\#0a0a0a\\]{background-color:#0a0a0a}.eloq\\:bg-\\[\\#000\\]{background-color:#000}.eloq\\:bg-\\[\\#fff\\]{background-color:#fff}.eloq\\:bg-amber-50{background-color:var(--eloq-color-amber-50)}.eloq\\:bg-background{background-color:hsl(var(--background))}.eloq\\:bg-black\\/20{background-color:var(--eloq-color-black)}@supports (color:color-mix(in lab,red,red)){.eloq\\:bg-black\\/20{background-color:color-mix(in oklab,var(--eloq-color-black) 20%,transparent)}}.eloq\\:bg-black\\/60{background-color:var(--eloq-color-black)}@supports (color:color-mix(in lab,red,red)){.eloq\\:bg-black\\/60{background-color:color-mix(in oklab,var(--eloq-color-black) 60%,transparent)}}.eloq\\:bg-blue-50{background-color:var(--eloq-color-blue-50)}.eloq\\:bg-border{background-color:hsl(var(--border))}.eloq\\:bg-card{background-color:hsl(var(--card))}.eloq\\:bg-cream{background-color:hsl(var(--cream))}.eloq\\:bg-gray-400{background-color:var(--eloq-color-gray-400)}.eloq\\:bg-green-50{background-color:var(--eloq-color-green-50)}.eloq\\:bg-muted{background-color:hsl(var(--muted))}.eloq\\:bg-muted-foreground{background-color:hsl(var(--muted-foreground))}.eloq\\:bg-primary{background-color:hsl(var(--primary))}.eloq\\:bg-red-50{background-color:var(--eloq-color-red-50)}.eloq\\:bg-white,.eloq\\:bg-white\\/20{background-color:var(--eloq-color-white)}@supports (color:color-mix(in lab,red,red)){.eloq\\:bg-white\\/20{background-color:color-mix(in oklab,var(--eloq-color-white) 20%,transparent)}}.eloq\\:fill-none{fill:none}.eloq\\:fill-yellow-400{fill:var(--eloq-color-yellow-400)}.eloq\\:object-contain{object-fit:contain}.eloq\\:object-cover{object-fit:cover}.eloq\\:p-0{padding:0}.eloq\\:p-0\\.5{padding:calc(var(--eloq-spacing) * .5)}.eloq\\:p-1{padding:var(--eloq-spacing)}.eloq\\:p-1\\.5{padding:calc(var(--eloq-spacing) * 1.5)}.eloq\\:p-2{padding:calc(var(--eloq-spacing) * 2)}.eloq\\:p-3{padding:calc(var(--eloq-spacing) * 3)}.eloq\\:p-4{padding:calc(var(--eloq-spacing) * 4)}.eloq\\:p-6{padding:calc(var(--eloq-spacing) * 6)}.eloq\\:p-\\[1px\\]{padding:1px}.eloq\\:px-0{padding-inline:0}.eloq\\:px-2{padding-inline:calc(var(--eloq-spacing) * 2)}.eloq\\:px-3{padding-inline:calc(var(--eloq-spacing) * 3)}.eloq\\:px-4{padding-inline:calc(var(--eloq-spacing) * 4)}.eloq\\:px-5{padding-inline:calc(var(--eloq-spacing) * 5)}.eloq\\:px-\\[12px\\]{padding-inline:12px}.eloq\\:px-\\[16px\\]{padding-inline:16px}.eloq\\:py-1{padding-block:var(--eloq-spacing)}.eloq\\:py-1\\.5{padding-block:calc(var(--eloq-spacing) * 1.5)}.eloq\\:py-2{padding-block:calc(var(--eloq-spacing) * 2)}.eloq\\:py-3{padding-block:calc(var(--eloq-spacing) * 3)}.eloq\\:py-3\\.5{padding-block:calc(var(--eloq-spacing) * 3.5)}.eloq\\:py-\\[8px\\]{padding-block:8px}.eloq\\:py-\\[12px\\]{padding-block:12px}.eloq\\:pt-0{padding-top:0}.eloq\\:pt-2{padding-top:calc(var(--eloq-spacing) * 2)}.eloq\\:pt-4{padding-top:calc(var(--eloq-spacing) * 4)}.eloq\\:pt-5{padding-top:calc(var(--eloq-spacing) * 5)}.eloq\\:pt-6{padding-top:calc(var(--eloq-spacing) * 6)}.eloq\\:pt-10{padding-top:calc(var(--eloq-spacing) * 10)}.eloq\\:pt-24{padding-top:calc(var(--eloq-spacing) * 24)}.eloq\\:pr-2{padding-right:calc(var(--eloq-spacing) * 2)}.eloq\\:pr-4{padding-right:calc(var(--eloq-spacing) * 4)}.eloq\\:pr-12{padding-right:calc(var(--eloq-spacing) * 12)}.eloq\\:pb-2{padding-bottom:calc(var(--eloq-spacing) * 2)}.eloq\\:pb-4{padding-bottom:calc(var(--eloq-spacing) * 4)}.eloq\\:pb-10{padding-bottom:calc(var(--eloq-spacing) * 10)}.eloq\\:pb-14{padding-bottom:calc(var(--eloq-spacing) * 14)}.eloq\\:pl-3{padding-left:calc(var(--eloq-spacing) * 3)}.eloq\\:pl-4{padding-left:calc(var(--eloq-spacing) * 4)}.eloq\\:pl-11{padding-left:calc(var(--eloq-spacing) * 11)}.eloq\\:text-center{text-align:center}.eloq\\:text-left{text-align:left}.eloq\\:text-2xl{font-size:var(--eloq-text-2xl);line-height:var(--tw-leading,var(--eloq-text-2xl--line-height))}.eloq\\:text-base{font-size:var(--eloq-text-base);line-height:var(--tw-leading,var(--eloq-text-base--line-height))}.eloq\\:text-sm{font-size:var(--eloq-text-sm);line-height:var(--tw-leading,var(--eloq-text-sm--line-height))}.eloq\\:text-xs{font-size:var(--eloq-text-xs);line-height:var(--tw-leading,var(--eloq-text-xs--line-height))}.eloq\\:text-\\[10px\\]{font-size:10px}.eloq\\:leading-5{--tw-leading:calc(var(--eloq-spacing) * 5);line-height:calc(var(--eloq-spacing) * 5)}.eloq\\:leading-none{--tw-leading:1;line-height:1}.eloq\\:leading-relaxed{--tw-leading:var(--eloq-leading-relaxed);line-height:var(--eloq-leading-relaxed)}.eloq\\:font-medium{--tw-font-weight:var(--eloq-font-weight-medium);font-weight:var(--eloq-font-weight-medium)}.eloq\\:font-semibold{--tw-font-weight:var(--eloq-font-weight-semibold);font-weight:var(--eloq-font-weight-semibold)}.eloq\\:tracking-tight{--tw-tracking:var(--eloq-tracking-tight);letter-spacing:var(--eloq-tracking-tight)}.eloq\\:whitespace-nowrap{white-space:nowrap}.eloq\\:text-\\[\\#000\\]{color:#000}.eloq\\:text-\\[\\#fff\\]{color:#fff}.eloq\\:text-amber-500{color:var(--eloq-color-amber-500)}.eloq\\:text-amber-800{color:var(--eloq-color-amber-800)}.eloq\\:text-blue-500{color:var(--eloq-color-blue-500)}.eloq\\:text-blue-800{color:var(--eloq-color-blue-800)}.eloq\\:text-card-foreground{color:hsl(var(--card-foreground))}.eloq\\:text-destructive{color:hsl(var(--destructive))}.eloq\\:text-foreground{color:hsl(var(--foreground))}.eloq\\:text-gray-300{color:var(--eloq-color-gray-300)}.eloq\\:text-gray-400{color:var(--eloq-color-gray-400)}.eloq\\:text-gray-500{color:var(--eloq-color-gray-500)}.eloq\\:text-green-500{color:var(--eloq-color-green-500)}.eloq\\:text-green-800{color:var(--eloq-color-green-800)}.eloq\\:text-muted{color:hsl(var(--muted))}.eloq\\:text-muted-foreground{color:hsl(var(--muted-foreground))}.eloq\\:text-primary{color:hsl(var(--primary))}.eloq\\:text-primary-foreground{color:hsl(var(--primary-foreground))}.eloq\\:text-red-500{color:var(--eloq-color-red-500)}.eloq\\:text-red-800{color:var(--eloq-color-red-800)}.eloq\\:text-white{color:var(--eloq-color-white)}.eloq\\:text-yellow-400{color:var(--eloq-color-yellow-400)}.eloq\\:italic{font-style:italic}.eloq\\:underline{text-decoration-line:underline}.eloq\\:opacity-0{opacity:0}.eloq\\:opacity-50{opacity:.5}.eloq\\:opacity-70{opacity:.7}.eloq\\:opacity-75{opacity:.75}.eloq\\:opacity-100{opacity:1}.eloq\\:shadow-\\[0_-8px_24px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow:0 -8px 24px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:shadow-\\[0_0_4px_0_rgba\\(0\\,0\\,0\\,0\\.20\\)\\]{--tw-shadow:0 0 4px 0 var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:shadow-\\[0_3px_4px_-2px_rgba\\(0\\,0\\,0\\,0\\.04\\)\\]{--tw-shadow:0 3px 4px -2px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.eloq\\:outline-2{outline-style:var(--tw-outline-style);outline-width:2px}.eloq\\:outline-offset-2{outline-offset:2px}.eloq\\:outline-transparent{outline-color:#0000}.eloq\\:drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--eloq-drop-shadow-lg));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.eloq\\:transition-\\[outline-color\\]{transition-property:outline-color;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:duration-150{--tw-duration:.15s;transition-duration:.15s}.eloq\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.eloq\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.eloq\\:duration-500{--tw-duration:.5s;transition-duration:.5s}.eloq\\:ease-out{--tw-ease:var(--eloq-ease-out);transition-timing-function:var(--eloq-ease-out)}.eloq\\:select-none{-webkit-user-select:none;user-select:none}.eloq\\:placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.eloq\\:last\\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.eloq\\:hover\\:bg-black\\/5:hover{background-color:var(--eloq-color-black)}@supports (color:color-mix(in lab,red,red)){.eloq\\:hover\\:bg-black\\/5:hover{background-color:color-mix(in oklab,var(--eloq-color-black) 5%,transparent)}}.eloq\\:hover\\:bg-black\\/80:hover{background-color:var(--eloq-color-black)}@supports (color:color-mix(in lab,red,red)){.eloq\\:hover\\:bg-black\\/80:hover{background-color:color-mix(in oklab,var(--eloq-color-black) 80%,transparent)}}.eloq\\:hover\\:bg-muted:hover{background-color:hsl(var(--muted))}.eloq\\:hover\\:text-foreground:hover{color:hsl(var(--foreground))}.eloq\\:hover\\:text-gray-600:hover{color:var(--eloq-color-gray-600)}.eloq\\:hover\\:text-primary:hover{color:hsl(var(--primary))}.eloq\\:hover\\:opacity-80:hover{opacity:.8}.eloq\\:hover\\:opacity-90:hover{opacity:.9}.eloq\\:hover\\:opacity-100:hover{opacity:1}.eloq\\:hover\\:drop-shadow-xl:hover{--tw-drop-shadow-size:drop-shadow(0 9px 7px var(--tw-drop-shadow-color,#0000001a));--tw-drop-shadow:drop-shadow(var(--eloq-drop-shadow-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.eloq\\:focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:focus-visible\\:ring-muted:focus-visible{--tw-ring-color:hsl(var(--muted))}.eloq\\:focus-visible\\:ring-primary:focus-visible{--tw-ring-color:hsl(var(--primary))}.eloq\\:focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.eloq\\:focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.eloq\\:active\\:cursor-grabbing:active{cursor:grabbing}.eloq\\:disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.eloq\\:disabled\\:opacity-50:disabled{opacity:.5}@media(prefers-reduced-motion:reduce){.eloq\\:motion-reduce\\:animate-none{animation:none}.eloq\\:motion-reduce\\:opacity-70{opacity:.7}}@media(min-width:40rem){.eloq\\:sm\\:text-sm{font-size:var(--eloq-text-sm);line-height:var(--tw-leading,var(--eloq-text-sm--line-height))}}@media(min-width:48rem){.eloq\\:md\\:text-sm{font-size:var(--eloq-text-sm);line-height:var(--tw-leading,var(--eloq-text-sm--line-height))}}.eloq\\:dark\\:border:is(.dark *){border-style:var(--tw-border-style);border-width:1px}.eloq\\:dark\\:border-b:is(.dark *){border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.eloq\\:dark\\:border-border:is(.dark *){border-color:hsl(var(--border))}.eloq\\:dark\\:bg-amber-400\\/10:is(.dark *){background-color:var(--eloq-color-amber-400)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:bg-amber-400\\/10:is(.dark *){background-color:color-mix(in oklab,var(--eloq-color-amber-400) 10%,transparent)}}.eloq\\:dark\\:bg-blue-500\\/10:is(.dark *){background-color:var(--eloq-color-blue-500)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:bg-blue-500\\/10:is(.dark *){background-color:color-mix(in oklab,var(--eloq-color-blue-500) 10%,transparent)}}.eloq\\:dark\\:bg-card:is(.dark *){background-color:hsl(var(--card))}.eloq\\:dark\\:bg-gray-200:is(.dark *){background-color:var(--eloq-color-gray-200)}.eloq\\:dark\\:bg-green-500\\/10:is(.dark *){background-color:var(--eloq-color-green-500)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:bg-green-500\\/10:is(.dark *){background-color:color-mix(in oklab,var(--eloq-color-green-500) 10%,transparent)}}.eloq\\:dark\\:bg-muted:is(.dark *){background-color:hsl(var(--muted))}.eloq\\:dark\\:bg-red-500\\/10:is(.dark *){background-color:var(--eloq-color-red-500)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:bg-red-500\\/10:is(.dark *){background-color:color-mix(in oklab,var(--eloq-color-red-500) 10%,transparent)}}.eloq\\:dark\\:text-amber-200:is(.dark *){color:var(--eloq-color-amber-200)}.eloq\\:dark\\:text-amber-400:is(.dark *){color:var(--eloq-color-amber-400)}.eloq\\:dark\\:text-blue-200:is(.dark *){color:var(--eloq-color-blue-200)}.eloq\\:dark\\:text-blue-400:is(.dark *){color:var(--eloq-color-blue-400)}.eloq\\:dark\\:text-gray-500:is(.dark *){color:var(--eloq-color-gray-500)}.eloq\\:dark\\:text-green-200:is(.dark *){color:var(--eloq-color-green-200)}.eloq\\:dark\\:text-green-400:is(.dark *){color:var(--eloq-color-green-400)}.eloq\\:dark\\:text-muted-foreground:is(.dark *),.eloq\\:dark\\:text-muted-foreground\\/50:is(.dark *){color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:text-muted-foreground\\/50:is(.dark *){color:color-mix(in oklab,hsl(var(--muted-foreground)) 50%,transparent)}}.eloq\\:dark\\:text-red-200:is(.dark *){color:var(--eloq-color-red-200)}.eloq\\:dark\\:text-red-400:is(.dark *){color:var(--eloq-color-red-400)}.eloq\\:dark\\:shadow-none:is(.dark *){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.eloq\\:dark\\:hover\\:bg-white\\/10:is(.dark *):hover{background-color:var(--eloq-color-white)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:hover\\:bg-white\\/10:is(.dark *):hover{background-color:color-mix(in oklab,var(--eloq-color-white) 10%,transparent)}}.eloq\\:dark\\:hover\\:text-gray-300:is(.dark *):hover{color:var(--eloq-color-gray-300)}.eloq\\:dark\\:hover\\:text-primary:is(.dark *):hover{color:hsl(var(--primary))}}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}}body{background-color:#0000}.eloquent-chat{font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}.collapse{visibility:unset!important}.eloq-wrap-anywhere{overflow-wrap:anywhere}.eloq-thin-scrollbar{scrollbar-width:thin;scrollbar-color:hsl(var(--border)) transparent}.eloq-thin-scrollbar::-webkit-scrollbar{width:8px;height:8px}.eloq-thin-scrollbar::-webkit-scrollbar-thumb{background-color:hsl(var(--border));border-radius:9999px}.eloq-thin-scrollbar::-webkit-scrollbar-track{background-color:#0000}.eloq-test-mode-stripe{background:repeating-linear-gradient(-45deg,#f6e05e,#f6e05e 10px,#000 10px 20px)}.eloq-thinking-shimmer{--eloq-thinking-base:#9ca3af;--eloq-thinking-highlight:#4b5563;background:linear-gradient(90deg,var(--eloq-thinking-base) 0%,var(--eloq-thinking-base) 35%,var(--eloq-thinking-highlight) 50%,var(--eloq-thinking-base) 65%,var(--eloq-thinking-base) 100%);color:#0000;background-size:200% 100%;-webkit-background-clip:text;background-clip:text}.dark .eloq-thinking-shimmer{--eloq-thinking-base:#6b7280;--eloq-thinking-highlight:#e5e7eb}@media(prefers-reduced-motion:reduce){.eloq-thinking-shimmer{color:var(--eloq-thinking-base);background:0 0}}.eloq-regenerating-text{opacity:.4;transition:opacity .25s ease-out}.eloq-regenerating-sweep{border-radius:inherit;pointer-events:none;background:linear-gradient(100deg,#0000 30%,#ffffff8c,#0000 70%) 0 0/200% 100%;position:absolute;inset:0}.dark .eloq-regenerating-sweep{background-image:linear-gradient(100deg,#0000 30%,#ffffff1f,#0000 70%)}@media(prefers-reduced-motion:reduce){.eloq-regenerating-sweep{display:none}}@property --eloq-aura-angle{syntax:"<angle>";inherits:false;initial-value:0deg}.eloq-aura{--eloq-aura-strong:#9e9e9e;--eloq-aura-soft:#d1d1d1;background:conic-gradient(from var(--eloq-aura-angle),var(--eloq-aura-strong),var(--eloq-aura-soft),var(--eloq-aura-strong));border-radius:9999px;padding:2px;animation:2.6s linear infinite eloq-aura-spin;position:relative}@keyframes eloq-aura-spin{to{--eloq-aura-angle:360deg}}.eloq-aura-shine{border-radius:inherit;pointer-events:none;position:absolute;inset:0;overflow:hidden}.eloq-aura-shine:after{content:"";background:linear-gradient(90deg,#0000,#fffc,#0000);width:18%;position:absolute;top:-20%;bottom:-20%;left:0;transform:translate(-200%)skew(-20deg)}.eloq-aura-shine--active:after{animation:1.1s ease-in-out both eloq-aura-shine-sweep}@keyframes eloq-aura-shine-sweep{0%{transform:translate(-200%)skew(-20deg)}to{transform:translate(700%)skew(-20deg)}}@media(prefers-reduced-motion:reduce){.eloq-aura{animation:none}.eloq-aura-shine:after,.eloq-aura-shine--active:after{opacity:0;animation:none}}@keyframes panel-in{0%{opacity:0;transform:scale(.05)}to{opacity:1;transform:scale(1)}}@keyframes thinking-dot{0%,60%,to{opacity:.45;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}@keyframes regenerating-sweep{0%{background-position:150% 0}to{background-position:-50% 0}}@keyframes text-in{0%{opacity:0}to{opacity:1}}@keyframes thinking-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes panel-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.05)}}@keyframes message-in{0%{opacity:0;transform:translateY(.5rem)}to{opacity:1;transform:translateY(0)}}@keyframes slide-up-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}', Wt = ".eloquentai-chat-launcher{transition:transform .2s ease-in-out}.eloquentai-chat-launcher:hover{transform:scale(1.1)}";
|
|
37
|
-
function
|
|
38
|
-
toggleBubble:
|
|
39
|
-
isDarkMode:
|
|
36
|
+
const Ze = '/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--eloq-aura-angle:0deg}}}@layer theme{:root,:host{--eloq-font-sans:system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--eloq-font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--eloq-color-red-50:oklch(97.1% .013 17.38);--eloq-color-red-200:oklch(88.5% .062 18.334);--eloq-color-red-400:oklch(70.4% .191 22.216);--eloq-color-red-500:oklch(63.7% .237 25.331);--eloq-color-red-800:oklch(44.4% .177 26.899);--eloq-color-amber-50:oklch(98.7% .022 95.277);--eloq-color-amber-200:oklch(92.4% .12 95.746);--eloq-color-amber-400:oklch(82.8% .189 84.429);--eloq-color-amber-500:oklch(76.9% .188 70.08);--eloq-color-amber-800:oklch(47.3% .137 46.201);--eloq-color-yellow-400:oklch(85.2% .199 91.936);--eloq-color-green-50:oklch(98.2% .018 155.826);--eloq-color-green-200:oklch(92.5% .084 155.995);--eloq-color-green-400:oklch(79.2% .209 151.711);--eloq-color-green-500:oklch(72.3% .219 149.579);--eloq-color-green-800:oklch(44.8% .119 151.328);--eloq-color-blue-50:oklch(97% .014 254.604);--eloq-color-blue-200:oklch(88.2% .059 254.128);--eloq-color-blue-400:oklch(70.7% .165 254.624);--eloq-color-blue-500:oklch(62.3% .214 259.815);--eloq-color-blue-800:oklch(42.4% .199 265.638);--eloq-color-gray-200:oklch(92.8% .006 264.531);--eloq-color-gray-300:oklch(87.2% .01 258.338);--eloq-color-gray-400:oklch(70.7% .022 261.325);--eloq-color-gray-500:oklch(55.1% .027 264.364);--eloq-color-gray-600:oklch(44.6% .03 256.802);--eloq-color-black:#000;--eloq-color-white:#fff;--eloq-spacing:.25rem;--eloq-container-xs:20rem;--eloq-text-xs:.75rem;--eloq-text-xs--line-height:calc(1 / .75);--eloq-text-sm:.875rem;--eloq-text-sm--line-height:calc(1.25 / .875);--eloq-text-base:1rem;--eloq-text-base--line-height: 1.5 ;--eloq-text-2xl:1.5rem;--eloq-text-2xl--line-height:calc(2 / 1.5);--eloq-font-weight-medium:500;--eloq-font-weight-semibold:600;--eloq-tracking-tight:-.025em;--eloq-leading-relaxed:1.625;--eloq-radius-md:calc(var(--radius) - 2px);--eloq-radius-lg:var(--radius);--eloq-radius-xl:.75rem;--eloq-radius-2xl:1rem;--eloq-radius-3xl:1.5rem;--eloq-drop-shadow-lg:0 4px 4px #00000026;--eloq-drop-shadow-xl:0 9px 7px #0000001a;--eloq-ease-out:cubic-bezier(0, 0, .2, 1);--eloq-animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--eloq-default-transition-duration:.15s;--eloq-default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--eloq-default-font-family:var(--eloq-font-sans);--eloq-default-mono-font-family:var(--eloq-font-mono);--eloq-animate-panel-in:panel-in .35s cubic-bezier(.16, 1, .3, 1) both;--eloq-animate-panel-out:panel-out .25s cubic-bezier(.4, 0, 1, 1) both;--eloq-animate-thinking-dot:thinking-dot 1.2s ease-in-out infinite;--eloq-animate-thinking-shimmer:thinking-shimmer 1.8s linear infinite;--eloq-animate-regenerating:regenerating-sweep 1.2s linear infinite;--eloq-animate-text-in:text-in .35s ease-out both;--eloq-animate-message-in:message-in .3s ease-out both;--eloq-animate-slide-up-in:slide-up-in .3s ease-out both}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--eloq-default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--eloq-default-font-feature-settings,normal);font-variation-settings:var(--eloq-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--eloq-default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--eloq-default-mono-font-feature-settings,normal);font-variation-settings:var(--eloq-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--background:0 0% 100%;--foreground:0 0% 3.9%;--card:0 0% 100%;--card-foreground:0 0% 3.9%;--popover:0 0% 100%;--popover-foreground:0 0% 3.9%;--primary:267 56% 46%;--primary-foreground:0 0% 98%;--secondary:0 0% 96.1%;--secondary-foreground:0 0% 9%;--muted:0 0% 96.1%;--muted-foreground:0 0% 45.1%;--accent:0 0% 96.1%;--accent-foreground:0 0% 9%;--destructive:0 84.2% 60.2%;--destructive-foreground:0 0% 98%;--border:0 0% 89.8%;--input:0 0% 89.8%;--ring:0 0% 3.9%;--cream:37.5 44% 96.5%;--chart-1:12 76% 61%;--chart-2:173 58% 39%;--chart-3:197 37% 24%;--chart-4:43 74% 66%;--chart-5:27 87% 67%;--radius:.5rem}.dark{--background:262 50% 10%;--foreground:262 5% 90%;--card:262 50% 10%;--card-foreground:262 5% 90%;--popover:262 50% 5%;--popover-foreground:262 5% 90%;--primary:262 62% 70%;--primary-foreground:0 0% 100%;--primary-dark:262 62% 60%;--secondary:262 30% 30%;--secondary-foreground:0 0% 100%;--secondary-dark:262 30% 20%;--secondary-light:262 30% 40%;--tertiary:267 56% 46%;--tertiary-foreground:0 0% 100%;--tertiary-dark:267 38% 25%;--tertiary-light:263 100% 85%;--muted:224 30% 25%;--muted-foreground:262 5% 90%;--accent:224 30% 25%;--accent-foreground:262 5% 100%;--accent-dark:224 30% 15%;--destructive:0 100% 30%;--destructive-foreground:262 5% 90%;--border:0 0% 30%;--input:262 30% 25%;--ring:262 62% 71%;--cream:257 28% 20%;--radius:.5rem;--sidebar-background:var(--background);--sidebar-foreground:var(--foreground);--sidebar-primary:var(--primary);--sidebar-primary-foreground:var(--primary-foreground);--sidebar-accent:var(--accent);--sidebar-accent-foreground:var(--accent-foreground);--sidebar-border:var(--border);--sidebar-ring:var(--ring)}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}}@layer components;@layer utilities{.eloq\\:pointer-events-none{pointer-events:none}.eloq\\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.eloq\\:absolute{position:absolute}.eloq\\:relative{position:relative}.eloq\\:inset-0{inset:0}.eloq\\:inset-x-0{inset-inline:0}.eloq\\:top-0{top:0}.eloq\\:top-0\\.5{top:calc(var(--eloq-spacing) * .5)}.eloq\\:-right-\\[9px\\]{right:-9px}.eloq\\:right-0\\.5{right:calc(var(--eloq-spacing) * .5)}.eloq\\:right-2{right:calc(var(--eloq-spacing) * 2)}.eloq\\:right-16{right:calc(var(--eloq-spacing) * 16)}.eloq\\:bottom-0{bottom:0}.eloq\\:bottom-1{bottom:var(--eloq-spacing)}.eloq\\:bottom-2{bottom:calc(var(--eloq-spacing) * 2)}.eloq\\:bottom-10{bottom:calc(var(--eloq-spacing) * 10)}.eloq\\:left-0{left:0}.eloq\\:left-2{left:calc(var(--eloq-spacing) * 2)}.eloq\\:left-\\[calc\\(50\\%-0\\.75rem\\)\\]{left:calc(50% - .75rem)}.eloq\\:z-10{z-index:10}.eloq\\:z-20{z-index:20}.eloq\\:z-30{z-index:30}.eloq\\:m-0{margin:0}.eloq\\:m-auto{margin:auto}.eloq\\:mx-1{margin-inline:var(--eloq-spacing)}.eloq\\:mx-auto{margin-inline:auto}.eloq\\:my-2{margin-block:calc(var(--eloq-spacing) * 2)}.eloq\\:my-4{margin-block:calc(var(--eloq-spacing) * 4)}.eloq\\:-mt-2{margin-top:calc(var(--eloq-spacing) * -2)}.eloq\\:-mt-6{margin-top:calc(var(--eloq-spacing) * -6)}.eloq\\:-mt-20{margin-top:calc(var(--eloq-spacing) * -20)}.eloq\\:mt-1{margin-top:var(--eloq-spacing)}.eloq\\:mt-2{margin-top:calc(var(--eloq-spacing) * 2)}.eloq\\:mt-10{margin-top:calc(var(--eloq-spacing) * 10)}.eloq\\:mr-1{margin-right:var(--eloq-spacing)}.eloq\\:mr-\\[2px\\]{margin-right:2px}.eloq\\:mb-1{margin-bottom:var(--eloq-spacing)}.eloq\\:mb-3{margin-bottom:calc(var(--eloq-spacing) * 3)}.eloq\\:mb-4{margin-bottom:calc(var(--eloq-spacing) * 4)}.eloq\\:mb-10{margin-bottom:calc(var(--eloq-spacing) * 10)}.eloq\\:ml-0{margin-left:0}.eloq\\:ml-1{margin-left:var(--eloq-spacing)}.eloq\\:ml-5{margin-left:calc(var(--eloq-spacing) * 5)}.eloq\\:box-content{box-sizing:content-box}.eloq\\:block{display:block}.eloq\\:flex{display:flex}.eloq\\:hidden{display:none}.eloq\\:inline-flex{display:inline-flex}.eloq\\:aspect-square{aspect-ratio:1}.eloq\\:h-1{height:var(--eloq-spacing)}.eloq\\:h-2\\.5{height:calc(var(--eloq-spacing) * 2.5)}.eloq\\:h-3{height:calc(var(--eloq-spacing) * 3)}.eloq\\:h-4{height:calc(var(--eloq-spacing) * 4)}.eloq\\:h-5{height:calc(var(--eloq-spacing) * 5)}.eloq\\:h-6{height:calc(var(--eloq-spacing) * 6)}.eloq\\:h-8{height:calc(var(--eloq-spacing) * 8)}.eloq\\:h-10{height:calc(var(--eloq-spacing) * 10)}.eloq\\:h-12{height:calc(var(--eloq-spacing) * 12)}.eloq\\:h-14{height:calc(var(--eloq-spacing) * 14)}.eloq\\:h-16{height:calc(var(--eloq-spacing) * 16)}.eloq\\:h-\\[0\\.42em\\]{height:.42em}.eloq\\:h-\\[160px\\]{height:160px}.eloq\\:h-\\[220px\\]{height:220px}.eloq\\:h-\\[560px\\]{height:560px}.eloq\\:h-\\[600px\\]{height:600px}.eloq\\:h-full{height:100%}.eloq\\:max-h-\\[132px\\]{max-height:132px}.eloq\\:min-h-\\[48px\\]{min-height:48px}.eloq\\:min-h-\\[80px\\]{min-height:80px}.eloq\\:w-2\\.5{width:calc(var(--eloq-spacing) * 2.5)}.eloq\\:w-2\\/3{width:66.6667%}.eloq\\:w-3{width:calc(var(--eloq-spacing) * 3)}.eloq\\:w-4{width:calc(var(--eloq-spacing) * 4)}.eloq\\:w-5{width:calc(var(--eloq-spacing) * 5)}.eloq\\:w-6{width:calc(var(--eloq-spacing) * 6)}.eloq\\:w-8{width:calc(var(--eloq-spacing) * 8)}.eloq\\:w-10{width:calc(var(--eloq-spacing) * 10)}.eloq\\:w-12{width:calc(var(--eloq-spacing) * 12)}.eloq\\:w-14{width:calc(var(--eloq-spacing) * 14)}.eloq\\:w-16{width:calc(var(--eloq-spacing) * 16)}.eloq\\:w-24{width:calc(var(--eloq-spacing) * 24)}.eloq\\:w-32{width:calc(var(--eloq-spacing) * 32)}.eloq\\:w-48{width:calc(var(--eloq-spacing) * 48)}.eloq\\:w-\\[0\\.42em\\]{width:.42em}.eloq\\:w-\\[70\\%\\]{width:70%}.eloq\\:w-\\[320px\\]{width:320px}.eloq\\:w-\\[340px\\]{width:340px}.eloq\\:w-\\[348px\\]{width:348px}.eloq\\:w-\\[380px\\]{width:380px}.eloq\\:w-\\[420px\\]{width:420px}.eloq\\:w-full{width:100%}.eloq\\:max-w-\\[75\\%\\]{max-width:75%}.eloq\\:max-w-\\[88\\%\\]{max-width:88%}.eloq\\:max-w-full{max-width:100%}.eloq\\:max-w-xs{max-width:var(--eloq-container-xs)}.eloq\\:min-w-0{min-width:0}.eloq\\:min-w-min{min-width:min-content}.eloq\\:flex-1{flex:1}.eloq\\:flex-none{flex:none}.eloq\\:flex-shrink-0,.eloq\\:shrink-0{flex-shrink:0}.eloq\\:flex-grow{flex-grow:1}.eloq\\:origin-bottom-right{transform-origin:100% 100%}.eloq\\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.eloq\\:translate-x-8{--tw-translate-x:calc(var(--eloq-spacing) * 8);translate:var(--tw-translate-x) var(--tw-translate-y)}.eloq\\:scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.eloq\\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.eloq\\:-scale-x-100{--tw-scale-x: -100% ;scale:var(--tw-scale-x) var(--tw-scale-y)}.eloq\\:scale-\\[0\\.05\\]{scale:.05}.eloq\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.eloq\\:animate-message-in{animation:var(--eloq-animate-message-in)}.eloq\\:animate-panel-in{animation:var(--eloq-animate-panel-in)}.eloq\\:animate-panel-out{animation:var(--eloq-animate-panel-out)}.eloq\\:animate-pulse{animation:var(--eloq-animate-pulse)}.eloq\\:animate-regenerating{animation:var(--eloq-animate-regenerating)}.eloq\\:animate-slide-up-in{animation:var(--eloq-animate-slide-up-in)}.eloq\\:animate-text-in{animation:var(--eloq-animate-text-in)}.eloq\\:animate-thinking-dot{animation:var(--eloq-animate-thinking-dot)}.eloq\\:animate-thinking-shimmer{animation:var(--eloq-animate-thinking-shimmer)}.eloq\\:cursor-default{cursor:default}.eloq\\:cursor-grab{cursor:grab}.eloq\\:cursor-pointer{cursor:pointer}.eloq\\:touch-none{touch-action:none}.eloq\\:resize-none{resize:none}.eloq\\:list-decimal{list-style-type:decimal}.eloq\\:list-disc{list-style-type:disc}.eloq\\:flex-col{flex-direction:column}.eloq\\:flex-row{flex-direction:row}.eloq\\:flex-wrap{flex-wrap:wrap}.eloq\\:items-center{align-items:center}.eloq\\:items-end{align-items:flex-end}.eloq\\:items-start{align-items:flex-start}.eloq\\:justify-between{justify-content:space-between}.eloq\\:justify-center{justify-content:center}.eloq\\:justify-end{justify-content:flex-end}.eloq\\:justify-start{justify-content:flex-start}.eloq\\:gap-1{gap:var(--eloq-spacing)}.eloq\\:gap-1\\.5{gap:calc(var(--eloq-spacing) * 1.5)}.eloq\\:gap-2{gap:calc(var(--eloq-spacing) * 2)}.eloq\\:gap-3{gap:calc(var(--eloq-spacing) * 3)}.eloq\\:gap-\\[0\\.25em\\]{gap:.25em}:where(.eloq\\:space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block:0}:where(.eloq\\:space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--eloq-spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--eloq-spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--eloq-spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--eloq-spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--eloq-spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--eloq-spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--eloq-spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--eloq-spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--eloq-spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--eloq-spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.eloq\\:space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(var(--eloq-spacing) * var(--tw-space-x-reverse));margin-inline-end:calc(var(--eloq-spacing) * calc(1 - var(--tw-space-x-reverse)))}:where(.eloq\\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--eloq-spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--eloq-spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.eloq\\:space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--eloq-spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--eloq-spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}.eloq\\:self-end{align-self:flex-end}.eloq\\:self-stretch{align-self:stretch}.eloq\\:overflow-hidden{overflow:hidden}.eloq\\:overflow-x-auto{overflow-x:auto}.eloq\\:rounded-2xl{border-radius:var(--eloq-radius-2xl)}.eloq\\:rounded-3xl{border-radius:var(--eloq-radius-3xl)}.eloq\\:rounded-\\[inherit\\]{border-radius:inherit}.eloq\\:rounded-full{border-radius:3.40282e38px}.eloq\\:rounded-lg{border-radius:var(--eloq-radius-lg)}.eloq\\:rounded-md{border-radius:var(--eloq-radius-md)}.eloq\\:rounded-none{border-radius:0}.eloq\\:rounded-xl{border-radius:var(--eloq-radius-xl)}.eloq\\:rounded-t-2xl{border-top-left-radius:var(--eloq-radius-2xl);border-top-right-radius:var(--eloq-radius-2xl)}.eloq\\:border{border-style:var(--tw-border-style);border-width:1px}.eloq\\:border-0{border-style:var(--tw-border-style);border-width:0}.eloq\\:border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.eloq\\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.eloq\\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.eloq\\:border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.eloq\\:border-dashed{--tw-border-style:dashed;border-style:dashed}.eloq\\:border-amber-400{border-color:var(--eloq-color-amber-400)}.eloq\\:border-blue-500{border-color:var(--eloq-color-blue-500)}.eloq\\:border-border{border-color:hsl(var(--border))}.eloq\\:border-green-500{border-color:var(--eloq-color-green-500)}.eloq\\:border-input{border-color:hsl(var(--input))}.eloq\\:border-red-500{border-color:var(--eloq-color-red-500)}.eloq\\:border-t-transparent{border-top-color:#0000}.eloq\\:border-l-transparent{border-left-color:#0000}.eloq\\:bg-\\[\\#0a0a0a\\]{background-color:#0a0a0a}.eloq\\:bg-\\[\\#000\\]{background-color:#000}.eloq\\:bg-\\[\\#fff\\]{background-color:#fff}.eloq\\:bg-amber-50{background-color:var(--eloq-color-amber-50)}.eloq\\:bg-background{background-color:hsl(var(--background))}.eloq\\:bg-black\\/20{background-color:var(--eloq-color-black)}@supports (color:color-mix(in lab,red,red)){.eloq\\:bg-black\\/20{background-color:color-mix(in oklab,var(--eloq-color-black) 20%,transparent)}}.eloq\\:bg-black\\/60{background-color:var(--eloq-color-black)}@supports (color:color-mix(in lab,red,red)){.eloq\\:bg-black\\/60{background-color:color-mix(in oklab,var(--eloq-color-black) 60%,transparent)}}.eloq\\:bg-blue-50{background-color:var(--eloq-color-blue-50)}.eloq\\:bg-border{background-color:hsl(var(--border))}.eloq\\:bg-card{background-color:hsl(var(--card))}.eloq\\:bg-cream{background-color:hsl(var(--cream))}.eloq\\:bg-gray-400{background-color:var(--eloq-color-gray-400)}.eloq\\:bg-green-50{background-color:var(--eloq-color-green-50)}.eloq\\:bg-muted{background-color:hsl(var(--muted))}.eloq\\:bg-muted-foreground{background-color:hsl(var(--muted-foreground))}.eloq\\:bg-primary{background-color:hsl(var(--primary))}.eloq\\:bg-red-50{background-color:var(--eloq-color-red-50)}.eloq\\:bg-white,.eloq\\:bg-white\\/20{background-color:var(--eloq-color-white)}@supports (color:color-mix(in lab,red,red)){.eloq\\:bg-white\\/20{background-color:color-mix(in oklab,var(--eloq-color-white) 20%,transparent)}}.eloq\\:fill-none{fill:none}.eloq\\:fill-yellow-400{fill:var(--eloq-color-yellow-400)}.eloq\\:object-contain{object-fit:contain}.eloq\\:object-cover{object-fit:cover}.eloq\\:p-0{padding:0}.eloq\\:p-0\\.5{padding:calc(var(--eloq-spacing) * .5)}.eloq\\:p-1{padding:var(--eloq-spacing)}.eloq\\:p-1\\.5{padding:calc(var(--eloq-spacing) * 1.5)}.eloq\\:p-2{padding:calc(var(--eloq-spacing) * 2)}.eloq\\:p-3{padding:calc(var(--eloq-spacing) * 3)}.eloq\\:p-4{padding:calc(var(--eloq-spacing) * 4)}.eloq\\:p-6{padding:calc(var(--eloq-spacing) * 6)}.eloq\\:p-\\[1px\\]{padding:1px}.eloq\\:px-0{padding-inline:0}.eloq\\:px-2{padding-inline:calc(var(--eloq-spacing) * 2)}.eloq\\:px-3{padding-inline:calc(var(--eloq-spacing) * 3)}.eloq\\:px-4{padding-inline:calc(var(--eloq-spacing) * 4)}.eloq\\:px-5{padding-inline:calc(var(--eloq-spacing) * 5)}.eloq\\:px-\\[12px\\]{padding-inline:12px}.eloq\\:px-\\[16px\\]{padding-inline:16px}.eloq\\:py-1{padding-block:var(--eloq-spacing)}.eloq\\:py-1\\.5{padding-block:calc(var(--eloq-spacing) * 1.5)}.eloq\\:py-2{padding-block:calc(var(--eloq-spacing) * 2)}.eloq\\:py-3{padding-block:calc(var(--eloq-spacing) * 3)}.eloq\\:py-3\\.5{padding-block:calc(var(--eloq-spacing) * 3.5)}.eloq\\:py-\\[8px\\]{padding-block:8px}.eloq\\:py-\\[12px\\]{padding-block:12px}.eloq\\:pt-0{padding-top:0}.eloq\\:pt-2{padding-top:calc(var(--eloq-spacing) * 2)}.eloq\\:pt-4{padding-top:calc(var(--eloq-spacing) * 4)}.eloq\\:pt-5{padding-top:calc(var(--eloq-spacing) * 5)}.eloq\\:pt-6{padding-top:calc(var(--eloq-spacing) * 6)}.eloq\\:pt-10{padding-top:calc(var(--eloq-spacing) * 10)}.eloq\\:pt-24{padding-top:calc(var(--eloq-spacing) * 24)}.eloq\\:pr-2{padding-right:calc(var(--eloq-spacing) * 2)}.eloq\\:pr-4{padding-right:calc(var(--eloq-spacing) * 4)}.eloq\\:pr-12{padding-right:calc(var(--eloq-spacing) * 12)}.eloq\\:pb-2{padding-bottom:calc(var(--eloq-spacing) * 2)}.eloq\\:pb-4{padding-bottom:calc(var(--eloq-spacing) * 4)}.eloq\\:pb-10{padding-bottom:calc(var(--eloq-spacing) * 10)}.eloq\\:pb-14{padding-bottom:calc(var(--eloq-spacing) * 14)}.eloq\\:pl-3{padding-left:calc(var(--eloq-spacing) * 3)}.eloq\\:pl-4{padding-left:calc(var(--eloq-spacing) * 4)}.eloq\\:pl-11{padding-left:calc(var(--eloq-spacing) * 11)}.eloq\\:text-center{text-align:center}.eloq\\:text-left{text-align:left}.eloq\\:text-2xl{font-size:var(--eloq-text-2xl);line-height:var(--tw-leading,var(--eloq-text-2xl--line-height))}.eloq\\:text-base{font-size:var(--eloq-text-base);line-height:var(--tw-leading,var(--eloq-text-base--line-height))}.eloq\\:text-sm{font-size:var(--eloq-text-sm);line-height:var(--tw-leading,var(--eloq-text-sm--line-height))}.eloq\\:text-xs{font-size:var(--eloq-text-xs);line-height:var(--tw-leading,var(--eloq-text-xs--line-height))}.eloq\\:text-\\[10px\\]{font-size:10px}.eloq\\:leading-5{--tw-leading:calc(var(--eloq-spacing) * 5);line-height:calc(var(--eloq-spacing) * 5)}.eloq\\:leading-none{--tw-leading:1;line-height:1}.eloq\\:leading-relaxed{--tw-leading:var(--eloq-leading-relaxed);line-height:var(--eloq-leading-relaxed)}.eloq\\:font-medium{--tw-font-weight:var(--eloq-font-weight-medium);font-weight:var(--eloq-font-weight-medium)}.eloq\\:font-semibold{--tw-font-weight:var(--eloq-font-weight-semibold);font-weight:var(--eloq-font-weight-semibold)}.eloq\\:tracking-tight{--tw-tracking:var(--eloq-tracking-tight);letter-spacing:var(--eloq-tracking-tight)}.eloq\\:whitespace-nowrap{white-space:nowrap}.eloq\\:text-\\[\\#000\\]{color:#000}.eloq\\:text-\\[\\#fff\\]{color:#fff}.eloq\\:text-amber-500{color:var(--eloq-color-amber-500)}.eloq\\:text-amber-800{color:var(--eloq-color-amber-800)}.eloq\\:text-blue-500{color:var(--eloq-color-blue-500)}.eloq\\:text-blue-800{color:var(--eloq-color-blue-800)}.eloq\\:text-card-foreground{color:hsl(var(--card-foreground))}.eloq\\:text-destructive{color:hsl(var(--destructive))}.eloq\\:text-foreground{color:hsl(var(--foreground))}.eloq\\:text-gray-300{color:var(--eloq-color-gray-300)}.eloq\\:text-gray-400{color:var(--eloq-color-gray-400)}.eloq\\:text-gray-500{color:var(--eloq-color-gray-500)}.eloq\\:text-green-500{color:var(--eloq-color-green-500)}.eloq\\:text-green-800{color:var(--eloq-color-green-800)}.eloq\\:text-muted{color:hsl(var(--muted))}.eloq\\:text-muted-foreground{color:hsl(var(--muted-foreground))}.eloq\\:text-primary{color:hsl(var(--primary))}.eloq\\:text-primary-foreground{color:hsl(var(--primary-foreground))}.eloq\\:text-red-500{color:var(--eloq-color-red-500)}.eloq\\:text-red-800{color:var(--eloq-color-red-800)}.eloq\\:text-white{color:var(--eloq-color-white)}.eloq\\:text-yellow-400{color:var(--eloq-color-yellow-400)}.eloq\\:italic{font-style:italic}.eloq\\:underline{text-decoration-line:underline}.eloq\\:opacity-0{opacity:0}.eloq\\:opacity-50{opacity:.5}.eloq\\:opacity-70{opacity:.7}.eloq\\:opacity-75{opacity:.75}.eloq\\:opacity-100{opacity:1}.eloq\\:shadow-\\[0_-8px_24px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow:0 -8px 24px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:shadow-\\[0_0_4px_0_rgba\\(0\\,0\\,0\\,0\\.20\\)\\]{--tw-shadow:0 0 4px 0 var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:shadow-\\[0_3px_4px_-2px_rgba\\(0\\,0\\,0\\,0\\.04\\)\\]{--tw-shadow:0 3px 4px -2px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.eloq\\:outline-2{outline-style:var(--tw-outline-style);outline-width:2px}.eloq\\:outline-offset-2{outline-offset:2px}.eloq\\:outline-transparent{outline-color:#0000}.eloq\\:drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--eloq-drop-shadow-lg));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.eloq\\:transition-\\[outline-color\\]{transition-property:outline-color;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--eloq-default-transition-timing-function));transition-duration:var(--tw-duration,var(--eloq-default-transition-duration))}.eloq\\:duration-150{--tw-duration:.15s;transition-duration:.15s}.eloq\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.eloq\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.eloq\\:duration-500{--tw-duration:.5s;transition-duration:.5s}.eloq\\:ease-out{--tw-ease:var(--eloq-ease-out);transition-timing-function:var(--eloq-ease-out)}.eloq\\:select-none{-webkit-user-select:none;user-select:none}.eloq\\:placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.eloq\\:last\\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.eloq\\:hover\\:bg-black\\/5:hover{background-color:var(--eloq-color-black)}@supports (color:color-mix(in lab,red,red)){.eloq\\:hover\\:bg-black\\/5:hover{background-color:color-mix(in oklab,var(--eloq-color-black) 5%,transparent)}}.eloq\\:hover\\:bg-black\\/80:hover{background-color:var(--eloq-color-black)}@supports (color:color-mix(in lab,red,red)){.eloq\\:hover\\:bg-black\\/80:hover{background-color:color-mix(in oklab,var(--eloq-color-black) 80%,transparent)}}.eloq\\:hover\\:bg-muted:hover{background-color:hsl(var(--muted))}.eloq\\:hover\\:text-foreground:hover{color:hsl(var(--foreground))}.eloq\\:hover\\:text-gray-600:hover{color:var(--eloq-color-gray-600)}.eloq\\:hover\\:text-primary:hover{color:hsl(var(--primary))}.eloq\\:hover\\:opacity-80:hover{opacity:.8}.eloq\\:hover\\:opacity-90:hover{opacity:.9}.eloq\\:hover\\:opacity-100:hover{opacity:1}.eloq\\:hover\\:drop-shadow-xl:hover{--tw-drop-shadow-size:drop-shadow(0 9px 7px var(--tw-drop-shadow-color,#0000001a));--tw-drop-shadow:drop-shadow(var(--eloq-drop-shadow-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.eloq\\:focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.eloq\\:focus-visible\\:ring-muted:focus-visible{--tw-ring-color:hsl(var(--muted))}.eloq\\:focus-visible\\:ring-primary:focus-visible{--tw-ring-color:hsl(var(--primary))}.eloq\\:focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.eloq\\:focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.eloq\\:active\\:cursor-grabbing:active{cursor:grabbing}.eloq\\:disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.eloq\\:disabled\\:opacity-50:disabled{opacity:.5}@media(prefers-reduced-motion:reduce){.eloq\\:motion-reduce\\:animate-none{animation:none}.eloq\\:motion-reduce\\:opacity-70{opacity:.7}}@media(min-width:40rem){.eloq\\:sm\\:text-sm{font-size:var(--eloq-text-sm);line-height:var(--tw-leading,var(--eloq-text-sm--line-height))}}@media(min-width:48rem){.eloq\\:md\\:text-sm{font-size:var(--eloq-text-sm);line-height:var(--tw-leading,var(--eloq-text-sm--line-height))}}.eloq\\:dark\\:border:is(.dark *){border-style:var(--tw-border-style);border-width:1px}.eloq\\:dark\\:border-b:is(.dark *){border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.eloq\\:dark\\:border-border:is(.dark *){border-color:hsl(var(--border))}.eloq\\:dark\\:bg-amber-400\\/10:is(.dark *){background-color:var(--eloq-color-amber-400)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:bg-amber-400\\/10:is(.dark *){background-color:color-mix(in oklab,var(--eloq-color-amber-400) 10%,transparent)}}.eloq\\:dark\\:bg-blue-500\\/10:is(.dark *){background-color:var(--eloq-color-blue-500)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:bg-blue-500\\/10:is(.dark *){background-color:color-mix(in oklab,var(--eloq-color-blue-500) 10%,transparent)}}.eloq\\:dark\\:bg-card:is(.dark *){background-color:hsl(var(--card))}.eloq\\:dark\\:bg-gray-200:is(.dark *){background-color:var(--eloq-color-gray-200)}.eloq\\:dark\\:bg-green-500\\/10:is(.dark *){background-color:var(--eloq-color-green-500)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:bg-green-500\\/10:is(.dark *){background-color:color-mix(in oklab,var(--eloq-color-green-500) 10%,transparent)}}.eloq\\:dark\\:bg-muted:is(.dark *){background-color:hsl(var(--muted))}.eloq\\:dark\\:bg-red-500\\/10:is(.dark *){background-color:var(--eloq-color-red-500)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:bg-red-500\\/10:is(.dark *){background-color:color-mix(in oklab,var(--eloq-color-red-500) 10%,transparent)}}.eloq\\:dark\\:text-amber-200:is(.dark *){color:var(--eloq-color-amber-200)}.eloq\\:dark\\:text-amber-400:is(.dark *){color:var(--eloq-color-amber-400)}.eloq\\:dark\\:text-blue-200:is(.dark *){color:var(--eloq-color-blue-200)}.eloq\\:dark\\:text-blue-400:is(.dark *){color:var(--eloq-color-blue-400)}.eloq\\:dark\\:text-gray-500:is(.dark *){color:var(--eloq-color-gray-500)}.eloq\\:dark\\:text-green-200:is(.dark *){color:var(--eloq-color-green-200)}.eloq\\:dark\\:text-green-400:is(.dark *){color:var(--eloq-color-green-400)}.eloq\\:dark\\:text-muted-foreground:is(.dark *),.eloq\\:dark\\:text-muted-foreground\\/50:is(.dark *){color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:text-muted-foreground\\/50:is(.dark *){color:color-mix(in oklab,hsl(var(--muted-foreground)) 50%,transparent)}}.eloq\\:dark\\:text-red-200:is(.dark *){color:var(--eloq-color-red-200)}.eloq\\:dark\\:text-red-400:is(.dark *){color:var(--eloq-color-red-400)}.eloq\\:dark\\:shadow-none:is(.dark *){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.eloq\\:dark\\:hover\\:bg-white\\/10:is(.dark *):hover{background-color:var(--eloq-color-white)}@supports (color:color-mix(in lab,red,red)){.eloq\\:dark\\:hover\\:bg-white\\/10:is(.dark *):hover{background-color:color-mix(in oklab,var(--eloq-color-white) 10%,transparent)}}.eloq\\:dark\\:hover\\:text-gray-300:is(.dark *):hover{color:var(--eloq-color-gray-300)}.eloq\\:dark\\:hover\\:text-primary:is(.dark *):hover{color:hsl(var(--primary))}}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}}body{background-color:#0000}.eloquent-chat{font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}.collapse{visibility:unset!important}.eloq-wrap-anywhere{overflow-wrap:anywhere}.eloq-thin-scrollbar{scrollbar-width:thin;scrollbar-color:hsl(var(--border)) transparent}.eloq-thin-scrollbar::-webkit-scrollbar{width:8px;height:8px}.eloq-thin-scrollbar::-webkit-scrollbar-thumb{background-color:hsl(var(--border));border-radius:9999px}.eloq-thin-scrollbar::-webkit-scrollbar-track{background-color:#0000}.eloq-test-mode-stripe{background:repeating-linear-gradient(-45deg,#f6e05e,#f6e05e 10px,#000 10px 20px)}.eloq-thinking-shimmer{--eloq-thinking-base:#9ca3af;--eloq-thinking-highlight:#4b5563;background:linear-gradient(90deg,var(--eloq-thinking-base) 0%,var(--eloq-thinking-base) 35%,var(--eloq-thinking-highlight) 50%,var(--eloq-thinking-base) 65%,var(--eloq-thinking-base) 100%);color:#0000;background-size:200% 100%;-webkit-background-clip:text;background-clip:text}.dark .eloq-thinking-shimmer{--eloq-thinking-base:#6b7280;--eloq-thinking-highlight:#e5e7eb}@media(prefers-reduced-motion:reduce){.eloq-thinking-shimmer{color:var(--eloq-thinking-base);background:0 0}}.eloq-regenerating-text{opacity:.4;transition:opacity .25s ease-out}.eloq-regenerating-sweep{border-radius:inherit;pointer-events:none;background:linear-gradient(100deg,#0000 30%,#ffffff8c,#0000 70%) 0 0/200% 100%;position:absolute;inset:0}.dark .eloq-regenerating-sweep{background-image:linear-gradient(100deg,#0000 30%,#ffffff1f,#0000 70%)}@media(prefers-reduced-motion:reduce){.eloq-regenerating-sweep{display:none}}@property --eloq-aura-angle{syntax:"<angle>";inherits:false;initial-value:0deg}.eloq-aura{--eloq-aura-strong:#9e9e9e;--eloq-aura-soft:#d1d1d1;background:conic-gradient(from var(--eloq-aura-angle),var(--eloq-aura-strong),var(--eloq-aura-soft),var(--eloq-aura-strong));border-radius:9999px;padding:2px;animation:2.6s linear infinite eloq-aura-spin;position:relative}@keyframes eloq-aura-spin{to{--eloq-aura-angle:360deg}}.eloq-aura-shine{border-radius:inherit;pointer-events:none;position:absolute;inset:0;overflow:hidden}.eloq-aura-shine:after{content:"";background:linear-gradient(90deg,#0000,#fffc,#0000);width:18%;position:absolute;top:-20%;bottom:-20%;left:0;transform:translate(-200%)skew(-20deg)}.eloq-aura-shine--active:after{animation:1.1s ease-in-out both eloq-aura-shine-sweep}@keyframes eloq-aura-shine-sweep{0%{transform:translate(-200%)skew(-20deg)}to{transform:translate(700%)skew(-20deg)}}@media(prefers-reduced-motion:reduce){.eloq-aura{animation:none}.eloq-aura-shine:after,.eloq-aura-shine--active:after{opacity:0;animation:none}}@keyframes panel-in{0%{opacity:0;transform:scale(.05)}to{opacity:1;transform:scale(1)}}@keyframes thinking-dot{0%,60%,to{opacity:.45;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}@keyframes regenerating-sweep{0%{background-position:150% 0}to{background-position:-50% 0}}@keyframes text-in{0%{opacity:0}to{opacity:1}}@keyframes thinking-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes panel-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.05)}}@keyframes message-in{0%{opacity:0;transform:translateY(.5rem)}to{opacity:1;transform:translateY(0)}}@keyframes slide-up-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}', Qt = ".eloquentai-chat-launcher{transition:transform .2s ease-in-out}.eloquentai-chat-launcher:hover{transform:scale(1.1)}";
|
|
37
|
+
function eo({
|
|
38
|
+
toggleBubble: e,
|
|
39
|
+
isDarkMode: t = !1
|
|
40
40
|
}) {
|
|
41
|
-
const o =
|
|
42
|
-
return /* @__PURE__ */
|
|
41
|
+
const o = t ? "#fff" : "#000", r = t ? "#000000" : "#ffffff";
|
|
42
|
+
return /* @__PURE__ */ x("div", { className: "eloq:absolute eloq:inset-0 eloq:m-auto eloq:flex eloq:items-center eloq:justify-center eloq:overflow-hidden", children: /* @__PURE__ */ x(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
|
-
className:
|
|
45
|
+
className: Qe(
|
|
46
46
|
"eloq:chat-bubble eloq:relative eloq:flex eloq:items-center eloq:justify-center eloq:w-12 eloq:h-12 eloq:rounded-full eloq:cursor-pointer",
|
|
47
47
|
// Inverted in dark mode: a black launcher disappears on dark pages.
|
|
48
|
-
|
|
48
|
+
t ? "eloq:bg-[#fff] eloq:text-[#000]" : "eloq:bg-[#000] eloq:text-[#fff]"
|
|
49
49
|
),
|
|
50
|
-
onClick:
|
|
51
|
-
children: /* @__PURE__ */
|
|
50
|
+
onClick: e,
|
|
51
|
+
children: /* @__PURE__ */ x("div", { className: "eloq:absolute eloq:inset-0 eloq:flex eloq:justify-center eloq:items-center eloq:m-auto", children: /* @__PURE__ */ x(Tt, { bgColor: o, fgColor: r }) })
|
|
52
52
|
}
|
|
53
53
|
) });
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const [r, n] = _(null), i = r?.contentWindow?.document?.head,
|
|
55
|
+
function Ke({ children: e, head: t, ...o }) {
|
|
56
|
+
const [r, n] = _(null), i = r?.contentWindow?.document?.head, c = r?.contentWindow?.document?.body;
|
|
57
57
|
return /* @__PURE__ */ ze("iframe", { ...o, ref: n, children: [
|
|
58
|
-
i &&
|
|
59
|
-
|
|
58
|
+
i && Ge(t, i),
|
|
59
|
+
c && Ge(e, c)
|
|
60
60
|
] });
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
62
|
+
function to({ children: e, container: t }) {
|
|
63
|
+
return Ge(e, t);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
message:
|
|
67
|
-
isVisible:
|
|
65
|
+
function oo({
|
|
66
|
+
message: e,
|
|
67
|
+
isVisible: t,
|
|
68
68
|
onDismiss: o,
|
|
69
69
|
onMessageClick: r,
|
|
70
70
|
autoHideDelay: n
|
|
71
71
|
}) {
|
|
72
|
-
const [i,
|
|
73
|
-
return
|
|
74
|
-
if (
|
|
75
|
-
|
|
72
|
+
const [i, c] = _(!1), [s, d] = _("entering"), a = Mt();
|
|
73
|
+
return Z(() => {
|
|
74
|
+
if (t) {
|
|
75
|
+
c(!0), d("entering");
|
|
76
76
|
const l = setTimeout(() => {
|
|
77
|
-
|
|
77
|
+
d("visible");
|
|
78
78
|
}, 50);
|
|
79
|
-
let
|
|
80
|
-
const
|
|
81
|
-
|
|
79
|
+
let u;
|
|
80
|
+
const p = setTimeout(() => {
|
|
81
|
+
d("exiting"), u = setTimeout(() => {
|
|
82
82
|
o();
|
|
83
83
|
}, 300);
|
|
84
84
|
}, n);
|
|
85
85
|
return () => {
|
|
86
|
-
clearTimeout(l), clearTimeout(
|
|
86
|
+
clearTimeout(l), clearTimeout(p), clearTimeout(u);
|
|
87
87
|
};
|
|
88
88
|
} else {
|
|
89
|
-
|
|
89
|
+
d("exiting");
|
|
90
90
|
const l = setTimeout(() => {
|
|
91
|
-
|
|
91
|
+
c(!1), d("entering");
|
|
92
92
|
}, 300);
|
|
93
93
|
return () => clearTimeout(l);
|
|
94
94
|
}
|
|
95
|
-
}, [
|
|
95
|
+
}, [t, o, n]), i ? /* @__PURE__ */ x(
|
|
96
96
|
"div",
|
|
97
97
|
{
|
|
98
|
-
className:
|
|
98
|
+
className: Qe(
|
|
99
99
|
// right-16 leaves a ~7px gap between the tail tip and the launcher
|
|
100
100
|
// circle's edge — the tail points at it without sliding underneath.
|
|
101
101
|
"eloq:absolute eloq:right-16 eloq:bottom-0 eloq:max-w-xs eloq:transform eloq:transition-all eloq:duration-500 eloq:ease-out",
|
|
@@ -103,7 +103,7 @@ function Gt({
|
|
|
103
103
|
s === "visible" && "eloq:translate-x-0 eloq:opacity-100 eloq:scale-100",
|
|
104
104
|
s === "exiting" && "eloq:translate-x-8 eloq:opacity-0 eloq:scale-95"
|
|
105
105
|
),
|
|
106
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ x("div", { className: "eloq:relative eloq:drop-shadow-lg eloq:hover:drop-shadow-xl eloq:transition-all eloq:duration-300", children: /* @__PURE__ */ ze(
|
|
107
107
|
"div",
|
|
108
108
|
{
|
|
109
109
|
className: "eloq:relative eloq:rounded-lg eloq:border eloq:p-3 eloq:cursor-pointer",
|
|
@@ -119,7 +119,7 @@ function Gt({
|
|
|
119
119
|
className: "eloq:absolute eloq:bottom-1 eloq:-right-[9px] eloq:h-4 eloq:w-4 eloq:-scale-x-100",
|
|
120
120
|
viewBox: "0 0 10.54 11.14",
|
|
121
121
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ x(
|
|
123
123
|
"path",
|
|
124
124
|
{
|
|
125
125
|
d: "M5.75,0s0,.36,0,.51c-.09,4.52-5.74,10.64-5.74,10.64,8.19.02,10.54-2.26,10.54-2.26h0c-1.6-2.96-3.19-5.92-4.79-8.88Z",
|
|
@@ -129,7 +129,7 @@ function Gt({
|
|
|
129
129
|
style: { stroke: "hsl(var(--border))" }
|
|
130
130
|
}
|
|
131
131
|
),
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ x(
|
|
133
133
|
"rect",
|
|
134
134
|
{
|
|
135
135
|
x: "6.2",
|
|
@@ -142,17 +142,17 @@ function Gt({
|
|
|
142
142
|
]
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ x(
|
|
146
146
|
"p",
|
|
147
147
|
{
|
|
148
148
|
className: "eloq:text-sm eloq:leading-relaxed eloq:pr-4",
|
|
149
149
|
style: {
|
|
150
|
-
color: a.botBubbleTextColor ||
|
|
150
|
+
color: a.botBubbleTextColor || at(a.botBubbleColor)
|
|
151
151
|
},
|
|
152
|
-
children:
|
|
152
|
+
children: e
|
|
153
153
|
}
|
|
154
154
|
),
|
|
155
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ x(
|
|
156
156
|
"button",
|
|
157
157
|
{
|
|
158
158
|
"aria-label": "Dismiss message",
|
|
@@ -163,9 +163,9 @@ function Gt({
|
|
|
163
163
|
style: {
|
|
164
164
|
// Follows the bubble's computed text colour, so the X blends
|
|
165
165
|
// with the message on any bubble background (and dark mode).
|
|
166
|
-
color: a.botBubbleTextColor ||
|
|
166
|
+
color: a.botBubbleTextColor || at(a.botBubbleColor)
|
|
167
167
|
},
|
|
168
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ x(Pt, { className: "eloq:w-2.5 eloq:h-2.5", strokeWidth: 1.75 })
|
|
169
169
|
}
|
|
170
170
|
)
|
|
171
171
|
]
|
|
@@ -174,62 +174,62 @@ function Gt({
|
|
|
174
174
|
}
|
|
175
175
|
) : null;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function lt(e) {
|
|
178
178
|
if (typeof document > "u") return null;
|
|
179
|
-
const
|
|
180
|
-
return
|
|
179
|
+
const t = document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));
|
|
180
|
+
return t ? decodeURIComponent(t[1]) : null;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function ro(e, t, o) {
|
|
183
183
|
if (typeof document > "u") return;
|
|
184
184
|
const r = new Date(Date.now() + o * 60 * 60 * 1e3).toUTCString();
|
|
185
|
-
document.cookie = `${
|
|
185
|
+
document.cookie = `${e}=${encodeURIComponent(t)}; expires=${r}; path=/; SameSite=Lax`;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
typeof document > "u" || (document.cookie = `${
|
|
187
|
+
function no(e) {
|
|
188
|
+
typeof document > "u" || (document.cookie = `${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
chatProps:
|
|
192
|
-
chatSettings:
|
|
190
|
+
function ao({
|
|
191
|
+
chatProps: e,
|
|
192
|
+
chatSettings: t
|
|
193
193
|
}) {
|
|
194
|
-
return
|
|
195
|
-
assistantName:
|
|
196
|
-
assistantLogo:
|
|
194
|
+
return Je(() => t ? {
|
|
195
|
+
assistantName: t.agent_name,
|
|
196
|
+
assistantLogo: t.avatar_url || void 0,
|
|
197
197
|
theme: {
|
|
198
|
-
...
|
|
199
|
-
mode:
|
|
200
|
-
userBubbleColor:
|
|
201
|
-
botBubbleColor:
|
|
202
|
-
suggestedMessageBubbleColor:
|
|
203
|
-
userBubbleTextColor:
|
|
204
|
-
botBubbleTextColor:
|
|
205
|
-
suggestedMessageBubbleTextColor:
|
|
198
|
+
...e?.theme,
|
|
199
|
+
mode: t.theme ?? "light",
|
|
200
|
+
userBubbleColor: t.user_bubble_color || e?.theme?.userBubbleColor,
|
|
201
|
+
botBubbleColor: t.bot_bubble_color || e?.theme?.botBubbleColor,
|
|
202
|
+
suggestedMessageBubbleColor: t.suggested_message_bubble_color || e?.theme?.suggestedMessageBubbleColor,
|
|
203
|
+
userBubbleTextColor: t.user_bubble_text_color || e?.theme?.userBubbleTextColor,
|
|
204
|
+
botBubbleTextColor: t.bot_bubble_text_color || e?.theme?.botBubbleTextColor,
|
|
205
|
+
suggestedMessageBubbleTextColor: t.suggested_message_bubble_text_color || e?.theme?.suggestedMessageBubbleTextColor
|
|
206
206
|
},
|
|
207
|
-
welcomeMessage:
|
|
208
|
-
legalText:
|
|
209
|
-
suggestedMessages:
|
|
210
|
-
suggestedMessageTexts:
|
|
207
|
+
welcomeMessage: t.welcome_message || void 0,
|
|
208
|
+
legalText: t.footer_html || void 0,
|
|
209
|
+
suggestedMessages: t.suggested_messages,
|
|
210
|
+
suggestedMessageTexts: t.suggested_message_texts ?? void 0,
|
|
211
211
|
// Boot value wins when the server sends one (?? so an explicit false
|
|
212
212
|
// still wins); the host-app prop is the fallback.
|
|
213
|
-
hasSuggestedMessageAura:
|
|
214
|
-
hasSuggestedMessageShine:
|
|
215
|
-
hasAttachments:
|
|
216
|
-
displayWelcomeMessages:
|
|
217
|
-
collectUserFeedback:
|
|
218
|
-
title:
|
|
219
|
-
subtitle:
|
|
220
|
-
} :
|
|
221
|
-
}
|
|
222
|
-
function
|
|
213
|
+
hasSuggestedMessageAura: t.suggested_message_aura ?? e?.hasSuggestedMessageAura,
|
|
214
|
+
hasSuggestedMessageShine: t.suggested_message_shine ?? e?.hasSuggestedMessageShine,
|
|
215
|
+
hasAttachments: t.attachments_enabled ?? e?.hasAttachments,
|
|
216
|
+
displayWelcomeMessages: t.auto_display_welcome_message,
|
|
217
|
+
collectUserFeedback: t.collect_user_feedback,
|
|
218
|
+
title: t.title || "responds instantly",
|
|
219
|
+
subtitle: t.subtitle || "Ask me anything"
|
|
220
|
+
} : e, [e, t]);
|
|
221
|
+
}
|
|
222
|
+
function io() {
|
|
223
223
|
if (typeof window > "u")
|
|
224
224
|
return {};
|
|
225
|
-
const
|
|
226
|
-
return
|
|
227
|
-
|
|
228
|
-
}),
|
|
229
|
-
}
|
|
230
|
-
const
|
|
231
|
-
function
|
|
232
|
-
const
|
|
225
|
+
const e = new URLSearchParams(window.location.search), t = {};
|
|
226
|
+
return e.forEach((o, r) => {
|
|
227
|
+
t[r] = o;
|
|
228
|
+
}), t;
|
|
229
|
+
}
|
|
230
|
+
const so = "eloquent-ai::conversation-data", Ce = typeof window < "u", lo = 1800 * 1e3;
|
|
231
|
+
function tt({ appId: e }) {
|
|
232
|
+
const t = Je(() => `${so}-${e}`, [e]), o = Je(
|
|
233
233
|
() => ({
|
|
234
234
|
conversationId: null,
|
|
235
235
|
userId: null,
|
|
@@ -237,10 +237,10 @@ function Qe({ appId: t }) {
|
|
|
237
237
|
messages: []
|
|
238
238
|
}),
|
|
239
239
|
[]
|
|
240
|
-
), r =
|
|
240
|
+
), r = w(() => {
|
|
241
241
|
try {
|
|
242
|
-
if (!
|
|
243
|
-
const a = localStorage.getItem(
|
|
242
|
+
if (!Ce) return o;
|
|
243
|
+
const a = localStorage.getItem(t);
|
|
244
244
|
return a ? JSON.parse(a) : o;
|
|
245
245
|
} catch (a) {
|
|
246
246
|
return console.error(
|
|
@@ -248,37 +248,37 @@ function Qe({ appId: t }) {
|
|
|
248
248
|
a
|
|
249
249
|
), o;
|
|
250
250
|
}
|
|
251
|
-
}, [
|
|
251
|
+
}, [t, o]), n = w(() => {
|
|
252
252
|
try {
|
|
253
253
|
const a = r();
|
|
254
|
-
return a.lastActivity ? Date.now() - a.lastActivity >
|
|
254
|
+
return a.lastActivity ? Date.now() - a.lastActivity > lo : !0;
|
|
255
255
|
} catch (a) {
|
|
256
256
|
return console.error("Error checking conversation expiration:", a), !0;
|
|
257
257
|
}
|
|
258
|
-
}, [r]), i =
|
|
259
|
-
(a, l,
|
|
258
|
+
}, [r]), i = w(
|
|
259
|
+
(a, l, u, p, h) => {
|
|
260
260
|
try {
|
|
261
|
-
if (!
|
|
262
|
-
const
|
|
261
|
+
if (!Ce) return;
|
|
262
|
+
const f = {
|
|
263
263
|
conversationId: a,
|
|
264
264
|
userId: l,
|
|
265
|
-
deviceId:
|
|
266
|
-
messages:
|
|
265
|
+
deviceId: p,
|
|
266
|
+
messages: co(u),
|
|
267
267
|
lastActivity: Date.now(),
|
|
268
|
-
chatToken:
|
|
268
|
+
chatToken: h
|
|
269
269
|
};
|
|
270
|
-
localStorage.setItem(
|
|
271
|
-
} catch (
|
|
272
|
-
console.error("Error saving conversation data to localStorage:",
|
|
270
|
+
localStorage.setItem(t, JSON.stringify(f));
|
|
271
|
+
} catch (f) {
|
|
272
|
+
console.error("Error saving conversation data to localStorage:", f);
|
|
273
273
|
}
|
|
274
274
|
},
|
|
275
|
-
[
|
|
276
|
-
),
|
|
275
|
+
[t]
|
|
276
|
+
), c = w(() => {
|
|
277
277
|
try {
|
|
278
|
-
if (!
|
|
278
|
+
if (!Ce) return;
|
|
279
279
|
const a = r();
|
|
280
280
|
localStorage.setItem(
|
|
281
|
-
|
|
281
|
+
t,
|
|
282
282
|
JSON.stringify({ ...a, isChatClosed: !0 })
|
|
283
283
|
);
|
|
284
284
|
} catch (a) {
|
|
@@ -287,14 +287,14 @@ function Qe({ appId: t }) {
|
|
|
287
287
|
a
|
|
288
288
|
);
|
|
289
289
|
}
|
|
290
|
-
}, [
|
|
290
|
+
}, [t, r]), s = w(() => {
|
|
291
291
|
try {
|
|
292
|
-
if (!
|
|
293
|
-
const a = localStorage.getItem(
|
|
292
|
+
if (!Ce) return;
|
|
293
|
+
const a = localStorage.getItem(t);
|
|
294
294
|
if (a) {
|
|
295
295
|
const l = JSON.parse(a);
|
|
296
296
|
localStorage.setItem(
|
|
297
|
-
|
|
297
|
+
t,
|
|
298
298
|
JSON.stringify({
|
|
299
299
|
...o,
|
|
300
300
|
deviceId: l.deviceId,
|
|
@@ -308,128 +308,128 @@ function Qe({ appId: t }) {
|
|
|
308
308
|
a
|
|
309
309
|
);
|
|
310
310
|
}
|
|
311
|
-
}, [
|
|
311
|
+
}, [t, o]), d = w(() => {
|
|
312
312
|
try {
|
|
313
|
-
if (!
|
|
313
|
+
if (!Ce) return;
|
|
314
314
|
const a = r();
|
|
315
|
-
a.conversationId && (a.lastActivity = Date.now(), localStorage.setItem(
|
|
315
|
+
a.conversationId && (a.lastActivity = Date.now(), localStorage.setItem(t, JSON.stringify(a)));
|
|
316
316
|
} catch (a) {
|
|
317
317
|
console.error("Error updating last activity timestamp:", a);
|
|
318
318
|
}
|
|
319
|
-
}, [r,
|
|
319
|
+
}, [r, t]);
|
|
320
320
|
return {
|
|
321
321
|
isChatExpired: n,
|
|
322
322
|
saveChatData: i,
|
|
323
323
|
clearChatData: s,
|
|
324
324
|
getSavedChatData: r,
|
|
325
|
-
updateLastActivity:
|
|
326
|
-
markChatClosed:
|
|
325
|
+
updateLastActivity: d,
|
|
326
|
+
markChatClosed: c
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
return
|
|
331
|
-
if (!
|
|
332
|
-
const o =
|
|
333
|
-
return o.length > 0 ? [{ ...
|
|
329
|
+
function co(e) {
|
|
330
|
+
return e.flatMap((t) => {
|
|
331
|
+
if (!t.attachments) return [t];
|
|
332
|
+
const o = t.attachments.filter((r) => At(r.url)).map(({ url: r, mimeType: n, name: i }) => ({ url: r, mimeType: n, name: i }));
|
|
333
|
+
return o.length > 0 ? [{ ...t, attachments: o }] : t.content ? [{ ...t, attachments: void 0 }] : [];
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
const
|
|
337
|
-
function
|
|
338
|
-
const
|
|
339
|
-
return /\.appsync-api\.[\w-]+\.amazonaws\.com(\.cn)?$/.test(
|
|
336
|
+
const uo = "aws-appsync-event-ws", po = 15e3, ho = 3e5, fo = 5e3, go = 1;
|
|
337
|
+
function mo(e) {
|
|
338
|
+
const t = new URL(e);
|
|
339
|
+
return /\.appsync-api\.[\w-]+\.amazonaws\.com(\.cn)?$/.test(t.hostname) && (t.hostname = t.hostname.replace(
|
|
340
340
|
".appsync-api.",
|
|
341
341
|
".appsync-realtime-api."
|
|
342
|
-
)),
|
|
342
|
+
)), t.protocol = "wss:", t.pathname = `${t.pathname.replace(/\/$/, "")}/realtime`, t.toString();
|
|
343
343
|
}
|
|
344
|
-
function
|
|
345
|
-
const o = new URL(
|
|
346
|
-
return "authorizationToken" in
|
|
344
|
+
function bo(e, t) {
|
|
345
|
+
const o = new URL(e).host;
|
|
346
|
+
return "authorizationToken" in t ? { Authorization: t.authorizationToken, host: o } : { "x-api-key": t.apiKey, host: o };
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
return `header-${btoa(JSON.stringify(
|
|
348
|
+
function vo(e) {
|
|
349
|
+
return `header-${btoa(JSON.stringify(e)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "")}`;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
return !
|
|
351
|
+
function Ve(e) {
|
|
352
|
+
return !e || e.length === 0 ? "unknown error" : e.map((t) => `${t.errorType ?? "Error"}: ${t.message ?? ""}`).join("; ");
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function wo(e) {
|
|
355
355
|
const {
|
|
356
|
-
httpEndpoint:
|
|
356
|
+
httpEndpoint: t,
|
|
357
357
|
auth: o,
|
|
358
358
|
channel: r,
|
|
359
359
|
onEvent: n,
|
|
360
360
|
onDisconnect: i,
|
|
361
|
-
createWebSocket:
|
|
362
|
-
} =
|
|
363
|
-
return new Promise((l,
|
|
364
|
-
let
|
|
361
|
+
createWebSocket: c = (l, u) => new WebSocket(l, u)
|
|
362
|
+
} = e, s = bo(t, o), d = mo(t), a = crypto.randomUUID();
|
|
363
|
+
return new Promise((l, u) => {
|
|
364
|
+
let p;
|
|
365
365
|
try {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
366
|
+
p = c(d, [
|
|
367
|
+
uo,
|
|
368
|
+
vo(s)
|
|
369
369
|
]);
|
|
370
|
-
} catch (
|
|
371
|
-
|
|
370
|
+
} catch (m) {
|
|
371
|
+
u(m instanceof Error ? m : new Error(String(m)));
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
|
-
let
|
|
374
|
+
let h = "connecting", f = !1, g = ho, k = Date.now(), q = null, I = null;
|
|
375
375
|
const j = () => {
|
|
376
|
-
|
|
377
|
-
},
|
|
378
|
-
if (
|
|
379
|
-
const y =
|
|
380
|
-
|
|
376
|
+
q && (clearTimeout(q), q = null), I && (clearInterval(I), I = null);
|
|
377
|
+
}, S = (m) => {
|
|
378
|
+
if (h === "closed") return;
|
|
379
|
+
const y = h === "established";
|
|
380
|
+
h = "closed", j();
|
|
381
381
|
try {
|
|
382
|
-
|
|
382
|
+
p.close();
|
|
383
383
|
} catch {
|
|
384
384
|
}
|
|
385
|
-
|
|
386
|
-
},
|
|
387
|
-
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
},
|
|
385
|
+
f || (y ? i(m) : u(new Error(m)));
|
|
386
|
+
}, $ = (m) => {
|
|
387
|
+
p.readyState === go && p.send(JSON.stringify(m));
|
|
388
|
+
}, R = (m) => {
|
|
389
|
+
q && clearTimeout(q), q = setTimeout(() => {
|
|
390
|
+
S(`Timed out waiting for ${m}`);
|
|
391
|
+
}, po);
|
|
392
392
|
};
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}),
|
|
396
|
-
if (
|
|
393
|
+
p.addEventListener("open", () => {
|
|
394
|
+
h !== "closed" && ($({ type: "connection_init" }), R("connection_ack"));
|
|
395
|
+
}), p.addEventListener("message", (m) => {
|
|
396
|
+
if (h === "closed") return;
|
|
397
397
|
let y;
|
|
398
398
|
try {
|
|
399
|
-
y = JSON.parse(String(
|
|
399
|
+
y = JSON.parse(String(m.data));
|
|
400
400
|
} catch {
|
|
401
401
|
console.warn("[EloquentChatSDK] Unparseable realtime frame ignored");
|
|
402
402
|
return;
|
|
403
403
|
}
|
|
404
404
|
switch (y.type) {
|
|
405
405
|
case "connection_ack": {
|
|
406
|
-
if (
|
|
407
|
-
|
|
406
|
+
if (h !== "connecting") return;
|
|
407
|
+
h = "subscribing", typeof y.connectionTimeoutMs == "number" && (g = y.connectionTimeoutMs), $({
|
|
408
408
|
type: "subscribe",
|
|
409
409
|
id: a,
|
|
410
410
|
channel: r,
|
|
411
411
|
authorization: s
|
|
412
|
-
}),
|
|
412
|
+
}), R("subscribe_success");
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
415
|
case "connection_error": {
|
|
416
|
-
|
|
416
|
+
S(`Connection error: ${Ve(y.errors)}`);
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
419
|
case "subscribe_success": {
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
Date.now() - k >
|
|
423
|
-
},
|
|
420
|
+
if (h !== "subscribing" || y.id !== a) return;
|
|
421
|
+
h = "established", q && (clearTimeout(q), q = null), k = Date.now(), I = setInterval(() => {
|
|
422
|
+
Date.now() - k > g && S("Keep-alive timeout");
|
|
423
|
+
}, fo), l({
|
|
424
424
|
close: () => {
|
|
425
|
-
|
|
425
|
+
f = !0, $({ type: "unsubscribe", id: a }), S("Closed by client");
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
430
|
case "subscribe_error": {
|
|
431
431
|
if (y.id !== a) return;
|
|
432
|
-
|
|
432
|
+
S(`Subscribe error: ${Ve(y.errors)}`);
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
435
|
case "ka": {
|
|
@@ -439,309 +439,309 @@ function po(t) {
|
|
|
439
439
|
case "data": {
|
|
440
440
|
if (y.id !== a) return;
|
|
441
441
|
k = Date.now();
|
|
442
|
-
let
|
|
443
|
-
if (typeof
|
|
442
|
+
let P = y.event;
|
|
443
|
+
if (typeof P == "string")
|
|
444
444
|
try {
|
|
445
|
-
|
|
445
|
+
P = JSON.parse(P);
|
|
446
446
|
} catch {
|
|
447
447
|
console.warn(
|
|
448
448
|
"[EloquentChatSDK] Unparseable realtime event ignored"
|
|
449
449
|
);
|
|
450
450
|
return;
|
|
451
451
|
}
|
|
452
|
-
n(
|
|
452
|
+
n(P);
|
|
453
453
|
return;
|
|
454
454
|
}
|
|
455
455
|
case "broadcast_error": {
|
|
456
456
|
console.warn(
|
|
457
457
|
"[EloquentChatSDK] Realtime broadcast error:",
|
|
458
|
-
|
|
458
|
+
Ve(y.errors)
|
|
459
459
|
);
|
|
460
460
|
return;
|
|
461
461
|
}
|
|
462
462
|
default:
|
|
463
463
|
return;
|
|
464
464
|
}
|
|
465
|
-
}),
|
|
466
|
-
|
|
467
|
-
}),
|
|
468
|
-
|
|
465
|
+
}), p.addEventListener("close", () => {
|
|
466
|
+
S("WebSocket closed");
|
|
467
|
+
}), p.addEventListener("error", () => {
|
|
468
|
+
S("WebSocket error");
|
|
469
469
|
});
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
return typeof
|
|
472
|
+
function qo(e, t) {
|
|
473
|
+
return typeof t == "bigint" ? t.toString() : t;
|
|
474
474
|
}
|
|
475
|
-
class
|
|
476
|
-
constructor(
|
|
477
|
-
this._getter =
|
|
475
|
+
class yo {
|
|
476
|
+
constructor(t) {
|
|
477
|
+
this._getter = t, this._value = void 0;
|
|
478
478
|
}
|
|
479
479
|
get value() {
|
|
480
|
-
const
|
|
481
|
-
return
|
|
480
|
+
const t = this._getter;
|
|
481
|
+
return t !== void 0 && (this._value = t(), this._getter = void 0), this._value;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
return new
|
|
484
|
+
function xo(e) {
|
|
485
|
+
return new yo(e);
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
const
|
|
489
|
-
return
|
|
487
|
+
function yt(e) {
|
|
488
|
+
const t = e.startsWith("^") ? 1 : 0, o = e.endsWith("$") ? e.length - 1 : e.length;
|
|
489
|
+
return e.slice(t, o);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
Object.defineProperty(
|
|
491
|
+
function ko(e, t, o) {
|
|
492
|
+
Object.defineProperty(e, t, {
|
|
493
493
|
value: o,
|
|
494
494
|
writable: !0,
|
|
495
495
|
enumerable: !0,
|
|
496
496
|
configurable: !0
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
|
-
const
|
|
499
|
+
const xt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
500
500
|
};
|
|
501
|
-
function
|
|
502
|
-
return typeof
|
|
501
|
+
function Ye(e) {
|
|
502
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
if (
|
|
504
|
+
function _o(e) {
|
|
505
|
+
if (Ye(e) === !1)
|
|
506
506
|
return !1;
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
507
|
+
const t = e.constructor;
|
|
508
|
+
if (t === void 0 || typeof t != "function")
|
|
509
509
|
return !0;
|
|
510
|
-
const o =
|
|
511
|
-
return !(
|
|
510
|
+
const o = t.prototype;
|
|
511
|
+
return !(Ye(o) === !1 || Object.prototype.hasOwnProperty.call(o, "isPrototypeOf") === !1);
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
return
|
|
513
|
+
function ct(e) {
|
|
514
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
const r = new
|
|
518
|
-
return (!
|
|
516
|
+
function Co(e, t, o) {
|
|
517
|
+
const r = new e._zod.constr(t ?? e._zod.def);
|
|
518
|
+
return (!t || o?.parent) && (r._zod.parent = e), r;
|
|
519
519
|
}
|
|
520
|
-
function
|
|
521
|
-
const
|
|
522
|
-
if (!
|
|
520
|
+
function ye(e) {
|
|
521
|
+
const t = e;
|
|
522
|
+
if (!t)
|
|
523
523
|
return {};
|
|
524
|
-
if (typeof
|
|
525
|
-
return { error: () =>
|
|
526
|
-
if (
|
|
527
|
-
if (
|
|
524
|
+
if (typeof t == "string")
|
|
525
|
+
return { error: () => t };
|
|
526
|
+
if (t?.message !== void 0) {
|
|
527
|
+
if (t?.error !== void 0)
|
|
528
528
|
throw new Error("Cannot specify both `message` and `error` params");
|
|
529
|
-
|
|
529
|
+
t.error = t.message;
|
|
530
530
|
}
|
|
531
|
-
return delete
|
|
531
|
+
return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
return Object.keys(
|
|
533
|
+
function So(e) {
|
|
534
|
+
return Object.keys(e).filter((t) => e[t]._zod.optin !== void 0 && e[t]._zod.optout === "optional");
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
if (
|
|
536
|
+
function qe(e, t = 0) {
|
|
537
|
+
if (e.aborted === !0)
|
|
538
538
|
return !0;
|
|
539
|
-
for (let o =
|
|
540
|
-
if (
|
|
539
|
+
for (let o = t; o < e.issues.length; o++)
|
|
540
|
+
if (e.issues[o]?.continue !== !0)
|
|
541
541
|
return !0;
|
|
542
542
|
return !1;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
545
|
-
if (
|
|
544
|
+
function Io(e, t = 0) {
|
|
545
|
+
if (e.aborted === !0)
|
|
546
546
|
return !0;
|
|
547
|
-
for (let o =
|
|
548
|
-
if (
|
|
547
|
+
for (let o = t; o < e.issues.length; o++)
|
|
548
|
+
if (e.issues[o]?.continue === !1)
|
|
549
549
|
return !0;
|
|
550
550
|
return !1;
|
|
551
551
|
}
|
|
552
|
-
function
|
|
553
|
-
return
|
|
552
|
+
function Ie(e, t) {
|
|
553
|
+
return t.map((o) => {
|
|
554
554
|
var r;
|
|
555
|
-
return (r = o).path ?? (r.path = []), o.path.unshift(
|
|
555
|
+
return (r = o).path ?? (r.path = []), o.path.unshift(e), o;
|
|
556
556
|
});
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
return typeof
|
|
558
|
+
function Se(e) {
|
|
559
|
+
return typeof e == "string" ? e : e?.message;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function dt(e, t, o) {
|
|
562
562
|
var r;
|
|
563
|
-
for (let n =
|
|
564
|
-
(r =
|
|
563
|
+
for (let n = t; n < e.length; n++)
|
|
564
|
+
(r = e[n]).schema ?? (r.schema = o);
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function xe(e, t, o) {
|
|
567
567
|
var r;
|
|
568
|
-
const n =
|
|
569
|
-
n?.has("$ZodType") && (n.has("$ZodCheck") ? (r =
|
|
570
|
-
const i =
|
|
571
|
-
for (const
|
|
572
|
-
|
|
573
|
-
return s.path ?? (s.path = []), s.message =
|
|
574
|
-
}
|
|
575
|
-
function
|
|
576
|
-
for (const o in
|
|
577
|
-
const r = Object.getOwnPropertyDescriptor(
|
|
578
|
-
r.get ? Object.defineProperty(
|
|
568
|
+
const n = e.inst?._zod?.traits;
|
|
569
|
+
n?.has("$ZodType") && (n.has("$ZodCheck") ? (r = e).schema ?? (r.schema = e.inst) : e.schema = e.inst);
|
|
570
|
+
const i = e.schema !== e.inst ? e.schema?._zod.def?.error : void 0, c = e.message ? e.message : Se(e.inst?._zod.def?.error?.(e)) ?? Se(i?.(e)) ?? Se(t?.error?.(e)) ?? Se(o.customError?.(e)) ?? Se(o.localeError?.(e)) ?? "Invalid input", s = {};
|
|
571
|
+
for (const d of Object.keys(e))
|
|
572
|
+
d === "inst" || d === "schema" || d === "continue" || d === "input" || d === "__proto__" || (s[d] = e[d]);
|
|
573
|
+
return s.path ?? (s.path = []), s.message = c, t?.reportInput && (s.input = e.input), s;
|
|
574
|
+
}
|
|
575
|
+
function Eo(e, t) {
|
|
576
|
+
for (const o in t) {
|
|
577
|
+
const r = Object.getOwnPropertyDescriptor(t, o);
|
|
578
|
+
r.get ? Object.defineProperty(e, o, { ...r, enumerable: !1 }) : Ro(e, o, r.value);
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
return Object.defineProperty(
|
|
581
|
+
function Re(e, t, o, r = !0) {
|
|
582
|
+
return Object.defineProperty(e, t, { configurable: !0, writable: !0, enumerable: r, value: o }), o;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
return
|
|
584
|
+
function zo(e, t, o) {
|
|
585
|
+
return Re(e, t, o, !1);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
588
|
-
Object.defineProperty(
|
|
587
|
+
function Ro(e, t, o) {
|
|
588
|
+
Object.defineProperty(e, t, {
|
|
589
589
|
configurable: !0,
|
|
590
590
|
get() {
|
|
591
|
-
return this == null ? o :
|
|
591
|
+
return this == null ? o : Re(this, t, o.bind(this));
|
|
592
592
|
},
|
|
593
593
|
set(r) {
|
|
594
|
-
|
|
594
|
+
Re(this, t, r);
|
|
595
595
|
}
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
const o = Object.getPrototypeOf(
|
|
600
|
-
return
|
|
598
|
+
function To(e, t) {
|
|
599
|
+
const o = Object.getPrototypeOf(e);
|
|
600
|
+
return t in o ? void 0 : o;
|
|
601
601
|
}
|
|
602
|
-
let He,
|
|
603
|
-
const
|
|
602
|
+
let He, be = !1;
|
|
603
|
+
const Mo = {
|
|
604
604
|
configurable: !0,
|
|
605
605
|
get() {
|
|
606
|
-
|
|
606
|
+
be = !0;
|
|
607
607
|
}
|
|
608
608
|
};
|
|
609
|
-
function
|
|
610
|
-
const r = Object.getPrototypeOf(
|
|
611
|
-
if (
|
|
609
|
+
function de(e, t, o) {
|
|
610
|
+
const r = Object.getPrototypeOf(e._zod);
|
|
611
|
+
if (t in r && He !== e._zod) {
|
|
612
612
|
He = void 0;
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
|
-
He =
|
|
615
|
+
He = e._zod, Object.defineProperty(r, t, {
|
|
616
616
|
configurable: !0,
|
|
617
617
|
get() {
|
|
618
|
-
Object.defineProperty(this,
|
|
619
|
-
const n =
|
|
620
|
-
|
|
618
|
+
Object.defineProperty(this, t, Mo);
|
|
619
|
+
const n = be;
|
|
620
|
+
be = !1;
|
|
621
621
|
try {
|
|
622
622
|
const i = o(this);
|
|
623
|
-
return
|
|
623
|
+
return be ? delete this[t] : Object.defineProperty(this, t, { configurable: !0, writable: !0, value: i }), be = be || n, i;
|
|
624
624
|
} catch (i) {
|
|
625
|
-
throw delete this[
|
|
625
|
+
throw delete this[t], be = be || n, i;
|
|
626
626
|
}
|
|
627
627
|
},
|
|
628
628
|
set(n) {
|
|
629
|
-
Object.defineProperty(this,
|
|
629
|
+
Object.defineProperty(this, t, { configurable: !0, writable: !0, value: n });
|
|
630
630
|
}
|
|
631
631
|
});
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
const n =
|
|
635
|
-
n && Object.defineProperty(n,
|
|
633
|
+
function Po(e, t, o, r) {
|
|
634
|
+
const n = To(e, t);
|
|
635
|
+
n && Object.defineProperty(n, t, {
|
|
636
636
|
configurable: !0,
|
|
637
637
|
get() {
|
|
638
638
|
const i = { configurable: !0, writable: !0, enumerable: r, value: void 0 };
|
|
639
|
-
return Object.defineProperty(this,
|
|
639
|
+
return Object.defineProperty(this, t, i), i.value = o(this), Object.defineProperty(this, t, i), i.value;
|
|
640
640
|
},
|
|
641
641
|
set(i) {
|
|
642
|
-
Object.defineProperty(this,
|
|
642
|
+
Object.defineProperty(this, t, { configurable: !0, writable: !0, enumerable: r, value: i });
|
|
643
643
|
}
|
|
644
644
|
});
|
|
645
645
|
}
|
|
646
|
-
var
|
|
647
|
-
const
|
|
648
|
-
let
|
|
649
|
-
function
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
652
|
-
const o =
|
|
646
|
+
var ut;
|
|
647
|
+
const We = { value: void 0, enumerable: !1 };
|
|
648
|
+
let pt = "captureStackTrace" in Error ? Error : null;
|
|
649
|
+
function Ao(e) {
|
|
650
|
+
const t = pt;
|
|
651
|
+
if (t) {
|
|
652
|
+
const o = t.stackTraceLimit;
|
|
653
653
|
if (typeof o == "number") {
|
|
654
654
|
try {
|
|
655
|
-
|
|
655
|
+
t.stackTraceLimit = 0;
|
|
656
656
|
} catch {
|
|
657
|
-
return
|
|
657
|
+
return pt = null, new e();
|
|
658
658
|
}
|
|
659
659
|
try {
|
|
660
|
-
return new
|
|
660
|
+
return new e();
|
|
661
661
|
} finally {
|
|
662
|
-
|
|
662
|
+
t.stackTraceLimit = o;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
return new
|
|
666
|
+
return new e();
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function F(e, t, o, r) {
|
|
669
669
|
const n = {};
|
|
670
|
-
function i(
|
|
671
|
-
this.def =
|
|
670
|
+
function i(p) {
|
|
671
|
+
this.def = p, this.constr = u, this.traits = /* @__PURE__ */ new Set();
|
|
672
672
|
}
|
|
673
673
|
i.prototype = n;
|
|
674
|
-
const
|
|
675
|
-
function
|
|
676
|
-
if (
|
|
677
|
-
if (
|
|
674
|
+
const c = o, s = c && /* @__PURE__ */ new WeakSet();
|
|
675
|
+
function d(p, h) {
|
|
676
|
+
if (p._zod) {
|
|
677
|
+
if (p._zod.traits.has(e))
|
|
678
678
|
return;
|
|
679
679
|
} else {
|
|
680
|
-
|
|
680
|
+
We.value = new i(h);
|
|
681
681
|
try {
|
|
682
|
-
Object.defineProperty(
|
|
682
|
+
Object.defineProperty(p, "_zod", We);
|
|
683
683
|
} finally {
|
|
684
|
-
|
|
684
|
+
We.value = void 0;
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
if (
|
|
688
|
-
const
|
|
689
|
-
let
|
|
690
|
-
for (;
|
|
691
|
-
|
|
692
|
-
const I =
|
|
693
|
-
s.has(I) || (s.add(I),
|
|
687
|
+
if (p._zod.traits.add(e), t(p, h), s) {
|
|
688
|
+
const g = Object.getPrototypeOf(p), k = p._zod.constr.prototype;
|
|
689
|
+
let q = g;
|
|
690
|
+
for (; q && q !== k; )
|
|
691
|
+
q = Object.getPrototypeOf(q);
|
|
692
|
+
const I = q ?? g;
|
|
693
|
+
s.has(I) || (s.add(I), Eo(I, c));
|
|
694
694
|
}
|
|
695
|
-
const
|
|
696
|
-
for (const
|
|
697
|
-
Object.prototype.hasOwnProperty.call(
|
|
695
|
+
const f = u.prototype;
|
|
696
|
+
for (const g in f)
|
|
697
|
+
Object.prototype.hasOwnProperty.call(f, g) && (g in p || (p[g] = f[g].bind(p)));
|
|
698
698
|
}
|
|
699
699
|
const a = r?.Parent ?? Object;
|
|
700
700
|
class l extends a {
|
|
701
701
|
}
|
|
702
|
-
Object.defineProperty(l, "name", { value:
|
|
703
|
-
function
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
708
|
-
for (const k of
|
|
702
|
+
Object.defineProperty(l, "name", { value: e });
|
|
703
|
+
function u(p) {
|
|
704
|
+
const h = r?.Parent ? Ao(l) : this;
|
|
705
|
+
d(h, p);
|
|
706
|
+
const f = h._zod.deferred;
|
|
707
|
+
if (f) {
|
|
708
|
+
for (const k of f)
|
|
709
709
|
k();
|
|
710
|
-
|
|
710
|
+
h._zod.deferred = void 0;
|
|
711
711
|
}
|
|
712
|
-
const
|
|
713
|
-
return
|
|
712
|
+
const g = globalThis.__zod_globalConfig?.postProcessor;
|
|
713
|
+
return g && g(h), h;
|
|
714
714
|
}
|
|
715
|
-
return Object.defineProperty(
|
|
716
|
-
value: (
|
|
717
|
-
}), Object.defineProperty(
|
|
715
|
+
return Object.defineProperty(u, "init", { value: d }), Object.defineProperty(u, Symbol.hasInstance, {
|
|
716
|
+
value: (p) => r?.Parent && p instanceof r.Parent ? !0 : p?._zod?.traits?.has(e)
|
|
717
|
+
}), Object.defineProperty(u, "name", { value: e }), u;
|
|
718
718
|
}
|
|
719
|
-
class
|
|
719
|
+
class Ee extends Error {
|
|
720
720
|
constructor() {
|
|
721
721
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
(
|
|
725
|
-
const
|
|
726
|
-
function
|
|
727
|
-
return
|
|
724
|
+
(ut = globalThis).__zod_globalConfig ?? (ut.__zod_globalConfig = {});
|
|
725
|
+
const Ue = globalThis.__zod_globalConfig;
|
|
726
|
+
function ve(e) {
|
|
727
|
+
return e && Object.assign(Ue, e), Ue;
|
|
728
728
|
}
|
|
729
|
-
function
|
|
730
|
-
const
|
|
731
|
-
return
|
|
729
|
+
function Oo() {
|
|
730
|
+
const e = this._zod;
|
|
731
|
+
return e.message ?? (e.message = JSON.stringify(e.def, qo, 2)), e.message;
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
this._zod.message =
|
|
733
|
+
function Uo(e) {
|
|
734
|
+
this._zod.message = e;
|
|
735
735
|
}
|
|
736
|
-
const
|
|
737
|
-
get:
|
|
738
|
-
set:
|
|
736
|
+
const jo = {
|
|
737
|
+
get: Oo,
|
|
738
|
+
set: Uo,
|
|
739
739
|
enumerable: !0,
|
|
740
740
|
configurable: !0
|
|
741
|
-
},
|
|
742
|
-
|
|
743
|
-
const o = Object.getPrototypeOf(
|
|
744
|
-
|
|
741
|
+
}, Fe = { value: void 0, enumerable: !1 }, ht = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]), Do = (e, t) => {
|
|
742
|
+
e.name = "$ZodError", Fe.value = t, Object.defineProperty(e, "issues", Fe), Fe.value = void 0, Object.defineProperty(e, "message", jo);
|
|
743
|
+
const o = Object.getPrototypeOf(e);
|
|
744
|
+
ht.has(o) || (ht.add(o), Object.defineProperty(o, "toString", {
|
|
745
745
|
configurable: !0,
|
|
746
746
|
enumerable: !1,
|
|
747
747
|
get() {
|
|
@@ -752,152 +752,152 @@ const Po = {
|
|
|
752
752
|
Object.defineProperty(this, "toString", { value: r, configurable: !0, writable: !0 });
|
|
753
753
|
}
|
|
754
754
|
}));
|
|
755
|
-
},
|
|
755
|
+
}, $e = F("$ZodError", Do, void 0, {
|
|
756
756
|
Parent: Error
|
|
757
|
-
}),
|
|
758
|
-
const
|
|
759
|
-
const
|
|
757
|
+
}), $o = (e) => {
|
|
758
|
+
const t = (o, r, n, i) => {
|
|
759
|
+
const c = n ? { ...n, async: !1 } : { async: !1 }, s = o._zod.run({ value: r, issues: [] }, c);
|
|
760
760
|
if (s instanceof Promise)
|
|
761
|
-
throw new
|
|
761
|
+
throw new Ee();
|
|
762
762
|
if (s.issues.length) {
|
|
763
|
-
const
|
|
764
|
-
throw
|
|
763
|
+
const d = new (i?.Err ?? e)(s.issues.map((a) => xe(a, c, ve())));
|
|
764
|
+
throw xt(d, i?.callee ?? t), d;
|
|
765
765
|
}
|
|
766
766
|
return s.value;
|
|
767
767
|
};
|
|
768
|
-
return
|
|
769
|
-
},
|
|
770
|
-
const
|
|
771
|
-
const
|
|
772
|
-
let s = o._zod.run({ value: r, issues: [] },
|
|
768
|
+
return t;
|
|
769
|
+
}, Bo = /* @__PURE__ */ $o($e), Lo = (e) => {
|
|
770
|
+
const t = async (o, r, n, i) => {
|
|
771
|
+
const c = n ? { ...n, async: !0 } : { async: !0 };
|
|
772
|
+
let s = o._zod.run({ value: r, issues: [] }, c);
|
|
773
773
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
774
|
-
const
|
|
775
|
-
throw
|
|
774
|
+
const d = new (i?.Err ?? e)(s.issues.map((a) => xe(a, c, ve())));
|
|
775
|
+
throw xt(d, i?.callee ?? t), d;
|
|
776
776
|
}
|
|
777
777
|
return s.value;
|
|
778
778
|
};
|
|
779
|
-
return
|
|
780
|
-
},
|
|
781
|
-
const n = r ? { ...r, async: !1 } : { async: !1 }, i =
|
|
779
|
+
return t;
|
|
780
|
+
}, No = /* @__PURE__ */ Lo($e), Zo = (e) => (t, o, r) => {
|
|
781
|
+
const n = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: o, issues: [] }, n);
|
|
782
782
|
if (i instanceof Promise)
|
|
783
|
-
throw new
|
|
784
|
-
return i.issues.length ?
|
|
785
|
-
},
|
|
786
|
-
function
|
|
783
|
+
throw new Ee();
|
|
784
|
+
return i.issues.length ? kt(e, i.issues, n) : { success: !0, data: i.value };
|
|
785
|
+
}, Ko = /* @__PURE__ */ Zo($e);
|
|
786
|
+
function kt(e, t, o) {
|
|
787
787
|
let r;
|
|
788
788
|
return {
|
|
789
789
|
success: !1,
|
|
790
790
|
get error() {
|
|
791
|
-
return r || (r = new t
|
|
791
|
+
return r || (r = new e(t.map((n) => xe(n, o, ve()))), t = void 0, o = void 0), r;
|
|
792
792
|
},
|
|
793
793
|
set error(n) {
|
|
794
|
-
r = n,
|
|
794
|
+
r = n, t = void 0, o = void 0;
|
|
795
795
|
}
|
|
796
796
|
};
|
|
797
797
|
}
|
|
798
|
-
const
|
|
798
|
+
const Vo = (e) => async (t, o, r) => {
|
|
799
799
|
const n = r ? { ...r, async: !0 } : { async: !0 };
|
|
800
|
-
let i =
|
|
801
|
-
return i instanceof Promise && (i = await i), i.issues.length ?
|
|
802
|
-
},
|
|
800
|
+
let i = t._zod.run({ value: o, issues: [] }, n);
|
|
801
|
+
return i instanceof Promise && (i = await i), i.issues.length ? kt(e, i.issues, n) : { success: !0, data: i.value };
|
|
802
|
+
}, Ho = /* @__PURE__ */ Vo($e), Wo = /^[\s\S]{0,}$/, Fo = /^-?\d+(?:\.\d+)?$/, Jo = /^null$/i, Go = {
|
|
803
803
|
major: 4,
|
|
804
804
|
minor: 6,
|
|
805
805
|
patch: 7
|
|
806
|
-
},
|
|
806
|
+
}, we = /* @__PURE__ */ F("$ZodType", (e, t) => {
|
|
807
807
|
var o;
|
|
808
|
-
|
|
809
|
-
const r =
|
|
808
|
+
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Go;
|
|
809
|
+
const r = e._zod.def.checks, n = e._zod.traits.has("$ZodCheck") ? [e, ...r ?? []] : r?.length ? [...r] : [];
|
|
810
810
|
for (const i of n)
|
|
811
|
-
for (const
|
|
812
|
-
|
|
811
|
+
for (const c of i._zod.onattach)
|
|
812
|
+
c(e);
|
|
813
813
|
if (n.length === 0)
|
|
814
|
-
(o =
|
|
815
|
-
|
|
814
|
+
(o = e._zod).deferred ?? (o.deferred = []), e._zod.deferred?.push(() => {
|
|
815
|
+
e._zod.run = e._zod.parse;
|
|
816
816
|
});
|
|
817
817
|
else {
|
|
818
|
-
const i = (s,
|
|
818
|
+
const i = (s, d, a) => {
|
|
819
819
|
if (s.memo)
|
|
820
820
|
return s;
|
|
821
|
-
let l =
|
|
822
|
-
for (const
|
|
823
|
-
if (
|
|
824
|
-
if (
|
|
821
|
+
let l = qe(s), u;
|
|
822
|
+
for (const p of d) {
|
|
823
|
+
if (p._zod.def.when) {
|
|
824
|
+
if (Io(s) || !p._zod.def.when(s))
|
|
825
825
|
continue;
|
|
826
826
|
} else if (l)
|
|
827
827
|
continue;
|
|
828
|
-
const
|
|
829
|
-
if (
|
|
830
|
-
throw new
|
|
831
|
-
if (
|
|
832
|
-
|
|
833
|
-
await
|
|
828
|
+
const h = s.issues.length, f = p._zod.check(s);
|
|
829
|
+
if (f instanceof Promise && a?.async === !1)
|
|
830
|
+
throw new Ee();
|
|
831
|
+
if (u || f instanceof Promise)
|
|
832
|
+
u = (u ?? Promise.resolve()).then(async () => {
|
|
833
|
+
await f, s.issues.length !== h && (dt(s.issues, h, e), l || (l = qe(s, h)));
|
|
834
834
|
});
|
|
835
835
|
else {
|
|
836
|
-
if (s.issues.length ===
|
|
836
|
+
if (s.issues.length === h)
|
|
837
837
|
continue;
|
|
838
|
-
|
|
838
|
+
dt(s.issues, h, e), l || (l = qe(s, h));
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
-
return
|
|
842
|
-
},
|
|
843
|
-
if (
|
|
841
|
+
return u ? u.then(() => s) : s;
|
|
842
|
+
}, c = (s, d, a) => {
|
|
843
|
+
if (qe(s))
|
|
844
844
|
return s.aborted = !0, s;
|
|
845
|
-
const l = i(
|
|
845
|
+
const l = i(d, n, a);
|
|
846
846
|
if (l instanceof Promise) {
|
|
847
847
|
if (a.async === !1)
|
|
848
|
-
throw new
|
|
849
|
-
return l.then((
|
|
848
|
+
throw new Ee();
|
|
849
|
+
return l.then((u) => e._zod.parse(u, a));
|
|
850
850
|
}
|
|
851
|
-
return
|
|
851
|
+
return e._zod.parse(l, a);
|
|
852
852
|
};
|
|
853
|
-
|
|
854
|
-
if (
|
|
855
|
-
return
|
|
856
|
-
if (
|
|
857
|
-
const l =
|
|
858
|
-
return l instanceof Promise ? l.then((
|
|
853
|
+
e._zod.run = (s, d) => {
|
|
854
|
+
if (d.skipChecks)
|
|
855
|
+
return e._zod.parse(s, d);
|
|
856
|
+
if (d.direction === "backward") {
|
|
857
|
+
const l = e._zod.parse({ value: s.value, issues: [] }, { ...d, skipChecks: !0 });
|
|
858
|
+
return l instanceof Promise ? l.then((u) => c(u, s, d)) : c(l, s, d);
|
|
859
859
|
}
|
|
860
|
-
const a =
|
|
860
|
+
const a = e._zod.parse(s, d);
|
|
861
861
|
if (a instanceof Promise) {
|
|
862
|
-
if (
|
|
863
|
-
throw new
|
|
864
|
-
return a.then((l) => i(l, n,
|
|
862
|
+
if (d.async === !1)
|
|
863
|
+
throw new Ee();
|
|
864
|
+
return a.then((l) => i(l, n, d));
|
|
865
865
|
}
|
|
866
|
-
return i(a, n,
|
|
866
|
+
return i(a, n, d);
|
|
867
867
|
};
|
|
868
868
|
}
|
|
869
869
|
}, {
|
|
870
870
|
// Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
|
|
871
871
|
get "~standard"() {
|
|
872
|
-
return
|
|
872
|
+
return zo(this, "~standard", Xo(this));
|
|
873
873
|
},
|
|
874
|
-
set "~standard"(
|
|
875
|
-
|
|
874
|
+
set "~standard"(e) {
|
|
875
|
+
Re(this, "~standard", e);
|
|
876
876
|
}
|
|
877
|
-
}),
|
|
878
|
-
async function
|
|
877
|
+
}), _t = (e, t) => e.issues.length ? { issues: e.issues.map((o) => xe(o, t, ve())) } : { value: e.value };
|
|
878
|
+
async function Yo(e, t) {
|
|
879
879
|
const o = { async: !0 };
|
|
880
|
-
return
|
|
880
|
+
return _t(await e._zod.run({ value: t, issues: [] }, o), o);
|
|
881
881
|
}
|
|
882
|
-
function
|
|
882
|
+
function Xo(e) {
|
|
883
883
|
return {
|
|
884
|
-
validate: (
|
|
884
|
+
validate: (t) => {
|
|
885
885
|
const o = { async: !1 };
|
|
886
886
|
try {
|
|
887
|
-
const r =
|
|
887
|
+
const r = e._zod.run({ value: t, issues: [] }, o);
|
|
888
888
|
if (!(r instanceof Promise))
|
|
889
|
-
return
|
|
889
|
+
return _t(r, o);
|
|
890
890
|
} catch {
|
|
891
891
|
}
|
|
892
|
-
return
|
|
892
|
+
return Yo(e, t);
|
|
893
893
|
},
|
|
894
894
|
vendor: "zod",
|
|
895
895
|
version: 1
|
|
896
896
|
};
|
|
897
897
|
}
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
if (
|
|
898
|
+
const Qo = /* @__PURE__ */ F("$ZodString", (e, t) => {
|
|
899
|
+
we.init(e, t), e._zod.pattern = t.pattern ?? Wo, e._zod.parse = (o, r) => {
|
|
900
|
+
if (t.coerce)
|
|
901
901
|
try {
|
|
902
902
|
o.value = String(o.value);
|
|
903
903
|
} catch {
|
|
@@ -906,30 +906,30 @@ const Wo = /* @__PURE__ */ H("$ZodString", (t, e) => {
|
|
|
906
906
|
expected: "string",
|
|
907
907
|
code: "invalid_type",
|
|
908
908
|
input: o.value,
|
|
909
|
-
inst:
|
|
909
|
+
inst: e
|
|
910
910
|
}), o;
|
|
911
911
|
};
|
|
912
|
-
}),
|
|
913
|
-
|
|
912
|
+
}), er = /* @__PURE__ */ F("$ZodNull", (e, t) => {
|
|
913
|
+
we.init(e, t), e._zod.pattern = Jo, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (o, r) => {
|
|
914
914
|
const n = o.value;
|
|
915
915
|
return n === null || o.issues.push({
|
|
916
916
|
expected: "null",
|
|
917
917
|
code: "invalid_type",
|
|
918
918
|
input: n,
|
|
919
|
-
inst:
|
|
919
|
+
inst: e
|
|
920
920
|
}), o;
|
|
921
921
|
};
|
|
922
922
|
});
|
|
923
|
-
function
|
|
924
|
-
const
|
|
925
|
-
if (!(!
|
|
926
|
-
if (
|
|
927
|
-
if (n !== void 0 && s && !
|
|
923
|
+
function je(e, t, o, r, n, i) {
|
|
924
|
+
const c = o in r, s = i === "optional";
|
|
925
|
+
if (!(!c && s && n === "optional")) {
|
|
926
|
+
if (e.issues.length) {
|
|
927
|
+
if (n !== void 0 && s && !c)
|
|
928
928
|
return;
|
|
929
|
-
|
|
929
|
+
t.issues.push(...Ie(o, e.issues));
|
|
930
930
|
}
|
|
931
|
-
if (!
|
|
932
|
-
|
|
931
|
+
if (!c && n === void 0) {
|
|
932
|
+
e.issues.length || t.issues.push({
|
|
933
933
|
code: "invalid_type",
|
|
934
934
|
expected: "nonoptional",
|
|
935
935
|
input: void 0,
|
|
@@ -937,200 +937,200 @@ function Ue(t, e, o, r, n, i) {
|
|
|
937
937
|
});
|
|
938
938
|
return;
|
|
939
939
|
}
|
|
940
|
-
|
|
940
|
+
e.value === void 0 ? (c || n === "defaulted" && !s) && (t.value[o] = void 0) : t.value[o] = e.value;
|
|
941
941
|
}
|
|
942
942
|
}
|
|
943
|
-
const
|
|
944
|
-
function
|
|
945
|
-
const
|
|
946
|
-
for (const
|
|
947
|
-
if (!
|
|
948
|
-
throw new Error(`Invalid element at key "${String(
|
|
949
|
-
const i =
|
|
943
|
+
const tr = [];
|
|
944
|
+
function or(e) {
|
|
945
|
+
const t = Object.keys(e.shape), o = Object.getOwnPropertySymbols(e.shape), r = o.length ? o : tr, n = r.length ? [...t, ...r] : t;
|
|
946
|
+
for (const c of n)
|
|
947
|
+
if (!e.shape?.[c]?._zod?.traits?.has("$ZodType"))
|
|
948
|
+
throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);
|
|
949
|
+
const i = So(e.shape);
|
|
950
950
|
return {
|
|
951
|
-
...
|
|
951
|
+
...e,
|
|
952
952
|
allKeys: n,
|
|
953
953
|
symbolKeys: r,
|
|
954
954
|
// string-only: handleCatchall matches it against `for...in`, which never yields a symbol
|
|
955
|
-
keySet: new Set(
|
|
956
|
-
numKeys:
|
|
955
|
+
keySet: new Set(t),
|
|
956
|
+
numKeys: t.length,
|
|
957
957
|
optionalKeys: new Set(i)
|
|
958
958
|
};
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
const s = [],
|
|
962
|
-
let
|
|
963
|
-
for (const
|
|
964
|
-
if (
|
|
965
|
-
if (
|
|
960
|
+
function rr(e, t, o, r, n, i, c) {
|
|
961
|
+
const s = [], d = n.keySet, a = n.catchall._zod, l = a.def.type, u = a.optin, p = a.optout;
|
|
962
|
+
let h = 0;
|
|
963
|
+
for (const f in t) {
|
|
964
|
+
if (c && o.issues.length !== h) {
|
|
965
|
+
if (qe(o, h))
|
|
966
966
|
break;
|
|
967
|
-
|
|
967
|
+
h = o.issues.length;
|
|
968
968
|
}
|
|
969
|
-
if (
|
|
969
|
+
if (d.has(f))
|
|
970
970
|
continue;
|
|
971
|
-
if (
|
|
972
|
-
l === "never" && s.push(
|
|
971
|
+
if (f === "__proto__") {
|
|
972
|
+
l === "never" && s.push(f);
|
|
973
973
|
continue;
|
|
974
974
|
}
|
|
975
975
|
if (l === "never") {
|
|
976
|
-
s.push(
|
|
976
|
+
s.push(f);
|
|
977
977
|
continue;
|
|
978
978
|
}
|
|
979
|
-
const
|
|
980
|
-
|
|
979
|
+
const g = a.run({ value: t[f], issues: [] }, r);
|
|
980
|
+
g instanceof Promise ? e.push(g.then((k) => je(k, o, f, t, u, p))) : je(g, o, f, t, u, p);
|
|
981
981
|
}
|
|
982
982
|
return s.length && o.issues.push({
|
|
983
983
|
code: "unrecognized_keys",
|
|
984
984
|
keys: s,
|
|
985
|
-
input:
|
|
985
|
+
input: t,
|
|
986
986
|
inst: i,
|
|
987
987
|
// Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
|
|
988
988
|
continue: !0
|
|
989
|
-
}),
|
|
989
|
+
}), e.length ? Promise.all(e).then(() => o) : o;
|
|
990
990
|
}
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
const o = Object.getOwnPropertyDescriptor(
|
|
991
|
+
const nr = /* @__PURE__ */ F("$ZodObject", (e, t) => {
|
|
992
|
+
we.init(e, t);
|
|
993
|
+
const o = Object.getOwnPropertyDescriptor(t, "shape"), r = o?.get ? o.get.raw : t.shape ?? {};
|
|
994
994
|
if (r) {
|
|
995
995
|
const a = () => {
|
|
996
996
|
const l = { ...r };
|
|
997
|
-
return Object.defineProperty(
|
|
997
|
+
return Object.defineProperty(t, "shape", { value: l }), a.raw = l, l;
|
|
998
998
|
};
|
|
999
|
-
a.raw = r, Object.defineProperty(
|
|
999
|
+
a.raw = r, Object.defineProperty(t, "shape", { get: a });
|
|
1000
1000
|
}
|
|
1001
|
-
const n =
|
|
1002
|
-
|
|
1003
|
-
const l = a.def.shape,
|
|
1004
|
-
for (const
|
|
1005
|
-
const
|
|
1006
|
-
if (
|
|
1007
|
-
Object.prototype.hasOwnProperty.call(
|
|
1008
|
-
for (const
|
|
1009
|
-
|
|
1010
|
-
|
|
1001
|
+
const n = xo(() => or(t));
|
|
1002
|
+
de(e, "propValues", (a) => {
|
|
1003
|
+
const l = a.def.shape, u = {};
|
|
1004
|
+
for (const p in l) {
|
|
1005
|
+
const h = l[p]._zod;
|
|
1006
|
+
if (h.values) {
|
|
1007
|
+
Object.prototype.hasOwnProperty.call(u, p) || ko(u, p, /* @__PURE__ */ new Set());
|
|
1008
|
+
for (const f of h.values)
|
|
1009
|
+
u[p].add(f);
|
|
1010
|
+
h.optin !== void 0 && u[p].add(void 0);
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
|
-
return
|
|
1013
|
+
return u;
|
|
1014
1014
|
});
|
|
1015
|
-
const i =
|
|
1015
|
+
const i = Ye, c = t.catchall;
|
|
1016
1016
|
let s;
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1017
|
+
const d = Ue.memoizer;
|
|
1018
|
+
d?.attach(e), e._zod.parse = (a, l) => {
|
|
1019
1019
|
s ?? (s = n.value);
|
|
1020
|
-
const
|
|
1021
|
-
if (!i(
|
|
1020
|
+
const u = a.value;
|
|
1021
|
+
if (!i(u))
|
|
1022
1022
|
return a.issues.push({
|
|
1023
1023
|
expected: "object",
|
|
1024
1024
|
code: "invalid_type",
|
|
1025
|
-
input:
|
|
1026
|
-
inst:
|
|
1025
|
+
input: u,
|
|
1026
|
+
inst: e
|
|
1027
1027
|
}), a;
|
|
1028
|
-
a.value =
|
|
1029
|
-
const
|
|
1030
|
-
let
|
|
1028
|
+
a.value = d ? d.alloc(e, a, {}, l) : {};
|
|
1029
|
+
const p = [], h = s.shape, f = l?.abortEarly;
|
|
1030
|
+
let g = a.issues.length;
|
|
1031
1031
|
for (const k of s.allKeys) {
|
|
1032
|
-
if (
|
|
1033
|
-
if (
|
|
1032
|
+
if (f && a.issues.length !== g) {
|
|
1033
|
+
if (qe(a, g))
|
|
1034
1034
|
break;
|
|
1035
|
-
|
|
1035
|
+
g = a.issues.length;
|
|
1036
1036
|
}
|
|
1037
1037
|
if (k === "__proto__")
|
|
1038
1038
|
continue;
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1039
|
+
const q = h[k], I = q._zod.optin, j = q._zod.optout, S = q._zod.run({ value: u[k], issues: [] }, l);
|
|
1040
|
+
S instanceof Promise ? p.push(S.then(($) => je($, a, k, u, I, j))) : je(S, a, k, u, I, j);
|
|
1041
1041
|
}
|
|
1042
|
-
return
|
|
1042
|
+
return c ? rr(p, u, a, l, n.value, e, f === !0) : p.length ? Promise.all(p).then(() => a) : a;
|
|
1043
1043
|
};
|
|
1044
1044
|
});
|
|
1045
|
-
function
|
|
1046
|
-
for (const i of
|
|
1045
|
+
function ft(e, t, o, r) {
|
|
1046
|
+
for (const i of e)
|
|
1047
1047
|
if (i.issues.length === 0)
|
|
1048
|
-
return
|
|
1049
|
-
const n =
|
|
1050
|
-
return n.length === 1 ? (
|
|
1048
|
+
return t.value = i.value, t;
|
|
1049
|
+
const n = e.filter((i) => !qe(i));
|
|
1050
|
+
return n.length === 1 ? (t.value = n[0].value, n[0]) : (t.issues.push({
|
|
1051
1051
|
code: "invalid_union",
|
|
1052
|
-
input:
|
|
1052
|
+
input: t.value,
|
|
1053
1053
|
inst: o,
|
|
1054
|
-
errors:
|
|
1055
|
-
}),
|
|
1054
|
+
errors: e.map((i) => i.issues.map((c) => xe(c, r, ve())))
|
|
1055
|
+
}), t);
|
|
1056
1056
|
}
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1057
|
+
const ar = /* @__PURE__ */ F("$ZodUnion", (e, t) => {
|
|
1058
|
+
we.init(e, t), de(e, "optin", (r) => r.def.options.some((n) => n._zod.optin === "defaulted") ? "defaulted" : r.def.options.some((n) => n._zod.optin !== void 0) ? "optional" : void 0), de(e, "optout", (r) => r.def.options.some((n) => n._zod.optout === "optional") ? "optional" : void 0), de(e, "values", (r) => {
|
|
1059
1059
|
if (r.def.options.every((n) => n._zod.values))
|
|
1060
1060
|
return new Set(r.def.options.flatMap((n) => Array.from(n._zod.values)));
|
|
1061
|
-
}),
|
|
1061
|
+
}), de(e, "pattern", (r) => {
|
|
1062
1062
|
if (r.def.options.every((n) => n._zod.pattern)) {
|
|
1063
1063
|
const n = r.def.options.map((i) => i._zod.pattern);
|
|
1064
|
-
return new RegExp(`^(${n.map((i) =>
|
|
1064
|
+
return new RegExp(`^(${n.map((i) => yt(i.source)).join("|")})$`);
|
|
1065
1065
|
}
|
|
1066
1066
|
});
|
|
1067
|
-
const o =
|
|
1068
|
-
|
|
1067
|
+
const o = t.options.length === 1 ? t.options[0]._zod.run : null;
|
|
1068
|
+
e._zod.parse = (r, n) => {
|
|
1069
1069
|
if (o)
|
|
1070
1070
|
return o(r, n);
|
|
1071
1071
|
let i = !1;
|
|
1072
|
-
const
|
|
1073
|
-
for (const s of
|
|
1074
|
-
const
|
|
1072
|
+
const c = [];
|
|
1073
|
+
for (const s of t.options) {
|
|
1074
|
+
const d = s._zod.run({
|
|
1075
1075
|
value: r.value,
|
|
1076
1076
|
issues: []
|
|
1077
1077
|
}, n);
|
|
1078
|
-
if (
|
|
1079
|
-
|
|
1078
|
+
if (d instanceof Promise)
|
|
1079
|
+
c.push(d), i = !0;
|
|
1080
1080
|
else {
|
|
1081
|
-
if (
|
|
1082
|
-
return
|
|
1083
|
-
|
|
1081
|
+
if (d.issues.length === 0)
|
|
1082
|
+
return d;
|
|
1083
|
+
c.push(d);
|
|
1084
1084
|
}
|
|
1085
1085
|
}
|
|
1086
|
-
return i ? Promise.all(
|
|
1086
|
+
return i ? Promise.all(c).then((s) => ft(s, r, e, n)) : ft(c, r, e, n);
|
|
1087
1087
|
};
|
|
1088
|
-
}),
|
|
1089
|
-
|
|
1090
|
-
const o =
|
|
1091
|
-
o?.attach(
|
|
1088
|
+
}), ir = /* @__PURE__ */ F("$ZodRecord", (e, t) => {
|
|
1089
|
+
we.init(e, t);
|
|
1090
|
+
const o = Ue.memoizer;
|
|
1091
|
+
o?.attach(e), e._zod.parse = (r, n) => {
|
|
1092
1092
|
const i = r.value;
|
|
1093
|
-
if (!
|
|
1093
|
+
if (!_o(i))
|
|
1094
1094
|
return r.issues.push({
|
|
1095
1095
|
expected: "record",
|
|
1096
1096
|
code: "invalid_type",
|
|
1097
1097
|
input: i,
|
|
1098
|
-
inst:
|
|
1098
|
+
inst: e
|
|
1099
1099
|
}), r;
|
|
1100
|
-
const
|
|
1101
|
-
if (s && !
|
|
1102
|
-
r.value = o ? o.alloc(
|
|
1103
|
-
const
|
|
1100
|
+
const c = [], s = t.keyType._zod.values;
|
|
1101
|
+
if (s && !t.partial) {
|
|
1102
|
+
r.value = o ? o.alloc(e, r, {}, n) : {};
|
|
1103
|
+
const d = /* @__PURE__ */ new Set();
|
|
1104
1104
|
for (const l of s)
|
|
1105
1105
|
if (typeof l == "string" || typeof l == "number" || typeof l == "symbol") {
|
|
1106
|
-
if (
|
|
1106
|
+
if (d.add(typeof l == "number" ? l.toString() : l), l === "__proto__")
|
|
1107
1107
|
continue;
|
|
1108
|
-
const
|
|
1109
|
-
if (
|
|
1108
|
+
const u = t.keyType._zod.run({ value: l, issues: [] }, n);
|
|
1109
|
+
if (u instanceof Promise)
|
|
1110
1110
|
throw new Error("Async schemas not supported in object keys currently");
|
|
1111
|
-
if (
|
|
1111
|
+
if (u.issues.length) {
|
|
1112
1112
|
r.issues.push({
|
|
1113
1113
|
code: "invalid_key",
|
|
1114
1114
|
origin: "record",
|
|
1115
|
-
issues:
|
|
1115
|
+
issues: u.issues.map((f) => xe(f, n, ve())),
|
|
1116
1116
|
input: l,
|
|
1117
1117
|
path: [l],
|
|
1118
|
-
inst:
|
|
1118
|
+
inst: e
|
|
1119
1119
|
});
|
|
1120
1120
|
continue;
|
|
1121
1121
|
}
|
|
1122
|
-
const
|
|
1123
|
-
if (
|
|
1122
|
+
const p = u.value;
|
|
1123
|
+
if (p === "__proto__")
|
|
1124
1124
|
continue;
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
})) : (
|
|
1125
|
+
const h = t.valueType._zod.run({ value: i[l], issues: [] }, n);
|
|
1126
|
+
h instanceof Promise ? c.push(h.then((f) => {
|
|
1127
|
+
f.issues.length && r.issues.push(...Ie(l, f.issues)), r.value[p] = f.value;
|
|
1128
|
+
})) : (h.issues.length && r.issues.push(...Ie(l, h.issues)), r.value[p] = h.value);
|
|
1129
1129
|
}
|
|
1130
1130
|
let a;
|
|
1131
1131
|
for (const l in i)
|
|
1132
|
-
if (!
|
|
1133
|
-
if (
|
|
1132
|
+
if (!d.has(l))
|
|
1133
|
+
if (t.mode === "loose") {
|
|
1134
1134
|
if (l === "__proto__")
|
|
1135
1135
|
continue;
|
|
1136
1136
|
r.value[l] = i[l];
|
|
@@ -1139,519 +1139,519 @@ const Qo = /* @__PURE__ */ H("$ZodUnion", (t, e) => {
|
|
|
1139
1139
|
a && a.length > 0 && r.issues.push({
|
|
1140
1140
|
code: "unrecognized_keys",
|
|
1141
1141
|
input: i,
|
|
1142
|
-
inst:
|
|
1142
|
+
inst: e,
|
|
1143
1143
|
keys: a,
|
|
1144
1144
|
continue: !0
|
|
1145
1145
|
});
|
|
1146
1146
|
} else {
|
|
1147
|
-
r.value = o ? o.alloc(
|
|
1148
|
-
let
|
|
1147
|
+
r.value = o ? o.alloc(e, r, {}, n) : {};
|
|
1148
|
+
let d;
|
|
1149
1149
|
for (const a of Reflect.ownKeys(i)) {
|
|
1150
1150
|
if (a === "__proto__" || !Object.prototype.propertyIsEnumerable.call(i, a))
|
|
1151
1151
|
continue;
|
|
1152
|
-
let l =
|
|
1152
|
+
let l = t.keyType._zod.run({ value: a, issues: [] }, n);
|
|
1153
1153
|
if (l instanceof Promise)
|
|
1154
1154
|
throw new Error("Async schemas not supported in object keys currently");
|
|
1155
|
-
if (typeof a == "string" &&
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1155
|
+
if (typeof a == "string" && Fo.test(a) && l.issues.length) {
|
|
1156
|
+
const f = t.keyType._zod.run({ value: Number(a), issues: [] }, n);
|
|
1157
|
+
if (f instanceof Promise)
|
|
1158
1158
|
throw new Error("Async schemas not supported in object keys currently");
|
|
1159
|
-
|
|
1159
|
+
f.issues.length === 0 && (l = f);
|
|
1160
1160
|
}
|
|
1161
1161
|
if (l.issues.length) {
|
|
1162
|
-
|
|
1162
|
+
t.mode === "loose" ? r.value[a] = i[a] : s ? (d = d ?? [], d.push(a)) : r.issues.push({
|
|
1163
1163
|
code: "invalid_key",
|
|
1164
1164
|
origin: "record",
|
|
1165
|
-
issues: l.issues.map((
|
|
1165
|
+
issues: l.issues.map((f) => xe(f, n, ve())),
|
|
1166
1166
|
input: a,
|
|
1167
1167
|
path: [a],
|
|
1168
|
-
inst:
|
|
1168
|
+
inst: e
|
|
1169
1169
|
});
|
|
1170
1170
|
continue;
|
|
1171
1171
|
}
|
|
1172
|
-
const
|
|
1173
|
-
if (
|
|
1172
|
+
const p = l.value;
|
|
1173
|
+
if (p === "__proto__")
|
|
1174
1174
|
continue;
|
|
1175
|
-
const
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
})) : (
|
|
1175
|
+
const h = t.valueType._zod.run({ value: i[a], issues: [] }, n);
|
|
1176
|
+
h instanceof Promise ? c.push(h.then((f) => {
|
|
1177
|
+
f.issues.length && r.issues.push(...Ie(a, f.issues)), r.value[p] = f.value;
|
|
1178
|
+
})) : (h.issues.length && r.issues.push(...Ie(a, h.issues)), r.value[p] = h.value);
|
|
1179
1179
|
}
|
|
1180
|
-
|
|
1180
|
+
d && d.length > 0 && r.issues.push({
|
|
1181
1181
|
code: "unrecognized_keys",
|
|
1182
1182
|
input: i,
|
|
1183
|
-
inst:
|
|
1184
|
-
keys:
|
|
1183
|
+
inst: e,
|
|
1184
|
+
keys: d,
|
|
1185
1185
|
continue: !0
|
|
1186
1186
|
});
|
|
1187
1187
|
}
|
|
1188
|
-
return
|
|
1188
|
+
return c.length ? Promise.all(c).then(() => r) : r;
|
|
1189
1189
|
};
|
|
1190
|
-
}),
|
|
1191
|
-
|
|
1192
|
-
const o = new Set(
|
|
1193
|
-
|
|
1190
|
+
}), sr = /* @__PURE__ */ F("$ZodLiteral", (e, t) => {
|
|
1191
|
+
we.init(e, t);
|
|
1192
|
+
const o = new Set(t.values);
|
|
1193
|
+
e._zod.values = o, de(e, "pattern", (r) => {
|
|
1194
1194
|
const n = r.def.values;
|
|
1195
|
-
return new RegExp(n.length ? `^(${n.map((i) => typeof i == "string" ?
|
|
1196
|
-
}),
|
|
1195
|
+
return new RegExp(n.length ? `^(${n.map((i) => typeof i == "string" ? ct(i) : i ? ct(i.toString()) : String(i)).join("|")})$` : "^[^\\s\\S]$");
|
|
1196
|
+
}), e._zod.parse = (r, n) => {
|
|
1197
1197
|
const i = r.value;
|
|
1198
1198
|
return o.has(i) || r.issues.push({
|
|
1199
1199
|
code: "invalid_value",
|
|
1200
|
-
values:
|
|
1200
|
+
values: t.values,
|
|
1201
1201
|
input: i,
|
|
1202
|
-
inst:
|
|
1202
|
+
inst: e
|
|
1203
1203
|
}), r;
|
|
1204
1204
|
};
|
|
1205
|
-
}),
|
|
1206
|
-
|
|
1205
|
+
}), lr = /* @__PURE__ */ F("$ZodNullable", (e, t) => {
|
|
1206
|
+
we.init(e, t), de(e, "optin", (o) => o.def.innerType._zod.optin), de(e, "optout", (o) => o.def.innerType._zod.optout), de(e, "pattern", (o) => {
|
|
1207
1207
|
const r = o.def.innerType._zod.pattern;
|
|
1208
|
-
return r ? new RegExp(`^(${
|
|
1209
|
-
}),
|
|
1208
|
+
return r ? new RegExp(`^(${yt(r.source)}|null)$`) : void 0;
|
|
1209
|
+
}), de(e, "values", (o) => o.def.innerType._zod.values ? /* @__PURE__ */ new Set([...o.def.innerType._zod.values, null]) : void 0), e._zod.parse = (o, r) => o.value === null ? o : t.innerType._zod.run(o, r);
|
|
1210
1210
|
});
|
|
1211
|
-
function
|
|
1212
|
-
return
|
|
1211
|
+
function cr(e) {
|
|
1212
|
+
return e.checks && (e.checks = [...e.checks]), e;
|
|
1213
1213
|
}
|
|
1214
1214
|
// @__NO_SIDE_EFFECTS__
|
|
1215
|
-
function
|
|
1216
|
-
return new
|
|
1215
|
+
function dr(e, t) {
|
|
1216
|
+
return new e(cr({ type: "string", ...ye(t) }));
|
|
1217
1217
|
}
|
|
1218
1218
|
// @__NO_SIDE_EFFECTS__
|
|
1219
|
-
function
|
|
1220
|
-
return new
|
|
1219
|
+
function ur(e, t) {
|
|
1220
|
+
return new e({
|
|
1221
1221
|
type: "null",
|
|
1222
|
-
...
|
|
1222
|
+
...ye(t)
|
|
1223
1223
|
});
|
|
1224
1224
|
}
|
|
1225
|
-
const
|
|
1226
|
-
if (!
|
|
1225
|
+
const ke = /* @__PURE__ */ F("ZodMiniType", (e, t) => {
|
|
1226
|
+
if (!e._zod)
|
|
1227
1227
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
1228
|
-
|
|
1228
|
+
we.init(e, t), e.def = t, e.type = t.type;
|
|
1229
1229
|
}, {
|
|
1230
1230
|
// `with` is an alias for `check`: the same function object, not a wrapper.
|
|
1231
1231
|
get with() {
|
|
1232
1232
|
return this.check;
|
|
1233
1233
|
},
|
|
1234
|
-
set with(
|
|
1235
|
-
|
|
1234
|
+
set with(e) {
|
|
1235
|
+
Re(this, "with", e);
|
|
1236
1236
|
},
|
|
1237
|
-
parse(
|
|
1238
|
-
return
|
|
1237
|
+
parse(e, t) {
|
|
1238
|
+
return Bo(this, e, t, { callee: this.parse });
|
|
1239
1239
|
},
|
|
1240
|
-
parseAsync(
|
|
1241
|
-
return
|
|
1240
|
+
parseAsync(e, t) {
|
|
1241
|
+
return No(this, e, t, { callee: this.parseAsync });
|
|
1242
1242
|
},
|
|
1243
|
-
safeParse(
|
|
1244
|
-
return
|
|
1243
|
+
safeParse(e, t) {
|
|
1244
|
+
return Ko(this, e, t);
|
|
1245
1245
|
},
|
|
1246
|
-
safeParseAsync(
|
|
1247
|
-
return
|
|
1246
|
+
safeParseAsync(e, t) {
|
|
1247
|
+
return Ho(this, e, t);
|
|
1248
1248
|
},
|
|
1249
|
-
check(...
|
|
1250
|
-
const
|
|
1249
|
+
check(...e) {
|
|
1250
|
+
const t = this.def;
|
|
1251
1251
|
return this.clone({
|
|
1252
|
-
...
|
|
1252
|
+
...t,
|
|
1253
1253
|
checks: [
|
|
1254
|
-
...
|
|
1255
|
-
...
|
|
1254
|
+
...t.checks ?? [],
|
|
1255
|
+
...e.map((o) => typeof o == "function" ? { _zod: { check: o, def: { check: "custom" }, onattach: [] } } : o)
|
|
1256
1256
|
]
|
|
1257
1257
|
}, { parent: !0 });
|
|
1258
1258
|
},
|
|
1259
|
-
clone(
|
|
1260
|
-
return
|
|
1259
|
+
clone(e, t) {
|
|
1260
|
+
return Co(this, e, t);
|
|
1261
1261
|
},
|
|
1262
1262
|
brand() {
|
|
1263
1263
|
return this;
|
|
1264
1264
|
},
|
|
1265
|
-
register(
|
|
1266
|
-
return
|
|
1265
|
+
register(e, t) {
|
|
1266
|
+
return e.add(this, t), this;
|
|
1267
1267
|
},
|
|
1268
|
-
apply(
|
|
1269
|
-
return
|
|
1268
|
+
apply(e, ...t) {
|
|
1269
|
+
return t.length === 0 ? e(this) : e(this, ...t);
|
|
1270
1270
|
}
|
|
1271
|
-
}),
|
|
1272
|
-
|
|
1271
|
+
}), pr = /* @__PURE__ */ F("ZodMiniString", (e, t) => {
|
|
1272
|
+
Qo.init(e, t), ke.init(e, t);
|
|
1273
1273
|
});
|
|
1274
1274
|
// @__NO_SIDE_EFFECTS__
|
|
1275
|
-
function
|
|
1276
|
-
return /* @__PURE__ */
|
|
1275
|
+
function E(e) {
|
|
1276
|
+
return /* @__PURE__ */ dr(pr, e);
|
|
1277
1277
|
}
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1278
|
+
const hr = /* @__PURE__ */ F("ZodMiniNull", (e, t) => {
|
|
1279
|
+
er.init(e, t), ke.init(e, t);
|
|
1280
1280
|
});
|
|
1281
1281
|
// @__NO_SIDE_EFFECTS__
|
|
1282
|
-
function
|
|
1283
|
-
return /* @__PURE__ */
|
|
1282
|
+
function fr(e) {
|
|
1283
|
+
return /* @__PURE__ */ ur(hr, e);
|
|
1284
1284
|
}
|
|
1285
|
-
const
|
|
1286
|
-
|
|
1285
|
+
const gr = /* @__PURE__ */ F("ZodMiniObject", (e, t) => {
|
|
1286
|
+
nr.init(e, t), ke.init(e, t), Po(e, "shape", (o) => o._zod.def.shape, !1);
|
|
1287
1287
|
});
|
|
1288
1288
|
// @__NO_SIDE_EFFECTS__
|
|
1289
|
-
function U(
|
|
1289
|
+
function U(e, t) {
|
|
1290
1290
|
const o = {
|
|
1291
1291
|
type: "object",
|
|
1292
|
-
shape:
|
|
1293
|
-
...
|
|
1292
|
+
shape: e ?? {},
|
|
1293
|
+
...ye(t)
|
|
1294
1294
|
};
|
|
1295
|
-
return new
|
|
1295
|
+
return new gr(o);
|
|
1296
1296
|
}
|
|
1297
|
-
const
|
|
1298
|
-
|
|
1297
|
+
const mr = /* @__PURE__ */ F("ZodMiniUnion", (e, t) => {
|
|
1298
|
+
ar.init(e, t), ke.init(e, t);
|
|
1299
1299
|
});
|
|
1300
1300
|
// @__NO_SIDE_EFFECTS__
|
|
1301
|
-
function
|
|
1302
|
-
return new
|
|
1301
|
+
function br(e, t) {
|
|
1302
|
+
return new mr({
|
|
1303
1303
|
type: "union",
|
|
1304
|
-
options:
|
|
1305
|
-
...
|
|
1304
|
+
options: e,
|
|
1305
|
+
...ye(t)
|
|
1306
1306
|
});
|
|
1307
1307
|
}
|
|
1308
|
-
const
|
|
1309
|
-
|
|
1308
|
+
const gt = /* @__PURE__ */ F("ZodMiniRecord", (e, t) => {
|
|
1309
|
+
ir.init(e, t), ke.init(e, t);
|
|
1310
1310
|
});
|
|
1311
1311
|
// @__NO_SIDE_EFFECTS__
|
|
1312
|
-
function
|
|
1313
|
-
return !
|
|
1314
|
-
type: "record",
|
|
1315
|
-
keyType: /* @__PURE__ */ R(),
|
|
1316
|
-
valueType: t,
|
|
1317
|
-
...ve(e)
|
|
1318
|
-
}) : new pt({
|
|
1312
|
+
function vr(e, t, o) {
|
|
1313
|
+
return !t || !t._zod ? new gt({
|
|
1319
1314
|
type: "record",
|
|
1320
|
-
keyType:
|
|
1315
|
+
keyType: /* @__PURE__ */ E(),
|
|
1321
1316
|
valueType: e,
|
|
1322
|
-
...
|
|
1317
|
+
...ye(t)
|
|
1318
|
+
}) : new gt({
|
|
1319
|
+
type: "record",
|
|
1320
|
+
keyType: e,
|
|
1321
|
+
valueType: t,
|
|
1322
|
+
...ye(o)
|
|
1323
1323
|
});
|
|
1324
1324
|
}
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1325
|
+
const wr = /* @__PURE__ */ F("ZodMiniLiteral", (e, t) => {
|
|
1326
|
+
sr.init(e, t), ke.init(e, t);
|
|
1327
1327
|
});
|
|
1328
1328
|
// @__NO_SIDE_EFFECTS__
|
|
1329
|
-
function
|
|
1330
|
-
return new
|
|
1329
|
+
function se(e, t) {
|
|
1330
|
+
return new wr({
|
|
1331
1331
|
type: "literal",
|
|
1332
|
-
values: Array.isArray(
|
|
1333
|
-
...
|
|
1332
|
+
values: Array.isArray(e) ? e : [e],
|
|
1333
|
+
...ye(t)
|
|
1334
1334
|
});
|
|
1335
1335
|
}
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1336
|
+
const qr = /* @__PURE__ */ F("ZodMiniNullable", (e, t) => {
|
|
1337
|
+
lr.init(e, t), ke.init(e, t);
|
|
1338
1338
|
});
|
|
1339
1339
|
// @__NO_SIDE_EFFECTS__
|
|
1340
|
-
function
|
|
1341
|
-
return new
|
|
1340
|
+
function ot(e) {
|
|
1341
|
+
return new qr({
|
|
1342
1342
|
type: "nullable",
|
|
1343
|
-
innerType:
|
|
1343
|
+
innerType: e
|
|
1344
1344
|
});
|
|
1345
1345
|
}
|
|
1346
|
-
|
|
1347
|
-
const
|
|
1348
|
-
type: /* @__PURE__ */
|
|
1349
|
-
content: /* @__PURE__ */
|
|
1350
|
-
role: /* @__PURE__ */
|
|
1351
|
-
}), mr = /* @__PURE__ */ U({
|
|
1352
|
-
type: /* @__PURE__ */ le("agent_cognition"),
|
|
1353
|
-
content: /* @__PURE__ */ R()
|
|
1354
|
-
}), br = /* @__PURE__ */ U({
|
|
1355
|
-
type: /* @__PURE__ */ le("chat_closed_expired"),
|
|
1356
|
-
content: /* @__PURE__ */ R()
|
|
1357
|
-
}), vr = /* @__PURE__ */ U({
|
|
1358
|
-
type: /* @__PURE__ */ le("agent_captured_url"),
|
|
1359
|
-
content: /* @__PURE__ */ R()
|
|
1360
|
-
}), wr = /* @__PURE__ */ U({
|
|
1361
|
-
type: /* @__PURE__ */ le("agent_topic"),
|
|
1362
|
-
content: /* @__PURE__ */ R()
|
|
1363
|
-
}), qr = /* @__PURE__ */ U({
|
|
1364
|
-
type: /* @__PURE__ */ le("agent_summary"),
|
|
1365
|
-
content: /* @__PURE__ */ R()
|
|
1366
|
-
}), yr = /* @__PURE__ */ U({
|
|
1367
|
-
type: /* @__PURE__ */ le("chat_rating"),
|
|
1368
|
-
content: /* @__PURE__ */ R()
|
|
1346
|
+
ve({ jitless: !0 });
|
|
1347
|
+
const yr = /* @__PURE__ */ U({
|
|
1348
|
+
type: /* @__PURE__ */ se("utterance"),
|
|
1349
|
+
content: /* @__PURE__ */ E(),
|
|
1350
|
+
role: /* @__PURE__ */ E()
|
|
1369
1351
|
}), xr = /* @__PURE__ */ U({
|
|
1370
|
-
type: /* @__PURE__ */
|
|
1371
|
-
content: /* @__PURE__ */
|
|
1352
|
+
type: /* @__PURE__ */ se("agent_cognition"),
|
|
1353
|
+
content: /* @__PURE__ */ E()
|
|
1372
1354
|
}), kr = /* @__PURE__ */ U({
|
|
1373
|
-
type: /* @__PURE__ */
|
|
1374
|
-
content: /* @__PURE__ */
|
|
1355
|
+
type: /* @__PURE__ */ se("chat_closed_expired"),
|
|
1356
|
+
content: /* @__PURE__ */ E()
|
|
1375
1357
|
}), _r = /* @__PURE__ */ U({
|
|
1376
|
-
type: /* @__PURE__ */
|
|
1377
|
-
|
|
1358
|
+
type: /* @__PURE__ */ se("agent_captured_url"),
|
|
1359
|
+
content: /* @__PURE__ */ E()
|
|
1378
1360
|
}), Cr = /* @__PURE__ */ U({
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
data: fr
|
|
1361
|
+
type: /* @__PURE__ */ se("agent_topic"),
|
|
1362
|
+
content: /* @__PURE__ */ E()
|
|
1382
1363
|
}), Sr = /* @__PURE__ */ U({
|
|
1383
|
-
|
|
1384
|
-
|
|
1364
|
+
type: /* @__PURE__ */ se("agent_summary"),
|
|
1365
|
+
content: /* @__PURE__ */ E()
|
|
1385
1366
|
}), Ir = /* @__PURE__ */ U({
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
}), zr = /* @__PURE__ */ U({
|
|
1389
|
-
message_id: /* @__PURE__ */ et(/* @__PURE__ */ R()),
|
|
1390
|
-
created_at: /* @__PURE__ */ R(),
|
|
1391
|
-
data: br
|
|
1367
|
+
type: /* @__PURE__ */ se("chat_rating"),
|
|
1368
|
+
content: /* @__PURE__ */ E()
|
|
1392
1369
|
}), Er = /* @__PURE__ */ U({
|
|
1393
|
-
|
|
1394
|
-
|
|
1370
|
+
type: /* @__PURE__ */ se("breadcrumb"),
|
|
1371
|
+
content: /* @__PURE__ */ E()
|
|
1372
|
+
}), zr = /* @__PURE__ */ U({
|
|
1373
|
+
type: /* @__PURE__ */ se("chat_escalated"),
|
|
1374
|
+
content: /* @__PURE__ */ fr()
|
|
1395
1375
|
}), Rr = /* @__PURE__ */ U({
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
}), Pr = /* @__PURE__ */ U({
|
|
1399
|
-
created_at: /* @__PURE__ */ R(),
|
|
1400
|
-
data: qr
|
|
1376
|
+
type: /* @__PURE__ */ se("error"),
|
|
1377
|
+
code: /* @__PURE__ */ E()
|
|
1401
1378
|
}), Tr = /* @__PURE__ */ U({
|
|
1402
|
-
|
|
1379
|
+
message_id: /* @__PURE__ */ ot(/* @__PURE__ */ E()),
|
|
1380
|
+
created_at: /* @__PURE__ */ E(),
|
|
1403
1381
|
data: yr
|
|
1404
1382
|
}), Mr = /* @__PURE__ */ U({
|
|
1405
|
-
created_at: /* @__PURE__ */
|
|
1383
|
+
created_at: /* @__PURE__ */ E(),
|
|
1384
|
+
data: Rr
|
|
1385
|
+
}), Pr = /* @__PURE__ */ U({
|
|
1386
|
+
created_at: /* @__PURE__ */ E(),
|
|
1406
1387
|
data: xr
|
|
1407
|
-
}),
|
|
1408
|
-
message_id: /* @__PURE__ */
|
|
1409
|
-
created_at: /* @__PURE__ */
|
|
1388
|
+
}), Ar = /* @__PURE__ */ U({
|
|
1389
|
+
message_id: /* @__PURE__ */ ot(/* @__PURE__ */ E()),
|
|
1390
|
+
created_at: /* @__PURE__ */ E(),
|
|
1410
1391
|
data: kr
|
|
1411
|
-
}),
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
Pr,
|
|
1418
|
-
zr,
|
|
1419
|
-
Tr,
|
|
1420
|
-
Mr,
|
|
1421
|
-
Or
|
|
1422
|
-
]), Ur = /* @__PURE__ */ U({
|
|
1423
|
-
url: /* @__PURE__ */ R(),
|
|
1424
|
-
mimeType: /* @__PURE__ */ le(Et),
|
|
1425
|
-
name: /* @__PURE__ */ R()
|
|
1392
|
+
}), Or = /* @__PURE__ */ U({
|
|
1393
|
+
created_at: /* @__PURE__ */ E(),
|
|
1394
|
+
data: _r
|
|
1395
|
+
}), Ur = /* @__PURE__ */ U({
|
|
1396
|
+
created_at: /* @__PURE__ */ E(),
|
|
1397
|
+
data: Cr
|
|
1426
1398
|
}), jr = /* @__PURE__ */ U({
|
|
1427
|
-
|
|
1399
|
+
created_at: /* @__PURE__ */ E(),
|
|
1400
|
+
data: Sr
|
|
1428
1401
|
}), Dr = /* @__PURE__ */ U({
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1402
|
+
created_at: /* @__PURE__ */ E(),
|
|
1403
|
+
data: Ir
|
|
1404
|
+
}), $r = /* @__PURE__ */ U({
|
|
1405
|
+
created_at: /* @__PURE__ */ E(),
|
|
1406
|
+
data: Er
|
|
1407
|
+
}), Br = /* @__PURE__ */ U({
|
|
1408
|
+
message_id: /* @__PURE__ */ ot(/* @__PURE__ */ E()),
|
|
1409
|
+
created_at: /* @__PURE__ */ E(),
|
|
1410
|
+
data: zr
|
|
1411
|
+
}), Lr = /* @__PURE__ */ br([
|
|
1412
|
+
Tr,
|
|
1413
|
+
Mr,
|
|
1414
|
+
Pr,
|
|
1415
|
+
Or,
|
|
1416
|
+
Ur,
|
|
1417
|
+
jr,
|
|
1418
|
+
Ar,
|
|
1419
|
+
Dr,
|
|
1420
|
+
$r,
|
|
1421
|
+
Br
|
|
1422
|
+
]), Nr = /* @__PURE__ */ U({
|
|
1423
|
+
url: /* @__PURE__ */ E(),
|
|
1424
|
+
mimeType: /* @__PURE__ */ se(Ot),
|
|
1425
|
+
name: /* @__PURE__ */ E()
|
|
1426
|
+
}), Zr = /* @__PURE__ */ U({
|
|
1427
|
+
data: Nr
|
|
1428
|
+
}), Kr = /* @__PURE__ */ U({
|
|
1429
|
+
data: /* @__PURE__ */ U({ urls: /* @__PURE__ */ vr(/* @__PURE__ */ E(), /* @__PURE__ */ E()) })
|
|
1430
|
+
}), Vr = 500, Hr = 3e4, Wr = 6e4;
|
|
1431
|
+
function Fr({
|
|
1432
|
+
chatSettings: e,
|
|
1433
|
+
chatId: t,
|
|
1434
1434
|
messages: o,
|
|
1435
1435
|
onMessage: r,
|
|
1436
1436
|
onCognition: n,
|
|
1437
1437
|
onCognitionComplete: i,
|
|
1438
|
-
onError:
|
|
1438
|
+
onError: c,
|
|
1439
1439
|
onChatClosed: s,
|
|
1440
|
-
onAgentCapturedUrl:
|
|
1440
|
+
onAgentCapturedUrl: d,
|
|
1441
1441
|
onAgentTopic: a,
|
|
1442
1442
|
onAgentSummary: l,
|
|
1443
|
-
onRatingRequest:
|
|
1444
|
-
onBreadcrumb:
|
|
1445
|
-
fetchHistory:
|
|
1446
|
-
getChatToken:
|
|
1447
|
-
backupPollingInterval:
|
|
1443
|
+
onRatingRequest: u,
|
|
1444
|
+
onBreadcrumb: p,
|
|
1445
|
+
fetchHistory: h,
|
|
1446
|
+
getChatToken: f,
|
|
1447
|
+
backupPollingInterval: g = Wr
|
|
1448
1448
|
}) {
|
|
1449
|
-
const k =
|
|
1450
|
-
|
|
1451
|
-
for (const
|
|
1452
|
-
|
|
1449
|
+
const k = N(/* @__PURE__ */ new Set());
|
|
1450
|
+
Z(() => {
|
|
1451
|
+
for (const D of o)
|
|
1452
|
+
D.id && k.current.add(D.id);
|
|
1453
1453
|
}, [o]);
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1456
|
-
}, []),
|
|
1457
|
-
|
|
1458
|
-
}, []),
|
|
1459
|
-
|
|
1460
|
-
}, []),
|
|
1461
|
-
}),
|
|
1462
|
-
async (
|
|
1463
|
-
|
|
1464
|
-
const
|
|
1465
|
-
if (!
|
|
1454
|
+
const q = N(null), I = N(null), j = N(0), S = N(null), $ = N(null), R = N(!1), m = N(!1), y = V(r), P = V(n), oe = V(i), G = V(c), re = V(s), ne = V(d), T = V(a), L = V(l), A = V(u), K = V(p), X = V(h), H = V(f), { publishError: W } = De(), ae = e?.app_sync_url, Q = e?.app_sync_api_key, ee = !!(ae && Q), fe = V(ae), b = V(Q), v = w(() => {
|
|
1455
|
+
q.current && (q.current.close(), q.current = null);
|
|
1456
|
+
}, []), C = w(() => {
|
|
1457
|
+
$.current && (clearInterval($.current), $.current = null);
|
|
1458
|
+
}, []), O = w(() => {
|
|
1459
|
+
S.current && (clearTimeout(S.current), S.current = null);
|
|
1460
|
+
}, []), M = N(() => {
|
|
1461
|
+
}), B = w(
|
|
1462
|
+
async (D) => {
|
|
1463
|
+
v();
|
|
1464
|
+
const ie = fe.current, te = b.current;
|
|
1465
|
+
if (!ie || !te)
|
|
1466
1466
|
throw new Error("Cannot connect: AppSync settings not available");
|
|
1467
|
-
const
|
|
1468
|
-
httpEndpoint:
|
|
1469
|
-
auth:
|
|
1470
|
-
channel: `/default/chat/${
|
|
1467
|
+
const Te = H.current(), Be = await wo({
|
|
1468
|
+
httpEndpoint: ie,
|
|
1469
|
+
auth: Te ? { authorizationToken: Te } : { apiKey: te },
|
|
1470
|
+
channel: `/default/chat/${D}`,
|
|
1471
1471
|
onDisconnect: () => {
|
|
1472
|
-
|
|
1472
|
+
q.current = null, M.current();
|
|
1473
1473
|
},
|
|
1474
|
-
onEvent: (
|
|
1475
|
-
const
|
|
1476
|
-
if (!
|
|
1477
|
-
console.error("Invalid conversation response:",
|
|
1474
|
+
onEvent: (Le) => {
|
|
1475
|
+
const _e = Lr.safeParse(Le);
|
|
1476
|
+
if (!_e.success) {
|
|
1477
|
+
console.error("Invalid conversation response:", _e.error);
|
|
1478
1478
|
return;
|
|
1479
1479
|
}
|
|
1480
|
-
const
|
|
1481
|
-
switch (
|
|
1480
|
+
const le = _e.data;
|
|
1481
|
+
switch (le.data.type) {
|
|
1482
1482
|
case "utterance": {
|
|
1483
|
-
const
|
|
1484
|
-
if (k.current.has(
|
|
1483
|
+
const Y = le, he = Y.message_id ?? crypto.randomUUID();
|
|
1484
|
+
if (k.current.has(he))
|
|
1485
1485
|
return;
|
|
1486
|
-
k.current.add(
|
|
1486
|
+
k.current.add(he), oe.current(), y.current(
|
|
1487
1487
|
{
|
|
1488
|
-
message_id:
|
|
1488
|
+
message_id: he,
|
|
1489
1489
|
response: {
|
|
1490
|
-
id:
|
|
1491
|
-
type:
|
|
1492
|
-
content:
|
|
1490
|
+
id: he,
|
|
1491
|
+
type: Y.data.type,
|
|
1492
|
+
content: Y.data.content
|
|
1493
1493
|
}
|
|
1494
1494
|
},
|
|
1495
|
-
|
|
1495
|
+
D
|
|
1496
1496
|
);
|
|
1497
1497
|
return;
|
|
1498
1498
|
}
|
|
1499
1499
|
case "error": {
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1500
|
+
const he = parseInt(le.data.code);
|
|
1501
|
+
W({ code: he, message: Ut(he) }), G.current?.();
|
|
1502
1502
|
return;
|
|
1503
1503
|
}
|
|
1504
1504
|
case "agent_cognition": {
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1505
|
+
const Y = le;
|
|
1506
|
+
P.current(Y.data.content);
|
|
1507
1507
|
return;
|
|
1508
1508
|
}
|
|
1509
1509
|
case "agent_captured_url": {
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1510
|
+
const Y = le;
|
|
1511
|
+
ne.current?.(Y.data.content);
|
|
1512
1512
|
return;
|
|
1513
1513
|
}
|
|
1514
1514
|
case "agent_topic": {
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1515
|
+
const Y = le;
|
|
1516
|
+
T.current?.(Y.data.content);
|
|
1517
1517
|
return;
|
|
1518
1518
|
}
|
|
1519
1519
|
case "agent_summary": {
|
|
1520
|
-
const
|
|
1521
|
-
L.current?.(
|
|
1520
|
+
const Y = le;
|
|
1521
|
+
L.current?.(Y.data.content);
|
|
1522
1522
|
return;
|
|
1523
1523
|
}
|
|
1524
1524
|
case "chat_closed_expired": {
|
|
1525
|
-
|
|
1525
|
+
re.current?.(), A.current?.();
|
|
1526
1526
|
return;
|
|
1527
1527
|
}
|
|
1528
1528
|
case "chat_rating": {
|
|
1529
|
-
|
|
1529
|
+
A.current?.();
|
|
1530
1530
|
return;
|
|
1531
1531
|
}
|
|
1532
1532
|
case "breadcrumb": {
|
|
1533
|
-
|
|
1533
|
+
K.current?.();
|
|
1534
1534
|
return;
|
|
1535
1535
|
}
|
|
1536
1536
|
case "chat_escalated": {
|
|
1537
|
-
|
|
1537
|
+
re.current?.(), A.current?.();
|
|
1538
1538
|
return;
|
|
1539
1539
|
}
|
|
1540
1540
|
default:
|
|
1541
1541
|
console.warn(
|
|
1542
1542
|
"Unknown notification type:",
|
|
1543
|
-
|
|
1543
|
+
le.data.type
|
|
1544
1544
|
);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
});
|
|
1548
|
-
|
|
1548
|
+
q.current = Be;
|
|
1549
1549
|
},
|
|
1550
1550
|
// The *Ref entries are latest-refs (stable identities); listed to satisfy
|
|
1551
1551
|
// exhaustive-deps, which can't see that useLatestRef returns a ref.
|
|
1552
1552
|
[
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1553
|
+
v,
|
|
1554
|
+
W,
|
|
1555
|
+
fe,
|
|
1556
|
+
b,
|
|
1557
|
+
H,
|
|
1558
1558
|
y,
|
|
1559
|
-
|
|
1559
|
+
P,
|
|
1560
1560
|
oe,
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1561
|
+
G,
|
|
1562
|
+
re,
|
|
1563
|
+
ne,
|
|
1564
|
+
T,
|
|
1565
1565
|
L,
|
|
1566
|
-
|
|
1567
|
-
|
|
1566
|
+
A,
|
|
1567
|
+
K
|
|
1568
1568
|
]
|
|
1569
|
-
),
|
|
1570
|
-
async (
|
|
1569
|
+
), z = w(
|
|
1570
|
+
async (D) => {
|
|
1571
1571
|
try {
|
|
1572
|
-
const
|
|
1573
|
-
for (const te of
|
|
1572
|
+
const ie = await X.current(D);
|
|
1573
|
+
for (const te of ie)
|
|
1574
1574
|
te.role !== "assistant" || !te.message_id || k.current.has(te.message_id) || (k.current.add(te.message_id), y.current(
|
|
1575
1575
|
{ message_id: te.message_id, response: te.response },
|
|
1576
|
-
|
|
1576
|
+
D
|
|
1577
1577
|
));
|
|
1578
|
-
} catch (
|
|
1579
|
-
console.warn("Backup poll failed:",
|
|
1578
|
+
} catch (ie) {
|
|
1579
|
+
console.warn("Backup poll failed:", ie);
|
|
1580
1580
|
}
|
|
1581
1581
|
},
|
|
1582
|
-
[
|
|
1583
|
-
),
|
|
1584
|
-
(
|
|
1585
|
-
|
|
1586
|
-
() =>
|
|
1587
|
-
|
|
1582
|
+
[X, y]
|
|
1583
|
+
), J = w(
|
|
1584
|
+
(D) => {
|
|
1585
|
+
C(), $.current = setInterval(
|
|
1586
|
+
() => z(D),
|
|
1587
|
+
g
|
|
1588
1588
|
);
|
|
1589
1589
|
},
|
|
1590
|
-
[
|
|
1591
|
-
),
|
|
1592
|
-
function
|
|
1593
|
-
if (!
|
|
1590
|
+
[C, z, g]
|
|
1591
|
+
), ue = w(
|
|
1592
|
+
function D() {
|
|
1593
|
+
if (!R.current || m.current || S.current)
|
|
1594
1594
|
return;
|
|
1595
|
-
const
|
|
1596
|
-
if (!
|
|
1595
|
+
const ie = I.current;
|
|
1596
|
+
if (!ie) return;
|
|
1597
1597
|
const te = Math.min(
|
|
1598
|
-
|
|
1599
|
-
|
|
1598
|
+
Vr * Math.pow(2, j.current),
|
|
1599
|
+
Hr
|
|
1600
1600
|
);
|
|
1601
|
-
j.current += 1,
|
|
1602
|
-
|
|
1601
|
+
j.current += 1, S.current = setTimeout(async () => {
|
|
1602
|
+
S.current = null, m.current = !0;
|
|
1603
1603
|
try {
|
|
1604
|
-
await
|
|
1604
|
+
await B(ie), j.current = 0, m.current = !1, await z(ie);
|
|
1605
1605
|
} catch {
|
|
1606
|
-
|
|
1606
|
+
m.current = !1, D();
|
|
1607
1607
|
}
|
|
1608
1608
|
}, te);
|
|
1609
1609
|
},
|
|
1610
|
-
[
|
|
1610
|
+
[B, z]
|
|
1611
1611
|
);
|
|
1612
|
-
|
|
1613
|
-
|
|
1612
|
+
Z(() => {
|
|
1613
|
+
M.current = ue;
|
|
1614
1614
|
});
|
|
1615
|
-
const
|
|
1616
|
-
async (
|
|
1617
|
-
if (!
|
|
1615
|
+
const pe = w(
|
|
1616
|
+
async (D) => {
|
|
1617
|
+
if (!ee || !D)
|
|
1618
1618
|
throw new Error(
|
|
1619
1619
|
"Cannot connect: AppSync settings not ready or missing chatId"
|
|
1620
1620
|
);
|
|
1621
|
-
|
|
1621
|
+
O(), R.current = !0, I.current = D, j.current = 0, J(D), await B(D);
|
|
1622
1622
|
},
|
|
1623
|
-
[
|
|
1624
|
-
),
|
|
1625
|
-
|
|
1626
|
-
}, [
|
|
1623
|
+
[ee, O, B, J]
|
|
1624
|
+
), ge = w(() => {
|
|
1625
|
+
R.current = !1, I.current = null, j.current = 0, O(), C(), v();
|
|
1626
|
+
}, [O, C, v]), me = w(() => {
|
|
1627
1627
|
k.current.clear();
|
|
1628
1628
|
}, []);
|
|
1629
|
-
return
|
|
1630
|
-
!
|
|
1631
|
-
console.error("Failed to eagerly connect:",
|
|
1629
|
+
return Z(() => {
|
|
1630
|
+
!t || !ee || I.current === t || pe(t).catch((D) => {
|
|
1631
|
+
console.error("Failed to eagerly connect:", D), I.current = t, R.current = !0, M.current();
|
|
1632
1632
|
});
|
|
1633
|
-
}, [
|
|
1634
|
-
|
|
1635
|
-
}, [
|
|
1633
|
+
}, [t, ee, pe]), Z(() => () => {
|
|
1634
|
+
ge();
|
|
1635
|
+
}, [ge]), { connect: pe, disconnect: ge, clearProcessedIds: me };
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1637
|
+
function Jr(e) {
|
|
1638
1638
|
return {
|
|
1639
|
-
id:
|
|
1640
|
-
content:
|
|
1639
|
+
id: e.message_id,
|
|
1640
|
+
content: e.response.content ?? "",
|
|
1641
1641
|
sender: "assistant",
|
|
1642
1642
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1643
1643
|
};
|
|
1644
1644
|
}
|
|
1645
|
-
function
|
|
1645
|
+
function Gr(e) {
|
|
1646
1646
|
return {
|
|
1647
1647
|
id: crypto.randomUUID(),
|
|
1648
|
-
content:
|
|
1648
|
+
content: e,
|
|
1649
1649
|
sender: "assistant",
|
|
1650
1650
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1651
1651
|
isWelcomeMessage: !0
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1654
|
+
function Yr() {
|
|
1655
1655
|
return {
|
|
1656
1656
|
id: crypto.randomUUID(),
|
|
1657
1657
|
content: "",
|
|
@@ -1660,7 +1660,7 @@ function Hr() {
|
|
|
1660
1660
|
isRatingRequest: !0
|
|
1661
1661
|
};
|
|
1662
1662
|
}
|
|
1663
|
-
function
|
|
1663
|
+
function Xr() {
|
|
1664
1664
|
return {
|
|
1665
1665
|
id: crypto.randomUUID(),
|
|
1666
1666
|
content: "This conversation is closed, please start a new chat.",
|
|
@@ -1668,13 +1668,13 @@ function Vr() {
|
|
|
1668
1668
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1669
1669
|
};
|
|
1670
1670
|
}
|
|
1671
|
-
function
|
|
1671
|
+
function Qr(e, t) {
|
|
1672
1672
|
return {
|
|
1673
|
-
...
|
|
1673
|
+
...e,
|
|
1674
1674
|
id: crypto.randomUUID(),
|
|
1675
1675
|
isNew: !0,
|
|
1676
|
-
...
|
|
1677
|
-
attachments:
|
|
1676
|
+
...t.length > 0 ? {
|
|
1677
|
+
attachments: t.map(
|
|
1678
1678
|
({ file: o, mimeType: r, previewUrl: n }) => ({
|
|
1679
1679
|
url: n,
|
|
1680
1680
|
mimeType: r,
|
|
@@ -1685,253 +1685,267 @@ function Wr(t, e) {
|
|
|
1685
1685
|
} : {}
|
|
1686
1686
|
};
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return
|
|
1690
|
-
(r) => r.id ===
|
|
1688
|
+
function en(e, t, o) {
|
|
1689
|
+
return e.map(
|
|
1690
|
+
(r) => r.id === t ? o(r) : r
|
|
1691
1691
|
);
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function tn(e, t, o) {
|
|
1694
1694
|
return {
|
|
1695
|
-
...
|
|
1696
|
-
attachments:
|
|
1697
|
-
(r, n) => n ===
|
|
1695
|
+
...e,
|
|
1696
|
+
attachments: e.attachments?.map(
|
|
1697
|
+
(r, n) => n === t ? { ...r, uploadProgress: o } : r
|
|
1698
1698
|
)
|
|
1699
1699
|
};
|
|
1700
1700
|
}
|
|
1701
|
-
function
|
|
1702
|
-
return
|
|
1701
|
+
function on(e, t) {
|
|
1702
|
+
return e.flatMap((o) => o.id !== t ? [o] : o.content ? [{ ...o, attachments: void 0 }] : []);
|
|
1703
1703
|
}
|
|
1704
|
-
function
|
|
1705
|
-
appId:
|
|
1706
|
-
userId:
|
|
1704
|
+
function rn({
|
|
1705
|
+
appId: e,
|
|
1706
|
+
userId: t,
|
|
1707
1707
|
userName: o,
|
|
1708
1708
|
userData: r,
|
|
1709
1709
|
externalId: n,
|
|
1710
1710
|
deviceId: i,
|
|
1711
|
-
apiClient:
|
|
1711
|
+
apiClient: c,
|
|
1712
1712
|
chatSettings: s,
|
|
1713
|
-
messages:
|
|
1713
|
+
messages: d,
|
|
1714
1714
|
setMessages: a,
|
|
1715
1715
|
currentChat: l,
|
|
1716
|
-
setCurrentChat:
|
|
1717
|
-
onChatClosed:
|
|
1718
|
-
isChatClosed:
|
|
1716
|
+
setCurrentChat: u,
|
|
1717
|
+
onChatClosed: p,
|
|
1718
|
+
isChatClosed: h,
|
|
1719
|
+
onAgentMessage: f
|
|
1719
1720
|
}) {
|
|
1720
|
-
const { saveChatData: g, clearChatData:
|
|
1721
|
-
appId:
|
|
1722
|
-
}), { publishApiError:
|
|
1723
|
-
(
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1721
|
+
const { saveChatData: g, clearChatData: k, updateLastActivity: q, markChatClosed: I } = tt({
|
|
1722
|
+
appId: e
|
|
1723
|
+
}), { publishApiError: j, publishNetworkError: S } = De(), { showCognition: $, hideCognition: R } = jt(), m = V(c), y = V(d), P = w(
|
|
1724
|
+
(b, v) => {
|
|
1725
|
+
if (!b.response.content) return;
|
|
1726
|
+
const C = !!s?.welcome_message && b.response.content === s.welcome_message, O = y.current.some(
|
|
1727
|
+
(M) => M.isRatingRequest
|
|
1728
|
+
);
|
|
1729
|
+
!C && !O && f?.(), a((M) => {
|
|
1730
|
+
if (M.some((J) => J.isRatingRequest) || s?.welcome_message && b.response.content === s.welcome_message)
|
|
1731
|
+
return M;
|
|
1732
|
+
const z = [
|
|
1733
|
+
...M.filter((J) => !J.isThinking),
|
|
1734
|
+
Jr(b)
|
|
1730
1735
|
];
|
|
1731
1736
|
return g(
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1737
|
+
v,
|
|
1738
|
+
t,
|
|
1739
|
+
z,
|
|
1735
1740
|
i,
|
|
1736
|
-
|
|
1737
|
-
),
|
|
1741
|
+
m.current?.getChatToken()
|
|
1742
|
+
), z;
|
|
1738
1743
|
});
|
|
1739
1744
|
},
|
|
1740
|
-
[
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
+
[
|
|
1746
|
+
s,
|
|
1747
|
+
i,
|
|
1748
|
+
g,
|
|
1749
|
+
a,
|
|
1750
|
+
t,
|
|
1751
|
+
m,
|
|
1752
|
+
y,
|
|
1753
|
+
f
|
|
1754
|
+
]
|
|
1755
|
+
), oe = w(() => {
|
|
1756
|
+
R(), a((b) => b.filter((v) => !v.isThinking));
|
|
1757
|
+
}, [a, R]), G = w(() => {
|
|
1758
|
+
a((b) => [...b.filter((C) => !C.isRatingRequest), Yr()]);
|
|
1745
1759
|
}, [a]);
|
|
1746
|
-
|
|
1747
|
-
}, [
|
|
1748
|
-
const
|
|
1749
|
-
(
|
|
1750
|
-
[
|
|
1751
|
-
),
|
|
1752
|
-
|
|
1753
|
-
}, [
|
|
1760
|
+
Z(() => {
|
|
1761
|
+
}, [G]);
|
|
1762
|
+
const re = w(
|
|
1763
|
+
(b) => m.current ? m.current.getChatHistory(b) : Promise.resolve([]),
|
|
1764
|
+
[m]
|
|
1765
|
+
), ne = w(() => m.current?.getChatToken() ?? null, [m]), T = w(() => {
|
|
1766
|
+
I(), p?.();
|
|
1767
|
+
}, [I, p]), { connect: L, disconnect: A, clearProcessedIds: K } = Fr({
|
|
1754
1768
|
chatSettings: s,
|
|
1755
1769
|
chatId: l?.id ?? null,
|
|
1756
|
-
messages:
|
|
1757
|
-
onMessage:
|
|
1758
|
-
onCognition:
|
|
1759
|
-
onCognitionComplete:
|
|
1760
|
-
onError:
|
|
1761
|
-
onChatClosed:
|
|
1762
|
-
onRatingRequest:
|
|
1763
|
-
onBreadcrumb:
|
|
1764
|
-
fetchHistory:
|
|
1765
|
-
getChatToken:
|
|
1766
|
-
}),
|
|
1767
|
-
|
|
1768
|
-
(
|
|
1769
|
-
),
|
|
1770
|
+
messages: d,
|
|
1771
|
+
onMessage: P,
|
|
1772
|
+
onCognition: $,
|
|
1773
|
+
onCognitionComplete: R,
|
|
1774
|
+
onError: oe,
|
|
1775
|
+
onChatClosed: T,
|
|
1776
|
+
onRatingRequest: G,
|
|
1777
|
+
onBreadcrumb: T,
|
|
1778
|
+
fetchHistory: re,
|
|
1779
|
+
getChatToken: ne
|
|
1780
|
+
}), X = w(() => {
|
|
1781
|
+
R(), A(), K(), Dt(d), a(
|
|
1782
|
+
(b) => b.filter((v) => Array.isArray(v) ? !1 : v.isWelcomeMessage)
|
|
1783
|
+
), k(), u(null);
|
|
1770
1784
|
}, [
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1785
|
+
R,
|
|
1786
|
+
A,
|
|
1787
|
+
K,
|
|
1788
|
+
d,
|
|
1789
|
+
k,
|
|
1776
1790
|
a,
|
|
1777
|
-
|
|
1778
|
-
]),
|
|
1779
|
-
(
|
|
1791
|
+
u
|
|
1792
|
+
]), H = w(
|
|
1793
|
+
(b, v) => a((C) => en(C, b, v)),
|
|
1780
1794
|
[a]
|
|
1781
|
-
),
|
|
1782
|
-
async (
|
|
1783
|
-
const
|
|
1784
|
-
userId: n ||
|
|
1795
|
+
), W = w(
|
|
1796
|
+
async (b) => {
|
|
1797
|
+
const v = await b.createConversation({
|
|
1798
|
+
userId: n || t,
|
|
1785
1799
|
deviceId: i,
|
|
1786
1800
|
userName: o,
|
|
1787
1801
|
userData: r,
|
|
1788
1802
|
externalMetadata: {
|
|
1789
|
-
searchParams:
|
|
1803
|
+
searchParams: io()
|
|
1790
1804
|
}
|
|
1791
1805
|
});
|
|
1792
|
-
|
|
1806
|
+
u({ id: v.chat_id });
|
|
1793
1807
|
try {
|
|
1794
|
-
await
|
|
1795
|
-
} catch (
|
|
1808
|
+
await L(v.chat_id);
|
|
1809
|
+
} catch (C) {
|
|
1796
1810
|
console.warn(
|
|
1797
1811
|
"Failed to connect realtime channel, continuing with REST-only delivery:",
|
|
1798
|
-
|
|
1812
|
+
C
|
|
1799
1813
|
);
|
|
1800
1814
|
}
|
|
1801
|
-
return
|
|
1815
|
+
return v.chat_id;
|
|
1802
1816
|
},
|
|
1803
|
-
[n,
|
|
1804
|
-
),
|
|
1805
|
-
(
|
|
1806
|
-
|
|
1807
|
-
({ file:
|
|
1808
|
-
conversationId:
|
|
1809
|
-
file:
|
|
1810
|
-
onProgress: (
|
|
1811
|
-
|
|
1812
|
-
(
|
|
1817
|
+
[n, t, i, o, r, u, L]
|
|
1818
|
+
), ae = w(
|
|
1819
|
+
(b, v, C, O) => Promise.all(
|
|
1820
|
+
C.map(
|
|
1821
|
+
({ file: M }, B) => b.uploadAttachment({
|
|
1822
|
+
conversationId: v,
|
|
1823
|
+
file: M,
|
|
1824
|
+
onProgress: (z) => H(
|
|
1825
|
+
O,
|
|
1826
|
+
(J) => tn(J, B, z)
|
|
1813
1827
|
)
|
|
1814
|
-
}).catch((
|
|
1815
|
-
throw
|
|
1828
|
+
}).catch((z) => {
|
|
1829
|
+
throw $t(z, M.name);
|
|
1816
1830
|
})
|
|
1817
1831
|
)
|
|
1818
1832
|
),
|
|
1819
|
-
[
|
|
1820
|
-
),
|
|
1821
|
-
(
|
|
1822
|
-
|
|
1823
|
-
const
|
|
1824
|
-
if (
|
|
1825
|
-
|
|
1833
|
+
[H]
|
|
1834
|
+
), Q = w(
|
|
1835
|
+
(b, v, C, O) => {
|
|
1836
|
+
R(), O && a((B) => on(B, C)), a((B) => B.filter((z) => !z.isThinking));
|
|
1837
|
+
const M = () => H(C, (B) => ({ ...B, isFailed: !0 }));
|
|
1838
|
+
if (b instanceof Bt) {
|
|
1839
|
+
M();
|
|
1826
1840
|
return;
|
|
1827
1841
|
}
|
|
1828
|
-
if (
|
|
1829
|
-
|
|
1842
|
+
if (b instanceof et || b instanceof Oe && b.status === 403) {
|
|
1843
|
+
S();
|
|
1830
1844
|
return;
|
|
1831
1845
|
}
|
|
1832
|
-
|
|
1846
|
+
j(b), b instanceof Oe && // A 401 means an expired or closed chat token: drop the session so
|
|
1833
1847
|
// the next send starts a fresh one, as for a client-side expiry.
|
|
1834
|
-
(
|
|
1848
|
+
(b.status >= 500 || b.status === 401) ? (u(null), k(), a((B) => B.filter((z) => z.id !== C)), v.reset()) : M();
|
|
1835
1849
|
},
|
|
1836
1850
|
[
|
|
1837
|
-
|
|
1851
|
+
R,
|
|
1838
1852
|
a,
|
|
1839
|
-
|
|
1853
|
+
H,
|
|
1854
|
+
S,
|
|
1840
1855
|
j,
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
f
|
|
1856
|
+
u,
|
|
1857
|
+
k
|
|
1844
1858
|
]
|
|
1845
|
-
),
|
|
1846
|
-
async (
|
|
1847
|
-
if (!
|
|
1848
|
-
if (
|
|
1849
|
-
a((
|
|
1859
|
+
), ee = w(
|
|
1860
|
+
async (b, v = []) => {
|
|
1861
|
+
if (!c || d.some((O) => O.isRatingRequest)) return;
|
|
1862
|
+
if (h) {
|
|
1863
|
+
a((O) => [...O, Xr()]);
|
|
1850
1864
|
return;
|
|
1851
1865
|
}
|
|
1852
|
-
const
|
|
1853
|
-
a([...
|
|
1866
|
+
const C = Qr(b, v);
|
|
1867
|
+
a([...d, C]), q();
|
|
1854
1868
|
try {
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1869
|
+
const O = l?.id || await W(c), M = await ae(
|
|
1870
|
+
c,
|
|
1871
|
+
O,
|
|
1872
|
+
v,
|
|
1873
|
+
C.id
|
|
1860
1874
|
);
|
|
1861
|
-
|
|
1862
|
-
...
|
|
1863
|
-
attachments:
|
|
1875
|
+
M.length > 0 && H(C.id, (z) => ({
|
|
1876
|
+
...z,
|
|
1877
|
+
attachments: Lt(M, v)
|
|
1864
1878
|
}));
|
|
1865
|
-
const
|
|
1866
|
-
text:
|
|
1867
|
-
attachments:
|
|
1868
|
-
conversationId:
|
|
1869
|
-
userId: n ||
|
|
1879
|
+
const B = await c.replyToConversation({
|
|
1880
|
+
text: b.content,
|
|
1881
|
+
attachments: M,
|
|
1882
|
+
conversationId: O,
|
|
1883
|
+
userId: n || t,
|
|
1870
1884
|
deviceId: i,
|
|
1871
1885
|
userName: o,
|
|
1872
1886
|
userData: r
|
|
1873
1887
|
});
|
|
1874
|
-
|
|
1875
|
-
...
|
|
1876
|
-
id:
|
|
1888
|
+
H(C.id, (z) => ({
|
|
1889
|
+
...z,
|
|
1890
|
+
id: B.message_id,
|
|
1877
1891
|
isNew: !1
|
|
1878
1892
|
}));
|
|
1879
|
-
} catch (
|
|
1880
|
-
throw
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
),
|
|
1893
|
+
} catch (O) {
|
|
1894
|
+
throw Q(
|
|
1895
|
+
O,
|
|
1896
|
+
c,
|
|
1897
|
+
C.id,
|
|
1898
|
+
v.length > 0
|
|
1899
|
+
), O;
|
|
1886
1900
|
}
|
|
1887
1901
|
},
|
|
1888
1902
|
[
|
|
1889
|
-
d,
|
|
1890
1903
|
c,
|
|
1891
|
-
|
|
1904
|
+
d,
|
|
1905
|
+
h,
|
|
1892
1906
|
a,
|
|
1893
|
-
|
|
1907
|
+
q,
|
|
1894
1908
|
l?.id,
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1909
|
+
W,
|
|
1910
|
+
ae,
|
|
1911
|
+
H,
|
|
1912
|
+
Q,
|
|
1899
1913
|
n,
|
|
1900
|
-
|
|
1914
|
+
t,
|
|
1901
1915
|
i,
|
|
1902
1916
|
o,
|
|
1903
1917
|
r
|
|
1904
1918
|
]
|
|
1905
|
-
),
|
|
1906
|
-
async (
|
|
1907
|
-
const
|
|
1908
|
-
!
|
|
1919
|
+
), fe = w(
|
|
1920
|
+
async (b) => {
|
|
1921
|
+
const v = l?.id;
|
|
1922
|
+
!m.current || !v || await m.current.addRating(v, b);
|
|
1909
1923
|
},
|
|
1910
|
-
[l?.id,
|
|
1924
|
+
[l?.id, m]
|
|
1911
1925
|
);
|
|
1912
1926
|
return {
|
|
1913
|
-
onCleanMessages:
|
|
1914
|
-
onSendMessage:
|
|
1915
|
-
onRateChat:
|
|
1927
|
+
onCleanMessages: X,
|
|
1928
|
+
onSendMessage: ee,
|
|
1929
|
+
onRateChat: fe
|
|
1916
1930
|
};
|
|
1917
1931
|
}
|
|
1918
|
-
const
|
|
1919
|
-
function
|
|
1920
|
-
return typeof window > "u" || typeof import.meta > "u" ? "" :
|
|
1932
|
+
const nn = { BASE_URL: "/", DEV: !1, MODE: "dev", PROD: !0, SSR: !1, VITE_API_URL: "https://chat.eloquentai.dev", VITE_CDN_URL: "https://cdn.eloquentai.dev", VITE_ENVIRONMENT: "dev", VITE_REGION_API_URL: "https://region.eloquentai.dev" };
|
|
1933
|
+
function Ct(e) {
|
|
1934
|
+
return typeof window > "u" || typeof import.meta > "u" ? "" : nn[e] || "";
|
|
1921
1935
|
}
|
|
1922
|
-
const
|
|
1923
|
-
function
|
|
1924
|
-
return
|
|
1936
|
+
const an = Ct("VITE_API_URL"), sn = Ct("VITE_REGION_API_URL");
|
|
1937
|
+
function ln() {
|
|
1938
|
+
return an || "";
|
|
1925
1939
|
}
|
|
1926
|
-
function
|
|
1927
|
-
return
|
|
1940
|
+
function cn() {
|
|
1941
|
+
return sn || "";
|
|
1928
1942
|
}
|
|
1929
|
-
class
|
|
1943
|
+
class dn {
|
|
1930
1944
|
httpClient;
|
|
1931
1945
|
userId = null;
|
|
1932
1946
|
conversationId = null;
|
|
1933
|
-
constructor(
|
|
1934
|
-
this.userId =
|
|
1947
|
+
constructor(t) {
|
|
1948
|
+
this.userId = t.userId || null, this.httpClient = new Nt(t);
|
|
1935
1949
|
}
|
|
1936
1950
|
getUserData() {
|
|
1937
1951
|
return {
|
|
@@ -1945,22 +1959,22 @@ class rn {
|
|
|
1945
1959
|
reset() {
|
|
1946
1960
|
this.conversationId = null, this.httpClient.setChatToken(null);
|
|
1947
1961
|
}
|
|
1948
|
-
setRegion(
|
|
1949
|
-
this.httpClient.setRegion(
|
|
1962
|
+
setRegion(t) {
|
|
1963
|
+
this.httpClient.setRegion(t);
|
|
1950
1964
|
}
|
|
1951
1965
|
getChatToken() {
|
|
1952
1966
|
return this.httpClient.getChatToken();
|
|
1953
1967
|
}
|
|
1954
|
-
setChatToken(
|
|
1955
|
-
this.httpClient.setChatToken(
|
|
1968
|
+
setChatToken(t) {
|
|
1969
|
+
this.httpClient.setChatToken(t);
|
|
1956
1970
|
}
|
|
1957
1971
|
/**
|
|
1958
1972
|
* Get organization data by app ID
|
|
1959
1973
|
*/
|
|
1960
|
-
async getOrganizationByAppId(
|
|
1961
|
-
const o =
|
|
1974
|
+
async getOrganizationByAppId(t) {
|
|
1975
|
+
const o = cn();
|
|
1962
1976
|
return await this.httpClient.getExternal(
|
|
1963
|
-
`${o}/by-app-id/${
|
|
1977
|
+
`${o}/by-app-id/${t}`
|
|
1964
1978
|
);
|
|
1965
1979
|
}
|
|
1966
1980
|
async boot() {
|
|
@@ -1968,136 +1982,136 @@ class rn {
|
|
|
1968
1982
|
"/v1/sdk/boot"
|
|
1969
1983
|
)).data;
|
|
1970
1984
|
}
|
|
1971
|
-
async addRating(
|
|
1972
|
-
return (await this.httpClient.put(`/v1/chat/${
|
|
1985
|
+
async addRating(t, o) {
|
|
1986
|
+
return (await this.httpClient.put(`/v1/chat/${t}/rating`, { rating: o })).data;
|
|
1973
1987
|
}
|
|
1974
|
-
async createConversation(
|
|
1988
|
+
async createConversation(t) {
|
|
1975
1989
|
const o = await this.httpClient.post("/v2/chat", {
|
|
1976
1990
|
user_data: {
|
|
1977
|
-
user_id:
|
|
1978
|
-
device_id:
|
|
1979
|
-
user_name:
|
|
1980
|
-
external_id:
|
|
1981
|
-
user_data:
|
|
1991
|
+
user_id: t.userId,
|
|
1992
|
+
device_id: t.deviceId,
|
|
1993
|
+
user_name: t.userName,
|
|
1994
|
+
external_id: t.externalId,
|
|
1995
|
+
user_data: t.userData
|
|
1982
1996
|
},
|
|
1983
|
-
...
|
|
1997
|
+
...t.externalMetadata && Object.keys(t.externalMetadata).length > 0 ? { external_metadata: t.externalMetadata } : {}
|
|
1984
1998
|
}), { data: r } = o;
|
|
1985
1999
|
return this.httpClient.setChatToken(r.chat_token), r;
|
|
1986
2000
|
}
|
|
1987
|
-
async replyToConversation(
|
|
2001
|
+
async replyToConversation(t) {
|
|
1988
2002
|
const o = {
|
|
1989
|
-
...
|
|
1990
|
-
...
|
|
2003
|
+
...t.text ? { text: t.text } : {},
|
|
2004
|
+
...t.attachments?.length ? { attachments: t.attachments } : {},
|
|
1991
2005
|
user_data: {
|
|
1992
|
-
device_id:
|
|
1993
|
-
user_id:
|
|
1994
|
-
user_name:
|
|
1995
|
-
user_data:
|
|
2006
|
+
device_id: t.deviceId,
|
|
2007
|
+
user_id: t.userId,
|
|
2008
|
+
user_name: t.userName,
|
|
2009
|
+
user_data: t.userData
|
|
1996
2010
|
}
|
|
1997
|
-
}, { data: r } = await this.httpClient.post(`/v3/chat/${
|
|
2011
|
+
}, { data: r } = await this.httpClient.post(`/v3/chat/${t.conversationId}`, o);
|
|
1998
2012
|
return r;
|
|
1999
2013
|
}
|
|
2000
|
-
async uploadAttachment(
|
|
2014
|
+
async uploadAttachment(t) {
|
|
2001
2015
|
const o = new FormData();
|
|
2002
|
-
o.append("file",
|
|
2016
|
+
o.append("file", t.file);
|
|
2003
2017
|
const r = await this.httpClient.upload(
|
|
2004
|
-
`/v1/chat/${
|
|
2018
|
+
`/v1/chat/${t.conversationId}/attachments`,
|
|
2005
2019
|
o,
|
|
2006
|
-
|
|
2020
|
+
t.onProgress
|
|
2007
2021
|
);
|
|
2008
|
-
return
|
|
2022
|
+
return Zr.parse(r).data;
|
|
2009
2023
|
}
|
|
2010
|
-
async getAttachmentUrls(
|
|
2024
|
+
async getAttachmentUrls(t, o) {
|
|
2011
2025
|
const r = await this.httpClient.post(
|
|
2012
|
-
`/v1/chat/${
|
|
2026
|
+
`/v1/chat/${t}/attachments/urls`,
|
|
2013
2027
|
{ urls: o }
|
|
2014
2028
|
);
|
|
2015
|
-
return
|
|
2029
|
+
return Kr.parse(r).data.urls;
|
|
2016
2030
|
}
|
|
2017
|
-
async identifyUser(
|
|
2031
|
+
async identifyUser(t) {
|
|
2018
2032
|
const o = {
|
|
2019
|
-
device_id:
|
|
2020
|
-
user_id:
|
|
2021
|
-
user_name:
|
|
2022
|
-
external_id:
|
|
2023
|
-
user_data:
|
|
2024
|
-
}, { data: r } = await this.httpClient.post(`/v1/chat/${
|
|
2033
|
+
device_id: t.deviceId,
|
|
2034
|
+
user_id: t.userId,
|
|
2035
|
+
user_name: t.userName,
|
|
2036
|
+
external_id: t.externalId,
|
|
2037
|
+
user_data: t.userData
|
|
2038
|
+
}, { data: r } = await this.httpClient.post(`/v1/chat/${t.conversationId}/identify`, o);
|
|
2025
2039
|
return r;
|
|
2026
2040
|
}
|
|
2027
|
-
async getChatHistory(
|
|
2041
|
+
async getChatHistory(t) {
|
|
2028
2042
|
return (await this.httpClient.get(
|
|
2029
|
-
`/v1/chat/${
|
|
2043
|
+
`/v1/chat/${t}/history`
|
|
2030
2044
|
)).data;
|
|
2031
2045
|
}
|
|
2032
2046
|
}
|
|
2033
|
-
const
|
|
2047
|
+
const un = {
|
|
2034
2048
|
retries: 3,
|
|
2035
2049
|
minDelayMs: 200,
|
|
2036
2050
|
maxDelayMs: 1e3,
|
|
2037
2051
|
factor: 2
|
|
2038
2052
|
};
|
|
2039
|
-
function
|
|
2040
|
-
return
|
|
2053
|
+
function pn(e) {
|
|
2054
|
+
return e instanceof et ? !0 : e instanceof Oe ? e.status === 429 || e.status >= 500 : !1;
|
|
2041
2055
|
}
|
|
2042
|
-
function
|
|
2043
|
-
const o =
|
|
2056
|
+
function hn(e, t) {
|
|
2057
|
+
const o = t.minDelayMs * t.factor ** e, r = Math.min(o, t.maxDelayMs);
|
|
2044
2058
|
return Math.random() * r;
|
|
2045
2059
|
}
|
|
2046
|
-
async function
|
|
2047
|
-
const o = { ...
|
|
2060
|
+
async function mt(e, t = {}) {
|
|
2061
|
+
const o = { ...un, ...t };
|
|
2048
2062
|
for (let r = 0; ; r++)
|
|
2049
2063
|
try {
|
|
2050
|
-
return await
|
|
2064
|
+
return await e();
|
|
2051
2065
|
} catch (n) {
|
|
2052
|
-
if (r >= o.retries || !
|
|
2066
|
+
if (r >= o.retries || !pn(n))
|
|
2053
2067
|
throw n;
|
|
2054
2068
|
await new Promise(
|
|
2055
|
-
(i) => setTimeout(i,
|
|
2069
|
+
(i) => setTimeout(i, hn(r, o))
|
|
2056
2070
|
);
|
|
2057
2071
|
}
|
|
2058
2072
|
}
|
|
2059
|
-
const
|
|
2060
|
-
function
|
|
2073
|
+
const Pe = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Map();
|
|
2074
|
+
function fn(e, t, o) {
|
|
2061
2075
|
const r = o?.dedupe !== !1, [n, i] = _(
|
|
2062
|
-
() =>
|
|
2063
|
-
), { publishApiError:
|
|
2064
|
-
|
|
2065
|
-
|
|
2076
|
+
() => Pe.get(e)
|
|
2077
|
+
), { publishApiError: c, publishNetworkError: s } = De(), [d, a] = _(void 0), [l, u] = _(!1), p = N(!0);
|
|
2078
|
+
N(() => (p.current = !0, () => {
|
|
2079
|
+
p.current = !1;
|
|
2066
2080
|
}));
|
|
2067
|
-
const
|
|
2068
|
-
if (
|
|
2069
|
-
const
|
|
2070
|
-
return i(
|
|
2081
|
+
const h = w(async () => {
|
|
2082
|
+
if (Pe.has(e)) {
|
|
2083
|
+
const f = Pe.get(e);
|
|
2084
|
+
return i(f), f;
|
|
2071
2085
|
}
|
|
2072
|
-
|
|
2086
|
+
u(!0), a(void 0);
|
|
2073
2087
|
try {
|
|
2074
|
-
if (r &&
|
|
2075
|
-
return await
|
|
2076
|
-
const
|
|
2077
|
-
r &&
|
|
2078
|
-
const
|
|
2079
|
-
return
|
|
2080
|
-
} catch (
|
|
2081
|
-
throw
|
|
2088
|
+
if (r && Ae.has(e))
|
|
2089
|
+
return await Ae.get(e);
|
|
2090
|
+
const f = t();
|
|
2091
|
+
r && Ae.set(e, f);
|
|
2092
|
+
const g = await f;
|
|
2093
|
+
return Pe.set(e, g), p.current && i(g), g;
|
|
2094
|
+
} catch (f) {
|
|
2095
|
+
throw f instanceof et || f instanceof Oe && f.status === 403 ? s() : c(f), p.current && a(f), f;
|
|
2082
2096
|
} finally {
|
|
2083
|
-
|
|
2097
|
+
Ae.delete(e), p.current && u(!1);
|
|
2084
2098
|
}
|
|
2085
|
-
}, [
|
|
2086
|
-
return { data: n, error:
|
|
2087
|
-
}
|
|
2088
|
-
function
|
|
2089
|
-
const o =
|
|
2090
|
-
return
|
|
2091
|
-
userId:
|
|
2092
|
-
externalId:
|
|
2099
|
+
}, [e, r, t, c, s]);
|
|
2100
|
+
return { data: n, error: d, isLoading: l, fetch: h };
|
|
2101
|
+
}
|
|
2102
|
+
function bt(e, t) {
|
|
2103
|
+
const o = e?.deviceId || crypto.randomUUID();
|
|
2104
|
+
return e?.userId ? e.externalId !== t ? { userId: e.userId, externalId: t, deviceId: o } : {
|
|
2105
|
+
userId: e.userId,
|
|
2106
|
+
externalId: e.externalId,
|
|
2093
2107
|
deviceId: o
|
|
2094
|
-
} :
|
|
2108
|
+
} : t ? { userId: t, externalId: t, deviceId: o } : { userId: crypto.randomUUID(), externalId: null, deviceId: o };
|
|
2095
2109
|
}
|
|
2096
|
-
function
|
|
2097
|
-
const { appId:
|
|
2098
|
-
() =>
|
|
2099
|
-
), [
|
|
2100
|
-
return
|
|
2110
|
+
function gn(e) {
|
|
2111
|
+
const { appId: t, initialUserId: o } = e, { getSavedChatData: r } = tt({ appId: t }), [n, i] = _(
|
|
2112
|
+
() => bt(r(), o)
|
|
2113
|
+
), [c, s] = _(o);
|
|
2114
|
+
return c !== o && (s(o), i(bt(r(), o))), {
|
|
2101
2115
|
// Identity is available synchronously; kept in the contract because
|
|
2102
2116
|
// consumers (SDK boot) still key off it.
|
|
2103
2117
|
isReady: !0,
|
|
@@ -2106,259 +2120,361 @@ function cn(t) {
|
|
|
2106
2120
|
externalId: n.externalId
|
|
2107
2121
|
};
|
|
2108
2122
|
}
|
|
2109
|
-
function
|
|
2110
|
-
apiUrl:
|
|
2111
|
-
appId:
|
|
2123
|
+
function mn({
|
|
2124
|
+
apiUrl: e,
|
|
2125
|
+
appId: t,
|
|
2112
2126
|
initialUserId: o,
|
|
2113
2127
|
userName: r,
|
|
2114
2128
|
userData: n
|
|
2115
2129
|
}) {
|
|
2116
2130
|
const {
|
|
2117
2131
|
userId: i,
|
|
2118
|
-
externalId:
|
|
2132
|
+
externalId: c,
|
|
2119
2133
|
deviceId: s,
|
|
2120
|
-
isReady:
|
|
2121
|
-
} =
|
|
2122
|
-
appId:
|
|
2123
|
-
}), { current:
|
|
2124
|
-
new
|
|
2125
|
-
baseURL:
|
|
2126
|
-
appId:
|
|
2134
|
+
isReady: d
|
|
2135
|
+
} = gn({ appId: t, initialUserId: o }), { isChatExpired: a, clearChatData: l, getSavedChatData: u } = tt({
|
|
2136
|
+
appId: t
|
|
2137
|
+
}), { current: p } = N(e || ln()), [h] = _(
|
|
2138
|
+
new dn({
|
|
2139
|
+
baseURL: p,
|
|
2140
|
+
appId: t
|
|
2127
2141
|
})
|
|
2128
|
-
), [
|
|
2129
|
-
|
|
2142
|
+
), [f, g] = _(null), [k, q] = _(null), [I, j] = _([]), [S, $] = _(!1), [R, m] = _(!1), [y, P] = _(!0), G = fn(`sdk-boot-${t}`, () => h.boot()).fetch;
|
|
2143
|
+
Z(() => {
|
|
2130
2144
|
if (a())
|
|
2131
2145
|
l();
|
|
2132
2146
|
else {
|
|
2133
2147
|
const {
|
|
2134
|
-
conversationId:
|
|
2135
|
-
userId:
|
|
2148
|
+
conversationId: ne,
|
|
2149
|
+
userId: T,
|
|
2136
2150
|
messages: L,
|
|
2137
|
-
isChatClosed:
|
|
2138
|
-
chatToken:
|
|
2139
|
-
} =
|
|
2140
|
-
|
|
2141
|
-
id:
|
|
2142
|
-
}),
|
|
2151
|
+
isChatClosed: A,
|
|
2152
|
+
chatToken: K
|
|
2153
|
+
} = u();
|
|
2154
|
+
ne && T && (q({
|
|
2155
|
+
id: ne
|
|
2156
|
+
}), h.setChatToken(K ?? null), L && L.length > 0 && j(L), A && m(!0));
|
|
2143
2157
|
}
|
|
2144
|
-
}, [
|
|
2145
|
-
const
|
|
2146
|
-
return
|
|
2147
|
-
if (
|
|
2148
|
-
|
|
2149
|
-
const [
|
|
2150
|
-
|
|
2158
|
+
}, [u, a, l, h]);
|
|
2159
|
+
const re = N(!1);
|
|
2160
|
+
return Z(() => {
|
|
2161
|
+
if (re.current) return;
|
|
2162
|
+
re.current = !0, (async () => {
|
|
2163
|
+
const [T, L] = await it(
|
|
2164
|
+
mt(() => h.getOrganizationByAppId(t))
|
|
2151
2165
|
);
|
|
2152
2166
|
if (L) {
|
|
2153
|
-
console.error("Failed to fetch organization data:", L),
|
|
2167
|
+
console.error("Failed to fetch organization data:", L), P(!1), $(!0);
|
|
2154
2168
|
return;
|
|
2155
2169
|
}
|
|
2156
|
-
|
|
2157
|
-
const [
|
|
2158
|
-
if (
|
|
2159
|
-
|
|
2170
|
+
h.setRegion(T.region);
|
|
2171
|
+
const [A, K] = await it(mt(G));
|
|
2172
|
+
if (K) {
|
|
2173
|
+
P(!1), $(!0);
|
|
2160
2174
|
return;
|
|
2161
2175
|
}
|
|
2162
2176
|
const {
|
|
2163
|
-
conversationId:
|
|
2164
|
-
userId:
|
|
2165
|
-
messages:
|
|
2166
|
-
} =
|
|
2167
|
-
|
|
2168
|
-
await
|
|
2177
|
+
conversationId: X,
|
|
2178
|
+
userId: H,
|
|
2179
|
+
messages: W
|
|
2180
|
+
} = u();
|
|
2181
|
+
X && H && W.some(Zt) && j(
|
|
2182
|
+
await Kt(h, X, W)
|
|
2169
2183
|
);
|
|
2170
|
-
const ae =
|
|
2171
|
-
|
|
2184
|
+
const ae = A.chat_settings.welcome_message;
|
|
2185
|
+
g(A.chat_settings), P(A.chat_settings.is_active ?? !0), ae && j((Q) => Q.length > 0 || Q.some((ee) => ee.isWelcomeMessage) ? Q : [Gr(ae)]), $(!0);
|
|
2172
2186
|
})();
|
|
2173
|
-
}, [
|
|
2187
|
+
}, [d, h, t, G, u]), {
|
|
2174
2188
|
userId: i,
|
|
2175
2189
|
userName: r,
|
|
2176
2190
|
userData: n,
|
|
2177
|
-
externalId:
|
|
2191
|
+
externalId: c,
|
|
2178
2192
|
deviceId: s,
|
|
2179
|
-
apiClient:
|
|
2180
|
-
chatSettings:
|
|
2193
|
+
apiClient: h,
|
|
2194
|
+
chatSettings: f,
|
|
2181
2195
|
currentChat: k,
|
|
2182
2196
|
messages: I,
|
|
2183
|
-
isReady:
|
|
2184
|
-
isChatClosed:
|
|
2197
|
+
isReady: S,
|
|
2198
|
+
isChatClosed: R,
|
|
2185
2199
|
isChatActive: y
|
|
2186
2200
|
};
|
|
2187
2201
|
}
|
|
2188
|
-
const
|
|
2189
|
-
function
|
|
2190
|
-
return typeof window > "u" ? !1 : window.matchMedia(
|
|
2202
|
+
const St = "(max-width: 640px)";
|
|
2203
|
+
function bn() {
|
|
2204
|
+
return typeof window > "u" ? !1 : window.matchMedia(St).matches;
|
|
2191
2205
|
}
|
|
2192
|
-
function
|
|
2193
|
-
const [
|
|
2206
|
+
function vn(e) {
|
|
2207
|
+
const [t, o] = _(bn), [r, n] = _(
|
|
2194
2208
|
null
|
|
2195
|
-
), i =
|
|
2196
|
-
return
|
|
2197
|
-
if (
|
|
2198
|
-
const s = window.matchMedia(
|
|
2209
|
+
), i = e ?? t, c = typeof window > "u";
|
|
2210
|
+
return Z(() => {
|
|
2211
|
+
if (c) return;
|
|
2212
|
+
const s = window.matchMedia(St), d = (a) => {
|
|
2199
2213
|
o(a.matches);
|
|
2200
2214
|
};
|
|
2201
|
-
return
|
|
2202
|
-
}, [
|
|
2203
|
-
if (
|
|
2215
|
+
return d(s), s.addEventListener("change", d), () => s.removeEventListener("change", d);
|
|
2216
|
+
}, [c]), Z(() => {
|
|
2217
|
+
if (c) return;
|
|
2204
2218
|
const s = document.createElement("div");
|
|
2205
2219
|
return s.className = "eloquent-ai-chat-portal", s.style.position = "relative", s.style.zIndex = "30", document.body.appendChild(s), n(s), () => {
|
|
2206
2220
|
s.parentElement && s.parentElement.removeChild(s);
|
|
2207
2221
|
};
|
|
2208
|
-
}, [
|
|
2209
|
-
isMobileScreen:
|
|
2222
|
+
}, [c]), {
|
|
2223
|
+
isMobileScreen: t,
|
|
2210
2224
|
isMobile: i,
|
|
2211
2225
|
portalContainer: r
|
|
2212
2226
|
};
|
|
2213
2227
|
}
|
|
2214
|
-
const
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2228
|
+
const vt = 1245, wn = [
|
|
2229
|
+
[2.32, 0.4],
|
|
2230
|
+
[4.25, 0.18]
|
|
2231
|
+
], qn = [
|
|
2232
|
+
{ start: 0, duration: 0.22, level: 0.45 },
|
|
2233
|
+
{ start: 0.16, duration: 0.2, level: 0.25 }
|
|
2234
|
+
], yn = 0.3, xn = 3e-3, wt = 1e-4;
|
|
2235
|
+
function qt(e, t, o, r, n, i) {
|
|
2236
|
+
const c = e.createOscillator(), s = e.createGain();
|
|
2237
|
+
c.type = "sine", c.frequency.setValueAtTime(o, n), s.gain.setValueAtTime(wt, n), s.gain.exponentialRampToValueAtTime(r, n + xn), s.gain.exponentialRampToValueAtTime(wt, n + i), c.connect(s).connect(t), c.start(n), c.stop(n + i + 0.05);
|
|
2238
|
+
}
|
|
2239
|
+
function kn(e) {
|
|
2240
|
+
const t = e.createGain();
|
|
2241
|
+
t.gain.value = yn;
|
|
2242
|
+
const o = e.createBiquadFilter();
|
|
2243
|
+
o.type = "lowpass", o.frequency.value = 6e3, t.connect(o).connect(e.destination);
|
|
2244
|
+
const r = e.currentTime + 0.02;
|
|
2245
|
+
qn.forEach((n) => {
|
|
2246
|
+
qt(
|
|
2247
|
+
e,
|
|
2248
|
+
t,
|
|
2249
|
+
vt,
|
|
2250
|
+
n.level,
|
|
2251
|
+
r + n.start,
|
|
2252
|
+
n.duration
|
|
2253
|
+
), wn.forEach(([i, c]) => {
|
|
2254
|
+
qt(
|
|
2255
|
+
e,
|
|
2256
|
+
t,
|
|
2257
|
+
vt * i,
|
|
2258
|
+
n.level * c,
|
|
2259
|
+
r + n.start,
|
|
2260
|
+
n.duration * 0.35
|
|
2261
|
+
);
|
|
2262
|
+
});
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
const Xe = "eloquentai:notification-sound-muted", _n = 3e3;
|
|
2266
|
+
function Cn() {
|
|
2267
|
+
try {
|
|
2268
|
+
return window.localStorage.getItem(Xe) === "true";
|
|
2269
|
+
} catch {
|
|
2270
|
+
return !1;
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
function Sn(e) {
|
|
2274
|
+
try {
|
|
2275
|
+
e ? window.localStorage.setItem(Xe, "true") : window.localStorage.removeItem(Xe);
|
|
2276
|
+
} catch {
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
function In(e) {
|
|
2280
|
+
return document.visibilityState === "visible" && document.hasFocus() && e;
|
|
2281
|
+
}
|
|
2282
|
+
function En() {
|
|
2283
|
+
const e = window.webkitAudioContext;
|
|
2284
|
+
return window.AudioContext ?? e ?? null;
|
|
2285
|
+
}
|
|
2286
|
+
function zn({
|
|
2287
|
+
isEnabled: e,
|
|
2288
|
+
isOpen: t
|
|
2289
|
+
}) {
|
|
2290
|
+
const [o, r] = _(Cn), n = N(null), i = N(0), c = V(t), s = V(o), d = w(() => {
|
|
2291
|
+
if (!e) return;
|
|
2292
|
+
const u = En();
|
|
2293
|
+
if (!u) return;
|
|
2294
|
+
try {
|
|
2295
|
+
n.current ??= new u();
|
|
2296
|
+
} catch {
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2299
|
+
const p = n.current.state;
|
|
2300
|
+
(p === "suspended" || p === "interrupted") && n.current.resume().catch(() => {
|
|
2301
|
+
});
|
|
2302
|
+
}, [e]);
|
|
2303
|
+
Z(() => {
|
|
2304
|
+
if (!e) return;
|
|
2305
|
+
const u = { capture: !0 }, p = () => d();
|
|
2306
|
+
return window.addEventListener("pointerdown", p, u), window.addEventListener("keydown", p, u), () => {
|
|
2307
|
+
window.removeEventListener("pointerdown", p, u), window.removeEventListener("keydown", p, u);
|
|
2308
|
+
};
|
|
2309
|
+
}, [e, d]);
|
|
2310
|
+
const a = w(() => {
|
|
2311
|
+
if (!e || s.current || In(c.current)) return;
|
|
2312
|
+
const u = n.current;
|
|
2313
|
+
if (!u || u.state !== "running") return;
|
|
2314
|
+
const p = Date.now();
|
|
2315
|
+
p - i.current < _n || (i.current = p, kn(u));
|
|
2316
|
+
}, [e, s, c]), l = w(() => {
|
|
2317
|
+
r((u) => !u);
|
|
2318
|
+
}, []);
|
|
2319
|
+
return Z(() => {
|
|
2320
|
+
Sn(o);
|
|
2321
|
+
}, [o]), { notify: a, unlock: d, isMuted: o, toggleMuted: l };
|
|
2322
|
+
}
|
|
2323
|
+
const Rn = 2, Tn = (e) => `eloquent-ai:chat-widget-closed-${e}`;
|
|
2324
|
+
function Mn({
|
|
2325
|
+
environment: e,
|
|
2326
|
+
apiUrl: t,
|
|
2218
2327
|
appId: o,
|
|
2219
2328
|
userId: r,
|
|
2220
2329
|
userName: n,
|
|
2221
2330
|
userData: i,
|
|
2222
|
-
chatProps:
|
|
2331
|
+
chatProps: c,
|
|
2223
2332
|
isMobile: s,
|
|
2224
|
-
isInitiallyOpen:
|
|
2333
|
+
isInitiallyOpen: d,
|
|
2225
2334
|
hasCloseButton: a,
|
|
2226
2335
|
hasCleanChatButton: l,
|
|
2227
2336
|
// Deprecated aliases, kept until hosts migrate to the is/has names above.
|
|
2228
|
-
initialOpen:
|
|
2229
|
-
closeButton:
|
|
2230
|
-
cleanChatButton:
|
|
2231
|
-
proactiveMessageHideDelay:
|
|
2232
|
-
isAlwaysOpen:
|
|
2337
|
+
initialOpen: u,
|
|
2338
|
+
closeButton: p,
|
|
2339
|
+
cleanChatButton: h,
|
|
2340
|
+
proactiveMessageHideDelay: f = 5e3,
|
|
2341
|
+
isAlwaysOpen: g = !1,
|
|
2233
2342
|
hasCleanChatButtonOverride: k
|
|
2234
2343
|
}) {
|
|
2235
|
-
const { isMobile:
|
|
2344
|
+
const { isMobile: q, portalContainer: I } = vn(s), {
|
|
2236
2345
|
userId: j,
|
|
2237
|
-
externalId:
|
|
2238
|
-
deviceId:
|
|
2239
|
-
apiClient:
|
|
2240
|
-
chatSettings:
|
|
2346
|
+
externalId: S,
|
|
2347
|
+
deviceId: $,
|
|
2348
|
+
apiClient: R,
|
|
2349
|
+
chatSettings: m,
|
|
2241
2350
|
currentChat: y,
|
|
2242
|
-
messages:
|
|
2351
|
+
messages: P,
|
|
2243
2352
|
isReady: oe,
|
|
2244
|
-
isChatClosed:
|
|
2245
|
-
isChatActive:
|
|
2246
|
-
} =
|
|
2247
|
-
apiUrl:
|
|
2353
|
+
isChatClosed: G,
|
|
2354
|
+
isChatActive: re
|
|
2355
|
+
} = mn({
|
|
2356
|
+
apiUrl: t,
|
|
2248
2357
|
appId: o,
|
|
2249
2358
|
initialUserId: r,
|
|
2250
2359
|
userName: n,
|
|
2251
2360
|
userData: i
|
|
2252
|
-
}),
|
|
2253
|
-
|
|
2254
|
-
if (!oe ||
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2361
|
+
}), ne = ao({ chatProps: c, chatSettings: m }), T = d ?? u ?? !1, L = a ?? p ?? !0, A = l ?? h ?? !0, K = Tn(o), [X, H] = _(() => g ? !0 : lt(K) === "true" || q ? !1 : T ?? q), [W, ae] = _(!1);
|
|
2362
|
+
Z(() => {
|
|
2363
|
+
if (!oe || W || (ae(!0), g)) return;
|
|
2364
|
+
const ce = m?.initial_open;
|
|
2365
|
+
ce != null && (q || ce && lt(K) === "true" || H(ce));
|
|
2257
2366
|
}, [
|
|
2258
2367
|
oe,
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2368
|
+
W,
|
|
2369
|
+
m?.initial_open,
|
|
2370
|
+
q,
|
|
2371
|
+
K,
|
|
2372
|
+
g
|
|
2264
2373
|
]);
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2374
|
+
const Q = m?.initial_open ?? T, ee = m?.close_button ?? L, fe = k ?? m?.clean_chat_button ?? A, b = m?.proactive_message_hide_delay ?? f, v = zn({
|
|
2375
|
+
isEnabled: m?.notification_sound !== !1,
|
|
2376
|
+
isOpen: X
|
|
2377
|
+
}), { unlock: C } = v, O = w(
|
|
2378
|
+
(ce) => {
|
|
2379
|
+
g || (C(), H((Me) => {
|
|
2380
|
+
const nt = typeof ce == "function" ? ce(Me) : ce;
|
|
2381
|
+
return nt ? no(K) : ro(K, "true", Rn), nt;
|
|
2382
|
+
}));
|
|
2271
2383
|
},
|
|
2272
|
-
[
|
|
2273
|
-
),
|
|
2274
|
-
|
|
2275
|
-
), [
|
|
2276
|
-
me !==
|
|
2277
|
-
const [
|
|
2278
|
-
|
|
2279
|
-
const [
|
|
2280
|
-
|
|
2281
|
-
const
|
|
2282
|
-
|
|
2283
|
-
}, []), [
|
|
2284
|
-
text:
|
|
2285
|
-
isVisible:
|
|
2286
|
-
autoHideDelay:
|
|
2287
|
-
}, { onSendMessage:
|
|
2384
|
+
[K, g, C]
|
|
2385
|
+
), M = Vt(X, 400), [B, z] = _(
|
|
2386
|
+
c?.messages ?? []
|
|
2387
|
+
), [J, ue] = _(y), [pe, ge] = _(!1), [me, D] = _(P);
|
|
2388
|
+
me !== P && (D(P), P.length > 0 && z(P));
|
|
2389
|
+
const [ie, te] = _(y);
|
|
2390
|
+
ie !== y && (te(y), y && ue(y));
|
|
2391
|
+
const [Te, Be] = _(G);
|
|
2392
|
+
Te !== G && (Be(G), G && ge(!0));
|
|
2393
|
+
const Le = w(() => {
|
|
2394
|
+
ge(!0);
|
|
2395
|
+
}, []), [_e, le] = _(!1), Y = oe && m?.auto_display_welcome_message && m?.welcome_message ? m.welcome_message : "", he = {
|
|
2396
|
+
text: Y,
|
|
2397
|
+
isVisible: Y !== "" && !_e,
|
|
2398
|
+
autoHideDelay: b
|
|
2399
|
+
}, { onSendMessage: It, onCleanMessages: Ne, onRateChat: Et } = rn({
|
|
2288
2400
|
appId: o,
|
|
2289
2401
|
userId: j,
|
|
2290
2402
|
userName: n,
|
|
2291
2403
|
userData: i,
|
|
2292
|
-
externalId:
|
|
2293
|
-
deviceId:
|
|
2294
|
-
apiClient:
|
|
2295
|
-
chatSettings:
|
|
2296
|
-
setMessages:
|
|
2297
|
-
messages:
|
|
2298
|
-
currentChat:
|
|
2299
|
-
setCurrentChat:
|
|
2300
|
-
onChatClosed:
|
|
2301
|
-
isChatClosed:
|
|
2404
|
+
externalId: S,
|
|
2405
|
+
deviceId: $,
|
|
2406
|
+
apiClient: R,
|
|
2407
|
+
chatSettings: m,
|
|
2408
|
+
setMessages: z,
|
|
2409
|
+
messages: B,
|
|
2410
|
+
currentChat: J,
|
|
2411
|
+
setCurrentChat: ue,
|
|
2412
|
+
onChatClosed: Le,
|
|
2413
|
+
isChatClosed: pe,
|
|
2414
|
+
onAgentMessage: v.notify
|
|
2302
2415
|
});
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
}, [
|
|
2306
|
-
y &&
|
|
2416
|
+
Z(() => {
|
|
2417
|
+
P.length > 0 && z(P);
|
|
2418
|
+
}, [P]), Z(() => {
|
|
2419
|
+
y && ue(y);
|
|
2307
2420
|
}, [y]);
|
|
2308
|
-
const
|
|
2309
|
-
|
|
2310
|
-
if (!
|
|
2311
|
-
const
|
|
2421
|
+
const rt = N(null);
|
|
2422
|
+
Z(() => {
|
|
2423
|
+
if (!J || !S || !R) return;
|
|
2424
|
+
const ce = {
|
|
2312
2425
|
userId: j,
|
|
2313
2426
|
userName: n,
|
|
2314
2427
|
userData: i,
|
|
2315
|
-
externalId:
|
|
2316
|
-
deviceId:
|
|
2317
|
-
conversationId:
|
|
2318
|
-
},
|
|
2319
|
-
|
|
2428
|
+
externalId: S,
|
|
2429
|
+
deviceId: $,
|
|
2430
|
+
conversationId: J.id
|
|
2431
|
+
}, Me = JSON.stringify(ce);
|
|
2432
|
+
rt.current !== Me && (rt.current = Me, R.identifyUser(ce));
|
|
2320
2433
|
}, [
|
|
2321
|
-
|
|
2434
|
+
S,
|
|
2322
2435
|
j,
|
|
2323
2436
|
n,
|
|
2324
2437
|
i,
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2438
|
+
$,
|
|
2439
|
+
J,
|
|
2440
|
+
R
|
|
2328
2441
|
]);
|
|
2329
|
-
const
|
|
2330
|
-
|
|
2331
|
-
}, [
|
|
2332
|
-
|
|
2442
|
+
const zt = w(() => {
|
|
2443
|
+
Ne(), ge(!1);
|
|
2444
|
+
}, [Ne]), Rt = w(() => {
|
|
2445
|
+
le(!0);
|
|
2333
2446
|
}, []);
|
|
2334
2447
|
return {
|
|
2335
2448
|
isReady: oe,
|
|
2336
|
-
isChatActive:
|
|
2337
|
-
isInitiallyOpen:
|
|
2338
|
-
hasCloseButton:
|
|
2339
|
-
hasCleanChatButton:
|
|
2340
|
-
isMobile:
|
|
2341
|
-
chatId:
|
|
2342
|
-
chatInterfaceProps:
|
|
2343
|
-
chatOpen:
|
|
2344
|
-
chatOpenDebounced:
|
|
2345
|
-
messages:
|
|
2449
|
+
isChatActive: re,
|
|
2450
|
+
isInitiallyOpen: Q,
|
|
2451
|
+
hasCloseButton: ee,
|
|
2452
|
+
hasCleanChatButton: fe,
|
|
2453
|
+
isMobile: q,
|
|
2454
|
+
chatId: J?.id ?? null,
|
|
2455
|
+
chatInterfaceProps: ne,
|
|
2456
|
+
chatOpen: X,
|
|
2457
|
+
chatOpenDebounced: M,
|
|
2458
|
+
messages: B,
|
|
2346
2459
|
portalContainer: I,
|
|
2347
|
-
onSendMessage:
|
|
2348
|
-
setChatOpen:
|
|
2349
|
-
onCleanMessages:
|
|
2350
|
-
proactiveMessage:
|
|
2351
|
-
hideProactiveMessage:
|
|
2352
|
-
isChatClosed:
|
|
2353
|
-
onStartNewChat:
|
|
2354
|
-
onRateChat:
|
|
2460
|
+
onSendMessage: It,
|
|
2461
|
+
setChatOpen: O,
|
|
2462
|
+
onCleanMessages: Ne,
|
|
2463
|
+
proactiveMessage: he,
|
|
2464
|
+
hideProactiveMessage: Rt,
|
|
2465
|
+
isChatClosed: pe,
|
|
2466
|
+
onStartNewChat: zt,
|
|
2467
|
+
onRateChat: Et,
|
|
2468
|
+
unlockSound: C,
|
|
2469
|
+
isSoundMuted: v.isMuted,
|
|
2470
|
+
toggleSound: v.toggleMuted
|
|
2355
2471
|
};
|
|
2356
2472
|
}
|
|
2357
|
-
function
|
|
2358
|
-
const [
|
|
2359
|
-
return
|
|
2473
|
+
function Pn(e) {
|
|
2474
|
+
const [t, o] = _(0);
|
|
2475
|
+
return Z(() => {
|
|
2360
2476
|
const r = window.visualViewport;
|
|
2361
|
-
if (!
|
|
2477
|
+
if (!e || !r) {
|
|
2362
2478
|
o(0);
|
|
2363
2479
|
return;
|
|
2364
2480
|
}
|
|
@@ -2369,136 +2485,139 @@ function mn(t) {
|
|
|
2369
2485
|
return n(), r.addEventListener("resize", n), r.addEventListener("scroll", n), () => {
|
|
2370
2486
|
r.removeEventListener("resize", n), r.removeEventListener("scroll", n), o(0);
|
|
2371
2487
|
};
|
|
2372
|
-
}, [
|
|
2373
|
-
}
|
|
2374
|
-
function
|
|
2375
|
-
|
|
2376
|
-
if (!
|
|
2377
|
-
const { body:
|
|
2378
|
-
position:
|
|
2379
|
-
top:
|
|
2380
|
-
left:
|
|
2381
|
-
right:
|
|
2382
|
-
overflow:
|
|
2488
|
+
}, [e]), t;
|
|
2489
|
+
}
|
|
2490
|
+
function An(e) {
|
|
2491
|
+
Z(() => {
|
|
2492
|
+
if (!e) return;
|
|
2493
|
+
const { body: t } = document, o = window.scrollY, r = {
|
|
2494
|
+
position: t.style.position,
|
|
2495
|
+
top: t.style.top,
|
|
2496
|
+
left: t.style.left,
|
|
2497
|
+
right: t.style.right,
|
|
2498
|
+
overflow: t.style.overflow
|
|
2383
2499
|
};
|
|
2384
|
-
return
|
|
2385
|
-
|
|
2500
|
+
return t.style.position = "fixed", t.style.top = `-${o}px`, t.style.left = "0", t.style.right = "0", t.style.overflow = "hidden", () => {
|
|
2501
|
+
t.style.position = r.position, t.style.top = r.top, t.style.left = r.left, t.style.right = r.right, t.style.overflow = r.overflow, window.scrollTo(0, o);
|
|
2386
2502
|
};
|
|
2387
|
-
}, [
|
|
2503
|
+
}, [e]);
|
|
2388
2504
|
}
|
|
2389
|
-
function
|
|
2390
|
-
const [
|
|
2505
|
+
function On() {
|
|
2506
|
+
const [e, t] = _(!1), [o, r] = _(null), n = N(null), i = N(null), c = w((d) => {
|
|
2391
2507
|
const a = (l) => {
|
|
2392
|
-
r(l),
|
|
2508
|
+
r(l), t(!0), i.current = null, n.current && clearTimeout(n.current), n.current = setTimeout(() => {
|
|
2393
2509
|
n.current = null;
|
|
2394
|
-
const
|
|
2395
|
-
|
|
2510
|
+
const u = i.current;
|
|
2511
|
+
u && a(u);
|
|
2396
2512
|
}, 1e3);
|
|
2397
2513
|
};
|
|
2398
|
-
n.current ? i.current =
|
|
2399
|
-
}, []), s =
|
|
2400
|
-
n.current && (clearTimeout(n.current), n.current = null), i.current = null,
|
|
2514
|
+
n.current ? i.current = d : a(d);
|
|
2515
|
+
}, []), s = w(() => {
|
|
2516
|
+
n.current && (clearTimeout(n.current), n.current = null), i.current = null, t(!1), r(null);
|
|
2401
2517
|
}, []);
|
|
2402
2518
|
return {
|
|
2403
|
-
isVisible:
|
|
2519
|
+
isVisible: e,
|
|
2404
2520
|
content: o,
|
|
2405
|
-
showCognition:
|
|
2521
|
+
showCognition: c,
|
|
2406
2522
|
hideCognition: s
|
|
2407
2523
|
};
|
|
2408
2524
|
}
|
|
2409
|
-
function
|
|
2410
|
-
children:
|
|
2525
|
+
function Un({
|
|
2526
|
+
children: e
|
|
2411
2527
|
}) {
|
|
2412
|
-
const
|
|
2413
|
-
return /* @__PURE__ */
|
|
2528
|
+
const t = On();
|
|
2529
|
+
return /* @__PURE__ */ x(Ht.Provider, { value: t, children: e });
|
|
2414
2530
|
}
|
|
2415
|
-
const
|
|
2416
|
-
const [
|
|
2417
|
-
error:
|
|
2531
|
+
const jn = ({ children: e }) => {
|
|
2532
|
+
const [t, o] = _(null), [r, n] = _(!1), i = Ft(o), a = {
|
|
2533
|
+
error: t,
|
|
2418
2534
|
hideSdk: r,
|
|
2419
2535
|
publishApiError: i,
|
|
2420
2536
|
publishError: (l) => o(l),
|
|
2421
2537
|
publishNetworkError: () => n(!0),
|
|
2422
2538
|
clearError: () => o(null)
|
|
2423
2539
|
};
|
|
2424
|
-
return /* @__PURE__ */
|
|
2425
|
-
},
|
|
2426
|
-
function
|
|
2427
|
-
appId:
|
|
2428
|
-
userId:
|
|
2540
|
+
return /* @__PURE__ */ x(Wt.Provider, { value: a, children: e });
|
|
2541
|
+
}, Dn = 100;
|
|
2542
|
+
function $n({
|
|
2543
|
+
appId: e,
|
|
2544
|
+
userId: t,
|
|
2429
2545
|
userName: o,
|
|
2430
2546
|
userData: r,
|
|
2431
2547
|
chatProps: n,
|
|
2432
2548
|
proactiveMessageHideDelay: i = 5e3,
|
|
2433
|
-
isMobile:
|
|
2549
|
+
isMobile: c,
|
|
2434
2550
|
hasCloseButton: s,
|
|
2435
|
-
hasCleanChatButton:
|
|
2551
|
+
hasCleanChatButton: d,
|
|
2436
2552
|
isInitiallyOpen: a,
|
|
2437
2553
|
// Deprecated aliases, resolved in useChat (new name wins).
|
|
2438
2554
|
closeButton: l,
|
|
2439
|
-
cleanChatButton:
|
|
2440
|
-
initialOpen:
|
|
2441
|
-
INTERNAL_ONLY_CHAT_INTERFACE_ONLY:
|
|
2442
|
-
INTERNAL_ONLY_SHOW_CLEAN_CHAT_BUTTON:
|
|
2443
|
-
INTERNAL_ONLY_BLOCK_STYLE:
|
|
2555
|
+
cleanChatButton: u,
|
|
2556
|
+
initialOpen: p,
|
|
2557
|
+
INTERNAL_ONLY_CHAT_INTERFACE_ONLY: h = !1,
|
|
2558
|
+
INTERNAL_ONLY_SHOW_CLEAN_CHAT_BUTTON: f = void 0,
|
|
2559
|
+
INTERNAL_ONLY_BLOCK_STYLE: g = !1,
|
|
2444
2560
|
INTERNAL_ONLY_FEATURE_MESSAGE_CLICK: k = void 0,
|
|
2445
|
-
INTERNAL_ONLY_FEATURE_CLEAR_CHAT_CLICK:
|
|
2561
|
+
INTERNAL_ONLY_FEATURE_CLEAR_CHAT_CLICK: q = void 0,
|
|
2446
2562
|
INTERNAL_ONLY_ON_CHAT_ID: I = void 0,
|
|
2447
2563
|
INTERNAL_ONLY_HIGHLIGHTED_MESSAGE_ID: j = null,
|
|
2448
|
-
INTERNAL_ONLY_ON_MESSAGE_SENT:
|
|
2449
|
-
INTERNAL_ONLY_SHOW_COPY_BUTTON:
|
|
2450
|
-
INTERNAL_ONLY_ENVIRONMENT:
|
|
2451
|
-
INTERNAL_ONLY_API_URL:
|
|
2564
|
+
INTERNAL_ONLY_ON_MESSAGE_SENT: S = void 0,
|
|
2565
|
+
INTERNAL_ONLY_SHOW_COPY_BUTTON: $ = !1,
|
|
2566
|
+
INTERNAL_ONLY_ENVIRONMENT: R = "live",
|
|
2567
|
+
INTERNAL_ONLY_API_URL: m
|
|
2452
2568
|
}) {
|
|
2453
|
-
const { hideSdk: y } =
|
|
2454
|
-
isReady:
|
|
2569
|
+
const { hideSdk: y } = De(), {
|
|
2570
|
+
isReady: P,
|
|
2455
2571
|
isChatActive: oe,
|
|
2456
|
-
isInitiallyOpen:
|
|
2457
|
-
hasCloseButton:
|
|
2458
|
-
hasCleanChatButton:
|
|
2459
|
-
isMobile:
|
|
2572
|
+
isInitiallyOpen: G,
|
|
2573
|
+
hasCloseButton: re,
|
|
2574
|
+
hasCleanChatButton: ne,
|
|
2575
|
+
isMobile: T,
|
|
2460
2576
|
chatId: L,
|
|
2461
|
-
chatOpen:
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2577
|
+
chatOpen: A,
|
|
2578
|
+
unlockSound: K,
|
|
2579
|
+
isSoundMuted: X,
|
|
2580
|
+
toggleSound: H,
|
|
2581
|
+
chatInterfaceProps: W,
|
|
2582
|
+
chatOpenDebounced: ae,
|
|
2583
|
+
messages: Q,
|
|
2584
|
+
portalContainer: ee,
|
|
2585
|
+
onSendMessage: fe,
|
|
2586
|
+
setChatOpen: b,
|
|
2587
|
+
proactiveMessage: v,
|
|
2588
|
+
hideProactiveMessage: C,
|
|
2589
|
+
isChatClosed: O,
|
|
2590
|
+
onStartNewChat: M,
|
|
2591
|
+
onRateChat: B
|
|
2592
|
+
} = Mn({
|
|
2593
|
+
environment: R,
|
|
2594
|
+
apiUrl: m,
|
|
2595
|
+
appId: e,
|
|
2596
|
+
userId: t,
|
|
2478
2597
|
userName: o,
|
|
2479
2598
|
userData: r,
|
|
2480
2599
|
chatProps: n,
|
|
2481
|
-
isMobile:
|
|
2600
|
+
isMobile: c,
|
|
2482
2601
|
isInitiallyOpen: a,
|
|
2483
2602
|
hasCloseButton: s,
|
|
2484
|
-
hasCleanChatButton:
|
|
2485
|
-
initialOpen:
|
|
2603
|
+
hasCleanChatButton: d,
|
|
2604
|
+
initialOpen: p,
|
|
2486
2605
|
closeButton: l,
|
|
2487
|
-
cleanChatButton:
|
|
2606
|
+
cleanChatButton: u,
|
|
2488
2607
|
proactiveMessageHideDelay: i,
|
|
2489
2608
|
// Embedded: the interface is the page content with no launcher to reopen
|
|
2490
2609
|
// it, so nothing (boot initial_open, closed-cookie, props) may close it.
|
|
2491
|
-
isAlwaysOpen:
|
|
2492
|
-
hasCleanChatButtonOverride:
|
|
2493
|
-
}),
|
|
2494
|
-
|
|
2495
|
-
!I ||
|
|
2610
|
+
isAlwaysOpen: h,
|
|
2611
|
+
hasCleanChatButtonOverride: f
|
|
2612
|
+
}), z = N(void 0);
|
|
2613
|
+
Z(() => {
|
|
2614
|
+
!I || z.current === L || (z.current = L, I(L));
|
|
2496
2615
|
}, [L, I]);
|
|
2497
|
-
const
|
|
2498
|
-
|
|
2499
|
-
const
|
|
2500
|
-
if (y ||
|
|
2501
|
-
const
|
|
2616
|
+
const J = Pn(T && A);
|
|
2617
|
+
An(T && A);
|
|
2618
|
+
const ue = !P;
|
|
2619
|
+
if (y || ue && !h || !ue && !oe) return null;
|
|
2620
|
+
const pe = () => /* @__PURE__ */ ze(
|
|
2502
2621
|
"div",
|
|
2503
2622
|
{
|
|
2504
2623
|
style: {
|
|
@@ -2511,41 +2630,41 @@ function xn({
|
|
|
2511
2630
|
position: "fixed",
|
|
2512
2631
|
right: 12,
|
|
2513
2632
|
bottom: 4,
|
|
2514
|
-
...
|
|
2633
|
+
...g ? { position: "relative", inset: 0, width: "100%", height: "100%" } : {}
|
|
2515
2634
|
},
|
|
2516
2635
|
children: [
|
|
2517
|
-
/* @__PURE__ */
|
|
2518
|
-
/* @__PURE__ */
|
|
2519
|
-
|
|
2636
|
+
/* @__PURE__ */ x("style", { children: Qt }),
|
|
2637
|
+
/* @__PURE__ */ x(
|
|
2638
|
+
Ke,
|
|
2520
2639
|
{
|
|
2521
2640
|
className: "eloquentai-chat-messaging",
|
|
2522
|
-
head: /* @__PURE__ */ ze(
|
|
2523
|
-
/* @__PURE__ */
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2641
|
+
head: /* @__PURE__ */ ze(st, { children: [
|
|
2642
|
+
/* @__PURE__ */ x("link", { rel: "preconnect", href: "https://fonts.googleapis.com" }),
|
|
2643
|
+
/* @__PURE__ */ x("link", { rel: "preconnect", href: "https://fonts.gstatic.com" }),
|
|
2644
|
+
/* @__PURE__ */ x(
|
|
2526
2645
|
"link",
|
|
2527
2646
|
{
|
|
2528
2647
|
href: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap",
|
|
2529
2648
|
rel: "stylesheet"
|
|
2530
2649
|
}
|
|
2531
2650
|
),
|
|
2532
|
-
/* @__PURE__ */
|
|
2651
|
+
/* @__PURE__ */ x("style", { children: Ze })
|
|
2533
2652
|
] }),
|
|
2534
2653
|
style: {
|
|
2535
|
-
display:
|
|
2536
|
-
width:
|
|
2654
|
+
display: A || ae ? "block" : "none",
|
|
2655
|
+
width: T ? "100vw" : "400px",
|
|
2537
2656
|
// 100dvh accounts for mobile browser chrome (e.g. address bar); 100vh fallback for older browsers
|
|
2538
2657
|
"--chat-mobile-viewport-height": "100dvh",
|
|
2539
|
-
height:
|
|
2540
|
-
maxHeight:
|
|
2658
|
+
height: T ? "var(--chat-mobile-viewport-height, 100vh)" : "700px",
|
|
2659
|
+
maxHeight: T ? "var(--chat-mobile-viewport-height, 100vh)" : `calc(100% - ${Dn}px)`,
|
|
2541
2660
|
border: "none",
|
|
2542
2661
|
zIndex: 2147483e3,
|
|
2543
2662
|
position: "fixed",
|
|
2544
|
-
top:
|
|
2545
|
-
left:
|
|
2546
|
-
right:
|
|
2547
|
-
bottom:
|
|
2548
|
-
...
|
|
2663
|
+
top: T ? 0 : void 0,
|
|
2664
|
+
left: T ? 0 : void 0,
|
|
2665
|
+
right: T ? 0 : 16,
|
|
2666
|
+
bottom: T ? 0 : 16,
|
|
2667
|
+
...g ? {
|
|
2549
2668
|
position: "relative",
|
|
2550
2669
|
top: 0,
|
|
2551
2670
|
left: 0,
|
|
@@ -2557,44 +2676,46 @@ function xn({
|
|
|
2557
2676
|
zIndex: 0
|
|
2558
2677
|
} : {}
|
|
2559
2678
|
},
|
|
2560
|
-
children:
|
|
2679
|
+
children: ue ? (
|
|
2561
2680
|
// Only reachable in embedded mode (the launcher returns null while
|
|
2562
2681
|
// booting): hold the widget's frame with a skeleton so a remount —
|
|
2563
2682
|
// project/environment switch in the host app — doesn't flash an
|
|
2564
2683
|
// empty hole where the chat was.
|
|
2565
|
-
/* @__PURE__ */
|
|
2566
|
-
) : /* @__PURE__ */
|
|
2567
|
-
|
|
2684
|
+
/* @__PURE__ */ x(Jt, { isOpen: !0, isMobile: T, skipAnimation: !0 })
|
|
2685
|
+
) : /* @__PURE__ */ x(
|
|
2686
|
+
Gt,
|
|
2568
2687
|
{
|
|
2569
|
-
...
|
|
2570
|
-
hasIntroAnimation: !
|
|
2571
|
-
isTestMode:
|
|
2572
|
-
isOpen:
|
|
2573
|
-
keyboardInset:
|
|
2574
|
-
messages:
|
|
2575
|
-
onSendMessage: (
|
|
2688
|
+
...W,
|
|
2689
|
+
hasIntroAnimation: !h,
|
|
2690
|
+
isTestMode: R === "test",
|
|
2691
|
+
isOpen: A,
|
|
2692
|
+
keyboardInset: J,
|
|
2693
|
+
messages: Q,
|
|
2694
|
+
onSendMessage: (me, D) => (K(), S?.(me), fe(me, D)),
|
|
2576
2695
|
onMessageClick: k,
|
|
2577
2696
|
highlightedMessageId: j,
|
|
2578
|
-
isMobile:
|
|
2579
|
-
hasCloseButton:
|
|
2580
|
-
hasCleanChatButton:
|
|
2581
|
-
hasCopyButton:
|
|
2582
|
-
isChatClosed:
|
|
2583
|
-
onStartNewChat:
|
|
2584
|
-
onRateChat:
|
|
2585
|
-
|
|
2697
|
+
isMobile: T,
|
|
2698
|
+
hasCloseButton: re,
|
|
2699
|
+
hasCleanChatButton: ne,
|
|
2700
|
+
hasCopyButton: $,
|
|
2701
|
+
isChatClosed: O,
|
|
2702
|
+
onStartNewChat: M,
|
|
2703
|
+
onRateChat: B,
|
|
2704
|
+
isSoundMuted: X,
|
|
2705
|
+
onToggleSound: H,
|
|
2706
|
+
onClose: () => b(!1),
|
|
2586
2707
|
onCleanChat: () => {
|
|
2587
|
-
|
|
2708
|
+
M(), q?.();
|
|
2588
2709
|
}
|
|
2589
2710
|
}
|
|
2590
2711
|
)
|
|
2591
2712
|
}
|
|
2592
2713
|
),
|
|
2593
|
-
!
|
|
2594
|
-
|
|
2714
|
+
!h && /* @__PURE__ */ x(
|
|
2715
|
+
Ke,
|
|
2595
2716
|
{
|
|
2596
2717
|
className: "eloquentai-chat-launcher",
|
|
2597
|
-
head: /* @__PURE__ */
|
|
2718
|
+
head: /* @__PURE__ */ x("style", { children: Ze }),
|
|
2598
2719
|
style: {
|
|
2599
2720
|
position: "fixed",
|
|
2600
2721
|
bottom: 17,
|
|
@@ -2603,26 +2724,26 @@ function xn({
|
|
|
2603
2724
|
width: 48,
|
|
2604
2725
|
height: 48,
|
|
2605
2726
|
border: "none",
|
|
2606
|
-
zIndex:
|
|
2607
|
-
opacity:
|
|
2608
|
-
pointerEvents:
|
|
2609
|
-
transition:
|
|
2727
|
+
zIndex: T ? 2147482999 : 2147483e3,
|
|
2728
|
+
opacity: A ? 0 : 1,
|
|
2729
|
+
pointerEvents: A ? "none" : "auto",
|
|
2730
|
+
transition: A ? "opacity 100ms ease-in" : "opacity 200ms ease-out 320ms"
|
|
2610
2731
|
},
|
|
2611
|
-
children: /* @__PURE__ */
|
|
2612
|
-
|
|
2732
|
+
children: /* @__PURE__ */ x(
|
|
2733
|
+
eo,
|
|
2613
2734
|
{
|
|
2614
|
-
isOpen:
|
|
2615
|
-
toggleBubble: () =>
|
|
2616
|
-
isDarkMode:
|
|
2735
|
+
isOpen: A,
|
|
2736
|
+
toggleBubble: () => b((me) => !me),
|
|
2737
|
+
isDarkMode: W?.theme?.mode === "dark"
|
|
2617
2738
|
}
|
|
2618
2739
|
)
|
|
2619
2740
|
}
|
|
2620
2741
|
),
|
|
2621
|
-
|
|
2622
|
-
|
|
2742
|
+
W?.displayWelcomeMessages ? /* @__PURE__ */ x(
|
|
2743
|
+
Ke,
|
|
2623
2744
|
{
|
|
2624
2745
|
className: "eloquentai-chat-proactive-message",
|
|
2625
|
-
head: /* @__PURE__ */
|
|
2746
|
+
head: /* @__PURE__ */ x("style", { children: Ze }),
|
|
2626
2747
|
style: {
|
|
2627
2748
|
position: "fixed",
|
|
2628
2749
|
// Aligns the bubble's tail with the launcher's center: the
|
|
@@ -2631,22 +2752,22 @@ function xn({
|
|
|
2631
2752
|
bottom: 24,
|
|
2632
2753
|
right: 17
|
|
2633
2754
|
},
|
|
2634
|
-
children: /* @__PURE__ */
|
|
2755
|
+
children: /* @__PURE__ */ x(Yt, { ...W?.theme ?? {}, children: /* @__PURE__ */ x(
|
|
2635
2756
|
"div",
|
|
2636
2757
|
{
|
|
2637
|
-
className:
|
|
2638
|
-
dark:
|
|
2758
|
+
className: Qe("eloq:w-full eloq:h-full", {
|
|
2759
|
+
dark: W?.theme?.mode === "dark"
|
|
2639
2760
|
}),
|
|
2640
|
-
children:
|
|
2641
|
-
|
|
2761
|
+
children: v && !G && /* @__PURE__ */ x(
|
|
2762
|
+
oo,
|
|
2642
2763
|
{
|
|
2643
|
-
message:
|
|
2644
|
-
isVisible:
|
|
2645
|
-
onDismiss:
|
|
2764
|
+
message: v.text,
|
|
2765
|
+
isVisible: v.isVisible,
|
|
2766
|
+
onDismiss: C,
|
|
2646
2767
|
onMessageClick: () => {
|
|
2647
|
-
|
|
2768
|
+
b(!0), C();
|
|
2648
2769
|
},
|
|
2649
|
-
autoHideDelay:
|
|
2770
|
+
autoHideDelay: v.autoHideDelay
|
|
2650
2771
|
}
|
|
2651
2772
|
)
|
|
2652
2773
|
}
|
|
@@ -2656,21 +2777,21 @@ function xn({
|
|
|
2656
2777
|
]
|
|
2657
2778
|
}
|
|
2658
2779
|
);
|
|
2659
|
-
return /* @__PURE__ */
|
|
2780
|
+
return /* @__PURE__ */ x(st, { children: g ? pe() : ee ? /* @__PURE__ */ x(to, { container: ee, children: pe() }) : null });
|
|
2660
2781
|
}
|
|
2661
|
-
function
|
|
2662
|
-
return /* @__PURE__ */
|
|
2782
|
+
function Bn(e) {
|
|
2783
|
+
return /* @__PURE__ */ x(jn, { children: /* @__PURE__ */ x(Un, { children: /* @__PURE__ */ x($n, { ...e }) }) });
|
|
2663
2784
|
}
|
|
2664
|
-
function
|
|
2785
|
+
function Hn(e, t) {
|
|
2665
2786
|
return ((r, n, i) => {
|
|
2666
|
-
const
|
|
2667
|
-
return
|
|
2668
|
-
})(
|
|
2787
|
+
const c = Xt.createRoot(n);
|
|
2788
|
+
return c.render(/* @__PURE__ */ x(r, { ...i })), c.unmount;
|
|
2789
|
+
})(Bn, e, t);
|
|
2669
2790
|
}
|
|
2670
2791
|
export {
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2792
|
+
Bn as Chat,
|
|
2793
|
+
Gt as ChatInterface,
|
|
2794
|
+
Hn as renderChat,
|
|
2795
|
+
Fr as useRealtimeSocket
|
|
2675
2796
|
};
|
|
2676
2797
|
//# sourceMappingURL=index.mjs.map
|