@articles-media/articles-dev-box 1.0.17 → 1.0.23

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 (69) hide show
  1. package/README.md +6 -5
  2. package/dist/Ad-Ck5UdTq3.js +387 -0
  3. package/dist/Ad.js +2 -604
  4. package/dist/AdConfirmExitModal-CJ-HtcVC.js +56 -0
  5. package/dist/AdDetailsModal-DRNRTL2W.js +108 -0
  6. package/dist/ArticlesAd.js +16 -15
  7. package/dist/Button-BlAdEbSd.js +30 -0
  8. package/dist/CreditsModal.js +56 -0
  9. package/dist/DarkModeHandler.js +17 -16
  10. package/dist/FriendsList.js +77 -121
  11. package/dist/GameScoreboard-CBY3JsFa.js +165 -0
  12. package/dist/GameScoreboard.js +2 -190
  13. package/dist/GlobalBody.js +36 -7
  14. package/dist/GlobalHead.js +10 -12
  15. package/dist/Link-MFZblBb4.js +17 -0
  16. package/dist/Modal-BX1s6CCU.js +1631 -0
  17. package/dist/ReturnToLauncherButton.js +39 -54
  18. package/dist/SettingsModal-XI2dMI09.js +247 -0
  19. package/dist/SettingsModal.js +2 -658
  20. package/dist/StatusModal-elrPJvX1.js +70 -0
  21. package/dist/ViewUserModal-DDjWLpyM.js +3094 -0
  22. package/dist/ViewUserModal.js +3 -3149
  23. package/dist/articles-dev-box.css +2 -1
  24. package/dist/classnames-DP6dWde5.js +31 -0
  25. package/dist/index.js +16 -28
  26. package/dist/jsx-runtime-VZk6y-ec.js +191 -0
  27. package/dist/numberWithCommas-BSKBdR-e.js +18 -0
  28. package/dist/useAuthSiteStatus-1rHjYC4N.js +29 -0
  29. package/dist/useFullscreen.js +24 -0
  30. package/dist/useUserDetails.js +22 -32
  31. package/dist/useUserFriends.js +29 -51
  32. package/dist/useUserToken.js +16 -21
  33. package/package.json +26 -67
  34. package/dist/Ad.cjs +0 -1
  35. package/dist/AdConfirmExitModal-Bhz-lt9w.js +0 -72
  36. package/dist/AdConfirmExitModal-N3Lvhb4y.cjs +0 -1
  37. package/dist/AdDetailsModal-BMj8DjV0.cjs +0 -1
  38. package/dist/AdDetailsModal-DXvfmyKK.js +0 -83
  39. package/dist/ArticlesAd.cjs +0 -1
  40. package/dist/Button-0ZK0NKiK.cjs +0 -1
  41. package/dist/Button-_Quon8UV.js +0 -54
  42. package/dist/DarkModeHandler.cjs +0 -1
  43. package/dist/ElementChildren-DN3RWY2E.js +0 -51
  44. package/dist/ElementChildren-eAwIENLl.cjs +0 -1
  45. package/dist/FriendsList.cjs +0 -1
  46. package/dist/GameScoreboard.cjs +0 -1
  47. package/dist/GlobalBody-BrrtfBBs.js +0 -123
  48. package/dist/GlobalBody-weON_TbJ.cjs +0 -33
  49. package/dist/GlobalBody.cjs +0 -1
  50. package/dist/GlobalHead.cjs +0 -1
  51. package/dist/Modal-Bdhkgkwr.cjs +0 -2
  52. package/dist/Modal-nux8R77F.js +0 -2087
  53. package/dist/ReturnToLauncherButton.cjs +0 -1
  54. package/dist/SettingsModal.cjs +0 -1
  55. package/dist/StatusModal-B086BgSW.js +0 -71
  56. package/dist/StatusModal-CzPyqQQA.cjs +0 -1
  57. package/dist/ViewUserModal.cjs +0 -1
  58. package/dist/index-BlP2-uOi.cjs +0 -1
  59. package/dist/index-C8MeSLnR.js +0 -2504
  60. package/dist/index-DWV8myok.cjs +0 -6
  61. package/dist/index-YnD2EP-S.js +0 -43
  62. package/dist/index.cjs +0 -1
  63. package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
  64. package/dist/jsx-runtime-tc70JA_2.js +0 -264
  65. package/dist/numberWithCommas-CRgrb58X.cjs +0 -1
  66. package/dist/numberWithCommas-DnAkiOFL.js +0 -1256
  67. package/dist/useUserDetails.cjs +0 -1
  68. package/dist/useUserFriends.cjs +0 -1
  69. package/dist/useUserToken.cjs +0 -1
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@articles-media/articles-dev-box",
3
3
  "description": "Shared code, functions, and components for different Articles Media projects.",
4
- "version": "1.0.17",
4
+ "version": "1.0.23",
5
5
  "type": "module",
6
6
  "imports": {
7
7
  "#root/src/*": "./src/*"
8
8
  },
9
- "main": "./dist/index.cjs",
9
+ "main": "./dist/index.js",
10
10
  "module": "./dist/index.js",
11
11
  "files": [
12
12
  "dist"
@@ -16,62 +16,22 @@
16
16
  "url": "git+https://github.com/Articles-Joey/articles-dev-box.git"
17
17
  },
18
18
  "exports": {
19
- ".": {
20
- "import": "./dist/index.js",
21
- "require": "./dist/index.cjs"
22
- },
23
- "./Ad": {
24
- "import": "./dist/Ad.js",
25
- "require": "./dist/Ad.cjs"
26
- },
27
- "./ArticlesAd": {
28
- "import": "./dist/ArticlesAd.js",
29
- "require": "./dist/ArticlesAd.cjs"
30
- },
31
- "./GameScoreboard": {
32
- "import": "./dist/GameScoreboard.js",
33
- "require": "./dist/GameScoreboard.cjs"
34
- },
35
- "./ReturnToLauncherButton": {
36
- "import": "./dist/ReturnToLauncherButton.js",
37
- "require": "./dist/ReturnToLauncherButton.cjs"
38
- },
39
- "./GlobalHead": {
40
- "import": "./dist/GlobalHead.js",
41
- "require": "./dist/GlobalHead.cjs"
42
- },
43
- "./GlobalBody": {
44
- "import": "./dist/GlobalBody.js",
45
- "require": "./dist/GlobalBody.cjs"
46
- },
47
- "./ViewUserModal": {
48
- "import": "./dist/ViewUserModal.js",
49
- "require": "./dist/ViewUserModal.cjs"
50
- },
51
- "./SettingsModal": {
52
- "import": "./dist/SettingsModal.js",
53
- "require": "./dist/SettingsModal.cjs"
54
- },
55
- "./DarkModeHandler": {
56
- "import": "./dist/DarkModeHandler.js",
57
- "require": "./dist/DarkModeHandler.cjs"
58
- },
59
- "./FriendsList": {
60
- "import": "./dist/FriendsList.js",
61
- "require": "./dist/FriendsList.cjs"
62
- },
63
- "./useUserDetails": {
64
- "import": "./dist/useUserDetails.js",
65
- "require": "./dist/useUserDetails.cjs"
66
- },
67
- "./useUserToken": {
68
- "import": "./dist/useUserToken.js",
69
- "require": "./dist/useUserToken.cjs"
70
- },
71
- "./useUserFriends": {
72
- "import": "./dist/useUserFriends.js",
73
- "require": "./dist/useUserFriends.cjs"
74
- },
19
+ ".": "./dist/index.js",
20
+ "./Ad": "./dist/Ad.js",
21
+ "./ArticlesAd": "./dist/ArticlesAd.js",
22
+ "./GameScoreboard": "./dist/GameScoreboard.js",
23
+ "./ReturnToLauncherButton": "./dist/ReturnToLauncherButton.js",
24
+ "./GlobalHead": "./dist/GlobalHead.js",
25
+ "./GlobalBody": "./dist/GlobalBody.js",
26
+ "./ViewUserModal": "./dist/ViewUserModal.js",
27
+ "./SettingsModal": "./dist/SettingsModal.js",
28
+ "./CreditsModal": "./dist/CreditsModal.js",
29
+ "./DarkModeHandler": "./dist/DarkModeHandler.js",
30
+ "./FriendsList": "./dist/FriendsList.js",
31
+ "./useUserDetails": "./dist/useUserDetails.js",
32
+ "./useUserToken": "./dist/useUserToken.js",
33
+ "./useUserFriends": "./dist/useUserFriends.js",
34
+ "./useFullscreen": "./dist/useFullscreen.js",
75
35
  "./dist/style.css": "./dist/articles-dev-box.css",
76
36
  "./dist/articles-dev-box.css": "./dist/articles-dev-box.css"
77
37
  },
@@ -87,20 +47,19 @@
87
47
  "license": "ISC",
88
48
  "peerDependencies": {
89
49
  "react": ">=19.2.3",
90
- "react-dom": ">=19.2.3"
50
+ "react-dom": ">=19.2.3",
51
+ "swr": "^2.0.0",
52
+ "date-fns": "^4.0.0",
53
+ "react-intersection-observer": "^10.0.0",
54
+ "react-bootstrap": "^2.0.0"
91
55
  },
92
56
  "devDependencies": {
93
- "@vitejs/plugin-react": "^5.1.2",
57
+ "@vitejs/plugin-react": "^6.0.1",
94
58
  "classnames": "^2.5.1",
95
59
  "nodemon": "^3.1.11",
96
60
  "react-bootstrap": "^2.10.10",
97
61
  "sass": "^1.97.2",
98
- "vite": "^7.3.1"
62
+ "vite": "^8.0.3"
99
63
  },
100
- "dependencies": {
101
- "axios": "^1.13.2",
102
- "date-fns": "^4.1.0",
103
- "react-intersection-observer": "^10.0.0",
104
- "swr": "^2.3.8"
105
- }
64
+ "dependencies": {}
106
65
  }
package/dist/Ad.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),c=require("react"),v=require("./numberWithCommas-CRgrb58X.cjs"),R=require("./index-DWV8myok.cjs"),Z=require("./Button-0ZK0NKiK.cjs"),ee=require("./index-BlP2-uOi.cjs");function se(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>s[i]})}}return t.default=s,Object.freeze(t)}const A=se(c);var C=new Map,M=new WeakMap,W=0,te;function ne(s){return s?(M.has(s)||(W+=1,M.set(s,W.toString())),M.get(s)):"0"}function re(s){return Object.keys(s).sort().filter(t=>s[t]!==void 0).map(t=>`${t}_${t==="root"?ne(s.root):s[t]}`).toString()}function ie(s){const t=re(s);let i=C.get(t);if(!i){const r=new Map;let l;const u=new IntersectionObserver(x=>{x.forEach(o=>{var p;const N=o.isIntersecting&&l.some(j=>o.intersectionRatio>=j);s.trackVisibility&&typeof o.isVisible>"u"&&(o.isVisible=N),(p=r.get(o.target))==null||p.forEach(j=>{j(N,o)})})},s);l=u.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),i={id:t,observer:u,elements:r},C.set(t,i)}return i}function oe(s,t,i={},r=te){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const p=s.getBoundingClientRect();return t(r,{isIntersecting:r,target:s,intersectionRatio:typeof i.threshold=="number"?i.threshold:0,time:0,boundingClientRect:p,intersectionRect:p,rootBounds:p}),()=>{}}const{id:l,observer:u,elements:x}=ie(i),o=x.get(s)||[];return x.has(s)||x.set(s,o),o.push(t),u.observe(s),function(){o.splice(o.indexOf(t),1),o.length===0&&(x.delete(s),u.unobserve(s)),x.size===0&&(u.disconnect(),C.delete(l))}}function ae({threshold:s,delay:t,trackVisibility:i,rootMargin:r,root:l,triggerOnce:u,skip:x,initialInView:o,fallbackInView:p,onChange:N}={}){var j;const[_,b]=A.useState(null),n=A.useRef(N),a=A.useRef(o),[k,D]=A.useState({inView:!!o,entry:void 0});n.current=N,A.useEffect(()=>{if(a.current===void 0&&(a.current=o),x||!_)return;let g;return g=oe(_,(f,E)=>{const P=a.current;a.current=f,!(P===void 0&&!f)&&(D({inView:f,entry:E}),n.current&&n.current(f,E),E.isIntersecting&&u&&g&&(g(),g=void 0))},{root:l,rootMargin:r,threshold:s,trackVisibility:i,delay:t},p),()=>{g&&g()}},[Array.isArray(s)?s.toString():s,_,l,r,u,x,i,p,t]);const y=(j=k.entry)==null?void 0:j.target,S=A.useRef(void 0);!_&&y&&!u&&!x&&S.current!==y&&(S.current=y,D({inView:!!o,entry:void 0}),a.current=o);const m=[b,k.inView,k.entry];return m.ref=m[0],m.inView=m[1],m.entry=m[2],m}const ce=async s=>{if(process.env.NODE_ENV==="development")try{return(await R.axios.get(`http://localhost:3001/api/ads/${s.ad_id}`,{params:{ad_id:s.ad_id,user_ad_token:s.user_ad_token}})).data.result}catch{}return R.axios.get(s.url,{params:{ad_id:s.ad_id}}).then(t=>t.data.result)},le=60,de={dedupingInterval:1e3*60*le},ue=(s,t)=>{const{data:i,error:r,isLoading:l,mutate:u}=R.useSWR(s?{url:`https://articles.media/api/ads/${s}`,ad_id:s,user_ad_token:t}:null,ce,de);return{data:i,error:r,isLoading:l,mutate:u}};function xe(s){return t=>{const r=(s?Math[s]:Math.trunc)(t);return r===0?0:r}}function me(s,t){return+v.toDate(s)-+v.toDate(t)}function z(s,t,i){const r=me(s,t)/v.millisecondsInMinute;return xe(i?.roundingMethod)(r)}function U(s){return Math.trunc(s*v.millisecondsInMinute)}const pe=async s=>{if(process.env.NODE_ENV==="development")try{return(await R.axios.get("http://localhost:3001/api/ads",{params:{}})).data}catch{}return R.axios.get(s.url,{params:{}}).then(t=>t.data)},X=60,je={dedupingInterval:U(X),focusThrottleInterval:U(X)},fe=s=>{const{data:t,error:i,isLoading:r,mutate:l}=R.useSWR(s?.loading||s?.disabled?null:{url:"https://articles.media/api/ads"},pe,je);return{data:t,error:i,isLoading:r,mutate:l}},he=c.lazy(()=>Promise.resolve().then(()=>require("./AdDetailsModal-BMj8DjV0.cjs"))),ve=c.lazy(()=>Promise.resolve().then(()=>require("./AdConfirmExitModal-N3Lvhb4y.cjs")));function ge(s,t){return Math.floor(Math.random()*(t-s+1))+s}function Ee(s){let{previewMode:t,darkMode:i,user_ad_token:r,userDetails:l,userDetailsLoading:u,prepend:x,append:o}=s;const p=!1,N=[],[j,_]=c.useState(null),{data:b}=fe({loading:u,disabled:l?.articles_membership?.status=="Active"}),{data:n}=ue(j,r);let a=s.previewData||{};const[k,D]=c.useState(null),[y,S]=c.useState(null),[m,g]=c.useState(null),[f,E]=c.useState(0),[P,K]=c.useState(!1),[$,L]=c.useState(!1),[F,O]=c.useState(!1),[Ne,be]=c.useState(new Date),[V,G]=c.useState([]);c.useEffect(()=>{b&&b?.length>0&&!j&&(console.log("Ad Mounted or reduxAds changed"),_(s.ad_id||b[ge(0,b?.length-1)]?._id))},[b]),c.useEffect(()=>{},[n]),c.useEffect(()=>{n?.populated_promos&&f>=0&&g(n?.populated_promos[f])},[f,n]);function H(){L(!$)}const{ref:J,inView:w}=ae({threshold:0,triggerOnce:!0});function T(d){if(t&&console.log("Preventing this event from being logged as this ad is being shown in preview mode."),V.find(h=>h==d)){console.log("Already logged this event");return}R.axios.get("/api/ads/event",{params:{ad_id:n?._id,event:d}}).then(function(h){G([...V,d]),console.log(h.data)}).catch(function(h){console.log(h)})}c.useEffect(()=>{if(!t&&(console.log("inView",w),w&&j)){let d=[{ad_id:j,date:new Date().toString()},...N.filter(h=>{if(console.log(z(new Date,new Date(h.date))),z(new Date,new Date(h.date))>5){console.log("adsViewed - Remove Old Ad View Object");return}else return console.log("adsViewed - Keep Ad View Object"),h})];console.log("unexpiredRecentViews",d)}},[w,j]);const[q,Q]=c.useState(null),[Y,I]=c.useState(!1);function B(){I(!0),console.log("logAdAvoided called",r),R.axios.get(process.env.NODE_ENV==="development"?"http://localhost:3001/api/user/advertising/avoided":"https://articles.media/api/user/advertising/avoided",{params:{user_id:l?._id},headers:{"x-articles-api-key":r}}).then(function(d){I(!1),Q(d.data.avoided_count),console.log(d.data)}).catch(function(d){console.log(d),I(!1)})}return c.useEffect(()=>{t||(console.log("inView",w),l?.articles_membership?.status=="Active"&&w&&B())},[w,l]),u?null:e.jsxRuntimeExports.jsxs("div",{ref:J,className:ee.classNames("ad-wrap",{"active-member":l?.articles_membership?.status=="Active"}),style:{"--articles-ad-background-color":a.background_color||n?.background_color,"--articles-ad-font-color":a.font_color||n?.font_color,"--articles-ad-border-color":a.border_color||n?.border_color},children:[$&&e.jsxRuntimeExports.jsx(he,{setModalShow:L,ad:n,previewData:a}),F&&e.jsxRuntimeExports.jsx(ve,{setModalShow:O,ad:n,previewData:a}),x&&e.jsxRuntimeExports.jsx("div",{className:"prepend-container",children:x}),e.jsxRuntimeExports.jsxs("div",{className:"ad",children:[l?.articles_membership?.status!=="Active"&&e.jsxRuntimeExports.jsxs("div",{className:"main-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"ad-warning flex-header",children:e.jsxRuntimeExports.jsxs("div",{className:"",children:[n?.city&&"Local"," Advertisement"]})}),e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo",children:(a.logo?.location||n?.logo?.location)&&e.jsxRuntimeExports.jsx("img",{src:a?.logo?.key?`${process.env.NEXT_PUBLIC_CDN}${a?.logo?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.logo?.key}`,alt:""})}),e.jsxRuntimeExports.jsx("div",{className:"icon d-none",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-mug-hot"})}),e.jsxRuntimeExports.jsx("img",{className:"photo",src:a?.background?.key?`${process.env.NEXT_PUBLIC_CDN}${a.background?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.background?.key}`,alt:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail-title",children:[e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:a?.business||n?.business})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-column d-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-search-location"})}),e.jsxRuntimeExports.jsxs("span",{children:[n?.city,", ",n?.state]})]}),e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-clock me-2"})}),e.jsxRuntimeExports.jsx("span",{children:"6:30AM–8PM"})]})]})]}),n?.city&&e.jsxRuntimeExports.jsx("div",{className:"details mb-3 d-none"}),e.jsxRuntimeExports.jsx("div",{className:"short-description",children:a?.description||n?.description})]})]}),p?.roles?.isDev&&n?.populated_promos?.length>0&&e.jsxRuntimeExports.jsxs("div",{children:[m&&e.jsxRuntimeExports.jsx("div",{className:"promos-wrap",children:m&&e.jsxRuntimeExports.jsxs("div",{className:"promo-wrap d-flex justify-content-between align-items-center mx-2 p-1 px-2 border border-2 border-light mb-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"",children:[e.jsxRuntimeExports.jsx("div",{children:m.title}),e.jsxRuntimeExports.jsx("div",{className:"small",children:e.jsxRuntimeExports.jsx("div",{className:"small",children:m.details})})]}),e.jsxRuntimeExports.jsx(Z.ArticlesButton,{className:"px-3",small:!0,onClick:()=>{console.log("Load Save Modal"),K(!0)},children:"Save"})]},m._id)}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsxRuntimeExports.jsxs("div",{className:"px-2",children:[n?.populated_promos?.length," Promos Active"]}),e.jsxRuntimeExports.jsxs("div",{className:"controls",children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-left",type:"button",onClick:()=>{f==0?E(n?.populated_promos?.length-1):E(d=>d-1)}}),n?.populated_promos?.map((d,h)=>e.jsxRuntimeExports.jsx("i",{className:`fa-square ${h==f?"fad":"fas"}`},d._id)),e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-right",type:"button",onClick:()=>{f==n?.populated_promos?.length-1?E(0):E(d=>d+1)}})]})]})]}),e.jsxRuntimeExports.jsx("hr",{style:{borderColor:"white"},className:"mt-auto mb-0"}),e.jsxRuntimeExports.jsxs("div",{className:"action-wrap d-flex justify-content-lg-between px-3 py-2",children:[e.jsxRuntimeExports.jsx("div",{onClick:()=>{H(),T("Details")},className:"action flex-grow-1 flex-shrink-0",children:"Details"}),e.jsxRuntimeExports.jsx("span",{className:"px-4"}),e.jsxRuntimeExports.jsx("a",{className:"action flex-grow-1 flex-shrink-0",href:n?.website,target:"_blank",rel:"noreferrer",onClick:d=>{d.preventDefault(),O(!0),T("Confirm Exit Modal Opened")},children:e.jsxRuntimeExports.jsx("div",{children:"Website"})})]})]}),l?.articles_membership?.status=="Active"&&e.jsxRuntimeExports.jsx("div",{className:"main-panel",children:e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo"}),e.jsxRuntimeExports.jsxs("div",{className:"splash",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-broadcast-tower"}),e.jsxRuntimeExports.jsxs("div",{className:"text",children:[e.jsxRuntimeExports.jsx("div",{className:"count",children:Y?e.jsxRuntimeExports.jsx("i",{className:"fas fa-spinner fa-spin me-0"}):q?v.numberWithCommas(q):0}),e.jsxRuntimeExports.jsx("div",{className:"label",children:"ads avoided."})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"member-since",children:["Member since: ",e.jsxRuntimeExports.jsx(v.ArticlesDate,{format:"PP",date:l?.articles_membership?.membership_started})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsx("div",{className:"detail-title",children:e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:"Thanks for the support!"})})}),e.jsxRuntimeExports.jsxs("div",{className:"short-description",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-2",children:"Without support from users like you, we wouldn't be here."}),e.jsxRuntimeExports.jsxs("div",{className:"links-list",children:[e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/messages",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-comments-alt"}),"0 unread messages."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/notifications",onClick:()=>{B()},children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-bell"}),"0 notifications."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/account",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-cog"}),"Manage account settings."]})]})]})]})]})})]}),o&&e.jsxRuntimeExports.jsx("div",{className:"append-container",children:o}),!t&&e.jsxRuntimeExports.jsx("div",{className:"advertise-with-us p-1",style:{backgroundColor:a.background_color||n?.background_color,color:a.font_color||n?.font_color,borderColor:a.border_color||n?.border_color},children:e.jsxRuntimeExports.jsxs(v.Link,{className:"small d-block w-100 text-center",href:"https://articles.media/advertising",newPage:!0,children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-share me-1"}),"Advertise with Articles Media!"]})})]})}const Re=c.memo(Ee);module.exports=Re;
@@ -1,72 +0,0 @@
1
- import { j as e } from "./jsx-runtime-tc70JA_2.js";
2
- import { useEffect as l } from "react";
3
- import { L as n } from "./numberWithCommas-DnAkiOFL.js";
4
- import { M as s } from "./Modal-nux8R77F.js";
5
- import { A as i } from "./Button-_Quon8UV.js";
6
- function x(t) {
7
- let { setModalShow: r, ad: o, previewData: d } = t;
8
- l(() => {
9
- console.log("Mounted");
10
- }, []);
11
- const a = () => {
12
- r(!1);
13
- };
14
- return /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
15
- s,
16
- {
17
- show: !0,
18
- backdropClassName: "ad-details-modal-backdrop",
19
- className: "articles-modal",
20
- centered: !0,
21
- onHide: a,
22
- size: "md",
23
- children: [
24
- /* @__PURE__ */ e.jsx(s.Header, { className: "align-items-center", closeButton: !0, children: /* @__PURE__ */ e.jsx(s.Title, { children: "Confirm Exit" }) }),
25
- /* @__PURE__ */ e.jsxs(
26
- s.Body,
27
- {
28
- className: "",
29
- children: [
30
- /* @__PURE__ */ e.jsx("div", { className: "ratio ratio-16x9 bg-black mb-2" }),
31
- /* @__PURE__ */ e.jsx("p", { className: "mb-1", children: "This advertiser has been approved and verified to display ads but always be cautious when interacting with ads. Any offsite interactions are at your own risk and should be approached with caution. We can not be held responsible for any issues that may arise." })
32
- ]
33
- }
34
- ),
35
- /* @__PURE__ */ e.jsxs(s.Footer, { className: "d-flex justify-content-between", children: [
36
- /* @__PURE__ */ e.jsxs(
37
- i,
38
- {
39
- variant: "articles",
40
- onClick: a,
41
- children: [
42
- /* @__PURE__ */ e.jsx("i", { className: "fad fa-times" }),
43
- "Close"
44
- ]
45
- }
46
- ),
47
- /* @__PURE__ */ e.jsx(
48
- n,
49
- {
50
- href: o?.website,
51
- newPage: !0,
52
- children: /* @__PURE__ */ e.jsxs(
53
- i,
54
- {
55
- variant: "articles",
56
- onClick: a,
57
- children: [
58
- /* @__PURE__ */ e.jsx("i", { className: "fad fa-link" }),
59
- "Proceed"
60
- ]
61
- }
62
- )
63
- }
64
- )
65
- ] })
66
- ]
67
- }
68
- ) });
69
- }
70
- export {
71
- x as default
72
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.cjs"),n=require("react"),l=require("./numberWithCommas-CRgrb58X.cjs"),s=require("./Modal-Bdhkgkwr.cjs"),i=require("./Button-0ZK0NKiK.cjs");function d(a){let{setModalShow:r,ad:o,previewData:c}=a;n.useEffect(()=>{console.log("Mounted")},[]);const t=()=>{r(!1)};return e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs(s.Modal,{show:!0,backdropClassName:"ad-details-modal-backdrop",className:"articles-modal",centered:!0,onHide:t,size:"md",children:[e.jsxRuntimeExports.jsx(s.Modal.Header,{className:"align-items-center",closeButton:!0,children:e.jsxRuntimeExports.jsx(s.Modal.Title,{children:"Confirm Exit"})}),e.jsxRuntimeExports.jsxs(s.Modal.Body,{className:"",children:[e.jsxRuntimeExports.jsx("div",{className:"ratio ratio-16x9 bg-black mb-2"}),e.jsxRuntimeExports.jsx("p",{className:"mb-1",children:"This advertiser has been approved and verified to display ads but always be cautious when interacting with ads. Any offsite interactions are at your own risk and should be approached with caution. We can not be held responsible for any issues that may arise."})]}),e.jsxRuntimeExports.jsxs(s.Modal.Footer,{className:"d-flex justify-content-between",children:[e.jsxRuntimeExports.jsxs(i.ArticlesButton,{variant:"articles",onClick:t,children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-times"}),"Close"]}),e.jsxRuntimeExports.jsx(l.Link,{href:o?.website,newPage:!0,children:e.jsxRuntimeExports.jsxs(i.ArticlesButton,{variant:"articles",onClick:t,children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-link"}),"Proceed"]})})]})]})})}exports.default=d;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-nZSsnGb7.cjs"),o=require("react"),x=require("./numberWithCommas-CRgrb58X.cjs"),t=require("./Modal-Bdhkgkwr.cjs"),r=require("./Button-0ZK0NKiK.cjs");function d(n){let{setModalShow:a,ad:e,previewData:l}=n;o.useEffect(()=>{console.log("Mounted")},[]);const i=()=>{a(!1)};return s.jsxRuntimeExports.jsx("div",{children:s.jsxRuntimeExports.jsxs(t.Modal,{show:!0,backdropClassName:"ad-details-modal-backdrop",className:"articles-modal",centered:!0,onHide:i,size:"md",children:[s.jsxRuntimeExports.jsx(t.Modal.Header,{className:"align-items-center",closeButton:!0,children:s.jsxRuntimeExports.jsx(t.Modal.Title,{children:"Ad Details"})}),s.jsxRuntimeExports.jsxs(t.Modal.Body,{className:"",children:[s.jsxRuntimeExports.jsxs("p",{className:"mb-1",children:["Advertiser: ",s.jsxRuntimeExports.jsx("b",{children:e?.business})]}),s.jsxRuntimeExports.jsxs("p",{className:"mb-0",children:["Ad ID: ",s.jsxRuntimeExports.jsx("b",{children:l?._id||e._id})]}),s.jsxRuntimeExports.jsx("hr",{}),s.jsxRuntimeExports.jsx("div",{className:"mb-1",children:"This ad is being shown to you for the following reasons"}),e.city?s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("div",{className:"h4 mb-1",children:e.business}),s.jsxRuntimeExports.jsx("div",{children:"Is advertising to all zip codes within a"}),s.jsxRuntimeExports.jsx("span",{children:s.jsxRuntimeExports.jsx("div",{className:"badge bg-black shadow-articles",children:"15 Mile Radius"})}),s.jsxRuntimeExports.jsx("div",{children:"of it's business"}),s.jsxRuntimeExports.jsx("hr",{className:"border w-50 border-white"}),s.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center",children:[s.jsxRuntimeExports.jsx("div",{children:"Your Zip code"}),s.jsxRuntimeExports.jsx("div",{className:"badge bg-black shadow-articles ms-2",children:"00000"}),s.jsxRuntimeExports.jsx("div",{className:"ms-2",children:"is"}),s.jsxRuntimeExports.jsx("div",{className:"badge bg-black shadow-articles ms-2",children:"4.2 miles away"})]})]}):s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsx("div",{className:"h4 mb-1",children:e.business}),s.jsxRuntimeExports.jsx("div",{children:"Is advertising to all users"})]}),s.jsxRuntimeExports.jsx("div",{className:"grow"}),s.jsxRuntimeExports.jsx("hr",{className:"w-100"}),s.jsxRuntimeExports.jsx("div",{className:"reason lh-sm mb-2",children:"Ads we display to you will always be transparent as to why you are seeing them."}),s.jsxRuntimeExports.jsx(x.Link,{href:"https://articles.media/settings/account",newPage:!0,className:"",children:s.jsxRuntimeExports.jsx(r.ArticlesButton,{small:!0,children:"Settings"})})]}),s.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"d-flex justify-content-center",children:s.jsxRuntimeExports.jsx(r.ArticlesButton,{variant:"articles",onClick:i,children:"Close"})})]})})}exports.default=d;
@@ -1,83 +0,0 @@
1
- import { j as s } from "./jsx-runtime-tc70JA_2.js";
2
- import { useEffect as t } from "react";
3
- import { L as n } from "./numberWithCommas-DnAkiOFL.js";
4
- import { M as i } from "./Modal-nux8R77F.js";
5
- import { A as l } from "./Button-_Quon8UV.js";
6
- function b(d) {
7
- let { setModalShow: r, ad: e, previewData: c } = d;
8
- t(() => {
9
- console.log("Mounted");
10
- }, []);
11
- const a = () => {
12
- r(!1);
13
- };
14
- return /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsxs(
15
- i,
16
- {
17
- show: !0,
18
- backdropClassName: "ad-details-modal-backdrop",
19
- className: "articles-modal",
20
- centered: !0,
21
- onHide: a,
22
- size: "md",
23
- children: [
24
- /* @__PURE__ */ s.jsx(i.Header, { className: "align-items-center", closeButton: !0, children: /* @__PURE__ */ s.jsx(i.Title, { children: "Ad Details" }) }),
25
- /* @__PURE__ */ s.jsxs(
26
- i.Body,
27
- {
28
- className: "",
29
- children: [
30
- /* @__PURE__ */ s.jsxs("p", { className: "mb-1", children: [
31
- "Advertiser: ",
32
- /* @__PURE__ */ s.jsx("b", { children: e?.business })
33
- ] }),
34
- /* @__PURE__ */ s.jsxs("p", { className: "mb-0", children: [
35
- "Ad ID: ",
36
- /* @__PURE__ */ s.jsx("b", { children: c?._id || e._id })
37
- ] }),
38
- /* @__PURE__ */ s.jsx("hr", {}),
39
- /* @__PURE__ */ s.jsx("div", { className: "mb-1", children: "This ad is being shown to you for the following reasons" }),
40
- e.city ? /* @__PURE__ */ s.jsxs("div", { children: [
41
- /* @__PURE__ */ s.jsx("div", { className: "h4 mb-1", children: e.business }),
42
- /* @__PURE__ */ s.jsx("div", { children: "Is advertising to all zip codes within a" }),
43
- /* @__PURE__ */ s.jsx("span", { children: /* @__PURE__ */ s.jsx("div", { className: "badge bg-black shadow-articles", children: "15 Mile Radius" }) }),
44
- /* @__PURE__ */ s.jsx("div", { children: "of it's business" }),
45
- /* @__PURE__ */ s.jsx("hr", { className: "border w-50 border-white" }),
46
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center", children: [
47
- /* @__PURE__ */ s.jsx("div", { children: "Your Zip code" }),
48
- /* @__PURE__ */ s.jsx("div", { className: "badge bg-black shadow-articles ms-2", children: "00000" }),
49
- /* @__PURE__ */ s.jsx("div", { className: "ms-2", children: "is" }),
50
- /* @__PURE__ */ s.jsx("div", { className: "badge bg-black shadow-articles ms-2", children: "4.2 miles away" })
51
- ] })
52
- ] }) : /* @__PURE__ */ s.jsxs("div", { children: [
53
- /* @__PURE__ */ s.jsx("div", { className: "h4 mb-1", children: e.business }),
54
- /* @__PURE__ */ s.jsx("div", { children: "Is advertising to all users" })
55
- ] }),
56
- /* @__PURE__ */ s.jsx("div", { className: "grow" }),
57
- /* @__PURE__ */ s.jsx("hr", { className: "w-100" }),
58
- /* @__PURE__ */ s.jsx("div", { className: "reason lh-sm mb-2", children: "Ads we display to you will always be transparent as to why you are seeing them." }),
59
- /* @__PURE__ */ s.jsx(n, { href: "https://articles.media/settings/account", newPage: !0, className: "", children: /* @__PURE__ */ s.jsx(
60
- l,
61
- {
62
- small: !0,
63
- children: "Settings"
64
- }
65
- ) })
66
- ]
67
- }
68
- ),
69
- /* @__PURE__ */ s.jsx(i.Footer, { className: "d-flex justify-content-center", children: /* @__PURE__ */ s.jsx(
70
- l,
71
- {
72
- variant: "articles",
73
- onClick: a,
74
- children: "Close"
75
- }
76
- ) })
77
- ]
78
- }
79
- ) });
80
- }
81
- export {
82
- b as default
83
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("./jsx-runtime-nZSsnGb7.cjs"),s=require("react");function c({darkMode:r}){return s.useEffect(()=>{},[]),s.useEffect(()=>{const e=document.createElement("script");return e.src="https://accounts.articles.media/js/ad.js",e.async=!0,document.body.appendChild(e),()=>{document.body.removeChild(e)}},[]),t.jsxRuntimeExports.jsx("div",{className:"",children:t.jsxRuntimeExports.jsx("div",{className:"articles-media-ad"})})}module.exports=c;
@@ -1 +0,0 @@
1
- "use strict";const N=require("./jsx-runtime-nZSsnGb7.cjs"),R=require("react"),j=require("./index-BlP2-uOi.cjs"),o=R.forwardRef((t,c)=>{const{size:e,variant:s,style:i,small:r,large:a,onClick:l,className:n,disabled:u,active:b,type:m,onMouseDown:d,onMouseUp:x,onMouseLeave:h,onTouchStart:v,onTouchEnd:y,...p}=t;return N.jsxRuntimeExports.jsx("button",{ref:c,...m&&{type:"submit"},disabled:u,style:i,onMouseDown:d,onMouseUp:x,onMouseLeave:h,onTouchStart:v,onTouchEnd:y,className:j.classNames(`btn ${s?`btn-${s}`:"btn-articles"}`,{[n]:n,"btn-lg":a,"btn-sm":r,active:b,[`btn-${e}`]:e}),onClick:l,children:t.children})});o.displayName="ArticlesButton";exports.ArticlesButton=o;
@@ -1,54 +0,0 @@
1
- import { j as v } from "./jsx-runtime-tc70JA_2.js";
2
- import { forwardRef as x } from "react";
3
- import { c as y } from "./index-YnD2EP-S.js";
4
- const N = x((t, n) => {
5
- const {
6
- size: s,
7
- variant: e,
8
- style: a,
9
- // Can just use small instead of size="sm"
10
- small: r,
11
- large: i,
12
- onClick: c,
13
- className: o,
14
- disabled: l,
15
- active: m,
16
- type: u,
17
- onMouseDown: b,
18
- onMouseUp: d,
19
- onMouseLeave: p,
20
- onTouchStart: f,
21
- onTouchEnd: h,
22
- ...j
23
- } = t;
24
- return /* @__PURE__ */ v.jsx(
25
- "button",
26
- {
27
- ref: n,
28
- ...u && { type: "submit" },
29
- disabled: l,
30
- style: a,
31
- onMouseDown: b,
32
- onMouseUp: d,
33
- onMouseLeave: p,
34
- onTouchStart: f,
35
- onTouchEnd: h,
36
- className: y(
37
- `btn ${e ? `btn-${e}` : "btn-articles"}`,
38
- {
39
- [o]: o,
40
- "btn-lg": i,
41
- "btn-sm": r,
42
- active: m,
43
- [`btn-${s}`]: s
44
- }
45
- ),
46
- onClick: c,
47
- children: t.children
48
- }
49
- );
50
- });
51
- N.displayName = "ArticlesButton";
52
- export {
53
- N as A
54
- };
@@ -1 +0,0 @@
1
- "use strict";const a=require("./jsx-runtime-nZSsnGb7.cjs"),d=require("react");function n({useStore:t}){const r=t(e=>e.darkMode),s=t(e=>e._hasHydrated);return d.useEffect(()=>{if(s){if(r==null){const e=window.matchMedia("(prefers-color-scheme: dark)").matches;t.getState().setDarkMode(!!e)}r?document.body.setAttribute("data-bs-theme","dark"):document.body.setAttribute("data-bs-theme","light")}},[r,s]),a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{})}module.exports=n;
@@ -1,51 +0,0 @@
1
- import { g as l } from "./index-YnD2EP-S.js";
2
- import * as s from "react";
3
- var f, m;
4
- function p() {
5
- if (m) return f;
6
- m = 1;
7
- var o = process.env.NODE_ENV !== "production", a = function() {
8
- };
9
- if (o) {
10
- var t = function(u, n) {
11
- var e = arguments.length;
12
- n = new Array(e > 1 ? e - 1 : 0);
13
- for (var r = 1; r < e; r++)
14
- n[r - 1] = arguments[r];
15
- var c = 0, g = "Warning: " + u.replace(/%s/g, function() {
16
- return n[c++];
17
- });
18
- typeof console < "u" && console.error(g);
19
- try {
20
- throw new Error(g);
21
- } catch {
22
- }
23
- };
24
- a = function(i, u, n) {
25
- var e = arguments.length;
26
- n = new Array(e > 2 ? e - 2 : 0);
27
- for (var r = 2; r < e; r++)
28
- n[r - 2] = arguments[r];
29
- if (u === void 0)
30
- throw new Error(
31
- "`warning(condition, format, ...args)` requires a warning message argument"
32
- );
33
- i || t.apply(null, [u].concat(n));
34
- };
35
- }
36
- return f = a, f;
37
- }
38
- var v = p();
39
- const E = /* @__PURE__ */ l(v);
40
- function h(o, a) {
41
- let t = 0;
42
- return s.Children.map(o, (i) => /* @__PURE__ */ s.isValidElement(i) ? a(i, t++) : i);
43
- }
44
- function x(o, a) {
45
- return s.Children.toArray(o).some((t) => /* @__PURE__ */ s.isValidElement(t) && t.type === a);
46
- }
47
- export {
48
- x as h,
49
- h as m,
50
- E as w
51
- };
@@ -1 +0,0 @@
1
- "use strict";const p=require("./index-BlP2-uOi.cjs"),d=require("react");function m(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>n[r]})}}return e.default=n,Object.freeze(e)}const c=m(d);var s,l;function v(){if(l)return s;l=1;var n=process.env.NODE_ENV!=="production",e=function(){};if(n){var r=function(u,i){var o=arguments.length;i=new Array(o>1?o-1:0);for(var a=1;a<o;a++)i[a-1]=arguments[a];var g=0,f="Warning: "+u.replace(/%s/g,function(){return i[g++]});typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}};e=function(t,u,i){var o=arguments.length;i=new Array(o>2?o-2:0);for(var a=2;a<o;a++)i[a-2]=arguments[a];if(u===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");t||r.apply(null,[u].concat(i))}}return s=e,s}var w=v();const h=p.getDefaultExportFromCjs(w);function E(n,e){let r=0;return c.Children.map(n,t=>c.isValidElement(t)?e(t,r++):t)}function _(n,e){return c.Children.toArray(n).some(r=>c.isValidElement(r)&&r.type===e)}exports.hasChildOfType=_;exports.map=E;exports.warning=h;
@@ -1 +0,0 @@
1
- "use strict";const s=require("./jsx-runtime-nZSsnGb7.cjs"),f=require("./useUserFriends.cjs"),n=require("./Button-0ZK0NKiK.cjs"),i=require("./Modal-Bdhkgkwr.cjs");function h({show:u,setShow:x,componentType:a,className:l,style:o={},user_id:c,user_token:m,id:j=null,allowInvite:d=!1,inviteFunction:E=null,modalBackdropClassName:p=""}){const{data:e,error:N,isLoading:r,mutate:R}=f({user_id:c,user_token:m});if((!a||a=="list")&&!r&&e&&e.length>0)return s.jsxRuntimeExports.jsx("ul",{className:l,style:o,children:e.map(t=>s.jsxRuntimeExports.jsxs("li",{children:[t?.populated_user?.username," - ",t?.populated_user?.display_name||"No Display Name"]},t.user_id))});if(a.toLowerCase()=="modal")return s.jsxRuntimeExports.jsxs(i.Modal,{show:u,size:"md",className:`articles-modal ${l}`,modalBackdropClassName:p,centered:!0,onHide:()=>x(!1),style:o,id:j,children:[s.jsxRuntimeExports.jsx(i.Modal.Header,{children:s.jsxRuntimeExports.jsx(i.Modal.Title,{children:"Friends"})}),s.jsxRuntimeExports.jsxs(i.Modal.Body,{children:[r&&s.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center",children:[s.jsxRuntimeExports.jsx("i",{className:"fad fa-spinner-third fa-spin fa-2x"}),s.jsxRuntimeExports.jsx("div",{children:"Loading..."})]}),!r&&e&&e.length==0&&s.jsxRuntimeExports.jsx("div",{children:"No friends to show."}),!r&&e&&e.length>0&&s.jsxRuntimeExports.jsx("div",{children:e.map(t=>s.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center justify-content-between border p-1",children:[t?.populated_user?.username," - ",t?.populated_user?.display_name||"No Display Name",s.jsxRuntimeExports.jsxs("div",{children:[d&&s.jsxRuntimeExports.jsx(n.ArticlesButton,{variant:"articles",onClick:()=>{d(t)},children:s.jsxRuntimeExports.jsx("i",{className:"fad fa-comment-check"})}),s.jsxRuntimeExports.jsx(n.ArticlesButton,{variant:"articles",onClick:()=>{},children:s.jsxRuntimeExports.jsx("i",{className:"fad fa-info"})})]})]},t.user_id))})]}),s.jsxRuntimeExports.jsxs(i.Modal.Footer,{className:"justify-content-between",children:[s.jsxRuntimeExports.jsxs(n.ArticlesButton,{variant:"articles",onClick:()=>{R()},children:[s.jsxRuntimeExports.jsx("i",{className:"fad fa-redo me-2"}),s.jsxRuntimeExports.jsx("span",{children:"Refresh"})]}),s.jsxRuntimeExports.jsxs(n.ArticlesButton,{variant:"articles",onClick:()=>{x(!1)},children:[s.jsxRuntimeExports.jsx("i",{className:"fad fa-times me-2"}),"Close"]})]})]})}module.exports=h;
@@ -1 +0,0 @@
1
- "use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),l=require("react"),i=require("./Modal-Bdhkgkwr.cjs"),E=require("./ViewUserModal.cjs"),m=require("./Button-0ZK0NKiK.cjs"),d=require("./index-DWV8myok.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,123 +0,0 @@
1
- import { j as e } from "./jsx-runtime-tc70JA_2.js";
2
- import { u as r, a as l } from "./index-C8MeSLnR.js";
3
- import { c as i } from "./index-YnD2EP-S.js";
4
- import { lazy as c, memo as d, useState as u, Suspense as m } from "react";
5
- const p = (s) => l.get(s).then((t) => t.data), f = (s) => {
6
- const { data: t, error: a, isLoading: o, mutate: n } = r(
7
- // "http://localhost:3012/api/auth/session",
8
- process.env.NODE_ENV === "development" && !s?.disable ? "http://localhost:3001/api/config" : null,
9
- p,
10
- {
11
- revalidateOnFocus: !1,
12
- revalidateOnReconnect: !1,
13
- shouldRetryOnError: !1
14
- }
15
- );
16
- return {
17
- data: t,
18
- error: a,
19
- isLoading: o,
20
- mutate: n
21
- };
22
- }, h = (s) => l.get(s).then((t) => t.data), b = (s) => {
23
- const { data: t, error: a, isLoading: o, mutate: n } = r(
24
- // "http://localhost:3012/api/auth/session",
25
- process.env.NODE_ENV === "development" && !s?.disable ? "http://localhost:3012/api/status" : null,
26
- h,
27
- {
28
- revalidateOnFocus: !1,
29
- revalidateOnReconnect: !1,
30
- shouldRetryOnError: !1
31
- }
32
- );
33
- return {
34
- data: t,
35
- error: a,
36
- isLoading: o,
37
- mutate: n
38
- };
39
- }, x = c(() => import("./StatusModal-B086BgSW.js"));
40
- function g(s) {
41
- const [t, a] = u(!1), {
42
- data: o
43
- } = f({
44
- disable: process.env.NODE_ENV !== "development"
45
- }), {
46
- data: n
47
- } = b({
48
- disable: process.env.NODE_ENV !== "development"
49
- });
50
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
51
- /* @__PURE__ */ e.jsx(
52
- "link",
53
- {
54
- rel: "stylesheet",
55
- href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
56
- }
57
- ),
58
- process.env.NODE_ENV === "development" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
59
- /* @__PURE__ */ e.jsx("style", { children: `
60
- @keyframes grow-shrink {
61
- 0% { transform: translateY(-50px); }
62
- 50% { transform: translateY(0px); }
63
- 100% { transform: translateY(-50px); }
64
- }
65
- .articles-global-body {
66
- transform: translateY(-40px);
67
- z-index: 1055!important;
68
- position: absolute;
69
- top: 0;
70
- left: 0;
71
- display: flex;
72
- justify-content: center;
73
- align-items: center;
74
- width: 50px;
75
- height: 50px;
76
- margin: 0;
77
- padding: 0;
78
- background-color: yellow;
79
- color: #FFFFFF;
80
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
81
- animation: grow-shrink 2s ease-in;
82
- border: 4px solid red;
83
- cursor: pointer;
84
- }
85
- .articles-global-body.main-connected {
86
- background-color: green;
87
- }
88
- .articles-global-body.auth-connected {
89
- border-color: blue;
90
- }
91
- ` }),
92
- /* @__PURE__ */ e.jsx(
93
- "div",
94
- {
95
- onClick: () => {
96
- a(!0);
97
- },
98
- className: i(
99
- "articles-global-body",
100
- {
101
- "main-connected": o,
102
- "auth-connected": n
103
- }
104
- ),
105
- children: /* @__PURE__ */ e.jsx("div", { className: "content", children: /* @__PURE__ */ e.jsx("i", { className: "fas fa-thumbs-up" }) })
106
- }
107
- ),
108
- t && /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx(
109
- x,
110
- {
111
- show: t,
112
- setShow: a
113
- }
114
- ) })
115
- ] })
116
- ] });
117
- }
118
- const E = d(g);
119
- export {
120
- E as G,
121
- b as a,
122
- f as u
123
- };
@@ -1,33 +0,0 @@
1
- "use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),l=require("./index-DWV8myok.cjs"),u=require("./index-BlP2-uOi.cjs"),r=require("react"),d=s=>l.axios.get(s).then(t=>t.data),i=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3001/api/config":null,d,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},m=s=>l.axios.get(s).then(t=>t.data),c=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3012/api/status":null,m,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},p=r.lazy(()=>Promise.resolve().then(()=>require("./StatusModal-CzPyqQQA.cjs")));function x(s){const[t,n]=r.useState(!1),{data:a}=i({disable:process.env.NODE_ENV!=="development"}),{data:o}=c({disable:process.env.NODE_ENV!=="development"});return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("link",{rel:"stylesheet",href:"https://cdn.articles.media/fonts/fontawesome/css/all.min.css"}),process.env.NODE_ENV==="development"&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.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
- `}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{n(!0)},className:u.classNames("articles-global-body",{"main-connected":a,"auth-connected":o}),children:e.jsxRuntimeExports.jsx("div",{className:"content",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-thumbs-up"})})}),t&&e.jsxRuntimeExports.jsx(r.Suspense,{children:e.jsxRuntimeExports.jsx(p,{show:t,setShow:n})})]})]})}const h=r.memo(x);exports.GlobalBody_default=h;exports.useAuthSiteStatus=c;exports.useMainSiteStatus=i;
@@ -1 +0,0 @@
1
- "use strict";require("./jsx-runtime-nZSsnGb7.cjs");const e=require("./GlobalBody-weON_TbJ.cjs");require("./index-BlP2-uOi.cjs");require("react");module.exports=e.GlobalBody_default;
@@ -1 +0,0 @@
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;