@anywayseo/tools 4.2.2 → 5.1.0
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/dist/components/base/index.d.ts +1 -0
- package/dist/components/base/link/index.d.ts +2 -0
- package/dist/components/base/link/utils.d.ts +1 -0
- package/dist/components/game-info/utils.d.ts +2 -2
- package/dist/components/index.cjs +3 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/layout/header/locale-switcher/icons/earth/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/france/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/germany/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/globe/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/index.d.ts +6 -0
- package/dist/components/layout/header/locale-switcher/icons/italy/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/russia/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/index.d.ts +8 -0
- package/dist/components/layout/header/locale-switcher/utils.d.ts +2 -0
- package/dist/components/layout/header/navigation/desktop/index.d.ts +1 -1
- package/dist/components/layout/header/navigation/index.d.ts +1 -1
- package/dist/components/layout/header/navigation/mobile/index.d.ts +1 -1
- package/dist/components/seo/index.d.ts +2 -3
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.mjs +4 -2
- package/dist/hooks/use-localization/index.d.ts +9 -0
- package/dist/i18n/index.cjs +11 -5
- package/dist/i18n/index.d.ts +3 -2
- package/dist/i18n/index.mjs +11 -5
- package/dist/i18n/resources/fr/index.d.ts +112 -0
- package/dist/index-At00w6EN.js +9 -0
- package/dist/index-B9GEoC68.js +63 -0
- package/dist/{index-DAbZBo7_.mjs → index-BCuXOiT9.mjs} +201 -67
- package/dist/{index-BPLxhZG_.js → index-BHfpWNqh.js} +183 -73
- package/dist/{index-DF_u_tzx.js → index-BIdYBT1G.js} +7 -3
- package/dist/{index-MpNfBHkQ.mjs → index-BJRvnR8Q.mjs} +1 -5
- package/dist/index-BRVKhbs6.mjs +6 -0
- package/dist/index-BmaWfWLV.mjs +10 -0
- package/dist/{index-BV0hDmYP.js → index-BnmGE5_x.js} +3 -2
- package/dist/{index-DPO0aIC3.mjs → index-Bu4S7kG8.mjs} +7 -10
- package/dist/index-BzbpMLDD.mjs +23 -0
- package/dist/{index-DVcQxWMZ.js → index-C6MG_f24.js} +0 -4
- package/dist/{index-BE9gNdXx.mjs → index-CACDltm3.mjs} +183 -73
- package/dist/index-CYr1ct1t.js +93 -0
- package/dist/index-CbuiYkSg.js +5 -0
- package/dist/{index-CcsbqDXL.mjs → index-CrmmG8yy.mjs} +7 -3
- package/dist/{index-N8nXj4-i.js → index-D0yXUsJz.js} +220 -86
- package/dist/{index-DuQjQMNN.js → index-D34TfBTR.js} +7 -10
- package/dist/{index-CkTgVjZS.mjs → index-QazOxABc.mjs} +3 -2
- package/dist/index-WFgDSB1A.js +22 -0
- package/dist/index-cQqALZIW.mjs +94 -0
- package/dist/index-tJcccH0B.mjs +64 -0
- package/dist/index.cjs +43 -31
- package/dist/index.mjs +33 -21
- package/dist/providers/index.cjs +4 -2
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.mjs +5 -3
- package/dist/providers/page-provider/index.d.ts +11 -0
- package/dist/providers/site-provider/index.d.ts +5 -4
- package/dist/types/api/index.d.ts +2 -2
- package/dist/types/components/icon/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/locale-switcher/index.d.ts +5 -0
- package/dist/types/components/navigation/index.d.ts +9 -10
- package/dist/types/i18n/index.d.ts +7 -1
- package/dist/types/site/index.d.ts +15 -13
- package/dist/utils/api/index.d.ts +5 -0
- package/dist/utils/date/index.d.ts +4 -3
- package/dist/utils/index.cjs +23 -16
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.mjs +16 -9
- package/dist/utils/navigation/index.d.ts +2 -2
- package/dist/utils/numbers/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/components/layout/header/navigation/types.d.ts +0 -4
- package/dist/index-BClxYYix.js +0 -40
- package/dist/index-BNb-P8a6.mjs +0 -17
- package/dist/index-BhsXlbd8.js +0 -16
- package/dist/index-Ca_M-II5.mjs +0 -41
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
3
|
const react$1 = require("@chakra-ui/react");
|
|
4
4
|
const reactI18next = require("react-i18next");
|
|
5
|
-
const
|
|
6
|
-
const index$2 = require("./index-DVcQxWMZ.js");
|
|
7
|
-
const i18n = require("./index-BPLxhZG_.js");
|
|
8
|
-
const react$2 = require("@mdx-js/react");
|
|
9
|
-
const index = require("./index-BhsXlbd8.js");
|
|
5
|
+
const index = require("./index-B9GEoC68.js");
|
|
10
6
|
const react = require("react");
|
|
7
|
+
const index$3 = require("./index-C6MG_f24.js");
|
|
8
|
+
const index$5 = require("./index-BHfpWNqh.js");
|
|
9
|
+
const react$2 = require("@mdx-js/react");
|
|
11
10
|
const icons = require("@chakra-ui/icons");
|
|
12
|
-
const index$
|
|
13
|
-
const index$
|
|
14
|
-
const
|
|
11
|
+
const index$4 = require("./index-D34TfBTR.js");
|
|
12
|
+
const index$2 = require("./index-At00w6EN.js");
|
|
13
|
+
const index$1 = require("./index-BnmGE5_x.js");
|
|
14
|
+
const i18next = require("i18next");
|
|
15
15
|
const Markdown = require("react-markdown");
|
|
16
16
|
const ONE_LINE_HEIGHT = 24;
|
|
17
17
|
const Bio = ({ content, maxLines = 1 }) => {
|
|
@@ -81,11 +81,11 @@ const LinkButton = ({
|
|
|
81
81
|
...boxProps
|
|
82
82
|
}) => {
|
|
83
83
|
var _a;
|
|
84
|
-
const {
|
|
84
|
+
const { config } = index.useSiteContext();
|
|
85
85
|
const { color, invertedColor } = index$1.usePrimaryColors();
|
|
86
|
-
const isInvertedColor = (_a =
|
|
87
|
-
const isInternalLink = linkType === "redirect" || (href
|
|
88
|
-
const LinkComponent = isInternalLink ?
|
|
86
|
+
const isInvertedColor = (_a = config == null ? void 0 : config.theme) == null ? void 0 : _a.isInvertedColor;
|
|
87
|
+
const isInternalLink = linkType === "redirect" || index$2.isRelativePath(href);
|
|
88
|
+
const LinkComponent = isInternalLink ? index.Link : react$1.Link;
|
|
89
89
|
const hrefKey = isInternalLink ? "to" : "href";
|
|
90
90
|
const hrefValue = linkType === "redirect" ? `/follow?to=${href}` : href;
|
|
91
91
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -95,7 +95,7 @@ const LinkButton = ({
|
|
|
95
95
|
size: size === "auto" ? { base: "sm", md: "lg" } : size,
|
|
96
96
|
bg: "brand.500",
|
|
97
97
|
color: isInvertedColor ? invertedColor : color,
|
|
98
|
-
animation: animation ? index$
|
|
98
|
+
animation: animation ? index$3.Animation[animation.type](animation.params) : void 0,
|
|
99
99
|
textTransform,
|
|
100
100
|
_hover: { textDecoration, bg: "brand.200" },
|
|
101
101
|
_active: { transform: "scale(0.95)" },
|
|
@@ -356,7 +356,7 @@ const GameCardGrid = ({
|
|
|
356
356
|
}) => {
|
|
357
357
|
let sortedItems = items;
|
|
358
358
|
if (order === "random") {
|
|
359
|
-
sortedItems = [...items].sort(randomSeed ? index$
|
|
359
|
+
sortedItems = [...items].sort(randomSeed ? index$4.getSeededRandomComparator(randomSeed) : index$4.randomComparator);
|
|
360
360
|
}
|
|
361
361
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
362
362
|
Grid,
|
|
@@ -505,10 +505,10 @@ const GameInfoItem = ({ title, value }) => {
|
|
|
505
505
|
};
|
|
506
506
|
const VISIBLE_LANGUAGE_NUMBER = 5;
|
|
507
507
|
function stringifyHasFeature(value) {
|
|
508
|
-
return
|
|
508
|
+
return i18next.t(`gameInfo:value.boolean.${value}`);
|
|
509
509
|
}
|
|
510
510
|
function stringifyVolatility(value) {
|
|
511
|
-
return
|
|
511
|
+
return i18next.t(`gameInfo:value.volatility.${value}`);
|
|
512
512
|
}
|
|
513
513
|
function stringifyArray(array) {
|
|
514
514
|
return array.join(", ");
|
|
@@ -516,35 +516,35 @@ function stringifyArray(array) {
|
|
|
516
516
|
function stringifyLanguageArray(languages) {
|
|
517
517
|
return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
|
|
518
518
|
}
|
|
519
|
-
function getGameInfoItemValue(key, value, currency) {
|
|
519
|
+
function getGameInfoItemValue(key, value, locale, currency) {
|
|
520
520
|
let formattedValue = "";
|
|
521
521
|
if (typeof value !== "string") {
|
|
522
|
-
if (key ===
|
|
523
|
-
formattedValue = index$
|
|
522
|
+
if (key === index$5.GameCharacteristic.Rtp) {
|
|
523
|
+
formattedValue = index$4.formatNumber(value, { percent: "real", precision: 3 });
|
|
524
524
|
}
|
|
525
|
-
if (key ===
|
|
525
|
+
if (key === index$5.GameCharacteristic.MinBet || key === index$5.GameCharacteristic.MaxBet || key === index$5.GameCharacteristic.MaxWin) {
|
|
526
526
|
if (Array.isArray(currency)) {
|
|
527
527
|
const [primary, ...secondaries] = currency || ["USD"];
|
|
528
|
-
const primaryValue = index$
|
|
529
|
-
formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => index$
|
|
528
|
+
const primaryValue = index$4.formatNumber(value, { currency: primary });
|
|
529
|
+
formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => index$4.getCurrencySymbol(currency2, locale)).join(", ")})` : primaryValue;
|
|
530
530
|
} else {
|
|
531
|
-
formattedValue = index$
|
|
531
|
+
formattedValue = index$4.formatNumber(value, { currency });
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
if (key ===
|
|
534
|
+
if (key === index$5.GameCharacteristic.Compatibility || key === index$5.GameCharacteristic.BonusFeatures) {
|
|
535
535
|
formattedValue = stringifyArray(value);
|
|
536
536
|
}
|
|
537
|
-
if (key ===
|
|
537
|
+
if (key === index$5.GameCharacteristic.Languages) {
|
|
538
538
|
formattedValue = stringifyLanguageArray(value);
|
|
539
539
|
}
|
|
540
540
|
if (typeof value === "boolean") {
|
|
541
541
|
formattedValue = stringifyHasFeature(value);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
if (key ===
|
|
545
|
-
formattedValue = index$
|
|
544
|
+
if (key === index$5.GameCharacteristic.ReleaseDate) {
|
|
545
|
+
formattedValue = index$4.formatDate({ value, locale, options: { year: "numeric", month: "long" } });
|
|
546
546
|
}
|
|
547
|
-
if (key ===
|
|
547
|
+
if (key === index$5.GameCharacteristic.Volatility) {
|
|
548
548
|
formattedValue = stringifyVolatility(value);
|
|
549
549
|
}
|
|
550
550
|
if (!formattedValue) {
|
|
@@ -553,9 +553,11 @@ function getGameInfoItemValue(key, value, currency) {
|
|
|
553
553
|
return formattedValue;
|
|
554
554
|
}
|
|
555
555
|
const GameInfo = ({ info }) => {
|
|
556
|
-
const { metadata } = index.useSiteContext();
|
|
557
|
-
const { currency } = metadata;
|
|
558
556
|
const { t } = reactI18next.useTranslation("gameInfo");
|
|
557
|
+
const { localization } = index.useSiteContext();
|
|
558
|
+
const { currentLocale } = index.usePageContext();
|
|
559
|
+
const locale = currentLocale.code;
|
|
560
|
+
const currency = localization.currency;
|
|
559
561
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
560
562
|
react$1.Box,
|
|
561
563
|
{
|
|
@@ -574,7 +576,7 @@ const GameInfo = ({ info }) => {
|
|
|
574
576
|
return null;
|
|
575
577
|
}
|
|
576
578
|
const feature = itemKey;
|
|
577
|
-
const value = getGameInfoItemValue(feature, itemValue, currency);
|
|
579
|
+
const value = getGameInfoItemValue(feature, itemValue, locale, currency);
|
|
578
580
|
return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`), value }, itemKey);
|
|
579
581
|
})
|
|
580
582
|
] }, group)) })
|
|
@@ -607,19 +609,20 @@ const Logo = () => {
|
|
|
607
609
|
const Brand$1 = ({ brand }) => {
|
|
608
610
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { position: "relative", my: 2, py: 8, children: [
|
|
609
611
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Divider, {}),
|
|
610
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { display: "flex", bgColor: react$1.useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
612
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { display: "flex", bgColor: react$1.useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsxRuntime.jsx(index.Link, { to: "/", children: brand }) })
|
|
611
613
|
] });
|
|
612
614
|
};
|
|
613
615
|
const Copyright = () => {
|
|
614
616
|
const { metadata } = index.useSiteContext();
|
|
615
|
-
const { name: siteName } = metadata;
|
|
616
617
|
const { t } = reactI18next.useTranslation("footer");
|
|
617
|
-
|
|
618
|
+
const siteName = metadata.name;
|
|
619
|
+
const lang = metadata.lang;
|
|
620
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "small", colorScheme: "gray", display: "flex", align: "center", justifyContent: "center", children: t("copyright", { year: index$4.getCurrentYear(lang), siteName }) });
|
|
618
621
|
};
|
|
619
622
|
const Disclaimer = () => {
|
|
620
623
|
const { metadata } = index.useSiteContext();
|
|
621
|
-
const { name: siteName } = metadata;
|
|
622
624
|
const { t } = reactI18next.useTranslation("footer");
|
|
625
|
+
const siteName = metadata.name;
|
|
623
626
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { as: "small", colorScheme: "gray", fontSize: "sm", children: [
|
|
624
627
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", fontWeight: "bold", color: "red.600", children: t("disclaimer.title") }),
|
|
625
628
|
t("disclaimer.description", { siteName })
|
|
@@ -640,29 +643,29 @@ const Navigation$1 = ({ menu }) => {
|
|
|
640
643
|
spacing: 4,
|
|
641
644
|
justifyItems: { base: "flex-start", md: "center" },
|
|
642
645
|
justifyContent: "space-between",
|
|
643
|
-
children: menu.map(({
|
|
646
|
+
children: menu.map(({ slug, label }, index$12) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
644
647
|
react$1.Text,
|
|
645
648
|
{
|
|
646
|
-
as:
|
|
647
|
-
to:
|
|
649
|
+
as: index.Link,
|
|
650
|
+
to: slug,
|
|
648
651
|
fontSize: "md",
|
|
649
652
|
fontWeight: "semibold",
|
|
650
653
|
colorScheme: "gray",
|
|
651
654
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
652
655
|
children: label
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
) }, index2))
|
|
656
|
+
}
|
|
657
|
+
) }, index$12))
|
|
656
658
|
}
|
|
657
659
|
);
|
|
658
660
|
};
|
|
659
661
|
const Footer = () => {
|
|
660
|
-
var _a, _b
|
|
661
|
-
const {
|
|
662
|
-
const
|
|
663
|
-
const
|
|
664
|
-
const
|
|
665
|
-
const
|
|
662
|
+
var _a, _b;
|
|
663
|
+
const { navigation, config } = index.useSiteContext();
|
|
664
|
+
const { currentLocale } = index.usePageContext();
|
|
665
|
+
const menu = navigation.footer[currentLocale.code] ?? [];
|
|
666
|
+
const extra = (_a = config == null ? void 0 : config.footer) == null ? void 0 : _a.extra;
|
|
667
|
+
const showDisclaimer = ((_b = config == null ? void 0 : config.footer) == null ? void 0 : _b.showDisclaimer) ?? true;
|
|
668
|
+
const hasNavigation = !!menu.length;
|
|
666
669
|
const hasExtra = !!extra;
|
|
667
670
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
668
671
|
react$1.Box,
|
|
@@ -672,7 +675,7 @@ const Footer = () => {
|
|
|
672
675
|
color: react$1.useColorModeValue("gray.700", "gray.200"),
|
|
673
676
|
py: 4,
|
|
674
677
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
|
|
675
|
-
hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(Navigation$1, { menu
|
|
678
|
+
hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(Navigation$1, { menu }),
|
|
676
679
|
hasExtra && /* @__PURE__ */ jsxRuntime.jsx(Extra, { children: extra }),
|
|
677
680
|
showDisclaimer && /* @__PURE__ */ jsxRuntime.jsx(Disclaimer, {}),
|
|
678
681
|
/* @__PURE__ */ jsxRuntime.jsx(Brand$1, { brand: /* @__PURE__ */ jsxRuntime.jsx(Logo, {}) }),
|
|
@@ -682,15 +685,111 @@ const Footer = () => {
|
|
|
682
685
|
);
|
|
683
686
|
};
|
|
684
687
|
const Brand = ({ brand }) => {
|
|
685
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
688
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Link, { to: "/", children: brand });
|
|
689
|
+
};
|
|
690
|
+
const FranceIcon = (props) => {
|
|
691
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
|
|
692
|
+
/* @__PURE__ */ jsxRuntime.jsx("mask", { id: "circleFlagsFr0", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
|
|
693
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { mask: "url(#circleFlagsFr0)", children: [
|
|
694
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#eee", d: "M167 0h178l25.9 252.3L345 512H167l-29.8-253.4z" }),
|
|
695
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#0052b4", d: "M0 0h167v512H0z" }),
|
|
696
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#d80027", d: "M345 0h167v512H345z" })
|
|
697
|
+
] })
|
|
698
|
+
] });
|
|
699
|
+
};
|
|
700
|
+
const GermanyIcon = (props) => {
|
|
701
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
|
|
702
|
+
/* @__PURE__ */ jsxRuntime.jsx("mask", { id: "circleFlagsDe0", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
|
|
703
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { mask: "url(#circleFlagsDe0)", children: [
|
|
704
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#ffda44", d: "m0 345l256.7-25.5L512 345v167H0z" }),
|
|
705
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#d80027", d: "m0 167l255-23l257 23v178H0z" }),
|
|
706
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#333", d: "M0 0h512v167H0z" })
|
|
707
|
+
] })
|
|
708
|
+
] });
|
|
709
|
+
};
|
|
710
|
+
const GlobeIcon = (props) => {
|
|
711
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 496", width: "1em", height: "1em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
712
|
+
"path",
|
|
713
|
+
{
|
|
714
|
+
fill: "currentColor",
|
|
715
|
+
d: "M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64m324.7-96c-28.6-67.9-86.5-120.4-158-141.6c24.4 33.8 41.2 84.7 50 141.6zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6M487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64M120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64m39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6M19.3 352c28.6 67.9 86.5 120.4 158 141.6c-24.4-33.8-41.2-84.7-50-141.6z"
|
|
716
|
+
}
|
|
717
|
+
) });
|
|
718
|
+
};
|
|
719
|
+
const ItalyIcon = (props) => {
|
|
720
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
|
|
721
|
+
/* @__PURE__ */ jsxRuntime.jsx("mask", { id: "circleFlagsIt0", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
|
|
722
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { mask: "url(#circleFlagsIt0)", children: [
|
|
723
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#eee", d: "M167 0h178l25.9 252.3L345 512H167l-29.8-253.4z" }),
|
|
724
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#6da544", d: "M0 0h167v512H0z" }),
|
|
725
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#d80027", d: "M345 0h167v512H345z" })
|
|
726
|
+
] })
|
|
727
|
+
] });
|
|
728
|
+
};
|
|
729
|
+
const RussiaIcon = (props) => {
|
|
730
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
|
|
731
|
+
/* @__PURE__ */ jsxRuntime.jsx("mask", { id: "circleFlagsRu0", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
|
|
732
|
+
/* @__PURE__ */ jsxRuntime.jsxs("g", { mask: "url(#circleFlagsRu0)", children: [
|
|
733
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#0052b4", d: "M512 170v172l-256 32L0 342V170l256-32z" }),
|
|
734
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#eee", d: "M512 0v170H0V0Z" }),
|
|
735
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#d80027", d: "M512 342v170H0V342Z" })
|
|
736
|
+
] })
|
|
737
|
+
] });
|
|
738
|
+
};
|
|
739
|
+
function getMappedIcon(code) {
|
|
740
|
+
let icon = GlobeIcon;
|
|
741
|
+
switch (code) {
|
|
742
|
+
case "de":
|
|
743
|
+
icon = GermanyIcon;
|
|
744
|
+
break;
|
|
745
|
+
case "it":
|
|
746
|
+
icon = ItalyIcon;
|
|
747
|
+
break;
|
|
748
|
+
case "ru":
|
|
749
|
+
icon = RussiaIcon;
|
|
750
|
+
break;
|
|
751
|
+
case "fr":
|
|
752
|
+
icon = FranceIcon;
|
|
753
|
+
break;
|
|
754
|
+
case "en":
|
|
755
|
+
default:
|
|
756
|
+
icon = GlobeIcon;
|
|
757
|
+
break;
|
|
758
|
+
}
|
|
759
|
+
return icon;
|
|
760
|
+
}
|
|
761
|
+
const LocaleSwitcher = ({ currentLocale, locales }) => {
|
|
762
|
+
const localeCode = currentLocale.code;
|
|
763
|
+
const localeIcon = getMappedIcon(localeCode);
|
|
764
|
+
const localeMenuItems = react.useMemo(
|
|
765
|
+
() => locales.map((locale) => ({ ...locale, icon: getMappedIcon(locale.code) })),
|
|
766
|
+
[locales]
|
|
767
|
+
);
|
|
768
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Menu, { placement: "bottom-end", children: [
|
|
769
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
770
|
+
react$1.MenuButton,
|
|
771
|
+
{
|
|
772
|
+
as: react$1.Button,
|
|
773
|
+
rightIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}),
|
|
774
|
+
w: { base: 20, md: "28" },
|
|
775
|
+
px: { base: 1, md: 4 },
|
|
776
|
+
size: { base: "sm", md: "lg" },
|
|
777
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.HStack, { children: [
|
|
778
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { as: localeIcon }),
|
|
779
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: localeCode.toUpperCase() })
|
|
780
|
+
] })
|
|
781
|
+
}
|
|
782
|
+
),
|
|
783
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.MenuList, { minW: "fit-content", children: localeMenuItems.map(({ code, name, icon }) => /* @__PURE__ */ jsxRuntime.jsx(react$1.MenuItem, { as: index.Link, to: `/${code}`, icon: /* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { as: icon, w: 4, h: 4 }), children: name }, code)) })
|
|
784
|
+
] });
|
|
686
785
|
};
|
|
687
|
-
const NavLink = react.forwardRef(({
|
|
786
|
+
const NavLink = react.forwardRef(({ slug, label }, ref) => {
|
|
688
787
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
689
788
|
react$1.Text,
|
|
690
789
|
{
|
|
691
790
|
ref,
|
|
692
|
-
as:
|
|
693
|
-
to:
|
|
791
|
+
as: index.Link,
|
|
792
|
+
to: slug,
|
|
694
793
|
p: 2,
|
|
695
794
|
fontWeight: "semibold",
|
|
696
795
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
@@ -699,7 +798,7 @@ const NavLink = react.forwardRef(({ path, label }, ref) => {
|
|
|
699
798
|
);
|
|
700
799
|
});
|
|
701
800
|
NavLink.displayName = "NavLink";
|
|
702
|
-
const NavList$1 = ({
|
|
801
|
+
const NavList$1 = ({ slug, label, children }) => {
|
|
703
802
|
const background = react$1.useColorModeValue("white", "gray.800");
|
|
704
803
|
const backgroundHover = react$1.useColorModeValue("brand.50", "gray.900");
|
|
705
804
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Popover, { trigger: "hover", placement: "bottom-start", children: [
|
|
@@ -714,22 +813,37 @@ const NavList$1 = ({ path, label, children }) => {
|
|
|
714
813
|
children: label
|
|
715
814
|
}
|
|
716
815
|
) }),
|
|
717
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
816
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
817
|
+
react$1.PopoverContent,
|
|
818
|
+
{
|
|
819
|
+
p: 2,
|
|
820
|
+
border: 0,
|
|
821
|
+
minW: "sm",
|
|
822
|
+
maxH: 300,
|
|
823
|
+
overflowY: "auto",
|
|
824
|
+
rounded: "xl",
|
|
825
|
+
boxShadow: "xl",
|
|
826
|
+
bg: background,
|
|
827
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child, index$12) => {
|
|
828
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: index.Link, to: index$2.buildPath(child.slug, slug), p: 2, role: "group", children: [
|
|
829
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
|
|
830
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
831
|
+
react$1.Flex,
|
|
832
|
+
{
|
|
833
|
+
flex: 1,
|
|
834
|
+
justify: "flex-end",
|
|
835
|
+
align: "center",
|
|
836
|
+
opacity: 0,
|
|
837
|
+
transition: "all .3s ease",
|
|
838
|
+
transform: "translateX(-10px)",
|
|
839
|
+
_groupHover: { opacity: 1, transform: "translateX(0)" },
|
|
840
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { as: icons.ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
|
|
841
|
+
}
|
|
842
|
+
)
|
|
843
|
+
] }) }, index$12);
|
|
844
|
+
}) })
|
|
845
|
+
}
|
|
846
|
+
)
|
|
733
847
|
] });
|
|
734
848
|
};
|
|
735
849
|
const DesktopNavigation = ({ menu }) => {
|
|
@@ -739,7 +853,7 @@ const DesktopNavigation = ({ menu }) => {
|
|
|
739
853
|
}) });
|
|
740
854
|
};
|
|
741
855
|
const CHEVRON_DOWN_ICON_SIZE = "1.5rem";
|
|
742
|
-
const NavList = ({
|
|
856
|
+
const NavList = ({ slug, label, children, isExpanded, onExpand }) => {
|
|
743
857
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { flex: 1, children: [
|
|
744
858
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
745
859
|
react$1.Flex,
|
|
@@ -765,7 +879,19 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
|
765
879
|
]
|
|
766
880
|
}
|
|
767
881
|
),
|
|
768
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
882
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
883
|
+
react$1.List,
|
|
884
|
+
{
|
|
885
|
+
ml: 2,
|
|
886
|
+
pl: 0,
|
|
887
|
+
maxH: 300,
|
|
888
|
+
overflowY: "auto",
|
|
889
|
+
borderLeft: 1,
|
|
890
|
+
borderStyle: "solid",
|
|
891
|
+
borderColor: react$1.useColorModeValue("gray.200", "gray.700"),
|
|
892
|
+
children: children == null ? void 0 : children.map((child, index$12) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: index.Link, to: index$2.buildPath(child.slug, slug), p: 2, fontSize: "sm", children: child.label }) }, index$12))
|
|
893
|
+
}
|
|
894
|
+
) })
|
|
769
895
|
] });
|
|
770
896
|
};
|
|
771
897
|
const CLOSE_ICON_SIZE = "0.75rem";
|
|
@@ -820,12 +946,15 @@ const Navigation = ({ menu }) => {
|
|
|
820
946
|
] });
|
|
821
947
|
};
|
|
822
948
|
const Header = () => {
|
|
823
|
-
var _a
|
|
824
|
-
const {
|
|
825
|
-
const
|
|
826
|
-
const
|
|
827
|
-
const
|
|
828
|
-
const
|
|
949
|
+
var _a;
|
|
950
|
+
const { navigation, localization, config } = index.useSiteContext();
|
|
951
|
+
const { currentLocale } = index.usePageContext();
|
|
952
|
+
const locales = localization.locales;
|
|
953
|
+
const menu = navigation.header[currentLocale.code] ?? [];
|
|
954
|
+
const toolbar = (_a = config == null ? void 0 : config.header) == null ? void 0 : _a.toolbar;
|
|
955
|
+
const isMultiLanguage = locales.length > 1;
|
|
956
|
+
const hasNavigation = !!menu.length;
|
|
957
|
+
const hasToolbar = !!toolbar || isMultiLanguage;
|
|
829
958
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
830
959
|
react$1.Box,
|
|
831
960
|
{
|
|
@@ -848,8 +977,11 @@ const Header = () => {
|
|
|
848
977
|
align: "center",
|
|
849
978
|
gap: 2,
|
|
850
979
|
children: [
|
|
851
|
-
hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Navigation, { menu
|
|
852
|
-
hasToolbar && /* @__PURE__ */ jsxRuntime.
|
|
980
|
+
hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Navigation, { menu }) }),
|
|
981
|
+
hasToolbar && /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { gap: 2, flex: { base: 1, md: 0 }, justifyContent: "flex-end", children: [
|
|
982
|
+
!!toolbar && toolbar,
|
|
983
|
+
isMultiLanguage && /* @__PURE__ */ jsxRuntime.jsx(LocaleSwitcher, { currentLocale, locales })
|
|
984
|
+
] })
|
|
853
985
|
]
|
|
854
986
|
}
|
|
855
987
|
)
|
|
@@ -951,7 +1083,7 @@ const NotFound = () => {
|
|
|
951
1083
|
/* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { fontSize: "xl", children: [
|
|
952
1084
|
t("description"),
|
|
953
1085
|
" ",
|
|
954
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { as:
|
|
1086
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { as: index.Link, to: "/", variant: "link", colorScheme: "brand", fontSize: "xl", children: t("action") })
|
|
955
1087
|
] })
|
|
956
1088
|
] });
|
|
957
1089
|
};
|
|
@@ -1028,19 +1160,21 @@ function replacePlaceholders(text, placeholders) {
|
|
|
1028
1160
|
});
|
|
1029
1161
|
return text;
|
|
1030
1162
|
}
|
|
1031
|
-
const Seo = ({ children,
|
|
1032
|
-
const {
|
|
1163
|
+
const Seo = ({ children, title, description, lang }) => {
|
|
1164
|
+
const { metadata } = index.useSiteContext();
|
|
1165
|
+
const { name: siteName, lang: defaultLang, seo } = metadata;
|
|
1033
1166
|
const { title: defaultTitle, description: defaultDescription } = seo;
|
|
1167
|
+
const siteLang = lang || defaultLang;
|
|
1034
1168
|
const placeholders = react.useMemo(
|
|
1035
1169
|
() => ({
|
|
1036
1170
|
siteName,
|
|
1037
|
-
currentYear: index$
|
|
1038
|
-
currentMonth: index$
|
|
1171
|
+
currentYear: index$4.getCurrentYear(siteLang),
|
|
1172
|
+
currentMonth: index$4.getCurrentMonth(siteLang)
|
|
1039
1173
|
}),
|
|
1040
|
-
[siteName]
|
|
1174
|
+
[siteName, siteLang]
|
|
1041
1175
|
);
|
|
1042
1176
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1043
|
-
/* @__PURE__ */ jsxRuntime.jsx("html", { lang:
|
|
1177
|
+
/* @__PURE__ */ jsxRuntime.jsx("html", { lang: siteLang }),
|
|
1044
1178
|
/* @__PURE__ */ jsxRuntime.jsx("title", { children: title ? typeof title === "string" ? replacePlaceholders(title, placeholders) : title(placeholders) : defaultTitle }),
|
|
1045
1179
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1046
1180
|
"meta",
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
require("./index
|
|
3
|
-
|
|
4
|
-
function getCurrentYear() {
|
|
5
|
-
const locale = i18n.language;
|
|
2
|
+
const i18n = require("./i18n/index.cjs");
|
|
3
|
+
function getCurrentYear(locale = i18n.DEFAULT_LANGUAGE) {
|
|
6
4
|
const currentDate = /* @__PURE__ */ new Date();
|
|
7
5
|
const currentYear = new Intl.DateTimeFormat(locale, { year: "numeric" }).format(currentDate);
|
|
8
6
|
return currentYear;
|
|
9
7
|
}
|
|
10
|
-
function getCurrentMonth() {
|
|
11
|
-
const locale = i18n.language;
|
|
8
|
+
function getCurrentMonth(locale = i18n.DEFAULT_LANGUAGE) {
|
|
12
9
|
const currentDate = /* @__PURE__ */ new Date();
|
|
13
10
|
const currentMonth = new Intl.DateTimeFormat(locale, { month: "long" }).format(currentDate);
|
|
14
11
|
return currentMonth;
|
|
15
12
|
}
|
|
16
|
-
function formatDate({ value, locale = i18n.
|
|
13
|
+
function formatDate({ value, locale = i18n.DEFAULT_LANGUAGE, options }) {
|
|
17
14
|
const date = typeof value === "string" || typeof value === "number" ? new Date(value) : value;
|
|
18
15
|
if (isNaN(date.getTime())) {
|
|
19
16
|
throw new Error("Invalid date provided");
|
|
@@ -31,7 +28,7 @@ function toFixedTwo(number) {
|
|
|
31
28
|
return round(number, DEFAULT_PRECISION);
|
|
32
29
|
}
|
|
33
30
|
function formatNumber(number, options) {
|
|
34
|
-
const locale = (options == null ? void 0 : options.locale) ?? i18n.
|
|
31
|
+
const locale = (options == null ? void 0 : options.locale) ?? i18n.DEFAULT_LANGUAGE;
|
|
35
32
|
const precision = (options == null ? void 0 : options.precision) ?? DEFAULT_PRECISION;
|
|
36
33
|
let postfix = "";
|
|
37
34
|
const formatOptions = {
|
|
@@ -65,8 +62,8 @@ function parseNumber(value) {
|
|
|
65
62
|
}
|
|
66
63
|
return parsedNumber;
|
|
67
64
|
}
|
|
68
|
-
function getCurrencySymbol(currencyCode) {
|
|
69
|
-
const symbol = 0 .toLocaleString(
|
|
65
|
+
function getCurrencySymbol(currencyCode, locale = i18n.DEFAULT_LANGUAGE) {
|
|
66
|
+
const symbol = 0 .toLocaleString(locale, {
|
|
70
67
|
style: "currency",
|
|
71
68
|
currency: currencyCode,
|
|
72
69
|
minimumFractionDigits: 0,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useColorModeValue } from "@chakra-ui/react";
|
|
2
|
-
import
|
|
3
|
-
import "./index-
|
|
2
|
+
import "./index-BJRvnR8Q.mjs";
|
|
3
|
+
import "./index-CACDltm3.mjs";
|
|
4
|
+
import { L as LIGHT_THEME_COLOR, D as DARK_THEME_COLOR } from "./index-BRVKhbs6.mjs";
|
|
4
5
|
function usePrimaryColors() {
|
|
5
6
|
const color = useColorModeValue(LIGHT_THEME_COLOR, DARK_THEME_COLOR);
|
|
6
7
|
const bgColor = useColorModeValue("brand.500", "brand.200");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const react = require("react");
|
|
3
|
+
const reactI18next = require("react-i18next");
|
|
4
|
+
function useLocalization({ location, defaultLocale, locales }) {
|
|
5
|
+
const [currentLocale, setCurrentLocale] = react.useState(defaultLocale);
|
|
6
|
+
const { i18n } = reactI18next.useTranslation();
|
|
7
|
+
const path = location.pathname;
|
|
8
|
+
react.useEffect(() => {
|
|
9
|
+
const cleanPath = path.replace(/^\/+|\/+$/g, "");
|
|
10
|
+
const maybeLocaleCode = cleanPath.split("/")[0];
|
|
11
|
+
const maybeLocale = locales.find(({ code }) => code === maybeLocaleCode);
|
|
12
|
+
const locale = maybeLocale ? maybeLocale : defaultLocale;
|
|
13
|
+
if (locale.code !== currentLocale.code) {
|
|
14
|
+
setCurrentLocale(locale);
|
|
15
|
+
}
|
|
16
|
+
if (i18n.language !== locale.code) {
|
|
17
|
+
i18n.changeLanguage(locale.code);
|
|
18
|
+
}
|
|
19
|
+
}, [path]);
|
|
20
|
+
return { currentLocale };
|
|
21
|
+
}
|
|
22
|
+
exports.useLocalization = useLocalization;
|