@appbaseio/reactivesearch-vue 2.0.0-alpha.4 → 3.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +9 -9
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js +21316 -29369
  3. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +5 -19
  5. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  6. package/dist/cjs/Button-ad042719.js +59 -0
  7. package/dist/cjs/Card-f5ab024a.js +27 -0
  8. package/dist/cjs/{ComponentWrapper-ad3dad02.js → ComponentWrapper-611cf7f9.js} +44 -58
  9. package/dist/cjs/Container-29f049b2.js +12 -0
  10. package/dist/cjs/DropDown-dc184468.js +700 -0
  11. package/dist/cjs/DynamicRangeSlider.js +106 -157
  12. package/dist/cjs/Flex-d5675ea6.js +48 -0
  13. package/dist/cjs/FormControlList-fadd792f.js +42 -0
  14. package/dist/cjs/Input-088dfcb4.js +74 -0
  15. package/dist/cjs/ListItem-d57d648d.js +42 -0
  16. package/dist/cjs/MultiDropdownList.js +124 -240
  17. package/dist/cjs/MultiList.js +124 -262
  18. package/dist/cjs/MultiRange.js +87 -133
  19. package/dist/cjs/{Pagination-71e85fa9.js → Pagination-b5ddc906.js} +70 -83
  20. package/dist/cjs/PreferencesConsumer-22d1b49f.js +73 -0
  21. package/dist/cjs/RangeInput.js +163 -171
  22. package/dist/cjs/RangeSlider.js +81 -109
  23. package/dist/cjs/ReactiveBase.js +139 -156
  24. package/dist/cjs/ReactiveComponent-a6108189.js +2184 -0
  25. package/dist/cjs/ReactiveComponent.js +46 -340
  26. package/dist/cjs/ReactiveGoogleMap.js +451 -660
  27. package/dist/cjs/ReactiveList.js +180 -305
  28. package/dist/cjs/ResultCard.js +36 -36
  29. package/dist/cjs/ResultList.js +48 -56
  30. package/dist/cjs/SelectedFilters.js +62 -69
  31. package/dist/cjs/SingleDropdownList.js +117 -177
  32. package/dist/cjs/SingleList.js +122 -206
  33. package/dist/cjs/SingleRange.js +78 -105
  34. package/dist/cjs/StateProvider.js +35 -38
  35. package/dist/cjs/Title-8802a218.js +12 -0
  36. package/dist/cjs/ToggleButton.js +72 -119
  37. package/dist/cjs/{_rollupPluginBabelHelpers-c705cbe6.js → _rollupPluginBabelHelpers-f8b843f8.js} +0 -15
  38. package/dist/cjs/{index-6a167fe0.js → index-d8d8f291.js} +38 -108
  39. package/dist/cjs/index.js +44 -41
  40. package/dist/cjs/initReactivesearch.js +63 -150
  41. package/dist/cjs/install.js +47 -43
  42. package/dist/cjs/ssr-6c8a72e1.js +66 -0
  43. package/dist/cjs/{utils-d6a52588.js → utils-83fd01e9.js} +7 -16
  44. package/dist/cjs/version.js +1 -1
  45. package/dist/cjs/{vueTypes-727b7c63.js → vueTypes-1bf00978.js} +8 -19
  46. package/dist/es/Button-474510e3.js +53 -0
  47. package/dist/es/{Card-450683f1.js → Card-38cbe652.js} +3 -3
  48. package/dist/es/{ComponentWrapper-424e86fd.js → ComponentWrapper-3dfe6931.js} +44 -58
  49. package/dist/es/{Container-ba826e96.js → Container-d00219f7.js} +2 -2
  50. package/dist/es/DropDown-029ffd42.js +690 -0
  51. package/dist/es/DynamicRangeSlider.js +106 -157
  52. package/dist/es/Flex-a08e22d7.js +46 -0
  53. package/dist/es/FormControlList-fe6eaee4.js +38 -0
  54. package/dist/es/Input-ad474a55.js +69 -0
  55. package/dist/es/{ListItem-cad14c5e.js → ListItem-16756c02.js} +7 -8
  56. package/dist/es/MultiDropdownList.js +124 -240
  57. package/dist/es/MultiList.js +124 -262
  58. package/dist/es/MultiRange.js +87 -133
  59. package/dist/es/{Pagination-784bf143.js → Pagination-72bd1d9e.js} +70 -83
  60. package/dist/es/PreferencesConsumer-24e88f3b.js +71 -0
  61. package/dist/es/RangeInput.js +163 -170
  62. package/dist/es/RangeSlider.js +81 -109
  63. package/dist/es/ReactiveBase.js +138 -154
  64. package/dist/es/ReactiveComponent-0a97eb1e.js +2178 -0
  65. package/dist/es/ReactiveComponent.js +42 -337
  66. package/dist/es/ReactiveGoogleMap.js +446 -654
  67. package/dist/es/ReactiveList.js +178 -302
  68. package/dist/es/ResultCard.js +36 -36
  69. package/dist/es/ResultList.js +48 -56
  70. package/dist/es/SelectedFilters.js +62 -69
  71. package/dist/es/SingleDropdownList.js +117 -177
  72. package/dist/es/SingleList.js +122 -206
  73. package/dist/es/SingleRange.js +78 -105
  74. package/dist/es/StateProvider.js +36 -39
  75. package/dist/es/{Title-3342664a.js → Title-863dfa42.js} +2 -2
  76. package/dist/es/ToggleButton.js +72 -119
  77. package/dist/es/{_rollupPluginBabelHelpers-76660dab.js → _rollupPluginBabelHelpers-ded08042.js} +0 -15
  78. package/dist/es/{index-7788a843.js → index-4520a598.js} +39 -107
  79. package/dist/es/index.js +30 -32
  80. package/dist/es/initReactivesearch.js +63 -150
  81. package/dist/es/install.js +49 -41
  82. package/dist/es/{ssr-b2c0b401.js → ssr-584c278d.js} +37 -8
  83. package/dist/es/{utils-9e68acee.js → utils-9e5a16a1.js} +7 -16
  84. package/dist/es/version.js +1 -1
  85. package/dist/es/{vueTypes-b8146772.js → vueTypes-f1923c72.js} +8 -19
  86. package/package.json +10 -9
  87. package/dist/cjs/Button-446f819e.js +0 -68
  88. package/dist/cjs/CancelSvg-9f258f4f.js +0 -449
  89. package/dist/cjs/Card-642547a8.js +0 -30
  90. package/dist/cjs/Container-daf30918.js +0 -15
  91. package/dist/cjs/DataSearch-aa04dc6e.js +0 -2352
  92. package/dist/cjs/DataSearch.js +0 -30
  93. package/dist/cjs/DropDown-c479bbb0.js +0 -328
  94. package/dist/cjs/Flex-aa517a13.js +0 -52
  95. package/dist/cjs/FormControlList-c195a592.js +0 -47
  96. package/dist/cjs/Input-e6603a7e.js +0 -79
  97. package/dist/cjs/ListItem-8c9e0d68.js +0 -46
  98. package/dist/cjs/Title-1de7d0f4.js +0 -15
  99. package/dist/cjs/install-b97dbac4.js +0 -1409
  100. package/dist/cjs/ssr-3027b848.js +0 -39
  101. package/dist/es/Button-d8bc15ea.js +0 -59
  102. package/dist/es/CancelSvg-4cfae5fd.js +0 -440
  103. package/dist/es/DataSearch-b86a6675.js +0 -2337
  104. package/dist/es/DataSearch.js +0 -22
  105. package/dist/es/DropDown-05a644a5.js +0 -322
  106. package/dist/es/Flex-1f0795c3.js +0 -47
  107. package/dist/es/FormControlList-c22d64f6.js +0 -40
  108. package/dist/es/Input-7a2a9fac.js +0 -71
  109. package/dist/es/install-ac8a1edb.js +0 -1402
@@ -0,0 +1,2184 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var configureStore = require('@appbaseio/reactivecore');
6
+ var configureStore__default = _interopDefault(configureStore);
7
+ var constants = require('@appbaseio/reactivecore/lib/utils/constants');
8
+ var _transformOn = _interopDefault(require('@vue/babel-helper-vue-transform-on'));
9
+ var _rollupPluginBabelHelpers = require('./_rollupPluginBabelHelpers-f8b843f8.js');
10
+ var vue = require('vue');
11
+ var VueTypes = _interopDefault(require('vue-types'));
12
+ var helper = require('@appbaseio/reactivecore/lib/utils/helper');
13
+ var vueEmotion = require('@appbaseio/vue-emotion');
14
+ var emotion = require('emotion');
15
+ var Button = require('./Button-ad042719.js');
16
+ var vueTypes = require('./vueTypes-1bf00978.js');
17
+ var ReactiveList = require('./ReactiveList.js');
18
+ var index = require('./index-d8d8f291.js');
19
+ var ComponentWrapper = require('./ComponentWrapper-611cf7f9.js');
20
+ var PreferencesConsumer = require('./PreferencesConsumer-22d1b49f.js');
21
+ var Title = require('./Title-8802a218.js');
22
+ var Flex = require('./Flex-d5675ea6.js');
23
+ var hotkeys = _interopDefault(require('hotkeys-js'));
24
+ var DropDown = require('./DropDown-dc184468.js');
25
+ var Input = require('./Input-088dfcb4.js');
26
+ var Container = require('./Container-29f049b2.js');
27
+ var Highlight = _interopDefault(require('vue-highlight-words'));
28
+ var SingleList = require('./SingleList.js');
29
+ var MultiList = require('./MultiList.js');
30
+ var SingleDropdownList = require('./SingleDropdownList.js');
31
+ var MultiDropdownList = require('./MultiDropdownList.js');
32
+ var ToggleButton = require('./ToggleButton.js');
33
+ var DynamicRangeSlider = require('./DynamicRangeSlider.js');
34
+ var SingleRange = require('./SingleRange.js');
35
+ var MultiRange = require('./MultiRange.js');
36
+ var RangeSlider = require('./RangeSlider.js');
37
+ var RangeInput = require('./RangeInput.js');
38
+
39
+ var _templateObject;
40
+ var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
41
+ InputGroup.defaultProps = {
42
+ className: 'input-group'
43
+ };
44
+
45
+ var _templateObject$1;
46
+ var InputAddon = vueEmotion.styled('span')(_templateObject$1 || (_templateObject$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #fafafa;\n border: 1px solid #ccc;\n border-radius: 2px;\n color: rgba(0, 0, 0, 0.85);\n font-size: 14px;\n font-weight: 400;\n padding: 0 11px;\n position: relative;\n transition: all 0.3s;\n box-sizing: border-box;\n overflow: hidden;\n\n &:first-of-type {\n border-right: none;\n }\n &:last-of-type {\n border-left: none;\n }\n"])));
47
+ InputAddon.defaultProps = {
48
+ className: 'input-addon'
49
+ };
50
+
51
+ var getClassName = configureStore.helper.getClassName;
52
+ var SuggestionWrapper = {
53
+ name: 'SuggestionWrapper',
54
+ props: {
55
+ innerClassName: vueTypes.types.string,
56
+ themePreset: vueTypes.types.themePreset,
57
+ innerClass: vueTypes.types.style
58
+ },
59
+ render: function render() {
60
+ var _this$$props = this.$props,
61
+ themePreset = _this$$props.themePreset,
62
+ innerClass = _this$$props.innerClass,
63
+ innerClassName = _this$$props.innerClassName;
64
+ return vue.createVNode("div", {
65
+ "class": Input.noSuggestions(themePreset) + " " + getClassName(innerClass, innerClassName || '')
66
+ }, [vue.createVNode("li", null, [this.$slots["default"]()])]);
67
+ }
68
+ };
69
+
70
+ var _templateObject$2;
71
+ var highlightStyle = {
72
+ fontWeight: 600,
73
+ padding: 0,
74
+ backgroundColor: 'transparent',
75
+ color: 'inherit'
76
+ };
77
+ var PredictiveSuggestion = vueEmotion.styled('span')(_templateObject$2 || (_templateObject$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t.highlight {\n\t\tbackground: transparent;\n\t\tcolor: inherit;\n\t\tfont-weight: 600;\n\t\tpadding: 0;\n\t}\n"])));
78
+ var SuggestionItem = {
79
+ name: 'SuggestionItem',
80
+ props: {
81
+ currentValue: vueTypes.types.string,
82
+ suggestion: vueTypes.types.any
83
+ },
84
+ render: function render() {
85
+ var _this = this;
86
+ var _this$suggestion = this.suggestion,
87
+ label = _this$suggestion.label,
88
+ value = _this$suggestion.value,
89
+ title = _this$suggestion.title,
90
+ description = _this$suggestion.description,
91
+ image = _this$suggestion.image,
92
+ isPredictiveSuggestion = _this$suggestion.isPredictiveSuggestion,
93
+ _suggestion_type = _this$suggestion._suggestion_type,
94
+ _category = _this$suggestion._category;
95
+ if (label) {
96
+ // label has highest precedence
97
+ return typeof label === 'string' ? vue.createVNode("div", {
98
+ "class": "trim"
99
+ }, [(_category ? false : isPredictiveSuggestion
100
+ // eslint-disable-next-line
101
+ || !!_suggestion_type) ? vue.createVNode(PredictiveSuggestion, {
102
+ "innerHTML": label
103
+ }, null) : vue.createVNode(Highlight, {
104
+ "searchWords": _category ? [_category] : this.currentValue.split(' '),
105
+ "textToHighlight": label,
106
+ "autoEscape": true,
107
+ "highlightStyle": highlightStyle
108
+ }, null)]) : label;
109
+ }
110
+ if (title || image || description) {
111
+ return vue.createVNode(Flex.Flex, {
112
+ "alignItems": "center",
113
+ "css": {
114
+ width: '100%'
115
+ }
116
+ }, {
117
+ "default": function _default() {
118
+ return [image && vue.createVNode("div", {
119
+ "css": {
120
+ margin: 'auto',
121
+ marginRight: 10
122
+ }
123
+ }, [vue.createVNode("img", {
124
+ "src": image,
125
+ "alt": " ",
126
+ "height": "50px",
127
+ "width": "50px",
128
+ "css": {
129
+ objectFit: 'contain'
130
+ }
131
+ }, null)]), vue.createVNode(Flex.Flex, {
132
+ "direction": "column",
133
+ "css": {
134
+ width: image ? 'calc(100% - 60px)' : '100%'
135
+ }
136
+ }, {
137
+ "default": function _default() {
138
+ return [title && vue.createVNode("div", {
139
+ "class": "trim"
140
+ }, [vue.createVNode(Highlight, {
141
+ "searchWords": _this.currentValue.split(' '),
142
+ "textToHighlight": title,
143
+ "highlightStyle": highlightStyle,
144
+ "class": emotion.css({
145
+ fontSize: '1rem'
146
+ })
147
+ }, null)]), description && vue.createVNode("div", {
148
+ "class": emotion.cx('trim', emotion.css({
149
+ marginTop: 3
150
+ }))
151
+ }, [vue.createVNode(Highlight, {
152
+ "searchWords": _this.currentValue.split(' '),
153
+ "textToHighlight": description,
154
+ "highlightStyle": highlightStyle
155
+ }, null)])];
156
+ }
157
+ })];
158
+ }
159
+ });
160
+ }
161
+ return value;
162
+ }
163
+ };
164
+
165
+ var SearchSvg = {
166
+ name: 'SearchSvg',
167
+ props: ['styles'],
168
+ render: function render() {
169
+ return vue.createVNode("svg", {
170
+ "alt": "Search",
171
+ "class": "search-icon",
172
+ "height": "12",
173
+ "xmlns": "http://www.w3.org/2000/svg",
174
+ "viewBox": "0 0 15 15",
175
+ "style": _rollupPluginBabelHelpers._extends({
176
+ transform: 'scale(1.35)',
177
+ position: 'relative'
178
+ }, this.$props.styles ? this.$props.styles : {})
179
+ }, [vue.createVNode("title", null, [vue.createTextVNode("Search")]), vue.createVNode("path", {
180
+ "d": 'M6.02945,10.20327a4.17382,4.17382,0,1,1,4.17382-4.17382A4.15609,4.15609,0,0,1,6.02945,10.20327Zm9.69195,4.2199L10.8989,9.59979A5.88021,5.88021,0,0,0,12.058,6.02856,6.00467,6.00467,0,1,0,9.59979,10.8989l4.82338,4.82338a.89729.89729,0,0,0,1.29912,0,.89749.89749,0,0,0-.00087-1.29909Z'
181
+ }, null)]);
182
+ }
183
+ };
184
+
185
+ var _templateObject$3;
186
+
187
+ // eslint-disable-next-line
188
+ 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"])));
189
+ var MicSvg = {
190
+ name: 'MicSvg',
191
+ props: ['className'],
192
+ render: function render() {
193
+ return vue.createVNode("svg", {
194
+ "viewBox": "0 0 480 480",
195
+ "xmlns": "http://www.w3.org/2000/svg",
196
+ "id": "el_xS0FRzQjJ",
197
+ "width": 28,
198
+ "height": 28,
199
+ "className": this.$props.className,
200
+ "style": {
201
+ transform: 'scale(1.5)'
202
+ }
203
+ }, [vue.createVNode("g", {
204
+ "id": "el_TvxDfTAtKp",
205
+ "fillRule": "evenodd"
206
+ }, [vue.createVNode("g", {
207
+ "id": "el_D93PK3GbmJ",
208
+ "fillRule": "nonzero",
209
+ "style": {
210
+ fill: '#595959'
211
+ }
212
+ }, [vue.createVNode("path", {
213
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
214
+ "id": "el_uly3EwA2O3"
215
+ }, null), vue.createVNode("path", {
216
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,-2.84217094e-14 76.9864699,-2.84217094e-14 C55.8825877,-2.84217094e-14 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
217
+ "id": "el_tnDbR4ytu4"
218
+ }, null)])])]);
219
+ }
220
+ };
221
+
222
+ var _templateObject$4;
223
+
224
+ // eslint-disable-next-line
225
+ 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"])));
226
+ var MuteSvg = {
227
+ name: 'MuteSvg',
228
+ props: ['className'],
229
+ render: function render() {
230
+ return vue.createVNode("svg", {
231
+ "style": {
232
+ transform: 'scale(1.5)'
233
+ },
234
+ "viewBox": "0 0 480 480",
235
+ "xmlns": "http://www.w3.org/2000/svg",
236
+ "id": "el_D1rEpH2zj",
237
+ "width": 28,
238
+ "height": 28,
239
+ "className": this.$props.className
240
+ }, [vue.createVNode("g", {
241
+ "id": "el_X81iT9kZYo",
242
+ "fillRule": "evenodd"
243
+ }, [vue.createVNode("g", {
244
+ "id": "el_gMpyalCphp"
245
+ }, [vue.createVNode("path", {
246
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
247
+ "id": "el_c7H-3u-D4l",
248
+ "fillRule": "nonzero",
249
+ "style": {
250
+ fill: '#595959'
251
+ }
252
+ }, null), vue.createVNode("path", {
253
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,-2.84217094e-14 76.9864699,-2.84217094e-14 C55.8825877,-2.84217094e-14 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
254
+ "id": "el_qhFcdAAFwo",
255
+ "fillRule": "nonzero",
256
+ "style": {
257
+ fill: '#595959'
258
+ }
259
+ }, null), vue.createVNode("path", {
260
+ "d": "M11.5,206.5 L142.5,12.5",
261
+ "id": "el_M8X8g37WOI",
262
+ "strokeLinecap": "round",
263
+ "strokeLinejoin": "round"
264
+ }, null)])])]);
265
+ }
266
+ };
267
+
268
+ var _templateObject$5;
269
+
270
+ // eslint-disable-next-line
271
+ 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"])));
272
+ var ListenSvg = {
273
+ name: 'ListenSvg',
274
+ props: ['className'],
275
+ render: function render() {
276
+ return vue.createVNode("svg", {
277
+ "viewBox": "0 0 480 480",
278
+ "xmlns": "http://www.w3.org/2000/svg",
279
+ "xmlnsXlink": "http://www.w3.org/1999/xlink",
280
+ "id": "el_hiibMG0x-",
281
+ "width": 28,
282
+ "height": 29,
283
+ "className": this.$props.className,
284
+ "style": {
285
+ transform: 'scale(1.5)'
286
+ }
287
+ }, [vue.createVNode("defs", null, [vue.createVNode("path", {
288
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
289
+ "id": "path-1"
290
+ }, null), vue.createVNode("path", {
291
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
292
+ "id": "path-3"
293
+ }, null), vue.createVNode("path", {
294
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
295
+ "id": "path-5"
296
+ }, null), vue.createVNode("path", {
297
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
298
+ "id": "path-7"
299
+ }, null), vue.createVNode("path", {
300
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
301
+ "id": "path-9"
302
+ }, null), vue.createVNode("path", {
303
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
304
+ "id": "path-11"
305
+ }, null), vue.createVNode("path", {
306
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
307
+ "id": "path-13"
308
+ }, null), vue.createVNode("path", {
309
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
310
+ "id": "path-15"
311
+ }, null)]), vue.createVNode("g", {
312
+ "id": "el_QJeJ_2CDw5",
313
+ "fillRule": "evenodd"
314
+ }, [vue.createVNode("g", {
315
+ "id": "el_UYYCfubTRf"
316
+ }, [vue.createVNode("path", {
317
+ "d": "M142.731204,111 C137.280427,111 132.719573,114.852 131.82965,120.095 C127.268796,145.24 104.464526,164.5 76.9881611,164.5 C49.5117965,164.5 26.7075263,145.24 22.1466723,120.095 C21.2567496,114.852 16.6958955,111 11.2451187,111 C4.45945784,111 -0.880078594,116.778 0.121084488,123.198 C5.57186127,155.298 32.2695435,180.443 65.8641269,185.044 L65.8641269,207.3 C65.8641269,213.185 70.8699423,218 76.9881611,218 C83.10638,218 88.1121954,213.185 88.1121954,207.3 L88.1121954,185.044 C121.706779,180.443 148.404461,155.298 153.855238,123.198 C154.967641,116.778 149.516864,111 142.731204,111 Z",
318
+ "id": "el_uzZNtK32Zi",
319
+ "fillRule": "nonzero",
320
+ "style": {
321
+ fill: '#0B6AFF'
322
+ }
323
+ }, null), vue.createVNode("path", {
324
+ "d": "M76.9864699,147.789474 C98.090352,147.789474 115.126016,131.286316 115.126016,110.842105 L115.126016,36.9473684 C115.126016,16.5031579 98.090352,0 76.9864699,0 C55.8825877,0 38.8469239,16.5031579 38.8469239,36.9473684 L38.8469239,110.842105 C38.8469239,131.286316 55.8825877,147.789474 76.9864699,147.789474 Z",
325
+ "id": "el_EYKQ2N9Kgy",
326
+ "fillRule": "nonzero"
327
+ }, null), vue.createVNode("g", {
328
+ "id": "el_6SDP2LAgKC"
329
+ }, [vue.createVNode("mask", {
330
+ "id": "mask-2",
331
+ "fill": "#fff"
332
+ }, [vue.createVNode("use", {
333
+ "xlink:href": "#path-1"
334
+ }, null)]), vue.createVNode("path", {
335
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
336
+ "id": "el_-Vm65Ltfy7",
337
+ "fillRule": "nonzero",
338
+ "mask": "url(#mask-2)"
339
+ }, null), vue.createVNode("rect", {
340
+ "id": "el_q04iZcSim4",
341
+ "mask": "url(#mask-2)",
342
+ "x": "0.279",
343
+ "width": "77",
344
+ "height": "130"
345
+ }, null)]), vue.createVNode("g", {
346
+ "id": "el_6WKby7wXqV"
347
+ }, [vue.createVNode("mask", {
348
+ "id": "mask-4",
349
+ "fill": "#fff"
350
+ }, [vue.createVNode("use", {
351
+ "xlink:href": "#path-3"
352
+ }, null)]), vue.createVNode("path", {
353
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
354
+ "id": "el_9bggsfQOtU",
355
+ "fillRule": "nonzero",
356
+ "mask": "url(#mask-4)"
357
+ }, null), vue.createVNode("rect", {
358
+ "id": "el_NKxqi9eIym",
359
+ "mask": "url(#mask-4)",
360
+ "x": "0.279",
361
+ "width": "77",
362
+ "height": "115"
363
+ }, null)]), vue.createVNode("g", {
364
+ "id": "el_Wi-my975tM"
365
+ }, [vue.createVNode("mask", {
366
+ "id": "mask-6",
367
+ "fill": "#fff"
368
+ }, [vue.createVNode("use", {
369
+ "xlink:href": "#path-5"
370
+ }, null)]), vue.createVNode("path", {
371
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
372
+ "id": "el_zclQ34fvf7",
373
+ "fillRule": "nonzero",
374
+ "mask": "url(#mask-6)"
375
+ }, null), vue.createVNode("rect", {
376
+ "id": "el_1OsvRT8HkeZ",
377
+ "mask": "url(#mask-6)",
378
+ "x": "0.279",
379
+ "width": "77",
380
+ "height": "100"
381
+ }, null)]), vue.createVNode("g", {
382
+ "id": "el_DkfFFTaFxy8"
383
+ }, [vue.createVNode("mask", {
384
+ "id": "mask-8",
385
+ "fill": "#fff"
386
+ }, [vue.createVNode("use", {
387
+ "xlink:href": "#path-7"
388
+ }, null)]), vue.createVNode("path", {
389
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
390
+ "id": "el_aa9sjx4H0vA",
391
+ "fillRule": "nonzero",
392
+ "mask": "url(#mask-8)"
393
+ }, null), vue.createVNode("rect", {
394
+ "id": "el_tea114vWg0J",
395
+ "mask": "url(#mask-8)",
396
+ "x": "0.279",
397
+ "width": "77",
398
+ "height": "85"
399
+ }, null)]), vue.createVNode("g", {
400
+ "id": "el_34IgwiMB5rf"
401
+ }, [vue.createVNode("mask", {
402
+ "id": "mask-10",
403
+ "fill": "#fff"
404
+ }, [vue.createVNode("use", {
405
+ "xlink:href": "#path-9"
406
+ }, null)]), vue.createVNode("path", {
407
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
408
+ "id": "el_z5u6RAFhx7d",
409
+ "fillRule": "nonzero",
410
+ "mask": "url(#mask-10)"
411
+ }, null), vue.createVNode("rect", {
412
+ "id": "el_7nfuWmA5Uhy",
413
+ "mask": "url(#mask-10)",
414
+ "x": "0.279",
415
+ "width": "77",
416
+ "height": "70"
417
+ }, null)]), vue.createVNode("g", {
418
+ "id": "el_DeebuCsPTGA"
419
+ }, [vue.createVNode("mask", {
420
+ "id": "mask-12",
421
+ "fill": "#fff"
422
+ }, [vue.createVNode("use", {
423
+ "xlink:href": "#path-11"
424
+ }, null)]), vue.createVNode("path", {
425
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
426
+ "id": "el__ZcqlS20zcw",
427
+ "fillRule": "nonzero",
428
+ "mask": "url(#mask-12)"
429
+ }, null), vue.createVNode("rect", {
430
+ "id": "el_8DnEQnD7VWV",
431
+ "mask": "url(#mask-12)",
432
+ "x": "0.279",
433
+ "width": "77",
434
+ "height": "55"
435
+ }, null)]), vue.createVNode("g", {
436
+ "id": "el_ZOjjrPTvyrv"
437
+ }, [vue.createVNode("mask", {
438
+ "id": "mask-14",
439
+ "fill": "#fff"
440
+ }, [vue.createVNode("use", {
441
+ "xlink:href": "#path-13"
442
+ }, null)]), vue.createVNode("path", {
443
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
444
+ "id": "el_FYYKCI_u24e",
445
+ "fillRule": "nonzero",
446
+ "mask": "url(#mask-14)"
447
+ }, null), vue.createVNode("rect", {
448
+ "id": "el_XZty4MnTp5Y",
449
+ "mask": "url(#mask-14)",
450
+ "x": "0.279",
451
+ "width": "77",
452
+ "height": "40"
453
+ }, null)]), vue.createVNode("g", {
454
+ "id": "el_2FATegVmf0K"
455
+ }, [vue.createVNode("mask", {
456
+ "id": "mask-16",
457
+ "fill": "#fff"
458
+ }, [vue.createVNode("use", {
459
+ "xlink:href": "#path-15"
460
+ }, null)]), vue.createVNode("path", {
461
+ "d": "M38.779092,147.789474 C60.0824253,147.789474 77.279092,131.286316 77.279092,110.842105 L77.279092,36.9473684 C77.279092,16.5031579 60.0824253,0 38.779092,0 C17.4757586,0 0.279091964,16.5031579 0.279091964,36.9473684 L0.279091964,110.842105 C0.279091964,131.286316 17.4757586,147.789474 38.779092,147.789474 Z",
462
+ "id": "el_RMT1KUfbdF8",
463
+ "fillRule": "nonzero",
464
+ "mask": "url(#mask-16)"
465
+ }, null), vue.createVNode("rect", {
466
+ "id": "el_RgLcovvFiO1",
467
+ "mask": "url(#mask-16)",
468
+ "x": "0.279",
469
+ "width": "77",
470
+ "height": "25"
471
+ }, null)])])])]);
472
+ }
473
+ };
474
+
475
+ var STATUS = {
476
+ inactive: 'INACTIVE',
477
+ stopped: 'STOPPED',
478
+ active: 'ACTIVE',
479
+ denied: 'DENIED'
480
+ };
481
+ var Mic = {
482
+ name: 'Mic',
483
+ props: {
484
+ children: vueTypes.types.title,
485
+ lang: VueTypes.string.def('en-US'),
486
+ iconPosition: VueTypes.string.def('left'),
487
+ handleResult: vueTypes.types.func,
488
+ onNoMatch: vueTypes.types.func,
489
+ onError: vueTypes.types.func,
490
+ getInstance: vueTypes.types.func,
491
+ render: vueTypes.types.func,
492
+ className: vueTypes.types.string,
493
+ applyClearStyle: VueTypes.bool,
494
+ showIcon: VueTypes.bool
495
+ },
496
+ methods: {
497
+ getComponent: function getComponent() {
498
+ var status = this.$data.status;
499
+ var data = {
500
+ handleClick: this.handleClick,
501
+ status: status
502
+ };
503
+ return index.getComponent(data, this);
504
+ },
505
+ stopMic: function stopMic() {
506
+ if (this.instance) {
507
+ this.status = STATUS.inactive;
508
+ this.instance.stop();
509
+ this.instance = null;
510
+ }
511
+ },
512
+ handleClick: function handleClick() {
513
+ var _this = this;
514
+ this.results = [];
515
+ if (window && window.SpeechRecognition) {
516
+ var status = this.$data.status;
517
+ if (status === STATUS.active) {
518
+ this.status = STATUS.inactive;
519
+ }
520
+ var _this$$props = this.$props,
521
+ handleResult = _this$$props.handleResult,
522
+ onNoMatch = _this$$props.onNoMatch,
523
+ onError = _this$$props.onError,
524
+ lang = _this$$props.lang,
525
+ getInstance = _this$$props.getInstance;
526
+ var _window = window,
527
+ SpeechRecognition = _window.SpeechRecognition;
528
+ if (this.instance && this.status !== STATUS.denied) {
529
+ this.status = STATUS.inactive;
530
+ this.instance.stop();
531
+ this.instance = null;
532
+ return;
533
+ }
534
+ this.instance = new SpeechRecognition();
535
+ this.instance.continuous = true;
536
+ this.instance.interimResults = true;
537
+ this.instance.lang = lang;
538
+ if (getInstance) {
539
+ getInstance(this.instance);
540
+ }
541
+ this.instance.start();
542
+ this.instance.onstart = function () {
543
+ _this.status = STATUS.active;
544
+ };
545
+ this.instance.onresult = function (_ref) {
546
+ var results = _ref.results,
547
+ timeStamp = _ref.timeStamp;
548
+ _this.stopMic();
549
+ if (handleResult) {
550
+ handleResult({
551
+ results: results,
552
+ timeStamp: timeStamp
553
+ });
554
+ }
555
+ _this.results.push({
556
+ results: results,
557
+ timeStamp: timeStamp
558
+ });
559
+ };
560
+ this.instance.onnomatch = function (e) {
561
+ return onNoMatch ? onNoMatch(e) : console.warn(e);
562
+ };
563
+ this.instance.onerror = function (e) {
564
+ if (e.error === 'no-speech' || e.error === 'audio-capture') {
565
+ _this.status = STATUS.inactive;
566
+ } else if (e.error === 'not-allowed') {
567
+ _this.status = STATUS.denied;
568
+ }
569
+ console.error(e);
570
+ if (onError) {
571
+ onError(e);
572
+ }
573
+ };
574
+
575
+ /* Below Two methods run when Continuous is False */
576
+ this.instance.onspeechend = function () {
577
+ _this.status = STATUS.inactive;
578
+ };
579
+ this.instance.onaudioend = function () {
580
+ _this.status = STATUS.inactive;
581
+ };
582
+ }
583
+ }
584
+ },
585
+ computed: {
586
+ hasCustomRenderer: function hasCustomRenderer() {
587
+ return index.hasCustomRenderer(this);
588
+ },
589
+ Icon: function Icon() {
590
+ var status = this.$data.status;
591
+ var className = this.$props.className;
592
+ switch (status) {
593
+ case STATUS.active:
594
+ return vue.createVNode(ListenSvg, {
595
+ "className": className,
596
+ "nativeOnClick": this.handleClick
597
+ }, null);
598
+ case STATUS.stopped:
599
+ case STATUS.denied:
600
+ return vue.createVNode(MuteSvg, {
601
+ "className": className,
602
+ "nativeOnClick": this.handleClick
603
+ }, null);
604
+ default:
605
+ return vue.createVNode(MicSvg, {
606
+ "className": className,
607
+ "nativeOnClick": this.handleClick
608
+ }, null);
609
+ }
610
+ }
611
+ },
612
+ data: function data() {
613
+ return {
614
+ status: STATUS.inactive
615
+ };
616
+ },
617
+ created: function created() {
618
+ this.results = [];
619
+ if (typeof window !== 'undefined') {
620
+ window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition || null;
621
+ if (!window.SpeechRecognition) {
622
+ console.error('SpeechRecognition is not supported in this browser. Please check the browser compatibility at https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#Browser_compatibility.');
623
+ }
624
+ }
625
+ },
626
+ render: function render() {
627
+ var _this2 = this;
628
+ if (this.hasCustomRenderer) {
629
+ return this.getComponent();
630
+ }
631
+ return vue.createVNode(DropDown.IconWrapper, null, {
632
+ "default": function _default() {
633
+ return [_this2.Icon];
634
+ }
635
+ });
636
+ }
637
+ };
638
+
639
+ var CustomSvg = {
640
+ name: 'CustomSvg',
641
+ props: {
642
+ className: String,
643
+ icon: Function,
644
+ type: String
645
+ },
646
+ data: function data() {
647
+ return {
648
+ customIcon: this.$props.icon && typeof this.$props.icon === 'function' ? this.$props.icon() : null
649
+ };
650
+ },
651
+ render: function render() {
652
+ if (this.customIcon) {
653
+ return vue.createVNode("div", {
654
+ "class": this.$props.className
655
+ }, [this.customIcon]);
656
+ }
657
+ if (this.$props.type === 'recent-search-icon') {
658
+ return vue.createVNode("svg", {
659
+ "xmlns": "http://www.w3.org/2000/svg",
660
+ "alt": "Recent Search",
661
+ "height": "20",
662
+ "width": "20",
663
+ "viewBox": "0 0 24 24",
664
+ "style": {
665
+ fill: '#707070'
666
+ },
667
+ "class": this.$props.className
668
+ }, [vue.createVNode("path", {
669
+ "d": "M0 0h24v24H0z",
670
+ "fill": "none"
671
+ }, null), vue.createVNode("path", {
672
+ "d": "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
673
+ }, null)]);
674
+ }
675
+ if (this.$props.type === 'promoted-search-icon') {
676
+ return vue.createVNode("svg", {
677
+ "xmlns": "http://www.w3.org/2000/svg",
678
+ "width": "20",
679
+ "alt": "promoted search",
680
+ "height": "20",
681
+ "viewBox": "0 0 24 24",
682
+ "class": this.$props.className,
683
+ "style": {
684
+ fill: '#707070'
685
+ }
686
+ }, [vue.createVNode("path", {
687
+ "d": "M12 .587l3.668 7.568 8.332 1.151-6.064 5.828 1.48 8.279-7.416-3.967-7.417 3.967 1.481-8.279-6.064-5.828 8.332-1.151z"
688
+ }, null)]);
689
+ }
690
+ if (this.$props.type === 'popular-search-icon') {
691
+ return vue.createVNode("svg", {
692
+ "xmlns": "http://www.w3.org/2000/svg",
693
+ "alt": "Popular Search",
694
+ "height": "20",
695
+ "width": "20",
696
+ "viewBox": "0 0 24 24",
697
+ "style": {
698
+ fill: '#707070'
699
+ },
700
+ "class": this.$props.className
701
+ }, [vue.createVNode("path", {
702
+ "d": "M0 0h24v24H0z",
703
+ "fill": "none"
704
+ }, null), vue.createVNode("path", {
705
+ "d": "M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
706
+ }, null)]);
707
+ }
708
+ return vue.createVNode(SearchSvg, {
709
+ "styles": {
710
+ position: 'relative',
711
+ fill: '#707070',
712
+ left: '3px',
713
+ marginRight: '8px'
714
+ }
715
+ }, null);
716
+ }
717
+ };
718
+
719
+ var _templateObject$6;
720
+ 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"])));
721
+ var AutoFillSvg = {
722
+ name: 'AutoFillSvg',
723
+ render: function render() {
724
+ return vue.createVNode(AutofillSvgIcon, {
725
+ "onClick": this.$attrs.click
726
+ }, {
727
+ "default": function _default() {
728
+ return [vue.createVNode("svg", {
729
+ "viewBox": "0 0 24 24"
730
+ }, [vue.createVNode("path", {
731
+ "d": "M8 17v-7.586l8.293 8.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-8.293-8.293h7.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-10c-0.552 0-1 0.448-1 1v10c0 0.552 0.448 1 1 1s1-0.448 1-1z"
732
+ }, null)])];
733
+ }
734
+ });
735
+ },
736
+ methods: {
737
+ clicked: function clicked(e) {
738
+ e.stopPropagation();
739
+ window.console.log('hey', e);
740
+ }
741
+ }
742
+ };
743
+
744
+ var _templateObject$7, _templateObject2;
745
+ 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"])));
746
+ 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"])));
747
+
748
+ function _isSlot(s) {
749
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
750
+ }
751
+ var updateQuery = configureStore.Actions.updateQuery,
752
+ setCustomQuery = configureStore.Actions.setCustomQuery,
753
+ setDefaultQuery = configureStore.Actions.setDefaultQuery,
754
+ recordSuggestionClick = configureStore.Actions.recordSuggestionClick;
755
+ var _debounce = configureStore.helper.debounce,
756
+ checkValueChange = configureStore.helper.checkValueChange,
757
+ getClassName$1 = configureStore.helper.getClassName,
758
+ isEqual = configureStore.helper.isEqual,
759
+ getCompositeAggsQuery = configureStore.helper.getCompositeAggsQuery,
760
+ withClickIds = configureStore.helper.withClickIds,
761
+ getResultStats = configureStore.helper.getResultStats;
762
+ var SearchBox = vue.defineComponent({
763
+ name: 'SearchBox',
764
+ isTagsMode: false,
765
+ data: function data() {
766
+ var props = this.$props;
767
+ this.__state = {
768
+ currentValue: '',
769
+ selectedTags: [],
770
+ isOpen: false,
771
+ normalizedSuggestions: []
772
+ };
773
+ this.internalComponent = props.componentId + "__internal";
774
+ return this.__state;
775
+ },
776
+ inject: {
777
+ theme: {
778
+ from: 'theme_reactivesearch'
779
+ }
780
+ },
781
+ created: function created() {
782
+ var mode = this.$props.mode;
783
+ if (mode === constants.SEARCH_COMPONENTS_MODES.TAG) {
784
+ this.$options.isTagsMode = true;
785
+ }
786
+ if (this.$options.isTagsMode) {
787
+ console.warn('Warning(ReactiveSearch): The `categoryField` prop is not supported when `mode` prop is set to `tag`');
788
+ }
789
+ this.currentValue = index.decodeHtml(this.selectedValue || this.value || this.defaultValue || '');
790
+ if (this.$options.isTagsMode) {
791
+ this.currentValue = '';
792
+ }
793
+ this.handleTextChange = _debounce(this.handleText, this.$props.debounce);
794
+
795
+ // Set custom and default queries in store
796
+ this.triggerCustomQuery(this.currentValue, this.selectedCategory);
797
+ this.triggerDefaultQuery(this.currentValue);
798
+ },
799
+ computed: {
800
+ hasCustomRenderer: function hasCustomRenderer() {
801
+ return index.hasCustomRenderer(this);
802
+ },
803
+ stats: function stats() {
804
+ return getResultStats(this);
805
+ }
806
+ },
807
+ props: {
808
+ autoFocus: VueTypes.bool,
809
+ autosuggest: VueTypes.bool.def(true),
810
+ beforeValueChange: vueTypes.types.func,
811
+ className: VueTypes.string.def(''),
812
+ clearIcon: vueTypes.types.children,
813
+ componentId: vueTypes.types.stringRequired,
814
+ customHighlight: vueTypes.types.func,
815
+ customQuery: vueTypes.types.func,
816
+ defaultQuery: vueTypes.types.func,
817
+ dataField: VueTypes.oneOfType([VueTypes.string, VueTypes.shape({
818
+ field: VueTypes.string,
819
+ weight: VueTypes.number
820
+ }), VueTypes.arrayOf(VueTypes.string), VueTypes.arrayOf({
821
+ field: VueTypes.string,
822
+ weight: VueTypes.number
823
+ })]),
824
+ aggregationField: vueTypes.types.string,
825
+ aggregationSize: VueTypes.number,
826
+ size: VueTypes.number,
827
+ debounce: VueTypes.number.def(0),
828
+ defaultValue: vueTypes.types.string,
829
+ excludeFields: vueTypes.types.excludeFields,
830
+ value: VueTypes.oneOfType([VueTypes.arrayOf(VueTypes.string), vueTypes.types.value]),
831
+ defaultSuggestions: vueTypes.types.suggestions,
832
+ enableSynonyms: VueTypes.bool.def(true),
833
+ enableQuerySuggestions: VueTypes.bool.def(false),
834
+ enablePopularSuggestions: VueTypes.bool.def(false),
835
+ enableRecentSuggestions: VueTypes.bool.def(false),
836
+ fieldWeights: vueTypes.types.fieldWeights,
837
+ filterLabel: vueTypes.types.string,
838
+ fuzziness: vueTypes.types.fuzziness,
839
+ highlight: VueTypes.bool,
840
+ highlightField: vueTypes.types.stringOrArray,
841
+ icon: vueTypes.types.children,
842
+ iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
843
+ includeFields: vueTypes.types.includeFields,
844
+ innerClass: vueTypes.types.style,
845
+ innerRef: VueTypes.string.def('searchInputField'),
846
+ render: vueTypes.types.func,
847
+ renderNoSuggestion: vueTypes.types.title,
848
+ renderError: vueTypes.types.title,
849
+ placeholder: VueTypes.string.def('Search'),
850
+ queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
851
+ react: vueTypes.types.react,
852
+ showClear: VueTypes.bool.def(true),
853
+ showDistinctSuggestions: VueTypes.bool.def(true),
854
+ showFilter: VueTypes.bool.def(true),
855
+ showIcon: VueTypes.bool.def(true),
856
+ title: vueTypes.types.title,
857
+ URLParams: VueTypes.bool.def(false),
858
+ strictSelection: VueTypes.bool.def(false),
859
+ nestedField: vueTypes.types.string,
860
+ enablePredictiveSuggestions: VueTypes.bool.def(false),
861
+ recentSearchesIcon: VueTypes.any,
862
+ popularSearchesIcon: VueTypes.any,
863
+ // mic props
864
+ showVoiceSearch: VueTypes.bool.def(false),
865
+ getMicInstance: vueTypes.types.func,
866
+ renderMic: vueTypes.types.func,
867
+ distinctField: vueTypes.types.string,
868
+ distinctFieldConfig: vueTypes.types.props,
869
+ //
870
+ focusShortcuts: VueTypes.arrayOf(VueTypes.oneOfType([VueTypes.string, VueTypes.number])).def(['/']),
871
+ addonBefore: VueTypes.any,
872
+ addonAfter: VueTypes.any,
873
+ expandSuggestionsContainer: VueTypes.bool.def(true),
874
+ index: VueTypes.string,
875
+ popularSuggestionsConfig: VueTypes.object,
876
+ recentSuggestionsConfig: VueTypes.object,
877
+ applyStopwords: VueTypes.bool,
878
+ customStopwords: vueTypes.types.stringArray,
879
+ onData: vueTypes.types.func,
880
+ renderItem: vueTypes.types.func,
881
+ enterButton: VueTypes.bool.def(false),
882
+ renderEnterButton: VueTypes.any,
883
+ mode: VueTypes.oneOf(['select', 'tag']).def('select'),
884
+ renderSelectedTags: VueTypes.any,
885
+ searchboxId: VueTypes.string,
886
+ endpoint: vueTypes.types.endpointConfig
887
+ },
888
+ beforeMount: function beforeMount() {
889
+ if (this.selectedValue) {
890
+ this.setValue(this.selectedValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
891
+ } else if (this.$props.value) {
892
+ this.setValue(this.$props.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
893
+ } else if (this.$props.defaultValue) {
894
+ this.setValue(this.$props.defaultValue, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined);
895
+ }
896
+ },
897
+ mounted: function mounted() {
898
+ this.listenForFocusShortcuts();
899
+ },
900
+ watch: {
901
+ dataField: function dataField(newVal, oldVal) {
902
+ if (!isEqual(newVal, oldVal)) {
903
+ this.triggerCustomQuery(this.$data.currentValue);
904
+ }
905
+ },
906
+ fieldWeights: function fieldWeights() {
907
+ this.triggerCustomQuery(this.$data.currentValue);
908
+ },
909
+ fuzziness: function fuzziness() {
910
+ this.triggerCustomQuery(this.$data.currentValue);
911
+ },
912
+ queryFormat: function queryFormat() {
913
+ this.triggerCustomQuery(this.$data.currentValue);
914
+ },
915
+ defaultValue: function defaultValue(newVal) {
916
+ this.setValue(newVal, true, this.$props);
917
+ },
918
+ value: function value(newVal, oldVal) {
919
+ if (!isEqual(newVal, oldVal)) {
920
+ this.setValue(newVal, true, this.$props, newVal === '' ? configureStore.causes.CLEAR_VALUE : undefined, false);
921
+ }
922
+ },
923
+ defaultQuery: function defaultQuery(newVal, oldVal) {
924
+ if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
925
+ this.triggerDefaultQuery(this.$data.currentValue);
926
+ }
927
+ },
928
+ customQuery: function customQuery(newVal, oldVal) {
929
+ if (!index.isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
930
+ this.triggerCustomQuery(this.$data.currentValue);
931
+ }
932
+ },
933
+ suggestions: function suggestions(newVal) {
934
+ var suggestionsList = [];
935
+ if (Array.isArray(newVal) && newVal.length) {
936
+ suggestionsList = [].concat(withClickIds(newVal));
937
+ } else if (Array.isArray(this.$props.defaultSuggestions) && this.$props.defaultSuggestions.length) {
938
+ suggestionsList = [].concat(withClickIds(this.$props.defaultSuggestions));
939
+ }
940
+ this.normalizedSuggestions = suggestionsList;
941
+ },
942
+ selectedValue: function selectedValue(newVal, oldVal) {
943
+ if (!isEqual(newVal, oldVal) && (this.$options.isTagsMode ? !isEqual(this.$data.selectedTags, newVal) : this.$data.currentValue !== newVal)) {
944
+ if (!newVal && this.$data.currentValue) {
945
+ // selected value is cleared, call onValueSelected
946
+ this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
947
+ }
948
+ if (this.$options.isTagsMode) {
949
+ // handling reset of tags through SelectedFilters or URL
950
+ this.selectedTags = [];
951
+ }
952
+ var cause = !newVal ? configureStore.causes.CLEAR_VALUE : undefined;
953
+ if (this.$options.isTagsMode) {
954
+ cause = configureStore.causes.SUGGESTION_SELECT;
955
+ }
956
+ this.setValue(newVal || '', true, this.$props, cause);
957
+ }
958
+ },
959
+ focusShortcuts: function focusShortcuts() {
960
+ this.listenForFocusShortcuts();
961
+ },
962
+ rawData: function rawData(newVal) {
963
+ this.$emit('on-data', {
964
+ data: this.normalizedSuggestions,
965
+ rawData: newVal,
966
+ aggregationData: this.aggregationData,
967
+ loading: this.isLoading,
968
+ error: this.isError
969
+ });
970
+ },
971
+ aggregationData: function aggregationData(newVal) {
972
+ this.$emit('on-data', {
973
+ data: this.normalizedSuggestions,
974
+ rawData: this.rawData,
975
+ aggregationData: newVal,
976
+ loading: this.isLoading,
977
+ error: this.isError
978
+ });
979
+ },
980
+ loading: function loading(newVal) {
981
+ this.$emit('on-data', {
982
+ data: this.normalizedSuggestions,
983
+ rawData: this.rawData,
984
+ aggregationData: this.aggregationData,
985
+ loading: newVal,
986
+ error: this.isError
987
+ });
988
+ },
989
+ error: function error(newVal) {
990
+ this.$emit('on-data', {
991
+ data: this.normalizedSuggestions,
992
+ rawData: this.rawData,
993
+ aggregationData: this.aggregationData,
994
+ loading: this.isLoading,
995
+ error: newVal
996
+ });
997
+ },
998
+ debounce: function debounce(newVal, oldVal) {
999
+ if (!isEqual(newVal, oldVal)) {
1000
+ this.handleTextChange = _debounce(this.handleText, newVal);
1001
+ }
1002
+ }
1003
+ },
1004
+ methods: {
1005
+ handleText: function handleText(value, cause) {
1006
+ if (cause === configureStore.causes.CLEAR_VALUE) {
1007
+ this.triggerCustomQuery(value);
1008
+ this.triggerDefaultQuery(value);
1009
+ } else if (this.$props.autosuggest) {
1010
+ this.triggerDefaultQuery(value);
1011
+ } else if (!this.$props.enterButton) {
1012
+ this.triggerCustomQuery(value);
1013
+ }
1014
+ },
1015
+ getComponent: function getComponent(downshiftProps) {
1016
+ if (downshiftProps === void 0) {
1017
+ downshiftProps = {};
1018
+ }
1019
+ var currentValue = this.$data.currentValue;
1020
+ var data = {
1021
+ error: this.error,
1022
+ loading: this.isLoading,
1023
+ downshiftProps: downshiftProps,
1024
+ data: this.normalizedSuggestions,
1025
+ rawData: this.rawData,
1026
+ value: currentValue,
1027
+ resultStats: this.stats
1028
+ };
1029
+ return index.getComponent(data, this);
1030
+ },
1031
+ // returns size and aggs property
1032
+ getBasicQueryOptions: function getBasicQueryOptions() {
1033
+ var aggregationField = this.$props.aggregationField;
1034
+ var queryOptions = helper.getQueryOptions(this.$props);
1035
+ if (aggregationField) {
1036
+ queryOptions.aggs = getCompositeAggsQuery({
1037
+ props: this.$props,
1038
+ showTopHits: true
1039
+ }).aggs;
1040
+ }
1041
+ return queryOptions;
1042
+ },
1043
+ handleSearchIconClick: function handleSearchIconClick() {
1044
+ var currentValue = this.currentValue;
1045
+ if (currentValue.trim()) {
1046
+ this.setValue(currentValue, true);
1047
+ this.onValueSelectedHandler(currentValue, configureStore.causes.SEARCH_ICON_CLICK);
1048
+ }
1049
+ },
1050
+ setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
1051
+ var _this = this;
1052
+ if (isDefaultValue === void 0) {
1053
+ isDefaultValue = false;
1054
+ }
1055
+ if (props === void 0) {
1056
+ props = this.$props;
1057
+ }
1058
+ if (toggleIsOpen === void 0) {
1059
+ toggleIsOpen = true;
1060
+ }
1061
+ if (categoryValue === void 0) {
1062
+ categoryValue = undefined;
1063
+ }
1064
+ var performUpdate = function performUpdate() {
1065
+ if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
1066
+ return;
1067
+ }
1068
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
1069
+ if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
1070
+ // check if value already present in selectedTags
1071
+ if (typeof value === 'string' && _this.selectedTags.includes(value)) {
1072
+ _this.isOpen = false;
1073
+ return;
1074
+ }
1075
+ _this.selectedTags = [].concat(_this.selectedTags);
1076
+ if (typeof value === 'string' && !!value) {
1077
+ _this.selectedTags.push(value);
1078
+ } else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
1079
+ _this.selectedTags = value;
1080
+ }
1081
+ } else if (value) {
1082
+ _this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
1083
+ }
1084
+ _this.currentValue = '';
1085
+ } else {
1086
+ _this.currentValue = index.decodeHtml(value);
1087
+ }
1088
+ var queryHandlerValue = value;
1089
+ if (_this.$options.isTagsMode && cause === configureStore.causes.SUGGESTION_SELECT) {
1090
+ queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
1091
+ }
1092
+ if (isDefaultValue) {
1093
+ if (_this.$props.autosuggest) {
1094
+ if (toggleIsOpen) {
1095
+ _this.isOpen = false;
1096
+ }
1097
+ if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
1098
+ } // in case of strict selection only SUGGESTION_SELECT should be able
1099
+ // to set the query otherwise the value should reset
1100
+ if (props.strictSelection) {
1101
+ if (cause === configureStore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
1102
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1103
+ } else {
1104
+ _this.setValue('', true);
1105
+ }
1106
+ } else if (props.value === undefined || cause === configureStore.causes.SUGGESTION_SELECT || cause === configureStore.causes.CLEAR_VALUE) {
1107
+ _this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
1108
+ }
1109
+ } else {
1110
+ // debounce for handling text while typing
1111
+ _this.handleTextChange(value, cause);
1112
+ }
1113
+ _this.$emit('valueChange', value);
1114
+ _this.$emit('value-change', value);
1115
+ };
1116
+ checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
1117
+ },
1118
+ triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
1119
+ if (!this.$props.autosuggest) {
1120
+ return;
1121
+ }
1122
+ var value = typeof paramValue !== 'string' ? this.currentValue : paramValue;
1123
+ var query = SearchBox.defaultQuery(value, this.$props);
1124
+ if (this.defaultQuery) {
1125
+ var defaultQueryToBeSet = this.defaultQuery(value, this.$props) || {};
1126
+ if (defaultQueryToBeSet.query) {
1127
+ query = defaultQueryToBeSet.query;
1128
+ }
1129
+
1130
+ // Update calculated default query in store
1131
+ index.updateDefaultQuery(this.$props.componentId, this.setDefaultQuery, this.$props, value);
1132
+ }
1133
+ this.updateQuery({
1134
+ componentId: this.internalComponent,
1135
+ query: query,
1136
+ value: value,
1137
+ componentType: constants.componentTypes.searchBox
1138
+ });
1139
+ },
1140
+ triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
1141
+ if (categoryValue === void 0) {
1142
+ categoryValue = undefined;
1143
+ }
1144
+ var _this$$props = this.$props,
1145
+ customQuery = _this$$props.customQuery,
1146
+ filterLabel = _this$$props.filterLabel,
1147
+ showFilter = _this$$props.showFilter,
1148
+ URLParams = _this$$props.URLParams;
1149
+ var value = typeof paramValue !== 'string' ? this.$data.currentValue : paramValue;
1150
+ if (this.$options.isTagsMode) {
1151
+ value = paramValue;
1152
+ }
1153
+ var defaultQueryTobeSet = SearchBox.defaultQuery("" + value + (categoryValue ? " in " + categoryValue : ''), this.$props);
1154
+ var query = defaultQueryTobeSet;
1155
+ if (customQuery) {
1156
+ var customQueryTobeSet = customQuery(value, this.$props);
1157
+ var queryTobeSet = customQueryTobeSet.query;
1158
+ if (queryTobeSet) {
1159
+ query = queryTobeSet;
1160
+ }
1161
+ index.updateCustomQuery(this.$props.componentId, this.setCustomQuery, this.$props, value);
1162
+ }
1163
+ this.updateQuery({
1164
+ componentId: this.$props.componentId,
1165
+ query: query,
1166
+ value: value,
1167
+ label: filterLabel,
1168
+ showFilter: showFilter,
1169
+ URLParams: URLParams,
1170
+ componentType: constants.componentTypes.searchBox,
1171
+ category: categoryValue
1172
+ });
1173
+ },
1174
+ handleFocus: function handleFocus(event) {
1175
+ if (this.$props.autosuggest) {
1176
+ this.isOpen = true;
1177
+ }
1178
+ this.$emit('focus', event);
1179
+ },
1180
+ handleVoiceResults: function handleVoiceResults(_ref) {
1181
+ var results = _ref.results;
1182
+ if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
1183
+ this.setValue(results[0][0].transcript.trim(), true);
1184
+ }
1185
+ },
1186
+ triggerQuery: function triggerQuery(_ref2) {
1187
+ var _ref2$isOpen = _ref2.isOpen,
1188
+ isOpen = _ref2$isOpen === void 0 ? undefined : _ref2$isOpen,
1189
+ _ref2$customQuery = _ref2.customQuery,
1190
+ customQuery = _ref2$customQuery === void 0 ? true : _ref2$customQuery,
1191
+ _ref2$defaultQuery = _ref2.defaultQuery,
1192
+ defaultQuery = _ref2$defaultQuery === void 0 ? true : _ref2$defaultQuery,
1193
+ _ref2$value = _ref2.value,
1194
+ value = _ref2$value === void 0 ? undefined : _ref2$value,
1195
+ _ref2$categoryValue = _ref2.categoryValue,
1196
+ categoryValue = _ref2$categoryValue === void 0 ? undefined : _ref2$categoryValue;
1197
+ if (typeof isOpen === 'boolean') {
1198
+ this.isOpen = isOpen;
1199
+ }
1200
+ if (customQuery) {
1201
+ this.triggerCustomQuery(value, categoryValue);
1202
+ }
1203
+ if (defaultQuery) {
1204
+ this.triggerDefaultQuery(value);
1205
+ }
1206
+ },
1207
+ triggerClickAnalytics: function triggerClickAnalytics(searchPosition, documentId) {
1208
+ // click analytics would only work client side and after javascript loads
1209
+ var docId = documentId;
1210
+ if (!docId) {
1211
+ var hitData = this.normalizedSuggestions.find(function (hit) {
1212
+ return hit._click_id === searchPosition;
1213
+ });
1214
+ if (hitData && hitData.source && hitData.source._id) {
1215
+ docId = hitData.source._id;
1216
+ }
1217
+ }
1218
+ this.recordSuggestionClick(searchPosition, docId);
1219
+ },
1220
+ clearValue: function clearValue() {
1221
+ this.setValue('', false, this.$props, configureStore.causes.CLEAR_VALUE, false);
1222
+ this.onValueSelectedHandler('', configureStore.causes.CLEAR_VALUE);
1223
+ },
1224
+ handleKeyDown: function handleKeyDown(event, highlightedIndex) {
1225
+ if (highlightedIndex === void 0) {
1226
+ highlightedIndex = null;
1227
+ }
1228
+ // if a suggestion was selected, delegate the handling to suggestion handler
1229
+ if (event.key === 'Enter') {
1230
+ if (this.$props.autosuggest === false) {
1231
+ this.enterButtonOnClick();
1232
+ } else if (highlightedIndex === null) {
1233
+ this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? configureStore.causes.SUGGESTION_SELECT : undefined // to handle tags
1234
+ );
1235
+
1236
+ this.onValueSelectedHandler(event.target.value, configureStore.causes.ENTER_PRESS);
1237
+ }
1238
+ }
1239
+
1240
+ // Need to review
1241
+ this.$emit('keyDown', event, this.triggerQuery);
1242
+ this.$emit('key-down', event, this.triggerQuery);
1243
+ },
1244
+ onInputChange: function onInputChange(e) {
1245
+ var _this2 = this;
1246
+ var inputValue = e.target.value;
1247
+ if (!this.$data.isOpen && this.$props.autosuggest) {
1248
+ this.isOpen = true;
1249
+ }
1250
+ var value = this.$props.value;
1251
+ if (value === undefined) {
1252
+ this.setValue(inputValue, false, this.$props, inputValue === '' ? configureStore.causes.CLEAR_VALUE : undefined);
1253
+ } else {
1254
+ this.$emit('change', inputValue, function (_ref3) {
1255
+ var isOpen = _ref3.isOpen;
1256
+ return _this2.triggerQuery({
1257
+ defaultQuery: true,
1258
+ customQuery: true,
1259
+ value: inputValue,
1260
+ isOpen: isOpen
1261
+ });
1262
+ }, e);
1263
+ }
1264
+ },
1265
+ onSuggestionSelected: function onSuggestionSelected(suggestion) {
1266
+ var _this3 = this;
1267
+ this.isOpen = false;
1268
+ var value = this.$props.value;
1269
+ // Record analytics for selected suggestions
1270
+ this.triggerClickAnalytics(suggestion._click_id);
1271
+ if (value === undefined) {
1272
+ this.setValue(suggestion.value, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
1273
+ } else {
1274
+ var emitValue = suggestion.value;
1275
+ if (this.$options.isTagsMode) {
1276
+ emitValue = Array.isArray(this.selectedTags) ? [].concat(this.selectedTags) : [];
1277
+ if (this.selectedTags.includes(suggestion.value)) {
1278
+ // avoid duplicates in tags array
1279
+ this.isOpen = false;
1280
+ return;
1281
+ }
1282
+ emitValue.push(suggestion.value);
1283
+ }
1284
+ this.setValue(emitValue, true, this.$props, configureStore.causes.SUGGESTION_SELECT, false, suggestion._category);
1285
+ this.$emit('change', emitValue, function (_ref4) {
1286
+ var isOpen = _ref4.isOpen;
1287
+ return _this3.triggerQuery(_rollupPluginBabelHelpers._extends({
1288
+ isOpen: isOpen,
1289
+ value: emitValue
1290
+ }, !_this3.$options.isTagsMode && {
1291
+ categoryValue: suggestion._category
1292
+ }));
1293
+ });
1294
+ }
1295
+ this.onValueSelectedHandler(suggestion.value, configureStore.causes.SUGGESTION_SELECT, suggestion.source);
1296
+ },
1297
+ onValueSelectedHandler: function onValueSelectedHandler(currentValue) {
1298
+ if (currentValue === void 0) {
1299
+ currentValue = this.$data.currentValue;
1300
+ }
1301
+ for (var _len = arguments.length, cause = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1302
+ cause[_key - 1] = arguments[_key];
1303
+ }
1304
+ this.$emit.apply(this, ['valueSelected', currentValue].concat(cause));
1305
+ this.$emit.apply(this, ['value-selected', currentValue].concat(cause));
1306
+ },
1307
+ handleStateChange: function handleStateChange(changes) {
1308
+ var isOpen = changes.isOpen;
1309
+ this.isOpen = isOpen;
1310
+ },
1311
+ getBackgroundColor: function getBackgroundColor(highlightedIndex, index) {
1312
+ var isDark = this.themePreset === 'dark';
1313
+ if (isDark) {
1314
+ return highlightedIndex === index ? '#555' : '#424242';
1315
+ }
1316
+ return highlightedIndex === index ? '#eee' : '#fff';
1317
+ },
1318
+ renderIcon: function renderIcon() {
1319
+ if (this.$props.showIcon) {
1320
+ return this.$props.icon || vue.createVNode(SearchSvg, null, null);
1321
+ }
1322
+ return null;
1323
+ },
1324
+ renderErrorComponent: function renderErrorComponent() {
1325
+ var _this4 = this;
1326
+ var renderError = this.$slots.renderError || this.$props.renderError;
1327
+ if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
1328
+ return vue.createVNode(SuggestionWrapper, {
1329
+ "innerClass": this.$props.innerClass,
1330
+ "innerClassName": "error",
1331
+ "theme": this.theme,
1332
+ "themePreset": this.themePreset
1333
+ }, {
1334
+ "default": function _default() {
1335
+ return [index.isFunction(renderError) ? renderError(_this4.error) : renderError];
1336
+ }
1337
+ });
1338
+ }
1339
+ return null;
1340
+ },
1341
+ renderCancelIcon: function renderCancelIcon() {
1342
+ if (this.$props.showClear) {
1343
+ return this.$props.clearIcon || vue.createVNode(DropDown.CancelSvg, null, null);
1344
+ }
1345
+ return null;
1346
+ },
1347
+ renderNoSuggestions: function renderNoSuggestions(finalSuggestionsList) {
1348
+ if (finalSuggestionsList === void 0) {
1349
+ finalSuggestionsList = [];
1350
+ }
1351
+ var innerClass = this.$props.innerClass;
1352
+ var renderNoSuggestion = this.$slots.renderNoSuggestion || this.$props.renderNoSuggestion;
1353
+ var renderError = this.$slots.renderError || this.$props.renderError;
1354
+ var _this$$data = this.$data,
1355
+ isOpen = _this$$data.isOpen,
1356
+ currentValue = _this$$data.currentValue;
1357
+ if (renderNoSuggestion && isOpen && !finalSuggestionsList.length && !this.isLoading && currentValue && !(renderError && this.error)) {
1358
+ return vue.createVNode(SuggestionWrapper, {
1359
+ "innerClass": innerClass,
1360
+ "themePreset": this.themePreset,
1361
+ "theme": this.theme,
1362
+ "innerClassName": "noSuggestion"
1363
+ }, {
1364
+ "default": function _default() {
1365
+ return typeof renderNoSuggestion === 'function' ? renderNoSuggestion(currentValue) : renderNoSuggestion;
1366
+ }
1367
+ });
1368
+ }
1369
+ return null;
1370
+ },
1371
+ renderInputAddonBefore: function renderInputAddonBefore() {
1372
+ var addonBefore = this.$slots.addonBefore;
1373
+ if (addonBefore) {
1374
+ var _slot;
1375
+ return vue.createVNode(InputAddon, {
1376
+ "class": "addon-before"
1377
+ }, _isSlot(_slot = addonBefore()) ? _slot : {
1378
+ "default": function _default() {
1379
+ return [_slot];
1380
+ }
1381
+ });
1382
+ }
1383
+ return null;
1384
+ },
1385
+ renderInputAddonAfter: function renderInputAddonAfter() {
1386
+ var addonAfter = this.$slots.addonAfter;
1387
+ if (addonAfter) {
1388
+ var _slot2;
1389
+ return vue.createVNode(InputAddon, {
1390
+ "class": "addon-after"
1391
+ }, _isSlot(_slot2 = addonAfter()) ? _slot2 : {
1392
+ "default": function _default() {
1393
+ return [_slot2];
1394
+ }
1395
+ });
1396
+ }
1397
+ return null;
1398
+ },
1399
+ enterButtonOnClick: function enterButtonOnClick() {
1400
+ this.triggerQuery({
1401
+ isOpen: false,
1402
+ value: this.currentValue,
1403
+ customQuery: true
1404
+ });
1405
+ },
1406
+ renderEnterButtonElement: function renderEnterButtonElement() {
1407
+ var _this5 = this;
1408
+ var _this$$props2 = this.$props,
1409
+ enterButton = _this$$props2.enterButton,
1410
+ innerClass = _this$$props2.innerClass;
1411
+ var renderEnterButton = this.$slots.renderEnterButton;
1412
+ if (enterButton) {
1413
+ var getEnterButtonMarkup = function getEnterButtonMarkup() {
1414
+ if (renderEnterButton) {
1415
+ return renderEnterButton(_this5.enterButtonOnClick);
1416
+ }
1417
+ return vue.createVNode(Button.Button, {
1418
+ "class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
1419
+ "primary": true,
1420
+ "onClick": _this5.enterButtonOnClick
1421
+ }, {
1422
+ "default": function _default() {
1423
+ return [vue.createTextVNode("Search")];
1424
+ }
1425
+ });
1426
+ };
1427
+ return vue.createVNode("div", {
1428
+ "class": "enter-button-wrapper"
1429
+ }, [getEnterButtonMarkup()]);
1430
+ }
1431
+ return null;
1432
+ },
1433
+ renderIcons: function renderIcons() {
1434
+ var _this6 = this;
1435
+ var _slot3, _slot4, _slot5;
1436
+ var _this$$props3 = this.$props,
1437
+ iconPosition = _this$$props3.iconPosition,
1438
+ showClear = _this$$props3.showClear,
1439
+ innerClass = _this$$props3.innerClass,
1440
+ getMicInstance = _this$$props3.getMicInstance,
1441
+ showVoiceSearch = _this$$props3.showVoiceSearch,
1442
+ showIcon = _this$$props3.showIcon;
1443
+ var renderMic = this.$slots.renderMic || this.$props.renderMic;
1444
+ var currentValue = this.$data.currentValue;
1445
+ return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
1446
+ "groupPosition": "right",
1447
+ "positionType": "absolute"
1448
+ }, {
1449
+ "default": function _default() {
1450
+ return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
1451
+ "onClick": _this6.clearValue,
1452
+ "showIcon": showIcon,
1453
+ "isClearIcon": true
1454
+ }, _isSlot(_slot3 = _this6.renderCancelIcon()) ? _slot3 : {
1455
+ "default": function _default() {
1456
+ return [_slot3];
1457
+ }
1458
+ }), showVoiceSearch && vue.createVNode(Mic, {
1459
+ "getInstance": getMicInstance,
1460
+ "render": renderMic,
1461
+ "handleResult": _this6.handleVoiceResults,
1462
+ "className": getClassName$1(innerClass, 'mic') || null
1463
+ }, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1464
+ "onClick": _this6.handleSearchIconClick
1465
+ }, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
1466
+ "default": function _default() {
1467
+ return [_slot4];
1468
+ }
1469
+ })];
1470
+ }
1471
+ }), vue.createVNode(DropDown.IconGroup, {
1472
+ "groupPosition": "left",
1473
+ "positionType": "absolute"
1474
+ }, {
1475
+ "default": function _default() {
1476
+ return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
1477
+ "onClick": _this6.handleSearchIconClick
1478
+ }, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
1479
+ "default": function _default() {
1480
+ return [_slot5];
1481
+ }
1482
+ })];
1483
+ }
1484
+ })]);
1485
+ },
1486
+ focusSearchBox: function focusSearchBox(event) {
1487
+ var _this$$refs, _this$$refs$this$$pro;
1488
+ var elt = event.target || event.srcElement;
1489
+ var tagName = elt.tagName;
1490
+ if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
1491
+ // already in an input
1492
+ return;
1493
+ }
1494
+ (_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
1495
+ },
1496
+ listenForFocusShortcuts: function listenForFocusShortcuts() {
1497
+ var _this7 = this;
1498
+ var _this$$props$focusSho = this.$props.focusShortcuts,
1499
+ focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
1500
+ if (index.isEmpty(focusShortcuts)) {
1501
+ return;
1502
+ }
1503
+ var shortcutsString = index.parseFocusShortcuts(focusShortcuts).join(',');
1504
+
1505
+ // handler for alphabets and other key combinations
1506
+ hotkeys(shortcutsString,
1507
+ // eslint-disable-next-line no-unused-vars
1508
+ /* eslint-disable no-shadow */
1509
+ function (event, handler) {
1510
+ // Prevent the default refresh event under WINDOWS system
1511
+ event.preventDefault();
1512
+ _this7.focusSearchBox(event);
1513
+ });
1514
+
1515
+ // if one of modifier keys are used, they are handled below
1516
+ hotkeys('*', function (event) {
1517
+ var modifierKeys = index.extractModifierKeysFromFocusShortcuts(focusShortcuts);
1518
+ if (modifierKeys.length === 0) return;
1519
+ for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
1520
+ var element = modifierKeys[index$1];
1521
+ if (hotkeys[element]) {
1522
+ _this7.focusSearchBox(event);
1523
+ break;
1524
+ }
1525
+ }
1526
+ });
1527
+ },
1528
+ onAutofillClick: function onAutofillClick(suggestion) {
1529
+ var value = suggestion.value;
1530
+ this.isOpen = true;
1531
+ this.currentValue = index.decodeHtml(value);
1532
+ this.triggerDefaultQuery(value);
1533
+ },
1534
+ renderAutoFill: function renderAutoFill(suggestion) {
1535
+ var _this8 = this;
1536
+ var handleAutoFillClick = function handleAutoFillClick(e) {
1537
+ e.stopPropagation();
1538
+ _this8.onAutofillClick(suggestion);
1539
+ };
1540
+ /* 👇 avoid showing autofill for category suggestions👇 */
1541
+ return suggestion._category ? null : vue.createVNode(AutoFillSvg, {
1542
+ "onClick": handleAutoFillClick
1543
+ }, null);
1544
+ },
1545
+ renderTag: function renderTag(item) {
1546
+ var _this9 = this;
1547
+ var innerClass = this.$props.innerClass;
1548
+ return vue.createVNode(TagItem, {
1549
+ "class": getClassName$1(innerClass, 'selected-tag') || ''
1550
+ }, {
1551
+ "default": function _default() {
1552
+ return [vue.createVNode("span", null, [item]), vue.createVNode("span", {
1553
+ "role": "img",
1554
+ "aria-label": "delete-tag",
1555
+ "class": "close-icon",
1556
+ "onClick": function onClick() {
1557
+ return _this9.clearTag(item);
1558
+ }
1559
+ }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
1560
+ }
1561
+ });
1562
+ },
1563
+ clearAllTags: function clearAllTags() {
1564
+ this.selectedTags = [];
1565
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1566
+ if (this.$props.value !== undefined) {
1567
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1568
+ }
1569
+ },
1570
+ clearTag: function clearTag(tagValue) {
1571
+ this.selectedTags = [].concat(this.selectedTags.filter(function (tag) {
1572
+ return tag !== tagValue;
1573
+ }));
1574
+ this.setValue('', true, this.$props, configureStore.causes.SUGGESTION_SELECT);
1575
+ if (this.$props.value !== undefined) {
1576
+ this.$emit('change', this.selectedTags, this.triggerQuery);
1577
+ }
1578
+ },
1579
+ renderTags: function renderTags() {
1580
+ var _this10 = this;
1581
+ if (!Array.isArray(this.selectedTags)) {
1582
+ return null;
1583
+ }
1584
+ var tagsList = [].concat(this.selectedTags);
1585
+ var shouldRenderClearAllTag = tagsList.length > 1;
1586
+ var renderSelectedTags = this.$slots.renderSelectedTags || this.$props.renderSelectedTags;
1587
+ return renderSelectedTags ? renderSelectedTags({
1588
+ values: this.selectedTags,
1589
+ handleClear: this.clearTag,
1590
+ handleClearAll: this.clearAllTags
1591
+ }) : vue.createVNode(TagsContainer, null, {
1592
+ "default": function _default() {
1593
+ return [tagsList.map(function (item) {
1594
+ return _this10.renderTag(item);
1595
+ }), shouldRenderClearAllTag && vue.createVNode(TagItem, {
1596
+ "class": getClassName$1(_this10.$props.innerClass, 'selected-tag') || ''
1597
+ }, {
1598
+ "default": function _default() {
1599
+ return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
1600
+ "role": "img",
1601
+ "aria-label": "delete-tag",
1602
+ "class": "close-icon",
1603
+ "onClick": _this10.clearAllTags
1604
+ }, [vue.createVNode(DropDown.CancelSvg, null, null)])];
1605
+ }
1606
+ })];
1607
+ }
1608
+ });
1609
+ }
1610
+ },
1611
+ render: function render() {
1612
+ var _this11 = this;
1613
+ var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
1614
+ var _this$$slots = this.$slots,
1615
+ recentSearchesIcon = _this$$slots.recentSearchesIcon,
1616
+ popularSearchesIcon = _this$$slots.popularSearchesIcon;
1617
+ var hasSuggestions = Array.isArray(this.normalizedSuggestions) && this.normalizedSuggestions.length;
1618
+ var renderItem = this.$slots.renderItem || this.$props.renderItem;
1619
+ return vue.createVNode(Container.Container, {
1620
+ "class": this.$props.className
1621
+ }, {
1622
+ "default": function _default() {
1623
+ return [_this11.$props.title && vue.createVNode(Title.Title, {
1624
+ "class": getClassName$1(_this11.$props.innerClass, 'title') || ''
1625
+ }, {
1626
+ "default": function _default() {
1627
+ return [_this11.$props.title];
1628
+ }
1629
+ }), _this11.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
1630
+ "id": _this11.$props.componentId + "-downshift",
1631
+ "handleChange": _this11.onSuggestionSelected,
1632
+ "handleMouseup": _this11.handleStateChange,
1633
+ "isOpen": _this11.$data.isOpen
1634
+ }, {
1635
+ "default": function _default(_ref5) {
1636
+ var getInputEvents = _ref5.getInputEvents,
1637
+ getInputProps = _ref5.getInputProps,
1638
+ getItemProps = _ref5.getItemProps,
1639
+ getItemEvents = _ref5.getItemEvents,
1640
+ isOpen = _ref5.isOpen,
1641
+ highlightedIndex = _ref5.highlightedIndex,
1642
+ setHighlightedIndex = _ref5.setHighlightedIndex;
1643
+ var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
1644
+ var getIcon = function getIcon(iconType) {
1645
+ switch (iconType) {
1646
+ case helper.suggestionTypes.Recent:
1647
+ return recentSearchesIcon;
1648
+ case helper.suggestionTypes.Popular:
1649
+ return popularSearchesIcon;
1650
+ default:
1651
+ return null;
1652
+ }
1653
+ };
1654
+ return vue.createVNode("div", null, [_this11.hasCustomRenderer && _this11.getComponent({
1655
+ isOpen: isOpen,
1656
+ getItemProps: getItemProps,
1657
+ getItemEvents: getItemEvents,
1658
+ highlightedIndex: highlightedIndex
1659
+ }), _this11.renderErrorComponent(), !_this11.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
1660
+ "class": Input.suggestions(_this11.themePreset, _this11.theme) + " " + getClassName$1(_this11.$props.innerClass, 'list')
1661
+ }, [_this11.normalizedSuggestions.map(function (item, index) {
1662
+ return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
1663
+ item: item
1664
+ }), getItemEvents({
1665
+ item: item
1666
+ }), {
1667
+ "key": index + 1 + "-" + item.value,
1668
+ "style": {
1669
+ backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1670
+ justifyContent: 'flex-start',
1671
+ alignItems: 'center'
1672
+ }
1673
+ }), [renderItem(item)]) : vue.createVNode("li", vue.mergeProps(getItemProps({
1674
+ item: item
1675
+ }), _transformOn(getItemEvents({
1676
+ item: item
1677
+ })), {
1678
+ "key": index + 1 + "-" + item.value,
1679
+ "style": {
1680
+ backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
1681
+ justifyContent: 'flex-start',
1682
+ alignItems: 'center'
1683
+ }
1684
+ }), [vue.createVNode("div", {
1685
+ "style": {
1686
+ padding: '0 10px 0 0',
1687
+ display: 'flex'
1688
+ }
1689
+ }, [vue.createVNode(CustomSvg, {
1690
+ "className": getClassName$1(_this11.$props.innerClass, item._suggestion_type + "-search-icon") || null,
1691
+ "icon": getIcon(item._suggestion_type),
1692
+ "type": item._suggestion_type + "-search-icon"
1693
+ }, null)]), vue.createVNode(SuggestionItem, {
1694
+ "currentValue": _this11.currentValue,
1695
+ "suggestion": item
1696
+ }, null), _this11.renderAutoFill(item)]);
1697
+ })]) : _this11.renderNoSuggestions(_this11.normalizedSuggestions)]);
1698
+ };
1699
+ return vue.createVNode("div", {
1700
+ "class": Input.suggestionsContainer
1701
+ }, [vue.createVNode(InputGroup, null, {
1702
+ "default": function _default() {
1703
+ return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
1704
+ "default": function _default() {
1705
+ return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn(getInputEvents({
1706
+ onInput: _this11.onInputChange,
1707
+ onBlur: function onBlur(e) {
1708
+ _this11.$emit('blur', e, _this11.triggerQuery);
1709
+ },
1710
+ onFocus: _this11.handleFocus,
1711
+ onKeyPress: function onKeyPress(e) {
1712
+ _this11.$emit('keyPress', e, _this11.triggerQuery);
1713
+ _this11.$emit('key-press', e, _this11.triggerQuery);
1714
+ },
1715
+ onKeyDown: function onKeyDown(e) {
1716
+ return _this11.handleKeyDown(e, highlightedIndex);
1717
+ },
1718
+ onKeyUp: function onKeyUp(e) {
1719
+ _this11.$emit('keyUp', e, _this11.triggerQuery);
1720
+ _this11.$emit('key-up', e, _this11.triggerQuery);
1721
+ },
1722
+ onClick: function onClick() {
1723
+ setHighlightedIndex(null);
1724
+ }
1725
+ })), {
1726
+ "id": _this11.$props.componentId + "-input",
1727
+ "showIcon": _this11.$props.showIcon,
1728
+ "showClear": _this11.$props.showClear,
1729
+ "iconPosition": _this11.$props.iconPosition,
1730
+ "ref": _this11.$props.innerRef,
1731
+ "class": getClassName$1(_this11.$props.innerClass, 'input'),
1732
+ "placeholder": _this11.$props.placeholder,
1733
+ "autoFocus": _this11.$props.autoFocus
1734
+ }, getInputProps({
1735
+ value: _this11.$data.currentValue === null ? '' : _this11.$data.currentValue
1736
+ }), {
1737
+ "themePreset": _this11.themePreset,
1738
+ "autocomplete": "off"
1739
+ }), null), _this11.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
1740
+ }
1741
+ }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
1742
+ }
1743
+ }), expandSuggestionsContainer && renderSuggestionsDropdown(), _this11.renderTags()]);
1744
+ }
1745
+ }) : vue.createVNode("div", {
1746
+ "class": Input.suggestionsContainer
1747
+ }, [vue.createVNode(InputGroup, null, {
1748
+ "default": function _default() {
1749
+ return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
1750
+ "default": function _default() {
1751
+ return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn({
1752
+ blur: function blur(e) {
1753
+ _this11.$emit('blur', e, _this11.triggerQuery);
1754
+ },
1755
+ keypress: function keypress(e) {
1756
+ _this11.$emit('keyPress', e, _this11.triggerQuery);
1757
+ _this11.$emit('key-press', e, _this11.triggerQuery);
1758
+ },
1759
+ input: _this11.onInputChange,
1760
+ focus: function focus(e) {
1761
+ _this11.$emit('focus', e, _this11.triggerQuery);
1762
+ },
1763
+ keydown: _this11.handleKeyDown,
1764
+ keyup: function keyup(e) {
1765
+ _this11.$emit('keyUp', e, _this11.triggerQuery);
1766
+ _this11.$emit('key-up', e, _this11.triggerQuery);
1767
+ }
1768
+ }), {
1769
+ "class": getClassName$1(_this11.$props.innerClass, 'input') || '',
1770
+ "placeholder": _this11.$props.placeholder,
1771
+ "autofocus": _this11.$props.autoFocus,
1772
+ "value": _this11.$data.currentValue ? _this11.$data.currentValue : '',
1773
+ "iconPosition": _this11.$props.iconPosition,
1774
+ "showIcon": _this11.$props.showIcon,
1775
+ "showClear": _this11.$props.showClear,
1776
+ "ref": _this11.$props.innerRef,
1777
+ "themePreset": _this11.themePreset
1778
+ }), null), _this11.renderIcons()];
1779
+ }
1780
+ }), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
1781
+ }
1782
+ })])];
1783
+ }
1784
+ });
1785
+ },
1786
+ destroyed: function destroyed() {
1787
+ document.removeEventListener('keydown', this.onKeyDown);
1788
+ }
1789
+ });
1790
+ SearchBox.defaultQuery = function (value, props) {
1791
+ var finalQuery = null;
1792
+ finalQuery = {
1793
+ bool: {
1794
+ should: SearchBox.shouldQuery(value, props),
1795
+ minimum_should_match: '1'
1796
+ }
1797
+ };
1798
+ if (finalQuery && props.nestedField) {
1799
+ return {
1800
+ query: {
1801
+ nested: {
1802
+ path: props.nestedField,
1803
+ query: finalQuery
1804
+ }
1805
+ }
1806
+ };
1807
+ }
1808
+ return finalQuery;
1809
+ };
1810
+ SearchBox.shouldQuery = function (value, props) {
1811
+ return {
1812
+ query: {
1813
+ queryFormat: props.queryFormat,
1814
+ dataField: props.dataField,
1815
+ value: value,
1816
+ nestedField: props.nestedField,
1817
+ queryString: props.queryString,
1818
+ searchOperators: props.searchOperators
1819
+ }
1820
+ };
1821
+ };
1822
+ var mapStateToProps = function mapStateToProps(state, props) {
1823
+ return {
1824
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
1825
+ selectedCategory: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].category || null,
1826
+ suggestions: state.hits[props.componentId] && state.hits[props.componentId].hits,
1827
+ rawData: state.rawData[props.componentId],
1828
+ aggregationData: state.compositeAggregations[props.componentId] || [],
1829
+ themePreset: state.config.themePreset,
1830
+ isLoading: !!state.isLoading[props.componentId + "_active"],
1831
+ error: state.error[props.componentId],
1832
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
1833
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
1834
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
1835
+ };
1836
+ };
1837
+ var mapDispatchToProps = {
1838
+ updateQuery: updateQuery,
1839
+ setCustomQuery: setCustomQuery,
1840
+ setDefaultQuery: setDefaultQuery,
1841
+ recordSuggestionClick: recordSuggestionClick
1842
+ };
1843
+ var SBConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
1844
+ componentType: constants.componentTypes.searchBox,
1845
+ internalComponent: true
1846
+ }));
1847
+ SBConnected.name = SearchBox.name;
1848
+ SBConnected.install = function (Vue) {
1849
+ Vue.component(SBConnected.name, SBConnected);
1850
+ };
1851
+ // Add componentType for SSR
1852
+ SBConnected.componentType = constants.componentTypes.searchBox;
1853
+
1854
+ var _excluded = ["options"];
1855
+ var updateQuery$1 = configureStore.Actions.updateQuery,
1856
+ setQueryOptions = configureStore.Actions.setQueryOptions,
1857
+ setCustomQuery$1 = configureStore.Actions.setCustomQuery,
1858
+ setDefaultQuery$1 = configureStore.Actions.setDefaultQuery;
1859
+ var parseHits = configureStore.helper.parseHits,
1860
+ isEqual$1 = configureStore.helper.isEqual,
1861
+ getCompositeAggsQuery$1 = configureStore.helper.getCompositeAggsQuery,
1862
+ getResultStats$1 = configureStore.helper.getResultStats,
1863
+ extractQueryFromCustomQuery = configureStore.helper.extractQueryFromCustomQuery,
1864
+ getOptionsForCustomQuery = configureStore.helper.getOptionsForCustomQuery;
1865
+ var ReactiveComponent = {
1866
+ name: 'ReactiveComponent',
1867
+ props: {
1868
+ componentId: vueTypes.types.stringRequired,
1869
+ aggregationField: vueTypes.types.string,
1870
+ aggregationSize: VueTypes.number,
1871
+ size: VueTypes.number,
1872
+ defaultQuery: vueTypes.types.func,
1873
+ customQuery: vueTypes.types.func,
1874
+ filterLabel: vueTypes.types.string,
1875
+ react: vueTypes.types.react,
1876
+ showFilter: VueTypes.bool.def(true),
1877
+ URLParams: VueTypes.bool.def(false),
1878
+ distinctField: vueTypes.types.string,
1879
+ distinctFieldConfig: vueTypes.types.props,
1880
+ index: VueTypes.string,
1881
+ endpoint: vueTypes.types.endpointConfig
1882
+ },
1883
+ created: function created() {
1884
+ var _this = this;
1885
+ var props = this.$props;
1886
+ this.internalComponent = null;
1887
+ this.$defaultQuery = null;
1888
+ // Set custom query in store
1889
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
1890
+ var customQuery = props.customQuery,
1891
+ componentId = props.componentId,
1892
+ filterLabel = props.filterLabel,
1893
+ showFilter = props.showFilter,
1894
+ URLParams = props.URLParams;
1895
+ if (customQuery) {
1896
+ var calcCustomQuery = customQuery(this.selectedValue, props);
1897
+ var query = extractQueryFromCustomQuery(calcCustomQuery);
1898
+ var customQueryOptions = calcCustomQuery ? getOptionsForCustomQuery(calcCustomQuery) : null;
1899
+ if (customQueryOptions) {
1900
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, customQueryOptions, this.getAggsQuery()), false);
1901
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
1902
+ this.updateQuery({
1903
+ componentId: componentId,
1904
+ query: query,
1905
+ value: this.selectedValue || null,
1906
+ label: filterLabel,
1907
+ showFilter: showFilter,
1908
+ URLParams: URLParams
1909
+ });
1910
+ }
1911
+ this.setQuery = function (_ref) {
1912
+ var options = _ref.options,
1913
+ obj = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(_ref, _excluded);
1914
+ var queryToBeSet = obj.query;
1915
+
1916
+ // when enableAppbase is true, Backend throws error because of repeated query in request body
1917
+ if (queryToBeSet && queryToBeSet.query) {
1918
+ queryToBeSet = queryToBeSet.query;
1919
+ }
1920
+ var customQueryCalc = _rollupPluginBabelHelpers._extends({}, options, {
1921
+ query: queryToBeSet
1922
+ });
1923
+ var rsAPIQuery = customQueryCalc;
1924
+ // handle stored queries
1925
+ if (queryToBeSet && queryToBeSet.id) {
1926
+ rsAPIQuery = queryToBeSet;
1927
+ }
1928
+ // Update customQuery field for RS API
1929
+ _this.setCustomQuery(props.componentId, rsAPIQuery);
1930
+ if (options) {
1931
+ _this.setQueryOptions(props.componentId, _rollupPluginBabelHelpers._extends({}, _this.getAggsQuery(), options), false);
1932
+ }
1933
+ _this.updateQuery(_rollupPluginBabelHelpers._extends({}, obj, {
1934
+ query: customQueryCalc.query,
1935
+ componentId: props.componentId,
1936
+ label: props.filterLabel,
1937
+ showFilter: props.showFilter,
1938
+ URLParams: props.URLParams
1939
+ }));
1940
+ };
1941
+ if (props.defaultQuery) {
1942
+ this.internalComponent = props.componentId + "__internal";
1943
+ }
1944
+ if (this.internalComponent && this.$props.defaultQuery) {
1945
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
1946
+ this.$defaultQuery = this.$props.defaultQuery(this.selectedValue, this.$props);
1947
+ var _query = extractQueryFromCustomQuery(this.$defaultQuery);
1948
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
1949
+ if (queryOptions) {
1950
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
1951
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
1952
+ this.updateQuery({
1953
+ componentId: this.internalComponent,
1954
+ query: _query
1955
+ });
1956
+ }
1957
+ },
1958
+ watch: {
1959
+ hits: function hits(newVal, oldVal) {
1960
+ if (!isEqual$1(newVal, oldVal)) {
1961
+ this.$emit('data', this.getData());
1962
+ }
1963
+ },
1964
+ rawData: function rawData(newVal, oldVal) {
1965
+ if (!isEqual$1(newVal, oldVal)) {
1966
+ this.$emit('data', this.getData());
1967
+ }
1968
+ },
1969
+ aggregations: function aggregations(newVal, oldVal) {
1970
+ if (!isEqual$1(newVal, oldVal)) {
1971
+ this.$emit('data', this.getData());
1972
+ }
1973
+ },
1974
+ aggregationData: function aggregationData(newVal, oldVal) {
1975
+ if (!isEqual$1(newVal, oldVal)) {
1976
+ this.$emit('data', this.getData());
1977
+ }
1978
+ },
1979
+ promotedResults: function promotedResults(newVal, oldVal) {
1980
+ if (!isEqual$1(newVal, oldVal)) {
1981
+ this.$emit('data', this.getData());
1982
+ }
1983
+ },
1984
+ hidden: function hidden(newVal, oldVal) {
1985
+ if (!isEqual$1(newVal, oldVal)) {
1986
+ this.$emit('data', this.getData());
1987
+ }
1988
+ },
1989
+ total: function total(newVal, oldVal) {
1990
+ if (!isEqual$1(newVal, oldVal)) {
1991
+ this.$emit('data', this.getData());
1992
+ }
1993
+ },
1994
+ time: function time(newVal, oldVal) {
1995
+ if (!isEqual$1(newVal, oldVal)) {
1996
+ this.$emit('data', this.getData());
1997
+ }
1998
+ },
1999
+ defaultQuery: function defaultQuery(newVal, oldVal) {
2000
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
2001
+ this.$defaultQuery = newVal(this.selectedValue, this.$props);
2002
+ var query = extractQueryFromCustomQuery(this.$defaultQuery);
2003
+ var queryOptions = getOptionsForCustomQuery(this.$defaultQuery);
2004
+ if (queryOptions) {
2005
+ this.setQueryOptions(this.internalComponent, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
2006
+ } else this.setQueryOptions(this.internalComponent, this.getAggsQuery(), false);
2007
+ // Update default query for RS API
2008
+ index.updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.selectedValue);
2009
+ this.updateQuery({
2010
+ componentId: this.internalComponent,
2011
+ query: query
2012
+ });
2013
+ }
2014
+ },
2015
+ customQuery: function customQuery(newVal, oldVal) {
2016
+ if (newVal && !index.isQueryIdentical(newVal, oldVal, this.selectedValue, this.$props)) {
2017
+ var componentId = this.$props.componentId;
2018
+ this.$customQuery = newVal(this.selectedValue, this.$props);
2019
+ var query = extractQueryFromCustomQuery(this.$customQuery);
2020
+ var queryOptions = getOptionsForCustomQuery(this.$customQuery);
2021
+ if (queryOptions) {
2022
+ this.setQueryOptions(componentId, _rollupPluginBabelHelpers._extends({}, queryOptions, this.getAggsQuery()), false);
2023
+ } else this.setQueryOptions(componentId, this.getAggsQuery(), false);
2024
+
2025
+ // Update custom query for RS API
2026
+ index.updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.selectedValue);
2027
+ this.updateQuery({
2028
+ componentId: componentId,
2029
+ query: query
2030
+ });
2031
+ }
2032
+ }
2033
+ },
2034
+ render: function render() {
2035
+ try {
2036
+ var dom = this.$slots["default"];
2037
+ var error = this.error,
2038
+ isLoading = this.isLoading,
2039
+ selectedValue = this.selectedValue;
2040
+ var propsToBePassed = _rollupPluginBabelHelpers._extends({
2041
+ error: error,
2042
+ loading: isLoading
2043
+ }, this.getData(), {
2044
+ value: selectedValue,
2045
+ setQuery: this.setQuery
2046
+ });
2047
+ return vue.createVNode("div", null, [dom(propsToBePassed)]);
2048
+ } catch (e) {
2049
+ return null;
2050
+ }
2051
+ },
2052
+ methods: {
2053
+ getAggsQuery: function getAggsQuery() {
2054
+ if (this.aggregationField) {
2055
+ return {
2056
+ aggs: getCompositeAggsQuery$1({
2057
+ props: this.$props,
2058
+ showTopHits: true,
2059
+ value: this.selectedValue
2060
+ }).aggs
2061
+ };
2062
+ }
2063
+ return {};
2064
+ },
2065
+ getData: function getData() {
2066
+ var hits = this.hits,
2067
+ aggregations = this.aggregations,
2068
+ aggregationData = this.aggregationData,
2069
+ promotedResults = this.promotedResults,
2070
+ rawData = this.rawData;
2071
+ var filteredResults = parseHits(hits);
2072
+ if (promotedResults.length) {
2073
+ var ids = promotedResults.map(function (item) {
2074
+ return item._id;
2075
+ }).filter(Boolean);
2076
+ if (ids) {
2077
+ filteredResults = filteredResults.filter(function (item) {
2078
+ return !ids.includes(item._id);
2079
+ });
2080
+ }
2081
+ filteredResults = [].concat(promotedResults, filteredResults);
2082
+ }
2083
+ return {
2084
+ data: filteredResults,
2085
+ aggregationData: aggregationData,
2086
+ rawData: rawData,
2087
+ aggregations: aggregations,
2088
+ promotedData: promotedResults,
2089
+ resultStats: this.stats
2090
+ };
2091
+ }
2092
+ },
2093
+ computed: {
2094
+ stats: function stats() {
2095
+ return getResultStats$1(this);
2096
+ }
2097
+ }
2098
+ };
2099
+ ReactiveComponent.hasInternalComponent = function (props) {
2100
+ return !!props.defaultQuery;
2101
+ };
2102
+ var mapStateToProps$1 = function mapStateToProps(state, props) {
2103
+ return {
2104
+ aggregations: state.aggregations[props.componentId] && state.aggregations[props.componentId] || null,
2105
+ aggregationData: state.compositeAggregations[props.componentId] || [],
2106
+ hits: state.hits[props.componentId] && state.hits[props.componentId].hits || [],
2107
+ rawData: state.rawData[props.componentId],
2108
+ error: state.error[props.componentId],
2109
+ isLoading: state.isLoading[props.componentId],
2110
+ selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
2111
+ promotedResults: state.promotedResults[props.componentId] || [],
2112
+ time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
2113
+ total: state.hits[props.componentId] && state.hits[props.componentId].total,
2114
+ hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden,
2115
+ componentProps: state.props[props.componentId]
2116
+ };
2117
+ };
2118
+ var mapDispatchtoProps = {
2119
+ setQueryOptions: setQueryOptions,
2120
+ updateQuery: updateQuery$1,
2121
+ setCustomQuery: setCustomQuery$1,
2122
+ setDefaultQuery: setDefaultQuery$1
2123
+ };
2124
+ var ConnectedComponent = ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchtoProps)(ReactiveComponent), {
2125
+ componentType: constants.componentTypes.reactiveComponent
2126
+ });
2127
+ var RcConnected = PreferencesConsumer.PreferencesConsumer({
2128
+ name: 'RcConnected',
2129
+ render: function render() {
2130
+ var component = ConnectedComponent;
2131
+ switch (this.$attrs.componentType) {
2132
+ case constants.componentTypes.reactiveList:
2133
+ component = ReactiveList.RLConnected;
2134
+ break;
2135
+ case constants.componentTypes.searchBox:
2136
+ component = SBConnected;
2137
+ break;
2138
+ // list components
2139
+ case constants.componentTypes.singleList:
2140
+ component = SingleList.ListConnected;
2141
+ break;
2142
+ case constants.componentTypes.multiList:
2143
+ component = MultiList.ListConnected;
2144
+ break;
2145
+ case constants.componentTypes.singleDropdownList:
2146
+ component = SingleDropdownList.ListConnected;
2147
+ break;
2148
+ case constants.componentTypes.multiDropdownList:
2149
+ component = MultiDropdownList.ListConnected;
2150
+ break;
2151
+ // basic components
2152
+ case constants.componentTypes.toggleButton:
2153
+ component = ToggleButton.TBConnected;
2154
+ break;
2155
+ // range components
2156
+ case constants.componentTypes.dynamicRangeSlider:
2157
+ component = DynamicRangeSlider.RangeConnected;
2158
+ break;
2159
+ case constants.componentTypes.singleRange:
2160
+ component = SingleRange.RangeConnected;
2161
+ break;
2162
+ case constants.componentTypes.multiRange:
2163
+ component = MultiRange.RangeConnected;
2164
+ break;
2165
+ case constants.componentTypes.rangeSlider:
2166
+ component = RangeSlider.RangeConnected;
2167
+ break;
2168
+ case constants.componentTypes.rangeInput:
2169
+ component = RangeInput.RangeConnected;
2170
+ break;
2171
+ }
2172
+ return vue.h(component, null, this.$slots);
2173
+ }
2174
+ });
2175
+ RcConnected.name = ReactiveComponent.name;
2176
+ RcConnected.install = function (Vue) {
2177
+ Vue.component(RcConnected.name, RcConnected);
2178
+ };
2179
+
2180
+ // Add componentType for SSR
2181
+ RcConnected.componentType = constants.componentTypes.reactiveComponent;
2182
+
2183
+ exports.ReactiveComponent = RcConnected;
2184
+ exports.SearchBox = SBConnected;