@wix/bookings 1.0.1785 → 1.0.1787
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/build/cjs/context-booking-checkout.d.ts +22 -6
- package/build/cjs/context-booking-checkout.js +2296 -2253
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.js +285 -275
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.js +465 -455
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.js +964 -917
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +14 -5
- package/build/cjs/context-service.js +3514 -3337
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.js +878 -832
- package/build/cjs/context-services.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +10 -0
- package/build/cjs/context-time-slots.js +1202 -1159
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +22 -6
- package/build/es/context-booking-checkout.mjs +2304 -2261
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.mjs +285 -275
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.mjs +465 -455
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.mjs +971 -924
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +14 -5
- package/build/es/context-service.mjs +3383 -3206
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.mjs +878 -832
- package/build/es/context-services.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +10 -0
- package/build/es/context-time-slots.mjs +1222 -1179
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +22 -6
- package/build/internal/cjs/context-service.d.ts +14 -5
- package/build/internal/cjs/context-time-slots.d.ts +10 -0
- package/build/internal/es/context-booking-checkout.d.mts +22 -6
- package/build/internal/es/context-service.d.mts +14 -5
- package/build/internal/es/context-time-slots.d.mts +10 -0
- package/context-runtime/context-booking-checkout/runtime.d.ts +22 -6
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-categories/runtime.js +2 -2
- package/context-runtime/context-locations/runtime.js +2 -2
- package/context-runtime/context-service/runtime.d.ts +14 -5
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-service-addons/runtime.js +2 -2
- package/context-runtime/context-services/runtime.js +3 -3
- package/context-runtime/context-time-slots/runtime.d.ts +10 -0
- package/context-runtime/context-time-slots/runtime.js +3 -3
- package/package.json +3 -3
|
@@ -20,12 +20,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-categories.ts
|
|
21
21
|
var context_categories_exports = {};
|
|
22
22
|
__export(context_categories_exports, {
|
|
23
|
-
CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR: () =>
|
|
24
|
-
CategoriesContextProvider: () =>
|
|
23
|
+
CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR: () => Mi,
|
|
24
|
+
CategoriesContextProvider: () => Ri,
|
|
25
25
|
categoriesContext: () => $,
|
|
26
|
-
default: () =>
|
|
27
|
-
injectAccessTokenGetter: () =>
|
|
28
|
-
useCategoriesContext: () =>
|
|
26
|
+
default: () => Ri,
|
|
27
|
+
injectAccessTokenGetter: () => zi,
|
|
28
|
+
useCategoriesContext: () => Ni
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(context_categories_exports);
|
|
31
31
|
|
|
@@ -830,30 +830,36 @@ function Zt(e5) {
|
|
|
830
830
|
return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`, e6), t2;
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
|
-
var Qt = `x-wix-
|
|
834
|
-
var $t =
|
|
835
|
-
|
|
836
|
-
|
|
833
|
+
var Qt = `x-wix-currency`;
|
|
834
|
+
var $t = () => {
|
|
835
|
+
let e5 = M(`currency`);
|
|
836
|
+
if (e5) return { [Qt]: e5 };
|
|
837
|
+
};
|
|
838
|
+
var en = `x-wix-linguist`;
|
|
839
|
+
var tn = `00000000-0000-0000-0000-000000000000`;
|
|
840
|
+
var nn = `false`;
|
|
841
|
+
var rn = () => {
|
|
837
842
|
let e5 = M(`language`), t2 = M(`locale`);
|
|
838
|
-
if (e5) return { [
|
|
843
|
+
if (e5) return { [en]: [e5, t2 || e5, nn, tn].join(`|`) };
|
|
839
844
|
};
|
|
840
|
-
function
|
|
845
|
+
function an() {
|
|
841
846
|
let e5 = null, t2 = null;
|
|
842
847
|
return { promise: new Promise((n2, r2) => {
|
|
843
848
|
e5 = n2, t2 = r2;
|
|
844
849
|
}), resolve: e5, reject: t2 };
|
|
845
850
|
}
|
|
846
|
-
var
|
|
847
|
-
var M = (e5) =>
|
|
848
|
-
var
|
|
849
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 =
|
|
851
|
+
var on = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
852
|
+
var M = (e5) => on()?.[e5];
|
|
853
|
+
var sn = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host: (t2) => {
|
|
854
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 = ln();
|
|
850
855
|
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: M(`language`), locale: M(`locale`), get passThroughHeaders() {
|
|
851
|
-
|
|
856
|
+
let e6 = { ...rn(), ...$t() };
|
|
857
|
+
return Object.keys(e6).length > 0 ? e6 : void 0;
|
|
852
858
|
} } };
|
|
853
859
|
}, auth: (e6) => {
|
|
854
860
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
855
|
-
!e6 &&
|
|
856
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
861
|
+
!e6 && cn() && (e6 = t2?.getAccessTokenFunction?.());
|
|
862
|
+
let n2 = false, { resolve: r2, promise: i2 } = an();
|
|
857
863
|
return { getAuthHeaders: async () => {
|
|
858
864
|
if (!e6 && n2 && (e6 = await i2), !e6) throw Error(`Failed to resolve auth token`);
|
|
859
865
|
return { headers: { Authorization: await e6() } };
|
|
@@ -861,34 +867,34 @@ var an = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host:
|
|
|
861
867
|
r2(e7);
|
|
862
868
|
}) };
|
|
863
869
|
} });
|
|
864
|
-
function
|
|
870
|
+
function cn() {
|
|
865
871
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
866
872
|
}
|
|
867
|
-
function
|
|
873
|
+
function ln() {
|
|
868
874
|
let e5 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
869
875
|
if (!e5) return;
|
|
870
876
|
let t2 = new URL(e5);
|
|
871
877
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
872
878
|
}
|
|
873
|
-
var
|
|
879
|
+
var un = ({ clientSdk: e5, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
874
880
|
if (!e5) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
875
881
|
return e5.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
876
882
|
}, getAccessToken: () => {
|
|
877
883
|
throw Error(`Not implemented`);
|
|
878
884
|
}, observeState: () => ({ disconnect: () => {
|
|
879
885
|
} }) });
|
|
880
|
-
var
|
|
886
|
+
var dn = sn({ createHost: function(e5) {
|
|
881
887
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e5?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e5 || {};
|
|
882
888
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
883
|
-
return { channel:
|
|
889
|
+
return { channel: un({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
884
890
|
} };
|
|
885
891
|
} });
|
|
886
|
-
var
|
|
887
|
-
let n2 =
|
|
892
|
+
var fn = (e5, t2) => {
|
|
893
|
+
let n2 = dn.host({ applicationId: e5, componentId: t2 }), r2 = dn.auth();
|
|
888
894
|
return He({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
889
895
|
};
|
|
890
|
-
var
|
|
891
|
-
function
|
|
896
|
+
var pn = (e5) => fn(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e5);
|
|
897
|
+
function mn() {
|
|
892
898
|
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
893
899
|
if (e5) return { initWixModules(t3, n3) {
|
|
894
900
|
return N(() => e5(t3, n3));
|
|
@@ -925,15 +931,15 @@ function N(e5) {
|
|
|
925
931
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
926
932
|
}
|
|
927
933
|
}
|
|
928
|
-
function
|
|
934
|
+
function hn(e5, t2) {
|
|
929
935
|
return { ...e5, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
930
|
-
let r2 =
|
|
936
|
+
let r2 = mn();
|
|
931
937
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
932
938
|
return r2.initWixModules(e5)[t3].apply(void 0, n2);
|
|
933
939
|
}])) };
|
|
934
940
|
}
|
|
935
|
-
function
|
|
936
|
-
return
|
|
941
|
+
function gn(e5) {
|
|
942
|
+
return hn({ __type: `host`, create: (t2) => Object.entries(e5).reduce((e6, [n2, r2]) => ({ ...e6, [n2]: r2(t2) }), {}) }, Object.keys(e5));
|
|
937
943
|
}
|
|
938
944
|
var P = (e5) => typeof e5 == `string`;
|
|
939
945
|
var F = () => {
|
|
@@ -942,25 +948,25 @@ var F = () => {
|
|
|
942
948
|
});
|
|
943
949
|
return n2.resolve = e5, n2.reject = t2, n2;
|
|
944
950
|
};
|
|
945
|
-
var
|
|
946
|
-
var
|
|
951
|
+
var _n = (e5) => e5 == null ? `` : `` + e5;
|
|
952
|
+
var vn = (e5, t2, n2) => {
|
|
947
953
|
e5.forEach((e6) => {
|
|
948
954
|
t2[e6] && (n2[e6] = t2[e6]);
|
|
949
955
|
});
|
|
950
956
|
};
|
|
951
|
-
var
|
|
952
|
-
var
|
|
953
|
-
var
|
|
957
|
+
var yn = /###/g;
|
|
958
|
+
var bn = (e5) => e5 && e5.indexOf(`###`) > -1 ? e5.replace(yn, `.`) : e5;
|
|
959
|
+
var xn = (e5) => !e5 || P(e5);
|
|
954
960
|
var I = (e5, t2, n2) => {
|
|
955
961
|
let r2 = P(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
956
962
|
for (; i2 < r2.length - 1; ) {
|
|
957
|
-
if (
|
|
958
|
-
let t3 =
|
|
963
|
+
if (xn(e5)) return {};
|
|
964
|
+
let t3 = bn(r2[i2]);
|
|
959
965
|
!e5[t3] && n2 && (e5[t3] = new n2()), e5 = Object.prototype.hasOwnProperty.call(e5, t3) ? e5[t3] : {}, ++i2;
|
|
960
966
|
}
|
|
961
|
-
return
|
|
967
|
+
return xn(e5) ? {} : { obj: e5, k: bn(r2[i2]) };
|
|
962
968
|
};
|
|
963
|
-
var
|
|
969
|
+
var Sn = (e5, t2, n2) => {
|
|
964
970
|
let { obj: r2, k: i2 } = I(e5, t2, Object);
|
|
965
971
|
if (r2 !== void 0 || t2.length === 1) {
|
|
966
972
|
r2[i2] = n2;
|
|
@@ -970,7 +976,7 @@ var bn = (e5, t2, n2) => {
|
|
|
970
976
|
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = I(e5, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
971
977
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
972
978
|
};
|
|
973
|
-
var
|
|
979
|
+
var Cn = (e5, t2, n2, r2) => {
|
|
974
980
|
let { obj: i2, k: a2 } = I(e5, t2, Object);
|
|
975
981
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
976
982
|
};
|
|
@@ -978,18 +984,18 @@ var L = (e5, t2) => {
|
|
|
978
984
|
let { obj: n2, k: r2 } = I(e5, t2);
|
|
979
985
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
980
986
|
};
|
|
981
|
-
var
|
|
987
|
+
var wn = (e5, t2, n2) => {
|
|
982
988
|
let r2 = L(e5, n2);
|
|
983
989
|
return r2 === void 0 ? L(t2, n2) : r2;
|
|
984
990
|
};
|
|
985
|
-
var
|
|
986
|
-
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (r2 in e5 ? P(e5[r2]) || e5[r2] instanceof String || P(t2[r2]) || t2[r2] instanceof String ? n2 && (e5[r2] = t2[r2]) :
|
|
991
|
+
var Tn = (e5, t2, n2) => {
|
|
992
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (r2 in e5 ? P(e5[r2]) || e5[r2] instanceof String || P(t2[r2]) || t2[r2] instanceof String ? n2 && (e5[r2] = t2[r2]) : Tn(e5[r2], t2[r2], n2) : e5[r2] = t2[r2]);
|
|
987
993
|
return e5;
|
|
988
994
|
};
|
|
989
995
|
var R = (e5) => e5.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
990
|
-
var
|
|
991
|
-
var
|
|
992
|
-
var
|
|
996
|
+
var En = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
997
|
+
var Dn = (e5) => P(e5) ? e5.replace(/[&<>"'\/]/g, (e6) => En[e6]) : e5;
|
|
998
|
+
var On = class {
|
|
993
999
|
constructor(e5) {
|
|
994
1000
|
this.capacity = e5, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
995
1001
|
}
|
|
@@ -1000,13 +1006,13 @@ var En = class {
|
|
|
1000
1006
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e5, n2), this.regExpQueue.push(e5), n2;
|
|
1001
1007
|
}
|
|
1002
1008
|
};
|
|
1003
|
-
var
|
|
1004
|
-
var
|
|
1005
|
-
var
|
|
1009
|
+
var kn = [` `, `,`, `?`, `!`, `;`];
|
|
1010
|
+
var An = new On(20);
|
|
1011
|
+
var jn = (e5, t2, n2) => {
|
|
1006
1012
|
t2 ||= ``, n2 ||= ``;
|
|
1007
|
-
let r2 =
|
|
1013
|
+
let r2 = kn.filter((e6) => t2.indexOf(e6) < 0 && n2.indexOf(e6) < 0);
|
|
1008
1014
|
if (r2.length === 0) return true;
|
|
1009
|
-
let i2 =
|
|
1015
|
+
let i2 = An.getRegExp(`(${r2.map((e6) => e6 === `?` ? `\\?` : e6).join(`|`)})`), a2 = !i2.test(e5);
|
|
1010
1016
|
if (!a2) {
|
|
1011
1017
|
let t3 = e5.indexOf(n2);
|
|
1012
1018
|
t3 > 0 && !i2.test(e5.substring(0, t3)) && (a2 = true);
|
|
@@ -1030,7 +1036,7 @@ var z = (e5, t2, n2 = `.`) => {
|
|
|
1030
1036
|
return i2;
|
|
1031
1037
|
};
|
|
1032
1038
|
var B = (e5) => e5?.replace(/_/g, `-`);
|
|
1033
|
-
var
|
|
1039
|
+
var Mn = { type: `logger`, log(e5) {
|
|
1034
1040
|
this.output(`log`, e5);
|
|
1035
1041
|
}, warn(e5) {
|
|
1036
1042
|
this.output(`warn`, e5);
|
|
@@ -1044,7 +1050,7 @@ var V = new class e2 {
|
|
|
1044
1050
|
this.init(e5, t2);
|
|
1045
1051
|
}
|
|
1046
1052
|
init(e5, t2 = {}) {
|
|
1047
|
-
this.prefix = t2.prefix || `i18next:`, this.logger = e5 ||
|
|
1053
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e5 || Mn, this.options = t2, this.debug = t2.debug;
|
|
1048
1054
|
}
|
|
1049
1055
|
log(...e5) {
|
|
1050
1056
|
return this.forward(e5, `log`, ``, true);
|
|
@@ -1096,7 +1102,7 @@ var H = class {
|
|
|
1096
1102
|
});
|
|
1097
1103
|
}
|
|
1098
1104
|
};
|
|
1099
|
-
var
|
|
1105
|
+
var Nn = class extends H {
|
|
1100
1106
|
constructor(e5, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1101
1107
|
super(), this.data = e5 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1102
1108
|
}
|
|
@@ -1115,7 +1121,7 @@ var jn = class extends H {
|
|
|
1115
1121
|
}
|
|
1116
1122
|
addResource(e5, t2, n2, r2, i2 = { silent: false }) {
|
|
1117
1123
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e5, t2];
|
|
1118
|
-
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2),
|
|
1124
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), Sn(this.data, o2, r2), i2.silent || this.emit(`added`, e5, t2, n2, r2);
|
|
1119
1125
|
}
|
|
1120
1126
|
addResources(e5, t2, n2, r2 = { silent: false }) {
|
|
1121
1127
|
for (let r3 in n2) (P(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e5, t2, r3, n2[r3], { silent: true });
|
|
@@ -1125,7 +1131,7 @@ var jn = class extends H {
|
|
|
1125
1131
|
let o2 = [e5, t2];
|
|
1126
1132
|
e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1127
1133
|
let s2 = L(this.data, o2) || {};
|
|
1128
|
-
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ?
|
|
1134
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? Tn(s2, n2, i2) : s2 = { ...s2, ...n2 }, Sn(this.data, o2, s2), a2.silent || this.emit(`added`, e5, t2, n2);
|
|
1129
1135
|
}
|
|
1130
1136
|
removeResourceBundle(e5, t2) {
|
|
1131
1137
|
this.hasResourceBundle(e5, t2) && delete this.data[e5][t2], this.removeNamespaces(t2), this.emit(`removed`, e5, t2);
|
|
@@ -1147,31 +1153,31 @@ var jn = class extends H {
|
|
|
1147
1153
|
return this.data;
|
|
1148
1154
|
}
|
|
1149
1155
|
};
|
|
1150
|
-
var
|
|
1156
|
+
var Pn = { processors: {}, addPostProcessor(e5) {
|
|
1151
1157
|
this.processors[e5.name] = e5;
|
|
1152
1158
|
}, handle(e5, t2, n2, r2, i2) {
|
|
1153
1159
|
return e5.forEach((e6) => {
|
|
1154
1160
|
t2 = this.processors[e6]?.process(t2, n2, r2, i2) ?? t2;
|
|
1155
1161
|
}), t2;
|
|
1156
1162
|
} };
|
|
1157
|
-
var
|
|
1158
|
-
function
|
|
1163
|
+
var Fn = Symbol(`i18next/PATH_KEY`);
|
|
1164
|
+
function In() {
|
|
1159
1165
|
let e5 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1160
|
-
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 ===
|
|
1166
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === Fn ? e5 : (e5.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1161
1167
|
}
|
|
1162
1168
|
function U(e5, t2) {
|
|
1163
|
-
let { [
|
|
1169
|
+
let { [Fn]: n2 } = e5(In()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`;
|
|
1164
1170
|
if (n2.length > 1 && i2) {
|
|
1165
1171
|
let e6 = t2?.ns, a2 = Array.isArray(e6) ? e6 : null;
|
|
1166
1172
|
if (a2 && a2.length > 1 && a2.slice(1).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1167
1173
|
}
|
|
1168
1174
|
return n2.join(r2);
|
|
1169
1175
|
}
|
|
1170
|
-
var
|
|
1176
|
+
var Ln = {};
|
|
1171
1177
|
var W = (e5) => !P(e5) && typeof e5 != `boolean` && typeof e5 != `number`;
|
|
1172
|
-
var
|
|
1178
|
+
var Rn = class e3 extends H {
|
|
1173
1179
|
constructor(e5, t2 = {}) {
|
|
1174
|
-
super(),
|
|
1180
|
+
super(), vn([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e5, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = V.create(`translator`);
|
|
1175
1181
|
}
|
|
1176
1182
|
changeLanguage(e5) {
|
|
1177
1183
|
e5 && (this.language = e5);
|
|
@@ -1187,7 +1193,7 @@ var In = class e3 extends H {
|
|
|
1187
1193
|
extractFromKey(e5, t2) {
|
|
1188
1194
|
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1189
1195
|
n2 === void 0 && (n2 = `:`);
|
|
1190
|
-
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e5.indexOf(n2) > -1, o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !
|
|
1196
|
+
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e5.indexOf(n2) > -1, o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !jn(e5, n2, r2);
|
|
1191
1197
|
if (a2 && !o2) {
|
|
1192
1198
|
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1193
1199
|
if (t3 && t3.length > 0) return { key: e5, namespaces: P(i2) ? [i2] : i2 };
|
|
@@ -1266,7 +1272,7 @@ var In = class e3 extends H {
|
|
|
1266
1272
|
!n2.lng && r2 && r2.res && (n2.lng = this.language || r2.usedLng), n2.nest !== false && (e5 = this.interpolator.nest(e5, (...e6) => i2?.[0] === e6[0] && !n2.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e6[0]} in key: ${t2[0]}`), null) : this.translate(...e6, t2), n2)), n2.interpolation && this.interpolator.reset();
|
|
1267
1273
|
}
|
|
1268
1274
|
let a2 = n2.postProcess || this.options.postProcess, o2 = P(a2) ? [a2] : a2;
|
|
1269
|
-
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 =
|
|
1275
|
+
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 = Pn.handle(o2, e5, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e5;
|
|
1270
1276
|
}
|
|
1271
1277
|
resolve(e5, t2 = {}) {
|
|
1272
1278
|
let n2, r2, i2, a2, o2;
|
|
@@ -1278,7 +1284,7 @@ var In = class e3 extends H {
|
|
|
1278
1284
|
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1279
1285
|
let u2 = t2.count !== void 0 && !P(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (P(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1280
1286
|
l2.forEach((e7) => {
|
|
1281
|
-
this.isValidLookup(n2) || (o2 = e7, !
|
|
1287
|
+
this.isValidLookup(n2) || (o2 = e7, !Ln[`${p2[0]}-${e7}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (Ln[`${p2[0]}-${e7}`] = true, this.logger.warn(`key "${r2}" for languages "${p2.join(`, `)}" won't get resolved as namespace "${o2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)), p2.forEach((r3) => {
|
|
1282
1288
|
if (this.isValidLookup(n2)) return;
|
|
1283
1289
|
a2 = r3;
|
|
1284
1290
|
let o3 = [c2];
|
|
@@ -1317,7 +1323,7 @@ var In = class e3 extends H {
|
|
|
1317
1323
|
return false;
|
|
1318
1324
|
}
|
|
1319
1325
|
};
|
|
1320
|
-
var
|
|
1326
|
+
var zn = class {
|
|
1321
1327
|
constructor(e5) {
|
|
1322
1328
|
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger = V.create(`languageUtils`);
|
|
1323
1329
|
}
|
|
@@ -1379,9 +1385,9 @@ var Ln = class {
|
|
|
1379
1385
|
}), r2;
|
|
1380
1386
|
}
|
|
1381
1387
|
};
|
|
1382
|
-
var
|
|
1383
|
-
var
|
|
1384
|
-
var
|
|
1388
|
+
var Bn = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
1389
|
+
var Vn = { select: (e5) => e5 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1390
|
+
var Hn = class {
|
|
1385
1391
|
constructor(e5, t2 = {}) {
|
|
1386
1392
|
this.languageUtils = e5, this.options = t2, this.logger = V.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1387
1393
|
}
|
|
@@ -1395,8 +1401,8 @@ var Bn = class {
|
|
|
1395
1401
|
try {
|
|
1396
1402
|
a2 = new Intl.PluralRules(n2, { type: r2 });
|
|
1397
1403
|
} catch {
|
|
1398
|
-
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`),
|
|
1399
|
-
if (!e5.match(/-|_/)) return
|
|
1404
|
+
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`), Vn;
|
|
1405
|
+
if (!e5.match(/-|_/)) return Vn;
|
|
1400
1406
|
let n3 = this.languageUtils.getLanguagePartFromCode(e5);
|
|
1401
1407
|
a2 = this.getRule(n3, t2);
|
|
1402
1408
|
}
|
|
@@ -1411,26 +1417,26 @@ var Bn = class {
|
|
|
1411
1417
|
}
|
|
1412
1418
|
getSuffixes(e5, t2 = {}) {
|
|
1413
1419
|
let n2 = this.getRule(e5, t2);
|
|
1414
|
-
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e6, t3) =>
|
|
1420
|
+
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e6, t3) => Bn[e6] - Bn[t3]).map((e6) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ``}${e6}`) : [];
|
|
1415
1421
|
}
|
|
1416
1422
|
getSuffix(e5, t2, n2 = {}) {
|
|
1417
1423
|
let r2 = this.getRule(e5, n2);
|
|
1418
1424
|
return r2 ? `${this.options.prepend}${n2.ordinal ? `ordinal${this.options.prepend}` : ``}${r2.select(t2)}` : (this.logger.warn(`no plural rule found for: ${e5}`), this.getSuffix(`dev`, t2, n2));
|
|
1419
1425
|
}
|
|
1420
1426
|
};
|
|
1421
|
-
var
|
|
1422
|
-
let a2 =
|
|
1427
|
+
var Un = (e5, t2, n2, r2 = `.`, i2 = true) => {
|
|
1428
|
+
let a2 = wn(e5, t2, n2);
|
|
1423
1429
|
return !a2 && i2 && P(n2) && (a2 = z(e5, n2, r2), a2 === void 0 && (a2 = z(t2, n2, r2))), a2;
|
|
1424
1430
|
};
|
|
1425
1431
|
var G = (e5) => e5.replace(/\$/g, `$$$$`);
|
|
1426
|
-
var
|
|
1432
|
+
var Wn = class {
|
|
1427
1433
|
constructor(e5 = {}) {
|
|
1428
1434
|
this.logger = V.create(`interpolator`), this.options = e5, this.format = e5?.interpolation?.format || ((e6) => e6), this.init(e5);
|
|
1429
1435
|
}
|
|
1430
1436
|
init(e5 = {}) {
|
|
1431
1437
|
e5.interpolation ||= { escapeValue: true };
|
|
1432
1438
|
let { escape: t2, escapeValue: n2, useRawValueToEscape: r2, prefix: i2, prefixEscaped: a2, suffix: o2, suffixEscaped: s2, formatSeparator: c2, unescapeSuffix: l2, unescapePrefix: u2, nestingPrefix: d2, nestingPrefixEscaped: f2, nestingSuffix: p2, nestingSuffixEscaped: m2, nestingOptionsSeparator: h2, maxReplaces: g2, alwaysFormat: _2 } = e5.interpolation;
|
|
1433
|
-
this.escape = t2 === void 0 ?
|
|
1439
|
+
this.escape = t2 === void 0 ? Dn : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? R(i2) : a2 || `{{`, this.suffix = o2 ? R(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 || `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 || ``, this.nestingPrefix = d2 ? R(d2) : f2 || R(`$t(`), this.nestingSuffix = p2 ? R(p2) : m2 || R(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1434
1440
|
}
|
|
1435
1441
|
reset() {
|
|
1436
1442
|
this.options && this.init(this.options);
|
|
@@ -1442,11 +1448,11 @@ var Hn = class {
|
|
|
1442
1448
|
interpolate(e5, t2, n2, r2) {
|
|
1443
1449
|
let i2, a2, o2, s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c2 = (e6) => {
|
|
1444
1450
|
if (e6.indexOf(this.formatSeparator) < 0) {
|
|
1445
|
-
let i4 =
|
|
1451
|
+
let i4 = Un(t2, s2, e6, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1446
1452
|
return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e6 }) : i4;
|
|
1447
1453
|
}
|
|
1448
1454
|
let i3 = e6.split(this.formatSeparator), a3 = i3.shift().trim(), o3 = i3.join(this.formatSeparator).trim();
|
|
1449
|
-
return this.format(
|
|
1455
|
+
return this.format(Un(t2, s2, a3, this.options.keySeparator, this.options.ignoreJSONStructure), o3, n2, { ...r2, ...t2, interpolationkey: a3 });
|
|
1450
1456
|
};
|
|
1451
1457
|
this.resetRegExp();
|
|
1452
1458
|
let l2 = r2?.missingInterpolationHandler || this.options.missingInterpolationHandler, u2 = r2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r2.interpolation.skipOnVariables;
|
|
@@ -1462,7 +1468,7 @@ var Hn = class {
|
|
|
1462
1468
|
a2 = i2[0];
|
|
1463
1469
|
continue;
|
|
1464
1470
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e5}`), a2 = ``;
|
|
1465
|
-
} else !P(a2) && !this.useRawValueToEscape && (a2 =
|
|
1471
|
+
} else !P(a2) && !this.useRawValueToEscape && (a2 = _n(a2));
|
|
1466
1472
|
let s3 = t3.safeValue(a2);
|
|
1467
1473
|
if (e5 = e5.replace(i2[0], s3), u2 ? (t3.regex.lastIndex += a2.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1468
1474
|
}
|
|
@@ -1488,12 +1494,12 @@ var Hn = class {
|
|
|
1488
1494
|
a2 = { ...n2 }, a2 = a2.replace && !P(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1489
1495
|
let c2 = /{.*}/.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1490
1496
|
if (c2 !== -1 && (s2 = r2[1].slice(c2).split(this.formatSeparator).map((e6) => e6.trim()).filter(Boolean), r2[1] = r2[1].slice(0, c2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e5 && !P(i2)) return i2;
|
|
1491
|
-
P(i2) || (i2 =
|
|
1497
|
+
P(i2) || (i2 = _n(i2)), i2 ||= (this.logger.warn(`missed to resolve ${r2[1]} for nesting ${e5}`), ``), s2.length && (i2 = s2.reduce((e6, t3) => this.format(e6, t3, n2.lng, { ...n2, interpolationkey: r2[1].trim() }), i2.trim())), e5 = e5.replace(r2[0], i2), this.regexp.lastIndex = 0;
|
|
1492
1498
|
}
|
|
1493
1499
|
return e5;
|
|
1494
1500
|
}
|
|
1495
1501
|
};
|
|
1496
|
-
var
|
|
1502
|
+
var Gn = (e5) => {
|
|
1497
1503
|
let t2 = e5.toLowerCase().trim(), n2 = {};
|
|
1498
1504
|
if (e5.indexOf(`(`) > -1) {
|
|
1499
1505
|
let r2 = e5.split(`(`);
|
|
@@ -1508,7 +1514,7 @@ var Un = (e5) => {
|
|
|
1508
1514
|
}
|
|
1509
1515
|
return { formatName: t2, formatOptions: n2 };
|
|
1510
1516
|
};
|
|
1511
|
-
var
|
|
1517
|
+
var Kn = (e5) => {
|
|
1512
1518
|
let t2 = {};
|
|
1513
1519
|
return (n2, r2, i2) => {
|
|
1514
1520
|
let a2 = i2;
|
|
@@ -1517,14 +1523,14 @@ var Wn = (e5) => {
|
|
|
1517
1523
|
return s2 || (s2 = e5(B(r2), i2), t2[o2] = s2), s2(n2);
|
|
1518
1524
|
};
|
|
1519
1525
|
};
|
|
1520
|
-
var
|
|
1521
|
-
var
|
|
1526
|
+
var qn = (e5) => (t2, n2, r2) => e5(B(n2), r2)(t2);
|
|
1527
|
+
var Jn = class {
|
|
1522
1528
|
constructor(e5 = {}) {
|
|
1523
1529
|
this.logger = V.create(`formatter`), this.options = e5, this.init(e5);
|
|
1524
1530
|
}
|
|
1525
1531
|
init(e5, t2 = { interpolation: {} }) {
|
|
1526
1532
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
1527
|
-
let n2 = t2.cacheInBuiltFormats ?
|
|
1533
|
+
let n2 = t2.cacheInBuiltFormats ? Kn : qn;
|
|
1528
1534
|
this.formats = { number: n2((e6, t3) => {
|
|
1529
1535
|
let n3 = new Intl.NumberFormat(e6, { ...t3 });
|
|
1530
1536
|
return (e7) => n3.format(e7);
|
|
@@ -1546,7 +1552,7 @@ var Kn = class {
|
|
|
1546
1552
|
this.formats[e5.toLowerCase().trim()] = t2;
|
|
1547
1553
|
}
|
|
1548
1554
|
addCached(e5, t2) {
|
|
1549
|
-
this.formats[e5.toLowerCase().trim()] =
|
|
1555
|
+
this.formats[e5.toLowerCase().trim()] = Kn(t2);
|
|
1550
1556
|
}
|
|
1551
1557
|
format(e5, t2, n2, r2 = {}) {
|
|
1552
1558
|
let i2 = t2.split(this.formatSeparator);
|
|
@@ -1555,7 +1561,7 @@ var Kn = class {
|
|
|
1555
1561
|
i2[0] = [i2[0], ...i2.splice(1, e6)].join(this.formatSeparator);
|
|
1556
1562
|
}
|
|
1557
1563
|
return i2.reduce((e6, t3) => {
|
|
1558
|
-
let { formatName: i3, formatOptions: a2 } =
|
|
1564
|
+
let { formatName: i3, formatOptions: a2 } = Gn(t3);
|
|
1559
1565
|
if (this.formats[i3]) {
|
|
1560
1566
|
let t4 = e6;
|
|
1561
1567
|
try {
|
|
@@ -1570,10 +1576,10 @@ var Kn = class {
|
|
|
1570
1576
|
}, e5);
|
|
1571
1577
|
}
|
|
1572
1578
|
};
|
|
1573
|
-
var
|
|
1579
|
+
var Yn = (e5, t2) => {
|
|
1574
1580
|
e5.pending[t2] !== void 0 && (delete e5.pending[t2], e5.pendingCount--);
|
|
1575
1581
|
};
|
|
1576
|
-
var
|
|
1582
|
+
var Xn = class extends H {
|
|
1577
1583
|
constructor(e5, t2, n2, r2 = {}) {
|
|
1578
1584
|
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = V.create(`backendConnector`), this.waitingReads = [], this.maxParallelReads = r2.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r2.maxRetries >= 0 ? r2.maxRetries : 5, this.retryTimeout = r2.retryTimeout >= 1 ? r2.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n2, r2.backend, r2);
|
|
1579
1585
|
}
|
|
@@ -1592,7 +1598,7 @@ var Jn = class extends H {
|
|
|
1592
1598
|
t2 && this.emit(`failedLoading`, i2, a2, t2), !t2 && n2 && this.store.addResourceBundle(i2, a2, n2, void 0, void 0, { skipCopy: true }), this.state[e5] = t2 ? -1 : 2, t2 && n2 && (this.state[e5] = 0);
|
|
1593
1599
|
let o2 = {};
|
|
1594
1600
|
this.queue.forEach((n3) => {
|
|
1595
|
-
|
|
1601
|
+
Cn(n3.loaded, [i2], a2), Yn(n3, e5), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e6) => {
|
|
1596
1602
|
o2[e6] || (o2[e6] = {});
|
|
1597
1603
|
let t3 = n3.loaded[e6];
|
|
1598
1604
|
t3.length && t3.forEach((t4) => {
|
|
@@ -1684,23 +1690,23 @@ var K = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
1684
1690
|
}
|
|
1685
1691
|
return t2;
|
|
1686
1692
|
}, interpolation: { escapeValue: true, format: (e5) => e5, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1687
|
-
var
|
|
1693
|
+
var Zn = (e5) => (P(e5.ns) && (e5.ns = [e5.ns]), P(e5.fallbackLng) && (e5.fallbackLng = [e5.fallbackLng]), P(e5.fallbackNS) && (e5.fallbackNS = [e5.fallbackNS]), e5.supportedLngs?.indexOf?.(`cimode`) < 0 && (e5.supportedLngs = e5.supportedLngs.concat([`cimode`])), typeof e5.initImmediate == `boolean` && (e5.initAsync = e5.initImmediate), e5);
|
|
1688
1694
|
var q = () => {
|
|
1689
1695
|
};
|
|
1690
|
-
var
|
|
1696
|
+
var Qn = (e5) => {
|
|
1691
1697
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e5)).forEach((t2) => {
|
|
1692
1698
|
typeof e5[t2] == `function` && (e5[t2] = e5[t2].bind(e5));
|
|
1693
1699
|
});
|
|
1694
1700
|
};
|
|
1695
|
-
var
|
|
1696
|
-
var
|
|
1697
|
-
var
|
|
1698
|
-
typeof globalThis < `u` && (globalThis[
|
|
1701
|
+
var $n = `__i18next_supportNoticeShown`;
|
|
1702
|
+
var er = () => !!(typeof globalThis < `u` && globalThis[$n] || typeof process < `u` && {}.I18NEXT_NO_SUPPORT_NOTICE || typeof process < `u`);
|
|
1703
|
+
var tr = () => {
|
|
1704
|
+
typeof globalThis < `u` && (globalThis[$n] = true);
|
|
1699
1705
|
};
|
|
1700
|
-
var
|
|
1706
|
+
var nr = (e5) => !!(e5?.modules?.backend?.name?.indexOf(`Locize`) > 0 || e5?.modules?.backend?.constructor?.name?.indexOf(`Locize`) > 0 || e5?.options?.backend?.backends && e5.options.backend.backends.some((e6) => e6?.name?.indexOf(`Locize`) > 0 || e6?.constructor?.name?.indexOf(`Locize`) > 0) || e5?.options?.backend?.projectId || e5?.options?.backend?.backendOptions && e5.options.backend.backendOptions.some((e6) => e6?.projectId));
|
|
1701
1707
|
var J = class e4 extends H {
|
|
1702
1708
|
constructor(e5 = {}, t2) {
|
|
1703
|
-
if (super(), this.options =
|
|
1709
|
+
if (super(), this.options = Zn(e5), this.services = {}, this.logger = V, this.modules = { external: [] }, Qn(this), t2 && !this.isInitialized && !e5.isClone) {
|
|
1704
1710
|
if (!this.options.initAsync) return this.init(e5, t2), this;
|
|
1705
1711
|
setTimeout(() => {
|
|
1706
1712
|
this.init(e5, t2);
|
|
@@ -1710,18 +1716,18 @@ var J = class e4 extends H {
|
|
|
1710
1716
|
init(e5 = {}, t2) {
|
|
1711
1717
|
this.isInitializing = true, typeof e5 == `function` && (t2 = e5, e5 = {}), e5.defaultNS == null && e5.ns && (P(e5.ns) ? e5.defaultNS = e5.ns : e5.ns.indexOf(`translation`) < 0 && (e5.defaultNS = e5.ns[0]));
|
|
1712
1718
|
let n2 = K();
|
|
1713
|
-
this.options = { ...n2, ...this.options, ...
|
|
1719
|
+
this.options = { ...n2, ...this.options, ...Zn(e5) }, this.options.interpolation = { ...n2.interpolation, ...this.options.interpolation }, e5.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e5.keySeparator), e5.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e5.nsSeparator), typeof this.options.overloadTranslationOptionHandler != `function` && (this.options.overloadTranslationOptionHandler = n2.overloadTranslationOptionHandler), this.options.showSupportNotice !== false && !nr(this) && !er() && (typeof console < `u` && console.info !== void 0 && console.info(`\u{1F310} i18next is made possible by our own product, Locize \u2014 consider powering your project with managed localization (AI, CDN, integrations): https://locize.com \u{1F499}`), tr());
|
|
1714
1720
|
let r2 = (e6) => e6 ? typeof e6 == `function` ? new e6() : e6 : null;
|
|
1715
1721
|
if (!this.options.isClone) {
|
|
1716
1722
|
this.modules.logger ? V.init(r2(this.modules.logger), this.options) : V.init(null, this.options);
|
|
1717
1723
|
let e6;
|
|
1718
|
-
e6 = this.modules.formatter ? this.modules.formatter :
|
|
1719
|
-
let t3 = new
|
|
1720
|
-
this.store = new
|
|
1724
|
+
e6 = this.modules.formatter ? this.modules.formatter : Jn;
|
|
1725
|
+
let t3 = new zn(this.options);
|
|
1726
|
+
this.store = new Nn(this.options.resources, this.options);
|
|
1721
1727
|
let i3 = this.services;
|
|
1722
|
-
i3.logger = V, i3.resourceStore = this.store, i3.languageUtils = t3, i3.pluralResolver = new
|
|
1728
|
+
i3.logger = V, i3.resourceStore = this.store, i3.languageUtils = t3, i3.pluralResolver = new Hn(t3, { prepend: this.options.pluralSeparator, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), this.options.interpolation.format && this.options.interpolation.format !== n2.interpolation.format && this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`), e6 && (!this.options.interpolation.format || this.options.interpolation.format === n2.interpolation.format) && (i3.formatter = r2(e6), i3.formatter.init && i3.formatter.init(i3, this.options), this.options.interpolation.format = i3.formatter.format.bind(i3.formatter)), i3.interpolator = new Wn(this.options), i3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i3.backendConnector = new Xn(r2(this.modules.backend), i3.resourceStore, i3, this.options), i3.backendConnector.on(`*`, (e7, ...t4) => {
|
|
1723
1729
|
this.emit(e7, ...t4);
|
|
1724
|
-
}), this.modules.languageDetector && (i3.languageDetector = r2(this.modules.languageDetector), i3.languageDetector.init && i3.languageDetector.init(i3, this.options.detection, this.options)), this.modules.i18nFormat && (i3.i18nFormat = r2(this.modules.i18nFormat), i3.i18nFormat.init && i3.i18nFormat.init(this)), this.translator = new
|
|
1730
|
+
}), this.modules.languageDetector && (i3.languageDetector = r2(this.modules.languageDetector), i3.languageDetector.init && i3.languageDetector.init(i3, this.options.detection, this.options)), this.modules.i18nFormat && (i3.i18nFormat = r2(this.modules.i18nFormat), i3.i18nFormat.init && i3.i18nFormat.init(this)), this.translator = new Rn(this.services, this.options), this.translator.on(`*`, (e7, ...t4) => {
|
|
1725
1731
|
this.emit(e7, ...t4);
|
|
1726
1732
|
}), this.modules.external.forEach((e7) => {
|
|
1727
1733
|
e7.init && e7.init(this);
|
|
@@ -1768,7 +1774,7 @@ var J = class e4 extends H {
|
|
|
1768
1774
|
use(e5) {
|
|
1769
1775
|
if (!e5) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
1770
1776
|
if (!e5.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
1771
|
-
return e5.type === `backend` && (this.modules.backend = e5), (e5.type === `logger` || e5.log && e5.warn && e5.error) && (this.modules.logger = e5), e5.type === `languageDetector` && (this.modules.languageDetector = e5), e5.type === `i18nFormat` && (this.modules.i18nFormat = e5), e5.type === `postProcessor` &&
|
|
1777
|
+
return e5.type === `backend` && (this.modules.backend = e5), (e5.type === `logger` || e5.log && e5.warn && e5.error) && (this.modules.logger = e5), e5.type === `languageDetector` && (this.modules.languageDetector = e5), e5.type === `i18nFormat` && (this.modules.i18nFormat = e5), e5.type === `postProcessor` && Pn.addPostProcessor(e5), e5.type === `formatter` && (this.modules.formatter = e5), e5.type === `3rdParty` && this.modules.external.push(e5), this;
|
|
1772
1778
|
}
|
|
1773
1779
|
setResolvedLanguage(e5) {
|
|
1774
1780
|
if (e5 && this.languages && !([`cimode`, `dev`].indexOf(e5) > -1)) {
|
|
@@ -1860,7 +1866,7 @@ var J = class e4 extends H {
|
|
|
1860
1866
|
}
|
|
1861
1867
|
} catch {
|
|
1862
1868
|
}
|
|
1863
|
-
let t2 = `ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`), n2 = this.services?.languageUtils || new
|
|
1869
|
+
let t2 = `ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`), n2 = this.services?.languageUtils || new zn(K());
|
|
1864
1870
|
return e5.toLowerCase().indexOf(`-latn`) > 1 ? `ltr` : t2.indexOf(n2.getLanguagePartFromCode(e5)) > -1 || e5.toLowerCase().indexOf(`-arab`) > 1 ? `rtl` : `ltr`;
|
|
1865
1871
|
}
|
|
1866
1872
|
static createInstance(t2 = {}, n2) {
|
|
@@ -1873,11 +1879,11 @@ var J = class e4 extends H {
|
|
|
1873
1879
|
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
1874
1880
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e5) => {
|
|
1875
1881
|
a2[e5] = this[e5];
|
|
1876
|
-
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new
|
|
1882
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new Nn(Object.keys(this.store.data).reduce((e5, t3) => (e5[t3] = { ...this.store.data[t3] }, e5[t3] = Object.keys(e5[t3]).reduce((n3, r3) => (n3[r3] = { ...e5[t3][r3] }, n3), e5[t3]), e5), {}), i2), a2.services.resourceStore = a2.store), t2.interpolation) {
|
|
1877
1883
|
let e5 = { ...K().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e5 };
|
|
1878
|
-
a2.services.interpolator = new
|
|
1884
|
+
a2.services.interpolator = new Wn(n3);
|
|
1879
1885
|
}
|
|
1880
|
-
return a2.translator = new
|
|
1886
|
+
return a2.translator = new Rn(a2.services, i2), a2.translator.on(`*`, (e5, ...t3) => {
|
|
1881
1887
|
a2.emit(e5, ...t3);
|
|
1882
1888
|
}), a2.init(i2, n2), a2.translator.options = i2, a2.translator.backendConnector.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, a2;
|
|
1883
1889
|
}
|
|
@@ -1886,20 +1892,20 @@ var J = class e4 extends H {
|
|
|
1886
1892
|
}
|
|
1887
1893
|
}.createInstance();
|
|
1888
1894
|
J.createInstance, J.dir, J.init, J.loadResources, J.reloadResources, J.use, J.changeLanguage, J.getFixedT, J.t, J.exists, J.setDefaultNamespace, J.hasLoadedNamespace, J.loadNamespaces, J.loadLanguages;
|
|
1889
|
-
var
|
|
1890
|
-
var
|
|
1891
|
-
var
|
|
1892
|
-
var
|
|
1893
|
-
var
|
|
1894
|
-
|
|
1895
|
+
var rr = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
1896
|
+
var ir = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
1897
|
+
var ar = (e5) => ir[e5];
|
|
1898
|
+
var or = { bindI18n: `languageChanged`, bindI18nStore: ``, transEmptyNodeValue: ``, transSupportBasicHtmlNodes: true, transWrapTextNodes: ``, transKeepBasicHtmlNodesFor: [`br`, `strong`, `i`, `p`], useSuspense: true, unescape: (e5) => e5.replace(rr, ar), transDefaultProps: void 0 };
|
|
1899
|
+
var sr = (e5 = {}) => {
|
|
1900
|
+
or = { ...or, ...e5 };
|
|
1895
1901
|
};
|
|
1896
|
-
var
|
|
1897
|
-
|
|
1902
|
+
var cr = { type: `3rdParty`, init(e5) {
|
|
1903
|
+
sr(e5.options.react);
|
|
1898
1904
|
} };
|
|
1899
1905
|
var Y = /* @__PURE__ */ new Map();
|
|
1900
|
-
var
|
|
1906
|
+
var lr = 500;
|
|
1901
1907
|
var X;
|
|
1902
|
-
function
|
|
1908
|
+
function ur() {
|
|
1903
1909
|
if (X === void 0) try {
|
|
1904
1910
|
X = new Intl.NumberFormat(`en-US`, { useGrouping: false, maximumFractionDigits: 0 }).format(`9007199254740993`) === `9007199254740993`;
|
|
1905
1911
|
} catch {
|
|
@@ -1907,32 +1913,32 @@ function cr() {
|
|
|
1907
1913
|
}
|
|
1908
1914
|
return X;
|
|
1909
1915
|
}
|
|
1910
|
-
var
|
|
1911
|
-
function
|
|
1912
|
-
if (!(typeof e5 != `string` ||
|
|
1916
|
+
var dr = 15;
|
|
1917
|
+
function fr(e5) {
|
|
1918
|
+
if (!(typeof e5 != `string` || ur()) && e5.replace(/[^0-9]/g, ``).replace(/^0+/, ``).length > dr) throw Error(`Cannot format the amount '${e5}' exactly: this runtime's Intl implementation predates ES2023 string support and would lose precision. Use a runtime with ES2023 Intl support (for example Node 20+), or pass a value within 15 significant digits.`);
|
|
1913
1919
|
}
|
|
1914
|
-
function
|
|
1920
|
+
function pr(e5, t2, n2) {
|
|
1915
1921
|
return `${e5}|${t2}|${Object.entries(n2).filter(([, e6]) => e6 !== void 0).sort(([e6], [t3]) => e6 < t3 ? -1 : 1).map(([e6, t3]) => `${e6}=${String(t3)}`).join(`&`)}`;
|
|
1916
1922
|
}
|
|
1917
|
-
function
|
|
1918
|
-
let r2 =
|
|
1919
|
-
return i2 || (i2 = new Intl.NumberFormat(e5, { ...n2, style: `currency`, currency: t2 }), Y.size >=
|
|
1923
|
+
function mr(e5, t2, n2) {
|
|
1924
|
+
let r2 = pr(e5, t2, n2), i2 = Y.get(r2);
|
|
1925
|
+
return i2 || (i2 = new Intl.NumberFormat(e5, { ...n2, style: `currency`, currency: t2 }), Y.size >= lr && Y.clear(), Y.set(r2, i2)), i2;
|
|
1920
1926
|
}
|
|
1921
|
-
function
|
|
1922
|
-
return
|
|
1927
|
+
function hr(e5, { value: t2, currency: n2 }, r2 = {}) {
|
|
1928
|
+
return fr(t2), mr(e5, n2, r2).format(t2);
|
|
1923
1929
|
}
|
|
1924
|
-
function
|
|
1925
|
-
return
|
|
1930
|
+
function gr(e5, { value: t2, currency: n2 }, r2 = {}) {
|
|
1931
|
+
return fr(t2), mr(e5, n2, r2).formatToParts(t2);
|
|
1926
1932
|
}
|
|
1927
|
-
function
|
|
1933
|
+
function _r(e5) {
|
|
1928
1934
|
return Gt().find((e6) => e6.primary)?.id ?? e5;
|
|
1929
1935
|
}
|
|
1930
|
-
function
|
|
1936
|
+
function vr(e5, t2) {
|
|
1931
1937
|
let { locale: n2, ...r2 } = t2 ?? {}, i2 = n2 ?? e5.essentials?.locale;
|
|
1932
1938
|
if (!i2) throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
1933
1939
|
return { locale: i2, formatOptions: r2 };
|
|
1934
1940
|
}
|
|
1935
|
-
var
|
|
1941
|
+
var yr = gn({ getLanguage: (e5) => () => {
|
|
1936
1942
|
let t2 = e5.essentials?.language;
|
|
1937
1943
|
if (!t2) throw Error(`Host language is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
1938
1944
|
return t2;
|
|
@@ -1941,20 +1947,20 @@ var _r = mn({ getLanguage: (e5) => () => {
|
|
|
1941
1947
|
if (!t2) throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
1942
1948
|
return t2;
|
|
1943
1949
|
}, formatCurrency: (e5) => (t2, n2) => {
|
|
1944
|
-
let { locale: r2, formatOptions: i2 } =
|
|
1945
|
-
return
|
|
1950
|
+
let { locale: r2, formatOptions: i2 } = vr(e5, n2);
|
|
1951
|
+
return hr(r2, t2, i2);
|
|
1946
1952
|
}, formatCurrencyToParts: (e5) => (t2, n2) => {
|
|
1947
|
-
let { locale: r2, formatOptions: i2 } =
|
|
1948
|
-
return
|
|
1953
|
+
let { locale: r2, formatOptions: i2 } = vr(e5, n2);
|
|
1954
|
+
return gr(r2, t2, i2);
|
|
1949
1955
|
}, getTranslationFunction: (e5) => () => {
|
|
1950
1956
|
let t2 = e5.translations?.();
|
|
1951
1957
|
if (!t2) throw Error(`Host translation resources are not available.`);
|
|
1952
|
-
let n2 = J.createInstance(), r2 =
|
|
1953
|
-
return n2.use(
|
|
1958
|
+
let n2 = J.createInstance(), r2 = _r(e5.essentials?.language) || `en`, i2 = { lng: e5.essentials?.language || r2, fallbackLng: r2, resources: t2 };
|
|
1959
|
+
return n2.use(cr).init(i2, (e6) => {
|
|
1954
1960
|
if (e6) throw e6;
|
|
1955
1961
|
}), n2.t.bind(n2);
|
|
1956
1962
|
} });
|
|
1957
|
-
var
|
|
1963
|
+
var br = class {
|
|
1958
1964
|
constructor(e5) {
|
|
1959
1965
|
this.message = e5, this.captureException = () => {
|
|
1960
1966
|
console.error(this.message);
|
|
@@ -1969,81 +1975,85 @@ var vr = class {
|
|
|
1969
1975
|
};
|
|
1970
1976
|
}
|
|
1971
1977
|
};
|
|
1972
|
-
var
|
|
1973
|
-
var
|
|
1974
|
-
var
|
|
1975
|
-
function
|
|
1978
|
+
var xr = (e5) => new br(e5);
|
|
1979
|
+
var Sr = gn({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : xr(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
1980
|
+
var Cr = { 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` };
|
|
1981
|
+
function wr(e5) {
|
|
1976
1982
|
try {
|
|
1977
|
-
let t2 =
|
|
1983
|
+
let t2 = Sr.getMonitoringClient?.();
|
|
1978
1984
|
return t2 && typeof t2[e5] == `function` ? t2 : null;
|
|
1979
1985
|
} catch {
|
|
1980
1986
|
return null;
|
|
1981
1987
|
}
|
|
1982
1988
|
}
|
|
1983
|
-
function
|
|
1984
|
-
let a2 =
|
|
1989
|
+
function Tr(e5, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
1990
|
+
let a2 = wr(`captureException`);
|
|
1985
1991
|
if (!a2) return;
|
|
1986
1992
|
let o2 = e5 instanceof Error ? e5 : Error(String(e5));
|
|
1987
1993
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
1988
1994
|
}
|
|
1989
|
-
function
|
|
1990
|
-
let i2 =
|
|
1995
|
+
function Er(e5, { feature: t2, tags: n2 }, r2) {
|
|
1996
|
+
let i2 = wr(`startSpanManual`);
|
|
1991
1997
|
if (!i2) return r2;
|
|
1992
1998
|
let a2 = i2.startSpanManual({ name: e5, tags: { feature: t2, ...n2 } });
|
|
1993
1999
|
return r2.then(() => a2.end(), (e6) => a2.fail(e6)), r2;
|
|
1994
2000
|
}
|
|
1995
|
-
var
|
|
2001
|
+
var Dr = class extends import_react.Component {
|
|
1996
2002
|
state = { hasError: false };
|
|
1997
2003
|
static getDerivedStateFromError() {
|
|
1998
2004
|
return { hasError: true };
|
|
1999
2005
|
}
|
|
2000
2006
|
componentDidCatch(e5, t2) {
|
|
2001
|
-
|
|
2007
|
+
Tr(e5, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
2002
2008
|
}
|
|
2003
2009
|
render() {
|
|
2004
2010
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
2005
2011
|
}
|
|
2006
2012
|
};
|
|
2007
|
-
function
|
|
2013
|
+
function Or(e5) {
|
|
2008
2014
|
let t2 = e5;
|
|
2009
|
-
|
|
2015
|
+
return t2.__state || (t2.__state = { status: `pending` }, t2.then((e6) => {
|
|
2010
2016
|
t2.__state = { status: `fulfilled`, value: e6 };
|
|
2011
2017
|
}, (e6) => {
|
|
2012
2018
|
t2.__state = { status: `rejected`, reason: e6 };
|
|
2013
|
-
})), t2.__state
|
|
2014
|
-
|
|
2019
|
+
})), t2.__state;
|
|
2020
|
+
}
|
|
2021
|
+
function kr(e5) {
|
|
2022
|
+
let t2 = Or(e5);
|
|
2023
|
+
if (t2.status === `fulfilled`) return t2.value;
|
|
2024
|
+
throw t2.status === `rejected` ? t2.reason : e5;
|
|
2015
2025
|
}
|
|
2016
|
-
function
|
|
2026
|
+
function Ar(e5) {
|
|
2017
2027
|
let t2 = Promise.resolve(e5);
|
|
2018
2028
|
return t2.__state = { status: `fulfilled`, value: e5 }, t2;
|
|
2019
2029
|
}
|
|
2020
|
-
var
|
|
2021
|
-
function
|
|
2022
|
-
let r2 =
|
|
2023
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
2030
|
+
var jr = /* @__PURE__ */ new WeakMap();
|
|
2031
|
+
function Mr(e5, t2, n2) {
|
|
2032
|
+
let r2 = jr.get(e5);
|
|
2033
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), jr.set(e5, r2));
|
|
2024
2034
|
let i2 = r2.get(t2);
|
|
2025
2035
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
2026
2036
|
let a2 = i2.get(n2);
|
|
2027
2037
|
if (!a2) {
|
|
2028
2038
|
let r3 = e5;
|
|
2029
|
-
a2 = r3.__state?.status === `fulfilled` ?
|
|
2039
|
+
a2 = r3.__state?.status === `fulfilled` ? Ar(t2(r3.__state.value)) : r3.__state?.status === `rejected` ? Ar(n2(r3.__state.reason)) : e5.then(t2, n2), i2.set(n2, a2);
|
|
2030
2040
|
}
|
|
2031
2041
|
return a2;
|
|
2032
2042
|
}
|
|
2033
2043
|
function Z(e5) {
|
|
2034
2044
|
return e5;
|
|
2035
2045
|
}
|
|
2036
|
-
var
|
|
2037
|
-
var
|
|
2038
|
-
function
|
|
2039
|
-
let t2 = e5.searchParams.get(
|
|
2046
|
+
var Nr = Z(`@wix/site-service-url`);
|
|
2047
|
+
var Pr = `appSectionParams`;
|
|
2048
|
+
function Fr(e5) {
|
|
2049
|
+
let t2 = e5.searchParams.get(Pr);
|
|
2040
2050
|
if (t2 === null) return e5;
|
|
2041
2051
|
let n2 = new URL(e5);
|
|
2042
|
-
n2.searchParams.delete(
|
|
2043
|
-
for (let [e6, r2] of Object.entries(
|
|
2052
|
+
n2.searchParams.delete(Pr);
|
|
2053
|
+
for (let [e6, r2] of Object.entries(Ir(t2))) typeof r2 == `string` && !n2.searchParams.has(e6) && n2.searchParams.set(e6, r2);
|
|
2044
2054
|
return n2;
|
|
2045
2055
|
}
|
|
2046
|
-
function
|
|
2056
|
+
function Ir(e5) {
|
|
2047
2057
|
try {
|
|
2048
2058
|
let t2 = JSON.parse(e5);
|
|
2049
2059
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
@@ -2051,16 +2061,16 @@ function Nr(e5) {
|
|
|
2051
2061
|
return {};
|
|
2052
2062
|
}
|
|
2053
2063
|
}
|
|
2054
|
-
var
|
|
2055
|
-
var
|
|
2064
|
+
var Lr = `bookings-uou:url-change`;
|
|
2065
|
+
var Rr = (e5) => {
|
|
2056
2066
|
let t2 = new URL(e5);
|
|
2057
2067
|
return t2.searchParams.sort(), t2.href;
|
|
2058
2068
|
};
|
|
2059
|
-
function
|
|
2069
|
+
function zr(e5, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
2060
2070
|
let r2 = globalThis.window;
|
|
2061
2071
|
if (!r2?.history) return;
|
|
2062
2072
|
let i2 = new URL(r2.location.href);
|
|
2063
|
-
if (
|
|
2073
|
+
if (Rr(i2) === Rr(e5)) return;
|
|
2064
2074
|
let a2 = { scrollY: r2.scrollY };
|
|
2065
2075
|
if (n2) r2.history.replaceState(a2, ``, e5.href);
|
|
2066
2076
|
else {
|
|
@@ -2071,54 +2081,54 @@ function Ir(e5, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
|
2071
2081
|
return;
|
|
2072
2082
|
}
|
|
2073
2083
|
}
|
|
2074
|
-
r2.dispatchEvent(new Event(
|
|
2084
|
+
r2.dispatchEvent(new Event(Lr));
|
|
2075
2085
|
}
|
|
2076
|
-
function
|
|
2086
|
+
function Br(e5) {
|
|
2077
2087
|
let t2 = globalThis.window;
|
|
2078
|
-
return t2 ? (t2.addEventListener(
|
|
2079
|
-
t2.removeEventListener(
|
|
2088
|
+
return t2 ? (t2.addEventListener(Lr, e5), t2.addEventListener(`popstate`, e5), () => {
|
|
2089
|
+
t2.removeEventListener(Lr, e5), t2.removeEventListener(`popstate`, e5);
|
|
2080
2090
|
}) : () => {
|
|
2081
2091
|
};
|
|
2082
2092
|
}
|
|
2083
|
-
var
|
|
2093
|
+
var Vr = (e5) => {
|
|
2084
2094
|
try {
|
|
2085
2095
|
return decodeURIComponent(e5);
|
|
2086
2096
|
} catch {
|
|
2087
2097
|
return e5;
|
|
2088
2098
|
}
|
|
2089
2099
|
};
|
|
2090
|
-
function
|
|
2100
|
+
function Hr(e5, t2) {
|
|
2091
2101
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
2092
|
-
return `./${
|
|
2102
|
+
return `./${Vr(new URL(e5).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
2093
2103
|
}
|
|
2094
|
-
function
|
|
2095
|
-
let e5 = (0, import_services_manager_react.useService)(
|
|
2096
|
-
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () =>
|
|
2104
|
+
function Ur() {
|
|
2105
|
+
let e5 = (0, import_services_manager_react.useService)(Nr), t2 = (0, import_react.useCallback)(() => e5.currentUrl, [e5]), n2 = (0, import_react.useSyncExternalStore)(Br, t2, t2), i2 = (0, import_react.useMemo)(() => Fr(new URL(n2)), [n2]), a2 = e5.siteUrl.replace(/\/$/, ``);
|
|
2106
|
+
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => Fr(new URL(e5.currentUrl)), getRelativeUrl: () => Hr(e5.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: zr };
|
|
2097
2107
|
}
|
|
2098
|
-
var Q = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
2099
|
-
var
|
|
2100
|
-
function
|
|
2108
|
+
var Q = { category: `category`, location: `location`, page: `page`, blob: `bookingSelection`, legacyBlob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
2109
|
+
var Wr = Z(`@wix/site-service-warmup-data`);
|
|
2110
|
+
function Gr() {
|
|
2101
2111
|
try {
|
|
2102
2112
|
return (0, import_services_manager_react.useGetService)();
|
|
2103
2113
|
} catch {
|
|
2104
2114
|
return null;
|
|
2105
2115
|
}
|
|
2106
2116
|
}
|
|
2107
|
-
function
|
|
2117
|
+
function Kr(e5) {
|
|
2108
2118
|
try {
|
|
2109
|
-
return e5 ? e5(
|
|
2119
|
+
return e5 ? e5(Wr) : null;
|
|
2110
2120
|
} catch {
|
|
2111
2121
|
return null;
|
|
2112
2122
|
}
|
|
2113
2123
|
}
|
|
2114
|
-
function
|
|
2115
|
-
let e5 =
|
|
2124
|
+
function qr() {
|
|
2125
|
+
let e5 = Kr(Gr()), t2 = typeof window > `u`;
|
|
2116
2126
|
return { scope: e5 ?? void 0, get: async (n2) => {
|
|
2117
2127
|
if (t2 || !e5) return null;
|
|
2118
2128
|
try {
|
|
2119
2129
|
return await e5.get(n2);
|
|
2120
2130
|
} catch (e6) {
|
|
2121
|
-
return
|
|
2131
|
+
return Tr(e6, { feature: Cr.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
|
|
2122
2132
|
}
|
|
2123
2133
|
}, set: (n2, r2) => {
|
|
2124
2134
|
if (t2 && e5) try {
|
|
@@ -2127,75 +2137,75 @@ function Wr() {
|
|
|
2127
2137
|
}
|
|
2128
2138
|
} };
|
|
2129
2139
|
}
|
|
2130
|
-
var
|
|
2131
|
-
var
|
|
2132
|
-
var
|
|
2133
|
-
function
|
|
2140
|
+
var Jr = Z(`@wix/site-service-locale`);
|
|
2141
|
+
var Yr = Z;
|
|
2142
|
+
var Xr = Yr(`@wix/viewer-service-multilingual`);
|
|
2143
|
+
function Zr() {
|
|
2134
2144
|
try {
|
|
2135
|
-
return
|
|
2145
|
+
return yr.getLanguage() ?? `en`;
|
|
2136
2146
|
} catch {
|
|
2137
2147
|
return `en`;
|
|
2138
2148
|
}
|
|
2139
2149
|
}
|
|
2140
|
-
function
|
|
2150
|
+
function Qr(e5) {
|
|
2141
2151
|
try {
|
|
2142
2152
|
return (0, import_services_manager_react.useService)(e5);
|
|
2143
2153
|
} catch {
|
|
2144
2154
|
return null;
|
|
2145
2155
|
}
|
|
2146
2156
|
}
|
|
2147
|
-
function
|
|
2148
|
-
let e5 =
|
|
2149
|
-
return t2?.multilingualEnabled && t2.currentLocale?.languageCode || e5?.language ||
|
|
2157
|
+
function $r() {
|
|
2158
|
+
let e5 = Qr(Jr), t2 = Qr(Xr);
|
|
2159
|
+
return t2?.multilingualEnabled && t2.currentLocale?.languageCode || e5?.language || Zr();
|
|
2150
2160
|
}
|
|
2151
|
-
var
|
|
2152
|
-
function
|
|
2153
|
-
return `${
|
|
2161
|
+
var ei = `bookings-uou`;
|
|
2162
|
+
function ti(e5) {
|
|
2163
|
+
return `${ei}:${e5}:categories:all`;
|
|
2154
2164
|
}
|
|
2155
|
-
var
|
|
2156
|
-
var
|
|
2157
|
-
var
|
|
2158
|
-
var
|
|
2159
|
-
function
|
|
2165
|
+
var ni = 5e3;
|
|
2166
|
+
var ri = 100;
|
|
2167
|
+
var ii = `wix-warmup-data`;
|
|
2168
|
+
var ai = null;
|
|
2169
|
+
function oi(e5) {
|
|
2160
2170
|
if (typeof document < `u`) try {
|
|
2161
|
-
let t2 = document.getElementById(
|
|
2162
|
-
return t2 ? (
|
|
2171
|
+
let t2 = document.getElementById(ii)?.textContent;
|
|
2172
|
+
return t2 ? (ai?.text !== t2 && (ai = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), ai.data[e5] ?? void 0) : void 0;
|
|
2163
2173
|
} catch {
|
|
2164
2174
|
return;
|
|
2165
2175
|
}
|
|
2166
2176
|
}
|
|
2167
|
-
var
|
|
2168
|
-
var
|
|
2169
|
-
var
|
|
2170
|
-
var
|
|
2171
|
-
function
|
|
2172
|
-
if (!e5) return
|
|
2173
|
-
let t2 =
|
|
2174
|
-
return t2 || (t2 =
|
|
2177
|
+
var si = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
2178
|
+
var ci = si();
|
|
2179
|
+
var li = /* @__PURE__ */ new WeakMap();
|
|
2180
|
+
var ui = /* @__PURE__ */ new WeakMap();
|
|
2181
|
+
function di(e5) {
|
|
2182
|
+
if (!e5) return ci;
|
|
2183
|
+
let t2 = li.get(e5);
|
|
2184
|
+
return t2 || (t2 = si(), li.set(e5, t2)), t2;
|
|
2175
2185
|
}
|
|
2176
|
-
function
|
|
2186
|
+
function fi({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
2177
2187
|
if (e5 === null) return n2();
|
|
2178
2188
|
if (typeof window > `u`) {
|
|
2179
2189
|
let r3 = () => n2().then((n3) => (t2.set(e5, n3), n3)), { scope: i3 } = t2;
|
|
2180
2190
|
if (!i3) return r3();
|
|
2181
|
-
let a3 =
|
|
2182
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
2191
|
+
let a3 = ui.get(i3);
|
|
2192
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), ui.set(i3, a3));
|
|
2183
2193
|
let o3 = a3.get(e5);
|
|
2184
2194
|
if (o3) return o3;
|
|
2185
2195
|
let s3 = r3();
|
|
2186
2196
|
return a3.set(e5, s3), s3.catch(() => a3.delete(e5)), s3;
|
|
2187
2197
|
}
|
|
2188
|
-
let i2 =
|
|
2198
|
+
let i2 = di(t2.scope), a2 = Date.now();
|
|
2189
2199
|
for (let [e6, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e6);
|
|
2190
2200
|
let o2 = i2.promises.get(e5);
|
|
2191
2201
|
if (o2 && !r2) return o2.promise;
|
|
2192
2202
|
r2 && i2.invalidatedWarmup.add(e5);
|
|
2193
2203
|
let s2 = !i2.invalidatedWarmup.has(e5);
|
|
2194
2204
|
if (s2) {
|
|
2195
|
-
let t3 =
|
|
2205
|
+
let t3 = oi(e5);
|
|
2196
2206
|
if (t3 !== void 0) {
|
|
2197
|
-
let n3 =
|
|
2198
|
-
return i2.promises.set(e5, { promise: n3, expiresAt: a2 +
|
|
2207
|
+
let n3 = Ar(t3);
|
|
2208
|
+
return i2.promises.set(e5, { promise: n3, expiresAt: a2 + ni }), n3;
|
|
2199
2209
|
}
|
|
2200
2210
|
}
|
|
2201
2211
|
let c2 = (async () => {
|
|
@@ -2205,26 +2215,26 @@ function li({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2205
2215
|
}
|
|
2206
2216
|
return n2();
|
|
2207
2217
|
})();
|
|
2208
|
-
i2.promises.size >=
|
|
2218
|
+
i2.promises.size >= ri && i2.promises.delete(i2.promises.keys().next().value);
|
|
2209
2219
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
2210
2220
|
return i2.promises.set(e5, l2), c2.then(() => {
|
|
2211
|
-
l2.expiresAt = Date.now() +
|
|
2221
|
+
l2.expiresAt = Date.now() + ni;
|
|
2212
2222
|
}, () => {
|
|
2213
2223
|
i2.promises.get(e5) === l2 && i2.promises.delete(e5);
|
|
2214
2224
|
}), c2;
|
|
2215
2225
|
}
|
|
2216
|
-
function
|
|
2226
|
+
function pi(e5) {
|
|
2217
2227
|
return gt(Object.assign(e5, { 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: `` }] } }));
|
|
2218
2228
|
}
|
|
2219
|
-
var
|
|
2220
|
-
function
|
|
2229
|
+
var mi = `@wix/auto_sdk_bookings_services`;
|
|
2230
|
+
function hi(e5) {
|
|
2221
2231
|
function t2({ host: t3 }) {
|
|
2222
|
-
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryCategories`, packageName:
|
|
2232
|
+
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.ServicesService.QueryCategories`, packageName: mi, migrationOptions: { optInTransformResponse: true }, url: pi({ protoPath: `/v2/services/categories/query`, data: e5, host: t3 }), data: e5 };
|
|
2223
2233
|
}
|
|
2224
2234
|
return t2;
|
|
2225
2235
|
}
|
|
2226
|
-
async function
|
|
2227
|
-
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 =
|
|
2236
|
+
async function gi(e5) {
|
|
2237
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = hi(Xe({ filter: e5?.filter }));
|
|
2228
2238
|
n2?.onSiteCall?.();
|
|
2229
2239
|
try {
|
|
2230
2240
|
let e6 = await t2.request(r2);
|
|
@@ -2234,70 +2244,70 @@ async function pi(e5) {
|
|
|
2234
2244
|
throw n2?.onError?.(e6), t3;
|
|
2235
2245
|
}
|
|
2236
2246
|
}
|
|
2237
|
-
function
|
|
2238
|
-
return (t2) =>
|
|
2247
|
+
function _i(e5) {
|
|
2248
|
+
return (t2) => gi(t2, { httpClient: e5 });
|
|
2239
2249
|
}
|
|
2240
|
-
var
|
|
2241
|
-
async function
|
|
2242
|
-
return [...(await
|
|
2250
|
+
var vi = ht(_i);
|
|
2251
|
+
async function yi() {
|
|
2252
|
+
return [...(await vi({ filter: { services: {} } })).categories ?? []].sort((e5, t2) => (e5.sortOrder ?? 0) - (t2.sortOrder ?? 0));
|
|
2243
2253
|
}
|
|
2244
|
-
function
|
|
2254
|
+
function bi({ isLoading: e5, hasError: t2, refetch: n2, children: r2 }) {
|
|
2245
2255
|
let i2 = { categoryItems: [], hasMultipleCategories: false, isLoading: e5, hasError: t2, refetch: n2, selectCategory: () => {
|
|
2246
2256
|
} };
|
|
2247
2257
|
return (0, import_jsx_runtime.jsx)($.Provider, { value: i2, children: r2 });
|
|
2248
2258
|
}
|
|
2249
|
-
function
|
|
2250
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2259
|
+
function xi({ refetch: e5, children: t2 }) {
|
|
2260
|
+
return (0, import_jsx_runtime.jsx)(bi, { isLoading: true, hasError: false, refetch: e5, children: t2 });
|
|
2251
2261
|
}
|
|
2252
|
-
function
|
|
2253
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2262
|
+
function Si({ refetch: e5, children: t2 }) {
|
|
2263
|
+
return (0, import_jsx_runtime.jsx)(bi, { isLoading: false, hasError: true, refetch: e5, children: t2 });
|
|
2254
2264
|
}
|
|
2255
|
-
function
|
|
2265
|
+
function Ci(e5) {
|
|
2256
2266
|
let t2 = e5?.$in ?? (e5?.$eq == null ? [] : [e5.$eq]);
|
|
2257
2267
|
return [...new Set(t2.filter((e6) => typeof e6 == `string` && e6 !== ``))].sort().join(`,`);
|
|
2258
2268
|
}
|
|
2259
|
-
function
|
|
2269
|
+
function wi(e5) {
|
|
2260
2270
|
return e5 ? e5.split(`,`) : null;
|
|
2261
2271
|
}
|
|
2262
|
-
var
|
|
2263
|
-
function
|
|
2272
|
+
var Ti = Yr(`@wix/site-service-business-logger`);
|
|
2273
|
+
function Ei(e5) {
|
|
2264
2274
|
return { evid: 32, src: 16, endpoint: ``, params: e5 };
|
|
2265
2275
|
}
|
|
2266
|
-
var
|
|
2276
|
+
var Di = function(e5) {
|
|
2267
2277
|
return e5.BOOK_ONLINE = `bookingsBookOnline`, e5.SERVICE_PAGE = `bookingsServicePage`, e5.CALENDAR_PAGE = `bookingsCalendar`, e5.FORM_PAGE = `bookingsForm`, e5;
|
|
2268
2278
|
}({});
|
|
2269
|
-
var
|
|
2270
|
-
|
|
2271
|
-
var
|
|
2272
|
-
var
|
|
2273
|
-
let { reportBi: t2 } = (0, import_services_manager_react.useService)(
|
|
2279
|
+
var Oi = { 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` };
|
|
2280
|
+
Di.BOOK_ONLINE;
|
|
2281
|
+
var ki = `new_bookings_server`;
|
|
2282
|
+
var Ai = (e5) => {
|
|
2283
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(Ti);
|
|
2274
2284
|
return (0, import_react.useCallback)((n2) => {
|
|
2275
|
-
t2({ widget_name: e5, bookingsPlatform:
|
|
2285
|
+
t2({ widget_name: e5, bookingsPlatform: ki, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
2276
2286
|
}, [t2, e5]);
|
|
2277
2287
|
};
|
|
2278
|
-
var
|
|
2279
|
-
let n2 =
|
|
2288
|
+
var ji = (e5, t2 = true) => {
|
|
2289
|
+
let n2 = Ai(e5), { getParsedUrl: r2 } = Ur(), i2 = (0, import_react.useRef)(false);
|
|
2280
2290
|
(0, import_react.useEffect)(() => {
|
|
2281
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
2291
|
+
t2 && !i2.current && (i2.current = true, n2(Ei({ referralInfo: r2().searchParams.get(Q.referral) ?? void 0 })));
|
|
2282
2292
|
}, [t2, n2, r2]);
|
|
2283
2293
|
};
|
|
2284
2294
|
var $ = (0, import_react.createContext)(null);
|
|
2285
|
-
var
|
|
2286
|
-
function
|
|
2295
|
+
var Mi = `useCategoriesContext must be used within CategoriesContextProvider`;
|
|
2296
|
+
function Ni() {
|
|
2287
2297
|
let e5 = (0, import_react.useContext)($);
|
|
2288
|
-
if (!e5) throw Error(
|
|
2298
|
+
if (!e5) throw Error(Mi);
|
|
2289
2299
|
return e5;
|
|
2290
2300
|
}
|
|
2291
|
-
function
|
|
2301
|
+
function Pi(e5, t2) {
|
|
2292
2302
|
return { categoryId: e5._id ?? null, categoryName: e5.name ?? null, isSelected: e5._id != null && e5._id === t2 };
|
|
2293
2303
|
}
|
|
2294
|
-
var
|
|
2295
|
-
var
|
|
2296
|
-
function
|
|
2297
|
-
let { categories: s2, hasError: c2 } =
|
|
2298
|
-
let e6 =
|
|
2304
|
+
var Fi = (e5) => ({ categories: e5, hasError: false });
|
|
2305
|
+
var Ii = () => ({ categories: [], hasError: true });
|
|
2306
|
+
function Li({ categoriesPromise: e5, categoryIdsKey: t2, refetch: n2, children: i2 }) {
|
|
2307
|
+
let { categories: s2, hasError: c2 } = kr(e5), l2 = (0, import_react.useMemo)(() => {
|
|
2308
|
+
let e6 = wi(t2);
|
|
2299
2309
|
return e6 ? s2.filter((t3) => t3._id && e6.includes(t3._id)) : s2;
|
|
2300
|
-
}, [s2, t2]), { pathname: u2, searchParams: d2, pushUrl: p2, getExternalBaseUrl: m2 } =
|
|
2310
|
+
}, [s2, t2]), { pathname: u2, searchParams: d2, pushUrl: p2, getExternalBaseUrl: m2 } = Ur(), h2 = d2.get(Q.category), g2 = (0, import_react.useCallback)((e6, t3) => {
|
|
2301
2311
|
let n3 = new URLSearchParams(d2);
|
|
2302
2312
|
e6 ? n3.set(Q.category, e6) : n3.delete(Q.category), n3.delete(Q.page);
|
|
2303
2313
|
let r2 = n3.toString(), i3 = r2 ? `${u2}?${r2}` : u2;
|
|
@@ -2306,15 +2316,15 @@ function Pi({ categoriesPromise: e5, categoryIdsKey: t2, refetch: n2, children:
|
|
|
2306
2316
|
(0, import_react.useEffect)(() => {
|
|
2307
2317
|
v2 && g2(null, true);
|
|
2308
2318
|
}, [v2, g2]);
|
|
2309
|
-
let y2 = l2.filter((e6) => e6._id).length > 1, b2 = (0, import_react.useMemo)(() => ({ categoryItems: l2.map((e6) =>
|
|
2319
|
+
let y2 = l2.filter((e6) => e6._id).length > 1, b2 = (0, import_react.useMemo)(() => ({ categoryItems: l2.map((e6) => Pi(e6, h2)), hasMultipleCategories: y2, isLoading: false, hasError: c2, refetch: n2, selectCategory: _2 }), [l2, h2, y2, c2, n2, _2]);
|
|
2310
2320
|
return (0, import_jsx_runtime.jsx)($.Provider, { value: b2, children: i2 });
|
|
2311
2321
|
}
|
|
2312
|
-
function
|
|
2313
|
-
Oi
|
|
2314
|
-
let a2 =
|
|
2315
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2322
|
+
function Ri({ categoriesPicker: e5, refreshSignal: n2 = 0, children: i2 }) {
|
|
2323
|
+
ji(Oi.CATEGORIES);
|
|
2324
|
+
let a2 = qr(), s2 = $r(), l2 = Ci(e5?.categoryId), [u2, d2] = (0, import_react.useState)(0), p2 = (0, import_react.useMemo)(() => Mr(fi({ key: ti(s2), refresh: u2 !== 0 || n2 !== 0, warmupData: a2, fetchData: () => Er(`categories-context-load`, { feature: Cr.categories }, yi()) }), Fi, Ii), [u2, n2, s2]), m2 = (0, import_react.useCallback)(() => d2((e6) => e6 + 1), []);
|
|
2325
|
+
return (0, import_jsx_runtime.jsx)(Dr, { fallback: (0, import_jsx_runtime.jsx)(Si, { refetch: m2, children: i2 }), feature: Cr.categories, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(xi, { refetch: m2, children: i2 }), children: (0, import_jsx_runtime.jsx)(Li, { categoriesPromise: p2, categoryIdsKey: l2, refetch: m2, children: i2 }) }) });
|
|
2316
2326
|
}
|
|
2317
|
-
var
|
|
2327
|
+
var zi = pn(`73a358c8-c2c8-4342-bf64-9079e92178fc`);
|
|
2318
2328
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2319
2329
|
0 && (module.exports = {
|
|
2320
2330
|
CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR,
|