import { proxyCustomElement, HTMLElement, h, Host, Fragment } from '@stencil/core/internal/client';
import { p as parts } from './parts.js';
import { K as KlevuInit } from './klevu-init2.js';
import { d as defineCustomElement$q } from './klevu-button2.js';
import { d as defineCustomElement$p } from './klevu-chat-bubble2.js';
import { d as defineCustomElement$o } from './klevu-chat-layout2.js';
import { d as defineCustomElement$n } from './klevu-chat-messages2.js';
import { d as defineCustomElement$m } from './klevu-cms-list2.js';
import { d as defineCustomElement$l } from './klevu-dropdown2.js';
import { d as defineCustomElement$k } from './klevu-icon2.js';
import { d as defineCustomElement$j } from './klevu-latest-searches2.js';
import { d as defineCustomElement$i } from './klevu-list2.js';
import { d as defineCustomElement$h } from './klevu-loading-indicator2.js';
import { d as defineCustomElement$g } from './klevu-modal2.js';
import { d as defineCustomElement$f } from './klevu-moi2.js';
import { d as defineCustomElement$e } from './klevu-pagination2.js';
import { d as defineCustomElement$d } from './klevu-popular-searches2.js';
import { d as defineCustomElement$c } from './klevu-popup2.js';
import { d as defineCustomElement$b } from './klevu-product2.js';
import { d as defineCustomElement$a } from './klevu-product-grid2.js';
import { d as defineCustomElement$9 } from './klevu-search-field2.js';
import { d as defineCustomElement$8 } from './klevu-slides2.js';
import { d as defineCustomElement$7 } from './klevu-sort2.js';
import { d as defineCustomElement$6 } from './klevu-suggestions-list2.js';
import { d as defineCustomElement$5 } from './klevu-tab2.js';
import { d as defineCustomElement$4 } from './klevu-textfield2.js';
import { d as defineCustomElement$3 } from './klevu-typography2.js';
import { d as defineCustomElement$2 } from './klevu-util-scrollbars2.js';
import { f as KlevuTypeOfRecord, K as KlevuFetch, g as KlevuLastClickedProducts } from './klevuFetch.js';
import { s as search } from './search.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);
}

const klevuQuicksearchCss = ":host{display:block;}.content{display:flex;padding:var(--klevu-spacing-04)}.content aside{width:240px;flex-shrink:0;padding-right:var(--klevu-spacing-04);border-right:1px solid var(--klevu-color-border);margin-right:var(--klevu-spacing-04)}klevu-suggestions-list,klevu-popular-searches,klevu-cms-list{margin-bottom:var(--klevu-spacing-05)}klevu-product-grid.desktop{width:600px}.content section{max-width:600px;min-width:300px}.desktop{display:initial}.mobile{display:none}.resultheader{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--klevu-spacing-05)}klevu-pagination{margin-top:var(--klevu-spacing-05)}.tabrow{border-bottom:1px solid var(--klevu-color-neutral-5)}.tabrow klevu-tab{position:relative;bottom:-1px}klevu-moi{position:fixed;top:0;left:0;height:100vh;width:100vw;background-color:#fff;box-sizing:border-box;padding:var(--klevu-spacing-03);z-index:10000}.content aside klevu-button{display:none}@media (max-width: 600px){.desktop{display:none}.mobile{display:initial}klevu-product-grid.mobile{display:flex}.content{flex-direction:column;left:0;width:calc(100vw - 60px)}.content aside{width:100%;border:none}.content aside klevu-button{display:block;float:right}}";

var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
  if (kind === "m")
    throw new TypeError("Private method is not writable");
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
  if (kind === "a" && !f)
    throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
    throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _KlevuQuicksearch_instances, _KlevuQuicksearch_searchField, _KlevuQuicksearch_resultObject, _KlevuQuicksearch_searchPageChange, _KlevuQuicksearch_internalRenderProductSlot, _KlevuQuicksearch_onPopupOpen, _KlevuQuicksearch_startSearch, _KlevuQuicksearch_renderResultPage, _KlevuQuicksearch_renderTrendingPage;
const KlevuQuicksearch$1 = /*@__PURE__*/ proxyCustomElement(class KlevuQuicksearch extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
    _KlevuQuicksearch_instances.add(this);
    _KlevuQuicksearch_searchField.set(this, void 0);
    _KlevuQuicksearch_resultObject.set(this, void 0);
    this.fallbackTerm = undefined;
    this.popupAnchor = "bottom-end";
    this.searchCategories = undefined;
    this.searchCmsPages = undefined;
    this.placeholder = undefined;
    this.searchText = undefined;
    this.searchFieldVariant = "pill";
    this.resultVariant = "simple";
    this.simpleResultCount = 3;
    this.fullResultCount = 9;
    this.enableChat = undefined;
    this.renderProductSlot = undefined;
    this.products = [];
    this.trendingProducts = [
      undefined,
      undefined,
      undefined,
      undefined,
      undefined,
      undefined,
    ];
    this.suggestions = [];
    this.cmsPages = undefined;
    this.categories = undefined;
    this.queryResult = undefined;
    this.searchSort = undefined;
    this.lastClickedProducts = undefined;
    this.activeTab = "trending";
    this.chat = false;
  }
  async onTextChange(event) {
    if (event.detail.length === 0) {
      this.suggestions = [];
      this.products = [];
    }
  }
  async onResults(event) {
    var _a, _b, _c, _d, _e, _f, _g;
    if (((_a = event.detail.search) === null || _a === void 0 ? void 0 : _a.records.length) === 0) {
      __classPrivateFieldSet(this, _KlevuQuicksearch_resultObject, event.detail.fallback, "f");
      this.products = (_b = event.detail.fallback) === null || _b === void 0 ? void 0 : _b.records;
    }
    else {
      __classPrivateFieldSet(this, _KlevuQuicksearch_resultObject, event.detail.search, "f");
      this.products = (_c = event.detail.search) === null || _c === void 0 ? void 0 : _c.records;
    }
    this.cmsPages = (_d = event.detail.cms) === null || _d === void 0 ? void 0 : _d.records;
    this.categories = (_e = event.detail.category) === null || _e === void 0 ? void 0 : _e.records;
    (_f = this.popup) === null || _f === void 0 ? void 0 : _f.openModal();
    this.queryResult = await ((_g = __classPrivateFieldGet(this, _KlevuQuicksearch_searchField, "f")) === null || _g === void 0 ? void 0 : _g.getQueryResult("search"));
  }
  async onSuggestions(event) {
    this.suggestions = event.detail;
  }
  onProductClick(event) {
    var _a, _b, _c;
    const { product } = event.detail;
    (_a = this.popup) === null || _a === void 0 ? void 0 : _a.closeModal();
    if (product.id) {
      (_c = (_b = __classPrivateFieldGet(this, _KlevuQuicksearch_resultObject, "f")) === null || _b === void 0 ? void 0 : _b.searchClickEvent) === null || _c === void 0 ? void 0 : _c.call(_b, {
        productId: product.id,
        variantId: product.itemGroupId || product.id,
      });
    }
  }
  onChatLayoutClose() {
    this.chat = false;
  }
  async connectedCallback() {
    await KlevuInit.ready();
    const trendingProductsQuery = await KlevuFetch(trendingProducts({
      limit: this.simpleResultCount,
    }));
    const resultObject = trendingProductsQuery.queriesById("trendingProducts");
    if (resultObject) {
      this.trendingProducts = resultObject.records;
    }
  }
  render() {
    var _a, _b;
    return (h(Host, null, h("klevu-popup", { anchor: this.popupAnchor, ref: (el) => (this.popup = el), fullwidthContent: true, openAtFocus: true, onKlevuPopupOpen: __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_onPopupOpen).bind(this), elevation: 2 }, h("klevu-search-field", { ref: (el) => (__classPrivateFieldSet(this, _KlevuQuicksearch_searchField, el, "f")), limit: this.resultVariant === "simple" ? this.simpleResultCount : this.fullResultCount, sort: this.searchSort, slot: "origin", searchProducts: true, searchSuggestions: true, searchText: this.searchText, placeholder: this.placeholder, "fallback-term": this.fallbackTerm, searchCmsPages: this.searchCmsPages, searchCategories: this.searchCategories, onFocus: () => { var _a; return (_a = this.popup) === null || _a === void 0 ? void 0 : _a.openModal(); }, variant: this.searchFieldVariant }), h("div", { class: "content", slot: "content" }, ((_a = this.products) !== null && _a !== void 0 ? _a : []).length > 0
      ? __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_renderResultPage).call(this)
      : ((_b = this.products) === null || _b === void 0 ? void 0 : _b.length) === 0 && this.trendingProducts.length > 0
        ? __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_renderTrendingPage).call(this)
        : null)), this.chat && h("klevu-moi", null)));
  }
  static get style() { return klevuQuicksearchCss; }
}, [1, "klevu-quicksearch", {
    "fallbackTerm": [1, "fallback-term"],
    "popupAnchor": [1, "popup-anchor"],
    "searchCategories": [4, "search-categories"],
    "searchCmsPages": [4, "search-cms-pages"],
    "placeholder": [1],
    "searchText": [1, "search-text"],
    "searchFieldVariant": [1, "search-field-variant"],
    "resultVariant": [1, "result-variant"],
    "simpleResultCount": [2, "simple-result-count"],
    "fullResultCount": [2, "full-result-count"],
    "enableChat": [4, "enable-chat"],
    "renderProductSlot": [16],
    "products": [32],
    "trendingProducts": [32],
    "suggestions": [32],
    "cmsPages": [32],
    "categories": [32],
    "queryResult": [32],
    "searchSort": [32],
    "lastClickedProducts": [32],
    "activeTab": [32],
    "chat": [32]
  }, [[0, "klevuTextChanged", "onTextChange"], [0, "klevuSearchResults", "onResults"], [0, "klevuSearchSuggestions", "onSuggestions"], [0, "klevuProductClick", "onProductClick"], [0, "klevuChatLayoutClose", "onChatLayoutClose"]]]);
_KlevuQuicksearch_searchField = new WeakMap(), _KlevuQuicksearch_resultObject = new WeakMap(), _KlevuQuicksearch_instances = new WeakSet(), _KlevuQuicksearch_searchPageChange = async function _KlevuQuicksearch_searchPageChange(event) {
  var _a;
  if (!__classPrivateFieldGet(this, _KlevuQuicksearch_searchField, "f")) {
    return;
  }
  __classPrivateFieldGet(this, _KlevuQuicksearch_searchField, "f").getPage("search", event.detail - 1);
  this.queryResult = await ((_a = __classPrivateFieldGet(this, _KlevuQuicksearch_searchField, "f")) === null || _a === void 0 ? void 0 : _a.getQueryResult("search"));
}, _KlevuQuicksearch_internalRenderProductSlot = function _KlevuQuicksearch_internalRenderProductSlot(product, slot) {
  if (!this.renderProductSlot || !product) {
    return null;
  }
  const content = this.renderProductSlot(product, slot);
  if (content === null) {
    return null;
  }
  if (typeof content === "string") {
    return h("div", { slot: slot, innerHTML: content });
  }
  return (h("div", { slot: slot, ref: (el) => {
      if (!el) {
        return;
      }
      el.innerHTML = "";
      el.appendChild(content);
    } }));
}, _KlevuQuicksearch_onPopupOpen = function _KlevuQuicksearch_onPopupOpen() {
  this.lastClickedProducts = KlevuLastClickedProducts.getProducts(3);
}, _KlevuQuicksearch_startSearch = function _KlevuQuicksearch_startSearch(term) {
  var _a;
  this.products = [undefined, undefined, undefined];
  (_a = __classPrivateFieldGet(this, _KlevuQuicksearch_searchField, "f")) === null || _a === void 0 ? void 0 : _a.makeSearch(term);
}, _KlevuQuicksearch_renderResultPage = function _KlevuQuicksearch_renderResultPage() {
  var _a, _b, _c;
  return (h(Fragment, null, h("aside", null, h("klevu-suggestions-list", { suggestions: this.suggestions, onKlevuSuggestionClicked: (event) => __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_startSearch).call(this, event.detail) }), this.cmsPages && this.cmsPages.length > 0 && h("klevu-cms-list", { pages: this.cmsPages, link: true }), this.categories && this.categories.length > 0 && (h("klevu-cms-list", { pages: this.categories, caption: "Categories", link: true }))), h("section", null, this.resultVariant === "full" && (h(Fragment, null, h("div", { class: "resultheader" }, h("klevu-typography", { variant: "h3" }, "Search results"), h("klevu-sort", { variant: "inline", onKlevuSortChanged: (event) => (this.searchSort = event.detail) })), h("klevu-product-grid", { class: "desktop", itemsPerRow: 3 }, (_a = this.products) === null || _a === void 0 ? void 0 : _a.map((p) => (h("klevu-product", { product: p, fixedWidth: true, variant: "small", exportparts: parts["klevu-product"] }, __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "top"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "image"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "info"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "bottom"))))), h("klevu-product-grid", { class: "mobile" }, (_b = this.products) === null || _b === void 0 ? void 0 : _b.map((p) => (h("klevu-product", { product: p, fixedWidth: true, variant: "line", exportparts: parts["klevu-product"] }, __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "top"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "image"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "info"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "bottom"))))), h("klevu-pagination", { queryResult: this.queryResult, onKlevuPaginationChange: __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_searchPageChange).bind(this) }))), this.resultVariant === "simple" && (h(Fragment, null, h("div", { class: "resultheader" }, h("klevu-typography", { variant: "h3" }, "Search results")), h("div", { class: "lineproducts" }, (_c = this.products) === null || _c === void 0 ? void 0 : _c.map((p) => (h("klevu-product", { product: p, variant: "line", exportparts: parts["klevu-product"] }, __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "top"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "image"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "info"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "bottom"))))))))));
}, _KlevuQuicksearch_renderTrendingPage = function _KlevuQuicksearch_renderTrendingPage() {
  var _a, _b, _c, _d, _e;
  return (h(Fragment, null, h("aside", null, this.enableChat && (h("klevu-button", { size: "small", onClick: () => (this.chat = true) }, "Start chat")), h("klevu-popular-searches", { onKlevuPopularSearchClicked: (event) => __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_startSearch).call(this, event.detail) }), h("klevu-latest-searches", { onKlevuLastSearchClicked: (event) => __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_startSearch).call(this, event.detail) })), h("section", null, h("div", { class: "tabrow" }, h("klevu-tab", { caption: "Trending", active: this.activeTab === "trending", onClick: () => (this.activeTab = "trending") }), h("klevu-tab", { caption: `Recently viewed (${(_b = (_a = this.lastClickedProducts) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0})`, active: this.activeTab === "last", onClick: () => {
      var _a;
      if (((_a = this.lastClickedProducts) === null || _a === void 0 ? void 0 : _a.length) === 0) {
        return;
      }
      this.activeTab = "last";
    }, disabled: ((_c = this.lastClickedProducts) === null || _c === void 0 ? void 0 : _c.length) === 0 })), this.activeTab === "trending" && (h(Fragment, null, (_d = this.trendingProducts) === null || _d === void 0 ? void 0 : _d.map((p) => (h("klevu-product", { product: p, variant: "line", exportparts: parts["klevu-product"] }, __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "top"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "image"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "info"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "bottom")))))), this.activeTab === "last" && (h(Fragment, null, (_e = this.lastClickedProducts) === null || _e === void 0 ? void 0 : _e.map((p) => (h("klevu-product", { product: p, variant: "line", exportparts: parts["klevu-product"] }, __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "top"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "image"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "info"), __classPrivateFieldGet(this, _KlevuQuicksearch_instances, "m", _KlevuQuicksearch_internalRenderProductSlot).call(this, p, "bottom")))))))));
};
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["klevu-quicksearch", "klevu-button", "klevu-chat-bubble", "klevu-chat-layout", "klevu-chat-messages", "klevu-cms-list", "klevu-dropdown", "klevu-icon", "klevu-latest-searches", "klevu-list", "klevu-loading-indicator", "klevu-modal", "klevu-moi", "klevu-pagination", "klevu-popular-searches", "klevu-popup", "klevu-product", "klevu-product-grid", "klevu-search-field", "klevu-slides", "klevu-sort", "klevu-suggestions-list", "klevu-tab", "klevu-textfield", "klevu-typography", "klevu-util-scrollbars"];
  components.forEach(tagName => { switch (tagName) {
    case "klevu-quicksearch":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, KlevuQuicksearch$1);
      }
      break;
    case "klevu-button":
      if (!customElements.get(tagName)) {
        defineCustomElement$q();
      }
      break;
    case "klevu-chat-bubble":
      if (!customElements.get(tagName)) {
        defineCustomElement$p();
      }
      break;
    case "klevu-chat-layout":
      if (!customElements.get(tagName)) {
        defineCustomElement$o();
      }
      break;
    case "klevu-chat-messages":
      if (!customElements.get(tagName)) {
        defineCustomElement$n();
      }
      break;
    case "klevu-cms-list":
      if (!customElements.get(tagName)) {
        defineCustomElement$m();
      }
      break;
    case "klevu-dropdown":
      if (!customElements.get(tagName)) {
        defineCustomElement$l();
      }
      break;
    case "klevu-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$k();
      }
      break;
    case "klevu-latest-searches":
      if (!customElements.get(tagName)) {
        defineCustomElement$j();
      }
      break;
    case "klevu-list":
      if (!customElements.get(tagName)) {
        defineCustomElement$i();
      }
      break;
    case "klevu-loading-indicator":
      if (!customElements.get(tagName)) {
        defineCustomElement$h();
      }
      break;
    case "klevu-modal":
      if (!customElements.get(tagName)) {
        defineCustomElement$g();
      }
      break;
    case "klevu-moi":
      if (!customElements.get(tagName)) {
        defineCustomElement$f();
      }
      break;
    case "klevu-pagination":
      if (!customElements.get(tagName)) {
        defineCustomElement$e();
      }
      break;
    case "klevu-popular-searches":
      if (!customElements.get(tagName)) {
        defineCustomElement$d();
      }
      break;
    case "klevu-popup":
      if (!customElements.get(tagName)) {
        defineCustomElement$c();
      }
      break;
    case "klevu-product":
      if (!customElements.get(tagName)) {
        defineCustomElement$b();
      }
      break;
    case "klevu-product-grid":
      if (!customElements.get(tagName)) {
        defineCustomElement$a();
      }
      break;
    case "klevu-search-field":
      if (!customElements.get(tagName)) {
        defineCustomElement$9();
      }
      break;
    case "klevu-slides":
      if (!customElements.get(tagName)) {
        defineCustomElement$8();
      }
      break;
    case "klevu-sort":
      if (!customElements.get(tagName)) {
        defineCustomElement$7();
      }
      break;
    case "klevu-suggestions-list":
      if (!customElements.get(tagName)) {
        defineCustomElement$6();
      }
      break;
    case "klevu-tab":
      if (!customElements.get(tagName)) {
        defineCustomElement$5();
      }
      break;
    case "klevu-textfield":
      if (!customElements.get(tagName)) {
        defineCustomElement$4();
      }
      break;
    case "klevu-typography":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "klevu-util-scrollbars":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}
defineCustomElement$1();

const KlevuQuicksearch = KlevuQuicksearch$1;
const defineCustomElement = defineCustomElement$1;

export { KlevuQuicksearch, defineCustomElement };

//# sourceMappingURL=klevu-quicksearch.js.map