@minecraft-docker/mcctl-console 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/.next/standalone/platform/services/mcctl-console/.next/BUILD_ID +1 -1
  2. package/.next/standalone/platform/services/mcctl-console/.next/app-build-manifest.json +66 -66
  3. package/.next/standalone/platform/services/mcctl-console/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/standalone/platform/services/mcctl-console/.next/build-manifest.json +5 -5
  5. package/.next/standalone/platform/services/mcctl-console/.next/prerender-manifest.json +1 -1
  6. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page.js +1 -1
  7. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page.js.nft.json +1 -1
  8. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js +1 -1
  10. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js.nft.json +1 -1
  11. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js +1 -1
  13. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js.nft.json +1 -1
  14. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js +1 -1
  16. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js.nft.json +1 -1
  17. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js +1 -1
  19. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js.nft.json +1 -1
  20. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js +1 -1
  22. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js.nft.json +1 -1
  23. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page.js +1 -1
  25. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page.js.nft.json +1 -1
  26. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page_client-reference-manifest.js +1 -1
  27. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js +1 -1
  28. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js.nft.json +1 -1
  29. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js +1 -1
  31. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js.nft.json +1 -1
  32. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page.js +1 -1
  34. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page.js.nft.json +1 -1
  35. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js +1 -1
  37. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js.nft.json +1 -1
  38. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page.js +1 -1
  40. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page.js.nft.json +1 -1
  41. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.html +1 -1
  43. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.rsc +5 -5
  44. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.html +1 -1
  45. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.rsc +6 -6
  46. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.html +1 -1
  47. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +5 -5
  48. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.html +1 -1
  49. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.rsc +5 -5
  50. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.html +1 -1
  51. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.rsc +5 -5
  52. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page.js +1 -1
  53. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page.js.nft.json +1 -1
  54. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.html +1 -1
  56. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.rsc +5 -5
  57. package/.next/standalone/platform/services/mcctl-console/.next/server/app/page.js +1 -1
  58. package/.next/standalone/platform/services/mcctl-console/.next/server/app/page.js.nft.json +1 -1
  59. package/.next/standalone/platform/services/mcctl-console/.next/server/app/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.html +1 -1
  61. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.rsc +5 -5
  62. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.html +1 -1
  63. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.rsc +6 -6
  64. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.html +1 -1
  65. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.rsc +5 -5
  66. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.html +1 -1
  67. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.rsc +6 -6
  68. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page.js +1 -1
  69. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page.js.nft.json +1 -1
  70. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page_client-reference-manifest.js +1 -1
  71. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.html +1 -1
  72. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.rsc +5 -5
  73. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.html +1 -1
  74. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.rsc +5 -5
  75. package/.next/standalone/platform/services/mcctl-console/.next/server/app-paths-manifest.json +17 -17
  76. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/354.js +1 -1
  77. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5843.js +1 -1
  78. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/6175.js +57 -0
  79. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/6591.js +2 -0
  80. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7573.js +1 -1
  81. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8243.js +1 -1
  82. package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-build-manifest.js +1 -1
  83. package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-manifest.json +5 -5
  84. package/.next/standalone/platform/services/mcctl-console/.next/server/next-font-manifest.js +1 -1
  85. package/.next/standalone/platform/services/mcctl-console/.next/server/next-font-manifest.json +1 -1
  86. package/.next/standalone/platform/services/mcctl-console/.next/server/pages/404.html +1 -1
  87. package/.next/standalone/platform/services/mcctl-console/.next/server/pages/500.html +1 -1
  88. package/.next/standalone/platform/services/mcctl-console/.next/server/server-reference-manifest.json +1 -1
  89. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2724-6be0c6be94353443.js +1 -0
  90. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5787-bea4ee84b4bf2dea.js +1 -0
  91. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7965-e1d52a92f5303aca.js +1 -0
  92. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/admin/users/{page-b4483a2e5c12dce7.js → page-db10014c56588381.js} +1 -1
  93. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/page-b8468e574885e74f.js +1 -0
  94. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-37b9107156ee1587.js +1 -0
  95. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/layout-37a5eb78e96aa17e.js +1 -0
  96. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/{webpack-c5f126aae1eac753.js → webpack-198a420ca2ddb7de.js} +1 -1
  97. package/.next/standalone/platform/services/mcctl-console/.next/static/css/0c287cf361a10682.css +1 -0
  98. package/.next/standalone/platform/services/mcctl-console/.next/static/media/0ea4f4df910e6120-s.woff2 +0 -0
  99. package/.next/standalone/platform/services/mcctl-console/.next/static/media/1f160ec2cb9962ef-s.woff2 +0 -0
  100. package/.next/standalone/platform/services/mcctl-console/.next/static/media/739c2d8941231bb4-s.p.woff2 +0 -0
  101. package/.next/standalone/platform/services/mcctl-console/.next/static/media/ad8a7e2c3c2c120b-s.woff2 +0 -0
  102. package/.next/standalone/platform/services/mcctl-console/.next/static/media/cde148027b808b99-s.woff2 +0 -0
  103. package/.next/standalone/platform/services/mcctl-console/.next/static/media/e61ae719f7cc4155-s.woff2 +0 -0
  104. package/.next/static/chunks/2724-6be0c6be94353443.js +1 -0
  105. package/.next/static/chunks/5787-bea4ee84b4bf2dea.js +1 -0
  106. package/.next/static/chunks/7965-e1d52a92f5303aca.js +1 -0
  107. package/.next/static/chunks/app/(main)/admin/users/{page-b4483a2e5c12dce7.js → page-db10014c56588381.js} +1 -1
  108. package/.next/static/chunks/app/(main)/audit-logs/page-b8468e574885e74f.js +1 -0
  109. package/.next/static/chunks/app/(main)/servers/[name]/page-37b9107156ee1587.js +1 -0
  110. package/.next/static/chunks/app/layout-37a5eb78e96aa17e.js +1 -0
  111. package/.next/static/chunks/{webpack-c5f126aae1eac753.js → webpack-198a420ca2ddb7de.js} +1 -1
  112. package/.next/static/css/0c287cf361a10682.css +1 -0
  113. package/.next/static/media/0ea4f4df910e6120-s.woff2 +0 -0
  114. package/.next/static/media/1f160ec2cb9962ef-s.woff2 +0 -0
  115. package/.next/static/media/739c2d8941231bb4-s.p.woff2 +0 -0
  116. package/.next/static/media/ad8a7e2c3c2c120b-s.woff2 +0 -0
  117. package/.next/static/media/cde148027b808b99-s.woff2 +0 -0
  118. package/.next/static/media/e61ae719f7cc4155-s.woff2 +0 -0
  119. package/package.json +2 -2
  120. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4533.js +0 -2
  121. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/613.js +0 -57
  122. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5645-d306bb768b5907c8.js +0 -1
  123. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5787-3387a2b82bbb1e66.js +0 -1
  124. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7965-51dfb844f8b8584c.js +0 -1
  125. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/page-90479d797d04efdb.js +0 -1
  126. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-ab34db97055578dd.js +0 -1
  127. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/layout-e0e626ece42c56d9.js +0 -1
  128. package/.next/standalone/platform/services/mcctl-console/.next/static/css/4d6bfee1e91e393d.css +0 -1
  129. package/.next/standalone/platform/services/mcctl-console/.next/static/media/12a3e8885b69eb86-s.woff2 +0 -0
  130. package/.next/standalone/platform/services/mcctl-console/.next/static/media/14d38ce06836ffee-s.woff2 +0 -0
  131. package/.next/standalone/platform/services/mcctl-console/.next/static/media/19bbd60ccc95b5d0-s.woff2 +0 -0
  132. package/.next/standalone/platform/services/mcctl-console/.next/static/media/23822ac40846484b-s.woff2 +0 -0
  133. package/.next/standalone/platform/services/mcctl-console/.next/static/media/2fec16f4e3247070-s.woff2 +0 -0
  134. package/.next/standalone/platform/services/mcctl-console/.next/static/media/33a864272e2b3e97-s.p.woff2 +0 -0
  135. package/.next/standalone/platform/services/mcctl-console/.next/static/media/387866ce4a39ca39-s.woff2 +0 -0
  136. package/.next/standalone/platform/services/mcctl-console/.next/static/media/3ecd40fce058ee61-s.p.woff2 +0 -0
  137. package/.next/standalone/platform/services/mcctl-console/.next/static/media/4b1cfd3867993fed-s.woff2 +0 -0
  138. package/.next/standalone/platform/services/mcctl-console/.next/static/media/64b603a0050c6c5e-s.woff2 +0 -0
  139. package/.next/standalone/platform/services/mcctl-console/.next/static/media/70d2fd2b9078a5a3-s.p.woff2 +0 -0
  140. package/.next/standalone/platform/services/mcctl-console/.next/static/media/77f5a85cac4ea515-s.woff2 +0 -0
  141. package/.next/standalone/platform/services/mcctl-console/.next/static/media/854d2e4705543874-s.woff2 +0 -0
  142. package/.next/standalone/platform/services/mcctl-console/.next/static/media/b188519314c42064-s.woff2 +0 -0
  143. package/.next/standalone/platform/services/mcctl-console/.next/static/media/b22cdab1bc584ea3-s.woff2 +0 -0
  144. package/.next/standalone/platform/services/mcctl-console/.next/static/media/b664222af7dcc13c-s.woff2 +0 -0
  145. package/.next/standalone/platform/services/mcctl-console/.next/static/media/bda87828535b47a7-s.woff2 +0 -0
  146. package/.next/standalone/platform/services/mcctl-console/.next/static/media/c99b890c5ded8d2e-s.p.woff2 +0 -0
  147. package/.next/standalone/platform/services/mcctl-console/.next/static/media/cf66601165af2130-s.woff2 +0 -0
  148. package/.next/standalone/platform/services/mcctl-console/.next/static/media/d39dd0fe2707b73f-s.woff2 +0 -0
  149. package/.next/standalone/platform/services/mcctl-console/.next/static/media/dbd9849a8a735d72-s.woff2 +0 -0
  150. package/.next/standalone/platform/services/mcctl-console/.next/static/media/e8773fdd4b7ad26f-s.woff2 +0 -0
  151. package/.next/standalone/platform/services/mcctl-console/.next/static/media/eeeb642bd71d217b-s.woff2 +0 -0
  152. package/.next/standalone/platform/services/mcctl-console/.next/static/media/f882d86c499cfa5a-s.woff2 +0 -0
  153. package/.next/static/chunks/5645-d306bb768b5907c8.js +0 -1
  154. package/.next/static/chunks/5787-3387a2b82bbb1e66.js +0 -1
  155. package/.next/static/chunks/7965-51dfb844f8b8584c.js +0 -1
  156. package/.next/static/chunks/app/(main)/audit-logs/page-90479d797d04efdb.js +0 -1
  157. package/.next/static/chunks/app/(main)/servers/[name]/page-ab34db97055578dd.js +0 -1
  158. package/.next/static/chunks/app/layout-e0e626ece42c56d9.js +0 -1
  159. package/.next/static/css/4d6bfee1e91e393d.css +0 -1
  160. package/.next/static/media/12a3e8885b69eb86-s.woff2 +0 -0
  161. package/.next/static/media/14d38ce06836ffee-s.woff2 +0 -0
  162. package/.next/static/media/19bbd60ccc95b5d0-s.woff2 +0 -0
  163. package/.next/static/media/23822ac40846484b-s.woff2 +0 -0
  164. package/.next/static/media/2fec16f4e3247070-s.woff2 +0 -0
  165. package/.next/static/media/33a864272e2b3e97-s.p.woff2 +0 -0
  166. package/.next/static/media/387866ce4a39ca39-s.woff2 +0 -0
  167. package/.next/static/media/3ecd40fce058ee61-s.p.woff2 +0 -0
  168. package/.next/static/media/4b1cfd3867993fed-s.woff2 +0 -0
  169. package/.next/static/media/64b603a0050c6c5e-s.woff2 +0 -0
  170. package/.next/static/media/70d2fd2b9078a5a3-s.p.woff2 +0 -0
  171. package/.next/static/media/77f5a85cac4ea515-s.woff2 +0 -0
  172. package/.next/static/media/854d2e4705543874-s.woff2 +0 -0
  173. package/.next/static/media/b188519314c42064-s.woff2 +0 -0
  174. package/.next/static/media/b22cdab1bc584ea3-s.woff2 +0 -0
  175. package/.next/static/media/b664222af7dcc13c-s.woff2 +0 -0
  176. package/.next/static/media/bda87828535b47a7-s.woff2 +0 -0
  177. package/.next/static/media/c99b890c5ded8d2e-s.p.woff2 +0 -0
  178. package/.next/static/media/cf66601165af2130-s.woff2 +0 -0
  179. package/.next/static/media/d39dd0fe2707b73f-s.woff2 +0 -0
  180. package/.next/static/media/dbd9849a8a735d72-s.woff2 +0 -0
  181. package/.next/static/media/e8773fdd4b7ad26f-s.woff2 +0 -0
  182. package/.next/static/media/eeeb642bd71d217b-s.woff2 +0 -0
  183. package/.next/static/media/f882d86c499cfa5a-s.woff2 +0 -0
  184. /package/.next/standalone/platform/services/mcctl-console/.next/static/{fdYvEyTkN35IFbAO8RHVv → Yn14R25oBpteEUUEyZNGO}/_buildManifest.js +0 -0
  185. /package/.next/standalone/platform/services/mcctl-console/.next/static/{fdYvEyTkN35IFbAO8RHVv → Yn14R25oBpteEUUEyZNGO}/_ssgManifest.js +0 -0
  186. /package/.next/static/{fdYvEyTkN35IFbAO8RHVv → Yn14R25oBpteEUUEyZNGO}/_buildManifest.js +0 -0
  187. /package/.next/static/{fdYvEyTkN35IFbAO8RHVv → Yn14R25oBpteEUUEyZNGO}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7965],{57965:function(e,s,r){r.d(s,{eE:function(){return X},E4:function(){return N},SB:function(){return k},ms:function(){return O},hI:function(){return j},aY:function(){return ec},zd:function(){return _},Ik:function(){return P}});var n=r(94655),t=r(628),i=r(41565),a=r(31317),l=r(7281),o=r(25333),c=r(21138),d=r(84811),x=r(70366),u=r(47001),h=r(59602);let m={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},p={border:0,py:1};function j(e){var s;let{router:r}=e,j=(s=r.mode)?s.includes("in-docker")||s.includes("auto-discovery")?{label:"Auto Discovery",color:"info"}:s.includes("mapping")?{label:"Manual Mapping",color:"warning"}:{label:s,color:"default"}:{label:"Unknown",color:"default"};return(0,n.jsx)(t.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,n.jsx)(h.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"Platform Information"})]}),(0,n.jsx)(c.Z,{size:"small",children:(0,n.jsxs)(d.Z,{children:[(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:m,children:"Router Name"}),(0,n.jsx)(u.Z,{sx:p,children:r.name})]}),(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:m,children:"Port"}),(0,n.jsx)(u.Z,{sx:p,children:r.port})]}),(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:m,children:"Mode"}),(0,n.jsx)(u.Z,{sx:p,children:(0,n.jsx)(o.Z,{label:j.label,size:"small",color:j.color,variant:"outlined"})})]}),(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:m,children:"Uptime"}),(0,n.jsx)(u.Z,{sx:p,children:r.uptime||"-"})]})]})})]})})}var Z=r(95511),f=r(66561),g=r(12795),y=r(96407),v=r(29983),b=r(81960);function w(e){switch(e){case"running":return"#4caf50";case"exited":case"dead":case"not_found":case"not_created":return"#f44336";case"created":case"restarting":case"paused":return"#ff9800";default:return"#9e9e9e"}}function S(e){let{status:s}=e;return(0,n.jsx)(Z.Z,{title:s,arrow:!0,children:(0,n.jsx)(l.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:w(s),flexShrink:0,boxShadow:"running"===s?"0 0 6px ".concat(w(s)):"none"}})})}function P(e){let{router:s}=e,r=function(e){let s=new Map;for(let r of e){let e=r.target.replace(/^mc-/,"").replace(/:25565$/,""),n=s.get(e);n?n.hostnames.push(r.hostname):s.set(e,{status:r.serverStatus,hostnames:[r.hostname],serverType:r.serverType,serverVersion:r.serverVersion})}return s}(s.routes);return(0,n.jsx)(t.Z,{sx:{height:"100%"},children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,n.jsx)(v.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"MC-Router Status"}),(0,n.jsxs)(l.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,n.jsx)(o.Z,{label:s.status,size:"small",color:function(e){switch(e){case"running":return"success";case"exited":case"dead":case"not_found":case"not_created":return"error";case"created":case"restarting":case"paused":return"warning";default:return"default"}}(s.status)}),(0,n.jsx)(o.Z,{label:s.health,size:"small",color:function(e){switch(e){case"healthy":return"success";case"unhealthy":return"error";case"starting":return"warning";default:return"default"}}(s.health),variant:"outlined"})]})]}),(0,n.jsx)(a.Z,{variant:"subtitle2",sx:{mb:1,mt:3},children:"Routing Table"}),0===s.routes.length?(0,n.jsx)(a.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No routes configured"}):(0,n.jsx)(l.Z,{sx:{mt:1},children:Array.from(r.entries()).map(e=>{let[s,{status:r,hostnames:t,serverType:i,serverVersion:o}]=e;return(0,n.jsxs)(f.Z,{defaultExpanded:!0,disableGutters:!0,elevation:0,sx:{border:1,borderColor:"divider","&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}},children:[(0,n.jsx)(g.Z,{expandIcon:(0,n.jsx)(b.Z,{}),children:(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%",pr:1},children:[(0,n.jsx)(S,{status:r}),(0,n.jsx)(a.Z,{variant:"subtitle2",sx:{fontWeight:600},children:s}),(i||o)&&(0,n.jsx)(a.Z,{variant:"caption",color:"text.secondary",children:[i,o].filter(Boolean).join(" ")}),(0,n.jsxs)(a.Z,{variant:"caption",color:"text.secondary",sx:{ml:"auto"},children:[t.length," ",1===t.length?"route":"routes"]})]})}),(0,n.jsx)(y.Z,{sx:{pt:0},children:(0,n.jsx)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:t.map(e=>(0,n.jsx)(a.Z,{variant:"body2",sx:{fontFamily:'"Roboto Mono", monospace',fontSize:"0.85rem",color:"text.secondary"},children:e},e))})})]},s)})})]})})}var C=r(21605);let z={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},I={border:0,py:1};function k(e){var s;let{router:r}=e,h=r.routes.filter(e=>"running"===e.serverStatus).length,m=r.routes.length;return(0,n.jsx)(t.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,n.jsx)(C.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"Network Settings"})]}),(0,n.jsx)(c.Z,{size:"small",children:(0,n.jsxs)(d.Z,{children:[(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:z,children:"Listening Port"}),(0,n.jsx)(u.Z,{sx:I,children:(0,n.jsx)(o.Z,{label:r.port,size:"small",variant:"outlined"})})]}),(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:z,children:"Routing Mode"}),(0,n.jsx)(u.Z,{sx:I,children:(0,n.jsx)(o.Z,{label:(s=r.mode)?s.includes("in-docker")||s.includes("auto-discovery")?"Auto Discovery":s.includes("mapping")?"Manual Mapping":s:"Unknown",size:"small",color:"info",variant:"outlined"})})]}),(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:z,children:"Total Routes"}),(0,n.jsx)(u.Z,{sx:I,children:m})]}),(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:z,children:"Active Routes"}),(0,n.jsx)(u.Z,{sx:I,children:(0,n.jsx)(o.Z,{label:"".concat(h," / ").concat(m),size:"small",color:h>0?"success":"default",variant:"outlined"})})]})]})})]})})}var A=r(76544);function N(e){var s;let{avahi:r}=e,c=null!==(s=null==r?void 0:r.status)&&void 0!==s?s:"unknown";return(0,n.jsx)(t.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,n.jsx)(A.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"mDNS (Avahi)"}),(0,n.jsx)(o.Z,{label:c,size:"small",color:"running"===c?"success":c.includes("not running")?"warning":"not installed"===c?"error":"default",sx:{ml:"auto"}})]}),(0,n.jsxs)(a.Z,{variant:"body2",color:"text.secondary",children:["Avahi mDNS daemon enables ",(0,n.jsx)("code",{children:".local"})," hostname resolution for Minecraft servers on the local network."]})]})})}var D=r(35106),T=r(97436),E=r(30417),R=r(93017),W=r(30114),U=r(6986);function _(e){var s;let{onSuccess:r,onError:c}=e,{data:d}=(0,U.kP)(),[x,u]=(0,D.useState)((null==d?void 0:null===(s=d.user)||void 0===s?void 0:s.name)||""),[h,m]=(0,D.useState)(!1),[p,j]=(0,D.useState)(!1),Z=null==d?void 0:d.user;(0,D.useEffect)(()=>{(null==Z?void 0:Z.name)&&!p&&(u(Z.name),j(!0))},[null==Z?void 0:Z.name,p]);let f=x!==((null==Z?void 0:Z.name)||""),g=async()=>{if(f&&x.trim()){m(!0);try{let{error:e}=await (0,U.Nq)({name:x.trim()});e?c(e.message||"Failed to update profile"):r("Profile updated successfully")}catch(e){c("Failed to update profile")}finally{m(!1)}}};return Z?(0,n.jsx)(t.Z,{sx:{height:"100%"},children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[(0,n.jsx)(W.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"Profile"})]}),(0,n.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[(0,n.jsx)(T.Z,{label:"Name",value:x,onChange:e=>u(e.target.value),fullWidth:!0,size:"small"}),(0,n.jsx)(T.Z,{label:"Email",value:Z.email,fullWidth:!0,size:"small",disabled:!0,helperText:"Email cannot be changed"}),(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(a.Z,{variant:"body2",color:"text.secondary",children:"Role:"}),(0,n.jsx)(o.Z,{label:"admin"===Z.role?"Admin":"User",size:"small",color:"admin"===Z.role?"primary":"default",variant:"outlined"})]}),(0,n.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,n.jsx)(E.Z,{variant:"contained",onClick:g,disabled:!f||!x.trim()||h,startIcon:h?(0,n.jsx)(R.Z,{size:16}):null,children:h?"Saving...":"Save Changes"})})]})]})}):null}var B=r(52082),F=r(79983),M=r(70603),L=r(28058),q=r(42730);function O(e){let{onSuccess:s,onError:r}=e,[o,c]=(0,D.useState)(""),[d,x]=(0,D.useState)(""),[u,h]=(0,D.useState)(""),[m,p]=(0,D.useState)(!1),[j,Z]=(0,D.useState)(!1),[f,g]=(0,D.useState)(!1),[y,v]=(0,D.useState)(!1),[b,w]=(0,D.useState)({}),S=()=>{let e={};return o||(e.currentPassword="Current password is required"),d?d.length<8&&(e.newPassword="Password must be at least ".concat(8," characters")):e.newPassword="New password is required",u?d!==u&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your new password",o&&d&&o===d&&(e.newPassword="New password must be different from current password"),w(e),0===Object.keys(e).length},P=async e=>{if(e.preventDefault(),S()){v(!0);try{let{error:e}=await (0,U.Cp)({currentPassword:o,newPassword:d,revokeOtherSessions:!1});e?r(e.message||"Failed to change password"):(s("Password changed successfully"),c(""),x(""),h(""),w({}))}catch(e){r("Failed to change password")}finally{v(!1)}}},C=(e,s)=>(0,n.jsx)(B.Z,{position:"end",children:(0,n.jsx)(F.Z,{"aria-label":e?"hide password":"show password",onClick:()=>s(!e),edge:"end",size:"small",children:e?(0,n.jsx)(q.Z,{fontSize:"small"}):(0,n.jsx)(L.Z,{fontSize:"small"})})});return(0,n.jsx)(t.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[(0,n.jsx)(M.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"Change Password"})]}),(0,n.jsxs)(l.Z,{component:"form",onSubmit:P,sx:{display:"flex",flexDirection:"column",gap:2.5},children:[(0,n.jsx)(T.Z,{label:"Current Password",type:m?"text":"password",value:o,onChange:e=>{c(e.target.value),b.currentPassword&&w(e=>({...e,currentPassword:""}))},error:!!b.currentPassword,helperText:b.currentPassword,fullWidth:!0,size:"small",autoComplete:"current-password",InputProps:{endAdornment:C(m,p)}}),(0,n.jsx)(T.Z,{label:"New Password",type:j?"text":"password",value:d,onChange:e=>{x(e.target.value),b.newPassword&&w(e=>({...e,newPassword:""}))},error:!!b.newPassword,helperText:b.newPassword||"Minimum ".concat(8," characters"),fullWidth:!0,size:"small",autoComplete:"new-password",InputProps:{endAdornment:C(j,Z)}}),(0,n.jsx)(T.Z,{label:"Confirm New Password",type:f?"text":"password",value:u,onChange:e=>{h(e.target.value),b.confirmPassword&&w(e=>({...e,confirmPassword:""}))},error:!!b.confirmPassword,helperText:b.confirmPassword,fullWidth:!0,size:"small",autoComplete:"new-password",InputProps:{endAdornment:C(f,g)}}),(0,n.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,n.jsx)(E.Z,{type:"submit",variant:"contained",disabled:y,startIcon:y?(0,n.jsx)(R.Z,{size:16}):null,children:y?"Changing...":"Change Password"})})]})]})})}var K=r(23695);let V={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},$={border:0,py:1};function Q(e){return e?("string"==typeof e?new Date(e):e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}function X(){let{data:e}=(0,U.kP)(),s=null==e?void 0:e.user;return s?(0,n.jsx)(t.Z,{sx:{height:"100%"},children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,n.jsx)(K.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"Account Information"})]}),(0,n.jsx)(c.Z,{size:"small",children:(0,n.jsxs)(d.Z,{children:[(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:V,children:"Account ID"}),(0,n.jsx)(u.Z,{sx:$,children:(0,n.jsx)(a.Z,{variant:"body2",sx:{fontFamily:'"Roboto Mono", monospace',fontSize:"0.8rem"},children:s.id})})]}),(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:V,children:"Created"}),(0,n.jsx)(u.Z,{sx:$,children:Q(s.createdAt)})]}),(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:V,children:"Last Updated"}),(0,n.jsx)(u.Z,{sx:$,children:Q(s.updatedAt)})]})]})})]})}):null}var Y=r(11254),G=r(10721),H=r(81071),J=r(84974),ee=r(5501),es=r(93315),er=r(9078),en=r(10449),et=r(24559),ei=r(37228);let ea={fontWeight:500,color:"text.secondary",border:0,width:"40%",py:1},el={border:0,py:1};function eo(e){let{text:s}=e,[r,t]=(0,D.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(s),t(!0),setTimeout(()=>t(!1),2e3)}catch(e){console.error("Failed to copy:",e)}};return(0,n.jsx)(F.Z,{size:"small",onClick:i,sx:{ml:1,color:r?"success.main":"text.secondary","&:hover":{bgcolor:"action.hover"}},"aria-label":r?"Copied":"Copy to clipboard",children:r?(0,n.jsx)(et.Z,{sx:{fontSize:16}}):(0,n.jsx)(en.Z,{sx:{fontSize:16}})})}function ec(){let{data:e,isLoading:s,error:r}=(0,ei.UW)(),h=(0,ei.Bc)(),m=(0,ei.N$)();if(r)return(0,n.jsx)(t.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,n.jsx)(J.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"})]}),(0,n.jsxs)(H.Z,{severity:"error",children:["Failed to load playit status: ",r.message]})]})});if(s)return(0,n.jsx)(t.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,n.jsx)(G.Z,{variant:"circular",width:24,height:24}),(0,n.jsx)(G.Z,{variant:"text",width:"40%",height:32})]}),(0,n.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,n.jsx)(G.Z,{variant:"text",width:"35%"}),(0,n.jsx)(G.Z,{variant:"text",width:"40%"})]}),(0,n.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,n.jsx)(G.Z,{variant:"text",width:"35%"}),(0,n.jsx)(G.Z,{variant:"text",width:"40%"})]})]})});if(!(null==e?void 0:e.enabled))return(0,n.jsx)(t.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,n.jsx)(J.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"})]}),(0,n.jsxs)(H.Z,{severity:"info",children:[(0,n.jsx)(a.Z,{variant:"body2",fontWeight:500,sx:{mb:.5},children:"Not configured"}),(0,n.jsx)(a.Z,{variant:"body2",color:"text.secondary",children:"playit.gg agent is not set up. Configure PLAYIT_SECRET to enable external access."})]})]})});let p=e.agentRunning&&"running"===e.containerStatus,j=h.isPending||m.isPending,Z=h.error||m.error;return(0,n.jsx)(t.Z,{children:(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,n.jsx)(J.Z,{color:"primary"}),(0,n.jsx)(a.Z,{variant:"h6",component:"h2",children:"External Access (playit.gg)"})]}),Z&&(0,n.jsx)(H.Z,{severity:"error",sx:{mb:2},children:Z.message||"Action failed"}),(0,n.jsxs)(l.Z,{sx:{display:"flex",gap:1,mb:2,flexWrap:"wrap"},children:[p?(0,n.jsx)(E.Z,{variant:"outlined",size:"small",color:"error",startIcon:j?(0,n.jsx)(R.Z,{size:16}):(0,n.jsx)(es.Z,{}),onClick:()=>{m.mutate()},disabled:j,sx:{fontSize:12},children:j?"Stopping...":"Stop Agent"}):(0,n.jsx)(E.Z,{variant:"contained",size:"small",color:"success",startIcon:j?(0,n.jsx)(R.Z,{size:16,color:"inherit"}):(0,n.jsx)(ee.Z,{}),onClick:()=>{h.mutate()},disabled:j,sx:{fontSize:12},children:j?"Starting...":"Start Agent"}),(0,n.jsx)(E.Z,{component:"a",href:"https://playit.gg/account/tunnels",target:"_blank",rel:"noopener noreferrer",size:"small",startIcon:(0,n.jsx)(er.Z,{}),sx:{fontSize:12},children:"View Dashboard"})]}),(0,n.jsx)(c.Z,{size:"small",sx:{mb:3},children:(0,n.jsxs)(d.Z,{children:[(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:ea,children:"Agent Status"}),(0,n.jsx)(u.Z,{sx:el,children:(0,n.jsx)(o.Z,{label:p?"Running":"Stopped",size:"small",color:p?"success":"default",variant:"outlined"})})]}),e.uptime&&(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:ea,children:"Uptime"}),(0,n.jsx)(u.Z,{sx:el,children:e.uptime})]})]})}),e.servers&&e.servers.length>0&&(()=>{let s=e.servers.filter(e=>e.playitDomain),r=e.servers.filter(e=>!e.playitDomain);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.Z,{variant:"subtitle2",sx:{mb:1.5,fontWeight:600},children:"Server Domains"}),s.length>0?(0,n.jsxs)(c.Z,{size:"small",sx:{mb:r.length>0?2:0},children:[(0,n.jsx)(Y.Z,{children:(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:{fontWeight:600,borderBottom:2,borderColor:"divider"},children:"Server"}),(0,n.jsx)(u.Z,{sx:{fontWeight:600,borderBottom:2,borderColor:"divider"},children:"External Domain"})]})}),(0,n.jsx)(d.Z,{children:s.map(e=>(0,n.jsxs)(x.Z,{children:[(0,n.jsx)(u.Z,{sx:{py:1.5,borderBottom:1,borderColor:"divider"},children:e.serverName}),(0,n.jsx)(u.Z,{sx:{py:1.5,borderBottom:1,borderColor:"divider"},children:(0,n.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(a.Z,{variant:"body2",sx:{fontFamily:'"Roboto Mono", monospace'},children:e.playitDomain}),(0,n.jsx)(eo,{text:e.playitDomain})]})})]},e.serverName))})]}):(0,n.jsxs)(a.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["No servers with external domains configured. Use ",(0,n.jsx)("code",{children:"mcctl create --playit-domain"})," to register a domain."]}),r.length>0&&(0,n.jsxs)(a.Z,{variant:"body2",color:"text.secondary",children:[r.length," server",r.length>1?"s":""," without external domain: ",r.map(e=>e.serverName).join(", ")]})]})})()]})})}},37228:function(e,s,r){r.d(s,{Bc:function(){return o},N$:function(){return c},UW:function(){return l}});var n=r(5632),t=r(58919),i=r(20367),a=r(42936);function l(){return(0,n.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function o(){let e=(0,t.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/start",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}function c(){let e=(0,t.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/stop",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}},6986:function(e,s,r){r.d(s,{Cp:function(){return u},Nq:function(){return x},cg:function(){return l},kP:function(){return d},w7:function(){return o},y1:function(){return c},zB:function(){return h}});var n=r(77054),t=r(61648),i=r(35016);let a=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,t.zB)()]}),{signIn:l,signOut:o,signUp:c,useSession:d,updateUser:x,changePassword:u}=a,h=a.admin}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5931],{66289:function(e,t,r){Promise.resolve().then(r.bind(r,12256))},71185:function(e,t,r){"use strict";var i=r(8091);t.Z=void 0;var n=i(r(66758)),l=r(94655);t.Z=(0,n.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},69123:function(e,t,r){"use strict";var i=r(32324),n=r(81500),l=r(35106),a=r(70316),o=r(65951),s=r(64577),c=r(34519),d=r(28057),h=r(16945),u=r(94655);let x=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],m=e=>{let{absolute:t,children:r,classes:i,flexItem:n,light:l,orientation:a,textAlign:s,variant:c}=e;return(0,o.Z)({root:["root",t&&"absolute",c,l&&"light","vertical"===a&&"vertical",n&&"flexItem",r&&"withChildren",r&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},h.V,i)},v=(0,c.ZP)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})(e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},r.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},r.light&&{borderColor:t.vars?"rgba(".concat(t.vars.palette.dividerChannel," / 0.08)"):(0,s.Fq)(t.palette.divider,.08)},"inset"===r.variant&&{marginLeft:72},"middle"===r.variant&&"horizontal"===r.orientation&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},"middle"===r.variant&&"vertical"===r.orientation&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},"vertical"===r.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},r.flexItem&&{alignSelf:"stretch",height:"auto"})},e=>{let{ownerState:t}=e;return(0,n.Z)({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}})},e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({},r.children&&"vertical"!==r.orientation&&{"&::before, &::after":{width:"100%",borderTop:"thin solid ".concat((t.vars||t).palette.divider),borderTopStyle:"inherit"}})},e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({},r.children&&"vertical"===r.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:"thin solid ".concat((t.vars||t).palette.divider),borderLeftStyle:"inherit"}})},e=>{let{ownerState:t}=e;return(0,n.Z)({},"right"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})}),Z=(0,c.ZP)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})(e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({display:"inline-block",paddingLeft:"calc(".concat(t.spacing(1)," * 1.2)"),paddingRight:"calc(".concat(t.spacing(1)," * 1.2)")},"vertical"===r.orientation&&{paddingTop:"calc(".concat(t.spacing(1)," * 1.2)"),paddingBottom:"calc(".concat(t.spacing(1)," * 1.2)")})}),f=l.forwardRef(function(e,t){let r=(0,d.i)({props:e,name:"MuiDivider"}),{absolute:l=!1,children:o,className:s,component:c=o?"div":"hr",flexItem:h=!1,light:f=!1,orientation:p="horizontal",role:g="hr"!==c?"separator":void 0,textAlign:j="center",variant:b="fullWidth"}=r,y=(0,i.Z)(r,x),w=(0,n.Z)({},r,{absolute:l,component:c,flexItem:h,light:f,orientation:p,role:g,textAlign:j,variant:b}),C=m(w);return(0,u.jsx)(v,(0,n.Z)({as:c,className:(0,a.Z)(C.root,s),role:g,ref:t,ownerState:w},y,{children:o?(0,u.jsx)(Z,{className:C.wrapper,ownerState:w,children:o}):null}))});f.muiSkipListHighlight=!0,t.Z=f},16945:function(e,t,r){"use strict";r.d(t,{V:function(){return l}});var i=r(11379),n=r(9049);function l(e){return(0,n.ZP)("MuiDivider",e)}let a=(0,i.Z)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);t.Z=a},53281:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var i=r(81500),n=r(32324),l=r(35106),a=r(70316),o=r(65951),s=r(28057),c=r(34519),d=r(11379),h=r(9049);function u(e){return(0,h.ZP)("MuiTableContainer",e)}(0,d.Z)("MuiTableContainer",["root"]);var x=r(94655);let m=["className","component"],v=e=>{let{classes:t}=e;return(0,o.Z)({root:["root"]},u,t)},Z=(0,c.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"});var f=l.forwardRef(function(e,t){let r=(0,s.i)({props:e,name:"MuiTableContainer"}),{className:l,component:o="div"}=r,c=(0,n.Z)(r,m),d=(0,i.Z)({},r,{component:o}),h=v(d);return(0,x.jsx)(Z,(0,i.Z)({ref:t,as:o,className:(0,a.Z)(h.root,l),ownerState:d},c))})},12256:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return R}});var i=r(94655),n=r(35106),l=r(7281),a=r(93017),o=r(81071),s=r(31317),c=r(5632),d=r(6986),h=r(53281),u=r(69899),x=r(21138),m=r(11254),v=r(70366),Z=r(47001),f=r(84811),p=r(25333);function g(e){let{users:t,onUserClick:r}=e;return 0===t.length?(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",p:4},children:(0,i.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"No users found"})}):(0,i.jsx)(h.Z,{component:u.Z,children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(m.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(Z.Z,{children:"Email"}),(0,i.jsx)(Z.Z,{children:"Name"}),(0,i.jsx)(Z.Z,{children:"Role"}),(0,i.jsx)(Z.Z,{children:"Status"}),(0,i.jsx)(Z.Z,{children:"Created At"})]})}),(0,i.jsx)(f.Z,{children:t.map(e=>(0,i.jsxs)(v.Z,{hover:!0,onClick:()=>r(e),sx:{cursor:"pointer"},children:[(0,i.jsx)(Z.Z,{children:e.email}),(0,i.jsx)(Z.Z,{children:e.name||"N/A"}),(0,i.jsx)(Z.Z,{children:"admin"===e.role?(0,i.jsx)(p.Z,{label:"Admin",color:"primary",size:"small"}):(0,i.jsx)(p.Z,{label:"User",size:"small"})}),(0,i.jsx)(Z.Z,{children:e.banned?(0,i.jsx)(p.Z,{label:"Banned",color:"error",size:"small"}):(0,i.jsx)(p.Z,{label:"Active",color:"success",size:"small"})}),(0,i.jsx)(Z.Z,{children:new Date(e.createdAt).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]},e.id))})]})})}var j=r(99770),b=r(62508),y=r(79983),w=r(5682),C=r(69123),A=r(71185);function S(e){let{user:t,open:r,onClose:n}=e;return(0,i.jsxs)(j.Z,{open:r,onClose:n,maxWidth:"sm",fullWidth:!0,children:[(0,i.jsx)(b.Z,{children:(0,i.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(s.Z,{variant:"h6",children:"User Details"}),(0,i.jsx)(y.Z,{onClick:n,size:"small","aria-label":"close",children:(0,i.jsx)(A.Z,{})})]})}),(0,i.jsx)(w.Z,{children:(0,i.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Email"}),(0,i.jsx)(s.Z,{variant:"body1",children:t.email})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Name"}),(0,i.jsx)(s.Z,{variant:"body1",children:t.name||"N/A"})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Role"}),(0,i.jsx)(l.Z,{sx:{mt:.5},children:"admin"===t.role?(0,i.jsx)(p.Z,{label:"Admin",color:"primary",size:"small"}):(0,i.jsx)(p.Z,{label:"User",size:"small"})})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Status"}),(0,i.jsx)(l.Z,{sx:{mt:.5},children:t.banned?(0,i.jsx)(p.Z,{label:"Banned",color:"error",size:"small"}):(0,i.jsx)(p.Z,{label:"Active",color:"success",size:"small"})})]}),(0,i.jsx)(C.Z,{}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Created At"}),(0,i.jsx)(s.Z,{variant:"body2",children:new Date(t.createdAt).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"User ID"}),(0,i.jsx)(s.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:t.id})]})]})})]})}function R(){let{data:e,isLoading:t,isError:r,error:h}=(0,c.a)({queryKey:["admin","users"],queryFn:async()=>{let{data:e,error:t}=await d.zB.listUsers({query:{}});if(t)throw Error(t.message||"Failed to fetch users");return(null==e?void 0:e.users)?e.users.map(e=>{var t,r,i;return{id:e.id,email:e.email,name:null!==(t=e.name)&&void 0!==t?t:null,role:null!==(r=e.role)&&void 0!==r?r:"user",banned:null!==(i=e.banned)&&void 0!==i&&i,createdAt:new Date(e.createdAt)}}):[]}}),[u,x]=(0,n.useState)(null);return t?(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"400px"},children:(0,i.jsx)(a.Z,{})}):r?(0,i.jsx)(l.Z,{sx:{p:3},children:(0,i.jsxs)(o.Z,{severity:"error",children:["Failed to load users. ",(null==h?void 0:h.message)||"Please try again later."]})}):(0,i.jsxs)(l.Z,{sx:{p:3},children:[(0,i.jsx)(s.Z,{variant:"h4",component:"h1",gutterBottom:!0,children:"User Management"}),(0,i.jsx)(g,{users:e||[],onUserClick:e=>{x(e)}}),u&&(0,i.jsx)(S,{user:u,open:!0,onClose:()=>{x(null)}})]})}},6986:function(e,t,r){"use strict";r.d(t,{Cp:function(){return u},Nq:function(){return h},cg:function(){return o},kP:function(){return d},w7:function(){return s},y1:function(){return c},zB:function(){return x}});var i=r(77054),n=r(61648),l=r(35016);let a=(0,i.X)({baseURL:l.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,n.zB)()]}),{signIn:o,signOut:s,signUp:c,useSession:d,updateUser:h,changePassword:u}=a,x=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1071,540,4416,2542,880,2844,3669,2757,1744],function(){return e(e.s=66289)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5931],{66289:function(e,t,r){Promise.resolve().then(r.bind(r,12256))},71185:function(e,t,r){"use strict";var i=r(8091);t.Z=void 0;var n=i(r(66758)),l=r(94655);t.Z=(0,n.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},69123:function(e,t,r){"use strict";var i=r(32324),n=r(81500),l=r(35106),a=r(70316),o=r(65951),s=r(64577),c=r(34519),d=r(28057),h=r(16945),u=r(94655);let x=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],m=e=>{let{absolute:t,children:r,classes:i,flexItem:n,light:l,orientation:a,textAlign:s,variant:c}=e;return(0,o.Z)({root:["root",t&&"absolute",c,l&&"light","vertical"===a&&"vertical",n&&"flexItem",r&&"withChildren",r&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},h.V,i)},v=(0,c.ZP)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})(e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},r.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},r.light&&{borderColor:t.vars?"rgba(".concat(t.vars.palette.dividerChannel," / 0.08)"):(0,s.Fq)(t.palette.divider,.08)},"inset"===r.variant&&{marginLeft:72},"middle"===r.variant&&"horizontal"===r.orientation&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},"middle"===r.variant&&"vertical"===r.orientation&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},"vertical"===r.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},r.flexItem&&{alignSelf:"stretch",height:"auto"})},e=>{let{ownerState:t}=e;return(0,n.Z)({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}})},e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({},r.children&&"vertical"!==r.orientation&&{"&::before, &::after":{width:"100%",borderTop:"thin solid ".concat((t.vars||t).palette.divider),borderTopStyle:"inherit"}})},e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({},r.children&&"vertical"===r.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:"thin solid ".concat((t.vars||t).palette.divider),borderLeftStyle:"inherit"}})},e=>{let{ownerState:t}=e;return(0,n.Z)({},"right"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})}),Z=(0,c.ZP)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})(e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({display:"inline-block",paddingLeft:"calc(".concat(t.spacing(1)," * 1.2)"),paddingRight:"calc(".concat(t.spacing(1)," * 1.2)")},"vertical"===r.orientation&&{paddingTop:"calc(".concat(t.spacing(1)," * 1.2)"),paddingBottom:"calc(".concat(t.spacing(1)," * 1.2)")})}),f=l.forwardRef(function(e,t){let r=(0,d.i)({props:e,name:"MuiDivider"}),{absolute:l=!1,children:o,className:s,component:c=o?"div":"hr",flexItem:h=!1,light:f=!1,orientation:p="horizontal",role:g="hr"!==c?"separator":void 0,textAlign:j="center",variant:b="fullWidth"}=r,y=(0,i.Z)(r,x),w=(0,n.Z)({},r,{absolute:l,component:c,flexItem:h,light:f,orientation:p,role:g,textAlign:j,variant:b}),C=m(w);return(0,u.jsx)(v,(0,n.Z)({as:c,className:(0,a.Z)(C.root,s),role:g,ref:t,ownerState:w},y,{children:o?(0,u.jsx)(Z,{className:C.wrapper,ownerState:w,children:o}):null}))});f.muiSkipListHighlight=!0,t.Z=f},16945:function(e,t,r){"use strict";r.d(t,{V:function(){return l}});var i=r(11379),n=r(9049);function l(e){return(0,n.ZP)("MuiDivider",e)}let a=(0,i.Z)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);t.Z=a},53281:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var i=r(81500),n=r(32324),l=r(35106),a=r(70316),o=r(65951),s=r(28057),c=r(34519),d=r(11379),h=r(9049);function u(e){return(0,h.ZP)("MuiTableContainer",e)}(0,d.Z)("MuiTableContainer",["root"]);var x=r(94655);let m=["className","component"],v=e=>{let{classes:t}=e;return(0,o.Z)({root:["root"]},u,t)},Z=(0,c.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"});var f=l.forwardRef(function(e,t){let r=(0,s.i)({props:e,name:"MuiTableContainer"}),{className:l,component:o="div"}=r,c=(0,n.Z)(r,m),d=(0,i.Z)({},r,{component:o}),h=v(d);return(0,x.jsx)(Z,(0,i.Z)({ref:t,as:o,className:(0,a.Z)(h.root,l),ownerState:d},c))})},12256:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return R}});var i=r(94655),n=r(35106),l=r(7281),a=r(93017),o=r(81071),s=r(31317),c=r(5632),d=r(6986),h=r(53281),u=r(69899),x=r(21138),m=r(11254),v=r(70366),Z=r(47001),f=r(84811),p=r(25333);function g(e){let{users:t,onUserClick:r}=e;return 0===t.length?(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",p:4},children:(0,i.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"No users found"})}):(0,i.jsx)(h.Z,{component:u.Z,children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(m.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(Z.Z,{children:"Email"}),(0,i.jsx)(Z.Z,{children:"Name"}),(0,i.jsx)(Z.Z,{children:"Role"}),(0,i.jsx)(Z.Z,{children:"Status"}),(0,i.jsx)(Z.Z,{children:"Created At"})]})}),(0,i.jsx)(f.Z,{children:t.map(e=>(0,i.jsxs)(v.Z,{hover:!0,onClick:()=>r(e),sx:{cursor:"pointer"},children:[(0,i.jsx)(Z.Z,{children:e.email}),(0,i.jsx)(Z.Z,{children:e.name||"N/A"}),(0,i.jsx)(Z.Z,{children:"admin"===e.role?(0,i.jsx)(p.Z,{label:"Admin",color:"primary",size:"small"}):(0,i.jsx)(p.Z,{label:"User",size:"small"})}),(0,i.jsx)(Z.Z,{children:e.banned?(0,i.jsx)(p.Z,{label:"Banned",color:"error",size:"small"}):(0,i.jsx)(p.Z,{label:"Active",color:"success",size:"small"})}),(0,i.jsx)(Z.Z,{children:new Date(e.createdAt).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]},e.id))})]})})}var j=r(99770),b=r(62508),y=r(79983),w=r(5682),C=r(69123),A=r(71185);function S(e){let{user:t,open:r,onClose:n}=e;return(0,i.jsxs)(j.Z,{open:r,onClose:n,maxWidth:"sm",fullWidth:!0,children:[(0,i.jsx)(b.Z,{children:(0,i.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(s.Z,{variant:"h6",children:"User Details"}),(0,i.jsx)(y.Z,{onClick:n,size:"small","aria-label":"close",children:(0,i.jsx)(A.Z,{})})]})}),(0,i.jsx)(w.Z,{children:(0,i.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Email"}),(0,i.jsx)(s.Z,{variant:"body1",children:t.email})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Name"}),(0,i.jsx)(s.Z,{variant:"body1",children:t.name||"N/A"})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Role"}),(0,i.jsx)(l.Z,{sx:{mt:.5},children:"admin"===t.role?(0,i.jsx)(p.Z,{label:"Admin",color:"primary",size:"small"}):(0,i.jsx)(p.Z,{label:"User",size:"small"})})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Status"}),(0,i.jsx)(l.Z,{sx:{mt:.5},children:t.banned?(0,i.jsx)(p.Z,{label:"Banned",color:"error",size:"small"}):(0,i.jsx)(p.Z,{label:"Active",color:"success",size:"small"})})]}),(0,i.jsx)(C.Z,{}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Created At"}),(0,i.jsx)(s.Z,{variant:"body2",children:new Date(t.createdAt).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"User ID"}),(0,i.jsx)(s.Z,{variant:"body2",sx:{fontFamily:'"Roboto Mono", monospace',fontSize:"0.875rem"},children:t.id})]})]})})]})}function R(){let{data:e,isLoading:t,isError:r,error:h}=(0,c.a)({queryKey:["admin","users"],queryFn:async()=>{let{data:e,error:t}=await d.zB.listUsers({query:{}});if(t)throw Error(t.message||"Failed to fetch users");return(null==e?void 0:e.users)?e.users.map(e=>{var t,r,i;return{id:e.id,email:e.email,name:null!==(t=e.name)&&void 0!==t?t:null,role:null!==(r=e.role)&&void 0!==r?r:"user",banned:null!==(i=e.banned)&&void 0!==i&&i,createdAt:new Date(e.createdAt)}}):[]}}),[u,x]=(0,n.useState)(null);return t?(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"400px"},children:(0,i.jsx)(a.Z,{})}):r?(0,i.jsx)(l.Z,{sx:{p:3},children:(0,i.jsxs)(o.Z,{severity:"error",children:["Failed to load users. ",(null==h?void 0:h.message)||"Please try again later."]})}):(0,i.jsxs)(l.Z,{sx:{p:3},children:[(0,i.jsx)(s.Z,{variant:"h4",component:"h1",gutterBottom:!0,children:"User Management"}),(0,i.jsx)(g,{users:e||[],onUserClick:e=>{x(e)}}),u&&(0,i.jsx)(S,{user:u,open:!0,onClose:()=>{x(null)}})]})}},6986:function(e,t,r){"use strict";r.d(t,{Cp:function(){return u},Nq:function(){return h},cg:function(){return o},kP:function(){return d},w7:function(){return s},y1:function(){return c},zB:function(){return x}});var i=r(77054),n=r(61648),l=r(35016);let a=(0,i.X)({baseURL:l.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,n.zB)()]}),{signIn:o,signOut:s,signUp:c,useSession:d,updateUser:h,changePassword:u}=a,x=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1071,540,4416,2542,880,2844,3669,2757,1744],function(){return e(e.s=66289)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4743],{3590:function(e,t,r){Promise.resolve().then(r.bind(r,52791))},52791:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return eS}});var n=r(94655),s=r(35106),i=r(74228),a=r(7281),o=r(69899),l=r(31317),c=r(25333),d=r(76492),u=r(80620),x=r(78439),h=r(56813),m=r(26892),p=r(84840),g=r(628),j=r(41565),f=r(10721),v=r(69178),Z=r(46207),y=r(45354),b=r(35847);function S(e){var t,r,s;let{stats:i,isLoading:o}=e;if(o)return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:[0,1,2,3].map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{children:(0,n.jsxs)(j.Z,{children:[(0,n.jsx)(f.Z,{variant:"text",width:"60%"}),(0,n.jsx)(f.Z,{variant:"text",width:"40%",height:40}),(0,n.jsx)(f.Z,{variant:"text",width:"80%"})]})})},e))});let c=null!==(t=null==i?void 0:i.total)&&void 0!==t?t:0,d=c>0?((null!==(r=null==i?void 0:i.byStatus.success)&&void 0!==r?r:0)/c*100).toFixed(1):"0.0",u=null!==(s=null==i?void 0:i.byStatus.failure)&&void 0!==s?s:0,x=i?Object.keys(i.byActor).length:0,h=[{title:"Total Logs",value:c.toLocaleString(),icon:(0,n.jsx)(v.Z,{fontSize:"large"}),color:"#1bd96a",description:"All audit log entries"},{title:"Success Rate",value:"".concat(d,"%"),icon:(0,n.jsx)(Z.Z,{fontSize:"large"}),color:"#22c55e",description:"Successful operations"},{title:"Failures",value:u,icon:(0,n.jsx)(y.Z,{fontSize:"large"}),color:"#ef4444",description:"Failed operations"},{title:"Active Users",value:x,icon:(0,n.jsx)(b.Z,{fontSize:"large"}),color:"#3b82f6",description:"Unique actors"}];return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:h.map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:e.color}},children:(0,n.jsxs)(j.Z,{children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:e.title}),(0,n.jsx)(a.Z,{sx:{color:e.color,opacity:.8},children:e.icon})]}),(0,n.jsx)(l.Z,{variant:"h3",component:"div",sx:{fontWeight:700,color:"text.primary",mb:1},children:e.value}),(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",children:e.description})]})})},e.title))})}var C=r(97436),w=r(62328),T=r(7178),k=r(29793),z=r(75726),R=r(30417),N=r(87716),A=r(79983),E=r(89923),I=r(10297),F=r(50880),L=r(54617),D=r(42431),P=r(81960),W=r(84284),M=r(82925);function O(e){return"server"===e?M.Xn:"player"===e?M.KK:M.xg}function U(e){let t,{filters:r,onFiltersChange:i,onExport:o}=e,[d,u]=(0,s.useState)(!0),x=(t=0,r.action&&t++,r.actor&&t++,r.targetType&&t++,r.targetName&&t++,r.status&&t++,r.from&&t++,r.to&&t++,t),h=O(r.targetType),m=(e,t)=>{let n={...r};""===t||void 0===t?delete n[e]:n[e]=t,"targetType"===e&&n.action&&!O(t).includes(n.action)&&delete n.action,n.offset=0,i(n)};return(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:d?2:0},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsxs)(A.Z,{onClick:()=>u(!d),size:"small","aria-label":d?"Collapse filters":"Expand filters",children:[(0,n.jsx)(F.Z,{}),d?(0,n.jsx)(W.Z,{sx:{fontSize:14}}):(0,n.jsx)(P.Z,{sx:{fontSize:14}})]}),(0,n.jsx)(l.Z,{variant:"subtitle2",color:"text.secondary",children:"Filters"}),x>0&&(0,n.jsx)(c.Z,{label:x,size:"small",color:"primary",sx:{height:20,fontSize:"0.7rem"}})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[x>0&&(0,n.jsx)(R.Z,{size:"small",startIcon:(0,n.jsx)(L.Z,{}),onClick:()=>{i({limit:r.limit,sort:r.sort})},color:"inherit",children:"Clear All"}),o&&(0,n.jsx)(R.Z,{size:"small",variant:"outlined",onClick:o,children:"Export"})]})]}),(0,n.jsx)(N.Z,{in:d,children:(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:2,flexWrap:"wrap"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1,alignItems:"center"},children:[(0,n.jsx)(C.Z,{type:"date",label:"From",size:"small",value:r.from?r.from.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("from",t?"".concat(t,"T00:00:00Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"~"}),(0,n.jsx)(C.Z,{type:"date",label:"To",size:"small",value:r.to?r.to.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("to",t?"".concat(t,"T23:59:59Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}})]}),(0,n.jsxs)(k.Z,{size:"small",sx:{minWidth:160},children:[(0,n.jsx)(z.Z,{children:"Action"}),(0,n.jsxs)(w.Z,{value:r.action||"",label:"Action",onChange:e=>m("action",e.target.value||void 0),children:[(0,n.jsx)(T.Z,{value:"",children:"All Actions"}),h.map(e=>(0,n.jsx)(T.Z,{value:e,children:M.n3[e]||e},e))]})]}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.targetType||"",exclusive:!0,onChange:(e,t)=>m("targetType",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All targets",children:"All"}),(0,n.jsx)(E.Z,{value:"server","aria-label":"Server targets",children:"Server"}),(0,n.jsx)(E.Z,{value:"player","aria-label":"Player targets",children:"Player"})]})}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.status||"",exclusive:!0,onChange:(e,t)=>m("status",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All statuses",children:"All"}),(0,n.jsx)(E.Z,{value:"success","aria-label":"Success only",children:"Success"}),(0,n.jsx)(E.Z,{value:"failure","aria-label":"Failure only",children:"Failure"})]})}),(0,n.jsx)(C.Z,{label:"Target Name",placeholder:"Search...",size:"small",value:r.targetName||"",onChange:e=>m("targetName",e.target.value||void 0),InputProps:{startAdornment:(0,n.jsx)(D.Z,{sx:{color:"text.secondary",mr:.5,fontSize:18}})},sx:{minWidth:160}}),(0,n.jsx)(C.Z,{label:"Actor",placeholder:"e.g., api:admin",size:"small",value:r.actor||"",onChange:e=>m("actor",e.target.value||void 0),sx:{minWidth:140}})]})})]})}var q=r(21138),K=r(84811),_=r(47001),B=r(53281),V=r(11254),X=r(70366),J=r(6406),H=r(95511),G=r(81071),Q=r(89161),Y=r(60236),$=r(27171),ee=r(30114),et=r(46725);function er(e){var t,r;let{log:i,onClick:o}=e,[d,u]=(0,s.useState)("failure"===i.status),x=i.details&&Object.keys(i.details).length>0,p="failure"===i.status&&i.errorMessage,g=x||p,j=(t=i.targetType,r=i.targetName,"server"===t?"/servers/".concat(encodeURIComponent(r)):"player"===t?"/players":null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(X.Z,{hover:!0,sx:{cursor:"pointer","&:last-child td, &:last-child th":{border:0}},onClick:()=>null==o?void 0:o(i),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==o||o(i))},role:"button","aria-label":"".concat(i.action," by ").concat(i.actor," on ").concat(i.targetName),children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48},children:g&&(0,n.jsx)(A.Z,{size:"small",onClick:e=>{e.stopPropagation(),u(!d)},"aria-label":d?"Collapse details":"Expand details",children:d?(0,n.jsx)(Y.Z,{}):(0,n.jsx)(Q.Z,{})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(H.Z,{title:function(e){let t=new Date(e);return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(t)}(i.timestamp),arrow:!0,children:(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3),s=Math.floor(n/60),i=Math.floor(s/60),a=Math.floor(i/24);return n<60?"just now":s<60?"".concat(s,"m ago"):i<24?"".concat(i,"h ago"):a<7?"".concat(a,"d ago"):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(r)}(i.timestamp)})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(h.I,{action:i.action})}),(0,n.jsx)(_.Z,{children:i.actor.startsWith("cli:")?(0,n.jsx)(c.Z,{label:i.actor.replace("cli:",""),size:"small",variant:"outlined",sx:{fontSize:"0.75rem"}}):(0,n.jsx)(l.Z,{variant:"body2",children:i.actor.replace("api:","")})}),(0,n.jsx)(_.Z,{children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[function(e){switch(e){case"server":return(0,n.jsx)($.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});case"player":return(0,n.jsx)(ee.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});default:return null}}(i.targetType),j?(0,n.jsx)(et.default,{href:j,style:{textDecoration:"none"},onClick:e=>e.stopPropagation(),children:(0,n.jsx)(l.Z,{variant:"body2",sx:{color:"primary.main","&:hover":{textDecoration:"underline"}},children:i.targetName})}):(0,n.jsx)(l.Z,{variant:"body2",children:i.targetName})]})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(m.c,{status:i.status})})]}),g&&(0,n.jsx)(X.Z,{children:(0,n.jsx)(_.Z,{sx:{py:0},colSpan:6,children:(0,n.jsx)(N.Z,{in:d,timeout:"auto",unmountOnExit:!0,children:(0,n.jsxs)(a.Z,{sx:{py:2,px:2},children:[p&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:i.errorMessage}),x&&(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{mb:1,display:"block"},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",sx:{width:"auto"},children:(0,n.jsx)(K.Z,{children:Object.entries(i.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]})]})})})})]})}function en(e){let{logs:t,total:r,isLoading:s,error:i,filters:a,onFiltersChange:c,onRowClick:d,onRetry:u}=e,x=Math.floor((a.offset||0)/(a.limit||50)),h=a.limit||50;return s?(0,n.jsx)(o.Z,{children:(0,n.jsx)(B.Z,{children:(0,n.jsxs)(q.Z,{children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:"Timestamp"}),(0,n.jsx)(_.Z,{children:"Action"}),(0,n.jsx)(_.Z,{children:"Actor"}),(0,n.jsx)(_.Z,{children:"Target"}),(0,n.jsx)(_.Z,{children:"Status"})]})}),(0,n.jsx)(K.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:80})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:70,height:24})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:60})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:100})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:50,height:24})})]},t))})]})})}):i?(0,n.jsx)(G.Z,{severity:"error",action:u&&(0,n.jsx)(R.Z,{color:"inherit",size:"small",onClick:u,children:"Retry"}),children:i.message||"Failed to load audit logs"}):0===t.length?(0,n.jsxs)(o.Z,{sx:{p:6,textAlign:"center"},children:[(0,n.jsx)(v.Z,{sx:{fontSize:64,color:"text.disabled",mb:2}}),(0,n.jsx)(l.Z,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"No audit logs found"}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.disabled",sx:{mb:2},children:"Try adjusting your filters or check back later."}),(0,n.jsx)(R.Z,{variant:"outlined",size:"small",onClick:()=>c({limit:a.limit,sort:a.sort}),children:"Reset Filters"})]}):(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(B.Z,{sx:{overflowX:"auto"},children:(0,n.jsxs)(q.Z,{size:"small",children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48}}),(0,n.jsx)(_.Z,{sx:{fontWeight:600,whiteSpace:"nowrap"},children:"Timestamp"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Action"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Actor"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Target"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Status"})]})}),(0,n.jsx)(K.Z,{children:t.map(e=>(0,n.jsx)(er,{log:e,onClick:d},e.id))})]})}),(0,n.jsx)(J.Z,{component:"div",count:r,page:x,onPageChange:(e,t)=>{c({...a,offset:t*h})},rowsPerPage:h,onRowsPerPageChange:e=>{let t=parseInt(e.target.value,10);c({...a,limit:t,offset:0})},rowsPerPageOptions:[25,50,100],"aria-label":"Audit log pagination"})]})}var es=r(62142),ei=r(69123),ea=r(33402),eo=r(60097),el=r(90158),ec=r(58347),ed=r(73424),eu=r(93017),ex=r(71185),eh=r(84509);function em(e){let{logs:t}=e;return 0===t.length?(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No related logs found"}):(0,n.jsx)(el.Z,{dense:!0,sx:{py:0},children:t.map(e=>(0,n.jsx)(ec.ZP,{sx:{px:0,py:1,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,n.jsx)(ed.Z,{primary:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(h.I,{action:e.action,size:"small"}),e.targetName&&(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e.targetName})]}),secondary:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/6e4),s=Math.floor(n/60);return n<60?"".concat(n,"m ago"):s<24?"".concat(s,"h ago"):"".concat(Math.floor(s/24),"d ago")}(e.timestamp)})},e.id))})}function ep(e){var t,r,i,o,c;let{log:d,open:u,onClose:x}=e,[p,g]=(0,s.useState)(0),{data:j,isLoading:f}=(0,eh.VM)(null!==(t=null==d?void 0:d.id)&&void 0!==t?t:null,{enabled:u&&!!d});return(0,n.jsxs)(es.ZP,{anchor:"right",open:u,onClose:x,sx:{"& .MuiDrawer-paper":{width:{xs:"100%",sm:420},maxWidth:"100%"}},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:2,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsx)(l.Z,{variant:"h6",component:"h2",children:"Audit Log Detail"}),(0,n.jsx)(A.Z,{onClick:x,"aria-label":"Close detail drawer",autoFocus:!0,children:(0,n.jsx)(ex.Z,{})})]}),(0,n.jsx)(a.Z,{sx:{p:2,overflow:"auto",flex:1},children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"ID"}),(0,n.jsx)(l.Z,{variant:"body2",sx:{fontFamily:'"Roboto Mono", monospace',fontSize:"0.8rem",wordBreak:"break-all"},children:d.id})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Timestamp"}),(0,n.jsx)(l.Z,{variant:"body2",children:function(e){let t=new Date(e);return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(t)}(d.timestamp)})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:3,mb:3},children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Action"}),(0,n.jsx)(h.I,{action:d.action,size:"medium"})]}),(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Status"}),(0,n.jsx)(m.c,{status:d.status,size:"medium"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Actor"}),(0,n.jsx)(l.Z,{variant:"body2",children:d.actor})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Target"}),(0,n.jsxs)(l.Z,{variant:"body2",children:[d.targetType,"/",d.targetName]})]}),"failure"===d.status&&d.errorMessage&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:3},children:d.errorMessage}),d.details&&Object.keys(d.details).length>0&&(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",children:(0,n.jsx)(K.Z,{children:Object.entries(d.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0,width:"40%"},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]}),(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Related Logs"}),f?(0,n.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",py:3},children:(0,n.jsx)(eu.Z,{size:24})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ea.Z,{value:p,onChange:(e,t)=>g(t),sx:{mb:1},children:[(0,n.jsx)(eo.Z,{label:"Same Target (".concat(null!==(r=null==j?void 0:j.relatedLogs.sameTarget.length)&&void 0!==r?r:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}}),(0,n.jsx)(eo.Z,{label:"Same Actor (".concat(null!==(i=null==j?void 0:j.relatedLogs.sameActor.length)&&void 0!==i?i:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}})]}),0===p&&(0,n.jsx)(em,{logs:null!==(o=null==j?void 0:j.relatedLogs.sameTarget)&&void 0!==o?o:[]}),1===p&&(0,n.jsx)(em,{logs:null!==(c=null==j?void 0:j.relatedLogs.sameActor)&&void 0!==c?c:[]})]})]}):(0,n.jsx)(l.Z,{color:"text.secondary",children:"No log selected"})})]})}var eg=r(99770),ej=r(62508),ef=r(5682),ev=r(76678),eZ=r(15761);function ey(e){let{open:t,onClose:r,filters:i,totalCount:o}=e,[c,d]=(0,s.useState)("csv"),[u,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),p=function(e){let t=[];return e.action&&t.push("Action: ".concat(e.action)),e.actor&&t.push("Actor: ".concat(e.actor)),e.targetType&&t.push("Type: ".concat(e.targetType)),e.targetName&&t.push("Target: ".concat(e.targetName)),e.status&&t.push("Status: ".concat(e.status)),e.from&&t.push("From: ".concat(e.from.split("T")[0])),e.to&&t.push("To: ".concat(e.to.split("T")[0])),t}(i),g=async()=>{x(!0),m(null);try{let e=function(e,t){let r=new URLSearchParams;return r.set("format",t),e.action&&r.set("action",e.action),e.actor&&r.set("actor",e.actor),e.targetType&&r.set("targetType",e.targetType),e.targetName&&r.set("targetName",e.targetName),e.status&&r.set("status",e.status),e.from&&r.set("from",e.from),e.to&&r.set("to",e.to),"/api/audit-logs/export?".concat(r.toString())}(i,c),t=await fetch(e);if(!t.ok){let e=await t.json().catch(()=>({message:"Export failed"}));throw Error(e.message||"Export failed")}let n=await t.blob(),s=window.URL.createObjectURL(n),a=document.createElement("a");a.href=s;let o=t.headers.get("Content-Disposition"),l=null==o?void 0:o.match(/filename="?([^"]+)"?/);a.download=(null==l?void 0:l[1])||"audit-logs.".concat(c),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),r()}catch(e){m(e instanceof Error?e.message:"Export failed")}finally{x(!1)}};return(0,n.jsxs)(eg.Z,{open:t,onClose:r,maxWidth:"sm",fullWidth:!0,children:[(0,n.jsx)(ej.Z,{children:"Export Audit Logs"}),(0,n.jsxs)(ef.Z,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Format"}),(0,n.jsxs)(I.Z,{value:c,exclusive:!0,onChange:(e,t)=>t&&d(t),size:"small",children:[(0,n.jsx)(E.Z,{value:"csv",children:"CSV"}),(0,n.jsx)(E.Z,{value:"json",children:"JSON"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Applied Filters"}),p.length>0?(0,n.jsx)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:p.map(e=>(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e},e))}):(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"No filters applied (all logs)"})]}),(0,n.jsxs)(a.Z,{sx:{mb:2},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:.5},children:"Estimated Rows"}),(0,n.jsxs)(l.Z,{variant:"body2",color:"text.secondary",children:[Math.min(o,5e3).toLocaleString()," rows"]})]}),o>5e3&&(0,n.jsxs)(G.Z,{severity:"warning",sx:{mb:2},children:["Export is limited to ",5e3.toLocaleString()," rows. Total matching logs: ",o.toLocaleString(),". Consider narrowing your filters for a complete export."]}),h&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:h})]}),(0,n.jsxs)(ev.Z,{children:[(0,n.jsx)(R.Z,{onClick:r,disabled:u,children:"Cancel"}),(0,n.jsx)(R.Z,{variant:"contained",startIcon:u?(0,n.jsx)(eu.Z,{size:16,color:"inherit"}):(0,n.jsx)(eZ.Z,{}),onClick:g,disabled:u,children:u?"Exporting...":"Export ".concat(c.toUpperCase())})]})]})}var eb=r(93757);function eS(){var e,t,r;let h=(0,i.useRouter)(),m=(0,i.useSearchParams)(),[p,g]=(0,s.useState)(()=>(function(e){let t={},r=e.get("action"),n=e.get("actor"),s=e.get("targetType"),i=e.get("targetName"),a=e.get("status"),o=e.get("from"),l=e.get("to"),c=e.get("limit"),d=e.get("offset"),u=e.get("sort");return r&&(t.action=r),n&&(t.actor=n),s&&(t.targetType=s),i&&(t.targetName=i),a&&(t.status=a),o&&(t.from=o),l&&(t.to=l),c&&(t.limit=parseInt(c,10)),d&&(t.offset=parseInt(d,10)),("timestamp:asc"===u||"timestamp:desc"===u)&&(t.sort=u),t})(m)),[j,f]=(0,s.useState)(null),[v,Z]=(0,s.useState)(!1),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(0),T=(0,s.useRef)(new Set),{data:k,isLoading:z,error:R,refetch:N}=(0,eh.hT)(p),{data:A,isLoading:E}=(0,eh.DM)(),{isConnected:I}=(0,eb.D)({url:"/api/audit-logs/stream",enabled:!0,onMessage:(0,s.useCallback)(e=>{if("audit-log"===e.type){let t=e.data;if("id"in t&&"string"==typeof t.id){if(T.current.has(t.id))return;if(T.current.add(t.id),T.current.size>1e3){let e=Array.from(T.current);T.current=new Set(e.slice(e.length-500))}}w(e=>e+1)}},[]),reconnectInterval:3e3,maxReconnectAttempts:1/0});(0,s.useEffect)(()=>{let e=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),e.limit&&50!==e.limit&&t.set("limit",String(e.limit)),e.offset&&e.offset>0&&t.set("offset",String(e.offset)),e.sort&&"timestamp:desc"!==e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(p);e!==(m.toString()?"?".concat(m.toString()):"")&&h.replace("/audit-logs".concat(e),{scroll:!1})},[p,h,m]);let F=(0,s.useCallback)(e=>{g(e),w(0)},[]),L=(0,s.useCallback)(e=>{f(e),Z(!0)},[]),D=(0,s.useCallback)(()=>{w(0),N()},[N]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,d.Fq)(e.palette.warning.main,.1)," 0%, ").concat((0,d.Fq)(e.palette.error.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,d.Fq)(e.palette.warning.main,.2))},children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"warning.main",color:"warning.contrastText"},children:(0,n.jsx)(u.Z,{sx:{fontSize:32}})}),(0,n.jsxs)(a.Z,{sx:{flex:1},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[(0,n.jsx)(l.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Audit Log"}),(0,n.jsx)(c.Z,{icon:(0,n.jsx)(x.Z,{sx:{fontSize:10,color:I?"success.main":"text.disabled",animation:I?"pulse 2s infinite":"none","@keyframes pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}}),label:I?"Live":"Offline",size:"small",variant:"outlined",sx:{fontSize:"0.7rem"}})]}),(0,n.jsx)(l.Z,{variant:"body1",color:"text.secondary",children:"Monitor all management activities across your servers"})]})]})}),(0,n.jsx)(a.Z,{sx:{mb:3},children:(0,n.jsx)(S,{stats:A,isLoading:E})}),C>0&&(0,n.jsx)(a.Z,{sx:{mb:2,p:1.5,textAlign:"center",bgcolor:"primary.main",color:"primary.contrastText",borderRadius:1,cursor:"pointer","&:hover":{opacity:.9}},onClick:D,role:"button","aria-label":"".concat(C," new logs, click to refresh"),children:(0,n.jsxs)(l.Z,{variant:"body2",fontWeight:600,children:[C," new ",1===C?"log":"logs"," available - Click to refresh"]})}),(0,n.jsx)(U,{filters:p,onFiltersChange:F,onExport:()=>b(!0)}),(0,n.jsx)(en,{logs:null!==(e=null==k?void 0:k.logs)&&void 0!==e?e:[],total:null!==(t=null==k?void 0:k.total)&&void 0!==t?t:0,isLoading:z,error:R,filters:p,onFiltersChange:F,onRowClick:L,onRetry:()=>N()}),(0,n.jsx)(ep,{log:j,open:v,onClose:()=>{Z(!1),f(null)}}),(0,n.jsx)(ey,{open:y,onClose:()=>b(!1),filters:p,totalCount:null!==(r=null==k?void 0:k.total)&&void 0!==r?r:0})]})}},56813:function(e,t,r){"use strict";r.d(t,{I:function(){return a}});var n=r(94655),s=r(25333),i=r(82925);function a(e){let{action:t,size:r="small"}=e,a=i.Lu[t]||"default",o=i.n3[t]||t;return(0,n.jsx)(s.Z,{label:o,color:a,size:r,variant:"filled",sx:{fontWeight:600,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},26892:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var n=r(94655),s=r(25333),i=r(46207),a=r(43436);function o(e){let{status:t,size:r="small"}=e;return(0,n.jsx)(s.Z,{icon:"success"===t?(0,n.jsx)(i.Z,{}):(0,n.jsx)(a.Z,{}),label:"success"===t?"OK":"Error",color:"success"===t?"success":"error",size:r,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},42936:function(e,t,r){"use strict";async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={...t.headers};t.body&&(r["Content-Type"]="application/json");let n=await fetch(e,{...t,headers:r});if(!n.ok){let e=await n.json().catch(()=>({error:"UnknownError",message:n.statusText})),t=Error(e.message);throw t.statusCode=n.status,t.code=e.error,t}return n.json()}r.d(t,{SC:function(){return n}})},84509:function(e,t,r){"use strict";r.d(t,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return c}});var n=r(5632),s=r(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),void 0!==e.limit&&t.set("limit",String(e.limit)),void 0!==e.offset&&t.set("offset",String(e.offset)),e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(e);return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1})}function a(e){return(0,n.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,s.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,t){return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function l(e,t){var r;return i({targetType:"server",targetName:e,limit:null!==(r=null==t?void 0:t.limit)&&void 0!==r?r:20},{enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},93757:function(e,t,r){"use strict";r.d(t,{D:function(){return i}});var n=r(35106);class s{connect(e){this.options=e,this.shouldReconnect=!0,this.establishConnection()}establishConnection(){this.options&&(this.updateState("connecting"),this.eventSource&&this.eventSource.close(),this.eventSource=new EventSource(this.options.url,{withCredentials:this.options.withCredentials||!1}),this.eventSource.onopen=()=>{this.updateState("connected"),this.retryCount=0,this.lastError=null},this.eventSource.onmessage=e=>{if(!e.data.startsWith(":"))try{var t,r;let n=JSON.parse(e.data);null===(r=this.options)||void 0===r||null===(t=r.onMessage)||void 0===t||t.call(r,n)}catch(e){console.warn("Failed to parse SSE message:",e)}},this.eventSource.onerror=()=>{var e,t;let r={message:"SSE connection error",code:"CONNECTION_ERROR",retryCount:this.retryCount,timestamp:new Date};this.lastError=r,this.updateState("error"),null===(t=this.options)||void 0===t||null===(e=t.onError)||void 0===e||e.call(t,r),this.shouldReconnect&&this.scheduleReconnect()})}scheduleReconnect(){var e,t;if(!this.options)return;let r=null!==(e=this.options.maxReconnectAttempts)&&void 0!==e?e:1/0;if(this.retryCount>=r)return;this.reconnectTimer&&clearTimeout(this.reconnectTimer);let n=null!==(t=this.options.reconnectInterval)&&void 0!==t?t:3e3;this.reconnectTimer=setTimeout(()=>{this.retryCount++,this.establishConnection()},n)}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.updateState("disconnected")}getState(){return this.state}isConnected(){return"connected"===this.state}getLastError(){return this.lastError}getRetryCount(){return this.retryCount}reconnect(){this.retryCount++,this.shouldReconnect=!0,this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.establishConnection()}updateState(e){var t,r;this.state=e,null===(r=this.options)||void 0===r||null===(t=r.onStateChange)||void 0===t||t.call(r,e)}constructor(){this.eventSource=null,this.state="disconnected",this.retryCount=0,this.lastError=null,this.reconnectTimer=null,this.options=null,this.shouldReconnect=!0}}function i(e){let{url:t,onMessage:r,onError:i,reconnectInterval:a=3e3,maxReconnectAttempts:o=1/0,enabled:l=!0,withCredentials:c=!1}=e,[d,u]=(0,n.useState)(null),[x,h]=(0,n.useState)("disconnected"),[m,p]=(0,n.useState)(null),[g,j]=(0,n.useState)(0),f=(0,n.useRef)(null),v=(0,n.useCallback)(e=>{u(e),null==r||r(e)},[r]),Z=(0,n.useCallback)(e=>{h(e),"connected"===e&&j(0)},[]),y=(0,n.useCallback)(e=>{p(e),"number"==typeof e.retryCount&&j(e.retryCount),null==i||i(e)},[i]),b=(0,n.useCallback)(()=>{f.current&&(f.current.reconnect(),j(f.current.getRetryCount()))},[]),S=(0,n.useCallback)(()=>{f.current&&f.current.disconnect()},[]);return(0,n.useEffect)(()=>{if(!l){f.current&&(f.current.disconnect(),f.current=null);return}return f.current||(f.current=new s),f.current.connect({url:t,onMessage:v,onStateChange:Z,onError:y,reconnectInterval:a,maxReconnectAttempts:o,withCredentials:c}),()=>{f.current&&(f.current.disconnect(),f.current=null)}},[t,l,a,o,c,v,Z,y]),{data:d,isConnected:"connected"===x,state:x,error:m,retryCount:g,reconnect:b,disconnect:S}}},82925:function(e,t,r){"use strict";r.d(t,{KK:function(){return o},Lu:function(){return n},Xn:function(){return a},n3:function(){return s},xg:function(){return i}});let n={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},s={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],o=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,5511,880,55,2844,8347,6909,4187,4240,8233,3669,2757,1744],function(){return e(e.s=3590)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[278],{59616:function(e,t,r){Promise.resolve().then(r.bind(r,46812))},46812:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return to}});var s=r(94655),n=r(35106),i=r(74228),a=r(31358),l=r(7281),o=r(30417),d=r(79983),c=r(81071),x=r(93017),u=r(10721),h=r(628),p=r(41565),m=r(31317),v=r(35694),y=r(7178),g=r(17820),j=r(73424),b=r(99770),f=r(62508),Z=r(5682),w=r(76678),C=r(97436),S=r(84840),k=r(76492),R=r(10117),T=r(5501),I=r(37809),z=r(21111),F=r(17978),P=r(89573),W=r(96292),A=r(33104),M=r(25333),D=r(52082),O=r(69123),E=r(71185),q=r(30165),N=r(97293),U=r(11259),B=r(66615),L=r(89161),H=r(34071),K=r(4405);function G(e){let{value:t,unit:r,label:n,icon:i,progress:a,progressMax:o,color:d="#1bd96a"}=e;return(0,s.jsxs)(h.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"baseline",gap:.75,flexWrap:"wrap",minWidth:0},children:[(0,s.jsx)(m.Z,{variant:"h4",component:"span",sx:{fontWeight:700,color:"text.primary",fontFamily:'"Roboto Mono", monospace',letterSpacing:"-0.5px"},children:t}),(0,s.jsx)(m.Z,{variant:"body2",component:"span",sx:{color:"text.secondary",fontWeight:500},children:r})]}),(0,s.jsx)(l.Z,{sx:{color:"text.secondary",flexShrink:0},children:i})]}),(0,s.jsx)(m.Z,{variant:"body2",sx:{color:"text.secondary",fontWeight:500,mt:.5},children:n}),(0,s.jsx)(K.Z,{variant:"determinate",value:Math.min(a/o*100,100),sx:{mt:1,height:6,borderRadius:1.5,bgcolor:"#2a2d3a","& .MuiLinearProgress-bar":{borderRadius:1.5,background:"linear-gradient(90deg, ".concat(d," 0%, ").concat(d,"cc 100%)")}}})]})}var V=r(163),J=r(73660),Q=r(90158),_=r(58347),X=r(95511),$=r(46725),Y=r(26577),ee=r(56813),et=r(26892),er=r(84509);function es(e){var t;let{serverName:r}=e,{data:n,isLoading:i,error:a}=(0,er.HZ)(r,{limit:20});if(i)return(0,s.jsx)(l.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,s.jsxs)(l.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,s.jsx)(u.Z,{variant:"rounded",width:60,height:24}),(0,s.jsx)(u.Z,{variant:"text",width:"60%"}),(0,s.jsx)(u.Z,{variant:"text",width:50})]},t))});if(a)return(0,s.jsxs)(c.Z,{severity:"error",children:["Failed to load activity: ",a.message]});let d=null!==(t=null==n?void 0:n.logs)&&void 0!==t?t:[];if(0===d.length)return(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{py:4,textAlign:"center"},children:"No activity recorded for this server yet."});let x="/audit-logs?targetType=server&targetName=".concat(encodeURIComponent(r));return(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(Q.Z,{sx:{py:0},children:d.map(e=>{var t;return(0,s.jsx)(_.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,s.jsx)(j.Z,{primary:(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(ee.I,{action:e.action,size:"small"}),(0,s.jsxs)(m.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),(0,s.jsx)(et.c,{status:e.status,size:"small"})]}),secondary:(0,s.jsx)(X.Z,{title:(t=e.timestamp,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(new Date(t))),arrow:!0,children:(0,s.jsx)(m.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let t=new Date,r=new Date(e),s=Math.floor((t.getTime()-r.getTime())/6e4),n=Math.floor(s/60);return s<1?"just now":s<60?"".concat(s,"m ago"):n<24?"".concat(n,"h ago"):"".concat(Math.floor(n/24),"d ago")}(e.timestamp)})})})},e.id)})}),(0,s.jsx)(l.Z,{sx:{mt:2,textAlign:"center"},children:(0,s.jsx)(o.Z,{component:$.default,href:x,size:"small",endIcon:(0,s.jsx)(Y.Z,{}),sx:{textTransform:"none"},children:"View Full History"})})]})}var en=r(37530),ei=r(84420),ea=r(46121),el=r(84775),eo=r(92666),ed=r(70115),ec=r(70603),ex=r(32366),eu=r(5942),eh=r(25523);function ep(e){let{serverName:t}=e,{data:r,isLoading:i}=(0,eo.Js)(t),a=(0,eo.Bx)(),[u,v]=(0,n.useState)([]),[y,g]=(0,n.useState)(!1),[j,b]=(0,n.useState)(!1),[f,Z]=(0,n.useState)(""),[w,S]=(0,n.useState)(""),[k,R]=(0,n.useState)(!1),[T,I]=(0,n.useState)({open:!1,message:"",severity:"success"});(0,n.useEffect)(()=>{(null==r?void 0:r.customHostnames)&&(v(r.customHostnames),g(!1),R(!1))},[r]);let F=e=>{let t=e.trim().toLowerCase();return t?t.length>253?"Domain exceeds 253 characters":/^[a-z0-9]([a-z0-9\-.]*[a-z0-9])?$/.test(t)?t.endsWith(".local")?"Cannot use .local system domain":t.endsWith(".nip.io")?"Cannot use .nip.io system domain":u.includes(t)?"Domain already exists":"":"Invalid domain format":"Domain cannot be empty"},P=()=>{let e=f.trim().toLowerCase(),t=F(e);if(t){S(t);return}v(t=>[...t,e]),Z(""),S(""),b(!1),g(!0)},W=e=>{v(t=>t.filter(t=>t!==e)),g(!0)},A=async()=>{try{await a.mutateAsync({serverName:t,customHostnames:u}),g(!1),R(!0),I({open:!0,message:"Hostnames saved. Container recreation required to apply changes.",severity:"warning"})}catch(e){I({open:!0,message:e instanceof Error?e.message:"Failed to save hostnames",severity:"error"})}},D=()=>{b(!1),Z(""),S("")};return i?(0,s.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,s.jsx)(p.Z,{children:(0,s.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(x.Z,{size:24})})})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,s.jsx)(eh.Z,{color:"primary"}),(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Hostnames / Domains"})]}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Manage hostnames used by mc-router to route connections to this server."}),(0,s.jsx)(O.Z,{sx:{mb:3}}),(null==r?void 0:r.systemHostnames)&&r.systemHostnames.length>0&&(0,s.jsxs)(l.Z,{sx:{mb:3},children:[(0,s.jsx)(m.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"System Hostnames (read-only)"}),(0,s.jsx)(ed.Z,{direction:"row",flexWrap:"wrap",gap:1,children:r.systemHostnames.map(e=>(0,s.jsx)(M.Z,{icon:(0,s.jsx)(ec.Z,{sx:{fontSize:16}}),label:e.hostname,title:e.description,variant:"outlined",color:"default",size:"small"},e.hostname))})]}),(0,s.jsxs)(l.Z,{sx:{mb:2},children:[(0,s.jsx)(m.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"Custom Domains"}),0===u.length&&!j&&(0,s.jsx)(m.Z,{variant:"body2",color:"text.disabled",sx:{mb:1},children:"No custom domains configured."}),(0,s.jsx)(ed.Z,{spacing:1,children:u.map(e=>(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5,px:1.5,borderRadius:1,bgcolor:"action.hover"},children:[(0,s.jsx)(m.Z,{variant:"body2",fontFamily:'"Roboto Mono", monospace',children:e}),(0,s.jsx)(d.Z,{size:"small",color:"error",onClick:()=>W(e),title:"Remove domain",children:(0,s.jsx)(z.Z,{fontSize:"small"})})]},e))}),j?(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"flex-start",gap:1,mt:1},children:[(0,s.jsx)(C.Z,{size:"small",placeholder:"e.g. play.example.com",value:f,onChange:e=>{Z(e.target.value),S("")},onKeyDown:e=>{"Enter"===e.key&&P(),"Escape"===e.key&&D()},error:!!w,helperText:w,autoFocus:!0,sx:{flex:1}}),(0,s.jsx)(o.Z,{size:"small",variant:"contained",onClick:P,children:"Add"}),(0,s.jsx)(d.Z,{size:"small",onClick:D,children:(0,s.jsx)(E.Z,{fontSize:"small"})})]}):(0,s.jsx)(o.Z,{size:"small",startIcon:(0,s.jsx)(ex.Z,{}),onClick:()=>b(!0),sx:{mt:1},children:"Add Domain"})]}),k&&(0,s.jsxs)(c.Z,{severity:"warning",sx:{mb:2},children:["Container recreation is required for hostname changes to take effect. Run ",(0,s.jsx)("code",{children:"docker compose up -d"})," or restart the server from the dashboard."]}),(0,s.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,s.jsx)(o.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(eu.Z,{}),onClick:A,disabled:!y||a.isPending,children:a.isPending?"Saving...":"Save Hostnames"})})]})}),(0,s.jsx)(en.Z,{open:T.open,autoHideDuration:6e3,onClose:()=>I({...T,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,s.jsx)(c.Z,{onClose:()=>I({...T,open:!1}),severity:T.severity,sx:{width:"100%"},children:T.message})})]})}var em=r(87716),ev=r(81960),ey=r(62328),eg=r(29793),ej=r(75726),eb=r(40064),ef=r(38393),eZ=r(28058),ew=r(42730);function eC(e){var t;let{field:r,value:i,onChange:a}=e,[o,c]=(0,n.useState)(!1),x=null!==(t=r.columns)&&void 0!==t?t:6;return(0,s.jsx)(S.ZP,{item:!0,xs:12,sm:x,children:(()=>{var e,t,n,x,u,h;switch(r.type){case"boolean":return(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(eb.Z,{control:(0,s.jsx)(ef.Z,{checked:null!=i&&i,onChange:e=>a(r.key,e.target.checked)}),label:r.label}),r.helperText&&(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",sx:{ml:4,display:"block"},children:r.helperText})]});case"select":return(0,s.jsxs)(eg.Z,{fullWidth:!0,size:"small",children:[(0,s.jsx)(ej.Z,{children:r.label}),(0,s.jsx)(ey.Z,{value:null!==(x=null!=i?i:null===(t=r.options)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.value)&&void 0!==x?x:"",label:r.label,onChange:e=>a(r.key,e.target.value),children:null===(n=r.options)||void 0===n?void 0:n.map(e=>(0,s.jsx)(y.Z,{value:e.value,children:e.label},e.value))})]});case"number":return(0,s.jsx)(C.Z,{fullWidth:!0,size:"small",type:"number",label:r.label,value:null!=i?i:"",onChange:e=>{let t=e.target.value;a(r.key,""===t?void 0:parseInt(t,10))},inputProps:{min:null===(u=r.validation)||void 0===u?void 0:u.min,max:null===(h=r.validation)||void 0===h?void 0:h.max},helperText:r.helperText,InputProps:r.unit?{endAdornment:(0,s.jsx)(D.Z,{position:"end",children:(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:r.unit})})}:void 0});case"password":return(0,s.jsx)(C.Z,{fullWidth:!0,size:"small",type:o?"text":"password",label:r.label,value:null!=i?i:"",onChange:e=>a(r.key,e.target.value),helperText:r.helperText,InputProps:{endAdornment:(0,s.jsx)(D.Z,{position:"end",children:(0,s.jsx)(d.Z,{size:"small",onClick:()=>c(!o),edge:"end",children:o?(0,s.jsx)(ew.Z,{fontSize:"small"}):(0,s.jsx)(eZ.Z,{fontSize:"small"})})})}});default:return(0,s.jsx)(C.Z,{fullWidth:!0,size:"small",label:r.label,value:null!=i?i:"",onChange:e=>a(r.key,e.target.value),helperText:r.helperText})}})()})}function eS(e){let{section:t,values:r,onChange:i}=e,[a,d]=(0,n.useState)(!1),c=t.icon,x=t.advancedFields.length;return(0,s.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,s.jsxs)(p.Z,{sx:{p:3},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:1},children:[(0,s.jsx)(c,{sx:{fontSize:22,color:"primary.main"}}),(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:t.title})]}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t.description}),(0,s.jsx)(O.Z,{sx:{mb:3}}),(0,s.jsx)(S.ZP,{container:!0,spacing:2.5,children:t.essentialFields.map(e=>(0,s.jsx)(eC,{field:e,value:r[e.key],onChange:i},e.key))}),x>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{fullWidth:!0,variant:"text",onClick:()=>d(!a),endIcon:(0,s.jsx)(ev.Z,{sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s"}}),sx:{mt:2.5,justifyContent:"flex-start",color:"text.secondary",textTransform:"none",py:1,"&:hover":{bgcolor:"action.hover"}},children:[a?"Hide":"Show"," Advanced Settings (",x,")"]}),(0,s.jsx)(em.Z,{in:a,timeout:300,children:(0,s.jsx)(l.Z,{sx:{pt:2,borderTop:"1px dashed",borderColor:"divider"},children:(0,s.jsx)(S.ZP,{container:!0,spacing:2.5,children:t.advancedFields.map(e=>(0,s.jsx)(eC,{field:e,value:r[e.key],onChange:i},e.key))})})})]})]})})}var ek=r(12550);function eR(e){let{hasChanges:t,changedCount:r,hasRestartChanges:n,restartFields:i=[],isSaving:a,onSave:d,onDiscard:c}=e;return(0,s.jsx)(ek.Z,{direction:"up",in:t,mountOnEnter:!0,unmountOnExit:!0,children:(0,s.jsxs)(l.Z,{sx:{position:"sticky",bottom:0,zIndex:1100,bgcolor:"background.paper",borderTop:2,borderColor:"primary.main",px:3,py:2,mx:-3,mb:-3,boxShadow:"0 -4px 20px rgba(0,0,0,0.4)",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[n&&(0,s.jsx)(el.Z,{sx:{color:"warning.main",fontSize:20}}),(0,s.jsxs)(m.Z,{variant:"body2",fontWeight:600,children:[r," unsaved change",1!==r?"s":""]}),n&&(0,s.jsxs)(m.Z,{variant:"caption",color:"warning.main",children:["(",i.length>0?i.join(", "):"some fields"," require restart)"]})]}),(0,s.jsxs)(l.Z,{sx:{display:"flex",gap:1},children:[(0,s.jsx)(o.Z,{variant:"text",color:"inherit",onClick:c,disabled:a,children:"Discard"}),(0,s.jsx)(o.Z,{variant:"contained",startIcon:a?(0,s.jsx)(x.Z,{size:16,color:"inherit"}):(0,s.jsx)(eu.Z,{}),onClick:d,disabled:a,children:a?"Saving...":"Save Changes (".concat(r,")")})]})]})})}function eT(e){let{open:t,changedFields:r,onSaveOnly:n,onSaveAndRestart:i,onCancel:a}=e;return(0,s.jsxs)(b.Z,{open:t,onClose:a,maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(f.Z,{children:(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(el.Z,{color:"warning"}),(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Restart Required"})]})}),(0,s.jsxs)(Z.Z,{children:[(0,s.jsx)(m.Z,{variant:"body1",gutterBottom:!0,children:"The following changes require a server restart to take effect:"}),(0,s.jsx)(Q.Z,{dense:!0,children:r.map(e=>(0,s.jsx)(_.ZP,{sx:{py:0},children:(0,s.jsx)(j.Z,{primary:e,primaryTypographyProps:{variant:"body2",fontFamily:'"Roboto Mono", monospace'}})},e))})]}),(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(o.Z,{onClick:a,color:"inherit",children:"Cancel"}),(0,s.jsx)(o.Z,{onClick:n,variant:"outlined",children:"Save Only"}),(0,s.jsx)(o.Z,{onClick:i,variant:"contained",color:"warning",children:"Save & Restart"})]})]})}var eI=r(1217),ez=r(84974),eF=r(23482),eP=r(61244),eW=r(87739);let eA=[{id:"gameplay",icon:eI.Z,title:"Gameplay",description:"Core game rules and player experience settings.",essentialFields:[{key:"difficulty",label:"Difficulty",type:"select",options:[{value:"peaceful",label:"Peaceful"},{value:"easy",label:"Easy"},{value:"normal",label:"Normal"},{value:"hard",label:"Hard"}]},{key:"gameMode",label:"Game Mode",type:"select",options:[{value:"survival",label:"Survival"},{value:"creative",label:"Creative"},{value:"adventure",label:"Adventure"},{value:"spectator",label:"Spectator"}]},{key:"maxPlayers",label:"Max Players",type:"number",validation:{min:1,max:1e3}},{key:"pvp",label:"Enable PvP",type:"boolean",helperText:"Allow players to damage each other"}],advancedFields:[{key:"forceGamemode",label:"Force Game Mode",type:"boolean",helperText:"Force game mode when players join"},{key:"hardcore",label:"Hardcore",type:"boolean",helperText:"One life only - world deleted on death"},{key:"allowFlight",label:"Allow Flight",type:"boolean",helperText:"Allow flight in survival mode"},{key:"allowNether",label:"Allow Nether",type:"boolean",helperText:"Enable Nether portal access"},{key:"enableCommandBlock",label:"Command Blocks",type:"boolean",helperText:"Enable command block functionality"},{key:"spawnProtection",label:"Spawn Protection",type:"number",helperText:"Radius around spawn (0 = disabled)",unit:"blocks",validation:{min:0,max:256}},{key:"spawnAnimals",label:"Spawn Animals",type:"boolean",helperText:"Spawn passive mobs (cows, pigs, etc.)"},{key:"spawnMonsters",label:"Spawn Monsters",type:"boolean",helperText:"Spawn hostile mobs (zombies, creepers, etc.)"},{key:"spawnNpcs",label:"Spawn NPCs",type:"boolean",helperText:"Spawn villagers and wandering traders"}]},{id:"world",icon:ez.Z,title:"World",description:"World generation and server identity settings.",essentialFields:[{key:"motd",label:"MOTD (Message of the Day)",type:"string",helperText:"Displayed in the server list",columns:12},{key:"level",label:"World Name",type:"string",helperText:"Save folder name",restartRequired:!0},{key:"levelType",label:"Level Type",type:"select",restartRequired:!0,options:[{value:"default",label:"Default"},{value:"flat",label:"Flat"},{value:"largeBiomes",label:"Large Biomes"},{value:"amplified",label:"Amplified"},{value:"buffet",label:"Buffet"}]},{key:"seed",label:"World Seed",type:"string",helperText:"Only affects new world generation",restartRequired:!0}],advancedFields:[{key:"generateStructures",label:"Generate Structures",type:"boolean",helperText:"Generate villages, temples, etc."},{key:"maxWorldSize",label:"Max World Size",type:"number",unit:"blocks",helperText:"Maximum world radius",validation:{min:1,max:29999984}},{key:"icon",label:"Server Icon URL",type:"string",helperText:"64x64 PNG image URL",columns:12}]},{id:"security",icon:eF.Z,title:"Security",description:"Authentication and access control settings.",essentialFields:[{key:"onlineMode",label:"Online Mode (Mojang Auth)",type:"boolean",helperText:"Disable to allow cracked clients (not recommended)",restartRequired:!0},{key:"enableWhitelist",label:"Enable Whitelist",type:"boolean",helperText:"Only whitelisted players can join",restartRequired:!0}],advancedFields:[{key:"enforceWhitelist",label:"Enforce Whitelist",type:"boolean",helperText:"Kick non-whitelisted players already online",restartRequired:!0},{key:"enforceSecureProfile",label:"Enforce Secure Profile",type:"boolean",helperText:"Require signed chat messages from players",restartRequired:!0}]},{id:"performance",icon:q.Z,title:"Performance & JVM",description:"Memory, view distance, and JVM optimization settings.",essentialFields:[{key:"memory",label:"Memory",type:"string",helperText:"e.g., 2G, 4G, 8G",restartRequired:!0},{key:"useAikarFlags",label:"Aikar's Flags",type:"boolean",helperText:"Optimized GC flags for Paper/Spigot",restartRequired:!0},{key:"viewDistance",label:"View Distance",type:"number",unit:"chunks",validation:{min:2,max:32}}],advancedFields:[{key:"simulationDistance",label:"Simulation Distance",type:"number",unit:"chunks",validation:{min:3,max:32}},{key:"maxTickTime",label:"Max Tick Time",type:"number",unit:"ms",helperText:"-1 to disable watchdog",validation:{min:-1}},{key:"initMemory",label:"Initial Heap",type:"string",helperText:"e.g., 1G (overrides Memory)",restartRequired:!0},{key:"maxMemory",label:"Max Heap",type:"string",helperText:"e.g., 8G (overrides Memory)",restartRequired:!0},{key:"jvmXxOpts",label:"JVM -XX Options",type:"string",helperText:"Additional -XX JVM flags",restartRequired:!0,columns:12}]},{id:"autopause",icon:eP.Z,title:"Auto-pause / Auto-stop",description:"Automatically pause or stop when no players are connected.",essentialFields:[{key:"enableAutopause",label:"Enable Auto-pause",type:"boolean",helperText:"Pause process when no players connected",restartRequired:!0},{key:"autopauseTimeoutEst",label:"Pause Timeout",type:"number",unit:"seconds",helperText:"Wait time after last player leaves",validation:{min:0}}],advancedFields:[{key:"autopauseTimeoutInit",label:"Init Timeout",type:"number",unit:"seconds",helperText:"Timeout after start without connections",validation:{min:0}},{key:"autopausePeriod",label:"Check Period",type:"number",unit:"seconds",helperText:"Status check interval",validation:{min:1}},{key:"enableAutostop",label:"Enable Auto-stop",type:"boolean",helperText:"Stop container when no players connected",restartRequired:!0},{key:"autostopTimeoutEst",label:"Stop Timeout",type:"number",unit:"seconds",helperText:"Wait time before stopping container",validation:{min:0}}]},{id:"system",icon:eW.Z,title:"System",description:"Timezone, resource pack, RCON, and container settings.",essentialFields:[{key:"tz",label:"Timezone",type:"string",helperText:"e.g., Asia/Seoul, UTC",restartRequired:!0},{key:"resourcePack",label:"Resource Pack URL",type:"string",helperText:"Direct download URL for resource pack",columns:12},{key:"enableRcon",label:"Enable RCON",type:"boolean",helperText:"Remote server console access",restartRequired:!0}],advancedFields:[{key:"resourcePackSha1",label:"Resource Pack SHA1",type:"string",helperText:"40-character hex checksum",columns:12},{key:"resourcePackEnforce",label:"Enforce Resource Pack",type:"boolean",helperText:"Kick players who decline"},{key:"resourcePackPrompt",label:"Resource Pack Prompt",type:"string",helperText:"Custom message for resource pack dialog",columns:12},{key:"rconPassword",label:"RCON Password",type:"password",restartRequired:!0},{key:"rconPort",label:"RCON Port",type:"number",validation:{min:1024,max:65535},restartRequired:!0},{key:"stopDuration",label:"Stop Timeout",type:"number",unit:"seconds",helperText:"Graceful shutdown wait time",restartRequired:!0,validation:{min:0}},{key:"uid",label:"User ID (UID)",type:"number",helperText:"Container process UID",restartRequired:!0,validation:{min:0}},{key:"gid",label:"Group ID (GID)",type:"number",helperText:"Container process GID",restartRequired:!0,validation:{min:0}}]}],eM=["memory","initMemory","maxMemory","useAikarFlags","jvmXxOpts","onlineMode","enableWhitelist","enforceWhitelist","enforceSecureProfile","level","seed","levelType","enableAutopause","enableAutostop","enableRcon","rconPassword","rconPort","tz","uid","gid","stopDuration"];function eD(e){let{serverName:t,isRunning:r}=e,{data:i,isLoading:a}=(0,eo.iC)(t),d=(0,eo.MH)(),u=(0,eo.gx)(),v=(0,eo._I)(),[y,g]=(0,n.useState)({}),[j,S]=(0,n.useState)({}),[k,R]=(0,n.useState)(!1),[T,I]=(0,n.useState)(""),[z,F]=(0,n.useState)(!1),[P,W]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==i?void 0:i.config)&&(g(i.config),S(i.config))},[i]);let A=(0,n.useMemo)(()=>{let e=[];for(let t of Object.keys(y))y[t]!==j[t]&&e.push(t);for(let t of Object.keys(j))y[t]===j[t]||e.includes(t)||e.push(t);return e},[y,j]),M=A.length>0,D=A.filter(e=>eM.includes(e)),E=D.length>0,q=(0,n.useCallback)((e,t)=>{g(r=>({...r,[e]:t}))},[]),N=(0,n.useCallback)(()=>{g(j)},[j]),U=(0,n.useCallback)(async e=>{try{let s=await d.mutateAsync({serverName:t,config:y});if(S(s.config),g(s.config),e&&r)try{await v.mutateAsync(t),W({open:!0,message:"Settings saved. Server is restarting...",severity:"warning"})}catch(e){W({open:!0,message:"Settings saved, but server restart failed. Please restart manually.",severity:"error"})}else W({open:!0,message:s.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:s.restartRequired?"warning":"success"})}catch(e){W({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}finally{F(!1)}},[y,t,r,d,v]),B=(0,n.useCallback)(()=>{E&&r?F(!0):U(!1)},[E,r,U]),L=async()=>{if("RESET"!==T){W({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await u.mutateAsync(t),W({open:!0,message:"World reset successfully",severity:"success"}),R(!1),I("")}catch(e){W({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return a?(0,s.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,s.jsx)(x.Z,{})}):(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(ep,{serverName:t}),eA.map(e=>(0,s.jsx)(eS,{section:e,values:y,onChange:q},e.id)),(0,s.jsx)(h.Z,{sx:{borderRadius:3,borderColor:"error.main",borderWidth:1,borderStyle:"solid"},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,color:"error",children:"Danger Zone"}),(0,s.jsx)(O.Z,{sx:{mb:3}}),(0,s.jsxs)(l.Z,{sx:{mb:3},children:[(0,s.jsx)(m.Z,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Reset World"}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"This will permanently delete the current world and generate a new one. This action cannot be undone."}),(0,s.jsx)(o.Z,{variant:"outlined",color:"error",startIcon:(0,s.jsx)(el.Z,{}),onClick:()=>R(!0),disabled:r,children:"Reset World"}),r&&(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",sx:{ml:2},children:"Stop the server first"})]})]})}),(0,s.jsx)(eR,{hasChanges:M,changedCount:A.length,hasRestartChanges:E,restartFields:D,isSaving:d.isPending,onSave:B,onDiscard:N}),(0,s.jsx)(eT,{open:z,changedFields:D,onSaveOnly:()=>U(!1),onSaveAndRestart:()=>U(!0),onCancel:()=>F(!1)}),(0,s.jsxs)(b.Z,{open:k,onClose:()=>R(!1),maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(f.Z,{children:(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(ei.Z,{color:"error"}),(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Reset World"})]})}),(0,s.jsxs)(Z.Z,{children:[(0,s.jsxs)(m.Z,{variant:"body1",gutterBottom:!0,children:["This will permanently delete the world for ",(0,s.jsx)("strong",{children:t})," and generate a new one."]}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"This action cannot be undone. All player progress and builds will be lost."}),(0,s.jsx)(C.Z,{fullWidth:!0,label:"Type RESET to confirm",value:T,onChange:e=>I(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,s.jsxs)(w.Z,{children:[(0,s.jsx)(o.Z,{onClick:()=>R(!1),children:"Cancel"}),(0,s.jsx)(o.Z,{variant:"contained",color:"error",onClick:L,disabled:"RESET"!==T||u.isPending,startIcon:u.isPending?(0,s.jsx)(x.Z,{size:16}):(0,s.jsx)(ea.Z,{}),children:u.isPending?"Resetting...":"Reset World"})]})]}),(0,s.jsx)(en.Z,{open:P.open,autoHideDuration:6e3,onClose:()=>W({...P,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,s.jsx)(c.Z,{onClose:()=>W({...P,open:!1}),severity:P.severity,sx:{width:"100%"},children:P.message})})]})}var eO=r(86702),eE=r(47606),eq=r(407),eN=r(56056),eU=r(11597),eB=r(59602);let eL={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function eH(e){let{permission:t,size:r="medium"}=e,n=eL[t];return(0,s.jsx)(M.Z,{label:n.label,color:n.color,variant:n.variant,size:r})}var eK=r(99046),eG=r(68038),eV=r(34080),eJ=r(39181),eQ=r(5632),e_=r(58919),eX=r(20367),e$=r(42936);function eY(e){var t,r;let{open:i,onClose:a,serverId:d}=e,[u,h]=(0,n.useState)(""),[p,v]=(0,n.useState)(null),[y,g]=(0,n.useState)("view"),{data:j,isLoading:S}=(r={enabled:i},(0,eQ.a)({queryKey:["users","search",u],queryFn:()=>(0,e$.SC)("/api/users?q=".concat(encodeURIComponent(u))),enabled:(null==r?void 0:r.enabled)!==!1&&u.length>=2,staleTime:3e4})),k=function(){let e=(0,e_.NL)();return(0,eX.D)({mutationFn:e=>(0,e$.SC)("/api/user-servers",{method:"POST",body:JSON.stringify(e)}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["user-servers",r.serverId]}),e.invalidateQueries({queryKey:["user-servers"]})}})}(),R=(0,n.useMemo)(()=>{var e;return null!==(e=null==j?void 0:j.users)&&void 0!==e?e:[]},[j]),T=()=>{h(""),v(null),g("view"),k.reset(),a()};return(0,s.jsxs)(b.Z,{open:i,onClose:T,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,s.jsx)(f.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,s.jsxs)(Z.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[k.isError&&(0,s.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(t=k.error)||void 0===t?void 0:t.message)||"Failed to grant access"}),(0,s.jsx)(eK.Z,{options:R,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,t)=>e.id===t.id,value:p,onChange:(e,t)=>v(t),inputValue:u,onInputChange:(e,t)=>h(t),loading:S,filterOptions:e=>e,noOptionsText:u.length<2?"Type at least 2 characters":"No users found",renderInput:e=>(0,s.jsx)(C.Z,{...e,label:"Search User",placeholder:"Search by name or email...",InputProps:{...e.InputProps,endAdornment:(0,s.jsxs)(s.Fragment,{children:[S&&(0,s.jsx)(x.Z,{size:20}),e.InputProps.endAdornment]})}}),renderOption:(e,t)=>{var r,n,i;let{key:a,...o}=e;return(0,s.jsxs)(l.Z,{component:"li",...o,sx:{display:"flex",gap:1.5,py:1},children:[(0,s.jsx)(eO.Z,{src:null!==(i=t.image)&&void 0!==i?i:void 0,sx:{width:32,height:32,bgcolor:"primary.main",fontSize:14},children:((null===(r=t.name)||void 0===r?void 0:r[0])||(null===(n=t.email)||void 0===n?void 0:n[0])||"?").toUpperCase()}),(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,children:t.name||"Unknown"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:t.email})]})]},a)}}),(0,s.jsxs)(eg.Z,{children:[(0,s.jsx)(eG.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,s.jsxs)(eV.Z,{value:y,onChange:e=>g(e.target.value),children:[(0,s.jsx)(eb.Z,{value:"view",control:(0,s.jsx)(eJ.Z,{size:"small"}),label:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,children:"Viewer"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:"Can view server status and logs"})]})}),(0,s.jsx)(eb.Z,{value:"manage",control:(0,s.jsx)(eJ.Z,{size:"small"}),label:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,children:"Operator"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:"Can start, stop, and configure the server"})]})}),(0,s.jsx)(eb.Z,{value:"admin",control:(0,s.jsx)(eJ.Z,{size:"small"}),label:(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,children:"Owner"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",children:"Full control including managing other users"})]})})]})]})]}),(0,s.jsxs)(w.Z,{sx:{px:3,pb:2},children:[(0,s.jsx)(o.Z,{onClick:T,color:"inherit",children:"Cancel"}),(0,s.jsx)(o.Z,{onClick:()=>{p&&k.mutate({userId:p.id,serverId:d,permission:y},{onSuccess:T})},variant:"contained",disabled:!p||k.isPending,sx:{borderRadius:2},children:k.isPending?"Adding...":"Add User"})]})]})}function e0(e){var t,r;let{serverId:i}=e,{data:a,isLoading:x,error:b}=(0,eQ.a)({queryKey:["user-servers",i],queryFn:()=>(0,e$.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),f=function(){let e=(0,e_.NL)();return(0,eX.D)({mutationFn:e=>{let{id:t,permission:r}=e;return(0,e$.SC)("/api/user-servers/".concat(encodeURIComponent(t)),{method:"PATCH",body:JSON.stringify({permission:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),Z=function(){let e=(0,e_.NL)();return(0,eX.D)({mutationFn:e=>(0,e$.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[w,C]=(0,n.useState)(!1),[S,k]=(0,n.useState)(null),[R,T]=(0,n.useState)(null),z=(e,t)=>{k(e.currentTarget),T(t)},F=()=>{k(null),T(null)},P=e=>{if(!R||R.permission===e){F();return}f.mutate({id:R.id,permission:e},{onSettled:F})},W=null!==(t=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==t?t:0,A=(null==R?void 0:R.permission)==="admin"&&W<=1;if(x)return(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%",height:32}),(0,s.jsx)(u.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,s.jsx)(O.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,s.jsx)(u.Z,{variant:"circular",width:40,height:40}),(0,s.jsxs)(l.Z,{sx:{flex:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"40%"}),(0,s.jsx)(u.Z,{variant:"text",width:"60%"})]}),(0,s.jsx)(u.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,s.jsx)(u.Z,{variant:"circular",width:32,height:32})]},e))]})});if(b)return(0,s.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",b.message]});let M=null!==(r=null==a?void 0:a.users)&&void 0!==r?r:[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Server Access"}),(0,s.jsx)(o.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(eE.Z,{}),onClick:()=>C(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,s.jsx)(O.Z,{sx:{mb:1}}),0===M.length?(0,s.jsx)(l.Z,{sx:{py:4,textAlign:"center"},children:(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:"No users have been granted access to this server yet."})}):M.map(e=>{var t,r,n,i,a,o,c,x;return(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,s.jsx)(eO.Z,{src:null!==(x=null===(t=e.user)||void 0===t?void 0:t.image)&&void 0!==x?x:void 0,sx:{width:40,height:40,bgcolor:"primary.main",fontSize:16},children:((null===(n=e.user)||void 0===n?void 0:null===(r=n.name)||void 0===r?void 0:r[0])||(null===(a=e.user)||void 0===a?void 0:null===(i=a.email)||void 0===i?void 0:i[0])||"?").toUpperCase()}),(0,s.jsxs)(l.Z,{sx:{flex:1,minWidth:0},children:[(0,s.jsx)(m.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(o=e.user)||void 0===o?void 0:o.name)||"Unknown User"}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:(null===(c=e.user)||void 0===c?void 0:c.email)||e.userId})]}),(0,s.jsx)(eH,{permission:e.permission,size:"small"}),(0,s.jsx)(d.Z,{size:"small",onClick:t=>z(t,e),sx:{color:"text.secondary"},children:(0,s.jsx)(I.Z,{fontSize:"small"})})]},e.id)}),(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,s.jsx)(eB.Z,{sx:{fontSize:16,color:"text.disabled"}}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.disabled",children:"Only platform admins and server owners can manage access."})]})]})}),(0,s.jsxs)(v.Z,{anchorEl:S,open:!!S,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,s.jsxs)(y.Z,{onClick:()=>P("admin"),disabled:(null==R?void 0:R.permission)==="admin",children:[(0,s.jsx)(g.Z,{children:(0,s.jsx)(eq.Z,{fontSize:"small"})}),(0,s.jsx)(j.Z,{children:"Change to Owner"})]}),(0,s.jsxs)(y.Z,{onClick:()=>P("manage"),disabled:(null==R?void 0:R.permission)==="manage"||A,children:[(0,s.jsx)(g.Z,{children:(0,s.jsx)(eN.Z,{fontSize:"small"})}),(0,s.jsx)(j.Z,{children:"Change to Operator"})]}),(0,s.jsxs)(y.Z,{onClick:()=>P("view"),disabled:(null==R?void 0:R.permission)==="view"||A,children:[(0,s.jsx)(g.Z,{children:(0,s.jsx)(eZ.Z,{fontSize:"small"})}),(0,s.jsx)(j.Z,{children:"Change to Viewer"})]}),(0,s.jsx)(O.Z,{}),(0,s.jsxs)(y.Z,{onClick:()=>{R&&Z.mutate(R.id,{onSettled:F})},disabled:A,sx:{color:"error.main"},children:[(0,s.jsx)(g.Z,{children:(0,s.jsx)(eU.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,s.jsx)(j.Z,{children:"Remove Access"})]})]}),(0,s.jsx)(eY,{open:w,onClose:()=>C(!1),serverId:i})]})}var e1=r(10449),e2=r(24559),e3=r(37228);function e6(e){let{text:t}=e,[r,i]=(0,n.useState)(!1),a=async()=>{try{await navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),2e3)}catch(e){console.error("Failed to copy:",e)}};return(0,s.jsx)(d.Z,{size:"small",onClick:a,sx:{ml:1,color:r?"success.main":"text.secondary","&:hover":{bgcolor:"action.hover"}},"aria-label":r?"Copied":"Copy to clipboard",children:r?(0,s.jsx)(e2.Z,{sx:{fontSize:16}}):(0,s.jsx)(e1.Z,{sx:{fontSize:16}})})}function e5(e){let{label:t,value:r,copyText:n}=e;return(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:1},children:[(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:t}),(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,s.jsx)(m.Z,{variant:"body2",sx:{fontFamily:n?'"Roboto Mono", monospace':"inherit",color:n?"text.primary":"text.secondary"},children:r}),n&&(0,s.jsx)(e6,{text:n})]})]})}function e4(e){let{serverName:t,hostname:r}=e,{data:n,isLoading:i}=(0,e3.UW)();if(i)return(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,s.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%"}),(0,s.jsx)(u.Z,{variant:"text",width:"40%"})]}),(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%"}),(0,s.jsx)(u.Z,{variant:"text",width:"40%"})]})]})});let a=r?"".concat(r,":25565"):"Not configured",o=(null==n?void 0:n.enabled)&&n.servers.length>0,d=null==n?void 0:n.servers.find(e=>e.serverName===t),c=(null==d?void 0:d.playitDomain)||"Not configured",x=!!(null==d?void 0:d.playitDomain);return(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Connection"}),(0,s.jsx)(O.Z,{sx:{mb:2}}),(0,s.jsx)(e5,{label:"LAN Address",value:a,copyText:r?a:void 0}),o&&(0,s.jsx)(e5,{label:"External Address",value:c,copyText:x?c:void 0})]})})}var e8=r(42431),e7=r(76777),e9=r(15761);function te(e){let{serverName:t}=e,{data:r,isLoading:i,error:a}=(0,eQ.a)({queryKey:["servers",t,"mods"],queryFn:()=>(0,e$.SC)("/api/servers/".concat(encodeURIComponent(t),"/mods")),enabled:!!t}),u=function(){let e=(0,e_.NL)();return(0,eX.D)({mutationFn:e=>{let{serverName:t,slugs:r,source:s}=e;return(0,e$.SC)("/api/servers/".concat(encodeURIComponent(t),"/mods"),{method:"POST",body:JSON.stringify({slugs:r,source:s})})},onSuccess:(t,r)=>{let{serverName:s}=r;e.invalidateQueries({queryKey:["servers",s,"mods"]})}})}(),v=function(){let e=(0,e_.NL)();return(0,eX.D)({mutationFn:e=>{let{serverName:t,slug:r}=e;return(0,e$.SC)("/api/servers/".concat(encodeURIComponent(t),"/mods/").concat(encodeURIComponent(r)),{method:"DELETE"})},onSuccess:(t,r)=>{let{serverName:s}=r;e.invalidateQueries({queryKey:["servers",s,"mods"]})}})}(),[y,g]=(0,n.useState)(!1),[j,w]=(0,n.useState)(""),[S,k]=(0,n.useState)(""),[R,T]=(0,n.useState)(!1),[I,F]=(0,n.useState)({open:!1,message:"",severity:"info"}),{data:P,isLoading:W}=function(e,t){let r=new URLSearchParams;return e&&r.set("q",e),(null==t?void 0:t.limit)!=null&&r.set("limit",String(t.limit)),(null==t?void 0:t.offset)!=null&&r.set("offset",String(t.offset)),(0,eQ.a)({queryKey:["mods","search",e,null==t?void 0:t.limit,null==t?void 0:t.offset],queryFn:()=>(0,e$.SC)("/api/mods/search?".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1&&!!e.trim()})}(S,{limit:10,enabled:y&&S.length>0});(0,n.useEffect)(()=>{let e=setTimeout(()=>{k(j)},300);return()=>clearTimeout(e)},[j]);let A=(0,n.useCallback)(async e=>{try{await v.mutateAsync({serverName:t,slug:e}),T(!0),F({open:!0,message:"Removed ".concat(e),severity:"success"})}catch(e){F({open:!0,message:e instanceof Error?e.message:"Failed to remove mod",severity:"error"})}},[v,t]),q=(0,n.useCallback)(async e=>{try{await u.mutateAsync({serverName:t,slugs:[e]}),T(!0),F({open:!0,message:"Added ".concat(e),severity:"success"})}catch(e){F({open:!0,message:e instanceof Error?e.message:"Failed to add mod",severity:"error"})}},[u,t]),N=new Set;if(null==r?void 0:r.mods)for(let e of Object.values(r.mods))for(let t of e)N.add(t);if(i)return(0,s.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:6},children:(0,s.jsx)(x.Z,{})});if(a)return(0,s.jsxs)(c.Z,{severity:"error",sx:{mt:2},children:["Failed to load mods: ",a.message]});let U=N.size>0;return(0,s.jsxs)(l.Z,{children:[R&&(0,s.jsx)(c.Z,{severity:"info",sx:{mb:2},children:"Restart the server to apply mod changes."}),(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,s.jsx)(m.Z,{variant:"h6",fontWeight:600,children:"Installed Mods"}),(0,s.jsx)(o.Z,{variant:"contained",size:"small",startIcon:(0,s.jsx)(ex.Z,{}),onClick:()=>{w(""),k(""),g(!0)},children:"Add Mods"})]}),(0,s.jsx)(O.Z,{sx:{mb:2}}),U?Object.entries(r.mods).map(e=>{let[t,r]=e;return(0,s.jsxs)(l.Z,{sx:{mb:2},children:[(0,s.jsx)(m.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1,textTransform:"capitalize"},children:t}),(0,s.jsx)(l.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:r.map(e=>(0,s.jsx)(M.Z,{label:e,icon:(0,s.jsx)(e7.Z,{}),onDelete:()=>A(e),deleteIcon:(0,s.jsx)(z.Z,{}),variant:"outlined"},e))})]},t)}):(0,s.jsxs)(l.Z,{sx:{textAlign:"center",py:4},children:[(0,s.jsx)(e7.Z,{sx:{fontSize:48,color:"text.disabled",mb:1}}),(0,s.jsx)(m.Z,{variant:"body1",color:"text.secondary",children:"No mods installed"}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.disabled",sx:{mt:.5},children:'Click "Add Mods" to search and install mods from Modrinth'})]})]})}),(0,s.jsxs)(b.Z,{open:y,onClose:()=>g(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{minHeight:400}},children:[(0,s.jsxs)(f.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:["Search Mods",(0,s.jsx)(d.Z,{onClick:()=>g(!1),size:"small",children:(0,s.jsx)(E.Z,{})})]}),(0,s.jsxs)(Z.Z,{children:[(0,s.jsx)(C.Z,{fullWidth:!0,autoFocus:!0,placeholder:"Search Modrinth...",value:j,onChange:e=>w(e.target.value),InputProps:{startAdornment:(0,s.jsx)(D.Z,{position:"start",children:(0,s.jsx)(e8.Z,{})})},sx:{mb:2}}),W&&(0,s.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(x.Z,{size:28})}),!W&&P&&0===P.hits.length&&S&&(0,s.jsxs)(m.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:4},children:['No mods found for "',S,'"']}),!W&&P&&P.hits.length>0&&(0,s.jsx)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:P.hits.map(e=>{var t;let r=N.has(e.slug);return(0,s.jsx)(h.Z,{variant:"outlined",sx:{borderRadius:2},children:(0,s.jsx)(p.Z,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:(0,s.jsxs)(l.Z,{sx:{display:"flex",gap:1.5,alignItems:"flex-start"},children:[(0,s.jsx)(eO.Z,{src:e.iconUrl||void 0,variant:"rounded",sx:{width:40,height:40,bgcolor:"action.hover"},children:(0,s.jsx)(e7.Z,{})}),(0,s.jsxs)(l.Z,{sx:{flex:1,minWidth:0},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(m.Z,{variant:"subtitle2",noWrap:!0,children:e.title}),(0,s.jsx)(o.Z,{size:"small",variant:r?"outlined":"contained",disabled:r||u.isPending,onClick:()=>q(e.slug),sx:{ml:1,minWidth:80,flexShrink:0},children:r?"Installed":"Add"})]}),(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mt:.25,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:e.description}),(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.25},children:[(0,s.jsx)(e9.Z,{sx:{fontSize:14,color:"text.disabled"}}),(0,s.jsx)(m.Z,{variant:"caption",color:"text.disabled",children:(t=e.downloads)>=1e6?"".concat((t/1e6).toFixed(1),"M"):t>=1e3?"".concat((t/1e3).toFixed(1),"K"):String(t)})]}),e.author&&(0,s.jsxs)(m.Z,{variant:"caption",color:"text.disabled",children:["by ",e.author]})]})]})]})})},e.slug)})})]})]}),(0,s.jsx)(en.Z,{open:I.open,autoHideDuration:4e3,onClose:()=>F(e=>({...e,open:!1})),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:(0,s.jsx)(c.Z,{onClose:()=>F(e=>({...e,open:!1})),severity:I.severity,variant:"filled",children:I.message})})]})}let tt=["Overview","Activity","Mods","Files","Backups","Access","Options"];function tr(e){return e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[a-zA-Z]/g,"").replace(/\[m/g,"").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"").trim()}function ts(e){var t,r,i,a,c;let{server:x,onSendCommand:u}=e,[v,y]=(0,n.useState)("Overview"),[g,j]=(0,n.useState)(""),[f,w]=(0,n.useState)(!0),[R,T]=(0,n.useState)(!1),I=(0,n.useRef)(null),{logs:z,isConnected:F}=(0,V.Y)({serverName:x.name}),P=(0,n.useMemo)(()=>z.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[z]);(0,n.useEffect)(()=>{I.current&&f&&(I.current.scrollTop=I.current.scrollHeight)},[P,f]);let W=async()=>{g.trim()&&u&&(await u(g.trim()),j(""))},A=null!==(a=null===(t=x.stats)||void 0===t?void 0:t.cpuPercent)&&void 0!==a?a:0;(null===(r=x.stats)||void 0===r?void 0:r.memoryUsage)&&x.stats.memoryUsage,function(e){if(!e)return;let t=e.match(/^(\d+)\s*(M|G)?$/i);if(t)parseInt(t[1],10),(t[2]||"M").toUpperCase()}(x.memory);let K=null!==(c=null===(i=x.stats)||void 0===i?void 0:i.memoryPercent)&&void 0!==c?c:0;return(0,s.jsxs)(l.Z,{children:[(0,s.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:tt.map(e=>(0,s.jsx)(o.Z,{onClick:()=>y(e),sx:{px:2,py:1,borderRadius:5,fontSize:14,fontWeight:500,textTransform:"none",bgcolor:v===e?"primary.main":"transparent",color:v===e?"#0a0e14":"text.secondary","&:hover":{bgcolor:v===e?"primary.main":(0,k.Fq)("#1bd96a",.1)}},children:e},e))}),(0,s.jsxs)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,s.jsx)(G,{value:"".concat(A.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,s.jsx)(q.Z,{sx:{fontSize:28}}),progress:A,progressMax:100,color:"#1bd96a"}),(0,s.jsx)(G,{value:"".concat(K.toFixed(2),"%"),unit:"/ 100%",label:"Memory usage",icon:(0,s.jsx)(N.Z,{sx:{fontSize:28}}),progress:K,progressMax:100,color:"#1bd96a"}),(0,s.jsx)(G,{value:x.worldSize||"0 B",unit:"/ 10 GB",label:"World size",icon:(0,s.jsx)(U.Z,{sx:{fontSize:28}}),progress:function(e){if(!e)return 0;let t=e.match(/^([\d.]+)\s*(B|KB|MB|MiB|GB|GiB)?$/i);if(!t)return 0;let r=parseFloat(t[1]);switch((t[2]||"B").toUpperCase()){case"GB":case"GIB":return 1024*r;case"MB":case"MIB":return r;case"KB":return r/1024;default:return r/1048576}}(x.worldSize),progressMax:10240,color:"#1bd96a"})]}),(0,s.jsxs)(h.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,s.jsxs)(l.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,s.jsx)(m.Z,{variant:"h6",sx:{fontWeight:700,color:"text.primary"},children:"Console"}),(0,s.jsx)(l.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:F?"primary.main":"error.main",boxShadow:F?"0 0 8px rgba(27, 217, 106, 0.4)":"0 0 8px rgba(239, 68, 68, 0.4)"}})]}),(0,s.jsxs)(l.Z,{sx:{position:"relative"},children:[(0,s.jsx)(l.Z,{ref:I,onScroll:()=>{if(!I.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:r}=I.current;w(t-e-r<30)},sx:{height:360,overflowY:"auto",px:2.5,py:2,fontFamily:'"Roboto Mono", monospace',fontSize:13,lineHeight:1.85,color:"#b4b6c4",bgcolor:"#0a0a0a",scrollbarWidth:"thin",scrollbarColor:"#3a3d4e #0a0a0a","&::-webkit-scrollbar":{width:8},"&::-webkit-scrollbar-track":{bgcolor:"#0a0a0a"},"&::-webkit-scrollbar-thumb":{bgcolor:"#3a3d4e",borderRadius:4}},children:0===P.length?(0,s.jsx)(m.Z,{sx:{color:"text.secondary",textAlign:"center",py:8},children:"Waiting for logs..."}):P.map((e,t)=>{let r=function(e){let t=tr(e).match(/\[(\d{2}:\d{2}:\d{2})\]\s*\[([^/]+)\/(\w+)\]:\s*(.+)/);return t?{time:t[1],thread:t[2],level:t[3]||"INFO",msg:t[4]}:null}(e);return r?(0,s.jsxs)(l.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,s.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",r.time,"]"]}),(0,s.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",r.thread,"/",(0,s.jsx)(l.Z,{component:"span",sx:{color:"WARN"===r.level?"#e8a848":"#6b6e80"},children:r.level}),"]:\xa0"]}),(0,s.jsx)(l.Z,{component:"span",sx:{color:"WARN"===r.level?"#c4a45a":"#b4b6c4"},children:r.msg})]},t):(0,s.jsx)(l.Z,{sx:{color:"#b4b6c4"},children:tr(e)},t)})}),(0,s.jsx)(d.Z,{onClick:()=>T(!0),sx:{position:"absolute",top:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,s.jsx)(B.Z,{sx:{fontSize:18}})}),!f&&(0,s.jsx)(d.Z,{onClick:()=>{I.current&&I.current.scrollTo({top:I.current.scrollHeight,behavior:"smooth"})},sx:{position:"absolute",bottom:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,s.jsx)(L.Z,{sx:{fontSize:18}})})]}),(0,s.jsx)(l.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,s.jsx)(C.Z,{fullWidth:!0,size:"small",placeholder:"Send a command",value:g,onChange:e=>j(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),W())},disabled:!F,InputProps:{startAdornment:(0,s.jsx)(D.Z,{position:"start",children:(0,s.jsx)(H.Z,{sx:{fontSize:16,color:"#999"}})}),sx:{bgcolor:"#13141c",borderRadius:2,fontFamily:'"Roboto Mono", monospace',fontSize:14,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#2a2d3e"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#3a3d4e"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}}})})]}),"Overview"===v&&(0,s.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Information"}),(0,s.jsx)(O.Z,{sx:{mb:2}}),(0,s.jsx)(tn,{label:"Name",value:x.name}),(0,s.jsx)(tn,{label:"Container",value:x.container}),(0,s.jsx)(tn,{label:"Hostname",value:x.hostname}),(0,s.jsx)(tn,{label:"Type",value:x.type}),(0,s.jsx)(tn,{label:"Version",value:x.version}),(0,s.jsx)(tn,{label:"Memory",value:x.memory}),(0,s.jsx)(tn,{label:"Uptime",value:x.uptime||function(e){if(!e||e<0)return"0s";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),s=e%60;return t>0?"".concat(t,"h ").concat(r,"m"):r>0?"".concat(r,"m ").concat(s,"s"):"".concat(s,"s")}(x.uptimeSeconds)})]})})}),(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Players"}),(0,s.jsx)(O.Z,{sx:{mb:2}}),x.players?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tn,{label:"Online",value:"".concat(x.players.online," / ").concat(x.players.max)}),x.players.players&&x.players.players.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",sx:{mt:2,mb:1},children:"Online Players"}),(0,s.jsx)(l.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.players.map(e=>(0,s.jsx)(M.Z,{label:e,size:"small"},e))})]})]}):(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})}),(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(e4,{serverName:x.name,hostname:x.hostname})})]}),"Activity"===v&&(0,s.jsx)(l.Z,{sx:{mt:3},children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(m.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Activity"}),(0,s.jsx)(O.Z,{sx:{mb:2}}),(0,s.jsx)(es,{serverName:x.name})]})})}),"Mods"===v&&(0,s.jsx)(l.Z,{sx:{mt:3},children:(0,s.jsx)(te,{serverName:x.name})}),"Files"===v&&(0,s.jsx)(l.Z,{sx:{mt:3},children:(0,s.jsx)(m.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===v&&(0,s.jsx)(l.Z,{sx:{mt:3},children:(0,s.jsx)(m.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===v&&(0,s.jsx)(l.Z,{sx:{mt:3},children:(0,s.jsx)(e0,{serverId:x.name})}),"Options"===v&&(0,s.jsx)(l.Z,{sx:{mt:3},children:(0,s.jsx)(eD,{serverName:x.name,isRunning:"running"===x.status})}),(0,s.jsxs)(b.Z,{open:R,onClose:()=>T(!1),maxWidth:"xl",fullWidth:!0,PaperProps:{sx:{height:"90vh",bgcolor:"background.paper"}},children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,borderBottom:1,borderColor:"divider"},children:[(0,s.jsxs)(m.Z,{variant:"h6",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,letterSpacing:"0.05em"},children:["Console - ",x.name]}),(0,s.jsx)(d.Z,{onClick:()=>T(!1),children:(0,s.jsx)(E.Z,{})})]}),(0,s.jsx)(Z.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,s.jsx)(J.K,{serverName:x.name})})]})]})}function tn(e){let{label:t,value:r}=e;return r?(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(m.Z,{variant:"body2",color:"text.secondary",children:t}),(0,s.jsx)(m.Z,{variant:"body2",sx:{fontWeight:500},children:r})]}):null}var ti=r(93757);function ta(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function tl(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M21 2v6h-6"}),(0,s.jsx)("path",{d:"M3 12a9 9 0 0115.36-6.36L21 8"}),(0,s.jsx)("path",{d:"M3 22v-6h6"}),(0,s.jsx)("path",{d:"M21 12a9 9 0 01-15.36 6.36L3 16"})]})}function to(){var e,t,r,M;let D=(0,i.useParams)(),O=(0,a.x)(),E=decodeURIComponent(D.name),{data:q,isLoading:N,error:U}=(0,eo.Hy)(E),{status:B,health:L}=function(e){let{serverName:t,onStatusChange:r,enabled:s=!0,reconnectInterval:i=3e3}=e,[a,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{l(null),d(null)},[t]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let t=e.data.status,s=e.data.health;l(t),d(s),null==r||r(t,s)}},[r]),{isConnected:x,reconnect:u,retryCount:h}=(0,ti.D)({url:"/api/sse/servers/".concat(encodeURIComponent(t),"/status"),onMessage:c,enabled:s,reconnectInterval:i});return{status:a,health:o,isConnected:x,reconnect:u,retryCount:h}}({serverName:E,enabled:!!E}),[H,K]=(0,n.useState)(null),[G,V]=(0,n.useState)(!1),[J,Q]=(0,n.useState)(""),_=(0,eo.jM)(),X=(0,eo.Aw)(),$=(0,eo._I)(),Y=(0,eo.Hq)(),ee=async()=>{try{await _.mutateAsync(E)}catch(e){console.error("Failed to start server:",e)}},et=async()=>{try{await X.mutateAsync(E)}catch(e){console.error("Failed to stop server:",e)}},er=async()=>{try{await $.mutateAsync(E)}catch(e){console.error("Failed to restart server:",e)}},es=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(E),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=B||(null==q?void 0:q.server.status),ei=_.isPending||X.isPending||$.isPending,ea=null==q?void 0:q.server;return(0,s.jsxs)(s.Fragment,{children:[U&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to load server: ",U.message]}),_.isError&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=_.error)||void 0===e?void 0:e.message]}),X.isError&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(t=X.error)||void 0===t?void 0:t.message]}),$.isError&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(r=$.error)||void 0===r?void 0:r.message]}),Y.isError&&(0,s.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to delete server: ",null===(M=Y.error)||void 0===M?void 0:M.message]}),N?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,s.jsx)(u.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,s.jsxs)(l.Z,{sx:{flex:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,s.jsx)(u.Z,{variant:"text",width:"40%",height:40}),(0,s.jsxs)(l.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,s.jsx)(u.Z,{variant:"text",width:100}),(0,s.jsx)(u.Z,{variant:"text",width:60}),(0,s.jsx)(u.Z,{variant:"text",width:140}),(0,s.jsx)(u.Z,{variant:"text",width:50})]})]}),(0,s.jsxs)(l.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,s.jsx)(u.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,s.jsx)(u.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,s.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,t)=>(0,s.jsx)(u.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},t))}),(0,s.jsx)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,s.jsx)(u.Z,{variant:"text",width:"50%"}),(0,s.jsx)(u.Z,{variant:"circular",width:28,height:28})]}),(0,s.jsx)(u.Z,{variant:"text",width:"60%",height:36}),(0,s.jsx)(u.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,s.jsxs)(h.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,s.jsxs)(l.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,s.jsx)(u.Z,{variant:"text",width:80,height:28}),(0,s.jsx)(u.Z,{variant:"circular",width:10,height:10})]}),(0,s.jsx)(u.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,s.jsx)(l.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,s.jsx)(u.Z,{variant:"rounded",width:"100%",height:40,sx:{borderRadius:2}})})]}),(0,s.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,s.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%"}),(0,s.jsx)(u.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,s.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,s.jsx)(h.Z,{sx:{borderRadius:3},children:(0,s.jsxs)(p.Z,{children:[(0,s.jsx)(u.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,s.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,s.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,s.jsx)(u.Z,{variant:"text",width:"25%"}),(0,s.jsx)(u.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,s.jsx)(l.Z,{sx:{width:64,height:64,borderRadius:3,overflow:"hidden",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"1px solid",borderColor:"divider",fontSize:36},children:function(e){if(!e)return"\uD83C\uDFAE";let t=e.toUpperCase();return["PAPER","SPIGOT","BUKKIT","PURPUR"].includes(t)?"\uD83D\uDD0C":["FORGE","NEOFORGE","FABRIC","QUILT"].includes(t)?"\uD83D\uDD27":"\uD83C\uDFAE"}(ea.type)}),(0,s.jsxs)(l.Z,{sx:{flex:1},children:[(0,s.jsxs)(m.Z,{onClick:()=>O.push("/servers"),sx:{fontSize:12,color:"primary.main",cursor:"pointer",mb:.25,display:"flex",alignItems:"center",gap:.5,"&:hover":{textDecoration:"underline"}},children:[(0,s.jsx)(R.Z,{sx:{fontSize:14}})," All servers"]}),(0,s.jsx)(m.Z,{variant:"h4",component:"h1",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"text.primary",letterSpacing:"0.5px",m:0,textTransform:"uppercase"},children:E}),(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:0,mt:.75,flexWrap:"wrap",fontSize:13,color:"text.secondary"},children:[ea.version&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,s.jsx)(F.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,s.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,s.jsx)(P.Z,{sx:{fontSize:14}}),ea.type]}),(0,s.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,s.jsx)(W.Z,{sx:{fontSize:14}}),ea.hostname]}),(0,s.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,s.jsx)(A.Z,{sx:{fontSize:14}}),ea.uptime||function(e){if(!e||e<0)return"0s";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),s=e%60;return t>0?"".concat(t,"h ").concat(r,"m"):r>0?"".concat(r,"m ").concat(s,"s"):"".concat(s,"s")}(ea.uptimeSeconds)||"0s"]})]})]}),(0,s.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,s.jsx)(o.Z,{variant:"contained",color:"success",startIcon:ei?(0,s.jsx)(x.Z,{size:16,color:"inherit"}):(0,s.jsx)(T.Z,{}),onClick:ee,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600},children:"Start"}),"running"===en&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Z,{variant:"outlined",startIcon:ei?(0,s.jsx)(x.Z,{size:16}):(0,s.jsx)(ta,{}),onClick:et,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:500,borderColor:"divider",color:"text.secondary","&:hover":{borderColor:"text.secondary",bgcolor:(0,k.Fq)("#fff",.05)}},children:"Stop"}),(0,s.jsx)(o.Z,{variant:"contained",startIcon:ei?(0,s.jsx)(x.Z,{size:16,color:"inherit"}):(0,s.jsx)(tl,{}),onClick:er,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600,bgcolor:"primary.main",color:"#0a0e14","&:hover":{bgcolor:"primary.dark"}},children:"Restart"})]}),(0,s.jsx)(d.Z,{onClick:e=>K(e.currentTarget),sx:{width:36,height:36,borderRadius:2,border:"1px solid",borderColor:"divider",color:"text.secondary"},children:(0,s.jsx)(I.Z,{sx:{fontSize:18}})}),(0,s.jsx)(v.Z,{anchorEl:H,open:!!H,onClose:()=>K(null),children:(0,s.jsxs)(y.Z,{onClick:()=>{K(null),V(!0),Q("")},sx:{color:"error.main"},children:[(0,s.jsx)(g.Z,{children:(0,s.jsx)(z.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,s.jsx)(j.Z,{children:"Delete Server"})]})})]})]}),(0,s.jsx)(ts,{server:ea,onSendCommand:es})]}):(0,s.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,s.jsxs)(b.Z,{open:G,onClose:()=>{V(!1),Q("")},maxWidth:"sm",fullWidth:!0,children:[(0,s.jsx)(f.Z,{children:"Delete Server"}),(0,s.jsxs)(Z.Z,{children:[(0,s.jsxs)(m.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,s.jsx)("strong",{children:E})," to confirm deletion."]}),(0,s.jsx)(C.Z,{label:"Server name",value:J,onChange:e=>Q(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,s.jsxs)(w.Z,{sx:{px:3,pb:2},children:[(0,s.jsx)(o.Z,{onClick:()=>{V(!1),Q("")},children:"Cancel"}),(0,s.jsx)(o.Z,{variant:"contained",color:"error",onClick:()=>{J===E&&Y.mutate({name:E,force:!0},{onSuccess:()=>{O.push("/servers")}})},disabled:J!==E||Y.isPending,startIcon:Y.isPending?(0,s.jsx)(x.Z,{size:16}):null,children:Y.isPending?"Deleting...":"Delete"})]})]})]})}},56813:function(e,t,r){"use strict";r.d(t,{I:function(){return a}});var s=r(94655),n=r(25333),i=r(82925);function a(e){let{action:t,size:r="small"}=e,a=i.Lu[t]||"default",l=i.n3[t]||t;return(0,s.jsx)(n.Z,{label:l,color:a,size:r,variant:"filled",sx:{fontWeight:600,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},26892:function(e,t,r){"use strict";r.d(t,{c:function(){return l}});var s=r(94655),n=r(25333),i=r(46207),a=r(43436);function l(e){let{status:t,size:r="small"}=e;return(0,s.jsx)(n.Z,{icon:"success"===t?(0,s.jsx)(i.Z,{}):(0,s.jsx)(a.Z,{}),label:"success"===t?"OK":"Error",color:"success"===t?"success":"error",size:r,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},84509:function(e,t,r){"use strict";r.d(t,{DM:function(){return a},HZ:function(){return o},VM:function(){return l},hT:function(){return i},oL:function(){return d}});var s=r(5632),n=r(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),void 0!==e.limit&&t.set("limit",String(e.limit)),void 0!==e.offset&&t.set("offset",String(e.offset)),e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(e);return(0,s.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1})}function a(e){return(0,s.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,n.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function l(e,t){return(0,s.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function o(e,t){var r;return i({targetType:"server",targetName:e,limit:null!==(r=null==t?void 0:t.limit)&&void 0!==r?r:20},{enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},37228:function(e,t,r){"use strict";r.d(t,{Bc:function(){return o},N$:function(){return d},UW:function(){return l}});var s=r(5632),n=r(58919),i=r(20367),a=r(42936);function l(){return(0,s.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function o(){let e=(0,n.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/start",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}function d(){let e=(0,n.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/stop",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}},82925:function(e,t,r){"use strict";r.d(t,{KK:function(){return l},Lu:function(){return s},Xn:function(){return a},n3:function(){return n},xg:function(){return i}});let s={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},n={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],l=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,5511,880,55,7727,8347,1658,3945,6727,6645,2535,4219,4436,2666,5787,3669,2757,1744],function(){return e(e.s=59616)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{28342:function(e,r,o){Promise.resolve().then(o.bind(o,89083)),Promise.resolve().then(o.t.bind(o,58678,23)),Promise.resolve().then(o.t.bind(o,46639,23)),Promise.resolve().then(o.bind(o,3454)),Promise.resolve().then(o.bind(o,22237)),Promise.resolve().then(o.bind(o,88904)),Promise.resolve().then(o.bind(o,48283))},3454:function(e,r,o){"use strict";o.d(r,{LoadingProvider:function(){return c},startLoading:function(){return d},stopLoading:function(){return u}});var n=o(94655),t=o(35106),i=o(74228),a=o(31477),s=o.n(a);function c(e){let{children:r}=e,o=(0,i.usePathname)(),a=(0,i.useSearchParams)();return(0,t.useEffect)(()=>{s().done()},[o,a]),(0,n.jsx)(n.Fragment,{children:r})}function d(){s().start()}function u(){s().done()}s().configure({showSpinner:!1,speed:300,minimum:.1})},22237:function(e,r,o){"use strict";let n;o.d(r,{QueryProvider:function(){return s}});var t=o(94655),i=o(63145),a=o(58919);function s(e){let{children:r}=e,o=(n||(n=new i.S({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}})),n);return(0,t.jsx)(a.aH,{client:o,children:r})}},48283:function(e,r,o){"use strict";o.d(r,{ThemeProvider:function(){return s}});var n=o(94655),t=o(93150),i=o(75416),a=o(88904);function s(e){let{children:r}=e;return(0,n.jsxs)(t.Z,{theme:a.darkTheme,children:[(0,n.jsx)(i.ZP,{}),r]})}},88904:function(e,r,o){"use strict";o.d(r,{darkTheme:function(){return d}});var n=o(61789);let t="#16181c",i="#1a1d22",a="#26282e",s="#313338",c="#2e3035",d=(0,n.Z)({palette:{mode:"dark",primary:{main:"#1bd96a",light:"#4de38a",dark:"#15a852"},secondary:{main:"#7c3aed",light:"#9f67f0",dark:"#5b21b6"},background:{default:t,paper:i},success:{main:"#22c55e"},error:{main:"#ef4444"},warning:{main:"#f59e0b"},text:{primary:"#ffffff",secondary:"#9a9a9a"},divider:c,action:{hover:a,selected:a}},typography:{fontFamily:'var(--font-roboto-mono), "Roboto Mono", monospace'},components:{MuiCard:{styleOverrides:{root:{backgroundColor:i,borderRadius:"12px",border:"1px solid ".concat(c)}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}},MuiButton:{styleOverrides:{root:{borderRadius:"8px",textTransform:"none"}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:i,borderBottom:"1px solid ".concat(c)}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:i,borderRight:"1px solid ".concat(c)}}},MuiCssBaseline:{styleOverrides:{body:{scrollbarColor:"".concat(s," ").concat(t),"&::-webkit-scrollbar, & *::-webkit-scrollbar":{backgroundColor:t,width:8},"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb":{borderRadius:8,backgroundColor:s,minHeight:24},"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover":{backgroundColor:a}}}}}})},46639:function(){}},function(e){e.O(0,[6273,6812,540,2724,3669,2757,1744],function(){return e(e.s=28342)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- !function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,s),r=!1}finally{r&&delete l[e]}return n.exports}s.m=a,e=[],s.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){},s.miniCssF=function(e){},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",s.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+n),i.src=s.tu(e)),r[e]=[t];var d=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(e){return s.tt().createScriptURL(e)},s.p="/_next/",i={2272:0,6369:0},s.f.j=function(e,t){var n=s.o(i,e)?i[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(/^(2272|6369)$/.test(e))i[e]=0;else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),u=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}}},s.O.j=function(e){return 0===i[e]},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)s.o(u,n)&&(s.m[n]=u[n]);if(c)var a=c(s)}for(e&&e(t);f<o.length;f++)r=o[f],s.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return s.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f))}();
1
+ !function(){"use strict";var e,t,n,r,o,u,i,c,f,a={},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}},r=!0;try{a[e].call(n.exports,n,n.exports,s),r=!1}finally{r&&delete l[e]}return n.exports}s.m=a,e=[],s.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u<e.length;u++){for(var n=e[u][0],r=e[u][1],o=e[u][2],c=!0,f=0;f<n.length;f++)i>=o&&Object.keys(s.O).every(function(e){return s.O[e](n[f])})?n.splice(f--,1):(c=!1,o<i&&(i=o));if(c){e.splice(u--,1);var a=r();void 0!==a&&(t=a)}}return t},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);s.r(o);var u={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;"object"==typeof i&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(function(t){u[t]=function(){return e[t]}});return u.default=function(){return e},s.d(o,u),o},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){},s.miniCssF=function(e){},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",s.l=function(e,t,n,u){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var i,c,f=document.getElementsByTagName("script"),a=0;a<f.length;a++){var l=f[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+n){i=l;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+n),i.src=s.tu(e)),r[e]=[t];var d=function(t,n){i.onerror=i.onload=null,clearTimeout(p);var o=r[e];if(delete r[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),c&&document.head.appendChild(i)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.tt=function(){return void 0===u&&(u={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(u=trustedTypes.createPolicy("nextjs#bundler",u))),u},s.tu=function(e){return s.tt().createScriptURL(e)},s.p="/_next/",i={2272:0,6273:0},s.f.j=function(e,t){var n=s.o(i,e)?i[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(/^(2272|6273)$/.test(e))i[e]=0;else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),u=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}}},s.O.j=function(e){return 0===i[e]},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],f=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)s.o(u,n)&&(s.m[n]=u[n]);if(c)var a=c(s)}for(e&&e(t);f<o.length;f++)r=o[f],s.o(i,r)&&i[r]&&i[r][0](),i[r]=0;return s.O(a)},(f=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),f.push=c.bind(null,f.push.bind(f))}();
@@ -0,0 +1 @@
1
+ @import url("https://fonts.cdnfonts.com/css/minecraft-4");*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}#__next .visible{visibility:visible}#__next .fixed{position:fixed}#__next .absolute{position:absolute}#__next .relative{position:relative}#__next .sticky{position:sticky}#__next .block{display:block}#__next .flex{display:flex}#__next .table{display:table}#__next .grid{display:grid}#__next .hidden{display:none}#__next .shrink{flex-shrink:1}#__next .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#__next .break-all{word-break:break-all}#__next .rounded{border-radius:.25rem}#__next .border{border-width:1px}#__next .uppercase{text-transform:uppercase}#__next .lowercase{text-transform:lowercase}#__next .capitalize{text-transform:capitalize}#__next .italic{font-style:italic}#__next .underline{text-decoration-line:underline}#__next .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#__next .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--bg-base:#16181c;--bg-raised:#1a1d22;--bg-surface:#26282e;--bg-elevated:#313338;--text-primary:#fff;--text-secondary:#9a9a9a;--text-tertiary:#72767d;--border-default:#2e3035;--primary:#1bd96a;--primary-light:#4de38a;--primary-dark:#15a852;--secondary:#7c3aed}body{color:var(--text-primary);background-color:var(--bg-base);min-height:100vh}html{scroll-behavior:smooth;scrollbar-gutter:stable}:focus-visible{outline:2px solid var(--primary);outline-offset:2px}#nprogress{pointer-events:none}#nprogress .bar{background:var(--primary);position:fixed;z-index:9999;top:0;left:0;width:100%;height:3px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px var(--primary),0 0 5px var(--primary);opacity:1;transform:rotate(3deg) translateY(-4px)}@font-face{font-family:__Roboto_Mono_5899e0;font-style:normal;font-weight:100 700;font-display:swap;src:url(/_next/static/media/1f160ec2cb9962ef-s.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c8a,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-family:__Roboto_Mono_5899e0;font-style:normal;font-weight:100 700;font-display:swap;src:url(/_next/static/media/ad8a7e2c3c2c120b-s.woff2) format("woff2");unicode-range:u+0301,u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-family:__Roboto_Mono_5899e0;font-style:normal;font-weight:100 700;font-display:swap;src:url(/_next/static/media/cde148027b808b99-s.woff2) format("woff2");unicode-range:u+0370-0377,u+037a-037f,u+0384-038a,u+038c,u+038e-03a1,u+03a3-03ff}@font-face{font-family:__Roboto_Mono_5899e0;font-style:normal;font-weight:100 700;font-display:swap;src:url(/_next/static/media/e61ae719f7cc4155-s.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+0300-0301,u+0303-0304,u+0308-0309,u+0323,u+0329,u+1ea0-1ef9,u+20ab}@font-face{font-family:__Roboto_Mono_5899e0;font-style:normal;font-weight:100 700;font-display:swap;src:url(/_next/static/media/0ea4f4df910e6120-s.woff2) format("woff2");unicode-range:u+0100-02ba,u+02bd-02c5,u+02c7-02cc,u+02ce-02d7,u+02dd-02ff,u+0304,u+0308,u+0329,u+1d00-1dbf,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-family:__Roboto_Mono_5899e0;font-style:normal;font-weight:100 700;font-display:swap;src:url(/_next/static/media/739c2d8941231bb4-s.p.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-family:__Roboto_Mono_Fallback_5899e0;src:local("Arial");ascent-override:77.84%;descent-override:20.13%;line-gap-override:0.00%;size-adjust:134.61%}.__className_5899e0{font-family:__Roboto_Mono_5899e0,__Roboto_Mono_Fallback_5899e0;font-style:normal}.__variable_5899e0{--font-roboto-mono:"__Roboto_Mono_5899e0","__Roboto_Mono_Fallback_5899e0"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft-docker/mcctl-console",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Web management console for Docker Minecraft servers",
5
5
  "bin": {
6
6
  "mcctl-console": "bin/start.js"
@@ -47,7 +47,7 @@
47
47
  "dependencies": {
48
48
  "@emotion/react": "^11.13.5",
49
49
  "@emotion/styled": "^11.13.5",
50
- "@minecraft-docker/shared": "^2.6.0",
50
+ "@minecraft-docker/shared": "^2.7.0",
51
51
  "@mui/icons-material": "^5.17.1",
52
52
  "@mui/material": "^5.17.1",
53
53
  "@mui/material-nextjs": "^5.17.1",