@pagelines/sdk 1.0.661 → 1.0.663

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.
Files changed (70) hide show
  1. package/dist/AgentProvider.js +2782 -0
  2. package/dist/AgentProvider.js.map +1 -0
  3. package/dist/AgentWidgetInline.js +44 -32
  4. package/dist/AgentWidgetInline.js.map +1 -1
  5. package/dist/AgentWidgetModal.js +75 -64
  6. package/dist/AgentWidgetModal.js.map +1 -1
  7. package/dist/AgentWrap.js +5251 -0
  8. package/dist/AgentWrap.js.map +1 -0
  9. package/dist/FModal.js +165 -0
  10. package/dist/FModal.js.map +1 -0
  11. package/dist/agent/ui/ElCreateAgent.vue.d.ts +4 -6
  12. package/dist/agent.js +157 -186
  13. package/dist/agent.js.map +1 -1
  14. package/dist/constants.js +80 -0
  15. package/dist/constants.js.map +1 -0
  16. package/dist/contract.js +6271 -0
  17. package/dist/contract.js.map +1 -0
  18. package/dist/demo/index.d.ts +2 -3
  19. package/dist/demo.js +242 -259
  20. package/dist/demo.js.map +1 -1
  21. package/dist/node_modules/.vue-global-types/vue_3.5_false.d.ts +4 -0
  22. package/dist/rolldown-runtime.js +14 -0
  23. package/dist/sdk.css +2 -1
  24. package/dist/sdk.js +4 -14
  25. package/dist/sdkClient.d.ts +6 -9
  26. package/dist/sdkClient.js +776 -859
  27. package/dist/sdkClient.js.map +1 -1
  28. package/dist/useWidgetState.js +21 -0
  29. package/dist/useWidgetState.js.map +1 -0
  30. package/dist/widget/composables/useWidgetState.d.ts +6 -9
  31. package/dist/widget.js +721 -7
  32. package/dist/widget.js.map +1 -1
  33. package/package.json +12 -12
  34. package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js +0 -4208
  35. package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +0 -1
  36. package/dist/AgentWidgetOnboard.js +0 -5
  37. package/dist/AgentWidgetOnboard.js.map +0 -1
  38. package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +0 -5103
  39. package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +0 -1
  40. package/dist/FModal.vue_vue_type_script_setup_true_lang.js +0 -181
  41. package/dist/FModal.vue_vue_type_script_setup_true_lang.js.map +0 -1
  42. package/dist/agent/test/AgentController.test.d.ts +0 -1
  43. package/dist/agent/test/ChatRichText.client.test.d.ts +0 -1
  44. package/dist/agent/test/ChatVisualBlock.client.test.d.ts +0 -1
  45. package/dist/agent/test/ElAgentChat.client.test.d.ts +0 -1
  46. package/dist/agent/test/ElAgentChatPreview.client.test.d.ts +0 -1
  47. package/dist/agent/test/VoiceRecorderController.unit.test.d.ts +0 -1
  48. package/dist/agent/test/auth-inputs.test.d.ts +0 -1
  49. package/dist/agent/test/chat-visual-format.unit.test.d.ts +0 -1
  50. package/dist/agent/test/utils.test.d.ts +0 -1
  51. package/dist/agent/test/webhook.test.d.ts +0 -1
  52. package/dist/contract/regenerate.d.ts +0 -2
  53. package/dist/contract/test/build.unit.test.d.ts +0 -1
  54. package/dist/contract/test/conversation-wire-shapes.unit.test.d.ts +0 -14
  55. package/dist/contract/test/snapshot.unit.test.d.ts +0 -1
  56. package/dist/index.js +0 -872
  57. package/dist/index.js.map +0 -1
  58. package/dist/sdk.js.map +0 -1
  59. package/dist/socialPlatforms.js +0 -82
  60. package/dist/socialPlatforms.js.map +0 -1
  61. package/dist/test/agent-client.test.d.ts +0 -4
  62. package/dist/test/api.test.d.ts +0 -1
  63. package/dist/test/billing-client.test.d.ts +0 -4
  64. package/dist/test/build.test.d.ts +0 -1
  65. package/dist/test/chat-authenticated.test.d.ts +0 -1
  66. package/dist/test/chat-issue-presentation.test.d.ts +0 -1
  67. package/dist/test/derive-mode.test.d.ts +0 -1
  68. package/dist/test/sdk-token-capture.test.d.ts +0 -13
  69. package/dist/vite.config.sdk.d.ts +0 -2
  70. package/dist/vitest.config.d.ts +0 -2
package/dist/FModal.js ADDED
@@ -0,0 +1,165 @@
1
+ import "./rolldown-runtime.js";
2
+ import { Teleport as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, normalizeClass as u, normalizeProps as d, onMounted as f, onUnmounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y, withModifiers as b } from "vue";
3
+ //#region ../../src/ui/common/FClose.vue?vue&type=script&setup=true&lang.ts
4
+ var x = ["aria-label"], S = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, C = /* @__PURE__ */ c({
5
+ name: "FClose",
6
+ __name: "FClose",
7
+ props: { ariaLabel: {} },
8
+ emits: ["click"],
9
+ setup(e) {
10
+ let t = h(!1);
11
+ return f(() => {
12
+ setTimeout(() => {
13
+ t.value = !0;
14
+ }, 100);
15
+ }), (n, r) => (m(), a("button", {
16
+ type: "button",
17
+ "aria-label": e.ariaLabel || "Close",
18
+ class: "close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90",
19
+ onClick: r[0] || (r[0] = (e) => n.$emit("click", e))
20
+ }, [r[1] || (r[1] = o("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), o("span", S, [o("span", {
21
+ class: u(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 rotate-45" : "translate-y-[30px] -translate-x-[30px] rotate-0"]),
22
+ style: {
23
+ "background-color": "currentColor",
24
+ "transition-delay": "0.15s"
25
+ }
26
+ }, null, 2), o("span", {
27
+ class: u(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 -rotate-45" : "-translate-y-[30px] -translate-x-[30px] rotate-0"]),
28
+ style: {
29
+ "background-color": "currentColor",
30
+ "transition-delay": "0.45s"
31
+ }
32
+ }, null, 2)])], 8, x));
33
+ }
34
+ }), w = { class: "flex min-h-full items-center justify-center text-center p-4" }, T = {
35
+ key: 0,
36
+ class: "text-base p-4 font-semibold"
37
+ }, E = {
38
+ key: 1,
39
+ class: "flex items-center gap-2 px-2"
40
+ }, D = /* @__PURE__ */ c({
41
+ inheritAttrs: !1,
42
+ name: "FModal",
43
+ __name: "FModal",
44
+ props: {
45
+ vis: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ modalClass: {},
50
+ styleClass: {},
51
+ fullScreen: {
52
+ type: Boolean,
53
+ default: !1
54
+ },
55
+ hasClose: {
56
+ type: Boolean,
57
+ default: !1
58
+ },
59
+ title: { default: "" },
60
+ transitionMode: { default: "modal" },
61
+ teleportTo: { default: "body" },
62
+ disableTeleport: {
63
+ type: Boolean,
64
+ default: !1
65
+ }
66
+ },
67
+ emits: [
68
+ "update:vis",
69
+ "close",
70
+ "escape"
71
+ ],
72
+ setup(c, { emit: x }) {
73
+ let S = x, D = h(!1);
74
+ function close(e) {
75
+ let { reason: t } = e;
76
+ S("update:vis", !1), S("close", !0), t === "escape" && S("escape", !0);
77
+ }
78
+ let O = n(() => {
79
+ let e = c.modalClass ? [c.modalClass] : ["max-w-screen-md p-24"], t = c.styleClass ? [c.styleClass] : ["bg-theme-0", "shadow-xl"];
80
+ return c.fullScreen ? e.push("fixed inset-0") : e.push("rounded-2xl"), [
81
+ "relative",
82
+ "text-left",
83
+ "transform",
84
+ "transition-all",
85
+ "w-full",
86
+ "overflow-hidden",
87
+ ...e,
88
+ ...t
89
+ ];
90
+ }), k = h(!1), A = [];
91
+ function onKeydown(e) {
92
+ e.key === "Escape" && c.vis && close({ reason: "escape" });
93
+ }
94
+ f(async () => {
95
+ D.value = !0;
96
+ let e = v(() => c.vis, (e) => {
97
+ e ? setTimeout(() => k.value = !0, 300) : k.value = !1;
98
+ }, { immediate: !0 });
99
+ A.push(e), typeof document < "u" && (document.addEventListener("keydown", onKeydown), A.push(() => document.removeEventListener("keydown", onKeydown)));
100
+ }), p(() => {
101
+ A.forEach((e) => e());
102
+ });
103
+ let j = n(() => c.transitionMode === "slideUp" ? {
104
+ enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
105
+ enterFromClass: "opacity-0 translate-y-full scale-95",
106
+ enterToClass: "opacity-100 translate-y-0 scale-100",
107
+ leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
108
+ leaveFromClass: "opacity-100 translate-y-0 scale-100",
109
+ leaveToClass: "opacity-0 translate-y-full scale-95"
110
+ } : {
111
+ enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
112
+ enterFromClass: "opacity-0 scale-75",
113
+ enterToClass: "opacity-100 translate-y-0 scale-100",
114
+ leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
115
+ leaveFromClass: "opacity-100 translate-y-0 scale-100",
116
+ leaveToClass: "opacity-0 scale-75"
117
+ });
118
+ return (n, f) => D.value ? (m(), r(e, {
119
+ key: 0,
120
+ to: c.teleportTo,
121
+ disabled: c.disableTeleport
122
+ }, [o("div", {
123
+ class: u(["fixed inset-0 z-50", c.vis ? "" : "pointer-events-none"]),
124
+ "aria-labelledby": "modal-title",
125
+ role: "dialog",
126
+ "aria-modal": "true"
127
+ }, [s(t, {
128
+ "enter-active-class": "ease-out duration-300",
129
+ "enter-from-class": "opacity-0",
130
+ "enter-to-class": "opacity-100",
131
+ "leave-active-class": "ease-in duration-200",
132
+ "leave-from-class": "opacity-100",
133
+ "leave-to-class": "opacity-0"
134
+ }, {
135
+ default: y(() => [c.vis ? (m(), a("div", {
136
+ key: 0,
137
+ class: "fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity",
138
+ onClick: f[0] || (f[0] = (e) => close({ reason: "escape" }))
139
+ })) : i("", !0)]),
140
+ _: 1
141
+ }), o("div", {
142
+ class: "fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar",
143
+ onClick: f[3] || (f[3] = (e) => close({ reason: "escape" }))
144
+ }, [o("div", w, [s(t, d(l(j.value)), {
145
+ default: y(() => [c.vis ? (m(), a("div", {
146
+ key: 0,
147
+ class: u([O.value, "w-full"]),
148
+ onClick: f[2] || (f[2] = b(() => {}, ["stop"]))
149
+ }, [c.hasClose || c.title || n.$slots.actions ? (m(), a("div", {
150
+ key: 0,
151
+ class: u(!c.title && (c.hasClose || n.$slots.actions) ? "absolute top-0 right-0 z-10" : "flex justify-between items-center")
152
+ }, [c.title ? (m(), a("h2", T, _(c.title), 1)) : i("", !0), c.hasClose || n.$slots.actions ? (m(), a("div", E, [g(n.$slots, "actions"), c.hasClose ? (m(), r(C, {
153
+ key: 0,
154
+ class: "relative",
155
+ "data-test-id": "close-modal",
156
+ onClick: f[1] || (f[1] = b((e) => close({ reason: "escape" }), ["stop"]))
157
+ })) : i("", !0)])) : i("", !0)], 2)) : i("", !0), g(n.$slots, "default")], 2)) : i("", !0)]),
158
+ _: 3
159
+ }, 16)])])], 2)], 8, ["to", "disabled"])) : i("", !0);
160
+ }
161
+ });
162
+ //#endregion
163
+ export { D as t };
164
+
165
+ //# sourceMappingURL=FModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FModal.js","names":["$emit","$slots"],"sources":["../../../src/ui/common/FClose.vue","../../../src/ui/common/FClose.vue","../../../src/ui/common/FModal.vue","../../../src/ui/common/FModal.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { onMounted, ref } from 'vue'\n\ndefineOptions({ name: 'FClose' })\n\ndefineProps<{\n ariaLabel?: string\n}>()\n\ndefineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst inView = ref(false)\n\nonMounted(() => {\n setTimeout(() => {\n inView.value = true\n }, 100)\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :aria-label=\"ariaLabel || 'Close'\"\n class=\"close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90\"\n @click=\"$emit('click', $event)\"\n >\n <!-- Background circle (invisible, for hover area) -->\n <span class=\"absolute inset-0 rounded-full transition-all\" />\n\n <!-- Close lines container -->\n <span class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden\">\n <!-- Line 1 - animates from bottom-left to center, rotates 45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 rotate-45' : 'translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.15s\"\n />\n\n <!-- Line 2 - animates from top-left to center, rotates -45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 -rotate-45' : '-translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.45s\"\n />\n </span>\n </button>\n</template>\n","<script lang=\"ts\" setup>\nimport { onMounted, ref } from 'vue'\n\ndefineOptions({ name: 'FClose' })\n\ndefineProps<{\n ariaLabel?: string\n}>()\n\ndefineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst inView = ref(false)\n\nonMounted(() => {\n setTimeout(() => {\n inView.value = true\n }, 100)\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :aria-label=\"ariaLabel || 'Close'\"\n class=\"close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90\"\n @click=\"$emit('click', $event)\"\n >\n <!-- Background circle (invisible, for hover area) -->\n <span class=\"absolute inset-0 rounded-full transition-all\" />\n\n <!-- Close lines container -->\n <span class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden\">\n <!-- Line 1 - animates from bottom-left to center, rotates 45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 rotate-45' : 'translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.15s\"\n />\n\n <!-- Line 2 - animates from top-left to center, rotates -45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 -rotate-45' : '-translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.45s\"\n />\n </span>\n </button>\n</template>\n","<script lang=\"ts\" setup>\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport FClose from './FClose.vue'\n\ndefineOptions({ name: 'FModal' })\n\nconst {\n vis = false,\n modalClass,\n styleClass,\n fullScreen = false,\n hasClose = false,\n title = '',\n transitionMode = 'modal',\n teleportTo = 'body',\n disableTeleport = false,\n} = defineProps<{\n vis?: boolean\n modalClass?: string\n styleClass?: string\n fullScreen?: boolean\n hasClose?: boolean\n title?: string\n transitionMode?: 'modal' | 'slideUp'\n teleportTo?: string | Element\n disableTeleport?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n 'close': [value: boolean]\n 'escape': [value: boolean]\n}>()\n\nconst isMounted = ref(false)\n\nfunction close(args: { reason: 'escape' | 'reset' }): void {\n const { reason } = args\n emit('update:vis', false)\n emit('close', true)\n if (reason === 'escape')\n emit('escape', true)\n}\n\nconst classes = computed(() => {\n const cls = modalClass ? [modalClass] : ['max-w-screen-md p-24']\n const style = styleClass ? [styleClass] : ['bg-theme-0', 'shadow-xl']\n\n if (fullScreen)\n cls.push('fixed inset-0')\n else\n cls.push('rounded-2xl')\n\n return [\n 'relative',\n 'text-left',\n 'transform',\n 'transition-all',\n 'w-full',\n 'overflow-hidden',\n ...cls,\n ...style,\n ]\n})\n\nconst afterVisible = ref(false)\nconst cleanups: (() => void)[] = []\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && vis)\n close({ reason: 'escape' })\n}\n\nonMounted(async () => {\n isMounted.value = true\n\n const unwatch = watch(\n () => vis,\n (vis) => {\n if (vis) {\n setTimeout(() => (afterVisible.value = true), 300)\n } else {\n afterVisible.value = false\n }\n },\n { immediate: true },\n )\n\n cleanups.push(unwatch)\n\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', onKeydown)\n cleanups.push(() => document.removeEventListener('keydown', onKeydown))\n }\n})\n\nonUnmounted(() => {\n cleanups.forEach((c) => c())\n})\n\nconst modalTransition = computed(() => {\n if (transitionMode === 'slideUp') {\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 translate-y-full scale-95',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 translate-y-full scale-95',\n }\n }\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 scale-75',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 scale-75',\n }\n})\n</script>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<template>\n <Teleport v-if=\"isMounted\" :to=\"teleportTo\" :disabled=\"disableTeleport\">\n <div\n class=\"fixed inset-0 z-50\"\n aria-labelledby=\"modal-title\"\n role=\"dialog\"\n aria-modal=\"true\"\n :class=\"!vis ? 'pointer-events-none' : ''\"\n >\n <Transition\n enter-active-class=\"ease-out duration-300\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-200\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"vis\"\n class=\"fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity\"\n @click=\"close({ reason: 'escape' })\"\n />\n </Transition>\n <div\n class=\"fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar\"\n @click=\"close({ reason: 'escape' })\"\n >\n <!-- min-h-full, never h-full: a taller-than-viewport panel must grow this\n row so the outer layer scrolls; h-full + items-center centers the\n overflow and clips the modal top unreachably. p-4 = the 1em minimum\n viewport gap for tall modals. -->\n <div class=\"flex min-h-full items-center justify-center text-center p-4\">\n <Transition v-bind=\"modalTransition\">\n <div\n v-if=\"vis\"\n :class=\"classes\"\n class=\"w-full\"\n @click.stop\n >\n <div\n v-if=\"hasClose || title || $slots.actions\"\n :class=\"!title && (hasClose || $slots.actions) ? 'absolute top-0 right-0 z-10' : 'flex justify-between items-center'\"\n >\n <h2 v-if=\"title\" class=\"text-base p-4 font-semibold\">\n {{ title }}\n </h2>\n <div v-if=\"hasClose || $slots.actions\" class=\"flex items-center gap-2 px-2\">\n <slot name=\"actions\" />\n <FClose\n v-if=\"hasClose\"\n class=\"relative\"\n data-test-id=\"close-modal\"\n @click.stop=\"close({ reason: 'escape' })\"\n />\n </div>\n </div>\n <slot />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n","<script lang=\"ts\" setup>\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport FClose from './FClose.vue'\n\ndefineOptions({ name: 'FModal' })\n\nconst {\n vis = false,\n modalClass,\n styleClass,\n fullScreen = false,\n hasClose = false,\n title = '',\n transitionMode = 'modal',\n teleportTo = 'body',\n disableTeleport = false,\n} = defineProps<{\n vis?: boolean\n modalClass?: string\n styleClass?: string\n fullScreen?: boolean\n hasClose?: boolean\n title?: string\n transitionMode?: 'modal' | 'slideUp'\n teleportTo?: string | Element\n disableTeleport?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n 'close': [value: boolean]\n 'escape': [value: boolean]\n}>()\n\nconst isMounted = ref(false)\n\nfunction close(args: { reason: 'escape' | 'reset' }): void {\n const { reason } = args\n emit('update:vis', false)\n emit('close', true)\n if (reason === 'escape')\n emit('escape', true)\n}\n\nconst classes = computed(() => {\n const cls = modalClass ? [modalClass] : ['max-w-screen-md p-24']\n const style = styleClass ? [styleClass] : ['bg-theme-0', 'shadow-xl']\n\n if (fullScreen)\n cls.push('fixed inset-0')\n else\n cls.push('rounded-2xl')\n\n return [\n 'relative',\n 'text-left',\n 'transform',\n 'transition-all',\n 'w-full',\n 'overflow-hidden',\n ...cls,\n ...style,\n ]\n})\n\nconst afterVisible = ref(false)\nconst cleanups: (() => void)[] = []\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && vis)\n close({ reason: 'escape' })\n}\n\nonMounted(async () => {\n isMounted.value = true\n\n const unwatch = watch(\n () => vis,\n (vis) => {\n if (vis) {\n setTimeout(() => (afterVisible.value = true), 300)\n } else {\n afterVisible.value = false\n }\n },\n { immediate: true },\n )\n\n cleanups.push(unwatch)\n\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', onKeydown)\n cleanups.push(() => document.removeEventListener('keydown', onKeydown))\n }\n})\n\nonUnmounted(() => {\n cleanups.forEach((c) => c())\n})\n\nconst modalTransition = computed(() => {\n if (transitionMode === 'slideUp') {\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 translate-y-full scale-95',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 translate-y-full scale-95',\n }\n }\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 scale-75',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 scale-75',\n }\n})\n</script>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<template>\n <Teleport v-if=\"isMounted\" :to=\"teleportTo\" :disabled=\"disableTeleport\">\n <div\n class=\"fixed inset-0 z-50\"\n aria-labelledby=\"modal-title\"\n role=\"dialog\"\n aria-modal=\"true\"\n :class=\"!vis ? 'pointer-events-none' : ''\"\n >\n <Transition\n enter-active-class=\"ease-out duration-300\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-200\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"vis\"\n class=\"fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity\"\n @click=\"close({ reason: 'escape' })\"\n />\n </Transition>\n <div\n class=\"fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar\"\n @click=\"close({ reason: 'escape' })\"\n >\n <!-- min-h-full, never h-full: a taller-than-viewport panel must grow this\n row so the outer layer scrolls; h-full + items-center centers the\n overflow and clips the modal top unreachably. p-4 = the 1em minimum\n viewport gap for tall modals. -->\n <div class=\"flex min-h-full items-center justify-center text-center p-4\">\n <Transition v-bind=\"modalTransition\">\n <div\n v-if=\"vis\"\n :class=\"classes\"\n class=\"w-full\"\n @click.stop\n >\n <div\n v-if=\"hasClose || title || $slots.actions\"\n :class=\"!title && (hasClose || $slots.actions) ? 'absolute top-0 right-0 z-10' : 'flex justify-between items-center'\"\n >\n <h2 v-if=\"title\" class=\"text-base p-4 font-semibold\">\n {{ title }}\n </h2>\n <div v-if=\"hasClose || $slots.actions\" class=\"flex items-center gap-2 px-2\">\n <slot name=\"actions\" />\n <FClose\n v-if=\"hasClose\"\n class=\"relative\"\n data-test-id=\"close-modal\"\n @click.stop=\"close({ reason: 'escape' })\"\n />\n </div>\n </div>\n <slot />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;EAaA,IAAM,IAAS,EAAI,EAAK;SAExB,QAAgB;GACd,iBAAiB;IACf,EAAO,QAAQ;GACjB,GAAG,GAAG;EACR,CAAC,mBAIC,EAyBS,UAAA;GAxBP,MAAK;GACJ,cAAY,EAAA,aAAS;GACtB,OAAM;GACL,SAAK,EAAA,OAAA,EAAA,MAAA,MAAEA,EAAAA,MAAK,SAAU,CAAM;sBAG7B,EAA6D,QAAA,EAAvD,OAAM,+CAA8C,GAAA,MAAA,EAAA,IAG1D,EAcO,QAdP,GAcO,CAZL,EAIE,QAAA;GAHA,OAAK,EAAA,CAAC,2HACE,EAAA,QAAM,0CAAA,iDAAA,CAAA;GACd,OAAA;IAAA,oBAAA;IAAA,oBAAA;GAAA;eAIF,EAIE,QAAA;GAHA,OAAK,EAAA,CAAC,2HACE,EAAA,QAAM,2CAAA,kDAAA,CAAA;GACd,OAAA;IAAA,oBAAA;IAAA,oBAAA;GAAA;;;;;;;;;;CE+EN,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAhGhB,IAAM,IAAO,GAMP,IAAY,EAAI,EAAK;EAE3B,SAAS,MAAM,GAA4C;GACzD,IAAM,EAAE,cAAW;GAGnB,AAFA,EAAK,cAAc,EAAK,GACxB,EAAK,SAAS,EAAI,GACd,MAAW,YACb,EAAK,UAAU,EAAI;EACvB;EAEA,IAAM,IAAU,QAAe;GAC7B,IAAM,IAAM,EAAA,aAAa,CAAC,EAAA,UAAU,IAAI,CAAC,sBAAsB,GACzD,IAAQ,EAAA,aAAa,CAAC,EAAA,UAAU,IAAI,CAAC,cAAc,WAAW;GAOpE,OALI,EAAA,aACF,EAAI,KAAK,eAAe,IAExB,EAAI,KAAK,aAAa,GAEjB;IACL;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;IACH,GAAG;GACL;EACF,CAAC,GAEK,IAAe,EAAI,EAAK,GACxB,IAA2B,CAAC;EAElC,SAAS,UAAU,GAA4B;GAC7C,AAAI,EAAM,QAAQ,YAAY,EAAA,OAC5B,MAAM,EAAE,QAAQ,SAAS,CAAC;EAC9B;EAyBA,AAvBA,EAAU,YAAY;GACpB,EAAU,QAAQ;GAElB,IAAM,IAAU,QACR,EAAA,MACL,MAAQ;IACP,AAAI,IACF,iBAAkB,EAAa,QAAQ,IAAO,GAAG,IAEjD,EAAa,QAAQ;GAEzB,GACA,EAAE,WAAW,GAAK,CACpB;GAIA,AAFA,EAAS,KAAK,CAAO,GAEjB,OAAO,WAAa,QACtB,SAAS,iBAAiB,WAAW,SAAS,GAC9C,EAAS,WAAW,SAAS,oBAAoB,WAAW,SAAS,CAAC;EAE1E,CAAC,GAED,QAAkB;GAChB,EAAS,SAAS,MAAM,EAAE,CAAC;EAC7B,CAAC;EAED,IAAM,IAAkB,QAClB,EAAA,mBAAmB,YACd;GACL,kBAAkB;GAClB,gBAAgB;GAChB,cAAc;GACd,kBAAkB;GAClB,gBAAgB;GAChB,cAAc;EAChB,IAEK;GACL,kBAAkB;GAClB,gBAAgB;GAChB,cAAc;GACd,kBAAkB;GAClB,gBAAgB;GAChB,cAAc;EAChB,CACD;mBAUiB,EAAA,SAAA,EAAA,GAAhB,EA6DW,GAAA;;GA7DiB,IAAI,EAAA;GAAa,UAAU,EAAA;MACrD,EA2DM,OAAA;GA1DJ,OAAK,EAAA,CAAC,sBAIG,EAAA,MAAG,KAAA,qBAAA,CAAA;GAHZ,mBAAgB;GAChB,MAAK;GACL,cAAW;MAGX,EAaa,GAAA;GAZX,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;GACf,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;;oBAMb,CAHM,EAAA,OAAA,EAAA,GADR,EAIE,OAAA;;IAFA,OAAM;IACL,SAAK,EAAA,OAAA,EAAA,MAAA,MAAE,MAAK,EAAA,QAAA,SAAA,CAAA;;;MAGjB,EAqCM,OAAA;GApCJ,OAAM;GACL,SAAK,EAAA,OAAA,EAAA,MAAA,MAAE,MAAK,EAAA,QAAA,SAAA,CAAA;MAMb,EA4BM,OA5BN,GA4BM,CA3BJ,EA0Ba,GAAA,EAAA,EA1BO,EAAA,KAAe,CAAA,GAAA;oBAyB3B,CAvBE,EAAA,OAAA,EAAA,GADR,EAwBM,OAAA;;IAtBH,OAAK,EAAA,CAAE,EAAA,OACF,QAAQ,CAAA;IACb,SAAK,EAAA,OAAA,EAAA,KAAA,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;OAGH,EAAA,YAAY,EAAA,SAASC,EAAAA,OAAO,WAAA,EAAA,GADpC,EAgBM,OAAA;;IAdH,OAAK,EAAA,CAAG,EAAA,UAAU,EAAA,YAAYA,EAAAA,OAAO,WAAO,gCAAA,mCAAA;OAEnC,EAAA,SAAA,EAAA,GAAV,EAEK,MAFL,GAEK,EADA,EAAA,KAAK,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,GAEC,EAAA,YAAYA,EAAAA,OAAO,WAAA,EAAA,GAA9B,EAQM,OARN,GAQM,CAPJ,EAAuB,EAAA,QAAA,SAAA,GAEf,EAAA,YAAA,EAAA,GADR,EAKE,GAAA;;IAHA,OAAM;IACN,gBAAa;IACZ,SAAK,EAAA,OAAA,EAAA,KAAA,GAAA,MAAO,MAAK,EAAA,QAAA,SAAA,CAAA,GAAA,CAAA,MAAA,CAAA;qDAIxB,EAAQ,EAAA,QAAA,SAAA,CAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
@@ -71,11 +71,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
71
71
  lastActiveAt?: string | null | undefined;
72
72
  lastMessageAt?: string | null | undefined;
73
73
  runtime?: string | undefined;
74
- timezone?: string | null | undefined;
74
+ timezone?: string | undefined;
75
75
  desiredStatus?: "active" | "stopped" | null | undefined;
76
76
  automationPrimaryChannel?: string | undefined;
77
- heartbeatMode?: "standard" | "briefing" | "checkpoint" | "off" | undefined;
78
- heartbeatAnchorTime?: string | undefined;
77
+ heartbeatEnabled?: boolean | undefined;
79
78
  onboardedAt?: string | null | undefined;
80
79
  org?: {
81
80
  orgId: string;
@@ -177,11 +176,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
177
176
  lastActiveAt?: string | null | undefined;
178
177
  lastMessageAt?: string | null | undefined;
179
178
  runtime?: string | undefined;
180
- timezone?: string | null | undefined;
179
+ timezone?: string | undefined;
181
180
  desiredStatus?: "active" | "stopped" | null | undefined;
182
181
  automationPrimaryChannel?: string | undefined;
183
- heartbeatMode?: "standard" | "briefing" | "checkpoint" | "off" | undefined;
184
- heartbeatAnchorTime?: string | undefined;
182
+ heartbeatEnabled?: boolean | undefined;
185
183
  onboardedAt?: string | null | undefined;
186
184
  org?: {
187
185
  orgId: string;
package/dist/agent.js CHANGED
@@ -1,187 +1,158 @@
1
- var C = Object.defineProperty;
2
- var u = (e, o) => C(e, "name", { value: o, configurable: !0 });
3
- import { _ as $, a as M } from "./AgentProvider.vue_vue_type_script_setup_true_lang.js";
4
- import { A as Y } from "./AgentProvider.vue_vue_type_script_setup_true_lang.js";
5
- import { defineComponent as m, openBlock as n, createBlock as g, withCtx as w, createElementVNode as i, createVNode as b, ref as p, watch as _, nextTick as z, createElementBlock as d, normalizeClass as f, normalizeStyle as E, createCommentVNode as v, Fragment as N, renderList as j } from "vue";
6
- import { _ as B } from "./FModal.vue_vue_type_script_setup_true_lang.js";
7
- import { _ as P, a as T } from "./AgentWrap.vue_vue_type_script_setup_true_lang.js";
8
- import { A as ee, A as te, b as se } from "./AgentWrap.vue_vue_type_script_setup_true_lang.js";
9
- import { Agent as ne } from "@pagelines/core";
10
- const V = { class: "relative w-full h-[80vh] md:h-[600px]" }, J = /* @__PURE__ */ m({
11
- name: "AgentModal",
12
- __name: "AgentModal",
13
- props: {
14
- vis: { type: Boolean, default: !1 },
15
- sdk: {},
16
- agent: {},
17
- handle: {},
18
- context: {},
19
- firstMessage: {}
20
- },
21
- emits: ["update:vis"],
22
- setup(e, { emit: o }) {
23
- const s = o;
24
- return (t, a) => (n(), g(B, {
25
- vis: e.vis,
26
- "modal-class": "max-w-4xl p-0",
27
- "style-class": "bg-transparent shadow-2xl rounded-2xl",
28
- "has-close": !1,
29
- "onUpdate:vis": a[1] || (a[1] = (c) => s("update:vis", c))
30
- }, {
31
- default: w(() => [
32
- i("div", V, [
33
- b($, {
34
- sdk: e.sdk,
35
- agent: e.agent,
36
- handle: e.handle,
37
- context: e.context,
38
- "first-message": e.firstMessage,
39
- "has-close": !0,
40
- onClose: a[0] || (a[0] = (c) => s("update:vis", !1))
41
- }, null, 8, ["sdk", "agent", "handle", "context", "first-message"])
42
- ])
43
- ]),
44
- _: 1
45
- }, 8, ["vis"]));
46
- }
47
- }), W = {
48
- key: 0,
49
- class: "relative h-full w-full"
50
- }, O = { class: "group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100" }, S = ["src", "alt"], U = {
51
- key: 0,
52
- class: "absolute top-0.5 right-0.5"
53
- }, K = /* @__PURE__ */ m({
54
- __name: "AgentWidget",
55
- props: {
56
- sdk: {},
57
- handle: {},
58
- context: {},
59
- firstMessage: {},
60
- position: {}
61
- },
62
- setup(e, { expose: o }) {
63
- const s = e, t = p(!1), a = p(!1);
64
- function c() {
65
- t.value = !t.value;
66
- }
67
- u(c, "toggle"), _(t, async (x) => {
68
- x ? (await z(), setTimeout(() => {
69
- a.value = !0;
70
- }, 400)) : a.value = !1;
71
- });
72
- function k() {
73
- t.value = !0;
74
- }
75
- u(k, "open");
76
- function h() {
77
- t.value = !1;
78
- }
79
- u(h, "close");
80
- function y() {
81
- h();
82
- }
83
- return u(y, "handleClose"), o({
84
- toggle: c,
85
- open: k,
86
- close: h
87
- }), (x, l) => (n(), g(P, {
88
- sdk: e.sdk,
89
- handle: e.handle,
90
- context: e.context,
91
- "first-message": e.firstMessage
92
- }, {
93
- default: w(({ agent: r, sdk: A }) => [
94
- r ? (n(), d("div", {
95
- key: 0,
96
- class: f(["fixed z-[999999] pointer-events-auto", [
97
- s.position === "bottom-left" ? "bottom-6 left-6" : s.position === "top-right" ? "top-6 right-6" : s.position === "top-left" ? "top-6 left-6" : "bottom-6 right-6"
98
- ]])
99
- }, [
100
- i("div", {
101
- class: f(["transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu", [
102
- t.value ? "widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100" : "widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer"
103
- ]]),
104
- style: E({
105
- "transform-origin": s.position === "bottom-left" ? "bottom left" : s.position === "top-right" ? "top right" : s.position === "top-left" ? "top left" : "bottom right"
106
- }),
107
- onClick: l[0] || (l[0] = (F) => t.value ? void 0 : c())
108
- }, [
109
- t.value ? v("", !0) : (n(), d("div", W, [
110
- i("div", O, [
111
- i("img", {
112
- src: r.avatarUrl.value,
113
- alt: `${r.displayName.value} assistant`,
114
- class: "h-full w-full object-cover pointer-events-none",
115
- width: "80",
116
- height: "80"
117
- }, null, 8, S),
118
- l[1] || (l[1] = i("div", { class: "absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40" }, null, -1))
119
- ]),
120
- r.state.value.lifecycle === "running" ? (n(), d("div", U, [...l[2] || (l[2] = [
121
- i("div", {
122
- class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
123
- style: { "animation-duration": "3s" }
124
- }, null, -1),
125
- i("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1)
126
- ])])) : v("", !0)
127
- ])),
128
- t.value && r ? (n(), g(M, {
129
- key: 1,
130
- class: "rounded-3xl shadow-2xl border border-white/10",
131
- sdk: A,
132
- agent: r,
133
- context: e.context,
134
- "first-message": e.firstMessage,
135
- "has-close": !0,
136
- "is-active": a.value,
137
- onClose: y
138
- }, null, 8, ["sdk", "agent", "context", "first-message", "is-active"])) : v("", !0)
139
- ], 6)
140
- ], 2)) : v("", !0)
141
- ]),
142
- _: 1
143
- }, 8, ["sdk", "handle", "context", "first-message"]));
144
- }
145
- }), D = ["data-sender"], Q = /* @__PURE__ */ m({
146
- __name: "ElAgentChatPreview",
147
- props: {
148
- messages: {},
149
- variant: {}
150
- },
151
- setup(e) {
152
- return (o, s) => (n(), d("div", {
153
- class: f(["@container/chat-preview flex flex-col gap-3", e.variant === "dark" ? "text-white" : "text-slate-950"]),
154
- "data-test": "agent-chat-preview"
155
- }, [
156
- (n(!0), d(N, null, j(e.messages, (t, a) => (n(), d("div", {
157
- key: `${t.sender}-${a}`,
158
- class: f(["flex", t.sender === "user" ? "justify-end" : "justify-start"]),
159
- "data-test": "agent-chat-preview-message",
160
- "data-sender": t.sender
161
- }, [
162
- i("div", {
163
- class: f(["max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]", t.sender === "user" ? "bg-slate-950 text-white" : e.variant === "dark" ? "border border-white/10 bg-white/10 text-white" : "border border-slate-200 bg-white text-slate-950"])
164
- }, [
165
- b(T, {
166
- text: t.text,
167
- inverted: t.sender === "user" || e.variant === "dark"
168
- }, null, 8, ["text", "inverted"])
169
- ], 2)
170
- ], 10, D))), 128))
171
- ], 2));
172
- }
1
+ import "./rolldown-runtime.js";
2
+ import { d as e, f as t, n, p as r, r as i, t as a } from "./AgentWrap.js";
3
+ import { n as o, t as s } from "./AgentProvider.js";
4
+ import { t as c } from "./FModal.js";
5
+ import { Fragment as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, nextTick as g, normalizeClass as _, normalizeStyle as v, openBlock as y, ref as b, renderList as x, watch as S, withCtx as C } from "vue";
6
+ //#region agent/ui/AgentModal.vue?vue&type=script&setup=true&lang.ts
7
+ var w = { class: "relative w-full h-[80vh] md:h-[600px]" }, T = /* @__PURE__ */ h({
8
+ name: "AgentModal",
9
+ __name: "AgentModal",
10
+ props: {
11
+ vis: {
12
+ type: Boolean,
13
+ default: !1
14
+ },
15
+ sdk: {},
16
+ agent: {},
17
+ handle: {},
18
+ context: {},
19
+ firstMessage: {}
20
+ },
21
+ emits: ["update:vis"],
22
+ setup(e, { emit: t }) {
23
+ let n = t;
24
+ return (t, r) => (y(), u(c, {
25
+ vis: e.vis,
26
+ "modal-class": "max-w-4xl p-0",
27
+ "style-class": "bg-transparent shadow-2xl rounded-2xl",
28
+ "has-close": !1,
29
+ "onUpdate:vis": r[1] || (r[1] = (e) => n("update:vis", e))
30
+ }, {
31
+ default: C(() => [p("div", w, [m(s, {
32
+ sdk: e.sdk,
33
+ agent: e.agent,
34
+ handle: e.handle,
35
+ context: e.context,
36
+ "first-message": e.firstMessage,
37
+ "has-close": !0,
38
+ onClose: r[0] || (r[0] = (e) => n("update:vis", !1))
39
+ }, null, 8, [
40
+ "sdk",
41
+ "agent",
42
+ "handle",
43
+ "context",
44
+ "first-message"
45
+ ])])]),
46
+ _: 1
47
+ }, 8, ["vis"]));
48
+ }
49
+ }), E = {
50
+ key: 0,
51
+ class: "relative h-full w-full"
52
+ }, D = { class: "group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100" }, O = ["src", "alt"], k = {
53
+ key: 0,
54
+ class: "absolute top-0.5 right-0.5"
55
+ }, A = /* @__PURE__ */ h({
56
+ __name: "AgentWidget",
57
+ props: {
58
+ sdk: {},
59
+ handle: {},
60
+ context: {},
61
+ firstMessage: {},
62
+ position: {}
63
+ },
64
+ setup(e, { expose: t }) {
65
+ let n = e, r = b(!1), i = b(!1);
66
+ function toggle() {
67
+ r.value = !r.value;
68
+ }
69
+ S(r, async (e) => {
70
+ e ? (await g(), setTimeout(() => {
71
+ i.value = !0;
72
+ }, 400)) : i.value = !1;
73
+ });
74
+ function open() {
75
+ r.value = !0;
76
+ }
77
+ function close() {
78
+ r.value = !1;
79
+ }
80
+ function handleClose() {
81
+ close();
82
+ }
83
+ return t({
84
+ toggle,
85
+ open,
86
+ close
87
+ }), (t, s) => (y(), u(a, {
88
+ sdk: e.sdk,
89
+ handle: e.handle,
90
+ context: e.context,
91
+ "first-message": e.firstMessage
92
+ }, {
93
+ default: C(({ agent: t, sdk: a }) => [t ? (y(), f("div", {
94
+ key: 0,
95
+ class: _(["fixed z-[999999] pointer-events-auto", [n.position === "bottom-left" ? "bottom-6 left-6" : n.position === "top-right" ? "top-6 right-6" : n.position === "top-left" ? "top-6 left-6" : "bottom-6 right-6"]])
96
+ }, [p("div", {
97
+ class: _(["transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu", [r.value ? "widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100" : "widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer"]]),
98
+ style: v({ "transform-origin": n.position === "bottom-left" ? "bottom left" : n.position === "top-right" ? "top right" : n.position === "top-left" ? "top left" : "bottom right" }),
99
+ onClick: s[0] || (s[0] = (e) => r.value ? void 0 : toggle())
100
+ }, [r.value ? d("", !0) : (y(), f("div", E, [p("div", D, [p("img", {
101
+ src: t.avatarUrl.value,
102
+ alt: `${t.displayName.value} assistant`,
103
+ class: "h-full w-full object-cover pointer-events-none",
104
+ width: "80",
105
+ height: "80"
106
+ }, null, 8, O), s[1] || (s[1] = p("div", { class: "absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40" }, null, -1))]), t.state.value.lifecycle === "running" ? (y(), f("div", k, [...s[2] || (s[2] = [p("div", {
107
+ class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
108
+ style: { "animation-duration": "3s" }
109
+ }, null, -1), p("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1)])])) : d("", !0)])), r.value && t ? (y(), u(o, {
110
+ key: 1,
111
+ class: "rounded-3xl shadow-2xl border border-white/10",
112
+ sdk: a,
113
+ agent: t,
114
+ context: e.context,
115
+ "first-message": e.firstMessage,
116
+ "has-close": !0,
117
+ "is-active": i.value,
118
+ onClose: handleClose
119
+ }, null, 8, [
120
+ "sdk",
121
+ "agent",
122
+ "context",
123
+ "first-message",
124
+ "is-active"
125
+ ])) : d("", !0)], 6)], 2)) : d("", !0)]),
126
+ _: 1
127
+ }, 8, [
128
+ "sdk",
129
+ "handle",
130
+ "context",
131
+ "first-message"
132
+ ]));
133
+ }
134
+ }), j = ["data-sender"], M = /* @__PURE__ */ h({
135
+ __name: "ElAgentChatPreview",
136
+ props: {
137
+ messages: {},
138
+ variant: {}
139
+ },
140
+ setup(e) {
141
+ return (t, n) => (y(), f("div", {
142
+ class: _(["@container/chat-preview flex flex-col gap-3", e.variant === "dark" ? "text-white" : "text-slate-950"]),
143
+ "data-test": "agent-chat-preview"
144
+ }, [(y(!0), f(l, null, x(e.messages, (t, n) => (y(), f("div", {
145
+ key: `${t.sender}-${n}`,
146
+ class: _(["flex", t.sender === "user" ? "justify-end" : "justify-start"]),
147
+ "data-test": "agent-chat-preview-message",
148
+ "data-sender": t.sender
149
+ }, [p("div", { class: _(["max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]", t.sender === "user" ? "bg-slate-950 text-white" : e.variant === "dark" ? "border border-white/10 bg-white/10 text-white" : "border border-slate-200 bg-white text-slate-950"]) }, [m(i, {
150
+ text: t.text,
151
+ inverted: t.sender === "user" || e.variant === "dark"
152
+ }, null, 8, ["text", "inverted"])], 2)], 10, j))), 128))], 2));
153
+ }
173
154
  });
174
- export {
175
- Y as AGENT_MODES,
176
- ne as Agent,
177
- M as AgentChat,
178
- ee as AgentChatController,
179
- te as AgentController,
180
- J as AgentModal,
181
- $ as AgentProvider,
182
- K as AgentWidget,
183
- P as AgentWrap,
184
- se as ElAgentChat,
185
- Q as ElAgentChatPreview
186
- };
187
- //# sourceMappingURL=agent.js.map
155
+ //#endregion
156
+ export { t as AGENT_MODES, r as Agent, o as AgentChat, e as AgentChatController, e as AgentController, T as AgentModal, s as AgentProvider, A as AgentWidget, a as AgentWrap, n as ElAgentChat, M as ElAgentChatPreview };
157
+
158
+ //# sourceMappingURL=agent.js.map