@inkeep/cxkit-primitives 0.5.115 → 0.5.116
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/embedded-chat.cjs +4 -4
- package/dist/components/embedded-chat.js +597 -590
- package/dist/components/intelligent-form.cjs +1 -1
- package/dist/components/intelligent-form.js +258 -251
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/dist/utils/component-ids.cjs +1 -1
- package/dist/utils/component-ids.js +2 -0
- package/package.json +4 -4
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import { ikp as t } from "./factory.js";
|
|
4
|
-
import { forwardRef as
|
|
4
|
+
import { forwardRef as b, useRef as v, useEffect as P } from "react";
|
|
5
5
|
import x from "react-textarea-autosize";
|
|
6
|
-
import { Trigger as A, Icon as V, Content as L, Viewport as H, Item as
|
|
6
|
+
import { Trigger as A, Icon as V, Content as L, Viewport as H, Item as D, ItemText as E, ItemIndicator as N, Root as q, Value as M } from "../atoms/select.js";
|
|
7
7
|
import { ComboboxRoot as z, ComboboxControl as O, ComboboxInput as U, ComboboxTrigger as j, ComboboxPositioner as Q, ComboboxContent as W, ComboboxItem as $, ComboboxItemText as G, ComboboxSelectedTags as J, ComboboxItemIndicator as K } from "../atoms/combobox.js";
|
|
8
|
-
import { useComboboxItems as
|
|
8
|
+
import { useComboboxItems as gt } from "../atoms/combobox.js";
|
|
9
9
|
import * as y from "@radix-ui/react-checkbox";
|
|
10
10
|
import { useIntelligentForm as m } from "./intelligent-form/intelligent-form-provider.js";
|
|
11
|
-
import { IntelligentFormProvider as
|
|
12
|
-
import * as
|
|
13
|
-
import { BuiltInIconRenderer as
|
|
14
|
-
import { maybeRender as
|
|
11
|
+
import { IntelligentFormProvider as St } from "./intelligent-form/intelligent-form-provider.js";
|
|
12
|
+
import * as S from "@radix-ui/react-scroll-area";
|
|
13
|
+
import { BuiltInIconRenderer as g } from "../atoms/icons/built-in-icon-renderer.js";
|
|
14
|
+
import { maybeRender as f, dataAttr as F } from "../utils/misc.js";
|
|
15
15
|
import { Controller as X } from "react-hook-form";
|
|
16
|
-
import { IntelligentFormFieldProvider as Y, useIntelligentFormField as
|
|
16
|
+
import { IntelligentFormFieldProvider as Y, useIntelligentFormField as u } from "../providers/intelligent-form-field-provider.js";
|
|
17
17
|
import { CheckboxIcon as Z } from "../atoms/icons/checkbox-icon.js";
|
|
18
18
|
import { useInkeepConfig as w } from "../providers/config-provider.js";
|
|
19
19
|
import { SourceItemProvider as ee, useSourceItem as T } from "../providers/source-item-provider.js";
|
|
@@ -25,19 +25,19 @@ import { transformInkeepSource as oe } from "../utils/transform-source/index.js"
|
|
|
25
25
|
import { useShadow as ne } from "../atoms/shadow/context.js";
|
|
26
26
|
const re = t("form", {
|
|
27
27
|
_id: "intelligentForm__Root"
|
|
28
|
-
}),
|
|
28
|
+
}), oi = (i) => {
|
|
29
29
|
const { onSubmit: e, ...o } = i, { handleSubmit: n } = m();
|
|
30
30
|
return /* @__PURE__ */ r(re, { onSubmit: a(e, n), ...o });
|
|
31
|
-
},
|
|
31
|
+
}, ni = t("h2", {
|
|
32
32
|
_id: "intelligentForm__Heading",
|
|
33
33
|
children: "Contact Support"
|
|
34
|
-
}),
|
|
34
|
+
}), ri = t("div", {
|
|
35
35
|
_id: "intelligentForm__Content"
|
|
36
|
-
}),
|
|
36
|
+
}), li = t(S.Root, {
|
|
37
37
|
_id: "intelligentForm__Content__ScrollArea"
|
|
38
|
-
}), le = t(
|
|
38
|
+
}), le = t(S.Viewport, {
|
|
39
39
|
_id: "intelligentForm__Content__ScrollAreaViewport"
|
|
40
|
-
}),
|
|
40
|
+
}), mi = (i) => {
|
|
41
41
|
const { children: e, ...o } = i;
|
|
42
42
|
return /* @__PURE__ */ r(
|
|
43
43
|
le,
|
|
@@ -49,26 +49,26 @@ const re = t("form", {
|
|
|
49
49
|
...o
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
},
|
|
53
|
-
|
|
52
|
+
}, si = t(
|
|
53
|
+
S.ScrollAreaScrollbar,
|
|
54
54
|
{
|
|
55
55
|
_id: "intelligentForm__Content__ScrollAreaScrollbar"
|
|
56
56
|
}
|
|
57
|
-
),
|
|
58
|
-
|
|
57
|
+
), ci = t(
|
|
58
|
+
S.ScrollAreaThumb,
|
|
59
59
|
{
|
|
60
60
|
_id: "intelligentForm__Content__ScrollAreaThumb"
|
|
61
61
|
}
|
|
62
|
-
),
|
|
62
|
+
), di = t(S.Corner, {
|
|
63
63
|
_id: "intelligentForm__Content__ScrollAreaCorner"
|
|
64
64
|
}), me = t("div", {
|
|
65
65
|
_id: "intelligentForm__Success"
|
|
66
|
-
}),
|
|
66
|
+
}), ai = (i) => {
|
|
67
67
|
const { children: e, ...o } = i, { isSubmitSuccessful: n } = m();
|
|
68
68
|
return n ? /* @__PURE__ */ r(me, { ...o, children: e }) : null;
|
|
69
|
-
}, se = t(
|
|
69
|
+
}, se = t(g, {
|
|
70
70
|
_id: "intelligentForm__SuccessIcon"
|
|
71
|
-
}),
|
|
71
|
+
}), Fi = (i) => {
|
|
72
72
|
const {
|
|
73
73
|
formSettings: { successView: e }
|
|
74
74
|
} = m();
|
|
@@ -81,25 +81,25 @@ const re = t("form", {
|
|
|
81
81
|
);
|
|
82
82
|
}, ce = t("h2", {
|
|
83
83
|
_id: "intelligentForm__SuccessHeading"
|
|
84
|
-
}),
|
|
84
|
+
}), ui = (i) => {
|
|
85
85
|
const {
|
|
86
86
|
formSettings: { successView: e }
|
|
87
87
|
} = m();
|
|
88
88
|
return /* @__PURE__ */ r(ce, { children: e.heading, ...i });
|
|
89
89
|
}, de = t("p", {
|
|
90
90
|
_id: "intelligentForm__SuccessMessage"
|
|
91
|
-
}),
|
|
91
|
+
}), _i = (i) => {
|
|
92
92
|
const {
|
|
93
93
|
formSettings: { successView: e }
|
|
94
94
|
} = m();
|
|
95
95
|
return /* @__PURE__ */ r(de, { children: e.message, ...i });
|
|
96
|
-
},
|
|
96
|
+
}, gi = t("div", {
|
|
97
97
|
_id: "intelligentForm__PrimaryForm"
|
|
98
98
|
}), ae = t("div", {
|
|
99
99
|
_id: "intelligentForm__PrimaryFormFields"
|
|
100
100
|
}), Fe = t("p", {
|
|
101
101
|
_id: "intelligentForm__PrimaryForm__Description"
|
|
102
|
-
}),
|
|
102
|
+
}), pi = (i) => {
|
|
103
103
|
const {
|
|
104
104
|
formSettings: { primary: e }
|
|
105
105
|
} = m();
|
|
@@ -108,7 +108,7 @@ const re = t("form", {
|
|
|
108
108
|
const { children: e, ...o } = i, {
|
|
109
109
|
formSettings: { primary: n }
|
|
110
110
|
} = m();
|
|
111
|
-
return /* @__PURE__ */ r(ae, { children:
|
|
111
|
+
return /* @__PURE__ */ r(ae, { children: f(e, n.fields), ...o });
|
|
112
112
|
}, ue = t("button", {
|
|
113
113
|
_id: "intelligentForm__PrimaryFormSubmit",
|
|
114
114
|
type: "button",
|
|
@@ -125,7 +125,7 @@ const re = t("form", {
|
|
|
125
125
|
);
|
|
126
126
|
}, _e = t("div", {
|
|
127
127
|
_id: "intelligentForm__Field"
|
|
128
|
-
}),
|
|
128
|
+
}), Ci = (i) => {
|
|
129
129
|
const { field: e, autoFocus: o, ...n } = i, { control: l, errors: s } = m();
|
|
130
130
|
return /* @__PURE__ */ r(
|
|
131
131
|
X,
|
|
@@ -159,8 +159,8 @@ const re = t("form", {
|
|
|
159
159
|
);
|
|
160
160
|
}, ge = t("label", {
|
|
161
161
|
_id: "intelligentForm__FieldLabel"
|
|
162
|
-
}),
|
|
163
|
-
const { field: e } =
|
|
162
|
+
}), Ii = (i) => {
|
|
163
|
+
const { field: e } = u();
|
|
164
164
|
return /* @__PURE__ */ r(
|
|
165
165
|
ge,
|
|
166
166
|
{
|
|
@@ -170,10 +170,10 @@ const re = t("form", {
|
|
|
170
170
|
...i
|
|
171
171
|
}
|
|
172
172
|
);
|
|
173
|
-
},
|
|
173
|
+
}, pe = t("input", {
|
|
174
174
|
_id: "intelligentForm__FieldText",
|
|
175
175
|
type: "text"
|
|
176
|
-
}), R =
|
|
176
|
+
}), R = b((i, e) => {
|
|
177
177
|
const {
|
|
178
178
|
field: o,
|
|
179
179
|
error: n,
|
|
@@ -183,18 +183,18 @@ const re = t("form", {
|
|
|
183
183
|
ref: c,
|
|
184
184
|
...d
|
|
185
185
|
},
|
|
186
|
-
autoFocus:
|
|
187
|
-
} =
|
|
186
|
+
autoFocus: p
|
|
187
|
+
} = u(), _ = C(
|
|
188
188
|
e,
|
|
189
189
|
c
|
|
190
190
|
);
|
|
191
191
|
return /* @__PURE__ */ r(
|
|
192
|
-
|
|
192
|
+
pe,
|
|
193
193
|
{
|
|
194
194
|
asChild: o.inputType === "textarea",
|
|
195
|
-
ref:
|
|
195
|
+
ref: _,
|
|
196
196
|
id: o.name,
|
|
197
|
-
autoFocus:
|
|
197
|
+
autoFocus: p,
|
|
198
198
|
placeholder: "placeholder" in o ? o.placeholder : void 0,
|
|
199
199
|
"data-invalid": F(!!n),
|
|
200
200
|
onChange: a(i.onChange, l),
|
|
@@ -204,37 +204,37 @@ const re = t("form", {
|
|
|
204
204
|
children: o.inputType === "textarea" ? /* @__PURE__ */ r(x, { minRows: 3, maxRows: 10 }) : null
|
|
205
205
|
}
|
|
206
206
|
);
|
|
207
|
-
}),
|
|
207
|
+
}), vi = t(R, {
|
|
208
208
|
_id: "intelligentForm__FieldEmail",
|
|
209
209
|
type: "email"
|
|
210
|
-
}),
|
|
210
|
+
}), Se = t("input", {
|
|
211
211
|
_id: "intelligentForm__FieldFile",
|
|
212
212
|
type: "file",
|
|
213
213
|
multiple: !0
|
|
214
|
-
}),
|
|
214
|
+
}), Pi = (i) => {
|
|
215
215
|
const {
|
|
216
216
|
field: e,
|
|
217
217
|
error: o,
|
|
218
218
|
fieldProps: { value: n, onChange: l, onBlur: s, ...c },
|
|
219
219
|
autoFocus: d
|
|
220
|
-
} =
|
|
220
|
+
} = u(), { onChange: p, onBlur: _, ...h } = i, I = (k) => {
|
|
221
221
|
const B = k.target.files;
|
|
222
222
|
l(B);
|
|
223
223
|
};
|
|
224
224
|
return /* @__PURE__ */ r(
|
|
225
|
-
|
|
225
|
+
Se,
|
|
226
226
|
{
|
|
227
227
|
id: e.name,
|
|
228
228
|
autoFocus: d,
|
|
229
229
|
"data-value": n,
|
|
230
230
|
"data-invalid": F(!!o),
|
|
231
|
-
...
|
|
231
|
+
...h,
|
|
232
232
|
...c,
|
|
233
|
-
onChange: a(
|
|
234
|
-
onBlur: a(
|
|
233
|
+
onChange: a(p, I),
|
|
234
|
+
onBlur: a(_, s)
|
|
235
235
|
}
|
|
236
236
|
);
|
|
237
|
-
},
|
|
237
|
+
}, fi = t(
|
|
238
238
|
R,
|
|
239
239
|
{
|
|
240
240
|
_id: "intelligentForm__FieldTextArea",
|
|
@@ -242,12 +242,12 @@ const re = t("form", {
|
|
|
242
242
|
asChild: !0,
|
|
243
243
|
children: /* @__PURE__ */ r(x, { rows: 1, maxRows: 8 })
|
|
244
244
|
}
|
|
245
|
-
),
|
|
245
|
+
), be = t(y.Root, {
|
|
246
246
|
_id: "intelligentForm__FieldCheckbox"
|
|
247
247
|
}), hi = (i) => {
|
|
248
|
-
const { field: e, error: o, fieldProps: n, autoFocus: l } =
|
|
248
|
+
const { field: e, error: o, fieldProps: n, autoFocus: l } = u(), { onCheckedChange: s, ...c } = i;
|
|
249
249
|
return /* @__PURE__ */ r(
|
|
250
|
-
|
|
250
|
+
be,
|
|
251
251
|
{
|
|
252
252
|
id: e.name,
|
|
253
253
|
name: e.name,
|
|
@@ -258,13 +258,13 @@ const re = t("form", {
|
|
|
258
258
|
...c
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
|
-
},
|
|
261
|
+
}, xi = t(y.Indicator, {
|
|
262
262
|
_id: "intelligentForm__FieldCheckboxIndicator",
|
|
263
263
|
children: /* @__PURE__ */ r(Z, {})
|
|
264
264
|
}), Ce = t(q, {
|
|
265
265
|
_id: "intelligentForm__FieldSelect"
|
|
266
|
-
}),
|
|
267
|
-
const { field: e, error: o, fieldProps: n } =
|
|
266
|
+
}), yi = (i) => {
|
|
267
|
+
const { field: e, error: o, fieldProps: n } = u(), { onValueChange: l, ...s } = i;
|
|
268
268
|
return /* @__PURE__ */ r(
|
|
269
269
|
Ce,
|
|
270
270
|
{
|
|
@@ -275,12 +275,12 @@ const re = t("form", {
|
|
|
275
275
|
...s
|
|
276
276
|
}
|
|
277
277
|
);
|
|
278
|
-
},
|
|
278
|
+
}, wi = t(A, {
|
|
279
279
|
_id: "intelligentForm__FieldSelect__Trigger"
|
|
280
280
|
}), Ie = t(M, {
|
|
281
281
|
_id: "intelligentForm__FieldSelect__Value"
|
|
282
|
-
}),
|
|
283
|
-
const { field: e } =
|
|
282
|
+
}), Ti = (i) => {
|
|
283
|
+
const { field: e } = u();
|
|
284
284
|
return /* @__PURE__ */ r(
|
|
285
285
|
Ie,
|
|
286
286
|
{
|
|
@@ -288,34 +288,34 @@ const re = t("form", {
|
|
|
288
288
|
...i
|
|
289
289
|
}
|
|
290
290
|
);
|
|
291
|
-
},
|
|
291
|
+
}, Ri = t(V, {
|
|
292
292
|
_id: "intelligentForm__FieldSelect__Icon",
|
|
293
293
|
asChild: !0,
|
|
294
|
-
children: /* @__PURE__ */ r(
|
|
295
|
-
}),
|
|
294
|
+
children: /* @__PURE__ */ r(g, { iconSettings: { builtIn: "LuChevronDown" } })
|
|
295
|
+
}), ki = t(L, {
|
|
296
296
|
_id: "intelligentForm__FieldSelect__Content",
|
|
297
297
|
position: "popper"
|
|
298
|
-
}),
|
|
298
|
+
}), Bi = t(H, {
|
|
299
299
|
_id: "intelligentForm__FieldSelect__Viewport"
|
|
300
|
-
}), Bi = t(E, {
|
|
301
|
-
_id: "intelligentForm__FieldSelect__Item"
|
|
302
300
|
}), Ai = t(D, {
|
|
301
|
+
_id: "intelligentForm__FieldSelect__Item"
|
|
302
|
+
}), Vi = t(E, {
|
|
303
303
|
_id: "intelligentForm__FieldSelect__ItemText"
|
|
304
|
-
}),
|
|
304
|
+
}), Li = t(
|
|
305
305
|
N,
|
|
306
306
|
{
|
|
307
307
|
_id: "intelligentForm__FieldSelect__ItemIndicator",
|
|
308
308
|
asChild: !0,
|
|
309
|
-
children: /* @__PURE__ */ r(
|
|
309
|
+
children: /* @__PURE__ */ r(g, { iconSettings: { builtIn: "LuCheck" } })
|
|
310
310
|
}
|
|
311
|
-
),
|
|
312
|
-
const { field: e, error: o, fieldProps: n, autoFocus: l } =
|
|
311
|
+
), Hi = (i) => {
|
|
312
|
+
const { field: e, error: o, fieldProps: n, autoFocus: l } = u(), s = ne();
|
|
313
313
|
if (e.inputType !== "combobox") return null;
|
|
314
|
-
const { onValueChange: c, children: d, ...
|
|
314
|
+
const { onValueChange: c, children: d, ...p } = i, _ = s?.shadowHost ? () => s.shadowHost.shadowRoot ?? document : void 0;
|
|
315
315
|
return /* @__PURE__ */ r(
|
|
316
316
|
z,
|
|
317
317
|
{
|
|
318
|
-
...
|
|
318
|
+
...p,
|
|
319
319
|
id: e.name,
|
|
320
320
|
name: e.name,
|
|
321
321
|
items: e.items ?? [],
|
|
@@ -325,50 +325,55 @@ const re = t("form", {
|
|
|
325
325
|
placeholder: "placeholder" in e ? e.placeholder : void 0,
|
|
326
326
|
invalid: !!o,
|
|
327
327
|
autoFocus: l,
|
|
328
|
-
getRootNode:
|
|
328
|
+
getRootNode: _,
|
|
329
329
|
children: d
|
|
330
330
|
}
|
|
331
331
|
);
|
|
332
|
-
},
|
|
332
|
+
}, Di = t(O, {
|
|
333
333
|
_id: "intelligentForm__FieldCombobox__Control"
|
|
334
334
|
}), Ei = t(U, {
|
|
335
335
|
_id: "intelligentForm__FieldCombobox__Input"
|
|
336
|
-
}),
|
|
336
|
+
}), Ni = t(j, {
|
|
337
337
|
_id: "intelligentForm__FieldCombobox__Trigger",
|
|
338
|
-
children: /* @__PURE__ */ r(
|
|
339
|
-
}),
|
|
338
|
+
children: /* @__PURE__ */ r(g, { iconSettings: { builtIn: "LuChevronDown" } })
|
|
339
|
+
}), qi = t(Q, {
|
|
340
340
|
_id: "intelligentForm__FieldCombobox__Positioner"
|
|
341
|
-
}),
|
|
341
|
+
}), Mi = t(W, {
|
|
342
342
|
_id: "intelligentForm__FieldCombobox__Content"
|
|
343
|
-
}),
|
|
343
|
+
}), zi = t($, {
|
|
344
344
|
_id: "intelligentForm__FieldCombobox__Item"
|
|
345
|
-
}),
|
|
345
|
+
}), Oi = t(G, {
|
|
346
346
|
_id: "intelligentForm__FieldCombobox__ItemText"
|
|
347
|
-
}),
|
|
347
|
+
}), Ui = t(J, {
|
|
348
348
|
_id: "intelligentForm__FieldCombobox__SelectedTags"
|
|
349
|
-
}),
|
|
349
|
+
}), ji = t(K, {
|
|
350
350
|
_id: "intelligentForm__FieldCombobox__ItemIndicator",
|
|
351
|
-
children: /* @__PURE__ */ r(
|
|
352
|
-
}), ve = t("
|
|
351
|
+
children: /* @__PURE__ */ r(g, { iconSettings: { builtIn: "LuCheck" } })
|
|
352
|
+
}), ve = t("p", {
|
|
353
|
+
_id: "intelligentForm__FieldDescription"
|
|
354
|
+
}), Qi = (i) => {
|
|
355
|
+
const { field: e } = u();
|
|
356
|
+
return e.description ? /* @__PURE__ */ r(ve, { children: e.description, ...i }) : null;
|
|
357
|
+
}, Pe = t("span", {
|
|
353
358
|
_id: "intelligentForm__FieldError"
|
|
354
|
-
}),
|
|
355
|
-
const { error: e } =
|
|
356
|
-
return e ? /* @__PURE__ */ r(
|
|
357
|
-
},
|
|
359
|
+
}), Wi = (i) => {
|
|
360
|
+
const { error: e } = u();
|
|
361
|
+
return e ? /* @__PURE__ */ r(Pe, { children: e.message?.toString(), ...i }) : null;
|
|
362
|
+
}, $i = t("div", {
|
|
358
363
|
_id: "intelligentForm__BotHeading"
|
|
359
|
-
}),
|
|
364
|
+
}), Gi = t(g, {
|
|
360
365
|
_id: "intelligentForm__BotHeading__Icon",
|
|
361
366
|
iconSettings: { builtIn: "LuSparkles" }
|
|
362
|
-
}),
|
|
367
|
+
}), fe = t("div", {
|
|
363
368
|
_id: "intelligentForm__BotHeading__Name"
|
|
364
|
-
}),
|
|
369
|
+
}), Ji = (i) => {
|
|
365
370
|
const { baseSettings: e } = w(), { organizationDisplayName: o } = e ?? {}, {
|
|
366
371
|
formSettings: { aiAssistantName: n }
|
|
367
372
|
} = m();
|
|
368
|
-
return /* @__PURE__ */ r(
|
|
373
|
+
return /* @__PURE__ */ r(fe, { children: n ?? o, ...i });
|
|
369
374
|
}, he = t("div", {
|
|
370
375
|
_id: "intelligentForm__Loading"
|
|
371
|
-
}),
|
|
376
|
+
}), Ki = b(({ ...i }, e) => {
|
|
372
377
|
const { loading: o } = m(), n = v(null), l = C(e, n);
|
|
373
378
|
return P(() => {
|
|
374
379
|
o && n.current && n.current.scrollIntoView({
|
|
@@ -377,9 +382,9 @@ const re = t("form", {
|
|
|
377
382
|
inline: "nearest"
|
|
378
383
|
});
|
|
379
384
|
}, [o]), o ? /* @__PURE__ */ r(he, { ref: l, ...i }) : null;
|
|
380
|
-
}),
|
|
385
|
+
}), xe = t("div", {
|
|
381
386
|
_id: "intelligentForm__ConfidentResponse"
|
|
382
|
-
}),
|
|
387
|
+
}), Xi = b(({ ...i }, e) => {
|
|
383
388
|
const { aiResponse: o, loading: n } = m(), l = v(null), s = C(e, l);
|
|
384
389
|
return P(() => {
|
|
385
390
|
!n && o.answerConfidence && l.current && l.current.scrollIntoView({
|
|
@@ -387,36 +392,36 @@ const re = t("form", {
|
|
|
387
392
|
block: "nearest",
|
|
388
393
|
inline: "nearest"
|
|
389
394
|
});
|
|
390
|
-
}, [n, o.answerConfidence]), o.answerConfidence ? /* @__PURE__ */ r(
|
|
391
|
-
}),
|
|
395
|
+
}, [n, o.answerConfidence]), o.answerConfidence ? /* @__PURE__ */ r(xe, { ref: s, ...i }) : null;
|
|
396
|
+
}), ye = t(te, {
|
|
392
397
|
_id: "intelligentForm__ConfidentAnswer"
|
|
393
|
-
}),
|
|
398
|
+
}), Yi = (i) => {
|
|
394
399
|
const { aiResponse: e } = m();
|
|
395
|
-
return /* @__PURE__ */ r(
|
|
396
|
-
},
|
|
400
|
+
return /* @__PURE__ */ r(ye, { shouldOpenLinksInNewTab: !0, children: e.answer, ...i });
|
|
401
|
+
}, we = t("button", {
|
|
397
402
|
_id: "intelligentForm__ConfidentResponseButton",
|
|
398
403
|
type: "button"
|
|
399
|
-
}),
|
|
404
|
+
}), Zi = (i) => {
|
|
400
405
|
const { onClick: e, ...o } = i, { showSecondaryFields: n, setShowSecondaryFields: l } = m(), s = () => {
|
|
401
406
|
l(!0);
|
|
402
407
|
};
|
|
403
408
|
return /* @__PURE__ */ r(
|
|
404
|
-
|
|
409
|
+
we,
|
|
405
410
|
{
|
|
406
411
|
"data-escalated": F(n),
|
|
407
412
|
onClick: a(e, s),
|
|
408
413
|
...o
|
|
409
414
|
}
|
|
410
415
|
);
|
|
411
|
-
},
|
|
416
|
+
}, et = t(g, {
|
|
412
417
|
_id: "intelligentForm__ConfidentResponseButton__Icon",
|
|
413
418
|
iconSettings: { builtIn: "LuUser" }
|
|
414
|
-
}),
|
|
419
|
+
}), it = t("span", {
|
|
415
420
|
_id: "intelligentForm__ConfidentResponseButton__Label",
|
|
416
421
|
children: "Escalate to human"
|
|
417
|
-
}),
|
|
422
|
+
}), Te = t("div", {
|
|
418
423
|
_id: "intelligentForm__SecondaryForm"
|
|
419
|
-
}),
|
|
424
|
+
}), tt = b(({ ...i }, e) => {
|
|
420
425
|
const { showSecondaryFields: o } = m(), n = v(null), l = C(e, n);
|
|
421
426
|
return P(() => {
|
|
422
427
|
o && n.current && n.current.scrollIntoView({
|
|
@@ -424,10 +429,10 @@ const re = t("form", {
|
|
|
424
429
|
block: "nearest",
|
|
425
430
|
inline: "nearest"
|
|
426
431
|
});
|
|
427
|
-
}, [o]), o ? /* @__PURE__ */ r(
|
|
428
|
-
}),
|
|
432
|
+
}, [o]), o ? /* @__PURE__ */ r(Te, { ref: l, ...i }) : null;
|
|
433
|
+
}), Re = t("p", {
|
|
429
434
|
_id: "intelligentForm__SecondaryForm__Description"
|
|
430
|
-
}),
|
|
435
|
+
}), ot = (i) => {
|
|
431
436
|
const {
|
|
432
437
|
formSettings: { secondary: e },
|
|
433
438
|
aiResponse: { answerConfidence: o }
|
|
@@ -437,54 +442,54 @@ const re = t("form", {
|
|
|
437
442
|
// If description is an object, use the confident description if the answer is confident
|
|
438
443
|
o ? e.description.confident : e.description.default
|
|
439
444
|
);
|
|
440
|
-
return /* @__PURE__ */ r(
|
|
441
|
-
},
|
|
445
|
+
return /* @__PURE__ */ r(Re, { children: n, ...i });
|
|
446
|
+
}, ke = t("div", {
|
|
442
447
|
_id: "intelligentForm__SecondaryFormFields"
|
|
443
|
-
}),
|
|
448
|
+
}), nt = (i) => {
|
|
444
449
|
const { children: e, ...o } = i, {
|
|
445
450
|
formSettings: { secondary: n }
|
|
446
451
|
} = m();
|
|
447
|
-
return /* @__PURE__ */ r(
|
|
448
|
-
},
|
|
452
|
+
return /* @__PURE__ */ r(ke, { children: f(e, n.fields), ...o });
|
|
453
|
+
}, Be = t("button", {
|
|
449
454
|
_id: "intelligentForm__SecondaryFormSubmit",
|
|
450
455
|
type: "submit",
|
|
451
456
|
children: "Submit"
|
|
452
|
-
}),
|
|
457
|
+
}), rt = (i) => {
|
|
453
458
|
const { formSettings: e, isSubmitting: o } = m(), { label: n } = e.buttons.submit;
|
|
454
|
-
return /* @__PURE__ */ r(
|
|
455
|
-
},
|
|
459
|
+
return /* @__PURE__ */ r(Be, { disabled: o, children: n ?? "Submit", ...i });
|
|
460
|
+
}, Ae = t("span", {
|
|
456
461
|
_id: "intelligentForm__Error"
|
|
457
|
-
}),
|
|
462
|
+
}), lt = (i) => {
|
|
458
463
|
const { formError: e } = m();
|
|
459
|
-
return e ? /* @__PURE__ */ r(
|
|
460
|
-
},
|
|
464
|
+
return e ? /* @__PURE__ */ r(Ae, { children: e.message, ...i }) : null;
|
|
465
|
+
}, mt = t("div", {
|
|
461
466
|
_id: "intelligentForm__Sources"
|
|
462
|
-
}),
|
|
467
|
+
}), st = t("p", {
|
|
463
468
|
_id: "intelligentForm__SourcesCaption",
|
|
464
469
|
children: "Here are the sources I considered:"
|
|
465
|
-
}),
|
|
470
|
+
}), Ve = t("div", {
|
|
466
471
|
_id: "intelligentForm__SourcesList"
|
|
467
|
-
}),
|
|
472
|
+
}), ct = (i) => {
|
|
468
473
|
const { children: e, ...o } = i, {
|
|
469
474
|
baseSettings: { transformSource: n, organizationDisplayName: l }
|
|
470
475
|
} = w(), {
|
|
471
476
|
aiResponse: { recordsConsidered: s }
|
|
472
477
|
} = m();
|
|
473
478
|
if (!s) return null;
|
|
474
|
-
const c = s.reduce((d,
|
|
475
|
-
const
|
|
479
|
+
const c = s.reduce((d, p) => {
|
|
480
|
+
const _ = oe(p, "intelligentFormSource", {
|
|
476
481
|
organizationDisplayName: l,
|
|
477
482
|
transformSource: n
|
|
478
483
|
});
|
|
479
|
-
return d.some((I) => I.url ===
|
|
484
|
+
return d.some((I) => I.url === _.url) || d.push(_), d;
|
|
480
485
|
}, []);
|
|
481
|
-
return /* @__PURE__ */ r(
|
|
482
|
-
},
|
|
486
|
+
return /* @__PURE__ */ r(Ve, { children: f(e, c), ...o });
|
|
487
|
+
}, Le = t(ie, {
|
|
483
488
|
_id: "intelligentForm__Source"
|
|
484
|
-
}),
|
|
489
|
+
}), dt = (i) => {
|
|
485
490
|
const { source: e, ...o } = i;
|
|
486
491
|
return /* @__PURE__ */ r(ee, { source: { ...e, isExternal: !!e.shouldOpenInNewTab }, children: /* @__PURE__ */ r(
|
|
487
|
-
|
|
492
|
+
Le,
|
|
488
493
|
{
|
|
489
494
|
"data-type": e.type,
|
|
490
495
|
appendToUrl: e.appendToUrl,
|
|
@@ -493,146 +498,148 @@ const re = t("form", {
|
|
|
493
498
|
...o
|
|
494
499
|
}
|
|
495
500
|
) });
|
|
496
|
-
},
|
|
501
|
+
}, He = t(g, {
|
|
497
502
|
_id: "intelligentForm__SourceIcon"
|
|
498
|
-
}),
|
|
503
|
+
}), at = (i) => {
|
|
499
504
|
const { source: e } = T();
|
|
500
|
-
return /* @__PURE__ */ r(
|
|
501
|
-
},
|
|
505
|
+
return /* @__PURE__ */ r(He, { iconSettings: e.icon, "data-type": e.type, ...i });
|
|
506
|
+
}, De = t("span", {
|
|
502
507
|
_id: "intelligentForm__SourceTitle"
|
|
503
|
-
}),
|
|
508
|
+
}), Ft = (i) => {
|
|
504
509
|
const { source: e } = T();
|
|
505
|
-
return /* @__PURE__ */ r(
|
|
510
|
+
return /* @__PURE__ */ r(De, { "data-type": e.type, children: e.title, ...i });
|
|
506
511
|
};
|
|
507
512
|
export {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
513
|
+
$i as BotHeading,
|
|
514
|
+
Gi as BotHeadingIcon,
|
|
515
|
+
Ji as BotHeadingName,
|
|
516
|
+
Yi as ConfidentAnswer,
|
|
517
|
+
Xi as ConfidentResponse,
|
|
518
|
+
Zi as ConfidentResponseButton,
|
|
519
|
+
et as ConfidentResponseButtonIcon,
|
|
520
|
+
it as ConfidentResponseButtonLabel,
|
|
521
|
+
ri as Content,
|
|
522
|
+
li as ContentScrollArea,
|
|
523
|
+
di as ContentScrollAreaCorner,
|
|
524
|
+
si as ContentScrollAreaScrollbar,
|
|
525
|
+
ci as ContentScrollAreaThumb,
|
|
526
|
+
mi as ContentScrollAreaViewport,
|
|
527
|
+
lt as Error,
|
|
528
|
+
Ci as FormField,
|
|
524
529
|
hi as FormFieldCheckbox,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
530
|
+
xi as FormFieldCheckboxIndicator,
|
|
531
|
+
Hi as FormFieldCombobox,
|
|
532
|
+
Mi as FormFieldComboboxContent,
|
|
533
|
+
Di as FormFieldComboboxControl,
|
|
529
534
|
Ei as FormFieldComboboxInput,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
wi as
|
|
548
|
-
|
|
535
|
+
zi as FormFieldComboboxItem,
|
|
536
|
+
ji as FormFieldComboboxItemIndicator,
|
|
537
|
+
Oi as FormFieldComboboxItemText,
|
|
538
|
+
qi as FormFieldComboboxPositioner,
|
|
539
|
+
Ui as FormFieldComboboxSelectedTags,
|
|
540
|
+
Ni as FormFieldComboboxTrigger,
|
|
541
|
+
Qi as FormFieldDescription,
|
|
542
|
+
vi as FormFieldEmail,
|
|
543
|
+
Wi as FormFieldError,
|
|
544
|
+
Pi as FormFieldFile,
|
|
545
|
+
Ii as FormFieldLabel,
|
|
546
|
+
yi as FormFieldSelect,
|
|
547
|
+
ki as FormFieldSelectContent,
|
|
548
|
+
Ri as FormFieldSelectIcon,
|
|
549
|
+
Ai as FormFieldSelectItem,
|
|
550
|
+
Li as FormFieldSelectItemIndicator,
|
|
551
|
+
Vi as FormFieldSelectItemText,
|
|
552
|
+
wi as FormFieldSelectTrigger,
|
|
553
|
+
Ti as FormFieldSelectValue,
|
|
554
|
+
Bi as FormFieldSelectViewport,
|
|
549
555
|
R as FormFieldText,
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
556
|
+
fi as FormFieldTextArea,
|
|
557
|
+
ni as Heading,
|
|
558
|
+
$i as IntelligentFormPrimitiveBotHeading,
|
|
559
|
+
Gi as IntelligentFormPrimitiveBotHeadingIcon,
|
|
560
|
+
Ji as IntelligentFormPrimitiveBotHeadingName,
|
|
561
|
+
Yi as IntelligentFormPrimitiveConfidentAnswer,
|
|
562
|
+
Xi as IntelligentFormPrimitiveConfidentResponse,
|
|
563
|
+
Zi as IntelligentFormPrimitiveConfidentResponseButton,
|
|
564
|
+
et as IntelligentFormPrimitiveConfidentResponseButtonIcon,
|
|
565
|
+
it as IntelligentFormPrimitiveConfidentResponseButtonLabel,
|
|
566
|
+
ri as IntelligentFormPrimitiveContent,
|
|
567
|
+
li as IntelligentFormPrimitiveContentScrollArea,
|
|
568
|
+
di as IntelligentFormPrimitiveContentScrollAreaCorner,
|
|
569
|
+
si as IntelligentFormPrimitiveContentScrollAreaScrollbar,
|
|
570
|
+
ci as IntelligentFormPrimitiveContentScrollAreaThumb,
|
|
571
|
+
mi as IntelligentFormPrimitiveContentScrollAreaViewport,
|
|
572
|
+
lt as IntelligentFormPrimitiveFormError,
|
|
573
|
+
Ci as IntelligentFormPrimitiveFormField,
|
|
568
574
|
hi as IntelligentFormPrimitiveFormFieldCheckbox,
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
575
|
+
xi as IntelligentFormPrimitiveFormFieldCheckboxIndicator,
|
|
576
|
+
Hi as IntelligentFormPrimitiveFormFieldCombobox,
|
|
577
|
+
Mi as IntelligentFormPrimitiveFormFieldComboboxContent,
|
|
578
|
+
Di as IntelligentFormPrimitiveFormFieldComboboxControl,
|
|
573
579
|
Ei as IntelligentFormPrimitiveFormFieldComboboxInput,
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
wi as
|
|
592
|
-
|
|
580
|
+
zi as IntelligentFormPrimitiveFormFieldComboboxItem,
|
|
581
|
+
ji as IntelligentFormPrimitiveFormFieldComboboxItemIndicator,
|
|
582
|
+
Oi as IntelligentFormPrimitiveFormFieldComboboxItemText,
|
|
583
|
+
qi as IntelligentFormPrimitiveFormFieldComboboxPositioner,
|
|
584
|
+
Ui as IntelligentFormPrimitiveFormFieldComboboxSelectedTags,
|
|
585
|
+
Ni as IntelligentFormPrimitiveFormFieldComboboxTrigger,
|
|
586
|
+
Qi as IntelligentFormPrimitiveFormFieldDescription,
|
|
587
|
+
vi as IntelligentFormPrimitiveFormFieldEmail,
|
|
588
|
+
Wi as IntelligentFormPrimitiveFormFieldError,
|
|
589
|
+
Pi as IntelligentFormPrimitiveFormFieldFile,
|
|
590
|
+
Ii as IntelligentFormPrimitiveFormFieldLabel,
|
|
591
|
+
yi as IntelligentFormPrimitiveFormFieldSelect,
|
|
592
|
+
ki as IntelligentFormPrimitiveFormFieldSelectContent,
|
|
593
|
+
Ri as IntelligentFormPrimitiveFormFieldSelectIcon,
|
|
594
|
+
Ai as IntelligentFormPrimitiveFormFieldSelectItem,
|
|
595
|
+
Li as IntelligentFormPrimitiveFormFieldSelectItemIndicator,
|
|
596
|
+
Vi as IntelligentFormPrimitiveFormFieldSelectItemText,
|
|
597
|
+
wi as IntelligentFormPrimitiveFormFieldSelectTrigger,
|
|
598
|
+
Ti as IntelligentFormPrimitiveFormFieldSelectValue,
|
|
599
|
+
Bi as IntelligentFormPrimitiveFormFieldSelectViewport,
|
|
593
600
|
R as IntelligentFormPrimitiveFormFieldText,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
601
|
+
fi as IntelligentFormPrimitiveFormFieldTextArea,
|
|
602
|
+
ni as IntelligentFormPrimitiveHeading,
|
|
603
|
+
Ki as IntelligentFormPrimitiveLoading,
|
|
604
|
+
gi as IntelligentFormPrimitivePrimaryForm,
|
|
605
|
+
pi as IntelligentFormPrimitivePrimaryFormDescription,
|
|
599
606
|
Si as IntelligentFormPrimitivePrimaryFormFields,
|
|
600
607
|
bi as IntelligentFormPrimitivePrimaryFormSubmit,
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
608
|
+
oi as IntelligentFormPrimitiveRoot,
|
|
609
|
+
tt as IntelligentFormPrimitiveSecondaryForm,
|
|
610
|
+
ot as IntelligentFormPrimitiveSecondaryFormDescription,
|
|
611
|
+
nt as IntelligentFormPrimitiveSecondaryFormFields,
|
|
612
|
+
rt as IntelligentFormPrimitiveSecondaryFormSubmit,
|
|
613
|
+
dt as IntelligentFormPrimitiveSource,
|
|
614
|
+
at as IntelligentFormPrimitiveSourceIcon,
|
|
615
|
+
Ft as IntelligentFormPrimitiveSourceTitle,
|
|
616
|
+
mt as IntelligentFormPrimitiveSources,
|
|
617
|
+
st as IntelligentFormPrimitiveSourcesCaption,
|
|
618
|
+
ct as IntelligentFormPrimitiveSourcesList,
|
|
619
|
+
ai as IntelligentFormPrimitiveSuccess,
|
|
620
|
+
ui as IntelligentFormPrimitiveSuccessHeading,
|
|
621
|
+
Fi as IntelligentFormPrimitiveSuccessIcon,
|
|
622
|
+
_i as IntelligentFormPrimitiveSuccessMessage,
|
|
623
|
+
Ki as Loading,
|
|
624
|
+
gi as PrimaryForm,
|
|
625
|
+
pi as PrimaryFormDescription,
|
|
619
626
|
Si as PrimaryFormFields,
|
|
620
627
|
bi as PrimaryFormSubmit,
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
628
|
+
St as Provider,
|
|
629
|
+
oi as Root,
|
|
630
|
+
tt as SecondaryForm,
|
|
631
|
+
ot as SecondaryFormDescription,
|
|
632
|
+
nt as SecondaryFormFields,
|
|
633
|
+
rt as SecondaryFormSubmit,
|
|
634
|
+
dt as Source,
|
|
635
|
+
at as SourceIcon,
|
|
636
|
+
Ft as SourceTitle,
|
|
637
|
+
mt as Sources,
|
|
638
|
+
st as SourcesCaption,
|
|
639
|
+
ct as SourcesList,
|
|
640
|
+
ai as Success,
|
|
641
|
+
ui as SuccessHeading,
|
|
642
|
+
Fi as SuccessIcon,
|
|
643
|
+
_i as SuccessMessage,
|
|
644
|
+
gt as useComboboxItems
|
|
638
645
|
};
|