@sonic-equipment/ui 220.0.0 → 221.0.0

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 (87) hide show
  1. package/dist/algolia/algolia-search-provider.js +2 -2
  2. package/dist/algolia/use-algolia-search.d.ts +1 -1
  3. package/dist/global-search/plugins/categories-plugin.d.ts +1 -1
  4. package/dist/global-search/plugins/categories-plugin.js +1 -1
  5. package/dist/global-search/plugins/popular-categories-plugin.d.ts +1 -1
  6. package/dist/global-search/plugins/popular-categories-plugin.js +1 -1
  7. package/dist/global-search/plugins/popular-searches-plugin.d.ts +1 -1
  8. package/dist/global-search/plugins/popular-searches-plugin.js +1 -1
  9. package/dist/global-search/plugins/query-suggestions-plugin.d.ts +1 -1
  10. package/dist/global-search/plugins/query-suggestions-plugin.js +1 -1
  11. package/dist/global-search/plugins/quick-access-plugin.d.ts +1 -1
  12. package/dist/global-search/plugins/quick-access-plugin.js +1 -1
  13. package/dist/global-search/plugins/recent-searches-plugin.d.ts +1 -1
  14. package/dist/global-search/plugins/recent-searches-plugin.js +2 -1
  15. package/dist/global-search/search-highlight/highlight.d.ts +1 -1
  16. package/dist/global-search/search-highlight/highlight.js +1 -1
  17. package/dist/global-search/types.d.ts +1 -1
  18. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.js +7 -0
  19. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js +109 -0
  20. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/createStore.js +31 -0
  21. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.js +51 -0
  22. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.js +12 -0
  23. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.js +135 -0
  24. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js +355 -0
  25. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/metadata.js +44 -0
  26. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/onInput.js +148 -0
  27. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js +202 -0
  28. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/reshape.js +48 -0
  29. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/resolve.js +119 -0
  30. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.js +149 -0
  31. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.js +50 -0
  32. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.js +42 -0
  33. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.js +38 -0
  34. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.js +79 -0
  35. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getAutocompleteElementId.js +12 -0
  36. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNativeEvent.js +5 -0
  37. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.js +31 -0
  38. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.js +53 -0
  39. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getPluginSubmitPromise.js +39 -0
  40. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.js +5 -0
  41. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/isSamsung.js +6 -0
  42. package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.js +25 -0
  43. package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/requesters/createAlgoliaRequester.js +16 -0
  44. package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/requesters/getAlgoliaResults.js +12 -0
  45. package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/userAgents.js +8 -0
  46. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createAlgoliaInsightsPlugin.js +252 -0
  47. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createClickedEvent.js +16 -0
  48. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createSearchInsightsApi.js +209 -0
  49. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createViewedEvents.js +18 -0
  50. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/isAlgoliaInsightsHit.js +5 -0
  51. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/isModernInsightsClient.js +25 -0
  52. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_algoliase_q33j3oaxy2utuyscyksb32r6mu/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/constants.js +7 -0
  53. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_algoliase_q33j3oaxy2utuyscyksb32r6mu/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/createQuerySuggestionsPlugin.js +118 -0
  54. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_algoliase_q33j3oaxy2utuyscyksb32r6mu/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/getTemplates.js +64 -0
  55. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/addHighlightedAttribute.js +21 -0
  56. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/constants.js +10 -0
  57. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createLocalStorage.js +36 -0
  58. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createLocalStorageRecentSearchesPlugin.js +49 -0
  59. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createRecentSearchesPlugin.js +137 -0
  60. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createStorageApi.js +16 -0
  61. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/getLocalStorage.js +33 -0
  62. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/getTemplates.js +72 -0
  63. package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/search.js +25 -0
  64. package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.js +4 -0
  65. package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js +25 -0
  66. package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.js +51 -0
  67. package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.js +6 -0
  68. package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.js +37 -0
  69. package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js +19 -0
  70. package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.js +69 -0
  71. package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/utils/getAppIdAndApiKey.js +16 -0
  72. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.js +7 -0
  73. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.js +16 -0
  74. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.js +34 -0
  75. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js +7 -0
  76. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js +6 -0
  77. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.js +7 -0
  78. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js +10 -0
  79. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.js +15 -0
  80. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.js +26 -0
  81. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/noop.js +3 -0
  82. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/safelyRunOnBrowser.js +13 -0
  83. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.js +8 -0
  84. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/version.js +3 -0
  85. package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/warn.js +26 -0
  86. package/dist/shared/utils/uuid.js +1 -1
  87. package/package.json +1 -1
@@ -0,0 +1,209 @@
1
+ import { isModernInsightsClient } from './isModernInsightsClient.js';
2
+
3
+ var _excluded = ["items"],
4
+ _excluded2 = ["items"];
5
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
6
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
18
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
19
+ function chunk(item) {
20
+ var chunkSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
21
+ var chunks = [];
22
+ for (var i = 0; i < item.objectIDs.length; i += chunkSize) {
23
+ chunks.push(_objectSpread(_objectSpread({}, item), {}, {
24
+ objectIDs: item.objectIDs.slice(i, i + chunkSize)
25
+ }));
26
+ }
27
+ return chunks;
28
+ }
29
+ function mapToInsightsParamsApi(params) {
30
+ return params.map(function (_ref) {
31
+ var items = _ref.items,
32
+ param = _objectWithoutProperties(_ref, _excluded);
33
+ return _objectSpread(_objectSpread({}, param), {}, {
34
+ objectIDs: (items === null || items === void 0 ? void 0 : items.map(function (_ref2) {
35
+ var objectID = _ref2.objectID;
36
+ return objectID;
37
+ })) || param.objectIDs
38
+ });
39
+ });
40
+ }
41
+ function createSearchInsightsApi(searchInsights) {
42
+ var canSendHeaders = isModernInsightsClient(searchInsights);
43
+ function sendToInsights(method, payloads, items) {
44
+ if (canSendHeaders && typeof items !== 'undefined') {
45
+ var _items$0$__autocomple = items[0].__autocomplete_algoliaCredentials,
46
+ appId = _items$0$__autocomple.appId,
47
+ apiKey = _items$0$__autocomple.apiKey;
48
+ var headers = {
49
+ 'X-Algolia-Application-Id': appId,
50
+ 'X-Algolia-API-Key': apiKey
51
+ };
52
+ searchInsights.apply(void 0, [method].concat(_toConsumableArray(payloads), [{
53
+ headers: headers
54
+ }]));
55
+ } else {
56
+ searchInsights.apply(void 0, [method].concat(_toConsumableArray(payloads)));
57
+ }
58
+ }
59
+ return {
60
+ /**
61
+ * Initializes Insights with Algolia credentials.
62
+ */
63
+ init: function init(appId, apiKey) {
64
+ searchInsights('init', {
65
+ appId: appId,
66
+ apiKey: apiKey
67
+ });
68
+ },
69
+ /**
70
+ * Sets the authenticated user token to attach to events.
71
+ * Unsets the authenticated token by passing `undefined`.
72
+ *
73
+ * @link https://www.algolia.com/doc/api-reference/api-methods/set-authenticated-user-token/
74
+ */
75
+ setAuthenticatedUserToken: function setAuthenticatedUserToken(authenticatedUserToken) {
76
+ searchInsights('setAuthenticatedUserToken', authenticatedUserToken);
77
+ },
78
+ /**
79
+ * Sets the user token to attach to events.
80
+ */
81
+ setUserToken: function setUserToken(userToken) {
82
+ searchInsights('setUserToken', userToken);
83
+ },
84
+ /**
85
+ * Sends click events to capture a query and its clicked items and positions.
86
+ *
87
+ * @link https://www.algolia.com/doc/api-reference/api-methods/clicked-object-ids-after-search/
88
+ */
89
+ clickedObjectIDsAfterSearch: function clickedObjectIDsAfterSearch() {
90
+ for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
91
+ params[_key] = arguments[_key];
92
+ }
93
+ if (params.length > 0) {
94
+ sendToInsights('clickedObjectIDsAfterSearch', mapToInsightsParamsApi(params), params[0].items);
95
+ }
96
+ },
97
+ /**
98
+ * Sends click events to capture clicked items.
99
+ *
100
+ * @link https://www.algolia.com/doc/api-reference/api-methods/clicked-object-ids/
101
+ */
102
+ clickedObjectIDs: function clickedObjectIDs() {
103
+ for (var _len2 = arguments.length, params = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
104
+ params[_key2] = arguments[_key2];
105
+ }
106
+ if (params.length > 0) {
107
+ sendToInsights('clickedObjectIDs', mapToInsightsParamsApi(params), params[0].items);
108
+ }
109
+ },
110
+ /**
111
+ * Sends click events to capture the filters a user clicks on.
112
+ *
113
+ * @link https://www.algolia.com/doc/api-reference/api-methods/clicked-filters/
114
+ */
115
+ clickedFilters: function clickedFilters() {
116
+ for (var _len3 = arguments.length, params = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
117
+ params[_key3] = arguments[_key3];
118
+ }
119
+ if (params.length > 0) {
120
+ searchInsights.apply(void 0, ['clickedFilters'].concat(params));
121
+ }
122
+ },
123
+ /**
124
+ * Sends conversion events to capture a query and its clicked items.
125
+ *
126
+ * @link https://www.algolia.com/doc/api-reference/api-methods/converted-object-ids-after-search/
127
+ */
128
+ convertedObjectIDsAfterSearch: function convertedObjectIDsAfterSearch() {
129
+ for (var _len4 = arguments.length, params = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
130
+ params[_key4] = arguments[_key4];
131
+ }
132
+ if (params.length > 0) {
133
+ sendToInsights('convertedObjectIDsAfterSearch', mapToInsightsParamsApi(params), params[0].items);
134
+ }
135
+ },
136
+ /**
137
+ * Sends conversion events to capture clicked items.
138
+ *
139
+ * @link https://www.algolia.com/doc/api-reference/api-methods/converted-object-ids/
140
+ */
141
+ convertedObjectIDs: function convertedObjectIDs() {
142
+ for (var _len5 = arguments.length, params = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
143
+ params[_key5] = arguments[_key5];
144
+ }
145
+ if (params.length > 0) {
146
+ sendToInsights('convertedObjectIDs', mapToInsightsParamsApi(params), params[0].items);
147
+ }
148
+ },
149
+ /**
150
+ * Sends conversion events to capture the filters a user uses when converting.
151
+ *
152
+ * @link https://www.algolia.com/doc/api-reference/api-methods/converted-filters/
153
+ */
154
+ convertedFilters: function convertedFilters() {
155
+ for (var _len6 = arguments.length, params = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
156
+ params[_key6] = arguments[_key6];
157
+ }
158
+ if (params.length > 0) {
159
+ searchInsights.apply(void 0, ['convertedFilters'].concat(params));
160
+ }
161
+ },
162
+ /**
163
+ * Sends view events to capture clicked items.
164
+ *
165
+ * @link https://www.algolia.com/doc/api-reference/api-methods/viewed-object-ids/
166
+ */
167
+ viewedObjectIDs: function viewedObjectIDs() {
168
+ for (var _len7 = arguments.length, params = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
169
+ params[_key7] = arguments[_key7];
170
+ }
171
+ if (params.length > 0) {
172
+ params.reduce(function (acc, _ref3) {
173
+ var items = _ref3.items,
174
+ param = _objectWithoutProperties(_ref3, _excluded2);
175
+ return [].concat(_toConsumableArray(acc), _toConsumableArray(chunk(_objectSpread(_objectSpread({}, param), {}, {
176
+ objectIDs: (items === null || items === void 0 ? void 0 : items.map(function (_ref4) {
177
+ var objectID = _ref4.objectID;
178
+ return objectID;
179
+ })) || param.objectIDs
180
+ })).map(function (payload) {
181
+ return {
182
+ items: items,
183
+ payload: payload
184
+ };
185
+ })));
186
+ }, []).forEach(function (_ref5) {
187
+ var items = _ref5.items,
188
+ payload = _ref5.payload;
189
+ return sendToInsights('viewedObjectIDs', [payload], items);
190
+ });
191
+ }
192
+ },
193
+ /**
194
+ * Sends view events to capture the filters a user uses when viewing.
195
+ *
196
+ * @link https://www.algolia.com/doc/api-reference/api-methods/viewed-filters/
197
+ */
198
+ viewedFilters: function viewedFilters() {
199
+ for (var _len8 = arguments.length, params = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
200
+ params[_key8] = arguments[_key8];
201
+ }
202
+ if (params.length > 0) {
203
+ searchInsights.apply(void 0, ['viewedFilters'].concat(params));
204
+ }
205
+ }
206
+ };
207
+ }
208
+
209
+ export { createSearchInsightsApi };
@@ -0,0 +1,18 @@
1
+ function createViewedEvents(_ref) {
2
+ var items = _ref.items;
3
+ var itemsByIndexName = items.reduce(function (acc, current) {
4
+ var _acc$current$__autoco;
5
+ acc[current.__autocomplete_indexName] = ((_acc$current$__autoco = acc[current.__autocomplete_indexName]) !== null && _acc$current$__autoco !== void 0 ? _acc$current$__autoco : []).concat(current);
6
+ return acc;
7
+ }, {});
8
+ return Object.keys(itemsByIndexName).map(function (indexName) {
9
+ var items = itemsByIndexName[indexName];
10
+ return {
11
+ index: indexName,
12
+ items: items,
13
+ algoliaSource: ['autocomplete']
14
+ };
15
+ });
16
+ }
17
+
18
+ export { createViewedEvents };
@@ -0,0 +1,5 @@
1
+ function isAlgoliaInsightsHit(hit) {
2
+ return hit.objectID && hit.__autocomplete_indexName && hit.__autocomplete_queryID;
3
+ }
4
+
5
+ export { isAlgoliaInsightsHit };
@@ -0,0 +1,25 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = true, _d = false; try { if (_x = (_i = _i.call(arr)).next, 0 === i) ; else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = true, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ /**
8
+ * Determines if a given insights `client` supports the optional call to `init`
9
+ * and the ability to set credentials via extra parameters when sending events.
10
+ */
11
+ function isModernInsightsClient(client) {
12
+ var _split$map = (client.version || '').split('.').map(Number),
13
+ _split$map2 = _slicedToArray(_split$map, 2),
14
+ major = _split$map2[0],
15
+ minor = _split$map2[1];
16
+
17
+ /* eslint-disable @typescript-eslint/camelcase */
18
+ var v3 = major >= 3;
19
+ var v2_4 = major === 2 && minor >= 4;
20
+ var v1_10 = major === 1 && minor >= 10;
21
+ return v3 || v2_4 || v1_10;
22
+ /* eslint-enable @typescript-eslint/camelcase */
23
+ }
24
+
25
+ export { isModernInsightsClient };
@@ -0,0 +1,7 @@
1
+ var defaultTranslations = {
2
+ fillQueryTitle: function fillQueryTitle(text) {
3
+ return "Fill query with \"".concat(text, "\"");
4
+ }
5
+ };
6
+
7
+ export { defaultTranslations };
@@ -0,0 +1,118 @@
1
+ import { defaultTranslations } from './constants.js';
2
+ import { getTemplates } from './getTemplates.js';
3
+ import { getAlgoliaResults } from '../../../../../../@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/requesters/getAlgoliaResults.js';
4
+ import { getAttributeValueByPath } from '../../../../../../@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.js';
5
+
6
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
7
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
+ function createQuerySuggestionsPlugin(options) {
16
+ var _getOptions = getOptions(options),
17
+ searchClient = _getOptions.searchClient,
18
+ indexName = _getOptions.indexName,
19
+ getSearchParams = _getOptions.getSearchParams,
20
+ transformSource = _getOptions.transformSource,
21
+ categoryAttribute = _getOptions.categoryAttribute,
22
+ itemsWithCategories = _getOptions.itemsWithCategories,
23
+ categoriesPerItem = _getOptions.categoriesPerItem,
24
+ translations = _getOptions.translations;
25
+ return {
26
+ name: 'aa.querySuggestionsPlugin',
27
+ getSources: function getSources(_ref) {
28
+ var query = _ref.query,
29
+ setQuery = _ref.setQuery,
30
+ refresh = _ref.refresh,
31
+ state = _ref.state;
32
+ function onTapAhead(item) {
33
+ setQuery("".concat(item.query, " "));
34
+ refresh();
35
+ }
36
+ return [transformSource({
37
+ source: {
38
+ sourceId: 'querySuggestionsPlugin',
39
+ getItemInputValue: function getItemInputValue(_ref2) {
40
+ var item = _ref2.item;
41
+ return item.query;
42
+ },
43
+ getItems: function getItems() {
44
+ return getAlgoliaResults({
45
+ searchClient: searchClient,
46
+ queries: [{
47
+ indexName: indexName,
48
+ query: query,
49
+ params: getSearchParams({
50
+ state: state
51
+ })
52
+ }],
53
+ transformResponse: function transformResponse(_ref3) {
54
+ var hits = _ref3.hits;
55
+ var querySuggestionsHits = hits[0];
56
+ if (!query || !categoryAttribute) {
57
+ return querySuggestionsHits;
58
+ }
59
+ var itemsWithCategoriesAdded = 0;
60
+ return querySuggestionsHits.reduce(function (acc, current) {
61
+ var items = [current];
62
+ if (itemsWithCategoriesAdded < itemsWithCategories) {
63
+ var categories = (getAttributeValueByPath(current, Array.isArray(categoryAttribute) ? categoryAttribute : [categoryAttribute]) || []).map(function (x) {
64
+ return x.value;
65
+ }).slice(0, categoriesPerItem);
66
+ if (categories.length > 0) {
67
+ itemsWithCategoriesAdded++;
68
+ }
69
+ var _iterator = _createForOfIteratorHelper(categories),
70
+ _step;
71
+ try {
72
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
73
+ var category = _step.value;
74
+ items.push(_objectSpread({
75
+ __autocomplete_qsCategory: category
76
+ }, current));
77
+ }
78
+ } catch (err) {
79
+ _iterator.e(err);
80
+ } finally {
81
+ _iterator.f();
82
+ }
83
+ }
84
+ acc.push.apply(acc, items);
85
+ return acc;
86
+ }, []);
87
+ }
88
+ });
89
+ },
90
+ templates: getTemplates({
91
+ onTapAhead: onTapAhead,
92
+ translations: translations
93
+ })
94
+ },
95
+ onTapAhead: onTapAhead,
96
+ state: state
97
+ })];
98
+ },
99
+ __autocomplete_pluginOptions: options
100
+ };
101
+ }
102
+ function getOptions(options) {
103
+ return _objectSpread(_objectSpread({
104
+ getSearchParams: function getSearchParams() {
105
+ return {};
106
+ },
107
+ transformSource: function transformSource(_ref4) {
108
+ var source = _ref4.source;
109
+ return source;
110
+ },
111
+ itemsWithCategories: 1,
112
+ categoriesPerItem: 1
113
+ }, options), {}, {
114
+ translations: _objectSpread(_objectSpread({}, defaultTranslations), options.translations)
115
+ });
116
+ }
117
+
118
+ export { createQuerySuggestionsPlugin };
@@ -0,0 +1,64 @@
1
+ /** @jsxRuntime classic */
2
+ /** @jsx createElement */
3
+
4
+ function getTemplates(_ref) {
5
+ var onTapAhead = _ref.onTapAhead,
6
+ translations = _ref.translations;
7
+ return {
8
+ item: function item(_ref2) {
9
+ var item = _ref2.item,
10
+ createElement = _ref2.createElement,
11
+ components = _ref2.components;
12
+ if (item.__autocomplete_qsCategory) {
13
+ return createElement("div", {
14
+ className: "aa-ItemWrapper"
15
+ }, createElement("div", {
16
+ className: "aa-ItemContent aa-ItemContent--indented"
17
+ }, createElement("div", {
18
+ className: "aa-ItemContentSubtitle aa-ItemContentSubtitle--standalone"
19
+ }, createElement("span", {
20
+ className: "aa-ItemContentSubtitleIcon"
21
+ }), createElement("span", null, "in", ' ', createElement("span", {
22
+ className: "aa-ItemContentSubtitleCategory"
23
+ }, item.__autocomplete_qsCategory)))));
24
+ }
25
+ return createElement("div", {
26
+ className: "aa-ItemWrapper"
27
+ }, createElement("div", {
28
+ className: "aa-ItemContent"
29
+ }, createElement("div", {
30
+ className: "aa-ItemIcon aa-ItemIcon--noBorder"
31
+ }, createElement("svg", {
32
+ viewBox: "0 0 24 24",
33
+ fill: "currentColor"
34
+ }, createElement("path", {
35
+ d: "M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z"
36
+ }))), createElement("div", {
37
+ className: "aa-ItemContentBody"
38
+ }, createElement("div", {
39
+ className: "aa-ItemContentTitle"
40
+ }, createElement(components.ReverseHighlight, {
41
+ hit: item,
42
+ attribute: "query"
43
+ })))), createElement("div", {
44
+ className: "aa-ItemActions"
45
+ }, createElement("button", {
46
+ type: "button",
47
+ className: "aa-ItemActionButton",
48
+ title: translations.fillQueryTitle(item.query),
49
+ onClick: function onClick(event) {
50
+ event.preventDefault();
51
+ event.stopPropagation();
52
+ onTapAhead(item);
53
+ }
54
+ }, createElement("svg", {
55
+ viewBox: "0 0 24 24",
56
+ fill: "currentColor"
57
+ }, createElement("path", {
58
+ 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"
59
+ })))));
60
+ }
61
+ };
62
+ }
63
+
64
+ export { getTemplates };
@@ -0,0 +1,21 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function addHighlightedAttribute(_ref) {
8
+ var item = _ref.item,
9
+ query = _ref.query;
10
+ return _objectSpread(_objectSpread({}, item), {}, {
11
+ _highlightResult: {
12
+ label: {
13
+ value: query ? item.label.replace(new RegExp(query.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), 'gi'), function (match) {
14
+ return "__aa-highlight__".concat(match, "__/aa-highlight__");
15
+ }) : item.label
16
+ }
17
+ }
18
+ });
19
+ }
20
+
21
+ export { addHighlightedAttribute };
@@ -0,0 +1,10 @@
1
+ var LOCAL_STORAGE_KEY = 'AUTOCOMPLETE_RECENT_SEARCHES';
2
+ var LOCAL_STORAGE_KEY_TEST = '__AUTOCOMPLETE_RECENT_SEARCHES_PLUGIN_TEST_KEY__';
3
+ var defaultTranslations = {
4
+ removeSearchTitle: 'Remove this search',
5
+ fillQueryTitle: function fillQueryTitle(text) {
6
+ return "Fill query with \"".concat(text, "\"");
7
+ }
8
+ };
9
+
10
+ export { LOCAL_STORAGE_KEY, LOCAL_STORAGE_KEY_TEST, defaultTranslations };
@@ -0,0 +1,36 @@
1
+ import { getLocalStorage } from './getLocalStorage.js';
2
+
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function createLocalStorage(_ref) {
10
+ var key = _ref.key,
11
+ limit = _ref.limit,
12
+ search = _ref.search;
13
+ var storage = getLocalStorage({
14
+ key: key
15
+ });
16
+ return {
17
+ onAdd: function onAdd(item) {
18
+ storage.setItem([item].concat(_toConsumableArray(storage.getItem())));
19
+ },
20
+ onRemove: function onRemove(id) {
21
+ storage.setItem(storage.getItem().filter(function (x) {
22
+ return x.id !== id;
23
+ }));
24
+ },
25
+ getAll: function getAll() {
26
+ var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
27
+ return search({
28
+ query: query,
29
+ items: storage.getItem(),
30
+ limit: limit
31
+ }).slice(0, limit);
32
+ }
33
+ };
34
+ }
35
+
36
+ export { createLocalStorage };
@@ -0,0 +1,49 @@
1
+ import { defaultTranslations, LOCAL_STORAGE_KEY } from './constants.js';
2
+ import { createLocalStorage } from './createLocalStorage.js';
3
+ import { createRecentSearchesPlugin } from './createRecentSearchesPlugin.js';
4
+ import { search } from './search.js';
5
+
6
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
7
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ function createLocalStorageRecentSearchesPlugin(options) {
13
+ var _getOptions = getOptions(options),
14
+ key = _getOptions.key,
15
+ limit = _getOptions.limit,
16
+ transformSource = _getOptions.transformSource,
17
+ search = _getOptions.search,
18
+ subscribe = _getOptions.subscribe,
19
+ translations = _getOptions.translations;
20
+ var storage = createLocalStorage({
21
+ key: [LOCAL_STORAGE_KEY, key].join(':'),
22
+ limit: limit,
23
+ search: search
24
+ });
25
+ var recentSearchesPlugin = createRecentSearchesPlugin({
26
+ transformSource: transformSource,
27
+ storage: storage,
28
+ subscribe: subscribe,
29
+ translations: translations
30
+ });
31
+ return _objectSpread(_objectSpread({}, recentSearchesPlugin), {}, {
32
+ name: 'aa.localStorageRecentSearchesPlugin',
33
+ __autocomplete_pluginOptions: options
34
+ });
35
+ }
36
+ function getOptions(options) {
37
+ return _objectSpread(_objectSpread({
38
+ limit: 5,
39
+ search: search,
40
+ transformSource: function transformSource(_ref) {
41
+ var source = _ref.source;
42
+ return source;
43
+ }
44
+ }, options), {}, {
45
+ translations: _objectSpread(_objectSpread({}, defaultTranslations), options.translations)
46
+ });
47
+ }
48
+
49
+ export { createLocalStorageRecentSearchesPlugin };