@turquoisehealth/pit-viper 2.264.1 → 2.264.2-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_site/assets/css/pit-viper-a11y-v3.css +6 -0
- package/_site/assets/css/pit-viper-a11y.css +6 -0
- package/_site/assets/css/pit-viper-consumer.css +6 -0
- package/_site/assets/css/pit-viper-v2-scoped.css +5 -0
- package/_site/assets/css/pit-viper-v2.css +6 -0
- package/_site/assets/css/pit-viper-v3.css +6 -0
- package/_site/assets/css/pit-viper.css +6 -0
- package/package.json +1 -1
- package/pv-components/dist/stats/vue/ai/stats.html +1 -1
- package/pv-components/dist/stats/vue/base/stats.html +1 -1
- package/pv-components/dist/stats/vue/visualizations/stats.html +1 -1
- package/pv-components/dist/stats/web/pv-filter-panel-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-prompt-input-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-question-stats.html +1 -1
- package/pv-components/dist/stats/web/pv-suggestion-tag-stats.html +1 -1
- package/pv-components/dist/vue/ai/components/ai/PvPromptInput/PvPromptInput.vue.d.ts +4 -0
- package/pv-components/dist/vue/ai/components/ai/PvPromptInput/types.d.ts +12 -0
- package/pv-components/dist/vue/ai/components/ai/PvQuestion/types.d.ts +4 -0
- package/pv-components/dist/vue/ai/components/base/PvPopoverV2/PvPopoverV2.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/components/base/PvRange/PvRange.vue.d.ts +2 -2
- package/pv-components/dist/vue/ai/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +5 -0
- package/pv-components/dist/vue/ai/components/base/PvTooltip/PvTooltip.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/components/base/PvTooltipV2/PvTooltipV2.vue.d.ts +1 -1
- package/pv-components/dist/vue/ai/pv-components-ai.mjs +489 -325
- package/pv-components/dist/vue/ai/pv-components-ai.mjs.map +1 -1
- package/pv-components/dist/vue/base/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +5 -0
- package/pv-components/dist/vue/base/pv-components-base.mjs +1102 -1096
- package/pv-components/dist/vue/base/pv-components-base.mjs.map +1 -1
- package/pv-components/dist/vue/visualizations/components/base/PvSuggestionTag/PvSuggestionTag.vue.d.ts +5 -0
- package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs +599 -593
- package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs.map +1 -1
- package/pv-components/dist/web/components/pv-filter-panel/pv-filter-panel.js +875 -869
- package/pv-components/dist/web/components/pv-prompt-input/pv-prompt-input.js +829 -572
- package/pv-components/dist/web/components/pv-question/pv-question.js +387 -373
- package/pv-components/dist/web/components/pv-suggestion-tag/pv-suggestion-tag.js +382 -376
- package/pv-components/dist/web/pv-components.iife.js +36 -36
- package/pv-components/dist/web/pv-components.iife.js.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.pv-badge-md[data-v-3def68cb]{--inset-size:2px 2px;min-width:20px;min-height:20px;max-height:20px;font-weight:500}.pv-badge-sm[data-v-3def68cb]{--inset-size:0 2px;min-width:16px;min-height:16px;max-height:16px;font-weight:500}.pv-rounded[data-v-3def68cb]{border-radius:50%}.input-icon-position{pointer-events:none;position:absolute;top:8px;left:12px}summary[data-v-dfa0b416]{background-image:none;padding-right:2px}
|
|
2
|
-
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { Comment as e, Fragment as t, Text as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f,
|
|
2
|
+
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { Comment as e, Fragment as t, Text as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, guardReactiveProps as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onBeforeUpdate as x, onMounted as S, onScopeDispose as C, openBlock as w, ref as T, renderList as E, renderSlot as D, toDisplayString as O, toHandlers as k, unref as A, useId as j, useModel as M, useSlots as N, useTemplateRef as P, vModelDynamic as F, vModelText as I, vShow as L, watch as R, withCtx as z, withDirectives as B, withKeys as ee, withModifiers as V } from "vue";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region src/components/base/PvSpinner/PvSpinner.vue
|
|
5
|
-
var
|
|
5
|
+
var te = /* @__PURE__ */ d({
|
|
6
6
|
__name: "PvSpinner",
|
|
7
7
|
props: {
|
|
8
8
|
size: { default: "lg" },
|
|
@@ -20,26 +20,26 @@ var z = /* @__PURE__ */ d({
|
|
|
20
20
|
dark: "pv-spinner-dark",
|
|
21
21
|
white: "pv-spinner-light"
|
|
22
22
|
};
|
|
23
|
-
return (r, i) => (
|
|
23
|
+
return (r, i) => (w(), s("div", {
|
|
24
24
|
"data-testid": "pv-spinner",
|
|
25
|
-
class:
|
|
26
|
-
style:
|
|
25
|
+
class: _(n[e.variant]),
|
|
26
|
+
style: y({ "--size": t[e.size] })
|
|
27
27
|
}, null, 6));
|
|
28
28
|
}
|
|
29
|
-
}),
|
|
29
|
+
}), ne = ["ghost"], H = {
|
|
30
30
|
md: "pv-button-small",
|
|
31
31
|
lg: void 0,
|
|
32
32
|
xl: "pv-button-large"
|
|
33
|
-
},
|
|
33
|
+
}, re = (e) => e == null || !H.hasOwnProperty(e) ? null : H[e] || null;
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/web-components/utils.ts
|
|
36
36
|
function U() {
|
|
37
|
-
let e =
|
|
37
|
+
let e = T(!1), t = f()?.root || {};
|
|
38
38
|
return "isCE" in t && t.isCE === !0 && (e.value = !0), e;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/components/base/baseProps.ts
|
|
42
|
-
var
|
|
42
|
+
var ie = [
|
|
43
43
|
void 0,
|
|
44
44
|
10,
|
|
45
45
|
12,
|
|
@@ -48,24 +48,24 @@ var ee = [
|
|
|
48
48
|
24,
|
|
49
49
|
32,
|
|
50
50
|
64
|
|
51
|
-
],
|
|
51
|
+
], ae = ["xlink:href"], W = /* @__PURE__ */ d({
|
|
52
52
|
__name: "PvIcon",
|
|
53
53
|
props: {
|
|
54
54
|
name: {},
|
|
55
55
|
size: {}
|
|
56
56
|
},
|
|
57
57
|
setup(e) {
|
|
58
|
-
let t = e, n = U(), r =
|
|
58
|
+
let t = e, n = U(), r = T(null), a = i(() => ({
|
|
59
59
|
"pv-icon": !0,
|
|
60
|
-
[`pv-icon-${t.size}`]: t.size != null &&
|
|
60
|
+
[`pv-icon-${t.size}`]: t.size != null && ie.includes(t.size)
|
|
61
61
|
})), o = i(() => n.value && r.value ? `${r.value}#${t.name}` : `#${t.name}`);
|
|
62
|
-
return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (r.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (e, t) => (
|
|
62
|
+
return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (r.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (e, t) => (w(), s("svg", {
|
|
63
63
|
"data-testid": "pv-icon",
|
|
64
64
|
"aria-hidden": "true",
|
|
65
|
-
class:
|
|
66
|
-
}, [c("use", { "xlink:href": o.value }, null, 8,
|
|
65
|
+
class: _(a.value)
|
|
66
|
+
}, [c("use", { "xlink:href": o.value }, null, 8, ae)], 2));
|
|
67
67
|
}
|
|
68
|
-
}),
|
|
68
|
+
}), oe = /* @__PURE__ */ d({
|
|
69
69
|
__name: "PvCounterBadge",
|
|
70
70
|
props: {
|
|
71
71
|
maxValue: { default: 99 },
|
|
@@ -87,19 +87,19 @@ var ee = [
|
|
|
87
87
|
"pv-surface": t.variant == "ghost",
|
|
88
88
|
"pv-rounded": t.rounded
|
|
89
89
|
}));
|
|
90
|
-
return (e, t) => (
|
|
91
|
-
class:
|
|
90
|
+
return (e, t) => (w(), s("div", {
|
|
91
|
+
class: _(r.value),
|
|
92
92
|
"data-testid": "pv-counter-badge"
|
|
93
|
-
},
|
|
93
|
+
}, O(n.value), 3));
|
|
94
94
|
}
|
|
95
95
|
}), G = (e, t) => {
|
|
96
96
|
let n = e.__vccOpts || e;
|
|
97
97
|
for (let [e, r] of t) n[e] = r;
|
|
98
98
|
return n;
|
|
99
|
-
}, K = /* @__PURE__ */ G(
|
|
99
|
+
}, K = /* @__PURE__ */ G(oe, [["__scopeId", "data-v-3def68cb"]]), q = ["disabled", "aria-label"], se = {
|
|
100
100
|
key: 2,
|
|
101
101
|
"data-testid": "pv-button-label"
|
|
102
|
-
},
|
|
102
|
+
}, J = /* @__PURE__ */ d({
|
|
103
103
|
__name: "PvButton",
|
|
104
104
|
props: {
|
|
105
105
|
variant: { default: "primary" },
|
|
@@ -126,57 +126,57 @@ var ee = [
|
|
|
126
126
|
setup(e) {
|
|
127
127
|
let n = e, r = i(() => !n.label || n.loading ? n.label || n.ariaLabel : void 0), c = i(() => {
|
|
128
128
|
let e = [];
|
|
129
|
-
n.inverse &&
|
|
130
|
-
let t =
|
|
129
|
+
n.inverse && ne.includes(n.variant) ? e.push(`pv-button-${n.variant}-inverse`) : e.push(`pv-button-${n.variant}`);
|
|
130
|
+
let t = re(n.size);
|
|
131
131
|
return t && e.push(t), e;
|
|
132
132
|
});
|
|
133
|
-
return (n, i) => (
|
|
133
|
+
return (n, i) => (w(), s("button", {
|
|
134
134
|
type: "button",
|
|
135
|
-
class:
|
|
135
|
+
class: _(c.value),
|
|
136
136
|
disabled: e.disabled,
|
|
137
137
|
"aria-label": r.value,
|
|
138
138
|
"data-testid": "pv-button"
|
|
139
|
-
}, [e.loading ? (
|
|
139
|
+
}, [e.loading ? (w(), a(te, {
|
|
140
140
|
key: 0,
|
|
141
141
|
size: "sm"
|
|
142
|
-
})) : (
|
|
143
|
-
e.leftCounterBadge ? (
|
|
142
|
+
})) : (w(), s(t, { key: 1 }, [
|
|
143
|
+
e.leftCounterBadge ? (w(), a(K, {
|
|
144
144
|
key: 0,
|
|
145
145
|
value: e.leftCounterBadge,
|
|
146
146
|
variant: "tertiary"
|
|
147
147
|
}, null, 8, ["value"])) : o("", !0),
|
|
148
|
-
e.leftIcon ? (
|
|
148
|
+
e.leftIcon ? (w(), a(W, {
|
|
149
149
|
key: 1,
|
|
150
150
|
name: e.leftIcon,
|
|
151
151
|
"data-testid": "pv-button-left-icon"
|
|
152
152
|
}, null, 8, ["name"])) : o("", !0),
|
|
153
|
-
e.label ? (
|
|
154
|
-
e.rightCounterBadge ? (
|
|
153
|
+
e.label ? (w(), s("span", se, O(e.label), 1)) : o("", !0),
|
|
154
|
+
e.rightCounterBadge ? (w(), a(K, {
|
|
155
155
|
key: 3,
|
|
156
156
|
value: e.rightCounterBadge,
|
|
157
157
|
variant: "tertiary"
|
|
158
158
|
}, null, 8, ["value"])) : o("", !0),
|
|
159
|
-
e.rightIcon ? (
|
|
159
|
+
e.rightIcon ? (w(), a(W, {
|
|
160
160
|
key: 4,
|
|
161
161
|
name: e.rightIcon,
|
|
162
162
|
"data-testid": "pv-button-right-icon"
|
|
163
163
|
}, null, 8, ["name"])) : o("", !0)
|
|
164
|
-
], 64))], 10,
|
|
164
|
+
], 64))], 10, q));
|
|
165
165
|
}
|
|
166
|
-
}),
|
|
166
|
+
}), ce = ["for"], le = {
|
|
167
167
|
key: 0,
|
|
168
168
|
class: "pv-surface-accent pv-inset-square pv-text-body-md pv-radius pv-bordered",
|
|
169
169
|
style: { "--inset-size": "6px 10px" }
|
|
170
|
-
},
|
|
170
|
+
}, ue = { class: "pv-relative pv-flex-item" }, de = [
|
|
171
171
|
"disabled",
|
|
172
172
|
"type",
|
|
173
173
|
"placeholder",
|
|
174
174
|
"id",
|
|
175
175
|
"data-invalid",
|
|
176
176
|
"step"
|
|
177
|
-
],
|
|
177
|
+
], fe = /* @__PURE__ */ d({
|
|
178
178
|
__name: "PvInput",
|
|
179
|
-
props: /* @__PURE__ */
|
|
179
|
+
props: /* @__PURE__ */ m({
|
|
180
180
|
showLabel: { type: Boolean },
|
|
181
181
|
error: { type: Boolean },
|
|
182
182
|
disabled: { type: Boolean },
|
|
@@ -194,19 +194,19 @@ var ee = [
|
|
|
194
194
|
}),
|
|
195
195
|
emits: ["update:modelValue"],
|
|
196
196
|
setup(e) {
|
|
197
|
-
let n = e, r =
|
|
198
|
-
return (n, i) => (
|
|
199
|
-
n.$slots.label || e.showLabel ? (
|
|
197
|
+
let n = e, r = M(e, "modelValue"), l = i(() => n.inputIcon ? { "--inset-size": "8px 12px 6px 36px" } : {});
|
|
198
|
+
return (n, i) => (w(), s(t, null, [
|
|
199
|
+
n.$slots.label || e.showLabel ? (w(), s("label", {
|
|
200
200
|
key: 0,
|
|
201
201
|
"data-testid": "pv-input-label",
|
|
202
202
|
class: "pv-label pv-stack-8",
|
|
203
203
|
for: e.id
|
|
204
|
-
}, [
|
|
205
|
-
c("div", { class:
|
|
204
|
+
}, [D(n.$slots, "label")], 8, ce)) : o("", !0),
|
|
205
|
+
c("div", { class: _(["pv-flex pv-flex-item", { "pv-stack-8": e.lowerLabel }]) }, [e.prefixLabel ? (w(), s("div", le, O(e.prefixLabel), 1)) : o("", !0), c("div", ue, [e.inputIcon ? (w(), a(W, {
|
|
206
206
|
key: 0,
|
|
207
207
|
class: "pv-absolute input-icon-position",
|
|
208
208
|
name: e.inputIcon
|
|
209
|
-
}, null, 8, ["name"])) : o("", !0),
|
|
209
|
+
}, null, 8, ["name"])) : o("", !0), B(c("input", h(n.$attrs, {
|
|
210
210
|
"onUpdate:modelValue": i[0] ||= (e) => r.value = e,
|
|
211
211
|
"data-testid": "pv-input",
|
|
212
212
|
class: ["pv-input-text", {
|
|
@@ -220,57 +220,70 @@ var ee = [
|
|
|
220
220
|
id: e.id,
|
|
221
221
|
"data-invalid": e.error ? !0 : void 0,
|
|
222
222
|
step: e.step
|
|
223
|
-
}), null, 16,
|
|
224
|
-
e.lowerLabel ? (
|
|
223
|
+
}), null, 16, de), [[F, r.value]])])], 2),
|
|
224
|
+
e.lowerLabel ? (w(), s("p", {
|
|
225
225
|
key: 1,
|
|
226
226
|
"data-testid": "pv-input-lower-label",
|
|
227
227
|
style: { "margin-left": "12px" },
|
|
228
|
-
class:
|
|
228
|
+
class: _(["pv-text-body-xs", {
|
|
229
229
|
"pv-text-red": e.error,
|
|
230
230
|
"pv-text-subdued": !e.error
|
|
231
231
|
}])
|
|
232
|
-
},
|
|
232
|
+
}, O(e.lowerLabel), 3)) : o("", !0)
|
|
233
233
|
], 64));
|
|
234
234
|
}
|
|
235
|
-
}),
|
|
235
|
+
}), pe = ["onKeydown"], me = { class: "pv-question-header pv-inset-square-16 pv-space-between" }, he = {
|
|
236
236
|
class: "pv-question-header-copy pv-flex-vertical pv-flex-item",
|
|
237
237
|
style: {
|
|
238
238
|
"--flex-align": "flex-start",
|
|
239
239
|
"--flex-gap": "4px",
|
|
240
240
|
"min-width": "0"
|
|
241
241
|
}
|
|
242
|
-
},
|
|
242
|
+
}, ge = {
|
|
243
243
|
key: 0,
|
|
244
244
|
class: "pv-text-body-md pv-text-tertiary"
|
|
245
|
-
},
|
|
245
|
+
}, _e = { class: "pv-question-header-actions pv-flex" }, ve = {
|
|
246
246
|
key: 0,
|
|
247
247
|
class: "pv-text-body-xs pv-text-tertiary",
|
|
248
248
|
role: "status",
|
|
249
249
|
"aria-live": "polite"
|
|
250
|
-
},
|
|
250
|
+
}, ye = {
|
|
251
251
|
class: "pv-question-body pv-border-bottom",
|
|
252
252
|
style: { "padding-bottom": "2px" }
|
|
253
|
-
},
|
|
253
|
+
}, be = {
|
|
254
254
|
class: "pv-question-options pv-flex-vertical pv-inset-inline-16",
|
|
255
255
|
style: {
|
|
256
256
|
"--flex-align": "stretch",
|
|
257
257
|
"--flex-gap": "2px"
|
|
258
258
|
}
|
|
259
|
-
},
|
|
259
|
+
}, xe = ["aria-activedescendant"], Se = [
|
|
260
260
|
"id",
|
|
261
261
|
"aria-selected",
|
|
262
262
|
"data-active",
|
|
263
263
|
"onClick",
|
|
264
264
|
"onMouseenter"
|
|
265
|
-
],
|
|
265
|
+
], Ce = {
|
|
266
|
+
key: 0,
|
|
267
|
+
class: "pv-flex-item pv-flex-vertical",
|
|
268
|
+
style: {
|
|
269
|
+
"--flex-align": "flex-start",
|
|
270
|
+
"--flex-gap": "2px",
|
|
271
|
+
"min-width": "0"
|
|
272
|
+
}
|
|
273
|
+
}, we = { class: "pv-question-answer-text pv-text-title-md" }, Te = { class: "pv-question-description pv-text-body-sm pv-text-tertiary" }, Ee = {
|
|
274
|
+
key: 1,
|
|
266
275
|
class: "pv-question-answer-text pv-flex-item pv-text-title-md",
|
|
267
276
|
style: { "min-width": "0" }
|
|
268
|
-
},
|
|
277
|
+
}, De = {
|
|
278
|
+
key: 2,
|
|
279
|
+
class: "pv-question-tag pv-tag-highlight",
|
|
280
|
+
"data-style": "rounded"
|
|
281
|
+
}, Oe = ["title"], ke = { class: "pv-visually-hidden" }, Ae = ["data-active"], je = { class: "pv-question-chat-badge pv-flex pv-radius pv-text-subdued" }, Me = {
|
|
269
282
|
class: "pv-question-chat-input pv-flex-item",
|
|
270
283
|
style: { "min-width": "0" }
|
|
271
|
-
},
|
|
284
|
+
}, Ne = { class: "pv-question-footer pv-inset-squish-12 pv-space-between" }, Pe = /* @__PURE__ */ d({
|
|
272
285
|
__name: "PvQuestion",
|
|
273
|
-
props: /* @__PURE__ */
|
|
286
|
+
props: /* @__PURE__ */ m({
|
|
274
287
|
chatInputLabel: { default: "Other answer" },
|
|
275
288
|
chatInputPlaceholder: { default: "Something else..." },
|
|
276
289
|
currentQuestion: { default: 1 },
|
|
@@ -284,18 +297,18 @@ var ee = [
|
|
|
284
297
|
chatInput: { default: "" },
|
|
285
298
|
chatInputModifiers: {}
|
|
286
299
|
}),
|
|
287
|
-
emits: /* @__PURE__ */
|
|
300
|
+
emits: /* @__PURE__ */ m([
|
|
288
301
|
"close",
|
|
289
302
|
"select",
|
|
290
303
|
"skip",
|
|
291
304
|
"submit"
|
|
292
305
|
], ["update:modelValue", "update:chatInput"]),
|
|
293
306
|
setup(e, { emit: n }) {
|
|
294
|
-
let r = e, l = n, d =
|
|
295
|
-
|
|
307
|
+
let r = e, l = n, d = M(e, "modelValue"), f = M(e, "chatInput"), p = j(), m = `${p}-heading`, h = `${p}-keyboard-hint`, _ = T(), v = T(), y = r.options.findIndex((e) => e.id === d.value), b = T(Math.max(y, 0)), x = i(() => r.totalQuestions > 1), S = i(() => b.value < r.options.length ? C(b.value) : void 0);
|
|
308
|
+
R(d, (e) => {
|
|
296
309
|
let t = r.options.findIndex((t) => t.id === e);
|
|
297
310
|
t >= 0 && (b.value = t);
|
|
298
|
-
}),
|
|
311
|
+
}), R(() => r.options.map((e) => e.id), (e, t) => {
|
|
299
312
|
let n = e.findIndex((e) => e === d.value);
|
|
300
313
|
if (n >= 0) {
|
|
301
314
|
b.value = n;
|
|
@@ -308,34 +321,34 @@ var ee = [
|
|
|
308
321
|
let r = t[b.value], i = e.indexOf(r);
|
|
309
322
|
b.value = i >= 0 ? i : Math.min(b.value, Math.max(e.length - 1, 0));
|
|
310
323
|
});
|
|
311
|
-
function
|
|
324
|
+
function C(e) {
|
|
312
325
|
return `${p}-option-${e}`;
|
|
313
326
|
}
|
|
314
|
-
function
|
|
315
|
-
r.options.length && (b.value = e,
|
|
327
|
+
function D(e) {
|
|
328
|
+
r.options.length && (b.value = e, g(() => _.value?.focus()));
|
|
316
329
|
}
|
|
317
|
-
function
|
|
318
|
-
b.value = r.options.length,
|
|
330
|
+
function k() {
|
|
331
|
+
b.value = r.options.length, g(() => v.value?.querySelector("input")?.focus());
|
|
319
332
|
}
|
|
320
|
-
function
|
|
333
|
+
function A(e, t) {
|
|
321
334
|
b.value = t, d.value = e.id, l("select", e);
|
|
322
335
|
}
|
|
323
336
|
function N(e, t) {
|
|
324
|
-
|
|
337
|
+
A(e, t), g(() => _.value?.focus());
|
|
325
338
|
}
|
|
326
|
-
function
|
|
339
|
+
function P() {
|
|
327
340
|
b.value >= r.options.length && (b.value = 0);
|
|
328
341
|
}
|
|
329
|
-
function
|
|
330
|
-
e.key === "ArrowDown" ? (e.preventDefault(), b.value >= r.options.length - 1 ?
|
|
342
|
+
function F(e) {
|
|
343
|
+
e.key === "ArrowDown" ? (e.preventDefault(), b.value >= r.options.length - 1 ? k() : b.value += 1) : e.key === "ArrowUp" ? (e.preventDefault(), b.value <= 0 ? k() : --b.value) : e.key === "Enter" && r.options[b.value] && (e.preventDefault(), A(r.options[b.value], b.value));
|
|
331
344
|
}
|
|
332
|
-
function
|
|
345
|
+
function I() {
|
|
333
346
|
b.value = r.options.length, d.value = void 0;
|
|
334
347
|
}
|
|
335
|
-
function
|
|
348
|
+
function L(e) {
|
|
336
349
|
if (!(!r.options.length && (e.key === "ArrowDown" || e.key === "ArrowUp"))) {
|
|
337
|
-
if (e.key === "ArrowDown") e.preventDefault(),
|
|
338
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
350
|
+
if (e.key === "ArrowDown") e.preventDefault(), D(0);
|
|
351
|
+
else if (e.key === "ArrowUp") e.preventDefault(), D(r.options.length - 1);
|
|
339
352
|
else if (e.key === "Enter" && !e.isComposing) {
|
|
340
353
|
e.preventDefault();
|
|
341
354
|
let t = f.value.trim();
|
|
@@ -343,29 +356,29 @@ var ee = [
|
|
|
343
356
|
}
|
|
344
357
|
}
|
|
345
358
|
}
|
|
346
|
-
function
|
|
359
|
+
function z() {
|
|
347
360
|
l("close");
|
|
348
361
|
}
|
|
349
|
-
function
|
|
362
|
+
function B() {
|
|
350
363
|
l("skip");
|
|
351
364
|
}
|
|
352
|
-
return (n, r) => (
|
|
365
|
+
return (n, r) => (w(), s("section", {
|
|
353
366
|
class: "pv-question pv-card pv-surface pv-full-width",
|
|
354
367
|
"data-testid": "pv-question",
|
|
355
368
|
"aria-labelledby": m,
|
|
356
|
-
onKeydown:
|
|
369
|
+
onKeydown: ee(V(B, ["stop", "prevent"]), ["esc"])
|
|
357
370
|
}, [
|
|
358
|
-
c("header",
|
|
371
|
+
c("header", me, [c("div", he, [c("h3", {
|
|
359
372
|
id: m,
|
|
360
373
|
class: "pv-heading-3"
|
|
361
|
-
},
|
|
374
|
+
}, O(e.headerLabel), 1), e.subheader ? (w(), s("p", ge, O(e.subheader), 1)) : o("", !0)]), c("div", _e, [x.value ? (w(), s("span", ve, O(e.currentQuestion) + " of " + O(e.totalQuestions), 1)) : o("", !0), u(J, {
|
|
362
375
|
ariaLabel: "Close",
|
|
363
376
|
leftIcon: "close",
|
|
364
377
|
size: "md",
|
|
365
378
|
variant: "ghost",
|
|
366
|
-
onClick:
|
|
379
|
+
onClick: z
|
|
367
380
|
})])]),
|
|
368
|
-
c("div",
|
|
381
|
+
c("div", ye, [c("div", be, [c("div", {
|
|
369
382
|
ref_key: "listboxRef",
|
|
370
383
|
ref: _,
|
|
371
384
|
class: "pv-question-listbox pv-flex-vertical",
|
|
@@ -376,13 +389,13 @@ var ee = [
|
|
|
376
389
|
"data-testid": "pv-question-listbox",
|
|
377
390
|
role: "listbox",
|
|
378
391
|
tabindex: "0",
|
|
379
|
-
"aria-activedescendant":
|
|
380
|
-
"aria-describedby":
|
|
392
|
+
"aria-activedescendant": S.value,
|
|
393
|
+
"aria-describedby": h,
|
|
381
394
|
"aria-labelledby": m,
|
|
382
|
-
onFocus:
|
|
383
|
-
onKeydown:
|
|
384
|
-
}, [(
|
|
385
|
-
id:
|
|
395
|
+
onFocus: P,
|
|
396
|
+
onKeydown: F
|
|
397
|
+
}, [(w(!0), s(t, null, E(e.options, (e, t) => (w(), s("div", {
|
|
398
|
+
id: C(t),
|
|
386
399
|
key: e.id,
|
|
387
400
|
class: "pv-question-option pv-flex pv-inset-squish-12 pv-radius-lg",
|
|
388
401
|
"data-testid": "pv-question-option",
|
|
@@ -397,9 +410,10 @@ var ee = [
|
|
|
397
410
|
size: "sm",
|
|
398
411
|
variant: "tertiary"
|
|
399
412
|
}, null, 8, ["value"]),
|
|
400
|
-
c("span",
|
|
401
|
-
e.
|
|
402
|
-
|
|
413
|
+
e.description ? (w(), s("div", Ce, [c("span", we, O(e.label), 1), c("span", Te, O(e.description), 1)])) : (w(), s("span", Ee, O(e.label), 1)),
|
|
414
|
+
e.tag ? (w(), s("span", De, O(e.tag), 1)) : o("", !0),
|
|
415
|
+
e.helpText ? (w(), s("span", {
|
|
416
|
+
key: 3,
|
|
403
417
|
class: "pv-question-help pv-flex",
|
|
404
418
|
style: { "--flex-gap": "0" },
|
|
405
419
|
title: e.helpText
|
|
@@ -407,9 +421,9 @@ var ee = [
|
|
|
407
421
|
class: "pv-text-tertiary",
|
|
408
422
|
name: "info-circle",
|
|
409
423
|
size: 12
|
|
410
|
-
}), c("span",
|
|
411
|
-
d.value === e.id ? (
|
|
412
|
-
key:
|
|
424
|
+
}), c("span", ke, O(e.helpText), 1)], 8, Oe)) : o("", !0),
|
|
425
|
+
d.value === e.id ? (w(), a(W, {
|
|
426
|
+
key: 4,
|
|
413
427
|
class: "pv-question-check pv-text-brand",
|
|
414
428
|
name: "check"
|
|
415
429
|
})) : o("", !0),
|
|
@@ -417,26 +431,26 @@ var ee = [
|
|
|
417
431
|
class: "pv-question-chevron pv-text-tertiary",
|
|
418
432
|
name: "chevron-right"
|
|
419
433
|
})
|
|
420
|
-
], 40,
|
|
434
|
+
], 40, Se))), 128))], 40, xe), c("div", {
|
|
421
435
|
ref_key: "chatInputWrapperRef",
|
|
422
436
|
ref: v,
|
|
423
437
|
class: "pv-question-chat pv-flex pv-inset-squish-12 pv-radius-lg",
|
|
424
438
|
"data-testid": "pv-question-chat",
|
|
425
439
|
"data-active": b.value === e.options.length || void 0,
|
|
426
|
-
onClick:
|
|
440
|
+
onClick: k,
|
|
427
441
|
onMouseenter: r[1] ||= (t) => b.value = e.options.length
|
|
428
442
|
}, [
|
|
429
|
-
c("span",
|
|
443
|
+
c("span", je, [u(W, {
|
|
430
444
|
name: "text-search",
|
|
431
445
|
size: 12
|
|
432
446
|
})]),
|
|
433
|
-
c("div",
|
|
447
|
+
c("div", Me, [u(fe, {
|
|
434
448
|
modelValue: f.value,
|
|
435
449
|
"onUpdate:modelValue": r[0] ||= (e) => f.value = e,
|
|
436
450
|
"aria-label": e.chatInputLabel,
|
|
437
451
|
placeholder: e.chatInputPlaceholder,
|
|
438
|
-
onFocus:
|
|
439
|
-
onKeydown:
|
|
452
|
+
onFocus: I,
|
|
453
|
+
onKeydown: L
|
|
440
454
|
}, null, 8, [
|
|
441
455
|
"modelValue",
|
|
442
456
|
"aria-label",
|
|
@@ -446,36 +460,36 @@ var ee = [
|
|
|
446
460
|
class: "pv-question-chevron pv-text-tertiary",
|
|
447
461
|
name: "chevron-right"
|
|
448
462
|
})
|
|
449
|
-
], 40,
|
|
450
|
-
c("footer",
|
|
451
|
-
id:
|
|
463
|
+
], 40, Ae)])]),
|
|
464
|
+
c("footer", Ne, [c("span", {
|
|
465
|
+
id: h,
|
|
452
466
|
class: "pv-text-body-xs pv-text-tertiary"
|
|
453
|
-
}, "↑↓ to navigate • Enter to select • Esc to skip"), u(
|
|
467
|
+
}, "↑↓ to navigate • Enter to select • Esc to skip"), u(J, {
|
|
454
468
|
class: "pv-question-skip",
|
|
455
469
|
label: "Skip",
|
|
456
470
|
size: "lg",
|
|
457
471
|
variant: "secondary",
|
|
458
|
-
onClick:
|
|
472
|
+
onClick: B
|
|
459
473
|
})])
|
|
460
|
-
], 40,
|
|
474
|
+
], 40, pe));
|
|
461
475
|
}
|
|
462
|
-
}),
|
|
476
|
+
}), Fe = {
|
|
463
477
|
key: 0,
|
|
464
478
|
class: "pv-confirmation pv-bordered pv-radius pv-inset-square-16 pv-flow-16",
|
|
465
479
|
"data-testid": "pv-confirmation",
|
|
466
480
|
"aria-label": "Tool approval"
|
|
467
|
-
},
|
|
481
|
+
}, Ie = { class: "pv-text-body-sm" }, Le = {
|
|
468
482
|
class: "pv-flex",
|
|
469
483
|
style: { "--flex-justify": "flex-end" }
|
|
470
|
-
},
|
|
484
|
+
}, Re = {
|
|
471
485
|
key: 1,
|
|
472
486
|
class: "pv-flex pv-text-body-sm pv-text-success",
|
|
473
487
|
role: "status"
|
|
474
|
-
},
|
|
488
|
+
}, ze = {
|
|
475
489
|
key: 2,
|
|
476
490
|
class: "pv-flex pv-text-body-sm pv-text-critical",
|
|
477
491
|
role: "status"
|
|
478
|
-
},
|
|
492
|
+
}, Be = /* @__PURE__ */ d({
|
|
479
493
|
__name: "PvConfirmation",
|
|
480
494
|
props: {
|
|
481
495
|
approval: {},
|
|
@@ -497,37 +511,223 @@ var ee = [
|
|
|
497
511
|
approved: e
|
|
498
512
|
});
|
|
499
513
|
}
|
|
500
|
-
return (n, r) => d.value || f.value || p.value ? (
|
|
514
|
+
return (n, r) => d.value || f.value || p.value ? (w(), s("section", Fe, [d.value ? (w(), s(t, { key: 0 }, [c("div", Ie, [D(n.$slots, "default", {}, () => [l(O(e.message), 1)])]), c("div", Le, [u(J, {
|
|
501
515
|
variant: "secondary",
|
|
502
516
|
size: "md",
|
|
503
517
|
label: e.rejectLabel,
|
|
504
518
|
disabled: e.disabled,
|
|
505
519
|
onClick: r[0] ||= (e) => m(!1)
|
|
506
|
-
}, null, 8, ["label", "disabled"]), u(
|
|
520
|
+
}, null, 8, ["label", "disabled"]), u(J, {
|
|
507
521
|
size: "md",
|
|
508
522
|
label: e.approveLabel,
|
|
509
523
|
disabled: e.disabled,
|
|
510
524
|
onClick: r[1] ||= (e) => m(!0)
|
|
511
|
-
}, null, 8, ["label", "disabled"])])], 64)) : f.value ? (
|
|
525
|
+
}, null, 8, ["label", "disabled"])])], 64)) : f.value ? (w(), s("p", Re, [u(W, {
|
|
512
526
|
name: "check-circle",
|
|
513
527
|
size: 20
|
|
514
|
-
}),
|
|
528
|
+
}), D(n.$slots, "accepted", {}, () => [r[2] ||= l("You approved this tool execution.", -1)])])) : (w(), s("p", ze, [u(W, {
|
|
515
529
|
name: "close-circle",
|
|
516
530
|
size: 20
|
|
517
|
-
}),
|
|
531
|
+
}), D(n.$slots, "rejected", {}, () => [r[3] ||= l("You rejected this tool execution.", -1)])]))])) : o("", !0);
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region src/composables/useSlotPresence.ts
|
|
536
|
+
function Y(e, t) {
|
|
537
|
+
if (e.nodeType !== Node.TEXT_NODE) return !1;
|
|
538
|
+
let n = e.textContent ?? "";
|
|
539
|
+
return t ? n.length > 0 : n.trim().length > 0;
|
|
540
|
+
}
|
|
541
|
+
function Ve(e, t, n) {
|
|
542
|
+
let r = t === "default" ? "" : t, i = Array.from(e.childNodes);
|
|
543
|
+
return r === "" ? i.some((e) => e.nodeType === Node.ELEMENT_NODE ? !e.hasAttribute("slot") : Y(e, n)) : i.some((e) => e.nodeType === Node.ELEMENT_NODE ? e.getAttribute("slot") === r : !1);
|
|
544
|
+
}
|
|
545
|
+
function He(e) {
|
|
546
|
+
if (e.shadowRoot) return null;
|
|
547
|
+
let t = e._slots;
|
|
548
|
+
return !t || typeof t != "object" ? null : t;
|
|
549
|
+
}
|
|
550
|
+
function Ue(e, t, n) {
|
|
551
|
+
let r = e[t === "" ? "default" : t];
|
|
552
|
+
return r ? r.some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Y(e, n)) : !1;
|
|
553
|
+
}
|
|
554
|
+
function We(e, t) {
|
|
555
|
+
let n = e.shadowRoot;
|
|
556
|
+
return n ? t === "default" || t === "" ? n.querySelector("slot:not([name])") : n.querySelector(`slot[name="${CSS.escape(t)}"]`) : null;
|
|
557
|
+
}
|
|
558
|
+
function Ge(e, t, { useShadowSlot: n = !0, countWhitespaceTextInDefaultSlot: r = !1 } = {}) {
|
|
559
|
+
let i = n ? We(e, t) : null;
|
|
560
|
+
if (i) return i.assignedNodes({ flatten: !0 }).some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Y(e, r));
|
|
561
|
+
let a = He(e);
|
|
562
|
+
return a ? Ue(a, t, r) : Ve(e, t, r);
|
|
563
|
+
}
|
|
564
|
+
function X(e, t = {}) {
|
|
565
|
+
let { host: n, vueSlots: r, observe: a = !0, listenSlotChange: o = !0, countWhitespaceTextInDefaultSlot: s = !1 } = t, c = U(), l = r ?? N(), u = e === "default" || e === "" ? "default" : e, d = () => !!l && !!l[u], f = T(d());
|
|
566
|
+
x(() => {
|
|
567
|
+
f.value = d();
|
|
568
|
+
});
|
|
569
|
+
let p = T(!1), m = null, h = null, g = () => {
|
|
570
|
+
m &&= (m.disconnect(), null), h &&= (h.removeEventListener("slotchange", _), null);
|
|
571
|
+
}, _ = () => {
|
|
572
|
+
if (!c.value) {
|
|
573
|
+
p.value = !1;
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
let t = A(n);
|
|
577
|
+
if (!t) {
|
|
578
|
+
p.value = !1;
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
p.value = Ge(t, e, {
|
|
582
|
+
useShadowSlot: o,
|
|
583
|
+
countWhitespaceTextInDefaultSlot: s
|
|
584
|
+
});
|
|
585
|
+
}, v = () => {
|
|
586
|
+
if (!c.value) return;
|
|
587
|
+
g();
|
|
588
|
+
let e = A(n);
|
|
589
|
+
if (!e) {
|
|
590
|
+
p.value = !1;
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
_(), o && (h = e.shadowRoot, h?.addEventListener("slotchange", _)), a && (m = new MutationObserver(() => _()), m.observe(e, {
|
|
594
|
+
childList: !0,
|
|
595
|
+
subtree: !1,
|
|
596
|
+
attributes: !0,
|
|
597
|
+
attributeFilter: ["slot"],
|
|
598
|
+
characterData: !0
|
|
599
|
+
}));
|
|
600
|
+
};
|
|
601
|
+
return S(v), b(g), R(() => A(n), () => {
|
|
602
|
+
c.value && v();
|
|
603
|
+
}), {
|
|
604
|
+
present: i(() => c.value ? p.value : f.value),
|
|
605
|
+
hasVueSlot: f,
|
|
606
|
+
hasNativeSlot: p,
|
|
607
|
+
refresh: _
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region src/components/base/PvTooltip/PvTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
612
|
+
var Ke = [
|
|
613
|
+
"data-position",
|
|
614
|
+
"data-style",
|
|
615
|
+
"data-static",
|
|
616
|
+
"aria-labelledby"
|
|
617
|
+
], qe = ["id"], Je = /* @__PURE__ */ d({
|
|
618
|
+
__name: "PvTooltip",
|
|
619
|
+
props: {
|
|
620
|
+
variant: { default: "white" },
|
|
621
|
+
tooltipPosition: { default: "top-right" },
|
|
622
|
+
ariaLabelledBy: { default: "ariaLabelledById" },
|
|
623
|
+
size: { default: "md" },
|
|
624
|
+
disableInteractive: {
|
|
625
|
+
type: Boolean,
|
|
626
|
+
default: !1
|
|
627
|
+
},
|
|
628
|
+
delay: { default: 0 }
|
|
629
|
+
},
|
|
630
|
+
setup(e) {
|
|
631
|
+
let t = e, n = P("rootRef"), { present: r } = X("tooltip-content", { host: i(() => {
|
|
632
|
+
let e = n.value?.getRootNode();
|
|
633
|
+
return e instanceof ShadowRoot ? e.host : null;
|
|
634
|
+
}) }), a = i(() => t.delay > 0), c = T(!1), l = T(!1), u, d = () => {
|
|
635
|
+
u && clearTimeout(u), u = void 0;
|
|
636
|
+
}, f = i(() => !a.value || c.value || l.value), p = () => {
|
|
637
|
+
a.value && (d(), u = setTimeout(() => {
|
|
638
|
+
u = void 0, l.value = !0;
|
|
639
|
+
}, t.delay));
|
|
640
|
+
}, m = () => {
|
|
641
|
+
a.value && (d(), l.value = !1);
|
|
642
|
+
}, h = () => {
|
|
643
|
+
a.value && (c.value = !0);
|
|
644
|
+
}, g = () => {
|
|
645
|
+
a.value && (c.value = !1);
|
|
646
|
+
};
|
|
647
|
+
return b(d), (t, i) => (w(), s("div", {
|
|
648
|
+
ref_key: "rootRef",
|
|
649
|
+
ref: n,
|
|
650
|
+
"data-testid": "pv-tooltip",
|
|
651
|
+
class: _([{
|
|
652
|
+
"pv-tooltip": A(r),
|
|
653
|
+
"pv-tooltip-small": A(r) && e.size === "sm"
|
|
654
|
+
}]),
|
|
655
|
+
"data-position": e.tooltipPosition,
|
|
656
|
+
"data-style": e.variant === "white" ? "white" : "dark",
|
|
657
|
+
"data-static": e.disableInteractive ? !0 : void 0,
|
|
658
|
+
"aria-labelledby": A(r) ? e.ariaLabelledBy : void 0,
|
|
659
|
+
onMouseenter: p,
|
|
660
|
+
onMouseleave: m,
|
|
661
|
+
onFocusin: h,
|
|
662
|
+
onFocusout: g
|
|
663
|
+
}, [D(t.$slots, "label"), A(r) ? B((w(), s("div", {
|
|
664
|
+
key: 0,
|
|
665
|
+
role: "tooltip",
|
|
666
|
+
id: e.ariaLabelledBy,
|
|
667
|
+
"data-testid": "pv-tooltip-content"
|
|
668
|
+
}, [D(t.$slots, "tooltip-content")], 8, qe)), [[L, f.value]]) : o("", !0)], 42, Ke));
|
|
669
|
+
}
|
|
670
|
+
}), Ye = { class: "pv-text-body-sm" }, Xe = /* @__PURE__ */ d({
|
|
671
|
+
__name: "PvButtonWithTooltip",
|
|
672
|
+
props: {
|
|
673
|
+
tooltipText: {},
|
|
674
|
+
tooltipVariant: { default: "dark" },
|
|
675
|
+
tooltipPosition: {},
|
|
676
|
+
delay: { default: 500 },
|
|
677
|
+
variant: {},
|
|
678
|
+
disabled: { type: Boolean },
|
|
679
|
+
size: {},
|
|
680
|
+
loading: { type: Boolean },
|
|
681
|
+
label: {},
|
|
682
|
+
leftIcon: {},
|
|
683
|
+
rightIcon: {},
|
|
684
|
+
inverse: { type: Boolean },
|
|
685
|
+
leftCounterBadge: {},
|
|
686
|
+
rightCounterBadge: {},
|
|
687
|
+
ariaLabel: {}
|
|
688
|
+
},
|
|
689
|
+
setup(e) {
|
|
690
|
+
let t = e, n = i(() => t.size === "md" ? "sm" : "md"), r = i(() => ({
|
|
691
|
+
variant: t.variant,
|
|
692
|
+
disabled: t.disabled,
|
|
693
|
+
size: t.size,
|
|
694
|
+
loading: t.loading,
|
|
695
|
+
label: t.label,
|
|
696
|
+
leftIcon: t.leftIcon,
|
|
697
|
+
rightIcon: t.rightIcon,
|
|
698
|
+
inverse: t.inverse,
|
|
699
|
+
leftCounterBadge: t.leftCounterBadge,
|
|
700
|
+
rightCounterBadge: t.rightCounterBadge,
|
|
701
|
+
ariaLabel: t.ariaLabel
|
|
702
|
+
}));
|
|
703
|
+
return (t, i) => (w(), a(Je, {
|
|
704
|
+
variant: e.tooltipVariant,
|
|
705
|
+
"tooltip-position": e.tooltipPosition,
|
|
706
|
+
delay: e.delay,
|
|
707
|
+
size: n.value
|
|
708
|
+
}, {
|
|
709
|
+
"tooltip-content": z(() => [c("p", Ye, O(e.tooltipText), 1)]),
|
|
710
|
+
label: z(() => [u(J, v(p(r.value)), null, 16)]),
|
|
711
|
+
_: 1
|
|
712
|
+
}, 8, [
|
|
713
|
+
"variant",
|
|
714
|
+
"tooltip-position",
|
|
715
|
+
"delay",
|
|
716
|
+
"size"
|
|
717
|
+
]));
|
|
518
718
|
}
|
|
519
|
-
}),
|
|
719
|
+
}), Ze = {
|
|
520
720
|
class: "pv-flex-vertical",
|
|
521
721
|
style: { "--flex-align": "flex-start" }
|
|
522
|
-
},
|
|
722
|
+
}, Qe = ["for"], $e = [
|
|
523
723
|
"rows",
|
|
524
724
|
"disabled",
|
|
525
725
|
"placeholder",
|
|
526
726
|
"id",
|
|
527
727
|
"data-invalid"
|
|
528
|
-
],
|
|
728
|
+
], et = /* @__PURE__ */ d({
|
|
529
729
|
__name: "PvTextArea",
|
|
530
|
-
props: /* @__PURE__ */
|
|
730
|
+
props: /* @__PURE__ */ m({
|
|
531
731
|
error: { type: Boolean },
|
|
532
732
|
disabled: { type: Boolean },
|
|
533
733
|
placeholder: {},
|
|
@@ -541,14 +741,14 @@ var ee = [
|
|
|
541
741
|
}),
|
|
542
742
|
emits: ["update:modelValue"],
|
|
543
743
|
setup(e) {
|
|
544
|
-
let t =
|
|
545
|
-
return (n, r) => (
|
|
546
|
-
n.$slots.label ? (
|
|
744
|
+
let t = M(e, "modelValue");
|
|
745
|
+
return (n, r) => (w(), s("div", Ze, [
|
|
746
|
+
n.$slots.label ? (w(), s("label", {
|
|
547
747
|
key: 0,
|
|
548
748
|
class: "pv-label",
|
|
549
749
|
for: e.id
|
|
550
|
-
}, [
|
|
551
|
-
|
|
750
|
+
}, [D(n.$slots, "label")], 8, Qe)) : o("", !0),
|
|
751
|
+
B(c("textarea", h(n.$attrs, {
|
|
552
752
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
553
753
|
class: ["pv-textarea", { "pv-surface-accent": e.variant === "grey" }],
|
|
554
754
|
rows: e.rows,
|
|
@@ -556,78 +756,96 @@ var ee = [
|
|
|
556
756
|
placeholder: e.placeholder,
|
|
557
757
|
id: e.id,
|
|
558
758
|
"data-invalid": e.error ? !0 : void 0
|
|
559
|
-
}), null, 16,
|
|
560
|
-
e.lowerLabel ? (
|
|
759
|
+
}), null, 16, $e), [[I, t.value]]),
|
|
760
|
+
e.lowerLabel ? (w(), s("p", {
|
|
561
761
|
key: 1,
|
|
562
762
|
style: { "margin-left": "12px" },
|
|
563
|
-
class:
|
|
763
|
+
class: _(["pv-text-body-xs", {
|
|
564
764
|
"pv-text-red": e.error,
|
|
565
765
|
"pv-text-subdued": !e.error
|
|
566
766
|
}])
|
|
567
|
-
},
|
|
767
|
+
}, O(e.lowerLabel), 3)) : o("", !0)
|
|
568
768
|
]));
|
|
569
769
|
}
|
|
570
|
-
}),
|
|
770
|
+
}), tt = ["aria-busy"], nt = {
|
|
571
771
|
key: 0,
|
|
572
772
|
class: "pv-full-width pv-flow-8"
|
|
573
|
-
},
|
|
773
|
+
}, rt = { class: "pv-prompt-input-footer pv-flex pv-full-width" }, it = { class: "pv-prompt-input-actions pv-flex pv-flex-item" }, at = {
|
|
574
774
|
class: "pv-visually-hidden",
|
|
575
775
|
"aria-live": "polite"
|
|
576
|
-
},
|
|
776
|
+
}, ot = /* @__PURE__ */ d({
|
|
577
777
|
__name: "PvPromptInput",
|
|
578
|
-
props: /* @__PURE__ */
|
|
778
|
+
props: /* @__PURE__ */ m({
|
|
579
779
|
ariaLabel: { default: "Message" },
|
|
580
780
|
disabled: {
|
|
581
781
|
type: Boolean,
|
|
582
782
|
default: !1
|
|
583
783
|
},
|
|
784
|
+
ignoreModifiedEnter: {
|
|
785
|
+
type: Boolean,
|
|
786
|
+
default: !1
|
|
787
|
+
},
|
|
584
788
|
maxHeight: { default: "200px" },
|
|
585
789
|
maxLength: {},
|
|
586
790
|
placeholder: { default: "Ask anything..." },
|
|
791
|
+
roundedButton: {
|
|
792
|
+
type: Boolean,
|
|
793
|
+
default: !1
|
|
794
|
+
},
|
|
587
795
|
rows: { default: 1 },
|
|
588
796
|
status: { default: "ready" },
|
|
589
797
|
stopLabel: { default: "Stop generating" },
|
|
590
|
-
|
|
798
|
+
stopTooltip: {},
|
|
799
|
+
submitIcon: { default: "send" },
|
|
800
|
+
submitLabel: { default: "Send message" },
|
|
801
|
+
submitPending: {
|
|
802
|
+
type: Boolean,
|
|
803
|
+
default: !1
|
|
804
|
+
},
|
|
805
|
+
submitPendingLabel: {}
|
|
591
806
|
}, {
|
|
592
807
|
modelValue: { default: "" },
|
|
593
808
|
modelModifiers: {}
|
|
594
809
|
}),
|
|
595
|
-
emits: /* @__PURE__ */
|
|
810
|
+
emits: /* @__PURE__ */ m(["submit", "stop"], ["update:modelValue"]),
|
|
596
811
|
setup(e, { expose: n, emit: r }) {
|
|
597
|
-
let
|
|
598
|
-
function
|
|
599
|
-
|
|
812
|
+
let d = e, f = r, p = M(e, "modelValue"), m = T(), h = i(() => d.status === "submitted" || d.status === "streaming"), g = i(() => d.submitPending && !h.value), _ = i(() => !d.disabled && !h.value && !d.submitPending && p.value.trim().length > 0), v = i(() => h.value ? d.stopTooltip : g.value ? d.submitPendingLabel : void 0), b = i(() => d.roundedButton ? { "--button-radius": "999px" } : void 0);
|
|
813
|
+
function x() {
|
|
814
|
+
_.value && f("submit", p.value.trim());
|
|
600
815
|
}
|
|
601
|
-
function
|
|
602
|
-
|
|
816
|
+
function S() {
|
|
817
|
+
m.value?.querySelector("textarea")?.focus();
|
|
603
818
|
}
|
|
604
|
-
function
|
|
605
|
-
|
|
819
|
+
function C(e) {
|
|
820
|
+
d.disabled || e.target?.closest("button, a, input, textarea, select, [tabindex]") || S();
|
|
606
821
|
}
|
|
607
|
-
function
|
|
608
|
-
e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), e.stopPropagation(),
|
|
822
|
+
function E(e) {
|
|
823
|
+
e.key !== "Enter" || e.shiftKey || e.isComposing || d.ignoreModifiedEnter && (e.ctrlKey || e.metaKey || e.altKey) || (e.preventDefault(), e.stopPropagation(), x());
|
|
609
824
|
}
|
|
610
|
-
return n({ focus:
|
|
825
|
+
return n({ focus: S }), (n, r) => (w(), s("form", {
|
|
611
826
|
ref_key: "formRef",
|
|
612
|
-
ref:
|
|
827
|
+
ref: m,
|
|
613
828
|
class: "pv-prompt-input pv-bordered pv-radius pv-inset-square-8 pv-flex-vertical",
|
|
614
829
|
"data-testid": "pv-prompt-input",
|
|
615
|
-
"aria-busy":
|
|
616
|
-
onSubmit:
|
|
617
|
-
onClick:
|
|
830
|
+
"aria-busy": h.value,
|
|
831
|
+
onSubmit: V(x, ["prevent"]),
|
|
832
|
+
onClick: C
|
|
618
833
|
}, [
|
|
619
|
-
n.$slots.header ? (
|
|
620
|
-
u(
|
|
621
|
-
modelValue:
|
|
622
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
834
|
+
n.$slots.header ? (w(), s("div", nt, [D(n.$slots, "header")])) : o("", !0),
|
|
835
|
+
u(et, {
|
|
836
|
+
modelValue: p.value,
|
|
837
|
+
"onUpdate:modelValue": r[0] ||= (e) => p.value = e,
|
|
623
838
|
class: "pv-prompt-input-textarea",
|
|
624
|
-
style:
|
|
839
|
+
style: y({
|
|
840
|
+
"--prompt-input-max-height": e.maxHeight,
|
|
841
|
+
"--prompt-input-rows": e.rows
|
|
842
|
+
}),
|
|
625
843
|
rows: e.rows,
|
|
626
844
|
maxlength: e.maxLength,
|
|
627
845
|
placeholder: e.placeholder,
|
|
628
846
|
disabled: e.disabled,
|
|
629
847
|
"aria-label": e.ariaLabel,
|
|
630
|
-
onKeydown:
|
|
848
|
+
onKeydown: E
|
|
631
849
|
}, null, 8, [
|
|
632
850
|
"modelValue",
|
|
633
851
|
"style",
|
|
@@ -637,32 +855,57 @@ var ee = [
|
|
|
637
855
|
"disabled",
|
|
638
856
|
"aria-label"
|
|
639
857
|
]),
|
|
640
|
-
c("div",
|
|
641
|
-
|
|
642
|
-
|
|
858
|
+
c("div", rt, [c("div", it, [D(n.$slots, "actions")]), v.value ? (w(), a(Xe, {
|
|
859
|
+
key: 0,
|
|
860
|
+
"tooltip-text": v.value,
|
|
861
|
+
delay: 0,
|
|
862
|
+
variant: h.value ? "secondary" : "primary",
|
|
643
863
|
size: "md",
|
|
644
|
-
"left-icon":
|
|
645
|
-
"aria-label":
|
|
646
|
-
disabled: e.disabled || !
|
|
647
|
-
|
|
864
|
+
"left-icon": h.value ? "stop" : e.submitIcon,
|
|
865
|
+
"aria-label": h.value ? e.stopLabel : e.submitLabel,
|
|
866
|
+
disabled: e.disabled || !h.value && !_.value,
|
|
867
|
+
loading: g.value,
|
|
868
|
+
style: y(b.value),
|
|
869
|
+
onClick: r[1] ||= (e) => h.value && f("stop")
|
|
870
|
+
}, null, 8, [
|
|
871
|
+
"tooltip-text",
|
|
872
|
+
"variant",
|
|
873
|
+
"left-icon",
|
|
874
|
+
"aria-label",
|
|
875
|
+
"disabled",
|
|
876
|
+
"loading",
|
|
877
|
+
"style"
|
|
878
|
+
])) : (w(), a(J, {
|
|
879
|
+
key: 1,
|
|
880
|
+
type: h.value ? "button" : "submit",
|
|
881
|
+
variant: h.value ? "secondary" : "primary",
|
|
882
|
+
size: "md",
|
|
883
|
+
"left-icon": h.value ? "stop" : e.submitIcon,
|
|
884
|
+
"aria-label": h.value ? e.stopLabel : e.submitLabel,
|
|
885
|
+
disabled: e.disabled || !h.value && !_.value,
|
|
886
|
+
loading: g.value,
|
|
887
|
+
style: y(b.value),
|
|
888
|
+
onClick: r[2] ||= (e) => h.value && f("stop")
|
|
648
889
|
}, null, 8, [
|
|
649
890
|
"type",
|
|
650
891
|
"variant",
|
|
651
892
|
"left-icon",
|
|
652
893
|
"aria-label",
|
|
653
|
-
"disabled"
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
894
|
+
"disabled",
|
|
895
|
+
"loading",
|
|
896
|
+
"style"
|
|
897
|
+
]))]),
|
|
898
|
+
c("p", at, [e.status === "submitted" ? (w(), s(t, { key: 0 }, [l("Message submitted.")], 64)) : e.status === "streaming" ? (w(), s(t, { key: 1 }, [l("Response is streaming.")], 64)) : e.status === "error" ? (w(), s(t, { key: 2 }, [l("The message could not be sent.")], 64)) : o("", !0)])
|
|
899
|
+
], 40, tt));
|
|
657
900
|
}
|
|
658
|
-
}),
|
|
901
|
+
}), st = [
|
|
659
902
|
"ready",
|
|
660
903
|
"submitted",
|
|
661
904
|
"streaming",
|
|
662
905
|
"error"
|
|
663
|
-
],
|
|
906
|
+
], ct = ["open"], Z = /* @__PURE__ */ G(/* @__PURE__ */ d({
|
|
664
907
|
__name: "PvAccordion",
|
|
665
|
-
props: /* @__PURE__ */
|
|
908
|
+
props: /* @__PURE__ */ m({
|
|
666
909
|
chevronPosition: { default: "right" },
|
|
667
910
|
chevronVariant: { default: "vertical" },
|
|
668
911
|
defaultOpen: { type: Boolean },
|
|
@@ -688,148 +931,69 @@ var ee = [
|
|
|
688
931
|
modelValue: { type: Boolean },
|
|
689
932
|
modelModifiers: {}
|
|
690
933
|
}),
|
|
691
|
-
emits: /* @__PURE__ */
|
|
934
|
+
emits: /* @__PURE__ */ m([
|
|
692
935
|
"summary-mouseenter",
|
|
693
936
|
"summary-mouseleave",
|
|
694
937
|
"summary-click"
|
|
695
938
|
], ["update:modelValue"]),
|
|
696
939
|
setup(e, { emit: n }) {
|
|
697
|
-
let r = e, l =
|
|
940
|
+
let r = e, l = M(e, "modelValue"), u = n;
|
|
698
941
|
r.defaultOpen !== void 0 && (l.value = r.defaultOpen);
|
|
699
942
|
let d = (e) => {
|
|
700
943
|
l.value = e.target.open;
|
|
701
944
|
}, f = (e) => {
|
|
702
945
|
e.detail !== 0 && (e.target?.closest("[data-pv-accordion-chevron]") || e.defaultPrevented || (e.preventDefault(), u("summary-click", e)));
|
|
703
|
-
}, p = i(() => r.toggleOnChevronOnly ? { click: f } : {}),
|
|
704
|
-
return (n, r) => (
|
|
946
|
+
}, p = i(() => r.toggleOnChevronOnly ? { click: f } : {}), m = { width: r.enableTriggerFullWidth ? "100%" : "fit-content" }, g = i(() => r.chevronVariant === "horizontal" ? r.chevronPosition === "left" ? l.value ? "chevron-down" : "chevron-right" : l.value ? "chevron-down" : "chevron-left" : l.value ? "chevron-up" : "chevron-down");
|
|
947
|
+
return (n, r) => (w(), s("details", {
|
|
705
948
|
"data-testid": "pv-accordion",
|
|
706
949
|
class: "pv-accordion",
|
|
707
950
|
open: l.value,
|
|
708
951
|
onToggle: d
|
|
709
|
-
}, [c("summary",
|
|
952
|
+
}, [c("summary", h(e.summaryAttrs, {
|
|
710
953
|
class: ["pv-flex pv-space-between pv-relative", e.summaryClasses],
|
|
711
954
|
style: {
|
|
712
|
-
...
|
|
955
|
+
...m,
|
|
713
956
|
...e.summaryStyles
|
|
714
957
|
},
|
|
715
958
|
onMouseenter: r[0] ||= (e) => n.$emit("summary-mouseenter"),
|
|
716
959
|
onMouseleave: r[1] ||= (e) => n.$emit("summary-mouseleave")
|
|
717
|
-
},
|
|
718
|
-
|
|
719
|
-
e.chevronPosition === "left" ? (
|
|
960
|
+
}, k(p.value, !0)), [
|
|
961
|
+
D(n.$slots, "leading", {}, void 0, !0),
|
|
962
|
+
e.chevronPosition === "left" ? (w(), a(W, {
|
|
720
963
|
key: 0,
|
|
721
964
|
name: g.value,
|
|
722
965
|
"data-pv-accordion-chevron": ""
|
|
723
966
|
}, null, 8, ["name"])) : o("", !0),
|
|
724
|
-
e.enableTriggerSlot ?
|
|
967
|
+
e.enableTriggerSlot ? D(n.$slots, "trigger", { key: 1 }, void 0, !0) : (w(), s(t, { key: 2 }, [c("span", null, O(e.header), 1), e.counter ? (w(), a(K, {
|
|
725
968
|
key: 0,
|
|
726
969
|
value: e.counter,
|
|
727
970
|
variant: "secondary",
|
|
728
971
|
size: "sm"
|
|
729
972
|
}, null, 8, ["value"])) : o("", !0)], 64)),
|
|
730
|
-
e.chevronPosition === "right" ? (
|
|
973
|
+
e.chevronPosition === "right" ? (w(), a(W, {
|
|
731
974
|
key: 3,
|
|
732
975
|
name: g.value,
|
|
733
976
|
"data-pv-accordion-chevron": ""
|
|
734
977
|
}, null, 8, ["name"])) : o("", !0)
|
|
735
|
-
], 16), c("div", { style:
|
|
978
|
+
], 16), c("div", { style: y(e.contentStyles) }, [D(n.$slots, "default", {}, void 0, !0)], 4)], 40, ct));
|
|
736
979
|
}
|
|
737
|
-
}), [["__scopeId", "data-v-dfa0b416"]])
|
|
738
|
-
//#endregion
|
|
739
|
-
//#region src/composables/useSlotPresence.ts
|
|
740
|
-
function Z(e, t) {
|
|
741
|
-
if (e.nodeType !== Node.TEXT_NODE) return !1;
|
|
742
|
-
let n = e.textContent ?? "";
|
|
743
|
-
return t ? n.length > 0 : n.trim().length > 0;
|
|
744
|
-
}
|
|
745
|
-
function We(e, t, n) {
|
|
746
|
-
let r = t === "default" ? "" : t, i = Array.from(e.childNodes);
|
|
747
|
-
return r === "" ? i.some((e) => e.nodeType === Node.ELEMENT_NODE ? !e.hasAttribute("slot") : Z(e, n)) : i.some((e) => e.nodeType === Node.ELEMENT_NODE ? e.getAttribute("slot") === r : !1);
|
|
748
|
-
}
|
|
749
|
-
function Ge(e) {
|
|
750
|
-
if (e.shadowRoot) return null;
|
|
751
|
-
let t = e._slots;
|
|
752
|
-
return !t || typeof t != "object" ? null : t;
|
|
753
|
-
}
|
|
754
|
-
function Ke(e, t, n) {
|
|
755
|
-
let r = e[t === "" ? "default" : t];
|
|
756
|
-
return r ? r.some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Z(e, n)) : !1;
|
|
757
|
-
}
|
|
758
|
-
function qe(e, t) {
|
|
759
|
-
let n = e.shadowRoot;
|
|
760
|
-
return n ? t === "default" || t === "" ? n.querySelector("slot:not([name])") : n.querySelector(`slot[name="${CSS.escape(t)}"]`) : null;
|
|
761
|
-
}
|
|
762
|
-
function Je(e, t, { useShadowSlot: n = !0, countWhitespaceTextInDefaultSlot: r = !1 } = {}) {
|
|
763
|
-
let i = n ? qe(e, t) : null;
|
|
764
|
-
if (i) return i.assignedNodes({ flatten: !0 }).some((e) => e.nodeType === Node.ELEMENT_NODE ? !0 : Z(e, r));
|
|
765
|
-
let a = Ge(e);
|
|
766
|
-
return a ? Ke(a, t, r) : We(e, t, r);
|
|
767
|
-
}
|
|
768
|
-
function Ye(e, t = {}) {
|
|
769
|
-
let { host: n, vueSlots: r, observe: a = !0, listenSlotChange: o = !0, countWhitespaceTextInDefaultSlot: s = !1 } = t, c = U(), l = r ?? j(), u = e === "default" || e === "" ? "default" : e, d = () => !!l && !!l[u], f = C(d());
|
|
770
|
-
y(() => {
|
|
771
|
-
f.value = d();
|
|
772
|
-
});
|
|
773
|
-
let p = C(!1), m = null, h = null, g = () => {
|
|
774
|
-
m &&= (m.disconnect(), null), h &&= (h.removeEventListener("slotchange", _), null);
|
|
775
|
-
}, _ = () => {
|
|
776
|
-
if (!c.value) {
|
|
777
|
-
p.value = !1;
|
|
778
|
-
return;
|
|
779
|
-
}
|
|
780
|
-
let t = O(n);
|
|
781
|
-
if (!t) {
|
|
782
|
-
p.value = !1;
|
|
783
|
-
return;
|
|
784
|
-
}
|
|
785
|
-
p.value = Je(t, e, {
|
|
786
|
-
useShadowSlot: o,
|
|
787
|
-
countWhitespaceTextInDefaultSlot: s
|
|
788
|
-
});
|
|
789
|
-
}, x = () => {
|
|
790
|
-
if (!c.value) return;
|
|
791
|
-
g();
|
|
792
|
-
let e = O(n);
|
|
793
|
-
if (!e) {
|
|
794
|
-
p.value = !1;
|
|
795
|
-
return;
|
|
796
|
-
}
|
|
797
|
-
_(), o && (h = e.shadowRoot, h?.addEventListener("slotchange", _)), a && (m = new MutationObserver(() => _()), m.observe(e, {
|
|
798
|
-
childList: !0,
|
|
799
|
-
subtree: !1,
|
|
800
|
-
attributes: !0,
|
|
801
|
-
attributeFilter: ["slot"],
|
|
802
|
-
characterData: !0
|
|
803
|
-
}));
|
|
804
|
-
};
|
|
805
|
-
return b(x), v(g), P(() => O(n), () => {
|
|
806
|
-
c.value && x();
|
|
807
|
-
}), {
|
|
808
|
-
present: i(() => c.value ? p.value : f.value),
|
|
809
|
-
hasVueSlot: f,
|
|
810
|
-
hasNativeSlot: p,
|
|
811
|
-
refresh: _
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
//#endregion
|
|
815
|
-
//#region src/components/ai/PvStepList/PvStepList.vue?vue&type=script&setup=true&lang.ts
|
|
816
|
-
var Xe = ["data-status"], Ze = {
|
|
980
|
+
}), [["__scopeId", "data-v-dfa0b416"]]), lt = ["data-status"], ut = {
|
|
817
981
|
key: 0,
|
|
818
982
|
class: "pv-step-marker",
|
|
819
983
|
"aria-hidden": "true"
|
|
820
|
-
},
|
|
984
|
+
}, dt = {
|
|
821
985
|
key: 1,
|
|
822
986
|
class: "pv-step-dot"
|
|
823
|
-
},
|
|
987
|
+
}, ft = { class: "pv-step-body pv-flow-8" }, pt = {
|
|
824
988
|
key: 0,
|
|
825
989
|
class: "pv-step-aside pv-text-body-md pv-text-tertiary"
|
|
826
|
-
},
|
|
990
|
+
}, mt = {
|
|
827
991
|
key: 0,
|
|
828
992
|
class: "pv-tag-highlight"
|
|
829
|
-
},
|
|
993
|
+
}, ht = {
|
|
830
994
|
key: 0,
|
|
831
995
|
class: "pv-text-body-md pv-text-tertiary"
|
|
832
|
-
},
|
|
996
|
+
}, gt = {
|
|
833
997
|
key: 1,
|
|
834
998
|
class: "pv-flex",
|
|
835
999
|
role: "list",
|
|
@@ -837,7 +1001,7 @@ var Xe = ["data-status"], Ze = {
|
|
|
837
1001
|
"--flex-wrap": "wrap",
|
|
838
1002
|
"--flex-gap": "4px"
|
|
839
1003
|
}
|
|
840
|
-
},
|
|
1004
|
+
}, _t = {
|
|
841
1005
|
key: 2,
|
|
842
1006
|
class: "pv-text-body-md pv-text-medium pv-text-brand"
|
|
843
1007
|
}, Q = /* @__PURE__ */ d({
|
|
@@ -860,46 +1024,46 @@ var Xe = ["data-status"], Ze = {
|
|
|
860
1024
|
function d(e, t) {
|
|
861
1025
|
return u(e, t) === "active" ? "pv-text-medium pv-text-default" : "pv-text-quaternary";
|
|
862
1026
|
}
|
|
863
|
-
return (n, i) => (
|
|
1027
|
+
return (n, i) => (w(), a(r, {
|
|
864
1028
|
tag: "ol",
|
|
865
1029
|
name: "pv-step",
|
|
866
1030
|
class: "pv-step-list",
|
|
867
1031
|
role: "list"
|
|
868
1032
|
}, {
|
|
869
|
-
default:
|
|
1033
|
+
default: z(() => [(w(!0), s(t, null, E(e.steps, (e, n) => (w(), s("li", {
|
|
870
1034
|
key: e.id ?? n,
|
|
871
1035
|
class: "pv-step",
|
|
872
1036
|
"data-status": u(e, n)
|
|
873
|
-
}, [e.variant === "aside" ? o("", !0) : (
|
|
1037
|
+
}, [e.variant === "aside" ? o("", !0) : (w(), s("span", ut, [e.icon ? (w(), a(W, {
|
|
874
1038
|
key: 0,
|
|
875
1039
|
name: e.icon,
|
|
876
1040
|
size: 12
|
|
877
|
-
}, null, 8, ["name"])) : (
|
|
1041
|
+
}, null, 8, ["name"])) : (w(), s("span", dt))])), c("div", ft, [e.variant === "aside" ? (w(), s("p", pt, [c("em", null, O(e.label), 1)])) : (w(), s(t, { key: 1 }, [
|
|
878
1042
|
c("p", {
|
|
879
|
-
class:
|
|
1043
|
+
class: _(["pv-flex pv-text-body-md", d(e, n)]),
|
|
880
1044
|
style: { "--flex-wrap": "wrap" }
|
|
881
|
-
}, [c("span", { class:
|
|
882
|
-
e.note ? (
|
|
883
|
-
e.tags && e.tags.length > 0 ? (
|
|
1045
|
+
}, [c("span", { class: _({ "pv-shimmer": u(e, n) === "active" }) }, O(e.label), 3), e.artifact ? (w(), s("span", mt, O(e.artifact), 1)) : o("", !0)], 2),
|
|
1046
|
+
e.note ? (w(), s("p", ht, O(e.note), 1)) : o("", !0),
|
|
1047
|
+
e.tags && e.tags.length > 0 ? (w(), s("ul", gt, [(w(!0), s(t, null, E(e.tags, (e, t) => (w(), s("li", {
|
|
884
1048
|
key: t,
|
|
885
|
-
class:
|
|
1049
|
+
class: _(["pv-tag-secondary", { "pv-text-quaternary": e.variant === "muted" }]),
|
|
886
1050
|
"data-style": "rounded"
|
|
887
|
-
},
|
|
888
|
-
e.outcome ? (
|
|
889
|
-
], 64))])], 8,
|
|
1051
|
+
}, O(e.label), 3))), 128))])) : o("", !0),
|
|
1052
|
+
e.outcome ? (w(), s("p", _t, " →\xA0" + O(e.outcome), 1)) : o("", !0)
|
|
1053
|
+
], 64))])], 8, lt))), 128))]),
|
|
890
1054
|
_: 1
|
|
891
1055
|
}));
|
|
892
1056
|
}
|
|
893
|
-
}),
|
|
1057
|
+
}), vt = {
|
|
894
1058
|
class: "pv-reasoning-trigger pv-flex pv-text-body-md pv-text-medium",
|
|
895
1059
|
"aria-live": "polite"
|
|
896
|
-
},
|
|
1060
|
+
}, yt = { class: "pv-reasoning-content pv-text-body-md pv-text-tertiary" }, $ = {
|
|
897
1061
|
key: 1,
|
|
898
1062
|
class: "pv-reasoning-trigger pv-reasoning-standalone pv-flex pv-text-body-md pv-text-medium pv-text-tertiary",
|
|
899
1063
|
"aria-live": "polite"
|
|
900
|
-
},
|
|
1064
|
+
}, bt = /* @__PURE__ */ d({
|
|
901
1065
|
__name: "PvReasoning",
|
|
902
|
-
props: /* @__PURE__ */
|
|
1066
|
+
props: /* @__PURE__ */ m({
|
|
903
1067
|
autoCloseDelay: { default: 1e3 },
|
|
904
1068
|
completedLabel: { default: "Reasoning" },
|
|
905
1069
|
defaultOpen: {
|
|
@@ -922,36 +1086,36 @@ var Xe = ["data-status"], Ze = {
|
|
|
922
1086
|
}),
|
|
923
1087
|
emits: ["update:open"],
|
|
924
1088
|
setup(r) {
|
|
925
|
-
let l = r, d =
|
|
1089
|
+
let l = r, d = M(r, "open"), p = T(), m = T(), h = T(!1), g;
|
|
926
1090
|
(l.defaultOpen || l.isStreaming) && (d.value = !0), l.isStreaming && (m.value = Date.now());
|
|
927
|
-
let
|
|
1091
|
+
let v = i(() => l.duration ?? p.value), y = i(() => {
|
|
928
1092
|
if (l.isStreaming) return l.streamingLabel;
|
|
929
|
-
if (
|
|
930
|
-
let e = Math.max(1, Math.round(
|
|
1093
|
+
if (v.value === void 0) return l.completedLabel;
|
|
1094
|
+
let e = Math.max(1, Math.round(v.value));
|
|
931
1095
|
return `Thought for ${e} ${e === 1 ? "second" : "seconds"}`;
|
|
932
|
-
}), x =
|
|
933
|
-
function
|
|
934
|
-
return r.some((r) => r.type === e ? !1 : r.type === n ? String(r.children ?? "").trim().length > 0 : r.type === t ? Array.isArray(r.children) &&
|
|
1096
|
+
}), x = N(), S = f(), C = U(), E = i(() => C.value ? S?.ce : null), { hasNativeSlot: k } = X("default", { host: E });
|
|
1097
|
+
function A(r) {
|
|
1098
|
+
return r.some((r) => r.type === e ? !1 : r.type === n ? String(r.children ?? "").trim().length > 0 : r.type === t ? Array.isArray(r.children) && A(r.children) : !0);
|
|
935
1099
|
}
|
|
936
|
-
function
|
|
937
|
-
return l.steps.length > 0 || k.value ? !0 :
|
|
1100
|
+
function j() {
|
|
1101
|
+
return l.steps.length > 0 || k.value ? !0 : E.value ? !1 : A(x.default?.({}) ?? []);
|
|
938
1102
|
}
|
|
939
|
-
function
|
|
940
|
-
|
|
1103
|
+
function P() {
|
|
1104
|
+
g !== void 0 && (clearTimeout(g), g = void 0);
|
|
941
1105
|
}
|
|
942
|
-
function
|
|
1106
|
+
function F(e) {
|
|
943
1107
|
let t = e.target?.closest?.("summary");
|
|
944
|
-
!t || t.parentElement !== e.currentTarget || (h.value = !0,
|
|
1108
|
+
!t || t.parentElement !== e.currentTarget || (h.value = !0, P());
|
|
945
1109
|
}
|
|
946
|
-
return
|
|
947
|
-
if (
|
|
1110
|
+
return R(() => l.isStreaming, (e, t) => {
|
|
1111
|
+
if (P(), e) {
|
|
948
1112
|
m.value = Date.now(), p.value = void 0, h.value = !1, d.value = !0;
|
|
949
1113
|
return;
|
|
950
1114
|
}
|
|
951
|
-
t && (m.value !== void 0 && (p.value = (Date.now() - m.value) / 1e3), h.value || (
|
|
1115
|
+
t && (m.value !== void 0 && (p.value = (Date.now() - m.value) / 1e3), h.value || (g = setTimeout(() => {
|
|
952
1116
|
h.value || (d.value = !1);
|
|
953
1117
|
}, l.autoCloseDelay)));
|
|
954
|
-
}),
|
|
1118
|
+
}), b(P), (e, t) => j() ? (w(), a(Z, {
|
|
955
1119
|
key: 0,
|
|
956
1120
|
modelValue: d.value,
|
|
957
1121
|
"onUpdate:modelValue": t[0] ||= (e) => d.value = e,
|
|
@@ -963,31 +1127,31 @@ var Xe = ["data-status"], Ze = {
|
|
|
963
1127
|
"enable-trigger-slot": "",
|
|
964
1128
|
"summary-classes": { "pv-text-tertiary": !0 },
|
|
965
1129
|
"summary-styles": { justifyContent: "flex-start" },
|
|
966
|
-
onClick:
|
|
1130
|
+
onClick: F
|
|
967
1131
|
}, {
|
|
968
|
-
trigger:
|
|
969
|
-
default:
|
|
1132
|
+
trigger: z(() => [c("span", vt, [D(e.$slots, "trigger", {}, () => [u(W, { name: "brain" }), c("span", { class: _(["pv-text-subdued", { "pv-shimmer": r.isStreaming }]) }, O(y.value), 3)])])]),
|
|
1133
|
+
default: z(() => [c("div", yt, [r.steps.length > 0 ? (w(), a(Q, {
|
|
970
1134
|
key: 0,
|
|
971
1135
|
steps: r.steps,
|
|
972
1136
|
"in-progress": r.isStreaming
|
|
973
|
-
}, null, 8, ["steps", "in-progress"])) : o("", !0),
|
|
1137
|
+
}, null, 8, ["steps", "in-progress"])) : o("", !0), D(e.$slots, "default")])]),
|
|
974
1138
|
_: 3
|
|
975
|
-
}, 8, ["modelValue", "default-open"])) : (
|
|
1139
|
+
}, 8, ["modelValue", "default-open"])) : (w(), s("span", $, [D(e.$slots, "trigger", {}, () => [u(W, { name: "brain" }), c("span", { class: _(["pv-text-subdued", { "pv-shimmer": r.isStreaming }]) }, O(y.value), 3)])]));
|
|
976
1140
|
}
|
|
977
|
-
}),
|
|
1141
|
+
}), xt = { class: "pv-tool-heading pv-flex pv-flex-item" }, St = { class: "pv-text-title-sm pv-truncate" }, Ct = { class: "pv-tool-disclosure-content" }, wt = { class: "pv-flow-16 pv-border-top pv-tool-content" }, Tt = {
|
|
978
1142
|
key: 0,
|
|
979
1143
|
class: "pv-flow-8"
|
|
980
|
-
},
|
|
1144
|
+
}, Et = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, Dt = {
|
|
981
1145
|
key: 1,
|
|
982
1146
|
class: "pv-flow-8",
|
|
983
1147
|
role: "alert",
|
|
984
1148
|
"aria-label": "Tool error"
|
|
985
|
-
},
|
|
1149
|
+
}, Ot = { class: "pv-surface-critical pv-inset-square-12 pv-radius-sm pv-text-body-xs pv-text-critical" }, kt = {
|
|
986
1150
|
key: 2,
|
|
987
1151
|
class: "pv-flow-8"
|
|
988
|
-
},
|
|
1152
|
+
}, At = { class: "pv-surface-accent pv-inset-square-12 pv-radius-sm pv-text-body-xs" }, jt = /* @__PURE__ */ d({
|
|
989
1153
|
__name: "PvTool",
|
|
990
|
-
props: /* @__PURE__ */
|
|
1154
|
+
props: /* @__PURE__ */ m({
|
|
991
1155
|
defaultOpen: {
|
|
992
1156
|
type: Boolean,
|
|
993
1157
|
default: !1
|
|
@@ -1020,7 +1184,7 @@ var Xe = ["data-status"], Ze = {
|
|
|
1020
1184
|
}),
|
|
1021
1185
|
emits: ["update:open"],
|
|
1022
1186
|
setup(e) {
|
|
1023
|
-
let t = e, n =
|
|
1187
|
+
let t = e, n = M(e, "open"), r = ["output-available", "output-error"];
|
|
1024
1188
|
(t.defaultOpen || r.includes(t.state)) && (n.value = !0);
|
|
1025
1189
|
let l = i(() => ({
|
|
1026
1190
|
"input-streaming": {
|
|
@@ -1060,9 +1224,9 @@ var Xe = ["data-status"], Ze = {
|
|
|
1060
1224
|
return String(e);
|
|
1061
1225
|
}
|
|
1062
1226
|
}
|
|
1063
|
-
return
|
|
1227
|
+
return R(() => t.state, (e, t) => {
|
|
1064
1228
|
e !== t && r.includes(e) && (n.value = !0);
|
|
1065
|
-
}), (t, r) => (
|
|
1229
|
+
}), (t, r) => (w(), a(Z, {
|
|
1066
1230
|
modelValue: n.value,
|
|
1067
1231
|
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
1068
1232
|
"default-open": n.value,
|
|
@@ -1073,22 +1237,22 @@ var Xe = ["data-status"], Ze = {
|
|
|
1073
1237
|
"enable-trigger-slot": "",
|
|
1074
1238
|
"summary-classes": { "pv-inset-square-12": !0 }
|
|
1075
1239
|
}, {
|
|
1076
|
-
trigger:
|
|
1240
|
+
trigger: z(() => [c("span", xt, [
|
|
1077
1241
|
u(W, {
|
|
1078
1242
|
name: "settings",
|
|
1079
1243
|
size: 20
|
|
1080
1244
|
}),
|
|
1081
|
-
c("span",
|
|
1245
|
+
c("span", St, O(e.toolName), 1),
|
|
1082
1246
|
c("span", {
|
|
1083
|
-
class:
|
|
1247
|
+
class: _([l.value.className, "pv-tag-sm"]),
|
|
1084
1248
|
role: "status"
|
|
1085
|
-
},
|
|
1249
|
+
}, O(l.value.label), 3)
|
|
1086
1250
|
])]),
|
|
1087
|
-
default:
|
|
1251
|
+
default: z(() => [c("div", Ct, [c("div", wt, [t.$slots.input || e.input !== void 0 ? (w(), s("section", Tt, [r[1] ||= c("h3", { class: "pv-text-title-xs" }, "Parameters", -1), D(t.$slots, "input", { input: e.input }, () => [c("pre", Et, [c("code", null, O(d(e.input)), 1)])])])) : o("", !0), e.errorText ? (w(), s("section", Dt, [r[2] ||= c("h3", { class: "pv-text-title-xs pv-text-critical" }, "Error", -1), c("pre", Ot, O(e.errorText), 1)])) : t.$slots.output || e.output !== void 0 ? (w(), s("section", kt, [r[3] ||= c("h3", { class: "pv-text-title-xs" }, "Result", -1), D(t.$slots, "output", { output: e.output }, () => [c("pre", At, [c("code", null, O(d(e.output)), 1)])])])) : o("", !0)])])]),
|
|
1088
1252
|
_: 3
|
|
1089
1253
|
}, 8, ["modelValue", "default-open"]));
|
|
1090
1254
|
}
|
|
1091
|
-
}),
|
|
1255
|
+
}), Mt = [
|
|
1092
1256
|
"input-streaming",
|
|
1093
1257
|
"input-available",
|
|
1094
1258
|
"approval-requested",
|
|
@@ -1099,8 +1263,8 @@ var Xe = ["data-status"], Ze = {
|
|
|
1099
1263
|
];
|
|
1100
1264
|
//#endregion
|
|
1101
1265
|
//#region src/components/ai/useStickToBottom.ts
|
|
1102
|
-
function
|
|
1103
|
-
let n = t.threshold ?? 32, r =
|
|
1266
|
+
function Nt(e, t = {}) {
|
|
1267
|
+
let n = t.threshold ?? 32, r = T(!0);
|
|
1104
1268
|
function i() {
|
|
1105
1269
|
let t = e.value;
|
|
1106
1270
|
t && (r.value = t.scrollHeight - t.scrollTop - t.clientHeight <= n);
|
|
@@ -1131,14 +1295,14 @@ function bt(e, t = {}) {
|
|
|
1131
1295
|
e.removeEventListener("scroll", t), s.forEach((e) => e.disconnect());
|
|
1132
1296
|
};
|
|
1133
1297
|
}
|
|
1134
|
-
return
|
|
1298
|
+
return R(e, (e) => {
|
|
1135
1299
|
o?.(), o = void 0, e && s(e);
|
|
1136
|
-
}, { immediate: !0 }),
|
|
1300
|
+
}, { immediate: !0 }), C(() => o?.()), {
|
|
1137
1301
|
isAtBottom: r,
|
|
1138
1302
|
scrollToBottom: a
|
|
1139
1303
|
};
|
|
1140
1304
|
}
|
|
1141
1305
|
//#endregion
|
|
1142
|
-
export {
|
|
1306
|
+
export { Be as PvConfirmation, ot as PvPromptInput, Pe as PvQuestion, bt as PvReasoning, Q as PvStepList, jt as PvTool, st as promptInputStatuses, Mt as toolLifecycleStates, Nt as useStickToBottom };
|
|
1143
1307
|
|
|
1144
1308
|
//# sourceMappingURL=pv-components-ai.mjs.map
|