@mbpockets/shared-ui 0.2.0 → 0.2.6

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 (205) hide show
  1. package/dist/EventPage/editMode/index.cjs.map +1 -1
  2. package/dist/EventPage/editMode/index.d.cts +1 -1
  3. package/dist/EventPage/editMode/index.d.ts +1 -1
  4. package/dist/EventPage/editMode/index.mjs.map +1 -1
  5. package/dist/EventPage/editMode.cjs.map +1 -1
  6. package/dist/EventPage/editMode.d.cts +1 -1
  7. package/dist/EventPage/editMode.d.ts +1 -1
  8. package/dist/EventPage/editMode.mjs.map +1 -1
  9. package/dist/EventPage/index.cjs +202 -96
  10. package/dist/EventPage/index.cjs.map +1 -1
  11. package/dist/EventPage/index.d.cts +1 -1
  12. package/dist/EventPage/index.d.ts +1 -1
  13. package/dist/EventPage/index.mjs +202 -96
  14. package/dist/EventPage/index.mjs.map +1 -1
  15. package/dist/EventPage.cjs +202 -96
  16. package/dist/EventPage.cjs.map +1 -1
  17. package/dist/EventPage.d.cts +6 -4
  18. package/dist/EventPage.d.ts +6 -4
  19. package/dist/EventPage.mjs +202 -96
  20. package/dist/EventPage.mjs.map +1 -1
  21. package/dist/PlayerPage/index.cjs +12 -8
  22. package/dist/PlayerPage/index.cjs.map +1 -1
  23. package/dist/PlayerPage/index.mjs +12 -8
  24. package/dist/PlayerPage/index.mjs.map +1 -1
  25. package/dist/PlayerPage.cjs +12 -8
  26. package/dist/PlayerPage.cjs.map +1 -1
  27. package/dist/PlayerPage.mjs +12 -8
  28. package/dist/PlayerPage.mjs.map +1 -1
  29. package/dist/ProfilePage/index.cjs +12 -8
  30. package/dist/ProfilePage/index.cjs.map +1 -1
  31. package/dist/ProfilePage/index.mjs +12 -8
  32. package/dist/ProfilePage/index.mjs.map +1 -1
  33. package/dist/ProfilePage.cjs +12 -8
  34. package/dist/ProfilePage.cjs.map +1 -1
  35. package/dist/ProfilePage.mjs +12 -8
  36. package/dist/ProfilePage.mjs.map +1 -1
  37. package/dist/SearchPage/Filters/index.cjs +38 -18
  38. package/dist/SearchPage/Filters/index.cjs.map +1 -1
  39. package/dist/SearchPage/Filters/index.d.cts +2 -1
  40. package/dist/SearchPage/Filters/index.d.ts +2 -1
  41. package/dist/SearchPage/Filters/index.mjs +34 -17
  42. package/dist/SearchPage/Filters/index.mjs.map +1 -1
  43. package/dist/SearchPage/Filters.cjs +38 -18
  44. package/dist/SearchPage/Filters.cjs.map +1 -1
  45. package/dist/SearchPage/Filters.d.cts +13 -1
  46. package/dist/SearchPage/Filters.d.ts +13 -1
  47. package/dist/SearchPage/Filters.mjs +34 -17
  48. package/dist/SearchPage/Filters.mjs.map +1 -1
  49. package/dist/SearchPage/Results/index.cjs +137 -73
  50. package/dist/SearchPage/Results/index.cjs.map +1 -1
  51. package/dist/SearchPage/Results/index.mjs +137 -73
  52. package/dist/SearchPage/Results/index.mjs.map +1 -1
  53. package/dist/SearchPage/Results.cjs +137 -73
  54. package/dist/SearchPage/Results.cjs.map +1 -1
  55. package/dist/SearchPage/Results.d.cts +14 -3
  56. package/dist/SearchPage/Results.d.ts +14 -3
  57. package/dist/SearchPage/Results.mjs +137 -73
  58. package/dist/SearchPage/Results.mjs.map +1 -1
  59. package/dist/SearchPage/index.cjs +265 -130
  60. package/dist/SearchPage/index.cjs.map +1 -1
  61. package/dist/SearchPage/index.d.cts +2 -2
  62. package/dist/SearchPage/index.d.ts +2 -2
  63. package/dist/SearchPage/index.mjs +261 -129
  64. package/dist/SearchPage/index.mjs.map +1 -1
  65. package/dist/SearchPage.cjs +265 -130
  66. package/dist/SearchPage.cjs.map +1 -1
  67. package/dist/SearchPage.d.cts +25 -3
  68. package/dist/SearchPage.d.ts +25 -3
  69. package/dist/SearchPage.mjs +261 -129
  70. package/dist/SearchPage.mjs.map +1 -1
  71. package/dist/TablePage/EditComponents/index.cjs +296 -0
  72. package/dist/TablePage/EditComponents/index.cjs.map +1 -0
  73. package/dist/TablePage/EditComponents/index.d.cts +3 -0
  74. package/dist/TablePage/EditComponents/index.d.ts +3 -0
  75. package/dist/TablePage/EditComponents/index.mjs +286 -0
  76. package/dist/TablePage/EditComponents/index.mjs.map +1 -0
  77. package/dist/TablePage/EditComponents.cjs +296 -0
  78. package/dist/TablePage/EditComponents.cjs.map +1 -0
  79. package/dist/TablePage/EditComponents.d.cts +21 -0
  80. package/dist/TablePage/EditComponents.d.ts +21 -0
  81. package/dist/TablePage/EditComponents.mjs +286 -0
  82. package/dist/TablePage/EditComponents.mjs.map +1 -0
  83. package/dist/TablePage/ModalProvider/index.cjs +59 -58
  84. package/dist/TablePage/ModalProvider/index.cjs.map +1 -1
  85. package/dist/TablePage/ModalProvider/index.d.cts +1 -1
  86. package/dist/TablePage/ModalProvider/index.d.ts +1 -1
  87. package/dist/TablePage/ModalProvider/index.mjs +50 -59
  88. package/dist/TablePage/ModalProvider/index.mjs.map +1 -1
  89. package/dist/TablePage/ModalProvider.cjs +59 -58
  90. package/dist/TablePage/ModalProvider.cjs.map +1 -1
  91. package/dist/TablePage/ModalProvider.d.cts +7 -2
  92. package/dist/TablePage/ModalProvider.d.ts +7 -2
  93. package/dist/TablePage/ModalProvider.mjs +50 -59
  94. package/dist/TablePage/ModalProvider.mjs.map +1 -1
  95. package/dist/TablePage/index.cjs +555 -331
  96. package/dist/TablePage/index.cjs.map +1 -1
  97. package/dist/TablePage/index.d.cts +3 -2
  98. package/dist/TablePage/index.d.ts +3 -2
  99. package/dist/TablePage/index.mjs +539 -320
  100. package/dist/TablePage/index.mjs.map +1 -1
  101. package/dist/TablePage/players/index.cjs +24 -4
  102. package/dist/TablePage/players/index.cjs.map +1 -1
  103. package/dist/TablePage/players/index.mjs +24 -4
  104. package/dist/TablePage/players/index.mjs.map +1 -1
  105. package/dist/TablePage/players.cjs +24 -4
  106. package/dist/TablePage/players.cjs.map +1 -1
  107. package/dist/TablePage/players.mjs +24 -4
  108. package/dist/TablePage/players.mjs.map +1 -1
  109. package/dist/TablePage.cjs +555 -331
  110. package/dist/TablePage.cjs.map +1 -1
  111. package/dist/TablePage.d.cts +4 -1
  112. package/dist/TablePage.d.ts +4 -1
  113. package/dist/TablePage.mjs +539 -320
  114. package/dist/TablePage.mjs.map +1 -1
  115. package/dist/{index-D7WHhl3Q.d.ts → index-B23RQop0.d.ts} +12 -12
  116. package/dist/{index-DC0kK3aC.d.cts → index-Csj8S4A4.d.cts} +12 -12
  117. package/dist/index.cjs +972 -460
  118. package/dist/index.cjs.map +1 -1
  119. package/dist/index.d.cts +5 -4
  120. package/dist/index.d.ts +5 -4
  121. package/dist/index.mjs +953 -457
  122. package/dist/index.mjs.map +1 -1
  123. package/dist/mocks/{EventDB.cjs → EventDetails.cjs} +203 -3
  124. package/dist/mocks/EventDetails.cjs.map +1 -0
  125. package/dist/mocks/EventDetails.d.cts +6 -0
  126. package/dist/mocks/EventDetails.d.ts +6 -0
  127. package/dist/mocks/{EventDB.mjs → EventDetails.mjs} +203 -3
  128. package/dist/mocks/EventDetails.mjs.map +1 -0
  129. package/dist/mocks/Tables.cjs +1 -1
  130. package/dist/mocks/Tables.cjs.map +1 -1
  131. package/dist/mocks/Tables.mjs +1 -1
  132. package/dist/mocks/Tables.mjs.map +1 -1
  133. package/dist/mocks/Tags.cjs +200 -0
  134. package/dist/mocks/Tags.cjs.map +1 -1
  135. package/dist/mocks/Tags.mjs +200 -0
  136. package/dist/mocks/Tags.mjs.map +1 -1
  137. package/dist/mocks/index.cjs +202 -2
  138. package/dist/mocks/index.cjs.map +1 -1
  139. package/dist/mocks/index.d.cts +1 -1
  140. package/dist/mocks/index.d.ts +1 -1
  141. package/dist/mocks/index.mjs +202 -2
  142. package/dist/mocks/index.mjs.map +1 -1
  143. package/dist/mocks.cjs +202 -2
  144. package/dist/mocks.cjs.map +1 -1
  145. package/dist/mocks.d.cts +1 -1
  146. package/dist/mocks.d.ts +1 -1
  147. package/dist/mocks.mjs +202 -2
  148. package/dist/mocks.mjs.map +1 -1
  149. package/dist/shared/index.cjs +327 -64
  150. package/dist/shared/index.cjs.map +1 -1
  151. package/dist/shared/index.d.cts +1 -1
  152. package/dist/shared/index.d.ts +1 -1
  153. package/dist/shared/index.mjs +324 -64
  154. package/dist/shared/index.mjs.map +1 -1
  155. package/dist/shared.cjs +327 -64
  156. package/dist/shared.cjs.map +1 -1
  157. package/dist/shared.d.cts +25 -2
  158. package/dist/shared.d.ts +25 -2
  159. package/dist/shared.mjs +324 -64
  160. package/dist/shared.mjs.map +1 -1
  161. package/dist/types/event.d.cts +2 -3
  162. package/dist/types/event.d.ts +2 -3
  163. package/dist/types/index.d.cts +2 -2
  164. package/dist/types/index.d.ts +2 -2
  165. package/dist/types/search.d.cts +7 -1
  166. package/dist/types/search.d.ts +7 -1
  167. package/dist/types/tables.d.cts +1 -0
  168. package/dist/types/tables.d.ts +1 -0
  169. package/dist/types.d.cts +2 -2
  170. package/dist/types.d.ts +2 -2
  171. package/package.json +9 -2
  172. package/dist/TablePage/ModalProvider/index.css +0 -49
  173. package/dist/TablePage/ModalProvider/index.css.map +0 -1
  174. package/dist/TablePage/ModalProvider.css +0 -49
  175. package/dist/TablePage/ModalProvider.css.map +0 -1
  176. package/dist/TablePage/index.css +0 -49
  177. package/dist/TablePage/index.css.map +0 -1
  178. package/dist/TablePage.css +0 -49
  179. package/dist/TablePage.css.map +0 -1
  180. package/dist/index.css +0 -49
  181. package/dist/index.css.map +0 -1
  182. package/dist/mocks/EventDB.cjs.map +0 -1
  183. package/dist/mocks/EventDB.d.cts +0 -6
  184. package/dist/mocks/EventDB.d.ts +0 -6
  185. package/dist/mocks/EventDB.mjs.map +0 -1
  186. package/dist/shared/Modal/index.cjs +0 -64
  187. package/dist/shared/Modal/index.cjs.map +0 -1
  188. package/dist/shared/Modal/index.css +0 -49
  189. package/dist/shared/Modal/index.css.map +0 -1
  190. package/dist/shared/Modal/index.d.cts +0 -2
  191. package/dist/shared/Modal/index.d.ts +0 -2
  192. package/dist/shared/Modal/index.mjs +0 -62
  193. package/dist/shared/Modal/index.mjs.map +0 -1
  194. package/dist/shared/Modal.cjs +0 -64
  195. package/dist/shared/Modal.cjs.map +0 -1
  196. package/dist/shared/Modal.css +0 -49
  197. package/dist/shared/Modal.css.map +0 -1
  198. package/dist/shared/Modal.d.cts +0 -9
  199. package/dist/shared/Modal.d.ts +0 -9
  200. package/dist/shared/Modal.mjs +0 -62
  201. package/dist/shared/Modal.mjs.map +0 -1
  202. package/dist/shared/index.css +0 -49
  203. package/dist/shared/index.css.map +0 -1
  204. package/dist/shared.css +0 -49
  205. package/dist/shared.css.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import React7, { createContext, useState, useEffect, useContext, useMemo, useRef } from 'react';
3
3
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
4
- import { Box, Grid, TextField, Tooltip, IconButton, Button, CircularProgress, Dialog, DialogTitle, DialogContent, DialogActions, Card, CardContent, Typography, FormControl, InputLabel, Select, MenuItem, CardMedia, CardHeader, useTheme, useMediaQuery, NoSsr } from '@mui/material';
4
+ import { Box, Grid, TextField, Tooltip, IconButton, Button, CircularProgress, Dialog, DialogTitle, DialogContent, DialogActions, Card, CardContent, Typography, FormControl, InputLabel, Select, MenuItem, CardMedia, CardHeader, useTheme, useMediaQuery, NoSsr, Link, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1 } from '@mui/material';
5
5
  import DeleteIcon from '@mui/icons-material/Delete';
6
- import EditIcon from '@mui/icons-material/Edit';
6
+ import EditIcon3 from '@mui/icons-material/Edit';
7
7
  import AddIcon from '@mui/icons-material/Add';
8
8
  import ColorizeIcon from '@mui/icons-material/Colorize';
9
9
  import CancelIcon from '@mui/icons-material/Cancel';
10
10
  import CheckCircleIcon from '@mui/icons-material/CheckCircle';
11
11
  import Box2 from '@mui/material/Box';
12
- import Grid8 from '@mui/material/Grid';
12
+ import Grid10 from '@mui/material/Grid';
13
13
  import Card10 from '@mui/material/Card';
14
14
  import CardContent10 from '@mui/material/CardContent';
15
15
  import CardHeader4 from '@mui/material/CardHeader';
@@ -17,6 +17,7 @@ import Divider3 from '@mui/material/Divider';
17
17
  import Typography4 from '@mui/material/Typography';
18
18
  import Pagination from '@mui/material/Pagination';
19
19
  import Avatar from '@mui/material/Avatar';
20
+ import { useRouter } from 'next/navigation';
20
21
  import Chip2 from '@mui/material/Chip';
21
22
  import LinearProgress from '@mui/material/LinearProgress';
22
23
  import PersonIcon from '@mui/icons-material/Person';
@@ -27,19 +28,29 @@ import LocationOnIcon from '@mui/icons-material/LocationOn';
27
28
  import EventIcon from '@mui/icons-material/Event';
28
29
  import Autocomplete from '@mui/material/Autocomplete';
29
30
  import Popper from '@mui/material/Popper';
31
+ import FormControl2 from '@mui/material/FormControl';
32
+ import Select2 from '@mui/material/Select';
33
+ import MenuItem2 from '@mui/material/MenuItem';
30
34
  import FormControlLabel from '@mui/material/FormControlLabel';
31
35
  import Checkbox from '@mui/material/Checkbox';
32
- import FormControl2 from '@mui/material/FormControl';
33
36
  import RadioGroup from '@mui/material/RadioGroup';
34
37
  import Radio from '@mui/material/Radio';
35
- import TextField4 from '@mui/material/TextField';
38
+ import TextField7 from '@mui/material/TextField';
36
39
  import FormGroup from '@mui/material/FormGroup';
37
- import Button7 from '@mui/material/Button';
40
+ import Button8 from '@mui/material/Button';
38
41
  import SearchIcon from '@mui/icons-material/Search';
39
42
  import CircularProgress3 from '@mui/material/CircularProgress';
43
+ import CasinoIcon from '@mui/icons-material/Casino';
44
+ import Dialog3 from '@mui/material/Dialog';
45
+ import DialogContent3 from '@mui/material/DialogContent';
46
+ import DialogActions3 from '@mui/material/DialogActions';
47
+ import IconButton3 from '@mui/material/IconButton';
48
+ import CloseIcon from '@mui/icons-material/Close';
49
+ import ReactMarkdown from 'react-markdown';
40
50
  import Image2 from 'next/image';
41
51
  import ListIcon from '@mui/icons-material/List';
42
52
  import SaveIcon from '@mui/icons-material/Save';
53
+ import DialogTitle3 from '@mui/material/DialogTitle';
43
54
 
44
55
  // src/components/EventPage/editMode/EventBannerEdit.tsx
45
56
  var defaultValue = {
@@ -128,12 +139,29 @@ function Chip({ tag, removeCallback }) {
128
139
  function generateTagsDisplay(tag) {
129
140
  return /* @__PURE__ */ jsx(Chip, { tag }, tag.id);
130
141
  }
131
- function renderTagsFromIds(ids, legalTags) {
142
+ function renderTagsFromIds(ids, legalTags, options = {}) {
132
143
  if (!ids || !legalTags || legalTags.length === 0) {
133
144
  return /* @__PURE__ */ jsx(Fragment, {});
134
145
  }
146
+ const { showEventTag = false, eventTagId } = options;
135
147
  const validTags = ids.map((id) => legalTags.find((tag) => tag.id === id)).filter((tag) => Boolean(tag));
136
- return validTags.map((tag) => generateTagsDisplay(tag));
148
+ const sortedTags = [...validTags].sort((a, b) => {
149
+ if (showEventTag && eventTagId !== void 0) {
150
+ if (a.id === eventTagId && b.id === eventTagId) return 0;
151
+ if (a.id === eventTagId) return -1;
152
+ if (b.id === eventTagId) return 1;
153
+ }
154
+ const priorityOrder = ["Organizer Run", "Display Only"];
155
+ const aIndex = priorityOrder.indexOf(a.label);
156
+ const bIndex = priorityOrder.indexOf(b.label);
157
+ if (aIndex !== -1 && bIndex !== -1) {
158
+ return aIndex - bIndex;
159
+ }
160
+ if (aIndex !== -1) return -1;
161
+ if (bIndex !== -1) return 1;
162
+ return 0;
163
+ });
164
+ return sortedTags.map((tag) => generateTagsDisplay(tag));
137
165
  }
138
166
  function EventBannerEdit({
139
167
  initialValue,
@@ -357,7 +385,7 @@ function EventBannerEdit({
357
385
  children: [
358
386
  link.text,
359
387
  /* @__PURE__ */ jsxs(Box, { sx: { ml: 1, display: "flex" }, children: [
360
- /* @__PURE__ */ jsx(Tooltip, { title: "Edit Link", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => openEditLink(index), sx: { color: "white", p: 0.2 }, children: /* @__PURE__ */ jsx(EditIcon, { fontSize: "inherit" }) }) }),
388
+ /* @__PURE__ */ jsx(Tooltip, { title: "Edit Link", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => openEditLink(index), sx: { color: "white", p: 0.2 }, children: /* @__PURE__ */ jsx(EditIcon3, { fontSize: "inherit" }) }) }),
361
389
  /* @__PURE__ */ jsx(Tooltip, { title: "Remove Link", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => removeLink(index), sx: { color: "error.light", p: 0.2 }, children: /* @__PURE__ */ jsx(DeleteIcon, { fontSize: "inherit" }) }) })
362
390
  ] })
363
391
  ]
@@ -484,7 +512,7 @@ function EventBasicInfo(props) {
484
512
  );
485
513
  }
486
514
  function EventBasicInfoView({ description, locationId, startingDate, endingDate, timeInfo, timezone, isOwner, onEdit }) {
487
- return /* @__PURE__ */ jsx(Grid8, { sx: { position: "relative" }, children: /* @__PURE__ */ jsx(Card, { style: {
515
+ return /* @__PURE__ */ jsx(Grid10, { sx: { position: "relative" }, children: /* @__PURE__ */ jsx(Card, { style: {
488
516
  boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.1)",
489
517
  background: "linear-gradient(135deg, rgba(225, 225, 225, 1), rgba(250, 250, 250, 1))"
490
518
  }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
@@ -768,7 +796,7 @@ function EventBannerView({
768
796
  }) {
769
797
  const backgroundColor = bannerColor || "linear-gradient(135deg, rgba(25,118,210,0.8), rgba(25,118,210,1))";
770
798
  return /* @__PURE__ */ jsxs(
771
- Grid8,
799
+ Grid10,
772
800
  {
773
801
  sx: {
774
802
  background: backgroundColor,
@@ -776,7 +804,7 @@ function EventBannerView({
776
804
  position: "relative"
777
805
  },
778
806
  children: [
779
- /* @__PURE__ */ jsxs(Grid8, { children: [
807
+ /* @__PURE__ */ jsxs(Grid10, { children: [
780
808
  /* @__PURE__ */ jsxs(
781
809
  Box,
782
810
  {
@@ -835,7 +863,7 @@ function EventBannerView({
835
863
  }
836
864
  ),
837
865
  /* @__PURE__ */ jsxs(
838
- Grid8,
866
+ Grid10,
839
867
  {
840
868
  display: "flex",
841
869
  justifyContent: "center",
@@ -943,6 +971,11 @@ var generateLink = function(link) {
943
971
  link.text
944
972
  );
945
973
  };
974
+
975
+ // src/data/values.tsx
976
+ var DEFAULT_PROFILE_PIC = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiB2aWV3Qm94PSIwIDAgMjU2IDI1NiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnIHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMDsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiAxMDsgZmlsbDogbm9uZTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMS40MDY1OTM0MDY1OTM0MDE2IDEuNDA2NTkzNDA2NTkzNDAxNikgc2NhbGUoMi44MSAyLjgxKSI+Cgk8cGF0aCBkPSJNIDQ1IDg4IGMgLTExLjA0OSAwIC0yMS4xOCAtMi4wMDMgLTI5LjAyMSAtOC42MzQgQyA2LjIxMiA3MS4xMDUgMCA1OC43NjQgMCA0NSBDIDAgMjAuMTg3IDIwLjE4NyAwIDQ1IDAgYyAyNC44MTMgMCA0NSAyMC4xODcgNDUgNDUgYyAwIDEzLjc2NSAtNi4yMTIgMjYuMTA1IC0xNS45NzkgMzQuMzY2IEMgNjYuMTgxIDg1Ljk5OCA1Ni4wNDkgODggNDUgODggeiIgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDEwOyBmaWxsOiByZ2IoMjE0LDIxNCwyMTQpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB0cmFuc2Zvcm09IiBtYXRyaXgoMSAwIDAgMSAwIDApICIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cgk8cGF0aCBkPSJNIDQ1IDYwLjcxIGMgLTExLjQ3OSAwIC0yMC44MTggLTkuMzM5IC0yMC44MTggLTIwLjgxNyBjIDAgLTExLjQ3OSA5LjMzOSAtMjAuODE4IDIwLjgxOCAtMjAuODE4IGMgMTEuNDc5IDAgMjAuODE3IDkuMzM5IDIwLjgxNyAyMC44MTggQyA2NS44MTcgNTEuMzcxIDU2LjQ3OSA2MC43MSA0NSA2MC43MSB6IiBzdHlsZT0ic3Ryb2tlOiBub25lOyBzdHJva2Utd2lkdGg6IDE7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogMTA7IGZpbGw6IHJnYigxNjUsMTY0LDE2NCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHRyYW5zZm9ybT0iIG1hdHJpeCgxIDAgMCAxIDAgMCkgIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KCTxwYXRoIGQ9Ik0gNDUgOTAgYyAtMTAuNjEzIDAgLTIwLjkyMiAtMy43NzMgLTI5LjAyOCAtMTAuNjI1IGMgLTAuNjQ4IC0wLjU0OCAtMC44OCAtMS40NDQgLTAuNTc5IC0yLjIzNyBDIDIwLjAzNCA2NC45MTkgMzEuOTMzIDU2LjcxIDQ1IDU2LjcxIHMgMjQuOTY2IDguMjA5IDI5LjYwNyAyMC40MjggYyAwLjMwMSAwLjc5MyAwLjA2OSAxLjY4OSAtMC41NzkgMi4yMzcgQyA2NS45MjIgODYuMjI3IDU1LjYxMyA5MCA0NSA5MCB6IiBzdHlsZT0ic3Ryb2tlOiBub25lOyBzdHJva2Utd2lkdGg6IDE7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogMTA7IGZpbGw6IHJnYigxNjUsMTY0LDE2NCk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHRyYW5zZm9ybT0iIG1hdHJpeCgxIDAgMCAxIDAgMCkgIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KPC9nPgo8L3N2Zz4=";
977
+ var ProfilePictureSettings = {
978
+ aspectRatio: 4 / 5};
946
979
  var NextGameLabel = ({ nextGameTime }) => {
947
980
  const date = typeof nextGameTime === "string" ? new Date(nextGameTime) : nextGameTime;
948
981
  return /* @__PURE__ */ jsxs(Typography, { variant: "caption", sx: { display: "block", mb: 1, color: "primary.main", fontWeight: "bold" }, children: [
@@ -956,17 +989,22 @@ var BaseSearchResultCard = ({
956
989
  onClick,
957
990
  children,
958
991
  icon,
959
- tags
992
+ tags,
993
+ showEventTag,
994
+ eventTagId
960
995
  }) => {
996
+ const router = useRouter();
961
997
  const handleClick = (e) => {
998
+ const url = `/${result.type}/${result.id}`;
999
+ if (e.ctrlKey || e.metaKey || e.shiftKey) {
1000
+ e.stopPropagation();
1001
+ window.open(url, "_blank");
1002
+ return;
1003
+ }
962
1004
  if (onClick) {
963
- if (e.ctrlKey || e.metaKey || e.shiftKey) {
964
- e.stopPropagation();
965
- const url = `/${result.type}/${result.id}`;
966
- window.open(url, "_blank");
967
- } else {
968
- onClick(result.id);
969
- }
1005
+ onClick(result.id);
1006
+ } else {
1007
+ router.push(url);
970
1008
  }
971
1009
  };
972
1010
  return /* @__PURE__ */ jsx(
@@ -975,7 +1013,7 @@ var BaseSearchResultCard = ({
975
1013
  elevation: 6,
976
1014
  sx: {
977
1015
  width: "100%",
978
- cursor: onClick ? "pointer" : "default",
1016
+ cursor: "pointer",
979
1017
  boxShadow: "0px 8px 24px rgba(0, 0, 0, 0.15)",
980
1018
  transition: "box-shadow 0.3s ease-in-out",
981
1019
  "&:hover": {
@@ -997,7 +1035,7 @@ var BaseSearchResultCard = ({
997
1035
  const text = full || "";
998
1036
  return text.length > 200 ? `${text.slice(0, 200).trimEnd()}...` : text;
999
1037
  })() }) : /* @__PURE__ */ jsx(Typography4, { variant: "body1", children: result.description }),
1000
- result.tags && result.tags.length > 0 && /* @__PURE__ */ jsx(Box2, { sx: { mt: 1, display: "flex", flexWrap: "wrap", gap: 1 }, children: renderTagsFromIds(result.tags, tags) })
1038
+ result.tags && result.tags.length > 0 && /* @__PURE__ */ jsx(Box2, { sx: { mt: 1, display: "flex", flexWrap: "wrap", gap: 1 }, children: renderTagsFromIds(result.tags, tags, { showEventTag, eventTagId }) })
1001
1039
  ] })
1002
1040
  ] })
1003
1041
  }
@@ -1007,7 +1045,9 @@ var BaseSearchResultCard_default = BaseSearchResultCard;
1007
1045
  var PlayerResultCard = ({
1008
1046
  result,
1009
1047
  onClick,
1010
- tags
1048
+ tags,
1049
+ showEventTag,
1050
+ eventTagId
1011
1051
  }) => {
1012
1052
  const firstLetter = result.title.charAt(0).toUpperCase();
1013
1053
  const getAvatarColor = (name) => {
@@ -1039,7 +1079,7 @@ var PlayerResultCard = ({
1039
1079
  const playerIcon = /* @__PURE__ */ jsx(
1040
1080
  Avatar,
1041
1081
  {
1042
- src: result.imageUrl,
1082
+ src: result.imageUrl || DEFAULT_PROFILE_PIC,
1043
1083
  alt: result.title,
1044
1084
  sx: {
1045
1085
  width: 40,
@@ -1049,13 +1089,25 @@ var PlayerResultCard = ({
1049
1089
  children: !result.imageUrl && firstLetter
1050
1090
  }
1051
1091
  );
1052
- return /* @__PURE__ */ jsx(BaseSearchResultCard_default, { result, onClick, icon: playerIcon, tags });
1092
+ return /* @__PURE__ */ jsx(
1093
+ BaseSearchResultCard_default,
1094
+ {
1095
+ result,
1096
+ onClick,
1097
+ icon: playerIcon,
1098
+ tags,
1099
+ showEventTag,
1100
+ eventTagId
1101
+ }
1102
+ );
1053
1103
  };
1054
1104
  var PlayerResultCard_default = PlayerResultCard;
1055
1105
  var TableResultCard = ({
1056
1106
  result,
1057
1107
  onClick,
1058
- tags
1108
+ tags,
1109
+ showEventTag,
1110
+ eventTagId
1059
1111
  }) => {
1060
1112
  const rawCapacity = result.capacity;
1061
1113
  const hasDefinedCapacity = typeof rawCapacity === "number" && Number.isFinite(rawCapacity) && rawCapacity > 0;
@@ -1073,46 +1125,59 @@ var TableResultCard = ({
1073
1125
  }
1074
1126
  }
1075
1127
  );
1076
- return /* @__PURE__ */ jsx(BaseSearchResultCard_default, { result, onClick, icon: tableIcon, tags, children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1077
- /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 1 }, children: [
1078
- /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1079
- /* @__PURE__ */ jsx("strong", { children: "Players:" }),
1080
- " ",
1081
- hasDefinedCapacity ? `${activePlayers}/${capacity}` : activePlayers
1082
- ] }),
1083
- typeof hasDM === "boolean" && /* @__PURE__ */ jsx(
1084
- Chip2,
1085
- {
1086
- icon: hasDM ? /* @__PURE__ */ jsx(SupervisorAccountIcon, {}) : /* @__PURE__ */ jsx(PersonIcon, {}),
1087
- label: hasDM ? "DM Present" : "No DM",
1088
- color: hasDM ? "success" : "warning",
1089
- size: "small"
1090
- }
1091
- )
1092
- ] }),
1093
- /* @__PURE__ */ jsx(
1094
- LinearProgress,
1095
- {
1096
- variant: "determinate",
1097
- value: occupancyPercentage,
1098
- sx: {
1099
- height: 10,
1100
- borderRadius: 5,
1101
- backgroundColor: "#e0e0e0",
1102
- "& .MuiLinearProgress-bar": {
1103
- backgroundColor: hasDefinedCapacity ? availableSlots > 0 ? "#4caf50" : "#f44336" : "#2196f3"
1128
+ return /* @__PURE__ */ jsx(
1129
+ BaseSearchResultCard_default,
1130
+ {
1131
+ result,
1132
+ onClick,
1133
+ icon: tableIcon,
1134
+ tags,
1135
+ showEventTag,
1136
+ eventTagId,
1137
+ children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1138
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 1 }, children: [
1139
+ /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1140
+ /* @__PURE__ */ jsx("strong", { children: "Players:" }),
1141
+ " ",
1142
+ hasDefinedCapacity ? `${activePlayers}/${capacity}` : activePlayers
1143
+ ] }),
1144
+ typeof hasDM === "boolean" && /* @__PURE__ */ jsx(
1145
+ Chip2,
1146
+ {
1147
+ icon: hasDM ? /* @__PURE__ */ jsx(SupervisorAccountIcon, {}) : /* @__PURE__ */ jsx(PersonIcon, {}),
1148
+ label: hasDM ? "DM Present" : "No DM",
1149
+ color: hasDM ? "success" : "warning",
1150
+ size: "small"
1151
+ }
1152
+ )
1153
+ ] }),
1154
+ /* @__PURE__ */ jsx(
1155
+ LinearProgress,
1156
+ {
1157
+ variant: "determinate",
1158
+ value: occupancyPercentage,
1159
+ sx: {
1160
+ height: 10,
1161
+ borderRadius: 5,
1162
+ backgroundColor: "#e0e0e0",
1163
+ "& .MuiLinearProgress-bar": {
1164
+ backgroundColor: hasDefinedCapacity ? availableSlots > 0 ? "#4caf50" : "#f44336" : "#2196f3"
1165
+ }
1166
+ }
1104
1167
  }
1105
- }
1106
- }
1107
- ),
1108
- hasDefinedCapacity && /* @__PURE__ */ jsx(Typography4, { variant: "body2", sx: { mt: 0.5, textAlign: "right" }, children: availableSlots > 0 ? `${availableSlots} slot${availableSlots !== 1 ? "s" : ""} available` : "Table full" })
1109
- ] }) });
1168
+ ),
1169
+ hasDefinedCapacity && /* @__PURE__ */ jsx(Typography4, { variant: "body2", sx: { mt: 0.5, textAlign: "right" }, children: availableSlots > 0 ? `${availableSlots} slot${availableSlots !== 1 ? "s" : ""} available` : "Table full" })
1170
+ ] })
1171
+ }
1172
+ );
1110
1173
  };
1111
1174
  var TableResultCard_default = TableResultCard;
1112
1175
  var EventResultCard = ({
1113
1176
  result,
1114
1177
  onClick,
1115
- tags
1178
+ tags,
1179
+ showEventTag,
1180
+ eventTagId
1116
1181
  }) => {
1117
1182
  const formatDate = (dateString) => {
1118
1183
  const options = {
@@ -1124,7 +1189,7 @@ var EventResultCard = ({
1124
1189
  try {
1125
1190
  const date = new Date(dateString);
1126
1191
  return date.toLocaleDateString("en-US", options);
1127
- } catch (error) {
1192
+ } catch (__) {
1128
1193
  return dateString;
1129
1194
  }
1130
1195
  };
@@ -1139,29 +1204,40 @@ var EventResultCard = ({
1139
1204
  }
1140
1205
  }
1141
1206
  );
1142
- return /* @__PURE__ */ jsx(BaseSearchResultCard_default, { result, onClick, icon: eventIcon, tags, children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1143
- /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", mb: 1 }, children: [
1144
- /* @__PURE__ */ jsx(CalendarTodayIcon, { sx: { mr: 1, color: "primary.main" } }),
1145
- /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1146
- /* @__PURE__ */ jsx("strong", { children: "Date:" }),
1147
- " ",
1148
- formattedDate
1149
- ] })
1150
- ] }),
1151
- /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center" }, children: [
1152
- /* @__PURE__ */ jsx(LocationOnIcon, { sx: { mr: 1, color: "primary.main" } }),
1153
- /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1154
- /* @__PURE__ */ jsx("strong", { children: "Location:" }),
1155
- " ",
1156
- location
1207
+ return /* @__PURE__ */ jsx(
1208
+ BaseSearchResultCard_default,
1209
+ {
1210
+ result,
1211
+ onClick,
1212
+ icon: eventIcon,
1213
+ tags,
1214
+ showEventTag,
1215
+ eventTagId,
1216
+ children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1217
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", mb: 1 }, children: [
1218
+ /* @__PURE__ */ jsx(CalendarTodayIcon, { sx: { mr: 1, color: "primary.main" } }),
1219
+ /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1220
+ /* @__PURE__ */ jsx("strong", { children: "Date:" }),
1221
+ " ",
1222
+ formattedDate
1223
+ ] })
1224
+ ] }),
1225
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center" }, children: [
1226
+ /* @__PURE__ */ jsx(LocationOnIcon, { sx: { mr: 1, color: "primary.main" } }),
1227
+ /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1228
+ /* @__PURE__ */ jsx("strong", { children: "Location:" }),
1229
+ " ",
1230
+ location
1231
+ ] })
1232
+ ] }),
1233
+ result.organizer && /* @__PURE__ */ jsxs(Typography4, { variant: "body2", sx: { mt: 1 }, children: [
1234
+ /* @__PURE__ */ jsx("strong", { children: "Organizer:" }),
1235
+ " ",
1236
+ result.organizer
1237
+ ] })
1157
1238
  ] })
1158
- ] }),
1159
- result.organizer && /* @__PURE__ */ jsxs(Typography4, { variant: "body2", sx: { mt: 1 }, children: [
1160
- /* @__PURE__ */ jsx("strong", { children: "Organizer:" }),
1161
- " ",
1162
- result.organizer
1163
- ] })
1164
- ] }) });
1239
+ }
1240
+ );
1165
1241
  };
1166
1242
  var EventResultCard_default = EventResultCard;
1167
1243
  var ResultsContainer = ({
@@ -1169,20 +1245,22 @@ var ResultsContainer = ({
1169
1245
  onResultClick,
1170
1246
  tags,
1171
1247
  pagination,
1172
- onPacketChange
1248
+ onPacketChange,
1249
+ showEventTag,
1250
+ eventTagId
1173
1251
  }) => {
1174
1252
  if (!results || results.length === 0 || !results.map) {
1175
1253
  return /* @__PURE__ */ jsx(Box2, { sx: { textAlign: "center", py: 4 }, children: "No results found. Try adjusting your filters." });
1176
1254
  }
1177
- const onPlayerClick = (id) => {
1178
- onResultClick == null ? void 0 : onResultClick(id, "player");
1179
- };
1180
- const onTableClick = (id) => {
1181
- onResultClick == null ? void 0 : onResultClick(id, "table");
1182
- };
1183
- const onEventClick = (id) => {
1184
- onResultClick == null ? void 0 : onResultClick(id, "event");
1185
- };
1255
+ const onPlayerClick = onResultClick ? (id) => {
1256
+ onResultClick(id, "player");
1257
+ } : void 0;
1258
+ const onTableClick = onResultClick ? (id) => {
1259
+ onResultClick(id, "table");
1260
+ } : void 0;
1261
+ const onEventClick = onResultClick ? (id) => {
1262
+ onResultClick(id, "event");
1263
+ } : void 0;
1186
1264
  const handlePacketChange = (_event, packet) => {
1187
1265
  onPacketChange == null ? void 0 : onPacketChange(packet);
1188
1266
  };
@@ -1206,7 +1284,9 @@ var ResultsContainer = ({
1206
1284
  {
1207
1285
  result,
1208
1286
  onClick: onPlayerClick,
1209
- tags
1287
+ tags,
1288
+ showEventTag,
1289
+ eventTagId
1210
1290
  },
1211
1291
  result.id
1212
1292
  );
@@ -1216,7 +1296,9 @@ var ResultsContainer = ({
1216
1296
  {
1217
1297
  result,
1218
1298
  onClick: onTableClick,
1219
- tags
1299
+ tags,
1300
+ showEventTag,
1301
+ eventTagId
1220
1302
  },
1221
1303
  result.id
1222
1304
  );
@@ -1226,7 +1308,9 @@ var ResultsContainer = ({
1226
1308
  {
1227
1309
  result,
1228
1310
  onClick: onEventClick,
1229
- tags
1311
+ tags,
1312
+ showEventTag,
1313
+ eventTagId
1230
1314
  },
1231
1315
  result.id
1232
1316
  );
@@ -1252,29 +1336,43 @@ var ScrollableResultsList = ({
1252
1336
  tags,
1253
1337
  maxHeight = 400,
1254
1338
  onResultClick,
1255
- emptyText
1339
+ emptyText,
1340
+ showEventTag,
1341
+ eventTagId
1256
1342
  }) => {
1257
1343
  const hasResults = Array.isArray(results) && results.length > 0;
1258
- return /* @__PURE__ */ jsx(Box2, { sx: { maxHeight, overflowY: "auto", pr: 1 }, children: hasResults ? /* @__PURE__ */ jsx(ResultsContainer_default, { results, onResultClick, tags }) : /* @__PURE__ */ jsx(Box2, { sx: { textAlign: "center", py: 2 }, children: emptyText || "No results to display." }) });
1344
+ return /* @__PURE__ */ jsx(Box2, { sx: { maxHeight, overflowY: "auto", pr: 1 }, children: hasResults ? /* @__PURE__ */ jsx(
1345
+ ResultsContainer_default,
1346
+ {
1347
+ results,
1348
+ onResultClick,
1349
+ tags,
1350
+ showEventTag,
1351
+ eventTagId
1352
+ }
1353
+ ) : /* @__PURE__ */ jsx(Box2, { sx: { textAlign: "center", py: 2 }, children: emptyText || "No results to display." }) });
1259
1354
  };
1260
1355
  var ScrollableResultsList_default = ScrollableResultsList;
1261
1356
  var TablesScrollableList = ({
1262
1357
  results,
1263
1358
  tags,
1264
1359
  maxHeight,
1265
- onResultClick
1360
+ onResultClick,
1361
+ showEventTag,
1362
+ eventTagId
1266
1363
  }) => {
1267
1364
  const tables = (results || []).filter((r) => (r == null ? void 0 : r.type) === "table");
1268
- const handleClick = (id) => onResultClick == null ? void 0 : onResultClick(id);
1269
1365
  return /* @__PURE__ */ jsx(
1270
1366
  ScrollableResultsList_default,
1271
1367
  {
1272
1368
  results: tables,
1273
1369
  tags,
1274
1370
  maxHeight,
1275
- onResultClick: (id, type) => {
1276
- if (type === "table") handleClick(id);
1277
- }
1371
+ onResultClick: onResultClick ? (id, type) => {
1372
+ if (type === "table") onResultClick(id);
1373
+ } : void 0,
1374
+ showEventTag,
1375
+ eventTagId
1278
1376
  }
1279
1377
  );
1280
1378
  };
@@ -1283,12 +1381,24 @@ var EventTablesCard = ({
1283
1381
  tables,
1284
1382
  tags,
1285
1383
  maxHeight = 450,
1286
- onTableClick
1384
+ onTableClick,
1385
+ showEventTag,
1386
+ eventTagId
1287
1387
  }) => {
1288
1388
  return /* @__PURE__ */ jsxs(Card10, { elevation: 6, sx: { width: "100%", boxShadow: "0px 8px 24px rgba(0, 0, 0, 0.15)" }, children: [
1289
1389
  /* @__PURE__ */ jsx(CardHeader4, { title: "Tables" }),
1290
1390
  /* @__PURE__ */ jsx(Divider3, {}),
1291
- /* @__PURE__ */ jsx(CardContent10, { children: /* @__PURE__ */ jsx(TablesScrollableList_default, { results: tables, tags, maxHeight, onResultClick: onTableClick }) })
1391
+ /* @__PURE__ */ jsx(CardContent10, { children: /* @__PURE__ */ jsx(
1392
+ TablesScrollableList_default,
1393
+ {
1394
+ results: tables,
1395
+ tags,
1396
+ maxHeight,
1397
+ onResultClick: onTableClick,
1398
+ showEventTag,
1399
+ eventTagId
1400
+ }
1401
+ ) })
1292
1402
  ] });
1293
1403
  };
1294
1404
  var EventTablesCard_default = EventTablesCard;
@@ -1302,24 +1412,32 @@ function EventPageLayout({
1302
1412
  tables,
1303
1413
  allTags
1304
1414
  }) {
1305
- return /* @__PURE__ */ jsx(Grid8, { container: true, flexDirection: "column", children: /* @__PURE__ */ jsxs(EventEditProvider, { initialEvent: mergedEvent, value: { isOwner, updateEvent, updateImages }, children: [
1306
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(
1415
+ return /* @__PURE__ */ jsx(Grid10, { container: true, flexDirection: "column", children: /* @__PURE__ */ jsxs(EventEditProvider, { initialEvent: mergedEvent, value: { isOwner, updateEvent, updateImages }, children: [
1416
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(
1307
1417
  EventBanner,
1308
1418
  {
1309
1419
  attendees,
1310
1420
  numGames
1311
1421
  }
1312
1422
  ) }),
1313
- /* @__PURE__ */ jsxs(Grid8, { container: true, flexDirection: "row", spacing: 3, size: { xs: 12, md: 12 }, children: [
1314
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 4 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1423
+ /* @__PURE__ */ jsxs(Grid10, { container: true, flexDirection: "row", spacing: 3, size: { xs: 12, md: 12 }, children: [
1424
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 4 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1315
1425
  EventBasicInfo,
1316
1426
  {
1317
1427
  locationId: mergedEvent.location || "0"
1318
1428
  }
1319
1429
  ) }),
1320
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(EventTablesCard_default, { tables, tags: allTags }) })
1430
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1431
+ EventTablesCard_default,
1432
+ {
1433
+ tables,
1434
+ tags: allTags,
1435
+ showEventTag: true,
1436
+ eventTagId: mergedEvent.id
1437
+ }
1438
+ ) })
1321
1439
  ] }),
1322
- /* @__PURE__ */ jsx(Grid8, {})
1440
+ /* @__PURE__ */ jsx(Grid10, {})
1323
1441
  ] }) });
1324
1442
  }
1325
1443
  var PlayerDetailsCard = ({
@@ -1478,19 +1596,18 @@ var PlayerDetailsCard = ({
1478
1596
  );
1479
1597
  };
1480
1598
  var PlayerDetailsCard_default = PlayerDetailsCard;
1481
-
1482
- // src/data/values.tsx
1483
- var ProfilePictureSettings = {
1484
- aspectRatio: 4 / 5};
1485
- var PlayerDisplayCard = ({ profilePicture, username, bio, preferredPronouns }) => {
1486
- const defaultImg = "/man-walking-silhouette-clipart.jpg";
1487
- const [imageSrc, setImageSrc] = useState(defaultImg);
1488
- const { aspectRatio } = ProfilePictureSettings;
1599
+ var PlayerDisplayCard = ({
1600
+ profilePicture,
1601
+ username,
1602
+ bio,
1603
+ preferredPronouns
1604
+ }) => {
1605
+ const [imageSrc, setImageSrc] = useState(DEFAULT_PROFILE_PIC);
1489
1606
  useEffect(() => {
1490
1607
  async function validateImage() {
1491
- const newImage = profilePicture || defaultImg;
1608
+ const newImage = profilePicture || DEFAULT_PROFILE_PIC;
1492
1609
  if (!profilePicture) {
1493
- setImageSrc(defaultImg);
1610
+ setImageSrc(DEFAULT_PROFILE_PIC);
1494
1611
  return;
1495
1612
  }
1496
1613
  const img = new Image();
@@ -1499,7 +1616,7 @@ var PlayerDisplayCard = ({ profilePicture, username, bio, preferredPronouns }) =
1499
1616
  setImageSrc(newImage);
1500
1617
  };
1501
1618
  img.onerror = () => {
1502
- setImageSrc(defaultImg);
1619
+ setImageSrc(DEFAULT_PROFILE_PIC);
1503
1620
  };
1504
1621
  }
1505
1622
  validateImage();
@@ -1529,7 +1646,7 @@ var PlayerDisplayCard = ({ profilePicture, username, bio, preferredPronouns }) =
1529
1646
  image: imageSrc,
1530
1647
  alt: `${username}'s Profile Picture`,
1531
1648
  sx: {
1532
- aspectRatio,
1649
+ aspectRatio: ProfilePictureSettings.aspectRatio,
1533
1650
  height: "auto",
1534
1651
  // Updates to maintain aspect ratio and fill space nicely
1535
1652
  width: "100%",
@@ -1848,6 +1965,24 @@ function PlayerPageLayout({
1848
1965
  ] }) })
1849
1966
  ] }) }) });
1850
1967
  }
1968
+ var DistanceFilter = ({ distances, selectedDistance, onChange }) => {
1969
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1970
+ /* @__PURE__ */ jsx(Typography4, { variant: "h6", gutterBottom: true, children: "Distance" }),
1971
+ /* @__PURE__ */ jsx(FormControl2, { fullWidth: true, size: "small", children: /* @__PURE__ */ jsxs(
1972
+ Select2,
1973
+ {
1974
+ value: selectedDistance !== void 0 ? selectedDistance : "",
1975
+ onChange: (e) => onChange(Number(e.target.value)),
1976
+ displayEmpty: true,
1977
+ children: [
1978
+ /* @__PURE__ */ jsx(MenuItem2, { value: "", children: /* @__PURE__ */ jsx("em", { children: "Any Distance" }) }),
1979
+ distances.map((option) => /* @__PURE__ */ jsx(MenuItem2, { value: option.value, children: option.display }, option.value))
1980
+ ]
1981
+ }
1982
+ ) })
1983
+ ] });
1984
+ };
1985
+ var DistanceFilter_default = DistanceFilter;
1851
1986
  var ExpiredTablesFilter = ({
1852
1987
  includeExpiredTables,
1853
1988
  onChange
@@ -1916,13 +2051,13 @@ var TagsFilter = ({
1916
2051
  shouldHaveAtLeastOne: ""
1917
2052
  });
1918
2053
  const tagOptions = React7.useMemo(() => {
2054
+ var _a;
1919
2055
  console.log("available tags: " + JSON.stringify(Tags));
1920
2056
  console.log(!Tags);
1921
- if (!Tags || Tags.length === 0 || !Tags.map) return [];
1922
- return Tags.map((tag) => ({
2057
+ return (_a = Tags == null ? void 0 : Tags.map((tag) => ({
1923
2058
  value: tag.id,
1924
2059
  label: tag.label
1925
- }));
2060
+ }))) != null ? _a : [];
1926
2061
  }, [Tags]);
1927
2062
  const handleTagChange = (tagId, category) => {
1928
2063
  let newTags = [];
@@ -1950,8 +2085,7 @@ var TagsFilter = ({
1950
2085
  };
1951
2086
  const renderSelectedTags = (selectedTags, category) => {
1952
2087
  const tagValues = [];
1953
- if (!Tags || Tags.length === 0 || !Tags.map) return null;
1954
- Tags.forEach((tag) => {
2088
+ Tags == null ? void 0 : Tags.forEach((tag) => {
1955
2089
  if (selectedTags.includes(tag.id)) {
1956
2090
  tagValues.push(tag);
1957
2091
  }
@@ -2017,7 +2151,7 @@ var TagsFilter = ({
2017
2151
  });
2018
2152
  },
2019
2153
  slots: { popper: CustomPopper2 },
2020
- renderInput: (params) => /* @__PURE__ */ jsx(TextField4, { ...params, label: `Select ${label}` })
2154
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField7, { ...params, label: `Select ${label}` })
2021
2155
  },
2022
2156
  `${category}-${selectedTags.join("-")}`
2023
2157
  )
@@ -2089,7 +2223,7 @@ var TextSearchCard = ({ onChange, selectedTypes, initialTextSearch }) => {
2089
2223
  /* @__PURE__ */ jsx(Typography4, { variant: "h6", gutterBottom: true, children: "Text Search" }),
2090
2224
  /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
2091
2225
  /* @__PURE__ */ jsx(
2092
- TextField4,
2226
+ TextField7,
2093
2227
  {
2094
2228
  fullWidth: true,
2095
2229
  label: "Search in title and description",
@@ -2138,9 +2272,7 @@ var TypeFilter = ({ types, initialSelectedTypes = [], onChange }) => {
2138
2272
  Checkbox,
2139
2273
  {
2140
2274
  checked: selectedTypes.includes(type.id),
2141
- onChange: () => handleTypeChange(type.id),
2142
- disabled: type.id === "event",
2143
- title: type.id === "event" ? "Coming soon! Currently only player and table search are supported." : ""
2275
+ onChange: () => handleTypeChange(type.id)
2144
2276
  }
2145
2277
  ),
2146
2278
  label: type.label
@@ -2155,10 +2287,13 @@ var FiltersContainer = ({
2155
2287
  initialSelectedTags,
2156
2288
  initialTextSearch,
2157
2289
  includeExpiredTables = false,
2290
+ distance,
2291
+ distances,
2158
2292
  onTypeChange,
2159
2293
  onTagChange,
2160
2294
  onTextSearchChange,
2161
2295
  onIncludeExpiredTablesChange,
2296
+ onDistanceChange,
2162
2297
  onSubmit,
2163
2298
  tags,
2164
2299
  searchTypes
@@ -2173,7 +2308,10 @@ var FiltersContainer = ({
2173
2308
  onTypeChange(types);
2174
2309
  }
2175
2310
  };
2176
- return /* @__PURE__ */ jsxs(Box2, { children: [
2311
+ return /* @__PURE__ */ jsxs(Box2, { component: "form", onSubmit: (e) => {
2312
+ e.preventDefault();
2313
+ if (onSubmit) onSubmit();
2314
+ }, children: [
2177
2315
  /* @__PURE__ */ jsx(
2178
2316
  TypeFilter_default,
2179
2317
  {
@@ -2183,6 +2321,16 @@ var FiltersContainer = ({
2183
2321
  }
2184
2322
  ),
2185
2323
  /* @__PURE__ */ jsx(Divider3, { sx: { my: 2 } }),
2324
+ /* @__PURE__ */ jsx(
2325
+ DistanceFilter_default,
2326
+ {
2327
+ distances,
2328
+ selectedDistance: distance,
2329
+ onChange: onDistanceChange || (() => {
2330
+ })
2331
+ }
2332
+ ),
2333
+ /* @__PURE__ */ jsx(Divider3, { sx: { my: 2 } }),
2186
2334
  /* @__PURE__ */ jsx(
2187
2335
  TextSearchCard_default,
2188
2336
  {
@@ -2213,13 +2361,13 @@ var FiltersContainer = ({
2213
2361
  /* @__PURE__ */ jsx(Divider3, { sx: { my: 2 } })
2214
2362
  ] }),
2215
2363
  /* @__PURE__ */ jsx(Box2, { sx: { display: "flex", justifyContent: "center", mt: 2 }, children: /* @__PURE__ */ jsx(
2216
- Button7,
2364
+ Button8,
2217
2365
  {
2366
+ type: "submit",
2218
2367
  variant: "contained",
2219
2368
  color: "primary",
2220
2369
  size: "large",
2221
2370
  startIcon: /* @__PURE__ */ jsx(SearchIcon, {}),
2222
- onClick: onSubmit,
2223
2371
  sx: {
2224
2372
  width: "100%",
2225
2373
  py: 1.5,
@@ -2244,16 +2392,15 @@ var PlayersScrollableList = ({
2244
2392
  onResultClick
2245
2393
  }) => {
2246
2394
  const players = (results || []).filter((r) => (r == null ? void 0 : r.type) === "player");
2247
- const handleClick = (id) => onResultClick == null ? void 0 : onResultClick(id);
2248
2395
  return /* @__PURE__ */ jsx(
2249
2396
  ScrollableResultsList_default,
2250
2397
  {
2251
2398
  results: players,
2252
2399
  tags,
2253
2400
  maxHeight,
2254
- onResultClick: (id, type) => {
2255
- if (type === "player") handleClick(id);
2256
- }
2401
+ onResultClick: onResultClick ? (id, type) => {
2402
+ if (type === "player") onResultClick(id);
2403
+ } : void 0
2257
2404
  }
2258
2405
  );
2259
2406
  };
@@ -2279,11 +2426,13 @@ function SearchPageLayout({
2279
2426
  query: "",
2280
2427
  titleOnly: false
2281
2428
  },
2282
- includeExpiredTables: initialIncludeExpiredTables = false,
2429
+ initialDistance,
2430
+ distances,
2283
2431
  onTypeChange,
2284
2432
  onTagChange,
2285
2433
  onTextSearchChange,
2286
2434
  onIncludeExpiredTablesChange,
2435
+ onDistanceChange,
2287
2436
  onSubmit,
2288
2437
  onResultClick,
2289
2438
  onPacketChange,
@@ -2291,14 +2440,16 @@ function SearchPageLayout({
2291
2440
  validTags,
2292
2441
  allTags,
2293
2442
  searchTypes,
2294
- isLoading = false
2443
+ isLoading = false,
2444
+ eventTagId
2295
2445
  }) {
2296
2446
  const theme = useTheme();
2297
2447
  const isMobile = useMediaQuery(theme.breakpoints.down("md"));
2298
2448
  const [selectedTypes, setSelectedTypes] = useState(initialSelectedTypes);
2299
2449
  const [selectedTags, setSelectedTags] = useState(initialSelectedTags);
2300
2450
  const [textSearch, setTextSearch] = useState(initialTextSearch);
2301
- const [includeExpiredTables, setIncludeExpiredTables] = useState(initialIncludeExpiredTables);
2451
+ const [includeExpiredTables, setIncludeExpiredTables] = useState(false);
2452
+ const [distance, setDistance] = useState(initialDistance);
2302
2453
  useEffect(() => {
2303
2454
  setSelectedTypes(initialSelectedTypes);
2304
2455
  }, [initialSelectedTypes]);
@@ -2309,8 +2460,8 @@ function SearchPageLayout({
2309
2460
  setTextSearch(initialTextSearch);
2310
2461
  }, [initialTextSearch]);
2311
2462
  useEffect(() => {
2312
- setIncludeExpiredTables(initialIncludeExpiredTables);
2313
- }, [initialIncludeExpiredTables]);
2463
+ setDistance(initialDistance);
2464
+ }, [initialDistance]);
2314
2465
  const handleTypeChange = (types) => {
2315
2466
  setSelectedTypes(types);
2316
2467
  if (onTypeChange) onTypeChange(types);
@@ -2327,12 +2478,17 @@ function SearchPageLayout({
2327
2478
  setIncludeExpiredTables(include);
2328
2479
  if (onIncludeExpiredTablesChange) onIncludeExpiredTablesChange(include);
2329
2480
  };
2481
+ const handleDistanceChange = (dist) => {
2482
+ setDistance(dist);
2483
+ if (onDistanceChange) onDistanceChange(dist);
2484
+ };
2330
2485
  const handleSubmit = () => {
2331
2486
  const currentCriteria = {
2332
2487
  selectedTypes,
2333
2488
  selectedTags,
2334
2489
  textSearch,
2335
- includeExpiredTables
2490
+ includeExpiredTables,
2491
+ distance
2336
2492
  };
2337
2493
  if (onSubmit) {
2338
2494
  onSubmit(currentCriteria);
@@ -2351,8 +2507,8 @@ function SearchPageLayout({
2351
2507
  }
2352
2508
  }
2353
2509
  ) }),
2354
- /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, children: [
2355
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 3 }, children: /* @__PURE__ */ jsxs(Card10, { sx: { marginBottom: isMobile ? 2 : 0 }, children: [
2510
+ /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 2, children: [
2511
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 3 }, children: /* @__PURE__ */ jsxs(Card10, { sx: { marginBottom: isMobile ? 2 : 0 }, children: [
2356
2512
  /* @__PURE__ */ jsx(
2357
2513
  CardHeader4,
2358
2514
  {
@@ -2372,17 +2528,20 @@ function SearchPageLayout({
2372
2528
  initialSelectedTags: selectedTags,
2373
2529
  initialTextSearch: textSearch,
2374
2530
  includeExpiredTables,
2531
+ distance,
2532
+ distances,
2375
2533
  onTypeChange: handleTypeChange,
2376
2534
  onTagChange: handleTagChange,
2377
2535
  onTextSearchChange: handleTextSearchChange,
2378
2536
  onIncludeExpiredTablesChange: handleIncludeExpiredTablesChange,
2537
+ onDistanceChange: handleDistanceChange,
2379
2538
  onSubmit: handleSubmit,
2380
2539
  tags: validTags,
2381
2540
  searchTypes
2382
2541
  }
2383
2542
  ) })
2384
2543
  ] }) }),
2385
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 9 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2544
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 9 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2386
2545
  /* @__PURE__ */ jsx(
2387
2546
  CardHeader4,
2388
2547
  {
@@ -2402,13 +2561,255 @@ function SearchPageLayout({
2402
2561
  pagination,
2403
2562
  onPacketChange,
2404
2563
  onResultClick,
2405
- tags: allTags
2564
+ tags: allTags,
2565
+ showEventTag: true,
2566
+ eventTagId
2406
2567
  }
2407
2568
  ) })
2408
2569
  ] }) })
2409
2570
  ] })
2410
2571
  ] });
2411
2572
  }
2573
+
2574
+ // src/components/shared/NameGenerator.ts
2575
+ var getRandomTitle = () => {
2576
+ const randomPrefix = titlePrefixes[Math.random() * titlePrefixes.length | 0];
2577
+ const randomMiddle = tileMiddle[Math.random() * tileMiddle.length | 0];
2578
+ const randomSuffix = titleSuffixes[Math.random() * titleSuffixes.length | 0];
2579
+ return `${randomPrefix} ${randomMiddle} ${randomSuffix}`;
2580
+ };
2581
+ var getRandomTagline = () => taglines[Math.random() * taglines.length | 0];
2582
+ var titlePrefixes = [
2583
+ "The Knights of The",
2584
+ "The Fellowship of The",
2585
+ "The Order of The",
2586
+ "The Infamous",
2587
+ "The Legendary",
2588
+ "The Dubious",
2589
+ "The Sworn Guardians of The",
2590
+ "The Ancient Guild of The",
2591
+ "The Unstoppable",
2592
+ "The Misfit",
2593
+ "The Chaotic",
2594
+ "The Brave",
2595
+ "The Forgotten",
2596
+ "The Wandering",
2597
+ "The Noble Council of The",
2598
+ "The Dread Pirates of The",
2599
+ "The Honorable Society of The",
2600
+ "The Cursed",
2601
+ "The Unlikely Heroes of The",
2602
+ "The Elders of The",
2603
+ "The Seekers of The",
2604
+ "The Champions of The",
2605
+ "The Heralds of The",
2606
+ "The Disciples of The",
2607
+ "The Ragtag Band of The",
2608
+ "The Cult of The"
2609
+ ];
2610
+ var tileMiddle = [
2611
+ "Round",
2612
+ "Kitchen",
2613
+ "Deepest",
2614
+ "Sorcery",
2615
+ "Munchkin",
2616
+ "Shenanigan",
2617
+ "Secret",
2618
+ "Dungeon",
2619
+ "Fireside",
2620
+ "Tabletop",
2621
+ "Midnight",
2622
+ "Tavern",
2623
+ "Goblin",
2624
+ "Dragon",
2625
+ "Critical",
2626
+ "Natural Twenty",
2627
+ "Counterspell",
2628
+ "Nat One",
2629
+ "Cardboard",
2630
+ "Dice Tower",
2631
+ "Campaign",
2632
+ "Lore",
2633
+ "Awkward",
2634
+ "Unhinged",
2635
+ "Chaotic Neutral",
2636
+ "Homebrew",
2637
+ "Side Quest"
2638
+ ];
2639
+ var titleSuffixes = [
2640
+ "Table",
2641
+ "Dungeon",
2642
+ "Cave",
2643
+ "Crew",
2644
+ "Team",
2645
+ "League",
2646
+ "Horde",
2647
+ "Party",
2648
+ "Conclave",
2649
+ "Collective",
2650
+ "Alliance",
2651
+ "Syndicate",
2652
+ "Guild",
2653
+ "Cabal",
2654
+ "Council",
2655
+ "Expedition",
2656
+ "Enclave",
2657
+ "Consortium",
2658
+ "Troupe",
2659
+ "Vanguard",
2660
+ "Cohort",
2661
+ "Brotherhood",
2662
+ "Sisterhood",
2663
+ "Pantheon",
2664
+ "Assembly",
2665
+ "Coven"
2666
+ ];
2667
+ var taglines = [
2668
+ "Everyone is welcome!",
2669
+ "Looking for serious players.",
2670
+ "Get in nerds, we're gaming!",
2671
+ "If you aren't there, you're square.",
2672
+ "It will be legendary!",
2673
+ "Beginners welcome \u2014 we were all level 1 once.",
2674
+ "No experience necessary. Snacks encouraged.",
2675
+ "Roleplayers, board gamers, and chaos gremlins welcome.",
2676
+ "We don't metagame. Much.",
2677
+ "All alignments accepted. True Neutral gets the snacks.",
2678
+ "Where every session is a one-shot... until it isn't.",
2679
+ "Homebrew rules may apply.",
2680
+ "Warning: may contain excessive lore.",
2681
+ "Critical failures celebrated as much as critical hits.",
2682
+ "No powergamers. Okay, maybe one powergamer.",
2683
+ "We finish campaigns. (Eventually.)",
2684
+ "Veteran players seeking worthy companions.",
2685
+ "Casuals only \u2014 we're here for the vibes.",
2686
+ "Serious about fun, not about rules.",
2687
+ "Min-maxers need not apply.",
2688
+ "For those who read the rulebook... and those who definitely didn't.",
2689
+ "Roll for initiative. Arrive on time.",
2690
+ "Side quests are the main quest here.",
2691
+ "Chaotic good energy required.",
2692
+ "If you bring snacks, you can name the first NPC.",
2693
+ "We read the rulebook so you don't have to.",
2694
+ "Wargamers only \u2014 no take-backs, no mercy.",
2695
+ "Everyone welcome. Meeple provided.",
2696
+ "We always play the longest game on the shelf.",
2697
+ "Worker placement. Resource management. Existential dread.",
2698
+ "No phones at the table! We're here for the game.",
2699
+ "Someone always flips the table. Metaphorically. Usually.",
2700
+ "We have a designated rules lawyer. It's fine.",
2701
+ "Cooperative games only \u2014 we can't handle another Monopoly incident.",
2702
+ "Teaching time is half the fun!"
2703
+ ];
2704
+ function TagSelector({ initialTagIDs, allTags, onTagChange }) {
2705
+ const [tagList, updateTagList] = useState(initialTagIDs);
2706
+ const [inputValue, setInputValue] = useState("");
2707
+ const toggleTag = (id) => tagList.find((t) => t === id) ? removeTag(id) : addTag(id);
2708
+ const addTag = (id) => {
2709
+ const newList = [...tagList, id];
2710
+ updateTagList(newList);
2711
+ onTagChange(newList);
2712
+ };
2713
+ const removeTag = (id) => {
2714
+ const newList = tagList.filter((t) => t !== id);
2715
+ updateTagList(newList);
2716
+ onTagChange(newList);
2717
+ };
2718
+ const selectedTags = useMemo(() => allTags.filter((tag) => tagList.includes(tag.id)), [allTags, tagList]);
2719
+ const options = useMemo(
2720
+ () => allTags.map((tag) => ({ value: tag.id, label: tag.label })),
2721
+ [allTags]
2722
+ );
2723
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2724
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: selectedTags.map((tag) => /* @__PURE__ */ jsx(
2725
+ Chip,
2726
+ {
2727
+ tag,
2728
+ removeCallback: () => toggleTag(tag.id)
2729
+ },
2730
+ tag.id
2731
+ )) }),
2732
+ /* @__PURE__ */ jsx(Grid10, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid10, { sx: { marginTop: 3, width: "100%", minWidth: "550px" }, children: /* @__PURE__ */ jsx(
2733
+ Autocomplete,
2734
+ {
2735
+ options,
2736
+ filterOptions: (availableOptions, state) => availableOptions.filter(
2737
+ (option) => !tagList.includes(option.value) && option.label.toLowerCase().includes(state.inputValue.toLowerCase())
2738
+ ),
2739
+ value: null,
2740
+ inputValue,
2741
+ onInputChange: (event, newInputValue) => {
2742
+ if (event && event.type === "change") {
2743
+ setInputValue(newInputValue);
2744
+ }
2745
+ },
2746
+ onChange: (event, newValue) => {
2747
+ if (newValue) {
2748
+ toggleTag(newValue.value);
2749
+ }
2750
+ setInputValue("");
2751
+ },
2752
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField7, { ...params, label: "Select Tags" })
2753
+ },
2754
+ tagList.join("-")
2755
+ ) }) })
2756
+ ] });
2757
+ }
2758
+ function EditTableDetailsForm({ initialTitle, initialSubtitle, onTitleChange, onSubtitleChange, allowEditingTitles, initialTagIDs, allTags, onTagChange }) {
2759
+ const [title, setTitle] = useState(initialTitle);
2760
+ const [subtitle, setSubtitle] = useState(initialSubtitle);
2761
+ const handleTitleChange = (newTitle) => {
2762
+ setTitle(newTitle);
2763
+ onTitleChange(newTitle);
2764
+ };
2765
+ const handleSubtitleChange = (newSubtitle) => {
2766
+ setSubtitle(newSubtitle);
2767
+ onSubtitleChange(newSubtitle);
2768
+ };
2769
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2770
+ allowEditingTitles && /* @__PURE__ */ jsxs(Box, { className: "flex flex-col gap-4 mb-8", children: [
2771
+ /* @__PURE__ */ jsxs(Box, { className: "inline-flex", children: [
2772
+ /* @__PURE__ */ jsx(
2773
+ TextField7,
2774
+ {
2775
+ sx: { minWidth: "400px" },
2776
+ label: "Title",
2777
+ onChange: (e) => handleTitleChange(e.target.value),
2778
+ variant: "filled",
2779
+ value: title
2780
+ }
2781
+ ),
2782
+ /* @__PURE__ */ jsx(Tooltip, { title: "Randomize", children: /* @__PURE__ */ jsx(
2783
+ CasinoIcon,
2784
+ {
2785
+ sx: { cursor: "pointer", alignSelf: "center", ml: 1 },
2786
+ onClick: () => handleTitleChange(getRandomTitle())
2787
+ }
2788
+ ) })
2789
+ ] }),
2790
+ /* @__PURE__ */ jsxs(Box, { className: "inline-flex min-w-96", children: [
2791
+ /* @__PURE__ */ jsx(
2792
+ TextField7,
2793
+ {
2794
+ sx: { minWidth: "400px" },
2795
+ label: "Short Description or Tagline",
2796
+ onChange: (e) => handleSubtitleChange(e.target.value),
2797
+ variant: "filled",
2798
+ value: subtitle
2799
+ }
2800
+ ),
2801
+ /* @__PURE__ */ jsx(Tooltip, { title: "Randomize", children: /* @__PURE__ */ jsx(
2802
+ CasinoIcon,
2803
+ {
2804
+ sx: { cursor: "pointer", alignSelf: "center", ml: 1 },
2805
+ onClick: () => handleSubtitleChange(getRandomTagline())
2806
+ }
2807
+ ) })
2808
+ ] })
2809
+ ] }),
2810
+ /* @__PURE__ */ jsx(TagSelector, { initialTagIDs, allTags, onTagChange })
2811
+ ] });
2812
+ }
2412
2813
  var GameTableContext = React7.createContext(void 0);
2413
2814
  function GameTableProvider(props) {
2414
2815
  return /* @__PURE__ */ jsx(Fragment, { children: props.children });
@@ -2421,76 +2822,206 @@ function useGameTableContext() {
2421
2822
  throw new Error("useGameTableContext is deprecated in the package build. Pass table data through props instead.");
2422
2823
  }
2423
2824
  var ModalContext = createContext({
2424
- showModal: (content) => {
2825
+ showModal: () => {
2425
2826
  },
2426
2827
  hideModal: () => {
2427
2828
  }
2428
2829
  });
2429
2830
  var useModal = () => useContext(ModalContext);
2430
- var Modal = ({ onClose, children }) => {
2431
- const modalRef = useRef(null);
2432
- const previouslyFocusedElement = useRef(null);
2831
+ var AutoResizingTextarea = (props) => {
2832
+ const { isInEditMode, onChange, textareaRef, value } = props;
2433
2833
  useEffect(() => {
2434
- var _a;
2435
- if (children) {
2436
- previouslyFocusedElement.current = document.activeElement;
2437
- (_a = modalRef.current) == null ? void 0 : _a.focus();
2834
+ if (isInEditMode && textareaRef.current) {
2835
+ const textarea = textareaRef.current;
2836
+ textarea.style.height = "auto";
2837
+ textarea.style.height = `${textarea.scrollHeight}px`;
2438
2838
  }
2439
- return () => {
2440
- var _a2;
2441
- (_a2 = previouslyFocusedElement.current) == null ? void 0 : _a2.focus();
2442
- };
2443
- }, [children]);
2444
- const handleOnClose = () => {
2445
- onClose();
2446
- };
2447
- const handleKeyDown = (e) => {
2448
- var _a;
2449
- if (e.key !== "Tab") return;
2450
- const focusableElements = (_a = modalRef.current) == null ? void 0 : _a.querySelectorAll(
2451
- 'button, [tabindex]:not([tabindex="-1"])'
2452
- );
2453
- if (!focusableElements || focusableElements.length === 0) return;
2454
- const first = focusableElements[0];
2455
- const last = focusableElements[focusableElements.length - 1];
2456
- if (e.shiftKey) {
2457
- if (document.activeElement === first) {
2458
- e.preventDefault();
2459
- last.focus();
2839
+ }, [isInEditMode, textareaRef, value]);
2840
+ return /* @__PURE__ */ jsx(
2841
+ "textarea",
2842
+ {
2843
+ ref: textareaRef,
2844
+ value,
2845
+ onChange: (e) => onChange(e.target.value),
2846
+ style: {
2847
+ backgroundColor: "#fffbea",
2848
+ overflow: "hidden",
2849
+ resize: "none",
2850
+ width: "100%"
2460
2851
  }
2461
- } else {
2462
- if (document.activeElement === last) {
2463
- e.preventDefault();
2464
- first.focus();
2852
+ }
2853
+ );
2854
+ };
2855
+ var AutoResizingTextarea_default = AutoResizingTextarea;
2856
+ var NextGameCountdown = ({ nextGameTime }) => {
2857
+ const [timeLeft, setTimeLeft] = useState("");
2858
+ useEffect(() => {
2859
+ if (!nextGameTime) return;
2860
+ const timer = setInterval(() => {
2861
+ const now = (/* @__PURE__ */ new Date()).getTime();
2862
+ const distance = new Date(nextGameTime).getTime() - now;
2863
+ if (distance < 0) {
2864
+ clearInterval(timer);
2865
+ setTimeLeft("Started");
2866
+ return;
2867
+ }
2868
+ const days = Math.floor(distance / (1e3 * 60 * 60 * 24));
2869
+ const hours = Math.floor(distance % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60));
2870
+ const minutes = Math.floor(distance % (1e3 * 60 * 60) / (1e3 * 60));
2871
+ const seconds = Math.floor(distance % (1e3 * 60) / 1e3);
2872
+ let timeString = "";
2873
+ if (days > 0) timeString += `${days}d `;
2874
+ if (hours > 0 || days > 0) timeString += `${hours}h `;
2875
+ timeString += `${minutes}m ${seconds}s`;
2876
+ setTimeLeft(timeString);
2877
+ }, 1e3);
2878
+ return () => clearInterval(timer);
2879
+ }, [nextGameTime]);
2880
+ if (!nextGameTime) return null;
2881
+ return /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "primary", sx: { fontWeight: "bold" }, children: [
2882
+ "Next Game: ",
2883
+ timeLeft
2884
+ ] });
2885
+ };
2886
+ function TagEditor({
2887
+ title,
2888
+ selectedTags,
2889
+ possibleTags,
2890
+ onToggleTag
2891
+ }) {
2892
+ const selectedIds = useMemo(() => selectedTags.map((tag) => tag.id), [selectedTags]);
2893
+ const onTagChange = (newSelectedIds) => {
2894
+ const addedTags = newSelectedIds.filter((id) => !selectedIds.includes(id));
2895
+ const removedTags = selectedIds.filter((id) => !newSelectedIds.includes(id));
2896
+ addedTags.forEach((id) => onToggleTag(id));
2897
+ removedTags.forEach((id) => onToggleTag(id));
2898
+ };
2899
+ return /* @__PURE__ */ jsx(Grid10, { container: true, children: /* @__PURE__ */ jsx(Grid10, { size: { xs: 12 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2900
+ title ? /* @__PURE__ */ jsx(
2901
+ CardHeader4,
2902
+ {
2903
+ title,
2904
+ style: {
2905
+ background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
2906
+ color: "#FFFFFF",
2907
+ fontSize: "1.5rem",
2908
+ textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)"
2909
+ }
2465
2910
  }
2911
+ ) : "",
2912
+ /* @__PURE__ */ jsx(CardContent10, { children: /* @__PURE__ */ jsx(TagSelector, { initialTagIDs: selectedIds, allTags: possibleTags, onTagChange }) })
2913
+ ] }) }) });
2914
+ }
2915
+ var UserAgreementModal = ({
2916
+ open,
2917
+ onClose,
2918
+ markdownContent,
2919
+ requirements,
2920
+ onAccept,
2921
+ title = "User Agreement",
2922
+ forceAgreement = false
2923
+ }) => {
2924
+ const [checkedState, setCheckedState] = useState(
2925
+ new Array(requirements.length).fill(false)
2926
+ );
2927
+ const handleCheckboxChange = (index) => {
2928
+ const updatedCheckedState = checkedState.map(
2929
+ (item, i) => i === index ? !item : item
2930
+ );
2931
+ setCheckedState(updatedCheckedState);
2932
+ };
2933
+ const isAllRequiredChecked = requirements.every((req, index) => {
2934
+ if (req.required) {
2935
+ return checkedState[index];
2936
+ }
2937
+ return true;
2938
+ });
2939
+ const handleAccept = () => {
2940
+ if (isAllRequiredChecked) {
2941
+ onAccept();
2466
2942
  }
2467
2943
  };
2468
- return /* @__PURE__ */ jsx(
2469
- "div",
2944
+ const handleClose = (event, reason) => {
2945
+ if (forceAgreement) return;
2946
+ if (onClose) onClose();
2947
+ };
2948
+ return /* @__PURE__ */ jsxs(
2949
+ Dialog,
2470
2950
  {
2471
- className: "modal-overlay",
2472
- onKeyDown: handleKeyDown,
2473
- ref: modalRef,
2474
- role: "dialog",
2475
- tabIndex: -1,
2476
- children: /* @__PURE__ */ jsxs("div", { className: "modal-container", children: [
2477
- /* @__PURE__ */ jsx("div", { className: "modal-control-strip", children: /* @__PURE__ */ jsx("button", { onClick: handleOnClose, children: "X" }) }),
2478
- /* @__PURE__ */ jsx("div", { className: "modal-content", children })
2479
- ] })
2951
+ open,
2952
+ onClose: handleClose,
2953
+ maxWidth: "md",
2954
+ fullWidth: true,
2955
+ disableEscapeKeyDown: forceAgreement,
2956
+ children: [
2957
+ /* @__PURE__ */ jsx(DialogTitle, { children: title }),
2958
+ /* @__PURE__ */ jsxs(DialogContent, { dividers: true, children: [
2959
+ /* @__PURE__ */ jsx(Box, { sx: { mb: 3 }, children: /* @__PURE__ */ jsx(
2960
+ ReactMarkdown,
2961
+ {
2962
+ components: {
2963
+ h1: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "h4", gutterBottom: true, ...props }),
2964
+ h2: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "h5", gutterBottom: true, ...props }),
2965
+ h3: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "h6", gutterBottom: true, ...props }),
2966
+ h4: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, ...props }),
2967
+ h5: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", gutterBottom: true, ...props }),
2968
+ h6: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "caption", gutterBottom: true, ...props }),
2969
+ p: ({ node, ...props }) => /* @__PURE__ */ jsx(Typography, { variant: "body1", gutterBottom: true, ...props }),
2970
+ li: ({ node, ...props }) => /* @__PURE__ */ jsx(Box, { component: "li", sx: { mb: 1, ml: 2 }, ...props }),
2971
+ ul: ({ node, ...props }) => /* @__PURE__ */ jsx(Box, { component: "ul", sx: { mb: 2 }, ...props }),
2972
+ ol: ({ node, ...props }) => /* @__PURE__ */ jsx(Box, { component: "ol", sx: { mb: 2 }, ...props }),
2973
+ a: ({ node, ...props }) => /* @__PURE__ */ jsx(Link, { ...props, target: "_blank", rel: "noopener" })
2974
+ },
2975
+ children: markdownContent
2976
+ }
2977
+ ) }),
2978
+ /* @__PURE__ */ jsx(Box, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: requirements.map((req, index) => /* @__PURE__ */ jsx(Box, { sx: { display: "flex", alignItems: "flex-start" }, children: /* @__PURE__ */ jsx(
2979
+ FormControlLabel$1,
2980
+ {
2981
+ control: /* @__PURE__ */ jsx(
2982
+ Checkbox$1,
2983
+ {
2984
+ checked: checkedState[index],
2985
+ onChange: () => handleCheckboxChange(index)
2986
+ }
2987
+ ),
2988
+ label: /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
2989
+ req.statement,
2990
+ req.link && req.linkText && /* @__PURE__ */ jsxs(Fragment, { children: [
2991
+ " ",
2992
+ /* @__PURE__ */ jsx(Link, { href: req.link, target: "_blank", rel: "noopener", children: req.linkText })
2993
+ ] }),
2994
+ req.required && /* @__PURE__ */ jsx(
2995
+ Typography,
2996
+ {
2997
+ component: "span",
2998
+ color: "error",
2999
+ sx: { ml: 0.5 },
3000
+ children: "*"
3001
+ }
3002
+ )
3003
+ ] })
3004
+ }
3005
+ ) }, index)) })
3006
+ ] }),
3007
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
3008
+ !forceAgreement && /* @__PURE__ */ jsx(Button, { onClick: onClose, color: "inherit", children: "Cancel" }),
3009
+ /* @__PURE__ */ jsx(
3010
+ Button,
3011
+ {
3012
+ onClick: handleAccept,
3013
+ variant: "contained",
3014
+ disabled: !isAllRequiredChecked,
3015
+ fullWidth: forceAgreement,
3016
+ children: "Accept"
3017
+ }
3018
+ )
3019
+ ] })
3020
+ ]
2480
3021
  }
2481
3022
  );
2482
3023
  };
2483
- var Modal_default = Modal;
2484
- var ModalProvider = ({ children }) => {
2485
- const [modalContent, setModalContent] = useState(null);
2486
- const showModal = (content) => setModalContent(content);
2487
- const hideModal = () => setModalContent(null);
2488
- return /* @__PURE__ */ jsxs(ModalContext.Provider, { value: { showModal, hideModal }, children: [
2489
- children,
2490
- modalContent && /* @__PURE__ */ jsx(Modal_default, { onClose: hideModal, children: modalContent })
2491
- ] });
2492
- };
2493
- var ModalProvider_default = ModalProvider;
3024
+ var UserAgreementModal_default = UserAgreementModal;
2494
3025
  var PlayerHighlightsCard = function(props) {
2495
3026
  const {
2496
3027
  allTags,
@@ -2502,16 +3033,16 @@ var PlayerHighlightsCard = function(props) {
2502
3033
  removeFromTable
2503
3034
  } = props;
2504
3035
  return /* @__PURE__ */ jsx(Card, { elevation: 3, sx: { backgroundColor: canEdit ? "#fffbea" : "#f5f9fa", marginBottom: "6px" }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
2505
- /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, direction: "column", children: [
2506
- /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "row", children: [
2507
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 64, src: player.miniPic || "", width: 64 }) }),
2508
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) })
3036
+ /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 2, direction: "column", children: [
3037
+ /* @__PURE__ */ jsxs(Grid10, { container: true, direction: "row", children: [
3038
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 64, src: player.miniPic || DEFAULT_PROFILE_PIC, width: 64 }) }),
3039
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) })
2509
3040
  ] }),
2510
- /* @__PURE__ */ jsx(Grid8, { children: renderTagsFromIds(player.tags, allTags) })
3041
+ /* @__PURE__ */ jsx(Grid10, { children: renderTagsFromIds(player.tags, allTags) })
2511
3042
  ] }),
2512
- canEdit && /* @__PURE__ */ jsxs(Grid8, { children: [
2513
- /* @__PURE__ */ jsx(Button7, { onClick: () => removeFromTable(player), children: isWaitList ? /* @__PURE__ */ jsx("p", { children: "Deny Player" }) : /* @__PURE__ */ jsx("p", { children: "Remove Player" }) }),
2514
- canChangeDungeonMaster && /* @__PURE__ */ jsx(Button7, { onClick: () => {
3043
+ canEdit && /* @__PURE__ */ jsxs(Grid10, { children: [
3044
+ /* @__PURE__ */ jsx(Button8, { onClick: () => removeFromTable(player), children: isWaitList ? /* @__PURE__ */ jsx("p", { children: "Deny Player" }) : /* @__PURE__ */ jsx("p", { children: "Remove Player" }) }),
3045
+ canChangeDungeonMaster && /* @__PURE__ */ jsx(Button8, { onClick: () => {
2515
3046
  handleAssignToDungeonMaster(player);
2516
3047
  removeFromTable(player);
2517
3048
  }, children: /* @__PURE__ */ jsx("p", { children: "Assign to DungeonMaster" }) })
@@ -2521,11 +3052,11 @@ var PlayerHighlightsCard = function(props) {
2521
3052
  var DMHighlightsCard = function({ canEdit, player, allTags }) {
2522
3053
  return /* @__PURE__ */ jsxs(Card, { elevation: 3, sx: { backgroundColor: "#f5f9fa", marginBottom: "6px" }, children: [
2523
3054
  /* @__PURE__ */ jsx(CardHeader, { slotProps: { title: { variant: "h4" } }, title: "Game Master" }),
2524
- /* @__PURE__ */ jsx(CardContent, { sx: { backgroundColor: canEdit ? "#fffbea" : "inherit" }, children: /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, direction: "column", children: [
2525
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) }),
2526
- /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "row", children: [
2527
- /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 120, src: player.imageUrl ? player.imageUrl : "", width: 256 }) }),
2528
- /* @__PURE__ */ jsx(Grid8, { children: renderTagsFromIds(player.tags, allTags) }),
3055
+ /* @__PURE__ */ jsx(CardContent, { sx: { backgroundColor: canEdit ? "#fffbea" : "inherit" }, children: /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 2, direction: "column", children: [
3056
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) }),
3057
+ /* @__PURE__ */ jsxs(Grid10, { container: true, direction: "row", children: [
3058
+ /* @__PURE__ */ jsx(Grid10, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 120, src: player.imageUrl || DEFAULT_PROFILE_PIC, width: 256 }) }),
3059
+ /* @__PURE__ */ jsx(Grid10, { children: renderTagsFromIds(player.tags, allTags) }),
2529
3060
  /* @__PURE__ */ jsx(Typography, { children: player.description })
2530
3061
  ] })
2531
3062
  ] }) })
@@ -2554,12 +3085,11 @@ function TableActionsBar(props) {
2554
3085
  if (waitlistPlayers.length === 0) {
2555
3086
  return /* @__PURE__ */ jsx("p", { children: "Waitlist is empty!" });
2556
3087
  }
2557
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
2558
- /* @__PURE__ */ jsx(CardHeader4, { slotProps: { title: { variant: "h4" } }, title: "Waitlist Players: " }),
2559
- /* @__PURE__ */ jsx("ul", { className: "gap-8", children: waitlistPlayers.map((player) => /* @__PURE__ */ jsxs(
3088
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3089
+ /* @__PURE__ */ jsx("ul", { className: "gap-8 px-6", children: waitlistPlayers.map((player) => /* @__PURE__ */ jsxs(
2560
3090
  "li",
2561
3091
  {
2562
- className: `${canMovePlayersToTable ? "bg-amber-100 cursor-pointer" : "bg-gray-200"} mb-8 flex flex-row flex-start space-between justify-center items-center gap-3 p-2 rounded`,
3092
+ className: `${canMovePlayersToTable ? "bg-amber-100 cursor-pointer" : "bg-gray-200"} mb-8 flex flex-row flex-start space-between items-center gap-3 p-2 rounded`,
2563
3093
  onClick: () => canMovePlayersToTable ? onPromoteWaitlistPlayer == null ? void 0 : onPromoteWaitlistPlayer(player.id) : void 0,
2564
3094
  tabIndex: 0,
2565
3095
  children: [
@@ -2568,7 +3098,7 @@ function TableActionsBar(props) {
2568
3098
  {
2569
3099
  alt: player.username + "'s profile pic",
2570
3100
  height: 64,
2571
- src: player.miniPic || "",
3101
+ src: player.miniPic || DEFAULT_PROFILE_PIC,
2572
3102
  width: 64
2573
3103
  }
2574
3104
  ),
@@ -2577,7 +3107,7 @@ function TableActionsBar(props) {
2577
3107
  },
2578
3108
  player.id
2579
3109
  )) }),
2580
- /* @__PURE__ */ jsx("button", { onClick: () => hideModal(), children: "close modal" })
3110
+ /* @__PURE__ */ jsx(DialogActions3, { children: /* @__PURE__ */ jsx(Button8, { onClick: () => hideModal(), children: "Close" }) })
2581
3111
  ] });
2582
3112
  };
2583
3113
  return /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", spacing: 1, children: [
@@ -2588,33 +3118,45 @@ function TableActionsBar(props) {
2588
3118
  slots
2589
3119
  ] }) }),
2590
3120
  /* @__PURE__ */ jsxs(Grid, { container: true, direction: "row", children: [
2591
- !isOwner && !isPlayer && !isDM && !onWaitlist && /* @__PURE__ */ jsx(Button7, { onClick: () => onJoinWaitlist == null ? void 0 : onJoinWaitlist(), sx: buttonStyle, children: "Join Waitlist" }),
2592
- !isOwner && (isPlayer || onWaitlist) && /* @__PURE__ */ jsx(Button7, { onClick: () => onLeaveTable == null ? void 0 : onLeaveTable(), sx: buttonStyle, children: onWaitlist ? "Leave Waitlist" : "Leave Table" }),
3121
+ !isOwner && !isPlayer && !isDM && !onWaitlist && /* @__PURE__ */ jsx(Button8, { onClick: () => onJoinWaitlist == null ? void 0 : onJoinWaitlist(), sx: buttonStyle, children: "Join Waitlist" }),
3122
+ !isOwner && (isPlayer || onWaitlist) && /* @__PURE__ */ jsx(Button8, { onClick: () => onLeaveTable == null ? void 0 : onLeaveTable(), sx: buttonStyle, children: onWaitlist ? "Leave Waitlist" : "Leave Table" }),
2593
3123
  canEditTable ? /* @__PURE__ */ jsxs(Fragment, { children: [
2594
- /* @__PURE__ */ jsx(Button7, { onClick: () => onEditModeChange(true), sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(EditIcon, {}), children: "Edit" }),
3124
+ /* @__PURE__ */ jsx(Button8, { onClick: () => onEditModeChange(true), sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(EditIcon3, {}), children: "Edit" }),
2595
3125
  canViewWaitlist ? /* @__PURE__ */ jsx(
2596
- Button7,
3126
+ Button8,
2597
3127
  {
2598
3128
  endIcon: /* @__PURE__ */ jsx(ListIcon, {}),
2599
- onClick: () => showModal(renderPlayerWaitlistModalContent(false)),
3129
+ onClick: () => showModal(renderPlayerWaitlistModalContent(false), "Waitlist Players:"),
2600
3130
  sx: buttonStyle,
2601
3131
  children: "View Waitlist"
2602
3132
  }
2603
3133
  ) : null
2604
3134
  ] }) : canSaveTable ? /* @__PURE__ */ jsxs(Fragment, { children: [
2605
- /* @__PURE__ */ jsx(Button7, { onClick: onSave, sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(SaveIcon, {}), children: "Save" }),
2606
- /* @__PURE__ */ jsx(Button7, { onClick: () => onEditModeChange(false), sx: buttonStyle, children: "Cancel" }),
3135
+ /* @__PURE__ */ jsx(Button8, { onClick: onSave, sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(SaveIcon, {}), children: "Save" }),
3136
+ /* @__PURE__ */ jsx(Button8, { onClick: () => onEditModeChange(false), sx: buttonStyle, children: "Cancel" }),
2607
3137
  /* @__PURE__ */ jsx(
2608
- Button7,
3138
+ Button8,
2609
3139
  {
2610
3140
  endIcon: /* @__PURE__ */ jsx(ListIcon, {}),
2611
- onClick: () => showModal(renderPlayerWaitlistModalContent(true)),
3141
+ onClick: () => showModal(renderPlayerWaitlistModalContent(true), "Waitlist Players:"),
2612
3142
  sx: buttonStyle,
2613
3143
  children: "Edit Waitlist"
2614
3144
  }
2615
3145
  )
2616
3146
  ] }) : null,
2617
- isOwner && /* @__PURE__ */ jsx(Button7, { onClick: () => onDeleteTable == null ? void 0 : onDeleteTable(), sx: buttonStyle, endIcon: /* @__PURE__ */ jsx(DeleteIcon, {}), children: "Delete Table" })
3147
+ isOwner && /* @__PURE__ */ jsx(
3148
+ Button8,
3149
+ {
3150
+ onClick: () => showModal(
3151
+ /* @__PURE__ */ jsx(Typography, { children: "Are you sure you want to delete this table? This action cannot be undone." }),
3152
+ "Delete Table",
3153
+ { acceptText: "Delete", onAccept: () => onDeleteTable == null ? void 0 : onDeleteTable() }
3154
+ ),
3155
+ sx: buttonStyle,
3156
+ endIcon: /* @__PURE__ */ jsx(DeleteIcon, {}),
3157
+ children: "Delete Table"
3158
+ }
3159
+ )
2618
3160
  ] })
2619
3161
  ] });
2620
3162
  }
@@ -2624,165 +3166,82 @@ var buttonStyle = {
2624
3166
  color: "white",
2625
3167
  borderRadius: "5px"
2626
3168
  };
2627
- var AutoResizingTextarea = (props) => {
2628
- const { isInEditMode, onChange, textareaRef, value } = props;
2629
- useEffect(() => {
2630
- if (isInEditMode && textareaRef.current) {
2631
- const textarea = textareaRef.current;
2632
- textarea.style.height = "auto";
2633
- textarea.style.height = `${textarea.scrollHeight}px`;
2634
- }
2635
- }, [isInEditMode, textareaRef, value]);
2636
- return /* @__PURE__ */ jsx(
2637
- "textarea",
2638
- {
2639
- ref: textareaRef,
2640
- value,
2641
- onChange: (e) => onChange(e.target.value),
2642
- style: {
2643
- backgroundColor: "#fffbea",
2644
- overflow: "hidden",
2645
- resize: "none",
2646
- width: "100%"
2647
- }
2648
- }
2649
- );
2650
- };
2651
- var AutoResizingTextarea_default = AutoResizingTextarea;
2652
- var NextGameCountdown = ({ nextGameTime }) => {
2653
- const [timeLeft, setTimeLeft] = useState("");
2654
- useEffect(() => {
2655
- if (!nextGameTime) return;
2656
- const timer = setInterval(() => {
2657
- const now = (/* @__PURE__ */ new Date()).getTime();
2658
- const distance = new Date(nextGameTime).getTime() - now;
2659
- if (distance < 0) {
2660
- clearInterval(timer);
2661
- setTimeLeft("Started");
2662
- return;
2663
- }
2664
- const days = Math.floor(distance / (1e3 * 60 * 60 * 24));
2665
- const hours = Math.floor(distance % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60));
2666
- const minutes = Math.floor(distance % (1e3 * 60 * 60) / (1e3 * 60));
2667
- const seconds = Math.floor(distance % (1e3 * 60) / 1e3);
2668
- let timeString = "";
2669
- if (days > 0) timeString += `${days}d `;
2670
- if (hours > 0 || days > 0) timeString += `${hours}h `;
2671
- timeString += `${minutes}m ${seconds}s`;
2672
- setTimeLeft(timeString);
2673
- }, 1e3);
2674
- return () => clearInterval(timer);
2675
- }, [nextGameTime]);
2676
- if (!nextGameTime) return null;
2677
- return /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "primary", sx: { fontWeight: "bold" }, children: [
2678
- "Next Game: ",
2679
- timeLeft
2680
- ] });
2681
- };
2682
- function TagEditor({
2683
- title = "Tags",
2684
- selectedTags,
2685
- possibleTags,
2686
- onToggleTag
2687
- }) {
2688
- const [inputValue, setInputValue] = useState("");
2689
- const selectedIds = useMemo(() => selectedTags.map((tag) => tag.id), [selectedTags]);
2690
- const options = useMemo(
2691
- () => possibleTags.map((tag) => ({ value: tag.id, label: tag.label })),
2692
- [possibleTags]
2693
- );
2694
- return /* @__PURE__ */ jsx(Grid8, { container: true, children: /* @__PURE__ */ jsx(Grid8, { size: { xs: 12 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2695
- /* @__PURE__ */ jsx(
2696
- CardHeader4,
2697
- {
2698
- title,
2699
- style: {
2700
- background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
2701
- color: "#FFFFFF",
2702
- fontSize: "1.5rem",
2703
- textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)"
2704
- }
2705
- }
2706
- ),
2707
- /* @__PURE__ */ jsxs(CardContent10, { children: [
2708
- /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: selectedTags.map((tag) => /* @__PURE__ */ jsx(
2709
- Chip,
2710
- {
2711
- tag,
2712
- removeCallback: () => onToggleTag(tag.id)
2713
- },
2714
- tag.id
2715
- )) }),
2716
- /* @__PURE__ */ jsx(Grid8, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid8, { sx: { marginTop: 3, width: "100%" }, children: /* @__PURE__ */ jsx(
2717
- Autocomplete,
2718
- {
2719
- options,
2720
- filterOptions: (availableOptions, state) => availableOptions.filter(
2721
- (option) => !selectedIds.includes(option.value) && option.label.toLowerCase().includes(state.inputValue.toLowerCase())
2722
- ).slice(0, 3),
2723
- value: null,
2724
- inputValue,
2725
- onInputChange: (event, newInputValue) => {
2726
- if (event && event.type === "change") {
2727
- setInputValue(newInputValue);
2728
- }
2729
- },
2730
- onChange: (event, newValue) => {
2731
- if (newValue) {
2732
- onToggleTag(newValue.value);
2733
- }
2734
- setInputValue("");
2735
- },
2736
- slots: { popper: CustomPopper3 },
2737
- renderInput: (params) => /* @__PURE__ */ jsx(TextField4, { ...params, label: "Select Tags" })
2738
- },
2739
- selectedIds.join("-")
2740
- ) }) })
2741
- ] })
2742
- ] }) }) });
2743
- }
2744
- var CustomPopper3 = (props) => {
2745
- return /* @__PURE__ */ jsx(
2746
- Popper,
2747
- {
2748
- ...props,
2749
- modifiers: [
2750
- {
2751
- name: "preventOverflow",
2752
- options: { boundary: "viewport" }
2753
- },
2754
- {
2755
- name: "offset",
2756
- options: { offset: [0, -10] }
2757
- }
2758
- ],
2759
- placement: "top-start"
2760
- }
2761
- );
2762
- };
2763
3169
  function TablePageLayout(props) {
2764
3170
  var _a;
2765
- const { allTags, dungeonMaster, onDeleteTable, onJoinWaitlist, onLeaveTable, onSaveDraft, players, table, tableStatus, waitlistPlayers } = props;
3171
+ const { hideModal, showModal } = useModal();
3172
+ const { allTags, dungeonMaster, onDeleteTable, onJoinWaitlist, onLeaveTable, onSaveDraft, players, table, tableStatus, waitlistPlayers, startWithEditTitle, eventTagId } = props;
3173
+ const canEdit = tableStatus.isOwner;
2766
3174
  const textAreaRef = useRef(null);
2767
3175
  const [isTableInEditMode, setIsTableInEditMode] = useState(false);
3176
+ const [currentTitle, setCurrentTitle] = useState(table.title);
3177
+ const [currentSubtitle, setCurrentSubtitle] = useState(table.shortDescription);
2768
3178
  const [currentDescription, setCurrentDescription] = useState(table.description);
2769
3179
  const [currentDungeonMaster, setCurrentDungeonMaster] = useState(dungeonMaster);
2770
3180
  const [currentPlayers, setCurrentPlayers] = useState(players);
2771
- const [currentShortDescription, setCurrentShortDescription] = useState(table.shortDescription);
2772
- const [currentTitle, setCurrentTitle] = useState(table.title);
2773
3181
  const [currentWaitlistPlayers, setCurrentWaitlistPlayers] = useState(waitlistPlayers);
2774
3182
  const [currentTagIds, setCurrentTagIds] = useState((_a = table.tags) != null ? _a : []);
3183
+ const pendingEdits = useRef({ title: currentTitle, subtitle: currentSubtitle, tags: currentTagIds });
3184
+ const handleSaveTable = (tableData = {}) => {
3185
+ const nextDraft = {
3186
+ ...table,
3187
+ description: currentDescription,
3188
+ dungeonMaster: String(currentDungeonMaster.id),
3189
+ players: currentPlayers.map((player) => player.id),
3190
+ shortDescription: currentSubtitle,
3191
+ tags: currentTagIds,
3192
+ title: currentTitle,
3193
+ waitlist: currentWaitlistPlayers.map((player) => player.id),
3194
+ ...tableData
3195
+ };
3196
+ void (onSaveDraft == null ? void 0 : onSaveDraft(nextDraft));
3197
+ setIsTableInEditMode(false);
3198
+ };
3199
+ const clean = (text) => text.replaceAll(
3200
+ /\b(n[i1!]g+(er|a|e)s?|f[a@]g|f[a@]g+[o0]ts?|k[i1!]k[e3]s?|ch[i1!]nks?|w[e3]tb[a@]cks?|r[a@]gh[e3][a@]ds?|t[o0]w[e3]lh[e3][a@]ds?|r[e3]t[a@]rd(ed|s)?|c[o0][o0]ns?|tr[a@]nn(y|i[e3]s?)|g[o0][o0]ks?)\b/gi,
3201
+ "dudes"
3202
+ );
3203
+ const editTableDetails = () => {
3204
+ if (!canEdit) {
3205
+ return;
3206
+ }
3207
+ pendingEdits.current = {
3208
+ title: currentTitle,
3209
+ subtitle: currentSubtitle,
3210
+ tags: currentTagIds
3211
+ };
3212
+ const editContent = /* @__PURE__ */ jsx(
3213
+ EditTableDetailsForm,
3214
+ {
3215
+ initialTitle: currentTitle,
3216
+ initialSubtitle: currentSubtitle,
3217
+ onTitleChange: (t) => pendingEdits.current.title = t,
3218
+ onSubtitleChange: (s) => pendingEdits.current.subtitle = s,
3219
+ onTagChange: (t) => pendingEdits.current.tags = t,
3220
+ initialTagIDs: currentTagIds,
3221
+ allTags: allTags.filter((t) => t.appliesTo.tables),
3222
+ allowEditingTitles: true
3223
+ }
3224
+ );
3225
+ showModal(editContent, "Edit Table Details", {
3226
+ acceptText: "Save",
3227
+ onAccept: () => {
3228
+ setCurrentTitle(clean(pendingEdits.current.title));
3229
+ setCurrentSubtitle(clean(pendingEdits.current.subtitle));
3230
+ setCurrentTagIds(pendingEdits.current.tags);
3231
+ handleSaveTable({
3232
+ title: clean(pendingEdits.current.title),
3233
+ shortDescription: clean(pendingEdits.current.subtitle),
3234
+ tags: pendingEdits.current.tags
3235
+ });
3236
+ }
3237
+ });
3238
+ };
2775
3239
  useEffect(() => {
2776
- var _a2;
2777
- setCurrentDescription(table.description);
2778
- setCurrentDungeonMaster(dungeonMaster);
2779
- setCurrentPlayers(players);
2780
- setCurrentShortDescription(table.shortDescription);
2781
- setCurrentTitle(table.title);
2782
- setCurrentWaitlistPlayers(waitlistPlayers);
2783
- setCurrentTagIds((_a2 = table.tags) != null ? _a2 : []);
2784
- }, [dungeonMaster, players, table, waitlistPlayers]);
2785
- const currentTags = useMemo(
3240
+ if (startWithEditTitle) {
3241
+ editTableDetails();
3242
+ }
3243
+ });
3244
+ useMemo(
2786
3245
  () => allTags.filter((tag) => currentTagIds.includes(tag.id)),
2787
3246
  [allTags, currentTagIds]
2788
3247
  );
@@ -2802,37 +3261,17 @@ function TablePageLayout(props) {
2802
3261
  return prevWaitlist.filter((player) => player.id !== playerIdToPromote);
2803
3262
  });
2804
3263
  };
2805
- const handleToggleTag = (tagId) => {
2806
- setCurrentTagIds(
2807
- (prevState) => prevState.includes(tagId) ? prevState.filter((id) => id !== tagId) : [...prevState, tagId]
2808
- );
2809
- };
2810
- const handleSaveTable = () => {
2811
- const nextDraft = {
2812
- ...table,
2813
- description: currentDescription,
2814
- dungeonMaster: String(currentDungeonMaster.id),
2815
- players: currentPlayers.map((player) => player.id),
2816
- shortDescription: currentShortDescription,
2817
- tags: currentTagIds,
2818
- title: currentTitle,
2819
- waitlist: currentWaitlistPlayers.map((player) => player.id)
2820
- };
2821
- void (onSaveDraft == null ? void 0 : onSaveDraft(nextDraft));
2822
- setIsTableInEditMode(false);
2823
- };
2824
3264
  return /* @__PURE__ */ jsx(
2825
3265
  Card,
2826
3266
  {
2827
3267
  sx: {
2828
3268
  backgroundColor: isTableInEditMode ? "lightsalmon" : "white",
2829
- borderRadius: "5%",
2830
3269
  p: 2,
2831
3270
  boxShadow: "0px 8px 15px rgba(25, 118, 210, 0.3)"
2832
3271
  },
2833
- children: /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "column", children: [
3272
+ children: /* @__PURE__ */ jsxs(Grid10, { container: true, direction: "column", children: [
2834
3273
  /* @__PURE__ */ jsxs(
2835
- Grid8,
3274
+ Grid10,
2836
3275
  {
2837
3276
  container: true,
2838
3277
  direction: "column",
@@ -2845,39 +3284,49 @@ function TablePageLayout(props) {
2845
3284
  textShadow: "4px 4px 6px rgba(0, 0, 0, 0.5)"
2846
3285
  },
2847
3286
  children: [
2848
- /* @__PURE__ */ jsx(Box, { children: isTableInEditMode ? /* @__PURE__ */ jsx(
2849
- "input",
3287
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(
3288
+ Box,
2850
3289
  {
2851
- onChange: (e) => setCurrentTitle(e.target.value),
2852
- style: { backgroundColor: "#fffbea" },
2853
- tabIndex: 0,
2854
- type: "text",
2855
- value: currentTitle
2856
- }
2857
- ) : /* @__PURE__ */ jsx(
2858
- CardHeader,
2859
- {
2860
- title: currentTitle,
2861
- sx: {
2862
- p: 0,
2863
- "& .MuiCardHeader-title": {
2864
- color: "white",
2865
- fontWeight: 700
2866
- }
2867
- }
3290
+ className: `flex items-center gap-1 ${canEdit ? "cursor-pointer" : ""}`,
3291
+ sx: { "&:hover .edit-icon": { opacity: 1 } },
3292
+ onClick: editTableDetails,
3293
+ children: [
3294
+ /* @__PURE__ */ jsx(
3295
+ CardHeader,
3296
+ {
3297
+ title: currentTitle,
3298
+ sx: {
3299
+ p: 0,
3300
+ "& .MuiCardHeader-title": {
3301
+ color: "white",
3302
+ fontWeight: 700
3303
+ }
3304
+ }
3305
+ }
3306
+ ),
3307
+ canEdit ? /* @__PURE__ */ jsx(EditIcon3, { className: "edit-icon text-white", sx: { opacity: 0, transition: "opacity 0.2s" } }) : ""
3308
+ ]
2868
3309
  }
2869
3310
  ) }),
2870
- isTableInEditMode ? /* @__PURE__ */ jsx(
2871
- "input",
3311
+ /* @__PURE__ */ jsxs(
3312
+ Box,
2872
3313
  {
2873
- onChange: (e) => setCurrentShortDescription(e.target.value),
2874
- style: { backgroundColor: "#fffbea" },
2875
- tabIndex: 0,
2876
- type: "text",
2877
- value: currentShortDescription
3314
+ className: `flex items-center gap-1 ${canEdit ? "cursor-pointer" : ""}`,
3315
+ sx: { "&:hover .edit-icon": { opacity: 1 } },
3316
+ onClick: editTableDetails,
3317
+ children: [
3318
+ /* @__PURE__ */ jsx(
3319
+ Typography,
3320
+ {
3321
+ sx: { color: "white", opacity: 0.95 },
3322
+ children: currentSubtitle
3323
+ }
3324
+ ),
3325
+ canEdit ? /* @__PURE__ */ jsx(EditIcon3, { className: "edit-icon text-white", sx: { opacity: 0, transition: "opacity 0.2s", fontSize: "medium" } }) : ""
3326
+ ]
2878
3327
  }
2879
- ) : /* @__PURE__ */ jsx(Typography, { sx: { color: "white", opacity: 0.95 }, children: currentShortDescription }),
2880
- /* @__PURE__ */ jsx(Grid8, { container: true, children: isTableInEditMode ? renderEditableTags(currentTags, allTags, handleToggleTag) : renderTags(currentTagIds, allTags) }),
3328
+ ),
3329
+ /* @__PURE__ */ jsx(Grid10, { container: true, onClick: editTableDetails, className: `${canEdit ? "cursor-pointer" : ""}`, children: renderTags(currentTagIds, allTags, canEdit, table.eventTagId || eventTagId) }),
2881
3330
  /* @__PURE__ */ jsx(
2882
3331
  TableActionsBar,
2883
3332
  {
@@ -2897,8 +3346,8 @@ function TablePageLayout(props) {
2897
3346
  ]
2898
3347
  }
2899
3348
  ),
2900
- /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, sx: { mt: 2 }, children: [
2901
- /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 8 }, children: /* @__PURE__ */ jsx(Card, { sx: { height: "100%" }, children: /* @__PURE__ */ jsx(CardContent, { children: isTableInEditMode ? /* @__PURE__ */ jsx(
3349
+ /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 2, sx: { mt: 2 }, children: [
3350
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 8 }, children: /* @__PURE__ */ jsx(Card, { sx: { height: "100%" }, children: /* @__PURE__ */ jsx(CardContent, { children: isTableInEditMode ? /* @__PURE__ */ jsx(
2902
3351
  AutoResizingTextarea_default,
2903
3352
  {
2904
3353
  isInEditMode: isTableInEditMode,
@@ -2907,7 +3356,7 @@ function TablePageLayout(props) {
2907
3356
  value: currentDescription
2908
3357
  }
2909
3358
  ) : /* @__PURE__ */ jsx(Typography, { sx: { whiteSpace: "pre-wrap" }, children: currentDescription }) }) }) }),
2910
- /* @__PURE__ */ jsxs(Grid8, { size: { xs: 12, md: 4 }, children: [
3359
+ /* @__PURE__ */ jsxs(Grid10, { size: { xs: 12, md: 4 }, children: [
2911
3360
  /* @__PURE__ */ jsx(DMHighlightsCard, { canEdit: isTableInEditMode, player: currentDungeonMaster, allTags }),
2912
3361
  /* @__PURE__ */ jsxs(Card, { sx: { height: "100%" }, children: [
2913
3362
  /* @__PURE__ */ jsx(CardHeader, { slotProps: { title: { variant: "h4" } }, title: "Players: " }),
@@ -2930,31 +3379,78 @@ function TablePageLayout(props) {
2930
3379
  }
2931
3380
  );
2932
3381
  }
2933
- var renderTags = function(tags, allTags) {
3382
+ var renderTags = function(tags, allTags, canEdit, eventTagId) {
2934
3383
  if (!tags || !allTags) {
2935
3384
  return /* @__PURE__ */ jsx(Fragment, {});
2936
3385
  }
2937
- return /* @__PURE__ */ jsx(Grid8, { container: true, spacing: 1, sx: { pb: 1.5 }, children: tags.map((tagId) => {
2938
- const tag = allTags.find((potentialTag) => tagId === potentialTag.id);
2939
- return tag ? generateTagsDisplay(tag) : /* @__PURE__ */ jsx(Fragment, {});
2940
- }) });
2941
- };
2942
- var renderEditableTags = function(selectedTags, allTags, onToggleTag) {
2943
- return /* @__PURE__ */ jsx(Grid8, { size: { xs: 12 }, sx: { pb: 1.5 }, children: /* @__PURE__ */ jsx(
2944
- TagEditor,
2945
- {
2946
- title: "Table Tags",
2947
- possibleTags: allTags.filter((tag) => {
2948
- var _a;
2949
- return (_a = tag.appliesTo) == null ? void 0 : _a.tables;
2950
- }),
2951
- selectedTags,
2952
- onToggleTag
2953
- }
2954
- ) });
3386
+ return /* @__PURE__ */ jsxs(Grid10, { container: true, spacing: 1, sx: { pb: 1.5 }, children: [
3387
+ renderTagsFromIds(tags, allTags, { showEventTag: true, eventTagId }),
3388
+ canEdit ? /* @__PURE__ */ jsx(
3389
+ Button,
3390
+ {
3391
+ variant: "text",
3392
+ className: "inline-block text-sm px-3 py-1font-outlined m-0.5 font-stretch-105% font-sans",
3393
+ sx: {
3394
+ color: "white",
3395
+ textShadow: "black 1.5px 1px 1.5px",
3396
+ "&:hover": {
3397
+ background: "#889"
3398
+ }
3399
+ },
3400
+ children: "Edit Tags..."
3401
+ }
3402
+ ) : ""
3403
+ ] });
2955
3404
  };
2956
3405
  var TablePageLayout_default = TablePageLayout;
3406
+ var ModalProvider = ({ children }) => {
3407
+ var _a;
3408
+ const [modalContent, setModalContent] = useState(null);
3409
+ const [displayModal, setDisplayModal] = useState(false);
3410
+ const [title, setTitle] = useState("");
3411
+ const [options, setOptions] = useState({});
3412
+ const showModal = (content, title2, opts) => {
3413
+ setModalContent(content);
3414
+ setTitle(title2);
3415
+ setOptions(opts != null ? opts : {});
3416
+ setDisplayModal(true);
3417
+ };
3418
+ const hideModal = () => {
3419
+ setDisplayModal(false);
3420
+ };
3421
+ return /* @__PURE__ */ jsxs(ModalContext.Provider, { value: { showModal, hideModal }, children: [
3422
+ children,
3423
+ /* @__PURE__ */ jsxs(Dialog3, { open: displayModal, onClose: hideModal, sx: { height: "85%" }, children: [
3424
+ /* @__PURE__ */ jsxs(Box, { children: [
3425
+ /* @__PURE__ */ jsx(DialogTitle3, { sx: { marginRight: "20px", minWidth: "400px" }, children: title }),
3426
+ /* @__PURE__ */ jsx(
3427
+ IconButton3,
3428
+ {
3429
+ "aria-label": "close",
3430
+ onClick: hideModal,
3431
+ sx: { position: "absolute", right: 8, top: 8 },
3432
+ children: /* @__PURE__ */ jsx(CloseIcon, {})
3433
+ }
3434
+ )
3435
+ ] }),
3436
+ /* @__PURE__ */ jsx(DialogContent3, { sx: { paddingTop: 0 }, children: modalContent }),
3437
+ (options.acceptText || options.onAccept) && /* @__PURE__ */ jsxs(DialogActions3, { children: [
3438
+ /* @__PURE__ */ jsx(Button8, { variant: "contained", onClick: () => {
3439
+ var _a2;
3440
+ hideModal();
3441
+ (_a2 = options.onAccept) == null ? void 0 : _a2.call(options);
3442
+ }, children: (_a = options.acceptText) != null ? _a : "OK" }),
3443
+ /* @__PURE__ */ jsx(Button8, { onClick: () => {
3444
+ var _a2;
3445
+ hideModal();
3446
+ (_a2 = options.onCancel) == null ? void 0 : _a2.call(options);
3447
+ }, children: "Cancel" })
3448
+ ] })
3449
+ ] })
3450
+ ] });
3451
+ };
3452
+ var ModalProvider_default = ModalProvider;
2957
3453
 
2958
- export { AutoResizingTextarea_default as AutoResizingTextarea, BaseSearchResultCard_default as BaseSearchResultCard, CANDIDATE_TIMEZONES, Chip, DMHighlightsCard, EventBanner, EventBannerEdit, EventBasicInfo, EventBasicInfoEdit, EventEditProvider, EventPageLayout, EventResultCard_default as EventResultCard, EventTablesCard_default as EventTablesCard, ExpiredTablesFilter_default as ExpiredTablesFilter, FiltersContainer_default as FiltersContainer, GameTableProvider, ModalContext, ModalProvider_default as ModalProvider, NextGameCountdown, NextGameLabel_default as NextGameLabel, PlayerDetailsCard_default as PlayerDetailsCard, PlayerDisplayCard_default as PlayerDisplayCard, PlayerHighlightsCard, PlayerPageLayout, PlayerPromptCard_default as PlayerPromptCard, PlayerResultCard_default as PlayerResultCard, PlayerTagsCard_default as PlayerTagsCard, PlayerTagsEdit_default as PlayerTagsEdit, PlayersScrollableList_default as PlayersScrollableList, ResultsContainer_default as ResultsContainer, ScrollableResultsList_default as ScrollableResultsList, SearchPageLayout, SearchResultCard_default as SearchResultCard, SortOptions_default as SortOptions, TableActionsBar, TablePageLayout_default as TablePageLayout, TableResultCard_default as TableResultCard, TablesScrollableList_default as TablesScrollableList, TagEditor, TagsFilter_default as TagsFilter, TextSearchCard_default as TextSearchCard, TypeFilter_default as TypeFilter, generateTagsDisplay, renderTagsFromIds, useEventEdit, useGameTableContext, useModal };
3454
+ export { AutoResizingTextarea_default as AutoResizingTextarea, BaseSearchResultCard_default as BaseSearchResultCard, CANDIDATE_TIMEZONES, Chip, DMHighlightsCard, DistanceFilter_default as DistanceFilter, EditTableDetailsForm, EventBanner, EventBannerEdit, EventBasicInfo, EventBasicInfoEdit, EventEditProvider, EventPageLayout, EventResultCard_default as EventResultCard, EventTablesCard_default as EventTablesCard, ExpiredTablesFilter_default as ExpiredTablesFilter, FiltersContainer_default as FiltersContainer, GameTableProvider, ModalContext, ModalProvider_default as ModalProvider, NextGameCountdown, NextGameLabel_default as NextGameLabel, PlayerDetailsCard_default as PlayerDetailsCard, PlayerDisplayCard_default as PlayerDisplayCard, PlayerHighlightsCard, PlayerPageLayout, PlayerPromptCard_default as PlayerPromptCard, PlayerResultCard_default as PlayerResultCard, PlayerTagsCard_default as PlayerTagsCard, PlayerTagsEdit_default as PlayerTagsEdit, PlayersScrollableList_default as PlayersScrollableList, ResultsContainer_default as ResultsContainer, ScrollableResultsList_default as ScrollableResultsList, SearchPageLayout, SearchResultCard_default as SearchResultCard, SortOptions_default as SortOptions, TableActionsBar, TablePageLayout_default as TablePageLayout, TableResultCard_default as TableResultCard, TablesScrollableList_default as TablesScrollableList, TagEditor, TagSelector, TagsFilter_default as TagsFilter, TextSearchCard_default as TextSearchCard, TypeFilter_default as TypeFilter, UserAgreementModal_default as UserAgreementModal, generateTagsDisplay, getRandomTagline, getRandomTitle, renderTagsFromIds, useEventEdit, useGameTableContext, useModal };
2959
3455
  //# sourceMappingURL=index.mjs.map
2960
3456
  //# sourceMappingURL=index.mjs.map