@sonic-equipment/ui 219.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 (112) hide show
  1. package/dist/algolia/algolia-search-provider.js +7 -5
  2. package/dist/algolia/algolia-sonic-searchclient.js +2 -2
  3. package/dist/algolia/use-algolia-insights.d.ts +7 -0
  4. package/dist/algolia/use-algolia-insights.js +45 -7
  5. package/dist/algolia/use-algolia-search.d.ts +2 -1
  6. package/dist/buttons/favorite/connected-favorite-button.d.ts +1 -1
  7. package/dist/buttons/favorite/connected-favorite-button.js +0 -2
  8. package/dist/cards/product-card/product-card.js +5 -2
  9. package/dist/exports.d.ts +1 -0
  10. package/dist/global-search/plugins/categories-plugin.d.ts +1 -1
  11. package/dist/global-search/plugins/categories-plugin.js +1 -1
  12. package/dist/global-search/plugins/popular-categories-plugin.d.ts +1 -1
  13. package/dist/global-search/plugins/popular-categories-plugin.js +1 -1
  14. package/dist/global-search/plugins/popular-searches-plugin.d.ts +1 -1
  15. package/dist/global-search/plugins/popular-searches-plugin.js +1 -1
  16. package/dist/global-search/plugins/query-suggestions-plugin.d.ts +1 -1
  17. package/dist/global-search/plugins/query-suggestions-plugin.js +1 -1
  18. package/dist/global-search/plugins/quick-access-plugin.d.ts +1 -1
  19. package/dist/global-search/plugins/quick-access-plugin.js +1 -1
  20. package/dist/global-search/plugins/recent-searches-plugin.d.ts +1 -1
  21. package/dist/global-search/plugins/recent-searches-plugin.js +2 -1
  22. package/dist/global-search/search-highlight/highlight.d.ts +1 -1
  23. package/dist/global-search/search-highlight/highlight.js +1 -1
  24. package/dist/global-search/types.d.ts +3 -1
  25. package/dist/header/buttons/account/connected-account-button.js +1 -1
  26. package/dist/index.js +2 -1
  27. package/dist/intl/translation-id.d.ts +1 -1
  28. package/dist/navigation/quick-access-menu/quick-access-menu.d.ts +2 -1
  29. package/dist/navigation/quick-access-menu/quick-access-menu.js +2 -2
  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/checkOptions.js +7 -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/createAutocomplete.js +109 -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/createStore.js +31 -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/getAutocompleteSetters.js +51 -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/getCompletion.js +12 -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/getDefaultProps.js +135 -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/getPropGetters.js +355 -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/metadata.js +44 -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/onInput.js +148 -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/onKeyDown.js +202 -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/reshape.js +48 -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/resolve.js +119 -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/stateReducer.js +149 -0
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. 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
  49. 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
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. 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
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. 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
  80. 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
  81. 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
  82. 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
  83. 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
  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/createRef.js +7 -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/debounce.js +16 -0
  86. 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
  87. 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
  88. 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
  89. 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
  90. 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
  91. 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
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. package/dist/pages/account/sign-in-page/sign-in-page.js +1 -1
  99. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.d.ts +1 -1
  100. package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.js +1 -1
  101. package/dist/pages/my-sonic/pages/favorites/favorites-page.js +26 -1
  102. package/dist/shared/api/bff/hooks/use-fetch-favorites.d.ts +2 -0
  103. package/dist/shared/api/bff/hooks/use-fetch-favorites.js +29 -0
  104. package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +5 -12
  105. package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-wishlist.js +6 -9
  106. package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +4 -7
  107. package/dist/shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js +10 -20
  108. package/dist/shared/api/storefront/services/wishlist-service.d.ts +4 -1
  109. package/dist/shared/api/storefront/services/wishlist-service.js +16 -1
  110. package/dist/shared/utils/uuid.js +1 -1
  111. package/dist/styles.css +6 -6
  112. package/package.json +1 -1
@@ -0,0 +1,137 @@
1
+ import { defaultTranslations } from './constants.js';
2
+ import { createStorageApi } from './createStorageApi.js';
3
+ import { getTemplates } from './getTemplates.js';
4
+ import { createRef } from '../../../../../../@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';
5
+ import { warn } from '../../../../../../@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';
6
+
7
+ 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); }
8
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
+ 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."); }
10
+ 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); }
11
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
+ 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; }
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 getDefaultSubscribe(store) {
20
+ return function subscribe(_ref) {
21
+ var onSelect = _ref.onSelect;
22
+ onSelect(function (_ref2) {
23
+ var item = _ref2.item,
24
+ state = _ref2.state,
25
+ source = _ref2.source;
26
+ var inputValue = source.getItemInputValue({
27
+ item: item,
28
+ state: state
29
+ });
30
+ if (source.sourceId === 'querySuggestionsPlugin' && inputValue) {
31
+ var recentItem = {
32
+ id: inputValue,
33
+ label: inputValue,
34
+ category: item.__autocomplete_qsCategory
35
+ };
36
+ store.addItem(recentItem);
37
+ }
38
+ });
39
+ };
40
+ }
41
+ function createRecentSearchesPlugin(options) {
42
+ var _getOptions = getOptions(options),
43
+ storage = _getOptions.storage,
44
+ transformSource = _getOptions.transformSource,
45
+ subscribe = _getOptions.subscribe,
46
+ translations = _getOptions.translations;
47
+ var store = createStorageApi(storage);
48
+ var lastItemsRef = createRef([]);
49
+ return {
50
+ name: 'aa.recentSearchesPlugin',
51
+ subscribe: subscribe !== null && subscribe !== void 0 ? subscribe : getDefaultSubscribe(store),
52
+ onSubmit: function onSubmit(_ref3) {
53
+ var state = _ref3.state;
54
+ var query = state.query;
55
+ if (query) {
56
+ var recentItem = {
57
+ id: query,
58
+ label: query
59
+ };
60
+ store.addItem(recentItem);
61
+ }
62
+ },
63
+ getSources: function getSources(_ref4) {
64
+ var query = _ref4.query,
65
+ setQuery = _ref4.setQuery,
66
+ refresh = _ref4.refresh,
67
+ state = _ref4.state;
68
+ lastItemsRef.current = store.getAll(query);
69
+ function onRemove(id) {
70
+ store.removeItem(id);
71
+ refresh();
72
+ }
73
+ function onTapAhead(item) {
74
+ setQuery(item.label);
75
+ refresh();
76
+ }
77
+ return Promise.resolve(lastItemsRef.current).then(function (items) {
78
+ if (items.length === 0) {
79
+ return [];
80
+ }
81
+ return [transformSource({
82
+ source: {
83
+ sourceId: 'recentSearchesPlugin',
84
+ getItemInputValue: function getItemInputValue(_ref5) {
85
+ var item = _ref5.item;
86
+ return item.label;
87
+ },
88
+ getItems: function getItems() {
89
+ return items;
90
+ },
91
+ templates: getTemplates({
92
+ onRemove: onRemove,
93
+ onTapAhead: onTapAhead,
94
+ translations: translations
95
+ })
96
+ },
97
+ onRemove: onRemove,
98
+ onTapAhead: onTapAhead,
99
+ state: state
100
+ })];
101
+ });
102
+ },
103
+ data: _objectSpread(_objectSpread({}, store), {}, {
104
+ // @ts-ignore SearchOptions `facetFilters` is ReadonlyArray
105
+ getAlgoliaSearchParams: function getAlgoliaSearchParams() {
106
+ var _params$facetFilters, _params$hitsPerPage;
107
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
108
+ // If the items returned by `store.getAll` are contained in a Promise,
109
+ // we cannot provide the search params in time when this function is called
110
+ // because we need to resolve the promise before getting the value.
111
+ if (!Array.isArray(lastItemsRef.current)) {
112
+ process.env.NODE_ENV !== 'production' ? warn(false, 'The `getAlgoliaSearchParams` function is not supported with storages that return promises in `getAll`.') : void 0;
113
+ return params;
114
+ }
115
+ return _objectSpread(_objectSpread({}, params), {}, {
116
+ facetFilters: [].concat(_toConsumableArray((_params$facetFilters = params.facetFilters) !== null && _params$facetFilters !== void 0 ? _params$facetFilters : []), _toConsumableArray(lastItemsRef.current.map(function (item) {
117
+ return ["objectID:-".concat(item.label)];
118
+ }))),
119
+ hitsPerPage: Math.max(1, ((_params$hitsPerPage = params.hitsPerPage) !== null && _params$hitsPerPage !== void 0 ? _params$hitsPerPage : 10) - lastItemsRef.current.length)
120
+ });
121
+ }
122
+ }),
123
+ __autocomplete_pluginOptions: options
124
+ };
125
+ }
126
+ function getOptions(options) {
127
+ return _objectSpread(_objectSpread({
128
+ transformSource: function transformSource(_ref6) {
129
+ var source = _ref6.source;
130
+ return source;
131
+ }
132
+ }, options), {}, {
133
+ translations: _objectSpread(_objectSpread({}, defaultTranslations), options.translations)
134
+ });
135
+ }
136
+
137
+ export { createRecentSearchesPlugin };
@@ -0,0 +1,16 @@
1
+ function createStorageApi(storage) {
2
+ return {
3
+ addItem: function addItem(item) {
4
+ storage.onRemove(item.id);
5
+ storage.onAdd(item);
6
+ },
7
+ removeItem: function removeItem(id) {
8
+ storage.onRemove(id);
9
+ },
10
+ getAll: function getAll(query) {
11
+ return storage.getAll(query);
12
+ }
13
+ };
14
+ }
15
+
16
+ export { createStorageApi };
@@ -0,0 +1,33 @@
1
+ import { LOCAL_STORAGE_KEY_TEST } from './constants.js';
2
+
3
+ function isLocalStorageSupported() {
4
+ try {
5
+ localStorage.setItem(LOCAL_STORAGE_KEY_TEST, '');
6
+ localStorage.removeItem(LOCAL_STORAGE_KEY_TEST);
7
+ return true;
8
+ } catch (error) {
9
+ return false;
10
+ }
11
+ }
12
+ function getLocalStorage(_ref) {
13
+ var key = _ref.key;
14
+ if (!isLocalStorageSupported()) {
15
+ return {
16
+ setItem: function setItem() {},
17
+ getItem: function getItem() {
18
+ return [];
19
+ }
20
+ };
21
+ }
22
+ return {
23
+ setItem: function setItem(items) {
24
+ return window.localStorage.setItem(key, JSON.stringify(items));
25
+ },
26
+ getItem: function getItem() {
27
+ var items = window.localStorage.getItem(key);
28
+ return items ? JSON.parse(items) : [];
29
+ }
30
+ };
31
+ }
32
+
33
+ export { getLocalStorage };
@@ -0,0 +1,72 @@
1
+ /** @jsxRuntime classic */
2
+ /** @jsx createElement */
3
+
4
+ function getTemplates(_ref) {
5
+ var onRemove = _ref.onRemove,
6
+ onTapAhead = _ref.onTapAhead,
7
+ translations = _ref.translations;
8
+ return {
9
+ item: function item(_ref2) {
10
+ var item = _ref2.item,
11
+ createElement = _ref2.createElement,
12
+ components = _ref2.components;
13
+ return createElement("div", {
14
+ className: "aa-ItemWrapper"
15
+ }, createElement("div", {
16
+ className: "aa-ItemContent"
17
+ }, createElement("div", {
18
+ className: "aa-ItemIcon aa-ItemIcon--noBorder"
19
+ }, createElement("svg", {
20
+ viewBox: "0 0 24 24",
21
+ fill: "currentColor"
22
+ }, createElement("path", {
23
+ d: "M12.516 6.984v5.25l4.5 2.672-0.75 1.266-5.25-3.188v-6h1.5zM12 20.016q3.281 0 5.648-2.367t2.367-5.648-2.367-5.648-5.648-2.367-5.648 2.367-2.367 5.648 2.367 5.648 5.648 2.367zM12 2.016q4.125 0 7.055 2.93t2.93 7.055-2.93 7.055-7.055 2.93-7.055-2.93-2.93-7.055 2.93-7.055 7.055-2.93z"
24
+ }))), createElement("div", {
25
+ className: "aa-ItemContentBody"
26
+ }, createElement("div", {
27
+ className: "aa-ItemContentTitle"
28
+ }, createElement(components.ReverseHighlight, {
29
+ hit: item,
30
+ attribute: "label"
31
+ }), item.category && createElement("span", {
32
+ className: "aa-ItemContentSubtitle aa-ItemContentSubtitle--inline"
33
+ }, createElement("span", {
34
+ className: "aa-ItemContentSubtitleIcon"
35
+ }), " in", ' ', createElement("span", {
36
+ className: "aa-ItemContentSubtitleCategory"
37
+ }, item.category))))), createElement("div", {
38
+ className: "aa-ItemActions"
39
+ }, createElement("button", {
40
+ type: "button",
41
+ className: "aa-ItemActionButton",
42
+ title: translations.removeSearchTitle,
43
+ onClick: function onClick(event) {
44
+ event.preventDefault();
45
+ event.stopPropagation();
46
+ onRemove(item.id);
47
+ }
48
+ }, createElement("svg", {
49
+ viewBox: "0 0 24 24",
50
+ fill: "currentColor"
51
+ }, createElement("path", {
52
+ d: "M18 7v13c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-10c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-13zM17 5v-1c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879h-4c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v1h-4c-0.552 0-1 0.448-1 1s0.448 1 1 1h1v13c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h10c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-13h1c0.552 0 1-0.448 1-1s-0.448-1-1-1zM9 5v-1c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293h4c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v1zM9 11v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1zM13 11v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1z"
53
+ }))), createElement("button", {
54
+ type: "button",
55
+ className: "aa-ItemActionButton",
56
+ title: translations.fillQueryTitle(item.label),
57
+ onClick: function onClick(event) {
58
+ event.preventDefault();
59
+ event.stopPropagation();
60
+ onTapAhead(item);
61
+ }
62
+ }, createElement("svg", {
63
+ viewBox: "0 0 24 24",
64
+ fill: "currentColor"
65
+ }, createElement("path", {
66
+ 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"
67
+ })))));
68
+ }
69
+ };
70
+ }
71
+
72
+ export { getTemplates };
@@ -0,0 +1,25 @@
1
+ import { addHighlightedAttribute } from './addHighlightedAttribute.js';
2
+
3
+ function search(_ref) {
4
+ var query = _ref.query,
5
+ items = _ref.items,
6
+ limit = _ref.limit;
7
+ if (!query) {
8
+ return items.slice(0, limit).map(function (item) {
9
+ return addHighlightedAttribute({
10
+ item: item,
11
+ query: query
12
+ });
13
+ });
14
+ }
15
+ return items.filter(function (item) {
16
+ return item.label.toLowerCase().includes(query.toLowerCase());
17
+ }).slice(0, limit).map(function (item) {
18
+ return addHighlightedAttribute({
19
+ item: item,
20
+ query: query
21
+ });
22
+ });
23
+ }
24
+
25
+ export { search };
@@ -0,0 +1,4 @@
1
+ var HIGHLIGHT_PRE_TAG = '__aa-highlight__';
2
+ var HIGHLIGHT_POST_TAG = '__/aa-highlight__';
3
+
4
+ export { HIGHLIGHT_POST_TAG, HIGHLIGHT_PRE_TAG };
@@ -0,0 +1,25 @@
1
+ import { parseAttribute } from './parseAttribute.js';
2
+ 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';
3
+ import { warn } from '../../../../../../../@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';
4
+
5
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
+ 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."); }
7
+ 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); }
8
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+ 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; }
11
+ function parseAlgoliaHitHighlight(_ref) {
12
+ var hit = _ref.hit,
13
+ attribute = _ref.attribute;
14
+ var path = Array.isArray(attribute) ? attribute : [attribute];
15
+ var highlightedValue = getAttributeValueByPath(hit, ['_highlightResult'].concat(_toConsumableArray(path), ['value']));
16
+ if (typeof highlightedValue !== 'string') {
17
+ process.env.NODE_ENV !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToHighlight`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/') : void 0;
18
+ highlightedValue = getAttributeValueByPath(hit, path) || '';
19
+ }
20
+ return parseAttribute({
21
+ highlightedValue: highlightedValue
22
+ });
23
+ }
24
+
25
+ export { parseAlgoliaHitHighlight };
@@ -0,0 +1,51 @@
1
+ import { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants/index.js';
2
+
3
+ /**
4
+ * Creates a data structure that allows to concatenate similar highlighting
5
+ * parts in a single value.
6
+ */
7
+ function createAttributeSet() {
8
+ var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9
+ var value = initialValue;
10
+ return {
11
+ get: function get() {
12
+ return value;
13
+ },
14
+ add: function add(part) {
15
+ var lastPart = value[value.length - 1];
16
+ if ((lastPart === null || lastPart === void 0 ? void 0 : lastPart.isHighlighted) === part.isHighlighted) {
17
+ value[value.length - 1] = {
18
+ value: lastPart.value + part.value,
19
+ isHighlighted: lastPart.isHighlighted
20
+ };
21
+ } else {
22
+ value.push(part);
23
+ }
24
+ }
25
+ };
26
+ }
27
+ function parseAttribute(_ref) {
28
+ var highlightedValue = _ref.highlightedValue;
29
+ var preTagParts = highlightedValue.split(HIGHLIGHT_PRE_TAG);
30
+ var firstValue = preTagParts.shift();
31
+ var parts = createAttributeSet(firstValue ? [{
32
+ value: firstValue,
33
+ isHighlighted: false
34
+ }] : []);
35
+ preTagParts.forEach(function (part) {
36
+ var postTagParts = part.split(HIGHLIGHT_POST_TAG);
37
+ parts.add({
38
+ value: postTagParts[0],
39
+ isHighlighted: true
40
+ });
41
+ if (postTagParts[1] !== '') {
42
+ parts.add({
43
+ value: postTagParts[1],
44
+ isHighlighted: false
45
+ });
46
+ }
47
+ });
48
+ return parts.get();
49
+ }
50
+
51
+ export { parseAttribute };
@@ -0,0 +1,6 @@
1
+ import { createRequester } from './createRequester.js';
2
+ import { fetchAlgoliaResults } from '../search/fetchAlgoliaResults.js';
3
+
4
+ var createAlgoliaRequester = createRequester(fetchAlgoliaResults, 'algolia');
5
+
6
+ export { createAlgoliaRequester };
@@ -0,0 +1,37 @@
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 createRequester(fetcher, requesterId) {
8
+ function execute(fetcherParams) {
9
+ return fetcher({
10
+ searchClient: fetcherParams.searchClient,
11
+ queries: fetcherParams.requests.map(function (x) {
12
+ return x.query;
13
+ })
14
+ }).then(function (responses) {
15
+ return responses.map(function (response, index) {
16
+ var _fetcherParams$reques = fetcherParams.requests[index],
17
+ sourceId = _fetcherParams$reques.sourceId,
18
+ transformResponse = _fetcherParams$reques.transformResponse;
19
+ return {
20
+ items: response,
21
+ sourceId: sourceId,
22
+ transformResponse: transformResponse
23
+ };
24
+ });
25
+ });
26
+ }
27
+ return function createSpecifiedRequester(requesterParams) {
28
+ return function requester(requestParams) {
29
+ return _objectSpread(_objectSpread({
30
+ requesterId: requesterId,
31
+ execute: execute
32
+ }, requesterParams), requestParams);
33
+ };
34
+ };
35
+ }
36
+
37
+ export { createRequester };
@@ -0,0 +1,19 @@
1
+ import { createAlgoliaRequester } from './createAlgoliaRequester.js';
2
+ import { invariant } from '../../../../../../../@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';
3
+
4
+ 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); }
5
+
6
+ /**
7
+ * Retrieves Algolia results from multiple indices.
8
+ */
9
+ function getAlgoliaResults(requestParams) {
10
+ invariant(_typeof(requestParams.searchClient) === 'object', 'The `searchClient` parameter is required for getAlgoliaResults({ searchClient }).');
11
+ var requester = createAlgoliaRequester({
12
+ transformResponse: function transformResponse(response) {
13
+ return response.hits;
14
+ }
15
+ });
16
+ return requester(requestParams);
17
+ }
18
+
19
+ export { getAlgoliaResults };
@@ -0,0 +1,69 @@
1
+ import { HIGHLIGHT_POST_TAG, HIGHLIGHT_PRE_TAG } from '../constants/index.js';
2
+ import { getAppIdAndApiKey } from '../utils/getAppIdAndApiKey.js';
3
+ import { invariant } from '../../../../../../../@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';
4
+ import { userAgents } from '../../../../../../../@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';
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
+ var _excluded = ["params"];
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ 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); }
13
+ 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; }
14
+ 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; }
15
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
16
+ 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."); }
17
+ 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); }
18
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
19
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
20
+ 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; }
21
+ function fetchAlgoliaResults(_ref) {
22
+ var searchClient = _ref.searchClient,
23
+ queries = _ref.queries,
24
+ _ref$userAgents = _ref.userAgents,
25
+ userAgents$1 = _ref$userAgents === void 0 ? [] : _ref$userAgents;
26
+ if (typeof searchClient.addAlgoliaAgent === 'function') {
27
+ var algoliaAgents = [].concat(_toConsumableArray(userAgents), _toConsumableArray(userAgents$1));
28
+ algoliaAgents.forEach(function (_ref2) {
29
+ var segment = _ref2.segment,
30
+ version = _ref2.version;
31
+ searchClient.addAlgoliaAgent(segment, version);
32
+ });
33
+ }
34
+ var _getAppIdAndApiKey = getAppIdAndApiKey(searchClient),
35
+ appId = _getAppIdAndApiKey.appId,
36
+ apiKey = _getAppIdAndApiKey.apiKey;
37
+ invariant(Boolean(appId), 'The Algolia `appId` was not accessible from the searchClient passed.');
38
+ invariant(Boolean(apiKey), 'The Algolia `apiKey` was not accessible from the searchClient passed.');
39
+ return searchClient.search(queries.map(function (searchParameters) {
40
+ var params = searchParameters.params,
41
+ headers = _objectWithoutProperties(searchParameters, _excluded);
42
+ return _objectSpread(_objectSpread({}, headers), {}, {
43
+ params: _objectSpread({
44
+ hitsPerPage: 5,
45
+ highlightPreTag: HIGHLIGHT_PRE_TAG,
46
+ highlightPostTag: HIGHLIGHT_POST_TAG
47
+ }, params)
48
+ });
49
+ })).then(function (response) {
50
+ return response.results.map(function (result, resultIndex) {
51
+ var _result$hits;
52
+ return _objectSpread(_objectSpread({}, result), {}, {
53
+ hits: (_result$hits = result.hits) === null || _result$hits === void 0 ? void 0 : _result$hits.map(function (hit) {
54
+ return _objectSpread(_objectSpread({}, hit), {}, {
55
+ // Bring support for the Insights plugin.
56
+ __autocomplete_indexName: result.index || queries[resultIndex].indexName,
57
+ __autocomplete_queryID: result.queryID,
58
+ __autocomplete_algoliaCredentials: {
59
+ appId: appId,
60
+ apiKey: apiKey
61
+ }
62
+ });
63
+ })
64
+ });
65
+ });
66
+ });
67
+ }
68
+
69
+ export { fetchAlgoliaResults };
@@ -0,0 +1,16 @@
1
+ // typed as any, since it accepts the _real_ js clients, not the interface we otherwise expect
2
+ function getAppIdAndApiKey(searchClient) {
3
+ var transporter = searchClient.transporter || {};
4
+ var headers = transporter.headers || transporter.baseHeaders || {};
5
+ var queryParameters = transporter.queryParameters || transporter.baseQueryParameters || {};
6
+ var APP_ID = 'x-algolia-application-id';
7
+ var API_KEY = 'x-algolia-api-key';
8
+ var appId = headers[APP_ID] || queryParameters[APP_ID];
9
+ var apiKey = headers[API_KEY] || queryParameters[API_KEY];
10
+ return {
11
+ appId: appId,
12
+ apiKey: apiKey
13
+ };
14
+ }
15
+
16
+ export { getAppIdAndApiKey };
@@ -0,0 +1,16 @@
1
+ function debounce(fn, time) {
2
+ var timerId = undefined;
3
+ return function () {
4
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5
+ args[_key] = arguments[_key];
6
+ }
7
+ if (timerId) {
8
+ clearTimeout(timerId);
9
+ }
10
+ timerId = setTimeout(function () {
11
+ return fn.apply(void 0, args);
12
+ }, time);
13
+ };
14
+ }
15
+
16
+ export { debounce };
@@ -0,0 +1,34 @@
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
+ 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); }
8
+ /**
9
+ * Decycles objects with circular references.
10
+ * This is used to print cyclic structures in development environment only.
11
+ */
12
+ function decycle(obj) {
13
+ var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();
14
+ if (!(process.env.NODE_ENV !== 'production') || !obj || _typeof(obj) !== 'object') {
15
+ return obj;
16
+ }
17
+ if (seen.has(obj)) {
18
+ return '[Circular]';
19
+ }
20
+ var newSeen = seen.add(obj);
21
+ if (Array.isArray(obj)) {
22
+ return obj.map(function (x) {
23
+ return decycle(x, newSeen);
24
+ });
25
+ }
26
+ return Object.fromEntries(Object.entries(obj).map(function (_ref) {
27
+ var _ref2 = _slicedToArray(_ref, 2),
28
+ key = _ref2[0],
29
+ value = _ref2[1];
30
+ return [key, decycle(value, newSeen)];
31
+ }));
32
+ }
33
+
34
+ export { decycle };
@@ -0,0 +1,7 @@
1
+ function flatten(values) {
2
+ return values.reduce(function (a, b) {
3
+ return a.concat(b);
4
+ }, []);
5
+ }
6
+
7
+ export { flatten };
@@ -0,0 +1,6 @@
1
+ var autocompleteId = 0;
2
+ function generateAutocompleteId() {
3
+ return "autocomplete-".concat(autocompleteId++);
4
+ }
5
+
6
+ export { generateAutocompleteId };
@@ -0,0 +1,7 @@
1
+ function getAttributeValueByPath(record, path) {
2
+ return path.reduce(function (current, key) {
3
+ return current && current[key];
4
+ }, record);
5
+ }
6
+
7
+ export { getAttributeValueByPath };
@@ -0,0 +1,10 @@
1
+ function getItemsCount(state) {
2
+ if (state.collections.length === 0) {
3
+ return 0;
4
+ }
5
+ return state.collections.reduce(function (sum, collection) {
6
+ return sum + collection.items.length;
7
+ }, 0);
8
+ }
9
+
10
+ export { getItemsCount };