@anywayseo/tools 2.6.0 → 3.0.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 (36) hide show
  1. package/dist/components/author-card/index.d.ts +7 -0
  2. package/dist/components/{author → base/author}/index.d.ts +3 -3
  3. package/dist/components/base/index.d.ts +1 -1
  4. package/dist/components/index.cjs +4 -3
  5. package/dist/components/index.d.ts +3 -2
  6. package/dist/components/index.mjs +10 -9
  7. package/dist/components/not-found/index.d.ts +3 -0
  8. package/dist/components/seo/index.d.ts +7 -12
  9. package/dist/components/seo/types.d.ts +6 -0
  10. package/dist/components/seo/utils.d.ts +2 -0
  11. package/dist/components/{expert-tip → tip}/index.d.ts +4 -4
  12. package/dist/i18n/index.cjs +1 -1
  13. package/dist/i18n/index.mjs +1 -1
  14. package/dist/{index-BqUBNm7v.mjs → index-25M8hPOF.mjs} +1 -6
  15. package/dist/{index-BEqFPNAt.js → index-Biz1dDqA.js} +12 -12
  16. package/dist/{index-D2APUOog.js → index-Cte2-g6s.js} +1 -6
  17. package/dist/{index-Ct1pg92K.mjs → index-DIxzgBCq.mjs} +113 -98
  18. package/dist/{index-F6_fGeRI.mjs → index-DoBCANwf.mjs} +12 -12
  19. package/dist/index-HmqLMmGf.js +1036 -0
  20. package/dist/index.cjs +6 -6
  21. package/dist/index.mjs +11 -11
  22. package/dist/providers/site-provider/index.d.ts +1 -2
  23. package/dist/types/components/how-to/index.d.ts +2 -2
  24. package/dist/types/components/image/index.d.ts +4 -0
  25. package/dist/types/content/author/index.d.ts +5 -4
  26. package/dist/types/content/index.d.ts +1 -0
  27. package/dist/types/content/seo/index.d.ts +4 -0
  28. package/dist/types/site/index.d.ts +8 -14
  29. package/dist/utils/index.cjs +1 -2
  30. package/dist/utils/index.d.ts +0 -1
  31. package/dist/utils/index.mjs +1 -2
  32. package/package.json +1 -1
  33. package/dist/components/base/expert/index.d.ts +0 -8
  34. package/dist/index-qgcoV14g.js +0 -1021
  35. package/dist/utils/url/index.d.ts +0 -1
  36. /package/dist/components/base/{expert → author}/bio/index.d.ts +0 -0
@@ -1,1021 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const react = require("@chakra-ui/react");
4
- const reactI18next = require("react-i18next");
5
- const index$1 = require("./index-D2APUOog.js");
6
- const i18n = require("./index-BEqFPNAt.js");
7
- require("@ctrl/tinycolor");
8
- const react$2 = require("@mdx-js/react");
9
- const index = require("./index-BhsXlbd8.js");
10
- const react$1 = require("react");
11
- const icons = require("@chakra-ui/icons");
12
- const index$2 = require("./index-IpSV-c71.js");
13
- const i18n$1 = require("i18next");
14
- const gatsby = require("gatsby");
15
- const Markdown = require("react-markdown");
16
- const Center = ({ children, ...boxProps }) => {
17
- return /* @__PURE__ */ jsxRuntime.jsx(react.Center, { ...boxProps, children });
18
- };
19
- const ONE_LINE_HEIGHT = 24;
20
- const Bio = ({ content, maxLines = 1 }) => {
21
- const ref = react$1.useRef(null);
22
- const [showToggle, setShowToggle] = react$1.useState(false);
23
- const [isExpanded, setIsExpanded] = react$1.useState(false);
24
- const { t } = reactI18next.useTranslation("author");
25
- react$1.useLayoutEffect(() => {
26
- if (ref.current) {
27
- const { scrollWidth, clientWidth, scrollHeight, clientHeight } = ref.current;
28
- const isClamped = scrollWidth > clientWidth || scrollHeight > clientHeight;
29
- setShowToggle(isClamped);
30
- }
31
- return () => {
32
- setShowToggle(false);
33
- };
34
- }, []);
35
- function handleClick() {
36
- setIsExpanded((prev) => !prev);
37
- }
38
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
39
- /* @__PURE__ */ jsxRuntime.jsx(react.Collapse, { in: isExpanded, startingHeight: ONE_LINE_HEIGHT * maxLines, children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { ref, fontSize: "md", noOfLines: isExpanded ? void 0 : maxLines, children: content }) }),
40
- showToggle && /* @__PURE__ */ jsxRuntime.jsx(react.Button, { size: "sm", variant: "link", colorScheme: "blue", onClick: handleClick, children: isExpanded ? t("action.collapse") : t("action.expand") })
41
- ] });
42
- };
43
- const Expert = ({ expert, variant }) => {
44
- var _a;
45
- const { firstName, lastName, jobTitle, bio } = expert;
46
- const { assets } = index.useSiteContext();
47
- const fullName = `${firstName} ${lastName}`;
48
- const image = (_a = assets == null ? void 0 : assets.images) == null ? void 0 : _a.expert;
49
- const imageComponent = typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react.Image, { src: image, alt: fullName, rounded: "full" }) : image;
50
- if (variant === "short") {
51
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: "article", align: "center", gap: 4, children: [
52
- !!imageComponent && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { w: 12, h: 12, children: imageComponent }),
53
- /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { fontWeight: "semibold", children: [
54
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { children: fullName }),
55
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "gray.500", children: expert.jobTitle })
56
- ] })
57
- ] });
58
- }
59
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
60
- !!imageComponent && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { grow: 1, maxW: { base: 48, sm: 32 }, children: imageComponent }),
61
- /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { w: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { children: [
62
- /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { fontSize: "lg", fontWeight: 600, children: [
63
- `${fullName}, `,
64
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "gray.500", children: jobTitle })
65
- ] }),
66
- /* @__PURE__ */ jsxRuntime.jsx(Bio, { content: bio })
67
- ] }) })
68
- ] });
69
- };
70
- const defaultColumns = { base: 1, sm: 2, md: 3, lg: 4, xl: 5 };
71
- const Grid = ({ items, columns = defaultColumns, gap, render, getKey, ...boxProps }) => {
72
- return /* @__PURE__ */ jsxRuntime.jsx(react.SimpleGrid, { as: "ul", columns, spacing: gap, p: 0, m: 0, listStyleType: "none", ...boxProps, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "li", children: render(item) }, getKey ? getKey(item) : index2)) });
73
- };
74
- const LinkButton = ({ label, url, width = "auto", ...boxProps }) => {
75
- return /* @__PURE__ */ jsxRuntime.jsx(
76
- react.Button,
77
- {
78
- as: react.Link,
79
- href: url,
80
- w: width,
81
- bg: "brand.600",
82
- textTransform: "uppercase",
83
- _hover: { textDecoration: "none", bg: "brand.300" },
84
- _active: { transform: "scale(0.95)" },
85
- ...boxProps,
86
- children: label
87
- }
88
- );
89
- };
90
- const ColorMap = {
91
- light: "gray.200",
92
- dark: "gray.700"
93
- };
94
- const PulseButton = ({ label, colorScheme = "light", to, onClick }) => {
95
- return /* @__PURE__ */ jsxRuntime.jsx(
96
- react.Button,
97
- {
98
- size: { base: "sm", md: "lg" },
99
- color: ColorMap[colorScheme],
100
- bgColor: "brand.500",
101
- animation: `${index$1.Animation.pulse} 2s infinite linear`,
102
- _hover: { bgColor: "brand.200", color: "gray.700" },
103
- ...to ? { as: react.Link, href: to } : { onClick },
104
- children: label
105
- }
106
- );
107
- };
108
- const Author = ({ author, ...cardProps }) => {
109
- const { t } = reactI18next.useTranslation("author");
110
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Card, { as: "article", variant: "filled", ...cardProps, children: [
111
- /* @__PURE__ */ jsxRuntime.jsx(react.CardHeader, { pb: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react.Heading, { size: "md", children: t("title") }) }),
112
- /* @__PURE__ */ jsxRuntime.jsx(
113
- react.CardBody,
114
- {
115
- display: "flex",
116
- flexDirection: { base: "column", sm: "row" },
117
- alignItems: { base: "center", sm: "flex-start" },
118
- gap: 4,
119
- children: /* @__PURE__ */ jsxRuntime.jsx(Expert, { expert: author, variant: "full" })
120
- }
121
- )
122
- ] });
123
- };
124
- const BonusCardContent = ({ content }) => {
125
- const { t } = reactI18next.useTranslation("author");
126
- return /* @__PURE__ */ jsxRuntime.jsx(react.Popover, { autoFocus: false, isLazy: true, lazyBehavior: "keepMounted", children: ({ isOpen }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
127
- /* @__PURE__ */ jsxRuntime.jsx(react.PopoverTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Button, { size: "sm", variant: "link", color: "white", children: isOpen ? t("action.collapse") : t("action.expand") }) }),
128
- /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverContent, { children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverBody, { children: Array.isArray(content) ? /* @__PURE__ */ jsxRuntime.jsx(react.Stack, { children: content.map((paragraph, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", children: paragraph }, index2)) }) : /* @__PURE__ */ jsxRuntime.jsx(react.Text, { children: content }) }) }) })
129
- ] }) });
130
- };
131
- const BonusCardTitle = ({ content }) => {
132
- return /* @__PURE__ */ jsxRuntime.jsx(
133
- react.Text,
134
- {
135
- as: "h3",
136
- display: "inline-block",
137
- py: 1,
138
- px: 2,
139
- borderRadius: "md",
140
- bg: "yellow",
141
- color: "black",
142
- fontWeight: "bold",
143
- fontSize: "lg",
144
- children: content
145
- }
146
- );
147
- };
148
- const BonusCard = ({ title, subtitle, content, link, image, className }) => {
149
- return /* @__PURE__ */ jsxRuntime.jsxs(
150
- react.Card,
151
- {
152
- as: "article",
153
- h: "full",
154
- color: "whiteAlpha.900",
155
- bg: "linear-gradient(90deg, #3b1f47, #731d58)",
156
- _before: image ? {
157
- content: '""',
158
- position: "absolute",
159
- top: 0,
160
- left: 0,
161
- w: "100%",
162
- h: "100%",
163
- bgImage: `url(${image})`,
164
- bgSize: "cover",
165
- bgPosition: "center",
166
- filter: "blur(0.05em) opacity(50%)",
167
- zIndex: 0
168
- } : void 0,
169
- className,
170
- children: [
171
- /* @__PURE__ */ jsxRuntime.jsxs(react.CardBody, { as: "section", pb: 0, flex: 1, children: [
172
- /* @__PURE__ */ jsxRuntime.jsx(BonusCardTitle, { content: title }),
173
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "2xl", fontWeight: "bold", my: 2, children: subtitle }),
174
- /* @__PURE__ */ jsxRuntime.jsx(BonusCardContent, { content })
175
- ] }),
176
- /* @__PURE__ */ jsxRuntime.jsx(react.CardFooter, { as: "footer", p: 4, children: /* @__PURE__ */ jsxRuntime.jsx(LinkButton, { ...link, width: "full" }) })
177
- ]
178
- }
179
- );
180
- };
181
- const ContactForm = ({ ...boxProps }) => {
182
- const toast = react.useToast();
183
- const { t } = reactI18next.useTranslation("contactForm");
184
- function handleSubmit(event) {
185
- event.preventDefault();
186
- const form = event.currentTarget;
187
- const formData = new FormData(form);
188
- const name = formData.get("name");
189
- const email = formData.get("email");
190
- const message = formData.get("message");
191
- if (name && email && message) {
192
- form.reset();
193
- toast({
194
- title: t("notification.title", { name }),
195
- description: t("notification.description", { email }),
196
- colorScheme: "brand",
197
- status: "success",
198
- duration: 5e3,
199
- isClosable: true
200
- });
201
- } else {
202
- console.error("Please fill out both fields");
203
- }
204
- }
205
- return /* @__PURE__ */ jsxRuntime.jsx(
206
- react.Box,
207
- {
208
- as: "form",
209
- borderRadius: "lg",
210
- p: 8,
211
- color: react.useColorModeValue("gray.700", "whiteAlpha.900"),
212
- bg: react.useColorModeValue("white", "gray.700"),
213
- shadow: "base",
214
- onSubmit: handleSubmit,
215
- ...boxProps,
216
- children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { spacing: 4, children: [
217
- /* @__PURE__ */ jsxRuntime.jsxs(react.FormControl, { isRequired: true, children: [
218
- /* @__PURE__ */ jsxRuntime.jsx(react.FormLabel, { children: t("field.name.label") }),
219
- /* @__PURE__ */ jsxRuntime.jsxs(react.InputGroup, { children: [
220
- /* @__PURE__ */ jsxRuntime.jsx(react.InputLeftElement, { children: /* @__PURE__ */ jsxRuntime.jsx(
221
- "svg",
222
- {
223
- xmlns: "http://www.w3.org/2000/svg",
224
- width: "16",
225
- height: "16",
226
- fill: "currentColor",
227
- className: "bi bi-person-fill",
228
- viewBox: "0 0 16 16",
229
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6" })
230
- }
231
- ) }),
232
- /* @__PURE__ */ jsxRuntime.jsx(react.Input, { type: "text", name: "name", placeholder: t("field.name.placeholder") })
233
- ] })
234
- ] }),
235
- /* @__PURE__ */ jsxRuntime.jsxs(react.FormControl, { isRequired: true, children: [
236
- /* @__PURE__ */ jsxRuntime.jsx(react.FormLabel, { children: t("field.email.label") }),
237
- /* @__PURE__ */ jsxRuntime.jsxs(react.InputGroup, { children: [
238
- /* @__PURE__ */ jsxRuntime.jsx(react.InputLeftElement, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.EmailIcon, {}) }),
239
- /* @__PURE__ */ jsxRuntime.jsx(react.Input, { type: "email", name: "email", placeholder: t("field.email.placeholder") })
240
- ] })
241
- ] }),
242
- /* @__PURE__ */ jsxRuntime.jsxs(react.FormControl, { isRequired: true, children: [
243
- /* @__PURE__ */ jsxRuntime.jsx(react.FormLabel, { children: t("field.message.label") }),
244
- /* @__PURE__ */ jsxRuntime.jsx(react.Textarea, { name: "message", placeholder: t("field.message.placeholder"), rows: 6, resize: "none" })
245
- ] }),
246
- /* @__PURE__ */ jsxRuntime.jsx(react.Button, { type: "submit", colorScheme: "brand", width: "full", children: t("action.send") })
247
- ] })
248
- }
249
- );
250
- };
251
- const ExpertTip = ({ tip, expert, ...boxProps }) => {
252
- return /* @__PURE__ */ jsxRuntime.jsxs(
253
- react.Card,
254
- {
255
- variant: "filled",
256
- p: 4,
257
- borderLeft: "4px solid gray",
258
- gap: 4,
259
- _before: {
260
- content: '"❛❛"',
261
- position: "absolute",
262
- top: -8,
263
- left: -2,
264
- fontSize: "6rem",
265
- fontStyle: "italic",
266
- color: react.useColorModeValue("blackAlpha.300", "whiteAlpha.300")
267
- },
268
- ...boxProps,
269
- children: [
270
- /* @__PURE__ */ jsxRuntime.jsx(react.CardBody, { as: "blockquote", p: 0, fontStyle: "italic", children: tip }),
271
- !!expert && /* @__PURE__ */ jsxRuntime.jsx(react.CardFooter, { alignItems: "center", justify: "flex-end", p: 0, children: /* @__PURE__ */ jsxRuntime.jsx(Expert, { expert, variant: "short" }) })
272
- ]
273
- }
274
- );
275
- };
276
- const Faq = ({ items, ...boxProps }) => {
277
- const { bgColor, color } = index$2.usePrimaryColors();
278
- return /* @__PURE__ */ jsxRuntime.jsx(react.Accordion, { allowToggle: true, ...boxProps, children: items.map(({ question, answer }) => {
279
- return /* @__PURE__ */ jsxRuntime.jsxs(react.AccordionItem, { border: 0, children: [
280
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "h3", children: /* @__PURE__ */ jsxRuntime.jsxs(react.AccordionButton, { _hover: { color, bgColor }, children: [
281
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", flex: "1", textAlign: "left", fontWeight: "bold", children: question }),
282
- /* @__PURE__ */ jsxRuntime.jsx(react.AccordionIcon, {})
283
- ] }) }),
284
- /* @__PURE__ */ jsxRuntime.jsx(react.AccordionPanel, { children: answer })
285
- ] }, question);
286
- }) });
287
- };
288
- const FeatureCard = ({ title, description }) => {
289
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Card, { as: "article", variant: "outline", textAlign: "center", h: "100%", children: [
290
- /* @__PURE__ */ jsxRuntime.jsxs(react.CardHeader, { as: "header", display: "flex", alignItems: "center", justifyContent: "center", gap: 2, pb: 2, children: [
291
- /* @__PURE__ */ jsxRuntime.jsx(icons.StarIcon, { w: 8, h: 8, color: "yellow.400" }),
292
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: 600, children: title }),
293
- /* @__PURE__ */ jsxRuntime.jsx(icons.StarIcon, { w: 8, h: 8, color: "yellow.400" })
294
- ] }),
295
- /* @__PURE__ */ jsxRuntime.jsx(react.CardBody, { as: "section", pt: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "gray.200", children: description }) })
296
- ] });
297
- };
298
- const Features = ({ features, ...boxProps }) => {
299
- return /* @__PURE__ */ jsxRuntime.jsx(
300
- Grid,
301
- {
302
- items: features,
303
- columns: { base: 1, md: 2, lg: 3 },
304
- gap: 10,
305
- getKey: ({ title }) => title,
306
- render: (item) => /* @__PURE__ */ jsxRuntime.jsx(FeatureCard, { ...item }),
307
- ...boxProps
308
- }
309
- );
310
- };
311
- const GameCard = ({ name, description, image, link, height = "auto" }) => {
312
- return /* @__PURE__ */ jsxRuntime.jsxs(
313
- react.LinkBox,
314
- {
315
- as: "article",
316
- rounded: "md",
317
- borderWidth: 1,
318
- transition: "transform 0.2s ease",
319
- cursor: link ? "pointer" : "default",
320
- overflow: "hidden",
321
- bg: "blackAlpha.200",
322
- height,
323
- _hover: { transform: "scale(1.1)" },
324
- children: [
325
- typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react.Image, { src: image, alt: name, w: "100%", aspectRatio: "16/9", objectFit: "cover", objectPosition: "center" }) : !!image && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { w: "100%", aspectRatio: "16/9", children: image }),
326
- /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "section", rounded: "md", p: 4, children: [
327
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", children: link ? /* @__PURE__ */ jsxRuntime.jsx(react.LinkOverlay, { href: link, children: name }) : name }),
328
- !!description && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", color: "gray.600", children: description })
329
- ] })
330
- ]
331
- }
332
- );
333
- };
334
- const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscreen }) => {
335
- const { t } = reactI18next.useTranslation("gameDemo");
336
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
337
- /* @__PURE__ */ jsxRuntime.jsx(
338
- react.Box,
339
- {
340
- as: "iframe",
341
- src,
342
- sandbox: "allow-scripts allow-same-origin",
343
- loading: "lazy",
344
- w: "100%",
345
- h: "100%",
346
- allowFullScreen: true,
347
- onLoad,
348
- children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: t("warning") })
349
- }
350
- ),
351
- /* @__PURE__ */ jsxRuntime.jsx(
352
- react.IconButton,
353
- {
354
- icon: isFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { w: 3, h: 3 }) : /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLinkIcon, { w: 4, h: 4 }),
355
- size: "sm",
356
- variant: "outline",
357
- title: t(isFullscreen ? "action.deactivateFullscreen" : "action.activateFullscreen"),
358
- "aria-label": "Fullscreen mode Toggle",
359
- isRound: true,
360
- disabled: !isLoaded,
361
- position: "absolute",
362
- top: 2,
363
- left: 2,
364
- border: "none",
365
- color: "white",
366
- _hover: { bgColor: "whiteAlpha.400" },
367
- onClick: onToggleFullscreen
368
- }
369
- ),
370
- /* @__PURE__ */ jsxRuntime.jsx(react.AbsoluteCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Spinner, { size: "xl", thickness: "0.6rem", display: isLoaded ? "none" : "block", color: "brand.100" }) })
371
- ] });
372
- };
373
- const GameDemoPreview = ({ image, alt, imageFit = "contain", onPlay }) => {
374
- const { t } = reactI18next.useTranslation("gameDemo");
375
- const imageComponent = typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react.Image, { src: image, alt, objectFit: imageFit }) : image;
376
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
377
- imageComponent,
378
- /* @__PURE__ */ jsxRuntime.jsx(react.AbsoluteCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(PulseButton, { label: t("action.playForFree"), onClick: onPlay }) })
379
- ] });
380
- };
381
- const GameDemo = ({ name, src, previewImage, previewImageFit, ...boxProps }) => {
382
- const [isRunning, setIsRunning] = react$1.useState(false);
383
- const [isLoaded, setIsLoaded] = react$1.useState(false);
384
- const { isOpen: isFullscreen, onToggle } = react.useDisclosure({ defaultIsOpen: false });
385
- function handlePlay() {
386
- setIsRunning(true);
387
- }
388
- function onLoad() {
389
- setIsLoaded(true);
390
- }
391
- function handleToggleFullscreen() {
392
- document.body.style.overflowY = isFullscreen ? "auto" : "hidden";
393
- onToggle();
394
- }
395
- return /* @__PURE__ */ jsxRuntime.jsx(
396
- react.Box,
397
- {
398
- as: "article",
399
- display: "grid",
400
- w: "100%",
401
- aspectRatio: "16/9 auto",
402
- ...isFullscreen ? { zIndex: 100, inset: 0, position: "fixed", h: "100dvh" } : { position: "relative" },
403
- ...boxProps,
404
- children: isRunning ? /* @__PURE__ */ jsxRuntime.jsx(
405
- GameDemoContent,
406
- {
407
- src,
408
- isFullscreen,
409
- isLoaded,
410
- onLoad,
411
- onToggleFullscreen: handleToggleFullscreen
412
- }
413
- ) : /* @__PURE__ */ jsxRuntime.jsx(GameDemoPreview, { image: previewImage, alt: name, imageFit: previewImageFit, onPlay: handlePlay })
414
- }
415
- );
416
- };
417
- const GameInfoItem = ({ title, value }) => {
418
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { gap: 2, children: [
419
- /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { w: "50%", color: "gray.500", textTransform: "capitalize", children: [
420
- title,
421
- ":"
422
- ] }),
423
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { w: "50%", textTransform: "capitalize", children: value })
424
- ] });
425
- };
426
- const VISIBLE_LANGUAGE_NUMBER = 5;
427
- function stringifyHasFeature(value) {
428
- return i18n$1.t(`gameInfo:value.boolean.${value}`);
429
- }
430
- function stringifyVolatility(value) {
431
- return i18n$1.t(`gameInfo:value.volatility.${value}`);
432
- }
433
- function stringifyArray(array) {
434
- return array.join(", ");
435
- }
436
- function stringifyLanguageArray(languages) {
437
- return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
438
- }
439
- function getGameInfoItemValue(key, value, currency) {
440
- let formattedValue = "";
441
- if (key === i18n.GameCharacteristic.Rtp) {
442
- formattedValue = index$1.formatNumber(value, { percent: "real", precision: 3 });
443
- }
444
- if ((key === i18n.GameCharacteristic.MinBet || key === i18n.GameCharacteristic.MaxBet || key === i18n.GameCharacteristic.MaxWin) && typeof value === "number") {
445
- if (Array.isArray(currency)) {
446
- const [primary, ...secondaries] = currency || ["USD"];
447
- const primaryValue = index$1.formatNumber(value, { currency: primary });
448
- formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => index$1.getCurrencySymbol(currency2)).join(", ")})` : primaryValue;
449
- } else {
450
- formattedValue = index$1.formatNumber(value, { currency });
451
- }
452
- }
453
- if (key === i18n.GameCharacteristic.Compatibility || key === i18n.GameCharacteristic.BonusFeatures && typeof value !== "string") {
454
- formattedValue = stringifyArray(value);
455
- }
456
- if (key === i18n.GameCharacteristic.Languages) {
457
- formattedValue = stringifyLanguageArray(value);
458
- }
459
- if (key === i18n.GameCharacteristic.ReleaseDate) {
460
- formattedValue = index$1.formatDate({ value, options: { year: "numeric", month: "long" } });
461
- }
462
- if (key === i18n.GameCharacteristic.Volatility) {
463
- formattedValue = stringifyVolatility(value);
464
- }
465
- if (typeof value === "boolean") {
466
- formattedValue = stringifyHasFeature(value);
467
- }
468
- if (!formattedValue) {
469
- formattedValue = value.toLocaleString();
470
- }
471
- return formattedValue;
472
- }
473
- const GameInfo = ({ info }) => {
474
- const { metadata } = index.useSiteContext();
475
- const { currency } = metadata;
476
- const { t } = reactI18next.useTranslation("gameInfo");
477
- return /* @__PURE__ */ jsxRuntime.jsx(
478
- react.Box,
479
- {
480
- as: "aside",
481
- float: { base: "none", lg: "right" },
482
- w: { base: "100%", lg: "xs" },
483
- ml: { base: 0, lg: 4 },
484
- mb: { base: 0, lg: 4 },
485
- children: /* @__PURE__ */ jsxRuntime.jsxs(react.Card, { as: "article", variant: "outline", h: "100%", p: 2, children: [
486
- /* @__PURE__ */ jsxRuntime.jsx(react.CardHeader, { as: "header", p: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react.Heading, { as: "h2", fontSize: "xl", children: t("title") }) }),
487
- /* @__PURE__ */ jsxRuntime.jsx(react.CardBody, { as: "section", p: 0, children: Object.entries(info).map(([group, items]) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.Fragment, { children: [
488
- /* @__PURE__ */ jsxRuntime.jsx(react.Divider, { my: 2 }),
489
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: "semibold", mb: 2, children: t(`group.${group}`) }),
490
- Object.entries(items).map(([itemKey, itemValue]) => {
491
- const feature = itemKey;
492
- const value = getGameInfoItemValue(feature, itemValue, currency);
493
- return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`), value }, itemKey);
494
- })
495
- ] }, group)) })
496
- ] })
497
- }
498
- );
499
- };
500
- const HowTo = ({ steps, ...boxProps }) => {
501
- const { color, bgColor } = index$2.usePrimaryColors();
502
- return /* @__PURE__ */ jsxRuntime.jsx(react.SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description, image }, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
503
- /* @__PURE__ */ jsxRuntime.jsx(react.Circle, { size: 12, bgColor, color, fontSize: "lg", fontWeight: "bold", children: String(index2 + 1) }),
504
- /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { flex: 1, children: [
505
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "lg", fontWeight: "bold", children: title }),
506
- typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react.Image, { src: image, alt: title, aspectRatio: "16/9", objectFit: "cover" }) : image,
507
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { children: description })
508
- ] })
509
- ] }, index2)) });
510
- };
511
- const Container = ({ children }) => {
512
- return /* @__PURE__ */ jsxRuntime.jsx(react.Container, { maxW: "container.xl", children });
513
- };
514
- const Content = ({ children }) => {
515
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "section", py: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children }) });
516
- };
517
- const Logo = () => {
518
- var _a;
519
- const { assets } = index.useSiteContext();
520
- const image = (_a = assets == null ? void 0 : assets.images) == null ? void 0 : _a.logo;
521
- if (!image) {
522
- return null;
523
- }
524
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { display: "flex", h: { base: 10, md: 14 }, overflow: "hidden", children: typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react.Image, { src: image, alt: "Logo", objectFit: "contain" }) : image });
525
- };
526
- const Brand$1 = ({ brand }) => {
527
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { position: "relative", my: 2, py: 8, children: [
528
- /* @__PURE__ */ jsxRuntime.jsx(react.Divider, {}),
529
- /* @__PURE__ */ jsxRuntime.jsx(react.AbsoluteCenter, { display: "flex", bgColor: react.useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsxRuntime.jsx(gatsby.Link, { to: "/", children: brand }) })
530
- ] });
531
- };
532
- const Copyright = () => {
533
- const { metadata } = index.useSiteContext();
534
- const { siteUrl } = metadata;
535
- const { t } = reactI18next.useTranslation("footer");
536
- return /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "small", colorScheme: "gray", display: "flex", align: "center", justifyContent: "center", children: t("copyright", { year: index$1.getCurrentYear(), domain: index$1.getDomain(siteUrl) }) });
537
- };
538
- const Disclaimer = () => {
539
- const { metadata } = index.useSiteContext();
540
- const { siteUrl } = metadata;
541
- const { t } = reactI18next.useTranslation("footer");
542
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "small", colorScheme: "gray", fontSize: "sm", children: [
543
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", fontWeight: "bold", color: "red.600", children: t("disclaimer.title") }),
544
- t("disclaimer.description", { domain: index$1.getDomain(siteUrl) })
545
- ] });
546
- };
547
- const Extra = ({ children }) => {
548
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "section", my: 2, children });
549
- };
550
- const Navigation$1 = ({ menu }) => {
551
- return /* @__PURE__ */ jsxRuntime.jsx(
552
- react.SimpleGrid,
553
- {
554
- as: "ul",
555
- columns: { base: 1, sm: 2, md: 4 },
556
- mt: 4,
557
- mb: 6,
558
- p: 0,
559
- spacing: 4,
560
- justifyItems: { base: "flex-start", md: "center" },
561
- justifyContent: "space-between",
562
- children: menu.map(({ path, label }, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
563
- react.Text,
564
- {
565
- as: gatsby.Link,
566
- to: path,
567
- fontSize: "md",
568
- fontWeight: "semibold",
569
- colorScheme: "gray",
570
- _hover: { textDecoration: "none", color: "brand.400" },
571
- children: label
572
- },
573
- path
574
- ) }, index2))
575
- }
576
- );
577
- };
578
- const Footer = () => {
579
- var _a, _b, _c;
580
- const { configs } = index.useSiteContext();
581
- const navigation = ((_a = configs == null ? void 0 : configs.footer) == null ? void 0 : _a.navigation) ?? [];
582
- const extra = (_b = configs == null ? void 0 : configs.footer) == null ? void 0 : _b.extra;
583
- const showDisclaimer = ((_c = configs == null ? void 0 : configs.footer) == null ? void 0 : _c.showDisclaimer) ?? true;
584
- const hasNavigation = !!navigation.length;
585
- const hasExtra = !!extra;
586
- return /* @__PURE__ */ jsxRuntime.jsx(
587
- react.Box,
588
- {
589
- as: "footer",
590
- bg: react.useColorModeValue("gray.50", "gray.900"),
591
- color: react.useColorModeValue("gray.700", "gray.200"),
592
- py: 4,
593
- children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
594
- hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(Navigation$1, { menu: navigation }),
595
- hasExtra && /* @__PURE__ */ jsxRuntime.jsx(Extra, { children: extra }),
596
- showDisclaimer && /* @__PURE__ */ jsxRuntime.jsx(Disclaimer, {}),
597
- /* @__PURE__ */ jsxRuntime.jsx(Brand$1, { brand: /* @__PURE__ */ jsxRuntime.jsx(Logo, {}) }),
598
- /* @__PURE__ */ jsxRuntime.jsx(Copyright, {})
599
- ] })
600
- }
601
- );
602
- };
603
- const Brand = ({ brand }) => {
604
- return /* @__PURE__ */ jsxRuntime.jsx(gatsby.Link, { to: "/", children: brand });
605
- };
606
- const NavLink = react$1.forwardRef(({ path, label }, ref) => {
607
- return /* @__PURE__ */ jsxRuntime.jsx(
608
- react.Text,
609
- {
610
- ref,
611
- as: gatsby.Link,
612
- to: path,
613
- p: 2,
614
- fontWeight: "semibold",
615
- _hover: { textDecoration: "none", color: "brand.400" },
616
- children: label
617
- }
618
- );
619
- });
620
- NavLink.displayName = "NavLink";
621
- const NavList$1 = ({ path, label, children }) => {
622
- const background = react.useColorModeValue("white", "gray.800");
623
- const backgroundHover = react.useColorModeValue("brand.50", "gray.900");
624
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Popover, { trigger: "hover", placement: "bottom-start", children: [
625
- /* @__PURE__ */ jsxRuntime.jsx(react.PopoverTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
626
- react.Text,
627
- {
628
- p: 2,
629
- fontWeight: "semibold",
630
- cursor: "pointer",
631
- tabIndex: 0,
632
- _hover: { textDecoration: "none", color: "brand.400" },
633
- children: label
634
- }
635
- ) }),
636
- /* @__PURE__ */ jsxRuntime.jsx(react.PopoverContent, { p: 2, border: 0, minW: "sm", rounded: "xl", boxShadow: "xl", bg: background, children: /* @__PURE__ */ jsxRuntime.jsx(react.List, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: gatsby.Link, to: `${path}${child.path}`, p: 2, role: "group", children: [
637
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
638
- /* @__PURE__ */ jsxRuntime.jsx(
639
- react.Flex,
640
- {
641
- flex: 1,
642
- justify: "flex-end",
643
- align: "center",
644
- opacity: 0,
645
- transition: "all .3s ease",
646
- transform: "translateX(-10px)",
647
- _groupHover: { opacity: 1, transform: "translateX(0)" },
648
- children: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { as: icons.ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
649
- }
650
- )
651
- ] }) }, index2)) }) })
652
- ] });
653
- };
654
- const DesktopNavigation = ({ menu }) => {
655
- return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "ul", role: "list", gap: 2, p: 0, display: { base: "none", md: "flex" }, children: menu.map((item, index2) => {
656
- var _a;
657
- return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", role: "listitem", children: ((_a = item.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx(NavList$1, { ...item }) : /* @__PURE__ */ jsxRuntime.jsx(NavLink, { ...item }) }, index2);
658
- }) });
659
- };
660
- const CHEVRON_DOWN_ICON_SIZE = "1.5rem";
661
- const NavList = ({ path, label, children, isExpanded, onExpand }) => {
662
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { flex: 1, children: [
663
- /* @__PURE__ */ jsxRuntime.jsxs(
664
- react.Flex,
665
- {
666
- as: "button",
667
- p: 2,
668
- pr: "3px",
669
- align: "center",
670
- justifyContent: "space-between",
671
- _hover: { textDecoration: "none", color: "brand.400" },
672
- onClick: onExpand,
673
- children: [
674
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { isTruncated: true, fontWeight: 600, children: label }),
675
- /* @__PURE__ */ jsxRuntime.jsx(
676
- icons.ChevronDownIcon,
677
- {
678
- w: CHEVRON_DOWN_ICON_SIZE,
679
- h: CHEVRON_DOWN_ICON_SIZE,
680
- transform: isExpanded ? "rotate(180deg)" : "",
681
- transition: "all .25s ease-in-out"
682
- }
683
- )
684
- ]
685
- }
686
- ),
687
- /* @__PURE__ */ jsxRuntime.jsx(react.Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsxRuntime.jsx(react.List, { ml: 2, pl: 0, borderLeft: 1, borderStyle: "solid", borderColor: react.useColorModeValue("gray.200", "gray.700"), children: children == null ? void 0 : children.map((child, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: gatsby.Link, to: `${path}${child.path}`, p: 2, fontSize: "sm", children: child.label }) }, index2)) }) })
688
- ] });
689
- };
690
- const CLOSE_ICON_SIZE = "0.75rem";
691
- const HAMBURGER_ICON_SIZE = "1rem";
692
- const MobileNavigation = ({ menu }) => {
693
- const [expanded, setExpanded] = react$1.useState(null);
694
- const { isOpen, onToggle } = react.useDisclosure();
695
- const background = react.useColorModeValue("gray.50", "gray.900");
696
- function handleExpand(index2) {
697
- return () => {
698
- setExpanded((prev) => prev === index2 ? null : index2);
699
- };
700
- }
701
- function handleClick() {
702
- setExpanded(null);
703
- onToggle();
704
- }
705
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: { base: "block", md: "none" }, children: [
706
- /* @__PURE__ */ jsxRuntime.jsx(
707
- react.IconButton,
708
- {
709
- icon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { w: CLOSE_ICON_SIZE, h: CLOSE_ICON_SIZE }) : /* @__PURE__ */ jsxRuntime.jsx(icons.HamburgerIcon, { w: HAMBURGER_ICON_SIZE, h: HAMBURGER_ICON_SIZE }),
710
- size: "sm",
711
- variant: "ghost",
712
- "aria-label": `${isOpen ? "Close" : "Open"} navigation menu`,
713
- "aria-expanded": isOpen,
714
- onClick: handleClick
715
- }
716
- ),
717
- /* @__PURE__ */ jsxRuntime.jsx(react.Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { position: "absolute", top: 16, left: 0, right: 0, w: "100vw", px: 2, children: /* @__PURE__ */ jsxRuntime.jsx(
718
- react.List,
719
- {
720
- spacing: 2,
721
- p: 2,
722
- boxShadow: "md",
723
- borderWidth: "1px",
724
- borderColor: react.useColorModeValue("gray.200", "gray.700"),
725
- borderRadius: "md",
726
- bg: background,
727
- children: menu.map((item, index2) => {
728
- var _a;
729
- return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", role: "listitem", children: ((_a = item.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx(NavList, { ...item, isExpanded: index2 === expanded, onExpand: handleExpand(index2) }) : /* @__PURE__ */ jsxRuntime.jsx(NavLink, { ...item }) }, index2);
730
- })
731
- }
732
- ) }) })
733
- ] });
734
- };
735
- const Navigation = ({ menu }) => {
736
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
737
- /* @__PURE__ */ jsxRuntime.jsx(DesktopNavigation, { menu }),
738
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavigation, { menu })
739
- ] });
740
- };
741
- const Header = () => {
742
- var _a, _b;
743
- const { configs } = index.useSiteContext();
744
- const navigation = ((_a = configs == null ? void 0 : configs.header) == null ? void 0 : _a.navigation) ?? [];
745
- const toolbar = (_b = configs == null ? void 0 : configs.header) == null ? void 0 : _b.toolbar;
746
- const hasToolbar = !!toolbar;
747
- const hasNavigation = !!navigation.length;
748
- return /* @__PURE__ */ jsxRuntime.jsx(
749
- react.Box,
750
- {
751
- as: "header",
752
- position: "sticky",
753
- top: 0,
754
- bg: react.useColorModeValue("white", "gray.900"),
755
- color: react.useColorModeValue("gray.700", "gray.200"),
756
- boxShadow: "sm",
757
- zIndex: 100,
758
- children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: "nav", gap: 2, py: 2, children: [
759
- /* @__PURE__ */ jsxRuntime.jsx(Brand, { brand: /* @__PURE__ */ jsxRuntime.jsx(Logo, {}) }),
760
- (hasNavigation || hasToolbar) && /* @__PURE__ */ jsxRuntime.jsxs(
761
- react.Flex,
762
- {
763
- as: "section",
764
- flex: 1,
765
- flexDir: { base: "row-reverse", md: "row" },
766
- justifyContent: "end",
767
- align: "center",
768
- gap: 2,
769
- children: [
770
- hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Navigation, { menu: navigation }) }),
771
- hasToolbar && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { gap: 2, flex: { base: 1, md: 0 }, justifyContent: "flex-end", children: toolbar })
772
- ]
773
- }
774
- )
775
- ] }) })
776
- }
777
- );
778
- };
779
- const Hero = ({ title, subtitle, content, link, image }) => {
780
- return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "section", bg: "gray.900", children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { direction: { base: "column", md: "row" }, children: [
781
- /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { align: "center", justify: { base: "center", md: "flex-start" }, flex: 1, py: 8, pe: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { spacing: 6, w: "full", maxW: "lg", children: [
782
- /* @__PURE__ */ jsxRuntime.jsxs(react.Heading, { as: "h1", fontSize: { base: "3xl", md: "4xl", lg: "5xl" }, children: [
783
- /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", display: "block", children: [
784
- title,
785
- " —"
786
- ] }),
787
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", display: "block", color: "brand.400", children: subtitle })
788
- ] }),
789
- /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: { base: "md", lg: "lg" }, color: "gray.500", children: content }),
790
- !!link && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { direction: { base: "column", md: "row" }, children: /* @__PURE__ */ jsxRuntime.jsx(LinkButton, { ...link }) })
791
- ] }) }),
792
- image && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { display: { base: "none", md: "flex" }, flex: 1, children: image })
793
- ] }) }) });
794
- };
795
- const Main = ({ children }) => {
796
- return /* @__PURE__ */ jsxRuntime.jsx(
797
- react.Flex,
798
- {
799
- as: "main",
800
- direction: "column",
801
- flexGrow: 1,
802
- bg: react.useColorModeValue("white", "gray.800"),
803
- color: react.useColorModeValue("gray.700", "gray.200"),
804
- children
805
- }
806
- );
807
- };
808
- const ScrollToTop = () => {
809
- const [isVisible, setIsVisible] = react$1.useState(false);
810
- react$1.useEffect(() => {
811
- const toggleVisibility = () => {
812
- setIsVisible(window.scrollY > 300);
813
- };
814
- window.addEventListener("scroll", toggleVisibility);
815
- return () => {
816
- window.removeEventListener("scroll", toggleVisibility);
817
- };
818
- }, []);
819
- function handleClick() {
820
- window.scrollTo({
821
- top: 0,
822
- behavior: "smooth"
823
- });
824
- }
825
- return /* @__PURE__ */ jsxRuntime.jsx(
826
- react.Box,
827
- {
828
- position: "fixed",
829
- bottom: { base: 4, md: 8, lg: 16 },
830
- right: { base: 4, md: 8, lg: 16 },
831
- zIndex: "1000",
832
- opacity: isVisible ? 1 : 0,
833
- transform: isVisible ? "translateY(0)" : "translateY(0.5rem)",
834
- transition: "opacity 0.4s ease, transform 0.4s ease",
835
- pointerEvents: isVisible ? "auto" : "none",
836
- children: /* @__PURE__ */ jsxRuntime.jsx(
837
- react.IconButton,
838
- {
839
- "aria-label": "Scroll to top",
840
- icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronUpIcon, { w: 6, h: 6 }),
841
- size: "lg",
842
- shadow: "lg",
843
- colorScheme: "brand",
844
- isRound: true,
845
- onClick: handleClick
846
- }
847
- )
848
- }
849
- );
850
- };
851
- const Layout = ({ children }) => {
852
- const content = typeof children === "function" ? children({ Hero, Content }) : /* @__PURE__ */ jsxRuntime.jsx(Content, { children });
853
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { spacing: 0, position: "relative", w: "100%", minH: "100dvh", children: [
854
- /* @__PURE__ */ jsxRuntime.jsx(Header, {}),
855
- /* @__PURE__ */ jsxRuntime.jsx(Main, { children: content }),
856
- /* @__PURE__ */ jsxRuntime.jsx(Footer, {}),
857
- /* @__PURE__ */ jsxRuntime.jsx(ScrollToTop, {})
858
- ] });
859
- };
860
- const List = ({ items, bullet = "—", render, ...boxProps }) => {
861
- return /* @__PURE__ */ jsxRuntime.jsx(react.List, { pl: 0, ml: 2, mb: 4, ...boxProps, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react.ListItem, { display: "flex", gap: 1, children: [
862
- /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: bullet }),
863
- render ? render(item) : item
864
- ] }, index2)) });
865
- };
866
- const TitleMap = {
867
- pros: "advantages",
868
- cons: "disadvantages"
869
- };
870
- const IconMap = {
871
- pros: icons.CheckCircleIcon,
872
- cons: icons.WarningIcon
873
- };
874
- const IconColorMap = {
875
- pros: "green.500",
876
- cons: "red.500"
877
- };
878
- const BgColorMap = {
879
- pros: "green",
880
- cons: "red"
881
- };
882
- const ProsConsCard = ({ itemType, items }) => {
883
- const { t } = reactI18next.useTranslation("prosCons");
884
- return /* @__PURE__ */ jsxRuntime.jsxs(
885
- react.Card,
886
- {
887
- as: "article",
888
- flex: 1,
889
- p: 2,
890
- bgColor: react.useColorModeValue(`${BgColorMap[itemType]}.100`, `${BgColorMap[itemType]}.800`),
891
- children: [
892
- /* @__PURE__ */ jsxRuntime.jsx(
893
- react.CardHeader,
894
- {
895
- as: "header",
896
- p: 2,
897
- borderTopRadius: "md",
898
- bgColor: react.useColorModeValue("whiteAlpha.800", "blackAlpha.800"),
899
- children: /* @__PURE__ */ jsxRuntime.jsx(react.Heading, { as: "h3", textTransform: "uppercase", fontSize: "xl", children: t(TitleMap[itemType]) })
900
- }
901
- ),
902
- /* @__PURE__ */ jsxRuntime.jsx(
903
- react.CardBody,
904
- {
905
- as: "section",
906
- p: 2,
907
- borderBottomRadius: "md",
908
- bgColor: react.useColorModeValue("whiteAlpha.800", "blackAlpha.800"),
909
- children: /* @__PURE__ */ jsxRuntime.jsx(react.List, { spacing: 4, p: 0, children: items.map(({ title, description }) => /* @__PURE__ */ jsxRuntime.jsxs(react.ListItem, { display: "flex", children: [
910
- /* @__PURE__ */ jsxRuntime.jsx(react.ListIcon, { as: IconMap[itemType], w: 6, h: 6, color: IconColorMap[itemType] }),
911
- /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { fontWeight: "semibold", fontSize: "md", children: [
912
- title,
913
- !!description && /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { as: "span", fontWeight: "normal", children: [
914
- ": ",
915
- description
916
- ] })
917
- ] })
918
- ] }, title)) })
919
- }
920
- )
921
- ]
922
- }
923
- );
924
- };
925
- const ProsCons = ({ items, ...boxProps }) => {
926
- const { pros, cons } = items;
927
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: "section", direction: { base: "column", md: "row" }, gap: 4, ...boxProps, children: [
928
- /* @__PURE__ */ jsxRuntime.jsx(ProsConsCard, { itemType: "pros", items: pros }),
929
- /* @__PURE__ */ jsxRuntime.jsx(ProsConsCard, { itemType: "cons", items: cons })
930
- ] });
931
- };
932
- const RichTextRenderer = ({ content }) => {
933
- const components = react$2.useMDXComponents();
934
- return /* @__PURE__ */ jsxRuntime.jsx(Markdown, { components, children: content });
935
- };
936
- const Seo = ({ children, siteMetadata, title, description, lang }) => {
937
- const { title: defaultTitle, description: defaultDescription, lang: defaultLang, siteUrl } = siteMetadata;
938
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
939
- /* @__PURE__ */ jsxRuntime.jsx("html", { lang: lang ?? defaultLang }),
940
- /* @__PURE__ */ jsxRuntime.jsx("title", { children: title ? typeof title === "string" ? title : title({
941
- domain: index$1.getDomain(siteUrl),
942
- currentYear: index$1.getCurrentYear(),
943
- currentMonth: index$1.getCurrentMonth()
944
- }) : defaultTitle }),
945
- /* @__PURE__ */ jsxRuntime.jsx(
946
- "meta",
947
- {
948
- name: "description",
949
- content: description ? typeof description === "string" ? description : description({
950
- domain: index$1.getDomain(siteUrl),
951
- currentYear: index$1.getCurrentYear(),
952
- currentMonth: index$1.getCurrentMonth()
953
- }) : defaultDescription
954
- }
955
- ),
956
- children
957
- ] });
958
- };
959
- const Table = ({
960
- columnNumber,
961
- items,
962
- caption,
963
- bordered = false,
964
- striped = true,
965
- scrollable,
966
- ...boxProps
967
- }) => {
968
- const headerItems = items.slice(0, columnNumber);
969
- const bodyItems = items.slice(columnNumber);
970
- return /* @__PURE__ */ jsxRuntime.jsx(
971
- react.TableContainer,
972
- {
973
- border: bordered ? void 0 : "none",
974
- ...scrollable ? { maxH: "50vh", overflowY: "auto" } : {},
975
- ...boxProps,
976
- children: /* @__PURE__ */ jsxRuntime.jsxs(react.Table, { variant: striped ? "striped" : "simple", children: [
977
- /* @__PURE__ */ jsxRuntime.jsx(react.Thead, { ...scrollable ? { position: "sticky", top: 0, zIndex: 1, bg: "gray.800" } : {}, children: /* @__PURE__ */ jsxRuntime.jsx(react.Tr, { children: headerItems.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.Th, { children: item }, index2)) }) }),
978
- /* @__PURE__ */ jsxRuntime.jsx(react.Tbody, { children: Array.from({ length: Math.ceil(bodyItems.length / columnNumber) }, (_, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(react.Tr, { children: Array.from({ length: columnNumber }, (_2, colIndex) => /* @__PURE__ */ jsxRuntime.jsx(react.Td, { children: bodyItems[rowIndex * columnNumber + colIndex] || "" }, colIndex)) }, rowIndex)) }),
979
- !!caption && /* @__PURE__ */ jsxRuntime.jsx(react.TableCaption, { children: caption })
980
- ] })
981
- }
982
- );
983
- };
984
- const Tabs = ({ items, render, ...boxProps }) => {
985
- const { tabs, panels } = react$1.useMemo(() => {
986
- const tabs2 = [];
987
- const panels2 = [];
988
- items.forEach(({ content, ...tab }) => {
989
- tabs2.push(tab);
990
- panels2.push(content);
991
- });
992
- return { tabs: tabs2, panels: panels2 };
993
- }, []);
994
- return /* @__PURE__ */ jsxRuntime.jsxs(react.Tabs, { overflow: "hidden", colorScheme: "brand", ...boxProps, children: [
995
- /* @__PURE__ */ jsxRuntime.jsx(react.TabList, { overflow: "auto hidden", children: tabs.map(({ label, icon }, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.Tab, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "h3", isTruncated: true, children: icon ? `${icon} ${label}` : label }) }, index2)) }),
996
- /* @__PURE__ */ jsxRuntime.jsx(react.TabPanels, { children: panels.map((panel, index2) => /* @__PURE__ */ jsxRuntime.jsx(react.TabPanel, { children: render ? render(panel) : panel }, index2)) })
997
- ] });
998
- };
999
- exports.Author = Author;
1000
- exports.BonusCard = BonusCard;
1001
- exports.Center = Center;
1002
- exports.ContactForm = ContactForm;
1003
- exports.Expert = Expert;
1004
- exports.ExpertTip = ExpertTip;
1005
- exports.Faq = Faq;
1006
- exports.FeatureCard = FeatureCard;
1007
- exports.Features = Features;
1008
- exports.GameCard = GameCard;
1009
- exports.GameDemo = GameDemo;
1010
- exports.GameInfo = GameInfo;
1011
- exports.Grid = Grid;
1012
- exports.HowTo = HowTo;
1013
- exports.Layout = Layout;
1014
- exports.LinkButton = LinkButton;
1015
- exports.List = List;
1016
- exports.ProsCons = ProsCons;
1017
- exports.PulseButton = PulseButton;
1018
- exports.RichTextRenderer = RichTextRenderer;
1019
- exports.Seo = Seo;
1020
- exports.Table = Table;
1021
- exports.Tabs = Tabs;