@articles-media/articles-dev-box 1.0.16 → 1.0.22

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 (84) hide show
  1. package/README.md +10 -5
  2. package/dist/Ad-Ck5UdTq3.js +387 -0
  3. package/dist/Ad-DYtftKNV.cjs +1 -0
  4. package/dist/Ad.cjs +1 -1
  5. package/dist/Ad.js +2 -604
  6. package/dist/AdConfirmExitModal-CJ-HtcVC.js +56 -0
  7. package/dist/AdConfirmExitModal-CRCnzYQM.cjs +1 -0
  8. package/dist/AdDetailsModal-DRNRTL2W.js +108 -0
  9. package/dist/AdDetailsModal-g0n7LiV6.cjs +1 -0
  10. package/dist/ArticlesAd.cjs +1 -1
  11. package/dist/ArticlesAd.js +16 -15
  12. package/dist/Button-BlAdEbSd.js +30 -0
  13. package/dist/Button-CbpRj01E.cjs +1 -0
  14. package/dist/CreditsModal.cjs +1 -0
  15. package/dist/CreditsModal.js +56 -0
  16. package/dist/DarkModeHandler.cjs +1 -0
  17. package/dist/DarkModeHandler.js +18 -0
  18. package/dist/FriendsList.cjs +1 -1
  19. package/dist/FriendsList.js +77 -121
  20. package/dist/GameScoreboard-CBY3JsFa.js +165 -0
  21. package/dist/GameScoreboard-DdOCRxON.cjs +1 -0
  22. package/dist/GameScoreboard.cjs +1 -1
  23. package/dist/GameScoreboard.js +2 -190
  24. package/dist/GlobalBody.cjs +33 -1
  25. package/dist/GlobalBody.js +36 -7
  26. package/dist/GlobalHead.cjs +1 -1
  27. package/dist/GlobalHead.js +10 -12
  28. package/dist/Link-MFZblBb4.js +17 -0
  29. package/dist/Link-c7exNCJ3.cjs +1 -0
  30. package/dist/Modal-BX1s6CCU.js +1631 -0
  31. package/dist/Modal-DP9CeAVD.cjs +3 -0
  32. package/dist/ReturnToLauncherButton.cjs +1 -1
  33. package/dist/ReturnToLauncherButton.js +39 -54
  34. package/dist/SettingsModal--sWLmLGp.cjs +1 -0
  35. package/dist/SettingsModal-XI2dMI09.js +247 -0
  36. package/dist/SettingsModal.cjs +1 -0
  37. package/dist/SettingsModal.js +2 -0
  38. package/dist/StatusModal-D7WDDR9P.cjs +1 -0
  39. package/dist/StatusModal-elrPJvX1.js +70 -0
  40. package/dist/ViewUserModal-DDjWLpyM.js +3094 -0
  41. package/dist/ViewUserModal-DPVcjXNU.cjs +1 -0
  42. package/dist/ViewUserModal.cjs +1 -1
  43. package/dist/ViewUserModal.js +3 -3189
  44. package/dist/articles-dev-box.css +2 -1
  45. package/dist/chunk-350yNsax.cjs +1 -0
  46. package/dist/classnames-DP6dWde5.js +31 -0
  47. package/dist/classnames-pS64X3rL.cjs +1 -0
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.js +16 -24
  50. package/dist/jsx-runtime-VZk6y-ec.js +191 -0
  51. package/dist/jsx-runtime-hCcDh67y.cjs +6 -0
  52. package/dist/numberWithCommas-BSKBdR-e.js +18 -0
  53. package/dist/numberWithCommas-D9tgiUnq.cjs +1 -0
  54. package/dist/useAuthSiteStatus-1rHjYC4N.js +29 -0
  55. package/dist/useAuthSiteStatus-P5kHc_Bz.cjs +1 -0
  56. package/dist/useFullscreen.cjs +1 -0
  57. package/dist/useFullscreen.js +24 -0
  58. package/dist/useUserDetails.cjs +1 -1
  59. package/dist/useUserDetails.js +22 -32
  60. package/dist/useUserFriends.cjs +1 -1
  61. package/dist/useUserFriends.js +29 -51
  62. package/dist/useUserToken.cjs +1 -1
  63. package/dist/useUserToken.js +16 -21
  64. package/package.json +25 -10
  65. package/dist/AdConfirmExitModal-CKkMAvBK.js +0 -72
  66. package/dist/AdConfirmExitModal-CcSxmXKT.cjs +0 -1
  67. package/dist/AdDetailsModal-Bp5hZm9N.js +0 -83
  68. package/dist/AdDetailsModal-k840vrS2.cjs +0 -1
  69. package/dist/Button-0ZK0NKiK.cjs +0 -1
  70. package/dist/Button-_Quon8UV.js +0 -54
  71. package/dist/GlobalBody-BQ2qC81K.cjs +0 -33
  72. package/dist/GlobalBody-tmIC_GWn.js +0 -123
  73. package/dist/Modal-C9oYRgI1.js +0 -2073
  74. package/dist/Modal-Wmqy9fOm.cjs +0 -2
  75. package/dist/StatusModal-BlwaI-2B.cjs +0 -1
  76. package/dist/StatusModal-CAVxWCUq.js +0 -71
  77. package/dist/index-BlP2-uOi.cjs +0 -1
  78. package/dist/index-DLYx67wi.js +0 -2394
  79. package/dist/index-Ddv_TnxK.cjs +0 -6
  80. package/dist/index-YnD2EP-S.js +0 -43
  81. package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
  82. package/dist/jsx-runtime-tc70JA_2.js +0 -264
  83. package/dist/numberWithCommas-CRgrb58X.cjs +0 -1
  84. package/dist/numberWithCommas-DnAkiOFL.js +0 -1256
@@ -0,0 +1,165 @@
1
+ import { t as e } from "./jsx-runtime-VZk6y-ec.js";
2
+ import { t } from "./Button-BlAdEbSd.js";
3
+ import { t as n } from "./Modal-BX1s6CCU.js";
4
+ import { t as r } from "./ViewUserModal-DDjWLpyM.js";
5
+ import { useEffect as i, useState as a } from "react";
6
+ import o from "swr";
7
+ //#region src/components/UI/ArticlesSwitch.jsx
8
+ var s = e();
9
+ function c({ setChecked: e, checked: t, readOnly: n }) {
10
+ return /* @__PURE__ */ (0, s.jsxs)("label", {
11
+ className: `articles-switch mb-0 ${t && "checked"}`,
12
+ children: [/* @__PURE__ */ (0, s.jsx)("input", {
13
+ type: "checkbox",
14
+ readOnly: !!n,
15
+ checked: t,
16
+ onChange: () => {}
17
+ }), /* @__PURE__ */ (0, s.jsx)("span", {
18
+ onClick: (n) => {
19
+ if (e) {
20
+ e(!t);
21
+ return;
22
+ } else {
23
+ n.preventDefault();
24
+ return;
25
+ }
26
+ },
27
+ className: "slider"
28
+ })]
29
+ });
30
+ }
31
+ //#endregion
32
+ //#region src/hooks/Games/useGameScoreboard.js
33
+ var l = async (e) => {
34
+ if (process.env.NODE_ENV === "development") try {
35
+ let t = new URLSearchParams({ game: e.game }).toString();
36
+ return await (await fetch(`http://localhost:3001/api/community/games/scoreboard?${t}`)).json();
37
+ } catch {}
38
+ let t = new URLSearchParams({ game: e.game }).toString();
39
+ return fetch(`${e.url}?${t}`).then((e) => e.json());
40
+ }, u = {
41
+ dedupingInterval: 1e3 * 60 * 30,
42
+ refreshInterval: 0,
43
+ revalidateOnFocus: !1,
44
+ revalidateIfStale: !1,
45
+ shouldRetryOnError: !1
46
+ }, d = (e) => {
47
+ let { data: t, error: n, isLoading: r, isValidating: i, mutate: a } = o(e?.game ? {
48
+ url: "https://articles.media/api/community/games/scoreboard",
49
+ game: e.game
50
+ } : null, l, u);
51
+ return {
52
+ data: t,
53
+ error: n,
54
+ isLoading: r,
55
+ isValidating: i,
56
+ mutate: a
57
+ };
58
+ };
59
+ //#endregion
60
+ //#region src/components/Games/GameScoreboard.jsx
61
+ function f({ game: e, reloadScoreboard: o, setReloadScoreboard: l, prepend: u, append: f }) {
62
+ let [p, m] = a(!1), [h, g] = a(!1), { data: _, isLoading: v, mutate: y } = d({ game: e });
63
+ return i(() => {}, []), i(() => {
64
+ o && (l(!1), y());
65
+ }, [o]), /* @__PURE__ */ (0, s.jsxs)("div", {
66
+ className: "scoreboard",
67
+ children: [
68
+ /* @__PURE__ */ (0, s.jsxs)(n, {
69
+ show: p,
70
+ size: "md",
71
+ className: "articles-modal",
72
+ centered: !0,
73
+ onHide: () => m(!1),
74
+ children: [
75
+ /* @__PURE__ */ (0, s.jsx)(n.Header, { children: /* @__PURE__ */ (0, s.jsx)(n.Title, { children: "Scoreboard Settings" }) }),
76
+ /* @__PURE__ */ (0, s.jsx)(n.Body, { children: /* @__PURE__ */ (0, s.jsxs)("div", {
77
+ className: "d-flex justify-content-between align-items-center",
78
+ onClick: () => g(!h),
79
+ children: [/* @__PURE__ */ (0, s.jsxs)("div", { children: [/* @__PURE__ */ (0, s.jsx)("i", { className: "fas fa-trophy-alt" }), /* @__PURE__ */ (0, s.jsx)("span", { children: "Join Scoreboard?" })] }), /* @__PURE__ */ (0, s.jsx)(c, { checked: h })]
80
+ }) }),
81
+ /* @__PURE__ */ (0, s.jsx)(n.Footer, {
82
+ className: "justify-content-between",
83
+ children: /* @__PURE__ */ (0, s.jsx)(t, {
84
+ variant: "articles",
85
+ onClick: () => {
86
+ m(!1);
87
+ },
88
+ children: "Close"
89
+ })
90
+ })
91
+ ]
92
+ }),
93
+ /* @__PURE__ */ (0, s.jsx)("div", {
94
+ className: "prepend-container",
95
+ children: u
96
+ }),
97
+ /* @__PURE__ */ (0, s.jsxs)("div", {
98
+ className: "card card-articles card-sm mb-3 mb-lg-0",
99
+ children: [
100
+ /* @__PURE__ */ (0, s.jsxs)("div", {
101
+ className: "card-header d-flex justify-content-between align-items-center",
102
+ children: [/* @__PURE__ */ (0, s.jsxs)("span", { children: [e, " Scoreboard"] }), /* @__PURE__ */ (0, s.jsx)(t, {
103
+ onClick: () => {
104
+ y();
105
+ },
106
+ small: !0,
107
+ children: /* @__PURE__ */ (0, s.jsx)("i", { className: "fad fa-redo me-0" })
108
+ })]
109
+ }),
110
+ /* @__PURE__ */ (0, s.jsxs)("div", {
111
+ className: "card-body p-0",
112
+ children: [(_?.length || 0) == 0 && /* @__PURE__ */ (0, s.jsx)("div", {
113
+ className: "small p-2",
114
+ children: "No scores yet"
115
+ }), _?.map((e, t) => /* @__PURE__ */ (0, s.jsxs)("div", {
116
+ className: "result d-flex flex-column justify-content-between border-bottom p-2",
117
+ children: [/* @__PURE__ */ (0, s.jsxs)("div", {
118
+ className: "d-flex justify-content-between lh-sm",
119
+ children: [/* @__PURE__ */ (0, s.jsxs)("div", {
120
+ className: "d-flex",
121
+ children: [/* @__PURE__ */ (0, s.jsx)("h5", {
122
+ className: "mb-0 me-3",
123
+ children: t + 1
124
+ }), /* @__PURE__ */ (0, s.jsx)("div", {
125
+ className: "lh-sm",
126
+ children: /* @__PURE__ */ (0, s.jsx)(r, {
127
+ populated_user: e.populated_user,
128
+ user_id: e.user_id
129
+ })
130
+ })]
131
+ }), /* @__PURE__ */ (0, s.jsx)("div", { children: /* @__PURE__ */ (0, s.jsx)("h5", {
132
+ className: "mb-0",
133
+ children: e.score || e.total
134
+ }) })]
135
+ }), e.last_play && e.public_last_play && /* @__PURE__ */ (0, s.jsxs)("small", {
136
+ className: "mt-1",
137
+ style: { fontSize: "0.75rem" },
138
+ children: ["Played: ", format(new Date(e.last_play), "MM/d/yy hh:mmaa")]
139
+ })]
140
+ }, e._id))]
141
+ }),
142
+ /* @__PURE__ */ (0, s.jsxs)("div", {
143
+ className: "card-footer d-flex justify-content-between align-items-center",
144
+ children: [/* @__PURE__ */ (0, s.jsx)("div", {
145
+ className: "small",
146
+ children: "Play to get on the board!"
147
+ }), /* @__PURE__ */ (0, s.jsx)(t, {
148
+ small: !0,
149
+ onClick: () => {
150
+ m(!0);
151
+ },
152
+ children: /* @__PURE__ */ (0, s.jsx)("i", { className: "fad fa-cog me-0" })
153
+ })]
154
+ })
155
+ ]
156
+ }),
157
+ /* @__PURE__ */ (0, s.jsx)("div", {
158
+ className: "append-container",
159
+ children: f
160
+ })
161
+ ]
162
+ });
163
+ }
164
+ //#endregion
165
+ export { f as t };
@@ -0,0 +1 @@
1
+ const e=require(`./chunk-350yNsax.cjs`),t=require(`./jsx-runtime-hCcDh67y.cjs`),n=require(`./Button-CbpRj01E.cjs`),r=require(`./Modal-DP9CeAVD.cjs`),i=require(`./ViewUserModal-DPVcjXNU.cjs`);let a=require(`react`),o=require(`swr`);o=e.n(o);var s=t.t();function c({setChecked:e,checked:t,readOnly:n}){return(0,s.jsxs)(`label`,{className:`articles-switch mb-0 ${t&&`checked`}`,children:[(0,s.jsx)(`input`,{type:`checkbox`,readOnly:!!n,checked:t,onChange:()=>{}}),(0,s.jsx)(`span`,{onClick:n=>{if(e){e(!t);return}else{n.preventDefault();return}},className:`slider`})]})}var l=async e=>{if(process.env.NODE_ENV===`development`)try{let t=new URLSearchParams({game:e.game}).toString();return await(await fetch(`http://localhost:3001/api/community/games/scoreboard?${t}`)).json()}catch{}let t=new URLSearchParams({game:e.game}).toString();return fetch(`${e.url}?${t}`).then(e=>e.json())},u={dedupingInterval:1e3*60*30,refreshInterval:0,revalidateOnFocus:!1,revalidateIfStale:!1,shouldRetryOnError:!1},d=e=>{let{data:t,error:n,isLoading:r,isValidating:i,mutate:a}=(0,o.default)(e?.game?{url:`https://articles.media/api/community/games/scoreboard`,game:e.game}:null,l,u);return{data:t,error:n,isLoading:r,isValidating:i,mutate:a}};function f({game:e,reloadScoreboard:t,setReloadScoreboard:o,prepend:l,append:u}){let[f,p]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),{data:g,isLoading:_,mutate:v}=d({game:e});return(0,a.useEffect)(()=>{},[]),(0,a.useEffect)(()=>{t&&(o(!1),v())},[t]),(0,s.jsxs)(`div`,{className:`scoreboard`,children:[(0,s.jsxs)(r.t,{show:f,size:`md`,className:`articles-modal`,centered:!0,onHide:()=>p(!1),children:[(0,s.jsx)(r.t.Header,{children:(0,s.jsx)(r.t.Title,{children:`Scoreboard Settings`})}),(0,s.jsx)(r.t.Body,{children:(0,s.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center`,onClick:()=>h(!m),children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`i`,{className:`fas fa-trophy-alt`}),(0,s.jsx)(`span`,{children:`Join Scoreboard?`})]}),(0,s.jsx)(c,{checked:m})]})}),(0,s.jsx)(r.t.Footer,{className:`justify-content-between`,children:(0,s.jsx)(n.t,{variant:`articles`,onClick:()=>{p(!1)},children:`Close`})})]}),(0,s.jsx)(`div`,{className:`prepend-container`,children:l}),(0,s.jsxs)(`div`,{className:`card card-articles card-sm mb-3 mb-lg-0`,children:[(0,s.jsxs)(`div`,{className:`card-header d-flex justify-content-between align-items-center`,children:[(0,s.jsxs)(`span`,{children:[e,` Scoreboard`]}),(0,s.jsx)(n.t,{onClick:()=>{v()},small:!0,children:(0,s.jsx)(`i`,{className:`fad fa-redo me-0`})})]}),(0,s.jsxs)(`div`,{className:`card-body p-0`,children:[(g?.length||0)==0&&(0,s.jsx)(`div`,{className:`small p-2`,children:`No scores yet`}),g?.map((e,t)=>(0,s.jsxs)(`div`,{className:`result d-flex flex-column justify-content-between border-bottom p-2`,children:[(0,s.jsxs)(`div`,{className:`d-flex justify-content-between lh-sm`,children:[(0,s.jsxs)(`div`,{className:`d-flex`,children:[(0,s.jsx)(`h5`,{className:`mb-0 me-3`,children:t+1}),(0,s.jsx)(`div`,{className:`lh-sm`,children:(0,s.jsx)(i.t,{populated_user:e.populated_user,user_id:e.user_id})})]}),(0,s.jsx)(`div`,{children:(0,s.jsx)(`h5`,{className:`mb-0`,children:e.score||e.total})})]}),e.last_play&&e.public_last_play&&(0,s.jsxs)(`small`,{className:`mt-1`,style:{fontSize:`0.75rem`},children:[`Played: `,format(new Date(e.last_play),`MM/d/yy hh:mmaa`)]})]},e._id))]}),(0,s.jsxs)(`div`,{className:`card-footer d-flex justify-content-between align-items-center`,children:[(0,s.jsx)(`div`,{className:`small`,children:`Play to get on the board!`}),(0,s.jsx)(n.t,{small:!0,onClick:()=>{p(!0)},children:(0,s.jsx)(`i`,{className:`fad fa-cog me-0`})})]})]}),(0,s.jsx)(`div`,{className:`append-container`,children:u})]})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
@@ -1 +1 @@
1
- "use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),l=require("react"),i=require("./Modal-Wmqy9fOm.cjs"),E=require("./ViewUserModal.cjs"),m=require("./Button-0ZK0NKiK.cjs"),d=require("./index-Ddv_TnxK.cjs");function R({setChecked:s,checked:t,readOnly:a}){return e.jsxRuntimeExports.jsxs("label",{className:`articles-switch mb-0 ${t&&"checked"}`,children:[e.jsxRuntimeExports.jsx("input",{type:"checkbox",readOnly:!!a,checked:t,onChange:()=>{}}),e.jsxRuntimeExports.jsx("span",{onClick:n=>{if(s){s(!t);return}else{n.preventDefault();return}},className:"slider"})]})}const b=async s=>{if(process.env.NODE_ENV==="development")try{return(await d.axios.get("http://localhost:3001/api/community/games/scoreboard",{params:{game:s.game}})).data}catch{}return d.axios.get(s.url,{params:{game:s.game}}).then(t=>t.data)},N={dedupingInterval:1e3*60*30,refreshInterval:0,revalidateOnFocus:!1,revalidateIfStale:!1,shouldRetryOnError:!1},v=s=>{const{data:t,error:a,isLoading:n,isValidating:o,mutate:c}=d.useSWR(s?.game?{url:"https://articles.media/api/community/games/scoreboard",game:s.game}:null,b,N);return{data:t,error:a,isLoading:n,isValidating:o,mutate:c}};function y({game:s,reloadScoreboard:t,setReloadScoreboard:a,prepend:n,append:o}){const[c,x]=l.useState(!1),[u,h]=l.useState(!1),{data:j,mutate:p}=v({game:s});return l.useEffect(()=>{},[]),l.useEffect(()=>{t&&(a(!1),p())},[t]),e.jsxRuntimeExports.jsxs("div",{className:"scoreboard",children:[e.jsxRuntimeExports.jsxs(i.Modal,{show:c,size:"md",className:"articles-modal",centered:!0,onHide:()=>x(!1),children:[e.jsxRuntimeExports.jsx(i.Modal.Header,{children:e.jsxRuntimeExports.jsx(i.Modal.Title,{children:"Scoreboard Settings"})}),e.jsxRuntimeExports.jsx(i.Modal.Body,{children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between align-items-center",onClick:()=>h(!u),children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-trophy-alt"}),e.jsxRuntimeExports.jsx("span",{children:"Join Scoreboard?"})]}),e.jsxRuntimeExports.jsx(R,{checked:u})]})}),e.jsxRuntimeExports.jsx(i.Modal.Footer,{className:"justify-content-between",children:e.jsxRuntimeExports.jsx(m.ArticlesButton,{variant:"articles",onClick:()=>{x(!1)},children:"Close"})})]}),e.jsxRuntimeExports.jsx("div",{className:"prepend-container",children:n}),e.jsxRuntimeExports.jsxs("div",{className:"card card-articles card-sm mb-3 mb-lg-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"card-header d-flex justify-content-between align-items-center",children:[e.jsxRuntimeExports.jsxs("span",{children:[s," Scoreboard"]}),e.jsxRuntimeExports.jsx(m.ArticlesButton,{onClick:()=>{p()},small:!0,children:e.jsxRuntimeExports.jsx("i",{className:"fad fa-redo me-0"})})]}),e.jsxRuntimeExports.jsxs("div",{className:"card-body p-0",children:[(j?.length||0)==0&&e.jsxRuntimeExports.jsx("div",{className:"small p-2",children:"No scores yet"}),j?.map((r,f)=>e.jsxRuntimeExports.jsxs("div",{className:"result d-flex flex-column justify-content-between border-bottom p-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between lh-sm",children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex",children:[e.jsxRuntimeExports.jsx("h5",{className:"mb-0 me-3",children:f+1}),e.jsxRuntimeExports.jsx("div",{className:"lh-sm",children:e.jsxRuntimeExports.jsx(E,{populated_user:r.populated_user,user_id:r.user_id})})]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("h5",{className:"mb-0",children:r.score||r.total})})]}),r.last_play&&r.public_last_play&&e.jsxRuntimeExports.jsxs("small",{className:"mt-1",style:{fontSize:"0.75rem"},children:["Played: ",format(new Date(r.last_play),"MM/d/yy hh:mmaa")]})]},r._id))]}),e.jsxRuntimeExports.jsxs("div",{className:"card-footer d-flex justify-content-between align-items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"small",children:"Play to get on the board!"}),e.jsxRuntimeExports.jsx(m.ArticlesButton,{small:!0,onClick:()=>{x(!0)},children:e.jsxRuntimeExports.jsx("i",{className:"fad fa-cog me-0"})})]})]}),e.jsxRuntimeExports.jsx("div",{className:"append-container",children:o})]})}module.exports=y;
1
+ const e=require(`./GameScoreboard-DdOCRxON.cjs`);module.exports=e.t;
@@ -1,190 +1,2 @@
1
- import { j as e } from "./jsx-runtime-tc70JA_2.js";
2
- import { useState as f, useEffect as x } from "react";
3
- import { M as i } from "./Modal-C9oYRgI1.js";
4
- import N from "./ViewUserModal.js";
5
- import { A as o } from "./Button-_Quon8UV.js";
6
- import { u as v, a as j } from "./index-DLYx67wi.js";
7
- function y({
8
- setChecked: s,
9
- checked: a,
10
- readOnly: r
11
- }) {
12
- return /* @__PURE__ */ e.jsxs("label", { className: `articles-switch mb-0 ${a && "checked"}`, children: [
13
- /* @__PURE__ */ e.jsx(
14
- "input",
15
- {
16
- type: "checkbox",
17
- readOnly: !!r,
18
- checked: a,
19
- onChange: () => {
20
- }
21
- }
22
- ),
23
- /* @__PURE__ */ e.jsx(
24
- "span",
25
- {
26
- onClick: (l) => {
27
- if (s) {
28
- s(!a);
29
- return;
30
- } else {
31
- l.preventDefault();
32
- return;
33
- }
34
- },
35
- className: "slider"
36
- }
37
- )
38
- ] });
39
- }
40
- const g = async (s) => {
41
- if (process.env.NODE_ENV === "development")
42
- try {
43
- return (await j.get("http://localhost:3001/api/community/games/scoreboard", {
44
- params: {
45
- game: s.game
46
- }
47
- })).data;
48
- } catch {
49
- }
50
- return j.get(s.url, {
51
- params: {
52
- game: s.game
53
- }
54
- }).then((a) => a.data);
55
- }, w = {
56
- dedupingInterval: 1e3 * 60 * 30,
57
- refreshInterval: 0,
58
- revalidateOnFocus: !1,
59
- revalidateIfStale: !1,
60
- shouldRetryOnError: !1
61
- // fallbackData: []
62
- }, S = (s) => {
63
- const { data: a, error: r, isLoading: l, isValidating: n, mutate: c } = v(
64
- s?.game ? {
65
- // url: "/api/community/games/scoreboard",
66
- url: "https://articles.media/api/community/games/scoreboard",
67
- game: s.game
68
- } : null,
69
- g,
70
- w
71
- );
72
- return {
73
- data: a,
74
- error: r,
75
- isLoading: l,
76
- isValidating: n,
77
- mutate: c
78
- };
79
- };
80
- function V({
81
- game: s,
82
- reloadScoreboard: a,
83
- setReloadScoreboard: r,
84
- prepend: l,
85
- append: n
86
- }) {
87
- const [c, d] = f(!1), [m, p] = f(!1), {
88
- data: h,
89
- mutate: u
90
- } = S({
91
- game: s
92
- });
93
- return x(() => {
94
- }, []), x(() => {
95
- a && (r(!1), u());
96
- }, [a]), /* @__PURE__ */ e.jsxs("div", { className: "scoreboard", children: [
97
- /* @__PURE__ */ e.jsxs(i, { show: c, size: "md", className: "articles-modal", centered: !0, onHide: () => d(!1), children: [
98
- /* @__PURE__ */ e.jsx(i.Header, { children: /* @__PURE__ */ e.jsx(i.Title, { children: "Scoreboard Settings" }) }),
99
- /* @__PURE__ */ e.jsx(i.Body, { children: /* @__PURE__ */ e.jsxs(
100
- "div",
101
- {
102
- className: "d-flex justify-content-between align-items-center",
103
- onClick: () => p(!m),
104
- children: [
105
- /* @__PURE__ */ e.jsxs("div", { children: [
106
- /* @__PURE__ */ e.jsx("i", { className: "fas fa-trophy-alt" }),
107
- /* @__PURE__ */ e.jsx("span", { children: "Join Scoreboard?" })
108
- ] }),
109
- /* @__PURE__ */ e.jsx(
110
- y,
111
- {
112
- checked: m
113
- }
114
- )
115
- ]
116
- }
117
- ) }),
118
- /* @__PURE__ */ e.jsx(i.Footer, { className: "justify-content-between", children: /* @__PURE__ */ e.jsx(
119
- o,
120
- {
121
- variant: "articles",
122
- onClick: () => {
123
- d(!1);
124
- },
125
- children: "Close"
126
- }
127
- ) })
128
- ] }),
129
- /* @__PURE__ */ e.jsx("div", { className: "prepend-container", children: l }),
130
- /* @__PURE__ */ e.jsxs("div", { className: "card card-articles card-sm mb-3 mb-lg-0", children: [
131
- /* @__PURE__ */ e.jsxs("div", { className: "card-header d-flex justify-content-between align-items-center", children: [
132
- /* @__PURE__ */ e.jsxs("span", { children: [
133
- s,
134
- " Scoreboard"
135
- ] }),
136
- /* @__PURE__ */ e.jsx(
137
- o,
138
- {
139
- onClick: () => {
140
- u();
141
- },
142
- small: !0,
143
- children: /* @__PURE__ */ e.jsx("i", { className: "fad fa-redo me-0" })
144
- }
145
- )
146
- ] }),
147
- /* @__PURE__ */ e.jsxs("div", { className: "card-body p-0", children: [
148
- (h?.length || 0) == 0 && /* @__PURE__ */ e.jsx("div", { className: "small p-2", children: "No scores yet" }),
149
- h?.map(
150
- (t, b) => /* @__PURE__ */ e.jsxs("div", { className: "result d-flex flex-column justify-content-between border-bottom p-2", children: [
151
- /* @__PURE__ */ e.jsxs("div", { className: "d-flex justify-content-between lh-sm", children: [
152
- /* @__PURE__ */ e.jsxs("div", { className: "d-flex", children: [
153
- /* @__PURE__ */ e.jsx("h5", { className: "mb-0 me-3", children: b + 1 }),
154
- /* @__PURE__ */ e.jsx("div", { className: "lh-sm", children: /* @__PURE__ */ e.jsx(
155
- N,
156
- {
157
- populated_user: t.populated_user,
158
- user_id: t.user_id
159
- }
160
- ) })
161
- ] }),
162
- /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("h5", { className: "mb-0", children: t.score || t.total }) })
163
- ] }),
164
- t.last_play && t.public_last_play && /* @__PURE__ */ e.jsxs("small", { className: "mt-1", style: { fontSize: "0.75rem" }, children: [
165
- "Played: ",
166
- format(new Date(t.last_play), "MM/d/yy hh:mmaa")
167
- ] })
168
- ] }, t._id)
169
- )
170
- ] }),
171
- /* @__PURE__ */ e.jsxs("div", { className: "card-footer d-flex justify-content-between align-items-center", children: [
172
- /* @__PURE__ */ e.jsx("div", { className: "small", children: "Play to get on the board!" }),
173
- /* @__PURE__ */ e.jsx(
174
- o,
175
- {
176
- small: !0,
177
- onClick: () => {
178
- d(!0);
179
- },
180
- children: /* @__PURE__ */ e.jsx("i", { className: "fad fa-cog me-0" })
181
- }
182
- )
183
- ] })
184
- ] }),
185
- /* @__PURE__ */ e.jsx("div", { className: "append-container", children: n })
186
- ] });
187
- }
188
- export {
189
- V as default
190
- };
1
+ import { t as e } from "./GameScoreboard-CBY3JsFa.js";
2
+ export { e as default };
@@ -1 +1,33 @@
1
- "use strict";require("./jsx-runtime-nZSsnGb7.cjs");const e=require("./GlobalBody-BQ2qC81K.cjs");require("./index-BlP2-uOi.cjs");require("react");module.exports=e.GlobalBody_default;
1
+ "use client";const e=require(`./chunk-350yNsax.cjs`),t=require(`./classnames-pS64X3rL.cjs`),n=require(`./jsx-runtime-hCcDh67y.cjs`),r=require(`./useAuthSiteStatus-P5kHc_Bz.cjs`);let i=require(`react`);i=e.n(i);var a=e.n(t.t(),1),o=n.t(),s=(0,i.lazy)(()=>Promise.resolve().then(()=>require(`./StatusModal-D7WDDR9P.cjs`)));function c(e){let[t,n]=(0,i.useState)(!1),{data:c,error:l,isLoading:u,mutate:d}=r.n({disable:process.env.NODE_ENV!==`development`}),{data:f,error:p,isLoading:m,mutate:h}=r.t({disable:process.env.NODE_ENV!==`development`});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`link`,{rel:`stylesheet`,href:`https://cdn.articles.media/fonts/fontawesome/css/all.min.css`}),process.env.NODE_ENV===`development`&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`style`,{children:`
2
+ @keyframes grow-shrink {
3
+ 0% { transform: translateY(-50px); }
4
+ 50% { transform: translateY(0px); }
5
+ 100% { transform: translateY(-50px); }
6
+ }
7
+ .articles-global-body {
8
+ transform: translateY(-40px);
9
+ z-index: 1055!important;
10
+ position: absolute;
11
+ top: 0;
12
+ left: 0;
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ width: 50px;
17
+ height: 50px;
18
+ margin: 0;
19
+ padding: 0;
20
+ background-color: yellow;
21
+ color: #FFFFFF;
22
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
23
+ animation: grow-shrink 2s ease-in;
24
+ border: 4px solid red;
25
+ cursor: pointer;
26
+ }
27
+ .articles-global-body.main-connected {
28
+ background-color: green;
29
+ }
30
+ .articles-global-body.auth-connected {
31
+ border-color: blue;
32
+ }
33
+ `}),(0,o.jsx)(`div`,{onClick:()=>{n(!0)},className:(0,a.default)(`articles-global-body`,{"main-connected":c,"auth-connected":f}),children:(0,o.jsx)(`div`,{className:`content`,children:(0,o.jsx)(`i`,{className:`fas fa-thumbs-up`})})}),t&&(0,o.jsx)(i.Suspense,{children:(0,o.jsx)(s,{show:t,setShow:n})})]})]})}var l=(0,i.memo)(c);module.exports=l;
@@ -1,7 +1,36 @@
1
- import "./jsx-runtime-tc70JA_2.js";
2
- import { G as i } from "./GlobalBody-tmIC_GWn.js";
3
- import "./index-YnD2EP-S.js";
4
- import "react";
5
- export {
6
- i as default
7
- };
1
+ "use client";
2
+ import { r as e, t } from "./jsx-runtime-VZk6y-ec.js";
3
+ import { t as n } from "./classnames-DP6dWde5.js";
4
+ import { n as r, t as i } from "./useAuthSiteStatus-1rHjYC4N.js";
5
+ import { Suspense as a, lazy as o, memo as s, useState as c } from "react";
6
+ //#region src/components/Global/GlobalBody.jsx
7
+ var l = /* @__PURE__ */ e(n(), 1), u = t(), d = o(() => import("./StatusModal-elrPJvX1.js"));
8
+ function f(e) {
9
+ let [t, n] = c(!1), { data: o, error: s, isLoading: f, mutate: p } = r({ disable: process.env.NODE_ENV !== "development" }), { data: m, error: h, isLoading: g, mutate: _ } = i({ disable: process.env.NODE_ENV !== "development" });
10
+ return /* @__PURE__ */ (0, u.jsxs)(u.Fragment, { children: [/* @__PURE__ */ (0, u.jsx)("link", {
11
+ rel: "stylesheet",
12
+ href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
13
+ }), process.env.NODE_ENV === "development" && /* @__PURE__ */ (0, u.jsxs)(u.Fragment, { children: [
14
+ /* @__PURE__ */ (0, u.jsx)("style", { children: " \n @keyframes grow-shrink {\n 0% { transform: translateY(-50px); }\n 50% { transform: translateY(0px); }\n 100% { transform: translateY(-50px); }\n }\n .articles-global-body {\n transform: translateY(-40px);\n z-index: 1055!important;\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 50px;\n height: 50px;\n margin: 0;\n padding: 0;\n background-color: yellow;\n color: #FFFFFF;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n animation: grow-shrink 2s ease-in;\n border: 4px solid red;\n cursor: pointer;\n }\n .articles-global-body.main-connected {\n background-color: green;\n }\n .articles-global-body.auth-connected {\n border-color: blue;\n } \n " }),
15
+ /* @__PURE__ */ (0, u.jsx)("div", {
16
+ onClick: () => {
17
+ n(!0);
18
+ },
19
+ className: (0, l.default)("articles-global-body", {
20
+ "main-connected": o,
21
+ "auth-connected": m
22
+ }),
23
+ children: /* @__PURE__ */ (0, u.jsx)("div", {
24
+ className: "content",
25
+ children: /* @__PURE__ */ (0, u.jsx)("i", { className: "fas fa-thumbs-up" })
26
+ })
27
+ }),
28
+ t && /* @__PURE__ */ (0, u.jsx)(a, { children: /* @__PURE__ */ (0, u.jsx)(d, {
29
+ show: t,
30
+ setShow: n
31
+ }) })
32
+ ] })] });
33
+ }
34
+ var p = s(f);
35
+ //#endregion
36
+ export { p as default };
@@ -1 +1 @@
1
- "use strict";const s=require("./jsx-runtime-nZSsnGb7.cjs");function e(){return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:s.jsxRuntimeExports.jsx("link",{rel:"stylesheet",href:"https://cdn.articles.media/fonts/fontawesome/css/all.min.css"})})}module.exports=e;
1
+ var e=require(`./jsx-runtime-hCcDh67y.cjs`).t();function t(){return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(`link`,{rel:`stylesheet`,href:`https://cdn.articles.media/fonts/fontawesome/css/all.min.css`})})}module.exports=t;
@@ -1,13 +1,11 @@
1
- import { j as e } from "./jsx-runtime-tc70JA_2.js";
2
- function t() {
3
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
4
- "link",
5
- {
6
- rel: "stylesheet",
7
- href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
8
- }
9
- ) });
1
+ import { t as e } from "./jsx-runtime-VZk6y-ec.js";
2
+ //#region src/components/Global/GlobalHead.jsx
3
+ var t = e();
4
+ function n() {
5
+ return /* @__PURE__ */ (0, t.jsx)(t.Fragment, { children: /* @__PURE__ */ (0, t.jsx)("link", {
6
+ rel: "stylesheet",
7
+ href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
8
+ }) });
10
9
  }
11
- export {
12
- t as default
13
- };
10
+ //#endregion
11
+ export { n as default };
@@ -0,0 +1,17 @@
1
+ import { t as e } from "./jsx-runtime-VZk6y-ec.js";
2
+ //#region src/components/UI/Link.jsx
3
+ var t = e();
4
+ function n(e) {
5
+ let { href: n, children: r, newPage: i, ...a } = e;
6
+ return /* @__PURE__ */ (0, t.jsx)("a", {
7
+ href: n,
8
+ ...a,
9
+ ...i && {
10
+ target: "_blank",
11
+ rel: "noopener noreferrer"
12
+ },
13
+ children: r
14
+ });
15
+ }
16
+ //#endregion
17
+ export { n as t };
@@ -0,0 +1 @@
1
+ var e=require(`./jsx-runtime-hCcDh67y.cjs`).t();function t(t){let{href:n,children:r,newPage:i,...a}=t;return(0,e.jsx)(`a`,{href:n,...a,...i&&{target:`_blank`,rel:`noopener noreferrer`},children:r})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});