@getlupa/client 1.15.0 → 1.15.1
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.
- package/dist/lupaSearch.iife.js +368 -281
- package/dist/lupaSearch.js +368 -281
- package/dist/lupaSearch.mjs +368 -281
- package/dist/lupaSearch.umd.js +368 -281
- package/package.json +2 -2
package/dist/lupaSearch.iife.js
CHANGED
|
@@ -6804,6 +6804,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
6804
6804
|
const TRACKING_STORAGE_KEY = "LUPA_STATS";
|
|
6805
6805
|
const TRACKING_STORAGE_KEY_BASE = "LUPA_STATS_BASE";
|
|
6806
6806
|
const TRACKING_ANALYTICS_KEY = "LUPA_ANALYTICS";
|
|
6807
|
+
const TRACKING_CLICK_DELAYED = "LUPA_TRACKING_CLICK_DELAYED";
|
|
6808
|
+
const DELAYED_TRACKING_EVENTS_CACHE = "LUPA_DELAYED_TRACKING_EVENTS";
|
|
6807
6809
|
const TRACKING_KEY_LENGTH = 10;
|
|
6808
6810
|
const HISTORY_MAX_ITEMS = 7;
|
|
6809
6811
|
const S_MIN_WIDTH = 575;
|
|
@@ -7024,6 +7026,14 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7024
7026
|
const transformedStr = typeof str === "string" ? str : str.toString();
|
|
7025
7027
|
return transformedStr.normalize === void 0 ? (_a = transformedStr.toLocaleLowerCase()) == null ? void 0 : _a.trim() : (_b = transformedStr.toLocaleLowerCase().normalize("NFKD").replace(/[^\w\s.-_/]/g, "")) == null ? void 0 : _b.trim();
|
|
7026
7028
|
};
|
|
7029
|
+
const getTransformedString = (str) => {
|
|
7030
|
+
var _a, _b;
|
|
7031
|
+
if (!str) {
|
|
7032
|
+
return "";
|
|
7033
|
+
}
|
|
7034
|
+
const transformedStr = typeof str === "string" ? str : str.toString();
|
|
7035
|
+
return transformedStr.normalize === void 0 ? (_a = transformedStr.toLocaleLowerCase()) == null ? void 0 : _a.trim() : (_b = transformedStr.toLocaleLowerCase().normalize("NFKD")) == null ? void 0 : _b.trim();
|
|
7036
|
+
};
|
|
7027
7037
|
const capitalize$1 = (str) => {
|
|
7028
7038
|
if (!str) {
|
|
7029
7039
|
return "";
|
|
@@ -7097,8 +7107,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7097
7107
|
if (!input2) {
|
|
7098
7108
|
return false;
|
|
7099
7109
|
}
|
|
7100
|
-
const normalizedInput =
|
|
7101
|
-
return possibleValues.some((v) =>
|
|
7110
|
+
const normalizedInput = getTransformedString(input2);
|
|
7111
|
+
return possibleValues.some((v) => getTransformedString(v) === normalizedInput);
|
|
7102
7112
|
};
|
|
7103
7113
|
const levenshteinDistance = (s = "", t = "") => {
|
|
7104
7114
|
if (!(s == null ? void 0 : s.length)) {
|
|
@@ -7131,225 +7141,6 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7131
7141
|
const closestValue = (_a = possibleValues.filter((_, i) => distances[i] === minDistance)) == null ? void 0 : _a[0];
|
|
7132
7142
|
return closestValue;
|
|
7133
7143
|
};
|
|
7134
|
-
const initAnalyticsTracking = (analyticsOptions) => {
|
|
7135
|
-
try {
|
|
7136
|
-
if (analyticsOptions == null ? void 0 : analyticsOptions.enabled) {
|
|
7137
|
-
window.sessionStorage.setItem(TRACKING_ANALYTICS_KEY, JSON.stringify(analyticsOptions));
|
|
7138
|
-
} else {
|
|
7139
|
-
window.sessionStorage.removeItem(TRACKING_ANALYTICS_KEY);
|
|
7140
|
-
}
|
|
7141
|
-
} catch (e2) {
|
|
7142
|
-
}
|
|
7143
|
-
};
|
|
7144
|
-
const initBaseTracking = (enabled) => {
|
|
7145
|
-
try {
|
|
7146
|
-
if (enabled) {
|
|
7147
|
-
window.sessionStorage.setItem(TRACKING_STORAGE_KEY_BASE, "1");
|
|
7148
|
-
} else {
|
|
7149
|
-
window.sessionStorage.removeItem(TRACKING_STORAGE_KEY_BASE);
|
|
7150
|
-
clearSessionTracking();
|
|
7151
|
-
clearUserTracking();
|
|
7152
|
-
}
|
|
7153
|
-
} catch (e2) {
|
|
7154
|
-
}
|
|
7155
|
-
};
|
|
7156
|
-
const clearSessionTracking = () => {
|
|
7157
|
-
try {
|
|
7158
|
-
window.sessionStorage.removeItem(TRACKING_STORAGE_KEY);
|
|
7159
|
-
} catch (e2) {
|
|
7160
|
-
}
|
|
7161
|
-
};
|
|
7162
|
-
const initSessionTracking = () => {
|
|
7163
|
-
try {
|
|
7164
|
-
if (getSessionKey()) {
|
|
7165
|
-
return;
|
|
7166
|
-
}
|
|
7167
|
-
const key = getRandomString(TRACKING_KEY_LENGTH);
|
|
7168
|
-
window.sessionStorage.setItem(TRACKING_STORAGE_KEY, key);
|
|
7169
|
-
} catch (e2) {
|
|
7170
|
-
}
|
|
7171
|
-
};
|
|
7172
|
-
const initUserTracking = (userKey) => {
|
|
7173
|
-
try {
|
|
7174
|
-
if (getUserKey()) {
|
|
7175
|
-
return;
|
|
7176
|
-
}
|
|
7177
|
-
const key = userKey || getRandomString(TRACKING_KEY_LENGTH);
|
|
7178
|
-
window.localStorage.setItem(TRACKING_STORAGE_KEY, key);
|
|
7179
|
-
} catch (e2) {
|
|
7180
|
-
}
|
|
7181
|
-
};
|
|
7182
|
-
const clearUserTracking = () => {
|
|
7183
|
-
try {
|
|
7184
|
-
window.localStorage.removeItem(TRACKING_STORAGE_KEY);
|
|
7185
|
-
} catch (e2) {
|
|
7186
|
-
}
|
|
7187
|
-
};
|
|
7188
|
-
const isTrackingEnabled = () => {
|
|
7189
|
-
try {
|
|
7190
|
-
return Boolean(window.sessionStorage.getItem(TRACKING_STORAGE_KEY_BASE));
|
|
7191
|
-
} catch (e2) {
|
|
7192
|
-
return false;
|
|
7193
|
-
}
|
|
7194
|
-
};
|
|
7195
|
-
const getSessionKey = () => {
|
|
7196
|
-
var _a;
|
|
7197
|
-
try {
|
|
7198
|
-
return (_a = window.sessionStorage.getItem(TRACKING_STORAGE_KEY)) != null ? _a : void 0;
|
|
7199
|
-
} catch (e2) {
|
|
7200
|
-
return void 0;
|
|
7201
|
-
}
|
|
7202
|
-
};
|
|
7203
|
-
const getUserKey = () => {
|
|
7204
|
-
var _a;
|
|
7205
|
-
try {
|
|
7206
|
-
return (_a = window.localStorage.getItem(TRACKING_STORAGE_KEY)) != null ? _a : void 0;
|
|
7207
|
-
} catch (e2) {
|
|
7208
|
-
return void 0;
|
|
7209
|
-
}
|
|
7210
|
-
};
|
|
7211
|
-
const initTracking = (options) => {
|
|
7212
|
-
initBaseTracking(Boolean(options.trackBase));
|
|
7213
|
-
if (options.trackSession) {
|
|
7214
|
-
initSessionTracking();
|
|
7215
|
-
} else {
|
|
7216
|
-
clearSessionTracking();
|
|
7217
|
-
}
|
|
7218
|
-
if (options.trackUser) {
|
|
7219
|
-
initUserTracking(options.userKey);
|
|
7220
|
-
} else {
|
|
7221
|
-
clearUserTracking();
|
|
7222
|
-
}
|
|
7223
|
-
if (options.analytics) {
|
|
7224
|
-
initAnalyticsTracking(options.analytics);
|
|
7225
|
-
}
|
|
7226
|
-
};
|
|
7227
|
-
const getLupaTrackingContext = () => {
|
|
7228
|
-
if (!isTrackingEnabled()) {
|
|
7229
|
-
return {};
|
|
7230
|
-
}
|
|
7231
|
-
return {
|
|
7232
|
-
userId: getUserKey(),
|
|
7233
|
-
sessionId: getSessionKey()
|
|
7234
|
-
};
|
|
7235
|
-
};
|
|
7236
|
-
const trackLupaEvent = (queryKey, data = {}, options) => {
|
|
7237
|
-
var _a, _b;
|
|
7238
|
-
if (!queryKey || !data.type) {
|
|
7239
|
-
return;
|
|
7240
|
-
}
|
|
7241
|
-
const eventData = {
|
|
7242
|
-
searchQuery: (_a = data.searchQuery) != null ? _a : "",
|
|
7243
|
-
itemId: (_b = data.itemId) != null ? _b : "",
|
|
7244
|
-
name: data.type,
|
|
7245
|
-
userId: getUserKey(),
|
|
7246
|
-
sessionId: getSessionKey(),
|
|
7247
|
-
filters: data.filters
|
|
7248
|
-
};
|
|
7249
|
-
LupaSearchSdk.track(queryKey, eventData, options);
|
|
7250
|
-
};
|
|
7251
|
-
const sendGa = (name, ...args) => {
|
|
7252
|
-
window.ga(() => {
|
|
7253
|
-
const trackers = window.ga.getAll();
|
|
7254
|
-
const firstTracker = trackers[0];
|
|
7255
|
-
if (!firstTracker) {
|
|
7256
|
-
console.error("GA tracker not found");
|
|
7257
|
-
}
|
|
7258
|
-
const trackerName = firstTracker.get("name");
|
|
7259
|
-
window.ga(`${trackerName}.${name}`, ...args);
|
|
7260
|
-
});
|
|
7261
|
-
};
|
|
7262
|
-
const trackAnalyticsEvent = (data) => {
|
|
7263
|
-
var _a, _b, _c;
|
|
7264
|
-
try {
|
|
7265
|
-
const options = JSON.parse(
|
|
7266
|
-
(_a = window.sessionStorage.getItem(TRACKING_ANALYTICS_KEY)) != null ? _a : "{}"
|
|
7267
|
-
);
|
|
7268
|
-
if (!data.analytics || !options.enabled || ((_c = options.ignoreEvents) == null ? void 0 : _c.includes((_b = data.analytics) == null ? void 0 : _b.type))) {
|
|
7269
|
-
return;
|
|
7270
|
-
}
|
|
7271
|
-
switch (options.type) {
|
|
7272
|
-
case "ua":
|
|
7273
|
-
sendUaAnalyticsEvent(data, options);
|
|
7274
|
-
break;
|
|
7275
|
-
case "ga4":
|
|
7276
|
-
sendGa4AnalyticsEvent(data, options);
|
|
7277
|
-
break;
|
|
7278
|
-
case "debug":
|
|
7279
|
-
processDebugEvent(data);
|
|
7280
|
-
break;
|
|
7281
|
-
default:
|
|
7282
|
-
sendUaAnalyticsEvent(data, options);
|
|
7283
|
-
}
|
|
7284
|
-
} catch (e2) {
|
|
7285
|
-
console.error("Unable to send an event to google analytics");
|
|
7286
|
-
}
|
|
7287
|
-
};
|
|
7288
|
-
const parseEcommerceData = (data, title) => {
|
|
7289
|
-
var _a, _b;
|
|
7290
|
-
return ((_a = data.analytics) == null ? void 0 : _a.items) ? {
|
|
7291
|
-
item_list_name: title,
|
|
7292
|
-
items: (_b = data.analytics) == null ? void 0 : _b.items
|
|
7293
|
-
} : void 0;
|
|
7294
|
-
};
|
|
7295
|
-
const sendUaAnalyticsEvent = (data, options) => {
|
|
7296
|
-
var _a, _b, _c, _d;
|
|
7297
|
-
const ga = window.ga;
|
|
7298
|
-
if (!ga) {
|
|
7299
|
-
console.error("Google Analytics object not found");
|
|
7300
|
-
return;
|
|
7301
|
-
}
|
|
7302
|
-
sendGa(
|
|
7303
|
-
"send",
|
|
7304
|
-
"event",
|
|
7305
|
-
options.parentEventName,
|
|
7306
|
-
(_b = (_a = data.analytics) == null ? void 0 : _a.type) != null ? _b : "",
|
|
7307
|
-
(_d = (_c = data.analytics) == null ? void 0 : _c.label) != null ? _d : ""
|
|
7308
|
-
);
|
|
7309
|
-
};
|
|
7310
|
-
const sendGa4AnalyticsEvent = (data, options) => {
|
|
7311
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
7312
|
-
if (!window || !window.dataLayer) {
|
|
7313
|
-
console.error("dataLayer object not found.");
|
|
7314
|
-
return;
|
|
7315
|
-
}
|
|
7316
|
-
const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
|
|
7317
|
-
const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
|
|
7318
|
-
const params = __spreadValues2({
|
|
7319
|
-
search_text: data.searchQuery,
|
|
7320
|
-
item_title: title,
|
|
7321
|
-
item_id: data.itemId,
|
|
7322
|
-
ecommerce: parseEcommerceData(data, (_c = data.analytics) == null ? void 0 : _c.listLabel)
|
|
7323
|
-
}, (_e = (_d = data.analytics) == null ? void 0 : _d.additionalParams) != null ? _e : {});
|
|
7324
|
-
window.dataLayer.push(__spreadValues2({
|
|
7325
|
-
event: (_g = (_f = data.analytics) == null ? void 0 : _f.type) != null ? _g : options.parentEventName
|
|
7326
|
-
}, params));
|
|
7327
|
-
};
|
|
7328
|
-
const processDebugEvent = (data) => {
|
|
7329
|
-
var _a, _b, _c, _d;
|
|
7330
|
-
const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
|
|
7331
|
-
const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
|
|
7332
|
-
const params = {
|
|
7333
|
-
event: (_c = data.analytics) == null ? void 0 : _c.type,
|
|
7334
|
-
search_text: data.searchQuery,
|
|
7335
|
-
item_title: title,
|
|
7336
|
-
item_id: data.itemId,
|
|
7337
|
-
ecommerce: parseEcommerceData(data, (_d = data.analytics) == null ? void 0 : _d.listLabel)
|
|
7338
|
-
};
|
|
7339
|
-
console.debug("Analytics debug event:", params);
|
|
7340
|
-
};
|
|
7341
|
-
const track = (queryKey, data = {}, options) => {
|
|
7342
|
-
var _a;
|
|
7343
|
-
if (!isTrackingEnabled()) {
|
|
7344
|
-
return;
|
|
7345
|
-
}
|
|
7346
|
-
const hasSearchQuery = data.searchQuery;
|
|
7347
|
-
if (!hasSearchQuery && !((_a = data.options) == null ? void 0 : _a.allowEmptySearchQuery)) {
|
|
7348
|
-
return;
|
|
7349
|
-
}
|
|
7350
|
-
trackAnalyticsEvent(data);
|
|
7351
|
-
trackLupaEvent(queryKey, data, options);
|
|
7352
|
-
};
|
|
7353
7144
|
const DEFAULT_SEARCH_BOX_OPTIONS$1 = {
|
|
7354
7145
|
inputSelector: "#searchBox",
|
|
7355
7146
|
options: {
|
|
@@ -7631,6 +7422,266 @@ var __async = (__this, __arguments, generator) => {
|
|
|
7631
7422
|
getQueryParamName
|
|
7632
7423
|
};
|
|
7633
7424
|
});
|
|
7425
|
+
const initAnalyticsTracking = (analyticsOptions) => {
|
|
7426
|
+
try {
|
|
7427
|
+
if (analyticsOptions == null ? void 0 : analyticsOptions.enabled) {
|
|
7428
|
+
window.sessionStorage.setItem(TRACKING_ANALYTICS_KEY, JSON.stringify(analyticsOptions));
|
|
7429
|
+
} else {
|
|
7430
|
+
window.sessionStorage.removeItem(TRACKING_ANALYTICS_KEY);
|
|
7431
|
+
}
|
|
7432
|
+
} catch (e2) {
|
|
7433
|
+
}
|
|
7434
|
+
};
|
|
7435
|
+
const initBaseTracking = (enabled) => {
|
|
7436
|
+
try {
|
|
7437
|
+
if (enabled) {
|
|
7438
|
+
window.sessionStorage.setItem(TRACKING_STORAGE_KEY_BASE, "1");
|
|
7439
|
+
} else {
|
|
7440
|
+
window.sessionStorage.removeItem(TRACKING_STORAGE_KEY_BASE);
|
|
7441
|
+
clearSessionTracking();
|
|
7442
|
+
clearUserTracking();
|
|
7443
|
+
}
|
|
7444
|
+
} catch (e2) {
|
|
7445
|
+
}
|
|
7446
|
+
};
|
|
7447
|
+
const clearSessionTracking = () => {
|
|
7448
|
+
try {
|
|
7449
|
+
window.sessionStorage.removeItem(TRACKING_STORAGE_KEY);
|
|
7450
|
+
} catch (e2) {
|
|
7451
|
+
}
|
|
7452
|
+
};
|
|
7453
|
+
const initSessionTracking = () => {
|
|
7454
|
+
try {
|
|
7455
|
+
if (getSessionKey()) {
|
|
7456
|
+
return;
|
|
7457
|
+
}
|
|
7458
|
+
const key = getRandomString(TRACKING_KEY_LENGTH);
|
|
7459
|
+
window.sessionStorage.setItem(TRACKING_STORAGE_KEY, key);
|
|
7460
|
+
} catch (e2) {
|
|
7461
|
+
}
|
|
7462
|
+
};
|
|
7463
|
+
const initUserTracking = (userKey) => {
|
|
7464
|
+
try {
|
|
7465
|
+
if (getUserKey()) {
|
|
7466
|
+
return;
|
|
7467
|
+
}
|
|
7468
|
+
const key = userKey || getRandomString(TRACKING_KEY_LENGTH);
|
|
7469
|
+
window.localStorage.setItem(TRACKING_STORAGE_KEY, key);
|
|
7470
|
+
} catch (e2) {
|
|
7471
|
+
}
|
|
7472
|
+
};
|
|
7473
|
+
const clearUserTracking = () => {
|
|
7474
|
+
try {
|
|
7475
|
+
window.localStorage.removeItem(TRACKING_STORAGE_KEY);
|
|
7476
|
+
} catch (e2) {
|
|
7477
|
+
}
|
|
7478
|
+
};
|
|
7479
|
+
const isTrackingEnabled = () => {
|
|
7480
|
+
try {
|
|
7481
|
+
return Boolean(window.sessionStorage.getItem(TRACKING_STORAGE_KEY_BASE));
|
|
7482
|
+
} catch (e2) {
|
|
7483
|
+
return false;
|
|
7484
|
+
}
|
|
7485
|
+
};
|
|
7486
|
+
const isDelayedClickTracking = () => {
|
|
7487
|
+
try {
|
|
7488
|
+
return Boolean(window.localStorage.getItem(TRACKING_CLICK_DELAYED));
|
|
7489
|
+
} catch (e2) {
|
|
7490
|
+
return false;
|
|
7491
|
+
}
|
|
7492
|
+
};
|
|
7493
|
+
const getSessionKey = () => {
|
|
7494
|
+
var _a;
|
|
7495
|
+
try {
|
|
7496
|
+
return (_a = window.sessionStorage.getItem(TRACKING_STORAGE_KEY)) != null ? _a : void 0;
|
|
7497
|
+
} catch (e2) {
|
|
7498
|
+
return void 0;
|
|
7499
|
+
}
|
|
7500
|
+
};
|
|
7501
|
+
const getUserKey = () => {
|
|
7502
|
+
var _a;
|
|
7503
|
+
try {
|
|
7504
|
+
return (_a = window.localStorage.getItem(TRACKING_STORAGE_KEY)) != null ? _a : void 0;
|
|
7505
|
+
} catch (e2) {
|
|
7506
|
+
return void 0;
|
|
7507
|
+
}
|
|
7508
|
+
};
|
|
7509
|
+
const initTracking = (options) => {
|
|
7510
|
+
initBaseTracking(Boolean(options.trackBase));
|
|
7511
|
+
if (options.trackSession) {
|
|
7512
|
+
initSessionTracking();
|
|
7513
|
+
} else {
|
|
7514
|
+
clearSessionTracking();
|
|
7515
|
+
}
|
|
7516
|
+
if (options.trackUser) {
|
|
7517
|
+
initUserTracking(options.userKey);
|
|
7518
|
+
} else {
|
|
7519
|
+
clearUserTracking();
|
|
7520
|
+
}
|
|
7521
|
+
if (options.analytics) {
|
|
7522
|
+
initAnalyticsTracking(options.analytics);
|
|
7523
|
+
}
|
|
7524
|
+
if (options.delayedClickTracking) {
|
|
7525
|
+
window.localStorage.setItem(TRACKING_CLICK_DELAYED, "1");
|
|
7526
|
+
checkAndDispatchDelayedEvents();
|
|
7527
|
+
} else {
|
|
7528
|
+
window.localStorage.removeItem(TRACKING_CLICK_DELAYED);
|
|
7529
|
+
}
|
|
7530
|
+
};
|
|
7531
|
+
const getLupaTrackingContext = () => {
|
|
7532
|
+
if (!isTrackingEnabled()) {
|
|
7533
|
+
return {};
|
|
7534
|
+
}
|
|
7535
|
+
return {
|
|
7536
|
+
userId: getUserKey(),
|
|
7537
|
+
sessionId: getSessionKey()
|
|
7538
|
+
};
|
|
7539
|
+
};
|
|
7540
|
+
const trackLupaEvent = (queryKey, data = {}, options) => {
|
|
7541
|
+
var _a, _b;
|
|
7542
|
+
if (!queryKey || !data.type) {
|
|
7543
|
+
return;
|
|
7544
|
+
}
|
|
7545
|
+
const eventData = {
|
|
7546
|
+
searchQuery: (_a = data.searchQuery) != null ? _a : "",
|
|
7547
|
+
itemId: (_b = data.itemId) != null ? _b : "",
|
|
7548
|
+
name: data.type,
|
|
7549
|
+
userId: getUserKey(),
|
|
7550
|
+
sessionId: getSessionKey(),
|
|
7551
|
+
filters: data.filters
|
|
7552
|
+
};
|
|
7553
|
+
LupaSearchSdk.track(queryKey, eventData, options);
|
|
7554
|
+
};
|
|
7555
|
+
const sendGa = (name, ...args) => {
|
|
7556
|
+
window.ga(() => {
|
|
7557
|
+
const trackers = window.ga.getAll();
|
|
7558
|
+
const firstTracker = trackers[0];
|
|
7559
|
+
if (!firstTracker) {
|
|
7560
|
+
console.error("GA tracker not found");
|
|
7561
|
+
}
|
|
7562
|
+
const trackerName = firstTracker.get("name");
|
|
7563
|
+
window.ga(`${trackerName}.${name}`, ...args);
|
|
7564
|
+
});
|
|
7565
|
+
};
|
|
7566
|
+
const trackAnalyticsEvent = (data) => {
|
|
7567
|
+
var _a, _b, _c;
|
|
7568
|
+
try {
|
|
7569
|
+
const options = JSON.parse(
|
|
7570
|
+
(_a = window.sessionStorage.getItem(TRACKING_ANALYTICS_KEY)) != null ? _a : "{}"
|
|
7571
|
+
);
|
|
7572
|
+
if (!data.analytics || !options.enabled || ((_c = options.ignoreEvents) == null ? void 0 : _c.includes((_b = data.analytics) == null ? void 0 : _b.type))) {
|
|
7573
|
+
return;
|
|
7574
|
+
}
|
|
7575
|
+
switch (options.type) {
|
|
7576
|
+
case "ua":
|
|
7577
|
+
sendUaAnalyticsEvent(data, options);
|
|
7578
|
+
break;
|
|
7579
|
+
case "ga4":
|
|
7580
|
+
sendGa4AnalyticsEvent(data, options);
|
|
7581
|
+
break;
|
|
7582
|
+
case "debug":
|
|
7583
|
+
processDebugEvent(data);
|
|
7584
|
+
break;
|
|
7585
|
+
default:
|
|
7586
|
+
sendUaAnalyticsEvent(data, options);
|
|
7587
|
+
}
|
|
7588
|
+
} catch (e2) {
|
|
7589
|
+
console.error("Unable to send an event to google analytics");
|
|
7590
|
+
}
|
|
7591
|
+
};
|
|
7592
|
+
const parseEcommerceData = (data, title) => {
|
|
7593
|
+
var _a, _b;
|
|
7594
|
+
return ((_a = data.analytics) == null ? void 0 : _a.items) ? {
|
|
7595
|
+
item_list_name: title,
|
|
7596
|
+
items: (_b = data.analytics) == null ? void 0 : _b.items
|
|
7597
|
+
} : void 0;
|
|
7598
|
+
};
|
|
7599
|
+
const sendUaAnalyticsEvent = (data, options) => {
|
|
7600
|
+
var _a, _b, _c, _d;
|
|
7601
|
+
const ga = window.ga;
|
|
7602
|
+
if (!ga) {
|
|
7603
|
+
console.error("Google Analytics object not found");
|
|
7604
|
+
return;
|
|
7605
|
+
}
|
|
7606
|
+
sendGa(
|
|
7607
|
+
"send",
|
|
7608
|
+
"event",
|
|
7609
|
+
options.parentEventName,
|
|
7610
|
+
(_b = (_a = data.analytics) == null ? void 0 : _a.type) != null ? _b : "",
|
|
7611
|
+
(_d = (_c = data.analytics) == null ? void 0 : _c.label) != null ? _d : ""
|
|
7612
|
+
);
|
|
7613
|
+
};
|
|
7614
|
+
const sendGa4AnalyticsEvent = (data, options) => {
|
|
7615
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
7616
|
+
if (!window || !window.dataLayer) {
|
|
7617
|
+
console.error("dataLayer object not found.");
|
|
7618
|
+
return;
|
|
7619
|
+
}
|
|
7620
|
+
const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
|
|
7621
|
+
const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
|
|
7622
|
+
const params = __spreadValues2({
|
|
7623
|
+
search_text: data.searchQuery,
|
|
7624
|
+
item_title: title,
|
|
7625
|
+
item_id: data.itemId,
|
|
7626
|
+
ecommerce: parseEcommerceData(data, (_c = data.analytics) == null ? void 0 : _c.listLabel)
|
|
7627
|
+
}, (_e = (_d = data.analytics) == null ? void 0 : _d.additionalParams) != null ? _e : {});
|
|
7628
|
+
window.dataLayer.push(__spreadValues2({
|
|
7629
|
+
event: (_g = (_f = data.analytics) == null ? void 0 : _f.type) != null ? _g : options.parentEventName
|
|
7630
|
+
}, params));
|
|
7631
|
+
};
|
|
7632
|
+
const processDebugEvent = (data) => {
|
|
7633
|
+
var _a, _b, _c, _d;
|
|
7634
|
+
const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
|
|
7635
|
+
const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
|
|
7636
|
+
const params = {
|
|
7637
|
+
event: (_c = data.analytics) == null ? void 0 : _c.type,
|
|
7638
|
+
search_text: data.searchQuery,
|
|
7639
|
+
item_title: title,
|
|
7640
|
+
item_id: data.itemId,
|
|
7641
|
+
ecommerce: parseEcommerceData(data, (_d = data.analytics) == null ? void 0 : _d.listLabel)
|
|
7642
|
+
};
|
|
7643
|
+
console.debug("Analytics debug event:", params);
|
|
7644
|
+
};
|
|
7645
|
+
const getDelayedEventsCache = () => {
|
|
7646
|
+
var _a;
|
|
7647
|
+
try {
|
|
7648
|
+
return JSON.parse((_a = window.localStorage.getItem(DELAYED_TRACKING_EVENTS_CACHE)) != null ? _a : "{}");
|
|
7649
|
+
} catch (e2) {
|
|
7650
|
+
return {};
|
|
7651
|
+
}
|
|
7652
|
+
};
|
|
7653
|
+
const storeDelayedEventCache = (cache) => {
|
|
7654
|
+
try {
|
|
7655
|
+
window.localStorage.setItem(DELAYED_TRACKING_EVENTS_CACHE, JSON.stringify(cache));
|
|
7656
|
+
} catch (e2) {
|
|
7657
|
+
}
|
|
7658
|
+
};
|
|
7659
|
+
const checkAndDispatchDelayedEvents = () => {
|
|
7660
|
+
var _a, _b;
|
|
7661
|
+
const optionsStore = useOptionsStore();
|
|
7662
|
+
const eventCache = getDelayedEventsCache();
|
|
7663
|
+
const urls = Object.keys(eventCache);
|
|
7664
|
+
for (const url of urls) {
|
|
7665
|
+
if ((_a = window.location.href) == null ? void 0 : _a.includes(url)) {
|
|
7666
|
+
const options = (_b = optionsStore.envOptions) != null ? _b : { environment: "production" };
|
|
7667
|
+
const { queryKey, data } = eventCache[url];
|
|
7668
|
+
track(queryKey, data, options);
|
|
7669
|
+
}
|
|
7670
|
+
}
|
|
7671
|
+
storeDelayedEventCache({});
|
|
7672
|
+
};
|
|
7673
|
+
const track = (queryKey, data = {}, options) => {
|
|
7674
|
+
var _a;
|
|
7675
|
+
if (!isTrackingEnabled()) {
|
|
7676
|
+
return;
|
|
7677
|
+
}
|
|
7678
|
+
const hasSearchQuery = data.searchQuery;
|
|
7679
|
+
if (!hasSearchQuery && !((_a = data.options) == null ? void 0 : _a.allowEmptySearchQuery)) {
|
|
7680
|
+
return;
|
|
7681
|
+
}
|
|
7682
|
+
trackAnalyticsEvent(data);
|
|
7683
|
+
trackLupaEvent(queryKey, data, options);
|
|
7684
|
+
};
|
|
7634
7685
|
var DocumentElementType = /* @__PURE__ */ ((DocumentElementType2) => {
|
|
7635
7686
|
DocumentElementType2["IMAGE"] = "image";
|
|
7636
7687
|
DocumentElementType2["TITLE"] = "title";
|
|
@@ -8614,7 +8665,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
8614
8665
|
const _hoisted_1$1g = { id: "lupa-search-box-input-container" };
|
|
8615
8666
|
const _hoisted_2$U = { class: "lupa-input-clear" };
|
|
8616
8667
|
const _hoisted_3$D = { id: "lupa-search-box-input" };
|
|
8617
|
-
const _hoisted_4$
|
|
8668
|
+
const _hoisted_4$t = ["value"];
|
|
8618
8669
|
const _hoisted_5$j = ["aria-label", "placeholder"];
|
|
8619
8670
|
const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
8620
8671
|
const _hoisted_7$7 = [
|
|
@@ -8721,7 +8772,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
8721
8772
|
"aria-hidden": "true",
|
|
8722
8773
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
8723
8774
|
disabled: ""
|
|
8724
|
-
}, null, 8, _hoisted_4$
|
|
8775
|
+
}, null, 8, _hoisted_4$t),
|
|
8725
8776
|
withDirectives(createBaseVNode("input", mergeProps({
|
|
8726
8777
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
8727
8778
|
}, inputAttributes.value, {
|
|
@@ -8933,7 +8984,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
8933
8984
|
class: "lupa-suggestion-facet",
|
|
8934
8985
|
"data-cy": "lupa-suggestion-facet"
|
|
8935
8986
|
};
|
|
8936
|
-
const _hoisted_4$
|
|
8987
|
+
const _hoisted_4$s = {
|
|
8937
8988
|
class: "lupa-suggestion-facet-label",
|
|
8938
8989
|
"data-cy": "lupa-suggestion-facet-label"
|
|
8939
8990
|
};
|
|
@@ -8979,7 +9030,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
8979
9030
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
8980
9031
|
}, null, 8, _hoisted_1$1c)) : (openBlock(), createElementBlock("div", _hoisted_2$S, toDisplayString(_ctx.suggestion.display), 1)),
|
|
8981
9032
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$C, [
|
|
8982
|
-
createBaseVNode("span", _hoisted_4$
|
|
9033
|
+
createBaseVNode("span", _hoisted_4$s, toDisplayString(facetLabel.value), 1),
|
|
8983
9034
|
createBaseVNode("span", _hoisted_5$i, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
8984
9035
|
])) : createCommentVNode("", true)
|
|
8985
9036
|
]);
|
|
@@ -18495,7 +18546,7 @@ and ensure you are accounting for this risk.
|
|
|
18495
18546
|
const _hoisted_1$16 = ["innerHTML"];
|
|
18496
18547
|
const _hoisted_2$O = { key: 0 };
|
|
18497
18548
|
const _hoisted_3$B = { key: 1 };
|
|
18498
|
-
const _hoisted_4$
|
|
18549
|
+
const _hoisted_4$r = { class: "lupa-search-box-custom-label" };
|
|
18499
18550
|
const _hoisted_5$h = { class: "lupa-search-box-custom-text" };
|
|
18500
18551
|
const _sfc_main$1e = /* @__PURE__ */ defineComponent({
|
|
18501
18552
|
__name: "SearchBoxProductCustom",
|
|
@@ -18528,7 +18579,7 @@ and ensure you are accounting for this risk.
|
|
|
18528
18579
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
18529
18580
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
18530
18581
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$O, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$B, [
|
|
18531
|
-
createBaseVNode("div", _hoisted_4$
|
|
18582
|
+
createBaseVNode("div", _hoisted_4$r, toDisplayString(label.value), 1),
|
|
18532
18583
|
createBaseVNode("div", _hoisted_5$h, toDisplayString(text.value), 1)
|
|
18533
18584
|
]))
|
|
18534
18585
|
], 16));
|
|
@@ -18941,7 +18992,7 @@ and ensure you are accounting for this risk.
|
|
|
18941
18992
|
const _hoisted_1$12 = { class: "lupa-badge-title" };
|
|
18942
18993
|
const _hoisted_2$M = ["src"];
|
|
18943
18994
|
const _hoisted_3$z = { key: 1 };
|
|
18944
|
-
const _hoisted_4$
|
|
18995
|
+
const _hoisted_4$q = {
|
|
18945
18996
|
key: 0,
|
|
18946
18997
|
class: "lupa-badge-full-text"
|
|
18947
18998
|
};
|
|
@@ -18985,7 +19036,7 @@ and ensure you are accounting for this risk.
|
|
|
18985
19036
|
}, null, 8, _hoisted_2$M)) : createCommentVNode("", true),
|
|
18986
19037
|
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$z, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
18987
19038
|
]),
|
|
18988
|
-
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
19039
|
+
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$q, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
18989
19040
|
], 6);
|
|
18990
19041
|
};
|
|
18991
19042
|
}
|
|
@@ -19463,7 +19514,18 @@ and ensure you are accounting for this risk.
|
|
|
19463
19514
|
options
|
|
19464
19515
|
);
|
|
19465
19516
|
};
|
|
19466
|
-
|
|
19517
|
+
const trackDelayedEvent = ({
|
|
19518
|
+
queryKey,
|
|
19519
|
+
data,
|
|
19520
|
+
url
|
|
19521
|
+
}) => {
|
|
19522
|
+
let currentCache = getDelayedEventsCache();
|
|
19523
|
+
currentCache = __spreadProps2(__spreadValues2({}, currentCache), {
|
|
19524
|
+
[url]: { data, queryKey }
|
|
19525
|
+
});
|
|
19526
|
+
storeDelayedEventCache(currentCache);
|
|
19527
|
+
};
|
|
19528
|
+
return { trackSearch, trackResults, trackEvent, trackDelayedEvent };
|
|
19467
19529
|
});
|
|
19468
19530
|
const _hoisted_1$X = { id: "lupa-search-box-products" };
|
|
19469
19531
|
const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
@@ -19507,7 +19569,7 @@ and ensure you are accounting for this risk.
|
|
|
19507
19569
|
if (!props.panelOptions.idKey) {
|
|
19508
19570
|
return;
|
|
19509
19571
|
}
|
|
19510
|
-
|
|
19572
|
+
const trackableEvent = {
|
|
19511
19573
|
queryKey: props.panelOptions.queryKey,
|
|
19512
19574
|
data: {
|
|
19513
19575
|
itemId: id,
|
|
@@ -19519,7 +19581,14 @@ and ensure you are accounting for this risk.
|
|
|
19519
19581
|
items: [item]
|
|
19520
19582
|
}
|
|
19521
19583
|
}
|
|
19522
|
-
}
|
|
19584
|
+
};
|
|
19585
|
+
if (isDelayedClickTracking()) {
|
|
19586
|
+
trackingStore.trackDelayedEvent(__spreadProps2(__spreadValues2({}, trackableEvent), {
|
|
19587
|
+
url: link
|
|
19588
|
+
}));
|
|
19589
|
+
} else {
|
|
19590
|
+
trackingStore.trackEvent(trackableEvent);
|
|
19591
|
+
}
|
|
19523
19592
|
if (!link || eventType === "addToCart") {
|
|
19524
19593
|
return;
|
|
19525
19594
|
}
|
|
@@ -19785,7 +19854,7 @@ and ensure you are accounting for this risk.
|
|
|
19785
19854
|
key: 0,
|
|
19786
19855
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
19787
19856
|
};
|
|
19788
|
-
const _hoisted_4$
|
|
19857
|
+
const _hoisted_4$p = {
|
|
19789
19858
|
key: 1,
|
|
19790
19859
|
class: "lupa-panel-title"
|
|
19791
19860
|
};
|
|
@@ -19979,7 +20048,7 @@ and ensure you are accounting for this risk.
|
|
|
19979
20048
|
"data-cy": "lupa-panel-" + panel.type + "-index"
|
|
19980
20049
|
}, [
|
|
19981
20050
|
((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$x, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
|
|
19982
|
-
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
20051
|
+
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$p, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
|
|
19983
20052
|
panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
|
|
19984
20053
|
key: 2,
|
|
19985
20054
|
panel,
|
|
@@ -20245,7 +20314,7 @@ and ensure you are accounting for this risk.
|
|
|
20245
20314
|
if (!doc2.queryKey || !doc2.doc) {
|
|
20246
20315
|
return;
|
|
20247
20316
|
}
|
|
20248
|
-
|
|
20317
|
+
const event = {
|
|
20249
20318
|
queryKey: doc2.queryKey,
|
|
20250
20319
|
data: {
|
|
20251
20320
|
itemId: doc2.id,
|
|
@@ -20257,7 +20326,14 @@ and ensure you are accounting for this risk.
|
|
|
20257
20326
|
items: [doc2]
|
|
20258
20327
|
}
|
|
20259
20328
|
}
|
|
20260
|
-
}
|
|
20329
|
+
};
|
|
20330
|
+
if (isDelayedClickTracking()) {
|
|
20331
|
+
trackingStore.trackDelayedEvent(__spreadProps2(__spreadValues2({}, event), {
|
|
20332
|
+
url: generateLink(props.options.links.searchResults, doc2)
|
|
20333
|
+
}));
|
|
20334
|
+
} else {
|
|
20335
|
+
trackingStore.trackEvent(event);
|
|
20336
|
+
}
|
|
20261
20337
|
};
|
|
20262
20338
|
const trackSearchQuery = (query) => {
|
|
20263
20339
|
if (!query) {
|
|
@@ -20418,7 +20494,7 @@ and ensure you are accounting for this risk.
|
|
|
20418
20494
|
key: 1,
|
|
20419
20495
|
"data-cy": "did-you-mean-label"
|
|
20420
20496
|
};
|
|
20421
|
-
const _hoisted_4$
|
|
20497
|
+
const _hoisted_4$o = { key: 1 };
|
|
20422
20498
|
const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
20423
20499
|
__name: "SearchResultsDidYouMean",
|
|
20424
20500
|
props: {
|
|
@@ -20469,7 +20545,7 @@ and ensure you are accounting for this risk.
|
|
|
20469
20545
|
class: "lupa-did-you-mean lupa-highlighted-search-text",
|
|
20470
20546
|
"data-cy": "did-you-mean-value",
|
|
20471
20547
|
onClick: _cache[0] || (_cache[0] = ($event) => goToResults({ searchText: didYouMeanValue.value }))
|
|
20472
|
-
}, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
20548
|
+
}, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$o, toDisplayString(label) + " ", 1))
|
|
20473
20549
|
]);
|
|
20474
20550
|
}), 128))
|
|
20475
20551
|
])) : createCommentVNode("", true)
|
|
@@ -20519,7 +20595,7 @@ and ensure you are accounting for this risk.
|
|
|
20519
20595
|
key: 1,
|
|
20520
20596
|
class: "lupa-results-total-count"
|
|
20521
20597
|
};
|
|
20522
|
-
const _hoisted_4$
|
|
20598
|
+
const _hoisted_4$n = { class: "lupa-results-total-count-number" };
|
|
20523
20599
|
const _hoisted_5$f = ["innerHTML"];
|
|
20524
20600
|
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
20525
20601
|
__name: "SearchResultsTitle",
|
|
@@ -20565,7 +20641,7 @@ and ensure you are accounting for this risk.
|
|
|
20565
20641
|
queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$E, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
|
|
20566
20642
|
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$v, [
|
|
20567
20643
|
createTextVNode("(" + toDisplayString(searchResultsCountLabel.value), 1),
|
|
20568
|
-
createBaseVNode("span", _hoisted_4$
|
|
20644
|
+
createBaseVNode("span", _hoisted_4$n, toDisplayString(unref(totalItems)), 1),
|
|
20569
20645
|
createTextVNode(")")
|
|
20570
20646
|
])) : createCommentVNode("", true)
|
|
20571
20647
|
])) : createCommentVNode("", true),
|
|
@@ -20623,7 +20699,7 @@ and ensure you are accounting for this risk.
|
|
|
20623
20699
|
key: 0,
|
|
20624
20700
|
class: "filter-values"
|
|
20625
20701
|
};
|
|
20626
|
-
const _hoisted_4$
|
|
20702
|
+
const _hoisted_4$m = { class: "lupa-current-filter-list" };
|
|
20627
20703
|
const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
20628
20704
|
__name: "CurrentFilters",
|
|
20629
20705
|
props: {
|
|
@@ -20707,7 +20783,7 @@ and ensure you are accounting for this risk.
|
|
|
20707
20783
|
}, null, 2)) : createCommentVNode("", true)
|
|
20708
20784
|
]),
|
|
20709
20785
|
!_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$t, [
|
|
20710
|
-
createBaseVNode("div", _hoisted_4$
|
|
20786
|
+
createBaseVNode("div", _hoisted_4$m, [
|
|
20711
20787
|
(openBlock(true), createElementBlock(Fragment, null, renderList(currentDisplayFilters.value, (filter2) => {
|
|
20712
20788
|
return openBlock(), createBlock(_sfc_main$V, {
|
|
20713
20789
|
key: filter2.key + "_" + filter2.value,
|
|
@@ -20775,7 +20851,7 @@ and ensure you are accounting for this risk.
|
|
|
20775
20851
|
};
|
|
20776
20852
|
const _hoisted_2$B = { class: "lupa-category-back" };
|
|
20777
20853
|
const _hoisted_3$s = ["href"];
|
|
20778
|
-
const _hoisted_4$
|
|
20854
|
+
const _hoisted_4$l = ["href"];
|
|
20779
20855
|
const _hoisted_5$e = { class: "lupa-child-category-list" };
|
|
20780
20856
|
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
20781
20857
|
__name: "CategoryFilter",
|
|
@@ -20882,7 +20958,7 @@ and ensure you are accounting for this risk.
|
|
|
20882
20958
|
href: parentUrlLink.value,
|
|
20883
20959
|
class: normalizeClass({ "lupa-title-category": !hasBackButton.value }),
|
|
20884
20960
|
onClick: handleNavigationParent
|
|
20885
|
-
}, toDisplayString(parentTitle.value), 11, _hoisted_4$
|
|
20961
|
+
}, toDisplayString(parentTitle.value), 11, _hoisted_4$l)
|
|
20886
20962
|
], 2),
|
|
20887
20963
|
createBaseVNode("div", _hoisted_5$e, [
|
|
20888
20964
|
(openBlock(true), createElementBlock(Fragment, null, renderList(categoryChildren.value, (child) => {
|
|
@@ -20903,7 +20979,7 @@ and ensure you are accounting for this risk.
|
|
|
20903
20979
|
};
|
|
20904
20980
|
const _hoisted_2$A = ["placeholder"];
|
|
20905
20981
|
const _hoisted_3$r = { class: "lupa-terms-list" };
|
|
20906
|
-
const _hoisted_4$
|
|
20982
|
+
const _hoisted_4$k = ["onClick"];
|
|
20907
20983
|
const _hoisted_5$d = { class: "lupa-term-checkbox-wrapper" };
|
|
20908
20984
|
const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
|
|
20909
20985
|
const _hoisted_7$6 = { class: "lupa-term-label" };
|
|
@@ -21011,7 +21087,7 @@ and ensure you are accounting for this risk.
|
|
|
21011
21087
|
createBaseVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
|
|
21012
21088
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
21013
21089
|
])
|
|
21014
|
-
], 10, _hoisted_4$
|
|
21090
|
+
], 10, _hoisted_4$k);
|
|
21015
21091
|
}), 128))
|
|
21016
21092
|
]),
|
|
21017
21093
|
displayShowMore.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -22011,7 +22087,7 @@ and ensure you are accounting for this risk.
|
|
|
22011
22087
|
key: 1,
|
|
22012
22088
|
class: "lupa-stats-facet-summary-input"
|
|
22013
22089
|
};
|
|
22014
|
-
const _hoisted_4$
|
|
22090
|
+
const _hoisted_4$j = {
|
|
22015
22091
|
key: 0,
|
|
22016
22092
|
class: "lupa-stats-range-label"
|
|
22017
22093
|
};
|
|
@@ -22210,7 +22286,7 @@ and ensure you are accounting for this risk.
|
|
|
22210
22286
|
return openBlock(), createElementBlock("div", _hoisted_1$L, [
|
|
22211
22287
|
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$z, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$q, [
|
|
22212
22288
|
createBaseVNode("div", null, [
|
|
22213
|
-
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
22289
|
+
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
|
|
22214
22290
|
createBaseVNode("div", _hoisted_5$c, [
|
|
22215
22291
|
withDirectives(createBaseVNode("input", {
|
|
22216
22292
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
|
|
@@ -22277,7 +22353,7 @@ and ensure you are accounting for this risk.
|
|
|
22277
22353
|
const _hoisted_1$K = { class: "lupa-term-checkbox-wrapper" };
|
|
22278
22354
|
const _hoisted_2$y = { class: "lupa-term-checkbox-label" };
|
|
22279
22355
|
const _hoisted_3$p = { class: "lupa-term-label" };
|
|
22280
|
-
const _hoisted_4$
|
|
22356
|
+
const _hoisted_4$i = {
|
|
22281
22357
|
key: 0,
|
|
22282
22358
|
class: "lupa-term-count"
|
|
22283
22359
|
};
|
|
@@ -22338,7 +22414,7 @@ and ensure you are accounting for this risk.
|
|
|
22338
22414
|
]),
|
|
22339
22415
|
createBaseVNode("div", _hoisted_2$y, [
|
|
22340
22416
|
createBaseVNode("span", _hoisted_3$p, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
|
|
22341
|
-
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
22417
|
+
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$i, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
|
|
22342
22418
|
])
|
|
22343
22419
|
]),
|
|
22344
22420
|
showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_5$b, [
|
|
@@ -22859,7 +22935,7 @@ and ensure you are accounting for this risk.
|
|
|
22859
22935
|
};
|
|
22860
22936
|
const _hoisted_2$t = ["onClick"];
|
|
22861
22937
|
const _hoisted_3$n = { class: "lupa-mobile-sidebar-content" };
|
|
22862
|
-
const _hoisted_4$
|
|
22938
|
+
const _hoisted_4$h = { class: "lupa-sidebar-top" };
|
|
22863
22939
|
const _hoisted_5$a = { class: "lupa-sidebar-title" };
|
|
22864
22940
|
const _hoisted_6$6 = {
|
|
22865
22941
|
key: 0,
|
|
@@ -22903,7 +22979,7 @@ and ensure you are accounting for this risk.
|
|
|
22903
22979
|
onClick: withModifiers(handleMobileToggle, ["stop"])
|
|
22904
22980
|
}, null, 8, _hoisted_2$t),
|
|
22905
22981
|
createBaseVNode("div", _hoisted_3$n, [
|
|
22906
|
-
createBaseVNode("div", _hoisted_4$
|
|
22982
|
+
createBaseVNode("div", _hoisted_4$h, [
|
|
22907
22983
|
createBaseVNode("div", _hoisted_5$a, [
|
|
22908
22984
|
createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
|
|
22909
22985
|
isFilterCountVisible.value ? (openBlock(), createElementBlock("span", _hoisted_6$6, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
|
|
@@ -22931,7 +23007,7 @@ and ensure you are accounting for this risk.
|
|
|
22931
23007
|
key: 1,
|
|
22932
23008
|
class: "lupa-search-results-breadcrumb-text"
|
|
22933
23009
|
};
|
|
22934
|
-
const _hoisted_4$
|
|
23010
|
+
const _hoisted_4$g = { key: 2 };
|
|
22935
23011
|
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
22936
23012
|
__name: "SearchResultsBreadcrumbs",
|
|
22937
23013
|
props: {
|
|
@@ -22972,7 +23048,7 @@ and ensure you are accounting for this risk.
|
|
|
22972
23048
|
return handleNavigation(e2, (_a = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a : "");
|
|
22973
23049
|
}
|
|
22974
23050
|
}, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$s)) : (openBlock(), createElementBlock("span", _hoisted_3$m, toDisplayString(getLabel(breadcrumb.label)), 1)),
|
|
22975
|
-
index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
23051
|
+
index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$g, " / ")) : createCommentVNode("", true)
|
|
22976
23052
|
]);
|
|
22977
23053
|
}), 128))
|
|
22978
23054
|
]);
|
|
@@ -23078,7 +23154,7 @@ and ensure you are accounting for this risk.
|
|
|
23078
23154
|
class: "lupa-page-number-separator"
|
|
23079
23155
|
};
|
|
23080
23156
|
const _hoisted_3$l = ["onClick"];
|
|
23081
|
-
const _hoisted_4$
|
|
23157
|
+
const _hoisted_4$f = {
|
|
23082
23158
|
key: 0,
|
|
23083
23159
|
class: "lupa-page-number-separator"
|
|
23084
23160
|
};
|
|
@@ -23184,7 +23260,7 @@ and ensure you are accounting for this risk.
|
|
|
23184
23260
|
}, toDisplayString(page), 11, _hoisted_3$l);
|
|
23185
23261
|
}), 128)),
|
|
23186
23262
|
showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
23187
|
-
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
23263
|
+
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$f, "...")) : createCommentVNode("", true),
|
|
23188
23264
|
createBaseVNode("div", {
|
|
23189
23265
|
class: "lupa-page-number lupa-page-number-last",
|
|
23190
23266
|
onClick: _cache[2] || (_cache[2] = () => {
|
|
@@ -23209,7 +23285,7 @@ and ensure you are accounting for this risk.
|
|
|
23209
23285
|
};
|
|
23210
23286
|
const _hoisted_2$q = { id: "lupa-select" };
|
|
23211
23287
|
const _hoisted_3$k = { class: "lupa-select-label" };
|
|
23212
|
-
const _hoisted_4$
|
|
23288
|
+
const _hoisted_4$e = ["aria-label"];
|
|
23213
23289
|
const _hoisted_5$9 = ["value"];
|
|
23214
23290
|
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
23215
23291
|
__name: "SearchResultsPageSize",
|
|
@@ -23256,7 +23332,7 @@ and ensure you are accounting for this risk.
|
|
|
23256
23332
|
value: option
|
|
23257
23333
|
}, toDisplayString(prefixLabel.value) + toDisplayString(option), 9, _hoisted_5$9);
|
|
23258
23334
|
}), 128))
|
|
23259
|
-
], 40, _hoisted_4$
|
|
23335
|
+
], 40, _hoisted_4$e)
|
|
23260
23336
|
])
|
|
23261
23337
|
]);
|
|
23262
23338
|
};
|
|
@@ -23268,7 +23344,7 @@ and ensure you are accounting for this risk.
|
|
|
23268
23344
|
};
|
|
23269
23345
|
const _hoisted_2$p = { id: "lupa-select" };
|
|
23270
23346
|
const _hoisted_3$j = { class: "lupa-select-label" };
|
|
23271
|
-
const _hoisted_4$
|
|
23347
|
+
const _hoisted_4$d = ["aria-label"];
|
|
23272
23348
|
const _hoisted_5$8 = ["value"];
|
|
23273
23349
|
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
23274
23350
|
__name: "SearchResultsSort",
|
|
@@ -23336,7 +23412,7 @@ and ensure you are accounting for this risk.
|
|
|
23336
23412
|
value: option.key
|
|
23337
23413
|
}, toDisplayString(option.label), 9, _hoisted_5$8);
|
|
23338
23414
|
}), 128))
|
|
23339
|
-
], 40, _hoisted_4$
|
|
23415
|
+
], 40, _hoisted_4$d), [
|
|
23340
23416
|
[vModelSelect, selectedKey.value]
|
|
23341
23417
|
])
|
|
23342
23418
|
])
|
|
@@ -23350,7 +23426,7 @@ and ensure you are accounting for this risk.
|
|
|
23350
23426
|
class: "lupa-toolbar-right-title"
|
|
23351
23427
|
};
|
|
23352
23428
|
const _hoisted_3$i = { key: 2 };
|
|
23353
|
-
const _hoisted_4$
|
|
23429
|
+
const _hoisted_4$c = { key: 4 };
|
|
23354
23430
|
const _hoisted_5$7 = { key: 6 };
|
|
23355
23431
|
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
23356
23432
|
const _hoisted_7$3 = {
|
|
@@ -23474,7 +23550,7 @@ and ensure you are accounting for this risk.
|
|
|
23474
23550
|
label: searchSummaryLabel.value,
|
|
23475
23551
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
23476
23552
|
onClear: handleClearAll
|
|
23477
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$
|
|
23553
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$c)),
|
|
23478
23554
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$D, {
|
|
23479
23555
|
key: 5,
|
|
23480
23556
|
options: paginationOptions.value.pageSelect,
|
|
@@ -23523,7 +23599,7 @@ and ensure you are accounting for this risk.
|
|
|
23523
23599
|
const _hoisted_1$u = ["title", "innerHTML"];
|
|
23524
23600
|
const _hoisted_2$n = ["title"];
|
|
23525
23601
|
const _hoisted_3$h = ["href", "innerHTML"];
|
|
23526
|
-
const _hoisted_4$
|
|
23602
|
+
const _hoisted_4$b = ["title"];
|
|
23527
23603
|
const _hoisted_5$6 = {
|
|
23528
23604
|
key: 0,
|
|
23529
23605
|
class: "lupa-search-results-product-title-text"
|
|
@@ -23591,7 +23667,7 @@ and ensure you are accounting for this risk.
|
|
|
23591
23667
|
class: "lupa-search-results-product-title-text lupa-title-link",
|
|
23592
23668
|
onClick: handleNavigation
|
|
23593
23669
|
}, toDisplayString(title.value), 9, _hoisted_6$4)) : createCommentVNode("", true)
|
|
23594
|
-
], 12, _hoisted_4$
|
|
23670
|
+
], 12, _hoisted_4$b));
|
|
23595
23671
|
};
|
|
23596
23672
|
}
|
|
23597
23673
|
});
|
|
@@ -23634,7 +23710,7 @@ and ensure you are accounting for this risk.
|
|
|
23634
23710
|
const _hoisted_1$s = { id: "lupa-search-results-rating" };
|
|
23635
23711
|
const _hoisted_2$m = { class: "lupa-ratings" };
|
|
23636
23712
|
const _hoisted_3$g = { class: "lupa-ratings-base" };
|
|
23637
|
-
const _hoisted_4$
|
|
23713
|
+
const _hoisted_4$a = ["innerHTML"];
|
|
23638
23714
|
const _hoisted_5$5 = { class: "lupa-rating-wrapper" };
|
|
23639
23715
|
const _hoisted_6$3 = ["innerHTML"];
|
|
23640
23716
|
const _hoisted_7$2 = ["href"];
|
|
@@ -23684,7 +23760,7 @@ and ensure you are accounting for this risk.
|
|
|
23684
23760
|
key: index,
|
|
23685
23761
|
innerHTML: star,
|
|
23686
23762
|
class: "lupa-rating lupa-rating-not-highlighted"
|
|
23687
|
-
}, null, 8, _hoisted_4$
|
|
23763
|
+
}, null, 8, _hoisted_4$a);
|
|
23688
23764
|
}), 128))
|
|
23689
23765
|
]),
|
|
23690
23766
|
createBaseVNode("div", _hoisted_5$5, [
|
|
@@ -23824,7 +23900,7 @@ and ensure you are accounting for this risk.
|
|
|
23824
23900
|
const _hoisted_1$p = ["innerHTML"];
|
|
23825
23901
|
const _hoisted_2$k = { key: 0 };
|
|
23826
23902
|
const _hoisted_3$e = { key: 1 };
|
|
23827
|
-
const _hoisted_4$
|
|
23903
|
+
const _hoisted_4$9 = { class: "lupa-search-box-custom-label" };
|
|
23828
23904
|
const _hoisted_5$4 = { class: "lupa-search-box-custom-text" };
|
|
23829
23905
|
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
23830
23906
|
__name: "SearchResultsProductCustom",
|
|
@@ -23869,7 +23945,7 @@ and ensure you are accounting for this risk.
|
|
|
23869
23945
|
class: className.value
|
|
23870
23946
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
23871
23947
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$k, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$e, [
|
|
23872
|
-
createBaseVNode("div", _hoisted_4$
|
|
23948
|
+
createBaseVNode("div", _hoisted_4$9, toDisplayString(label.value), 1),
|
|
23873
23949
|
createBaseVNode("div", _hoisted_5$4, toDisplayString(text.value), 1)
|
|
23874
23950
|
]))
|
|
23875
23951
|
], 16));
|
|
@@ -23915,7 +23991,7 @@ and ensure you are accounting for this risk.
|
|
|
23915
23991
|
const _hoisted_1$n = { id: "lupa-search-results-rating" };
|
|
23916
23992
|
const _hoisted_2$j = ["innerHTML"];
|
|
23917
23993
|
const _hoisted_3$d = { class: "lupa-ratings" };
|
|
23918
|
-
const _hoisted_4$
|
|
23994
|
+
const _hoisted_4$8 = ["href"];
|
|
23919
23995
|
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
23920
23996
|
__name: "SearchResultsProductSingleStarRating",
|
|
23921
23997
|
props: {
|
|
@@ -23953,7 +24029,7 @@ and ensure you are accounting for this risk.
|
|
|
23953
24029
|
createBaseVNode("a", {
|
|
23954
24030
|
href: ratingLink.value,
|
|
23955
24031
|
class: "lupa-total-ratings"
|
|
23956
|
-
}, toDisplayString(totalRatings.value), 9, _hoisted_4$
|
|
24032
|
+
}, toDisplayString(totalRatings.value), 9, _hoisted_4$8)
|
|
23957
24033
|
]);
|
|
23958
24034
|
};
|
|
23959
24035
|
}
|
|
@@ -24048,12 +24124,13 @@ and ensure you are accounting for this risk.
|
|
|
24048
24124
|
};
|
|
24049
24125
|
}
|
|
24050
24126
|
}));
|
|
24051
|
-
const _hoisted_1$m = ["
|
|
24052
|
-
const _hoisted_2$i =
|
|
24127
|
+
const _hoisted_1$m = ["onMouseup"];
|
|
24128
|
+
const _hoisted_2$i = ["href"];
|
|
24129
|
+
const _hoisted_3$c = {
|
|
24053
24130
|
key: 0,
|
|
24054
24131
|
class: "lupa-out-of-stock"
|
|
24055
24132
|
};
|
|
24056
|
-
const
|
|
24133
|
+
const _hoisted_4$7 = { class: "lupa-search-result-product-details-section" };
|
|
24057
24134
|
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
24058
24135
|
__name: "SearchResultsProductCard",
|
|
24059
24136
|
props: {
|
|
@@ -24157,7 +24234,7 @@ and ensure you are accounting for this risk.
|
|
|
24157
24234
|
});
|
|
24158
24235
|
const handleClick = () => {
|
|
24159
24236
|
var _a, _b, _c, _d;
|
|
24160
|
-
|
|
24237
|
+
const event = {
|
|
24161
24238
|
queryKey: props.options.queryKey,
|
|
24162
24239
|
data: {
|
|
24163
24240
|
itemId: id.value,
|
|
@@ -24170,9 +24247,15 @@ and ensure you are accounting for this risk.
|
|
|
24170
24247
|
items: [props.product],
|
|
24171
24248
|
itemId: id.value
|
|
24172
24249
|
},
|
|
24173
|
-
options: { allowEmptySearchQuery: true }
|
|
24250
|
+
options: { allowEmptySearchQuery: true },
|
|
24251
|
+
filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
|
|
24174
24252
|
}
|
|
24175
|
-
}
|
|
24253
|
+
};
|
|
24254
|
+
if (isDelayedClickTracking()) {
|
|
24255
|
+
trackingStore.trackDelayedEvent(__spreadProps2(__spreadValues2({}, event), { url: link.value }));
|
|
24256
|
+
} else {
|
|
24257
|
+
trackingStore.trackEvent(event);
|
|
24258
|
+
}
|
|
24176
24259
|
(_d = (_c = searchResultOptions.value.callbacks) == null ? void 0 : _c.onProductClick) == null ? void 0 : _d.call(_c, {
|
|
24177
24260
|
queryKey: query.value,
|
|
24178
24261
|
hasResults: true,
|
|
@@ -24205,7 +24288,10 @@ and ensure you are accounting for this risk.
|
|
|
24205
24288
|
id: "lupa-search-result-product-card",
|
|
24206
24289
|
"data-cy": "lupa-search-result-product-card",
|
|
24207
24290
|
class: ["lupa-search-result-product-card", !isInStock.value ? "lupa-out-of-stock" : ""]
|
|
24208
|
-
}, customDocumentHtmlAttributes.value, {
|
|
24291
|
+
}, customDocumentHtmlAttributes.value, {
|
|
24292
|
+
onClick: handleClick,
|
|
24293
|
+
onMouseup: withModifiers(handleClick, ["middle", "exact"])
|
|
24294
|
+
}), [
|
|
24209
24295
|
createVNode(_sfc_main$14, { options: badgesOptions.value }, null, 8, ["options"]),
|
|
24210
24296
|
createBaseVNode("div", {
|
|
24211
24297
|
class: normalizeClass(["lupa-search-result-product-contents", listLayoutClass.value])
|
|
@@ -24232,9 +24318,9 @@ and ensure you are accounting for this risk.
|
|
|
24232
24318
|
position: "image",
|
|
24233
24319
|
class: "lupa-image-badges"
|
|
24234
24320
|
}, null, 8, ["options"]),
|
|
24235
|
-
((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div",
|
|
24236
|
-
], 8,
|
|
24237
|
-
createBaseVNode("div",
|
|
24321
|
+
((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_3$c, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
|
|
24322
|
+
], 8, _hoisted_2$i),
|
|
24323
|
+
createBaseVNode("div", _hoisted_4$7, [
|
|
24238
24324
|
(openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
|
|
24239
24325
|
return openBlock(), createBlock(_sfc_main$p, {
|
|
24240
24326
|
class: "lupa-search-results-product-element",
|
|
@@ -24268,7 +24354,7 @@ and ensure you are accounting for this risk.
|
|
|
24268
24354
|
], 2);
|
|
24269
24355
|
}), 128))
|
|
24270
24356
|
], 2)
|
|
24271
|
-
], 16);
|
|
24357
|
+
], 16, _hoisted_1$m);
|
|
24272
24358
|
};
|
|
24273
24359
|
}
|
|
24274
24360
|
});
|
|
@@ -24406,6 +24492,7 @@ and ensure you are accounting for this risk.
|
|
|
24406
24492
|
});
|
|
24407
24493
|
};
|
|
24408
24494
|
const handleQueryChange = () => {
|
|
24495
|
+
showAll.value = false;
|
|
24409
24496
|
const context = getLupaTrackingContext();
|
|
24410
24497
|
const queryBody = __spreadProps2(__spreadValues2({}, context), {
|
|
24411
24498
|
limit: props.panel.totalCountLimit,
|