@anywayseo/tools 5.0.0 → 5.2.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.
Files changed (38) hide show
  1. package/dist/components/game-info/index.d.ts +2 -1
  2. package/dist/components/game-info/utils.d.ts +3 -1
  3. package/dist/components/index.cjs +2 -2
  4. package/dist/components/index.mjs +2 -2
  5. package/dist/components/strapi-component/utils.d.ts +9 -0
  6. package/dist/hooks/index.cjs +2 -2
  7. package/dist/hooks/index.mjs +2 -2
  8. package/dist/hooks/use-localization/index.d.ts +4 -1
  9. package/dist/i18n/index.cjs +1 -1
  10. package/dist/i18n/index.mjs +1 -1
  11. package/dist/{index-Bu4S7kG8.mjs → index-BCK4kr6V.mjs} +13 -21
  12. package/dist/{index-Dur8aLpm.js → index-BFhrFJqB.js} +2 -2
  13. package/dist/{index-D34TfBTR.js → index-BICcOaT7.js} +9 -17
  14. package/dist/{index-DVAydNYV.mjs → index-BJQgELmZ.mjs} +2 -2
  15. package/dist/{index-CACDltm3.mjs → index-Bts2DBYS.mjs} +12 -12
  16. package/dist/{index-Cc85xj4h.mjs → index-BzbpMLDD.mjs} +2 -6
  17. package/dist/{index-BnmGE5_x.js → index-CAfBnNV6.js} +1 -1
  18. package/dist/{index-BHfpWNqh.js → index-CJVr79Z2.js} +12 -12
  19. package/dist/{index-D1bJmcpz.js → index-Cn8RI_2O.js} +21 -7
  20. package/dist/{index-X2ihbchG.mjs → index-CtmxlomQ.mjs} +55 -32
  21. package/dist/{index-DnvTeCy9.mjs → index-DA6TBpuE.mjs} +22 -8
  22. package/dist/{index-DqGO34ef.js → index-WFgDSB1A.js} +2 -6
  23. package/dist/{index-3nQCWHPU.js → index-bNvgXBvA.js} +55 -32
  24. package/dist/{index-QazOxABc.mjs → index-tj12BA6U.mjs} +1 -1
  25. package/dist/index.cjs +9 -8
  26. package/dist/index.mjs +17 -16
  27. package/dist/providers/index.cjs +4 -2
  28. package/dist/providers/index.d.ts +1 -0
  29. package/dist/providers/index.mjs +5 -3
  30. package/dist/providers/page-provider/index.d.ts +11 -0
  31. package/dist/providers/site-provider/index.d.ts +3 -8
  32. package/dist/utils/currency/index.d.ts +2 -0
  33. package/dist/utils/index.cjs +1 -2
  34. package/dist/utils/index.d.ts +1 -0
  35. package/dist/utils/index.mjs +5 -6
  36. package/dist/utils/numbers/index.d.ts +1 -17
  37. package/dist/utils/numbers/types.d.ts +15 -1
  38. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import { IGameInfo } from '../../types';
2
+ import { Currency, IGameInfo } from '../../types';
3
3
  type GameInfoProps = {
4
4
  info: IGameInfo;
5
+ currencies?: Currency[];
5
6
  };
6
7
  declare const GameInfo: FC<GameInfoProps>;
7
8
  export default GameInfo;
@@ -1,2 +1,4 @@
1
1
  import { Currency, ILocale, GameCharacteristic } from '../../types';
2
- export declare function getGameInfoItemValue(key: GameCharacteristic, value: unknown, locale: ILocale['code'], currency: Currency | Currency[]): string;
2
+ export declare function getGameInfoItemValue(key: GameCharacteristic, value: unknown, locale: ILocale['code']): string;
3
+ export declare const DEFAULT_CURRENCY = "$, \u20AC, \u00A3";
4
+ export declare function getGameInfoCurrency(currency: Currency | Currency[], locale: ILocale['code']): string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-3nQCWHPU.js");
4
- const index$1 = require("../index-D1bJmcpz.js");
3
+ const index = require("../index-bNvgXBvA.js");
4
+ const index$1 = require("../index-Cn8RI_2O.js");
5
5
  exports.Author = index.Author;
6
6
  exports.AuthorCard = index.AuthorCard;
7
7
  exports.BonusCard = index.BonusCard;
@@ -1,5 +1,5 @@
1
- import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, S, h, T, i, j } from "../index-X2ihbchG.mjs";
2
- import { L as L2 } from "../index-DnvTeCy9.mjs";
1
+ import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, S, h, T, i, j } from "../index-CtmxlomQ.mjs";
2
+ import { L as L2 } from "../index-DA6TBpuE.mjs";
3
3
  export {
4
4
  k as Author,
5
5
  A as AuthorCard,
@@ -1,3 +1,12 @@
1
+ import { Currency } from '../../types';
1
2
  export declare function extractItemsFromJson(content: {
2
3
  ['strapi_json_value']: string[];
3
4
  }): string[];
5
+ interface ICurrencyListItem {
6
+ code: Currency;
7
+ }
8
+ interface ICurrencyList {
9
+ items: ICurrencyListItem[];
10
+ }
11
+ export declare function extractCurrencies(currencyList?: ICurrencyList): Currency[];
12
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-DqGO34ef.js");
4
- const index$1 = require("../index-BnmGE5_x.js");
3
+ const index = require("../index-WFgDSB1A.js");
4
+ const index$1 = require("../index-CAfBnNV6.js");
5
5
  exports.useLocalization = index.useLocalization;
6
6
  exports.usePrimaryColors = index$1.usePrimaryColors;
@@ -1,5 +1,5 @@
1
- import { u } from "../index-Cc85xj4h.mjs";
2
- import { u as u2 } from "../index-QazOxABc.mjs";
1
+ import { u } from "../index-BzbpMLDD.mjs";
2
+ import { u as u2 } from "../index-tj12BA6U.mjs";
3
3
  export {
4
4
  u as useLocalization,
5
5
  u2 as usePrimaryColors
@@ -1,6 +1,9 @@
1
1
  import { ILocale, ISiteLocalization } from '../../types';
2
+ interface IUseLocalizationParams extends ISiteLocalization {
3
+ location: Location;
4
+ }
2
5
  interface IUseLocalizationReturn {
3
6
  currentLocale: ILocale;
4
7
  }
5
- declare function useLocalization({ defaultLocale, locales }: ISiteLocalization): IUseLocalizationReturn;
8
+ declare function useLocalization({ location, defaultLocale, locales }: IUseLocalizationParams): IUseLocalizationReturn;
6
9
  export default useLocalization;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-BHfpWNqh.js");
3
+ const index = require("../index-CJVr79Z2.js");
4
4
  const resources = {
5
5
  en: index.dictionary$4,
6
6
  it: index.dictionary$3,
@@ -1,4 +1,4 @@
1
- import { d as dictionary, b as dictionary$1, c as dictionary$2, e as dictionary$3, f as dictionary$4 } from "../index-CACDltm3.mjs";
1
+ import { d as dictionary, b as dictionary$1, c as dictionary$2, e as dictionary$3, f as dictionary$4 } from "../index-Bts2DBYS.mjs";
2
2
  const resources = {
3
3
  en: dictionary$4,
4
4
  it: dictionary$3,
@@ -1,4 +1,13 @@
1
1
  import { DEFAULT_LANGUAGE } from "./i18n/index.mjs";
2
+ function getCurrencySymbol(currencyCode, locale = DEFAULT_LANGUAGE) {
3
+ const symbol = 0 .toLocaleString(locale, {
4
+ style: "currency",
5
+ currency: currencyCode,
6
+ minimumFractionDigits: 0,
7
+ maximumFractionDigits: 0
8
+ }).replace(/\d/g, "").trim();
9
+ return symbol;
10
+ }
2
11
  function getCurrentYear(locale = DEFAULT_LANGUAGE) {
3
12
  const currentDate = /* @__PURE__ */ new Date();
4
13
  const currentYear = new Intl.DateTimeFormat(locale, { year: "numeric" }).format(currentDate);
@@ -54,22 +63,6 @@ function formatNumber(number, options) {
54
63
  const formatter = new Intl.NumberFormat(locale, formatOptions);
55
64
  return `${formatter.format(round(number, precision))}${postfix}`;
56
65
  }
57
- function parseNumber(value) {
58
- const parsedNumber = parseFloat(value);
59
- if (isNaN(parsedNumber)) {
60
- return null;
61
- }
62
- return parsedNumber;
63
- }
64
- function getCurrencySymbol(currencyCode, locale = DEFAULT_LANGUAGE) {
65
- const symbol = 0 .toLocaleString(locale, {
66
- style: "currency",
67
- currency: currencyCode,
68
- minimumFractionDigits: 0,
69
- maximumFractionDigits: 0
70
- }).replace(/\d/g, "").trim();
71
- return symbol;
72
- }
73
66
  function randomComparator() {
74
67
  return Math.random() - 0.5;
75
68
  }
@@ -82,14 +75,13 @@ function getSeededRandomComparator(seed) {
82
75
  return () => seededRandom(safeSeed + index++) - 0.5;
83
76
  }
84
77
  export {
85
- getCurrentMonth as a,
86
- formatNumber as b,
87
- getCurrencySymbol as c,
78
+ getCurrentYear as a,
79
+ getCurrentMonth as b,
80
+ formatNumber as c,
88
81
  randomComparator as d,
89
82
  getSeededRandomComparator as e,
90
83
  formatDate as f,
91
- getCurrentYear as g,
92
- parseNumber as p,
84
+ getCurrencySymbol as g,
93
85
  round as r,
94
86
  toFixedTwo as t
95
87
  };
@@ -4,9 +4,9 @@ const react$1 = require("@chakra-ui/react");
4
4
  const react = require("@mdx-js/react");
5
5
  require("react");
6
6
  require("react-i18next");
7
- const index$1 = require("./index-D1bJmcpz.js");
7
+ const index$1 = require("./index-Cn8RI_2O.js");
8
8
  require("./index-C6MG_f24.js");
9
- require("./index-BHfpWNqh.js");
9
+ require("./index-CJVr79Z2.js");
10
10
  const index = require("./index-At00w6EN.js");
11
11
  function omitProps(props, omittedKeys) {
12
12
  const result = { ...props };
@@ -1,5 +1,14 @@
1
1
  "use strict";
2
2
  const i18n = require("./i18n/index.cjs");
3
+ function getCurrencySymbol(currencyCode, locale = i18n.DEFAULT_LANGUAGE) {
4
+ const symbol = 0 .toLocaleString(locale, {
5
+ style: "currency",
6
+ currency: currencyCode,
7
+ minimumFractionDigits: 0,
8
+ maximumFractionDigits: 0
9
+ }).replace(/\d/g, "").trim();
10
+ return symbol;
11
+ }
3
12
  function getCurrentYear(locale = i18n.DEFAULT_LANGUAGE) {
4
13
  const currentDate = /* @__PURE__ */ new Date();
5
14
  const currentYear = new Intl.DateTimeFormat(locale, { year: "numeric" }).format(currentDate);
@@ -55,22 +64,6 @@ function formatNumber(number, options) {
55
64
  const formatter = new Intl.NumberFormat(locale, formatOptions);
56
65
  return `${formatter.format(round(number, precision))}${postfix}`;
57
66
  }
58
- function parseNumber(value) {
59
- const parsedNumber = parseFloat(value);
60
- if (isNaN(parsedNumber)) {
61
- return null;
62
- }
63
- return parsedNumber;
64
- }
65
- function getCurrencySymbol(currencyCode, locale = i18n.DEFAULT_LANGUAGE) {
66
- const symbol = 0 .toLocaleString(locale, {
67
- style: "currency",
68
- currency: currencyCode,
69
- minimumFractionDigits: 0,
70
- maximumFractionDigits: 0
71
- }).replace(/\d/g, "").trim();
72
- return symbol;
73
- }
74
67
  function randomComparator() {
75
68
  return Math.random() - 0.5;
76
69
  }
@@ -88,7 +81,6 @@ exports.getCurrencySymbol = getCurrencySymbol;
88
81
  exports.getCurrentMonth = getCurrentMonth;
89
82
  exports.getCurrentYear = getCurrentYear;
90
83
  exports.getSeededRandomComparator = getSeededRandomComparator;
91
- exports.parseNumber = parseNumber;
92
84
  exports.randomComparator = randomComparator;
93
85
  exports.round = round;
94
86
  exports.toFixedTwo = toFixedTwo;
@@ -3,9 +3,9 @@ import { Text, UnorderedList, OrderedList, Heading, Link } from "@chakra-ui/reac
3
3
  import { MDXProvider } from "@mdx-js/react";
4
4
  import "react";
5
5
  import "react-i18next";
6
- import { L as Link$1 } from "./index-DnvTeCy9.mjs";
6
+ import { L as Link$1 } from "./index-DA6TBpuE.mjs";
7
7
  import "./index-BJRvnR8Q.mjs";
8
- import "./index-CACDltm3.mjs";
8
+ import "./index-Bts2DBYS.mjs";
9
9
  import { i as isRelativePath } from "./index-BmaWfWLV.mjs";
10
10
  function omitProps(props, omittedKeys) {
11
11
  const result = { ...props };
@@ -75,9 +75,9 @@ const gameInfo$4 = {
75
75
  [GameCharacteristic.HasFreeSpins]: "Freispiele",
76
76
  [GameCharacteristic.HasProgressiveJackpot]: "Progressiver Jackpot",
77
77
  [GameCharacteristic.Languages]: "Sprachen",
78
- [GameCharacteristic.MaxWin]: "Maximaler Gewinn",
79
- [GameCharacteristic.MaxBet]: "Maximaler Einsatz",
80
- [GameCharacteristic.MinBet]: "Minimaler Einsatz",
78
+ [GameCharacteristic.MaxWin]: "Max Gewinn",
79
+ [GameCharacteristic.MaxBet]: "Max Einsatz ({{currency}})",
80
+ [GameCharacteristic.MinBet]: "Min Einsatz ({{currency}})",
81
81
  [GameCharacteristic.Name]: "Name",
82
82
  [GameCharacteristic.PayLines]: "Anzahl der Gewinnlinien",
83
83
  [GameCharacteristic.ReelsNumber]: "Anzahl der Walzen",
@@ -195,8 +195,8 @@ const gameInfo$3 = {
195
195
  [GameCharacteristic.HasProgressiveJackpot]: "Progressive Jackpot",
196
196
  [GameCharacteristic.Languages]: "Languages",
197
197
  [GameCharacteristic.MaxWin]: "Max Win",
198
- [GameCharacteristic.MaxBet]: "Max Bet",
199
- [GameCharacteristic.MinBet]: "Min Bet",
198
+ [GameCharacteristic.MaxBet]: "Max Bet ({{currency}})",
199
+ [GameCharacteristic.MinBet]: "Min Bet ({{currency}})",
200
200
  [GameCharacteristic.Name]: "Name",
201
201
  [GameCharacteristic.PayLines]: "Pay Lines Number",
202
202
  [GameCharacteristic.ReelsNumber]: "Reels Number",
@@ -314,8 +314,8 @@ const gameInfo$2 = {
314
314
  [GameCharacteristic.HasProgressiveJackpot]: "Jackpot Progressivo",
315
315
  [GameCharacteristic.Languages]: "Lingue",
316
316
  [GameCharacteristic.MaxWin]: "Vincita Massima",
317
- [GameCharacteristic.MaxBet]: "Puntata Massima",
318
- [GameCharacteristic.MinBet]: "Puntata Minima",
317
+ [GameCharacteristic.MaxBet]: "Puntata Massima ({{currency}})",
318
+ [GameCharacteristic.MinBet]: "Puntata Minima ({{currency}})",
319
319
  [GameCharacteristic.Name]: "Nome",
320
320
  [GameCharacteristic.PayLines]: "Numero di Linee di Pagamento",
321
321
  [GameCharacteristic.ReelsNumber]: "Numero di Rulli",
@@ -432,9 +432,9 @@ const gameInfo$1 = {
432
432
  [GameCharacteristic.HasFreeSpins]: "Фриспины",
433
433
  [GameCharacteristic.HasProgressiveJackpot]: "Прогрессивный джекпот",
434
434
  [GameCharacteristic.Languages]: "Языки",
435
- [GameCharacteristic.MaxWin]: "Максимальный выигрыш",
436
- [GameCharacteristic.MaxBet]: "Максимальная ставка",
437
- [GameCharacteristic.MinBet]: "Минимальная ставка",
435
+ [GameCharacteristic.MaxWin]: "Макс. выигрыш",
436
+ [GameCharacteristic.MaxBet]: "Макс. ставка ({{currency}})",
437
+ [GameCharacteristic.MinBet]: "Мин. ставка ({{currency}})",
438
438
  [GameCharacteristic.Name]: "Название",
439
439
  [GameCharacteristic.PayLines]: "Количество линий выплат",
440
440
  [GameCharacteristic.ReelsNumber]: "Количество барабанов",
@@ -552,8 +552,8 @@ const gameInfo = {
552
552
  [GameCharacteristic.HasProgressiveJackpot]: "Jackpot progressif",
553
553
  [GameCharacteristic.Languages]: "Langues",
554
554
  [GameCharacteristic.MaxWin]: "Gain maximal",
555
- [GameCharacteristic.MaxBet]: "Mise maximale",
556
- [GameCharacteristic.MinBet]: "Mise minimale",
555
+ [GameCharacteristic.MaxBet]: "Mise maximale ({{currency}})",
556
+ [GameCharacteristic.MinBet]: "Mise minimale ({{currency}})",
557
557
  [GameCharacteristic.Name]: "Nom",
558
558
  [GameCharacteristic.PayLines]: "Nombre de lignes de paiement",
559
559
  [GameCharacteristic.ReelsNumber]: "Nombre de rouleaux",
@@ -1,14 +1,10 @@
1
1
  import { useState, useEffect } from "react";
2
2
  import { useTranslation } from "react-i18next";
3
- function useLocalization({ defaultLocale, locales }) {
4
- var _a;
3
+ function useLocalization({ location, defaultLocale, locales }) {
5
4
  const [currentLocale, setCurrentLocale] = useState(defaultLocale);
6
5
  const { i18n } = useTranslation();
7
- const path = ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.pathname) ?? "";
6
+ const path = location.pathname;
8
7
  useEffect(() => {
9
- if (typeof window === "undefined") {
10
- return;
11
- }
12
8
  const cleanPath = path.replace(/^\/+|\/+$/g, "");
13
9
  const maybeLocaleCode = cleanPath.split("/")[0];
14
10
  const maybeLocale = locales.find(({ code }) => code === maybeLocaleCode);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const react = require("@chakra-ui/react");
3
3
  require("./index-C6MG_f24.js");
4
- require("./index-BHfpWNqh.js");
4
+ require("./index-CJVr79Z2.js");
5
5
  const index = require("./index-CbuiYkSg.js");
6
6
  function usePrimaryColors() {
7
7
  const color = react.useColorModeValue(index.LIGHT_THEME_COLOR, index.DARK_THEME_COLOR);
@@ -76,9 +76,9 @@ const gameInfo$4 = {
76
76
  [GameCharacteristic.HasFreeSpins]: "Freispiele",
77
77
  [GameCharacteristic.HasProgressiveJackpot]: "Progressiver Jackpot",
78
78
  [GameCharacteristic.Languages]: "Sprachen",
79
- [GameCharacteristic.MaxWin]: "Maximaler Gewinn",
80
- [GameCharacteristic.MaxBet]: "Maximaler Einsatz",
81
- [GameCharacteristic.MinBet]: "Minimaler Einsatz",
79
+ [GameCharacteristic.MaxWin]: "Max Gewinn",
80
+ [GameCharacteristic.MaxBet]: "Max Einsatz ({{currency}})",
81
+ [GameCharacteristic.MinBet]: "Min Einsatz ({{currency}})",
82
82
  [GameCharacteristic.Name]: "Name",
83
83
  [GameCharacteristic.PayLines]: "Anzahl der Gewinnlinien",
84
84
  [GameCharacteristic.ReelsNumber]: "Anzahl der Walzen",
@@ -196,8 +196,8 @@ const gameInfo$3 = {
196
196
  [GameCharacteristic.HasProgressiveJackpot]: "Progressive Jackpot",
197
197
  [GameCharacteristic.Languages]: "Languages",
198
198
  [GameCharacteristic.MaxWin]: "Max Win",
199
- [GameCharacteristic.MaxBet]: "Max Bet",
200
- [GameCharacteristic.MinBet]: "Min Bet",
199
+ [GameCharacteristic.MaxBet]: "Max Bet ({{currency}})",
200
+ [GameCharacteristic.MinBet]: "Min Bet ({{currency}})",
201
201
  [GameCharacteristic.Name]: "Name",
202
202
  [GameCharacteristic.PayLines]: "Pay Lines Number",
203
203
  [GameCharacteristic.ReelsNumber]: "Reels Number",
@@ -315,8 +315,8 @@ const gameInfo$2 = {
315
315
  [GameCharacteristic.HasProgressiveJackpot]: "Jackpot Progressivo",
316
316
  [GameCharacteristic.Languages]: "Lingue",
317
317
  [GameCharacteristic.MaxWin]: "Vincita Massima",
318
- [GameCharacteristic.MaxBet]: "Puntata Massima",
319
- [GameCharacteristic.MinBet]: "Puntata Minima",
318
+ [GameCharacteristic.MaxBet]: "Puntata Massima ({{currency}})",
319
+ [GameCharacteristic.MinBet]: "Puntata Minima ({{currency}})",
320
320
  [GameCharacteristic.Name]: "Nome",
321
321
  [GameCharacteristic.PayLines]: "Numero di Linee di Pagamento",
322
322
  [GameCharacteristic.ReelsNumber]: "Numero di Rulli",
@@ -433,9 +433,9 @@ const gameInfo$1 = {
433
433
  [GameCharacteristic.HasFreeSpins]: "Фриспины",
434
434
  [GameCharacteristic.HasProgressiveJackpot]: "Прогрессивный джекпот",
435
435
  [GameCharacteristic.Languages]: "Языки",
436
- [GameCharacteristic.MaxWin]: "Максимальный выигрыш",
437
- [GameCharacteristic.MaxBet]: "Максимальная ставка",
438
- [GameCharacteristic.MinBet]: "Минимальная ставка",
436
+ [GameCharacteristic.MaxWin]: "Макс. выигрыш",
437
+ [GameCharacteristic.MaxBet]: "Макс. ставка ({{currency}})",
438
+ [GameCharacteristic.MinBet]: "Мин. ставка ({{currency}})",
439
439
  [GameCharacteristic.Name]: "Название",
440
440
  [GameCharacteristic.PayLines]: "Количество линий выплат",
441
441
  [GameCharacteristic.ReelsNumber]: "Количество барабанов",
@@ -553,8 +553,8 @@ const gameInfo = {
553
553
  [GameCharacteristic.HasProgressiveJackpot]: "Jackpot progressif",
554
554
  [GameCharacteristic.Languages]: "Langues",
555
555
  [GameCharacteristic.MaxWin]: "Gain maximal",
556
- [GameCharacteristic.MaxBet]: "Mise maximale",
557
- [GameCharacteristic.MinBet]: "Mise minimale",
556
+ [GameCharacteristic.MaxBet]: "Mise maximale ({{currency}})",
557
+ [GameCharacteristic.MinBet]: "Mise minimale ({{currency}})",
558
558
  [GameCharacteristic.Name]: "Nom",
559
559
  [GameCharacteristic.PayLines]: "Nombre de lignes de paiement",
560
560
  [GameCharacteristic.ReelsNumber]: "Nombre de rouleaux",
@@ -6,15 +6,12 @@ require("@chakra-ui/react");
6
6
  require("@mdx-js/react");
7
7
  require("react-i18next");
8
8
  require("./index-C6MG_f24.js");
9
- require("./index-BHfpWNqh.js");
10
- const index = require("./index-DqGO34ef.js");
9
+ require("./index-CJVr79Z2.js");
10
+ const index = require("./index-WFgDSB1A.js");
11
11
  const index$1 = require("./index-At00w6EN.js");
12
12
  const SiteContext = react.createContext(null);
13
13
  const SiteProvider = ({ children, ...context }) => {
14
- const { currentLocale } = index.useLocalization(context.localization);
15
- const value = react.useMemo(() => {
16
- return { ...context, localization: { ...context.localization, currentLocale } };
17
- }, [currentLocale]);
14
+ const value = react.useMemo(() => context, []);
18
15
  return /* @__PURE__ */ jsxRuntime.jsx(SiteContext.Provider, { value, children });
19
16
  };
20
17
  function useSiteContext() {
@@ -24,6 +21,20 @@ function useSiteContext() {
24
21
  }
25
22
  return context;
26
23
  }
24
+ const PageContext = react.createContext(null);
25
+ const PageProvider = ({ children, location }) => {
26
+ const { localization } = useSiteContext();
27
+ const { currentLocale } = index.useLocalization({ location, ...localization });
28
+ const value = react.useMemo(() => ({ currentLocale }), [currentLocale]);
29
+ return /* @__PURE__ */ jsxRuntime.jsx(PageContext.Provider, { value, children });
30
+ };
31
+ function usePageContext() {
32
+ const context = react.useContext(PageContext);
33
+ if (!context) {
34
+ throw new Error("usePageContext must be used within PageProvider");
35
+ }
36
+ return context;
37
+ }
27
38
  function normalizePath(path = "") {
28
39
  return path.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/");
29
40
  }
@@ -40,10 +51,13 @@ function getLocalizedPath(path, currentLocaleCode, defaultLocaleCode) {
40
51
  }
41
52
  const Link = react.forwardRef(({ to, ...props }, ref) => {
42
53
  const { localization } = useSiteContext();
43
- const { currentLocale, defaultLocale } = localization;
54
+ const { currentLocale } = usePageContext();
55
+ const defaultLocale = localization.defaultLocale;
44
56
  const path = getLocalizedPath(to, currentLocale.code, defaultLocale.code);
45
57
  return /* @__PURE__ */ jsxRuntime.jsx(gatsby.Link, { ref, to: path, ...props });
46
58
  });
47
59
  exports.Link = Link;
60
+ exports.PageProvider = PageProvider;
48
61
  exports.SiteProvider = SiteProvider;
62
+ exports.usePageContext = usePageContext;
49
63
  exports.useSiteContext = useSiteContext;
@@ -1,15 +1,15 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { Box, Collapse, Text, Button, Flex, Stack, Image, Center as Center$1, SimpleGrid, Link as Link$1, Card, CardHeader, Heading, CardBody, Popover, PopoverTrigger, Portal, PopoverContent, PopoverBody, CardFooter, useToast, useColorModeValue, VStack, FormControl, FormLabel, InputGroup, InputLeftElement, Input, Textarea, Accordion, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, LinkBox, LinkOverlay, IconButton, AbsoluteCenter, Spinner, useDisclosure, Divider, Circle, Container as Container$1, Menu, MenuButton, HStack, Icon, MenuList, MenuItem, List as List$1, ListItem, ListIcon, TableContainer, Table as Table$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, TabPanels, TabPanel } from "@chakra-ui/react";
3
3
  import { useTranslation } from "react-i18next";
4
- import { u as useSiteContext, L as Link } from "./index-DnvTeCy9.mjs";
4
+ import { a as useSiteContext, L as Link, u as usePageContext } from "./index-DA6TBpuE.mjs";
5
5
  import { useRef, useState, useLayoutEffect, Fragment as Fragment$1, useMemo, forwardRef, useEffect } from "react";
6
6
  import { A as Animation } from "./index-BJRvnR8Q.mjs";
7
- import { a as GameCharacteristic } from "./index-CACDltm3.mjs";
7
+ import { a as GameCharacteristic } from "./index-Bts2DBYS.mjs";
8
8
  import { useMDXComponents } from "@mdx-js/react";
9
9
  import { EmailIcon, StarIcon, CloseIcon, ViewOffIcon, ViewIcon, ChevronDownIcon, ChevronRightIcon, HamburgerIcon, ChevronUpIcon, WarningIcon, CheckCircleIcon } from "@chakra-ui/icons";
10
- import { e as getSeededRandomComparator, d as randomComparator, b as formatNumber, c as getCurrencySymbol, f as formatDate, g as getCurrentYear, a as getCurrentMonth } from "./index-Bu4S7kG8.mjs";
10
+ import { e as getSeededRandomComparator, d as randomComparator, g as getCurrencySymbol, c as formatNumber, f as formatDate, a as getCurrentYear, b as getCurrentMonth } from "./index-BCK4kr6V.mjs";
11
11
  import { i as isRelativePath, b as buildPath } from "./index-BmaWfWLV.mjs";
12
- import { u as usePrimaryColors } from "./index-QazOxABc.mjs";
12
+ import { u as usePrimaryColors } from "./index-tj12BA6U.mjs";
13
13
  import { t } from "i18next";
14
14
  import Markdown from "react-markdown";
15
15
  const ONE_LINE_HEIGHT = 24;
@@ -83,10 +83,11 @@ const LinkButton = ({
83
83
  const { config } = useSiteContext();
84
84
  const { color, invertedColor } = usePrimaryColors();
85
85
  const isInvertedColor = (_a = config == null ? void 0 : config.theme) == null ? void 0 : _a.isInvertedColor;
86
- const isInternalLink = linkType === "redirect" || isRelativePath(href);
86
+ const isRedirectLink = linkType === "redirect";
87
+ const isInternalLink = isRelativePath(href);
87
88
  const LinkComponent = isInternalLink ? Link : Link$1;
88
89
  const hrefKey = isInternalLink ? "to" : "href";
89
- const hrefValue = linkType === "redirect" ? `/follow?to=${href}` : href;
90
+ const hrefValue = isRedirectLink ? `/follow?to=${href}` : href;
90
91
  return /* @__PURE__ */ jsx(
91
92
  Button,
92
93
  {
@@ -103,7 +104,8 @@ const LinkButton = ({
103
104
  ...href ? {
104
105
  as: LinkComponent,
105
106
  [hrefKey]: hrefValue,
106
- rel: "nofollow"
107
+ target: isRedirectLink ? "_blank" : "_self",
108
+ rel: isInternalLink ? "" : "noopener noreferrer nofollow"
107
109
  } : {},
108
110
  children: label
109
111
  }
@@ -438,7 +440,17 @@ const GameDemoPreview = ({ image, alt, href, imageFit = "contain", onPlayDemo })
438
440
  ...href ? { label: t2("action.playForReal"), href } : { label: t2("action.playForFree"), onClick: onPlayDemo }
439
441
  }
440
442
  ),
441
- !!href && /* @__PURE__ */ jsx(Button, { variant: "outline", colorScheme: "brand", size: { base: "sm", md: "md" }, onClick: onPlayDemo, children: t2("action.playForFree") })
443
+ !!href && /* @__PURE__ */ jsx(
444
+ Button,
445
+ {
446
+ variant: "solid",
447
+ colorScheme: "brand",
448
+ size: { base: "sm", md: "lg" },
449
+ _active: { transform: "scale(0.95)" },
450
+ onClick: onPlayDemo,
451
+ children: t2("action.playForFree")
452
+ }
453
+ )
442
454
  ] }) })
443
455
  ] });
444
456
  };
@@ -502,39 +514,34 @@ const GameInfoItem = ({ title, value }) => {
502
514
  /* @__PURE__ */ jsx(Text, { w: "50%", textTransform: "capitalize", children: value })
503
515
  ] });
504
516
  };
505
- const VISIBLE_LANGUAGE_NUMBER = 5;
517
+ const MAX_VISIBLE_LANGUAGE = 5;
506
518
  function stringifyHasFeature(value) {
507
519
  return t(`gameInfo:value.boolean.${value}`);
508
520
  }
509
521
  function stringifyVolatility(value) {
510
522
  return t(`gameInfo:value.volatility.${value}`);
511
523
  }
512
- function stringifyArray(array) {
524
+ function stringifyArray(array, max) {
525
+ const safeMax = typeof max === "number" ? Math.max(max, 0) : null;
526
+ if (safeMax && array.length > safeMax) {
527
+ return `${array.slice(0, safeMax).join(", ")}, +${array.length - safeMax}`;
528
+ }
513
529
  return array.join(", ");
514
530
  }
515
- function stringifyLanguageArray(languages) {
516
- return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
517
- }
518
- function getGameInfoItemValue(key, value, locale, currency) {
531
+ function getGameInfoItemValue(key, value, locale) {
519
532
  let formattedValue = "";
520
533
  if (typeof value !== "string") {
521
534
  if (key === GameCharacteristic.Rtp) {
522
535
  formattedValue = formatNumber(value, { percent: "real", precision: 3 });
523
536
  }
524
537
  if (key === GameCharacteristic.MinBet || key === GameCharacteristic.MaxBet || key === GameCharacteristic.MaxWin) {
525
- if (Array.isArray(currency)) {
526
- const [primary, ...secondaries] = currency || ["USD"];
527
- const primaryValue = formatNumber(value, { currency: primary });
528
- formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => getCurrencySymbol(currency2, locale)).join(", ")})` : primaryValue;
529
- } else {
530
- formattedValue = formatNumber(value, { currency });
531
- }
538
+ formattedValue = formatNumber(value, { locale });
532
539
  }
533
540
  if (key === GameCharacteristic.Compatibility || key === GameCharacteristic.BonusFeatures) {
534
541
  formattedValue = stringifyArray(value);
535
542
  }
536
543
  if (key === GameCharacteristic.Languages) {
537
- formattedValue = stringifyLanguageArray(value);
544
+ formattedValue = stringifyArray(value, MAX_VISIBLE_LANGUAGE);
538
545
  }
539
546
  if (typeof value === "boolean") {
540
547
  formattedValue = stringifyHasFeature(value);
@@ -551,11 +558,15 @@ function getGameInfoItemValue(key, value, locale, currency) {
551
558
  }
552
559
  return formattedValue;
553
560
  }
554
- const GameInfo = ({ info }) => {
561
+ const DEFAULT_CURRENCY = "$, €, £";
562
+ function getGameInfoCurrency(currency, locale) {
563
+ const currencies = Array.isArray(currency) ? currency.map((code) => getCurrencySymbol(code, locale)) : [getCurrencySymbol(currency, locale)];
564
+ return stringifyArray(currencies);
565
+ }
566
+ const GameInfo = ({ info, currencies }) => {
555
567
  const { t: t2 } = useTranslation("gameInfo");
556
- const { localization } = useSiteContext();
557
- const locale = localization.currentLocale.code;
558
- const currency = localization.currency;
568
+ const { currentLocale } = usePageContext();
569
+ const currency = (currencies == null ? void 0 : currencies.length) ? getGameInfoCurrency(currencies, currentLocale.code) : DEFAULT_CURRENCY;
559
570
  return /* @__PURE__ */ jsx(
560
571
  Box,
561
572
  {
@@ -574,8 +585,8 @@ const GameInfo = ({ info }) => {
574
585
  return null;
575
586
  }
576
587
  const feature = itemKey;
577
- const value = getGameInfoItemValue(feature, itemValue, locale, currency);
578
- return /* @__PURE__ */ jsx(GameInfoItem, { title: t2(`feature.${feature}`), value }, itemKey);
588
+ const value = getGameInfoItemValue(feature, itemValue, currentLocale.code);
589
+ return /* @__PURE__ */ jsx(GameInfoItem, { title: t2(`feature.${feature}`, { currency }), value }, itemKey);
579
590
  })
580
591
  ] }, group)) })
581
592
  ] })
@@ -658,8 +669,8 @@ const Navigation$1 = ({ menu }) => {
658
669
  };
659
670
  const Footer = () => {
660
671
  var _a, _b;
661
- const { navigation, localization, config } = useSiteContext();
662
- const currentLocale = localization.currentLocale;
672
+ const { navigation, config } = useSiteContext();
673
+ const { currentLocale } = usePageContext();
663
674
  const menu = navigation.footer[currentLocale.code] ?? [];
664
675
  const extra = (_a = config == null ? void 0 : config.footer) == null ? void 0 : _a.extra;
665
676
  const showDisclaimer = ((_b = config == null ? void 0 : config.footer) == null ? void 0 : _b.showDisclaimer) ?? true;
@@ -946,8 +957,8 @@ const Navigation = ({ menu }) => {
946
957
  const Header = () => {
947
958
  var _a;
948
959
  const { navigation, localization, config } = useSiteContext();
960
+ const { currentLocale } = usePageContext();
949
961
  const locales = localization.locales;
950
- const currentLocale = localization.currentLocale;
951
962
  const menu = navigation.header[currentLocale.code] ?? [];
952
963
  const toolbar = (_a = config == null ? void 0 : config.header) == null ? void 0 : _a.toolbar;
953
964
  const isMultiLanguage = locales.length > 1;
@@ -1246,6 +1257,12 @@ const RichText = ({ content }) => {
1246
1257
  function extractItemsFromJson(content) {
1247
1258
  return content.strapi_json_value;
1248
1259
  }
1260
+ function extractCurrencies(currencyList) {
1261
+ if (!currencyList) {
1262
+ return [];
1263
+ }
1264
+ return [...new Set(currencyList.items.map(({ code }) => code))];
1265
+ }
1249
1266
  const StrapiComponent = ({ type, props, imageComponent }) => {
1250
1267
  switch (type) {
1251
1268
  case "STRAPI__COMPONENT_CONTENT_FAQ":
@@ -1264,7 +1281,13 @@ const StrapiComponent = ({ type, props, imageComponent }) => {
1264
1281
  }
1265
1282
  );
1266
1283
  case "STRAPI__COMPONENT_CONTENT_GAME_INFO":
1267
- return /* @__PURE__ */ jsx(GameInfo, { info: { ...props } });
1284
+ return /* @__PURE__ */ jsx(
1285
+ GameInfo,
1286
+ {
1287
+ info: { general: props.general, features: props.features },
1288
+ currencies: extractCurrencies(props.currency)
1289
+ }
1290
+ );
1268
1291
  case "STRAPI__COMPONENT_CONTENT_HOW_TO":
1269
1292
  return /* @__PURE__ */ jsx(
1270
1293
  HowTo,
@@ -5,15 +5,12 @@ import "@chakra-ui/react";
5
5
  import "@mdx-js/react";
6
6
  import "react-i18next";
7
7
  import "./index-BJRvnR8Q.mjs";
8
- import "./index-CACDltm3.mjs";
9
- import { u as useLocalization } from "./index-Cc85xj4h.mjs";
8
+ import "./index-Bts2DBYS.mjs";
9
+ import { u as useLocalization } from "./index-BzbpMLDD.mjs";
10
10
  import { i as isRelativePath } from "./index-BmaWfWLV.mjs";
11
11
  const SiteContext = createContext(null);
12
12
  const SiteProvider = ({ children, ...context }) => {
13
- const { currentLocale } = useLocalization(context.localization);
14
- const value = useMemo(() => {
15
- return { ...context, localization: { ...context.localization, currentLocale } };
16
- }, [currentLocale]);
13
+ const value = useMemo(() => context, []);
17
14
  return /* @__PURE__ */ jsx(SiteContext.Provider, { value, children });
18
15
  };
19
16
  function useSiteContext() {
@@ -23,6 +20,20 @@ function useSiteContext() {
23
20
  }
24
21
  return context;
25
22
  }
23
+ const PageContext = createContext(null);
24
+ const PageProvider = ({ children, location }) => {
25
+ const { localization } = useSiteContext();
26
+ const { currentLocale } = useLocalization({ location, ...localization });
27
+ const value = useMemo(() => ({ currentLocale }), [currentLocale]);
28
+ return /* @__PURE__ */ jsx(PageContext.Provider, { value, children });
29
+ };
30
+ function usePageContext() {
31
+ const context = useContext(PageContext);
32
+ if (!context) {
33
+ throw new Error("usePageContext must be used within PageProvider");
34
+ }
35
+ return context;
36
+ }
26
37
  function normalizePath(path = "") {
27
38
  return path.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/");
28
39
  }
@@ -39,12 +50,15 @@ function getLocalizedPath(path, currentLocaleCode, defaultLocaleCode) {
39
50
  }
40
51
  const Link = forwardRef(({ to, ...props }, ref) => {
41
52
  const { localization } = useSiteContext();
42
- const { currentLocale, defaultLocale } = localization;
53
+ const { currentLocale } = usePageContext();
54
+ const defaultLocale = localization.defaultLocale;
43
55
  const path = getLocalizedPath(to, currentLocale.code, defaultLocale.code);
44
56
  return /* @__PURE__ */ jsx(Link$1, { ref, to: path, ...props });
45
57
  });
46
58
  export {
47
59
  Link as L,
60
+ PageProvider as P,
48
61
  SiteProvider as S,
49
- useSiteContext as u
62
+ useSiteContext as a,
63
+ usePageContext as u
50
64
  };
@@ -1,15 +1,11 @@
1
1
  "use strict";
2
2
  const react = require("react");
3
3
  const reactI18next = require("react-i18next");
4
- function useLocalization({ defaultLocale, locales }) {
5
- var _a;
4
+ function useLocalization({ location, defaultLocale, locales }) {
6
5
  const [currentLocale, setCurrentLocale] = react.useState(defaultLocale);
7
6
  const { i18n } = reactI18next.useTranslation();
8
- const path = ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.pathname) ?? "";
7
+ const path = location.pathname;
9
8
  react.useEffect(() => {
10
- if (typeof window === "undefined") {
11
- return;
12
- }
13
9
  const cleanPath = path.replace(/^\/+|\/+$/g, "");
14
10
  const maybeLocaleCode = cleanPath.split("/")[0];
15
11
  const maybeLocale = locales.find(({ code }) => code === maybeLocaleCode);
@@ -2,15 +2,15 @@
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 index = require("./index-D1bJmcpz.js");
5
+ const index = require("./index-Cn8RI_2O.js");
6
6
  const react = require("react");
7
7
  const index$3 = require("./index-C6MG_f24.js");
8
- const index$5 = require("./index-BHfpWNqh.js");
8
+ const index$5 = require("./index-CJVr79Z2.js");
9
9
  const react$2 = require("@mdx-js/react");
10
10
  const icons = require("@chakra-ui/icons");
11
- const index$4 = require("./index-D34TfBTR.js");
11
+ const index$4 = require("./index-BICcOaT7.js");
12
12
  const index$2 = require("./index-At00w6EN.js");
13
- const index$1 = require("./index-BnmGE5_x.js");
13
+ const index$1 = require("./index-CAfBnNV6.js");
14
14
  const i18next = require("i18next");
15
15
  const Markdown = require("react-markdown");
16
16
  const ONE_LINE_HEIGHT = 24;
@@ -84,10 +84,11 @@ const LinkButton = ({
84
84
  const { config } = index.useSiteContext();
85
85
  const { color, invertedColor } = index$1.usePrimaryColors();
86
86
  const isInvertedColor = (_a = config == null ? void 0 : config.theme) == null ? void 0 : _a.isInvertedColor;
87
- const isInternalLink = linkType === "redirect" || index$2.isRelativePath(href);
87
+ const isRedirectLink = linkType === "redirect";
88
+ const isInternalLink = index$2.isRelativePath(href);
88
89
  const LinkComponent = isInternalLink ? index.Link : react$1.Link;
89
90
  const hrefKey = isInternalLink ? "to" : "href";
90
- const hrefValue = linkType === "redirect" ? `/follow?to=${href}` : href;
91
+ const hrefValue = isRedirectLink ? `/follow?to=${href}` : href;
91
92
  return /* @__PURE__ */ jsxRuntime.jsx(
92
93
  react$1.Button,
93
94
  {
@@ -104,7 +105,8 @@ const LinkButton = ({
104
105
  ...href ? {
105
106
  as: LinkComponent,
106
107
  [hrefKey]: hrefValue,
107
- rel: "nofollow"
108
+ target: isRedirectLink ? "_blank" : "_self",
109
+ rel: isInternalLink ? "" : "noopener noreferrer nofollow"
108
110
  } : {},
109
111
  children: label
110
112
  }
@@ -439,7 +441,17 @@ const GameDemoPreview = ({ image, alt, href, imageFit = "contain", onPlayDemo })
439
441
  ...href ? { label: t("action.playForReal"), href } : { label: t("action.playForFree"), onClick: onPlayDemo }
440
442
  }
441
443
  ),
442
- !!href && /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { variant: "outline", colorScheme: "brand", size: { base: "sm", md: "md" }, onClick: onPlayDemo, children: t("action.playForFree") })
444
+ !!href && /* @__PURE__ */ jsxRuntime.jsx(
445
+ react$1.Button,
446
+ {
447
+ variant: "solid",
448
+ colorScheme: "brand",
449
+ size: { base: "sm", md: "lg" },
450
+ _active: { transform: "scale(0.95)" },
451
+ onClick: onPlayDemo,
452
+ children: t("action.playForFree")
453
+ }
454
+ )
443
455
  ] }) })
444
456
  ] });
445
457
  };
@@ -503,39 +515,34 @@ const GameInfoItem = ({ title, value }) => {
503
515
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { w: "50%", textTransform: "capitalize", children: value })
504
516
  ] });
505
517
  };
506
- const VISIBLE_LANGUAGE_NUMBER = 5;
518
+ const MAX_VISIBLE_LANGUAGE = 5;
507
519
  function stringifyHasFeature(value) {
508
520
  return i18next.t(`gameInfo:value.boolean.${value}`);
509
521
  }
510
522
  function stringifyVolatility(value) {
511
523
  return i18next.t(`gameInfo:value.volatility.${value}`);
512
524
  }
513
- function stringifyArray(array) {
525
+ function stringifyArray(array, max) {
526
+ const safeMax = typeof max === "number" ? Math.max(max, 0) : null;
527
+ if (safeMax && array.length > safeMax) {
528
+ return `${array.slice(0, safeMax).join(", ")}, +${array.length - safeMax}`;
529
+ }
514
530
  return array.join(", ");
515
531
  }
516
- function stringifyLanguageArray(languages) {
517
- return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
518
- }
519
- function getGameInfoItemValue(key, value, locale, currency) {
532
+ function getGameInfoItemValue(key, value, locale) {
520
533
  let formattedValue = "";
521
534
  if (typeof value !== "string") {
522
535
  if (key === index$5.GameCharacteristic.Rtp) {
523
536
  formattedValue = index$4.formatNumber(value, { percent: "real", precision: 3 });
524
537
  }
525
538
  if (key === index$5.GameCharacteristic.MinBet || key === index$5.GameCharacteristic.MaxBet || key === index$5.GameCharacteristic.MaxWin) {
526
- if (Array.isArray(currency)) {
527
- const [primary, ...secondaries] = currency || ["USD"];
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
- } else {
531
- formattedValue = index$4.formatNumber(value, { currency });
532
- }
539
+ formattedValue = index$4.formatNumber(value, { locale });
533
540
  }
534
541
  if (key === index$5.GameCharacteristic.Compatibility || key === index$5.GameCharacteristic.BonusFeatures) {
535
542
  formattedValue = stringifyArray(value);
536
543
  }
537
544
  if (key === index$5.GameCharacteristic.Languages) {
538
- formattedValue = stringifyLanguageArray(value);
545
+ formattedValue = stringifyArray(value, MAX_VISIBLE_LANGUAGE);
539
546
  }
540
547
  if (typeof value === "boolean") {
541
548
  formattedValue = stringifyHasFeature(value);
@@ -552,11 +559,15 @@ function getGameInfoItemValue(key, value, locale, currency) {
552
559
  }
553
560
  return formattedValue;
554
561
  }
555
- const GameInfo = ({ info }) => {
562
+ const DEFAULT_CURRENCY = "$, €, £";
563
+ function getGameInfoCurrency(currency, locale) {
564
+ const currencies = Array.isArray(currency) ? currency.map((code) => index$4.getCurrencySymbol(code, locale)) : [index$4.getCurrencySymbol(currency, locale)];
565
+ return stringifyArray(currencies);
566
+ }
567
+ const GameInfo = ({ info, currencies }) => {
556
568
  const { t } = reactI18next.useTranslation("gameInfo");
557
- const { localization } = index.useSiteContext();
558
- const locale = localization.currentLocale.code;
559
- const currency = localization.currency;
569
+ const { currentLocale } = index.usePageContext();
570
+ const currency = (currencies == null ? void 0 : currencies.length) ? getGameInfoCurrency(currencies, currentLocale.code) : DEFAULT_CURRENCY;
560
571
  return /* @__PURE__ */ jsxRuntime.jsx(
561
572
  react$1.Box,
562
573
  {
@@ -575,8 +586,8 @@ const GameInfo = ({ info }) => {
575
586
  return null;
576
587
  }
577
588
  const feature = itemKey;
578
- const value = getGameInfoItemValue(feature, itemValue, locale, currency);
579
- return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`), value }, itemKey);
589
+ const value = getGameInfoItemValue(feature, itemValue, currentLocale.code);
590
+ return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`, { currency }), value }, itemKey);
580
591
  })
581
592
  ] }, group)) })
582
593
  ] })
@@ -659,8 +670,8 @@ const Navigation$1 = ({ menu }) => {
659
670
  };
660
671
  const Footer = () => {
661
672
  var _a, _b;
662
- const { navigation, localization, config } = index.useSiteContext();
663
- const currentLocale = localization.currentLocale;
673
+ const { navigation, config } = index.useSiteContext();
674
+ const { currentLocale } = index.usePageContext();
664
675
  const menu = navigation.footer[currentLocale.code] ?? [];
665
676
  const extra = (_a = config == null ? void 0 : config.footer) == null ? void 0 : _a.extra;
666
677
  const showDisclaimer = ((_b = config == null ? void 0 : config.footer) == null ? void 0 : _b.showDisclaimer) ?? true;
@@ -947,8 +958,8 @@ const Navigation = ({ menu }) => {
947
958
  const Header = () => {
948
959
  var _a;
949
960
  const { navigation, localization, config } = index.useSiteContext();
961
+ const { currentLocale } = index.usePageContext();
950
962
  const locales = localization.locales;
951
- const currentLocale = localization.currentLocale;
952
963
  const menu = navigation.header[currentLocale.code] ?? [];
953
964
  const toolbar = (_a = config == null ? void 0 : config.header) == null ? void 0 : _a.toolbar;
954
965
  const isMultiLanguage = locales.length > 1;
@@ -1247,6 +1258,12 @@ const RichText = ({ content }) => {
1247
1258
  function extractItemsFromJson(content) {
1248
1259
  return content.strapi_json_value;
1249
1260
  }
1261
+ function extractCurrencies(currencyList) {
1262
+ if (!currencyList) {
1263
+ return [];
1264
+ }
1265
+ return [...new Set(currencyList.items.map(({ code }) => code))];
1266
+ }
1250
1267
  const StrapiComponent = ({ type, props, imageComponent }) => {
1251
1268
  switch (type) {
1252
1269
  case "STRAPI__COMPONENT_CONTENT_FAQ":
@@ -1265,7 +1282,13 @@ const StrapiComponent = ({ type, props, imageComponent }) => {
1265
1282
  }
1266
1283
  );
1267
1284
  case "STRAPI__COMPONENT_CONTENT_GAME_INFO":
1268
- return /* @__PURE__ */ jsxRuntime.jsx(GameInfo, { info: { ...props } });
1285
+ return /* @__PURE__ */ jsxRuntime.jsx(
1286
+ GameInfo,
1287
+ {
1288
+ info: { general: props.general, features: props.features },
1289
+ currencies: extractCurrencies(props.currency)
1290
+ }
1291
+ );
1269
1292
  case "STRAPI__COMPONENT_CONTENT_HOW_TO":
1270
1293
  return /* @__PURE__ */ jsxRuntime.jsx(
1271
1294
  HowTo,
@@ -1,6 +1,6 @@
1
1
  import { useColorModeValue } from "@chakra-ui/react";
2
2
  import "./index-BJRvnR8Q.mjs";
3
- import "./index-CACDltm3.mjs";
3
+ import "./index-Bts2DBYS.mjs";
4
4
  import { L as LIGHT_THEME_COLOR, D as DARK_THEME_COLOR } from "./index-BRVKhbs6.mjs";
5
5
  function usePrimaryColors() {
6
6
  const color = useColorModeValue(LIGHT_THEME_COLOR, DARK_THEME_COLOR);
package/dist/index.cjs CHANGED
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-3nQCWHPU.js");
4
- const index$1 = require("./index-D1bJmcpz.js");
5
- const index$2 = require("./index-DqGO34ef.js");
6
- const index$3 = require("./index-BnmGE5_x.js");
3
+ const index = require("./index-bNvgXBvA.js");
4
+ const index$1 = require("./index-Cn8RI_2O.js");
5
+ const index$2 = require("./index-WFgDSB1A.js");
6
+ const index$3 = require("./index-CAfBnNV6.js");
7
7
  const i18n = require("./i18n/index.cjs");
8
- const index$4 = require("./index-Dur8aLpm.js");
9
- const index$5 = require("./index-BHfpWNqh.js");
8
+ const index$4 = require("./index-BFhrFJqB.js");
9
+ const index$5 = require("./index-CJVr79Z2.js");
10
10
  const index$6 = require("./index-C6MG_f24.js");
11
11
  const index$7 = require("./index-CYr1ct1t.js");
12
- const index$8 = require("./index-D34TfBTR.js");
12
+ const index$8 = require("./index-BICcOaT7.js");
13
13
  const index$9 = require("./index-At00w6EN.js");
14
14
  const index$a = require("./index-CbuiYkSg.js");
15
15
  exports.Author = index.Author;
@@ -38,7 +38,9 @@ exports.Table = index.Table;
38
38
  exports.Tabs = index.Tabs;
39
39
  exports.Tip = index.Tip;
40
40
  exports.Link = index$1.Link;
41
+ exports.PageProvider = index$1.PageProvider;
41
42
  exports.SiteProvider = index$1.SiteProvider;
43
+ exports.usePageContext = index$1.usePageContext;
42
44
  exports.useSiteContext = index$1.useSiteContext;
43
45
  exports.useLocalization = index$2.useLocalization;
44
46
  exports.usePrimaryColors = index$3.usePrimaryColors;
@@ -58,7 +60,6 @@ exports.getCurrencySymbol = index$8.getCurrencySymbol;
58
60
  exports.getCurrentMonth = index$8.getCurrentMonth;
59
61
  exports.getCurrentYear = index$8.getCurrentYear;
60
62
  exports.getSeededRandomComparator = index$8.getSeededRandomComparator;
61
- exports.parseNumber = index$8.parseNumber;
62
63
  exports.randomComparator = index$8.randomComparator;
63
64
  exports.round = index$8.round;
64
65
  exports.toFixedTwo = index$8.toFixedTwo;
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, S, h, T, i, j } from "./index-X2ihbchG.mjs";
2
- import { L as L2, S as S2, u } from "./index-DnvTeCy9.mjs";
3
- import { u as u2 } from "./index-Cc85xj4h.mjs";
4
- import { u as u3 } from "./index-QazOxABc.mjs";
1
+ import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, S, h, T, i, j } from "./index-CtmxlomQ.mjs";
2
+ import { L as L2, P as P2, S as S2, u, a as a2 } from "./index-DA6TBpuE.mjs";
3
+ import { u as u2 } from "./index-BzbpMLDD.mjs";
4
+ import { u as u3 } from "./index-tj12BA6U.mjs";
5
5
  import { DEFAULT_LANGUAGE, resources } from "./i18n/index.mjs";
6
- import { M } from "./index-DVAydNYV.mjs";
7
- import { a as a2, G as G2 } from "./index-CACDltm3.mjs";
6
+ import { M } from "./index-BJQgELmZ.mjs";
7
+ import { a as a3, G as G2 } from "./index-Bts2DBYS.mjs";
8
8
  import { A as A2 } from "./index-BJRvnR8Q.mjs";
9
- import { b as b2, c as c2, g as g2, a as a3 } from "./index-cQqALZIW.mjs";
10
- import { f as f2, b as b3, c as c3, a as a4, g as g3, e as e2, p, d as d2, r, t } from "./index-Bu4S7kG8.mjs";
9
+ import { b as b2, c as c2, g as g2, a as a4 } from "./index-cQqALZIW.mjs";
10
+ import { f as f2, c as c3, g as g3, b as b3, a as a5, e as e2, d as d2, r, t } from "./index-BCK4kr6V.mjs";
11
11
  import { b as b4, i as i2 } from "./index-BmaWfWLV.mjs";
12
12
  import { D, L as L3 } from "./index-BRVKhbs6.mjs";
13
13
  export {
@@ -25,7 +25,7 @@ export {
25
25
  c as FeatureCardGrid,
26
26
  G as GameCard,
27
27
  d as GameCardGrid,
28
- a2 as GameCharacteristic,
28
+ a3 as GameCharacteristic,
29
29
  e as GameDemo,
30
30
  f as GameInfo,
31
31
  G2 as GameVolatility,
@@ -38,6 +38,7 @@ export {
38
38
  g as List,
39
39
  M as MdxProvider,
40
40
  N as NotFound,
41
+ P2 as PageProvider,
41
42
  P as ProsCons,
42
43
  S as Seo,
43
44
  S2 as SiteProvider,
@@ -47,22 +48,22 @@ export {
47
48
  j as Tip,
48
49
  b4 as buildPath,
49
50
  f2 as formatDate,
50
- b3 as formatNumber,
51
- c3 as getCurrencySymbol,
52
- a4 as getCurrentMonth,
53
- g3 as getCurrentYear,
51
+ c3 as formatNumber,
52
+ g3 as getCurrencySymbol,
53
+ b3 as getCurrentMonth,
54
+ a5 as getCurrentYear,
54
55
  b2 as getLocale,
55
56
  c2 as getLocales,
56
57
  g2 as getNavigation,
57
58
  e2 as getSeededRandomComparator,
58
- a3 as getSiteName,
59
+ a4 as getSiteName,
59
60
  i2 as isRelativePath,
60
- p as parseNumber,
61
61
  d2 as randomComparator,
62
62
  resources,
63
63
  r as round,
64
64
  t as toFixedTwo,
65
65
  u2 as useLocalization,
66
+ u as usePageContext,
66
67
  u3 as usePrimaryColors,
67
- u as useSiteContext
68
+ a2 as useSiteContext
68
69
  };
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-Dur8aLpm.js");
4
- const index$1 = require("../index-D1bJmcpz.js");
3
+ const index = require("../index-BFhrFJqB.js");
4
+ const index$1 = require("../index-Cn8RI_2O.js");
5
5
  exports.MdxProvider = index.MdxProvider;
6
+ exports.PageProvider = index$1.PageProvider;
6
7
  exports.SiteProvider = index$1.SiteProvider;
8
+ exports.usePageContext = index$1.usePageContext;
7
9
  exports.useSiteContext = index$1.useSiteContext;
@@ -1,2 +1,3 @@
1
1
  export { default as MdxProvider } from './mdx-provider';
2
+ export { default as PageProvider, usePageContext } from './page-provider';
2
3
  export { default as SiteProvider, useSiteContext } from './site-provider';
@@ -1,7 +1,9 @@
1
- import { M } from "../index-DVAydNYV.mjs";
2
- import { S, u } from "../index-DnvTeCy9.mjs";
1
+ import { M } from "../index-BJQgELmZ.mjs";
2
+ import { P, S, u, a } from "../index-DA6TBpuE.mjs";
3
3
  export {
4
4
  M as MdxProvider,
5
+ P as PageProvider,
5
6
  S as SiteProvider,
6
- u as useSiteContext
7
+ u as usePageContext,
8
+ a as useSiteContext
7
9
  };
@@ -0,0 +1,11 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { ILocale } from '../../types';
3
+ interface IPageContextInput {
4
+ location: Location;
5
+ }
6
+ interface IPageContext {
7
+ currentLocale: ILocale;
8
+ }
9
+ declare const PageProvider: FC<PropsWithChildren<IPageContextInput>>;
10
+ export default PageProvider;
11
+ export declare function usePageContext(): IPageContext;
@@ -1,16 +1,11 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
- import { ILocale, ISiteConfig, ISiteLocalization, ISiteMetadata, ISiteNavigation } from '../../types';
3
- interface ISiteContextInput {
2
+ import { ISiteConfig, ISiteLocalization, ISiteMetadata, ISiteNavigation } from '../../types';
3
+ interface ISiteContext {
4
4
  metadata: ISiteMetadata;
5
5
  navigation: ISiteNavigation;
6
6
  localization: ISiteLocalization;
7
7
  config: ISiteConfig;
8
8
  }
9
- interface ISiteContext extends ISiteContextInput {
10
- localization: ISiteLocalization & {
11
- currentLocale: ILocale;
12
- };
13
- }
14
- declare const SiteProvider: FC<PropsWithChildren<ISiteContextInput>>;
9
+ declare const SiteProvider: FC<PropsWithChildren<ISiteContext>>;
15
10
  export default SiteProvider;
16
11
  export declare function useSiteContext(): ISiteContext;
@@ -0,0 +1,2 @@
1
+ import { Currency, ILocale } from '../../types';
2
+ export declare function getCurrencySymbol(currencyCode: Currency, locale?: ILocale['code']): string;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index = require("../index-C6MG_f24.js");
4
4
  const index$1 = require("../index-CYr1ct1t.js");
5
- const index$2 = require("../index-D34TfBTR.js");
5
+ const index$2 = require("../index-BICcOaT7.js");
6
6
  const index$3 = require("../index-At00w6EN.js");
7
7
  const index$4 = require("../index-CbuiYkSg.js");
8
8
  exports.Animation = index.Animation;
@@ -16,7 +16,6 @@ exports.getCurrencySymbol = index$2.getCurrencySymbol;
16
16
  exports.getCurrentMonth = index$2.getCurrentMonth;
17
17
  exports.getCurrentYear = index$2.getCurrentYear;
18
18
  exports.getSeededRandomComparator = index$2.getSeededRandomComparator;
19
- exports.parseNumber = index$2.parseNumber;
20
19
  exports.randomComparator = index$2.randomComparator;
21
20
  exports.round = index$2.round;
22
21
  exports.toFixedTwo = index$2.toFixedTwo;
@@ -1,5 +1,6 @@
1
1
  export * from './animation';
2
2
  export * from './api';
3
+ export * from './currency';
3
4
  export * from './date';
4
5
  export * from './navigation';
5
6
  export * from './numbers';
@@ -1,6 +1,6 @@
1
1
  import { A } from "../index-BJRvnR8Q.mjs";
2
2
  import { b, c, g, a } from "../index-cQqALZIW.mjs";
3
- import { f, b as b2, c as c2, a as a2, g as g2, e, p, d, r, t } from "../index-Bu4S7kG8.mjs";
3
+ import { f, c as c2, g as g2, b as b2, a as a2, e, d, r, t } from "../index-BCK4kr6V.mjs";
4
4
  import { b as b3, i } from "../index-BmaWfWLV.mjs";
5
5
  import { D, L } from "../index-BRVKhbs6.mjs";
6
6
  export {
@@ -9,17 +9,16 @@ export {
9
9
  L as LIGHT_THEME_COLOR,
10
10
  b3 as buildPath,
11
11
  f as formatDate,
12
- b2 as formatNumber,
13
- c2 as getCurrencySymbol,
14
- a2 as getCurrentMonth,
15
- g2 as getCurrentYear,
12
+ c2 as formatNumber,
13
+ g2 as getCurrencySymbol,
14
+ b2 as getCurrentMonth,
15
+ a2 as getCurrentYear,
16
16
  b as getLocale,
17
17
  c as getLocales,
18
18
  g as getNavigation,
19
19
  e as getSeededRandomComparator,
20
20
  a as getSiteName,
21
21
  i as isRelativePath,
22
- p as parseNumber,
23
22
  d as randomComparator,
24
23
  r as round,
25
24
  t as toFixedTwo
@@ -1,20 +1,4 @@
1
- import { Currency, ILocale } from '../../types';
2
- import { PercentFormatType } from './types';
1
+ import { FormatNumberOptions } from './types';
3
2
  export declare function round(number: number, precision: number): number;
4
3
  export declare function toFixedTwo(number: number): number;
5
- type FormatNumberOptions = {
6
- locale?: ILocale['code'];
7
- precision?: number;
8
- hasTrailingZeros?: boolean;
9
- hasSign?: boolean;
10
- } & ({
11
- percent?: PercentFormatType;
12
- currency?: never;
13
- } | {
14
- percent?: never;
15
- currency?: Currency;
16
- });
17
4
  export declare function formatNumber(number: number, options?: FormatNumberOptions): string;
18
- export declare function parseNumber(value: string): number | null;
19
- export declare function getCurrencySymbol(currencyCode: Currency, locale?: ILocale['code']): string;
20
- export {};
@@ -1 +1,15 @@
1
- export type PercentFormatType = 'real' | 'sign-only';
1
+ import { Currency, ILocale } from '../../types';
2
+ type PercentFormatType = 'real' | 'sign-only';
3
+ export type FormatNumberOptions = {
4
+ locale?: ILocale['code'];
5
+ precision?: number;
6
+ hasTrailingZeros?: boolean;
7
+ hasSign?: boolean;
8
+ } & ({
9
+ percent?: PercentFormatType;
10
+ currency?: never;
11
+ } | {
12
+ percent?: never;
13
+ currency?: Currency;
14
+ });
15
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@anywayseo/tools",
3
3
  "description": "Shared UI Components and Modules",
4
- "version": "5.0.0",
4
+ "version": "5.2.0",
5
5
  "keywords": [
6
6
  "react",
7
7
  "ui",