@getlupa/client 1.15.10 → 1.15.13
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 +172 -132
- package/dist/lupaSearch.js +172 -132
- package/dist/lupaSearch.mjs +172 -132
- package/dist/lupaSearch.umd.js +172 -132
- package/dist/src/index.d.ts +2 -1
- package/dist/src/modules/pluginManager/PluginConfigurationManager.d.ts +2 -1
- package/dist/src/types/OptionOverrides.d.ts +7 -0
- package/dist/src/utils/merger.utils.d.ts +1 -0
- package/package.json +2 -2
package/dist/lupaSearch.iife.js
CHANGED
|
@@ -71,9 +71,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
71
71
|
const isFunction$1 = (val) => typeof val === "function";
|
|
72
72
|
const isString = (val) => typeof val === "string";
|
|
73
73
|
const isSymbol = (val) => typeof val === "symbol";
|
|
74
|
-
const isObject$
|
|
74
|
+
const isObject$3 = (val) => val !== null && typeof val === "object";
|
|
75
75
|
const isPromise$1 = (val) => {
|
|
76
|
-
return isObject$
|
|
76
|
+
return isObject$3(val) && isFunction$1(val.then) && isFunction$1(val.catch);
|
|
77
77
|
};
|
|
78
78
|
const objectToString$1 = Object.prototype.toString;
|
|
79
79
|
const toTypeString = (value) => objectToString$1.call(value);
|
|
@@ -147,7 +147,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
147
147
|
return res;
|
|
148
148
|
} else if (isString(value)) {
|
|
149
149
|
return value;
|
|
150
|
-
} else if (isObject$
|
|
150
|
+
} else if (isObject$3(value)) {
|
|
151
151
|
return value;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
@@ -175,7 +175,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
175
175
|
res += normalized + " ";
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
} else if (isObject$
|
|
178
|
+
} else if (isObject$3(value)) {
|
|
179
179
|
for (const name in value) {
|
|
180
180
|
if (value[name]) {
|
|
181
181
|
res += name + " ";
|
|
@@ -228,8 +228,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
228
228
|
if (aValidType || bValidType) {
|
|
229
229
|
return aValidType && bValidType ? looseCompareArrays(a, b) : false;
|
|
230
230
|
}
|
|
231
|
-
aValidType = isObject$
|
|
232
|
-
bValidType = isObject$
|
|
231
|
+
aValidType = isObject$3(a);
|
|
232
|
+
bValidType = isObject$3(b);
|
|
233
233
|
if (aValidType || bValidType) {
|
|
234
234
|
if (!aValidType || !bValidType) {
|
|
235
235
|
return false;
|
|
@@ -253,7 +253,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
253
253
|
return arr.findIndex((item) => looseEqual(item, val));
|
|
254
254
|
}
|
|
255
255
|
const toDisplayString = (val) => {
|
|
256
|
-
return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject$
|
|
256
|
+
return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject$3(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
|
|
257
257
|
};
|
|
258
258
|
const replacer = (_key, val) => {
|
|
259
259
|
if (val && val.__v_isRef) {
|
|
@@ -269,7 +269,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
269
269
|
return {
|
|
270
270
|
[`Set(${val.size})`]: [...val.values()]
|
|
271
271
|
};
|
|
272
|
-
} else if (isObject$
|
|
272
|
+
} else if (isObject$3(val) && !isArray$1(val) && !isPlainObject$4(val)) {
|
|
273
273
|
return String(val);
|
|
274
274
|
}
|
|
275
275
|
return val;
|
|
@@ -662,7 +662,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
662
662
|
if (isRef(res)) {
|
|
663
663
|
return targetIsArray && isIntegerKey(key) ? res : res.value;
|
|
664
664
|
}
|
|
665
|
-
if (isObject$
|
|
665
|
+
if (isObject$3(res)) {
|
|
666
666
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
667
667
|
}
|
|
668
668
|
return res;
|
|
@@ -1056,7 +1056,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1056
1056
|
);
|
|
1057
1057
|
}
|
|
1058
1058
|
function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
|
|
1059
|
-
if (!isObject$
|
|
1059
|
+
if (!isObject$3(target)) {
|
|
1060
1060
|
return target;
|
|
1061
1061
|
}
|
|
1062
1062
|
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
@@ -1100,8 +1100,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1100
1100
|
def(value, "__v_skip", true);
|
|
1101
1101
|
return value;
|
|
1102
1102
|
}
|
|
1103
|
-
const toReactive = (value) => isObject$
|
|
1104
|
-
const toReadonly = (value) => isObject$
|
|
1103
|
+
const toReactive = (value) => isObject$3(value) ? reactive(value) : value;
|
|
1104
|
+
const toReadonly = (value) => isObject$3(value) ? readonly(value) : value;
|
|
1105
1105
|
function trackRefValue(ref2) {
|
|
1106
1106
|
if (shouldTrack && activeEffect) {
|
|
1107
1107
|
ref2 = toRaw(ref2);
|
|
@@ -1211,7 +1211,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1211
1211
|
return source;
|
|
1212
1212
|
} else if (isFunction$1(source)) {
|
|
1213
1213
|
return new GetterRefImpl(source);
|
|
1214
|
-
} else if (isObject$
|
|
1214
|
+
} else if (isObject$3(source) && arguments.length > 1) {
|
|
1215
1215
|
return propertyToRef(source, key, defaultValue);
|
|
1216
1216
|
} else {
|
|
1217
1217
|
return ref(source);
|
|
@@ -1531,7 +1531,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
1533
|
if (!raw && !hasExtends) {
|
|
1534
|
-
if (isObject$
|
|
1534
|
+
if (isObject$3(comp)) {
|
|
1535
1535
|
cache.set(comp, null);
|
|
1536
1536
|
}
|
|
1537
1537
|
return null;
|
|
@@ -1541,7 +1541,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1541
1541
|
} else {
|
|
1542
1542
|
extend(normalized, raw);
|
|
1543
1543
|
}
|
|
1544
|
-
if (isObject$
|
|
1544
|
+
if (isObject$3(comp)) {
|
|
1545
1545
|
cache.set(comp, normalized);
|
|
1546
1546
|
}
|
|
1547
1547
|
return normalized;
|
|
@@ -1949,7 +1949,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
1949
1949
|
};
|
|
1950
1950
|
}
|
|
1951
1951
|
function traverse(value, seen) {
|
|
1952
|
-
if (!isObject$
|
|
1952
|
+
if (!isObject$3(value) || value["__v_skip"]) {
|
|
1953
1953
|
return value;
|
|
1954
1954
|
}
|
|
1955
1955
|
seen = seen || /* @__PURE__ */ new Set();
|
|
@@ -2484,7 +2484,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2484
2484
|
for (let i = 0; i < source; i++) {
|
|
2485
2485
|
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2486
2486
|
}
|
|
2487
|
-
} else if (isObject$
|
|
2487
|
+
} else if (isObject$3(source)) {
|
|
2488
2488
|
if (source[Symbol.iterator]) {
|
|
2489
2489
|
ret = Array.from(
|
|
2490
2490
|
source,
|
|
@@ -2761,7 +2761,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2761
2761
|
}
|
|
2762
2762
|
if (dataOptions) {
|
|
2763
2763
|
const data = dataOptions.call(publicThis, publicThis);
|
|
2764
|
-
if (!isObject$
|
|
2764
|
+
if (!isObject$3(data))
|
|
2765
2765
|
;
|
|
2766
2766
|
else {
|
|
2767
2767
|
instance.data = reactive(data);
|
|
@@ -2849,7 +2849,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2849
2849
|
for (const key in injectOptions) {
|
|
2850
2850
|
const opt = injectOptions[key];
|
|
2851
2851
|
let injected;
|
|
2852
|
-
if (isObject$
|
|
2852
|
+
if (isObject$3(opt)) {
|
|
2853
2853
|
if ("default" in opt) {
|
|
2854
2854
|
injected = inject(
|
|
2855
2855
|
opt.from || key,
|
|
@@ -2891,7 +2891,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2891
2891
|
}
|
|
2892
2892
|
} else if (isFunction$1(raw)) {
|
|
2893
2893
|
watch(getter, raw.bind(publicThis));
|
|
2894
|
-
} else if (isObject$
|
|
2894
|
+
} else if (isObject$3(raw)) {
|
|
2895
2895
|
if (isArray$1(raw)) {
|
|
2896
2896
|
raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2897
2897
|
} else {
|
|
@@ -2928,7 +2928,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2928
2928
|
}
|
|
2929
2929
|
mergeOptions(resolved, base, optionMergeStrategies);
|
|
2930
2930
|
}
|
|
2931
|
-
if (isObject$
|
|
2931
|
+
if (isObject$3(base)) {
|
|
2932
2932
|
cache.set(base, resolved);
|
|
2933
2933
|
}
|
|
2934
2934
|
return resolved;
|
|
@@ -3069,7 +3069,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3069
3069
|
if (!isFunction$1(rootComponent)) {
|
|
3070
3070
|
rootComponent = extend({}, rootComponent);
|
|
3071
3071
|
}
|
|
3072
|
-
if (rootProps != null && !isObject$
|
|
3072
|
+
if (rootProps != null && !isObject$3(rootProps)) {
|
|
3073
3073
|
rootProps = null;
|
|
3074
3074
|
}
|
|
3075
3075
|
const context = createAppContext();
|
|
@@ -3413,7 +3413,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3413
3413
|
}
|
|
3414
3414
|
}
|
|
3415
3415
|
if (!raw && !hasExtends) {
|
|
3416
|
-
if (isObject$
|
|
3416
|
+
if (isObject$3(comp)) {
|
|
3417
3417
|
cache.set(comp, EMPTY_ARR);
|
|
3418
3418
|
}
|
|
3419
3419
|
return EMPTY_ARR;
|
|
@@ -3450,7 +3450,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3450
3450
|
}
|
|
3451
3451
|
}
|
|
3452
3452
|
const res = [normalized, needCastKeys];
|
|
3453
|
-
if (isObject$
|
|
3453
|
+
if (isObject$3(comp)) {
|
|
3454
3454
|
cache.set(comp, res);
|
|
3455
3455
|
}
|
|
3456
3456
|
return res;
|
|
@@ -5114,14 +5114,14 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5114
5114
|
if (klass && !isString(klass)) {
|
|
5115
5115
|
props.class = normalizeClass(klass);
|
|
5116
5116
|
}
|
|
5117
|
-
if (isObject$
|
|
5117
|
+
if (isObject$3(style)) {
|
|
5118
5118
|
if (isProxy(style) && !isArray$1(style)) {
|
|
5119
5119
|
style = extend({}, style);
|
|
5120
5120
|
}
|
|
5121
5121
|
props.style = normalizeStyle(style);
|
|
5122
5122
|
}
|
|
5123
5123
|
}
|
|
5124
|
-
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$
|
|
5124
|
+
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$3(type) ? 4 : isFunction$1(type) ? 2 : 0;
|
|
5125
5125
|
return createBaseVNode(
|
|
5126
5126
|
type,
|
|
5127
5127
|
props,
|
|
@@ -5458,7 +5458,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5458
5458
|
} else {
|
|
5459
5459
|
instance.render = setupResult;
|
|
5460
5460
|
}
|
|
5461
|
-
} else if (isObject$
|
|
5461
|
+
} else if (isObject$3(setupResult)) {
|
|
5462
5462
|
instance.setupState = proxyRefs(setupResult);
|
|
5463
5463
|
} else
|
|
5464
5464
|
;
|
|
@@ -5550,7 +5550,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5550
5550
|
function h$1(type, propsOrChildren, children) {
|
|
5551
5551
|
const l = arguments.length;
|
|
5552
5552
|
if (l === 2) {
|
|
5553
|
-
if (isObject$
|
|
5553
|
+
if (isObject$3(propsOrChildren) && !isArray$1(propsOrChildren)) {
|
|
5554
5554
|
if (isVNode(propsOrChildren)) {
|
|
5555
5555
|
return createVNode(type, null, [propsOrChildren]);
|
|
5556
5556
|
}
|
|
@@ -6056,7 +6056,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
6056
6056
|
function normalizeDuration(duration) {
|
|
6057
6057
|
if (duration == null) {
|
|
6058
6058
|
return null;
|
|
6059
|
-
} else if (isObject$
|
|
6059
|
+
} else if (isObject$3(duration)) {
|
|
6060
6060
|
return [NumberOf(duration.enter), NumberOf(duration.leave)];
|
|
6061
6061
|
} else {
|
|
6062
6062
|
const n = NumberOf(duration);
|
|
@@ -12902,18 +12902,18 @@ var __async = (__this, __arguments, generator) => {
|
|
|
12902
12902
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
12903
12903
|
* Released under the MIT License.
|
|
12904
12904
|
*/
|
|
12905
|
-
function isObject(o) {
|
|
12905
|
+
function isObject$2(o) {
|
|
12906
12906
|
return Object.prototype.toString.call(o) === "[object Object]";
|
|
12907
12907
|
}
|
|
12908
12908
|
function isPlainObject$1(o) {
|
|
12909
12909
|
var ctor, prot;
|
|
12910
|
-
if (isObject(o) === false)
|
|
12910
|
+
if (isObject$2(o) === false)
|
|
12911
12911
|
return false;
|
|
12912
12912
|
ctor = o.constructor;
|
|
12913
12913
|
if (ctor === void 0)
|
|
12914
12914
|
return true;
|
|
12915
12915
|
prot = ctor.prototype;
|
|
12916
|
-
if (isObject(prot) === false)
|
|
12916
|
+
if (isObject$2(prot) === false)
|
|
12917
12917
|
return false;
|
|
12918
12918
|
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
12919
12919
|
return false;
|
|
@@ -17699,12 +17699,12 @@ and ensure you are accounting for this risk.
|
|
|
17699
17699
|
enforceHtmlBoundary: false,
|
|
17700
17700
|
parseStyleAttributes: true
|
|
17701
17701
|
};
|
|
17702
|
-
sanitizeHtml.simpleTransform = function(newTagName, newAttribs,
|
|
17703
|
-
|
|
17702
|
+
sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge2) {
|
|
17703
|
+
merge2 = merge2 === void 0 ? true : merge2;
|
|
17704
17704
|
newAttribs = newAttribs || {};
|
|
17705
17705
|
return function(tagName, attribs) {
|
|
17706
17706
|
let attrib;
|
|
17707
|
-
if (
|
|
17707
|
+
if (merge2) {
|
|
17708
17708
|
for (attrib in newAttribs) {
|
|
17709
17709
|
attribs[attrib] = newAttribs[attrib];
|
|
17710
17710
|
}
|
|
@@ -19702,6 +19702,74 @@ and ensure you are accounting for this risk.
|
|
|
19702
19702
|
};
|
|
19703
19703
|
}
|
|
19704
19704
|
});
|
|
19705
|
+
const extractValue = (options) => {
|
|
19706
|
+
switch (options.extractFrom) {
|
|
19707
|
+
case "url":
|
|
19708
|
+
return extractFromUrl(options);
|
|
19709
|
+
case "localStorage":
|
|
19710
|
+
case "sessionStorage":
|
|
19711
|
+
return extractFromStorage(options);
|
|
19712
|
+
case "htmlElementText":
|
|
19713
|
+
return extractFromHtmlElementText(options);
|
|
19714
|
+
case "cookie":
|
|
19715
|
+
return extractFromCookie(options);
|
|
19716
|
+
default:
|
|
19717
|
+
return options.default;
|
|
19718
|
+
}
|
|
19719
|
+
};
|
|
19720
|
+
const extractFromCookie = (options) => {
|
|
19721
|
+
var _a, _b;
|
|
19722
|
+
try {
|
|
19723
|
+
const cookieValue = (_b = (_a = document.cookie) == null ? void 0 : _a.split("; ")) == null ? void 0 : _b.find((row) => row == null ? void 0 : row.startsWith(`${options.cookieName}=`));
|
|
19724
|
+
return cookieValue ? cookieValue.split("=")[1] : options.default;
|
|
19725
|
+
} catch (e2) {
|
|
19726
|
+
return options.default;
|
|
19727
|
+
}
|
|
19728
|
+
};
|
|
19729
|
+
const extractFromUrl = (options) => {
|
|
19730
|
+
const regex = new RegExp(options.regex);
|
|
19731
|
+
const match = window.location.href.match(regex);
|
|
19732
|
+
return match ? match[1] : options.default;
|
|
19733
|
+
};
|
|
19734
|
+
const extractFromStorage = (options) => {
|
|
19735
|
+
const storage = options.extractFrom === "localStorage" ? localStorage : sessionStorage;
|
|
19736
|
+
let rawValue2 = "";
|
|
19737
|
+
try {
|
|
19738
|
+
rawValue2 = storage.getItem(options.key);
|
|
19739
|
+
} catch (e2) {
|
|
19740
|
+
return options.default;
|
|
19741
|
+
}
|
|
19742
|
+
if (rawValue2) {
|
|
19743
|
+
try {
|
|
19744
|
+
const parsedValue = JSON.parse(rawValue2);
|
|
19745
|
+
return options.path ? getValueFromPath(parsedValue, options.path) : parsedValue;
|
|
19746
|
+
} catch (e2) {
|
|
19747
|
+
return rawValue2;
|
|
19748
|
+
}
|
|
19749
|
+
}
|
|
19750
|
+
return options.default;
|
|
19751
|
+
};
|
|
19752
|
+
const extractFromHtmlElementText = (options) => {
|
|
19753
|
+
var _a;
|
|
19754
|
+
const element = document.querySelector(options.querySelector);
|
|
19755
|
+
return element ? ((_a = element.textContent) == null ? void 0 : _a.trim()) || options.default : options.default;
|
|
19756
|
+
};
|
|
19757
|
+
const getValueFromPath = (obj, path) => {
|
|
19758
|
+
return path.split(".").reduce((value, key) => value && value[key] || null, obj);
|
|
19759
|
+
};
|
|
19760
|
+
const processExtractionObject = (value = {}) => {
|
|
19761
|
+
var _a;
|
|
19762
|
+
const parsedObject = {};
|
|
19763
|
+
for (const key in value) {
|
|
19764
|
+
if (isObject$1(value[key]) && ((_a = value[key]) == null ? void 0 : _a.extractFrom)) {
|
|
19765
|
+
const extractedValue = extractValue(value[key]);
|
|
19766
|
+
parsedObject[key] = Array.isArray(extractedValue) ? extractedValue : [extractedValue];
|
|
19767
|
+
} else {
|
|
19768
|
+
parsedObject[key] = value[key];
|
|
19769
|
+
}
|
|
19770
|
+
}
|
|
19771
|
+
return parsedObject;
|
|
19772
|
+
};
|
|
19705
19773
|
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
19706
19774
|
__name: "SearchBoxProductsWrapper",
|
|
19707
19775
|
props: {
|
|
@@ -19725,6 +19793,10 @@ and ensure you are accounting for this risk.
|
|
|
19725
19793
|
const showGoToResultsButton = computed(() => {
|
|
19726
19794
|
return props.panel.showGoToResults;
|
|
19727
19795
|
});
|
|
19796
|
+
const extractedInitialFilters = computed(() => {
|
|
19797
|
+
var _a;
|
|
19798
|
+
return __spreadValues2({}, processExtractionObject((_a = props.panel) == null ? void 0 : _a.initialFilters));
|
|
19799
|
+
});
|
|
19728
19800
|
const inputValueProp = computed(() => props.inputValue);
|
|
19729
19801
|
onMounted(() => {
|
|
19730
19802
|
getItemsDebounced();
|
|
@@ -19742,7 +19814,11 @@ and ensure you are accounting for this risk.
|
|
|
19742
19814
|
const getItems = () => {
|
|
19743
19815
|
searchBoxStore.queryDocuments({
|
|
19744
19816
|
queryKey: props.panel.queryKey,
|
|
19745
|
-
publicQuery: {
|
|
19817
|
+
publicQuery: {
|
|
19818
|
+
searchText: props.inputValue,
|
|
19819
|
+
limit: props.panel.limit,
|
|
19820
|
+
filters: extractedInitialFilters.value
|
|
19821
|
+
},
|
|
19746
19822
|
options: props.options
|
|
19747
19823
|
}).then(({ result: result2 }) => {
|
|
19748
19824
|
if (!(result2 == null ? void 0 : result2.items.length)) {
|
|
@@ -25097,12 +25173,12 @@ and ensure you are accounting for this risk.
|
|
|
25097
25173
|
"data-cy": "lupa-no-results-in-page"
|
|
25098
25174
|
};
|
|
25099
25175
|
const _hoisted_4$4 = {
|
|
25100
|
-
key:
|
|
25176
|
+
key: 4,
|
|
25101
25177
|
class: "lupa-empty-results",
|
|
25102
25178
|
"data-cy": "lupa-no-results"
|
|
25103
25179
|
};
|
|
25104
|
-
const _hoisted_5$1 = { key:
|
|
25105
|
-
const _hoisted_6$1 = { key:
|
|
25180
|
+
const _hoisted_5$1 = { key: 5 };
|
|
25181
|
+
const _hoisted_6$1 = { key: 6 };
|
|
25106
25182
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
25107
25183
|
__name: "SearchResultsProducts",
|
|
25108
25184
|
props: {
|
|
@@ -25223,10 +25299,11 @@ and ensure you are accounting for this risk.
|
|
|
25223
25299
|
location: "top",
|
|
25224
25300
|
sdkOptions: _ctx.options.options
|
|
25225
25301
|
}, null, 8, ["options", "sdkOptions"]),
|
|
25226
|
-
|
|
25302
|
+
_ctx.options.relatedQueries ? (openBlock(), createBlock(_sfc_main$i, {
|
|
25303
|
+
key: 1,
|
|
25227
25304
|
options: _ctx.options.relatedQueries
|
|
25228
|
-
}, null, 8, ["options"]),
|
|
25229
|
-
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key:
|
|
25305
|
+
}, null, 8, ["options"])) : createCommentVNode("", true),
|
|
25306
|
+
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
25230
25307
|
showTopFilters.value ? (openBlock(), createBlock(_sfc_main$H, {
|
|
25231
25308
|
key: 0,
|
|
25232
25309
|
options: (_a = _ctx.options.filters) != null ? _a : {}
|
|
@@ -25246,7 +25323,7 @@ and ensure you are accounting for this risk.
|
|
|
25246
25323
|
expandable: !desktopFiltersExpanded.value
|
|
25247
25324
|
}, null, 8, ["class", "options", "expandable"])) : createCommentVNode("", true)
|
|
25248
25325
|
], 64)) : createCommentVNode("", true),
|
|
25249
|
-
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key:
|
|
25326
|
+
unref(hasResults) ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
25250
25327
|
createVNode(_sfc_main$B, {
|
|
25251
25328
|
class: "lupa-toolbar-top",
|
|
25252
25329
|
options: _ctx.options,
|
|
@@ -25431,9 +25508,12 @@ and ensure you are accounting for this risk.
|
|
|
25431
25508
|
const dynamicDataStore = useDynamicDataStore();
|
|
25432
25509
|
const screenStore = useScreenStore();
|
|
25433
25510
|
const redirectionStore = useRedirectionStore();
|
|
25511
|
+
const extractedInitialFilters = computed(() => {
|
|
25512
|
+
return __spreadValues2({}, processExtractionObject(props.options.initialFilters));
|
|
25513
|
+
});
|
|
25434
25514
|
const initialFilters = computed(() => {
|
|
25435
|
-
var _a;
|
|
25436
|
-
return (_a = props.initialFilters) != null ? _a : {};
|
|
25515
|
+
var _a, _b;
|
|
25516
|
+
return (_b = (_a = props.initialFilters) != null ? _a : extractedInitialFilters.value) != null ? _b : {};
|
|
25437
25517
|
});
|
|
25438
25518
|
const { currentQueryText, hasResults, currentFilterCount } = storeToRefs(searchResultStore);
|
|
25439
25519
|
const { searchString, sortParams } = storeToRefs(paramStore);
|
|
@@ -25739,62 +25819,6 @@ and ensure you are accounting for this risk.
|
|
|
25739
25819
|
};
|
|
25740
25820
|
}
|
|
25741
25821
|
});
|
|
25742
|
-
const extractValue = (options) => {
|
|
25743
|
-
switch (options.extractFrom) {
|
|
25744
|
-
case "url":
|
|
25745
|
-
return extractFromUrl(options);
|
|
25746
|
-
case "localStorage":
|
|
25747
|
-
case "sessionStorage":
|
|
25748
|
-
return extractFromStorage(options);
|
|
25749
|
-
case "htmlElementText":
|
|
25750
|
-
return extractFromHtmlElementText(options);
|
|
25751
|
-
default:
|
|
25752
|
-
return options.default;
|
|
25753
|
-
}
|
|
25754
|
-
};
|
|
25755
|
-
const extractFromUrl = (options) => {
|
|
25756
|
-
const regex = new RegExp(options.regex);
|
|
25757
|
-
const match = window.location.href.match(regex);
|
|
25758
|
-
return match ? match[1] : options.default;
|
|
25759
|
-
};
|
|
25760
|
-
const extractFromStorage = (options) => {
|
|
25761
|
-
const storage = options.extractFrom === "localStorage" ? localStorage : sessionStorage;
|
|
25762
|
-
let rawValue2 = "";
|
|
25763
|
-
try {
|
|
25764
|
-
rawValue2 = storage.getItem(options.key);
|
|
25765
|
-
} catch (e2) {
|
|
25766
|
-
return options.default;
|
|
25767
|
-
}
|
|
25768
|
-
if (rawValue2) {
|
|
25769
|
-
try {
|
|
25770
|
-
const parsedValue = JSON.parse(rawValue2);
|
|
25771
|
-
return options.path ? getValueFromPath(parsedValue, options.path) : parsedValue;
|
|
25772
|
-
} catch (e2) {
|
|
25773
|
-
return rawValue2;
|
|
25774
|
-
}
|
|
25775
|
-
}
|
|
25776
|
-
return options.default;
|
|
25777
|
-
};
|
|
25778
|
-
const extractFromHtmlElementText = (options) => {
|
|
25779
|
-
var _a;
|
|
25780
|
-
const element = document.querySelector(options.querySelector);
|
|
25781
|
-
return element ? ((_a = element.textContent) == null ? void 0 : _a.trim()) || options.default : options.default;
|
|
25782
|
-
};
|
|
25783
|
-
const getValueFromPath = (obj, path) => {
|
|
25784
|
-
return path.split(".").reduce((value, key) => value && value[key] || null, obj);
|
|
25785
|
-
};
|
|
25786
|
-
const processExtractionObject = (value = {}) => {
|
|
25787
|
-
var _a;
|
|
25788
|
-
const parsedObject = {};
|
|
25789
|
-
for (const key in value) {
|
|
25790
|
-
if (isObject$1(value[key]) && ((_a = value[key]) == null ? void 0 : _a.extractFrom)) {
|
|
25791
|
-
parsedObject[key] = extractValue(value[key]);
|
|
25792
|
-
} else {
|
|
25793
|
-
parsedObject[key] = value[key];
|
|
25794
|
-
}
|
|
25795
|
-
}
|
|
25796
|
-
return parsedObject;
|
|
25797
|
-
};
|
|
25798
25822
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
25799
25823
|
__name: "ProductList",
|
|
25800
25824
|
props: {
|
|
@@ -25814,7 +25838,7 @@ and ensure you are accounting for this risk.
|
|
|
25814
25838
|
var _a;
|
|
25815
25839
|
(_a = searchResults2.value) == null ? void 0 : _a.handleMounted();
|
|
25816
25840
|
};
|
|
25817
|
-
computed(() => {
|
|
25841
|
+
const initialFilters = computed(() => {
|
|
25818
25842
|
return __spreadValues2({}, processExtractionObject(props.options.initialFilters));
|
|
25819
25843
|
});
|
|
25820
25844
|
__expose({ fetch: fetch2 });
|
|
@@ -25822,7 +25846,7 @@ and ensure you are accounting for this risk.
|
|
|
25822
25846
|
return openBlock(), createElementBlock("div", null, [
|
|
25823
25847
|
createVNode(_sfc_main$e, {
|
|
25824
25848
|
options: componentOptions.value,
|
|
25825
|
-
"initial-filters":
|
|
25849
|
+
"initial-filters": initialFilters.value,
|
|
25826
25850
|
"is-product-list": true,
|
|
25827
25851
|
ref_key: "searchResults",
|
|
25828
25852
|
ref: searchResults2
|
|
@@ -30210,7 +30234,7 @@ and ensure you are accounting for this risk.
|
|
|
30210
30234
|
});
|
|
30211
30235
|
return result3;
|
|
30212
30236
|
}
|
|
30213
|
-
var
|
|
30237
|
+
var merge2 = createAssigner(function(object, source, srcIndex) {
|
|
30214
30238
|
baseMerge(object, source, srcIndex);
|
|
30215
30239
|
});
|
|
30216
30240
|
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
@@ -30900,7 +30924,7 @@ and ensure you are accounting for this risk.
|
|
|
30900
30924
|
lodash2.matches = matches;
|
|
30901
30925
|
lodash2.matchesProperty = matchesProperty;
|
|
30902
30926
|
lodash2.memoize = memoize;
|
|
30903
|
-
lodash2.merge =
|
|
30927
|
+
lodash2.merge = merge2;
|
|
30904
30928
|
lodash2.mergeWith = mergeWith;
|
|
30905
30929
|
lodash2.method = method;
|
|
30906
30930
|
lodash2.methodOf = methodOf;
|
|
@@ -37736,7 +37760,7 @@ and ensure you are accounting for this risk.
|
|
|
37736
37760
|
});
|
|
37737
37761
|
return result3;
|
|
37738
37762
|
}
|
|
37739
|
-
var
|
|
37763
|
+
var merge2 = createAssigner(function(object, source, srcIndex) {
|
|
37740
37764
|
baseMerge(object, source, srcIndex);
|
|
37741
37765
|
});
|
|
37742
37766
|
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
@@ -38426,7 +38450,7 @@ and ensure you are accounting for this risk.
|
|
|
38426
38450
|
lodash2.matches = matches;
|
|
38427
38451
|
lodash2.matchesProperty = matchesProperty;
|
|
38428
38452
|
lodash2.memoize = memoize;
|
|
38429
|
-
lodash2.merge =
|
|
38453
|
+
lodash2.merge = merge2;
|
|
38430
38454
|
lodash2.mergeWith = mergeWith;
|
|
38431
38455
|
lodash2.method = method;
|
|
38432
38456
|
lodash2.methodOf = methodOf;
|
|
@@ -39583,6 +39607,14 @@ and ensure you are accounting for this risk.
|
|
|
39583
39607
|
}, interval);
|
|
39584
39608
|
});
|
|
39585
39609
|
});
|
|
39610
|
+
const isObject = (item) => typeof item === "object" && !Array.isArray(item);
|
|
39611
|
+
const merge = (target, source) => {
|
|
39612
|
+
const isDeep = (prop) => isObject(source[prop]) && Object.prototype.hasOwnProperty.call(target, prop) && isObject(target[prop]);
|
|
39613
|
+
const replaced = Object.getOwnPropertyNames(source).map((prop) => ({
|
|
39614
|
+
[prop]: isDeep(prop) ? merge(target[prop], source[prop]) : source[prop]
|
|
39615
|
+
})).reduce((a, b) => __spreadValues(__spreadValues({}, a), b), {});
|
|
39616
|
+
return __spreadValues(__spreadValues({}, target), replaced);
|
|
39617
|
+
};
|
|
39586
39618
|
const saveToLocalStorage = (key, value) => {
|
|
39587
39619
|
try {
|
|
39588
39620
|
localStorage.setItem(key, JSON.stringify(value));
|
|
@@ -39634,7 +39666,7 @@ and ensure you are accounting for this risk.
|
|
|
39634
39666
|
const PREVIEW_PARAMETER = "lupaSearchPreview";
|
|
39635
39667
|
const MAX_ELEMENT_MOUNT_RETRIES = 25;
|
|
39636
39668
|
let styleElement = null;
|
|
39637
|
-
const loadAndSaveConfigurationFromServer = (
|
|
39669
|
+
const loadAndSaveConfigurationFromServer = (_0, ..._1) => __async(this, [_0, ..._1], function* (configurationKey, options = { environment: "production" }) {
|
|
39638
39670
|
const configuration = yield fetchPluginConfiguration(
|
|
39639
39671
|
options,
|
|
39640
39672
|
configurationKey
|
|
@@ -39659,7 +39691,7 @@ and ensure you are accounting for this risk.
|
|
|
39659
39691
|
}
|
|
39660
39692
|
return isPreviewMode;
|
|
39661
39693
|
};
|
|
39662
|
-
const loadConfigurations = (configurationKey, isPreviewMode, options) => __async(this, null, function* () {
|
|
39694
|
+
const loadConfigurations = (configurationKey, isPreviewMode, options, optionOverrides) => __async(this, null, function* () {
|
|
39663
39695
|
if (isPreviewMode) {
|
|
39664
39696
|
return loadAndSaveConfigurationFromServer(configurationKey, options);
|
|
39665
39697
|
}
|
|
@@ -39677,7 +39709,7 @@ and ensure you are accounting for this risk.
|
|
|
39677
39709
|
const isPreviewMode2 = checkIsPreviewMode();
|
|
39678
39710
|
const configuration = isPreviewMode2 ? (_a = newestConfiguration.previewConfiguration) != null ? _a : newestConfiguration.configuration : newestConfiguration.configuration;
|
|
39679
39711
|
if (configuration) {
|
|
39680
|
-
yield mount(configuration, options, false, true);
|
|
39712
|
+
yield mount(configuration, options, optionOverrides, false, true);
|
|
39681
39713
|
} else {
|
|
39682
39714
|
removeFromLocalStorage(configurationKey);
|
|
39683
39715
|
window.location.reload();
|
|
@@ -39708,7 +39740,8 @@ and ensure you are accounting for this risk.
|
|
|
39708
39740
|
}
|
|
39709
39741
|
document.head.appendChild(styleElement);
|
|
39710
39742
|
});
|
|
39711
|
-
const mountSearchBox = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39743
|
+
const mountSearchBox = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39744
|
+
var _a;
|
|
39712
39745
|
if (!configuration.searchBox) {
|
|
39713
39746
|
return;
|
|
39714
39747
|
}
|
|
@@ -39725,9 +39758,11 @@ and ensure you are accounting for this risk.
|
|
|
39725
39758
|
);
|
|
39726
39759
|
return;
|
|
39727
39760
|
}
|
|
39728
|
-
|
|
39761
|
+
const mergedOptions = merge(resolvedConfiguration, (_a = optionOverrides == null ? void 0 : optionOverrides.searchBox) != null ? _a : {});
|
|
39762
|
+
searchBox(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
39729
39763
|
});
|
|
39730
|
-
const mountSearchResults = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39764
|
+
const mountSearchResults = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39765
|
+
var _a;
|
|
39731
39766
|
if (!configuration.searchResults) {
|
|
39732
39767
|
return;
|
|
39733
39768
|
}
|
|
@@ -39744,9 +39779,11 @@ and ensure you are accounting for this risk.
|
|
|
39744
39779
|
);
|
|
39745
39780
|
return;
|
|
39746
39781
|
}
|
|
39747
|
-
|
|
39782
|
+
const mergedOptions = merge(resolvedConfiguration, (_a = optionOverrides == null ? void 0 : optionOverrides.searchResults) != null ? _a : {});
|
|
39783
|
+
searchResults(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
39748
39784
|
});
|
|
39749
|
-
const mountProductList = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39785
|
+
const mountProductList = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39786
|
+
var _a;
|
|
39750
39787
|
if (!configuration.productList) {
|
|
39751
39788
|
return;
|
|
39752
39789
|
}
|
|
@@ -39766,12 +39803,14 @@ and ensure you are accounting for this risk.
|
|
|
39766
39803
|
);
|
|
39767
39804
|
return;
|
|
39768
39805
|
}
|
|
39769
|
-
|
|
39770
|
-
|
|
39771
|
-
|
|
39806
|
+
const mergedOptions = merge(
|
|
39807
|
+
__spreadValues(__spreadValues({}, resolvedSearchResultsConfiguration), resolvedConfiguration),
|
|
39808
|
+
(_a = optionOverrides == null ? void 0 : optionOverrides.productList) != null ? _a : {}
|
|
39772
39809
|
);
|
|
39810
|
+
productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
39773
39811
|
});
|
|
39774
|
-
const mountRecommendations = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39812
|
+
const mountRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39813
|
+
var _a;
|
|
39775
39814
|
if (!configuration.recommendations) {
|
|
39776
39815
|
return;
|
|
39777
39816
|
}
|
|
@@ -39793,10 +39832,11 @@ and ensure you are accounting for this risk.
|
|
|
39793
39832
|
);
|
|
39794
39833
|
return;
|
|
39795
39834
|
}
|
|
39796
|
-
|
|
39797
|
-
|
|
39798
|
-
|
|
39835
|
+
const mergedOptions = merge(
|
|
39836
|
+
__spreadValues(__spreadValues({}, resolvedSearchResultsConfiguration), resolvedConfiguration),
|
|
39837
|
+
(_a = optionOverrides == null ? void 0 : optionOverrides.recommendations) != null ? _a : {}
|
|
39799
39838
|
);
|
|
39839
|
+
recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
|
|
39800
39840
|
});
|
|
39801
39841
|
const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
|
|
39802
39842
|
if (!configuration.genAiChat) {
|
|
@@ -39823,24 +39863,24 @@ and ensure you are accounting for this risk.
|
|
|
39823
39863
|
{ fetch: fetch2, allowedMountUrls }
|
|
39824
39864
|
);
|
|
39825
39865
|
});
|
|
39826
|
-
const mount = (configuration, options, fetch2 = true, remount = false)
|
|
39866
|
+
const mount = (_0, ..._1) => __async(this, [_0, ..._1], function* (configuration, options = { environment: "production" }, optionOverrides = {}, fetch2 = true, remount = false) {
|
|
39827
39867
|
yield applyStyles(configuration);
|
|
39828
39868
|
const mountPromises = [
|
|
39829
|
-
mountSearchBox(configuration, options, fetch2, remount),
|
|
39830
|
-
mountSearchResults(configuration, options, fetch2, remount),
|
|
39831
|
-
mountProductList(configuration, options, fetch2, remount),
|
|
39832
|
-
mountRecommendations(configuration, options, fetch2, remount),
|
|
39869
|
+
mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
|
|
39870
|
+
mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
|
|
39871
|
+
mountProductList(configuration, options, optionOverrides, fetch2, remount),
|
|
39872
|
+
mountRecommendations(configuration, options, optionOverrides, fetch2, remount),
|
|
39833
39873
|
mountChat(configuration, options, fetch2, remount)
|
|
39834
39874
|
];
|
|
39835
39875
|
yield Promise.all(mountPromises);
|
|
39836
39876
|
});
|
|
39837
|
-
const init$1 = (
|
|
39877
|
+
const init$1 = (_0, ..._1) => __async(this, [_0, ..._1], function* (configurationKey, options = { environment: "production" }, optionOverrides = {}) {
|
|
39838
39878
|
var _a;
|
|
39839
39879
|
const isPreviewMode = checkIsPreviewMode();
|
|
39840
|
-
const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options);
|
|
39880
|
+
const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options, optionOverrides);
|
|
39841
39881
|
const configuration = isPreviewMode ? (_a = plugin.previewConfiguration) != null ? _a : plugin.configuration : plugin.configuration;
|
|
39842
39882
|
if (configuration) {
|
|
39843
|
-
yield mount(configuration, options);
|
|
39883
|
+
yield mount(configuration, options, optionOverrides);
|
|
39844
39884
|
}
|
|
39845
39885
|
});
|
|
39846
39886
|
const PluginConfigurationManager = {
|
|
@@ -39849,8 +39889,8 @@ and ensure you are accounting for this risk.
|
|
|
39849
39889
|
const tracking = (options) => {
|
|
39850
39890
|
setupTracking(options);
|
|
39851
39891
|
};
|
|
39852
|
-
const init = (configurationKey, options) => {
|
|
39853
|
-
return PluginConfigurationManager.init(configurationKey, options);
|
|
39892
|
+
const init = (configurationKey, options, optionOverrides) => {
|
|
39893
|
+
return PluginConfigurationManager.init(configurationKey, options, optionOverrides);
|
|
39854
39894
|
};
|
|
39855
39895
|
const lupaSearch = {
|
|
39856
39896
|
init,
|