@wix/bookings 1.0.1755 → 1.0.1756

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.
Files changed (71) hide show
  1. package/_sdk-exports/context-booking-checkout/runtime.d.ts +42 -1
  2. package/_sdk-exports/context-booking-checkout/runtime.js +3 -2
  3. package/_sdk-exports/context-categories/runtime.d.ts +1 -1
  4. package/_sdk-exports/context-categories/runtime.js +2 -1
  5. package/_sdk-exports/context-locations/runtime.d.ts +1 -1
  6. package/_sdk-exports/context-locations/runtime.js +2 -1
  7. package/_sdk-exports/context-service/runtime.d.ts +42 -1
  8. package/_sdk-exports/context-service/runtime.js +3 -2
  9. package/_sdk-exports/context-service-addons/runtime.d.ts +1 -1
  10. package/_sdk-exports/context-service-addons/runtime.js +2 -1
  11. package/_sdk-exports/context-services/runtime.d.ts +42 -1
  12. package/_sdk-exports/context-services/runtime.js +3 -2
  13. package/_sdk-exports/context-time-slots/runtime.d.ts +22 -9
  14. package/_sdk-exports/context-time-slots/runtime.js +3 -2
  15. package/build/cjs/context-booking-checkout.d.ts +42 -1
  16. package/build/cjs/context-booking-checkout.js +1346 -1344
  17. package/build/cjs/context-booking-checkout.js.map +1 -1
  18. package/build/cjs/context-categories.d.ts +1 -1
  19. package/build/cjs/context-categories.js +116 -114
  20. package/build/cjs/context-categories.js.map +1 -1
  21. package/build/cjs/context-locations.d.ts +1 -1
  22. package/build/cjs/context-locations.js +126 -124
  23. package/build/cjs/context-locations.js.map +1 -1
  24. package/build/cjs/context-service-addons.d.ts +1 -1
  25. package/build/cjs/context-service-addons.js +323 -321
  26. package/build/cjs/context-service-addons.js.map +1 -1
  27. package/build/cjs/context-service.d.ts +42 -1
  28. package/build/cjs/context-service.js +1517 -1515
  29. package/build/cjs/context-service.js.map +1 -1
  30. package/build/cjs/context-services.d.ts +42 -1
  31. package/build/cjs/context-services.js +460 -458
  32. package/build/cjs/context-services.js.map +1 -1
  33. package/build/cjs/context-time-slots.d.ts +22 -9
  34. package/build/cjs/context-time-slots.js +1033 -1000
  35. package/build/cjs/context-time-slots.js.map +1 -1
  36. package/build/es/context-booking-checkout.d.mts +42 -1
  37. package/build/es/context-booking-checkout.mjs +1346 -1344
  38. package/build/es/context-booking-checkout.mjs.map +1 -1
  39. package/build/es/context-categories.d.mts +1 -1
  40. package/build/es/context-categories.mjs +116 -114
  41. package/build/es/context-categories.mjs.map +1 -1
  42. package/build/es/context-locations.d.mts +1 -1
  43. package/build/es/context-locations.mjs +126 -124
  44. package/build/es/context-locations.mjs.map +1 -1
  45. package/build/es/context-service-addons.d.mts +1 -1
  46. package/build/es/context-service-addons.mjs +323 -321
  47. package/build/es/context-service-addons.mjs.map +1 -1
  48. package/build/es/context-service.d.mts +42 -1
  49. package/build/es/context-service.mjs +1517 -1515
  50. package/build/es/context-service.mjs.map +1 -1
  51. package/build/es/context-services.d.mts +42 -1
  52. package/build/es/context-services.mjs +460 -458
  53. package/build/es/context-services.mjs.map +1 -1
  54. package/build/es/context-time-slots.d.mts +22 -9
  55. package/build/es/context-time-slots.mjs +1033 -1000
  56. package/build/es/context-time-slots.mjs.map +1 -1
  57. package/build/internal/cjs/context-booking-checkout.d.ts +42 -1
  58. package/build/internal/cjs/context-categories.d.ts +1 -1
  59. package/build/internal/cjs/context-locations.d.ts +1 -1
  60. package/build/internal/cjs/context-service-addons.d.ts +1 -1
  61. package/build/internal/cjs/context-service.d.ts +42 -1
  62. package/build/internal/cjs/context-services.d.ts +42 -1
  63. package/build/internal/cjs/context-time-slots.d.ts +22 -9
  64. package/build/internal/es/context-booking-checkout.d.mts +42 -1
  65. package/build/internal/es/context-categories.d.mts +1 -1
  66. package/build/internal/es/context-locations.d.mts +1 -1
  67. package/build/internal/es/context-service-addons.d.mts +1 -1
  68. package/build/internal/es/context-service.d.mts +42 -1
  69. package/build/internal/es/context-services.d.mts +42 -1
  70. package/build/internal/es/context-time-slots.d.mts +22 -9
  71. package/package.json +2 -2
@@ -773,15 +773,16 @@ function Zt() {
773
773
  e2 = n2, t2 = r2;
774
774
  }), resolve: e2, reject: t2 };
775
775
  }
776
- var z = (e2) => typeof window < `u` ? window.commonConfig?.[e2] : void 0;
777
- var Qt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
778
- let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = en();
776
+ var Qt = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
777
+ var z = (e2) => Qt()?.[e2];
778
+ var $t = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
779
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = tn();
779
780
  return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: z(`language`), locale: z(`locale`), get passThroughHeaders() {
780
781
  return Xt();
781
782
  } } };
782
783
  }, auth: (e3) => {
783
784
  let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
784
- !e3 && $t() && (e3 = t2?.getAccessTokenFunction?.());
785
+ !e3 && en() && (e3 = t2?.getAccessTokenFunction?.());
785
786
  let n2 = false, { resolve: r2, promise: i2 } = Zt();
786
787
  return { getAuthHeaders: async () => {
787
788
  if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
@@ -790,33 +791,34 @@ var Qt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host:
790
791
  r2(e4);
791
792
  }) };
792
793
  } });
793
- function $t() {
794
+ function en() {
794
795
  return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
795
796
  }
796
- function en() {
797
+ function tn() {
797
798
  let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
798
799
  if (!e2) return;
799
800
  let t2 = new URL(e2);
800
801
  return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
801
802
  }
802
- var tn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
803
+ var nn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
803
804
  if (!e2) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
804
805
  return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
805
806
  }, getAccessToken: () => {
806
807
  throw Error(`Not implemented`);
807
808
  }, observeState: () => ({ disconnect: () => {
808
809
  } }) });
809
- var B = Qt({ createHost: function(e2) {
810
+ var B = $t({ createHost: function(e2) {
810
811
  let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
811
812
  if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
812
- return { channel: tn({ clientSdk: t2, applicationId: n2 }), close: () => {
813
+ return { channel: nn({ clientSdk: t2, applicationId: n2 }), close: () => {
813
814
  } };
814
815
  } });
815
- var nn = ((e2, t2) => {
816
+ var rn = (e2, t2) => {
816
817
  let n2 = B.host({ applicationId: e2, componentId: t2 }), r2 = B.auth();
817
818
  return Ve({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
818
- })(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`);
819
- function rn() {
819
+ };
820
+ var an = (e2) => rn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e2);
821
+ function on() {
820
822
  let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
821
823
  if (e2) return { initWixModules(t3, n3) {
822
824
  return V(() => e2(t3, n3));
@@ -853,17 +855,17 @@ function V(e2) {
853
855
  globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
854
856
  }
855
857
  }
856
- function an(e2, t2) {
858
+ function sn(e2, t2) {
857
859
  return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
858
- let r2 = rn();
860
+ let r2 = on();
859
861
  if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
860
862
  return r2.initWixModules(e2)[t3].apply(void 0, n2);
861
863
  }])) };
862
864
  }
863
- function on(e2) {
864
- return an({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
865
+ function cn(e2) {
866
+ return sn({ __type: `host`, create: (t2) => Object.entries(e2).reduce((e3, [n2, r2]) => ({ ...e3, [n2]: r2(t2) }), {}) }, Object.keys(e2));
865
867
  }
866
- var sn = class {
868
+ var ln = class {
867
869
  constructor(e2) {
868
870
  this.message = e2, this.captureException = () => {
869
871
  console.error(this.message);
@@ -878,12 +880,12 @@ var sn = class {
878
880
  };
879
881
  }
880
882
  };
881
- var cn = (e2) => new sn(e2);
882
- var ln = on({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : cn(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
883
+ var un = (e2) => new ln(e2);
884
+ var dn = cn({ getMonitoringClient: (e2) => () => e2.getMonitoringClient ? e2.getMonitoringClient() : un(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
883
885
  var H = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule` };
884
886
  function U(e2) {
885
887
  try {
886
- let t2 = ln.getMonitoringClient?.();
888
+ let t2 = dn.getMonitoringClient?.();
887
889
  return t2 && typeof t2[e2] == `function` ? t2 : null;
888
890
  } catch {
889
891
  return null;
@@ -895,13 +897,13 @@ function W(e2, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
895
897
  let o2 = e2 instanceof Error ? e2 : Error(String(e2));
896
898
  a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
897
899
  }
898
- function un(e2, { feature: t2, tags: n2 }, r2) {
900
+ function fn(e2, { feature: t2, tags: n2 }, r2) {
899
901
  let i2 = U(`startSpanManual`);
900
902
  if (!i2) return r2;
901
903
  let a2 = i2.startSpanManual({ name: e2, tags: { feature: t2, ...n2 } });
902
904
  return r2.then(() => a2.end(), (e3) => a2.fail(e3)), r2;
903
905
  }
904
- var dn = class extends e {
906
+ var pn = class extends e {
905
907
  state = { hasError: false };
906
908
  static getDerivedStateFromError() {
907
909
  return { hasError: true };
@@ -913,7 +915,7 @@ var dn = class extends e {
913
915
  return this.state.hasError ? this.props.fallback : this.props.children;
914
916
  }
915
917
  };
916
- function fn(e2) {
918
+ function mn(e2) {
917
919
  let t2 = e2;
918
920
  if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e3) => {
919
921
  t2.__state = { status: `fulfilled`, value: e3 };
@@ -926,10 +928,10 @@ function G(e2) {
926
928
  let t2 = Promise.resolve(e2);
927
929
  return t2.__state = { status: `fulfilled`, value: e2 }, t2;
928
930
  }
929
- var pn = /* @__PURE__ */ new WeakMap();
930
- function mn(e2, t2, n2) {
931
- let r2 = pn.get(e2);
932
- r2 || (r2 = /* @__PURE__ */ new WeakMap(), pn.set(e2, r2));
931
+ var hn = /* @__PURE__ */ new WeakMap();
932
+ function gn(e2, t2, n2) {
933
+ let r2 = hn.get(e2);
934
+ r2 || (r2 = /* @__PURE__ */ new WeakMap(), hn.set(e2, r2));
933
935
  let i2 = r2.get(t2);
934
936
  i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
935
937
  let a2 = i2.get(n2);
@@ -942,17 +944,17 @@ function mn(e2, t2, n2) {
942
944
  function K(e2) {
943
945
  return e2;
944
946
  }
945
- var hn = K(`@wix/site-service-url`);
946
- var gn = `appSectionParams`;
947
- function _n(e2) {
948
- let t2 = e2.searchParams.get(gn);
947
+ var _n = K(`@wix/site-service-url`);
948
+ var vn = `appSectionParams`;
949
+ function yn(e2) {
950
+ let t2 = e2.searchParams.get(vn);
949
951
  if (t2 === null) return e2;
950
952
  let n2 = new URL(e2);
951
- n2.searchParams.delete(gn);
952
- for (let [e3, r2] of Object.entries(vn(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
953
+ n2.searchParams.delete(vn);
954
+ for (let [e3, r2] of Object.entries(bn(t2))) typeof r2 == `string` && !n2.searchParams.has(e3) && n2.searchParams.set(e3, r2);
953
955
  return n2;
954
956
  }
955
- function vn(e2) {
957
+ function bn(e2) {
956
958
  try {
957
959
  let t2 = JSON.parse(e2);
958
960
  return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
@@ -961,15 +963,15 @@ function vn(e2) {
961
963
  }
962
964
  }
963
965
  var q = `bookings-uou:url-change`;
964
- var yn = (e2) => {
966
+ var xn = (e2) => {
965
967
  let t2 = new URL(e2);
966
968
  return t2.searchParams.sort(), t2.href;
967
969
  };
968
- function bn(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
970
+ function Sn(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
969
971
  let r2 = globalThis.window;
970
972
  if (!r2?.history) return;
971
973
  let i2 = new URL(r2.location.href);
972
- if (yn(i2) === yn(e2)) return;
974
+ if (xn(i2) === xn(e2)) return;
973
975
  let a2 = { scrollY: r2.scrollY };
974
976
  if (n2) r2.history.replaceState(a2, ``, e2.href);
975
977
  else {
@@ -982,46 +984,46 @@ function bn(e2, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
982
984
  }
983
985
  r2.dispatchEvent(new Event(q));
984
986
  }
985
- function xn(e2) {
987
+ function Cn(e2) {
986
988
  let t2 = globalThis.window;
987
989
  return t2 ? (t2.addEventListener(q, e2), t2.addEventListener(`popstate`, e2), () => {
988
990
  t2.removeEventListener(q, e2), t2.removeEventListener(`popstate`, e2);
989
991
  }) : () => {
990
992
  };
991
993
  }
992
- var Sn = (e2) => {
994
+ var wn = (e2) => {
993
995
  try {
994
996
  return decodeURIComponent(e2);
995
997
  } catch {
996
998
  return e2;
997
999
  }
998
1000
  };
999
- function Cn(e2, t2) {
1001
+ function Tn(e2, t2) {
1000
1002
  let n2 = t2 ? new URL(t2).pathname : `/`;
1001
- return `./${Sn(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
1003
+ return `./${wn(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
1002
1004
  }
1003
1005
  function J() {
1004
- let e2 = d(hn), t2 = r(() => e2.currentUrl, [e2]), n2 = l(xn, t2, t2), i2 = o(() => _n(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
1005
- return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => _n(new URL(e2.currentUrl)), getRelativeUrl: () => Cn(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: bn };
1006
+ let e2 = d(_n), t2 = r(() => e2.currentUrl, [e2]), n2 = l(Cn, t2, t2), i2 = o(() => yn(new URL(n2)), [n2]), a2 = e2.siteUrl.replace(/\/$/, ``);
1007
+ return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => yn(new URL(e2.currentUrl)), getRelativeUrl: () => Tn(e2.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: Sn };
1006
1008
  }
1007
1009
  var Y = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
1008
- var wn = K(`@wix/site-service-warmup-data`);
1009
- function Tn() {
1010
+ var En = K(`@wix/site-service-warmup-data`);
1011
+ function Dn() {
1010
1012
  try {
1011
1013
  return u();
1012
1014
  } catch {
1013
1015
  return null;
1014
1016
  }
1015
1017
  }
1016
- function En(e2) {
1018
+ function On(e2) {
1017
1019
  try {
1018
- return e2 ? e2(wn) : null;
1020
+ return e2 ? e2(En) : null;
1019
1021
  } catch {
1020
1022
  return null;
1021
1023
  }
1022
1024
  }
1023
- function Dn() {
1024
- let e2 = En(Tn()), t2 = typeof window > `u`;
1025
+ function kn() {
1026
+ let e2 = On(Dn()), t2 = typeof window > `u`;
1025
1027
  return { scope: e2 ?? void 0, get: async (n2) => {
1026
1028
  if (t2 || !e2) return null;
1027
1029
  try {
@@ -1036,54 +1038,54 @@ function Dn() {
1036
1038
  }
1037
1039
  } };
1038
1040
  }
1039
- var On = `bookings-uou`;
1040
- function kn() {
1041
- return `${On}:locations:all`;
1041
+ var An = `bookings-uou`;
1042
+ function jn() {
1043
+ return `${An}:locations:all`;
1042
1044
  }
1043
- var An = 5e3;
1044
- var jn = 100;
1045
- var Mn = `wix-warmup-data`;
1045
+ var Mn = 5e3;
1046
+ var Nn = 100;
1047
+ var Pn = `wix-warmup-data`;
1046
1048
  var X = null;
1047
- function Nn(e2) {
1049
+ function Fn(e2) {
1048
1050
  if (typeof document < `u`) try {
1049
- let t2 = document.getElementById(Mn)?.textContent;
1051
+ let t2 = document.getElementById(Pn)?.textContent;
1050
1052
  return t2 ? (X?.text !== t2 && (X = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), X.data[e2] ?? void 0) : void 0;
1051
1053
  } catch {
1052
1054
  return;
1053
1055
  }
1054
1056
  }
1055
- var Pn = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
1056
- var Fn = Pn();
1057
- var In = /* @__PURE__ */ new WeakMap();
1058
- var Ln = /* @__PURE__ */ new WeakMap();
1059
- function Rn(e2) {
1060
- if (!e2) return Fn;
1061
- let t2 = In.get(e2);
1062
- return t2 || (t2 = Pn(), In.set(e2, t2)), t2;
1057
+ var In = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
1058
+ var Ln = In();
1059
+ var Rn = /* @__PURE__ */ new WeakMap();
1060
+ var zn = /* @__PURE__ */ new WeakMap();
1061
+ function Bn(e2) {
1062
+ if (!e2) return Ln;
1063
+ let t2 = Rn.get(e2);
1064
+ return t2 || (t2 = In(), Rn.set(e2, t2)), t2;
1063
1065
  }
1064
- function zn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
1066
+ function Vn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
1065
1067
  if (e2 === null) return n2();
1066
1068
  if (typeof window > `u`) {
1067
1069
  let r3 = () => n2().then((n3) => (t2.set(e2, n3), n3)), { scope: i3 } = t2;
1068
1070
  if (!i3) return r3();
1069
- let a3 = Ln.get(i3);
1070
- a3 || (a3 = /* @__PURE__ */ new Map(), Ln.set(i3, a3));
1071
+ let a3 = zn.get(i3);
1072
+ a3 || (a3 = /* @__PURE__ */ new Map(), zn.set(i3, a3));
1071
1073
  let o3 = a3.get(e2);
1072
1074
  if (o3) return o3;
1073
1075
  let s3 = r3();
1074
1076
  return a3.set(e2, s3), s3.catch(() => a3.delete(e2)), s3;
1075
1077
  }
1076
- let i2 = Rn(t2.scope), a2 = Date.now();
1078
+ let i2 = Bn(t2.scope), a2 = Date.now();
1077
1079
  for (let [e3, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e3);
1078
1080
  let o2 = i2.promises.get(e2);
1079
1081
  if (o2 && !r2) return o2.promise;
1080
1082
  r2 && i2.invalidatedWarmup.add(e2);
1081
1083
  let s2 = !i2.invalidatedWarmup.has(e2);
1082
1084
  if (s2) {
1083
- let t3 = Nn(e2);
1085
+ let t3 = Fn(e2);
1084
1086
  if (t3 !== void 0) {
1085
1087
  let n3 = G(t3);
1086
- return i2.promises.set(e2, { promise: n3, expiresAt: a2 + An }), n3;
1088
+ return i2.promises.set(e2, { promise: n3, expiresAt: a2 + Mn }), n3;
1087
1089
  }
1088
1090
  }
1089
1091
  let c2 = (async () => {
@@ -1093,43 +1095,43 @@ function zn({ key: e2, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
1093
1095
  }
1094
1096
  return n2();
1095
1097
  })();
1096
- i2.promises.size >= jn && i2.promises.delete(i2.promises.keys().next().value);
1098
+ i2.promises.size >= Nn && i2.promises.delete(i2.promises.keys().next().value);
1097
1099
  let l2 = { promise: c2, expiresAt: 1 / 0 };
1098
1100
  return i2.promises.set(e2, l2), c2.then(() => {
1099
- l2.expiresAt = Date.now() + An;
1101
+ l2.expiresAt = Date.now() + Mn;
1100
1102
  }, () => {
1101
1103
  i2.promises.get(e2) === l2 && i2.promises.delete(e2);
1102
1104
  }), c2;
1103
1105
  }
1104
- var Bn = [{ path: `businessLocations.locations.business.address.geocode.latitude` }, { path: `businessLocations.locations.business.address.geocode.longitude` }, { path: `businessLocations.locations.custom.address.geocode.latitude` }, { path: `businessLocations.locations.custom.address.geocode.longitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.latitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.longitude` }];
1105
- function Vn(e2) {
1106
+ var Hn = [{ path: `businessLocations.locations.business.address.geocode.latitude` }, { path: `businessLocations.locations.business.address.geocode.longitude` }, { path: `businessLocations.locations.custom.address.geocode.latitude` }, { path: `businessLocations.locations.custom.address.geocode.longitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.latitude` }, { path: `businessLocations.locations.calculatedAddress.geocode.longitude` }];
1107
+ function Un(e2) {
1106
1108
  return St(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
1107
1109
  }
1108
- var Hn = `@wix/auto_sdk_bookings_services`;
1109
- function Un(e2) {
1110
+ var Wn = `@wix/auto_sdk_bookings_services`;
1111
+ function Gn(e2) {
1110
1112
  function t2({ host: t3 }) {
1111
- return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryLocations`, packageName: Hn, migrationOptions: { optInTransformResponse: true }, url: Vn({ protoPath: `/v2/services/locations/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => rt(e3, [{ transformFn: Gt, paths: Bn }]) };
1113
+ return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryLocations`, packageName: Wn, migrationOptions: { optInTransformResponse: true }, url: Un({ protoPath: `/v2/services/locations/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => rt(e3, [{ transformFn: Gt, paths: Hn }]) };
1112
1114
  }
1113
1115
  return t2;
1114
1116
  }
1115
- var Wn = [{ path: `businessLocations.locations.calculatedAddress` }, { path: `businessLocations.locations.business.address` }, { path: `businessLocations.locations.custom.address` }];
1116
- async function Gn(e2) {
1117
- let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Un(qe({ filter: e2?.filter }));
1117
+ var Kn = [{ path: `businessLocations.locations.calculatedAddress` }, { path: `businessLocations.locations.business.address` }, { path: `businessLocations.locations.custom.address` }];
1118
+ async function qn(e2) {
1119
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Gn(qe({ filter: e2?.filter }));
1118
1120
  n2?.onSiteCall?.();
1119
1121
  try {
1120
1122
  let e3 = await t2.request(r2);
1121
- return n2?.onSuccess?.(e3), Je(rt(e3.data, [{ transformFn: Kt, paths: Wn }]));
1123
+ return n2?.onSuccess?.(e3), Je(rt(e3.data, [{ transformFn: Kt, paths: Kn }]));
1122
1124
  } catch (e3) {
1123
1125
  let t3 = pt(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter` }, singleArgumentUnchanged: false }, [`options`]);
1124
1126
  throw n2?.onError?.(e3), t3;
1125
1127
  }
1126
1128
  }
1127
- function Kn(e2) {
1128
- return (t2) => Gn(t2, { httpClient: e2 });
1129
+ function Jn(e2) {
1130
+ return (t2) => qn(t2, { httpClient: e2 });
1129
1131
  }
1130
- var qn = xt(Kn);
1131
- var Jn = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1132
- var Yn = function(e2) {
1132
+ var Yn = xt(Jn);
1133
+ var Xn = `13d21c63-b5ec-5912-8397-c3a5ddb27a97`;
1134
+ var Zn = function(e2) {
1133
1135
  return e2.BOOK_ONLINE = `bookingsBookOnline`, e2.SERVICE_PAGE = `bookingsServicePage`, e2.CALENDAR_PAGE = `bookingsCalendar`, e2.FORM_PAGE = `bookingsForm`, e2;
1134
1136
  }({});
1135
1137
  function Z(e2) {
@@ -1138,55 +1140,55 @@ function Z(e2) {
1138
1140
  function Q(e2) {
1139
1141
  return e2.business?.name ?? null;
1140
1142
  }
1141
- async function Xn() {
1142
- let e2 = await qn({ filter: { services: { appId: Jn, hidden: false } } });
1143
+ async function Qn() {
1144
+ let e2 = await Yn({ filter: { services: { appId: Xn, hidden: false } } });
1143
1145
  return { locations: [...e2.businessLocations?.locations ?? []].sort((e3, t2) => (Q(e3) ?? ``).localeCompare(Q(t2) ?? ``)), hasOtherLocations: !!(e2.customLocations?.exists || e2.customerLocations?.exists) };
1144
1146
  }
1145
- function Zn({ isLoading: e2, hasError: t2, refetch: n2, children: r2 }) {
1147
+ function $n({ isLoading: e2, hasError: t2, refetch: n2, children: r2 }) {
1146
1148
  let { searchParams: i2 } = J(), a2 = { locations: [], locationItems: [], selectedLocationId: i2.get(Y.location), selectedLocationIndex: -1, selectedLocation: null, selectedLocationName: null, hasOtherLocations: false, hasMultipleLocations: false, isLoading: e2, hasError: t2, refetch: n2, selectLocation: () => {
1147
1149
  } };
1148
1150
  return f($.Provider, { value: a2, children: r2 });
1149
1151
  }
1150
- function Qn({ refetch: e2, children: t2 }) {
1151
- return f(Zn, { isLoading: true, hasError: false, refetch: e2, children: t2 });
1152
+ function er({ refetch: e2, children: t2 }) {
1153
+ return f($n, { isLoading: true, hasError: false, refetch: e2, children: t2 });
1152
1154
  }
1153
- function $n({ refetch: e2, children: t2 }) {
1154
- return f(Zn, { isLoading: false, hasError: true, refetch: e2, children: t2 });
1155
+ function tr({ refetch: e2, children: t2 }) {
1156
+ return f($n, { isLoading: false, hasError: true, refetch: e2, children: t2 });
1155
1157
  }
1156
- var er = K(`@wix/site-service-business-logger`);
1157
- function tr(e2) {
1158
+ var nr = K(`@wix/site-service-business-logger`);
1159
+ function rr(e2) {
1158
1160
  return { evid: 32, src: 16, endpoint: ``, params: e2 };
1159
1161
  }
1160
- var nr = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
1161
- Yn.BOOK_ONLINE;
1162
- var rr = `new_bookings_server`;
1163
- var ir = (e2) => {
1164
- let { reportBi: t2 } = d(er);
1162
+ var ir = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
1163
+ Zn.BOOK_ONLINE;
1164
+ var ar = `new_bookings_server`;
1165
+ var or = (e2) => {
1166
+ let { reportBi: t2 } = d(nr);
1165
1167
  return r((n2) => {
1166
- t2({ widget_name: e2, bookingsPlatform: rr, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
1168
+ t2({ widget_name: e2, bookingsPlatform: ar, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
1167
1169
  }, [t2, e2]);
1168
1170
  };
1169
- var ar = (e2, t2 = true) => {
1170
- let n2 = ir(e2), { getParsedUrl: r2 } = J(), i2 = s(false);
1171
+ var sr = (e2, t2 = true) => {
1172
+ let n2 = or(e2), { getParsedUrl: r2 } = J(), i2 = s(false);
1171
1173
  a(() => {
1172
- t2 && !i2.current && (i2.current = true, n2(tr({ referralInfo: r2().searchParams.get(Y.referral) ?? void 0 })));
1174
+ t2 && !i2.current && (i2.current = true, n2(rr({ referralInfo: r2().searchParams.get(Y.referral) ?? void 0 })));
1173
1175
  }, [t2, n2, r2]);
1174
1176
  };
1175
1177
  var $ = n(null);
1176
- var or = `useLocationsContext must be used within LocationsContextProvider`;
1177
- function sr() {
1178
+ var cr = `useLocationsContext must be used within LocationsContextProvider`;
1179
+ function lr() {
1178
1180
  let e2 = i($);
1179
- if (!e2) throw Error(or);
1181
+ if (!e2) throw Error(cr);
1180
1182
  return e2;
1181
1183
  }
1182
- function cr(e2, t2) {
1184
+ function ur(e2, t2) {
1183
1185
  let n2 = Z(e2);
1184
1186
  return { locationId: n2, locationName: Q(e2), isSelected: n2 != null && n2 === t2 };
1185
1187
  }
1186
- var lr = (e2) => ({ ...e2, hasError: false });
1187
- var ur = () => ({ locations: [], hasOtherLocations: false, hasError: true });
1188
- function dr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children: i2 }) {
1189
- let { locations: c2, hasOtherLocations: l2, hasError: u2 } = fn(e2), { pathname: d2, searchParams: p2, pushUrl: m2, getExternalBaseUrl: h2 } = J(), g2 = p2.get(Y.location), _2 = r((e3) => {
1188
+ var dr = (e2) => ({ ...e2, hasError: false });
1189
+ var fr = () => ({ locations: [], hasOtherLocations: false, hasError: true });
1190
+ function pr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children: i2 }) {
1191
+ let { locations: c2, hasOtherLocations: l2, hasError: u2 } = mn(e2), { pathname: d2, searchParams: p2, pushUrl: m2, getExternalBaseUrl: h2 } = J(), g2 = p2.get(Y.location), _2 = r((e3) => {
1190
1192
  let t3 = new URLSearchParams(p2);
1191
1193
  e3 ? t3.set(Y.location, e3) : t3.delete(Y.location), t3.delete(Y.page);
1192
1194
  let n3 = t3.toString(), r2 = n3 ? `${d2}?${n3}` : d2;
@@ -1195,21 +1197,21 @@ function dr({ locationsPromise: e2, initialLocationId: t2, refetch: n2, children
1195
1197
  a(() => {
1196
1198
  v2.current || (v2.current = true, t2 && !p2.get(Y.location) && _2(t2));
1197
1199
  }, [t2, p2, _2]);
1198
- let y2 = c2.findIndex((e3) => Z(e3) === g2), b2 = c2.find((e3) => Z(e3) === g2) ?? null, x2 = c2.filter((e3) => Z(e3)).length + +!!l2, ee2 = o(() => ({ locations: c2, locationItems: c2.map((e3) => cr(e3, g2)), selectedLocationId: g2, selectedLocationIndex: y2, selectedLocation: b2, selectedLocationName: b2 ? Q(b2) : null, hasOtherLocations: l2, hasMultipleLocations: x2 > 1, isLoading: false, hasError: u2, refetch: n2, selectLocation: _2 }), [c2, g2, y2, b2, l2, u2, x2, n2, _2]);
1200
+ let y2 = c2.findIndex((e3) => Z(e3) === g2), b2 = c2.find((e3) => Z(e3) === g2) ?? null, x2 = c2.filter((e3) => Z(e3)).length + +!!l2, ee2 = o(() => ({ locations: c2, locationItems: c2.map((e3) => ur(e3, g2)), selectedLocationId: g2, selectedLocationIndex: y2, selectedLocation: b2, selectedLocationName: b2 ? Q(b2) : null, hasOtherLocations: l2, hasMultipleLocations: x2 > 1, isLoading: false, hasError: u2, refetch: n2, selectLocation: _2 }), [c2, g2, y2, b2, l2, u2, x2, n2, _2]);
1199
1201
  return f($.Provider, { value: ee2, children: i2 });
1200
1202
  }
1201
- function fr({ initialLocationId: e2, children: n2 }) {
1202
- ar(nr.LOCATIONS);
1203
- let i2 = Dn(), [a2, s2] = c(0), l2 = o(() => mn(zn({ key: kn(), refresh: a2 !== 0, warmupData: i2, fetchData: () => un(`locations-context-load`, { feature: H.locations }, Xn()) }), lr, ur), [a2]), u2 = r(() => s2((e3) => e3 + 1), []);
1204
- return f(dn, { fallback: f($n, { refetch: u2, children: n2 }), feature: H.locations, children: f(t, { fallback: f(Qn, { refetch: u2, children: n2 }), children: f(dr, { locationsPromise: l2, initialLocationId: e2, refetch: u2, children: n2 }) }) });
1203
+ function mr({ initialLocationId: e2, children: n2 }) {
1204
+ sr(ir.LOCATIONS);
1205
+ let i2 = kn(), [a2, s2] = c(0), l2 = o(() => gn(Vn({ key: jn(), refresh: a2 !== 0, warmupData: i2, fetchData: () => fn(`locations-context-load`, { feature: H.locations }, Qn()) }), dr, fr), [a2]), u2 = r(() => s2((e3) => e3 + 1), []);
1206
+ return f(pn, { fallback: f(tr, { refetch: u2, children: n2 }), feature: H.locations, children: f(t, { fallback: f(er, { refetch: u2, children: n2 }), children: f(pr, { locationsPromise: l2, initialLocationId: e2, refetch: u2, children: n2 }) }) });
1205
1207
  }
1206
- var pr = nn;
1208
+ var hr = an(`c151d9f7-1582-407c-bb59-59030f244b47`);
1207
1209
  export {
1208
- or as LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,
1209
- fr as LocationsContextProvider,
1210
- fr as default,
1211
- pr as injectAccessTokenGetter,
1210
+ cr as LOCATIONS_CONTEXT_MISSING_PROVIDER_ERROR,
1211
+ mr as LocationsContextProvider,
1212
+ mr as default,
1213
+ hr as injectAccessTokenGetter,
1212
1214
  $ as locationsContext,
1213
- sr as useLocationsContext
1215
+ lr as useLocationsContext
1214
1216
  };
1215
1217
  //# sourceMappingURL=context-locations.mjs.map