@bikdotai/bik-component-library 0.0.863-beta.4 → 0.0.863-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  2. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +174 -42
  4. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/AgentStateModal.js +2 -0
  6. package/dist/cjs/components/agent-builder/components/AgentStateModal.js.map +1 -0
  7. package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js +2 -0
  8. package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
  9. package/dist/cjs/components/agent-builder/components/ChannelsSection.js +2 -0
  10. package/dist/cjs/components/agent-builder/components/ChannelsSection.js.map +1 -0
  11. package/dist/cjs/components/agent-builder/components/MentionPicker.js +1 -1
  12. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +1 -1
  14. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  15. package/dist/cjs/components/agent-builder/constants/channels.js +2 -0
  16. package/dist/cjs/components/agent-builder/constants/channels.js.map +1 -0
  17. package/dist/cjs/components/agent-builder/constants/steps.js +1 -1
  18. package/dist/cjs/components/agent-builder/constants/steps.js.map +1 -1
  19. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  20. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  21. package/dist/cjs/components/agent-builder/steps/Step1About.js +1 -1
  22. package/dist/cjs/components/agent-builder/steps/Step1About.js.map +1 -1
  23. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +2 -2
  24. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  25. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
  26. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  27. package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
  28. package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
  29. package/dist/cjs/components/toaster/Toaster.styled.js +35 -20
  30. package/dist/cjs/components/toaster/Toaster.styled.js.map +1 -1
  31. package/dist/cjs/index.js +1 -1
  32. package/dist/esm/components/agent-builder/AgentBuilder.js +105 -99
  33. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  34. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +76 -0
  35. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +91 -0
  36. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +271 -93
  37. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  38. package/dist/esm/components/agent-builder/components/AgentStateModal.d.ts +47 -0
  39. package/dist/esm/components/agent-builder/components/AgentStateModal.js +82 -0
  40. package/dist/esm/components/agent-builder/components/AgentStateModal.js.map +1 -0
  41. package/dist/esm/components/agent-builder/components/ChannelSelectModal.d.ts +26 -0
  42. package/dist/esm/components/agent-builder/components/ChannelSelectModal.js +121 -0
  43. package/dist/esm/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
  44. package/dist/esm/components/agent-builder/components/ChannelsSection.d.ts +10 -0
  45. package/dist/esm/components/agent-builder/components/ChannelsSection.js +183 -0
  46. package/dist/esm/components/agent-builder/components/ChannelsSection.js.map +1 -0
  47. package/dist/esm/components/agent-builder/components/MentionPicker.js +27 -27
  48. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  49. package/dist/esm/components/agent-builder/components/SelectableListSection.js +16 -23
  50. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  51. package/dist/esm/components/agent-builder/constants/channels.d.ts +56 -0
  52. package/dist/esm/components/agent-builder/constants/channels.js +41 -0
  53. package/dist/esm/components/agent-builder/constants/channels.js.map +1 -0
  54. package/dist/esm/components/agent-builder/constants/steps.d.ts +31 -1
  55. package/dist/esm/components/agent-builder/constants/steps.js +15 -6
  56. package/dist/esm/components/agent-builder/constants/steps.js.map +1 -1
  57. package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +13 -1
  58. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +192 -175
  59. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  60. package/dist/esm/components/agent-builder/index.d.ts +7 -2
  61. package/dist/esm/components/agent-builder/steps/Step1About.js +15 -13
  62. package/dist/esm/components/agent-builder/steps/Step1About.js.map +1 -1
  63. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +54 -49
  64. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  65. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.d.ts +11 -0
  66. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +127 -23
  67. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  68. package/dist/esm/components/agent-listing/AgentTableRow.js +71 -38
  69. package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
  70. package/dist/esm/components/toaster/Toaster.styled.js +37 -22
  71. package/dist/esm/components/toaster/Toaster.styled.js.map +1 -1
  72. package/dist/esm/index.js +644 -634
  73. package/dist/esm/index.js.map +1 -1
  74. package/package.json +1 -1
@@ -1,27 +1,28 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import { SectionBodyWrap as m } from "../AgentBuilder.styled.js";
3
3
  import { AiTextArea as l } from "../components/AiTextArea.js";
4
- import { StepSectionHeader as p } from "../components/StepSectionHeader.js";
4
+ import { ChannelsSection as p } from "../components/ChannelsSection.js";
5
+ import { StepSectionHeader as s } from "../components/StepSectionHeader.js";
5
6
  import { STEP_DEFINITIONS as d } from "../constants/steps.js";
6
- import { useAgentBuilderContext as s } from "../context/AgentBuilderContext.js";
7
- import { Input as c } from "../../input/Input.js";
8
- const o = d[0], b = () => {
9
- const { value: i, updateField: a, charLimits: n } = s();
7
+ import { useAgentBuilderContext as c } from "../context/AgentBuilderContext.js";
8
+ import { Input as h } from "../../input/Input.js";
9
+ const o = d[0], v = () => {
10
+ const { value: i, updateField: n, charLimits: a } = c();
10
11
  return /* @__PURE__ */ r("div", { className: "bik-agent-step bik-agent-step--about", children: [
11
- /* @__PURE__ */ e(p, { title: o.title, helper: o.helper }),
12
+ /* @__PURE__ */ e(s, { title: o.title, helper: o.helper }),
12
13
  /* @__PURE__ */ r(m, { children: [
13
14
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
14
- c,
15
+ h,
15
16
  {
16
17
  "data-test": "agent-name",
17
18
  labelText: "Agent name",
18
19
  labelTextBold: !0,
19
20
  placeholder: "Enter agent name",
20
21
  value: i.name,
21
- maxCharLimit: n.name,
22
+ maxCharLimit: a.name,
22
23
  maxCharLimitPosition: "TOP",
23
24
  maxCharStyle: { fontSize: 12, lineHeight: "16px" },
24
- onChangeText: (t) => a("name", t)
25
+ onChangeText: (t) => n("name", t)
25
26
  }
26
27
  ) }),
27
28
  /* @__PURE__ */ e(
@@ -30,16 +31,17 @@ const o = d[0], b = () => {
30
31
  "data-test": "agent-description",
31
32
  label: "What it does",
32
33
  value: i.description,
33
- onChange: (t) => a("description", t),
34
- maxLength: n.description,
34
+ onChange: (t) => n("description", t),
35
+ maxLength: a.description,
35
36
  placeholder: "Enter description",
36
37
  minHeight: "200px"
37
38
  }
38
- )
39
+ ),
40
+ /* @__PURE__ */ e(p, {})
39
41
  ] })
40
42
  ] });
41
43
  };
42
44
  export {
43
- b as Step1About
45
+ v as Step1About
44
46
  };
45
47
  //# sourceMappingURL=Step1About.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step1About.js","sources":["../../../../../src/components/agent-builder/steps/Step1About.tsx"],"sourcesContent":["import React from 'react';\nimport { Input } from '@src/components/input';\nimport { SectionBodyWrap } from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\n\nconst STEP = STEP_DEFINITIONS[0];\n\nexport const Step1About: React.FC = () => {\n\tconst { value, updateField, charLimits } = useAgentBuilderContext();\n\n\treturn (\n\t\t<div className=\"bik-agent-step bik-agent-step--about\">\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<div>\n\t\t\t\t\t<Input\n\t\t\t\t\t\tdata-test=\"agent-name\"\n\t\t\t\t\t\tlabelText=\"Agent name\"\n\t\t\t\t\t\tlabelTextBold\n\t\t\t\t\t\tplaceholder=\"Enter agent name\"\n\t\t\t\t\t\tvalue={value.name}\n\t\t\t\t\t\tmaxCharLimit={charLimits.name}\n\t\t\t\t\t\tmaxCharLimitPosition=\"TOP\"\n\t\t\t\t\t\tmaxCharStyle={{ fontSize: 12, lineHeight: '16px' }}\n\t\t\t\t\t\tonChangeText={(text) => updateField('name', text)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<AiTextArea\n\t\t\t\t\tdata-test=\"agent-description\"\n\t\t\t\t\tlabel=\"What it does\"\n\t\t\t\t\tvalue={value.description}\n\t\t\t\t\tonChange={(text) => updateField('description', text)}\n\t\t\t\t\tmaxLength={charLimits.description}\n\t\t\t\t\tplaceholder=\"Enter description\"\n\t\t\t\t\tminHeight=\"200px\"\n\t\t\t\t/>\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","Step1About","value","updateField","charLimits","useAgentBuilderContext","jsxs","jsx","StepSectionHeader","SectionBodyWrap","Input","text","AiTextArea"],"mappings":";;;;;;;AAQA,MAAMA,IAAOC,EAAiB,CAAC,GAElBC,IAAuB,MAAM;AACzC,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,YAAAC,EAAA,IAAeC,EAAA;AAE3C,SACC,gBAAAC,EAAC,OAAA,EAAI,WAAU,wCACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOT,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,sBAE1DU,GAAA,EACA,UAAA;AAAA,MAAA,gBAAAF,EAAC,OAAA,EACA,UAAA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,WAAU;AAAA,UACV,eAAa;AAAA,UACb,aAAY;AAAA,UACZ,OAAOR,EAAM;AAAA,UACb,cAAcE,EAAW;AAAA,UACzB,sBAAqB;AAAA,UACrB,cAAc,EAAE,UAAU,IAAI,YAAY,OAAA;AAAA,UAC1C,cAAc,CAACO,MAASR,EAAY,QAAQQ,CAAI;AAAA,QAAA;AAAA,MAAA,GAElD;AAAA,MAEA,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,OAAM;AAAA,UACN,OAAOV,EAAM;AAAA,UACb,UAAU,CAACS,MAASR,EAAY,eAAeQ,CAAI;AAAA,UACnD,WAAWP,EAAW;AAAA,UACtB,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACX,EAAA,CACD;AAAA,EAAA,GACD;AAEF;"}
1
+ {"version":3,"file":"Step1About.js","sources":["../../../../../src/components/agent-builder/steps/Step1About.tsx"],"sourcesContent":["import React from 'react';\nimport { Input } from '@src/components/input';\nimport { SectionBodyWrap } from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { ChannelsSection } from '../components/ChannelsSection';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\n\nconst STEP = STEP_DEFINITIONS[0];\n\nexport const Step1About: React.FC = () => {\n\tconst { value, updateField, charLimits } = useAgentBuilderContext();\n\n\treturn (\n\t\t<div className=\"bik-agent-step bik-agent-step--about\">\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<div>\n\t\t\t\t\t<Input\n\t\t\t\t\t\tdata-test=\"agent-name\"\n\t\t\t\t\t\tlabelText=\"Agent name\"\n\t\t\t\t\t\tlabelTextBold\n\t\t\t\t\t\tplaceholder=\"Enter agent name\"\n\t\t\t\t\t\tvalue={value.name}\n\t\t\t\t\t\tmaxCharLimit={charLimits.name}\n\t\t\t\t\t\tmaxCharLimitPosition=\"TOP\"\n\t\t\t\t\t\tmaxCharStyle={{ fontSize: 12, lineHeight: '16px' }}\n\t\t\t\t\t\tonChangeText={(text) => updateField('name', text)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<AiTextArea\n\t\t\t\t\tdata-test=\"agent-description\"\n\t\t\t\t\tlabel=\"What it does\"\n\t\t\t\t\tvalue={value.description}\n\t\t\t\t\tonChange={(text) => updateField('description', text)}\n\t\t\t\t\tmaxLength={charLimits.description}\n\t\t\t\t\tplaceholder=\"Enter description\"\n\t\t\t\t\tminHeight=\"200px\"\n\t\t\t\t/>\n\n\t\t\t\t<ChannelsSection />\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","Step1About","value","updateField","charLimits","useAgentBuilderContext","jsxs","jsx","StepSectionHeader","SectionBodyWrap","Input","text","AiTextArea","ChannelsSection"],"mappings":";;;;;;;;AASA,MAAMA,IAAOC,EAAiB,CAAC,GAElBC,IAAuB,MAAM;AACzC,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,YAAAC,EAAA,IAAeC,EAAA;AAE3C,SACC,gBAAAC,EAAC,OAAA,EAAI,WAAU,wCACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOT,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,sBAE1DU,GAAA,EACA,UAAA;AAAA,MAAA,gBAAAF,EAAC,OAAA,EACA,UAAA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,WAAU;AAAA,UACV,eAAa;AAAA,UACb,aAAY;AAAA,UACZ,OAAOR,EAAM;AAAA,UACb,cAAcE,EAAW;AAAA,UACzB,sBAAqB;AAAA,UACrB,cAAc,EAAE,UAAU,IAAI,YAAY,OAAA;AAAA,UAC1C,cAAc,CAACO,MAASR,EAAY,QAAQQ,CAAI;AAAA,QAAA;AAAA,MAAA,GAElD;AAAA,MAEA,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,OAAM;AAAA,UACN,OAAOV,EAAM;AAAA,UACb,UAAU,CAACS,MAASR,EAAY,eAAeQ,CAAI;AAAA,UACnD,WAAWP,EAAW;AAAA,UACtB,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,wBAGVS,GAAA,CAAA,CAAgB;AAAA,IAAA,EAAA,CAClB;AAAA,EAAA,GACD;AAEF;"}
@@ -1,35 +1,40 @@
1
1
  import { jsxs as o, jsx as n } from "react/jsx-runtime";
2
- import I from "../../../assets/icons/cross.svg.js";
3
- import T from "../../../assets/icons/plus.svg.js";
4
- import x from "styled-components";
5
- import { DropdownPopover as w } from "../../dropdown/DropdownPopover/index.js";
2
+ import x from "../../../assets/icons/cross.svg.js";
3
+ import w from "../../../assets/icons/plus.svg.js";
4
+ import k from "styled-components";
5
+ import { DropdownPopover as A } from "../../dropdown/DropdownPopover/index.js";
6
6
  import { RadioButton as u } from "../../radioButton/RadioButton.js";
7
- import { TitleSmall as c, BodyCaption as l } from "../../TypographyStyle.js";
8
- import { BASE_COLORS as h, COLORS as r } from "../../../constants/Theme.js";
9
- import { SectionBodyWrap as k, CardRow as A, RadioCard as f, RadioCardText as g, FieldBlock as B, ChipWrap as O } from "../AgentBuilder.styled.js";
10
- import { AiTextArea as R } from "../components/AiTextArea.js";
7
+ import { TitleSmall as l, BodyCaption as d } from "../../TypographyStyle.js";
8
+ import { BASE_COLORS as g, COLORS as r } from "../../../constants/Theme.js";
9
+ import { SectionBodyWrap as B, CardRow as L, RadioCard as f, RadioCardText as v, FieldBlock as O, ChipWrap as R } from "../AgentBuilder.styled.js";
10
+ import { AiTextArea as E } from "../components/AiTextArea.js";
11
11
  import { StepSectionHeader as D } from "../components/StepSectionHeader.js";
12
- import { STEP_DEFINITIONS as L } from "../constants/steps.js";
13
- import { useAgentBuilderContext as E } from "../context/AgentBuilderContext.js";
14
- import { Button as v } from "../../button/Button.js";
15
- import { unwrapDropdownValue as P } from "../../dropdown/utils.js";
16
- const y = L[1], Y = () => {
17
- const { value: b, patch: a, availableIntents: d, charLimits: C } = E(), { trigger: e } = b, s = (t) => a({
18
- trigger: t === "manifest_intent" ? { ...e, mode: t, custom_intent: "" } : { ...e, mode: t, intents: [] }
19
- }), S = (t) => {
12
+ import { STEP_DEFINITION_TEMPLATES as P, resolveAppToken as $ } from "../constants/steps.js";
13
+ import { useAgentBuilderContext as F } from "../context/AgentBuilderContext.js";
14
+ import { appTypeLabel as W } from "../utils/mentionSerialization.js";
15
+ import { Button as y } from "../../button/Button.js";
16
+ import { unwrapDropdownValue as j } from "../../dropdown/utils.js";
17
+ const b = P[1], ot = () => {
18
+ const { value: T, patch: a, availableIntents: m, charLimits: C, applicationType: S } = F(), { trigger: e } = T, c = W(S), s = (t) => a({ trigger: { ...e, mode: t } }), _ = (t) => {
20
19
  e.intents.includes(t) || a({
21
20
  trigger: { ...e, intents: [...e.intents, t] }
22
21
  });
23
- }, _ = (t) => a({
22
+ }, I = (t) => a({
24
23
  trigger: {
25
24
  ...e,
26
25
  intents: e.intents.filter((i) => i !== t)
27
26
  }
28
- }), m = (t) => d.find((i) => i.value === t)?.label ?? t, p = d.filter((t) => !e.intents.includes(t.value)).map((t) => ({ label: t.label, value: t.value }));
27
+ }), p = (t) => m.find((i) => i.value === t)?.label ?? t, h = m.filter((t) => !e.intents.includes(t.value)).map((t) => ({ label: t.label, value: t.value }));
29
28
  return /* @__PURE__ */ o("div", { children: [
30
- /* @__PURE__ */ n(D, { title: y.title, helper: y.helper }),
31
- /* @__PURE__ */ o(k, { children: [
32
- /* @__PURE__ */ o(A, { children: [
29
+ /* @__PURE__ */ n(
30
+ D,
31
+ {
32
+ title: b.title,
33
+ helper: $(b.helper, c)
34
+ }
35
+ ),
36
+ /* @__PURE__ */ o(B, { children: [
37
+ /* @__PURE__ */ o(L, { children: [
33
38
  /* @__PURE__ */ o(
34
39
  f,
35
40
  {
@@ -43,12 +48,12 @@ const y = L[1], Y = () => {
43
48
  isActive: e.mode === "manifest_intent",
44
49
  onValueChange: () => s("manifest_intent"),
45
50
  skipSelectingOff: !0,
46
- activeColor: h.brand[800]
51
+ activeColor: g.brand[800]
47
52
  }
48
53
  ),
49
- /* @__PURE__ */ o(g, { children: [
50
- /* @__PURE__ */ n(c, { color: r.content.primary, children: "Manifest intent" }),
51
- /* @__PURE__ */ n(l, { color: r.content.secondary, children: "Manifest's AI classifier routes conversations automatically — no keywords needed." })
54
+ /* @__PURE__ */ o(v, { children: [
55
+ /* @__PURE__ */ n(l, { color: r.content.primary, children: `${c} intent` }),
56
+ /* @__PURE__ */ n(d, { color: r.content.secondary, children: `${c}'s AI classifier routes conversations automatically — no keywords needed.` })
52
57
  ] })
53
58
  ]
54
59
  }
@@ -66,62 +71,62 @@ const y = L[1], Y = () => {
66
71
  isActive: e.mode === "custom_intent",
67
72
  onValueChange: () => s("custom_intent"),
68
73
  skipSelectingOff: !0,
69
- activeColor: h.brand[800]
74
+ activeColor: g.brand[800]
70
75
  }
71
76
  ),
72
- /* @__PURE__ */ o(g, { children: [
73
- /* @__PURE__ */ n(c, { color: r.content.primary, children: "Custom intent" }),
74
- /* @__PURE__ */ n(l, { color: r.content.secondary, children: "Define your own trigger — use exact phrases or describe the customer's intent." })
77
+ /* @__PURE__ */ o(v, { children: [
78
+ /* @__PURE__ */ n(l, { color: r.content.primary, children: "Custom intent" }),
79
+ /* @__PURE__ */ n(d, { color: r.content.secondary, children: "Define your own trigger — use exact phrases or describe the customer's intent." })
75
80
  ] })
76
81
  ]
77
82
  }
78
83
  )
79
84
  ] }),
80
- e.mode === "manifest_intent" ? /* @__PURE__ */ o(B, { children: [
81
- /* @__PURE__ */ n(c, { color: r.content.primary, children: "If customer talks about" }),
82
- e.intents.length > 0 && /* @__PURE__ */ n(O, { children: e.intents.map((t) => /* @__PURE__ */ n(
83
- v,
85
+ e.mode === "manifest_intent" ? /* @__PURE__ */ o(O, { children: [
86
+ /* @__PURE__ */ n(l, { color: r.content.primary, children: "If customer talks about" }),
87
+ e.intents.length > 0 && /* @__PURE__ */ n(R, { children: e.intents.map((t) => /* @__PURE__ */ n(
88
+ y,
84
89
  {
85
90
  "data-test": `intent-chip-${t}`,
86
91
  size: "chip",
87
92
  buttonType: "tertiaryGray",
88
- buttonText: m(t),
89
- TrailingIcon: I,
90
- "aria-label": `Remove ${m(t)}`,
91
- onClick: () => _(t)
93
+ buttonText: p(t),
94
+ TrailingIcon: x,
95
+ "aria-label": `Remove ${p(t)}`,
96
+ onClick: () => I(t)
92
97
  },
93
98
  t
94
99
  )) }),
95
- p.length > 0 && // Dashed "+ Intent" button on its own row under the chips;
100
+ h.length > 0 && // Dashed "+ Intent" button on its own row under the chips;
96
101
  // clicking it opens the intent list directly — no intermediate
97
102
  // select input.
98
- /* @__PURE__ */ n(F, { children: /* @__PURE__ */ n(
99
- w,
103
+ /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(
104
+ A,
100
105
  {
101
106
  "data-test": "intent-add-dropdown",
102
107
  isSearchable: !0,
103
108
  width: "200px",
104
109
  placement: "bottom-start",
105
- options: p,
110
+ options: h,
106
111
  onSelect: (t) => {
107
- const i = P(t);
108
- i && S(i);
112
+ const i = j(t);
113
+ i && _(i);
109
114
  },
110
115
  children: /* @__PURE__ */ n(
111
- v,
116
+ y,
112
117
  {
113
118
  "data-test": "intent-add-button",
114
119
  buttonType: "dashBold",
115
120
  size: "medium",
116
- LeadingIcon: T,
121
+ LeadingIcon: w,
117
122
  buttonText: "Intent"
118
123
  }
119
124
  )
120
125
  }
121
126
  ) }),
122
- /* @__PURE__ */ n(l, { color: r.content.secondary, children: "This agent takes over from your main assistant when this intent is detected. The changeover is automatic when you go live." })
127
+ /* @__PURE__ */ n(d, { color: r.content.secondary, children: "This agent takes over from your main assistant when this intent is detected. The changeover is automatic when you go live." })
123
128
  ] }) : /* @__PURE__ */ n(
124
- R,
129
+ E,
125
130
  {
126
131
  "data-test": "custom-intent",
127
132
  label: "Describe the trigger",
@@ -134,10 +139,10 @@ const y = L[1], Y = () => {
134
139
  )
135
140
  ] })
136
141
  ] });
137
- }, F = x.div`
142
+ }, z = k.div`
138
143
  display: flex;
139
144
  `;
140
145
  export {
141
- Y as Step2WhenItStepsIn
146
+ ot as Step2WhenItStepsIn
142
147
  };
143
148
  //# sourceMappingURL=Step2WhenItStepsIn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step2WhenItStepsIn.js","sources":["../../../../../src/components/agent-builder/steps/Step2WhenItStepsIn.tsx"],"sourcesContent":["import CrossIcon from '@src/assets/icons/cross.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownPopover } from '@src/components/dropdown/DropdownPopover';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport { TriggerMode } from '../AgentBuilder.model';\nimport {\n\tCardRow,\n\tChipWrap,\n\tFieldBlock,\n\tRadioCard,\n\tRadioCardText,\n\tSectionBodyWrap,\n} from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\n\nconst STEP = STEP_DEFINITIONS[1];\n\nexport const Step2WhenItStepsIn: React.FC = () => {\n\tconst { value, patch, availableIntents, charLimits } =\n\t\tuseAgentBuilderContext();\n\tconst { trigger } = value;\n\n\t// The two modes are mutually exclusive, so switching clears the other mode's\n\t// data — otherwise both manifest intents AND a custom intent get saved.\n\tconst setMode = (mode: TriggerMode) =>\n\t\tpatch({\n\t\t\ttrigger:\n\t\t\t\tmode === 'manifest_intent'\n\t\t\t\t\t? { ...trigger, mode, custom_intent: '' }\n\t\t\t\t\t: { ...trigger, mode, intents: [] },\n\t\t});\n\n\tconst addIntent = (intentValue: string) => {\n\t\tif (!trigger.intents.includes(intentValue)) {\n\t\t\tpatch({\n\t\t\t\ttrigger: { ...trigger, intents: [...trigger.intents, intentValue] },\n\t\t\t});\n\t\t}\n\t};\n\n\tconst removeIntent = (intentValue: string) =>\n\t\tpatch({\n\t\t\ttrigger: {\n\t\t\t\t...trigger,\n\t\t\t\tintents: trigger.intents.filter((i) => i !== intentValue),\n\t\t\t},\n\t\t});\n\n\tconst labelFor = (v: string) =>\n\t\tavailableIntents.find((o) => o.value === v)?.label ?? v;\n\n\tconst remainingOptions: SingleOption[] = availableIntents\n\t\t.filter((o) => !trigger.intents.includes(o.value))\n\t\t.map((o) => ({ label: o.label, value: o.value }));\n\n\treturn (\n\t\t<div>\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<CardRow>\n\t\t\t\t\t<RadioCard\n\t\t\t\t\t\tdata-test=\"trigger-mode-manifest\"\n\t\t\t\t\t\tselected={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\tonClick={() => setMode('manifest_intent')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tisActive={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\t\tonValueChange={() => setMode('manifest_intent')}\n\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\tManifest intent\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\tManifest&apos;s AI classifier routes conversations automatically\n\t\t\t\t\t\t\t\t— no keywords needed.\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t</RadioCard>\n\n\t\t\t\t\t<RadioCard\n\t\t\t\t\t\tdata-test=\"trigger-mode-custom\"\n\t\t\t\t\t\tselected={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\tonClick={() => setMode('custom_intent')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tisActive={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\t\tonValueChange={() => setMode('custom_intent')}\n\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\tCustom intent\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\tDefine your own trigger — use exact phrases or describe the\n\t\t\t\t\t\t\t\tcustomer&apos;s intent.\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t</RadioCard>\n\t\t\t\t</CardRow>\n\n\t\t\t\t{trigger.mode === 'manifest_intent' ? (\n\t\t\t\t\t<FieldBlock>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tIf customer talks about\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t{trigger.intents.length > 0 && (\n\t\t\t\t\t\t\t<ChipWrap>\n\t\t\t\t\t\t\t\t{trigger.intents.map((intent) => (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={intent}\n\t\t\t\t\t\t\t\t\t\tdata-test={`intent-chip-${intent}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"chip\"\n\t\t\t\t\t\t\t\t\t\tbuttonType=\"tertiaryGray\"\n\t\t\t\t\t\t\t\t\t\tbuttonText={labelFor(intent)}\n\t\t\t\t\t\t\t\t\t\tTrailingIcon={CrossIcon}\n\t\t\t\t\t\t\t\t\t\taria-label={`Remove ${labelFor(intent)}`}\n\t\t\t\t\t\t\t\t\t\tonClick={() => removeIntent(intent)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</ChipWrap>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{remainingOptions.length > 0 && (\n\t\t\t\t\t\t\t// Dashed \"+ Intent\" button on its own row under the chips;\n\t\t\t\t\t\t\t// clicking it opens the intent list directly — no intermediate\n\t\t\t\t\t\t\t// select input.\n\t\t\t\t\t\t\t<AddIntentRow>\n\t\t\t\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-dropdown\"\n\t\t\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\t\t\twidth=\"200px\"\n\t\t\t\t\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\t\t\t\t\toptions={remainingOptions}\n\t\t\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\t\t\taddIntent(v);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-button\"\n\t\t\t\t\t\t\t\t\t\tbuttonType=\"dashBold\"\n\t\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\t\t\t\t\tbuttonText=\"Intent\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</DropdownPopover>\n\t\t\t\t\t\t\t</AddIntentRow>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tThis agent takes over from your main assistant when this intent is\n\t\t\t\t\t\t\tdetected. The changeover is automatic when you go live.\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</FieldBlock>\n\t\t\t\t) : (\n\t\t\t\t\t<AiTextArea\n\t\t\t\t\t\tdata-test=\"custom-intent\"\n\t\t\t\t\t\tlabel=\"Describe the trigger\"\n\t\t\t\t\t\tvalue={trigger.custom_intent ?? ''}\n\t\t\t\t\t\tonChange={(text) =>\n\t\t\t\t\t\t\tpatch({ trigger: { ...trigger, custom_intent: text } })\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmaxLength={charLimits.custom_intent}\n\t\t\t\t\t\tplaceholder=\"e.g. The customer wants to cancel an order they placed.\"\n\t\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n\n// Keeps the dashed \"+ Intent\" button at its natural width on its own row.\nconst AddIntentRow = styled.div`\n\tdisplay: flex;\n`;\n"],"names":["STEP","STEP_DEFINITIONS","Step2WhenItStepsIn","value","patch","availableIntents","charLimits","useAgentBuilderContext","trigger","setMode","mode","addIntent","intentValue","removeIntent","labelFor","v","o","remainingOptions","jsx","StepSectionHeader","SectionBodyWrap","jsxs","CardRow","RadioCard","RadioButton","BASE_COLORS","RadioCardText","TitleSmall","COLORS","BodyCaption","FieldBlock","ChipWrap","intent","Button","CrossIcon","AddIntentRow","DropdownPopover","opt","unwrapDropdownValue","PlusIcon","AiTextArea","text","styled"],"mappings":";;;;;;;;;;;;;;;AAyBA,MAAMA,IAAOC,EAAiB,CAAC,GAElBC,IAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,kBAAAC,GAAkB,YAAAC,EAAA,IACvCC,EAAA,GACK,EAAE,SAAAC,MAAYL,GAIdM,IAAU,CAACC,MAChBN,EAAM;AAAA,IACL,SACCM,MAAS,oBACN,EAAE,GAAGF,GAAS,MAAAE,GAAM,eAAe,GAAA,IACnC,EAAE,GAAGF,GAAS,MAAAE,GAAM,SAAS,CAAA,EAAC;AAAA,EAAE,CACpC,GAEIC,IAAY,CAACC,MAAwB;AAC1C,IAAKJ,EAAQ,QAAQ,SAASI,CAAW,KACxCR,EAAM;AAAA,MACL,SAAS,EAAE,GAAGI,GAAS,SAAS,CAAC,GAAGA,EAAQ,SAASI,CAAW,EAAA;AAAA,IAAE,CAClE;AAAA,EAEH,GAEMC,IAAe,CAACD,MACrBR,EAAM;AAAA,IACL,SAAS;AAAA,MACR,GAAGI;AAAA,MACH,SAASA,EAAQ,QAAQ,OAAO,CAAC,MAAM,MAAMI,CAAW;AAAA,IAAA;AAAA,EACzD,CACA,GAEIE,IAAW,CAACC,MACjBV,EAAiB,KAAK,CAACW,MAAMA,EAAE,UAAUD,CAAC,GAAG,SAASA,GAEjDE,IAAmCZ,EACvC,OAAO,CAACW,MAAM,CAACR,EAAQ,QAAQ,SAASQ,EAAE,KAAK,CAAC,EAChD,IAAI,CAACA,OAAO,EAAE,OAAOA,EAAE,OAAO,OAAOA,EAAE,MAAA,EAAQ;AAEjD,2BACE,OAAA,EACA,UAAA;AAAA,IAAA,gBAAA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,CAG9C;AAAA,MAAA,EAAA,CACD,IAEA,gBAAAV;AAAA,QAACsB;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,OAAM;AAAA,UACN,OAAOhC,EAAQ,iBAAiB;AAAA,UAChC,UAAU,CAACiC,MACVrC,EAAM,EAAE,SAAS,EAAE,GAAGI,GAAS,eAAeiC,EAAA,GAAQ;AAAA,UAEvD,WAAWnC,EAAW;AAAA,UACtB,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACX,EAAA,CAEF;AAAA,EAAA,GACD;AAEF,GAGM6B,IAAeO,EAAO;AAAA;AAAA;"}
1
+ {"version":3,"file":"Step2WhenItStepsIn.js","sources":["../../../../../src/components/agent-builder/steps/Step2WhenItStepsIn.tsx"],"sourcesContent":["import CrossIcon from '@src/assets/icons/cross.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownPopover } from '@src/components/dropdown/DropdownPopover';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport { TriggerMode } from '../AgentBuilder.model';\nimport {\n\tCardRow,\n\tChipWrap,\n\tFieldBlock,\n\tRadioCard,\n\tRadioCardText,\n\tSectionBodyWrap,\n} from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { resolveAppToken, STEP_DEFINITION_TEMPLATES } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\nimport { appTypeLabel } from '../utils/mentionSerialization';\n\nconst STEP = STEP_DEFINITION_TEMPLATES[1];\n\nexport const Step2WhenItStepsIn: React.FC = () => {\n\tconst { value, patch, availableIntents, charLimits, applicationType } =\n\t\tuseAgentBuilderContext();\n\tconst { trigger } = value;\n\n\t// The first trigger mode is the host product's own intent classifier, so it's\n\t// named after whichever product the merchant is in — \"Manifest intent\" in\n\t// Manifest, \"BIK intent\" in BIK. `trigger.mode` stays `'manifest_intent'`:\n\t// it's a bik-models TriggerMode the backend keys off, not a label.\n\tconst appLabel = appTypeLabel(applicationType);\n\n\t// Only the mode changes here. The modes are mutually exclusive on save, but the\n\t// unselected one's data is kept until the merchant leaves this step (see\n\t// `triggerForSelectedMode` in AgentBuilderContext) — so toggling the radio to\n\t// compare the two options doesn't delete what they already picked or typed.\n\tconst setMode = (mode: TriggerMode) =>\n\t\tpatch({ trigger: { ...trigger, mode } });\n\n\tconst addIntent = (intentValue: string) => {\n\t\tif (!trigger.intents.includes(intentValue)) {\n\t\t\tpatch({\n\t\t\t\ttrigger: { ...trigger, intents: [...trigger.intents, intentValue] },\n\t\t\t});\n\t\t}\n\t};\n\n\tconst removeIntent = (intentValue: string) =>\n\t\tpatch({\n\t\t\ttrigger: {\n\t\t\t\t...trigger,\n\t\t\t\tintents: trigger.intents.filter((i) => i !== intentValue),\n\t\t\t},\n\t\t});\n\n\tconst labelFor = (v: string) =>\n\t\tavailableIntents.find((o) => o.value === v)?.label ?? v;\n\n\tconst remainingOptions: SingleOption[] = availableIntents\n\t\t.filter((o) => !trigger.intents.includes(o.value))\n\t\t.map((o) => ({ label: o.label, value: o.value }));\n\n\treturn (\n\t\t<div>\n\t\t\t<StepSectionHeader\n\t\t\t\ttitle={STEP.title}\n\t\t\t\thelper={resolveAppToken(STEP.helper, appLabel)}\n\t\t\t/>\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<CardRow>\n\t\t\t\t\t<RadioCard\n\t\t\t\t\t\tdata-test=\"trigger-mode-manifest\"\n\t\t\t\t\t\tselected={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\tonClick={() => setMode('manifest_intent')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tisActive={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\t\tonValueChange={() => setMode('manifest_intent')}\n\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t{`${appLabel} intent`}\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t{`${appLabel}'s AI classifier routes conversations automatically — no keywords needed.`}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t</RadioCard>\n\n\t\t\t\t\t<RadioCard\n\t\t\t\t\t\tdata-test=\"trigger-mode-custom\"\n\t\t\t\t\t\tselected={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\tonClick={() => setMode('custom_intent')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tisActive={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\t\tonValueChange={() => setMode('custom_intent')}\n\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\tCustom intent\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\tDefine your own trigger — use exact phrases or describe the\n\t\t\t\t\t\t\t\tcustomer&apos;s intent.\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t</RadioCard>\n\t\t\t\t</CardRow>\n\n\t\t\t\t{trigger.mode === 'manifest_intent' ? (\n\t\t\t\t\t<FieldBlock>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tIf customer talks about\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t{trigger.intents.length > 0 && (\n\t\t\t\t\t\t\t<ChipWrap>\n\t\t\t\t\t\t\t\t{trigger.intents.map((intent) => (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={intent}\n\t\t\t\t\t\t\t\t\t\tdata-test={`intent-chip-${intent}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"chip\"\n\t\t\t\t\t\t\t\t\t\tbuttonType=\"tertiaryGray\"\n\t\t\t\t\t\t\t\t\t\tbuttonText={labelFor(intent)}\n\t\t\t\t\t\t\t\t\t\tTrailingIcon={CrossIcon}\n\t\t\t\t\t\t\t\t\t\taria-label={`Remove ${labelFor(intent)}`}\n\t\t\t\t\t\t\t\t\t\tonClick={() => removeIntent(intent)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</ChipWrap>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{remainingOptions.length > 0 && (\n\t\t\t\t\t\t\t// Dashed \"+ Intent\" button on its own row under the chips;\n\t\t\t\t\t\t\t// clicking it opens the intent list directly — no intermediate\n\t\t\t\t\t\t\t// select input.\n\t\t\t\t\t\t\t<AddIntentRow>\n\t\t\t\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-dropdown\"\n\t\t\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\t\t\twidth=\"200px\"\n\t\t\t\t\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\t\t\t\t\toptions={remainingOptions}\n\t\t\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\t\t\taddIntent(v);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-button\"\n\t\t\t\t\t\t\t\t\t\tbuttonType=\"dashBold\"\n\t\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\t\t\t\t\tbuttonText=\"Intent\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</DropdownPopover>\n\t\t\t\t\t\t\t</AddIntentRow>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tThis agent takes over from your main assistant when this intent is\n\t\t\t\t\t\t\tdetected. The changeover is automatic when you go live.\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</FieldBlock>\n\t\t\t\t) : (\n\t\t\t\t\t<AiTextArea\n\t\t\t\t\t\tdata-test=\"custom-intent\"\n\t\t\t\t\t\tlabel=\"Describe the trigger\"\n\t\t\t\t\t\tvalue={trigger.custom_intent ?? ''}\n\t\t\t\t\t\tonChange={(text) =>\n\t\t\t\t\t\t\tpatch({ trigger: { ...trigger, custom_intent: text } })\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmaxLength={charLimits.custom_intent}\n\t\t\t\t\t\tplaceholder=\"e.g. The customer wants to cancel an order they placed.\"\n\t\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n\n// Keeps the dashed \"+ Intent\" button at its natural width on its own row.\nconst AddIntentRow = styled.div`\n\tdisplay: flex;\n`;\n"],"names":["STEP","STEP_DEFINITION_TEMPLATES","Step2WhenItStepsIn","value","patch","availableIntents","charLimits","applicationType","useAgentBuilderContext","trigger","appLabel","appTypeLabel","setMode","mode","addIntent","intentValue","removeIntent","labelFor","v","o","remainingOptions","jsx","StepSectionHeader","resolveAppToken","SectionBodyWrap","jsxs","CardRow","RadioCard","RadioButton","BASE_COLORS","RadioCardText","TitleSmall","COLORS","BodyCaption","FieldBlock","ChipWrap","intent","Button","CrossIcon","AddIntentRow","DropdownPopover","opt","unwrapDropdownValue","PlusIcon","AiTextArea","text","styled"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAOC,EAA0B,CAAC,GAE3BC,KAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,kBAAAC,GAAkB,YAAAC,GAAY,iBAAAC,EAAA,IACnDC,EAAA,GACK,EAAE,SAAAC,MAAYN,GAMdO,IAAWC,EAAaJ,CAAe,GAMvCK,IAAU,CAACC,MAChBT,EAAM,EAAE,SAAS,EAAE,GAAGK,GAAS,MAAAI,EAAA,GAAQ,GAElCC,IAAY,CAACC,MAAwB;AAC1C,IAAKN,EAAQ,QAAQ,SAASM,CAAW,KACxCX,EAAM;AAAA,MACL,SAAS,EAAE,GAAGK,GAAS,SAAS,CAAC,GAAGA,EAAQ,SAASM,CAAW,EAAA;AAAA,IAAE,CAClE;AAAA,EAEH,GAEMC,IAAe,CAACD,MACrBX,EAAM;AAAA,IACL,SAAS;AAAA,MACR,GAAGK;AAAA,MACH,SAASA,EAAQ,QAAQ,OAAO,CAAC,MAAM,MAAMM,CAAW;AAAA,IAAA;AAAA,EACzD,CACA,GAEIE,IAAW,CAACC,MACjBb,EAAiB,KAAK,CAACc,MAAMA,EAAE,UAAUD,CAAC,GAAG,SAASA,GAEjDE,IAAmCf,EACvC,OAAO,CAACc,MAAM,CAACV,EAAQ,QAAQ,SAASU,EAAE,KAAK,CAAC,EAChD,IAAI,CAACA,OAAO,EAAE,OAAOA,EAAE,OAAO,OAAOA,EAAE,MAAA,EAAQ;AAEjD,2BACE,OAAA,EACA,UAAA;AAAA,IAAA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W;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ;AAAA,QAAA,GAEF;AAAA,0BAEAV,GAAA,EAAY,OAAOD,EAAO,QAAQ,WAAW,UAAA,6HAAA,CAG9C;AAAA,MAAA,EAAA,CACD,IAEA,gBAAAX;AAAA,QAACuB;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,OAAM;AAAA,UACN,OAAOnC,EAAQ,iBAAiB;AAAA,UAChC,UAAU,CAACoC,MACVzC,EAAM,EAAE,SAAS,EAAE,GAAGK,GAAS,eAAeoC,EAAA,GAAQ;AAAA,UAEvD,WAAWvC,EAAW;AAAA,UACtB,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACX,EAAA,CAEF;AAAA,EAAA,GACD;AAEF,GAGMiC,IAAeO,EAAO;AAAA;AAAA;"}
@@ -1,2 +1,13 @@
1
1
  import { default as React } from 'react';
2
+ /**
3
+ * Step 4.
4
+ *
5
+ * **Manifest** (and any other host) keeps the original single free-text field:
6
+ * the method is implicit and the consumer always sends the seeded `'default'`.
7
+ *
8
+ * **BIK** picks a handover *method* first. "Use default settings" is selected by
9
+ * default and links out to where those defaults live; "Custom instructions" is
10
+ * deliberately disabled until that flow is built, so the free-text field only
11
+ * appears for an agent already saved with a non-default method.
12
+ */
2
13
  export declare const Step4HandoverRules: React.FC;
@@ -1,28 +1,132 @@
1
- import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
- import { SectionBodyWrap as s } from "../AgentBuilder.styled.js";
3
- import { AiTextArea as d } from "../components/AiTextArea.js";
4
- import { StepSectionHeader as m } from "../components/StepSectionHeader.js";
5
- import { STEP_DEFINITIONS as p } from "../constants/steps.js";
6
- import { useAgentBuilderContext as l } from "../context/AgentBuilderContext.js";
7
- const t = p[3], S = () => {
8
- const { value: o, patch: n, charLimits: a } = l(), { handover: r } = o;
9
- return /* @__PURE__ */ h("div", { className: "bik-agent-step bik-agent-step--handover", children: [
10
- /* @__PURE__ */ e(m, { title: t.title, helper: t.helper }),
11
- /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
12
- d,
13
- {
14
- "data-test": "handover-when",
15
- label: "Handover when",
16
- value: r.when,
17
- onChange: (i) => n({ handover: { ...r, when: i } }),
18
- maxLength: a.handoverWhen,
19
- placeholder: "e.g. Hand over if the customer is angry or asks for a human three times. Hand over if the order value exceeds ₹5,000.",
20
- minHeight: "120px"
21
- }
22
- ) })
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import x from "../../../assets/icons/RedirectToNew.svg.js";
3
+ import { RadioButton as m } from "../../radioButton/RadioButton.js";
4
+ import { TitleSmall as c, BodyCaption as p } from "../../TypographyStyle.js";
5
+ import { COLORS as a, BASE_COLORS as v } from "../../../constants/Theme.js";
6
+ import { SectionBodyWrap as u, FieldBlock as T, CardRow as w, RadioCard as f, RadioCardText as g, ChannelsLink as H } from "../AgentBuilder.styled.js";
7
+ import { AiTextArea as A } from "../components/AiTextArea.js";
8
+ import { StepSectionHeader as C } from "../components/StepSectionHeader.js";
9
+ import { STEP_DEFINITIONS as B } from "../constants/steps.js";
10
+ import { useAgentBuilderContext as S } from "../context/AgentBuilderContext.js";
11
+ import { appTypeLabel as O } from "../utils/mentionSerialization.js";
12
+ import { Tooltip as R } from "../../tooltips/Tooltip.js";
13
+ const d = B[3], h = "default", K = () => {
14
+ const { value: l, patch: i, applicationType: s, onSmartAgentHandover: o } = S(), { handover: n } = l, b = O(s) === "BIK", r = n.method !== h;
15
+ return b ? /* @__PURE__ */ t("div", { className: "bik-agent-step bik-agent-step--handover", children: [
16
+ /* @__PURE__ */ e(C, { title: d.title, helper: d.helper }),
17
+ /* @__PURE__ */ t(u, { children: [
18
+ /* @__PURE__ */ t(T, { children: [
19
+ /* @__PURE__ */ e(c, { color: a.content.primary, children: "Handover method" }),
20
+ /* @__PURE__ */ t(w, { children: [
21
+ /* @__PURE__ */ t(
22
+ f,
23
+ {
24
+ "data-test": "handover-method-default",
25
+ type: "button",
26
+ selected: !r,
27
+ onClick: () => i({ handover: { ...n, method: h } }),
28
+ children: [
29
+ /* @__PURE__ */ e(
30
+ m,
31
+ {
32
+ isActive: !r,
33
+ onValueChange: () => i({ handover: { ...n, method: h } }),
34
+ skipSelectingOff: !0,
35
+ activeColor: v.brand[800]
36
+ }
37
+ ),
38
+ /* @__PURE__ */ t(g, { children: [
39
+ /* @__PURE__ */ e(c, { color: a.content.primary, children: "Use default settings" }),
40
+ /* @__PURE__ */ t(p, { color: a.content.secondary, children: [
41
+ "As defined in",
42
+ " ",
43
+ o ? /* @__PURE__ */ t(
44
+ H,
45
+ {
46
+ "data-test": "handover-smart-agent-link",
47
+ type: "button",
48
+ onClick: (k) => {
49
+ k.stopPropagation(), o();
50
+ },
51
+ style: { display: "inline-flex" },
52
+ children: [
53
+ "Smart agent handover",
54
+ /* @__PURE__ */ e(x, { width: 12, height: 12 })
55
+ ]
56
+ }
57
+ ) : "Smart agent handover"
58
+ ] })
59
+ ] })
60
+ ]
61
+ }
62
+ ),
63
+ /* @__PURE__ */ e(
64
+ R,
65
+ {
66
+ body: "Custom handover rules are coming soon. For now this agent follows your smart agent handover settings.",
67
+ placement: "top",
68
+ children: /* @__PURE__ */ e(
69
+ "span",
70
+ {
71
+ style: {
72
+ flex: 1,
73
+ display: "flex",
74
+ cursor: "not-allowed"
75
+ },
76
+ children: /* @__PURE__ */ t(
77
+ f,
78
+ {
79
+ "data-test": "handover-method-custom",
80
+ type: "button",
81
+ disabled: !0,
82
+ selected: r,
83
+ children: [
84
+ /* @__PURE__ */ e(
85
+ m,
86
+ {
87
+ isActive: r,
88
+ isDisabled: !0,
89
+ onValueChange: () => {
90
+ },
91
+ skipSelectingOff: !0,
92
+ activeColor: v.brand[800]
93
+ }
94
+ ),
95
+ /* @__PURE__ */ t(g, { children: [
96
+ /* @__PURE__ */ e(c, { color: a.content.inactive, children: "Custom instructions" }),
97
+ /* @__PURE__ */ e(p, { color: a.content.inactive, children: "Write custom handover rules for this agent." })
98
+ ] })
99
+ ]
100
+ }
101
+ )
102
+ }
103
+ )
104
+ }
105
+ )
106
+ ] })
107
+ ] }),
108
+ r && /* @__PURE__ */ e(y, {})
109
+ ] })
110
+ ] }) : /* @__PURE__ */ t("div", { className: "bik-agent-step bik-agent-step--handover", children: [
111
+ /* @__PURE__ */ e(C, { title: d.title, helper: d.helper }),
112
+ /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(y, {}) })
23
113
  ] });
114
+ }, y = () => {
115
+ const { value: l, patch: i, charLimits: s } = S(), { handover: o } = l;
116
+ return /* @__PURE__ */ e(
117
+ A,
118
+ {
119
+ "data-test": "handover-when",
120
+ label: "Handover when",
121
+ value: o.when,
122
+ onChange: (n) => i({ handover: { ...o, when: n } }),
123
+ maxLength: s.handoverWhen,
124
+ placeholder: "e.g. Hand over if the customer is angry or asks for a human three times. Hand over if the order value exceeds ₹5,000.",
125
+ minHeight: "120px"
126
+ }
127
+ );
24
128
  };
25
129
  export {
26
- S as Step4HandoverRules
130
+ K as Step4HandoverRules
27
131
  };
28
132
  //# sourceMappingURL=Step4HandoverRules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step4HandoverRules.js","sources":["../../../../../src/components/agent-builder/steps/Step4HandoverRules.tsx"],"sourcesContent":["import React from 'react';\nimport { SectionBodyWrap } from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\n\nconst STEP = STEP_DEFINITIONS[3];\n\n// The \"Handover method\" radio section was removed: the method is UI-only and the\n// consumer always sends the seeded default ('default'); handover.method stays on\n// the value shape untouched.\nexport const Step4HandoverRules: React.FC = () => {\n\tconst { value, patch, charLimits } = useAgentBuilderContext();\n\tconst { handover } = value;\n\n\treturn (\n\t\t<div className=\"bik-agent-step bik-agent-step--handover\">\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<AiTextArea\n\t\t\t\t\tdata-test=\"handover-when\"\n\t\t\t\t\tlabel=\"Handover when\"\n\t\t\t\t\tvalue={handover.when}\n\t\t\t\t\tonChange={(text) => patch({ handover: { ...handover, when: text } })}\n\t\t\t\t\tmaxLength={charLimits.handoverWhen}\n\t\t\t\t\tplaceholder=\"e.g. Hand over if the customer is angry or asks for a human three times. Hand over if the order value exceeds ₹5,000.\"\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t/>\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","Step4HandoverRules","value","patch","charLimits","useAgentBuilderContext","handover","jsxs","jsx","StepSectionHeader","SectionBodyWrap","AiTextArea","text"],"mappings":";;;;;;AAOA,MAAMA,IAAOC,EAAiB,CAAC,GAKlBC,IAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,YAAAC,EAAA,IAAeC,EAAA,GAC/B,EAAE,UAAAC,MAAaJ;AAErB,SACC,gBAAAK,EAAC,OAAA,EAAI,WAAU,2CACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOV,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,sBAE1DW,GAAA,EACA,UAAA,gBAAAF;AAAA,MAACG;AAAA,MAAA;AAAA,QACA,aAAU;AAAA,QACV,OAAM;AAAA,QACN,OAAOL,EAAS;AAAA,QAChB,UAAU,CAACM,MAAST,EAAM,EAAE,UAAU,EAAE,GAAGG,GAAU,MAAMM,EAAA,GAAQ;AAAA,QACnE,WAAWR,EAAW;AAAA,QACtB,aAAY;AAAA,QACZ,WAAU;AAAA,MAAA;AAAA,IAAA,EACX,CACD;AAAA,EAAA,GACD;AAEF;"}
1
+ {"version":3,"file":"Step4HandoverRules.js","sources":["../../../../../src/components/agent-builder/steps/Step4HandoverRules.tsx"],"sourcesContent":["import RedirectIcon from '@src/assets/icons/RedirectToNew.svg';\nimport React from 'react';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport type { HandoverMethod } from '../AgentBuilder.model';\nimport {\n\tCardRow,\n\tChannelsLink,\n\tFieldBlock,\n\tRadioCard,\n\tRadioCardText,\n\tSectionBodyWrap,\n} from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\nimport { appTypeLabel } from '../utils/mentionSerialization';\n\nconst STEP = STEP_DEFINITIONS[3];\n\n/**\n * The stored `handover.method` that means \"inherit the store's smart-agent\n * handover settings\" — the BIK default, and the only method selectable today.\n */\nconst DEFAULT_METHOD: HandoverMethod = 'default';\n\n/**\n * Step 4.\n *\n * **Manifest** (and any other host) keeps the original single free-text field:\n * the method is implicit and the consumer always sends the seeded `'default'`.\n *\n * **BIK** picks a handover *method* first. \"Use default settings\" is selected by\n * default and links out to where those defaults live; \"Custom instructions\" is\n * deliberately disabled until that flow is built, so the free-text field only\n * appears for an agent already saved with a non-default method.\n */\nexport const Step4HandoverRules: React.FC = () => {\n\tconst { value, patch, applicationType, onSmartAgentHandover } =\n\t\tuseAgentBuilderContext();\n\tconst { handover } = value;\n\n\tconst isBik = appTypeLabel(applicationType) === 'BIK';\n\t// Anything other than the default method means the merchant is on custom\n\t// instructions, so the free-text field is what they need to see.\n\tconst usesCustom = handover.method !== DEFAULT_METHOD;\n\n\tif (!isBik) {\n\t\treturn (\n\t\t\t<div className=\"bik-agent-step bik-agent-step--handover\">\n\t\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\t\t\t\t<SectionBodyWrap>\n\t\t\t\t\t<HandoverWhenField />\n\t\t\t\t</SectionBodyWrap>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"bik-agent-step bik-agent-step--handover\">\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<FieldBlock>\n\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\tHandover method\n\t\t\t\t\t</TitleSmall>\n\n\t\t\t\t\t<CardRow>\n\t\t\t\t\t\t<RadioCard\n\t\t\t\t\t\t\tdata-test=\"handover-method-default\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tselected={!usesCustom}\n\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\tpatch({ handover: { ...handover, method: DEFAULT_METHOD } })\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\t\tisActive={!usesCustom}\n\t\t\t\t\t\t\t\tonValueChange={() =>\n\t\t\t\t\t\t\t\t\tpatch({ handover: { ...handover, method: DEFAULT_METHOD } })\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\tUse default settings\n\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\tAs defined in{' '}\n\t\t\t\t\t\t\t\t\t{onSmartAgentHandover ? (\n\t\t\t\t\t\t\t\t\t\t<ChannelsLink\n\t\t\t\t\t\t\t\t\t\t\tdata-test=\"handover-smart-agent-link\"\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t// The link sits inside the card's own click target, so\n\t\t\t\t\t\t\t\t\t\t\t// stop the click bubbling up and re-selecting the card.\n\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t\tonSmartAgentHandover();\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tstyle={{ display: 'inline-flex' }}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tSmart agent handover\n\t\t\t\t\t\t\t\t\t\t\t<RedirectIcon width={12} height={12} />\n\t\t\t\t\t\t\t\t\t\t</ChannelsLink>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t'Smart agent handover'\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t\t</RadioCard>\n\n\t\t\t\t\t\t{/* Custom handover rules aren't built yet — the card is shown so the\n\t\t\t\t\t\t merchant knows it's coming, but it can't be selected. */}\n\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\tbody=\"Custom handover rules are coming soon. For now this agent follows your smart agent handover settings.\"\n\t\t\t\t\t\t\tplacement=\"top\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{/* A disabled <button> fires no mouse events, so the tooltip would\n\t\t\t\t\t\t\t never open on the card itself — the span is the hover target\n\t\t\t\t\t\t\t (same wrapper IconButton uses for its disabled tooltip). It also\n\t\t\t\t\t\t\t has to carry the card's `flex: 1`, since it is now the flex item. */}\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tcursor: 'not-allowed',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RadioCard\n\t\t\t\t\t\t\t\t\tdata-test=\"handover-method-custom\"\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\t\tselected={usesCustom}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\t\t\t\tisActive={usesCustom}\n\t\t\t\t\t\t\t\t\t\tisDisabled\n\t\t\t\t\t\t\t\t\t\tonValueChange={() => undefined}\n\t\t\t\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.inactive}>\n\t\t\t\t\t\t\t\t\t\t\tCustom instructions\n\t\t\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.inactive}>\n\t\t\t\t\t\t\t\t\t\t\tWrite custom handover rules for this agent.\n\t\t\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t\t\t\t</RadioCard>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t</CardRow>\n\t\t\t\t</FieldBlock>\n\n\t\t\t\t{usesCustom && <HandoverWhenField />}\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n\n/** The free-text \"Handover when\" field, shared by both layouts. */\nconst HandoverWhenField: React.FC = () => {\n\tconst { value, patch, charLimits } = useAgentBuilderContext();\n\tconst { handover } = value;\n\n\treturn (\n\t\t<AiTextArea\n\t\t\tdata-test=\"handover-when\"\n\t\t\tlabel=\"Handover when\"\n\t\t\tvalue={handover.when}\n\t\t\tonChange={(text) => patch({ handover: { ...handover, when: text } })}\n\t\t\tmaxLength={charLimits.handoverWhen}\n\t\t\tplaceholder=\"e.g. Hand over if the customer is angry or asks for a human three times. Hand over if the order value exceeds ₹5,000.\"\n\t\t\tminHeight=\"120px\"\n\t\t/>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","DEFAULT_METHOD","Step4HandoverRules","value","patch","applicationType","onSmartAgentHandover","useAgentBuilderContext","handover","isBik","appTypeLabel","usesCustom","jsxs","jsx","StepSectionHeader","SectionBodyWrap","FieldBlock","TitleSmall","COLORS","CardRow","RadioCard","RadioButton","BASE_COLORS","RadioCardText","BodyCaption","ChannelsLink","event","RedirectIcon","Tooltip","HandoverWhenField","charLimits","AiTextArea","text"],"mappings":";;;;;;;;;;;;AAqBA,MAAMA,IAAOC,EAAiB,CAAC,GAMzBC,IAAiC,WAa1BC,IAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,iBAAAC,GAAiB,sBAAAC,EAAA,IACtCC,EAAA,GACK,EAAE,UAAAC,MAAaL,GAEfM,IAAQC,EAAaL,CAAe,MAAM,OAG1CM,IAAaH,EAAS,WAAWP;AAEvC,SAAKQ,IAYJ,gBAAAG,EAAC,OAAA,EAAI,WAAU,2CACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOf,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,sBAE1DgB,GAAA,EACA,UAAA;AAAA,MAAA,gBAAAH,EAACI,GAAA,EACA,UAAA;AAAA,QAAA,gBAAAH,EAACI,GAAA,EAAW,OAAOC,EAAO,QAAQ,SAAS,UAAA,mBAE3C;AAAA,0BAECC,GAAA,EACA,UAAA;AAAA,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACA,aAAU;AAAA,cACV,MAAK;AAAA,cACL,UAAU,CAACT;AAAA,cACX,SAAS,MACRP,EAAM,EAAE,UAAU,EAAE,GAAGI,GAAU,QAAQP,EAAA,GAAkB;AAAA,cAG5D,UAAA;AAAA,gBAAA,gBAAAY;AAAA,kBAACQ;AAAA,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