@appbaseio/reactivesearch-vue 3.0.0-rc.1 → 3.0.0-rc.10

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 (90) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +12245 -1576
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -5
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{Button-d4da7470.js → Button-f96a0570.js} +14 -7
  6. package/dist/cjs/{ComponentWrapper-9146d811.js → ComponentWrapper-0334c14b.js} +4 -1
  7. package/dist/cjs/{DropDown-b16418e9.js → DropDown-eb2aeafa.js} +19 -8
  8. package/dist/cjs/DynamicRangeSlider.js +6 -4
  9. package/dist/cjs/Input-18e425fb.js +97 -0
  10. package/dist/cjs/MultiDropdownList.js +8 -7
  11. package/dist/cjs/MultiList.js +5 -5
  12. package/dist/cjs/MultiRange.js +4 -4
  13. package/dist/cjs/{Pagination-b953a80a.js → Pagination-c44adce0.js} +2 -2
  14. package/dist/cjs/{PreferencesConsumer-85dee673.js → PreferencesConsumer-7bee3c57.js} +1 -1
  15. package/dist/cjs/RangeInput.js +7 -5
  16. package/dist/cjs/RangeSlider.js +7 -5
  17. package/dist/cjs/ReactiveBase.js +16 -18
  18. package/dist/cjs/ReactiveComponent.js +4 -4
  19. package/dist/cjs/ReactiveGoogleMap.js +7 -6
  20. package/dist/cjs/ReactiveList.js +6 -6
  21. package/dist/cjs/ResultCard.js +1 -1
  22. package/dist/cjs/ResultList.js +1 -1
  23. package/dist/cjs/SelectedFilters.js +4 -3
  24. package/dist/cjs/SingleDropdownList.js +8 -7
  25. package/dist/cjs/SingleList.js +5 -5
  26. package/dist/cjs/SingleRange.js +4 -4
  27. package/dist/cjs/StateProvider.js +1 -1
  28. package/dist/cjs/ToggleButton.js +6 -5
  29. package/dist/cjs/{index-779ed366.js → index-1f41363f.js} +7 -3
  30. package/dist/cjs/index.js +15 -9
  31. package/dist/cjs/{install-7cdf6798.js → install-0e8729aa.js} +1688 -284
  32. package/dist/cjs/install.js +14 -9
  33. package/dist/cjs/version.js +1 -1
  34. package/dist/cjs/{vueTypes-1bf00978.js → vueTypes-0dba0df2.js} +18 -0
  35. package/dist/components/ReactiveBase/ReactiveBase.d.ts +33 -0
  36. package/dist/components/basic/ReactiveComponent.d.ts +30 -0
  37. package/dist/components/basic/ReactiveComponentPrivate.d.ts +10 -0
  38. package/dist/components/basic/SelectedFilters.d.ts +24 -0
  39. package/dist/components/basic/StateProvider.d.ts +12 -0
  40. package/dist/components/list/MultiDropdownList.d.ts +49 -0
  41. package/dist/components/list/MultiList.d.ts +47 -0
  42. package/dist/components/list/SingleDropdownList.d.ts +47 -0
  43. package/dist/components/list/SingleList.d.ts +47 -0
  44. package/dist/components/list/ToggleButton.d.ts +33 -0
  45. package/dist/components/list/TreeList.d.ts +48 -0
  46. package/dist/components/range/DynamicRangeSlider.d.ts +38 -0
  47. package/dist/components/range/MultiRange.d.ts +30 -0
  48. package/dist/components/range/RangeInput.d.ts +30 -0
  49. package/dist/components/range/RangeSlider.d.ts +40 -0
  50. package/dist/components/range/SingleRange.d.ts +28 -0
  51. package/dist/components/result/ReactiveList.d.ts +55 -0
  52. package/dist/components/result/ResultCard.d.ts +10 -0
  53. package/dist/components/result/ResultList.d.ts +11 -0
  54. package/dist/components/search/AIAnswer.d.ts +39 -0
  55. package/dist/components/search/SearchBox.d.ts +106 -0
  56. package/dist/es/{Button-fd869491.js → Button-5c2cf399.js} +14 -7
  57. package/dist/es/{ComponentWrapper-8a3c388d.js → ComponentWrapper-46d04344.js} +4 -1
  58. package/dist/es/{DropDown-fc1fef02.js → DropDown-4a7b4864.js} +19 -9
  59. package/dist/es/DynamicRangeSlider.js +7 -5
  60. package/dist/es/Input-26360449.js +89 -0
  61. package/dist/es/MultiDropdownList.js +8 -7
  62. package/dist/es/MultiList.js +5 -5
  63. package/dist/es/MultiRange.js +4 -4
  64. package/dist/es/{Pagination-c2745bec.js → Pagination-aae4e95f.js} +2 -2
  65. package/dist/es/{PreferencesConsumer-b058d14e.js → PreferencesConsumer-0856ed43.js} +1 -1
  66. package/dist/es/RangeInput.js +7 -5
  67. package/dist/es/RangeSlider.js +8 -6
  68. package/dist/es/ReactiveBase.js +16 -18
  69. package/dist/es/ReactiveComponent.js +4 -4
  70. package/dist/es/ReactiveGoogleMap.js +7 -6
  71. package/dist/es/ReactiveList.js +6 -6
  72. package/dist/es/ResultCard.js +1 -1
  73. package/dist/es/ResultList.js +1 -1
  74. package/dist/es/SelectedFilters.js +4 -3
  75. package/dist/es/SingleDropdownList.js +8 -7
  76. package/dist/es/SingleList.js +5 -5
  77. package/dist/es/SingleRange.js +4 -4
  78. package/dist/es/StateProvider.js +1 -1
  79. package/dist/es/ToggleButton.js +6 -5
  80. package/dist/es/{index-882489e1.js → index-104f1dfb.js} +7 -3
  81. package/dist/es/index.js +15 -10
  82. package/dist/es/{install-0c7962bc.js → install-78ac6225.js} +1651 -248
  83. package/dist/es/install.js +14 -9
  84. package/dist/es/version.js +1 -1
  85. package/dist/es/{vueTypes-f1923c72.js → vueTypes-409296a9.js} +18 -0
  86. package/dist/index.d.ts +39 -0
  87. package/dist/types.ts +224 -0
  88. package/package.json +8 -4
  89. package/dist/cjs/Input-497be42a.js +0 -74
  90. package/dist/es/Input-f7499ef8.js +0 -69
@@ -11,22 +11,27 @@ var VueTypes = _interopDefault(require('vue-types'));
11
11
  var helper = require('@appbaseio/reactivecore/lib/utils/helper');
12
12
  var vueEmotion = require('@appbaseio/vue-emotion');
13
13
  var css = require('@emotion/css');
14
- var Button = require('./Button-d4da7470.js');
15
- var vueTypes = require('./vueTypes-1bf00978.js');
14
+ var polished = require('polished');
15
+ var Button = require('./Button-f96a0570.js');
16
+ var vueTypes = require('./vueTypes-0dba0df2.js');
16
17
  var ReactiveList = require('./ReactiveList.js');
17
18
  var transform = require('@appbaseio/reactivecore/lib/utils/transform');
18
- var index = require('./index-779ed366.js');
19
- var ComponentWrapper = require('./ComponentWrapper-9146d811.js');
20
- var PreferencesConsumer = require('./PreferencesConsumer-85dee673.js');
19
+ var index = require('./index-1f41363f.js');
20
+ var ComponentWrapper = require('./ComponentWrapper-0334c14b.js');
21
+ var PreferencesConsumer = require('./PreferencesConsumer-7bee3c57.js');
21
22
  var Title = require('./Title-8802a218.js');
22
23
  var ListItem = require('./ListItem-7a682970.js');
23
24
  var Flex = require('./Flex-ddde6d26.js');
25
+ var analytics = require('@appbaseio/reactivecore/lib/actions/analytics');
24
26
  var ReactiveBase = require('./ReactiveBase.js');
25
27
  var hotkeys = _interopDefault(require('hotkeys-js'));
26
- var DropDown = require('./DropDown-b16418e9.js');
27
- var Input = require('./Input-497be42a.js');
28
+ var remarkable = require('remarkable');
29
+ var xss = _interopDefault(require('xss'));
30
+ var DropDown = require('./DropDown-eb2aeafa.js');
31
+ var Input = require('./Input-18e425fb.js');
28
32
  var Container = require('./Container-29f049b2.js');
29
33
  var Highlight = _interopDefault(require('vue-highlight-words'));
34
+ var query = require('@appbaseio/reactivecore/lib/actions/query');
30
35
  var suggestions = require('@appbaseio/reactivecore/lib/utils/suggestions');
31
36
  var FormControlList = require('./FormControlList-fadd792f.js');
32
37
  var utils = require('./utils-c9bd5628.js');
@@ -48,7 +53,13 @@ var ResultList = require('./ResultList.js');
48
53
  var StateProvider = require('./StateProvider.js');
49
54
 
50
55
  var _templateObject;
51
- var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
56
+ var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n \tdisplay: flex;\n\talign-items: stretch;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\n\t", "\n\t", "\n\t};\n"])), function (_ref) {
57
+ var theme = _ref.theme,
58
+ searchBox = _ref.searchBox;
59
+ return searchBox && "background-color: " + (theme.colors.backgroundColor || '#fafafa') + ";\n\t\tcolor: " + (theme.colors.textColor || '#fff') + ";\n\n\t\t&:focus-within {\n\t\t\tbackground-color: " + (theme.colors.backgroundColor || '#fff') + ";\n\t\t}";
60
+ }, function (props) {
61
+ return props.isOpen && "box-shadow: rgb(0 0 0 / 20%) 0px 0px 15px;\n\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;";
62
+ });
52
63
  InputGroup.defaultProps = {
53
64
  className: 'input-group'
54
65
  };
@@ -193,10 +204,34 @@ var SearchSvg = {
193
204
  }
194
205
  };
195
206
 
196
- var _templateObject$3;
207
+ function styleInject(css, ref) {
208
+ if (ref === void 0) ref = {};
209
+ var insertAt = ref.insertAt;
210
+ if (!css || typeof document === 'undefined') {
211
+ return;
212
+ }
213
+ var head = document.head || document.getElementsByTagName('head')[0];
214
+ var style = document.createElement('style');
215
+ style.type = 'text/css';
216
+ if (insertAt === 'top') {
217
+ if (head.firstChild) {
218
+ head.insertBefore(style, head.firstChild);
219
+ } else {
220
+ head.appendChild(style);
221
+ }
222
+ } else {
223
+ head.appendChild(style);
224
+ }
225
+ if (style.styleSheet) {
226
+ style.styleSheet.cssText = css;
227
+ } else {
228
+ style.appendChild(document.createTextNode(css));
229
+ }
230
+ }
231
+
232
+ var css_248z = "#el_TvxDfTAtKp {\n stroke: none;\n stroke-width: 1;\n fill: none;\n}\n#el_D93PK3GbmJ {\n -webkit-transform: translate(163px, 131px);\n transform: translate(163px, 131px);\n fill: #d8d8d8;\n}\n";
233
+ styleInject(css_248z);
197
234
 
198
- // eslint-disable-next-line
199
- vueEmotion.createGlobalStyle(_templateObject$3 || (_templateObject$3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t#el_TvxDfTAtKp {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_D93PK3GbmJ {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t\tfill: #d8d8d8;\n\t}\n"])));
200
235
  var MicSvg = {
201
236
  name: 'MicSvg',
202
237
  props: ['className'],
@@ -230,10 +265,9 @@ var MicSvg = {
230
265
  }
231
266
  };
232
267
 
233
- var _templateObject$4;
268
+ var css_248z$1 = "#el_X81iT9kZYo {\n stroke: none;\n stroke-width: 1;\n fill: none;\n}\n#el_gMpyalCphp {\n -webkit-transform: translate(163px, 131px);\n transform: translate(163px, 131px);\n}\n#el_c7H-3u-D4l {\n fill: #d8d8d8;\n}\n#el_qhFcdAAFwo {\n fill: #d8d8d8;\n}\n#el_M8X8g37WOI {\n stroke: #e83137;\n stroke-width: 21;\n}\n";
269
+ styleInject(css_248z$1);
234
270
 
235
- // eslint-disable-next-line
236
- vueEmotion.createGlobalStyle(_templateObject$4 || (_templateObject$4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t#el_X81iT9kZYo {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_gMpyalCphp {\n\t\t-webkit-transform: translate(163px, 131px);\n\t\ttransform: translate(163px, 131px);\n\t}\n\t#el_c7H-3u-D4l {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_qhFcdAAFwo {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_M8X8g37WOI {\n\t\tstroke: #e83137;\n\t\tstroke-width: 21;\n\t}\n"])));
237
271
  var MuteSvg = {
238
272
  name: 'MuteSvg',
239
273
  props: ['className'],
@@ -276,10 +310,9 @@ var MuteSvg = {
276
310
  }
277
311
  };
278
312
 
279
- var _templateObject$5;
313
+ var css_248z$2 = "@-webkit-keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n 0% {\n opacity: 0;\n }\n 13.89% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n 0% {\n opacity: 0;\n }\n 13.89% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n 0% {\n opacity: 0;\n }\n 27.78% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n 0% {\n opacity: 0;\n }\n 27.78% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n 0% {\n opacity: 0;\n }\n 41.67% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n 0% {\n opacity: 0;\n }\n 41.67% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n 0% {\n opacity: 0;\n }\n 55.56% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n 0% {\n opacity: 0;\n }\n 55.56% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n 0% {\n opacity: 0;\n }\n 69.44% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n 0% {\n opacity: 0;\n }\n 69.44% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n 0% {\n opacity: 0;\n }\n 83.33% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n 0% {\n opacity: 0;\n }\n 83.33% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n 0% {\n opacity: 0;\n }\n 97.22% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n 0% {\n opacity: 0;\n }\n 97.22% {\n opacity: 1;\n }\n 100% {\n opacity: 1;\n }\n}\n#el_hiibMG0x- * {\n -webkit-animation-duration: 1.2s;\n animation-duration: 1.2s;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);\n animation-timing-function: cubic-bezier(0, 0, 1, 1);\n}\n#el_QJeJ_2CDw5 {\n stroke: none;\n stroke-width: 1;\n fill: none;\n}\n#el_UYYCfubTRf {\n -webkit-transform: translate(163px, 123px);\n transform: translate(163px, 123px);\n}\n#el_uzZNtK32Zi {\n fill: #d8d8d8;\n}\n#el_EYKQ2N9Kgy {\n fill: #d8d8d8;\n}\n#el_6SDP2LAgKC {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n}\n#el_-Vm65Ltfy7 {\n fill: #0B6AFF;\n}\n#el_q04iZcSim4 {\n fill: #d8d8d8;\n}\n#el_6WKby7wXqV {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_9bggsfQOtU {\n fill: #0B6AFF;\n}\n#el_NKxqi9eIym {\n fill: #d8d8d8;\n}\n#el_Wi-my975tM {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_zclQ34fvf7 {\n fill: #0B6AFF;\n}\n#el_1OsvRT8HkeZ {\n fill: #d8d8d8;\n}\n#el_DkfFFTaFxy8 {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_aa9sjx4H0vA {\n fill: #0B6AFF;\n}\n#el_tea114vWg0J {\n fill: #d8d8d8;\n}\n#el_34IgwiMB5rf {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_z5u6RAFhx7d {\n fill: #0B6AFF;\n}\n#el_7nfuWmA5Uhy {\n fill: #d8d8d8;\n}\n#el_DeebuCsPTGA {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el__ZcqlS20zcw {\n fill: #0B6AFF;\n}\n#el_8DnEQnD7VWV {\n fill: #d8d8d8;\n}\n#el_ZOjjrPTvyrv {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_FYYKCI_u24e {\n fill: #0B6AFF;\n}\n#el_XZty4MnTp5Y {\n fill: #d8d8d8;\n}\n#el_2FATegVmf0K {\n -webkit-transform: translate(37.846924px, 0px);\n transform: translate(37.846924px, 0px);\n -webkit-animation-fill-mode: backwards;\n animation-fill-mode: backwards;\n opacity: 0;\n -webkit-animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n -webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n}\n#el_RMT1KUfbdF8 {\n fill: #0B6AFF;\n}\n#el_RgLcovvFiO1 {\n fill: #d8d8d8;\n}\n";
314
+ styleInject(css_248z$2);
280
315
 
281
- // eslint-disable-next-line
282
- vueEmotion.createGlobalStyle(_templateObject$5 || (_templateObject$5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t@-webkit-keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_6WKby7wXqV_an_qqO-rxbNc {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t13.89% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_Wi-my975tM_an_XhXP1epXB {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t27.78% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DkfFFTaFxy8_an_T2XxzvIaA {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t41.67% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_34IgwiMB5rf_an_TPom3H2LI {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t55.56% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_DeebuCsPTGA_an_aYTRBE7Na {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t69.44% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_ZOjjrPTvyrv_an_l_BjBNzXw {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t83.33% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@-webkit-keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t@keyframes kf_el_2FATegVmf0K_an_wLg4ofuFx {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t}\n\t\t97.22% {\n\t\t\topacity: 1;\n\t\t}\n\t\t100% {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t#el_hiibMG0x- * {\n\t\t-webkit-animation-duration: 1.2s;\n\t\tanimation-duration: 1.2s;\n\t\t-webkit-animation-iteration-count: infinite;\n\t\tanimation-iteration-count: infinite;\n\t\t-webkit-animation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0, 0, 1, 1);\n\t}\n\t#el_QJeJ_2CDw5 {\n\t\tstroke: none;\n\t\tstroke-width: 1;\n\t\tfill: none;\n\t}\n\t#el_UYYCfubTRf {\n\t\t-webkit-transform: translate(163px, 123px);\n\t\ttransform: translate(163px, 123px);\n\t}\n\t#el_uzZNtK32Zi {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_EYKQ2N9Kgy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6SDP2LAgKC {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t}\n\t#el_-Vm65Ltfy7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_q04iZcSim4 {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_6WKby7wXqV {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\tanimation-name: kf_el_6WKby7wXqV_an_qqO-rxbNc;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_9bggsfQOtU {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_NKxqi9eIym {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_Wi-my975tM {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\tanimation-name: kf_el_Wi-my975tM_an_XhXP1epXB;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_zclQ34fvf7 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_1OsvRT8HkeZ {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DkfFFTaFxy8 {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\tanimation-name: kf_el_DkfFFTaFxy8_an_T2XxzvIaA;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_aa9sjx4H0vA {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_tea114vWg0J {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_34IgwiMB5rf {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\tanimation-name: kf_el_34IgwiMB5rf_an_TPom3H2LI;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_z5u6RAFhx7d {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_7nfuWmA5Uhy {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_DeebuCsPTGA {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\tanimation-name: kf_el_DeebuCsPTGA_an_aYTRBE7Na;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el__ZcqlS20zcw {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_8DnEQnD7VWV {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_ZOjjrPTvyrv {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\tanimation-name: kf_el_ZOjjrPTvyrv_an_l_BjBNzXw;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_FYYKCI_u24e {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_XZty4MnTp5Y {\n\t\tfill: #d8d8d8;\n\t}\n\t#el_2FATegVmf0K {\n\t\t-webkit-transform: translate(37.846924px, 0px);\n\t\ttransform: translate(37.846924px, 0px);\n\t\t-webkit-animation-fill-mode: backwards;\n\t\tanimation-fill-mode: backwards;\n\t\topacity: 0;\n\t\t-webkit-animation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\tanimation-name: kf_el_2FATegVmf0K_an_wLg4ofuFx;\n\t\t-webkit-animation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t\tanimation-timing-function: cubic-bezier(0.42, 0, 1, 1);\n\t}\n\t#el_RMT1KUfbdF8 {\n\t\tfill: #0B6AFF;\n\t}\n\t#el_RgLcovvFiO1 {\n\t\tfill: #d8d8d8;\n\t}\n"])));
283
316
  var ListenSvg = {
284
317
  name: 'ListenSvg',
285
318
  props: ['className'],
@@ -544,7 +577,7 @@ var Mic = {
544
577
  }
545
578
  this.instance = new SpeechRecognition();
546
579
  this.instance.continuous = true;
547
- this.instance.interimResults = true;
580
+ this.instance.interimResults = false;
548
581
  this.instance.lang = lang;
549
582
  if (getInstance) {
550
583
  getInstance(this.instance);
@@ -604,18 +637,18 @@ var Mic = {
604
637
  case STATUS.active:
605
638
  return vue.createVNode(ListenSvg, {
606
639
  "className": className,
607
- "nativeOnClick": this.handleClick
640
+ "onClick": this.handleClick
608
641
  }, null);
609
642
  case STATUS.stopped:
610
643
  case STATUS.denied:
611
644
  return vue.createVNode(MuteSvg, {
612
645
  "className": className,
613
- "nativeOnClick": this.handleClick
646
+ "onClick": this.handleClick
614
647
  }, null);
615
648
  default:
616
649
  return vue.createVNode(MicSvg, {
617
650
  "className": className,
618
- "nativeOnClick": this.handleClick
651
+ "onClick": this.handleClick
619
652
  }, null);
620
653
  }
621
654
  }
@@ -727,8 +760,8 @@ var CustomSvg = {
727
760
  }
728
761
  };
729
762
 
730
- var _templateObject$6;
731
- var AutofillSvgIcon = vueEmotion.styled('button')(_templateObject$6 || (_templateObject$6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tmargin-left: auto;\n\tposition: relative;\n\tright: -3px;\n\tborder: none;\n\toutline: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tz-index: 111000;\n\n\tsvg {\n\t\tcursor: pointer;\n\t\tfill: #707070;\n\t\theight: 20px;\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tfill: #1c1a1a;\n\t\t}\n\t}\n"])));
763
+ var _templateObject$3;
764
+ var AutofillSvgIcon = vueEmotion.styled('button')(_templateObject$3 || (_templateObject$3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tmargin-left: auto;\n\tposition: relative;\n\tright: -3px;\n\tborder: none;\n\toutline: none;\n\tbackground: transparent;\n\tpadding: 0;\n\tz-index: 111000;\n\n\tsvg {\n\t\tcursor: pointer;\n\t\tfill: #707070;\n\t\theight: 20px;\n\t}\n\n\t&:hover {\n\t\tsvg {\n\t\t\tfill: #1c1a1a;\n\t\t}\n\t}\n"])));
732
765
  var AutoFillSvg = {
733
766
  name: 'AutoFillSvg',
734
767
  render: function render() {
@@ -752,13 +785,313 @@ var AutoFillSvg = {
752
785
  }
753
786
  };
754
787
 
755
- var _templateObject$7, _templateObject2;
756
- var TagsContainer = vueEmotion.styled('div')(_templateObject$7 || (_templateObject$7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
788
+ var _templateObject$4, _templateObject2;
789
+ var TagsContainer = vueEmotion.styled('div')(_templateObject$4 || (_templateObject$4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
757
790
  var TagItem = vueEmotion.styled('span')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
758
791
 
792
+ var _templateObject$5;
793
+ var AutosuggestFooterContainer = vueEmotion.styled('div')(_templateObject$5 || (_templateObject$5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tcolor: #8792a2;\n\tbackground: #f7fafc;\n\tpadding: 10px;\n\theight: 40px;\n"])));
794
+
795
+ var _templateObject$6, _templateObject2$1, _templateObject3;
796
+ var skeletonAnimation = css.keyframes(_templateObject$6 || (_templateObject$6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
797
+ var SkeletonLoader = vueEmotion.styled('div')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
798
+ var SkeletonLine = vueEmotion.styled('div')(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: 20px;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\trgba(220, 220, 220, 0.5) 25%,\n\t\trgba(240, 240, 240, 0.9) 50%,\n\t\trgba(220, 220, 220, 0.5) 75%\n\t);\n\tbackground-size: 200% 100%;\n\tanimation: ", " 1.5s infinite;\n"])), skeletonAnimation);
799
+ var HorizontalSkeletonLoader = vue.defineComponent({
800
+ name: 'HorizontalSkeletonLoader',
801
+ render: function render() {
802
+ return vue.createVNode(SkeletonLoader, null, {
803
+ "default": function _default() {
804
+ return [vue.createVNode(SkeletonLine, null, null), vue.createVNode(SkeletonLine, null, null), vue.createVNode(SkeletonLine, null, null), vue.createVNode(SkeletonLine, null, null)];
805
+ }
806
+ });
807
+ }
808
+ });
809
+
810
+ var _templateObject$7, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
811
+ var Chatbox = vueEmotion.styled('div')(_templateObject$7 || (_templateObject$7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tposition: relative;\n\tmargin: 0 auto;\n\tpadding: 10px;\n\tbackground-color: #fafafa;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\tmargin-bottom: 20px;\n\tbackground-color: ", ";\n"])), function (props) {
812
+ return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
813
+ });
814
+ var ChatContainer = vueEmotion.styled('div')(_templateObject2$2 || (_templateObject2$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tposition: relative;\n\t.--ai-answer-error-container {\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tbottom: 0px;\n\t\t", ";\n\t\tz-index: 1;\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\twidth: 100%;\n\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tpadding: 10px;\n\t\t\tbackground-color: ", ";\n\t\t\tbox-shadow: 0 -5px 5px -2px\n\t\t\t\t", ";\n\n\t\t\tspan {\n\t\t\t\tmargin-bottom: 5px;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t}\n\t\t}\n\t}\n\n\t", ";\n"])), function (props) {
815
+ return props.showInput ? 'bottom: 48px;' : '';
816
+ }, function (props) {
817
+ return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
818
+ }, function (props) {
819
+ return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
820
+ }, function (props) {
821
+ return props.showInput ? ".--ai-answer-feedback-container {\n\t\tmargin-top: 15px;\n\t\tmargin-bottom: -10px;\n\t}" : ".--ai-answer-feedback-container {\n\t\tmargin-top: 4px;\n\t}";
822
+ });
823
+ var MessagesContainer = vueEmotion.styled('div')(_templateObject3$1 || (_templateObject3$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tmax-height: 400px;\n overflow-y: auto;\n\tpadding: 10px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 200px;\n\n}};\n"])));
824
+ var typingDots = css.keyframes(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-70%);\n }\n 100% {\n transform: translateY(0);\n }\n"])));
825
+ var TypingIndicator = vueEmotion.styled('div')(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin: 5px !important;\n"])));
826
+ var TypingDot = vueEmotion.styled('div')(_templateObject6 || (_templateObject6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: ", ";\n\tborder-radius: 50%;\n\tmargin: 0 2px !important;\n\tanimation: ", " 1s infinite;\n\t&:nth-child(2) {\n\t\tanimation-delay: 0.2s;\n\t}\n\t&:nth-child(3) {\n\t\tanimation-delay: 0.4s;\n\t}\n"])), function (props) {
827
+ var finalColor;
828
+ if (props.isSender) {
829
+ finalColor = props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor;
830
+ } else {
831
+ finalColor = props.themePreset !== 'dark' ? props.theme.colors.borderColor : props.theme.colors.textColor;
832
+ }
833
+ return finalColor;
834
+ }, typingDots);
835
+ var resetCSS = function resetCSS(props) {
836
+ return "\n\thtml,\n\tbody,\n\tdiv,\n\tspan,\n\tapplet,\n\tobject,\n\tiframe,\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\tp,\n\tblockquote,\n\tpre,\n\ta,\n\tabbr,\n\tacronym,\n\taddress,\n\tbig,\n\tcite,\n\tcode,\n\tdel,\n\tdfn,\n\tem,\n\timg,\n\tins,\n\tkbd,\n\tq,\n\ts,\n\tsamp,\n\tsmall,\n\tstrike,\n\tstrong,\n\tsub,\n\tsup,\n\ttt,\n\tvar,\n\tb,\n\tu,\n\ti,\n\tcenter,\n\tdl,\n\tdt,\n\tdd,\n\tol,\n\tul,\n\tli,\n\tfieldset,\n\tform,\n\tlabel,\n\tlegend,\n\ttable,\n\tcaption,\n\ttbody,\n\ttfoot,\n\tthead,\n\ttr,\n\tth,\n\ttd,\n\tarticle,\n\taside,\n\tcanvas,\n\tdetails,\n\tembed,\n\tfigure,\n\tfigcaption,\n\tfooter,\n\theader,\n\thgroup,\n\tmenu,\n\tnav,\n\toutput,\n\truby,\n\tsection,\n\tsummary,\n\ttime,\n\tmark,\n\taudio,\n\tvideo {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\tfont-size: 100%;\n\t\tfont: inherit;\n\t\tvertical-align: baseline;\n\t\toverflow-wrap: anywhere;\n\t}\n\tpre {\n\t\tmargin: 10px auto;\n\t}\n\ttable {\n\t\tmargin: 10px auto;\n\t\tborder-collapse: collapse;\n\t\tborder-spacing: 0;\n\t}\n\ttr {\n\t\tborder-bottom: 1px solid #ccc;\n\t}\n\tth,\n\ttd {\n\t\ttext-align: left;\n\t\tpadding: 4px;\n\t\tborder: 1px solid;\n\t\tborder-collapse: collapse;\n\t}\n\tpre,\n\tcode {\n\t\tpadding: 0.6em 0.4em;\n\t\tbackground: " + (
837
+ // eslint-disable-next-line no-nested-ternary
838
+ props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor : props.theme.colors.borderColor) + ";\n\t}\n\n\tcode {\n\t\tline-height: normal;\n\n\t\tcolor: " + (
839
+ // eslint-disable-next-line no-nested-ternary
840
+ props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor : props.theme.colors.primaryTextColor) + ";\n\t\tborder-radius: 3px;\n\t\tfont-size: 85%;\n\t\tpadding: 0.2em 0.4em;\n\t\tmargin-top: 5px;\n\t\tdisplay: inline-block;\n\t\toverflow: auto;\n\t\twidth: fit-content;\n\t\tmax-width: 100%;\n\t}\n\tul,\n\tol {\n\t\tlist-style-position: inside;\n\t\tpadding-left: 10px;\n\n\t}\n\n\tli{\n\t\tdisplay: list-item;\n\t\tcursor: default;\n\t\tpadding: initial;\n\n\t\t&:hover{\n\t\t\tbackground-color: initial;\n\t\t}\n\t}\n\tp {\n\t\tmargin: inherit;\n\t}\n";
841
+ };
842
+ var messageBGColor = function messageBGColor(props) {
843
+ var finalBGColor;
844
+ if (props.isSender) {
845
+ finalBGColor = props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor;
846
+ } else {
847
+ finalBGColor = props.themePreset !== 'dark' ? polished.lighten(0.53, props.theme.colors.borderColor) : props.theme.colors.backgroundColor;
848
+ }
849
+ return finalBGColor;
850
+ };
851
+ var Message = vueEmotion.styled('div')(_templateObject7 || (_templateObject7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tborder: 1px solid\n\t\t", ";\n\tpadding: 10px;\n\tborder-radius: 7px;\n\tmargin-bottom: 10px;\n\tmax-width: 80%;\n\talign-self: ", ";\n\tdisplay: inline-block;\n\tposition: relative;\n\toverflow-wrap: anywhere;\n\t", "\n"])), function (props) {
852
+ return messageBGColor(props);
853
+ }, function (props) {
854
+ var finalColor;
855
+ if (props.isSender) {
856
+ finalColor = props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor;
857
+ } else {
858
+ finalColor = props.themePreset !== 'dark' ? props.theme.colors.borderColor : props.theme.colors.textColor;
859
+ }
860
+ return finalColor;
861
+ }, function (props) {
862
+ return props.themePreset === 'dark' ? 'currentColor' : messageBGColor(props);
863
+ }, function (props) {
864
+ return props.isSender ? 'flex-end' : 'flex-start';
865
+ }, function (props) {
866
+ return resetCSS(props);
867
+ });
868
+ var MessageInputContainer = vueEmotion.styled('form')(_templateObject8 || (_templateObject8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tpadding-top: 12px;\n\talign-items: stretch;\n\tmargin-top: 10px;\n\t.ai-enter-button-wrapper {\n\t\talign-self: baseline;\n\t\theight: 41px;\n\t}\n"])));
869
+ var MessageInput = vueEmotion.styled(Input.TextArea)(_templateObject9 || (_templateObject9 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tborder-radius: 5px;\n\tborder: 1px solid #ccc;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\n\t::placeholder {\n\t\tcolor: ", ";\n\t}\n\n\t:-ms-input-placeholder {\n\t\tcolor: ", ";\n\t}\n\n\t::-ms-input-placeholder {\n\t\tcolor: ", ";\n\t}\n\t", "\n"])), function (props) {
870
+ return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
871
+ }, function (props) {
872
+ return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
873
+ }, function (props) {
874
+ return props.theme.colors.textColor;
875
+ }, function (props) {
876
+ return props.theme.colors.textColor;
877
+ }, function (props) {
878
+ return props.theme.colors.textColor;
879
+ }, function (_ref) {
880
+ var enterButton = _ref.enterButton;
881
+ return enterButton && "\n\t\t border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\t";
882
+ });
883
+ var SendButton = vueEmotion.styled(Button.Button)(_templateObject10 || (_templateObject10 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tborder: none;\n\tcolor: #ffffff;\n\tcursor: pointer;\n\tfont-size: 16px;\n\tmargin-left: 8px;\n\toutline: none;\n\tpadding: 10px;\n\ttext-align: center;\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t}\n"])));
884
+ var AIFeedbackContainer = vueEmotion.styled('div')(_templateObject11 || (_templateObject11 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t.--feedback-svgs-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\tgap: 5px;\n\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\ttransition: all ease-in 0.1s;\n\t\t\t&.selected {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t\tcursor: default;\n\t\t\t}\n\n\t\t\t&:hover {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t}\n\t\t}\n\t}\n\n\t.--feedback-input-wrapper {\n\t\tdisplay: flex;\n\t\tgap: 7px;\n\t}\n"])));
885
+
886
+ var _templateObject$8, _templateObject2$3, _templateObject3$2, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
887
+ var fadeInFromBottom = css.keyframes(_templateObject$8 || (_templateObject$8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
888
+ var fadeInFromTop = css.keyframes(_templateObject2$3 || (_templateObject2$3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(-20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
889
+ var SearchBoxAISection = vueEmotion.styled('div')(_templateObject3$2 || (_templateObject3$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tpadding: 10px;\n\tborder-radius: 4px;\n\tmin-height: 200px;\n\tpadding-top: 20px;\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\t.--ai-answer-error-container {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t}\n\t}\n"])), function (_ref) {
890
+ var themePreset = _ref.themePreset,
891
+ theme = _ref.theme;
892
+ return themePreset === 'dark' ? '#424242' : theme.colors.backgroundColor;
893
+ }, function (_ref2) {
894
+ var theme = _ref2.theme;
895
+ return theme.colors.textColor;
896
+ });
897
+ var Question = vueEmotion.styled('div')(_templateObject4$1 || (_templateObject4$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-weight: bold;\n\tmargin-bottom: 5px;\n\tanimation: ", " 0.5s ease-out;\n"])), fadeInFromTop);
898
+ var Answer = vueEmotion.styled('div')(_templateObject5$1 || (_templateObject5$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", "\n\tposition: relative;\n\tmargin-bottom: 5px;\n\tmin-height: 100px;\n\toverflow: auto;\n\twhite-space: pre-wrap;\n\tpre {\n\t\twhite-space: pre-wrap;\n\t}\n\tcode,\n\tpre {\n\t\tdisplay: revert;\n\t}\n"])), function (props) {
899
+ return resetCSS(props);
900
+ });
901
+ var Footer = vueEmotion.styled('div')(_templateObject6$1 || (_templateObject6$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tcolor: #777;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 1rem;\n\tflex-wrap: wrap;\n\tanimation: ", " 0.5s ease-out;\n\tpadding: 10px 0;\n\tbackground: white;\n\tbackground-color: ", ";\n\tcolor: ", ";\n"])), fadeInFromBottom, function (_ref3) {
902
+ var themePreset = _ref3.themePreset,
903
+ theme = _ref3.theme;
904
+ return themePreset === 'dark' ? '#424242' : theme.colors.backgroundColor;
905
+ }, function (_ref4) {
906
+ var theme = _ref4.theme;
907
+ return theme.colors.textColor;
908
+ });
909
+ var SourceTags = vueEmotion.styled('div')(_templateObject7$1 || (_templateObject7$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tgap: 8px;\n\tflex-wrap: wrap;\n\t.--ai-source-tag {\n\t\tdisplay: inline-block;\n\t\tmax-width: 200px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n"])));
910
+
911
+ var ThumbsUpSvg = {
912
+ name: 'ThumbsUpSvg',
913
+ props: ['clickHandler', 'className'],
914
+ render: function render() {
915
+ return vue.createVNode("svg", {
916
+ "stroke": "currentColor",
917
+ "fill": "none",
918
+ "strokeWidth": "2",
919
+ "viewBox": "0 0 24 24",
920
+ "strokeLinecap": "round",
921
+ "strokeLinejoin": "round",
922
+ "class": this.$props.className,
923
+ "height": "1em",
924
+ "width": "1em",
925
+ "xmlns": "http://www.w3.org/2000/svg",
926
+ "onClick": this.$props.clickHandler
927
+ }, [vue.createVNode("path", {
928
+ "d": "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"
929
+ }, null)]);
930
+ }
931
+ };
932
+
933
+ var ThumbsDownSvg = {
934
+ name: 'ThumbsDownSvg',
935
+ props: ['clickHandler', 'className'],
936
+ render: function render() {
937
+ return vue.createVNode("svg", {
938
+ "stroke": "currentColor",
939
+ "fill": "none",
940
+ "strokeWidth": "2",
941
+ "viewBox": "0 0 24 24",
942
+ "strokeLinecap": "round",
943
+ "strokeLinejoin": "round",
944
+ "class": this.$props.className,
945
+ "height": "1em",
946
+ "width": "1em",
947
+ "xmlns": "http://www.w3.org/2000/svg",
948
+ "onClick": this.$props.clickHandler
949
+ }, [vue.createVNode("path", {
950
+ "d": "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"
951
+ }, null), ' ']);
952
+ }
953
+ };
954
+
955
+ var AIFeedback = vue.defineComponent({
956
+ name: 'FeedbackComponent',
957
+ props: {
958
+ onFeedbackSubmit: {
959
+ type: Function,
960
+ "default": function _default() {}
961
+ },
962
+ hideUI: {
963
+ type: Boolean,
964
+ "default": false
965
+ },
966
+ overrideState: {
967
+ type: Object,
968
+ "default": function _default() {
969
+ return {};
970
+ }
971
+ }
972
+ },
973
+ setup: function setup(props, _ref) {
974
+ var emit = _ref.emit;
975
+ var showInput = vue.ref(false);
976
+ var feedbackType = vue.ref(null);
977
+ var feedbackText = vue.ref('');
978
+ var feedbackRecorded = vue.ref(false);
979
+ var handleButtonClick = function handleButtonClick(type) {
980
+ if (feedbackType.value === type) {
981
+ feedbackType.value = null;
982
+ showInput.value = false;
983
+ } else {
984
+ feedbackType.value = type;
985
+ showInput.value = true;
986
+ }
987
+ };
988
+ var handleInputChange = function handleInputChange(e) {
989
+ feedbackText.value = e.target.value;
990
+ };
991
+ var handleSubmit = function handleSubmit() {
992
+ emit('feedback-submit', feedbackType.value === 'positive', feedbackText.value);
993
+ feedbackText.value = '';
994
+ showInput.value = false;
995
+ feedbackRecorded.value = true;
996
+ };
997
+ var handleCancel = function handleCancel() {
998
+ feedbackType.value = null;
999
+ feedbackText.value = '';
1000
+ showInput.value = false;
1001
+ };
1002
+ vue.watch(function () {
1003
+ return props.overrideState;
1004
+ }, function (newValue) {
1005
+ if (newValue && newValue.isRecorded) {
1006
+ feedbackRecorded.value = true;
1007
+ feedbackType.value = newValue.feedbackType || 'positive';
1008
+ }
1009
+ });
1010
+ if (props.overrideState && props.overrideState.isRecorded) {
1011
+ feedbackRecorded.value = true;
1012
+ feedbackType.value = props.overrideState.feedbackType || 'positive';
1013
+ }
1014
+ return {
1015
+ showInput: showInput,
1016
+ feedbackType: feedbackType,
1017
+ feedbackText: feedbackText,
1018
+ feedbackRecorded: feedbackRecorded,
1019
+ handleButtonClick: handleButtonClick,
1020
+ handleInputChange: handleInputChange,
1021
+ handleSubmit: handleSubmit,
1022
+ handleCancel: handleCancel
1023
+ };
1024
+ },
1025
+ render: function render() {
1026
+ var _this = this;
1027
+ if (this.$props.hideUI) {
1028
+ return null;
1029
+ }
1030
+ if (this.feedbackRecorded) {
1031
+ return vue.createVNode(AIFeedbackContainer, null, {
1032
+ "default": function _default() {
1033
+ return [vue.createVNode("div", {
1034
+ "class": "--feedback-svgs-wrapper"
1035
+ }, [_this.feedbackType === 'positive' ? vue.createVNode(ThumbsUpSvg, {
1036
+ "class": "selected"
1037
+ }, null) : vue.createVNode(ThumbsDownSvg, {
1038
+ "class": "selected"
1039
+ }, null)])];
1040
+ }
1041
+ });
1042
+ }
1043
+ return vue.createVNode(AIFeedbackContainer, null, {
1044
+ "default": function _default() {
1045
+ return [!_this.showInput && vue.createVNode("div", {
1046
+ "class": "--feedback-svgs-wrapper"
1047
+ }, [vue.createVNode(ThumbsUpSvg, {
1048
+ "class": _this.feedbackType === 'positive' ? 'selected' : '',
1049
+ "onClick": function onClick() {
1050
+ return _this.handleButtonClick('positive');
1051
+ }
1052
+ }, null), vue.createVNode(ThumbsDownSvg, {
1053
+ "class": _this.feedbackType === 'negative' ? 'selected' : '',
1054
+ "onClick": function onClick() {
1055
+ return _this.handleButtonClick('negative');
1056
+ }
1057
+ }, null)]), _this.showInput && vue.createVNode("div", {
1058
+ "class": "--feedback-input-wrapper"
1059
+ }, [vue.createVNode(Input.Input, {
1060
+ "show": _this.showInput,
1061
+ "placeholder": _this.feedbackType === 'positive' ? 'What do you like about the response?' : 'What was the issue with the response? How can it be improved?',
1062
+ "value": _this.feedbackText,
1063
+ "onInput": _this.handleInputChange
1064
+ }, null), vue.createVNode(Button.Button, {
1065
+ "primary": true,
1066
+ "onClick": _this.handleSubmit
1067
+ }, {
1068
+ "default": function _default() {
1069
+ return [vue.createTextVNode("Submit")];
1070
+ }
1071
+ }), vue.createVNode(Button.Button, {
1072
+ "onClick": _this.handleCancel
1073
+ }, {
1074
+ "default": function _default() {
1075
+ return [vue.createTextVNode("Cancel")];
1076
+ }
1077
+ })])];
1078
+ }
1079
+ });
1080
+ }
1081
+ });
1082
+
1083
+ var _excluded = ["_source"];
759
1084
  function _isSlot(s) {
760
1085
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
761
1086
  }
1087
+ var md = new remarkable.Remarkable();
1088
+ md.set({
1089
+ html: true,
1090
+ breaks: true,
1091
+ xhtmlOut: true
1092
+ });
1093
+ var _dropdownULRef = 'dropdownULRef';
1094
+ var _inputGroupRef = 'inputGroupRef';
762
1095
  var updateQuery = reactivecore.Actions.updateQuery,
763
1096
  setCustomQuery = reactivecore.Actions.setCustomQuery,
764
1097
  setDefaultQuery = reactivecore.Actions.setDefaultQuery,
@@ -779,7 +1112,11 @@ var SearchBox = vue.defineComponent({
779
1112
  currentValue: '',
780
1113
  selectedTags: [],
781
1114
  isOpen: false,
782
- normalizedSuggestions: []
1115
+ normalizedSuggestions: [],
1116
+ showAIScreen: false,
1117
+ showAIScreenFooter: false,
1118
+ showFeedbackComponent: false,
1119
+ feedbackState: null
783
1120
  };
784
1121
  this.internalComponent = props.componentId + "__internal";
785
1122
  return this.__state;
@@ -820,6 +1157,26 @@ var SearchBox = vue.defineComponent({
820
1157
  },
821
1158
  stats: function stats() {
822
1159
  return getResultStats(this);
1160
+ },
1161
+ parsedSuggestions: function parsedSuggestions() {
1162
+ var suggestionsArray = [];
1163
+ if (Array.isArray(this.suggestions) && this.suggestions.length) {
1164
+ suggestionsArray = [].concat(withClickIds(this.suggestions));
1165
+ }
1166
+ var sectionsAccumulated = [];
1167
+ var sectionisedSuggestions = suggestionsArray.reduce(function (acc, d, currentIndex) {
1168
+ if (sectionsAccumulated.includes(d.sectionId)) return acc;
1169
+ if (d.sectionId) {
1170
+ acc[currentIndex] = suggestionsArray.filter(function (g) {
1171
+ return g.sectionId === d.sectionId;
1172
+ });
1173
+ sectionsAccumulated.push(d.sectionId);
1174
+ } else {
1175
+ acc[currentIndex] = d;
1176
+ }
1177
+ return acc;
1178
+ }, {});
1179
+ return Object.values(sectionisedSuggestions);
823
1180
  }
824
1181
  },
825
1182
  props: {
@@ -886,12 +1243,20 @@ var SearchBox = vue.defineComponent({
886
1243
  distinctFieldConfig: vueTypes.types.props,
887
1244
  //
888
1245
  focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
1246
+ showFocusShortcutsIcon: VueTypes.bool.def(true),
889
1247
  addonBefore: VueTypes.any,
890
1248
  addonAfter: VueTypes.any,
1249
+ showSuggestionsFooter: VueTypes.bool.def(true),
891
1250
  expandSuggestionsContainer: VueTypes.bool.def(true),
1251
+ renderSuggestionsFooter: VueTypes.func,
892
1252
  index: VueTypes.string,
893
1253
  popularSuggestionsConfig: VueTypes.object,
894
1254
  recentSuggestionsConfig: VueTypes.object,
1255
+ featuredSuggestionsConfig: VueTypes.shape({
1256
+ maxSuggestionsPerSection: VueTypes.number,
1257
+ sectionsOrder: VueTypes.arrayOf(VueTypes.string)
1258
+ }),
1259
+ customEvents: VueTypes.object,
895
1260
  applyStopwords: VueTypes.bool,
896
1261
  customStopwords: vueTypes.types.stringArray,
897
1262
  onData: vueTypes.types.func,
@@ -901,7 +1266,10 @@ var SearchBox = vue.defineComponent({
901
1266
  mode: VueTypes.oneOf(['select', 'tag']).def('select'),
902
1267
  renderSelectedTags: VueTypes.any,
903
1268
  searchboxId: VueTypes.string,
904
- endpoint: vueTypes.types.endpointConfig
1269
+ endpoint: vueTypes.types.endpointConfig,
1270
+ enableAI: VueTypes.bool.def(false),
1271
+ AIConfig: vueTypes.types.AIConfig,
1272
+ AIUIConfig: vueTypes.types.AIUIConfig
905
1273
  },
906
1274
  mounted: function mounted() {
907
1275
  this.listenForFocusShortcuts();
@@ -947,6 +1315,7 @@ var SearchBox = vue.defineComponent({
947
1315
  suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
948
1316
  }
949
1317
  this.normalizedSuggestions = suggestionsList;
1318
+ this.handleTextAreaHeightChange();
950
1319
  },
951
1320
  selectedValue: function selectedValue(newVal, oldVal) {
952
1321
  if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
@@ -1008,6 +1377,45 @@ var SearchBox = vue.defineComponent({
1008
1377
  if (!isEqual(newVal, oldVal)) {
1009
1378
  this.handleTextChange = _debounce(this.handleText, newVal);
1010
1379
  }
1380
+ },
1381
+ isAITyping: function isAITyping(newVal, oldVal) {
1382
+ var _this = this;
1383
+ var scrollAIContainer = function scrollAIContainer() {
1384
+ var dropdownEle = _this.$refs[_dropdownULRef];
1385
+ if (dropdownEle) {
1386
+ dropdownEle.scrollTo({
1387
+ top: dropdownEle.scrollHeight,
1388
+ behavior: 'smooth'
1389
+ });
1390
+ }
1391
+ };
1392
+ if (!newVal && oldVal) {
1393
+ this.showAIScreenFooter = true;
1394
+ if (this.$props.AIUIConfig && typeof this.$props.AIUIConfig.showFeedback === 'boolean' ? this.$props.AIUIConfig.showFeedback : true) {
1395
+ this.showFeedbackComponent = true;
1396
+ }
1397
+ setTimeout(function () {
1398
+ scrollAIContainer();
1399
+ }, 500);
1400
+ } else if (newVal) {
1401
+ this.scrollTimerRef = setTimeout(function () {
1402
+ scrollAIContainer();
1403
+ }, 2000);
1404
+ }
1405
+ },
1406
+ showAIScreen: function showAIScreen(newVal) {
1407
+ if (newVal) {
1408
+ var _this$$refs;
1409
+ if ((_this$$refs = this.$refs) != null && _this$$refs[this.$props.innerRef] && this.$refs[this.$props.innerRef].$el) {
1410
+ this.$refs[this.$props.innerRef].$el.blur();
1411
+ }
1412
+ } else {
1413
+ this.feedbackState = null;
1414
+ this.showFeedbackComponent = false;
1415
+ }
1416
+ },
1417
+ currentValue: function currentValue() {
1418
+ this.handleTextAreaHeightChange();
1011
1419
  }
1012
1420
  },
1013
1421
  methods: {
@@ -1033,9 +1441,20 @@ var SearchBox = vue.defineComponent({
1033
1441
  data: this.normalizedSuggestions,
1034
1442
  rawData: this.rawData,
1035
1443
  value: currentValue,
1036
- resultStats: this.stats
1444
+ resultStats: this.stats,
1445
+ AIData: {
1446
+ question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
1447
+ answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
1448
+ documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
1449
+ showAIScreen: this.showAIScreen,
1450
+ sources: this.getAISourceObjects(),
1451
+ isAILoading: this.isAIResponseLoading,
1452
+ AIError: this.AIResponseError
1453
+ }
1037
1454
  };
1038
- return index.getComponent(data, this);
1455
+ return vue.createVNode("div", {
1456
+ "ref": _dropdownULRef
1457
+ }, [index.getComponent(data, this)]);
1039
1458
  },
1040
1459
  // returns size and aggs property
1041
1460
  getBasicQueryOptions: function getBasicQueryOptions() {
@@ -1057,7 +1476,7 @@ var SearchBox = vue.defineComponent({
1057
1476
  }
1058
1477
  },
1059
1478
  setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
1060
- var _this = this;
1479
+ var _this2 = this;
1061
1480
  if (isDefaultValue === void 0) {
1062
1481
  isDefaultValue = false;
1063
1482
  }
@@ -1071,60 +1490,65 @@ var SearchBox = vue.defineComponent({
1071
1490
  categoryValue = undefined;
1072
1491
  }
1073
1492
  var performUpdate = function performUpdate() {
1074
- if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
1493
+ if (_this2.$options.isTagsMode && isEqual(value, _this2.selectedTags)) {
1075
1494
  return;
1076
1495
  }
1077
- if (_this.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
1078
- if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
1496
+ if (_this2.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
1497
+ if (Array.isArray(_this2.selectedTags) && _this2.selectedTags.length) {
1079
1498
  // check if value already present in selectedTags
1080
- if (typeof value === 'string' && _this.selectedTags.includes(value)) {
1081
- _this.isOpen = false;
1499
+ if (typeof value === 'string' && _this2.selectedTags.includes(value)) {
1500
+ _this2.isOpen = false;
1082
1501
  return;
1083
1502
  }
1084
- _this.selectedTags = [].concat(_this.selectedTags);
1503
+ _this2.selectedTags = [].concat(_this2.selectedTags);
1085
1504
  if (typeof value === 'string' && !!value) {
1086
- _this.selectedTags.push(value);
1087
- } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
1088
- _this.selectedTags = value;
1505
+ _this2.selectedTags.push(value);
1506
+ } else if (Array.isArray(value) && !isEqual(_this2.selectedTags, value)) {
1507
+ _this2.selectedTags = value;
1089
1508
  }
1090
1509
  } else if (value) {
1091
- _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1510
+ _this2.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1092
1511
  }
1093
- _this.currentValue = '';
1512
+ _this2.currentValue = '';
1094
1513
  } else {
1095
- _this.currentValue = index.decodeHtml(value);
1514
+ _this2.currentValue = index.decodeHtml(value);
1096
1515
  }
1097
1516
  var queryHandlerValue = value;
1098
- if (_this.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
1099
- queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
1517
+ if (_this2.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
1518
+ queryHandlerValue = Array.isArray(_this2.selectedTags) && _this2.selectedTags.length ? _this2.selectedTags : undefined;
1100
1519
  }
1101
1520
  if (isDefaultValue) {
1102
- if (_this.$props.autosuggest) {
1521
+ if (_this2.$props.autosuggest) {
1103
1522
  if (toggleIsOpen) {
1104
- _this.isOpen = false;
1523
+ _this2.isOpen = false;
1105
1524
  }
1106
- if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
1525
+ if (typeof _this2.currentValue === 'string') _this2.triggerDefaultQuery(_this2.currentValue, props.enableAI ? {
1526
+ enableAI: true
1527
+ } : {});
1107
1528
  } // in case of strict selection only SUGGESTION_SELECT should be able
1108
1529
  // to set the query otherwise the value should reset
1109
1530
  if (props.strictSelection) {
1110
- if (cause === reactivecore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
1111
- _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1531
+ if (cause === reactivecore.causes.SUGGESTION_SELECT || (_this2.$options.isTagsMode ? _this2.selectedTags.length === 0 : value === '')) {
1532
+ _this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue);
1112
1533
  } else {
1113
- _this.setValue('', true);
1534
+ _this2.setValue('', true);
1114
1535
  }
1115
1536
  } else if (props.value === undefined || cause === reactivecore.causes.SUGGESTION_SELECT || cause === reactivecore.causes.CLEAR_VALUE) {
1116
- _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1537
+ _this2.triggerCustomQuery(queryHandlerValue, _this2.$options.isTagsMode ? undefined : categoryValue);
1117
1538
  }
1118
1539
  } else {
1119
1540
  // debounce for handling text while typing
1120
- _this.handleTextChange(value, cause);
1541
+ _this2.handleTextChange(value, cause);
1121
1542
  }
1122
- _this.$emit('valueChange', value);
1123
- _this.$emit('value-change', value);
1543
+ _this2.$emit('valueChange', value);
1544
+ _this2.$emit('value-change', value);
1124
1545
  };
1125
1546
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
1126
1547
  },
1127
- triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
1548
+ triggerDefaultQuery: function triggerDefaultQuery(paramValue, meta) {
1549
+ if (meta === void 0) {
1550
+ meta = {};
1551
+ }
1128
1552
  if (!this.$props.autosuggest) {
1129
1553
  return;
1130
1554
  }
@@ -1143,7 +1567,8 @@ var SearchBox = vue.defineComponent({
1143
1567
  componentId: this.internalComponent,
1144
1568
  query: query,
1145
1569
  value: value,
1146
- componentType: constants.componentTypes.searchBox
1570
+ componentType: constants.componentTypes.searchBox,
1571
+ meta: meta
1147
1572
  });
1148
1573
  },
1149
1574
  triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
@@ -1227,8 +1652,8 @@ var SearchBox = vue.defineComponent({
1227
1652
  this.recordSuggestionClick(searchPosition, docId);
1228
1653
  },
1229
1654
  clearValue: function clearValue() {
1230
- this.setValue('', false, this.$props, reactivecore.causes.CLEAR_VALUE, false);
1231
- this.onValueSelectedHandler('', reactivecore.causes.CLEAR_VALUE);
1655
+ this.setValue('', false, this.$props, !this.$options.isTagsMode ? reactivecore.causes.CLEAR_VALUE : undefined, false);
1656
+ this.onValueSelectedHandler('', !this.$options.isTagsMode ? reactivecore.causes.CLEAR_VALUE : undefined);
1232
1657
  },
1233
1658
  handleKeyDown: function handleKeyDown(event, highlightedIndex) {
1234
1659
  if (highlightedIndex === void 0) {
@@ -1239,9 +1664,12 @@ var SearchBox = vue.defineComponent({
1239
1664
  if (this.$props.autosuggest === false) {
1240
1665
  this.enterButtonOnClick();
1241
1666
  } else if (highlightedIndex === null) {
1242
- this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? reactivecore.causes.SUGGESTION_SELECT : undefined // to handle tags
1243
- );
1244
-
1667
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? reactivecore.causes.SUGGESTION_SELECT : undefined,
1668
+ // to handle tags
1669
+ !this.$props.enableAI);
1670
+ if (this.$props.enableAI && !this.showAIScreen) {
1671
+ this.showAIScreen = true;
1672
+ }
1245
1673
  this.onValueSelectedHandler(event.target.value, reactivecore.causes.ENTER_PRESS);
1246
1674
  }
1247
1675
  }
@@ -1251,18 +1679,21 @@ var SearchBox = vue.defineComponent({
1251
1679
  this.$emit('key-down', event, this.triggerQuery);
1252
1680
  },
1253
1681
  onInputChange: function onInputChange(e) {
1254
- var _this2 = this;
1682
+ var _this3 = this;
1255
1683
  var inputValue = e.target.value;
1256
1684
  if (!this.$data.isOpen && this.$props.autosuggest) {
1257
1685
  this.isOpen = true;
1258
1686
  }
1687
+ if (this.showAIScreen) {
1688
+ this.showAIScreen = false;
1689
+ }
1259
1690
  var value = this.$props.value;
1260
1691
  if (value === undefined) {
1261
- this.setValue(inputValue, false, this.$props, inputValue === '' ? reactivecore.causes.CLEAR_VALUE : undefined);
1692
+ this.setValue(inputValue, false, this.$props, undefined);
1262
1693
  } else {
1263
1694
  this.$emit('change', inputValue, function (_ref3) {
1264
1695
  var isOpen = _ref3.isOpen;
1265
- return _this2.triggerQuery({
1696
+ return _this3.triggerQuery({
1266
1697
  defaultQuery: true,
1267
1698
  customQuery: true,
1268
1699
  value: inputValue,
@@ -1271,10 +1702,52 @@ var SearchBox = vue.defineComponent({
1271
1702
  }, e);
1272
1703
  }
1273
1704
  },
1705
+ handleFeaturedSuggestionClicked: function handleFeaturedSuggestionClicked(suggestion) {
1706
+ try {
1707
+ var _this$$refs2, _this$$refs2$this$$pr;
1708
+ if (suggestion.action === helper.featuredSuggestionsActionTypes.NAVIGATE) {
1709
+ var _JSON$parse = JSON.parse(suggestion.subAction),
1710
+ _JSON$parse$target = _JSON$parse.target,
1711
+ target = _JSON$parse$target === void 0 ? '_self' : _JSON$parse$target,
1712
+ _JSON$parse$link = _JSON$parse.link,
1713
+ link = _JSON$parse$link === void 0 ? '/' : _JSON$parse$link;
1714
+ if (typeof window !== 'undefined') {
1715
+ window.open(link, target);
1716
+ }
1717
+ }
1718
+ if (suggestion.action === helper.featuredSuggestionsActionTypes.FUNCTION) {
1719
+ var matchedValues = suggestion.subAction.match(/function\s*\(.*\)(.|\n)*/);
1720
+ var functionStr = matchedValues && matchedValues[0];
1721
+ // eslint-disable-next-line no-new-func
1722
+ var func = new Function("return " + functionStr)();
1723
+ func(suggestion, this.$data.currentValue, this.$props.customEvents);
1724
+ }
1725
+ if (suggestion.action === helper.featuredSuggestionsActionTypes.SELECT) {
1726
+ this.setValue(suggestion.value, true, this.$props, this.$options.isTagsMode.current ? reactivecore.causes.SUGGESTION_SELECT : reactivecore.causes.ENTER_PRESS);
1727
+ this.onValueSelectedHandler(suggestion.value, reactivecore.causes.SUGGESTION_SELECT);
1728
+ }
1729
+ // blur is important to close the dropdown
1730
+ // on selecting one of featured suggestions
1731
+ // else Downshift probably is focusing the dropdown
1732
+ // and not letting it close
1733
+ // eslint-disable-next-line no-unused-expressions
1734
+ (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$this$$pr = _this$$refs2[this.$props.innerRef]) == null ? void 0 : _this$$refs2$this$$pr.blur();
1735
+ } catch (e) {
1736
+ console.error("Error: There was an error parsing the subAction for the featured suggestion with label, \"" + suggestion.label + "\"", e);
1737
+ }
1738
+ },
1274
1739
  onSuggestionSelected: function onSuggestionSelected(suggestion) {
1275
- var _this3 = this;
1276
- this.isOpen = false;
1740
+ var _this4 = this;
1741
+ if (!this.$props.enableAI) this.isOpen = false;else {
1742
+ this.showAIScreen = true;
1743
+ }
1277
1744
  var value = this.$props.value;
1745
+
1746
+ // handle featured suggestions click event
1747
+ if (suggestion._suggestion_type === helper.suggestionTypes.Featured) {
1748
+ this.handleFeaturedSuggestionClicked(suggestion);
1749
+ return;
1750
+ }
1278
1751
  // Record analytics for selected suggestions
1279
1752
  this.triggerClickAnalytics(suggestion._click_id);
1280
1753
  if (value === undefined) {
@@ -1293,10 +1766,10 @@ var SearchBox = vue.defineComponent({
1293
1766
  this.setValue(emitValue, true, this.$props, reactivecore.causes.SUGGESTION_SELECT, false, suggestion._category);
1294
1767
  this.$emit('change', emitValue, function (_ref4) {
1295
1768
  var isOpen = _ref4.isOpen;
1296
- return _this3.triggerQuery(_rollupPluginBabelHelpers._extends({
1769
+ return _this4.triggerQuery(_rollupPluginBabelHelpers._extends({
1297
1770
  isOpen: isOpen,
1298
1771
  value: emitValue
1299
- }, !_this3.$options.isTagsMode && {
1772
+ }, !_this4.$options.isTagsMode && {
1300
1773
  categoryValue: suggestion._category
1301
1774
  }));
1302
1775
  });
@@ -1330,9 +1803,26 @@ var SearchBox = vue.defineComponent({
1330
1803
  }
1331
1804
  return null;
1332
1805
  },
1333
- renderErrorComponent: function renderErrorComponent() {
1334
- var _this4 = this;
1806
+ renderErrorComponent: function renderErrorComponent(isAIError) {
1807
+ var _this5 = this;
1808
+ if (isAIError === void 0) {
1809
+ isAIError = false;
1810
+ }
1335
1811
  var renderError = this.$slots.renderError || this.$props.renderError;
1812
+ if (isAIError) {
1813
+ if (this.showAIScreen && this.AIResponseError && !this.isAIResponseLoading) {
1814
+ if (renderError) {
1815
+ return vue.createVNode("div", {
1816
+ "class": "--ai-answer-error-container " + (getClassName$1(this.$props.innerClass, 'ai-error') || '')
1817
+ }, [renderError(this.AIResponseError)]);
1818
+ }
1819
+ return vue.createVNode("div", {
1820
+ "class": "--ai-answer-error-container " + (getClassName$1(this.$props.innerClass, 'ai-error') || '')
1821
+ }, [vue.createVNode("div", {
1822
+ "class": "--default-error-element"
1823
+ }, [vue.createVNode("span", null, [typeof this.AIResponseError === 'string' ? this.AIResponseError : this.AIResponseError.message ? this.AIResponseError.message : 'There was an error in generating the response.', this.AIResponseError.code ? "Code:\n\t\t\t\t\t\t\t" + this.AIResponseError.code : ''])])]);
1824
+ }
1825
+ }
1336
1826
  if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
1337
1827
  return vue.createVNode(SuggestionWrapper, {
1338
1828
  "innerClass": this.$props.innerClass,
@@ -1341,7 +1831,7 @@ var SearchBox = vue.defineComponent({
1341
1831
  "themePreset": this.themePreset
1342
1832
  }, {
1343
1833
  "default": function _default() {
1344
- return [index.isFunction(renderError) ? renderError(_this4.error) : renderError];
1834
+ return [index.isFunction(renderError) ? renderError(_this5.error) : renderError];
1345
1835
  }
1346
1836
  });
1347
1837
  }
@@ -1406,14 +1896,22 @@ var SearchBox = vue.defineComponent({
1406
1896
  return null;
1407
1897
  },
1408
1898
  enterButtonOnClick: function enterButtonOnClick() {
1899
+ this.showAIScreen = false;
1409
1900
  this.triggerQuery({
1410
1901
  isOpen: false,
1411
1902
  value: this.currentValue,
1412
1903
  customQuery: true
1413
1904
  });
1414
1905
  },
1906
+ suggestionsFooter: function suggestionsFooter() {
1907
+ return typeof renderSuggestionsFooter === 'function' ? this.$props.renderSuggestionsFooter() : vue.createVNode(AutosuggestFooterContainer, null, {
1908
+ "default": function _default() {
1909
+ return [vue.createVNode("div", null, [vue.createTextVNode("\u2191\u2193 Navigate")]), vue.createVNode("div", null, [vue.createTextVNode("\u21A9 Go")])];
1910
+ }
1911
+ });
1912
+ },
1415
1913
  renderEnterButtonElement: function renderEnterButtonElement() {
1416
- var _this5 = this;
1914
+ var _this6 = this;
1417
1915
  var _this$$props2 = this.$props,
1418
1916
  enterButton = _this$$props2.enterButton,
1419
1917
  innerClass = _this$$props2.innerClass;
@@ -1421,12 +1919,12 @@ var SearchBox = vue.defineComponent({
1421
1919
  if (enterButton) {
1422
1920
  var getEnterButtonMarkup = function getEnterButtonMarkup() {
1423
1921
  if (renderEnterButton) {
1424
- return renderEnterButton(_this5.enterButtonOnClick);
1922
+ return renderEnterButton(_this6.enterButtonOnClick);
1425
1923
  }
1426
1924
  return vue.createVNode(Button.Button, {
1427
1925
  "class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
1428
1926
  "primary": true,
1429
- "onClick": _this5.enterButtonOnClick
1927
+ "onClick": _this6.enterButtonOnClick
1430
1928
  }, {
1431
1929
  "default": function _default() {
1432
1930
  return [vue.createTextVNode("Search")];
@@ -1439,71 +1937,98 @@ var SearchBox = vue.defineComponent({
1439
1937
  }
1440
1938
  return null;
1441
1939
  },
1442
- renderIcons: function renderIcons() {
1443
- var _this6 = this;
1444
- var _slot3, _slot4, _slot5;
1940
+ renderShortcut: function renderShortcut() {
1941
+ if (this.$props.focusShortcuts && this.$props.focusShortcuts.length) {
1942
+ var shortcut = this.$props.focusShortcuts[0];
1943
+ shortcut = shortcut.toLowerCase();
1944
+ shortcut = shortcut.replace('shift', '⬆️');
1945
+ shortcut = shortcut.replace('command', 'cmd');
1946
+ shortcut = shortcut.replace('control', 'ctrl');
1947
+ shortcut = shortcut.replace('option', 'alt');
1948
+ return shortcut.toUpperCase();
1949
+ }
1950
+ return '/';
1951
+ },
1952
+ renderLeftIcons: function renderLeftIcons() {
1953
+ var _this7 = this;
1954
+ var _slot3;
1445
1955
  var _this$$props3 = this.$props,
1446
1956
  iconPosition = _this$$props3.iconPosition,
1447
- showClear = _this$$props3.showClear,
1448
- innerClass = _this$$props3.innerClass,
1449
- getMicInstance = _this$$props3.getMicInstance,
1450
- showVoiceSearch = _this$$props3.showVoiceSearch,
1451
1957
  showIcon = _this$$props3.showIcon;
1958
+ return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
1959
+ "groupPosition": "left"
1960
+ }, {
1961
+ "default": function _default() {
1962
+ return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1963
+ "onClick": _this7.handleSearchIconClick
1964
+ }, _isSlot(_slot3 = _this7.renderIcon()) ? _slot3 : {
1965
+ "default": function _default() {
1966
+ return [_slot3];
1967
+ }
1968
+ })];
1969
+ }
1970
+ })]);
1971
+ },
1972
+ renderRightIcons: function renderRightIcons() {
1973
+ var _this8 = this;
1974
+ var _slot4, _slot5, _slot6;
1975
+ var _this$$props4 = this.$props,
1976
+ iconPosition = _this$$props4.iconPosition,
1977
+ showClear = _this$$props4.showClear,
1978
+ innerClass = _this$$props4.innerClass,
1979
+ getMicInstance = _this$$props4.getMicInstance,
1980
+ showVoiceSearch = _this$$props4.showVoiceSearch,
1981
+ showIcon = _this$$props4.showIcon,
1982
+ showFocusShortcutsIcon = _this$$props4.showFocusShortcutsIcon;
1452
1983
  var renderMic = this.$slots.renderMic || this.$props.renderMic;
1453
1984
  var currentValue = this.$data.currentValue;
1454
1985
  return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
1455
- "groupPosition": "right",
1456
- "positionType": "absolute"
1986
+ "groupPosition": "right"
1457
1987
  }, {
1458
1988
  "default": function _default() {
1459
1989
  return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
1460
- "onClick": _this6.clearValue,
1990
+ "onClick": _this8.clearValue,
1461
1991
  "showIcon": showIcon,
1462
1992
  "isClearIcon": true
1463
- }, _isSlot(_slot3 = _this6.renderCancelIcon()) ? _slot3 : {
1993
+ }, _isSlot(_slot4 = _this8.renderCancelIcon()) ? _slot4 : {
1464
1994
  "default": function _default() {
1465
- return [_slot3];
1995
+ return [_slot4];
1996
+ }
1997
+ }), showFocusShortcutsIcon && vue.createVNode(DropDown.ButtonIconWrapper, {
1998
+ "onClick": function onClick(e) {
1999
+ return _this8.focusSearchBox(e);
2000
+ }
2001
+ }, _isSlot(_slot5 = _this8.renderShortcut()) ? _slot5 : {
2002
+ "default": function _default() {
2003
+ return [_slot5];
1466
2004
  }
1467
2005
  }), showVoiceSearch && vue.createVNode(Mic, {
1468
2006
  "getInstance": getMicInstance,
1469
2007
  "render": renderMic,
1470
- "handleResult": _this6.handleVoiceResults,
2008
+ "handleResult": _this8.handleVoiceResults,
1471
2009
  "className": getClassName$1(innerClass, 'mic') || null
1472
2010
  }, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1473
- "onClick": _this6.handleSearchIconClick
1474
- }, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
1475
- "default": function _default() {
1476
- return [_slot4];
1477
- }
1478
- })];
1479
- }
1480
- }), vue.createVNode(DropDown.IconGroup, {
1481
- "groupPosition": "left",
1482
- "positionType": "absolute"
1483
- }, {
1484
- "default": function _default() {
1485
- return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1486
- "onClick": _this6.handleSearchIconClick
1487
- }, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
2011
+ "onClick": _this8.handleSearchIconClick
2012
+ }, _isSlot(_slot6 = _this8.renderIcon()) ? _slot6 : {
1488
2013
  "default": function _default() {
1489
- return [_slot5];
2014
+ return [_slot6];
1490
2015
  }
1491
2016
  })];
1492
2017
  }
1493
2018
  })]);
1494
2019
  },
1495
2020
  focusSearchBox: function focusSearchBox(event) {
1496
- var _this$$refs, _this$$refs$this$$pro;
2021
+ var _this$$refs3, _this$$refs3$this$$pr, _this$$refs3$this$$pr2;
1497
2022
  var elt = event.target || event.srcElement;
1498
2023
  var tagName = elt.tagName;
1499
2024
  if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
1500
2025
  // already in an input
1501
2026
  return;
1502
2027
  }
1503
- (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
2028
+ (_this$$refs3 = this.$refs) == null ? void 0 : (_this$$refs3$this$$pr = _this$$refs3[this.$props.innerRef]) == null ? void 0 : (_this$$refs3$this$$pr2 = _this$$refs3$this$$pr.$el) == null ? void 0 : _this$$refs3$this$$pr2.focus(); // eslint-disable-line
1504
2029
  },
1505
2030
  listenForFocusShortcuts: function listenForFocusShortcuts() {
1506
- var _this7 = this;
2031
+ var _this9 = this;
1507
2032
  var _this$$props$focusSho = this.$props.focusShortcuts,
1508
2033
  focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
1509
2034
  if (index.isEmpty(focusShortcuts)) {
@@ -1518,7 +2043,7 @@ var SearchBox = vue.defineComponent({
1518
2043
  function (event, handler) {
1519
2044
  // Prevent the default refresh event under WINDOWS system
1520
2045
  event.preventDefault();
1521
- _this7.focusSearchBox(event);
2046
+ _this9.focusSearchBox(event);
1522
2047
  });
1523
2048
 
1524
2049
  // if one of modifier keys are used, they are handled below
@@ -1528,7 +2053,7 @@ var SearchBox = vue.defineComponent({
1528
2053
  for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
1529
2054
  var element = modifierKeys[index$1];
1530
2055
  if (hotkeys[element]) {
1531
- _this7.focusSearchBox(event);
2056
+ _this9.focusSearchBox(event);
1532
2057
  break;
1533
2058
  }
1534
2059
  }
@@ -1540,19 +2065,34 @@ var SearchBox = vue.defineComponent({
1540
2065
  this.currentValue = index.decodeHtml(value);
1541
2066
  this.triggerDefaultQuery(value);
1542
2067
  },
1543
- renderAutoFill: function renderAutoFill(suggestion) {
1544
- var _this8 = this;
2068
+ renderActionIcon: function renderActionIcon(suggestion) {
2069
+ var _this10 = this;
1545
2070
  var handleAutoFillClick = function handleAutoFillClick(e) {
1546
2071
  e.stopPropagation();
1547
- _this8.onAutofillClick(suggestion);
2072
+ _this10.onAutofillClick(suggestion);
1548
2073
  };
1549
- /* 👇 avoid showing autofill for category suggestions👇 */
1550
- return suggestion._category ? null : vue.createVNode(AutoFillSvg, {
1551
- "onClick": handleAutoFillClick
1552
- }, null);
2074
+ if (suggestion._suggestion_type === helper.suggestionTypes.Featured) {
2075
+ if (suggestion.action === helper.featuredSuggestionsActionTypes.FUNCTION) {
2076
+ return vue.createVNode(AutoFillSvg, {
2077
+ "style": {
2078
+ transform: 'rotate(135deg)',
2079
+ pointerEvents: 'none'
2080
+ }
2081
+ }, null);
2082
+ }
2083
+ return null;
2084
+ }
2085
+ if (!suggestion._category) {
2086
+ /* 👇 avoid showing autofill for category suggestions👇 */
2087
+
2088
+ return vue.createVNode(AutoFillSvg, {
2089
+ "onClick": handleAutoFillClick
2090
+ }, null);
2091
+ }
2092
+ return null;
1553
2093
  },
1554
2094
  renderTag: function renderTag(item) {
1555
- var _this9 = this;
2095
+ var _this11 = this;
1556
2096
  var innerClass = this.$props.innerClass;
1557
2097
  return vue.createVNode(TagItem, {
1558
2098
  "class": getClassName$1(innerClass, 'selected-tag') || ''
@@ -1563,7 +2103,7 @@ var SearchBox = vue.defineComponent({
1563
2103
  "aria-label": "delete-tag",
1564
2104
  "class": "close-icon",
1565
2105
  "onClick": function onClick() {
1566
- return _this9.clearTag(item);
2106
+ return _this11.clearTag(item);
1567
2107
  }
1568
2108
  }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
1569
2109
  }
@@ -1586,7 +2126,7 @@ var SearchBox = vue.defineComponent({
1586
2126
  }
1587
2127
  },
1588
2128
  renderTags: function renderTags() {
1589
- var _this10 = this;
2129
+ var _this12 = this;
1590
2130
  if (!Array.isArray(this.selectedTags)) {
1591
2131
  return null;
1592
2132
  }
@@ -1600,193 +2140,451 @@ var SearchBox = vue.defineComponent({
1600
2140
  }) : vue.createVNode(TagsContainer, null, {
1601
2141
  "default": function _default() {
1602
2142
  return [tagsList.map(function (item) {
1603
- return _this10.renderTag(item);
2143
+ return _this12.renderTag(item);
1604
2144
  }), shouldRenderClearAllTag && vue.createVNode(TagItem, {
1605
- "class": getClassName$1(_this10.$props.innerClass, 'selected-tag') || ''
2145
+ "class": getClassName$1(_this12.$props.innerClass, 'selected-tag') || ''
1606
2146
  }, {
1607
2147
  "default": function _default() {
1608
2148
  return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
1609
2149
  "role": "img",
1610
2150
  "aria-label": "delete-tag",
1611
2151
  "class": "close-icon",
1612
- "onClick": _this10.clearAllTags
2152
+ "onClick": _this12.clearAllTags
1613
2153
  }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
1614
2154
  }
1615
2155
  })];
1616
2156
  }
1617
2157
  });
1618
- }
1619
- },
1620
- render: function render() {
1621
- var _this11 = this;
1622
- var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
1623
- var _this$$slots = this.$slots,
1624
- recentSearchesIcon = _this$$slots.recentSearchesIcon,
1625
- popularSearchesIcon = _this$$slots.popularSearchesIcon;
1626
- var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
1627
- var renderItem = this.$slots.renderItem || this.$props.renderItem;
1628
- return vue.createVNode(Container.Container, {
1629
- "class": this.$props.className
1630
- }, {
1631
- "default": function _default() {
1632
- return [_this11.$props.title && vue.createVNode(Title.Title, {
1633
- "class": getClassName$1(_this11.$props.innerClass, 'title') || ''
1634
- }, {
1635
- "default": function _default() {
1636
- return [_this11.$props.title];
2158
+ },
2159
+ getAISourceObjects: function getAISourceObjects() {
2160
+ var localCache = helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) && helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY)[this.componentId];
2161
+ var sourceObjects = [];
2162
+ if (!this.AIResponse) return sourceObjects;
2163
+ var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
2164
+ if (localCache && localCache.meta && localCache.meta.hits && localCache.meta.hits.hits) {
2165
+ docIds.forEach(function (id) {
2166
+ var foundSourceObj = localCache.meta.hits.hits.find(function (hit) {
2167
+ return hit._id === id;
2168
+ }) || {};
2169
+ if (foundSourceObj) {
2170
+ var _foundSourceObj$_sour = foundSourceObj._source,
2171
+ _source = _foundSourceObj$_sour === void 0 ? {} : _foundSourceObj$_sour,
2172
+ rest = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(foundSourceObj, _excluded);
2173
+ sourceObjects.push(_rollupPluginBabelHelpers._extends({}, rest, _source));
1637
2174
  }
1638
- }), _this11.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
1639
- "id": _this11.$props.componentId + "-downshift",
1640
- "handleChange": _this11.onSuggestionSelected,
1641
- "handleMouseup": _this11.handleStateChange,
1642
- "isOpen": _this11.$data.isOpen
1643
- }, {
1644
- "default": function _default(_ref5) {
1645
- var getInputEvents = _ref5.getInputEvents,
1646
- getInputProps = _ref5.getInputProps,
1647
- getItemProps = _ref5.getItemProps,
1648
- getItemEvents = _ref5.getItemEvents,
1649
- isOpen = _ref5.isOpen,
1650
- highlightedIndex = _ref5.highlightedIndex,
1651
- setHighlightedIndex = _ref5.setHighlightedIndex;
1652
- var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
1653
- var getIcon = function getIcon(iconType) {
1654
- switch (iconType) {
1655
- case helper.suggestionTypes.Recent:
1656
- return recentSearchesIcon;
1657
- case helper.suggestionTypes.Popular:
1658
- return popularSearchesIcon;
1659
- default:
1660
- return null;
1661
- }
1662
- };
1663
- return vue.createVNode("div", null, [_this11.hasCustomRenderer && _this11.getComponent({
1664
- isOpen: isOpen,
1665
- getItemProps: getItemProps,
1666
- getItemEvents: getItemEvents,
1667
- highlightedIndex: highlightedIndex
1668
- }), _this11.renderErrorComponent(), !_this11.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
1669
- "class": Input.suggestions(_this11.themePreset, _this11.theme) + " " + getClassName$1(_this11.$props.innerClass, 'list')
1670
- }, [_this11.normalizedSuggestions.map(function (item, index) {
1671
- return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
1672
- item: item
1673
- }), getItemEvents({
1674
- item: item
1675
- }), {
1676
- "key": index + 1 + "-" + item.value,
1677
- "style": {
1678
- backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1679
- justifyContent: 'flex-start',
1680
- alignItems: 'center'
1681
- }
1682
- }), [renderItem(item)]) : vue.createVNode("li", vue.mergeProps(getItemProps({
1683
- item: item
1684
- }), _transformOn(getItemEvents({
1685
- item: item
1686
- })), {
1687
- "key": index + 1 + "-" + item.value,
1688
- "style": {
1689
- backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1690
- justifyContent: 'flex-start',
1691
- alignItems: 'center'
1692
- }
1693
- }), [vue.createVNode("div", {
1694
- "style": {
1695
- padding: '0 10px 0 0',
1696
- display: 'flex'
1697
- }
1698
- }, [vue.createVNode(CustomSvg, {
1699
- "className": getClassName$1(_this11.$props.innerClass, item._suggestion_type + "-search-icon") || null,
1700
- "icon": getIcon(item._suggestion_type),
1701
- "type": item._suggestion_type + "-search-icon"
1702
- }, null)]), vue.createVNode(SuggestionItem, {
1703
- "currentValue": _this11.currentValue,
1704
- "suggestion": item
1705
- }, null), _this11.renderAutoFill(item)]);
1706
- })]) : _this11.renderNoSuggestions(_this11.normalizedSuggestions)]);
1707
- };
1708
- return vue.createVNode("div", {
1709
- "class": Input.suggestionsContainer
1710
- }, [vue.createVNode(InputGroup, null, {
1711
- "default": function _default() {
1712
- return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
1713
- "default": function _default() {
1714
- return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn(getInputEvents({
1715
- onInput: _this11.onInputChange,
1716
- onBlur: function onBlur(e) {
1717
- _this11.$emit('blur', e, _this11.triggerQuery);
1718
- },
1719
- onFocus: _this11.handleFocus,
1720
- onKeyPress: function onKeyPress(e) {
1721
- _this11.$emit('keyPress', e, _this11.triggerQuery);
1722
- _this11.$emit('key-press', e, _this11.triggerQuery);
1723
- },
1724
- onKeyDown: function onKeyDown(e) {
1725
- return _this11.handleKeyDown(e, highlightedIndex);
1726
- },
1727
- onKeyUp: function onKeyUp(e) {
1728
- _this11.$emit('keyUp', e, _this11.triggerQuery);
1729
- _this11.$emit('key-up', e, _this11.triggerQuery);
1730
- },
1731
- onClick: function onClick() {
1732
- setHighlightedIndex(null);
1733
- }
2175
+ });
2176
+ } else {
2177
+ sourceObjects.push.apply(sourceObjects, docIds.map(function (id) {
2178
+ return {
2179
+ _id: id
2180
+ };
2181
+ }));
2182
+ }
2183
+ return sourceObjects;
2184
+ },
2185
+ renderAIScreenLoader: function renderAIScreenLoader() {
2186
+ var _this$$props$AIUIConf = this.$props.AIUIConfig,
2187
+ AIUIConfig = _this$$props$AIUIConf === void 0 ? {} : _this$$props$AIUIConf;
2188
+ var _ref5 = AIUIConfig || {},
2189
+ loaderMessage = _ref5.loaderMessage;
2190
+ if (loaderMessage) {
2191
+ return loaderMessage;
2192
+ }
2193
+ if (this.$slots.AILoaderMessage) {
2194
+ return this.$slots.AILoaderMessage();
2195
+ }
2196
+ return vue.createVNode(HorizontalSkeletonLoader, null, null);
2197
+ },
2198
+ renderAIScreenFooter: function renderAIScreenFooter() {
2199
+ var _slot8;
2200
+ var _this13 = this;
2201
+ var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
2202
+ AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
2203
+ var _ref6 = AIUIConfig || {},
2204
+ _ref6$showSourceDocum = _ref6.showSourceDocuments,
2205
+ showSourceDocuments = _ref6$showSourceDocum === void 0 ? true : _ref6$showSourceDocum,
2206
+ _ref6$onSourceClick = _ref6.onSourceClick,
2207
+ onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
2208
+ var renderSourceDocumentLabel = function renderSourceDocumentLabel(sourceObj) {
2209
+ if (_this13.$props.AIUIConfig && _this13.$props.AIUIConfig.renderSourceDocument) {
2210
+ return _this13.$props.AIUIConfig.renderSourceDocument(sourceObj);
2211
+ }
2212
+ if (_this13.$slots.renderSourceDocument) {
2213
+ return _this13.$slots.renderSourceDocument(sourceObj);
2214
+ }
2215
+ return sourceObj._id;
2216
+ };
2217
+ return showSourceDocuments && this.showAIScreenFooter && this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds ? vue.createVNode(Footer, {
2218
+ "themePreset": this.$props.themePreset
2219
+ }, {
2220
+ "default": function _default() {
2221
+ return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot8 = _this13.getAISourceObjects().map(function (el) {
2222
+ var _slot7;
2223
+ return vue.createVNode(Button.Button, {
2224
+ "class": "--ai-source-tag " + (getClassName$1(_this13.$props.innerClass, 'ai-source-tag') || ''),
2225
+ "info": true,
2226
+ "onClick": function onClick() {
2227
+ return onSourceClick && onSourceClick(el);
2228
+ }
2229
+ }, _isSlot(_slot7 = renderSourceDocumentLabel(el)) ? _slot7 : {
2230
+ "default": function _default() {
2231
+ return [_slot7];
2232
+ }
2233
+ });
2234
+ })) ? _slot8 : {
2235
+ "default": function _default() {
2236
+ return [_slot8];
2237
+ }
2238
+ })];
2239
+ }
2240
+ }) : null;
2241
+ },
2242
+ renderAIScreen: function renderAIScreen() {
2243
+ var _this14 = this;
2244
+ var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
2245
+ if (customAIRenderer) {
2246
+ return customAIRenderer({
2247
+ question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
2248
+ answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
2249
+ documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
2250
+ loading: this.isAIResponseLoading || this.isLoading,
2251
+ sources: this.getAISourceObjects(),
2252
+ error: this.AIResponseError
2253
+ });
2254
+ }
2255
+ if (this.isAIResponseLoading || this.isLoading) {
2256
+ return this.renderAIScreenLoader();
2257
+ }
2258
+ return vue.createVNode("div", null, [vue.createVNode(Answer, {
2259
+ "innerHTML": md.render(this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text)
2260
+ }, null), this.renderAIScreenFooter(), this.showFeedbackComponent && vue.createVNode("div", {
2261
+ "class": "" + (getClassName$1(this.$props.innerClass, 'ai-feedback') || '')
2262
+ }, [vue.createVNode(AIFeedback, {
2263
+ "overrideState": this.feedbackState,
2264
+ "hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
2265
+ "key": this.sessionIdFromStore,
2266
+ "onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
2267
+ _this14.feedbackState = {
2268
+ isRecorded: true,
2269
+ feedbackType: useful ? 'positive' : 'negative'
2270
+ };
2271
+ _this14.recordAISessionUsefulness(_this14.sessionIdFromStore, {
2272
+ useful: useful,
2273
+ reason: reason
2274
+ });
2275
+ }
2276
+ }, null)])]);
2277
+ },
2278
+ handleTextAreaHeightChange: function handleTextAreaHeightChange() {
2279
+ var _this$$refs$this$$pro, _this$$refs$_inputGro;
2280
+ var textArea = (_this$$refs$this$$pro = this.$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.$el;
2281
+ var inputGroupEle = (_this$$refs$_inputGro = this.$refs[_inputGroupRef]) == null ? void 0 : _this$$refs$_inputGro.$el;
2282
+ if (textArea) {
2283
+ textArea.style.height = '42px';
2284
+ var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
2285
+ var maxHeight = lineHeight * 4; // max height for 3 lines
2286
+ var height = Math.min(textArea.scrollHeight, maxHeight);
2287
+ textArea.style.height = height + "px";
2288
+ textArea.style.overflowY = height === maxHeight ? 'auto' : 'hidden';
2289
+ var dropdownEle = this.$refs[_dropdownULRef];
2290
+ if (dropdownEle) {
2291
+ dropdownEle.style.top = "" + textArea.style.height;
2292
+ }
2293
+ if (inputGroupEle) {
2294
+ inputGroupEle.style.height = "" + textArea.style.height;
2295
+ }
2296
+ }
2297
+ },
2298
+ askButtonOnClick: function askButtonOnClick() {
2299
+ this.showAIScreen = true;
2300
+ this.isOpen = true;
2301
+ this.triggerDefaultQuery(this.currentValue, {
2302
+ enableAI: true
2303
+ });
2304
+ },
2305
+ renderAskButtonElement: function renderAskButtonElement() {
2306
+ var _this15 = this;
2307
+ var _this$$props5 = this.$props,
2308
+ AIUIConfig = _this$$props5.AIUIConfig,
2309
+ innerClass = _this$$props5.innerClass;
2310
+ var _ref7 = AIUIConfig || {},
2311
+ askButton = _ref7.askButton;
2312
+ var renderAskButton = this.$slots.renderAskButton;
2313
+ if (askButton) {
2314
+ var getEnterButtonMarkup = function getEnterButtonMarkup() {
2315
+ if (renderAskButton) {
2316
+ return renderAskButton(_this15.askButtonOnClick);
2317
+ }
2318
+ return vue.createVNode(Button.Button, {
2319
+ "class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
2320
+ "info": true,
2321
+ "onClick": _this15.askButtonOnClick
2322
+ }, {
2323
+ "default": function _default() {
2324
+ return [vue.createTextVNode("Ask")];
2325
+ }
2326
+ });
2327
+ };
2328
+ return vue.createVNode("div", {
2329
+ "class": "enter-button-wrapper"
2330
+ }, [getEnterButtonMarkup()]);
2331
+ }
2332
+ return null;
2333
+ }
2334
+ },
2335
+ render: function render() {
2336
+ var _this16 = this;
2337
+ var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
2338
+ var _this$$slots = this.$slots,
2339
+ recentSearchesIcon = _this$$slots.recentSearchesIcon,
2340
+ popularSearchesIcon = _this$$slots.popularSearchesIcon;
2341
+ var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
2342
+ var renderItem = this.$slots.renderItem || this.$props.renderItem;
2343
+ return vue.createVNode(Container.Container, {
2344
+ "class": this.$props.className
2345
+ }, {
2346
+ "default": function _default() {
2347
+ return [_this16.$props.title && vue.createVNode(Title.Title, {
2348
+ "class": getClassName$1(_this16.$props.innerClass, 'title') || ''
2349
+ }, {
2350
+ "default": function _default() {
2351
+ return [_this16.$props.title];
2352
+ }
2353
+ }), _this16.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
2354
+ "id": _this16.$props.componentId + "-downshift",
2355
+ "handleChange": _this16.onSuggestionSelected,
2356
+ "handleMouseup": _this16.handleStateChange,
2357
+ "isOpen": _this16.$data.isOpen
2358
+ }, {
2359
+ "default": function _default(_ref8) {
2360
+ var getInputEvents = _ref8.getInputEvents,
2361
+ getInputProps = _ref8.getInputProps,
2362
+ getItemProps = _ref8.getItemProps,
2363
+ getItemEvents = _ref8.getItemEvents,
2364
+ isOpen = _ref8.isOpen,
2365
+ highlightedIndex = _ref8.highlightedIndex,
2366
+ setHighlightedIndex = _ref8.setHighlightedIndex;
2367
+ var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
2368
+ var getIcon = function getIcon(iconType, item, leaveSpaceForIcon) {
2369
+ switch (iconType) {
2370
+ case helper.suggestionTypes.Recent:
2371
+ return recentSearchesIcon;
2372
+ case helper.suggestionTypes.Popular:
2373
+ return popularSearchesIcon;
2374
+ case helper.suggestionTypes.Featured:
2375
+ if (item.icon) {
2376
+ return function () {
2377
+ return vue.createVNode("div", {
2378
+ "style": {
2379
+ display: 'flex'
2380
+ },
2381
+ "innerHTML": xss(item.icon)
2382
+ }, null);
2383
+ };
2384
+ }
2385
+ if (item.iconURL) {
2386
+ return function () {
2387
+ return (// When you change below also change the empty icon below
2388
+ vue.createVNode("img", {
2389
+ "style": {
2390
+ maxHeight: '25px'
2391
+ },
2392
+ "src": xss(item.iconURL),
2393
+ "alt": item.value
2394
+ }, null)
2395
+ );
2396
+ };
2397
+ }
2398
+ // Render an empty icon when no icon is provided from the dashboard
2399
+ return function () {
2400
+ return vue.createVNode("span", {
2401
+ "style": {
2402
+ display: 'inline-block',
2403
+ height: '25px',
2404
+ width: leaveSpaceForIcon ? '25px' : 0
2405
+ }
2406
+ }, null);
2407
+ };
2408
+ default:
2409
+ return null;
2410
+ }
2411
+ };
2412
+ var indexOffset = 0;
2413
+ return vue.createVNode("div", null, [_this16.hasCustomRenderer && _this16.getComponent({
2414
+ isOpen: isOpen,
2415
+ getItemProps: getItemProps,
2416
+ getItemEvents: getItemEvents,
2417
+ highlightedIndex: highlightedIndex
2418
+ }), _this16.renderErrorComponent(), !_this16.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
2419
+ "class": Input.suggestions(_this16.themePreset, _this16.theme) + " " + getClassName$1(_this16.$props.innerClass, 'list') + " " + Input.searchboxSuggestions(_this16.themePreset, _this16.theme) + "\n\t\t\t\t\t\t\t\t\t\t\t\t\t",
2420
+ "ref": _dropdownULRef
2421
+ }, [_this16.showAIScreen && vue.createVNode(SearchBoxAISection, {
2422
+ "themePreset": _this16.$props.themePreset
2423
+ }, {
2424
+ "default": function _default() {
2425
+ return [_this16.renderAIScreen(), ' ', _this16.renderErrorComponent(true)];
2426
+ }
2427
+ }), !_this16.showAIScreen && _this16.parsedSuggestions.map(function (item, itemIndex) {
2428
+ var index = indexOffset + itemIndex;
2429
+ if (Array.isArray(item)) {
2430
+ var sectionHtml = xss(item[0].sectionLabel);
2431
+ indexOffset += item.length - 1;
2432
+ return vue.createVNode("div", {
2433
+ "class": "section-container"
2434
+ }, [sectionHtml ? vue.createVNode("div", {
2435
+ "class": "section-header " + getClassName$1(_this16.$props.innerClass, 'section-label'),
2436
+ "key": "" + item[0].sectionId,
2437
+ "innerHTML": sectionHtml
2438
+ }, null) : null, vue.createVNode("ul", {
2439
+ "class": "section-list"
2440
+ }, [item.map(function (sectionItem, sectionIndex) {
2441
+ var suggestionsHaveIcon = item.some(function (s) {
2442
+ return s.icon || s.iconURL;
2443
+ });
2444
+ return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
2445
+ item: sectionItem
2446
+ }), _transformOn(getItemEvents({
2447
+ item: sectionItem
1734
2448
  })), {
1735
- "id": _this11.$props.componentId + "-input",
1736
- "showIcon": _this11.$props.showIcon,
1737
- "showClear": _this11.$props.showClear,
1738
- "iconPosition": _this11.$props.iconPosition,
1739
- "ref": _this11.$props.innerRef,
1740
- "class": getClassName$1(_this11.$props.innerClass, 'input'),
1741
- "placeholder": _this11.$props.placeholder,
1742
- "autoFocus": _this11.$props.autoFocus
2449
+ "key": index + sectionIndex,
2450
+ "style": {
2451
+ justifyContent: 'flex-start',
2452
+ alignItems: 'center'
2453
+ },
2454
+ "class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this16.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this16.$props.innerClass, 'suggestion-item'))
2455
+ }), [renderItem(sectionItem)]) : vue.createVNode("li", vue.mergeProps(getItemProps({
2456
+ item: sectionItem
2457
+ }), _transformOn(getItemEvents({
2458
+ item: sectionItem
2459
+ })), {
2460
+ "key": index + sectionIndex,
2461
+ "style": {
2462
+ justifyContent: 'flex-start',
2463
+ alignItems: 'center'
2464
+ },
2465
+ "class": "" + (highlightedIndex === index + sectionIndex ? "active-li-item " + getClassName$1(_this16.$props.innerClass, 'active-suggestion-item') : "li-item " + getClassName$1(_this16.$props.innerClass, 'suggestion-item'))
2466
+ }), [vue.createVNode("div", {
2467
+ "style": {
2468
+ padding: '0 10px 0 0',
2469
+ display: 'flex'
2470
+ }
2471
+ }, [vue.createVNode(CustomSvg, {
2472
+ "className": getClassName$1(_this16.$props.innerClass, sectionItem._suggestion_type + "-search-icon") || null,
2473
+ "icon": getIcon(sectionItem._suggestion_type, sectionItem, suggestionsHaveIcon),
2474
+ "type": sectionItem._suggestion_type + "-search-icon"
2475
+ }, null)]), vue.createVNode(SuggestionItem, {
2476
+ "currentValue": _this16.currentValue,
2477
+ "suggestion": sectionItem
2478
+ }, null), _this16.renderActionIcon(sectionItem)]);
2479
+ })])]);
2480
+ }
2481
+ return vue.createVNode("div", null, [vue.createTextVNode("No suggestions")]);
2482
+ }), !_this16.showAIScreen && _this16.parsedSuggestions.length && _this16.$props.showSuggestionsFooter ? _this16.suggestionsFooter() : null]) : _this16.renderNoSuggestions(_this16.normalizedSuggestions)]);
2483
+ };
2484
+ return vue.createVNode("div", {
2485
+ "class": Input.suggestionsContainer
2486
+ }, [vue.createVNode(InputGroup, {
2487
+ "searchBox": true,
2488
+ "ref": _inputGroupRef,
2489
+ "isOpen": _this16.$data.isOpen
2490
+ }, {
2491
+ "default": function _default() {
2492
+ return [vue.createVNode(Input.Actions, null, {
2493
+ "default": function _default() {
2494
+ return [_this16.renderInputAddonBefore(), _this16.renderLeftIcons()];
2495
+ }
2496
+ }), vue.createVNode(DropDown.InputWrapper, null, {
2497
+ "default": function _default() {
2498
+ return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn(getInputEvents({
2499
+ onInput: _this16.onInputChange,
2500
+ onBlur: function onBlur(e) {
2501
+ _this16.$emit('blur', e, _this16.triggerQuery);
2502
+ },
2503
+ onFocus: _this16.handleFocus,
2504
+ onKeyPress: function onKeyPress(e) {
2505
+ _this16.$emit('keyPress', e, _this16.triggerQuery);
2506
+ _this16.$emit('key-press', e, _this16.triggerQuery);
2507
+ },
2508
+ onKeyDown: function onKeyDown(e) {
2509
+ return _this16.handleKeyDown(e, highlightedIndex);
2510
+ },
2511
+ onKeyUp: function onKeyUp(e) {
2512
+ _this16.$emit('keyUp', e, _this16.triggerQuery);
2513
+ _this16.$emit('key-up', e, _this16.triggerQuery);
2514
+ },
2515
+ onClick: function onClick() {
2516
+ setHighlightedIndex(null);
2517
+ }
2518
+ })), {
2519
+ "isOpen": _this16.$data.isOpen,
2520
+ "id": _this16.$props.componentId + "-input",
2521
+ "ref": _this16.$props.innerRef,
2522
+ "class": getClassName$1(_this16.$props.innerClass, 'input'),
2523
+ "placeholder": _this16.$props.placeholder,
2524
+ "autoFocus": _this16.$props.autoFocus,
2525
+ "searchBox": true
1743
2526
  }, getInputProps({
1744
- value: _this11.$data.currentValue === null ? '' : _this11.$data.currentValue
2527
+ value: _this16.$data.currentValue === null ? '' : _this16.$data.currentValue
1745
2528
  }), {
1746
- "themePreset": _this11.themePreset,
2529
+ "themePreset": _this16.themePreset,
1747
2530
  "autocomplete": "off"
1748
- }), null), _this11.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
2531
+ }), null), !expandSuggestionsContainer && renderSuggestionsDropdown()];
2532
+ }
2533
+ }), vue.createVNode(Input.Actions, null, {
2534
+ "default": function _default() {
2535
+ return [_this16.renderRightIcons(), _this16.renderInputAddonAfter(), _this16.renderAskButtonElement(), _this16.renderEnterButtonElement()];
1749
2536
  }
1750
- }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
2537
+ })];
1751
2538
  }
1752
- }), expandSuggestionsContainer && renderSuggestionsDropdown(), _this11.renderTags()]);
2539
+ }), expandSuggestionsContainer && renderSuggestionsDropdown(), _this16.renderTags()]);
1753
2540
  }
1754
2541
  }) : vue.createVNode("div", {
1755
2542
  "class": Input.suggestionsContainer
1756
- }, [vue.createVNode(InputGroup, null, {
2543
+ }, [vue.createVNode(InputGroup, {
2544
+ "searchBox": true,
2545
+ "ref": _inputGroupRef
2546
+ }, {
1757
2547
  "default": function _default() {
1758
- return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
2548
+ return [vue.createVNode(Input.Actions, null, {
2549
+ "default": function _default() {
2550
+ return [_this16.renderInputAddonBefore(), _this16.renderLeftIcons()];
2551
+ }
2552
+ }), vue.createVNode(DropDown.InputWrapper, null, {
1759
2553
  "default": function _default() {
1760
- return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn({
2554
+ return [vue.createVNode(Input.TextArea, vue.mergeProps(_transformOn({
1761
2555
  blur: function blur(e) {
1762
- _this11.$emit('blur', e, _this11.triggerQuery);
2556
+ _this16.$emit('blur', e, _this16.triggerQuery);
1763
2557
  },
1764
2558
  keypress: function keypress(e) {
1765
- _this11.$emit('keyPress', e, _this11.triggerQuery);
1766
- _this11.$emit('key-press', e, _this11.triggerQuery);
2559
+ _this16.$emit('keyPress', e, _this16.triggerQuery);
2560
+ _this16.$emit('key-press', e, _this16.triggerQuery);
1767
2561
  },
1768
- input: _this11.onInputChange,
2562
+ input: _this16.onInputChange,
1769
2563
  focus: function focus(e) {
1770
- _this11.$emit('focus', e, _this11.triggerQuery);
2564
+ _this16.$emit('focus', e, _this16.triggerQuery);
1771
2565
  },
1772
- keydown: _this11.handleKeyDown,
2566
+ keydown: _this16.handleKeyDown,
1773
2567
  keyup: function keyup(e) {
1774
- _this11.$emit('keyUp', e, _this11.triggerQuery);
1775
- _this11.$emit('key-up', e, _this11.triggerQuery);
2568
+ _this16.$emit('keyUp', e, _this16.triggerQuery);
2569
+ _this16.$emit('key-up', e, _this16.triggerQuery);
1776
2570
  }
1777
2571
  }), {
1778
- "class": getClassName$1(_this11.$props.innerClass, 'input') || '',
1779
- "placeholder": _this11.$props.placeholder,
1780
- "autofocus": _this11.$props.autoFocus,
1781
- "value": _this11.$data.currentValue ? _this11.$data.currentValue : '',
1782
- "iconPosition": _this11.$props.iconPosition,
1783
- "showIcon": _this11.$props.showIcon,
1784
- "showClear": _this11.$props.showClear,
1785
- "ref": _this11.$props.innerRef,
1786
- "themePreset": _this11.themePreset
1787
- }), null), _this11.renderIcons()];
2572
+ "class": getClassName$1(_this16.$props.innerClass, 'input') || '',
2573
+ "placeholder": _this16.$props.placeholder,
2574
+ "autofocus": _this16.$props.autoFocus,
2575
+ "value": _this16.$data.currentValue ? _this16.$data.currentValue : '',
2576
+ "iconPosition": _this16.$props.iconPosition,
2577
+ "showIcon": _this16.$props.showIcon,
2578
+ "showClear": _this16.$props.showClear,
2579
+ "ref": _this16.$props.innerRef,
2580
+ "themePreset": _this16.themePreset
2581
+ }), null)];
1788
2582
  }
1789
- }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
2583
+ }), vue.createVNode(Input.Actions, null, {
2584
+ "default": function _default() {
2585
+ return [_this16.renderRightIcons(), _this16.renderInputAddonAfter(), _this16.renderEnterButtonElement()];
2586
+ }
2587
+ })];
1790
2588
  }
1791
2589
  })])];
1792
2590
  }
@@ -1839,18 +2637,24 @@ var mapStateToProps = function mapStateToProps(state, props) {
1839
2637
  rawData: state.rawData[props.componentId],
1840
2638
  aggregationData: state.compositeAggregations[props.componentId] || [],
1841
2639
  themePreset: state.config.themePreset,
1842
- isLoading: !!state.isLoading[props.componentId + "_active"],
2640
+ isLoading: !!state.isLoading["" + props.componentId],
1843
2641
  error: state.error[props.componentId],
1844
2642
  time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1845
2643
  total: state.hits[props.componentId] && state.hits[props.componentId].total,
1846
- hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
2644
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
2645
+ AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response || null,
2646
+ isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
2647
+ AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
2648
+ sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
2649
+ isAITyping: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.isTyping || false
1847
2650
  };
1848
2651
  };
1849
2652
  var mapDispatchToProps = {
1850
2653
  updateQuery: updateQuery,
1851
2654
  setCustomQuery: setCustomQuery,
1852
2655
  setDefaultQuery: setDefaultQuery,
1853
- recordSuggestionClick: recordSuggestionClick
2656
+ recordSuggestionClick: recordSuggestionClick,
2657
+ recordAISessionUsefulness: analytics.recordAISessionUsefulness
1854
2658
  };
1855
2659
  var SBConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
1856
2660
  componentType: constants.componentTypes.searchBox,
@@ -1866,9 +2670,608 @@ SBConnected.install = function (Vue) {
1866
2670
  // Add componentType for SSR
1867
2671
  SBConnected.componentType = constants.componentTypes.searchBox;
1868
2672
 
1869
- var _templateObject$8, _templateObject2$1;
1870
- var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$8 || (_templateObject$8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
1871
- var HierarchicalMenuListItem = vueEmotion.styled('li')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
2673
+ function _isSlot$1(s) {
2674
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
2675
+ }
2676
+ var md$1 = new remarkable.Remarkable();
2677
+ md$1.set({
2678
+ html: true,
2679
+ breaks: true,
2680
+ xhtmlOut: true
2681
+ });
2682
+ var _inputWrapperRef = 'inputWrapperRef';
2683
+ var _inputRef = 'inputRef';
2684
+ var _errorContainerRef = 'errorContainerRef';
2685
+ var AIAnswer = vue.defineComponent({
2686
+ name: 'AIAnswer',
2687
+ data: function data() {
2688
+ var props = this.$props;
2689
+ this.__state = {
2690
+ messages: [],
2691
+ inputMessage: '',
2692
+ AISessionId: '',
2693
+ error: null
2694
+ };
2695
+ this.internalComponent = props.componentId + "__internal";
2696
+ return this.__state;
2697
+ },
2698
+ inject: {
2699
+ theme: {
2700
+ from: 'theme_reactivesearch'
2701
+ }
2702
+ },
2703
+ created: function created() {},
2704
+ computed: {
2705
+ hasCustomRenderer: function hasCustomRenderer() {
2706
+ return index.hasCustomRenderer(this);
2707
+ },
2708
+ isLoadingState: function isLoadingState() {
2709
+ return this.isAIResponseLoading || this.isLoading;
2710
+ },
2711
+ shouldShowComponent: function shouldShowComponent() {
2712
+ return this.showComponent;
2713
+ },
2714
+ errorMessageForMissingSessionId: function errorMessageForMissingSessionId() {
2715
+ return "AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISessionId to function. Try reloading the App.";
2716
+ }
2717
+ },
2718
+ props: {
2719
+ componentId: vueTypes.types.string.isRequired,
2720
+ showVoiceInput: VueTypes.bool.def(false),
2721
+ showFeedback: VueTypes.bool.def(true),
2722
+ showIcon: VueTypes.bool.def(true),
2723
+ onData: vueTypes.types.func,
2724
+ innerRef: VueTypes.string.def('AISearchInputField'),
2725
+ react: vueTypes.types.react,
2726
+ enableAI: VueTypes.bool.def(true),
2727
+ AIConfig: vueTypes.types.AIConfig,
2728
+ iconPosition: vueTypes.types.iconPosition.def('left'),
2729
+ themePreset: vueTypes.types.themePreset,
2730
+ theme: vueTypes.types.style,
2731
+ icon: vueTypes.types.children,
2732
+ iconURL: VueTypes.string.def(''),
2733
+ renderMic: vueTypes.types.func,
2734
+ getMicInstance: vueTypes.types.func,
2735
+ innerClass: vueTypes.types.style,
2736
+ placeholder: VueTypes.string.def('Ask a question'),
2737
+ title: vueTypes.types.title,
2738
+ AIResponse: vueTypes.types.componentObject,
2739
+ isAIResponseLoading: VueTypes.bool.def(false),
2740
+ AIResponseError: vueTypes.types.componentObject,
2741
+ getAIResponse: vueTypes.types.func.isRequired,
2742
+ enterButton: vueTypes.types.bool,
2743
+ renderEnterButton: vueTypes.types.title,
2744
+ showInput: VueTypes.bool.def(true),
2745
+ clearSessionOnDestroy: VueTypes.bool.def(true),
2746
+ rawData: vueTypes.types.rawData,
2747
+ render: vueTypes.types.func,
2748
+ onError: vueTypes.types.func,
2749
+ renderError: vueTypes.types.title,
2750
+ isLoading: vueTypes.types.boolRequired,
2751
+ sessionIdFromStore: VueTypes.string,
2752
+ showComponent: vueTypes.types.boolRequired,
2753
+ componentError: vueTypes.types.componentObject,
2754
+ style: vueTypes.types.style
2755
+ },
2756
+ mounted: function mounted() {},
2757
+ watch: {
2758
+ AIResponse: function AIResponse(newVal) {
2759
+ if (newVal) {
2760
+ this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
2761
+ var messagesHistory = newVal.messages,
2762
+ response = newVal.response;
2763
+ var finalMessages = [];
2764
+ if (response && response.error) {
2765
+ this.error = {
2766
+ message: response.error
2767
+ };
2768
+ }
2769
+
2770
+ // pushing message history so far
2771
+ if (messagesHistory && messagesHistory && Array.isArray(messagesHistory)) {
2772
+ finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
2773
+ return msg.role !== constants.AI_ROLES.SYSTEM;
2774
+ }));
2775
+ } else if (response && response.answer && response.answer.text) {
2776
+ finalMessages.push({
2777
+ role: constants.AI_ROLES.ASSISTANT,
2778
+ content: response.answer.text
2779
+ });
2780
+ if (!this.AISessionId) this.error = {
2781
+ message: this.errorMessageForMissingSessionId
2782
+ };
2783
+ }
2784
+ this.messages = finalMessages;
2785
+ } else if (!newVal && !this.error) {
2786
+ this.messages = [];
2787
+ }
2788
+ },
2789
+ rawData: function rawData(newVal) {
2790
+ this.$emit('on-data', {
2791
+ data: this.messages,
2792
+ rawData: newVal,
2793
+ loading: this.$props.isAIResponseLoading || this.$props.isLoading,
2794
+ error: this.$props.AIResponseError
2795
+ });
2796
+ },
2797
+ isAIResponseLoading: function isAIResponseLoading(newVal) {
2798
+ this.$emit('on-data', {
2799
+ data: this.messages,
2800
+ rawData: this.$props.rawData,
2801
+ loading: newVal || this.isLoading,
2802
+ error: this.$props.AIResponseError
2803
+ });
2804
+ },
2805
+ isLoading: function isLoading(newVal) {
2806
+ this.$emit('on-data', {
2807
+ data: this.messages,
2808
+ rawData: this.$props.rawData,
2809
+ loading: newVal || this.isAIResponseLoading,
2810
+ error: this.$props.AIResponseError
2811
+ });
2812
+ },
2813
+ sessionIdFromStore: function sessionIdFromStore(newVal) {
2814
+ if (newVal) {
2815
+ this.sessionId = newVal;
2816
+ }
2817
+ },
2818
+ AIResponseError: function AIResponseError(newVal) {
2819
+ this.error = newVal;
2820
+ this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
2821
+ if (this.error && !this.AISessionId) {
2822
+ var errorMessage = this.errorMessageForMissingSessionId;
2823
+ this.error = {
2824
+ message: errorMessage
2825
+ };
2826
+ console.error(errorMessage);
2827
+ }
2828
+ this.$emit('on-data', {
2829
+ data: this.messages,
2830
+ rawData: this.$props.rawData,
2831
+ loading: this.isAIResponseLoading || this.isLoading,
2832
+ error: newVal
2833
+ });
2834
+ },
2835
+ messages: function messages() {
2836
+ this.scrollToBottom();
2837
+ },
2838
+ componentError: function componentError(newVal) {
2839
+ var _this = this;
2840
+ if (newVal && newVal._bodyBlob) {
2841
+ this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
2842
+ if (!this.AISessionId) {
2843
+ this.generateNewSessionId();
2844
+ }
2845
+ newVal._bodyBlob.text().then(function (textData) {
2846
+ try {
2847
+ var parsedErrorRes = JSON.parse(textData);
2848
+ if (parsedErrorRes.error) {
2849
+ _this.error = parsedErrorRes.error;
2850
+ _this.$emit('on-data', {
2851
+ data: _this.messages,
2852
+ rawData: _this.$props.rawData,
2853
+ loading: _this.$props.isAIResponseLoading || _this.$props.isLoading,
2854
+ error: parsedErrorRes.error
2855
+ });
2856
+ }
2857
+ } catch (error) {
2858
+ console.error('Error parsing component error JSON:', error);
2859
+ }
2860
+ })["catch"](function (error) {
2861
+ console.error('Error reading component error text data:', error);
2862
+ });
2863
+ }
2864
+ }
2865
+ },
2866
+ methods: {
2867
+ generateNewSessionId: function generateNewSessionId() {
2868
+ var _this2 = this;
2869
+ var newSessionPromise = this.createAISession();
2870
+ newSessionPromise.then(function (res) {
2871
+ _this2.AISessionId = res.AIsessionId;
2872
+ })["catch"](function (e) {
2873
+ console.error(e);
2874
+ });
2875
+ },
2876
+ scrollToBottom: function scrollToBottom() {
2877
+ var _this3 = this;
2878
+ this.$nextTick(function () {
2879
+ var _this3$$refs;
2880
+ var messageContainer = (_this3$$refs = _this3.$refs) == null ? void 0 : _this3$$refs[_this3.$props.innerRef];
2881
+ if (messageContainer && messageContainer.$el) {
2882
+ messageContainer.$el.scrollTo({
2883
+ top: messageContainer.$el.scrollHeight,
2884
+ behavior: 'smooth'
2885
+ });
2886
+ }
2887
+ });
2888
+ },
2889
+ handleMessageInputChange: function handleMessageInputChange(e) {
2890
+ this.inputMessage = e.target.value;
2891
+ this.handleTextAreaHeightChange();
2892
+ },
2893
+ handleSendMessage: function handleSendMessage(e, isRetry, text) {
2894
+ if (isRetry === void 0) {
2895
+ isRetry = false;
2896
+ }
2897
+ if (text === void 0) {
2898
+ text = this.inputMessage;
2899
+ }
2900
+ if (typeof e === 'object' && e !== null) e.preventDefault();
2901
+ if (text.trim()) {
2902
+ if (this.isLoadingState) {
2903
+ return;
2904
+ }
2905
+ if (this.AISessionId) {
2906
+ if (!isRetry) this.messages = [].concat(this.messages, [{
2907
+ content: text,
2908
+ role: constants.AI_ROLES.USER
2909
+ }]);
2910
+ this.getAIResponse(this.AISessionId, this.componentId, text);
2911
+ } else {
2912
+ console.error(this.errorMessageForMissingSessionId);
2913
+ this.error = {
2914
+ message: "AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISessionId to function. Trying reloading the App."
2915
+ };
2916
+ }
2917
+ this.inputMessage = '';
2918
+ }
2919
+ },
2920
+ handleRetryRequest: function handleRetryRequest() {
2921
+ if (this.messages && !this.isLoadingState) {
2922
+ var _this$messages;
2923
+ var lastUserRequestMessage = (_this$messages = this.messages[this.messages.length - 1]) == null ? void 0 : _this$messages.content;
2924
+ if (this.AISessionId) {
2925
+ this.getAIResponse(this.AISessionId, this.componentId, lastUserRequestMessage);
2926
+ this.inputMessage = '';
2927
+ } else {
2928
+ console.error("AISessionId for " + this.componentId + " is missing! AIAnswer component requires an AISessionId to function. Try reloading the App.");
2929
+ }
2930
+ }
2931
+ },
2932
+ renderErrorComponent: function renderErrorComponent() {
2933
+ var renderError = this.$slots.renderError || this.$props.renderError;
2934
+ if (this.error && !this.isLoadingState) {
2935
+ var _this$error, _this$error2;
2936
+ if (renderError) {
2937
+ return vue.createVNode("div", {
2938
+ "ref": _errorContainerRef,
2939
+ "class": "--ai-answer-error-container " + (helper.getClassName(this.$props.innerClass, 'ai-error') || '')
2940
+ }, [index.isFunction(renderError) ? renderError(this.error, this.handleRetryRequest) : renderError]);
2941
+ }
2942
+ return vue.createVNode("div", {
2943
+ "ref": _errorContainerRef,
2944
+ "class": "--ai-answer-error-container " + (helper.getClassName(this.$props.innerClass, 'ai-error') || '')
2945
+ }, [vue.createVNode("div", {
2946
+ "class": "--default-error-element"
2947
+ }, [vue.createVNode("span", null, [(_this$error = this.error) != null && _this$error.message ? this.error.message : 'There was an error in generating the response.', ' ', (_this$error2 = this.error) != null && _this$error2.code ? ", Code:\n\t\t\t\t\t\t\t" + this.error.code : '']), this.AISessionId && vue.createVNode(Button.Button, {
2948
+ "primary": true,
2949
+ "onClick": this.handleRetryRequest
2950
+ }, {
2951
+ "default": function _default() {
2952
+ return [vue.createTextVNode("Try again")];
2953
+ }
2954
+ })])]);
2955
+ }
2956
+ return null;
2957
+ },
2958
+ handleKeyPress: function handleKeyPress(e) {
2959
+ window.console.log('e', e);
2960
+ if (e.key === 'Enter') {
2961
+ this.handleSendMessage(e);
2962
+ this.inputMessage = '';
2963
+ }
2964
+ },
2965
+ renderIcon: function renderIcon() {
2966
+ if (this.$props.showIcon) {
2967
+ if (this.$props.icon) {
2968
+ return this.$props.icon;
2969
+ }
2970
+ if (this.$slots.icon) {
2971
+ return this.$slots.icon();
2972
+ }
2973
+ if (this.$props.iconURL) {
2974
+ return vue.createVNode("img", {
2975
+ "style": {
2976
+ maxHeight: '25px'
2977
+ },
2978
+ "src": this.$props.iconURL,
2979
+ "alt": "search-icon"
2980
+ }, null);
2981
+ }
2982
+ return vue.createVNode(SearchSvg, null, null);
2983
+ }
2984
+ return null;
2985
+ },
2986
+ shouldMicRender: function shouldMicRender(showVoiceSearch) {
2987
+ // checks for SSR
2988
+ if (typeof window === 'undefined') return false;
2989
+ return showVoiceSearch && (window.webkitSpeechRecognition || window.SpeechRecognition);
2990
+ },
2991
+ handleVoiceResults: function handleVoiceResults(_ref) {
2992
+ var results = _ref.results;
2993
+ if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
2994
+ this.handleSendMessage(null, false, results[0][0].transcript.trim());
2995
+ }
2996
+ },
2997
+ renderIcons: function renderIcons() {
2998
+ var _this4 = this;
2999
+ var _slot, _slot2;
3000
+ var _this$$props = this.$props,
3001
+ getMicInstance = _this$$props.getMicInstance,
3002
+ showVoiceInput = _this$$props.showVoiceInput,
3003
+ iconPosition = _this$$props.iconPosition,
3004
+ innerClass = _this$$props.innerClass;
3005
+ var renderMic = this.$slots.renderMic || this.$props.renderMic;
3006
+ return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
3007
+ "enableAI": true,
3008
+ "groupPosition": "right",
3009
+ "positionType": "absolute"
3010
+ }, {
3011
+ "default": function _default() {
3012
+ return [!_this4.isLoadingState && _this4.AISessionId && _this4.shouldMicRender(showVoiceInput) && vue.createVNode(Mic, {
3013
+ "getInstance": getMicInstance,
3014
+ "render": renderMic,
3015
+ "handleResult": _this4.handleVoiceResults,
3016
+ "class": helper.getClassName(innerClass, 'ai-search-mic') || null
3017
+ }, null), iconPosition === 'right' && vue.createVNode(DropDown.IconWrapper, null, _isSlot$1(_slot = _this4.renderIcon()) ? _slot : {
3018
+ "default": function _default() {
3019
+ return [_slot];
3020
+ }
3021
+ })];
3022
+ }
3023
+ }), vue.createVNode(DropDown.IconGroup, {
3024
+ "enableAI": true,
3025
+ "groupPosition": "left",
3026
+ "positionType": "absolute"
3027
+ }, {
3028
+ "default": function _default() {
3029
+ return [iconPosition === 'left' && vue.createVNode(DropDown.IconWrapper, null, _isSlot$1(_slot2 = _this4.renderIcon()) ? _slot2 : {
3030
+ "default": function _default() {
3031
+ return [_slot2];
3032
+ }
3033
+ })];
3034
+ }
3035
+ })]);
3036
+ },
3037
+ enterButtonOnClick: function enterButtonOnClick(e) {
3038
+ this.handleSendMessage(e);
3039
+ },
3040
+ renderEnterButtonElement: function renderEnterButtonElement() {
3041
+ var _this5 = this;
3042
+ var _this$$props2 = this.$props,
3043
+ enterButton = _this$$props2.enterButton,
3044
+ innerClass = _this$$props2.innerClass;
3045
+ var renderEnterButton = this.$slots.renderEnterButton;
3046
+ if (enterButton) {
3047
+ var getEnterButtonMarkup = function getEnterButtonMarkup() {
3048
+ if (renderEnterButton) {
3049
+ return renderEnterButton(_this5.enterButtonOnClick);
3050
+ }
3051
+ return vue.createVNode(SendButton, {
3052
+ "primary": true,
3053
+ "type": "submit",
3054
+ "tabIndex": 0,
3055
+ "onClick": _this5.handleSendMessage,
3056
+ "onKeyPress": _this5.handleKeyPress,
3057
+ "class": "ask-btn " + helper.getClassName(innerClass, 'ai-enter-button'),
3058
+ "disabled": _this5.isLoadingState || !_this5.AISessionId
3059
+ }, {
3060
+ "default": function _default() {
3061
+ return [vue.createTextVNode("Send")];
3062
+ }
3063
+ });
3064
+ };
3065
+ return vue.createVNode("div", {
3066
+ "class": "ai-enter-button-wrapper"
3067
+ }, [getEnterButtonMarkup()]);
3068
+ }
3069
+ return null;
3070
+ },
3071
+ getComponent: function getComponent() {
3072
+ var data = {
3073
+ error: this.AIResponseError,
3074
+ loading: this.isAIResponseLoading,
3075
+ data: this.messages,
3076
+ rawData: this.rawData
3077
+ };
3078
+ return index.getComponent(data, this);
3079
+ },
3080
+ handleTextAreaHeightChange: function handleTextAreaHeightChange() {
3081
+ var _this$$refs, _this$$refs$_inputRef, _this$$refs2, _this$$refs2$_inputWr, _this$$refs3;
3082
+ var textArea = (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$_inputRef = _this$$refs[_inputRef]) == null ? void 0 : _this$$refs$_inputRef.$el;
3083
+ var inputWrapper = (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$_inputWr = _this$$refs2[_inputWrapperRef]) == null ? void 0 : _this$$refs2$_inputWr.$el;
3084
+ var errorContainer = (_this$$refs3 = this.$refs) == null ? void 0 : _this$$refs3[_errorContainerRef];
3085
+ if (textArea) {
3086
+ textArea.style.height = '42px';
3087
+ var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
3088
+ var maxHeight = lineHeight * 11; // max height for 10 lines
3089
+ var height = Math.min(textArea.scrollHeight, maxHeight);
3090
+ textArea.style.height = height + "px";
3091
+ textArea.style.overflowY = height === maxHeight ? 'auto' : 'hidden';
3092
+ // wrapper around input/ textarea
3093
+ inputWrapper.style.height = height + "px";
3094
+ // adjust error-container
3095
+
3096
+ if (errorContainer) {
3097
+ errorContainer.style.bottom = height + "px";
3098
+ }
3099
+ this.$forceUpdate();
3100
+ }
3101
+ }
3102
+ },
3103
+ beforeUnmount: function beforeUnmount() {
3104
+ if (this.$props.clearSessionOnDestroy) {
3105
+ // cleanup logic
3106
+ // final Object to store in local storage cache
3107
+ var finalCacheObj = helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {};
3108
+ // delete current component's cache
3109
+ delete finalCacheObj[this.$props.componentId];
3110
+ // update local cache
3111
+ helper.setObjectInLocalStorage(constants.AI_LOCAL_CACHE_KEY, finalCacheObj);
3112
+ }
3113
+ },
3114
+ render: function render() {
3115
+ var _slot3;
3116
+ var _this6 = this;
3117
+ var props = this.$props;
3118
+ if (!this.shouldShowComponent) {
3119
+ return null;
3120
+ }
3121
+ return vue.createVNode(Chatbox, {
3122
+ "style": props.style || {}
3123
+ }, {
3124
+ "default": function _default() {
3125
+ return [_this6.$props.title && vue.createVNode(Title.Title, {
3126
+ "class": helper.getClassName(_this6.$props.innerClass, 'title') || ''
3127
+ }, {
3128
+ "default": function _default() {
3129
+ return [_this6.$props.title];
3130
+ }
3131
+ }), vue.createVNode(ChatContainer, {
3132
+ "class": "--ai-chat-container",
3133
+ "theme": props.theme,
3134
+ "showInput": props.showInput
3135
+ }, {
3136
+ "default": function _default() {
3137
+ return [_this6.hasCustomRenderer && vue.createVNode(MessagesContainer, {
3138
+ "themePreset": _this6.themePreset,
3139
+ "theme": props.theme,
3140
+ "ref": _this6.$props.innerRef,
3141
+ "class": "--ai-message-container " + (helper.getClassName(props.innerClass, 'ai-message-container') || '')
3142
+ }, _isSlot$1(_slot3 = _this6.getComponent()) ? _slot3 : {
3143
+ "default": function _default() {
3144
+ return [_slot3];
3145
+ }
3146
+ }), !_this6.hasCustomRenderer && vue.createVNode(MessagesContainer, {
3147
+ "themePreset": _this6.themePreset,
3148
+ "theme": props.theme,
3149
+ "ref": _this6.$props.innerRef,
3150
+ "class": "--ai-message-container " + (helper.getClassName(props.innerClass, 'ai-message-container') || '')
3151
+ }, {
3152
+ "default": function _default() {
3153
+ return [_this6.messages.map(function (message, index) {
3154
+ return vue.createVNode(Message, {
3155
+ "key": index,
3156
+ "isSender": message.role === constants.AI_ROLES.USER,
3157
+ "innerHTML": md$1.render(message.content),
3158
+ "themePreset": _this6.themePreset,
3159
+ "theme": props.theme,
3160
+ "class": "--ai-answer-message " + (helper.getClassName(props.innerClass, 'ai-message') || '')
3161
+ }, null);
3162
+ }), _this6.isLoadingState && vue.createVNode(Message, {
3163
+ "themePreset": _this6.themePreset,
3164
+ "theme": props.theme,
3165
+ "isSender": false,
3166
+ "class": "--ai-answer-message " + (helper.getClassName(props.innerClass, 'ai-message') || null)
3167
+ }, {
3168
+ "default": function _default() {
3169
+ return [vue.createVNode(TypingIndicator, null, {
3170
+ "default": function _default() {
3171
+ return [vue.createVNode(TypingDot, {
3172
+ "themePreset": _this6.themePreset
3173
+ }, null), vue.createVNode(TypingDot, {
3174
+ "themePreset": _this6.themePreset
3175
+ }, null), vue.createVNode(TypingDot, {
3176
+ "themePreset": _this6.themePreset
3177
+ }, null)];
3178
+ }
3179
+ })];
3180
+ }
3181
+ })];
3182
+ }
3183
+ }), _this6.renderErrorComponent(), ' ', props.showFeedback && vue.createVNode("div", {
3184
+ "class": "--ai-answer-feedback-container " + (helper.getClassName(props.innerClass, 'ai-feedback') || '')
3185
+ }, [vue.createVNode(AIFeedback, {
3186
+ "hideUI": _this6.isLoadingState || !_this6.sessionId,
3187
+ "key": _this6.sessionId,
3188
+ "onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
3189
+ _this6.trackUsefullness(_this6.sessionId, {
3190
+ useful: useful,
3191
+ reason: reason
3192
+ });
3193
+ }
3194
+ }, null)]), props.showInput && vue.createVNode(MessageInputContainer, {
3195
+ "class": "--ai-input-container",
3196
+ "onSubmit": _this6.handleSendMessage
3197
+ }, {
3198
+ "default": function _default() {
3199
+ return [vue.createVNode(InputGroup, {
3200
+ "enableAI": true,
3201
+ "isOpen": false
3202
+ }, {
3203
+ "default": function _default() {
3204
+ return [vue.createVNode(DropDown.InputWrapper, {
3205
+ "ref": _inputWrapperRef
3206
+ }, {
3207
+ "default": function _default() {
3208
+ return [vue.createVNode(MessageInput, {
3209
+ "ref": _inputRef,
3210
+ "placeholder": props.placeholder,
3211
+ "enterButton": props.enterButton,
3212
+ "value": _this6.inputMessage,
3213
+ "onInput": _this6.handleMessageInputChange,
3214
+ "id": props.componentId + "-ai-input",
3215
+ "showIcon": props.showIcon,
3216
+ "iconPosition": props.iconPosition,
3217
+ "themePreset": _this6.themePreset,
3218
+ "disabled": _this6.isLoadingState || !_this6.AISessionId,
3219
+ "class": helper.getClassName(props.innerClass, 'ai-input') || null
3220
+ }, null), ' ', _this6.renderIcons()];
3221
+ }
3222
+ })];
3223
+ }
3224
+ }), _this6.renderEnterButtonElement()];
3225
+ }
3226
+ }), ' '];
3227
+ }
3228
+ })];
3229
+ }
3230
+ });
3231
+ }
3232
+ });
3233
+ AIAnswer.hasInternalComponent = function () {
3234
+ return true;
3235
+ };
3236
+ var mapStateToProps$1 = function mapStateToProps(state, props) {
3237
+ var dependencyComponent = Object.values(props.react)[0];
3238
+ if (Array.isArray(dependencyComponent)) {
3239
+ // eslint-disable-next-line prefer-destructuring
3240
+ dependencyComponent = dependencyComponent[0];
3241
+ }
3242
+ var showComponent = state.selectedValues[dependencyComponent] && state.selectedValues[dependencyComponent].value;
3243
+ return {
3244
+ showComponent: showComponent,
3245
+ AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response,
3246
+ isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
3247
+ AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
3248
+ rawData: state.rawData[props.componentId],
3249
+ themePreset: state.config.themePreset,
3250
+ isLoading: state.isLoading[props.componentId] || false,
3251
+ sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
3252
+ componentError: state.error[props.componentId]
3253
+ };
3254
+ };
3255
+ var mapDispatchToProps$1 = {
3256
+ getAIResponse: query.fetchAIResponse,
3257
+ trackUsefullness: analytics.recordAISessionUsefulness,
3258
+ createAISession: query.createAISession
3259
+ };
3260
+ var AIConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchToProps$1)(AIAnswer), {
3261
+ componentType: constants.componentTypes.AIAnswer,
3262
+ internalComponent: true
3263
+ }));
3264
+ AIConnected.name = AIAnswer.name;
3265
+ AIConnected.hasInternalComponent = AIAnswer.hasInternalComponent;
3266
+ AIConnected.install = function (Vue) {
3267
+ Vue.component(AIConnected.name, AIConnected);
3268
+ };
3269
+ // Add componentType for SSR
3270
+ AIConnected.componentType = constants.componentTypes.AIAnswer;
3271
+
3272
+ var _templateObject$9, _templateObject2$4;
3273
+ var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$9 || (_templateObject$9 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
3274
+ var HierarchicalMenuListItem = vueEmotion.styled('li')(_templateObject2$4 || (_templateObject2$4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
1872
3275
  return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
1873
3276
  });
1874
3277
 
@@ -2081,7 +3484,7 @@ var HierarchicalMenuListItemComponent = {
2081
3484
  }
2082
3485
  };
2083
3486
 
2084
- function _isSlot$1(s) {
3487
+ function _isSlot$2(s) {
2085
3488
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
2086
3489
  }
2087
3490
  var HierarchicalMenuComponent = {
@@ -2106,7 +3509,7 @@ var HierarchicalMenuComponent = {
2106
3509
  return vue.createVNode(HierarchicalMenuList, {
2107
3510
  "class": "" + (isExpanded ? '--open' : ''),
2108
3511
  "isSelected": isExpanded
2109
- }, _isSlot$1(_slot = listArray.map(function (listItem) {
3512
+ }, _isSlot$2(_slot = listArray.map(function (listItem) {
2110
3513
  return vue.createVNode(HierarchicalMenuListItemComponent, vue.mergeProps({
2111
3514
  "key": parentPath + "__" + JSON.stringify(listItem),
2112
3515
  "parentPath": parentPath,
@@ -2120,7 +3523,7 @@ var HierarchicalMenuComponent = {
2120
3523
  }
2121
3524
  };
2122
3525
 
2123
- function _isSlot$2(s) {
3526
+ function _isSlot$3(s) {
2124
3527
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
2125
3528
  }
2126
3529
  var updateQueryAction = reactivecore.Actions.updateQuery,
@@ -2570,7 +3973,7 @@ var TreeList = {
2570
3973
  "default": function _default() {
2571
3974
  return [props.title && vue.createVNode(Title.Title, {
2572
3975
  "class": helper.getClassName(innerClass, 'title') || null
2573
- }, _isSlot$2(title) ? title : {
3976
+ }, _isSlot$3(title) ? title : {
2574
3977
  "default": function _default() {
2575
3978
  return [title];
2576
3979
  }
@@ -2599,7 +4002,7 @@ var TreeList = {
2599
4002
  });
2600
4003
  }
2601
4004
  };
2602
- var mapStateToProps$1 = function mapStateToProps(state, props) {
4005
+ var mapStateToProps$2 = function mapStateToProps(state, props) {
2603
4006
  return {
2604
4007
  selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
2605
4008
  rawData: state.rawData[props.componentId] || {},
@@ -2617,7 +4020,7 @@ var mapDispatchtoProps = {
2617
4020
  TreeList.hasInternalComponent = function () {
2618
4021
  return true;
2619
4022
  };
2620
- var TreeListConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchtoProps)(TreeList), {
4023
+ var TreeListConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$2, mapDispatchtoProps)(TreeList), {
2621
4024
  componentType: constants.componentTypes.treeList,
2622
4025
  internalComponent: TreeList.hasInternalComponent()
2623
4026
  }));
@@ -2685,7 +4088,7 @@ RcConnected.install = function (Vue) {
2685
4088
  Vue.component(RcConnected.name, RcConnected);
2686
4089
  };
2687
4090
 
2688
- var components = [ReactiveList.default, ResultCard.default, ResultList.default, ReactiveBase.default, SBConnected, SingleList.default, MultiList.default, SingleRange.default, MultiRange.default, RangeSlider.default, DynamicRangeSlider.default, ReactiveComponent.default, RcConnected, SelectedFilters.default, ToggleButton.default, SingleDropdownList.default, MultiDropdownList.default, StateProvider.default, RangeInput.default, TreeListConnected];
4091
+ var components = [ReactiveList.default, ResultCard.default, ResultList.default, ReactiveBase.default, SBConnected, SingleList.default, MultiList.default, SingleRange.default, MultiRange.default, RangeSlider.default, DynamicRangeSlider.default, ReactiveComponent.default, RcConnected, SelectedFilters.default, ToggleButton.default, SingleDropdownList.default, MultiDropdownList.default, StateProvider.default, RangeInput.default, TreeListConnected, AIConnected];
2689
4092
  function install (Vue) {
2690
4093
  components.map(function (component) {
2691
4094
  Vue.use(component);
@@ -2693,6 +4096,7 @@ function install (Vue) {
2693
4096
  });
2694
4097
  }
2695
4098
 
4099
+ exports.AIAnswer = AIConnected;
2696
4100
  exports.ReactiveComponentPrivate = RcConnected;
2697
4101
  exports.SearchBox = SBConnected;
2698
4102
  exports.TreeList = TreeListConnected;