@wix/bookings 1.0.1755 → 1.0.1757
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_sdk-exports/context-booking-checkout/runtime.d.ts +42 -1
- package/_sdk-exports/context-booking-checkout/runtime.js +3 -2
- package/_sdk-exports/context-categories/runtime.d.ts +1 -1
- package/_sdk-exports/context-categories/runtime.js +2 -1
- package/_sdk-exports/context-locations/runtime.d.ts +1 -1
- package/_sdk-exports/context-locations/runtime.js +2 -1
- package/_sdk-exports/context-service/runtime.d.ts +42 -1
- package/_sdk-exports/context-service/runtime.js +3 -2
- package/_sdk-exports/context-service-addons/runtime.d.ts +1 -1
- package/_sdk-exports/context-service-addons/runtime.js +2 -1
- package/_sdk-exports/context-services/runtime.d.ts +42 -1
- package/_sdk-exports/context-services/runtime.js +3 -2
- package/_sdk-exports/context-time-slots/runtime.d.ts +22 -9
- package/_sdk-exports/context-time-slots/runtime.js +3 -2
- package/build/cjs/context-booking-checkout.d.ts +42 -1
- package/build/cjs/context-booking-checkout.js +1346 -1344
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.d.ts +1 -1
- package/build/cjs/context-categories.js +116 -114
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.d.ts +1 -1
- package/build/cjs/context-locations.js +126 -124
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.d.ts +1 -1
- package/build/cjs/context-service-addons.js +323 -321
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +42 -1
- package/build/cjs/context-service.js +1517 -1515
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.d.ts +42 -1
- package/build/cjs/context-services.js +460 -458
- package/build/cjs/context-services.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +22 -9
- package/build/cjs/context-time-slots.js +1033 -1000
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +42 -1
- package/build/es/context-booking-checkout.mjs +1346 -1344
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.d.mts +1 -1
- package/build/es/context-categories.mjs +116 -114
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.d.mts +1 -1
- package/build/es/context-locations.mjs +126 -124
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.d.mts +1 -1
- package/build/es/context-service-addons.mjs +323 -321
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +42 -1
- package/build/es/context-service.mjs +1517 -1515
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.d.mts +42 -1
- package/build/es/context-services.mjs +460 -458
- package/build/es/context-services.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +22 -9
- package/build/es/context-time-slots.mjs +1033 -1000
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +42 -1
- package/build/internal/cjs/context-categories.d.ts +1 -1
- package/build/internal/cjs/context-locations.d.ts +1 -1
- package/build/internal/cjs/context-service-addons.d.ts +1 -1
- package/build/internal/cjs/context-service.d.ts +42 -1
- package/build/internal/cjs/context-services.d.ts +42 -1
- package/build/internal/cjs/context-time-slots.d.ts +22 -9
- package/build/internal/es/context-booking-checkout.d.mts +42 -1
- package/build/internal/es/context-categories.d.mts +1 -1
- package/build/internal/es/context-locations.d.mts +1 -1
- package/build/internal/es/context-service-addons.d.mts +1 -1
- package/build/internal/es/context-service.d.mts +42 -1
- package/build/internal/es/context-services.d.mts +42 -1
- package/build/internal/es/context-time-slots.d.mts +22 -9
- 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
|
|
777
|
-
var
|
|
778
|
-
|
|
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 &&
|
|
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
|
|
794
|
+
function en() {
|
|
794
795
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
795
796
|
}
|
|
796
|
-
function
|
|
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
|
|
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 =
|
|
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:
|
|
813
|
+
return { channel: nn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
813
814
|
} };
|
|
814
815
|
} });
|
|
815
|
-
var
|
|
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
|
-
}
|
|
819
|
-
|
|
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
|
|
858
|
+
function sn(e2, t2) {
|
|
857
859
|
return { ...e2, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
858
|
-
let r2 =
|
|
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
|
|
864
|
-
return
|
|
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
|
|
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
|
|
882
|
-
var
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
930
|
-
function
|
|
931
|
-
let r2 =
|
|
932
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
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
|
|
946
|
-
var
|
|
947
|
-
function
|
|
948
|
-
let t2 = e2.searchParams.get(
|
|
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(
|
|
952
|
-
for (let [e3, r2] of Object.entries(
|
|
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
|
|
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
|
|
966
|
+
var xn = (e2) => {
|
|
965
967
|
let t2 = new URL(e2);
|
|
966
968
|
return t2.searchParams.sort(), t2.href;
|
|
967
969
|
};
|
|
968
|
-
function
|
|
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 (
|
|
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
|
|
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
|
|
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
|
|
1001
|
+
function Tn(e2, t2) {
|
|
1000
1002
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
1001
|
-
return `./${
|
|
1003
|
+
return `./${wn(new URL(e2).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
1002
1004
|
}
|
|
1003
1005
|
function J() {
|
|
1004
|
-
let e2 = d(
|
|
1005
|
-
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () =>
|
|
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
|
|
1009
|
-
function
|
|
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
|
|
1018
|
+
function On(e2) {
|
|
1017
1019
|
try {
|
|
1018
|
-
return e2 ? e2(
|
|
1020
|
+
return e2 ? e2(En) : null;
|
|
1019
1021
|
} catch {
|
|
1020
1022
|
return null;
|
|
1021
1023
|
}
|
|
1022
1024
|
}
|
|
1023
|
-
function
|
|
1024
|
-
let e2 =
|
|
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
|
|
1040
|
-
function
|
|
1041
|
-
return `${
|
|
1041
|
+
var An = `bookings-uou`;
|
|
1042
|
+
function jn() {
|
|
1043
|
+
return `${An}:locations:all`;
|
|
1042
1044
|
}
|
|
1043
|
-
var
|
|
1044
|
-
var
|
|
1045
|
-
var
|
|
1045
|
+
var Mn = 5e3;
|
|
1046
|
+
var Nn = 100;
|
|
1047
|
+
var Pn = `wix-warmup-data`;
|
|
1046
1048
|
var X = null;
|
|
1047
|
-
function
|
|
1049
|
+
function Fn(e2) {
|
|
1048
1050
|
if (typeof document < `u`) try {
|
|
1049
|
-
let t2 = document.getElementById(
|
|
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
|
|
1056
|
-
var
|
|
1057
|
-
var
|
|
1058
|
-
var
|
|
1059
|
-
function
|
|
1060
|
-
if (!e2) return
|
|
1061
|
-
let t2 =
|
|
1062
|
-
return 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
|
|
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 =
|
|
1070
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
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 =
|
|
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 =
|
|
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 +
|
|
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 >=
|
|
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() +
|
|
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
|
|
1105
|
-
function
|
|
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
|
|
1109
|
-
function
|
|
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:
|
|
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
|
|
1116
|
-
async function
|
|
1117
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
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:
|
|
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
|
|
1128
|
-
return (t2) =>
|
|
1129
|
+
function Jn(e2) {
|
|
1130
|
+
return (t2) => qn(t2, { httpClient: e2 });
|
|
1129
1131
|
}
|
|
1130
|
-
var
|
|
1131
|
-
var
|
|
1132
|
-
var
|
|
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
|
|
1142
|
-
let e2 = await
|
|
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
|
|
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
|
|
1151
|
-
return f(
|
|
1152
|
+
function er({ refetch: e2, children: t2 }) {
|
|
1153
|
+
return f($n, { isLoading: true, hasError: false, refetch: e2, children: t2 });
|
|
1152
1154
|
}
|
|
1153
|
-
function
|
|
1154
|
-
return f(
|
|
1155
|
+
function tr({ refetch: e2, children: t2 }) {
|
|
1156
|
+
return f($n, { isLoading: false, hasError: true, refetch: e2, children: t2 });
|
|
1155
1157
|
}
|
|
1156
|
-
var
|
|
1157
|
-
function
|
|
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
|
|
1161
|
-
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1164
|
-
let { reportBi: t2 } = d(
|
|
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:
|
|
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
|
|
1170
|
-
let n2 =
|
|
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(
|
|
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
|
|
1177
|
-
function
|
|
1178
|
+
var cr = `useLocationsContext must be used within LocationsContextProvider`;
|
|
1179
|
+
function lr() {
|
|
1178
1180
|
let e2 = i($);
|
|
1179
|
-
if (!e2) throw Error(
|
|
1181
|
+
if (!e2) throw Error(cr);
|
|
1180
1182
|
return e2;
|
|
1181
1183
|
}
|
|
1182
|
-
function
|
|
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
|
|
1187
|
-
var
|
|
1188
|
-
function
|
|
1189
|
-
let { locations: c2, hasOtherLocations: l2, hasError: u2 } =
|
|
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) =>
|
|
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
|
|
1202
|
-
|
|
1203
|
-
let i2 =
|
|
1204
|
-
return f(
|
|
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
|
|
1208
|
+
var hr = an(`c151d9f7-1582-407c-bb59-59030f244b47`);
|
|
1207
1209
|
export {
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
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
|
-
|
|
1215
|
+
lr as useLocationsContext
|
|
1214
1216
|
};
|
|
1215
1217
|
//# sourceMappingURL=context-locations.mjs.map
|