@inkeep/cxkit-primitives 0.5.10 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat-button.cjs +1 -1
- package/dist/components/chat-button.d.cts +8 -1
- package/dist/components/chat-button.d.ts +8 -1
- package/dist/components/chat-button.js +31 -28
- package/dist/components/embedded-chat.cjs +3 -3
- package/dist/components/embedded-chat.js +720 -718
- package/dist/components/embedded-search/transform-results.cjs +1 -1
- package/dist/components/embedded-search/transform-results.js +27 -26
- package/dist/components/embedded-search/use-inkeep-search.cjs +1 -1
- package/dist/components/embedded-search/use-inkeep-search.d.cts +1 -1
- package/dist/components/embedded-search/use-inkeep-search.d.ts +1 -1
- package/dist/components/embedded-search/use-inkeep-search.js +22 -18
- package/dist/components/intelligent-form.cjs +1 -1
- package/dist/components/intelligent-form.js +239 -237
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/dist/utils/default-settings.cjs +1 -1
- package/dist/utils/default-settings.d.cts +1 -2
- package/dist/utils/default-settings.d.ts +1 -2
- package/dist/utils/default-settings.js +10 -12
- package/dist/utils/transform-source/breadcrumbs.cjs +1 -1
- package/dist/utils/transform-source/breadcrumbs.js +18 -11
- package/dist/utils/transform-source/index.cjs +1 -1
- package/dist/utils/transform-source/index.js +22 -19
- package/package.json +4 -4
- package/dist/utils/transform-source/index.d.cts +0 -2
- package/dist/utils/transform-source/index.d.ts +0 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import { ikp as t } from "./factory.js";
|
|
4
|
-
import { forwardRef as
|
|
4
|
+
import { forwardRef as I, useRef as h, useEffect as C } from "react";
|
|
5
5
|
import w from "react-textarea-autosize";
|
|
6
6
|
import * as u from "@radix-ui/react-select";
|
|
7
7
|
import * as R from "@radix-ui/react-checkbox";
|
|
8
8
|
import { useIntelligentForm as s } from "./intelligent-form/intelligent-form-provider.js";
|
|
9
|
-
import { IntelligentFormProvider as
|
|
9
|
+
import { IntelligentFormProvider as Hi } from "./intelligent-form/intelligent-form-provider.js";
|
|
10
10
|
import * as v from "@radix-ui/react-scroll-area";
|
|
11
11
|
import { BuiltInIconRenderer as S } from "../atoms/icons/built-in-icon-renderer.js";
|
|
12
12
|
import { maybeRender as b, dataAttr as a } from "../utils/misc.js";
|
|
@@ -17,26 +17,27 @@ import { useInkeepConfig as x } from "../providers/config-provider.js";
|
|
|
17
17
|
import { SourceItemProvider as E, useSourceItem as T } from "../providers/source-item-provider.js";
|
|
18
18
|
import { LinkWithQueryParams as D } from "../atoms/link.js";
|
|
19
19
|
import { Markdown as N } from "../atoms/markdown/index.js";
|
|
20
|
-
import { useComposedRefs as
|
|
20
|
+
import { useComposedRefs as P } from "../utils/compose-refs.js";
|
|
21
21
|
import { composeEventHandlers as F } from "../utils/compose-event-handlers.js";
|
|
22
|
-
|
|
22
|
+
import { transformInkeepSource as q } from "../utils/transform-source/index.js";
|
|
23
|
+
const M = t("form", {
|
|
23
24
|
_id: "intelligentForm__Root"
|
|
24
|
-
}),
|
|
25
|
+
}), Ve = (i) => {
|
|
25
26
|
const { onSubmit: e, ...n } = i, { handleSubmit: r } = s();
|
|
26
|
-
return /* @__PURE__ */ o(
|
|
27
|
-
},
|
|
27
|
+
return /* @__PURE__ */ o(M, { onSubmit: F(e, r), ...n });
|
|
28
|
+
}, He = t("h2", {
|
|
28
29
|
_id: "intelligentForm__Heading",
|
|
29
30
|
children: "Contact Support"
|
|
30
|
-
}),
|
|
31
|
+
}), Ee = t("div", {
|
|
31
32
|
_id: "intelligentForm__Content"
|
|
32
|
-
}),
|
|
33
|
+
}), De = t(v.Root, {
|
|
33
34
|
_id: "intelligentForm__Content__ScrollArea"
|
|
34
|
-
}),
|
|
35
|
+
}), z = t(v.Viewport, {
|
|
35
36
|
_id: "intelligentForm__Content__ScrollAreaViewport"
|
|
36
|
-
}),
|
|
37
|
+
}), Ne = (i) => {
|
|
37
38
|
const { children: e, ...n } = i;
|
|
38
39
|
return /* @__PURE__ */ o(
|
|
39
|
-
|
|
40
|
+
z,
|
|
40
41
|
{
|
|
41
42
|
children: (
|
|
42
43
|
/* added this to fix an overflow issue see https://github.com/radix-ui/primitives/issues/926 */
|
|
@@ -45,83 +46,83 @@ const q = t("form", {
|
|
|
45
46
|
...n
|
|
46
47
|
}
|
|
47
48
|
);
|
|
48
|
-
},
|
|
49
|
+
}, qe = t(
|
|
49
50
|
v.ScrollAreaScrollbar,
|
|
50
51
|
{
|
|
51
52
|
_id: "intelligentForm__Content__ScrollAreaScrollbar"
|
|
52
53
|
}
|
|
53
|
-
),
|
|
54
|
+
), Me = t(
|
|
54
55
|
v.ScrollAreaThumb,
|
|
55
56
|
{
|
|
56
57
|
_id: "intelligentForm__Content__ScrollAreaThumb"
|
|
57
58
|
}
|
|
58
|
-
),
|
|
59
|
+
), ze = t(v.Corner, {
|
|
59
60
|
_id: "intelligentForm__Content__ScrollAreaCorner"
|
|
60
|
-
}),
|
|
61
|
+
}), O = t("div", {
|
|
61
62
|
_id: "intelligentForm__Success"
|
|
62
|
-
}),
|
|
63
|
+
}), Oe = (i) => {
|
|
63
64
|
const { children: e, ...n } = i, { isSubmitSuccessful: r } = s();
|
|
64
|
-
return r ? /* @__PURE__ */ o(
|
|
65
|
-
},
|
|
65
|
+
return r ? /* @__PURE__ */ o(O, { ...n, children: e }) : null;
|
|
66
|
+
}, U = t(S, {
|
|
66
67
|
_id: "intelligentForm__SuccessIcon"
|
|
67
|
-
}),
|
|
68
|
+
}), Ue = (i) => {
|
|
68
69
|
const {
|
|
69
70
|
formSettings: { successView: e }
|
|
70
71
|
} = s();
|
|
71
72
|
return /* @__PURE__ */ o(
|
|
72
|
-
|
|
73
|
+
U,
|
|
73
74
|
{
|
|
74
75
|
iconSettings: e.icon ?? { builtIn: "LuCircleCheck" },
|
|
75
76
|
...i
|
|
76
77
|
}
|
|
77
78
|
);
|
|
78
|
-
},
|
|
79
|
+
}, j = t("h2", {
|
|
79
80
|
_id: "intelligentForm__SuccessHeading"
|
|
80
|
-
}),
|
|
81
|
+
}), je = (i) => {
|
|
81
82
|
const {
|
|
82
83
|
formSettings: { successView: e }
|
|
83
84
|
} = s();
|
|
84
|
-
return /* @__PURE__ */ o(
|
|
85
|
-
},
|
|
85
|
+
return /* @__PURE__ */ o(j, { children: e.heading, ...i });
|
|
86
|
+
}, Q = t("p", {
|
|
86
87
|
_id: "intelligentForm__SuccessMessage"
|
|
87
|
-
}),
|
|
88
|
+
}), Qe = (i) => {
|
|
88
89
|
const {
|
|
89
90
|
formSettings: { successView: e }
|
|
90
91
|
} = s();
|
|
91
|
-
return /* @__PURE__ */ o(
|
|
92
|
-
},
|
|
92
|
+
return /* @__PURE__ */ o(Q, { children: e.message, ...i });
|
|
93
|
+
}, We = t("div", {
|
|
93
94
|
_id: "intelligentForm__PrimaryForm"
|
|
94
|
-
}),
|
|
95
|
+
}), W = t("div", {
|
|
95
96
|
_id: "intelligentForm__PrimaryFormFields"
|
|
96
|
-
}),
|
|
97
|
+
}), $ = t("p", {
|
|
97
98
|
_id: "intelligentForm__PrimaryForm__Description"
|
|
98
|
-
}),
|
|
99
|
+
}), $e = (i) => {
|
|
99
100
|
const {
|
|
100
101
|
formSettings: { primary: e }
|
|
101
102
|
} = s();
|
|
102
|
-
return e.description ? /* @__PURE__ */ o(
|
|
103
|
-
},
|
|
103
|
+
return e.description ? /* @__PURE__ */ o($, { children: e.description, ...i }) : null;
|
|
104
|
+
}, Ge = (i) => {
|
|
104
105
|
const { children: e, ...n } = i, {
|
|
105
106
|
formSettings: { primary: r }
|
|
106
107
|
} = s();
|
|
107
|
-
return /* @__PURE__ */ o(
|
|
108
|
-
},
|
|
108
|
+
return /* @__PURE__ */ o(W, { children: b(e, r.fields), ...n });
|
|
109
|
+
}, G = t("button", {
|
|
109
110
|
_id: "intelligentForm__PrimaryFormSubmit",
|
|
110
111
|
type: "button",
|
|
111
112
|
children: "Next"
|
|
112
|
-
}),
|
|
113
|
+
}), Je = (i) => {
|
|
113
114
|
const { onClick: e, ...n } = i, { submittedPrimaryForm: r, handleSubmitPrimaryForm: l } = s();
|
|
114
115
|
return /* @__PURE__ */ o(
|
|
115
|
-
|
|
116
|
+
G,
|
|
116
117
|
{
|
|
117
118
|
"data-submitted": a(r),
|
|
118
119
|
onClick: F(e, l),
|
|
119
120
|
...n
|
|
120
121
|
}
|
|
121
122
|
);
|
|
122
|
-
},
|
|
123
|
+
}, J = t("div", {
|
|
123
124
|
_id: "intelligentForm__Field"
|
|
124
|
-
}),
|
|
125
|
+
}), Ke = (i) => {
|
|
125
126
|
const { field: e, autoFocus: n, ...r } = i, { control: l, errors: c } = s();
|
|
126
127
|
return /* @__PURE__ */ o(
|
|
127
128
|
L,
|
|
@@ -141,7 +142,7 @@ const q = t("form", {
|
|
|
141
142
|
fieldProps: m,
|
|
142
143
|
autoFocus: n,
|
|
143
144
|
children: d && /* @__PURE__ */ o(
|
|
144
|
-
|
|
145
|
+
J,
|
|
145
146
|
{
|
|
146
147
|
"data-input-type": e.inputType,
|
|
147
148
|
"data-hidden": a(e.isHidden),
|
|
@@ -153,12 +154,12 @@ const q = t("form", {
|
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
);
|
|
156
|
-
},
|
|
157
|
+
}, K = t("label", {
|
|
157
158
|
_id: "intelligentForm__FieldLabel"
|
|
158
|
-
}),
|
|
159
|
+
}), Xe = (i) => {
|
|
159
160
|
const { field: e } = _();
|
|
160
161
|
return /* @__PURE__ */ o(
|
|
161
|
-
|
|
162
|
+
K,
|
|
162
163
|
{
|
|
163
164
|
"data-required": a(e.isRequired),
|
|
164
165
|
htmlFor: e.name,
|
|
@@ -166,10 +167,10 @@ const q = t("form", {
|
|
|
166
167
|
...i
|
|
167
168
|
}
|
|
168
169
|
);
|
|
169
|
-
},
|
|
170
|
+
}, X = t("input", {
|
|
170
171
|
_id: "intelligentForm__FieldText",
|
|
171
172
|
type: "text"
|
|
172
|
-
}),
|
|
173
|
+
}), k = I((i, e) => {
|
|
173
174
|
const {
|
|
174
175
|
field: n,
|
|
175
176
|
error: r,
|
|
@@ -180,12 +181,12 @@ const q = t("form", {
|
|
|
180
181
|
...d
|
|
181
182
|
},
|
|
182
183
|
autoFocus: p
|
|
183
|
-
} = _(), g =
|
|
184
|
+
} = _(), g = P(
|
|
184
185
|
e,
|
|
185
186
|
m
|
|
186
187
|
);
|
|
187
188
|
return /* @__PURE__ */ o(
|
|
188
|
-
|
|
189
|
+
X,
|
|
189
190
|
{
|
|
190
191
|
asChild: n.inputType === "textarea",
|
|
191
192
|
ref: g,
|
|
@@ -200,25 +201,25 @@ const q = t("form", {
|
|
|
200
201
|
children: n.inputType === "textarea" ? /* @__PURE__ */ o(w, { minRows: 3, maxRows: 10 }) : null
|
|
201
202
|
}
|
|
202
203
|
);
|
|
203
|
-
}),
|
|
204
|
+
}), Ye = t(k, {
|
|
204
205
|
_id: "intelligentForm__FieldEmail",
|
|
205
206
|
type: "email"
|
|
206
|
-
}),
|
|
207
|
+
}), Y = t("input", {
|
|
207
208
|
_id: "intelligentForm__FieldFile",
|
|
208
209
|
type: "file",
|
|
209
210
|
multiple: !0
|
|
210
|
-
}),
|
|
211
|
+
}), Ze = (i) => {
|
|
211
212
|
const {
|
|
212
213
|
field: e,
|
|
213
214
|
error: n,
|
|
214
215
|
fieldProps: { value: r, onChange: l, onBlur: c, ...m },
|
|
215
216
|
autoFocus: d
|
|
216
|
-
} = _(), { onChange: p, onBlur: g, ...y } = i, f = (
|
|
217
|
-
const A =
|
|
217
|
+
} = _(), { onChange: p, onBlur: g, ...y } = i, f = (B) => {
|
|
218
|
+
const A = B.target.files;
|
|
218
219
|
l(A);
|
|
219
220
|
};
|
|
220
221
|
return /* @__PURE__ */ o(
|
|
221
|
-
|
|
222
|
+
Y,
|
|
222
223
|
{
|
|
223
224
|
id: e.name,
|
|
224
225
|
autoFocus: d,
|
|
@@ -230,20 +231,20 @@ const q = t("form", {
|
|
|
230
231
|
onBlur: F(g, c)
|
|
231
232
|
}
|
|
232
233
|
);
|
|
233
|
-
},
|
|
234
|
-
|
|
234
|
+
}, ei = t(
|
|
235
|
+
k,
|
|
235
236
|
{
|
|
236
237
|
_id: "intelligentForm__FieldTextArea",
|
|
237
238
|
type: "textarea",
|
|
238
239
|
asChild: !0,
|
|
239
240
|
children: /* @__PURE__ */ o(w, { rows: 1, maxRows: 8 })
|
|
240
241
|
}
|
|
241
|
-
),
|
|
242
|
+
), Z = t(R.Root, {
|
|
242
243
|
_id: "intelligentForm__FieldCheckbox"
|
|
243
|
-
}),
|
|
244
|
+
}), ii = (i) => {
|
|
244
245
|
const { field: e, error: n, fieldProps: r, autoFocus: l } = _(), { onCheckedChange: c, ...m } = i;
|
|
245
246
|
return /* @__PURE__ */ o(
|
|
246
|
-
|
|
247
|
+
Z,
|
|
247
248
|
{
|
|
248
249
|
id: e.name,
|
|
249
250
|
name: e.name,
|
|
@@ -254,15 +255,15 @@ const q = t("form", {
|
|
|
254
255
|
...m
|
|
255
256
|
}
|
|
256
257
|
);
|
|
257
|
-
},
|
|
258
|
+
}, ti = t(R.Indicator, {
|
|
258
259
|
_id: "intelligentForm__FieldCheckboxIndicator",
|
|
259
260
|
children: /* @__PURE__ */ o(H, {})
|
|
260
|
-
}),
|
|
261
|
+
}), ee = t(u.Root, {
|
|
261
262
|
_id: "intelligentForm__FieldSelect"
|
|
262
|
-
}),
|
|
263
|
+
}), ni = (i) => {
|
|
263
264
|
const { field: e, error: n, fieldProps: r } = _(), { onValueChange: l, ...c } = i;
|
|
264
265
|
return /* @__PURE__ */ o(
|
|
265
|
-
|
|
266
|
+
ee,
|
|
266
267
|
{
|
|
267
268
|
name: e.name,
|
|
268
269
|
"data-invalid": a(!!n),
|
|
@@ -271,118 +272,118 @@ const q = t("form", {
|
|
|
271
272
|
...c
|
|
272
273
|
}
|
|
273
274
|
);
|
|
274
|
-
},
|
|
275
|
+
}, ri = t(u.Trigger, {
|
|
275
276
|
_id: "intelligentForm__FieldSelect__Trigger"
|
|
276
|
-
}),
|
|
277
|
+
}), ie = t(u.Value, {
|
|
277
278
|
_id: "intelligentForm__FieldSelect__Value"
|
|
278
|
-
}),
|
|
279
|
+
}), oi = (i) => {
|
|
279
280
|
const { field: e } = _();
|
|
280
281
|
return /* @__PURE__ */ o(
|
|
281
|
-
|
|
282
|
+
ie,
|
|
282
283
|
{
|
|
283
284
|
placeholder: "placeholder" in e ? e.placeholder : void 0,
|
|
284
285
|
...i
|
|
285
286
|
}
|
|
286
287
|
);
|
|
287
|
-
},
|
|
288
|
+
}, li = t(u.Icon, {
|
|
288
289
|
_id: "intelligentForm__FieldSelect__Icon",
|
|
289
290
|
asChild: !0,
|
|
290
291
|
children: /* @__PURE__ */ o(S, { iconSettings: { builtIn: "LuChevronDown" } })
|
|
291
|
-
}),
|
|
292
|
+
}), si = t(u.Content, {
|
|
292
293
|
_id: "intelligentForm__FieldSelect__Content",
|
|
293
294
|
position: "popper"
|
|
294
|
-
}),
|
|
295
|
+
}), ci = t(u.Viewport, {
|
|
295
296
|
_id: "intelligentForm__FieldSelect__Viewport"
|
|
296
|
-
}),
|
|
297
|
+
}), mi = t(u.Item, {
|
|
297
298
|
_id: "intelligentForm__FieldSelect__Item"
|
|
298
|
-
}),
|
|
299
|
+
}), di = t(u.ItemText, {
|
|
299
300
|
_id: "intelligentForm__FieldSelect__ItemText"
|
|
300
|
-
}),
|
|
301
|
+
}), ai = t(
|
|
301
302
|
u.ItemIndicator,
|
|
302
303
|
{
|
|
303
304
|
_id: "intelligentForm__FieldSelect__ItemIndicator",
|
|
304
305
|
asChild: !0,
|
|
305
306
|
children: /* @__PURE__ */ o(S, { iconSettings: { builtIn: "LuCheck" } })
|
|
306
307
|
}
|
|
307
|
-
),
|
|
308
|
+
), te = t("span", {
|
|
308
309
|
_id: "intelligentForm__FieldError"
|
|
309
|
-
}),
|
|
310
|
+
}), Fi = (i) => {
|
|
310
311
|
const { error: e } = _();
|
|
311
|
-
return e ? /* @__PURE__ */ o(
|
|
312
|
-
},
|
|
312
|
+
return e ? /* @__PURE__ */ o(te, { children: e.message?.toString(), ...i }) : null;
|
|
313
|
+
}, ui = t("div", {
|
|
313
314
|
_id: "intelligentForm__BotHeading"
|
|
314
|
-
}),
|
|
315
|
+
}), _i = t(S, {
|
|
315
316
|
_id: "intelligentForm__BotHeading__Icon",
|
|
316
317
|
iconSettings: { builtIn: "LuSparkles" }
|
|
317
|
-
}),
|
|
318
|
+
}), ne = t("div", {
|
|
318
319
|
_id: "intelligentForm__BotHeading__Name"
|
|
319
|
-
}),
|
|
320
|
+
}), gi = (i) => {
|
|
320
321
|
const { baseSettings: e } = x(), { organizationDisplayName: n } = e ?? {}, {
|
|
321
322
|
formSettings: { aiAssistantName: r }
|
|
322
323
|
} = s();
|
|
323
|
-
return /* @__PURE__ */ o(
|
|
324
|
-
},
|
|
324
|
+
return /* @__PURE__ */ o(ne, { children: r ?? n, ...i });
|
|
325
|
+
}, re = t("div", {
|
|
325
326
|
_id: "intelligentForm__Loading"
|
|
326
|
-
}),
|
|
327
|
-
const { loading: n } = s(), r = h(null), l =
|
|
327
|
+
}), Si = I(({ ...i }, e) => {
|
|
328
|
+
const { loading: n } = s(), r = h(null), l = P(e, r);
|
|
328
329
|
return C(() => {
|
|
329
330
|
n && r.current && r.current.scrollIntoView({
|
|
330
331
|
behavior: "smooth",
|
|
331
332
|
block: "nearest",
|
|
332
333
|
inline: "nearest"
|
|
333
334
|
});
|
|
334
|
-
}, [n]), n ? /* @__PURE__ */ o(
|
|
335
|
-
}),
|
|
335
|
+
}, [n]), n ? /* @__PURE__ */ o(re, { ref: l, ...i }) : null;
|
|
336
|
+
}), oe = t("div", {
|
|
336
337
|
_id: "intelligentForm__ConfidentResponse"
|
|
337
|
-
}),
|
|
338
|
-
const { aiResponse: n, loading: r } = s(), l = h(null), c =
|
|
338
|
+
}), pi = I(({ ...i }, e) => {
|
|
339
|
+
const { aiResponse: n, loading: r } = s(), l = h(null), c = P(e, l);
|
|
339
340
|
return C(() => {
|
|
340
341
|
!r && n.answerConfidence && l.current && l.current.scrollIntoView({
|
|
341
342
|
behavior: "smooth",
|
|
342
343
|
block: "nearest",
|
|
343
344
|
inline: "nearest"
|
|
344
345
|
});
|
|
345
|
-
}, [r, n.answerConfidence]), n.answerConfidence ? /* @__PURE__ */ o(
|
|
346
|
-
}),
|
|
346
|
+
}, [r, n.answerConfidence]), n.answerConfidence ? /* @__PURE__ */ o(oe, { ref: c, ...i }) : null;
|
|
347
|
+
}), le = t(N, {
|
|
347
348
|
_id: "intelligentForm__ConfidentAnswer"
|
|
348
|
-
}),
|
|
349
|
+
}), vi = (i) => {
|
|
349
350
|
const { aiResponse: e } = s();
|
|
350
|
-
return /* @__PURE__ */ o(
|
|
351
|
-
},
|
|
351
|
+
return /* @__PURE__ */ o(le, { shouldOpenLinksInNewTab: !0, children: e.answer, ...i });
|
|
352
|
+
}, se = t("button", {
|
|
352
353
|
_id: "intelligentForm__ConfidentResponseButton",
|
|
353
354
|
type: "button"
|
|
354
|
-
}),
|
|
355
|
+
}), Ii = (i) => {
|
|
355
356
|
const { onClick: e, ...n } = i, { showSecondaryFields: r, setShowSecondaryFields: l } = s(), c = () => {
|
|
356
357
|
l(!0);
|
|
357
358
|
};
|
|
358
359
|
return /* @__PURE__ */ o(
|
|
359
|
-
|
|
360
|
+
se,
|
|
360
361
|
{
|
|
361
362
|
"data-escalated": a(r),
|
|
362
363
|
onClick: F(e, c),
|
|
363
364
|
...n
|
|
364
365
|
}
|
|
365
366
|
);
|
|
366
|
-
},
|
|
367
|
+
}, Pi = t(S, {
|
|
367
368
|
_id: "intelligentForm__ConfidentResponseButton__Icon",
|
|
368
369
|
iconSettings: { builtIn: "LuUser" }
|
|
369
|
-
}),
|
|
370
|
+
}), fi = t("span", {
|
|
370
371
|
_id: "intelligentForm__ConfidentResponseButton__Label",
|
|
371
372
|
children: "Escalate to human"
|
|
372
|
-
}),
|
|
373
|
+
}), ce = t("div", {
|
|
373
374
|
_id: "intelligentForm__SecondaryForm"
|
|
374
|
-
}),
|
|
375
|
-
const { showSecondaryFields: n } = s(), r = h(null), l =
|
|
375
|
+
}), hi = I(({ ...i }, e) => {
|
|
376
|
+
const { showSecondaryFields: n } = s(), r = h(null), l = P(e, r);
|
|
376
377
|
return C(() => {
|
|
377
378
|
n && r.current && r.current.scrollIntoView({
|
|
378
379
|
behavior: "smooth",
|
|
379
380
|
block: "nearest",
|
|
380
381
|
inline: "nearest"
|
|
381
382
|
});
|
|
382
|
-
}, [n]), n ? /* @__PURE__ */ o(
|
|
383
|
-
}),
|
|
383
|
+
}, [n]), n ? /* @__PURE__ */ o(ce, { ref: l, ...i }) : null;
|
|
384
|
+
}), me = t("p", {
|
|
384
385
|
_id: "intelligentForm__SecondaryForm__Description"
|
|
385
|
-
}),
|
|
386
|
+
}), Ci = (i) => {
|
|
386
387
|
const {
|
|
387
388
|
formSettings: { secondary: e },
|
|
388
389
|
aiResponse: { answerConfidence: n }
|
|
@@ -392,34 +393,34 @@ const q = t("form", {
|
|
|
392
393
|
// If description is an object, use the confident description if the answer is confident
|
|
393
394
|
n ? e.description.confident : e.description.default
|
|
394
395
|
);
|
|
395
|
-
return /* @__PURE__ */ o(
|
|
396
|
-
},
|
|
396
|
+
return /* @__PURE__ */ o(me, { children: r, ...i });
|
|
397
|
+
}, de = t("div", {
|
|
397
398
|
_id: "intelligentForm__SecondaryFormFields"
|
|
398
|
-
}),
|
|
399
|
+
}), bi = (i) => {
|
|
399
400
|
const { children: e, ...n } = i, {
|
|
400
401
|
formSettings: { secondary: r }
|
|
401
402
|
} = s();
|
|
402
|
-
return /* @__PURE__ */ o(
|
|
403
|
-
},
|
|
403
|
+
return /* @__PURE__ */ o(de, { children: b(e, r.fields), ...n });
|
|
404
|
+
}, ae = t("button", {
|
|
404
405
|
_id: "intelligentForm__SecondaryFormSubmit",
|
|
405
406
|
type: "submit",
|
|
406
407
|
children: "Submit"
|
|
407
|
-
}),
|
|
408
|
+
}), yi = (i) => {
|
|
408
409
|
const { formSettings: e } = s(), { label: n } = e.buttons.submit;
|
|
409
|
-
return /* @__PURE__ */ o(
|
|
410
|
-
},
|
|
410
|
+
return /* @__PURE__ */ o(ae, { children: n ?? "Submit", ...i });
|
|
411
|
+
}, Fe = t("span", {
|
|
411
412
|
_id: "intelligentForm__Error"
|
|
412
|
-
}),
|
|
413
|
+
}), wi = (i) => {
|
|
413
414
|
const { formError: e } = s();
|
|
414
|
-
return e ? /* @__PURE__ */ o(
|
|
415
|
-
},
|
|
415
|
+
return e ? /* @__PURE__ */ o(Fe, { children: e.message, ...i }) : null;
|
|
416
|
+
}, Ri = t("div", {
|
|
416
417
|
_id: "intelligentForm__Sources"
|
|
417
|
-
}),
|
|
418
|
+
}), xi = t("p", {
|
|
418
419
|
_id: "intelligentForm__SourcesCaption",
|
|
419
420
|
children: "Here are the sources I considered:"
|
|
420
|
-
}),
|
|
421
|
+
}), ue = t("div", {
|
|
421
422
|
_id: "intelligentForm__SourcesList"
|
|
422
|
-
}),
|
|
423
|
+
}), Ti = (i) => {
|
|
423
424
|
const { children: e, ...n } = i, {
|
|
424
425
|
baseSettings: { transformSource: r, organizationDisplayName: l }
|
|
425
426
|
} = x(), {
|
|
@@ -427,18 +428,19 @@ const q = t("form", {
|
|
|
427
428
|
} = s();
|
|
428
429
|
if (!c) return null;
|
|
429
430
|
const m = c.reduce((d, p) => {
|
|
430
|
-
const g =
|
|
431
|
-
organizationDisplayName: l
|
|
431
|
+
const g = q(p, "intelligentFormSource", {
|
|
432
|
+
organizationDisplayName: l,
|
|
433
|
+
transformSource: r
|
|
432
434
|
});
|
|
433
435
|
return d.some((f) => f.url === g.url) || d.push(g), d;
|
|
434
436
|
}, []);
|
|
435
|
-
return /* @__PURE__ */ o(
|
|
436
|
-
},
|
|
437
|
+
return /* @__PURE__ */ o(ue, { children: b(e, m), ...n });
|
|
438
|
+
}, _e = t(D, {
|
|
437
439
|
_id: "intelligentForm__Source"
|
|
438
|
-
}),
|
|
440
|
+
}), ki = (i) => {
|
|
439
441
|
const { source: e, ...n } = i;
|
|
440
442
|
return /* @__PURE__ */ o(E, { source: { ...e, isExternal: !!e.shouldOpenInNewTab }, children: /* @__PURE__ */ o(
|
|
441
|
-
|
|
443
|
+
_e,
|
|
442
444
|
{
|
|
443
445
|
"data-type": e.type,
|
|
444
446
|
appendToUrl: e.appendToUrl,
|
|
@@ -447,125 +449,125 @@ const q = t("form", {
|
|
|
447
449
|
...n
|
|
448
450
|
}
|
|
449
451
|
) });
|
|
450
|
-
},
|
|
452
|
+
}, ge = t(S, {
|
|
451
453
|
_id: "intelligentForm__SourceIcon"
|
|
452
|
-
}),
|
|
454
|
+
}), Bi = (i) => {
|
|
453
455
|
const { source: e } = T();
|
|
454
|
-
return /* @__PURE__ */ o(
|
|
455
|
-
},
|
|
456
|
+
return /* @__PURE__ */ o(ge, { iconSettings: e.icon, "data-type": e.type, ...i });
|
|
457
|
+
}, Se = t("span", {
|
|
456
458
|
_id: "intelligentForm__SourceTitle"
|
|
457
|
-
}),
|
|
459
|
+
}), Ai = (i) => {
|
|
458
460
|
const { source: e } = T();
|
|
459
|
-
return /* @__PURE__ */ o(
|
|
461
|
+
return /* @__PURE__ */ o(Se, { "data-type": e.type, children: e.title, ...i });
|
|
460
462
|
};
|
|
461
463
|
export {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
464
|
+
ui as BotHeading,
|
|
465
|
+
_i as BotHeadingIcon,
|
|
466
|
+
gi as BotHeadingName,
|
|
467
|
+
vi as ConfidentAnswer,
|
|
468
|
+
pi as ConfidentResponse,
|
|
469
|
+
Ii as ConfidentResponseButton,
|
|
470
|
+
Pi as ConfidentResponseButtonIcon,
|
|
471
|
+
fi as ConfidentResponseButtonLabel,
|
|
472
|
+
Ee as Content,
|
|
473
|
+
De as ContentScrollArea,
|
|
474
|
+
ze as ContentScrollAreaCorner,
|
|
475
|
+
qe as ContentScrollAreaScrollbar,
|
|
476
|
+
Me as ContentScrollAreaThumb,
|
|
477
|
+
Ne as ContentScrollAreaViewport,
|
|
478
|
+
wi as Error,
|
|
479
|
+
Ke as FormField,
|
|
480
|
+
ii as FormFieldCheckbox,
|
|
481
|
+
ti as FormFieldCheckboxIndicator,
|
|
482
|
+
Ye as FormFieldEmail,
|
|
483
|
+
Fi as FormFieldError,
|
|
484
|
+
Ze as FormFieldFile,
|
|
485
|
+
Xe as FormFieldLabel,
|
|
486
|
+
ni as FormFieldSelect,
|
|
487
|
+
si as FormFieldSelectContent,
|
|
488
|
+
li as FormFieldSelectIcon,
|
|
489
|
+
mi as FormFieldSelectItem,
|
|
490
|
+
ai as FormFieldSelectItemIndicator,
|
|
491
|
+
di as FormFieldSelectItemText,
|
|
492
|
+
ri as FormFieldSelectTrigger,
|
|
493
|
+
oi as FormFieldSelectValue,
|
|
494
|
+
ci as FormFieldSelectViewport,
|
|
495
|
+
k as FormFieldText,
|
|
496
|
+
ei as FormFieldTextArea,
|
|
497
|
+
He as Heading,
|
|
498
|
+
ui as IntelligentFormPrimitiveBotHeading,
|
|
499
|
+
_i as IntelligentFormPrimitiveBotHeadingIcon,
|
|
500
|
+
gi as IntelligentFormPrimitiveBotHeadingName,
|
|
501
|
+
vi as IntelligentFormPrimitiveConfidentAnswer,
|
|
502
|
+
pi as IntelligentFormPrimitiveConfidentResponse,
|
|
503
|
+
Ii as IntelligentFormPrimitiveConfidentResponseButton,
|
|
504
|
+
Pi as IntelligentFormPrimitiveConfidentResponseButtonIcon,
|
|
505
|
+
fi as IntelligentFormPrimitiveConfidentResponseButtonLabel,
|
|
506
|
+
Ee as IntelligentFormPrimitiveContent,
|
|
507
|
+
De as IntelligentFormPrimitiveContentScrollArea,
|
|
508
|
+
ze as IntelligentFormPrimitiveContentScrollAreaCorner,
|
|
509
|
+
qe as IntelligentFormPrimitiveContentScrollAreaScrollbar,
|
|
510
|
+
Me as IntelligentFormPrimitiveContentScrollAreaThumb,
|
|
511
|
+
Ne as IntelligentFormPrimitiveContentScrollAreaViewport,
|
|
512
|
+
wi as IntelligentFormPrimitiveFormError,
|
|
513
|
+
Ke as IntelligentFormPrimitiveFormField,
|
|
514
|
+
ii as IntelligentFormPrimitiveFormFieldCheckbox,
|
|
515
|
+
ti as IntelligentFormPrimitiveFormFieldCheckboxIndicator,
|
|
516
|
+
Ye as IntelligentFormPrimitiveFormFieldEmail,
|
|
517
|
+
Fi as IntelligentFormPrimitiveFormFieldError,
|
|
518
|
+
Ze as IntelligentFormPrimitiveFormFieldFile,
|
|
519
|
+
Xe as IntelligentFormPrimitiveFormFieldLabel,
|
|
520
|
+
ni as IntelligentFormPrimitiveFormFieldSelect,
|
|
521
|
+
si as IntelligentFormPrimitiveFormFieldSelectContent,
|
|
522
|
+
li as IntelligentFormPrimitiveFormFieldSelectIcon,
|
|
523
|
+
mi as IntelligentFormPrimitiveFormFieldSelectItem,
|
|
524
|
+
ai as IntelligentFormPrimitiveFormFieldSelectItemIndicator,
|
|
525
|
+
di as IntelligentFormPrimitiveFormFieldSelectItemText,
|
|
526
|
+
ri as IntelligentFormPrimitiveFormFieldSelectTrigger,
|
|
527
|
+
oi as IntelligentFormPrimitiveFormFieldSelectValue,
|
|
528
|
+
ci as IntelligentFormPrimitiveFormFieldSelectViewport,
|
|
529
|
+
k as IntelligentFormPrimitiveFormFieldText,
|
|
530
|
+
ei as IntelligentFormPrimitiveFormFieldTextArea,
|
|
531
|
+
He as IntelligentFormPrimitiveHeading,
|
|
532
|
+
Si as IntelligentFormPrimitiveLoading,
|
|
533
|
+
We as IntelligentFormPrimitivePrimaryForm,
|
|
534
|
+
$e as IntelligentFormPrimitivePrimaryFormDescription,
|
|
535
|
+
Ge as IntelligentFormPrimitivePrimaryFormFields,
|
|
536
|
+
Je as IntelligentFormPrimitivePrimaryFormSubmit,
|
|
537
|
+
Ve as IntelligentFormPrimitiveRoot,
|
|
538
|
+
hi as IntelligentFormPrimitiveSecondaryForm,
|
|
539
|
+
Ci as IntelligentFormPrimitiveSecondaryFormDescription,
|
|
540
|
+
bi as IntelligentFormPrimitiveSecondaryFormFields,
|
|
541
|
+
yi as IntelligentFormPrimitiveSecondaryFormSubmit,
|
|
542
|
+
ki as IntelligentFormPrimitiveSource,
|
|
543
|
+
Bi as IntelligentFormPrimitiveSourceIcon,
|
|
544
|
+
Ai as IntelligentFormPrimitiveSourceTitle,
|
|
545
|
+
Ri as IntelligentFormPrimitiveSources,
|
|
546
|
+
xi as IntelligentFormPrimitiveSourcesCaption,
|
|
547
|
+
Ti as IntelligentFormPrimitiveSourcesList,
|
|
548
|
+
Oe as IntelligentFormPrimitiveSuccess,
|
|
549
|
+
je as IntelligentFormPrimitiveSuccessHeading,
|
|
550
|
+
Ue as IntelligentFormPrimitiveSuccessIcon,
|
|
551
|
+
Qe as IntelligentFormPrimitiveSuccessMessage,
|
|
552
|
+
Si as Loading,
|
|
553
|
+
We as PrimaryForm,
|
|
554
|
+
$e as PrimaryFormDescription,
|
|
555
|
+
Ge as PrimaryFormFields,
|
|
556
|
+
Je as PrimaryFormSubmit,
|
|
557
|
+
Hi as Provider,
|
|
558
|
+
Ve as Root,
|
|
559
|
+
hi as SecondaryForm,
|
|
560
|
+
Ci as SecondaryFormDescription,
|
|
561
|
+
bi as SecondaryFormFields,
|
|
562
|
+
yi as SecondaryFormSubmit,
|
|
563
|
+
ki as Source,
|
|
564
|
+
Bi as SourceIcon,
|
|
565
|
+
Ai as SourceTitle,
|
|
566
|
+
Ri as Sources,
|
|
567
|
+
xi as SourcesCaption,
|
|
568
|
+
Ti as SourcesList,
|
|
569
|
+
Oe as Success,
|
|
570
|
+
je as SuccessHeading,
|
|
571
|
+
Ue as SuccessIcon,
|
|
572
|
+
Qe as SuccessMessage
|
|
571
573
|
};
|