@getlupa/client 1.18.2 → 1.18.5

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.
@@ -12619,6 +12619,11 @@ const getRandomString = (length) => {
12619
12619
  }
12620
12620
  return result2;
12621
12621
  };
12622
+ const getSocketClientId = () => {
12623
+ const timestamp = Date.now().toString(36);
12624
+ const randomString = getRandomString(8);
12625
+ return `${timestamp}-${randomString}`;
12626
+ };
12622
12627
  const toFixedIfNecessary = (value, precision = 2) => {
12623
12628
  return (+parseFloat(value).toFixed(precision)).toString();
12624
12629
  };
@@ -12733,6 +12738,10 @@ const DEFAULT_SEARCH_BOX_OPTIONS$1 = {
12733
12738
  links: {
12734
12739
  searchResults: "/search"
12735
12740
  },
12741
+ voiceSearch: {
12742
+ enabled: false,
12743
+ queryKey: ""
12744
+ },
12736
12745
  panels: [
12737
12746
  {
12738
12747
  type: "suggestion",
@@ -14314,10 +14323,354 @@ const useSearchBoxStore = defineStore("searchBox", () => {
14314
14323
  resetHighlightIndex
14315
14324
  };
14316
14325
  });
14326
+ const Env = {
14327
+ production: "https://api.lupasearch.com/v1/",
14328
+ staging: "https://api.staging.lupasearch.com/v1/"
14329
+ };
14330
+ const VoiceServiceEnv = {
14331
+ production: "ws://voice.lupasearch.com:3001",
14332
+ staging: "ws://voice.lupasearch.dev:3001"
14333
+ };
14334
+ const DEFAULT_REQUEST_CONFIG = {
14335
+ method: "POST",
14336
+ headers: { "Content-Type": "application/json" }
14337
+ };
14338
+ const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
14339
+ const getVoiceServiceApiUrl = (environment, customVoiceServiceUrl) => {
14340
+ if (customVoiceServiceUrl) {
14341
+ return customVoiceServiceUrl;
14342
+ }
14343
+ return VoiceServiceEnv[environment] || VoiceServiceEnv["production"];
14344
+ };
14345
+ const getApiUrl = (environment, customBaseUrl) => {
14346
+ if (customBaseUrl) {
14347
+ return customBaseUrl;
14348
+ }
14349
+ return Env[environment] || Env["production"];
14350
+ };
14351
+ const _sfc_main$1z = /* @__PURE__ */ defineComponent({
14352
+ __name: "VoiceSearchProgressCircle",
14353
+ props: {
14354
+ isRecording: { type: Boolean },
14355
+ timesliceLimit: {},
14356
+ timeSliceLength: {}
14357
+ },
14358
+ setup(__props, { expose: __expose }) {
14359
+ const props = __props;
14360
+ const progressBar = ref(null);
14361
+ const getProgressBarColor = (progressBarStyle) => {
14362
+ if (!progressBarStyle.backgroundImage.startsWith("conic-gradient")) {
14363
+ return progressBarStyle.backgroundColor;
14364
+ }
14365
+ const colorStops = progressBarStyle.backgroundImage.replace(/conic-gradient\(|\)$/g, "").split(")");
14366
+ if (colorStops.length > 1) {
14367
+ return `${colorStops[0]})`;
14368
+ } else {
14369
+ return progressBarStyle.backgroundColor;
14370
+ }
14371
+ };
14372
+ const startProgressBar = () => {
14373
+ if (!progressBar.value || !props.isRecording) {
14374
+ return;
14375
+ }
14376
+ const duration = props.timesliceLimit * props.timeSliceLength;
14377
+ const progressBarStyle = window.getComputedStyle(progressBar.value);
14378
+ const progressBarColor = getProgressBarColor(progressBarStyle);
14379
+ progressBar.value.style.background = `conic-gradient(${progressBarColor} 0%, transparent 0%)`;
14380
+ let startTime = null;
14381
+ function updateProgress(timestamp) {
14382
+ if (!progressBar.value || !props.isRecording) {
14383
+ return;
14384
+ }
14385
+ if (!startTime)
14386
+ startTime = timestamp;
14387
+ const elapsed = timestamp - startTime;
14388
+ const progress = Math.min(elapsed / duration, 1) * 100;
14389
+ progressBar.value.style.background = `conic-gradient(${progressBarColor} ${progress}%, transparent ${progress}%)`;
14390
+ if (elapsed < duration) {
14391
+ requestAnimationFrame(updateProgress);
14392
+ }
14393
+ }
14394
+ requestAnimationFrame(updateProgress);
14395
+ };
14396
+ const stopProgressBar = () => {
14397
+ if (!progressBar.value) {
14398
+ return;
14399
+ }
14400
+ progressBar.value.style.background = "";
14401
+ };
14402
+ __expose({
14403
+ startProgressBar,
14404
+ stopProgressBar
14405
+ });
14406
+ return (_ctx, _cache) => {
14407
+ return openBlock(), createElementBlock("div", {
14408
+ ref_key: "progressBar",
14409
+ ref: progressBar,
14410
+ class: "lupa-progress-circle"
14411
+ }, null, 512);
14412
+ };
14413
+ }
14414
+ });
14415
+ const buildSocketMessageFrameHeader = (event, payloadLength) => {
14416
+ const headerObj = { event, length: payloadLength };
14417
+ const headerJson = JSON.stringify(headerObj);
14418
+ const headerBytes = new TextEncoder().encode(headerJson);
14419
+ const headerLength = new Uint32Array([headerBytes.length]);
14420
+ const headerLengthBytes = new Uint8Array(headerLength.buffer);
14421
+ const result2 = new Uint8Array(4 + headerBytes.length);
14422
+ result2.set(headerLengthBytes, 0);
14423
+ result2.set(headerBytes, 4);
14424
+ return result2;
14425
+ };
14426
+ function useVoiceRecorder(options) {
14427
+ const socket = ref(null);
14428
+ const mediaStream = ref(null);
14429
+ const mediaRecorder = ref(null);
14430
+ const isRecording = ref(false);
14431
+ const errorRef = ref(null);
14432
+ const transcription = ref("");
14433
+ const timeSliceLength = computed(() => {
14434
+ var _a;
14435
+ return (_a = options.timesliceLength) != null ? _a : 1e3;
14436
+ });
14437
+ onBeforeUnmount(() => {
14438
+ closeSocket();
14439
+ stopRecording();
14440
+ });
14441
+ const initSocket = (url, onMessage) => {
14442
+ socket.value = new WebSocket(url);
14443
+ socket.value.onopen = () => __async2(this, null, function* () {
14444
+ var _a;
14445
+ if (((_a = mediaRecorder.value) == null ? void 0 : _a.state) !== "recording") {
14446
+ yield startRecording();
14447
+ }
14448
+ });
14449
+ socket.value.onmessage = (event) => {
14450
+ const msg = JSON.parse(event.data);
14451
+ if (msg.event === "transcription") {
14452
+ transcription.value = msg.transcription;
14453
+ onMessage == null ? void 0 : onMessage(msg.transcription);
14454
+ stopSocketConnection();
14455
+ } else if (msg.event === "error") {
14456
+ errorRef.value = "Server error during transcription";
14457
+ stopRecording();
14458
+ }
14459
+ };
14460
+ socket.value.onclose = () => {
14461
+ stopRecording();
14462
+ };
14463
+ socket.value.onerror = () => {
14464
+ stopRecording();
14465
+ errorRef.value = "Service connection error";
14466
+ };
14467
+ };
14468
+ const onMediaRecorderDataAvailable = (event) => __async2(this, null, function* () {
14469
+ var _a, _b;
14470
+ if (((_a = mediaRecorder.value) == null ? void 0 : _a.state) !== "recording")
14471
+ return;
14472
+ const audioBuffer = yield event.data.arrayBuffer();
14473
+ const header = buildSocketMessageFrameHeader("audio-chunk", audioBuffer.byteLength);
14474
+ const buffer = new Uint8Array(header.length + audioBuffer.byteLength);
14475
+ buffer.set(header, 0);
14476
+ buffer.set(new Uint8Array(audioBuffer), header.length);
14477
+ (_b = socket.value) == null ? void 0 : _b.send(buffer);
14478
+ });
14479
+ const startRecording = () => __async2(this, null, function* () {
14480
+ mediaStream.value = yield navigator.mediaDevices.getUserMedia({
14481
+ video: false,
14482
+ audio: {
14483
+ channelCount: 1,
14484
+ echoCancellation: true,
14485
+ sampleRate: 16e3
14486
+ }
14487
+ });
14488
+ mediaRecorder.value = new MediaRecorder(mediaStream.value, {
14489
+ mimeType: "audio/webm; codecs=opus"
14490
+ });
14491
+ mediaRecorder.value.ondataavailable = onMediaRecorderDataAvailable;
14492
+ mediaRecorder.value.start(timeSliceLength.value);
14493
+ isRecording.value = true;
14494
+ });
14495
+ const stopRecording = () => {
14496
+ var _a, _b;
14497
+ (_a = mediaRecorder.value) == null ? void 0 : _a.stop();
14498
+ (_b = mediaStream.value) == null ? void 0 : _b.getTracks().forEach((track2) => {
14499
+ track2.stop();
14500
+ });
14501
+ isRecording.value = false;
14502
+ };
14503
+ const stopSocketConnection = () => {
14504
+ if (socket.value && socket.value.readyState === WebSocket.OPEN) {
14505
+ const endHeader = buildSocketMessageFrameHeader("audio-chunk-end", 0);
14506
+ socket.value.send(endHeader);
14507
+ setTimeout(() => {
14508
+ closeSocket();
14509
+ }, 1e3);
14510
+ }
14511
+ };
14512
+ const closeSocket = () => {
14513
+ var _a;
14514
+ (_a = socket.value) == null ? void 0 : _a.close();
14515
+ socket.value = null;
14516
+ };
14517
+ const reset = () => {
14518
+ stopRecording();
14519
+ closeSocket();
14520
+ transcription.value = "";
14521
+ errorRef.value = null;
14522
+ isRecording.value = false;
14523
+ };
14524
+ return {
14525
+ isRecording,
14526
+ transcription,
14527
+ errorRef,
14528
+ initSocket,
14529
+ startRecording,
14530
+ stopRecording,
14531
+ stopSocketConnection,
14532
+ reset,
14533
+ closeSocket
14534
+ };
14535
+ }
14536
+ const _hoisted_1$1l = {
14537
+ key: 0,
14538
+ class: "lupa-dialog-overlay"
14539
+ };
14540
+ const _hoisted_2$W = { class: "lupa-dialog-content" };
14541
+ const _hoisted_3$F = { class: "lupa-listening-text" };
14542
+ const _hoisted_4$v = { class: "lupa-mic-button-wrapper" };
14543
+ const _sfc_main$1y = /* @__PURE__ */ defineComponent({
14544
+ __name: "VoiceSearchDialog",
14545
+ props: {
14546
+ isOpen: { type: Boolean },
14547
+ options: {}
14548
+ },
14549
+ emits: [
14550
+ "close",
14551
+ "transcript-update",
14552
+ "stop-recognize"
14553
+ ],
14554
+ setup(__props, { expose: __expose, emit: emit2 }) {
14555
+ const props = __props;
14556
+ const optionsStore = useOptionsStore();
14557
+ const {
14558
+ isRecording,
14559
+ transcription,
14560
+ errorRef,
14561
+ initSocket,
14562
+ stopSocketConnection,
14563
+ reset
14564
+ } = useVoiceRecorder(props.options);
14565
+ const clientId = ref(null);
14566
+ const voiceSearchProgressBar = ref(null);
14567
+ const timesliceLimit = computed(() => {
14568
+ var _a;
14569
+ return (_a = props.options.timesliceLimit) != null ? _a : 4;
14570
+ });
14571
+ const timeSliceLength = computed(() => {
14572
+ var _a;
14573
+ return (_a = props.options.timesliceLength) != null ? _a : 1e3;
14574
+ });
14575
+ const stopDelay = computed(() => {
14576
+ var _a;
14577
+ return (_a = props.options.stopDelay) != null ? _a : 700;
14578
+ });
14579
+ const labels = computed(() => {
14580
+ var _a;
14581
+ return (_a = props.options.labels) != null ? _a : {};
14582
+ });
14583
+ const description = computed(() => {
14584
+ var _a, _b, _c;
14585
+ if (errorRef.value) {
14586
+ return (_a = labels.value.serviceError) != null ? _a : errorRef.value;
14587
+ }
14588
+ if (!isRecording.value) {
14589
+ return (_b = labels.value.microphoneOff) != null ? _b : "Microphone is off. Try again.";
14590
+ }
14591
+ return (_c = labels.value.listening) != null ? _c : "Listening...";
14592
+ });
14593
+ watch(transcription, (newValue) => {
14594
+ emit2("transcript-update", newValue);
14595
+ });
14596
+ const handleRecordingButtonClick = () => {
14597
+ var _a, _b;
14598
+ if (isRecording.value) {
14599
+ setTimeout(() => {
14600
+ stopSocketConnection();
14601
+ handleOnStopEvent();
14602
+ }, stopDelay.value);
14603
+ return;
14604
+ }
14605
+ const voiceServiceUrl = getVoiceServiceApiUrl(
14606
+ optionsStore.envOptions.environment,
14607
+ props.options.customVoiceServiceUrl
14608
+ );
14609
+ const socketUrl = `${voiceServiceUrl}?clientId=${clientId.value}&queryKey=${props.options.queryKey}&languageCode=${(_a = props.options.language) != null ? _a : "en-US"}&connectionType=write-first`;
14610
+ initSocket(socketUrl);
14611
+ (_b = voiceSearchProgressBar.value) == null ? void 0 : _b.startProgressBar();
14612
+ setTimeout(() => {
14613
+ stopSocketConnection();
14614
+ handleOnStopEvent();
14615
+ }, timesliceLimit.value * timeSliceLength.value);
14616
+ };
14617
+ const handleOnStopEvent = () => {
14618
+ var _a;
14619
+ setTimeout(() => {
14620
+ if (errorRef.value)
14621
+ return;
14622
+ emit2("stop-recognize", transcription.value);
14623
+ }, 1500);
14624
+ (_a = voiceSearchProgressBar.value) == null ? void 0 : _a.stopProgressBar();
14625
+ };
14626
+ onMounted(() => {
14627
+ clientId.value = getSocketClientId();
14628
+ });
14629
+ onBeforeUnmount(() => {
14630
+ clientId.value = null;
14631
+ });
14632
+ const dialogReset = () => {
14633
+ var _a;
14634
+ reset();
14635
+ (_a = voiceSearchProgressBar.value) == null ? void 0 : _a.stopProgressBar();
14636
+ };
14637
+ __expose({
14638
+ handleRecordingButtonClick,
14639
+ reset: dialogReset
14640
+ });
14641
+ return (_ctx, _cache) => {
14642
+ return openBlock(), createElementBlock("div", null, [
14643
+ props.isOpen ? (openBlock(), createElementBlock("div", _hoisted_1$1l, [
14644
+ createBaseVNode("button", {
14645
+ class: "lupa-dialog-box-close-button",
14646
+ onClick: _cache[0] || (_cache[0] = () => emit2("close"))
14647
+ }),
14648
+ createBaseVNode("div", _hoisted_2$W, [
14649
+ createBaseVNode("p", _hoisted_3$F, toDisplayString(description.value), 1),
14650
+ createBaseVNode("div", _hoisted_4$v, [
14651
+ createBaseVNode("button", {
14652
+ class: normalizeClass(["lupa-mic-button", { recording: unref(isRecording) }]),
14653
+ onClick: handleRecordingButtonClick
14654
+ }, null, 2),
14655
+ createVNode(_sfc_main$1z, {
14656
+ ref_key: "voiceSearchProgressBar",
14657
+ ref: voiceSearchProgressBar,
14658
+ class: "lupa-progress-circle",
14659
+ isRecording: unref(isRecording),
14660
+ timesliceLimit: timesliceLimit.value,
14661
+ timeSliceLength: timeSliceLength.value
14662
+ }, null, 8, ["isRecording", "timesliceLimit", "timeSliceLength"])
14663
+ ])
14664
+ ])
14665
+ ])) : createCommentVNode("", true)
14666
+ ]);
14667
+ };
14668
+ }
14669
+ });
14317
14670
  const _hoisted_1$1k = { id: "lupa-search-box-input-container" };
14318
14671
  const _hoisted_2$V = { class: "lupa-input-clear" };
14319
14672
  const _hoisted_3$E = { id: "lupa-search-box-input" };
14320
- const _hoisted_4$v = ["value"];
14673
+ const _hoisted_4$u = ["value"];
14321
14674
  const _hoisted_5$l = ["aria-label", "placeholder"];
14322
14675
  const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
14323
14676
  const _hoisted_7$7 = [
@@ -14327,6 +14680,7 @@ const _hoisted_8$3 = {
14327
14680
  key: 0,
14328
14681
  class: "lupa-close-label"
14329
14682
  };
14683
+ const _hoisted_9$3 = { key: 1 };
14330
14684
  const _sfc_main$1x = /* @__PURE__ */ defineComponent({
14331
14685
  __name: "SearchBoxInput",
14332
14686
  props: {
@@ -14342,6 +14696,8 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
14342
14696
  const searchBoxStore = useSearchBoxStore();
14343
14697
  const { query } = storeToRefs(paramStore);
14344
14698
  const mainInput = ref(null);
14699
+ const voiceDialogOverlay = ref(null);
14700
+ const isVoiceDialogOpen = ref(false);
14345
14701
  const emitInputOnFocus = computed(() => {
14346
14702
  var _a;
14347
14703
  return (_a = props.emitInputOnFocus) != null ? _a : true;
@@ -14352,6 +14708,10 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
14352
14708
  return (_a = props.suggestedValue) != null ? _a : { value: "", override: false, item: { suggestion: "" } };
14353
14709
  }
14354
14710
  );
14711
+ const isVoiceSearchEnabled = computed(() => {
14712
+ var _a, _b;
14713
+ return (_b = (_a = props.options.voiceSearch) == null ? void 0 : _a.enabled) != null ? _b : false;
14714
+ });
14355
14715
  const labels = computed(() => props.options.labels);
14356
14716
  const input2 = ref("");
14357
14717
  const inputValue = computed({
@@ -14375,6 +14735,12 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
14375
14735
  var _a;
14376
14736
  return (_a = labels.value.searchInputAriaLabel) != null ? _a : "Search input";
14377
14737
  });
14738
+ onMounted(() => {
14739
+ document.addEventListener("click", handleClickOutsideVoiceDialogOverlay);
14740
+ });
14741
+ onBeforeUnmount(() => {
14742
+ document.removeEventListener("click", handleClickOutsideVoiceDialogOverlay);
14743
+ });
14378
14744
  watch(suggestedValue, () => {
14379
14745
  if (suggestedValue.value.override) {
14380
14746
  input2.value = suggestedValue.value.item.suggestion;
@@ -14409,6 +14775,37 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
14409
14775
  }
14410
14776
  (_a = mainInput == null ? void 0 : mainInput.value) == null ? void 0 : _a.focus();
14411
14777
  };
14778
+ const openVoiceSearchDialog = () => {
14779
+ var _a;
14780
+ isVoiceDialogOpen.value = true;
14781
+ (_a = voiceDialogOverlay.value) == null ? void 0 : _a.handleRecordingButtonClick();
14782
+ };
14783
+ const closeDialog = () => {
14784
+ var _a;
14785
+ isVoiceDialogOpen.value = false;
14786
+ (_a = voiceDialogOverlay.value) == null ? void 0 : _a.reset();
14787
+ };
14788
+ const handleVoiceSearchOutput = (transcription) => {
14789
+ inputValue.value = transcription;
14790
+ handleSubmit();
14791
+ };
14792
+ const stopRecognition = (trascription) => {
14793
+ setTimeout(() => {
14794
+ isVoiceDialogOpen.value = false;
14795
+ handleVoiceSearchOutput(trascription);
14796
+ }, 500);
14797
+ };
14798
+ const handleClickOutsideVoiceDialogOverlay = (event) => {
14799
+ if (event.target.classList.contains("lupa-voice-search-button")) {
14800
+ return;
14801
+ }
14802
+ if (voiceDialogOverlay.value && voiceDialogOverlay.value.$el.contains(event.target)) {
14803
+ return;
14804
+ }
14805
+ if (isVoiceDialogOpen.value) {
14806
+ closeDialog();
14807
+ }
14808
+ };
14412
14809
  __expose({ focus });
14413
14810
  return (_ctx, _cache) => {
14414
14811
  return openBlock(), createElementBlock("div", _hoisted_1$1k, [
@@ -14424,7 +14821,7 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
14424
14821
  "aria-hidden": "true",
14425
14822
  value: showHint.value ? suggestedValue.value.item.suggestion : "",
14426
14823
  disabled: ""
14427
- }, null, 8, _hoisted_4$v),
14824
+ }, null, 8, _hoisted_4$u),
14428
14825
  withDirectives(createBaseVNode("input", mergeProps({
14429
14826
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
14430
14827
  }, inputAttributes.value, {
@@ -14452,7 +14849,23 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
14452
14849
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
14453
14850
  }, [
14454
14851
  labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
14455
- ])) : createCommentVNode("", true)
14852
+ ])) : createCommentVNode("", true),
14853
+ isVoiceSearchEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
14854
+ createBaseVNode("button", {
14855
+ onClick: openVoiceSearchDialog,
14856
+ class: "lupa-voice-search-button"
14857
+ })
14858
+ ])) : createCommentVNode("", true),
14859
+ isVoiceSearchEnabled.value ? (openBlock(), createBlock(_sfc_main$1y, {
14860
+ key: 2,
14861
+ ref_key: "voiceDialogOverlay",
14862
+ ref: voiceDialogOverlay,
14863
+ isOpen: isVoiceDialogOpen.value,
14864
+ options: props.options.voiceSearch,
14865
+ onClose: closeDialog,
14866
+ onTranscriptUpdate: handleVoiceSearchOutput,
14867
+ onStopRecognize: stopRecognition
14868
+ }, null, 8, ["isOpen", "options"])) : createCommentVNode("", true)
14456
14869
  ]);
14457
14870
  };
14458
14871
  }
@@ -14650,7 +15063,7 @@ const _hoisted_3$D = {
14650
15063
  class: "lupa-suggestion-facet",
14651
15064
  "data-cy": "lupa-suggestion-facet"
14652
15065
  };
14653
- const _hoisted_4$u = {
15066
+ const _hoisted_4$t = {
14654
15067
  class: "lupa-suggestion-facet-label",
14655
15068
  "data-cy": "lupa-suggestion-facet-label"
14656
15069
  };
@@ -14696,7 +15109,7 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
14696
15109
  innerHTML: _ctx.suggestion.displayHighlight
14697
15110
  }, null, 8, _hoisted_1$1g)) : (openBlock(), createElementBlock("div", _hoisted_2$T, toDisplayString(_ctx.suggestion.display), 1)),
14698
15111
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$D, [
14699
- createBaseVNode("span", _hoisted_4$u, toDisplayString(facetLabel.value), 1),
15112
+ createBaseVNode("span", _hoisted_4$t, toDisplayString(facetLabel.value), 1),
14700
15113
  createBaseVNode("span", _hoisted_5$k, toDisplayString(_ctx.suggestion.facet.title), 1)
14701
15114
  ])) : createCommentVNode("", true)
14702
15115
  ]);
@@ -24190,7 +24603,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
24190
24603
  const _hoisted_1$1a = ["innerHTML"];
24191
24604
  const _hoisted_2$P = { key: 0 };
24192
24605
  const _hoisted_3$C = { key: 1 };
24193
- const _hoisted_4$t = { class: "lupa-search-box-custom-label" };
24606
+ const _hoisted_4$s = { class: "lupa-search-box-custom-label" };
24194
24607
  const _hoisted_5$j = { class: "lupa-search-box-custom-text" };
24195
24608
  const _sfc_main$1j = /* @__PURE__ */ defineComponent({
24196
24609
  __name: "SearchBoxProductCustom",
@@ -24223,7 +24636,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
24223
24636
  class: [className.value, "lupa-search-box-product-custom"]
24224
24637
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
24225
24638
  !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$C, [
24226
- createBaseVNode("div", _hoisted_4$t, toDisplayString(label.value), 1),
24639
+ createBaseVNode("div", _hoisted_4$s, toDisplayString(label.value), 1),
24227
24640
  createBaseVNode("div", _hoisted_5$j, toDisplayString(text.value), 1)
24228
24641
  ]))
24229
24642
  ], 16));
@@ -24573,7 +24986,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
24573
24986
  const _hoisted_1$18 = { class: "lupa-search-box-add-to-cart-wrapper" };
24574
24987
  const _hoisted_2$O = { class: "lupa-search-box-product-addtocart" };
24575
24988
  const _hoisted_3$B = ["disabled"];
24576
- const _hoisted_4$s = ["href"];
24989
+ const _hoisted_4$r = ["href"];
24577
24990
  const _hoisted_5$i = ["onClick", "disabled"];
24578
24991
  const _sfc_main$1h = /* @__PURE__ */ defineComponent({
24579
24992
  __name: "SearchBoxProductAddToCart",
@@ -24621,7 +25034,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
24621
25034
  "data-cy": "lupa-add-to-cart",
24622
25035
  disabled: !inStockValue.value || loading.value
24623
25036
  }, _ctx.dynamicAttributes, { onClick: handleClick }), [
24624
- createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$s)
25037
+ createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$r)
24625
25038
  ], 16, _hoisted_3$B)) : (openBlock(), createElementBlock("button", mergeProps({
24626
25039
  key: 1,
24627
25040
  onClick: withModifiers(handleClick, ["stop", "prevent"]),
@@ -24741,7 +25154,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
24741
25154
  const _hoisted_1$16 = { class: "lupa-badge-title" };
24742
25155
  const _hoisted_2$N = ["src"];
24743
25156
  const _hoisted_3$A = { key: 1 };
24744
- const _hoisted_4$r = {
25157
+ const _hoisted_4$q = {
24745
25158
  key: 0,
24746
25159
  class: "lupa-badge-full-text"
24747
25160
  };
@@ -24785,7 +25198,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
24785
25198
  }, null, 8, _hoisted_2$N)) : createCommentVNode("", true),
24786
25199
  hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$A, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
24787
25200
  ]),
24788
- hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$r, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
25201
+ hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$q, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
24789
25202
  ], 6);
24790
25203
  };
24791
25204
  }
@@ -25700,7 +26113,7 @@ const _hoisted_3$y = {
25700
26113
  key: 0,
25701
26114
  class: "lupa-panel-title lupa-panel-title-top-results"
25702
26115
  };
25703
- const _hoisted_4$q = {
26116
+ const _hoisted_4$p = {
25704
26117
  key: 1,
25705
26118
  class: "lupa-panel-title"
25706
26119
  };
@@ -25893,7 +26306,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
25893
26306
  "data-cy": "lupa-panel-" + panel.type + "-index"
25894
26307
  }, [
25895
26308
  ((_a = panel.labels) == null ? void 0 : _a.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$y, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
25896
- ((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$q, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
26309
+ ((_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),
25897
26310
  panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
25898
26311
  key: 2,
25899
26312
  panel,
@@ -25991,7 +26404,8 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
25991
26404
  "labels",
25992
26405
  "links",
25993
26406
  "inputAttributes",
25994
- "showSubmitButton"
26407
+ "showSubmitButton",
26408
+ "voiceSearch"
25995
26409
  ])
25996
26410
  );
25997
26411
  const panelOptions = computed(
@@ -26391,7 +26805,7 @@ const _hoisted_3$x = {
26391
26805
  key: 1,
26392
26806
  "data-cy": "did-you-mean-label"
26393
26807
  };
26394
- const _hoisted_4$p = { key: 1 };
26808
+ const _hoisted_4$o = { key: 1 };
26395
26809
  const _sfc_main$11 = /* @__PURE__ */ defineComponent({
26396
26810
  __name: "SearchResultsDidYouMean",
26397
26811
  props: {
@@ -26442,7 +26856,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
26442
26856
  class: "lupa-did-you-mean lupa-highlighted-search-text",
26443
26857
  "data-cy": "did-you-mean-value",
26444
26858
  onClick: _cache[0] || (_cache[0] = ($event) => goToResults({ searchText: didYouMeanValue.value }))
26445
- }, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(label) + " ", 1))
26859
+ }, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$o, toDisplayString(label) + " ", 1))
26446
26860
  ]);
26447
26861
  }), 128))
26448
26862
  ])) : createCommentVNode("", true)
@@ -26492,7 +26906,7 @@ const _hoisted_3$w = {
26492
26906
  key: 1,
26493
26907
  class: "lupa-results-total-count"
26494
26908
  };
26495
- const _hoisted_4$o = { class: "lupa-results-total-count-number" };
26909
+ const _hoisted_4$n = { class: "lupa-results-total-count-number" };
26496
26910
  const _hoisted_5$g = ["innerHTML"];
26497
26911
  const _sfc_main$$ = /* @__PURE__ */ defineComponent({
26498
26912
  __name: "SearchResultsTitle",
@@ -26542,7 +26956,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
26542
26956
  queryText.value && !searchResultsTitleTemplate.value ? (openBlock(), createElementBlock("span", _hoisted_2$G, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
26543
26957
  showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$w, [
26544
26958
  createTextVNode("(" + toDisplayString(searchResultsCountLabel.value), 1),
26545
- createBaseVNode("span", _hoisted_4$o, toDisplayString(unref(totalItems)), 1),
26959
+ createBaseVNode("span", _hoisted_4$n, toDisplayString(unref(totalItems)), 1),
26546
26960
  createTextVNode(")")
26547
26961
  ])) : createCommentVNode("", true)
26548
26962
  ])) : createCommentVNode("", true),
@@ -26575,22 +26989,42 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
26575
26989
  emits: ["remove"],
26576
26990
  setup(__props, { emit: emit2 }) {
26577
26991
  const props = __props;
26578
- const facetKeyClass = computed(() => {
26579
- return `lupa-facet-active-filter-${props.filter.key}`;
26992
+ const facetKeyClass = computed(() => `lupa-facet-active-filter-${props.filter.key}`);
26993
+ const { searchResultOptions } = storeToRefs(useOptionsStore());
26994
+ const units = computed(() => {
26995
+ var _a, _b, _c, _d, _e;
26996
+ return (_e = (_d = (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.filters) == null ? void 0 : _b.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
26580
26997
  });
26581
- const handleClick = () => {
26998
+ function handleClick() {
26582
26999
  emit2("remove", { filter: props.filter });
26583
- };
27000
+ }
27001
+ function formatFilterValue(filter2) {
27002
+ const unit = units.value[filter2.key] || "";
27003
+ let min, max;
27004
+ if (Array.isArray(filter2.value)) {
27005
+ [min, max] = filter2.value.map(String);
27006
+ } else if (typeof filter2.value === "string" && filter2.value.includes("-")) {
27007
+ const parts = filter2.value.split("-").map((s) => s.trim());
27008
+ if (parts.length === 2)
27009
+ [min, max] = parts;
27010
+ }
27011
+ if (min != null && max != null) {
27012
+ return `${min} ${unit} – ${max} ${unit}`;
27013
+ }
27014
+ return `${filter2.value} ${unit}`.trim();
27015
+ }
26584
27016
  return (_ctx, _cache) => {
26585
27017
  return openBlock(), createElementBlock("div", {
26586
- class: normalizeClass(["lupa-search-result-filter-value", { [facetKeyClass.value]: true }])
27018
+ class: normalizeClass(["lupa-search-result-filter-value", [facetKeyClass.value]]),
27019
+ "data-cy": "lupa-current-filter-item"
26587
27020
  }, [
26588
27021
  createBaseVNode("div", {
26589
27022
  class: "lupa-current-filter-action",
26590
- onClick: handleClick
26591
- }, ""),
27023
+ onClick: handleClick,
27024
+ "aria-label": "Remove filter"
27025
+ }, " ⨉ "),
26592
27026
  createBaseVNode("div", _hoisted_1$U, toDisplayString(_ctx.filter.label) + ": ", 1),
26593
- createBaseVNode("div", _hoisted_2$F, toDisplayString(_ctx.filter.value), 1)
27027
+ createBaseVNode("div", _hoisted_2$F, toDisplayString(formatFilterValue(props.filter)), 1)
26594
27028
  ], 2);
26595
27029
  };
26596
27030
  }
@@ -26604,7 +27038,7 @@ const _hoisted_3$v = {
26604
27038
  key: 0,
26605
27039
  class: "filter-values"
26606
27040
  };
26607
- const _hoisted_4$n = { class: "lupa-current-filter-list" };
27041
+ const _hoisted_4$m = { class: "lupa-current-filter-list" };
26608
27042
  const _sfc_main$Z = /* @__PURE__ */ defineComponent({
26609
27043
  __name: "CurrentFilters",
26610
27044
  props: {
@@ -26612,6 +27046,14 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
26612
27046
  expandable: { type: Boolean }
26613
27047
  },
26614
27048
  setup(__props) {
27049
+ const optionsStore = useOptionsStore();
27050
+ const { searchResultOptions } = storeToRefs(optionsStore);
27051
+ const units = computed(
27052
+ () => {
27053
+ var _a, _b, _c, _d, _e;
27054
+ return (_e = (_d = (_c = (_b = (_a = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a.filters) == null ? void 0 : _b.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
27055
+ }
27056
+ );
26615
27057
  const isOpen = ref(false);
26616
27058
  const paramsStore = useParamsStore();
26617
27059
  const optionStore = useOptionsStore();
@@ -26688,13 +27130,14 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
26688
27130
  }, null, 2)) : createCommentVNode("", true)
26689
27131
  ]),
26690
27132
  !_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
26691
- createBaseVNode("div", _hoisted_4$n, [
27133
+ createBaseVNode("div", _hoisted_4$m, [
26692
27134
  (openBlock(true), createElementBlock(Fragment, null, renderList(currentDisplayFilters.value, (filter2) => {
26693
27135
  return openBlock(), createBlock(_sfc_main$_, {
26694
27136
  key: filter2.key + "_" + filter2.value,
26695
27137
  filter: filter2,
27138
+ units: units.value,
26696
27139
  onRemove: handleRemove
26697
- }, null, 8, ["filter"]);
27140
+ }, null, 8, ["filter", "units"]);
26698
27141
  }), 128))
26699
27142
  ]),
26700
27143
  createBaseVNode("div", {
@@ -26756,7 +27199,7 @@ const _hoisted_1$R = {
26756
27199
  };
26757
27200
  const _hoisted_2$D = { class: "lupa-category-back" };
26758
27201
  const _hoisted_3$u = ["href"];
26759
- const _hoisted_4$m = ["href"];
27202
+ const _hoisted_4$l = ["href"];
26760
27203
  const _hoisted_5$f = { class: "lupa-child-category-list" };
26761
27204
  const _sfc_main$X = /* @__PURE__ */ defineComponent({
26762
27205
  __name: "CategoryFilter",
@@ -26863,7 +27306,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
26863
27306
  href: parentUrlLink.value,
26864
27307
  class: normalizeClass({ "lupa-title-category": !hasBackButton.value }),
26865
27308
  onClick: handleNavigationParent
26866
- }, toDisplayString(parentTitle.value), 11, _hoisted_4$m)
27309
+ }, toDisplayString(parentTitle.value), 11, _hoisted_4$l)
26867
27310
  ], 2),
26868
27311
  createBaseVNode("div", _hoisted_5$f, [
26869
27312
  (openBlock(true), createElementBlock(Fragment, null, renderList(categoryChildren.value, (child) => {
@@ -26884,7 +27327,7 @@ const _hoisted_1$Q = {
26884
27327
  };
26885
27328
  const _hoisted_2$C = ["placeholder"];
26886
27329
  const _hoisted_3$t = { class: "lupa-terms-list" };
26887
- const _hoisted_4$l = ["onClick"];
27330
+ const _hoisted_4$k = ["onClick"];
26888
27331
  const _hoisted_5$e = { class: "lupa-term-checkbox-wrapper" };
26889
27332
  const _hoisted_6$8 = { class: "lupa-term-label" };
26890
27333
  const _hoisted_7$6 = {
@@ -27011,7 +27454,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
27011
27454
  createBaseVNode("span", _hoisted_6$8, toDisplayString(getItemLabel(item)), 1),
27012
27455
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_7$6, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
27013
27456
  ], 2)
27014
- ], 10, _hoisted_4$l);
27457
+ ], 10, _hoisted_4$k);
27015
27458
  }), 128))
27016
27459
  ]),
27017
27460
  displayShowMore.value ? (openBlock(), createElementBlock("div", {
@@ -28011,22 +28454,24 @@ const _hoisted_3$s = {
28011
28454
  key: 1,
28012
28455
  class: "lupa-stats-facet-summary-input"
28013
28456
  };
28014
- const _hoisted_4$k = {
28457
+ const _hoisted_4$j = {
28015
28458
  key: 0,
28016
28459
  class: "lupa-stats-range-label"
28017
28460
  };
28018
28461
  const _hoisted_5$d = { class: "lupa-stats-from" };
28019
28462
  const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
28020
28463
  const _hoisted_7$5 = { key: 0 };
28021
- const _hoisted_8$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
28022
- const _hoisted_9$1 = {
28464
+ const _hoisted_8$1 = { key: 1 };
28465
+ const _hoisted_9$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
28466
+ const _hoisted_10 = {
28023
28467
  key: 0,
28024
28468
  class: "lupa-stats-range-label"
28025
28469
  };
28026
- const _hoisted_10 = { class: "lupa-stats-to" };
28027
- const _hoisted_11 = ["max", "min", "pattern", "aria-label"];
28028
- const _hoisted_12 = { key: 0 };
28029
- const _hoisted_13 = {
28470
+ const _hoisted_11 = { class: "lupa-stats-to" };
28471
+ const _hoisted_12 = ["max", "min", "pattern", "aria-label"];
28472
+ const _hoisted_13 = { key: 0 };
28473
+ const _hoisted_14 = { key: 1 };
28474
+ const _hoisted_15 = {
28030
28475
  key: 2,
28031
28476
  class: "lupa-stats-slider-wrapper"
28032
28477
  };
@@ -28093,7 +28538,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
28093
28538
  if (!value || value > facetMax.value) {
28094
28539
  return;
28095
28540
  }
28096
- innerSliderRange.value = [value, sliderRange.value[1]];
28541
+ innerSliderRange.value = [sliderRange.value[1], value];
28097
28542
  handleInputChange();
28098
28543
  }
28099
28544
  });
@@ -28149,7 +28594,18 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
28149
28594
  });
28150
28595
  const statsSummary = computed(() => {
28151
28596
  const [min, max] = sliderRange.value;
28152
- return isPrice.value ? formatPriceSummary([min, max], currency.value, separator.value, currencyTemplate.value) : formatRange({ gte: min, lte: max });
28597
+ if (isPrice.value) {
28598
+ return formatPriceSummary(
28599
+ [min, max],
28600
+ currency.value,
28601
+ separator.value,
28602
+ currencyTemplate.value
28603
+ );
28604
+ }
28605
+ if (unit.value) {
28606
+ return `${min} ${unit.value} - ${max} ${unit.value}`;
28607
+ }
28608
+ return formatRange({ gte: min, lte: max });
28153
28609
  });
28154
28610
  const separator = computed(() => {
28155
28611
  var _a, _b, _c;
@@ -28210,11 +28666,17 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
28210
28666
  const handleDragging = (value) => {
28211
28667
  innerSliderRange.value = value;
28212
28668
  };
28669
+ const unit = computed(
28670
+ () => {
28671
+ var _a, _b, _c, _d, _e;
28672
+ return (_e = (_d = (_a = props.options.stats) == null ? void 0 : _a.units) == null ? void 0 : _d[(_c = (_b = props.facet) == null ? void 0 : _b.key) != null ? _c : ""]) != null ? _e : "";
28673
+ }
28674
+ );
28213
28675
  return (_ctx, _cache) => {
28214
28676
  return openBlock(), createElementBlock("div", _hoisted_1$P, [
28215
28677
  !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$B, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$s, [
28216
28678
  createBaseVNode("div", null, [
28217
- rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$k, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
28679
+ rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
28218
28680
  createBaseVNode("div", _hoisted_5$d, [
28219
28681
  withDirectives(createBaseVNode("input", {
28220
28682
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
@@ -28232,13 +28694,14 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
28232
28694
  { lazy: true }
28233
28695
  ]
28234
28696
  ]),
28235
- isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
28697
+ isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true),
28698
+ unit.value ? (openBlock(), createElementBlock("span", _hoisted_8$1, toDisplayString(unit.value), 1)) : createCommentVNode("", true)
28236
28699
  ])
28237
28700
  ]),
28238
- _hoisted_8$1,
28701
+ _hoisted_9$1,
28239
28702
  createBaseVNode("div", null, [
28240
- rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_9$1, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
28241
- createBaseVNode("div", _hoisted_10, [
28703
+ rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
28704
+ createBaseVNode("div", _hoisted_11, [
28242
28705
  withDirectives(createBaseVNode("input", {
28243
28706
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
28244
28707
  type: "text",
@@ -28247,7 +28710,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
28247
28710
  min: facetMin.value,
28248
28711
  pattern: sliderInputFormat.value,
28249
28712
  "aria-label": ariaLabelTo.value
28250
- }, null, 8, _hoisted_11), [
28713
+ }, null, 8, _hoisted_12), [
28251
28714
  [
28252
28715
  vModelText,
28253
28716
  toValue.value,
@@ -28255,11 +28718,12 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
28255
28718
  { lazy: true }
28256
28719
  ]
28257
28720
  ]),
28258
- isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
28721
+ isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(currency.value), 1)) : createCommentVNode("", true),
28722
+ unit.value ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(unit.value), 1)) : createCommentVNode("", true)
28259
28723
  ])
28260
28724
  ])
28261
28725
  ])),
28262
- isSliderVisible.value ? (openBlock(), createElementBlock("div", _hoisted_13, [
28726
+ isSliderVisible.value ? (openBlock(), createElementBlock("div", _hoisted_15, [
28263
28727
  createVNode(unref(m), {
28264
28728
  class: "slider",
28265
28729
  tooltips: false,
@@ -28284,7 +28748,7 @@ const _hoisted_3$r = {
28284
28748
  key: 0,
28285
28749
  class: "lupa-term-count"
28286
28750
  };
28287
- const _hoisted_4$j = {
28751
+ const _hoisted_4$i = {
28288
28752
  key: 0,
28289
28753
  class: "lupa-facet-level"
28290
28754
  };
@@ -28353,7 +28817,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
28353
28817
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_3$r, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
28354
28818
  ], 2)
28355
28819
  ]),
28356
- showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, [
28820
+ showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, [
28357
28821
  (openBlock(true), createElementBlock(Fragment, null, renderList(treeItem.value.children, (itemChild) => {
28358
28822
  return openBlock(), createBlock(_component_HierarchyFacetLevel, {
28359
28823
  key: itemChild.title,
@@ -28886,7 +29350,7 @@ const _hoisted_1$H = {
28886
29350
  };
28887
29351
  const _hoisted_2$w = ["onClick"];
28888
29352
  const _hoisted_3$p = { class: "lupa-mobile-sidebar-content" };
28889
- const _hoisted_4$i = { class: "lupa-sidebar-top" };
29353
+ const _hoisted_4$h = { class: "lupa-sidebar-top" };
28890
29354
  const _hoisted_5$c = { class: "lupa-sidebar-title" };
28891
29355
  const _hoisted_6$6 = {
28892
29356
  key: 0,
@@ -28930,7 +29394,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
28930
29394
  onClick: withModifiers(handleMobileToggle, ["stop"])
28931
29395
  }, null, 8, _hoisted_2$w),
28932
29396
  createBaseVNode("div", _hoisted_3$p, [
28933
- createBaseVNode("div", _hoisted_4$i, [
29397
+ createBaseVNode("div", _hoisted_4$h, [
28934
29398
  createBaseVNode("div", _hoisted_5$c, [
28935
29399
  createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
28936
29400
  isFilterCountVisible.value ? (openBlock(), createElementBlock("span", _hoisted_6$6, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
@@ -28958,7 +29422,7 @@ const _hoisted_3$o = {
28958
29422
  key: 1,
28959
29423
  class: "lupa-search-results-breadcrumb-text"
28960
29424
  };
28961
- const _hoisted_4$h = { key: 2 };
29425
+ const _hoisted_4$g = { key: 2 };
28962
29426
  const _sfc_main$M = /* @__PURE__ */ defineComponent({
28963
29427
  __name: "SearchResultsBreadcrumbs",
28964
29428
  props: {
@@ -29000,7 +29464,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
29000
29464
  return handleNavigation(e2, (_a2 = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a2 : "");
29001
29465
  }
29002
29466
  }, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$v)) : (openBlock(), createElementBlock("span", _hoisted_3$o, toDisplayString(getLabel(breadcrumb.label)), 1)),
29003
- index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$h, toDisplayString((_a = breadcrumb.separator) != null ? _a : "/"), 1)) : createCommentVNode("", true)
29467
+ index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$g, toDisplayString((_a = breadcrumb.separator) != null ? _a : "/"), 1)) : createCommentVNode("", true)
29004
29468
  ]);
29005
29469
  }), 128))
29006
29470
  ]);
@@ -29162,7 +29626,7 @@ const _hoisted_2$u = {
29162
29626
  class: "lupa-page-number-separator"
29163
29627
  };
29164
29628
  const _hoisted_3$n = ["onClick"];
29165
- const _hoisted_4$g = {
29629
+ const _hoisted_4$f = {
29166
29630
  key: 0,
29167
29631
  class: "lupa-page-number-separator"
29168
29632
  };
@@ -29268,7 +29732,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
29268
29732
  }, toDisplayString(page), 11, _hoisted_3$n);
29269
29733
  }), 128)),
29270
29734
  showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
29271
- showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$g, "...")) : createCommentVNode("", true),
29735
+ showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$f, "...")) : createCommentVNode("", true),
29272
29736
  createBaseVNode("div", {
29273
29737
  class: "lupa-page-number lupa-page-number-last",
29274
29738
  onClick: _cache[2] || (_cache[2] = () => {
@@ -29293,7 +29757,7 @@ const _hoisted_1$B = {
29293
29757
  };
29294
29758
  const _hoisted_2$t = { id: "lupa-select" };
29295
29759
  const _hoisted_3$m = { class: "lupa-select-label" };
29296
- const _hoisted_4$f = ["aria-label"];
29760
+ const _hoisted_4$e = ["aria-label"];
29297
29761
  const _hoisted_5$b = ["value"];
29298
29762
  const _sfc_main$G = /* @__PURE__ */ defineComponent({
29299
29763
  __name: "SearchResultsPageSize",
@@ -29340,7 +29804,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
29340
29804
  value: option
29341
29805
  }, toDisplayString(prefixLabel.value) + toDisplayString(option), 9, _hoisted_5$b);
29342
29806
  }), 128))
29343
- ], 40, _hoisted_4$f)
29807
+ ], 40, _hoisted_4$e)
29344
29808
  ])
29345
29809
  ]);
29346
29810
  };
@@ -29352,7 +29816,7 @@ const _hoisted_1$A = {
29352
29816
  };
29353
29817
  const _hoisted_2$s = { id: "lupa-select" };
29354
29818
  const _hoisted_3$l = { class: "lupa-select-label" };
29355
- const _hoisted_4$e = ["aria-label"];
29819
+ const _hoisted_4$d = ["aria-label"];
29356
29820
  const _hoisted_5$a = ["value"];
29357
29821
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
29358
29822
  __name: "SearchResultsSort",
@@ -29420,7 +29884,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
29420
29884
  value: option.key
29421
29885
  }, toDisplayString(option.label), 9, _hoisted_5$a);
29422
29886
  }), 128))
29423
- ], 40, _hoisted_4$e), [
29887
+ ], 40, _hoisted_4$d), [
29424
29888
  [vModelSelect, selectedKey.value]
29425
29889
  ])
29426
29890
  ])
@@ -29434,7 +29898,7 @@ const _hoisted_2$r = {
29434
29898
  class: "lupa-toolbar-right-title"
29435
29899
  };
29436
29900
  const _hoisted_3$k = { key: 2 };
29437
- const _hoisted_4$d = { key: 4 };
29901
+ const _hoisted_4$c = { key: 4 };
29438
29902
  const _hoisted_5$9 = { key: 6 };
29439
29903
  const _hoisted_6$5 = { class: "lupa-toolbar-right" };
29440
29904
  const _hoisted_7$3 = {
@@ -29562,7 +30026,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
29562
30026
  label: searchSummaryLabel.value,
29563
30027
  clearable: unref(hasAnyFilter) && showFilterClear.value,
29564
30028
  onClear: handleClearAll
29565
- }, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$d)),
30029
+ }, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$c)),
29566
30030
  displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$H, {
29567
30031
  key: 5,
29568
30032
  options: paginationOptions.value.pageSelect,
@@ -29615,7 +30079,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
29615
30079
  const _hoisted_1$y = ["title", "innerHTML"];
29616
30080
  const _hoisted_2$q = ["title"];
29617
30081
  const _hoisted_3$j = ["href", "innerHTML"];
29618
- const _hoisted_4$c = ["title"];
30082
+ const _hoisted_4$b = ["title"];
29619
30083
  const _hoisted_5$8 = {
29620
30084
  key: 0,
29621
30085
  class: "lupa-search-results-product-title-text"
@@ -29683,7 +30147,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
29683
30147
  class: "lupa-search-results-product-title-text lupa-title-link",
29684
30148
  onClick: handleNavigation
29685
30149
  }, toDisplayString(title.value), 9, _hoisted_6$4)) : createCommentVNode("", true)
29686
- ], 12, _hoisted_4$c));
30150
+ ], 12, _hoisted_4$b));
29687
30151
  };
29688
30152
  }
29689
30153
  });
@@ -29726,7 +30190,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
29726
30190
  const _hoisted_1$w = { id: "lupa-search-results-rating" };
29727
30191
  const _hoisted_2$p = { class: "lupa-ratings" };
29728
30192
  const _hoisted_3$i = { class: "lupa-ratings-base" };
29729
- const _hoisted_4$b = ["innerHTML"];
30193
+ const _hoisted_4$a = ["innerHTML"];
29730
30194
  const _hoisted_5$7 = { class: "lupa-rating-wrapper" };
29731
30195
  const _hoisted_6$3 = ["innerHTML"];
29732
30196
  const _hoisted_7$2 = ["href"];
@@ -29776,7 +30240,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
29776
30240
  key: index,
29777
30241
  innerHTML: star,
29778
30242
  class: "lupa-rating lupa-rating-not-highlighted"
29779
- }, null, 8, _hoisted_4$b);
30243
+ }, null, 8, _hoisted_4$a);
29780
30244
  }), 128))
29781
30245
  ]),
29782
30246
  createBaseVNode("div", _hoisted_5$7, [
@@ -29863,7 +30327,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
29863
30327
  const _hoisted_1$u = { class: "lupa-search-results-add-to-cart-wrapper" };
29864
30328
  const _hoisted_2$o = { class: "lupa-search-results-product-addtocart" };
29865
30329
  const _hoisted_3$h = ["disabled"];
29866
- const _hoisted_4$a = ["href"];
30330
+ const _hoisted_4$9 = ["href"];
29867
30331
  const _hoisted_5$6 = ["id", "disabled", "onClick"];
29868
30332
  const _sfc_main$x = /* @__PURE__ */ defineComponent({
29869
30333
  __name: "SearchResultsProductAddToCart",
@@ -29882,6 +30346,8 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
29882
30346
  return (_a = props.inStock) != null ? _a : true;
29883
30347
  });
29884
30348
  const searchResultStore = useSearchResultStore();
30349
+ const optionsStore = useOptionsStore();
30350
+ const { searchResultOptions } = storeToRefs(optionsStore);
29885
30351
  const { addToCartAmount } = storeToRefs(searchResultStore);
29886
30352
  const loading = ref(false);
29887
30353
  const label = computed(() => {
@@ -29892,7 +30358,16 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
29892
30358
  const id2 = (_a = props.item.id) != null ? _a : "";
29893
30359
  return `lupa-add-to-cart-${id2}`;
29894
30360
  });
29895
- const handleClick = () => __async2(this, null, function* () {
30361
+ const productCardIsClickable = computed(() => {
30362
+ return searchResultOptions.value.isLink;
30363
+ });
30364
+ const hasLink = computed(() => {
30365
+ return Boolean(props.link && props.options.link);
30366
+ });
30367
+ const handleClick = (e2) => __async2(this, null, function* () {
30368
+ if (productCardIsClickable.value && !hasLink.value) {
30369
+ e2.preventDefault();
30370
+ }
29896
30371
  loading.value = true;
29897
30372
  if (props.options.emitEvent) {
29898
30373
  const event = new CustomEvent(props.options.emitEvent, { detail: { item: props.item } });
@@ -29904,9 +30379,6 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
29904
30379
  emit2("productEvent", { type: "addToCart" });
29905
30380
  loading.value = false;
29906
30381
  });
29907
- const hasLink = computed(() => {
29908
- return Boolean(props.link && props.options.link);
29909
- });
29910
30382
  return (_ctx, _cache) => {
29911
30383
  return openBlock(), createElementBlock("div", _hoisted_1$u, [
29912
30384
  createBaseVNode("div", _hoisted_2$o, [
@@ -29916,7 +30388,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
29916
30388
  "data-cy": "lupa-add-to-cart",
29917
30389
  disabled: !inStockValue.value || loading.value
29918
30390
  }, _ctx.dynamicAttributes, { onClick: handleClick }), [
29919
- createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$a)
30391
+ createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$9)
29920
30392
  ], 16, _hoisted_3$h)) : (openBlock(), createElementBlock("button", mergeProps({
29921
30393
  key: 1,
29922
30394
  id: id.value,
@@ -29934,7 +30406,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
29934
30406
  const _hoisted_1$t = ["innerHTML"];
29935
30407
  const _hoisted_2$n = { key: 0 };
29936
30408
  const _hoisted_3$g = { key: 1 };
29937
- const _hoisted_4$9 = { class: "lupa-search-box-custom-label" };
30409
+ const _hoisted_4$8 = { class: "lupa-search-box-custom-label" };
29938
30410
  const _hoisted_5$5 = { class: "lupa-search-box-custom-text" };
29939
30411
  const _sfc_main$w = /* @__PURE__ */ defineComponent({
29940
30412
  __name: "SearchResultsProductCustom",
@@ -29979,7 +30451,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
29979
30451
  class: className.value
29980
30452
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
29981
30453
  !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$n, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$g, [
29982
- createBaseVNode("div", _hoisted_4$9, toDisplayString(label.value), 1),
30454
+ createBaseVNode("div", _hoisted_4$8, toDisplayString(label.value), 1),
29983
30455
  createBaseVNode("div", _hoisted_5$5, toDisplayString(text.value), 1)
29984
30456
  ]))
29985
30457
  ], 16));
@@ -30025,7 +30497,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
30025
30497
  const _hoisted_1$r = { id: "lupa-search-results-rating" };
30026
30498
  const _hoisted_2$m = ["innerHTML"];
30027
30499
  const _hoisted_3$f = { class: "lupa-ratings" };
30028
- const _hoisted_4$8 = ["href"];
30500
+ const _hoisted_4$7 = ["href"];
30029
30501
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
30030
30502
  __name: "SearchResultsProductSingleStarRating",
30031
30503
  props: {
@@ -30063,7 +30535,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
30063
30535
  createBaseVNode("a", {
30064
30536
  href: ratingLink.value,
30065
30537
  class: "lupa-total-ratings"
30066
- }, toDisplayString(totalRatings.value), 9, _hoisted_4$8)
30538
+ }, toDisplayString(totalRatings.value), 9, _hoisted_4$7)
30067
30539
  ]);
30068
30540
  };
30069
30541
  }
@@ -30164,13 +30636,12 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
30164
30636
  };
30165
30637
  }
30166
30638
  }));
30167
- const _hoisted_1$q = ["onMouseup"];
30168
- const _hoisted_2$l = ["href"];
30169
- const _hoisted_3$e = {
30639
+ const _hoisted_1$q = ["href"];
30640
+ const _hoisted_2$l = {
30170
30641
  key: 0,
30171
30642
  class: "lupa-out-of-stock"
30172
30643
  };
30173
- const _hoisted_4$7 = { class: "lupa-search-result-product-details-section" };
30644
+ const _hoisted_3$e = { class: "lupa-search-result-product-details-section" };
30174
30645
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
30175
30646
  __name: "SearchResultsProductCard",
30176
30647
  props: {
@@ -30199,6 +30670,9 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
30199
30670
  const listLayoutClass = computed(() => {
30200
30671
  return layout.value === ResultsLayoutEnum.LIST && !props.isAdditionalPanel ? "lupa-search-result-product-contents-list" : "";
30201
30672
  });
30673
+ const useLinkWrapper = computed(() => {
30674
+ return props.options.isLink;
30675
+ });
30202
30676
  const badgesOptions = computed(() => {
30203
30677
  return __spreadProps2(__spreadValues2({}, props.options.badges), { product: props.product });
30204
30678
  });
@@ -30327,78 +30801,84 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
30327
30801
  checkIfIsInStock();
30328
30802
  }
30329
30803
  return (_ctx, _cache) => {
30330
- var _a;
30331
- return openBlock(), createElementBlock("div", mergeProps({
30804
+ return openBlock(), createBlock(resolveDynamicComponent(useLinkWrapper.value ? "a" : "div"), mergeProps({
30805
+ href: useLinkWrapper.value ? link.value : null,
30332
30806
  id: "lupa-search-result-product-card",
30333
30807
  "data-cy": "lupa-search-result-product-card",
30334
30808
  class: ["lupa-search-result-product-card", !isInStock.value ? "lupa-out-of-stock" : ""]
30335
30809
  }, customDocumentHtmlAttributes.value, {
30336
30810
  onClick: handleClick,
30337
30811
  onMouseup: withModifiers(handleClick, ["middle", "exact"])
30338
- }), [
30339
- createVNode(_sfc_main$19, { options: badgesOptions.value }, null, 8, ["options"]),
30340
- createBaseVNode("div", {
30341
- class: normalizeClass(["lupa-search-result-product-contents", listLayoutClass.value])
30342
- }, [
30343
- createBaseVNode("a", {
30344
- class: "lupa-search-result-product-image-section",
30345
- href: link.value,
30346
- onClick: handleNavigation
30347
- }, [
30348
- (openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
30349
- return openBlock(), createBlock(_sfc_main$t, {
30350
- class: "lupa-search-results-product-element",
30351
- item: _ctx.product,
30352
- element,
30353
- key: element.key,
30354
- labels: labels.value,
30355
- inStock: isInStock.value,
30356
- link: link.value,
30357
- onProductEvent: handleProductEvent
30358
- }, null, 8, ["item", "element", "labels", "inStock", "link"]);
30359
- }), 128)),
30360
- createVNode(_sfc_main$19, {
30361
- options: badgesOptions.value,
30362
- position: "image",
30363
- class: "lupa-image-badges"
30364
- }, null, 8, ["options"]),
30365
- ((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_3$e, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
30366
- ], 8, _hoisted_2$l),
30367
- createBaseVNode("div", _hoisted_4$7, [
30368
- (openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
30369
- return openBlock(), createBlock(_sfc_main$t, {
30370
- class: "lupa-search-results-product-element",
30371
- item: _ctx.product,
30372
- element,
30373
- key: element.key,
30374
- labels: labels.value,
30375
- inStock: isInStock.value,
30376
- link: link.value,
30377
- onProductEvent: handleProductEvent
30378
- }, null, 8, ["item", "element", "labels", "inStock", "link"]);
30379
- }), 128))
30380
- ]),
30381
- (openBlock(true), createElementBlock(Fragment, null, renderList(elementGroups.value, (group) => {
30382
- return openBlock(), createElementBlock("div", {
30383
- key: group,
30384
- class: normalizeClass("lupa-element-group-" + group)
30812
+ }), {
30813
+ default: withCtx(() => {
30814
+ var _a;
30815
+ return [
30816
+ createVNode(_sfc_main$19, { options: badgesOptions.value }, null, 8, ["options"]),
30817
+ createBaseVNode("div", {
30818
+ class: normalizeClass(["lupa-search-result-product-contents", listLayoutClass.value])
30385
30819
  }, [
30386
- (openBlock(true), createElementBlock(Fragment, null, renderList(getGroupElements(group), (element) => {
30387
- return openBlock(), createBlock(_sfc_main$t, {
30388
- class: "lupa-search-results-product-element",
30389
- item: _ctx.product,
30390
- element,
30391
- key: element.key,
30392
- labels: labels.value,
30393
- inStock: isInStock.value,
30394
- link: link.value,
30395
- onProductEvent: handleProductEvent
30396
- }, null, 8, ["item", "element", "labels", "inStock", "link"]);
30820
+ createBaseVNode("a", {
30821
+ class: "lupa-search-result-product-image-section",
30822
+ href: link.value,
30823
+ onClick: handleNavigation
30824
+ }, [
30825
+ (openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
30826
+ return openBlock(), createBlock(_sfc_main$t, {
30827
+ class: "lupa-search-results-product-element",
30828
+ item: _ctx.product,
30829
+ element,
30830
+ key: element.key,
30831
+ labels: labels.value,
30832
+ inStock: isInStock.value,
30833
+ link: link.value,
30834
+ onProductEvent: handleProductEvent
30835
+ }, null, 8, ["item", "element", "labels", "inStock", "link"]);
30836
+ }), 128)),
30837
+ createVNode(_sfc_main$19, {
30838
+ options: badgesOptions.value,
30839
+ position: "image",
30840
+ class: "lupa-image-badges"
30841
+ }, null, 8, ["options"]),
30842
+ ((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_2$l, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
30843
+ ], 8, _hoisted_1$q),
30844
+ createBaseVNode("div", _hoisted_3$e, [
30845
+ (openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
30846
+ return openBlock(), createBlock(_sfc_main$t, {
30847
+ class: "lupa-search-results-product-element",
30848
+ item: _ctx.product,
30849
+ element,
30850
+ key: element.key,
30851
+ labels: labels.value,
30852
+ inStock: isInStock.value,
30853
+ link: link.value,
30854
+ onProductEvent: handleProductEvent
30855
+ }, null, 8, ["item", "element", "labels", "inStock", "link"]);
30856
+ }), 128))
30857
+ ]),
30858
+ (openBlock(true), createElementBlock(Fragment, null, renderList(elementGroups.value, (group) => {
30859
+ return openBlock(), createElementBlock("div", {
30860
+ key: group,
30861
+ class: normalizeClass("lupa-element-group-" + group)
30862
+ }, [
30863
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getGroupElements(group), (element) => {
30864
+ return openBlock(), createBlock(_sfc_main$t, {
30865
+ class: "lupa-search-results-product-element",
30866
+ item: _ctx.product,
30867
+ element,
30868
+ key: element.key,
30869
+ labels: labels.value,
30870
+ inStock: isInStock.value,
30871
+ link: link.value,
30872
+ onProductEvent: handleProductEvent
30873
+ }, null, 8, ["item", "element", "labels", "inStock", "link"]);
30874
+ }), 128))
30875
+ ], 2);
30397
30876
  }), 128))
30398
- ], 2);
30399
- }), 128))
30400
- ], 2)
30401
- ], 16, _hoisted_1$q);
30877
+ ], 2)
30878
+ ];
30879
+ }),
30880
+ _: 1
30881
+ }, 16, ["href", "class", "onMouseup"]);
30402
30882
  };
30403
30883
  }
30404
30884
  });
@@ -31331,6 +31811,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
31331
31811
  "queryKey",
31332
31812
  "idKey",
31333
31813
  "titleKey",
31814
+ "isLink",
31334
31815
  "routingBehavior",
31335
31816
  "customDocumentHtmlAttributes"
31336
31817
  ]);
@@ -33145,21 +33626,6 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
33145
33626
  };
33146
33627
  }
33147
33628
  });
33148
- const Env = {
33149
- production: "https://api.lupasearch.com/v1/",
33150
- staging: "https://api.staging.lupasearch.com/v1/"
33151
- };
33152
- const DEFAULT_REQUEST_CONFIG = {
33153
- method: "POST",
33154
- headers: { "Content-Type": "application/json" }
33155
- };
33156
- const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
33157
- const getApiUrl = (environment, customBaseUrl) => {
33158
- if (customBaseUrl) {
33159
- return customBaseUrl;
33160
- }
33161
- return Env[environment] || Env["production"];
33162
- };
33163
33629
  const suggestSearchChatPhrases = (options, request, chatSettings) => __async2(void 0, null, function* () {
33164
33630
  var _a, _b, _c;
33165
33631
  const { environment, customBaseUrl } = options;
@@ -33666,7 +34132,7 @@ const _hoisted_4 = {
33666
34132
  key: 0,
33667
34133
  class: "lupasearch-chat-content"
33668
34134
  };
33669
- const _sfc_main$1y = /* @__PURE__ */ defineComponent({
34135
+ const _sfc_main$1A = /* @__PURE__ */ defineComponent({
33670
34136
  __name: "ChatContainer",
33671
34137
  props: {
33672
34138
  options: {}
@@ -40320,7 +40786,7 @@ const chat = (options, mountOptions) => {
40320
40786
  const instance = createVue(
40321
40787
  options.displayOptions.containerSelector,
40322
40788
  mountOptions == null ? void 0 : mountOptions.mountingBehavior,
40323
- _sfc_main$1y,
40789
+ _sfc_main$1A,
40324
40790
  {
40325
40791
  options
40326
40792
  }