@pagelines/sdk 1.0.153 → 1.0.154

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 (32) hide show
  1. package/dist/{AgentProvider.vue_vue_type_script_setup_true_lang-B0TWM6dY.js → AgentProvider.vue_vue_type_script_setup_true_lang-vzGl9adQ.js} +16 -14
  2. package/dist/AgentProvider.vue_vue_type_script_setup_true_lang-vzGl9adQ.js.map +1 -0
  3. package/dist/AgentWidgetInline-xKwzOBQ7.js +37 -0
  4. package/dist/AgentWidgetInline-xKwzOBQ7.js.map +1 -0
  5. package/dist/{AgentWidgetModal-C4MD7yII.js → AgentWidgetModal-BesI4epW.js} +23 -21
  6. package/dist/AgentWidgetModal-BesI4epW.js.map +1 -0
  7. package/dist/{AgentWidgetPopup-DpR4jkw4.js → AgentWidgetPopup-KU7OGmSO.js} +48 -46
  8. package/dist/AgentWidgetPopup-KU7OGmSO.js.map +1 -0
  9. package/dist/{AgentWrap.vue_vue_type_script_setup_true_lang-Cr7I8qea.js → AgentWrap.vue_vue_type_script_setup_true_lang-Dnt1w4Uv.js} +1150 -1109
  10. package/dist/AgentWrap.vue_vue_type_script_setup_true_lang-Dnt1w4Uv.js.map +1 -0
  11. package/dist/agent/ui/AgentChat.vue.d.ts +1 -0
  12. package/dist/agent/ui/AgentProvider.vue.d.ts +1 -0
  13. package/dist/agent.js +3 -3
  14. package/dist/clients/ChatClient.d.ts +2 -0
  15. package/dist/sdk.css +1 -1
  16. package/dist/sdk.js +1 -1
  17. package/dist/{sdkClient-yg_rc4B7.js → sdkClient-DlvpHeVt.js} +163 -161
  18. package/dist/sdkClient-DlvpHeVt.js.map +1 -0
  19. package/dist/widget/PLWidget.d.ts +7 -0
  20. package/dist/widget/ui/AgentWidgetInline.vue.d.ts +1 -0
  21. package/dist/widget/ui/AgentWidgetModal.vue.d.ts +1 -0
  22. package/dist/widget/ui/AgentWidgetPopup.vue.d.ts +1 -0
  23. package/dist/widget.js +109 -81
  24. package/dist/widget.js.map +1 -1
  25. package/package.json +2 -2
  26. package/dist/AgentProvider.vue_vue_type_script_setup_true_lang-B0TWM6dY.js.map +0 -1
  27. package/dist/AgentWidgetInline-DAihjazO.js +0 -35
  28. package/dist/AgentWidgetInline-DAihjazO.js.map +0 -1
  29. package/dist/AgentWidgetModal-C4MD7yII.js.map +0 -1
  30. package/dist/AgentWidgetPopup-DpR4jkw4.js.map +0 -1
  31. package/dist/AgentWrap.vue_vue_type_script_setup_true_lang-Cr7I8qea.js.map +0 -1
  32. package/dist/sdkClient-yg_rc4B7.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { defineComponent as i, createBlock as c, openBlock as l, mergeProps as u, withCtx as m, createVNode as f } from "vue";
2
- import { _ as g, a as p } from "./AgentWrap.vue_vue_type_script_setup_true_lang-Cr7I8qea.js";
3
- const b = /* @__PURE__ */ i({
1
+ import { defineComponent as c, createBlock as i, openBlock as l, mergeProps as u, withCtx as m, createVNode as f } from "vue";
2
+ import { _ as p, a as g } from "./AgentWrap.vue_vue_type_script_setup_true_lang-Dnt1w4Uv.js";
3
+ const b = /* @__PURE__ */ c({
4
4
  __name: "AgentProvider",
5
5
  props: {
6
6
  sdk: {},
@@ -11,26 +11,28 @@ const b = /* @__PURE__ */ i({
11
11
  buttonText: {},
12
12
  buttonIcon: {},
13
13
  hasClose: { type: Boolean },
14
+ chatOnly: { type: Boolean },
14
15
  apiBase: {}
15
16
  },
16
17
  emits: ["close", "error"],
17
- setup(r, { emit: a }) {
18
- const e = r, n = a;
19
- return (x, t) => (l(), c(g, u(e, { class: "agent-provider size-full relative" }), {
18
+ setup(a, { emit: r }) {
19
+ const t = a, s = r;
20
+ return (x, e) => (l(), i(p, u(t, { class: "agent-provider size-full relative" }), {
20
21
  default: m((o) => [
21
- f(p, {
22
+ f(g, {
22
23
  sdk: o.sdk,
23
24
  agent: o.agent,
24
25
  context: o.context,
25
26
  "first-message": o.firstMessage,
26
- "button-text": e.buttonText,
27
- "button-icon": e.buttonIcon,
28
- "has-close": e.hasClose,
27
+ "button-text": t.buttonText,
28
+ "button-icon": t.buttonIcon,
29
+ "has-close": t.hasClose,
30
+ "chat-only": t.chatOnly,
29
31
  "is-active": !0,
30
32
  class: "size-full",
31
- onClose: t[0] || (t[0] = (s) => n("close", s)),
32
- onError: t[1] || (t[1] = (s) => n("error", s))
33
- }, null, 8, ["sdk", "agent", "context", "first-message", "button-text", "button-icon", "has-close"])
33
+ onClose: e[0] || (e[0] = (n) => s("close", n)),
34
+ onError: e[1] || (e[1] = (n) => s("error", n))
35
+ }, null, 8, ["sdk", "agent", "context", "first-message", "button-text", "button-icon", "has-close", "chat-only"])
34
36
  ]),
35
37
  _: 1
36
38
  }, 16));
@@ -39,4 +41,4 @@ const b = /* @__PURE__ */ i({
39
41
  export {
40
42
  b as _
41
43
  };
42
- //# sourceMappingURL=AgentProvider.vue_vue_type_script_setup_true_lang-B0TWM6dY.js.map
44
+ //# sourceMappingURL=AgentProvider.vue_vue_type_script_setup_true_lang-vzGl9adQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentProvider.vue_vue_type_script_setup_true_lang-vzGl9adQ.js","sources":["../agent/ui/AgentProvider.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { ButtonIconPreset } from '../../widget/PLWidget'\nimport type { Agent } from '../schema'\nimport AgentChat from './AgentChat.vue'\nimport AgentWrap from './AgentWrap.vue'\n\nconst props = defineProps<{\n sdk?: PageLinesSDK\n agent?: Agent\n handle?: string\n context?: string\n firstMessage?: string\n buttonText?: string\n buttonIcon?: ButtonIconPreset\n hasClose?: boolean\n chatOnly?: boolean\n apiBase?: string\n}>()\n\nconst emit = defineEmits<{\n close: [value: string]\n error: [message: string]\n}>()\n\n</script>\n\n<template>\n <AgentWrap\n v-slot=\"slotProps\"\n v-bind=\"props\"\n class=\"agent-provider size-full relative\"\n >\n <AgentChat\n :sdk=\"slotProps.sdk\"\n :agent=\"slotProps.agent\"\n :context=\"slotProps.context\"\n :first-message=\"slotProps.firstMessage\"\n :button-text=\"props.buttonText\"\n :button-icon=\"props.buttonIcon\"\n :has-close=\"props.hasClose\"\n :chat-only=\"props.chatOnly\"\n :is-active=\"true\"\n class=\"size-full\"\n @close=\"emit('close', $event)\"\n @error=\"emit('error', $event)\"\n />\n </AgentWrap>\n</template>\n"],"names":["props","__props","emit","__emit","_openBlock","_createBlock","AgentWrap","_mergeProps","_withCtx","slotProps","_createVNode","AgentChat","_cache","$event"],"mappings":";;;;;;;;;;;;;;;;;;AAOA,UAAMA,IAAQC,GAaRC,IAAOC;sBAQXC,EAAA,GAAAC,EAmBYC,GAnBZC,EAmBYP,GAjBG,EACb,OAAM,oCAAA,CAAmC,GAAA;AAAA,MAEzC,SAAAQ,EAAA,CAJQC,MAAS;AAAA,QAIjBC,EAaEC,GAAA;AAAA,UAZC,KAAKF,EAAU;AAAA,UACf,OAAOA,EAAU;AAAA,UACjB,SAASA,EAAU;AAAA,UACnB,iBAAeA,EAAU;AAAA,UACzB,eAAaT,EAAM;AAAA,UACnB,eAAaA,EAAM;AAAA,UACnB,aAAWA,EAAM;AAAA,UACjB,aAAWA,EAAM;AAAA,UACjB,aAAW;AAAA,UACZ,OAAM;AAAA,UACL,SAAKY,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEX,EAAI,SAAUW,CAAM;AAAA,UAC3B,SAAKD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEX,EAAI,SAAUW,CAAM;AAAA,QAAA;;;;;;"}
@@ -0,0 +1,37 @@
1
+ var x = Object.defineProperty;
2
+ var l = (n, c) => x(n, "name", { value: c, configurable: !0 });
3
+ import { defineComponent as g, ref as o, createBlock as v, openBlock as b } from "vue";
4
+ import { _ as m } from "./AgentProvider.vue_vue_type_script_setup_true_lang-vzGl9adQ.js";
5
+ const y = /* @__PURE__ */ g({
6
+ __name: "AgentWidgetInline",
7
+ props: {
8
+ sdk: {},
9
+ handle: {},
10
+ agent: {},
11
+ context: {},
12
+ firstMessage: {},
13
+ buttonText: {},
14
+ buttonIcon: {},
15
+ chatOnly: { type: Boolean }
16
+ },
17
+ setup(n, { expose: c }) {
18
+ const e = n, a = o(e.agent), s = o(e.context), i = o(e.firstMessage), r = o(e.buttonText), u = o(e.buttonIcon);
19
+ function f(t) {
20
+ t.agent !== void 0 && (a.value = t.agent), t.context !== void 0 && (s.value = t.context), t.firstMessage !== void 0 && (i.value = t.firstMessage), t.buttonText !== void 0 && (r.value = t.buttonText), t.buttonIcon !== void 0 && (u.value = t.buttonIcon);
21
+ }
22
+ return l(f, "update"), c({ update: f }), (t, h) => (b(), v(m, {
23
+ sdk: n.sdk,
24
+ handle: n.handle,
25
+ agent: a.value,
26
+ context: s.value,
27
+ "first-message": i.value,
28
+ "button-text": r.value,
29
+ "button-icon": u.value,
30
+ "chat-only": n.chatOnly
31
+ }, null, 8, ["sdk", "handle", "agent", "context", "first-message", "button-text", "button-icon", "chat-only"]));
32
+ }
33
+ });
34
+ export {
35
+ y as default
36
+ };
37
+ //# sourceMappingURL=AgentWidgetInline-xKwzOBQ7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentWidgetInline-xKwzOBQ7.js","sources":["../widget/ui/AgentWidgetInline.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { Agent } from '@pagelines/types'\nimport type { ButtonIconPreset, WidgetUpdate } from '../PLWidget'\nimport { ref } from 'vue'\nimport AgentProvider from '../../agent/ui/AgentProvider.vue'\n\nconst props = defineProps<{\n sdk?: PageLinesSDK\n handle?: string\n agent?: Agent\n context?: string\n firstMessage?: string\n buttonText?: string\n buttonIcon?: ButtonIconPreset\n chatOnly?: boolean\n}>()\n\n// Local state for updateable props\nconst currentAgent = ref<Agent | undefined>(props.agent)\nconst currentContext = ref<string | undefined>(props.context)\nconst currentFirstMessage = ref<string | undefined>(props.firstMessage)\nconst currentButtonText = ref<string | undefined>(props.buttonText)\nconst currentButtonIcon = ref<ButtonIconPreset | undefined>(props.buttonIcon)\n\nfunction update(updates: WidgetUpdate) {\n if (updates.agent !== undefined)\n currentAgent.value = updates.agent\n if (updates.context !== undefined)\n currentContext.value = updates.context\n if (updates.firstMessage !== undefined)\n currentFirstMessage.value = updates.firstMessage\n if (updates.buttonText !== undefined)\n currentButtonText.value = updates.buttonText\n if (updates.buttonIcon !== undefined)\n currentButtonIcon.value = updates.buttonIcon\n}\n\ndefineExpose({ update })\n</script>\n\n<template>\n <AgentProvider\n :sdk=\"sdk\"\n :handle=\"handle\"\n :agent=\"currentAgent\"\n :context=\"currentContext\"\n :first-message=\"currentFirstMessage\"\n :button-text=\"currentButtonText\"\n :button-icon=\"currentButtonIcon\"\n :chat-only=\"chatOnly\"\n />\n</template>\n"],"names":["props","__props","currentAgent","ref","currentContext","currentFirstMessage","currentButtonText","currentButtonIcon","update","updates","__name","__expose","_createBlock","AgentProvider"],"mappings":";;;;;;;;;;;;;;;;;AAOA,UAAMA,IAAQC,GAYRC,IAAeC,EAAuBH,EAAM,KAAK,GACjDI,IAAiBD,EAAwBH,EAAM,OAAO,GACtDK,IAAsBF,EAAwBH,EAAM,YAAY,GAChEM,IAAoBH,EAAwBH,EAAM,UAAU,GAC5DO,IAAoBJ,EAAkCH,EAAM,UAAU;AAE5E,aAASQ,EAAOC,GAAuB;AACrC,MAAIA,EAAQ,UAAU,WACpBP,EAAa,QAAQO,EAAQ,QAC3BA,EAAQ,YAAY,WACtBL,EAAe,QAAQK,EAAQ,UAC7BA,EAAQ,iBAAiB,WAC3BJ,EAAoB,QAAQI,EAAQ,eAClCA,EAAQ,eAAe,WACzBH,EAAkB,QAAQG,EAAQ,aAChCA,EAAQ,eAAe,WACzBF,EAAkB,QAAQE,EAAQ;AAAA,IACtC;AAXS,WAAAC,EAAAF,GAAA,WAaTG,EAAa,EAAE,QAAAH,GAAQ,mBAIrBI,EASEC,GAAA;AAAA,MARC,KAAKZ,EAAA;AAAA,MACL,QAAQA,EAAA;AAAA,MACR,OAAOC,EAAA;AAAA,MACP,SAASE,EAAA;AAAA,MACT,iBAAeC,EAAA;AAAA,MACf,eAAaC,EAAA;AAAA,MACb,eAAaC,EAAA;AAAA,MACb,aAAWN,EAAA;AAAA,IAAA;;;"}
@@ -1,9 +1,9 @@
1
1
  var b = Object.defineProperty;
2
- var a = (o, i) => b(o, "name", { value: i, configurable: !0 });
3
- import { defineComponent as h, ref as n, onMounted as C, nextTick as T, createBlock as k, openBlock as M, withCtx as _, createVNode as p } from "vue";
2
+ var a = (n, l) => b(n, "name", { value: l, configurable: !0 });
3
+ import { defineComponent as h, ref as o, onMounted as C, nextTick as T, createBlock as k, openBlock as y, withCtx as M, createVNode as B } from "vue";
4
4
  import { _ as I } from "./FModal.vue_vue_type_script_setup_true_lang-cL0BFEkZ.js";
5
- import { _ as B } from "./AgentProvider.vue_vue_type_script_setup_true_lang-B0TWM6dY.js";
6
- const V = /* @__PURE__ */ h({
5
+ import { _ } from "./AgentProvider.vue_vue_type_script_setup_true_lang-vzGl9adQ.js";
6
+ const O = /* @__PURE__ */ h({
7
7
  __name: "AgentWidgetModal",
8
8
  props: {
9
9
  sdk: {},
@@ -13,54 +13,56 @@ const V = /* @__PURE__ */ h({
13
13
  firstMessage: {},
14
14
  buttonText: {},
15
15
  buttonIcon: {},
16
+ chatOnly: { type: Boolean },
16
17
  onClose: { type: Function }
17
18
  },
18
- setup(o, { expose: i }) {
19
- const e = o, u = n(e.agent), c = n(e.context), r = n(e.firstMessage), f = n(e.buttonText), v = n(e.buttonIcon), s = n(!1);
19
+ setup(n, { expose: l }) {
20
+ const e = n, i = o(e.agent), u = o(e.context), r = o(e.firstMessage), f = o(e.buttonText), v = o(e.buttonIcon), s = o(!1);
20
21
  C(async () => {
21
22
  await T(), setTimeout(() => {
22
23
  s.value = !0;
23
24
  }, 10);
24
25
  });
25
26
  function m(t) {
26
- t.agent !== void 0 && (u.value = t.agent), t.context !== void 0 && (c.value = t.context), t.firstMessage !== void 0 && (r.value = t.firstMessage), t.buttonText !== void 0 && (f.value = t.buttonText), t.buttonIcon !== void 0 && (v.value = t.buttonIcon);
27
+ t.agent !== void 0 && (i.value = t.agent), t.context !== void 0 && (u.value = t.context), t.firstMessage !== void 0 && (r.value = t.firstMessage), t.buttonText !== void 0 && (f.value = t.buttonText), t.buttonIcon !== void 0 && (v.value = t.buttonIcon);
27
28
  }
28
29
  a(m, "update");
29
- function l() {
30
+ function c() {
30
31
  s.value = !1, setTimeout(() => {
31
32
  e.onClose && e.onClose();
32
33
  }, 300);
33
34
  }
34
- a(l, "close");
35
+ a(c, "close");
35
36
  function d() {
36
37
  s.value = !0;
37
38
  }
38
- return a(d, "open"), i({ update: m, close: l, open: d }), (t, x) => (M(), k(I, {
39
+ return a(d, "open"), l({ update: m, close: c, open: d }), (t, x) => (y(), k(I, {
39
40
  vis: s.value,
40
41
  "disable-teleport": !0,
41
42
  "modal-class": "max-w-4xl h-[80vh] md:h-[600px]",
42
43
  "has-close": !1,
43
44
  "onUpdate:vis": x[0] || (x[0] = (g) => s.value = g),
44
- onClose: l
45
+ onClose: c
45
46
  }, {
46
- default: _(() => [
47
- p(B, {
48
- sdk: o.sdk,
49
- handle: o.handle,
50
- agent: u.value,
51
- context: c.value,
47
+ default: M(() => [
48
+ B(_, {
49
+ sdk: n.sdk,
50
+ handle: n.handle,
51
+ agent: i.value,
52
+ context: u.value,
52
53
  "first-message": r.value,
53
54
  "button-text": f.value,
54
55
  "button-icon": v.value,
56
+ "chat-only": n.chatOnly,
55
57
  "has-close": !0,
56
- onClose: l
57
- }, null, 8, ["sdk", "handle", "agent", "context", "first-message", "button-text", "button-icon"])
58
+ onClose: c
59
+ }, null, 8, ["sdk", "handle", "agent", "context", "first-message", "button-text", "button-icon", "chat-only"])
58
60
  ]),
59
61
  _: 1
60
62
  }, 8, ["vis"]));
61
63
  }
62
64
  });
63
65
  export {
64
- V as default
66
+ O as default
65
67
  };
66
- //# sourceMappingURL=AgentWidgetModal-C4MD7yII.js.map
68
+ //# sourceMappingURL=AgentWidgetModal-BesI4epW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentWidgetModal-BesI4epW.js","sources":["../widget/ui/AgentWidgetModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { Agent } from '@pagelines/types'\nimport type { ButtonIconPreset, WidgetUpdate } from '../PLWidget'\nimport { nextTick, onMounted, ref } from 'vue'\nimport FModal from '@/ui/common/FModal.vue'\nimport AgentProvider from '../../agent/ui/AgentProvider.vue'\n\nconst props = defineProps<{\n sdk?: PageLinesSDK\n handle?: string\n agent?: Agent\n context?: string\n firstMessage?: string\n buttonText?: string\n buttonIcon?: ButtonIconPreset\n chatOnly?: boolean\n onClose?: () => void\n}>()\n\nconst currentAgent = ref<Agent | undefined>(props.agent)\nconst currentContext = ref<string | undefined>(props.context)\nconst currentFirstMessage = ref<string | undefined>(props.firstMessage)\nconst currentButtonText = ref<string | undefined>(props.buttonText)\nconst currentButtonIcon = ref<ButtonIconPreset | undefined>(props.buttonIcon)\nconst isVisible = ref(false)\n\n// Trigger transition after mount\nonMounted(async () => {\n await nextTick()\n // Small delay to ensure DOM is ready and transition fires\n setTimeout(() => {\n isVisible.value = true\n }, 10)\n})\n\nfunction update(updates: WidgetUpdate) {\n if (updates.agent !== undefined)\n currentAgent.value = updates.agent\n if (updates.context !== undefined)\n currentContext.value = updates.context\n if (updates.firstMessage !== undefined)\n currentFirstMessage.value = updates.firstMessage\n if (updates.buttonText !== undefined)\n currentButtonText.value = updates.buttonText\n if (updates.buttonIcon !== undefined)\n currentButtonIcon.value = updates.buttonIcon\n}\n\nfunction close() {\n isVisible.value = false\n // Wait for transition to complete before calling onClose\n setTimeout(() => {\n if (props.onClose) {\n props.onClose()\n }\n }, 300) // Match FModal transition duration\n}\n\nfunction open() {\n isVisible.value = true\n}\n\ndefineExpose({ update, close, open })\n</script>\n\n<template>\n <FModal\n :vis=\"isVisible\"\n :disable-teleport=\"true\"\n modal-class=\"max-w-4xl h-[80vh] md:h-[600px]\"\n :has-close=\"false\"\n @update:vis=\"isVisible = $event\"\n @close=\"close\"\n >\n <AgentProvider\n :sdk=\"sdk\"\n :handle=\"handle\"\n :agent=\"currentAgent\"\n :context=\"currentContext\"\n :first-message=\"currentFirstMessage\"\n :button-text=\"currentButtonText\"\n :button-icon=\"currentButtonIcon\"\n :chat-only=\"chatOnly\"\n :has-close=\"true\"\n @close=\"close\"\n />\n </FModal>\n</template>\n"],"names":["props","__props","currentAgent","ref","currentContext","currentFirstMessage","currentButtonText","currentButtonIcon","isVisible","onMounted","nextTick","update","updates","__name","close","open","__expose","_createBlock","FModal","_cache","$event","_createVNode","AgentProvider"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA,UAAMA,IAAQC,GAYRC,IAAeC,EAAuBH,EAAM,KAAK,GACjDI,IAAiBD,EAAwBH,EAAM,OAAO,GACtDK,IAAsBF,EAAwBH,EAAM,YAAY,GAChEM,IAAoBH,EAAwBH,EAAM,UAAU,GAC5DO,IAAoBJ,EAAkCH,EAAM,UAAU,GACtEQ,IAAYL,EAAI,EAAK;AAG3B,IAAAM,EAAU,YAAY;AACpB,YAAMC,EAAA,GAEN,WAAW,MAAM;AACf,QAAAF,EAAU,QAAQ;AAAA,MACpB,GAAG,EAAE;AAAA,IACP,CAAC;AAED,aAASG,EAAOC,GAAuB;AACrC,MAAIA,EAAQ,UAAU,WACpBV,EAAa,QAAQU,EAAQ,QAC3BA,EAAQ,YAAY,WACtBR,EAAe,QAAQQ,EAAQ,UAC7BA,EAAQ,iBAAiB,WAC3BP,EAAoB,QAAQO,EAAQ,eAClCA,EAAQ,eAAe,WACzBN,EAAkB,QAAQM,EAAQ,aAChCA,EAAQ,eAAe,WACzBL,EAAkB,QAAQK,EAAQ;AAAA,IACtC;AAXS,IAAAC,EAAAF,GAAA;AAaT,aAASG,IAAQ;AACf,MAAAN,EAAU,QAAQ,IAElB,WAAW,MAAM;AACf,QAAIR,EAAM,WACRA,EAAM,QAAA;AAAA,MAEV,GAAG,GAAG;AAAA,IACR;AARS,IAAAa,EAAAC,GAAA;AAUT,aAASC,IAAO;AACd,MAAAP,EAAU,QAAQ;AAAA,IACpB;AAFS,WAAAK,EAAAE,GAAA,SAITC,EAAa,EAAE,QAAAL,GAAQ,OAAAG,GAAO,MAAAC,EAAA,CAAM,mBAIlCE,EAoBSC,GAAA;AAAA,MAnBN,KAAKV,EAAA;AAAA,MACL,oBAAkB;AAAA,MACnB,eAAY;AAAA,MACX,aAAW;AAAA,MACX,gBAAUW,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEZ,EAAA,QAAYY;AAAA,MACxB,SAAON;AAAA,IAAA;iBAER,MAWE;AAAA,QAXFO,EAWEC,GAAA;AAAA,UAVC,KAAKrB,EAAA;AAAA,UACL,QAAQA,EAAA;AAAA,UACR,OAAOC,EAAA;AAAA,UACP,SAASE,EAAA;AAAA,UACT,iBAAeC,EAAA;AAAA,UACf,eAAaC,EAAA;AAAA,UACb,eAAaC,EAAA;AAAA,UACb,aAAWN,EAAA;AAAA,UACX,aAAW;AAAA,UACX,SAAOa;AAAA,QAAA;;;;;;"}
@@ -1,11 +1,11 @@
1
- var B = Object.defineProperty;
2
- var s = (l, c) => B(l, "name", { value: c, configurable: !0 });
3
- import { defineComponent as I, ref as n, watch as M, nextTick as $, createBlock as w, openBlock as u, withCtx as j, createElementBlock as k, createCommentVNode as p, normalizeClass as y, createElementVNode as i, normalizeStyle as E, unref as C } from "vue";
4
- import { _ as F, g as N, b as U, a as V } from "./AgentWrap.vue_vue_type_script_setup_true_lang-Cr7I8qea.js";
5
- const D = {
1
+ var _ = Object.defineProperty;
2
+ var s = (a, u) => _(a, "name", { value: u, configurable: !0 });
3
+ import { defineComponent as I, ref as n, watch as M, nextTick as $, createBlock as w, openBlock as c, withCtx as O, createElementBlock as y, createCommentVNode as h, normalizeClass as k, createElementVNode as i, normalizeStyle as j, unref as C } from "vue";
4
+ import { _ as E, g as F, b as N, a as U } from "./AgentWrap.vue_vue_type_script_setup_true_lang-Dnt1w4Uv.js";
5
+ const V = {
6
6
  key: 0,
7
7
  class: "relative h-full w-full"
8
- }, 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" }, P = ["src", "alt"], H = /* @__PURE__ */ I({
8
+ }, 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" }, P = ["src", "alt"], H = /* @__PURE__ */ I({
9
9
  __name: "AgentWidgetPopup",
10
10
  props: {
11
11
  sdk: {},
@@ -15,75 +15,76 @@ const D = {
15
15
  firstMessage: {},
16
16
  buttonText: {},
17
17
  buttonIcon: {},
18
- position: {}
18
+ position: {},
19
+ chatOnly: { type: Boolean }
19
20
  },
20
- setup(l, { expose: c }) {
21
- const e = l, o = n(!1), v = n(!1), x = n(e.agent), d = n(e.context), f = n(e.firstMessage), g = n(e.buttonText), b = n(e.buttonIcon);
22
- function m() {
21
+ setup(a, { expose: u }) {
22
+ const e = a, o = n(!1), v = n(!1), p = n(e.agent), d = n(e.context), f = n(e.firstMessage), g = n(e.buttonText), b = n(e.buttonIcon);
23
+ function x() {
23
24
  o.value = !o.value;
24
25
  }
25
- s(m, "toggle"), M(o, async (t) => {
26
+ s(x, "toggle"), M(o, async (t) => {
26
27
  t ? (await $(), setTimeout(() => {
27
28
  v.value = !0;
28
29
  }, 400)) : v.value = !1;
29
30
  });
30
- function _() {
31
+ function z() {
31
32
  o.value = !0;
32
33
  }
33
- s(_, "open");
34
- function h() {
34
+ s(z, "open");
35
+ function m() {
35
36
  o.value = !1;
36
37
  }
37
- s(h, "close");
38
- function z() {
39
- h();
38
+ s(m, "close");
39
+ function A() {
40
+ m();
40
41
  }
41
- s(z, "handleClose");
42
- function A(t) {
43
- t.agent !== void 0 && (x.value = t.agent), t.context !== void 0 && (d.value = t.context), t.firstMessage !== void 0 && (f.value = t.firstMessage), t.buttonText !== void 0 && (g.value = t.buttonText), t.buttonIcon !== void 0 && (b.value = t.buttonIcon);
42
+ s(A, "handleClose");
43
+ function T(t) {
44
+ t.agent !== void 0 && (p.value = t.agent), t.context !== void 0 && (d.value = t.context), t.firstMessage !== void 0 && (f.value = t.firstMessage), t.buttonText !== void 0 && (g.value = t.buttonText), t.buttonIcon !== void 0 && (b.value = t.buttonIcon);
44
45
  }
45
- return s(A, "update"), c({
46
- toggle: m,
47
- open: _,
48
- close: h,
49
- update: A
50
- }), (t, a) => (u(), w(F, {
51
- sdk: l.sdk,
52
- handle: l.handle,
53
- agent: x.value,
46
+ return s(T, "update"), u({
47
+ toggle: x,
48
+ open: z,
49
+ close: m,
50
+ update: T
51
+ }), (t, l) => (c(), w(E, {
52
+ sdk: a.sdk,
53
+ handle: a.handle,
54
+ agent: p.value,
54
55
  context: d.value,
55
56
  "first-message": f.value,
56
57
  "button-text": g.value,
57
58
  "button-icon": b.value
58
59
  }, {
59
- default: j(({ agent: r, sdk: T }) => [
60
- r ? (u(), k("div", {
60
+ default: O(({ agent: r, sdk: B }) => [
61
+ r ? (c(), y("div", {
61
62
  key: 0,
62
- class: y(["fixed z-[999999] pointer-events-auto", [
63
+ class: k(["fixed z-[999999] pointer-events-auto", [
63
64
  e.position === "bottom-left" ? "bottom-6 left-6" : e.position === "top-right" ? "top-6 right-6" : e.position === "top-left" ? "top-6 left-6" : "bottom-6 right-6"
64
65
  ]])
65
66
  }, [
66
67
  i("div", {
67
- class: y(["transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu", [
68
+ class: k(["transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu", [
68
69
  o.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"
69
70
  ]]),
70
- style: E({
71
+ style: j({
71
72
  "transform-origin": e.position === "bottom-left" ? "bottom left" : e.position === "top-right" ? "top right" : e.position === "top-left" ? "top left" : "bottom right"
72
73
  }),
73
- onClick: a[0] || (a[0] = (S) => o.value ? void 0 : m())
74
+ onClick: l[0] || (l[0] = (S) => o.value ? void 0 : x())
74
75
  }, [
75
- o.value ? p("", !0) : (u(), k("div", D, [
76
- i("div", O, [
76
+ o.value ? h("", !0) : (c(), y("div", V, [
77
+ i("div", D, [
77
78
  i("img", {
78
- src: C(N)(r) || C(U)(),
79
+ src: C(F)(r) || C(N)(),
79
80
  alt: `${r.name} digital agent`,
80
81
  class: "h-full w-full object-cover pointer-events-none",
81
82
  width: "80",
82
83
  height: "80"
83
84
  }, null, 8, P),
84
- a[1] || (a[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))
85
+ 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))
85
86
  ]),
86
- a[2] || (a[2] = i("div", { class: "absolute top-0.5 right-0.5" }, [
87
+ l[2] || (l[2] = i("div", { class: "absolute top-0.5 right-0.5" }, [
87
88
  i("div", {
88
89
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
89
90
  style: { "animation-duration": "3s" }
@@ -91,10 +92,10 @@ const D = {
91
92
  i("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" })
92
93
  ], -1))
93
94
  ])),
94
- o.value && r ? (u(), w(V, {
95
+ o.value && r ? (c(), w(U, {
95
96
  key: 1,
96
97
  class: "rounded-3xl shadow-2xl border border-white/10",
97
- sdk: T,
98
+ sdk: B,
98
99
  agent: r,
99
100
  context: d.value,
100
101
  "first-message": f.value,
@@ -102,10 +103,11 @@ const D = {
102
103
  "button-icon": b.value,
103
104
  "has-close": !0,
104
105
  "is-active": v.value,
105
- onClose: z
106
- }, null, 8, ["sdk", "agent", "context", "first-message", "button-text", "button-icon", "is-active"])) : p("", !0)
106
+ "chat-only": a.chatOnly,
107
+ onClose: A
108
+ }, null, 8, ["sdk", "agent", "context", "first-message", "button-text", "button-icon", "is-active", "chat-only"])) : h("", !0)
107
109
  ], 6)
108
- ], 2)) : p("", !0)
110
+ ], 2)) : h("", !0)
109
111
  ]),
110
112
  _: 1
111
113
  }, 8, ["sdk", "handle", "agent", "context", "first-message", "button-text", "button-icon"]));
@@ -114,4 +116,4 @@ const D = {
114
116
  export {
115
117
  H as default
116
118
  };
117
- //# sourceMappingURL=AgentWidgetPopup-DpR4jkw4.js.map
119
+ //# sourceMappingURL=AgentWidgetPopup-KU7OGmSO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentWidgetPopup-KU7OGmSO.js","sources":["../widget/ui/AgentWidgetPopup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { Agent } from '@pagelines/types'\nimport type { ButtonIconPreset, WidgetUpdate } from '../PLWidget'\nimport { nextTick, ref, watch } from 'vue'\nimport { getFallbackAvatarDataUrl, getAgentAvatarUrl } from '../../agent/utils'\nimport AgentChat from '../../agent/ui/AgentChat.vue'\nimport AgentWrap from '../../agent/ui/AgentWrap.vue'\n\nconst props = defineProps<{\n sdk?: PageLinesSDK\n handle?: string\n agent?: Agent\n context?: string\n firstMessage?: string\n buttonText?: string\n buttonIcon?: ButtonIconPreset\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n chatOnly?: boolean\n}>()\nconst isOpen = ref(false)\nconst isAgentActive = ref(false)\n\n// Local state for updateable props\nconst currentAgent = ref<Agent | undefined>(props.agent)\nconst currentContext = ref<string | undefined>(props.context)\nconst currentFirstMessage = ref<string | undefined>(props.firstMessage)\nconst currentButtonText = ref<string | undefined>(props.buttonText)\nconst currentButtonIcon = ref<ButtonIconPreset | undefined>(props.buttonIcon)\n\nfunction toggle() {\n isOpen.value = !isOpen.value\n}\n\n// Watch isOpen to delay agent activation for smooth transition\nwatch(isOpen, async (newValue) => {\n if (newValue) {\n // When opening, delay agent activation until transition starts\n await nextTick()\n setTimeout(() => {\n isAgentActive.value = true\n }, 400) // Delay to let container expand first\n }\n else {\n // When closing, immediately deactivate agent\n isAgentActive.value = false\n }\n})\n\nfunction open() {\n isOpen.value = true\n}\n\nfunction close() {\n isOpen.value = false\n}\n\nfunction handleClose() {\n close()\n}\n\nfunction update(updates: WidgetUpdate) {\n if (updates.agent !== undefined)\n currentAgent.value = updates.agent\n if (updates.context !== undefined)\n currentContext.value = updates.context\n if (updates.firstMessage !== undefined)\n currentFirstMessage.value = updates.firstMessage\n if (updates.buttonText !== undefined)\n currentButtonText.value = updates.buttonText\n if (updates.buttonIcon !== undefined)\n currentButtonIcon.value = updates.buttonIcon\n}\n\ndefineExpose({\n toggle,\n open,\n close,\n update,\n})\n</script>\n\n<template>\n <AgentWrap\n v-slot=\"{ agent, sdk: resolvedSdk }\"\n :sdk=\"sdk\"\n :handle=\"handle\"\n :agent=\"currentAgent\"\n :context=\"currentContext\"\n :first-message=\"currentFirstMessage\"\n :button-text=\"currentButtonText\"\n :button-icon=\"currentButtonIcon\"\n >\n <!-- Fixed Widget Wrapper -->\n <div\n v-if=\"agent\"\n class=\"fixed z-[999999] pointer-events-auto\"\n :class=\"[\n props.position === 'bottom-left' ? 'bottom-6 left-6'\n : props.position === 'top-right' ? 'top-6 right-6'\n : props.position === 'top-left' ? 'top-6 left-6'\n : 'bottom-6 right-6',\n ]\"\n >\n <!-- Widget Content with Transition -->\n <div\n class=\"transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu\"\n :class=\"[\n isOpen\n ? 'widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100'\n : 'widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer',\n ]\"\n :style=\"{\n 'transform-origin':\n props.position === 'bottom-left' ? 'bottom left'\n : props.position === 'top-right' ? 'top right'\n : props.position === 'top-left' ? 'top left'\n : 'bottom right',\n }\"\n @click=\"!isOpen ? toggle() : undefined\"\n >\n <!-- Button Content (visible when closed) -->\n <div v-if=\"!isOpen\" class=\"relative h-full w-full\">\n <div 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\">\n <img\n :src=\"getAgentAvatarUrl(agent) || getFallbackAvatarDataUrl()\"\n :alt=\"`${agent.name} digital agent`\"\n class=\"h-full w-full object-cover pointer-events-none\"\n width=\"80\"\n height=\"80\"\n />\n <!-- Gradient overlay for contrast -->\n <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\" />\n </div>\n <!-- Online indicator -->\n <div class=\"absolute top-0.5 right-0.5\">\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping\" style=\"animation-duration: 3s;\" />\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white\" />\n </div>\n </div>\n\n <!-- Chat Content (visible when open) -->\n <AgentChat\n v-if=\"isOpen && agent\"\n class=\"rounded-3xl shadow-2xl border border-white/10\"\n :sdk=\"resolvedSdk\"\n :agent=\"agent\"\n :context=\"currentContext\"\n :first-message=\"currentFirstMessage\"\n :button-text=\"currentButtonText\"\n :button-icon=\"currentButtonIcon\"\n :has-close=\"true\"\n :is-active=\"isAgentActive\"\n :chat-only=\"chatOnly\"\n @close=\"handleClose\"\n />\n </div>\n </div>\n </AgentWrap>\n</template>\n"],"names":["props","__props","isOpen","ref","isAgentActive","currentAgent","currentContext","currentFirstMessage","currentButtonText","currentButtonIcon","toggle","__name","watch","newValue","nextTick","open","close","handleClose","update","updates","__expose","_createBlock","AgentWrap","agent","resolvedSdk","_createElementBlock","_createElementVNode","_normalizeStyle","_cache","$event","_openBlock","_hoisted_1","_hoisted_2","_unref","getAgentAvatarUrl","getFallbackAvatarDataUrl","AgentChat"],"mappings":"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"}