@appbaseio/reactivesearch-vue 1.33.2 → 1.33.4

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 (47) hide show
  1. package/dist/@appbaseio/reactivesearch-vue.umd.js +1091 -487
  2. package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
  3. package/dist/@appbaseio/reactivesearch-vue.umd.min.js +7 -7
  4. package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
  5. package/dist/cjs/{ComponentWrapper-9318cece.js → ComponentWrapper-b6d4660c.js} +13 -4
  6. package/dist/cjs/{DataSearch-99a6a2e8.js → DataSearch-2b5740ea.js} +11 -7
  7. package/dist/cjs/DataSearch.js +2 -2
  8. package/dist/cjs/MultiDropdownList.js +1 -1
  9. package/dist/cjs/MultiList.js +1 -1
  10. package/dist/cjs/MultiRange.js +8 -2
  11. package/dist/cjs/RangeInput.js +1 -1
  12. package/dist/cjs/RangeSlider.js +1 -1
  13. package/dist/cjs/ReactiveBase.js +35 -2
  14. package/dist/cjs/{ReactiveComponent-805201c6.js → ReactiveComponent-fd8d7403.js} +2 -2
  15. package/dist/cjs/ReactiveComponent.js +3 -3
  16. package/dist/cjs/ReactiveGoogleMap.js +1 -1
  17. package/dist/cjs/ReactiveList.js +1 -1
  18. package/dist/cjs/SingleDropdownList.js +1 -1
  19. package/dist/cjs/SingleList.js +1 -1
  20. package/dist/cjs/SingleRange.js +1 -1
  21. package/dist/cjs/StateProvider.js +22 -6
  22. package/dist/cjs/ToggleButton.js +1 -1
  23. package/dist/cjs/index.js +4 -4
  24. package/dist/cjs/install.js +4 -4
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/es/{ComponentWrapper-240450cc.js → ComponentWrapper-8042aa35.js} +13 -4
  27. package/dist/es/{DataSearch-20f0d8f1.js → DataSearch-68d2a78c.js} +11 -7
  28. package/dist/es/DataSearch.js +2 -2
  29. package/dist/es/MultiDropdownList.js +1 -1
  30. package/dist/es/MultiList.js +1 -1
  31. package/dist/es/MultiRange.js +8 -2
  32. package/dist/es/RangeInput.js +1 -1
  33. package/dist/es/RangeSlider.js +1 -1
  34. package/dist/es/ReactiveBase.js +35 -2
  35. package/dist/es/{ReactiveComponent-dd85aa9c.js → ReactiveComponent-62fa87e0.js} +2 -2
  36. package/dist/es/ReactiveComponent.js +3 -3
  37. package/dist/es/ReactiveGoogleMap.js +1 -1
  38. package/dist/es/ReactiveList.js +1 -1
  39. package/dist/es/SingleDropdownList.js +1 -1
  40. package/dist/es/SingleList.js +1 -1
  41. package/dist/es/SingleRange.js +1 -1
  42. package/dist/es/StateProvider.js +23 -7
  43. package/dist/es/ToggleButton.js +1 -1
  44. package/dist/es/index.js +4 -4
  45. package/dist/es/install.js +4 -4
  46. package/dist/es/version.js +1 -1
  47. package/package.json +3 -2
@@ -731,6 +731,7 @@
731
731
  var ADD_CONFIG = exports.ADD_CONFIG = 'ADD_CONFIG';
732
732
  var UPDATE_CONFIG = exports.UPDATE_CONFIG = 'UPDATE_CONFIG';
733
733
  var ADD_APPBASE_REF = exports.ADD_APPBASE_REF = 'ADD_APPBASE_REF';
734
+ var ADD_ANALYTICS_REF = exports.ADD_ANALYTICS_REF = 'ADD_ANALYTICS_REF';
734
735
  var LOG_QUERY = exports.LOG_QUERY = 'LOG_QUERY';
735
736
  var LOG_COMBINED_QUERY = exports.LOG_COMBINED_QUERY = 'LOG_COMBINED_QUERY';
736
737
  var SET_INTERNAL_VALUE = exports.SET_INTERNAL_VALUE = 'SET_INTERNAL_VALUE';
@@ -770,6 +771,8 @@
770
771
  var SET_GOOGLE_MAP_SCRIPT_LOADING = exports.SET_GOOGLE_MAP_SCRIPT_LOADING = 'SET_GOOGLE_MAP_SCRIPT_LOADING';
771
772
  var SET_GOOGLE_MAP_SCRIPT_LOADED = exports.SET_GOOGLE_MAP_SCRIPT_LOADED = 'SET_GOOGLE_MAP_SCRIPT_LOADED';
772
773
  var SET_GOOGLE_MAP_SCRIPT_ERROR = exports.SET_GOOGLE_MAP_SCRIPT_ERROR = 'SET_GOOGLE_MAP_SCRIPT_ERROR';
774
+ var SET_REGISTERED_COMPONENT_TIMESTAMP = exports.SET_REGISTERED_COMPONENT_TIMESTAMP = 'SET_REGISTERED_COMPONENT_TIMESTAMP';
775
+ var REMOVE_REGISTERED_COMPONENT_TIMESTAMP = exports.REMOVE_REGISTERED_COMPONENT_TIMESTAMP = 'REMOVE_REGISTERED_COMPONENT_TIMESTAMP';
773
776
  });
774
777
  unwrapExports(constants);
775
778
  var constants_1 = constants.ADD_COMPONENT;
@@ -785,45 +788,48 @@
785
788
  var constants_11 = constants.ADD_CONFIG;
786
789
  var constants_12 = constants.UPDATE_CONFIG;
787
790
  var constants_13 = constants.ADD_APPBASE_REF;
788
- var constants_14 = constants.LOG_QUERY;
789
- var constants_15 = constants.LOG_COMBINED_QUERY;
790
- var constants_16 = constants.SET_INTERNAL_VALUE;
791
- var constants_17 = constants.PATCH_VALUE;
792
- var constants_18 = constants.CLEAR_VALUES;
793
- var constants_19 = constants.SET_LOADING;
794
- var constants_20 = constants.SET_ERROR;
795
- var constants_21 = constants.SET_TIMESTAMP;
796
- var constants_22 = constants.SET_HEADERS;
797
- var constants_23 = constants.SET_MAP_DATA;
798
- var constants_24 = constants.SET_MAP_RESULTS;
799
- var constants_25 = constants.SET_QUERY_LISTENER;
800
- var constants_26 = constants.STORE_KEY;
801
- var constants_27 = constants.SET_SEARCH_ID;
802
- var constants_28 = constants.SET_PROMOTED_RESULTS;
803
- var constants_29 = constants.SET_DEFAULT_QUERY;
804
- var constants_30 = constants.SET_CUSTOM_QUERY;
805
- var constants_31 = constants.SET_CUSTOM_HIGHLIGHT_OPTIONS;
806
- var constants_32 = constants.SET_CUSTOM_DATA;
807
- var constants_33 = constants.SET_APPLIED_SETTINGS;
808
- var constants_34 = constants.SET_PROPS;
809
- var constants_35 = constants.UPDATE_PROPS;
810
- var constants_36 = constants.REMOVE_PROPS;
811
- var constants_37 = constants.SET_SUGGESTIONS_SEARCH_VALUE;
812
- var constants_38 = constants.CLEAR_SUGGESTIONS_SEARCH_VALUE;
813
- var constants_39 = constants.SET_SUGGESTIONS_SEARCH_ID;
814
- var constants_40 = constants.UPDATE_ANALYTICS_CONFIG;
815
- var constants_41 = constants.SET_RAW_DATA;
816
- var constants_42 = constants.SET_POPULAR_SUGGESTIONS;
817
- var constants_43 = constants.SET_DEFAULT_POPULAR_SUGGESTIONS;
818
- var constants_44 = constants.SET_QUERY_TO_HITS;
819
- var constants_45 = constants.RECENT_SEARCHES_SUCCESS;
820
- var constants_46 = constants.RECENT_SEARCHES_ERROR;
821
- var constants_47 = constants.SET_VALUE;
822
- var constants_48 = constants.SET_VALUES;
823
- var constants_49 = constants.RESET_TO_DEFAULT;
824
- var constants_50 = constants.SET_GOOGLE_MAP_SCRIPT_LOADING;
825
- var constants_51 = constants.SET_GOOGLE_MAP_SCRIPT_LOADED;
826
- var constants_52 = constants.SET_GOOGLE_MAP_SCRIPT_ERROR;
791
+ var constants_14 = constants.ADD_ANALYTICS_REF;
792
+ var constants_15 = constants.LOG_QUERY;
793
+ var constants_16 = constants.LOG_COMBINED_QUERY;
794
+ var constants_17 = constants.SET_INTERNAL_VALUE;
795
+ var constants_18 = constants.PATCH_VALUE;
796
+ var constants_19 = constants.CLEAR_VALUES;
797
+ var constants_20 = constants.SET_LOADING;
798
+ var constants_21 = constants.SET_ERROR;
799
+ var constants_22 = constants.SET_TIMESTAMP;
800
+ var constants_23 = constants.SET_HEADERS;
801
+ var constants_24 = constants.SET_MAP_DATA;
802
+ var constants_25 = constants.SET_MAP_RESULTS;
803
+ var constants_26 = constants.SET_QUERY_LISTENER;
804
+ var constants_27 = constants.STORE_KEY;
805
+ var constants_28 = constants.SET_SEARCH_ID;
806
+ var constants_29 = constants.SET_PROMOTED_RESULTS;
807
+ var constants_30 = constants.SET_DEFAULT_QUERY;
808
+ var constants_31 = constants.SET_CUSTOM_QUERY;
809
+ var constants_32 = constants.SET_CUSTOM_HIGHLIGHT_OPTIONS;
810
+ var constants_33 = constants.SET_CUSTOM_DATA;
811
+ var constants_34 = constants.SET_APPLIED_SETTINGS;
812
+ var constants_35 = constants.SET_PROPS;
813
+ var constants_36 = constants.UPDATE_PROPS;
814
+ var constants_37 = constants.REMOVE_PROPS;
815
+ var constants_38 = constants.SET_SUGGESTIONS_SEARCH_VALUE;
816
+ var constants_39 = constants.CLEAR_SUGGESTIONS_SEARCH_VALUE;
817
+ var constants_40 = constants.SET_SUGGESTIONS_SEARCH_ID;
818
+ var constants_41 = constants.UPDATE_ANALYTICS_CONFIG;
819
+ var constants_42 = constants.SET_RAW_DATA;
820
+ var constants_43 = constants.SET_POPULAR_SUGGESTIONS;
821
+ var constants_44 = constants.SET_DEFAULT_POPULAR_SUGGESTIONS;
822
+ var constants_45 = constants.SET_QUERY_TO_HITS;
823
+ var constants_46 = constants.RECENT_SEARCHES_SUCCESS;
824
+ var constants_47 = constants.RECENT_SEARCHES_ERROR;
825
+ var constants_48 = constants.SET_VALUE;
826
+ var constants_49 = constants.SET_VALUES;
827
+ var constants_50 = constants.RESET_TO_DEFAULT;
828
+ var constants_51 = constants.SET_GOOGLE_MAP_SCRIPT_LOADING;
829
+ var constants_52 = constants.SET_GOOGLE_MAP_SCRIPT_LOADED;
830
+ var constants_53 = constants.SET_GOOGLE_MAP_SCRIPT_ERROR;
831
+ var constants_54 = constants.SET_REGISTERED_COMPONENT_TIMESTAMP;
832
+ var constants_55 = constants.REMOVE_REGISTERED_COMPONENT_TIMESTAMP;
827
833
 
828
834
  var componentsReducer_1 = createCommonjsModule(function (module, exports) {
829
835
  Object.defineProperty(exports, "__esModule", {
@@ -1167,6 +1173,7 @@
1167
1173
  SELECT: 'select',
1168
1174
  TAG: 'tag'
1169
1175
  };
1176
+ var TREELIST_VALUES_PATH_SEPARATOR = exports.TREELIST_VALUES_PATH_SEPARATOR = '◐◑◒◓';
1170
1177
  });
1171
1178
  unwrapExports(constants$1);
1172
1179
  var constants_1$1 = constants$1.componentTypes;
@@ -1174,6 +1181,7 @@
1174
1181
  var constants_3$1 = constants$1.validProps;
1175
1182
  var constants_4$1 = constants$1.CLEAR_ALL;
1176
1183
  var constants_5$1 = constants$1.SEARCH_COMPONENTS_MODES;
1184
+ var constants_6$1 = constants$1.TREELIST_VALUES_PATH_SEPARATOR;
1177
1185
 
1178
1186
  var analytics = createCommonjsModule(function (module, exports) {
1179
1187
  Object.defineProperty(exports, "__esModule", {
@@ -1595,9 +1603,12 @@
1595
1603
  if (componentKeys.length) {
1596
1604
  var _newState = {};
1597
1605
  componentKeys.forEach(function (component) {
1606
+ var _action$componentsVal = action.componentsValues[component],
1607
+ value = _action$componentsVal.value,
1608
+ rest = _objectWithoutProperties(_action$componentsVal, ['value']);
1598
1609
  _newState[component] = _extends({}, state[component], {
1599
- value: action.componentsValues[component]
1600
- });
1610
+ value: value
1611
+ }, rest);
1601
1612
  });
1602
1613
  return _extends({}, state, _newState);
1603
1614
  }
@@ -2858,6 +2869,75 @@
2858
2869
  });
2859
2870
  unwrapExports(googleMapScriptReducer_1);
2860
2871
 
2872
+ var analyticsRefReducer_1 = createCommonjsModule(function (module, exports) {
2873
+ Object.defineProperty(exports, "__esModule", {
2874
+ value: true
2875
+ });
2876
+ exports["default"] = analyticsRefReducer;
2877
+ function analyticsRefReducer() {
2878
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2879
+ var action = arguments[1];
2880
+ if (action.type === constants.ADD_ANALYTICS_REF) {
2881
+ return action.analyticsRef;
2882
+ }
2883
+ return state;
2884
+ }
2885
+ });
2886
+ unwrapExports(analyticsRefReducer_1);
2887
+
2888
+ var registeredComponentReducer = createCommonjsModule(function (module, exports) {
2889
+ Object.defineProperty(exports, "__esModule", {
2890
+ value: true
2891
+ });
2892
+ var _extends = Object.assign || function (target) {
2893
+ for (var i = 1; i < arguments.length; i++) {
2894
+ var source = arguments[i];
2895
+ for (var key in source) {
2896
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
2897
+ target[key] = source[key];
2898
+ }
2899
+ }
2900
+ }
2901
+ return target;
2902
+ };
2903
+ exports["default"] = timestampReducer;
2904
+ function _objectWithoutProperties(obj, keys) {
2905
+ var target = {};
2906
+ for (var i in obj) {
2907
+ if (keys.indexOf(i) >= 0) continue;
2908
+ if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
2909
+ target[i] = obj[i];
2910
+ }
2911
+ return target;
2912
+ }
2913
+ function _defineProperty(obj, key, value) {
2914
+ if (key in obj) {
2915
+ Object.defineProperty(obj, key, {
2916
+ value: value,
2917
+ enumerable: true,
2918
+ configurable: true,
2919
+ writable: true
2920
+ });
2921
+ } else {
2922
+ obj[key] = value;
2923
+ }
2924
+ return obj;
2925
+ }
2926
+ function timestampReducer() {
2927
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2928
+ var action = arguments[1];
2929
+ if (action.type === constants.SET_REGISTERED_COMPONENT_TIMESTAMP) {
2930
+ return _extends({}, state, _defineProperty({}, action.component, action.timestamp));
2931
+ } else if (action.type === constants.REMOVE_REGISTERED_COMPONENT_TIMESTAMP) {
2932
+ var del = state[action.component],
2933
+ obj = _objectWithoutProperties(state, [action.component]);
2934
+ return obj;
2935
+ }
2936
+ return state;
2937
+ }
2938
+ });
2939
+ unwrapExports(registeredComponentReducer);
2940
+
2861
2941
  var reducers = createCommonjsModule(function (module, exports) {
2862
2942
  Object.defineProperty(exports, "__esModule", {
2863
2943
  value: true
@@ -2897,6 +2977,8 @@
2897
2977
  var _queryToHitsReducer2 = _interopRequireDefault(queryToHitsReducer_1);
2898
2978
  var _recentSearches2 = _interopRequireDefault(recentSearches);
2899
2979
  var _googleMapScriptReducer2 = _interopRequireDefault(googleMapScriptReducer_1);
2980
+ var _analyticsRefReducer2 = _interopRequireDefault(analyticsRefReducer_1);
2981
+ var _registeredComponentReducer2 = _interopRequireDefault(registeredComponentReducer);
2900
2982
  function _interopRequireDefault(obj) {
2901
2983
  return obj && obj.__esModule ? obj : {
2902
2984
  "default": obj
@@ -2913,6 +2995,7 @@
2913
2995
  queryOptions: _queryOptionsReducer2["default"],
2914
2996
  dependencyTree: _dependencyTreeReducer2["default"],
2915
2997
  appbaseRef: _appbaseRefReducer2["default"],
2998
+ analyticsRef: _analyticsRefReducer2["default"],
2916
2999
  config: _configReducer2["default"],
2917
3000
  hits: _hitsReducer2["default"],
2918
3001
  promotedResults: _promotedResultsReducer2["default"],
@@ -2941,7 +3024,8 @@
2941
3024
  return state;
2942
3025
  },
2943
3026
  googleMapScriptStatus: _googleMapScriptReducer2["default"],
2944
- lastUsedAppbaseQuery: _appbaseQueryReducer2["default"]
3027
+ lastUsedAppbaseQuery: _appbaseQueryReducer2["default"],
3028
+ registeredComponentsTimestamps: _registeredComponentReducer2["default"]
2945
3029
  });
2946
3030
  });
2947
3031
  unwrapExports(reducers);
@@ -5274,12 +5358,13 @@
5274
5358
  return isFunction(children) || isFunction(render);
5275
5359
  };
5276
5360
  var recLookup = exports.recLookup = function recLookup(obj, path) {
5361
+ var separator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
5277
5362
  try {
5278
- var parts = path.split('.');
5363
+ var parts = path.split(separator);
5279
5364
  if (parts.length === 1) {
5280
5365
  return obj[parts[0]];
5281
5366
  }
5282
- return recLookup(obj[parts[0]], parts.slice(1).join('.'));
5367
+ return recLookup(obj[parts[0]], parts.slice(1).join(separator), separator);
5283
5368
  } catch (e) {
5284
5369
  return false;
5285
5370
  }
@@ -5450,319 +5535,6 @@
5450
5535
  var helper_46 = helper.isValidDateRangeQueryFormat;
5451
5536
  var helper_47 = helper.setDeep;
5452
5537
 
5453
- var hits = createCommonjsModule(function (module, exports) {
5454
- Object.defineProperty(exports, "__esModule", {
5455
- value: true
5456
- });
5457
- exports.updateAggs = updateAggs;
5458
- exports.updateCompositeAggs = updateCompositeAggs;
5459
- exports.updateHits = updateHits;
5460
- exports.saveQueryToHits = saveQueryToHits;
5461
- exports.mockDataForTesting = mockDataForTesting;
5462
- function updateAggs(component, aggregations) {
5463
- var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
5464
- return {
5465
- type: constants.UPDATE_AGGS,
5466
- component: component,
5467
- aggregations: aggregations,
5468
- append: append
5469
- };
5470
- }
5471
- function updateCompositeAggs(component, aggregations) {
5472
- var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
5473
- return {
5474
- type: constants.UPDATE_COMPOSITE_AGGS,
5475
- component: component,
5476
- aggregations: aggregations,
5477
- append: append
5478
- };
5479
- }
5480
- function updateHits(component, hits, time, hidden) {
5481
- var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
5482
- return {
5483
- type: constants.UPDATE_HITS,
5484
- component: component,
5485
- hits: hits.hits,
5486
- total: typeof hits.total === 'object' ? hits.total.value : hits.total,
5487
- hidden: hidden,
5488
- time: time,
5489
- append: append
5490
- };
5491
- }
5492
- function saveQueryToHits(component, query) {
5493
- return {
5494
- type: constants.SET_QUERY_TO_HITS,
5495
- component: component,
5496
- query: query
5497
- };
5498
- }
5499
- function mockDataForTesting(component, data) {
5500
- return function (dispatch) {
5501
- if (data.hasOwnProperty('error')) {
5502
- dispatch((0, misc.setError)(component, data.error));
5503
- }
5504
- if (data.hasOwnProperty('aggregations')) {
5505
- dispatch(updateAggs(component, data.aggregations));
5506
- }
5507
- if (data.hasOwnProperty('hits')) {
5508
- dispatch(updateHits(component, data, data.time || undefined));
5509
- }
5510
- };
5511
- }
5512
- });
5513
- unwrapExports(hits);
5514
- var hits_1 = hits.updateAggs;
5515
- var hits_2 = hits.updateCompositeAggs;
5516
- var hits_3 = hits.updateHits;
5517
- var hits_4 = hits.saveQueryToHits;
5518
- var hits_5 = hits.mockDataForTesting;
5519
-
5520
- var misc = createCommonjsModule(function (module, exports) {
5521
- Object.defineProperty(exports, "__esModule", {
5522
- value: true
5523
- });
5524
- exports.setRawData = setRawData;
5525
- exports.setLoading = setLoading;
5526
- exports.setError = setError;
5527
- exports.setTimestamp = setTimestamp;
5528
- exports.setSearchId = setSearchId;
5529
- exports.setSuggestionsSearchId = setSuggestionsSearchId;
5530
- exports.setQuery = setQuery;
5531
- exports.setCustomQuery = setCustomQuery;
5532
- exports.setDefaultQuery = setDefaultQuery;
5533
- exports.setCustomHighlightOptions = setCustomHighlightOptions;
5534
- exports.updateQueryOptions = updateQueryOptions;
5535
- exports.logQuery = logQuery;
5536
- exports.logCombinedQuery = logCombinedQuery;
5537
- exports.setHeaders = setHeaders;
5538
- exports.setPromotedResults = setPromotedResults;
5539
- exports.setPopularSuggestions = setPopularSuggestions;
5540
- exports.setDefaultPopularSuggestions = setDefaultPopularSuggestions;
5541
- exports.setCustomData = setCustomData;
5542
- exports.setAppliedSettings = setAppliedSettings;
5543
- exports.setQueryListener = setQueryListener;
5544
- exports.setGoogleMapScriptLoading = setGoogleMapScriptLoading;
5545
- exports.setGoogleMapScriptLoaded = setGoogleMapScriptLoaded;
5546
- exports.setGoogleMapScriptError = setGoogleMapScriptError;
5547
- exports.resetStoreForComponent = resetStoreForComponent;
5548
- exports.setLastUsedAppbaseQuery = setLastUsedAppbaseQuery;
5549
- function setRawData(component, response) {
5550
- return {
5551
- type: constants.SET_RAW_DATA,
5552
- component: component,
5553
- response: response
5554
- };
5555
- }
5556
- function setLoading(component, isLoading) {
5557
- return {
5558
- type: constants.SET_LOADING,
5559
- component: component,
5560
- isLoading: isLoading
5561
- };
5562
- }
5563
- function setError(component, error) {
5564
- return {
5565
- type: constants.SET_ERROR,
5566
- component: component,
5567
- error: error
5568
- };
5569
- }
5570
- function setTimestamp(component, timestamp) {
5571
- return {
5572
- type: constants.SET_TIMESTAMP,
5573
- component: component,
5574
- timestamp: timestamp
5575
- };
5576
- }
5577
- function setSearchId() {
5578
- var searchId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5579
- return {
5580
- type: constants.SET_SEARCH_ID,
5581
- searchId: searchId
5582
- };
5583
- }
5584
- function setSuggestionsSearchId() {
5585
- var searchId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5586
- return {
5587
- type: constants.SET_SUGGESTIONS_SEARCH_ID,
5588
- searchId: searchId
5589
- };
5590
- }
5591
- function setQuery(component, query) {
5592
- return {
5593
- type: constants.SET_QUERY,
5594
- component: component,
5595
- query: query
5596
- };
5597
- }
5598
- function setCustomQuery(component, query) {
5599
- return {
5600
- type: constants.SET_CUSTOM_QUERY,
5601
- component: component,
5602
- query: query
5603
- };
5604
- }
5605
- function setDefaultQuery(component, query) {
5606
- return {
5607
- type: constants.SET_DEFAULT_QUERY,
5608
- component: component,
5609
- query: query
5610
- };
5611
- }
5612
- function setCustomHighlightOptions(component, data) {
5613
- return {
5614
- type: constants.SET_CUSTOM_HIGHLIGHT_OPTIONS,
5615
- component: component,
5616
- data: data
5617
- };
5618
- }
5619
- function updateQueryOptions(component, options) {
5620
- return {
5621
- type: constants.SET_QUERY_OPTIONS,
5622
- component: component,
5623
- options: options
5624
- };
5625
- }
5626
- function logQuery(component, query) {
5627
- return {
5628
- type: constants.LOG_QUERY,
5629
- component: component,
5630
- query: query
5631
- };
5632
- }
5633
- function logCombinedQuery(component, query) {
5634
- return {
5635
- type: constants.LOG_COMBINED_QUERY,
5636
- component: component,
5637
- query: query
5638
- };
5639
- }
5640
- function setHeaders(headers) {
5641
- return {
5642
- type: constants.SET_HEADERS,
5643
- headers: headers
5644
- };
5645
- }
5646
- function setPromotedResults() {
5647
- var results = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5648
- var component = arguments[1];
5649
- return {
5650
- type: constants.SET_PROMOTED_RESULTS,
5651
- results: results,
5652
- component: component
5653
- };
5654
- }
5655
- function setPopularSuggestions() {
5656
- var suggestions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5657
- var component = arguments[1];
5658
- return {
5659
- type: constants.SET_POPULAR_SUGGESTIONS,
5660
- suggestions: suggestions,
5661
- component: component
5662
- };
5663
- }
5664
- function setDefaultPopularSuggestions() {
5665
- var suggestions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5666
- var component = arguments[1];
5667
- return {
5668
- type: constants.SET_DEFAULT_POPULAR_SUGGESTIONS,
5669
- suggestions: suggestions,
5670
- component: component
5671
- };
5672
- }
5673
- function setCustomData() {
5674
- var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5675
- var component = arguments[1];
5676
- return {
5677
- type: constants.SET_CUSTOM_DATA,
5678
- data: data,
5679
- component: component
5680
- };
5681
- }
5682
- function setAppliedSettings() {
5683
- var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5684
- var component = arguments[1];
5685
- return {
5686
- type: constants.SET_APPLIED_SETTINGS,
5687
- data: data,
5688
- component: component
5689
- };
5690
- }
5691
- function setQueryListener(component, onQueryChange, onError) {
5692
- return {
5693
- type: constants.SET_QUERY_LISTENER,
5694
- component: component,
5695
- onQueryChange: onQueryChange,
5696
- onError: onError
5697
- };
5698
- }
5699
- function setGoogleMapScriptLoading(bool) {
5700
- return {
5701
- type: constants.SET_GOOGLE_MAP_SCRIPT_LOADING,
5702
- loading: bool
5703
- };
5704
- }
5705
- function setGoogleMapScriptLoaded(bool) {
5706
- return {
5707
- type: constants.SET_GOOGLE_MAP_SCRIPT_LOADED,
5708
- loaded: bool
5709
- };
5710
- }
5711
- function setGoogleMapScriptError(error) {
5712
- return {
5713
- type: constants.SET_GOOGLE_MAP_SCRIPT_ERROR,
5714
- error: error
5715
- };
5716
- }
5717
- function resetStoreForComponent(componentId) {
5718
- return function (dispatch) {
5719
- dispatch(setRawData(componentId, null));
5720
- dispatch(setCustomData(null, componentId));
5721
- dispatch(setPromotedResults([], componentId));
5722
- dispatch(setPopularSuggestions([], componentId));
5723
- dispatch(setDefaultPopularSuggestions([], componentId));
5724
- dispatch((0, hits.updateAggs)(componentId, null));
5725
- dispatch((0, hits.updateCompositeAggs)(componentId, {}));
5726
- dispatch((0, hits.updateHits)(componentId, {
5727
- hits: [],
5728
- total: 0
5729
- }, 0));
5730
- };
5731
- }
5732
- function setLastUsedAppbaseQuery(query) {
5733
- return {
5734
- type: constants.SET_APPBASE_QUERY,
5735
- query: query
5736
- };
5737
- }
5738
- });
5739
- unwrapExports(misc);
5740
- var misc_1 = misc.setRawData;
5741
- var misc_2 = misc.setLoading;
5742
- var misc_3 = misc.setError;
5743
- var misc_4 = misc.setTimestamp;
5744
- var misc_5 = misc.setSearchId;
5745
- var misc_6 = misc.setSuggestionsSearchId;
5746
- var misc_7 = misc.setQuery;
5747
- var misc_8 = misc.setCustomQuery;
5748
- var misc_9 = misc.setDefaultQuery;
5749
- var misc_10 = misc.setCustomHighlightOptions;
5750
- var misc_11 = misc.updateQueryOptions;
5751
- var misc_12 = misc.logQuery;
5752
- var misc_13 = misc.logCombinedQuery;
5753
- var misc_14 = misc.setHeaders;
5754
- var misc_15 = misc.setPromotedResults;
5755
- var misc_16 = misc.setPopularSuggestions;
5756
- var misc_17 = misc.setDefaultPopularSuggestions;
5757
- var misc_18 = misc.setCustomData;
5758
- var misc_19 = misc.setAppliedSettings;
5759
- var misc_20 = misc.setQueryListener;
5760
- var misc_21 = misc.setGoogleMapScriptLoading;
5761
- var misc_22 = misc.setGoogleMapScriptLoaded;
5762
- var misc_23 = misc.setGoogleMapScriptError;
5763
- var misc_24 = misc.resetStoreForComponent;
5764
- var misc_25 = misc.setLastUsedAppbaseQuery;
5765
-
5766
5538
  var xdate = createCommonjsModule(function (module) {
5767
5539
  /**
5768
5540
  * @preserve XDate v@VERSION
@@ -6464,7 +6236,7 @@
6464
6236
  Object.defineProperty(exports, "__esModule", {
6465
6237
  value: true
6466
6238
  });
6467
- exports.getDependentQueries = exports.extractPropsFromState = exports.getValidInterval = exports.getRSQuery = exports.hasPaginationSupport = exports.isComponentUsesLabelAsValue = exports.isSearchComponent = exports.isDRSRangeComponent = exports.getHistogramComponentID = exports.getInternalComponentID = exports.isInternalComponent = exports.getNormalizedField = exports.componentToTypeMap = undefined;
6239
+ exports.transformValueToComponentStateFormat = exports.getDependentQueries = exports.extractPropsFromState = exports.getValidInterval = exports.getRSQuery = exports.hasPaginationSupport = exports.isComponentUsesLabelAsValue = exports.isSearchComponent = exports.isDRSRangeComponent = exports.getHistogramComponentID = exports.getInternalComponentID = exports.isInternalComponent = exports.getNormalizedField = exports.componentToTypeMap = undefined;
6468
6240
  var _extends = Object.assign || function (target) {
6469
6241
  for (var i = 1; i < arguments.length; i++) {
6470
6242
  var source = arguments[i];
@@ -6717,20 +6489,26 @@
6717
6489
  }
6718
6490
  }
6719
6491
  if (dateRangeComponents.includes(componentProps.componentType)) {
6720
- queryFormat = 'or';
6721
6492
  if (value) {
6722
- if (typeof value === 'string') {
6723
- value = {
6724
- start: (0, helper.formatDate)(new _xdate2["default"](value).addHours(-24), componentProps),
6725
- end: (0, helper.formatDate)(new _xdate2["default"](value), componentProps)
6726
- };
6727
- } else if (Array.isArray(value)) {
6728
- value = value.map(function (val) {
6729
- return {
6730
- start: (0, helper.formatDate)(new _xdate2["default"](val).addHours(-24), componentProps),
6731
- end: (0, helper.formatDate)(new _xdate2["default"](val), componentProps)
6493
+ if ((0, helper.isValidDateRangeQueryFormat)(componentProps.queryFormat)) {
6494
+ if (typeof value === 'string') {
6495
+ value = {
6496
+ start: (0, helper.formatDate)(new _xdate2["default"](value).addHours(-24), componentProps),
6497
+ end: (0, helper.formatDate)(new _xdate2["default"](value), componentProps)
6732
6498
  };
6733
- });
6499
+ } else if (Array.isArray(value)) {
6500
+ value = value.map(function (val) {
6501
+ return {
6502
+ start: (0, helper.formatDate)(new _xdate2["default"](val).addHours(-24), componentProps),
6503
+ end: (0, helper.formatDate)(new _xdate2["default"](val), componentProps)
6504
+ };
6505
+ });
6506
+ } else {
6507
+ value = {
6508
+ start: (0, helper.formatDate)(new _xdate2["default"](value.start).addHours(-24), componentProps),
6509
+ end: (0, helper.formatDate)(new _xdate2["default"](value.end), componentProps)
6510
+ };
6511
+ }
6734
6512
  }
6735
6513
  }
6736
6514
  }
@@ -6888,13 +6666,19 @@
6888
6666
  execute = true;
6889
6667
  }
6890
6668
  var componentProps = store.props[component];
6891
- var dependentQuery = getRSQuery(component, extractPropsFromState(store, component, _extends({}, componentProps && componentProps.componentType === constants$1.componentTypes.searchBox ? _extends({}, execute === false ? {
6669
+ var dependentQuery = getRSQuery(component, extractPropsFromState(store, component, _extends({}, componentProps && _extends({}, componentProps.componentType === constants$1.componentTypes.searchBox ? _extends({}, execute === false ? {
6892
6670
  type: constants$1.queryTypes.search
6893
6671
  } : {}, calcValues.category ? {
6894
6672
  categoryValue: calcValues.category
6895
- } : {}, calcValues.value ? {
6673
+ } : {
6674
+ categoryValue: undefined
6675
+ }, calcValues.value ? {
6896
6676
  value: calcValues.value
6897
- } : {}) : {})), execute);
6677
+ } : {}) : {}, componentProps.componentType === constants$1.componentTypes.categorySearch ? _extends({}, calcValues.category ? {
6678
+ categoryValue: calcValues.category
6679
+ } : {
6680
+ categoryValue: undefined
6681
+ }) : {}))), execute);
6898
6682
  if (dependentQuery) {
6899
6683
  finalQuery[component] = dependentQuery;
6900
6684
  }
@@ -6903,22 +6687,527 @@
6903
6687
  });
6904
6688
  return finalQuery;
6905
6689
  };
6690
+ var transformValueToComponentStateFormat = exports.transformValueToComponentStateFormat = function transformValueToComponentStateFormat(value, componentProps) {
6691
+ var componentType = componentProps.componentType,
6692
+ data = componentProps.data,
6693
+ queryFormat = componentProps.queryFormat;
6694
+ var transformedValue = value;
6695
+ var meta = {};
6696
+ if (value) {
6697
+ switch (componentType) {
6698
+ case constants$1.componentTypes.singleDataList:
6699
+ case constants$1.componentTypes.tabDataList:
6700
+ transformedValue = '';
6701
+ if (Array.isArray(value) && typeof value[0] === 'string') {
6702
+ transformedValue = value[0];
6703
+ } else if (typeof value === 'object' && value.label) {
6704
+ transformedValue = value.label;
6705
+ } else {
6706
+ transformedValue = value;
6707
+ }
6708
+ break;
6709
+ case constants$1.componentTypes.multiDataList:
6710
+ transformedValue = [];
6711
+ if (Array.isArray(value)) {
6712
+ value.forEach(function (valObj) {
6713
+ if (typeof valObj === 'object' && (valObj.label || valObj.value)) {
6714
+ transformedValue.push(valObj.label || valObj.value);
6715
+ } else if (typeof valObj === 'string') {
6716
+ transformedValue.push(valObj);
6717
+ }
6718
+ });
6719
+ }
6720
+ break;
6721
+ case constants$1.componentTypes.toggleButton:
6722
+ transformedValue = [];
6723
+ if (Array.isArray(value)) {
6724
+ value.forEach(function (valObj) {
6725
+ if (typeof valObj === 'object' && valObj.label && valObj.value) {
6726
+ transformedValue.push(valObj);
6727
+ } else if (typeof valObj === 'string') {
6728
+ var findDataObj = data.find(function (item) {
6729
+ return item.label.trim() === valObj.trim() || item.value.trim() === valObj.trim();
6730
+ });
6731
+ transformedValue.push(findDataObj);
6732
+ }
6733
+ });
6734
+ } else if (typeof value === 'object' && value.label && value.value) {
6735
+ transformedValue = value.value;
6736
+ } else if (typeof value === 'string') {
6737
+ var findDataObj = data.find(function (item) {
6738
+ return item.label.trim() === value.trim() || item.value.trim() === value.trim();
6739
+ });
6740
+ transformedValue = findDataObj.value;
6741
+ }
6742
+ break;
6743
+ case constants$1.componentTypes.singleRange:
6744
+ case constants$1.componentTypes.singleDropdownRange:
6745
+ transformedValue = {};
6746
+ if (!Array.isArray(value) && typeof value === 'object') {
6747
+ transformedValue = _extends({}, value);
6748
+ } else if (typeof value === 'string') {
6749
+ var _findDataObj = data.find(function (item) {
6750
+ return item.label.trim() === value.trim();
6751
+ });
6752
+ transformedValue = _extends({}, _findDataObj);
6753
+ }
6754
+ break;
6755
+ case constants$1.componentTypes.multiDropdownRange:
6756
+ case constants$1.componentTypes.multiRange:
6757
+ transformedValue = [];
6758
+ if (Array.isArray(value)) {
6759
+ value.forEach(function (valObj) {
6760
+ if (typeof valObj === 'object' && typeof valObj.start === 'number' && typeof valObj.end === 'number') {
6761
+ var _findDataObj2 = _extends({}, valObj);
6762
+ if (!_findDataObj2.label) {
6763
+ _findDataObj2 = data.find(function (item) {
6764
+ return item.start === valObj.start && item.end === valObj.end;
6765
+ });
6766
+ }
6767
+ transformedValue.push(_findDataObj2);
6768
+ } else if (typeof valObj === 'string') {
6769
+ var _findDataObj3 = data.find(function (item) {
6770
+ return item.label.trim() === valObj.trim();
6771
+ });
6772
+ transformedValue.push(_findDataObj3);
6773
+ }
6774
+ });
6775
+ } else if (typeof value === 'string') {
6776
+ var _findDataObj4 = data.find(function (item) {
6777
+ return item.label.trim() === value.trim();
6778
+ });
6779
+ transformedValue.push(_findDataObj4);
6780
+ }
6781
+ break;
6782
+ case constants$1.componentTypes.rangeSlider:
6783
+ case constants$1.componentTypes.ratingsFilter:
6784
+ case constants$1.componentTypes.dynamicRangeSlider:
6785
+ case constants$1.componentTypes.reactiveChart:
6786
+ transformedValue = [];
6787
+ if (queryFormat) {
6788
+ if (Array.isArray(value)) {
6789
+ transformedValue = value.map(function (item) {
6790
+ return (0, helper.formatDate)(new _xdate2["default"](item), componentProps);
6791
+ });
6792
+ } else if (typeof value === 'object') {
6793
+ transformedValue = [(0, helper.formatDate)(new _xdate2["default"](value.start), componentProps), (0, helper.formatDate)(new _xdate2["default"](value.end), componentProps)];
6794
+ }
6795
+ } else if (Array.isArray(value)) {
6796
+ transformedValue = [].concat(_toConsumableArray(value));
6797
+ } else if (typeof value === 'object') {
6798
+ transformedValue = [value.start, value.end];
6799
+ } else {
6800
+ transformedValue = value;
6801
+ }
6802
+ break;
6803
+ case constants$1.componentTypes.numberBox:
6804
+ transformedValue = [];
6805
+ if (!Array.isArray(value) && typeof value === 'object') {
6806
+ transformedValue = value.start;
6807
+ } else if (typeof value === 'number') {
6808
+ transformedValue = value;
6809
+ }
6810
+ break;
6811
+ case constants$1.componentTypes.datePicker:
6812
+ transformedValue = '';
6813
+ if (typeof value !== 'object') {
6814
+ transformedValue = new _xdate2["default"](value).toString('yyyy-MM-dd');
6815
+ } else if (value.end) {
6816
+ transformedValue = new _xdate2["default"](value.end).toString('yyyy-MM-dd');
6817
+ } else if (value.start) {
6818
+ transformedValue = new _xdate2["default"](value.start).addHours(24).toString('yyyy-MM-dd');
6819
+ }
6820
+ break;
6821
+ case constants$1.componentTypes.dateRange:
6822
+ transformedValue = [];
6823
+ if (Array.isArray(value)) {
6824
+ transformedValue = value.map(function (t) {
6825
+ return new _xdate2["default"](t).toString('yyyy-MM-dd');
6826
+ });
6827
+ } else if (typeof value === 'object') {
6828
+ transformedValue = [new _xdate2["default"](value.start).toString('yyyy-MM-dd'), new _xdate2["default"](value.end).toString('yyyy-MM-dd')];
6829
+ }
6830
+ break;
6831
+ case constants$1.componentTypes.categorySearch:
6832
+ transformedValue = '';
6833
+ if (typeof value === 'object') {
6834
+ transformedValue = value.value;
6835
+ if (value.category !== undefined) {
6836
+ meta.category = value.category;
6837
+ }
6838
+ } else if (typeof value === 'string') {
6839
+ transformedValue = value;
6840
+ }
6841
+ break;
6842
+ }
6843
+ }
6844
+ return {
6845
+ value: transformedValue,
6846
+ meta: meta
6847
+ };
6848
+ };
6906
6849
  });
6907
6850
  unwrapExports(transform);
6908
- var transform_1 = transform.getDependentQueries;
6909
- var transform_2 = transform.extractPropsFromState;
6910
- var transform_3 = transform.getValidInterval;
6911
- var transform_4 = transform.getRSQuery;
6912
- var transform_5 = transform.hasPaginationSupport;
6913
- var transform_6 = transform.isComponentUsesLabelAsValue;
6914
- var transform_7 = transform.isSearchComponent;
6915
- var transform_8 = transform.isDRSRangeComponent;
6916
- var transform_9 = transform.getHistogramComponentID;
6917
- var transform_10 = transform.getInternalComponentID;
6918
- var transform_11 = transform.isInternalComponent;
6919
- var transform_12 = transform.getNormalizedField;
6920
- var transform_13 = transform.componentToTypeMap;
6921
- var transform_14 = transform.flatReactProp;
6851
+ var transform_1 = transform.transformValueToComponentStateFormat;
6852
+ var transform_2 = transform.getDependentQueries;
6853
+ var transform_3 = transform.extractPropsFromState;
6854
+ var transform_4 = transform.getValidInterval;
6855
+ var transform_5 = transform.getRSQuery;
6856
+ var transform_6 = transform.hasPaginationSupport;
6857
+ var transform_7 = transform.isComponentUsesLabelAsValue;
6858
+ var transform_8 = transform.isSearchComponent;
6859
+ var transform_9 = transform.isDRSRangeComponent;
6860
+ var transform_10 = transform.getHistogramComponentID;
6861
+ var transform_11 = transform.getInternalComponentID;
6862
+ var transform_12 = transform.isInternalComponent;
6863
+ var transform_13 = transform.getNormalizedField;
6864
+ var transform_14 = transform.componentToTypeMap;
6865
+ var transform_15 = transform.flatReactProp;
6866
+
6867
+ var hits = createCommonjsModule(function (module, exports) {
6868
+ Object.defineProperty(exports, "__esModule", {
6869
+ value: true
6870
+ });
6871
+ exports.updateAggs = updateAggs;
6872
+ exports.updateCompositeAggs = updateCompositeAggs;
6873
+ exports.updateHits = updateHits;
6874
+ exports.saveQueryToHits = saveQueryToHits;
6875
+ exports.mockDataForTesting = mockDataForTesting;
6876
+ function updateAggs(component, aggregations) {
6877
+ var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6878
+ return {
6879
+ type: constants.UPDATE_AGGS,
6880
+ component: component,
6881
+ aggregations: aggregations,
6882
+ append: append
6883
+ };
6884
+ }
6885
+ function updateCompositeAggs(component, aggregations) {
6886
+ var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6887
+ return {
6888
+ type: constants.UPDATE_COMPOSITE_AGGS,
6889
+ component: component,
6890
+ aggregations: aggregations,
6891
+ append: append
6892
+ };
6893
+ }
6894
+ function updateHits(component, hits, time, hidden) {
6895
+ var append = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
6896
+ return {
6897
+ type: constants.UPDATE_HITS,
6898
+ component: component,
6899
+ hits: hits.hits,
6900
+ total: typeof hits.total === 'object' ? hits.total.value : hits.total,
6901
+ hidden: hidden,
6902
+ time: time,
6903
+ append: append
6904
+ };
6905
+ }
6906
+ function saveQueryToHits(component, query) {
6907
+ return {
6908
+ type: constants.SET_QUERY_TO_HITS,
6909
+ component: component,
6910
+ query: query
6911
+ };
6912
+ }
6913
+ function mockDataForTesting(component, data) {
6914
+ return function (dispatch) {
6915
+ if (data.hasOwnProperty('error')) {
6916
+ dispatch((0, misc.setError)(component, data.error));
6917
+ }
6918
+ if (data.hasOwnProperty('aggregations')) {
6919
+ dispatch(updateAggs(component, data.aggregations));
6920
+ }
6921
+ if (data.hasOwnProperty('hits')) {
6922
+ dispatch(updateHits(component, data, data.time || undefined));
6923
+ }
6924
+ };
6925
+ }
6926
+ });
6927
+ unwrapExports(hits);
6928
+ var hits_1 = hits.updateAggs;
6929
+ var hits_2 = hits.updateCompositeAggs;
6930
+ var hits_3 = hits.updateHits;
6931
+ var hits_4 = hits.saveQueryToHits;
6932
+ var hits_5 = hits.mockDataForTesting;
6933
+
6934
+ var misc = createCommonjsModule(function (module, exports) {
6935
+ Object.defineProperty(exports, "__esModule", {
6936
+ value: true
6937
+ });
6938
+ var _extends = Object.assign || function (target) {
6939
+ for (var i = 1; i < arguments.length; i++) {
6940
+ var source = arguments[i];
6941
+ for (var key in source) {
6942
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
6943
+ target[key] = source[key];
6944
+ }
6945
+ }
6946
+ }
6947
+ return target;
6948
+ };
6949
+ exports.setRawData = setRawData;
6950
+ exports.setLoading = setLoading;
6951
+ exports.setError = setError;
6952
+ exports.setTimestamp = setTimestamp;
6953
+ exports.setSearchId = setSearchId;
6954
+ exports.setSuggestionsSearchId = setSuggestionsSearchId;
6955
+ exports.setQuery = setQuery;
6956
+ exports.setCustomQuery = setCustomQuery;
6957
+ exports.setDefaultQuery = setDefaultQuery;
6958
+ exports.setCustomHighlightOptions = setCustomHighlightOptions;
6959
+ exports.updateQueryOptions = updateQueryOptions;
6960
+ exports.logQuery = logQuery;
6961
+ exports.logCombinedQuery = logCombinedQuery;
6962
+ exports.setHeaders = setHeaders;
6963
+ exports.setPromotedResults = setPromotedResults;
6964
+ exports.setPopularSuggestions = setPopularSuggestions;
6965
+ exports.setDefaultPopularSuggestions = setDefaultPopularSuggestions;
6966
+ exports.setCustomData = setCustomData;
6967
+ exports.setAppliedSettings = setAppliedSettings;
6968
+ exports.setQueryListener = setQueryListener;
6969
+ exports.setGoogleMapScriptLoading = setGoogleMapScriptLoading;
6970
+ exports.setGoogleMapScriptLoaded = setGoogleMapScriptLoaded;
6971
+ exports.setGoogleMapScriptError = setGoogleMapScriptError;
6972
+ exports.resetStoreForComponent = resetStoreForComponent;
6973
+ exports.setLastUsedAppbaseQuery = setLastUsedAppbaseQuery;
6974
+ exports.setSearchState = setSearchState;
6975
+ function setRawData(component, response) {
6976
+ return {
6977
+ type: constants.SET_RAW_DATA,
6978
+ component: component,
6979
+ response: response
6980
+ };
6981
+ }
6982
+ function setLoading(component, isLoading) {
6983
+ return {
6984
+ type: constants.SET_LOADING,
6985
+ component: component,
6986
+ isLoading: isLoading
6987
+ };
6988
+ }
6989
+ function setError(component, error) {
6990
+ return {
6991
+ type: constants.SET_ERROR,
6992
+ component: component,
6993
+ error: error
6994
+ };
6995
+ }
6996
+ function setTimestamp(component, timestamp) {
6997
+ return {
6998
+ type: constants.SET_TIMESTAMP,
6999
+ component: component,
7000
+ timestamp: timestamp
7001
+ };
7002
+ }
7003
+ function setSearchId() {
7004
+ var searchId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
7005
+ return {
7006
+ type: constants.SET_SEARCH_ID,
7007
+ searchId: searchId
7008
+ };
7009
+ }
7010
+ function setSuggestionsSearchId() {
7011
+ var searchId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
7012
+ return {
7013
+ type: constants.SET_SUGGESTIONS_SEARCH_ID,
7014
+ searchId: searchId
7015
+ };
7016
+ }
7017
+ function setQuery(component, query) {
7018
+ return {
7019
+ type: constants.SET_QUERY,
7020
+ component: component,
7021
+ query: query
7022
+ };
7023
+ }
7024
+ function setCustomQuery(component, query) {
7025
+ return {
7026
+ type: constants.SET_CUSTOM_QUERY,
7027
+ component: component,
7028
+ query: query
7029
+ };
7030
+ }
7031
+ function setDefaultQuery(component, query) {
7032
+ return {
7033
+ type: constants.SET_DEFAULT_QUERY,
7034
+ component: component,
7035
+ query: query
7036
+ };
7037
+ }
7038
+ function setCustomHighlightOptions(component, data) {
7039
+ return {
7040
+ type: constants.SET_CUSTOM_HIGHLIGHT_OPTIONS,
7041
+ component: component,
7042
+ data: data
7043
+ };
7044
+ }
7045
+ function updateQueryOptions(component, options) {
7046
+ return {
7047
+ type: constants.SET_QUERY_OPTIONS,
7048
+ component: component,
7049
+ options: options
7050
+ };
7051
+ }
7052
+ function logQuery(component, query) {
7053
+ return {
7054
+ type: constants.LOG_QUERY,
7055
+ component: component,
7056
+ query: query
7057
+ };
7058
+ }
7059
+ function logCombinedQuery(component, query) {
7060
+ return {
7061
+ type: constants.LOG_COMBINED_QUERY,
7062
+ component: component,
7063
+ query: query
7064
+ };
7065
+ }
7066
+ function setHeaders(headers) {
7067
+ return {
7068
+ type: constants.SET_HEADERS,
7069
+ headers: headers
7070
+ };
7071
+ }
7072
+ function setPromotedResults() {
7073
+ var results = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
7074
+ var component = arguments[1];
7075
+ return {
7076
+ type: constants.SET_PROMOTED_RESULTS,
7077
+ results: results,
7078
+ component: component
7079
+ };
7080
+ }
7081
+ function setPopularSuggestions() {
7082
+ var suggestions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
7083
+ var component = arguments[1];
7084
+ return {
7085
+ type: constants.SET_POPULAR_SUGGESTIONS,
7086
+ suggestions: suggestions,
7087
+ component: component
7088
+ };
7089
+ }
7090
+ function setDefaultPopularSuggestions() {
7091
+ var suggestions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
7092
+ var component = arguments[1];
7093
+ return {
7094
+ type: constants.SET_DEFAULT_POPULAR_SUGGESTIONS,
7095
+ suggestions: suggestions,
7096
+ component: component
7097
+ };
7098
+ }
7099
+ function setCustomData() {
7100
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
7101
+ var component = arguments[1];
7102
+ return {
7103
+ type: constants.SET_CUSTOM_DATA,
7104
+ data: data,
7105
+ component: component
7106
+ };
7107
+ }
7108
+ function setAppliedSettings() {
7109
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
7110
+ var component = arguments[1];
7111
+ return {
7112
+ type: constants.SET_APPLIED_SETTINGS,
7113
+ data: data,
7114
+ component: component
7115
+ };
7116
+ }
7117
+ function setQueryListener(component, onQueryChange, onError) {
7118
+ return {
7119
+ type: constants.SET_QUERY_LISTENER,
7120
+ component: component,
7121
+ onQueryChange: onQueryChange,
7122
+ onError: onError
7123
+ };
7124
+ }
7125
+ function setGoogleMapScriptLoading(bool) {
7126
+ return {
7127
+ type: constants.SET_GOOGLE_MAP_SCRIPT_LOADING,
7128
+ loading: bool
7129
+ };
7130
+ }
7131
+ function setGoogleMapScriptLoaded(bool) {
7132
+ return {
7133
+ type: constants.SET_GOOGLE_MAP_SCRIPT_LOADED,
7134
+ loaded: bool
7135
+ };
7136
+ }
7137
+ function setGoogleMapScriptError(error) {
7138
+ return {
7139
+ type: constants.SET_GOOGLE_MAP_SCRIPT_ERROR,
7140
+ error: error
7141
+ };
7142
+ }
7143
+ function resetStoreForComponent(componentId) {
7144
+ return function (dispatch) {
7145
+ dispatch(setRawData(componentId, null));
7146
+ dispatch(setCustomData(null, componentId));
7147
+ dispatch(setPromotedResults([], componentId));
7148
+ dispatch(setPopularSuggestions([], componentId));
7149
+ dispatch(setDefaultPopularSuggestions([], componentId));
7150
+ dispatch((0, hits.updateAggs)(componentId, null));
7151
+ dispatch((0, hits.updateCompositeAggs)(componentId, {}));
7152
+ dispatch((0, hits.updateHits)(componentId, {
7153
+ hits: [],
7154
+ total: 0
7155
+ }, 0));
7156
+ };
7157
+ }
7158
+ function setLastUsedAppbaseQuery(query) {
7159
+ return {
7160
+ type: constants.SET_APPBASE_QUERY,
7161
+ query: query
7162
+ };
7163
+ }
7164
+ function setSearchState() {
7165
+ var componentsValueAndTypeMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7166
+ return function (dispatch) {
7167
+ var componentValues = {};
7168
+ Object.keys(componentsValueAndTypeMap).forEach(function (componentId) {
7169
+ var _componentsValueAndTy = componentsValueAndTypeMap[componentId],
7170
+ value = _componentsValueAndTy.value,
7171
+ componentProps = _componentsValueAndTy.componentProps;
7172
+ var _transformValueToComp = (0, transform.transformValueToComponentStateFormat)(value, componentProps),
7173
+ transformedValue = _transformValueToComp.value,
7174
+ _transformValueToComp2 = _transformValueToComp.meta,
7175
+ meta = _transformValueToComp2 === undefined ? {} : _transformValueToComp2;
7176
+ componentValues[componentId] = _extends({
7177
+ value: transformedValue
7178
+ }, meta);
7179
+ });
7180
+ dispatch((0, value.setValues)(componentValues));
7181
+ };
7182
+ }
7183
+ });
7184
+ unwrapExports(misc);
7185
+ var misc_1 = misc.setRawData;
7186
+ var misc_2 = misc.setLoading;
7187
+ var misc_3 = misc.setError;
7188
+ var misc_4 = misc.setTimestamp;
7189
+ var misc_5 = misc.setSearchId;
7190
+ var misc_6 = misc.setSuggestionsSearchId;
7191
+ var misc_7 = misc.setQuery;
7192
+ var misc_8 = misc.setCustomQuery;
7193
+ var misc_9 = misc.setDefaultQuery;
7194
+ var misc_10 = misc.setCustomHighlightOptions;
7195
+ var misc_11 = misc.updateQueryOptions;
7196
+ var misc_12 = misc.logQuery;
7197
+ var misc_13 = misc.logCombinedQuery;
7198
+ var misc_14 = misc.setHeaders;
7199
+ var misc_15 = misc.setPromotedResults;
7200
+ var misc_16 = misc.setPopularSuggestions;
7201
+ var misc_17 = misc.setDefaultPopularSuggestions;
7202
+ var misc_18 = misc.setCustomData;
7203
+ var misc_19 = misc.setAppliedSettings;
7204
+ var misc_20 = misc.setQueryListener;
7205
+ var misc_21 = misc.setGoogleMapScriptLoading;
7206
+ var misc_22 = misc.setGoogleMapScriptLoaded;
7207
+ var misc_23 = misc.setGoogleMapScriptError;
7208
+ var misc_24 = misc.resetStoreForComponent;
7209
+ var misc_25 = misc.setLastUsedAppbaseQuery;
7210
+ var misc_26 = misc.setSearchState;
6922
7211
 
6923
7212
  var utils = createCommonjsModule(function (module, exports) {
6924
7213
  Object.defineProperty(exports, "__esModule", {
@@ -7019,13 +7308,17 @@
7019
7308
  var _getState3 = getState(),
7020
7309
  config = _getState3.config,
7021
7310
  internalValues = _getState3.internalValues,
7022
- lastUsedAppbaseQuery = _getState3.lastUsedAppbaseQuery;
7311
+ lastUsedAppbaseQuery = _getState3.lastUsedAppbaseQuery,
7312
+ analyticsRef = _getState3.analyticsRef;
7023
7313
  var searchId = res._headers ? res._headers.get('X-Search-Id') : null;
7024
7314
  if (searchId) {
7025
7315
  if (isSuggestionsQuery) {
7026
7316
  dispatch((0, misc.setSuggestionsSearchId)(searchId));
7027
7317
  } else {
7028
7318
  dispatch((0, misc.setSearchId)(searchId));
7319
+ if (analyticsRef) {
7320
+ analyticsRef.queryID = searchId;
7321
+ }
7029
7322
  }
7030
7323
  }
7031
7324
  orderOfQueries.forEach(function (component) {
@@ -7097,6 +7390,8 @@
7097
7390
  appendToAggs = _ref3$appendToAggs === undefined ? false : _ref3$appendToAggs;
7098
7391
  var getState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
7099
7392
  var dispatch = arguments[2];
7393
+ var _getState5 = getState(),
7394
+ analyticsRef = _getState5.analyticsRef;
7100
7395
  orderOfQueries.forEach(function (component, index) {
7101
7396
  if (isComponentActive(getState, component)) {
7102
7397
  var searchId = res._headers ? res._headers.get('X-Search-Id') : null;
@@ -7105,18 +7400,21 @@
7105
7400
  dispatch((0, misc.setSuggestionsSearchId)(searchId));
7106
7401
  } else {
7107
7402
  dispatch((0, misc.setSearchId)(searchId));
7403
+ if (analyticsRef) {
7404
+ analyticsRef.queryID = searchId;
7405
+ }
7108
7406
  }
7109
7407
  }
7110
7408
  var transformResponse = res;
7111
7409
  if (res && Array.isArray(res.responses) && res.responses[index]) {
7112
7410
  transformResponse = res.responses[index];
7113
7411
  }
7114
- var _getState5 = getState(),
7115
- config = _getState5.config,
7116
- internalValues = _getState5.internalValues;
7412
+ var _getState6 = getState(),
7413
+ config = _getState6.config,
7414
+ internalValues = _getState6.internalValues;
7117
7415
  handleTransformResponse(transformResponse, config, component).then(function (response) {
7118
- var _getState6 = getState(),
7119
- timestamp = _getState6.timestamp;
7416
+ var _getState7 = getState(),
7417
+ timestamp = _getState7.timestamp;
7120
7418
  if (timestamp[component] === undefined || timestamp[component] < res._timestamp) {
7121
7419
  dispatch((0, misc.setRawData)(component, response));
7122
7420
  var promotedResults = response.promoted || res.promoted;
@@ -7154,8 +7452,8 @@
7154
7452
  var getSuggestionQuery = exports.getSuggestionQuery = function getSuggestionQuery() {
7155
7453
  var getState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
7156
7454
  var componentId = arguments[1];
7157
- var _getState7 = getState(),
7158
- internalValues = _getState7.internalValues;
7455
+ var _getState8 = getState(),
7456
+ internalValues = _getState8.internalValues;
7159
7457
  var internalValue = internalValues[componentId];
7160
7458
  var value = internalValue && internalValue.value || '';
7161
7459
  return [{
@@ -8614,12 +8912,25 @@
8614
8912
  exports.addComponent = addComponent;
8615
8913
  exports.removeComponent = removeComponent;
8616
8914
  exports.watchComponent = watchComponent;
8617
- function addComponent(component) {
8915
+ function addComponentToList(component) {
8618
8916
  return {
8619
8917
  type: constants.ADD_COMPONENT,
8620
8918
  component: component
8621
8919
  };
8622
8920
  }
8921
+ function addComponentTimestamp(component, timestamp) {
8922
+ return {
8923
+ type: constants.SET_REGISTERED_COMPONENT_TIMESTAMP,
8924
+ component: component,
8925
+ timestamp: timestamp
8926
+ };
8927
+ }
8928
+ function addComponent(component) {
8929
+ return function (dispatch) {
8930
+ dispatch(addComponentToList(component));
8931
+ dispatch(addComponentTimestamp(component, new Date().getTime()));
8932
+ };
8933
+ }
8623
8934
  function removeComponent(component) {
8624
8935
  return {
8625
8936
  type: constants.REMOVE_COMPONENT,
@@ -8842,28 +9153,17 @@
8842
9153
  };
8843
9154
  }
8844
9155
  function recordClick(_ref) {
8845
- var url = _ref.url,
8846
- app = _ref.app,
8847
- credentials = _ref.credentials,
8848
- headers = _ref.headers,
8849
- documentId = _ref.documentId,
9156
+ var documentId = _ref.documentId,
8850
9157
  clickPosition = _ref.clickPosition,
8851
- queryId = _ref.queryId,
8852
- clickType = _ref.clickType;
9158
+ analyticsInstance = _ref.analyticsInstance,
9159
+ isSuggestionClick = _ref.isSuggestionClick;
8853
9160
  if (!documentId) {
8854
9161
  console.warn('ReactiveSearch: document id is required to record the click analytics');
8855
9162
  } else {
8856
- fetch(url + '/' + app + '/_analytics/click', {
8857
- method: 'PUT',
8858
- body: JSON.stringify({
8859
- query_id: queryId,
8860
- click_type: clickType || 'result',
8861
- click_on: _defineProperty({}, documentId, clickPosition + 1)
8862
- }),
8863
- headers: _extends({}, headers, {
8864
- 'Content-Type': 'application/json',
8865
- Authorization: 'Basic ' + btoa(credentials)
8866
- })
9163
+ analyticsInstance.click({
9164
+ queryID: analyticsInstance.getQueryID(),
9165
+ objects: _defineProperty({}, documentId, clickPosition + 1),
9166
+ isSuggestionClick: isSuggestionClick
8867
9167
  });
8868
9168
  }
8869
9169
  }
@@ -8876,7 +9176,8 @@
8876
9176
  _getState2$appbaseRef = _getState2.appbaseRef,
8877
9177
  url = _getState2$appbaseRef.url,
8878
9178
  protocol = _getState2$appbaseRef.protocol,
8879
- credentials = _getState2$appbaseRef.credentials;
9179
+ credentials = _getState2$appbaseRef.credentials,
9180
+ analyticsInstance = _getState2.analyticsRef;
8880
9181
  var app = config.app;
8881
9182
  var esURL = protocol + '://' + url;
8882
9183
  if (config.analytics && searchId) {
@@ -8896,13 +9197,9 @@
8896
9197
  });
8897
9198
  } else {
8898
9199
  recordClick({
8899
- url: parsedURL,
8900
- app: app,
8901
- credentials: credentials,
8902
- parsedHeaders: parsedHeaders,
8903
9200
  documentId: documentId,
8904
9201
  clickPosition: searchPosition,
8905
- queryId: searchId
9202
+ analyticsInstance: analyticsInstance
8906
9203
  });
8907
9204
  }
8908
9205
  }
@@ -8917,14 +9214,15 @@
8917
9214
  _getState3$appbaseRef = _getState3.appbaseRef,
8918
9215
  url = _getState3$appbaseRef.url,
8919
9216
  protocol = _getState3$appbaseRef.protocol,
8920
- credentials = _getState3$appbaseRef.credentials;
9217
+ credentials = _getState3$appbaseRef.credentials,
9218
+ analyticsInstance = _getState3.analyticsRef;
8921
9219
  var app = config.app;
8922
9220
  var esURL = protocol + '://' + url;
8923
- if (config.analytics && (config.analyticsConfig === undefined || config.analyticsConfig.suggestionAnalytics === undefined || config.analyticsConfig.suggestionAnalytics) && suggestionsSearchId && searchPosition !== undefined) {
9221
+ if (config.analytics && (config.analyticsConfig === undefined || config.analyticsConfig.suggestionAnalytics === undefined || config.analyticsConfig.suggestionAnalytics)) {
8924
9222
  var parsedHeaders = headers;
8925
9223
  delete parsedHeaders['X-Search-Query'];
8926
9224
  var parsedURL = (esURL || '').replace(/\/+$/, '');
8927
- if (parsedURL.includes('scalr.api.appbase.io')) {
9225
+ if (parsedURL.includes('scalr.api.appbase.io') && searchPosition !== undefined && suggestionsSearchId) {
8928
9226
  fetch(parsedURL + '/' + app + '/_analytics', {
8929
9227
  method: 'POST',
8930
9228
  headers: _extends({}, parsedHeaders, {
@@ -8935,16 +9233,12 @@
8935
9233
  'X-Search-Suggestions-ClickPosition': searchPosition + 1
8936
9234
  })
8937
9235
  });
8938
- } else {
9236
+ } else if (searchPosition !== undefined) {
8939
9237
  recordClick({
8940
- url: parsedURL,
8941
- app: app,
8942
- credentials: credentials,
8943
- parsedHeaders: parsedHeaders,
8944
9238
  documentId: documentId,
8945
9239
  clickPosition: searchPosition,
8946
- clickType: 'suggestion',
8947
- queryId: suggestionsSearchId
9240
+ analyticsInstance: analyticsInstance,
9241
+ isSuggestionClick: true
8948
9242
  });
8949
9243
  }
8950
9244
  }
@@ -8954,26 +9248,17 @@
8954
9248
  var impressions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
8955
9249
  return function (dispatch, getState) {
8956
9250
  var _getState4 = getState(),
8957
- app = _getState4.config.app,
8958
- headers = _getState4.headers,
8959
9251
  _getState4$appbaseRef = _getState4.appbaseRef,
8960
9252
  url = _getState4$appbaseRef.url,
8961
9253
  protocol = _getState4$appbaseRef.protocol,
8962
- credentials = _getState4$appbaseRef.credentials;
9254
+ analyticsInstance = _getState4.analyticsRef,
9255
+ config = _getState4.config;
8963
9256
  var esURL = protocol + '://' + url;
8964
9257
  var parsedURL = esURL.replace(/\/+$/, '');
8965
- if (!parsedURL.includes('scalr.api.appbase.io') && queryId && impressions.length) {
8966
- fetch(parsedURL + '/' + app + '/_analytics/search', {
8967
- method: 'PUT',
8968
- body: JSON.stringify({
8969
- query_id: queryId,
8970
- impressions: impressions
8971
- }),
8972
- keepalive: true,
8973
- headers: _extends({}, headers, {
8974
- 'Content-Type': 'application/json',
8975
- Authorization: 'Basic ' + btoa(credentials)
8976
- })
9258
+ if (config.analytics && !parsedURL.includes('scalr.api.appbase.io') && queryId && impressions.length) {
9259
+ analyticsInstance.search({
9260
+ queryID: analyticsInstance.getQueryID(),
9261
+ impressions: impressions
8977
9262
  });
8978
9263
  }
8979
9264
  };
@@ -9356,14 +9641,9 @@
9356
9641
  };
9357
9642
  }
9358
9643
  function maybeInvokeDelegate(delegate, context) {
9359
- var method = delegate.iterator[context.method];
9360
- if (undefined === method) {
9361
- if (context.delegate = null, "throw" === context.method) {
9362
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
9363
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
9364
- }
9365
- return ContinueSentinel;
9366
- }
9644
+ var methodName = context.method,
9645
+ method = delegate.iterator[methodName];
9646
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
9367
9647
  var record = tryCatch(method, delegate.iterator, context.arg);
9368
9648
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
9369
9649
  var info = record.arg;
@@ -9563,7 +9843,7 @@
9563
9843
  descriptor.enumerable = descriptor.enumerable || false;
9564
9844
  descriptor.configurable = true;
9565
9845
  if ("value" in descriptor) descriptor.writable = true;
9566
- Object.defineProperty(target, descriptor.key, descriptor);
9846
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
9567
9847
  }
9568
9848
  }
9569
9849
  function _createClass(Constructor, protoProps, staticProps) {
@@ -12926,8 +13206,9 @@
12926
13206
  }
12927
13207
  return {
12928
13208
  name: 'ComponentWrapper',
13209
+ $timestamp: null,
12929
13210
  props: {
12930
- destroyOnUnmount: VueTypes.bool.def(false)
13211
+ destroyOnUnmount: VueTypes.bool.def(true)
12931
13212
  },
12932
13213
  created: function created() {
12933
13214
  // clone the props for component it is needed because attrs gets changed on time
@@ -12940,6 +13221,7 @@
12940
13221
  this.componentProps = parsedProps;
12941
13222
  this.componentId = this.componentProps.componentId;
12942
13223
  this.react = this.componentProps.react;
13224
+ this.$timestamp = new Date().getTime();
12943
13225
  },
12944
13226
  beforeMount: function beforeMount() {
12945
13227
  var _this = this;
@@ -12970,7 +13252,7 @@
12970
13252
 
12971
13253
  // if default query prop is defined and component is reactive component then register the internal component
12972
13254
  if (options.internalComponent || this.componentProps.defaultQuery && options.componentType === constants_1$1.reactiveComponent) {
12973
- this.internalComponent = transform_10(this.componentId);
13255
+ this.internalComponent = transform_11(this.componentId);
12974
13256
  }
12975
13257
  // Register internal component
12976
13258
  if (this.internalComponent && (this.destroyOnUnmount || components.indexOf(this.internalComponent) === -1)) {
@@ -12986,10 +13268,17 @@
12986
13268
  },
12987
13269
  beforeDestroy: function beforeDestroy() {
12988
13270
  if (this.destroyOnUnmount) {
13271
+ var registeredComponentsTimestamps = {};
13272
+ if (this.$$store) {
13273
+ var _this$$$store$getStat2 = this.$$store.getState();
13274
+ registeredComponentsTimestamps = _this$$$store$getStat2.registeredComponentsTimestamps;
13275
+ }
12989
13276
  // Unregister components
12990
- this.removeComponent(this.componentId);
12991
- if (this.internalComponent) {
12992
- this.removeComponent(this.internalComponent);
13277
+ if (registeredComponentsTimestamps[this.componentId] === this.$timestamp) {
13278
+ this.removeComponent(this.componentId);
13279
+ if (this.internalComponent) {
13280
+ this.removeComponent(this.internalComponent);
13281
+ }
12993
13282
  }
12994
13283
  }
12995
13284
  },
@@ -15156,6 +15445,260 @@
15156
15445
  return client;
15157
15446
  }
15158
15447
 
15448
+ function _extends$3() {
15449
+ _extends$3 = Object.assign || function (target) {
15450
+ for (var i = 1; i < arguments.length; i++) {
15451
+ var source = arguments[i];
15452
+ for (var key in source) {
15453
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
15454
+ target[key] = source[key];
15455
+ }
15456
+ }
15457
+ }
15458
+ return target;
15459
+ };
15460
+ return _extends$3.apply(this, arguments);
15461
+ }
15462
+
15463
+ // Function to parse the URL
15464
+ function btoa$2(input) {
15465
+ if (input === void 0) {
15466
+ input = '';
15467
+ }
15468
+ var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
15469
+ var str = input;
15470
+ var output = ''; // eslint-disable-next-line
15471
+
15472
+ for (var block = 0, charCode, i = 0, map = chars; str.charAt(i | 0) || (map = '=', i % 1);
15473
+ // eslint-disable-line no-bitwise
15474
+ output += map.charAt(63 & block >> 8 - i % 1 * 8) // eslint-disable-line no-bitwise
15475
+ ) {
15476
+ charCode = str.charCodeAt(i += 3 / 4);
15477
+ if (charCode > 0xff) {
15478
+ throw new Error('"btoa" failed: The string to be encoded contains characters outside of the Latin1 range.');
15479
+ }
15480
+ block = block << 8 | charCode; // eslint-disable-line no-bitwise
15481
+ }
15482
+
15483
+ return output;
15484
+ }
15485
+ function validateIndex(index) {
15486
+ if (!index) {
15487
+ throw new Error('appbase-analytics: A valid index must be present to record analytics events.');
15488
+ }
15489
+ }
15490
+ function validateCredentials(credentials) {
15491
+ if (!credentials) {
15492
+ throw new Error('appbase-analytics: Auth credentials is missing.');
15493
+ }
15494
+ }
15495
+ function validateURL(url) {
15496
+ if (!url) {
15497
+ throw new Error('appbase-analytics: URL is missing.');
15498
+ }
15499
+ }
15500
+ function validateQuery(query, queryID) {
15501
+ if ((query === undefined || query === null) && !queryID) {
15502
+ throw new Error('appbase-analytics: query or queryID must be present to register a click/conversion event');
15503
+ }
15504
+ }
15505
+ function validateQueryID(queryID) {
15506
+ if (!queryID) {
15507
+ throw new Error('appbase-analytics: queryID must be present to save search/favorite');
15508
+ }
15509
+ }
15510
+ function validateClickObjects(objects) {
15511
+ if (!objects || Object.keys(objects).length < 1) {
15512
+ throw new Error('appbase-analytics: at least one click object must be present to register a click event');
15513
+ }
15514
+ }
15515
+ function validateConversionObjects(objects) {
15516
+ if (!objects || Object.keys(objects).length < 1) {
15517
+ throw new Error('appbase-analytics: at least one click object must be present to register a click event');
15518
+ }
15519
+ }
15520
+ function initClient(config) {
15521
+ if (config === void 0) {
15522
+ config = {};
15523
+ }
15524
+ var metrics = {
15525
+ credentials: config.credentials,
15526
+ index: config.index,
15527
+ url: config.url,
15528
+ userID: config.userID,
15529
+ globalCustomEvents: config.globalCustomEvents,
15530
+ queryID: '',
15531
+ headers: null,
15532
+ _request: function _request(method, url, body, queryParams, callback) {
15533
+ var finalBody = _extends$3({
15534
+ user_id: metrics.userID
15535
+ }, body, {
15536
+ custom_events: _extends$3({}, body && body.custom_events, {}, metrics.globalCustomEvents)
15537
+ });
15538
+ var queryParamsString = '';
15539
+ if (queryParams) {
15540
+ queryParamsString = Object.keys(queryParams).map(function (param) {
15541
+ return param + "=" + queryParams[param];
15542
+ }).join('&');
15543
+ }
15544
+ return fetch$1(metrics.url + "/" + url + "?" + queryParamsString, {
15545
+ method: method,
15546
+ headers: _extends$3({}, metrics.headers, {
15547
+ 'Content-Type': 'application/json',
15548
+ Authorization: "Basic " + btoa$2(metrics.credentials)
15549
+ }),
15550
+ body: method === 'GET' ? null : JSON.stringify(finalBody)
15551
+ }).then(function (response) {
15552
+ if (callback) {
15553
+ callback(null, response);
15554
+ }
15555
+ })["catch"](function (err) {
15556
+ if (callback) {
15557
+ callback(err, null);
15558
+ }
15559
+ });
15560
+ }
15561
+ };
15562
+ validateIndex(metrics.index);
15563
+ validateCredentials(metrics.credentials);
15564
+ validateURL(metrics.url); // To register a search
15565
+
15566
+ metrics.search = function (searchConfig, callback) {
15567
+ validateQuery(searchConfig.query, searchConfig.queryID);
15568
+ var captureQueryID = function captureQueryID(err, res) {
15569
+ if (res) {
15570
+ res.json().then(function (response) {
15571
+ if (response && response.query_id) {
15572
+ metrics.queryID = response.query_id;
15573
+ }
15574
+ if (callback) {
15575
+ callback(err, res);
15576
+ }
15577
+ })["catch"](function (err2) {
15578
+ if (callback) {
15579
+ callback(err2, res);
15580
+ }
15581
+ });
15582
+ } else if (callback) {
15583
+ callback(err, res);
15584
+ }
15585
+ }; // just to avoid the flow type error
15586
+
15587
+ if (metrics._request) {
15588
+ var requestBody = {
15589
+ query: searchConfig.query,
15590
+ query_id: searchConfig.queryID,
15591
+ custom_events: searchConfig.customEvents,
15592
+ filters: searchConfig.filters,
15593
+ hits: searchConfig.hits,
15594
+ impressions: searchConfig.impressions
15595
+ };
15596
+ metrics._request('PUT', metrics.index + "/_analytics/search", requestBody, null, captureQueryID);
15597
+ }
15598
+ }; // To register a click
15599
+
15600
+ metrics.click = function (clickConfig, callback) {
15601
+ validateQuery(clickConfig.query, clickConfig.queryID);
15602
+ validateClickObjects(clickConfig.objects); // just to avoid the flow type error
15603
+
15604
+ if (metrics._request) {
15605
+ var requestBody = {
15606
+ click_on: clickConfig.objects,
15607
+ click_type: clickConfig.isSuggestionClick ? 'suggestion' : 'result',
15608
+ query: clickConfig.query,
15609
+ query_id: clickConfig.queryID,
15610
+ custom_events: clickConfig.customEvents,
15611
+ meta: clickConfig.meta
15612
+ };
15613
+ metrics._request('PUT', metrics.index + "/_analytics/click", requestBody, null, callback);
15614
+ }
15615
+ }; // To register a conversion
15616
+
15617
+ metrics.conversion = function (conversionConfig, callback) {
15618
+ validateQuery(null, conversionConfig.queryID);
15619
+ validateConversionObjects(conversionConfig.objects); // just to avoid the flow type error
15620
+
15621
+ if (metrics._request) {
15622
+ var requestBody = {
15623
+ conversion_on: conversionConfig.objects,
15624
+ query_id: conversionConfig.queryID,
15625
+ meta: conversionConfig.meta
15626
+ };
15627
+ metrics._request('PUT', metrics.index + "/_analytics/conversion", requestBody, null, callback);
15628
+ }
15629
+ }; // To save search
15630
+
15631
+ metrics.saveSearch = function (saveSearchConfig, callback) {
15632
+ validateQueryID(saveSearchConfig.queryID);
15633
+ var requestBody = {
15634
+ query_id: saveSearchConfig.queryID,
15635
+ save_search_id: saveSearchConfig.saveSearchID,
15636
+ save_search_meta: saveSearchConfig.saveSearchMeta,
15637
+ user_id: saveSearchConfig.userID,
15638
+ custom_events: saveSearchConfig.customEvents
15639
+ };
15640
+ metrics._request('PUT', '_analytics/save-search', requestBody, null, callback);
15641
+ }; // To delete save search
15642
+
15643
+ metrics.deleteSavedSearch = function (saveSearchId, callback) {
15644
+ metrics._request('DELETE', '_analytics/save-search/' + saveSearchId, null, null, callback);
15645
+ }; // To retrieve saved searches
15646
+
15647
+ metrics.getSavedSearches = function (filters, callback) {
15648
+ // just to avoid the flow type error
15649
+ if (metrics._request) {
15650
+ metrics._request('GET', '_analytics/saved-searches', null, filters, callback);
15651
+ }
15652
+ }; // To record a favorite document
15653
+
15654
+ metrics.favorite = function (favoriteConfig, callback) {
15655
+ validateQueryID(favoriteConfig.queryID);
15656
+ if (!favoriteConfig.favoriteOn || favoriteConfig.favoriteOn === '') {
15657
+ throw new Error('appbase-analytics: favoriteOn property is required');
15658
+ }
15659
+ if (!favoriteConfig.source) {
15660
+ throw new Error('appbase-analytics: source property is required');
15661
+ }
15662
+ var requestBody = {
15663
+ query_id: favoriteConfig.queryID,
15664
+ favorite_on: favoriteConfig.favoriteOn,
15665
+ source: favoriteConfig.source,
15666
+ id: favoriteConfig.id,
15667
+ meta: favoriteConfig.meta,
15668
+ user_id: favoriteConfig.userID,
15669
+ custom_events: favoriteConfig.customEvents
15670
+ };
15671
+ metrics._request('PUT', '_analytics/favorite', requestBody, null, callback);
15672
+ }; // To retrieve favorites
15673
+
15674
+ metrics.getFavorites = function (filters, callback) {
15675
+ // just to avoid the flow type error
15676
+ if (metrics._request) {
15677
+ metrics._request('GET', '_analytics/favorites', null, filters, callback);
15678
+ }
15679
+ }; // Sets the userID
15680
+
15681
+ metrics.setUserID = function (userID) {
15682
+ metrics.userID = userID;
15683
+ }; // Sets the global events
15684
+
15685
+ metrics.setGlobalCustomEvents = function (globalEvents) {
15686
+ metrics.globalCustomEvents = globalEvents;
15687
+ }; // Sets the headers
15688
+
15689
+ metrics.setHeaders = function (headers) {
15690
+ metrics.headers = headers;
15691
+ }; // get queryID
15692
+
15693
+ metrics.getQueryID = function () {
15694
+ return metrics.queryID;
15695
+ };
15696
+ return metrics;
15697
+ }
15698
+ var index$2 = {
15699
+ init: initClient
15700
+ };
15701
+
15159
15702
  /**
15160
15703
  *
15161
15704
  *
@@ -15488,11 +16031,16 @@
15488
16031
  }
15489
16032
  return true;
15490
16033
  }
16034
+ },
16035
+ analyticsRef: {
16036
+ type: Object,
16037
+ required: false
15491
16038
  }
15492
16039
  },
15493
16040
  provide: function provide() {
15494
16041
  return {
15495
- $$store: this.store
16042
+ $$store: this.store,
16043
+ $analytics: this.analyticsRef
15496
16044
  };
15497
16045
  },
15498
16046
  render: function render(h) {
@@ -15941,6 +16489,30 @@
15941
16489
  if (this.$props.transformResponse) {
15942
16490
  appbaseRef.transformResponse = this.$props.transformResponse;
15943
16491
  }
16492
+ var analyticsInitConfig = {
16493
+ url: url && url.replace(/\/\/.*@/, '//'),
16494
+ credentials: appbaseRef.credentials,
16495
+ // When endpoint prop is used index is not defined, so we use _default
16496
+ index: appbaseRef.app || '_default',
16497
+ globalCustomEvents: this.$props.appbaseConfig && this.$props.appbaseConfig.customEvents
16498
+ };
16499
+ try {
16500
+ if (this.$props.endpoint && this.$props.endpoint.url) {
16501
+ // Remove parts between '//' and first '/' in the url
16502
+ analyticsInitConfig.url = this.$props.endpoint.url.replace(/\/\/(.*?)\/.*/, '//$1');
16503
+ var headerCredentials = this.$props.endpoint.headers && this.$props.endpoint.headers.Authorization;
16504
+ analyticsInitConfig.credentials = headerCredentials && headerCredentials.replace('Basic ', '');
16505
+ // Decode the credentials
16506
+ analyticsInitConfig.credentials = analyticsInitConfig.credentials && atob(analyticsInitConfig.credentials);
16507
+ }
16508
+ } catch (e) {
16509
+ console.error('Endpoint not set correctly for analytics');
16510
+ console.error(e);
16511
+ }
16512
+ var analyticsRef = null;
16513
+ if (config.analytics) {
16514
+ analyticsRef = index$2.init(analyticsInitConfig);
16515
+ }
15944
16516
  var initialState = _extends({
15945
16517
  config: _extends({}, config, {
15946
16518
  initialQueriesSyncTime: props.initialQueriesSyncTime,
@@ -15949,11 +16521,13 @@
15949
16521
  themePreset: themePreset
15950
16522
  }),
15951
16523
  appbaseRef: appbaseRef,
16524
+ analyticsRef: analyticsRef,
15952
16525
  selectedValues: selectedValues,
15953
16526
  urlValues: urlValues,
15954
16527
  headers: this.getHeaders
15955
16528
  }, this.$props.initialState);
15956
16529
  this.store = configureStore(initialState);
16530
+ this.analyticsRef = analyticsRef;
15957
16531
  }
15958
16532
  },
15959
16533
  render: function render() {
@@ -15964,7 +16538,8 @@
15964
16538
  className = _this$$props2.className;
15965
16539
  return h(Provider, {
15966
16540
  "attrs": {
15967
- "store": this.store
16541
+ "store": this.store,
16542
+ "analyticsRef": this.analyticsRef
15968
16543
  }
15969
16544
  }, [h(URLParamsProvider$1, {
15970
16545
  "attrs": {
@@ -15983,7 +16558,7 @@
15983
16558
  };
15984
16559
 
15985
16560
  /**!
15986
- * hotkeys-js v3.10.0
16561
+ * hotkeys-js v3.10.1
15987
16562
  * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
15988
16563
  *
15989
16564
  * Copyright (c) 2022 kenny wong <wowohoo@qq.com>
@@ -16499,12 +17074,14 @@
16499
17074
  function trigger(shortcut) {
16500
17075
  var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
16501
17076
  Object.keys(_handlers).forEach(function (key) {
16502
- var data = _handlers[key].find(function (item) {
17077
+ var dataList = _handlers[key].filter(function (item) {
16503
17078
  return item.scope === scope && item.shortcut === shortcut;
16504
17079
  });
16505
- if (data && data.method) {
16506
- data.method();
16507
- }
17080
+ dataList.forEach(function (data) {
17081
+ if (data && data.method) {
17082
+ data.method();
17083
+ }
17084
+ });
16508
17085
  });
16509
17086
  }
16510
17087
  var _api = {
@@ -18413,10 +18990,11 @@
18413
18990
  }
18414
18991
  }
18415
18992
  this.handleTextChange = debounce$1(this.handleText, this.$props.debounce);
18993
+ this.updateDefaultQueryHandlerDebounced = debounce$1(this.updateDefaultQueryHandler, this.$props.debounce);
18416
18994
  // Set custom and default queries in store
18417
18995
  updateCustomQuery(this.componentId, this.setCustomQuery, this.$props, this.currentValue);
18418
18996
  updateDefaultQuery(this.componentId, this.setDefaultQuery, this.$props, this.currentValue);
18419
- this.updateDefaultQueryHandler(this.currentValue, this.$props, false);
18997
+ this.updateDefaultQueryHandlerDebounced(this.currentValue, this.$props, false);
18420
18998
  },
18421
18999
  computed: {
18422
19000
  suggestionsList: function suggestionsList() {
@@ -18601,7 +19179,7 @@
18601
19179
  },
18602
19180
  defaultQuery: function defaultQuery(newVal, oldVal) {
18603
19181
  if (!isQueryIdentical(newVal, oldVal, this.$data.currentValue, this.$props)) {
18604
- this.updateDefaultQueryHandler(this.$data.currentValue, this.$props);
19182
+ this.updateDefaultQueryHandlerDebounced(this.$data.currentValue, this.$props);
18605
19183
  }
18606
19184
  },
18607
19185
  customQuery: function customQuery(newVal, oldVal) {
@@ -18637,9 +19215,9 @@
18637
19215
  methods: {
18638
19216
  handleText: function handleText(value) {
18639
19217
  if (this.$props.autosuggest) {
18640
- this.updateDefaultQueryHandler(value, this.$props);
19218
+ this.updateDefaultQueryHandlerDebounced(value, this.$props);
18641
19219
  } else {
18642
- this.updateQueryHandler(this.$props.componentId, value, this.$props);
19220
+ this.updateDefaultQueryHandlerDebounced(this.$props.componentId, value, this.$props);
18643
19221
  }
18644
19222
  },
18645
19223
  validateDataField: function validateDataField() {
@@ -18780,7 +19358,7 @@
18780
19358
  if (toggleIsOpen) {
18781
19359
  _this.isOpen = false;
18782
19360
  }
18783
- if (typeof value === 'string') _this.updateDefaultQueryHandler(value, _this.$props);
19361
+ if (typeof value === 'string') _this.updateDefaultQueryHandlerDebounced(value, _this.$props);
18784
19362
  } // in case of strict selection only SUGGESTION_SELECT should be able
18785
19363
  // to set the query otherwise the value should reset
18786
19364
 
@@ -18814,6 +19392,9 @@
18814
19392
  checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
18815
19393
  },
18816
19394
  updateDefaultQueryHandler: function updateDefaultQueryHandler(value, props, execute) {
19395
+ if (props === void 0) {
19396
+ props = this.$props;
19397
+ }
18817
19398
  if (!value && props.enableDefaultSuggestions === false) {
18818
19399
  // clear Component data from store
18819
19400
  this.resetStoreForComponent(props.componentId);
@@ -18946,7 +19527,7 @@
18946
19527
  if (_this2.$options.isTagsMode && autosuggest) {
18947
19528
  _this2.currentValue = value;
18948
19529
  _this2.isOpen = isOpen;
18949
- _this2.updateDefaultQueryHandler(_this2.currentValue, _this2.$props);
19530
+ _this2.updateDefaultQueryHandlerDebounced(_this2.currentValue, _this2.$props);
18950
19531
  return;
18951
19532
  }
18952
19533
  _this2.triggerQuery({
@@ -23414,7 +23995,7 @@
23414
23995
  * Released under the MIT License.
23415
23996
  */
23416
23997
 
23417
- var index$2 = {
23998
+ var index$3 = {
23418
23999
  name: 'NoSsr',
23419
24000
  functional: true,
23420
24001
  props: {
@@ -23451,7 +24032,7 @@
23451
24032
  }) : h(false);
23452
24033
  }
23453
24034
  };
23454
- var vueNoSsr_common = index$2;
24035
+ var vueNoSsr_common = index$3;
23455
24036
 
23456
24037
  var _templateObject$o;
23457
24038
  var Slider = index$1('div')(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n\tmargin-top: 30px;\n\tpadding: 10px;\n\n\t/* component style */\n\t.vue-slider-disabled {\n\t\topacity: 0.5;\n\t\tcursor: not-allowed;\n\t}\n\n\t/* rail style */\n\t.vue-slider-rail {\n\t\tbackground-color: #ccc;\n\t\tborder-radius: 15px;\n\t\theight: 4px;\n\t}\n\n\t/* process style */\n\t.vue-slider-process {\n\t\tbackground-color: #0b6aff;\n\t\tborder-radius: 15px;\n\t}\n\n\t/* mark style */\n\t.vue-slider-mark {\n\t\tz-index: 4;\n\t}\n\n\t.vue-slider-mark:first-child .vue-slider-mark-step,\n\t.vue-slider-mark:last-child .vue-slider-mark-step {\n\t\tdisplay: none;\n\t}\n\n\t.vue-slider-mark-step {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: rgba(0, 0, 0, 0.16);\n\t}\n\n\t.vue-slider-mark-label {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t}\n\n\t/* dot style */\n\t.vue-slider-dot {\n\t\tz-index: 2;\n\t}\n\n\t.vue-slider-dot-handle {\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder-radius: 50%;\n\t\tbackground-color: #fff;\n\t\tbox-sizing: border-box;\n\t\tborder: 1px solid #9a9a9a;\n\t\tz-index: 2;\n\t\tbox-shadow: 0.5px 0.5px 2px 1px rgb(0 0 0 / 32%);\n\t}\n\n\t.vue-slider-dot-handle-disabled {\n\t\tcursor: not-allowed;\n\t\tbackground-color: #ccc;\n\t}\n\n\t.vue-slider-dot-tooltip-inner {\n\t\tfont-size: 14px;\n\t\twhite-space: nowrap;\n\t\tpadding: 2px 5px;\n\t\tmin-width: 20px;\n\t\ttext-align: center;\n\t\tcolor: #fff;\n\t\tborder-radius: 5px;\n\t\tborder: 1px solid #3498db;\n\t\tbackground-color: #3498db;\n\t\tbox-sizing: content-box;\n\t}\n\n\t.vue-slider-dot-tooltip-inner::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-top::after {\n\t\ttop: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-top-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-bottom::after {\n\t\tbottom: 100%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-bottom-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-left::after {\n\t\tleft: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-left-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-inner-right::after {\n\t\tright: 100%;\n\t\ttop: 50%;\n\t\ttransform: translate(0, -50%);\n\t\theight: 0;\n\t\twidth: 0;\n\t\tborder-color: transparent;\n\t\tborder-style: solid;\n\t\tborder-width: 5px;\n\t\tborder-right-color: inherit;\n\t}\n\n\t.vue-slider-dot-tooltip-wrapper {\n\t\topacity: 0;\n\t\ttransition: all 0.3s;\n\t}\n\t.vue-slider-dot-tooltip-wrapper-show {\n\t\topacity: 1;\n\t}\n\n\t.label-container {\n\t\tmargin: 10px 0;\n\t\twidth: 100%;\n\t}\n\n\t.range-label-right {\n\t\tfloat: right;\n\t}\n"])));
@@ -24233,7 +24814,13 @@
24233
24814
  },
24234
24815
  selectedValue: function selectedValue(newVal) {
24235
24816
  if (!isEqual$d(this.$data.currentValue, newVal)) {
24236
- this.selectItem(newVal, true, undefined, true);
24817
+ var processSelectedValues = newVal ? newVal.map(function (item) {
24818
+ if (typeof item === 'object' && 'label' in item) {
24819
+ return item.label;
24820
+ }
24821
+ return item;
24822
+ }) : null;
24823
+ this.selectItem(processSelectedValues, true, undefined, true);
24237
24824
  }
24238
24825
  },
24239
24826
  customQuery: function customQuery(newVal, oldVal) {
@@ -25638,6 +26225,7 @@
25638
26225
  Vue.component(ResultListTitle.name, ResultListTitle);
25639
26226
  };
25640
26227
 
26228
+ var setSearchState = lib_5.setSearchState;
25641
26229
  var getSearchState = lib_8.getSearchState;
25642
26230
  var defaultKeys = ['hits', 'value', 'aggregations', 'error'];
25643
26231
  var filterProps = function filterProps(props) {
@@ -25648,6 +26236,15 @@
25648
26236
  props: props.componentProps
25649
26237
  });
25650
26238
  };
26239
+ var convertArrayLike = function convertArrayLike(arrayLike) {
26240
+ var arr = [];
26241
+ var i = 0;
26242
+ while (arrayLike[i]) {
26243
+ arr[i] = arrayLike[i];
26244
+ i += 1;
26245
+ }
26246
+ return arr;
26247
+ };
25651
26248
  var filterByComponentIds = function filterByComponentIds(state, props) {
25652
26249
  if (props === void 0) {
25653
26250
  props = {};
@@ -25809,21 +26406,28 @@
25809
26406
  }
25810
26407
  },
25811
26408
  setSearchState: function setSearchState(valuesMap) {
26409
+ var _this = this;
25812
26410
  if (valuesMap === void 0) {
25813
26411
  valuesMap = {};
25814
26412
  }
25815
26413
  var components = this.components;
25816
26414
  var computedValuesMap = {};
25817
- components.filter(function (component) {
25818
- return !transform_11(component);
26415
+ convertArrayLike(components).filter(function (component) {
26416
+ return !transform_12(component);
25819
26417
  }).forEach(function (component) {
25820
26418
  if (component in valuesMap) {
25821
- computedValuesMap[component] = valuesMap[component];
26419
+ computedValuesMap[component] = {
26420
+ value: valuesMap[component],
26421
+ componentProps: _this.componentProps[component]
26422
+ };
25822
26423
  } else {
25823
- computedValuesMap[component] = null;
26424
+ computedValuesMap[component] = {
26425
+ value: null,
26426
+ componentProps: _this.componentProps[component]
26427
+ };
25824
26428
  }
25825
26429
  });
25826
- this.setValues(computedValuesMap);
26430
+ this.setSearchStateFn(computedValuesMap);
25827
26431
  }
25828
26432
  },
25829
26433
  render: function render() {
@@ -25853,7 +26457,7 @@
25853
26457
  };
25854
26458
  };
25855
26459
  var mapDispatchtoProps$d = {
25856
- setValues: value_6
26460
+ setSearchStateFn: setSearchState
25857
26461
  };
25858
26462
  var StateProviderConnected = connect(mapStateToProps$h, mapDispatchtoProps$d)(StateProvider);
25859
26463
  StateProvider.install = function (Vue) {
@@ -34205,7 +34809,7 @@
34205
34809
  }
34206
34810
  // [4] set query list
34207
34811
  // Do not set default query for suggestions
34208
- if (isInternalComponentPresent && !transform_7(component.componentType)) {
34812
+ if (isInternalComponentPresent && !transform_8(component.componentType)) {
34209
34813
  var _ref2 = getDefaultQuery(component, value) || {},
34210
34814
  defaultQuery = _ref2.query,
34211
34815
  defaultQueryOptions = _objectWithoutPropertiesLoose(_ref2, _excluded2);
@@ -34274,13 +34878,13 @@
34274
34878
  }, componentQueryOptions, queryOptions[component.componentId]);
34275
34879
  queryLog = _extends({}, queryLog, (_extends2 = {}, _extends2[component.componentId] = currentQuery, _extends2));
34276
34880
  if (settings.enableAppbase) {
34277
- var query = transform_4(component.componentId, transform_2(state, component.componentId, queryOptions && Object.keys(queryOptions[component.componentId]).length ? {
34881
+ var query = transform_5(component.componentId, transform_3(state, component.componentId, queryOptions && Object.keys(queryOptions[component.componentId]).length ? {
34278
34882
  from: queryOptions[component.componentId].from
34279
34883
  } : null));
34280
34884
  if (query) {
34281
34885
  var _extends3;
34282
34886
  // Apply dependent queries
34283
- appbaseQuery = _extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), transform_1(state, component.componentId, orderOfQueries));
34887
+ appbaseQuery = _extends({}, appbaseQuery, (_extends3 = {}, _extends3[component.componentId] = query, _extends3), transform_2(state, component.componentId, orderOfQueries));
34284
34888
  }
34285
34889
  } else {
34286
34890
  var preference = config && config.analyticsConfig && config.analyticsConfig.userId ? config.analyticsConfig.userId + "_" + component : component;
@@ -34439,7 +35043,7 @@
34439
35043
  });
34440
35044
  }
34441
35045
 
34442
- var version = "1.33.2";
35046
+ var version = "1.33.4";
34443
35047
 
34444
35048
  var components$1 = [ReactiveList, ResultCard, ResultList, ReactiveBase, DataSearch, SearchBox, SingleList, MultiList, SingleRange, MultiRange, RangeSlider, DynamicRangeSlider, ReactiveComponent, SelectedFilters, ToggleButton, SingleDropdownList, MultiDropdownList, StateProvider, RangeInput];
34445
35049
  function install (Vue) {
@@ -34453,7 +35057,7 @@
34453
35057
  if (typeof window !== 'undefined' && window.Vue) {
34454
35058
  install(window.Vue);
34455
35059
  }
34456
- var index$3 = {
35060
+ var index$4 = {
34457
35061
  version: version,
34458
35062
  install: install
34459
35063
  };
@@ -34479,7 +35083,7 @@
34479
35083
  exports.StateProvider = StateProvider;
34480
35084
  exports.ToggleButton = ToggleButton;
34481
35085
  exports.componentTypes = constants_1$1;
34482
- exports.default = index$3;
35086
+ exports.default = index$4;
34483
35087
  exports.initReactivesearch = initReactivesearch;
34484
35088
  exports.install = install;
34485
35089
  exports.version = version;