@visitscotland/component-library 5.57.4 → 5.58.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33388,7 +33388,7 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33388
33388
  provide("featuredPlaces", {
33389
33389
  categories: a,
33390
33390
  places: r
33391
- }), provide("onFeaturedLocationClick", Ee), provide("addDestinationMarkers", Se);
33391
+ }), provide("onFeaturedLocationClick", Te), provide("addDestinationMarkers", Ce);
33392
33392
  let o, i, l, c, d, u, f, m, p, g, v = {}, k;
33393
33393
  const _ = ref(), b = ref(/* @__PURE__ */ new Set()), S = ref(), V = ref(/* @__PURE__ */ new Set()), T = ref(/* @__PURE__ */ new Set()), N = ref(/* @__PURE__ */ new Set()), C = ref(/* @__PURE__ */ new Set()), F = ref(), I = ref(), w = ref(t.zoom), M = ref(!1), E = ref(), L = ref(/* @__PURE__ */ new Set()), $ = ref(), D = ref(!1), R = ref(void 0), B = ref(!1), P = computed$1(() => {
33394
33394
  const A = /* @__PURE__ */ new Map(), z = Y[_.value].subCategory;
@@ -33482,23 +33482,23 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33482
33482
  }
33483
33483
  g = new google.maps.InfoWindow(), g.addListener("closeclick", () => {
33484
33484
  he("card_close", m.place);
33485
- }), ke(), o.addListener("zoom_changed", () => {
33486
- w.value = o.getZoom(), w.value < CATEGORY_VISIBLE_ZOOM ? ke() : ke(!0), ue.value = !ce.value, w.value > 7 && !ce.value && ue.value && (fe.value = !0);
33485
+ }), be(), o.addListener("zoom_changed", () => {
33486
+ w.value = o.getZoom(), w.value < CATEGORY_VISIBLE_ZOOM ? be() : be(!0), ue.value = !ce.value, w.value > 7 && !ce.value && ue.value && (fe.value = !0);
33487
33487
  }), o.addListener("dragstart", () => {
33488
33488
  ue.value = !0;
33489
33489
  }), o.addListener("tilesloaded", () => {
33490
- B.value || (B.value = !0, Se());
33490
+ B.value || (B.value = !0, Ce());
33491
33491
  }), o.addListener("idle", () => {
33492
33492
  k = Ie(), !ce.value && ue.value && ge(le(o)) && (fe.value = !0, ue.value = !1);
33493
33493
  }), l.addEventListener("gmp-select", ({ place: z }) => {
33494
- v[z.id] && be(z, v[z.id]);
33494
+ v[z.id] && ye(z, v[z.id]);
33495
33495
  }), c.addEventListener("gmp-select", ({ place: z }) => {
33496
- v[z.id] && be(z, v[z.id]);
33496
+ v[z.id] && ye(z, v[z.id]);
33497
33497
  });
33498
33498
  }
33499
33499
  O.firstInteraction = !1, O.searchesCount = 0, O.filterUsesCount = 0, U.value === !1 && await A();
33500
33500
  });
33501
- function ke(A) {
33501
+ function be(A) {
33502
33502
  const z = {
33503
33503
  strokeColor: "#A3A3CC",
33504
33504
  strokeOpacity: 1,
@@ -33578,11 +33578,11 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33578
33578
  return z;
33579
33579
  });
33580
33580
  }
33581
- function Le(A, z) {
33581
+ function De(A, z) {
33582
33582
  oe.value && (X(() => o.setCenter(oe.value.center)), X(() => o.setZoom(oe.value.zoom))), ae.value = "", me(A, z);
33583
33583
  }
33584
33584
  function me(A, z) {
33585
- ye(), _.value = A, Y[A].includedType && V.value.add(Y[A].includedType), Object.values(Y[A].subCategory).forEach(
33585
+ Ve(), _.value = A, Y[A].includedType && V.value.add(Y[A].includedType), Object.values(Y[A].subCategory).forEach(
33586
33586
  (j) => V.value.add(j.includedType)
33587
33587
  ), Object.values(Y[A].subCategory).forEach(
33588
33588
  (j) => {
@@ -33630,15 +33630,15 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33630
33630
  q && C.value.add(ne), W && C.value.delete(ne);
33631
33631
  }));
33632
33632
  }
33633
- function De(A, z) {
33634
- oe.value && (X(() => o.setCenter(oe.value.center)), X(() => o.setZoom(oe.value.zoom))), ae.value = "", Me(A, z);
33635
- }
33636
33633
  function Me(A, z) {
33637
- if (I.value = z, ae.value = "", A === "self-catering") {
33638
- D.value = !0, Ve(), b.value = /* @__PURE__ */ new Set(), b.value.add(A);
33634
+ oe.value && (X(() => o.setCenter(oe.value.center)), X(() => o.setZoom(oe.value.zoom))), ae.value = "", Be(A, z);
33635
+ }
33636
+ function Be(A, z) {
33637
+ if (I.value = z, ae.value = "", A === "self-catering" && !b.value.has("self-catering")) {
33638
+ D.value = !0, Se(), b.value = /* @__PURE__ */ new Set(), b.value.add(A);
33639
33639
  const q = _e(b.value, A).value;
33640
- E.value = q, ye(), p.value = `${E.value} ${ae.value}`, Ce(), p.value = q;
33641
- } else b.value.has(A) ? (b.value.delete(A), N.value = /* @__PURE__ */ new Set(), C.value = /* @__PURE__ */ new Set(), b.value.forEach((q) => {
33640
+ E.value = q, p.value = `${E.value} ${ae.value}`, ke(), p.value = q;
33641
+ } else b.value.has(A) ? (b.value.delete("self-catering"), b.value.delete(A), N.value = /* @__PURE__ */ new Set(), C.value = /* @__PURE__ */ new Set(), b.value.forEach((q) => {
33642
33642
  $e(q, {
33643
33643
  includeTypes: !0,
33644
33644
  excludeTypes: !0
@@ -33648,7 +33648,7 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33648
33648
  ), b.value.size === 0 ? (L.value = /* @__PURE__ */ new Set(), me(_.value, F.value)) : (ve({
33649
33649
  includedTypes: Array.from(N.value).flat(),
33650
33650
  excludedTypes: Array.from(C.value).flat()
33651
- }), E.value = Array.from(L.value).join(", "), p.value = E.value)) : (b.value.add(A), $e(A, {
33651
+ }), E.value = Array.from(L.value).join(", "), p.value = E.value)) : (b.value.delete("self-catering"), b.value.add(A), $e(A, {
33652
33652
  includeTypes: !0,
33653
33653
  excludeTypes: !0
33654
33654
  }), xe(), ve({
@@ -33662,7 +33662,7 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33662
33662
  includedTypes: A = [],
33663
33663
  excludedTypes: z = []
33664
33664
  } = {}) {
33665
- pe(), Ve(), ee += 1;
33665
+ pe(), Se(), ee += 1;
33666
33666
  const q = ee;
33667
33667
  O.filterUsesCount += 1, $.value = "nearby";
33668
33668
  const j = o.getBounds(), W = j.getNorthEast(), G = j.getSouthWest(), J = google.maps.geometry.spherical.computeDistanceBetween(W, G), ne = Math.min(J / 2, 25e3);
@@ -33671,12 +33671,12 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33671
33671
  radius: ne
33672
33672
  }, l.style.display = "block", l.addEventListener("gmp-load", () => {
33673
33673
  if (q !== ee) return;
33674
- Be(q);
33675
- let ie = "main", Te = _.value;
33676
- b.value.size && (ie = "sub", Te = Array.from(b.value).join(", ")), n.createDataLayerObject("googleMapFilterEvent", {
33674
+ Ne(q);
33675
+ let ie = "main", Le = _.value;
33676
+ b.value.size && (ie = "sub", Le = Array.from(b.value).join(", ")), n.createDataLayerObject("googleMapFilterEvent", {
33677
33677
  filter_type: ie,
33678
33678
  search_map_location: o.getCenter().toString(),
33679
- filter_selection: Te,
33679
+ filter_selection: Le,
33680
33680
  results_count: l.places.length,
33681
33681
  filter_usage_index: O.filterUsesCount
33682
33682
  }), we("map_filter");
@@ -33684,13 +33684,13 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33684
33684
  once: !0
33685
33685
  });
33686
33686
  }
33687
- async function Ce() {
33688
- pe(), ye(), ee += 1;
33687
+ async function ke() {
33688
+ pe(), Ve(), ee += 1;
33689
33689
  const A = ee;
33690
- O.searchesCount += 1, $.value = "text", E.value = p.value.trim(), E.value && (D.value ? (d.locationBias = null, d.locationRestriction = o.getBounds()) : (d.locationRestriction = null, d.locationBias = o.getCenter()), d.includedType = R.value.some(
33690
+ O.searchesCount += 1, $.value = "text", E.value = p.value.trim(), E.value && (D.value ? (d.locationBias = null, d.locationRestriction = o.getBounds(), _.value = "accommodation", b.value.add("self-catering")) : (d.locationRestriction = null, d.locationBias = o.getCenter()), d.includedType = R.value.some(
33691
33691
  (z) => E.value.toLowerCase().includes(z)
33692
33692
  ) ? "lodging" : null, d.textQuery = `${E.value} in Scotland`, d.maxResultCount = NUMBER_OF_RESULTS, c.style.display = "block", c.addEventListener("gmp-load", () => {
33693
- A === ee && (Be(A), D.value = !1, n.createDataLayerObject("googleMapSearchEvent", {
33693
+ A === ee && (Ne(A), D.value = !1, n.createDataLayerObject("googleMapSearchEvent", {
33694
33694
  search_query: E.value,
33695
33695
  search_map_location: o.getCenter().toString(),
33696
33696
  search_results_count: c.places.length,
@@ -33700,7 +33700,7 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33700
33700
  once: !0
33701
33701
  }), O.showDestinations = !1, O.showCategories = !0);
33702
33702
  }
33703
- async function Be(A) {
33703
+ async function Ne(A) {
33704
33704
  const { AdvancedMarkerElement: z } = await importLibrary("marker"), { LatLngBounds: q } = await importLibrary("core");
33705
33705
  if (A !== ee) return;
33706
33706
  const j = ref();
@@ -33718,9 +33718,9 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33718
33718
  title: "Map pin"
33719
33719
  });
33720
33720
  ie.addEventListener("gmp-placeclick", () => {
33721
- be(G);
33721
+ ye(G);
33722
33722
  }), ie.addListener("click", () => {
33723
- be(G);
33723
+ ye(G);
33724
33724
  }), ie.metadata = {
33725
33725
  id: G.id
33726
33726
  }, v[G.id] = ie, W.extend(G.location), j.value.places.length === 1 ? (X(() => o.setCenter(
@@ -33731,9 +33731,9 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33731
33731
  )), X(() => o.setZoom(14)), X(() => o.fitBounds(G.viewport))) : (X(() => o.setCenter(W.getCenter())), X(() => o.fitBounds(W)));
33732
33732
  }), oe.value = le(o));
33733
33733
  }
33734
- async function Se() {
33734
+ async function Ce() {
33735
33735
  const { AdvancedMarkerElement: A } = await importLibrary("marker");
33736
- Ne(), r.value.forEach((z) => {
33736
+ Ee(), r.value.forEach((z) => {
33737
33737
  const q = document.createElement("div");
33738
33738
  q.classList.add("vs-map-marker");
33739
33739
  const j = document.createElement("i");
@@ -33747,24 +33747,24 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33747
33747
  content: q,
33748
33748
  title: z.properties.title
33749
33749
  });
33750
- W.addListener("gmp-click", () => Ee(z)), v[z.properties.title] = W;
33750
+ W.addListener("gmp-click", () => Te(z)), v[z.properties.title] = W;
33751
33751
  });
33752
33752
  }
33753
33753
  function pe(A, z) {
33754
- O.showCategories = !1, Ne(), $.value = "", u.includedTypes = null, u.excludedTypes = null, u.locationRestriction = null, l.style.display = "none", d.includedType = null, d.locationRestriction = null, d.locationBias = null, d.textQuery = null, c.style.display = "none", M.value = !1, g && g.close && g.close(), H.value = void 0, A && (Ve(), ye(), he("clear_all"), Se(), O.showDestinations = !0), z && (X(() => o.setCenter(t.center)), X(() => o.setZoom(t.zoom)), X(() => o.fitBounds(te)), he("reset_map"));
33754
+ O.showCategories = !1, Ee(), $.value = "", u.includedTypes = null, u.excludedTypes = null, u.locationRestriction = null, l.style.display = "none", d.includedType = null, d.locationRestriction = null, d.locationBias = null, d.textQuery = null, c.style.display = "none", M.value = !1, g && g.close && g.close(), H.value = void 0, A && (Se(), Ve(), he("clear_all"), Ce(), O.showDestinations = !0), z && (X(() => o.setCenter(t.center)), X(() => o.setZoom(t.zoom)), X(() => o.fitBounds(te)), he("reset_map"));
33755
33755
  }
33756
- function Ve() {
33756
+ function Se() {
33757
33757
  E.value = null, p.value = "";
33758
33758
  }
33759
- function ye() {
33759
+ function Ve() {
33760
33760
  _.value = void 0, b.value = /* @__PURE__ */ new Set(), V.value = /* @__PURE__ */ new Set(), T.value = /* @__PURE__ */ new Set(), N.value = /* @__PURE__ */ new Set(), C.value = /* @__PURE__ */ new Set(), L.value = /* @__PURE__ */ new Set(), F.value = void 0, I.value = void 0;
33761
33761
  }
33762
- function Ne() {
33762
+ function Ee() {
33763
33763
  for (const A in v)
33764
33764
  v[A] && (v[A].map = null);
33765
33765
  v = {};
33766
33766
  }
33767
- function be(A) {
33767
+ function ye(A) {
33768
33768
  g.isOpen && (g.close(), he("card_close", m.place)), m.place = A, window.innerWidth <= 768 ? (f.style.width = "85vw", f.style.height = "32em", O.sidebarOpen = !1) : (f.style.width = "20em", f.style.height = "32em"), f.style.display = "block", f.style.overflowY = "auto", f.style.overflowX = "hidden", f.style.boxSizing = "border-box", f.style.maxHeight = "32em", g.setOptions({
33769
33769
  content: f,
33770
33770
  maxWidth: "25em",
@@ -33818,7 +33818,7 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33818
33818
  return z;
33819
33819
  }
33820
33820
  const ae = ref("");
33821
- function Ee(A) {
33821
+ function Te(A) {
33822
33822
  O.showDestinations = !1, ae.value = A.properties.title, X(() => o.fitBounds(
33823
33823
  // eslint-disable-next-line no-undef
33824
33824
  new google.maps.LatLngBounds(
@@ -33843,16 +33843,20 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33843
33843
  }
33844
33844
  function Pe() {
33845
33845
  if (O.showDestinations = !1, O.sidebarOpen = !0, ae.value = "", fe.value = !1, b.value.size > 0) {
33846
- ve({
33847
- includedTypes: Array.from(N.value),
33848
- excludedTypes: Array.from(C.value)
33849
- });
33850
- const A = [];
33851
- b.value.forEach((z) => {
33852
- A.push(
33853
- _e(b.value, z).value
33854
- );
33855
- }), E.value = A.join(", "), p.value = E.value, O.showCategories = !0;
33846
+ if (b.value.has("self-catering"))
33847
+ b.value.delete("self-catering"), Be("self-catering", 0);
33848
+ else {
33849
+ ve({
33850
+ includedTypes: Array.from(N.value),
33851
+ excludedTypes: Array.from(C.value)
33852
+ });
33853
+ const A = [];
33854
+ b.value.forEach((z) => {
33855
+ A.push(
33856
+ _e(b.value, z).value
33857
+ );
33858
+ }), E.value = A.join(", "), p.value = E.value, O.showCategories = !0;
33859
+ }
33856
33860
  return;
33857
33861
  }
33858
33862
  if (_.value) {
@@ -33860,7 +33864,7 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33860
33864
  return;
33861
33865
  }
33862
33866
  if (p.value) {
33863
- Ce();
33867
+ ke();
33864
33868
  return;
33865
33869
  }
33866
33870
  me("things-to-do", 2);
@@ -33877,11 +33881,11 @@ const _hoisted_1 = { class: "vs-map" }, _hoisted_2 = { class: "vs-map__controls"
33877
33881
  "selected-category": _.value,
33878
33882
  "selected-subcategories": b.value,
33879
33883
  "sidebar-labels": de,
33880
- onCategorySelected: z[1] || (z[1] = (q) => Le(q.id, q.key)),
33884
+ onCategorySelected: z[1] || (z[1] = (q) => De(q.id, q.key)),
33881
33885
  onResetMap: z[2] || (z[2] = (q) => pe(!0)),
33882
33886
  onResetLocation: z[3] || (z[3] = (q) => pe(!0, !0)),
33883
- onSearchInputChanged: Ce,
33884
- onSubcategorySelected: z[4] || (z[4] = (q) => De(q.id, q.key))
33887
+ onSearchInputChanged: ke,
33888
+ onSubcategorySelected: z[4] || (z[4] = (q) => Me(q.id, q.key))
33885
33889
  }, {
33886
33890
  "vs-map-sidebar-search-results": withCtx(() => [
33887
33891
  H.value || t.alertText && H.value === !1 ? (openBlock(), createElementBlock("div", _hoisted_3, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visitscotland/component-library",
3
- "version": "5.57.4",
3
+ "version": "5.58.1",
4
4
  "description": "VisitScotland Component Library",
5
5
  "author": "VisitScotland",
6
6
  "homepage": "https://github.com/visitscotland/vs-component-library#readme",