@8wave/ai-elements 0.103.0-beta.3 → 0.103.0-beta.4
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/_chunks/PkLazyImg-CyeqD59M.js +34 -0
- package/dist/_chunks/{PkLazyImg-_389yCnQ.js.map → PkLazyImg-CyeqD59M.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-YJDdYD0E.js → PkStreamingMarkdown-DIkusrTI.js} +28 -28
- package/dist/_chunks/{PkStreamingMarkdown-YJDdYD0E.js.map → PkStreamingMarkdown-DIkusrTI.js.map} +1 -1
- package/dist/_chunks/PkToolRequestGeolocation-Cgus94KF.js +69 -0
- package/dist/_chunks/{PkToolRequestGeolocation-T16QI-Uv.js.map → PkToolRequestGeolocation-Cgus94KF.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-C8e5np2q.js → PkToolRequestOAuthConnection-DsUpUh97.js} +21 -21
- package/dist/_chunks/{PkToolRequestOAuthConnection-C8e5np2q.js.map → PkToolRequestOAuthConnection-DsUpUh97.js.map} +1 -1
- package/dist/_chunks/PkToolShowArtifact-griVx9w3.js +93 -0
- package/dist/_chunks/{PkToolShowArtifact-D15GjBm6.js.map → PkToolShowArtifact-griVx9w3.js.map} +1 -1
- package/dist/_chunks/{PkToolShowCalendarEvent-D_GjXl2_.js → PkToolShowCalendarEvent-DyiNmqqo.js} +43 -43
- package/dist/_chunks/{PkToolShowCalendarEvent-D_GjXl2_.js.map → PkToolShowCalendarEvent-DyiNmqqo.js.map} +1 -1
- package/dist/_chunks/PkToolShowComparison-RA72YL7R.js +66 -0
- package/dist/_chunks/{PkToolShowComparison-Bp2rP2Hx.js.map → PkToolShowComparison-RA72YL7R.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-NVzIu2t0.js → PkToolShowContactForm-BzDhv2yd.js} +41 -41
- package/dist/_chunks/{PkToolShowContactForm-NVzIu2t0.js.map → PkToolShowContactForm-BzDhv2yd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-BnZrDPVC.js → PkToolShowDiagram-DhXe8IPm.js} +79 -79
- package/dist/_chunks/{PkToolShowDiagram-BnZrDPVC.js.map → PkToolShowDiagram-DhXe8IPm.js.map} +1 -1
- package/dist/_chunks/{PkToolShowEmail-DCSj4328.js → PkToolShowEmail-CBmfy_I9.js} +34 -34
- package/dist/_chunks/{PkToolShowEmail-DCSj4328.js.map → PkToolShowEmail-CBmfy_I9.js.map} +1 -1
- package/dist/_chunks/PkToolShowForm-CzIfm5de.js +365 -0
- package/dist/_chunks/{PkToolShowForm-ztQFyFd9.js.map → PkToolShowForm-CzIfm5de.js.map} +1 -1
- package/dist/_chunks/PkToolShowImageGallery-CSIiRuSC.js +74 -0
- package/dist/_chunks/{PkToolShowImageGallery-DiOR0vYa.js.map → PkToolShowImageGallery-CSIiRuSC.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-CQmgakEo.js → PkToolShowLocation-BHoUqpx4.js} +4079 -4079
- package/dist/_chunks/{PkToolShowLocation-CQmgakEo.js.map → PkToolShowLocation-BHoUqpx4.js.map} +1 -1
- package/dist/_chunks/PkToolShowMessage-CpDmPfCG.js +77 -0
- package/dist/_chunks/{PkToolShowMessage-BysjJ1oS.js.map → PkToolShowMessage-CpDmPfCG.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-D-JXSRmA.js → PkToolShowProductList-B8uuIvGo.js} +28 -28
- package/dist/_chunks/{PkToolShowProductList-D-JXSRmA.js.map → PkToolShowProductList-B8uuIvGo.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-BcIwuGqm.js → PkToolShowQrCode-CD2lo3O0.js} +23 -23
- package/dist/_chunks/{PkToolShowQrCode-BcIwuGqm.js.map → PkToolShowQrCode-CD2lo3O0.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-U7etupUP.js → PkToolShowSources-JxaTAEpc.js} +98 -98
- package/dist/_chunks/{PkToolShowSources-U7etupUP.js.map → PkToolShowSources-JxaTAEpc.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-Dqe4gtEY.js → PkToolShowSuggestedReply-BTxqEwEm.js} +18 -18
- package/dist/_chunks/{PkToolShowSuggestedReply-Dqe4gtEY.js.map → PkToolShowSuggestedReply-BTxqEwEm.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DYMhfXKH.js → PkToolShowVideo-CVksKdPD.js} +17 -17
- package/dist/_chunks/{PkToolShowVideo-DYMhfXKH.js.map → PkToolShowVideo-CVksKdPD.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-D_pJe5DI.js → PkToolShowWeather-IDwTDozU.js} +68 -68
- package/dist/_chunks/{PkToolShowWeather-D_pJe5DI.js.map → PkToolShowWeather-IDwTDozU.js.map} +1 -1
- package/dist/_chunks/PkToolShowWebPages-D9Yst_2O.js +78 -0
- package/dist/_chunks/{PkToolShowWebPages-CPNgXzrS.js.map → PkToolShowWebPages-D9Yst_2O.js.map} +1 -1
- package/dist/_chunks/{PkUrl-C3gMPCjz.js → PkUrl-B3FTSURr.js} +19 -19
- package/dist/_chunks/{PkUrl-C3gMPCjz.js.map → PkUrl-B3FTSURr.js.map} +1 -1
- package/dist/_chunks/{VvCheckbox.es-CEfwI84M.js → VvCheckbox.es-C_dlDzrr.js} +78 -78
- package/dist/_chunks/{VvCheckbox.es-CEfwI84M.js.map → VvCheckbox.es-C_dlDzrr.js.map} +1 -1
- package/dist/_chunks/{VvCheckboxGroup.es-B-eWqe8G.js → VvCheckboxGroup.es-hY0kWpC2.js} +197 -197
- package/dist/_chunks/{VvCheckboxGroup.es-B-eWqe8G.js.map → VvCheckboxGroup.es-hY0kWpC2.js.map} +1 -1
- package/dist/_chunks/VvCombobox.es-DxhDF7ab.js +2044 -0
- package/dist/_chunks/{VvCombobox.es-CfRJtWOd.js.map → VvCombobox.es-DxhDF7ab.js.map} +1 -1
- package/dist/_chunks/{VvInputText.es-B0HHD6Th.js → VvInputText.es-CdpU8kvP.js} +460 -460
- package/dist/_chunks/{VvInputText.es-B0HHD6Th.js.map → VvInputText.es-CdpU8kvP.js.map} +1 -1
- package/dist/_chunks/{VvRadio.es-B3u8JJFF.js → VvRadio.es-BruZ5FHR.js} +144 -144
- package/dist/_chunks/{VvRadio.es-B3u8JJFF.js.map → VvRadio.es-BruZ5FHR.js.map} +1 -1
- package/dist/_chunks/{VvRadioGroup.es--AMV1wAw.js → VvRadioGroup.es-DSv6UdEy.js} +148 -148
- package/dist/_chunks/{VvRadioGroup.es--AMV1wAw.js.map → VvRadioGroup.es-DSv6UdEy.js.map} +1 -1
- package/dist/_chunks/{VvSelect.es-BfrDID0e.js → VvSelect.es-C244CAei.js} +155 -155
- package/dist/_chunks/{VvSelect.es-BfrDID0e.js.map → VvSelect.es-C244CAei.js.map} +1 -1
- package/dist/_chunks/VvTextarea.es-DbaPIcWl.js +1166 -0
- package/dist/_chunks/{VvTextarea.es-CAzFW944.js.map → VvTextarea.es-DbaPIcWl.js.map} +1 -1
- package/dist/_chunks/{dist-BvSGMyWS.js → dist-BgJVX4FG.js} +12 -12
- package/dist/_chunks/{dist-BvSGMyWS.js.map → dist-BgJVX4FG.js.map} +1 -1
- package/dist/_chunks/{dist-TFHdNK0W.js → dist-C5Y-NI3i.js} +230 -230
- package/dist/_chunks/{dist-TFHdNK0W.js.map → dist-C5Y-NI3i.js.map} +1 -1
- package/dist/_chunks/{esm-CUYQMpeA.js → esm-BTbGj6W3.js} +25 -25
- package/dist/_chunks/{esm-CUYQMpeA.js.map → esm-BTbGj6W3.js.map} +1 -1
- package/dist/_chunks/{floating-ui.vue-Br_zOLJv.js → floating-ui.vue-CoA4oagI.js} +16 -16
- package/dist/_chunks/{floating-ui.vue-Br_zOLJv.js.map → floating-ui.vue-CoA4oagI.js.map} +1 -1
- package/dist/_chunks/{iconify-BGSTR7vH.js → iconify-6ObncgfH.js} +36 -36
- package/dist/_chunks/{iconify-BGSTR7vH.js.map → iconify-6ObncgfH.js.map} +1 -1
- package/dist/_chunks/{index.es-B9rhQl9Z.js → index.es-BbyodRh9.js} +258 -258
- package/dist/_chunks/{index.es-B9rhQl9Z.js.map → index.es-BbyodRh9.js.map} +1 -1
- package/dist/_chunks/index.es-gbmOq0Nu.js +3124 -0
- package/dist/_chunks/index.es-gbmOq0Nu.js.map +1 -0
- package/dist/_chunks/{rolldown-runtime-CEFd7nDs.js → rolldown-runtime-CoeuCKPe.js} +4 -11
- package/dist/_chunks/{src-BjFv9Ag8.js → src-CIEdKLKO.js} +2 -2
- package/dist/_chunks/{src-BjFv9Ag8.js.map → src-CIEdKLKO.js.map} +1 -1
- package/dist/_chunks/useImageFallback-BAsLRsyg.js +19 -0
- package/dist/_chunks/{useImageFallback-8kfLDjXm.js.map → useImageFallback-BAsLRsyg.js.map} +1 -1
- package/dist/_chunks/{useLightbox-Bq6k-Wlt.js → useLightbox-Epg2fN87.js} +7 -7
- package/dist/_chunks/{useLightbox-Bq6k-Wlt.js.map → useLightbox-Epg2fN87.js.map} +1 -1
- package/dist/_chunks/useShortUrlResolver--HRa6Od3.js +72 -0
- package/dist/_chunks/{useShortUrlResolver-BTJM8XRw.js.map → useShortUrlResolver--HRa6Od3.js.map} +1 -1
- package/dist/_chunks/{vue-i18n-BJ7nxwO3.js → vue-i18n-t25g63Be.js} +81 -81
- package/dist/_chunks/{vue-i18n-BJ7nxwO3.js.map → vue-i18n-t25g63Be.js.map} +1 -1
- package/dist/_chunks/vue.runtime.esm-bundler-B3bThTaf.js +3747 -0
- package/dist/_chunks/vue.runtime.esm-bundler-B3bThTaf.js.map +1 -0
- package/dist/ai-elements.es.js +1861 -1861
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotFeedbackForm.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-DZ6TaZHh.js → PkChatbot-Ch8FlZjC.js} +2 -2
- package/dist-vue/_chunks/{PkChatbot-DZ6TaZHh.js.map → PkChatbot-Ch8FlZjC.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotAuth-CqwTN8ih.js → PkChatbotAuth-DvnmIukc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotAuth-CqwTN8ih.js.map → PkChatbotAuth-DvnmIukc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-nEevDHmI.js → PkChatbotFeedbackForm-D0RNa7bE.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-nEevDHmI.js.map → PkChatbotFeedbackForm-D0RNa7bE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-BgsyN-mB.js → PkChatbotMessages-DGO0WIqx.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotMessages-BgsyN-mB.js.map → PkChatbotMessages-DGO0WIqx.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-0g30_sQH.js → PkChatbotViewChat-Dkz8dq8N.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewChat-0g30_sQH.js.map → PkChatbotViewChat-Dkz8dq8N.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-CMK4zR2J.js → PkToolShowContactForm-CkkWxSSz.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-CMK4zR2J.js.map → PkToolShowContactForm-CkkWxSSz.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-DoklcF3f.js → PkToolShowDiagram-D0NBG-Gy.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-DoklcF3f.js.map → PkToolShowDiagram-D0NBG-Gy.js.map} +1 -1
- package/dist-vue/_chunks/{index.es-BT6Jr2yi.js → index.es-BKxzs6Sh.js} +2 -2
- package/dist-vue/_chunks/{index.es-BT6Jr2yi.js.map → index.es-BKxzs6Sh.js.map} +1 -1
- package/dist-vue/index.js +10 -10
- package/package.json +2 -2
- package/dist/_chunks/PkLazyImg-_389yCnQ.js +0 -34
- package/dist/_chunks/PkToolRequestGeolocation-T16QI-Uv.js +0 -69
- package/dist/_chunks/PkToolShowArtifact-D15GjBm6.js +0 -93
- package/dist/_chunks/PkToolShowComparison-Bp2rP2Hx.js +0 -66
- package/dist/_chunks/PkToolShowForm-ztQFyFd9.js +0 -365
- package/dist/_chunks/PkToolShowImageGallery-DiOR0vYa.js +0 -74
- package/dist/_chunks/PkToolShowMessage-BysjJ1oS.js +0 -77
- package/dist/_chunks/PkToolShowWebPages-CPNgXzrS.js +0 -78
- package/dist/_chunks/VvCombobox.es-CfRJtWOd.js +0 -2044
- package/dist/_chunks/VvTextarea.es-CAzFW944.js +0 -1166
- package/dist/_chunks/index.es-DvV0VhDa.js +0 -9832
- package/dist/_chunks/index.es-DvV0VhDa.js.map +0 -1
- package/dist/_chunks/useImageFallback-8kfLDjXm.js +0 -19
- package/dist/_chunks/useShortUrlResolver-BTJM8XRw.js +0 -72
- package/dist/_chunks/vue.runtime.esm-bundler-DF2of3lp.js +0 -5007
- package/dist/_chunks/vue.runtime.esm-bundler-DF2of3lp.js.map +0 -1
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { $ as e, B as t, C as n, K as r, L as i, M as a, O as o, St as s, Tt as c, X as l, _ as u, b as d, bt as f, d as p, dt as ee, g as m, h, it as g, j as _, l as te, m as v, pt as y, r as b, u as x, v as S, wt as ne, x as C, xt as w, y as T, z as E } from "./vue.runtime.esm-bundler-B3bThTaf.js";
|
|
2
|
+
import { r as re } from "./vue-i18n-t25g63Be.js";
|
|
3
|
+
import { t as ie } from "./PkStreamingMarkdown-DIkusrTI.js";
|
|
4
|
+
import { d as D, f as ae, l as O, m as k, o as oe, p as se, r as A } from "./index.es-gbmOq0Nu.js";
|
|
5
|
+
import { u as j } from "./Agent-hWgZhu7L.js";
|
|
6
|
+
o(), w();
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../../packages/components/src/PkEditorRadioButtons.vue
|
|
9
|
+
var ce = /* @__PURE__ */ n({
|
|
10
|
+
__name: "PkEditorRadioButtons",
|
|
11
|
+
props: /*@__PURE__*/ _({
|
|
12
|
+
name: { type: String },
|
|
13
|
+
required: { type: Boolean },
|
|
14
|
+
options: { type: Array },
|
|
15
|
+
readonly: { type: Boolean },
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
modifiers: { type: [String, Array] }
|
|
18
|
+
}, {
|
|
19
|
+
modelValue: { type: [
|
|
20
|
+
String,
|
|
21
|
+
Number,
|
|
22
|
+
Boolean,
|
|
23
|
+
Symbol,
|
|
24
|
+
Array
|
|
25
|
+
] },
|
|
26
|
+
modelModifiers: {}
|
|
27
|
+
}),
|
|
28
|
+
emits: ["update:modelValue"],
|
|
29
|
+
setup(n) {
|
|
30
|
+
let o = n, s = r(n, "modelValue"), l = v(() => [...o.modifiers ? Array.isArray(o.modifiers) ? o.modifiers : [o.modifiers] : [], "button"]);
|
|
31
|
+
return (r, o) => {
|
|
32
|
+
let u = D, f = k;
|
|
33
|
+
return i(), m(f, {
|
|
34
|
+
modelValue: s.value,
|
|
35
|
+
"onUpdate:modelValue": o[0] ||= (e) => s.value = e,
|
|
36
|
+
name: n.name,
|
|
37
|
+
modifiers: "buttons"
|
|
38
|
+
}, {
|
|
39
|
+
default: e(() => [(i(!0), S(p, null, E(n.options, (o, s) => (i(), m(u, {
|
|
40
|
+
key: s,
|
|
41
|
+
name: n.name,
|
|
42
|
+
required: n.required,
|
|
43
|
+
readonly: n.readonly,
|
|
44
|
+
disabled: n.disabled,
|
|
45
|
+
value: o.value,
|
|
46
|
+
modifiers: l.value
|
|
47
|
+
}, {
|
|
48
|
+
default: e(() => [t(r.$slots, o.value, a({ ref_for: !0 }, { option: o }), () => [d(c(o.label), 1)])]),
|
|
49
|
+
_: 2
|
|
50
|
+
}, 1032, [
|
|
51
|
+
"name",
|
|
52
|
+
"required",
|
|
53
|
+
"readonly",
|
|
54
|
+
"disabled",
|
|
55
|
+
"value",
|
|
56
|
+
"modifiers"
|
|
57
|
+
]))), 128))]),
|
|
58
|
+
_: 3
|
|
59
|
+
}, 8, ["modelValue", "name"]);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
o(), w();
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region ../../packages/components/src/PkEditorCheckboxButtons.vue
|
|
66
|
+
var le = /* @__PURE__ */ n({
|
|
67
|
+
__name: "PkEditorCheckboxButtons",
|
|
68
|
+
props: /*@__PURE__*/ _({
|
|
69
|
+
name: { type: String },
|
|
70
|
+
required: { type: Boolean },
|
|
71
|
+
options: { type: Array },
|
|
72
|
+
readonly: { type: Boolean },
|
|
73
|
+
disabled: { type: Boolean }
|
|
74
|
+
}, {
|
|
75
|
+
modelValue: {},
|
|
76
|
+
modelModifiers: {}
|
|
77
|
+
}),
|
|
78
|
+
emits: ["update:modelValue"],
|
|
79
|
+
setup(n) {
|
|
80
|
+
let o = r(n, "modelValue");
|
|
81
|
+
return (r, s) => {
|
|
82
|
+
let l = O, u = A;
|
|
83
|
+
return i(), m(u, {
|
|
84
|
+
modelValue: o.value,
|
|
85
|
+
"onUpdate:modelValue": s[0] ||= (e) => o.value = e,
|
|
86
|
+
name: n.name,
|
|
87
|
+
modifiers: "buttons"
|
|
88
|
+
}, {
|
|
89
|
+
default: e(() => [(i(!0), S(p, null, E(n.options, (o, s) => (i(), m(l, {
|
|
90
|
+
key: s,
|
|
91
|
+
name: n.name,
|
|
92
|
+
required: n.required,
|
|
93
|
+
readonly: n.readonly,
|
|
94
|
+
disabled: n.disabled,
|
|
95
|
+
value: o.value,
|
|
96
|
+
modifiers: "button"
|
|
97
|
+
}, {
|
|
98
|
+
default: e(() => [t(r.$slots, String(o.value), a({ ref_for: !0 }, { option: o }), () => [d(c(o.label), 1)])]),
|
|
99
|
+
_: 2
|
|
100
|
+
}, 1032, [
|
|
101
|
+
"name",
|
|
102
|
+
"required",
|
|
103
|
+
"readonly",
|
|
104
|
+
"disabled",
|
|
105
|
+
"value"
|
|
106
|
+
]))), 128))]),
|
|
107
|
+
_: 3
|
|
108
|
+
}, 8, ["modelValue", "name"]);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
o(), w(), g(), b();
|
|
113
|
+
var ue = {
|
|
114
|
+
key: 0,
|
|
115
|
+
class: "border border-surface-3 rounded-xl w-full overflow-hidden flex flex-col transition-all bg-surface"
|
|
116
|
+
}, de = {
|
|
117
|
+
key: 0,
|
|
118
|
+
class: "text-12 border-b border-surface-3 text-word-3 bg-surface-1"
|
|
119
|
+
}, fe = {
|
|
120
|
+
key: 1,
|
|
121
|
+
class: "flex flex-col gap-4 p-sm"
|
|
122
|
+
}, pe = { class: "flex justify-between text-10 text-word-3" }, me = { class: "h-4 bg-surface-3 rounded-full overflow-hidden" }, he = { class: "px-sm py-16 flex flex-col gap-12" }, M = { class: "leading-normal text-12" }, N = { class: "font-semibold" }, P = { class: "text-12" }, F = { class: "font-semibold" }, I = {
|
|
123
|
+
key: 0,
|
|
124
|
+
class: "text-word-3"
|
|
125
|
+
}, L = { class: "text-12" }, R = { class: "font-semibold" }, ge = {
|
|
126
|
+
key: 0,
|
|
127
|
+
class: "text-word-3"
|
|
128
|
+
}, _e = {
|
|
129
|
+
key: 2,
|
|
130
|
+
class: "flex flex-col gap-6 w-full"
|
|
131
|
+
}, ve = {
|
|
132
|
+
key: 0,
|
|
133
|
+
class: "px-sm pb-sm border-t border-surface-3"
|
|
134
|
+
}, ye = {
|
|
135
|
+
key: 1,
|
|
136
|
+
class: "px-sm py-10 bg-surface border-t border-surface-3 flex justify-between gap-12"
|
|
137
|
+
}, be = { key: 1 }, xe = { class: "px-sm py-12 bg-surface space-y-10" }, z = { class: "flex flex-col gap-8" }, Se = { class: "text-12 text-word-3" }, Ce = { class: "text-12 text-word-2 font-semibold" }, we = { class: "px-sm py-12 bg-surface border-t border-surface-3 flex items-center gap-10" }, Te = { class: "w-20 h-20 rounded-full border border-success text-success flex items-center justify-center" }, Ee = { class: "flex flex-col" }, De = { class: "font-semibold text-12 text-word-1 leading-tight" }, B = /* @__PURE__ */ n({
|
|
138
|
+
__name: "PkToolShowForm",
|
|
139
|
+
props: {
|
|
140
|
+
part: { type: null },
|
|
141
|
+
allowCustomAnswer: { type: Boolean },
|
|
142
|
+
answered: { type: Boolean }
|
|
143
|
+
},
|
|
144
|
+
emits: ["select"],
|
|
145
|
+
setup(t, { emit: n }) {
|
|
146
|
+
let r = t, a = n, { t: o, d } = re({ useScope: "global" }), g = v(() => JSON.parse(JSON.stringify(r.part))), _ = v(() => g.value.toolName === "showMultipleChoice" || g.value.type === "tool-showMultipleChoice"), b = v(() => j(g.value.output)), w = v(() => !r.answered && (g.value.state === "input-available" || b.value)), D = v(() => {
|
|
147
|
+
let e = V.value;
|
|
148
|
+
return e ? A.value.length === 1 && !e.allowFreeformInput && !r.allowCustomAnswer : !1;
|
|
149
|
+
}), O = v(() => _.value && A.value.length === 1 && !V.value?.multiSelect), k = v(() => !!V.value?.options && !V.value?.multiSelect && (D.value || O.value)), A = v(() => {
|
|
150
|
+
let e = g.value.input;
|
|
151
|
+
return e?.steps?.length ? e.steps : e?.question && e?.options ? [{
|
|
152
|
+
id: "legacy",
|
|
153
|
+
question: e.question,
|
|
154
|
+
options: e.options.map((e) => typeof e == "string" ? { label: e } : e)
|
|
155
|
+
}] : [];
|
|
156
|
+
}), B = y(0), V = v(() => A.value[B.value]), H = v(() => B.value > 0), U = v(() => B.value < A.value.length - 1), Oe = v(() => A.value.length > 1), W = v(() => Oe.value ? Math.round((B.value + 1) / A.value.length * 100) : null), G = ee({}), K = y("");
|
|
157
|
+
l(B, () => {
|
|
158
|
+
K.value = "";
|
|
159
|
+
});
|
|
160
|
+
let q = v({
|
|
161
|
+
get: () => {
|
|
162
|
+
let e = V.value ? G[V.value.id] : void 0;
|
|
163
|
+
if (!(e == null || Array.isArray(e))) return e;
|
|
164
|
+
},
|
|
165
|
+
set: (e) => {
|
|
166
|
+
V.value && (G[V.value.id] = e ?? null);
|
|
167
|
+
}
|
|
168
|
+
}), J = v({
|
|
169
|
+
get: () => {
|
|
170
|
+
let e = V.value ? G[V.value.id] : void 0;
|
|
171
|
+
return Array.isArray(e) ? e : [];
|
|
172
|
+
},
|
|
173
|
+
set: (e) => {
|
|
174
|
+
V.value && (G[V.value.id] = e ?? []);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
function Y(e) {
|
|
178
|
+
if (!e || typeof e == "string") return;
|
|
179
|
+
let t = e.answers;
|
|
180
|
+
return Array.isArray(t) ? t : void 0;
|
|
181
|
+
}
|
|
182
|
+
l(() => g.value.output, (e) => {
|
|
183
|
+
if (!e || j(e)) return;
|
|
184
|
+
if (typeof e == "string") {
|
|
185
|
+
A.value.length === 1 && (G[A.value[0].id] = e);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
let t = Y(e);
|
|
189
|
+
if (t) {
|
|
190
|
+
for (let e of t) G[e.id] = e.value;
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
let n = e;
|
|
194
|
+
for (let e of A.value) {
|
|
195
|
+
let t = n[e.id];
|
|
196
|
+
t !== void 0 && (G[e.id] = t);
|
|
197
|
+
}
|
|
198
|
+
}, { immediate: !0 });
|
|
199
|
+
let ke = v(() => {
|
|
200
|
+
let e = g.value.output;
|
|
201
|
+
if (!e || j(e)) return;
|
|
202
|
+
if (typeof e == "string") return e;
|
|
203
|
+
let t = Y(e);
|
|
204
|
+
if (t?.length === 1) {
|
|
205
|
+
let e = t[0].value;
|
|
206
|
+
return Array.isArray(e) ? e.join(", ") : String(e);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
l(ke, (e) => {
|
|
210
|
+
!e || !V.value || (V.value.options ?? []).map((e) => e.label).includes(e) || (K.value = e);
|
|
211
|
+
}, { immediate: !0 });
|
|
212
|
+
let X = v(() => V.value?.options ? V.value.options.map((e) => ({
|
|
213
|
+
label: e.label,
|
|
214
|
+
value: e.label,
|
|
215
|
+
description: e.description
|
|
216
|
+
})) : []);
|
|
217
|
+
function Z() {
|
|
218
|
+
if (K.value.trim()) {
|
|
219
|
+
$();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
U.value ? B.value++ : Q();
|
|
223
|
+
}
|
|
224
|
+
function Ae() {
|
|
225
|
+
H.value && B.value--;
|
|
226
|
+
}
|
|
227
|
+
function Q() {
|
|
228
|
+
if (!w.value) return;
|
|
229
|
+
let e = A.value.map((e) => ({
|
|
230
|
+
id: e.id,
|
|
231
|
+
value: G[e.id] ?? null
|
|
232
|
+
}));
|
|
233
|
+
if (O.value && !V.value?.allowFreeformInput) {
|
|
234
|
+
let t = e[0].value;
|
|
235
|
+
a("select", Array.isArray(t) ? t[0] : t);
|
|
236
|
+
} else a("select", { answers: e });
|
|
237
|
+
}
|
|
238
|
+
function $() {
|
|
239
|
+
let e = K.value.trim();
|
|
240
|
+
e && (G[V.value.id] = e, K.value = "", A.value.length === 1 ? Q() : Z());
|
|
241
|
+
}
|
|
242
|
+
function je() {
|
|
243
|
+
w.value && (D.value || O.value) && Q();
|
|
244
|
+
}
|
|
245
|
+
function Me(e) {
|
|
246
|
+
let t = G[e.id];
|
|
247
|
+
return t == null ? "—" : Array.isArray(t) ? t.join(", ") : e.type === "date" ? d(new Date(t), "short") : t;
|
|
248
|
+
}
|
|
249
|
+
return (t, n) => {
|
|
250
|
+
let r = ae, a = oe, l = se;
|
|
251
|
+
return A.value.length ? (i(), S("div", ue, [g.value.input?.title || w.value && A.value.length > 1 ? (i(), S("div", de, [g.value.input?.title ? (i(), S("div", {
|
|
252
|
+
key: 0,
|
|
253
|
+
class: s(["px-sm py-10 font-bold", { "border-b border-surface-3": w.value && A.value.length > 1 }])
|
|
254
|
+
}, c(g.value.input?.title), 3)) : u("", !0), w.value && A.value.length > 1 ? (i(), S("div", fe, [h("div", pe, [h("span", null, c(f(o)("showForm.step", {
|
|
255
|
+
current: B.value + 1,
|
|
256
|
+
total: A.value.length
|
|
257
|
+
})), 1), h("span", null, c(W.value) + "%", 1)]), h("div", me, [h("div", {
|
|
258
|
+
class: "h-full bg-word-4 transition-all duration-300",
|
|
259
|
+
style: ne({ width: `${W.value}%` })
|
|
260
|
+
}, null, 4)])])) : u("", !0)])) : u("", !0), w.value ? (i(), S(p, { key: 1 }, [
|
|
261
|
+
h("div", he, [h("div", M, [h("strong", N, c(V.value.question), 1), V.value.message ? (i(), m(ie, {
|
|
262
|
+
key: 0,
|
|
263
|
+
markdown: V.value.message,
|
|
264
|
+
class: "text-word-2 mt-4"
|
|
265
|
+
}, null, 8, ["markdown"])) : u("", !0)]), V.value.options && V.value.multiSelect ? (i(), m(le, {
|
|
266
|
+
key: 0,
|
|
267
|
+
modelValue: J.value,
|
|
268
|
+
"onUpdate:modelValue": n[0] ||= (e) => J.value = e,
|
|
269
|
+
name: V.value.id,
|
|
270
|
+
options: X.value,
|
|
271
|
+
readonly: !w.value,
|
|
272
|
+
class: "mb-0",
|
|
273
|
+
vertical: ""
|
|
274
|
+
}, T({ _: 2 }, [E(X.value, (t) => ({
|
|
275
|
+
name: t.value,
|
|
276
|
+
fn: e(() => [h("div", P, [h("div", F, c(t.label), 1), t.description ? (i(), S("div", I, c(t.description), 1)) : u("", !0)])])
|
|
277
|
+
}))]), 1032, [
|
|
278
|
+
"modelValue",
|
|
279
|
+
"name",
|
|
280
|
+
"options",
|
|
281
|
+
"readonly"
|
|
282
|
+
])) : V.value.options && !V.value.multiSelect ? (i(), m(ce, {
|
|
283
|
+
key: 1,
|
|
284
|
+
modelValue: q.value,
|
|
285
|
+
"onUpdate:modelValue": [n[1] ||= (e) => q.value = e, je],
|
|
286
|
+
name: V.value.id,
|
|
287
|
+
options: X.value,
|
|
288
|
+
readonly: !w.value,
|
|
289
|
+
vertical: "",
|
|
290
|
+
class: "mb-0"
|
|
291
|
+
}, T({ _: 2 }, [E(X.value, (t) => ({
|
|
292
|
+
name: t.value,
|
|
293
|
+
fn: e(() => [h("div", L, [h("div", R, c(t.label), 1), t.description ? (i(), S("div", ge, c(t.description), 1)) : u("", !0)])])
|
|
294
|
+
}))]), 1032, [
|
|
295
|
+
"modelValue",
|
|
296
|
+
"name",
|
|
297
|
+
"options",
|
|
298
|
+
"readonly"
|
|
299
|
+
])) : V.value.options ? u("", !0) : (i(), S("div", _e, [(i(), m(r, {
|
|
300
|
+
key: V.value.id,
|
|
301
|
+
modelValue: q.value,
|
|
302
|
+
"onUpdate:modelValue": n[2] ||= (e) => q.value = e,
|
|
303
|
+
placeholder: V.value.placeholder || f(o)("placeholder.insert"),
|
|
304
|
+
type: V.value.type,
|
|
305
|
+
class: "w-full",
|
|
306
|
+
name: V.value.id,
|
|
307
|
+
modifiers: "compact rounded",
|
|
308
|
+
disabled: !w.value,
|
|
309
|
+
onKeyup: te(Z, ["enter"])
|
|
310
|
+
}, null, 8, [
|
|
311
|
+
"modelValue",
|
|
312
|
+
"placeholder",
|
|
313
|
+
"type",
|
|
314
|
+
"name",
|
|
315
|
+
"disabled"
|
|
316
|
+
]))]))]),
|
|
317
|
+
V.value.allowFreeformInput && V.value.options ? (i(), S("div", ve, [h("form", {
|
|
318
|
+
class: "flex gap-xs pt-sm",
|
|
319
|
+
onSubmit: x($, ["prevent"])
|
|
320
|
+
}, [(i(), m(r, {
|
|
321
|
+
key: `${V.value.id}-custom`,
|
|
322
|
+
modelValue: K.value,
|
|
323
|
+
"onUpdate:modelValue": n[3] ||= (e) => K.value = e,
|
|
324
|
+
class: "flex-1",
|
|
325
|
+
name: `${V.value.id}-custom`,
|
|
326
|
+
modifiers: "compact rounded",
|
|
327
|
+
disabled: !w.value,
|
|
328
|
+
placeholder: V.value.placeholder || f(o)("showForm.otherPlaceholder")
|
|
329
|
+
}, null, 8, [
|
|
330
|
+
"modelValue",
|
|
331
|
+
"name",
|
|
332
|
+
"disabled",
|
|
333
|
+
"placeholder"
|
|
334
|
+
]))], 32)])) : u("", !0),
|
|
335
|
+
k.value ? u("", !0) : (i(), S("div", ye, [H.value ? (i(), m(a, {
|
|
336
|
+
key: 0,
|
|
337
|
+
modifiers: "action-quiet",
|
|
338
|
+
icon: "ri:arrow-left-s-line",
|
|
339
|
+
label: f(o)("action.back"),
|
|
340
|
+
onClick: x(Ae, ["stop"])
|
|
341
|
+
}, null, 8, ["label"])) : (i(), S("div", be)), C(a, {
|
|
342
|
+
modifiers: U.value ? "action-quiet" : "action-primary",
|
|
343
|
+
icon: U.value ? "ri:arrow-right-s-line" : "ri:send-plane-2-line",
|
|
344
|
+
"icon-position": "right",
|
|
345
|
+
label: U.value ? f(o)("action.next") : f(o)("action.submit"),
|
|
346
|
+
onClick: x(Z, ["stop"])
|
|
347
|
+
}, null, 8, [
|
|
348
|
+
"modifiers",
|
|
349
|
+
"icon",
|
|
350
|
+
"label"
|
|
351
|
+
])]))
|
|
352
|
+
], 64)) : (i(), S(p, { key: 2 }, [h("div", xe, [h("ul", z, [(i(!0), S(p, null, E(A.value, (e) => (i(), S("li", {
|
|
353
|
+
key: e.id,
|
|
354
|
+
class: "leading-normal"
|
|
355
|
+
}, [h("div", Se, c(e.question), 1), h("span", Ce, c(Me(e)), 1)]))), 128))])]), h("div", we, [h("div", Te, [C(l, {
|
|
356
|
+
name: "ri:check-line",
|
|
357
|
+
class: "text-12"
|
|
358
|
+
})]), h("div", Ee, [h("span", De, c(f(o)("showForm.completed")), 1)])])], 64))])) : u("", !0);
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
//#endregion
|
|
363
|
+
export { B as default };
|
|
364
|
+
|
|
365
|
+
//# sourceMappingURL=PkToolShowForm-CzIfm5de.js.map
|