import { s as search } from './search-58784dca.js';
import { g as KlevuTypeOfRecord } from './klevuFetch-ab326dc0.js';

/**
 * Create a trending products search query. Id for this query is `trendingProducts`
 *
 * @category Query
 * @param options {@link search}
 * @returns See {@link KlevuFetchFunction}
 *
 * @example Simple example
 * ```
 * const result = await KlevuFetch(
 *  trendingProducts()
 * )
 *
 * console.log(result.getQueries("trendingProducts").records)
 * ```
 */
function trendingProducts(options, ...modifiers) {
    return search("*", Object.assign({ id: "trendingProducts", typeOfRecords: [KlevuTypeOfRecord.Product] }, options), ...modifiers);
}

/**
 * Used to replace any amount of %s tokens with array of strings to concatenated string.
 * `hello %s %s %s` with values ['1', 'world', '2'] will lead to `hello 1 world 2`.
 *
 * If there isn't enough array values then %s will be left to string.
 *
 * @param string
 * @param values
 * @returns
 */
function stringConcat(string, values) {
  let copy = string;
  for (const v of values) {
    copy = copy.replace("%s", v);
  }
  return copy;
}

export { stringConcat as s, trendingProducts as t };

//# sourceMappingURL=stringConcat-fc082417.js.map