@minecraft-docker/mcctl-console 2.1.3 → 2.3.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 (276) hide show
  1. package/.next/standalone/package.json +1 -1
  2. package/.next/standalone/platform/services/mcctl-console/.next/BUILD_ID +1 -1
  3. package/.next/standalone/platform/services/mcctl-console/.next/app-build-manifest.json +67 -63
  4. package/.next/standalone/platform/services/mcctl-console/.next/app-path-routes-manifest.json +1 -1
  5. package/.next/standalone/platform/services/mcctl-console/.next/build-manifest.json +4 -4
  6. package/.next/standalone/platform/services/mcctl-console/.next/prerender-manifest.json +1 -1
  7. package/.next/standalone/platform/services/mcctl-console/.next/routes-manifest.json +1 -1
  8. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page.js +1 -1
  9. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page.js.nft.json +1 -1
  10. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js +51 -1
  12. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js.nft.json +1 -1
  13. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js +1 -1
  15. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js.nft.json +1 -1
  16. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js +51 -1
  18. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js.nft.json +1 -1
  19. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js +1 -1
  21. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js.nft.json +1 -1
  22. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js +51 -1
  24. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js.nft.json +1 -1
  25. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
  40. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.html +1 -1
  41. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.rsc +1 -1
  42. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/history/route.js +1 -57
  43. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/history/route.js.nft.json +1 -1
  44. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/restore/route.js +1 -57
  45. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/restore/route.js.nft.json +1 -1
  46. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/route.js +1 -57
  47. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/route.js.nft.json +1 -1
  48. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/ban/route.js +1 -57
  49. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/ban/route.js.nft.json +1 -1
  50. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/kick/route.js +1 -57
  51. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/kick/route.js.nft.json +1 -1
  52. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/[player]/route.js +1 -57
  53. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/[player]/route.js.nft.json +1 -1
  54. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/route.js +1 -57
  55. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/route.js.nft.json +1 -1
  56. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/route.js +1 -57
  57. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/route.js.nft.json +1 -1
  58. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/whitelist/route.js +1 -57
  59. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/whitelist/route.js.nft.json +1 -1
  60. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/whitelist/status/route.js +1 -0
  61. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/whitelist/status/route.js.nft.json +1 -0
  62. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/start/route.js +1 -0
  63. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/start/route.js.nft.json +1 -0
  64. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/status/route.js +1 -0
  65. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/status/route.js.nft.json +1 -0
  66. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/stop/route.js +1 -0
  67. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/stop/route.js.nft.json +1 -0
  68. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/router/status/route.js +1 -57
  69. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/router/status/route.js.nft.json +1 -1
  70. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/[action]/route.js +1 -57
  71. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/[action]/route.js.nft.json +1 -1
  72. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/config/route.js +1 -57
  73. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/config/route.js.nft.json +1 -1
  74. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/exec/route.js +1 -57
  75. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/exec/route.js.nft.json +1 -1
  76. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/hostnames/route.js +1 -0
  77. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/hostnames/route.js.nft.json +1 -0
  78. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/route.js +1 -57
  79. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/route.js.nft.json +1 -1
  80. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/world/reset/route.js +1 -57
  81. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/world/reset/route.js.nft.json +1 -1
  82. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/route.js +1 -57
  83. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/route.js.nft.json +1 -1
  84. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/[action]/route.js +1 -57
  85. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/[action]/route.js.nft.json +1 -1
  86. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/route.js +1 -57
  87. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/route.js.nft.json +1 -1
  88. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/route.js +1 -57
  89. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/route.js.nft.json +1 -1
  90. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.html +1 -1
  91. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.rsc +3 -3
  92. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.html +1 -1
  93. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +3 -3
  94. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.html +1 -1
  95. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.rsc +3 -3
  96. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.html +1 -1
  97. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.rsc +1 -1
  98. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page_client-reference-manifest.js +1 -1
  99. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.html +1 -1
  100. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.rsc +2 -2
  101. package/.next/standalone/platform/services/mcctl-console/.next/server/app/page_client-reference-manifest.js +1 -1
  102. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.html +1 -1
  103. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.rsc +3 -3
  104. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.html +1 -1
  105. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.rsc +3 -3
  106. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.html +1 -1
  107. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.rsc +3 -3
  108. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.html +1 -1
  109. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.rsc +3 -3
  110. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page_client-reference-manifest.js +1 -1
  111. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.html +1 -1
  112. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.rsc +2 -2
  113. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.html +1 -1
  114. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.rsc +3 -3
  115. package/.next/standalone/platform/services/mcctl-console/.next/server/app-paths-manifest.json +17 -12
  116. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1309.js +57 -0
  117. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2658.js +1 -0
  118. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/354.js +1 -1
  119. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3810.js +1 -0
  120. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4207.js +1 -0
  121. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4609.js +1 -0
  122. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4859.js +1 -0
  123. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5843.js +1 -0
  124. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5845.js +51 -0
  125. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7402.js +54 -0
  126. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7445.js +1 -0
  127. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8504.js +2 -0
  128. package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-build-manifest.js +1 -1
  129. package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-manifest.json +5 -5
  130. package/.next/standalone/platform/services/mcctl-console/.next/server/next-font-manifest.js +1 -1
  131. package/.next/standalone/platform/services/mcctl-console/.next/server/next-font-manifest.json +1 -1
  132. package/.next/standalone/platform/services/mcctl-console/.next/server/pages/404.html +1 -1
  133. package/.next/standalone/platform/services/mcctl-console/.next/server/pages/500.html +1 -1
  134. package/.next/standalone/platform/services/mcctl-console/.next/server/server-reference-manifest.json +1 -1
  135. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1476-a0570078fdf78fae.js +1 -0
  136. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/190-9ecdd3c2ad7fadef.js +1 -0
  137. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2538-09440cfe5c38aa16.js +1 -0
  138. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2666-060d67b8e56af9d0.js +1 -0
  139. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2698-aeed063326ab23db.js +1 -0
  140. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2844-de6e17c136b0de1e.js +1 -0
  141. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3468-6b2e00f103a95869.js +1 -0
  142. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4596-fa980f5e0b65f2b7.js +1 -0
  143. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5386-a568e84580b1d208.js +1 -0
  144. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5787-3387a2b82bbb1e66.js +1 -0
  145. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6645-9bcc9a0f9cd2fdc9.js +1 -0
  146. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7305-17eb783421477032.js +1 -0
  147. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7727-2552fac729c5514a.js +1 -0
  148. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7965-9d8c883e48d2ae13.js +1 -0
  149. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8854-11e2a182afd76dcd.js +1 -0
  150. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9186-5b49ecbdcac7ddc4.js +1 -0
  151. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9727-8e82372636a2fca6.js +1 -0
  152. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9949-92aa4cba630945d3.js +1 -0
  153. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9951-34eb9e4c6b6cdd23.js +1 -0
  154. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/admin/users/page-b4483a2e5c12dce7.js +1 -0
  155. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/{page-21b37416096d3cfc.js → page-2763a56ce0490dd1.js} +1 -1
  156. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/backups/page-76da68ecfd3fd38f.js +1 -0
  157. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/page-b2677b1041311201.js +1 -0
  158. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-9ce7f2bf657eacfa.js +1 -0
  159. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-a06b9b52377085b5.js +1 -0
  160. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-8333f2419cbdd686.js +1 -0
  161. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/console/page-4e811ac018a2a049.js +1 -0
  162. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-00a86e5a4cd95b72.js +1 -0
  163. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-c5378a7bfc6472ca.js +1 -0
  164. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/settings/page-af345917f438de8d.js +1 -0
  165. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-01447db96eaf75eb.js +1 -0
  166. package/.next/{static/chunks/app/login/page-073a17485ca81f18.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-ff4d395f77e036b5.js} +1 -1
  167. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/signup/{page-bfb822f4c5c7ce99.js → page-861124fab907567f.js} +1 -1
  168. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/{main-d86dc43481acf07f.js → main-0309b77c14e952d4.js} +1 -1
  169. package/.next/standalone/platform/services/mcctl-console/package.json +1 -1
  170. package/.next/static/chunks/1476-a0570078fdf78fae.js +1 -0
  171. package/.next/static/chunks/190-9ecdd3c2ad7fadef.js +1 -0
  172. package/.next/static/chunks/2538-09440cfe5c38aa16.js +1 -0
  173. package/.next/static/chunks/2666-060d67b8e56af9d0.js +1 -0
  174. package/.next/static/chunks/2698-aeed063326ab23db.js +1 -0
  175. package/.next/static/chunks/2844-de6e17c136b0de1e.js +1 -0
  176. package/.next/static/chunks/3468-6b2e00f103a95869.js +1 -0
  177. package/.next/static/chunks/4596-fa980f5e0b65f2b7.js +1 -0
  178. package/.next/static/chunks/5386-a568e84580b1d208.js +1 -0
  179. package/.next/static/chunks/5787-3387a2b82bbb1e66.js +1 -0
  180. package/.next/static/chunks/6645-9bcc9a0f9cd2fdc9.js +1 -0
  181. package/.next/static/chunks/7305-17eb783421477032.js +1 -0
  182. package/.next/static/chunks/7727-2552fac729c5514a.js +1 -0
  183. package/.next/static/chunks/7965-9d8c883e48d2ae13.js +1 -0
  184. package/.next/static/chunks/8854-11e2a182afd76dcd.js +1 -0
  185. package/.next/static/chunks/9186-5b49ecbdcac7ddc4.js +1 -0
  186. package/.next/static/chunks/9727-8e82372636a2fca6.js +1 -0
  187. package/.next/static/chunks/9949-92aa4cba630945d3.js +1 -0
  188. package/.next/static/chunks/9951-34eb9e4c6b6cdd23.js +1 -0
  189. package/.next/static/chunks/app/(main)/admin/users/page-b4483a2e5c12dce7.js +1 -0
  190. package/.next/static/chunks/app/(main)/audit-logs/{page-21b37416096d3cfc.js → page-2763a56ce0490dd1.js} +1 -1
  191. package/.next/static/chunks/app/(main)/backups/page-76da68ecfd3fd38f.js +1 -0
  192. package/.next/static/chunks/app/(main)/dashboard/page-b2677b1041311201.js +1 -0
  193. package/.next/static/chunks/app/(main)/layout-9ce7f2bf657eacfa.js +1 -0
  194. package/.next/static/chunks/app/(main)/players/page-a06b9b52377085b5.js +1 -0
  195. package/.next/static/chunks/app/(main)/routing/page-8333f2419cbdd686.js +1 -0
  196. package/.next/static/chunks/app/(main)/servers/[name]/console/page-4e811ac018a2a049.js +1 -0
  197. package/.next/static/chunks/app/(main)/servers/[name]/page-00a86e5a4cd95b72.js +1 -0
  198. package/.next/static/chunks/app/(main)/servers/page-c5378a7bfc6472ca.js +1 -0
  199. package/.next/static/chunks/app/(main)/settings/page-af345917f438de8d.js +1 -0
  200. package/.next/static/chunks/app/(main)/worlds/page-01447db96eaf75eb.js +1 -0
  201. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-073a17485ca81f18.js → static/chunks/app/login/page-ff4d395f77e036b5.js} +1 -1
  202. package/.next/static/chunks/app/signup/{page-bfb822f4c5c7ce99.js → page-861124fab907567f.js} +1 -1
  203. package/.next/static/chunks/{main-d86dc43481acf07f.js → main-0309b77c14e952d4.js} +1 -1
  204. package/package.json +2 -2
  205. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1080.js +0 -1
  206. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1314.js +0 -54
  207. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2793.js +0 -1
  208. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5019.js +0 -1
  209. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5068.js +0 -1
  210. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5466.js +0 -2
  211. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/701.js +0 -1
  212. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8402.js +0 -1
  213. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8849.js +0 -1
  214. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8913.js +0 -51
  215. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1189-9b2b752dc97065ac.js +0 -1
  216. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1544-d2d1404bef00d038.js +0 -1
  217. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1721-2758853c661770ff.js +0 -1
  218. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1854-71dbad60b363e57e.js +0 -1
  219. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2537-6c9d2dfd403b7448.js +0 -1
  220. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2777-90cc701b41e837af.js +0 -1
  221. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3489-b8c5f08aa4922197.js +0 -1
  222. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4668-f487c5c564e045d6.js +0 -1
  223. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/521-a5b59e2a19c8dd4f.js +0 -1
  224. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5375-a2d3a8fb915a3971.js +0 -1
  225. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/563-d87300cc5ef5920c.js +0 -1
  226. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6357-a9d3501984c53429.js +0 -1
  227. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6479-f31fbc0f2cf7ddd0.js +0 -1
  228. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6857-5b9c04069853bfc4.js +0 -1
  229. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7359-45760f0e0e93f86b.js +0 -1
  230. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8558-4356df5e91ec7f4c.js +0 -1
  231. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/892-a0f20ea0df618c15.js +0 -1
  232. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9654-84c0d7b06321aab9.js +0 -1
  233. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/admin/users/page-48f4e3bdef6c2202.js +0 -1
  234. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/backups/page-a8606e93b4994f33.js +0 -1
  235. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/page-fe3321721ddfe2a7.js +0 -1
  236. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-bc7b020e80bc6d8d.js +0 -1
  237. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-5bbed669a03279a3.js +0 -1
  238. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-ee0b47f2cc2bc235.js +0 -1
  239. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/console/page-617a1ab914c8d828.js +0 -1
  240. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-b8d4a08a748e882d.js +0 -1
  241. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-e47f9c34ab4e890d.js +0 -1
  242. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/settings/page-dac4b25dde7b0719.js +0 -1
  243. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-7e2bc35fda11d7c4.js +0 -1
  244. package/.next/static/chunks/1189-9b2b752dc97065ac.js +0 -1
  245. package/.next/static/chunks/1544-d2d1404bef00d038.js +0 -1
  246. package/.next/static/chunks/1721-2758853c661770ff.js +0 -1
  247. package/.next/static/chunks/1854-71dbad60b363e57e.js +0 -1
  248. package/.next/static/chunks/2537-6c9d2dfd403b7448.js +0 -1
  249. package/.next/static/chunks/2777-90cc701b41e837af.js +0 -1
  250. package/.next/static/chunks/3489-b8c5f08aa4922197.js +0 -1
  251. package/.next/static/chunks/4668-f487c5c564e045d6.js +0 -1
  252. package/.next/static/chunks/521-a5b59e2a19c8dd4f.js +0 -1
  253. package/.next/static/chunks/5375-a2d3a8fb915a3971.js +0 -1
  254. package/.next/static/chunks/563-d87300cc5ef5920c.js +0 -1
  255. package/.next/static/chunks/6357-a9d3501984c53429.js +0 -1
  256. package/.next/static/chunks/6479-f31fbc0f2cf7ddd0.js +0 -1
  257. package/.next/static/chunks/6857-5b9c04069853bfc4.js +0 -1
  258. package/.next/static/chunks/7359-45760f0e0e93f86b.js +0 -1
  259. package/.next/static/chunks/8558-4356df5e91ec7f4c.js +0 -1
  260. package/.next/static/chunks/892-a0f20ea0df618c15.js +0 -1
  261. package/.next/static/chunks/9654-84c0d7b06321aab9.js +0 -1
  262. package/.next/static/chunks/app/(main)/admin/users/page-48f4e3bdef6c2202.js +0 -1
  263. package/.next/static/chunks/app/(main)/backups/page-a8606e93b4994f33.js +0 -1
  264. package/.next/static/chunks/app/(main)/dashboard/page-fe3321721ddfe2a7.js +0 -1
  265. package/.next/static/chunks/app/(main)/layout-bc7b020e80bc6d8d.js +0 -1
  266. package/.next/static/chunks/app/(main)/players/page-5bbed669a03279a3.js +0 -1
  267. package/.next/static/chunks/app/(main)/routing/page-ee0b47f2cc2bc235.js +0 -1
  268. package/.next/static/chunks/app/(main)/servers/[name]/console/page-617a1ab914c8d828.js +0 -1
  269. package/.next/static/chunks/app/(main)/servers/[name]/page-b8d4a08a748e882d.js +0 -1
  270. package/.next/static/chunks/app/(main)/servers/page-e47f9c34ab4e890d.js +0 -1
  271. package/.next/static/chunks/app/(main)/settings/page-dac4b25dde7b0719.js +0 -1
  272. package/.next/static/chunks/app/(main)/worlds/page-7e2bc35fda11d7c4.js +0 -1
  273. /package/.next/standalone/platform/services/mcctl-console/.next/static/{ODNQp8gXEvQR9CpUaVR-y → 6Zejk2EJ9K70rNE23ZkEu}/_buildManifest.js +0 -0
  274. /package/.next/standalone/platform/services/mcctl-console/.next/static/{ODNQp8gXEvQR9CpUaVR-y → 6Zejk2EJ9K70rNE23ZkEu}/_ssgManifest.js +0 -0
  275. /package/.next/static/{ODNQp8gXEvQR9CpUaVR-y → 6Zejk2EJ9K70rNE23ZkEu}/_buildManifest.js +0 -0
  276. /package/.next/static/{ODNQp8gXEvQR9CpUaVR-y → 6Zejk2EJ9K70rNE23ZkEu}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[278],{59616:function(e,r,s){Promise.resolve().then(s.bind(s,50924))},50924:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return eX}});var t=s(94655),n=s(35106),i=s(74228),a=s(31358),o=s(7281),l=s(30417),d=s(79983),c=s(81071),x=s(93017),u=s(10721),h=s(628),m=s(41565),p=s(31317),v=s(35694),j=s(7178),g=s(17820),Z=s(73424),y=s(99770),f=s(62508),b=s(5682),C=s(76678),w=s(97436),S=s(84840),k=s(76492),R=s(10117),z=s(5501),I=s(37809),P=s(21111),W=s(17978),F=s(89573),T=s(96292),D=s(33104),A=s(25333),M=s(52082),O=s(69123),B=s(71185),E=s(30165),N=s(97293),U=s(11259),q=s(66615),L=s(89161),H=s(34071),K=s(4405);function G(e){let{value:r,unit:s,label:n,icon:i,progress:a,progressMax:l,color:d="#1bd96a"}=e;return(0,t.jsxs)(h.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"baseline",gap:.75,flexWrap:"wrap",minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"h4",component:"span",sx:{fontWeight:700,color:"text.primary",fontFamily:"'JetBrains Mono', 'Fira Code', monospace",letterSpacing:"-0.5px"},children:r}),(0,t.jsx)(p.Z,{variant:"body2",component:"span",sx:{color:"text.secondary",fontWeight:500},children:s})]}),(0,t.jsx)(o.Z,{sx:{color:"text.secondary",flexShrink:0},children:i})]}),(0,t.jsx)(p.Z,{variant:"body2",sx:{color:"text.secondary",fontWeight:500,mt:.5},children:n}),(0,t.jsx)(K.Z,{variant:"determinate",value:Math.min(a/l*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=s(163),_=s(73660),J=s(90158),Q=s(58347),$=s(95511),Y=s(46725),X=s(26577),ee=s(56813),er=s(26892),es=s(84509);function et(e){var r;let{serverName:s}=e,{data:n,isLoading:i,error:a}=(0,es.HZ)(s,{limit:20});if(i)return(0,t.jsx)(o.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:60,height:24}),(0,t.jsx)(u.Z,{variant:"text",width:"60%"}),(0,t.jsx)(u.Z,{variant:"text",width:50})]},r))});if(a)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load activity: ",a.message]});let d=null!==(r=null==n?void 0:n.logs)&&void 0!==r?r:[];if(0===d.length)return(0,t.jsx)(p.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(s));return(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(J.Z,{sx:{py:0},children:d.map(e=>{var r;return(0,t.jsx)(Q.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,t.jsx)(Z.Z,{primary:(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ee.I,{action:e.action,size:"small"}),(0,t.jsxs)(p.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),(0,t.jsx)(er.c,{status:e.status,size:"small"})]}),secondary:(0,t.jsx)($.Z,{title:(r=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(r))),arrow:!0,children:(0,t.jsx)(p.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let r=new Date,s=new Date(e),t=Math.floor((r.getTime()-s.getTime())/6e4),n=Math.floor(t/60);return t<1?"just now":t<60?"".concat(t,"m ago"):n<24?"".concat(n,"h ago"):"".concat(Math.floor(n/24),"d ago")}(e.timestamp)})})})},e.id)})}),(0,t.jsx)(o.Z,{sx:{mt:2,textAlign:"center"},children:(0,t.jsx)(l.Z,{component:Y.default,href:x,size:"small",endIcon:(0,t.jsx)(X.Z,{}),sx:{textTransform:"none"},children:"View Full History"})})]})}var en=s(62328),ei=s(29793),ea=s(75726),eo=s(40064),el=s(38393),ed=s(37530),ec=s(5942),ex=s(84420),eu=s(46121),eh=s(84775),em=s(92666),ep=s(70115),ev=s(70603),ej=s(32366),eg=s(25523);function eZ(e){let{serverName:r}=e,{data:s,isLoading:i}=(0,em.Js)(r),a=(0,em.Bx)(),[u,v]=(0,n.useState)([]),[j,g]=(0,n.useState)(!1),[Z,y]=(0,n.useState)(!1),[f,b]=(0,n.useState)(""),[C,S]=(0,n.useState)(""),[k,R]=(0,n.useState)(!1),[z,I]=(0,n.useState)({open:!1,message:"",severity:"success"});(0,n.useEffect)(()=>{(null==s?void 0:s.customHostnames)&&(v(s.customHostnames),g(!1),R(!1))},[s]);let W=e=>{let r=e.trim().toLowerCase();return r?r.length>253?"Domain exceeds 253 characters":/^[a-z0-9]([a-z0-9\-.]*[a-z0-9])?$/.test(r)?r.endsWith(".local")?"Cannot use .local system domain":r.endsWith(".nip.io")?"Cannot use .nip.io system domain":u.includes(r)?"Domain already exists":"":"Invalid domain format":"Domain cannot be empty"},F=()=>{let e=f.trim().toLowerCase(),r=W(e);if(r){S(r);return}v(r=>[...r,e]),b(""),S(""),y(!1),g(!0)},T=e=>{v(r=>r.filter(r=>r!==e)),g(!0)},D=async()=>{try{await a.mutateAsync({serverName:r,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"})}},M=()=>{y(!1),b(""),S("")};return i?(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsx)(m.Z,{children:(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(x.Z,{size:24})})})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,t.jsx)(eg.Z,{color:"primary"}),(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Hostnames / Domains"})]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Manage hostnames used by mc-router to route connections to this server."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(null==s?void 0:s.systemHostnames)&&s.systemHostnames.length>0&&(0,t.jsxs)(o.Z,{sx:{mb:3},children:[(0,t.jsx)(p.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"System Hostnames (read-only)"}),(0,t.jsx)(ep.Z,{direction:"row",flexWrap:"wrap",gap:1,children:s.systemHostnames.map(e=>(0,t.jsx)(A.Z,{icon:(0,t.jsx)(ev.Z,{sx:{fontSize:16}}),label:e.hostname,title:e.description,variant:"outlined",color:"default",size:"small"},e.hostname))})]}),(0,t.jsxs)(o.Z,{sx:{mb:2},children:[(0,t.jsx)(p.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"Custom Domains"}),0===u.length&&!Z&&(0,t.jsx)(p.Z,{variant:"body2",color:"text.disabled",sx:{mb:1},children:"No custom domains configured."}),(0,t.jsx)(ep.Z,{spacing:1,children:u.map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5,px:1.5,borderRadius:1,bgcolor:"action.hover"},children:[(0,t.jsx)(p.Z,{variant:"body2",fontFamily:"monospace",children:e}),(0,t.jsx)(d.Z,{size:"small",color:"error",onClick:()=>T(e),title:"Remove domain",children:(0,t.jsx)(P.Z,{fontSize:"small"})})]},e))}),Z?(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"flex-start",gap:1,mt:1},children:[(0,t.jsx)(w.Z,{size:"small",placeholder:"e.g. play.example.com",value:f,onChange:e=>{b(e.target.value),S("")},onKeyDown:e=>{"Enter"===e.key&&F(),"Escape"===e.key&&M()},error:!!C,helperText:C,autoFocus:!0,sx:{flex:1}}),(0,t.jsx)(l.Z,{size:"small",variant:"contained",onClick:F,children:"Add"}),(0,t.jsx)(d.Z,{size:"small",onClick:M,children:(0,t.jsx)(B.Z,{fontSize:"small"})})]}):(0,t.jsx)(l.Z,{size:"small",startIcon:(0,t.jsx)(ej.Z,{}),onClick:()=>y(!0),sx:{mt:1},children:"Add Domain"})]}),k&&(0,t.jsxs)(c.Z,{severity:"warning",sx:{mb:2},children:["Container recreation is required for hostname changes to take effect. Run ",(0,t.jsx)("code",{children:"docker compose up -d"})," or restart the server from the dashboard."]}),(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,t.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(ec.Z,{}),onClick:D,disabled:!j||a.isPending,children:a.isPending?"Saving...":"Save Hostnames"})})]})}),(0,t.jsx)(ed.Z,{open:z.open,autoHideDuration:6e3,onClose:()=>I({...z,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>I({...z,open:!1}),severity:z.severity,sx:{width:"100%"},children:z.message})})]})}function ey(e){var r,s;let{serverName:i,isRunning:a}=e,{data:d,isLoading:u}=(0,em.iC)(i),v=(0,em.MH)(),g=(0,em.gx)(),[Z,k]=(0,n.useState)({}),[R,z]=(0,n.useState)(!1),[I,P]=(0,n.useState)(!1),[W,F]=(0,n.useState)(!1),[T,D]=(0,n.useState)(""),[A,M]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==d?void 0:d.config)&&k(d.config)},[d]);let B=(e,r)=>{k(s=>({...s,[e]:r})),z(!0),("memory"===e||"useAikarFlags"===e)&&P(!0)},E=async()=>{try{let e=await v.mutateAsync({serverName:i,config:Z});M({open:!0,message:e.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:e.restartRequired?"warning":"success"}),z(!1),P(!1)}catch(e){M({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}},N=async()=>{if("RESET"!==T){M({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await g.mutateAsync(i),M({open:!0,message:"World reset successfully",severity:"success"}),F(!1),D("")}catch(e){M({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return u?(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,t.jsx)(x.Z,{})}):(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(eZ,{serverName:i}),I&&(0,t.jsx)(c.Z,{severity:"warning",icon:(0,t.jsx)(ex.Z,{}),sx:{mb:3},children:"Performance settings require a server restart to take effect."}),(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Properties"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings can be changed without restarting the server."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"MOTD (Message of the Day)",value:Z.motd||"",onChange:e=>B("motd",e.target.value),helperText:"The message displayed in the server list"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Max Players",value:Z.maxPlayers||20,onChange:e=>B("maxPlayers",parseInt(e.target.value,10)),inputProps:{min:1,max:100}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Difficulty"}),(0,t.jsxs)(en.Z,{value:Z.difficulty||"normal",label:"Difficulty",onChange:e=>B("difficulty",e.target.value),children:[(0,t.jsx)(j.Z,{value:"peaceful",children:"Peaceful"}),(0,t.jsx)(j.Z,{value:"easy",children:"Easy"}),(0,t.jsx)(j.Z,{value:"normal",children:"Normal"}),(0,t.jsx)(j.Z,{value:"hard",children:"Hard"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Game Mode"}),(0,t.jsxs)(en.Z,{value:Z.gameMode||"survival",label:"Game Mode",onChange:e=>B("gameMode",e.target.value),children:[(0,t.jsx)(j.Z,{value:"survival",children:"Survival"}),(0,t.jsx)(j.Z,{value:"creative",children:"Creative"}),(0,t.jsx)(j.Z,{value:"adventure",children:"Adventure"}),(0,t.jsx)(j.Z,{value:"spectator",children:"Spectator"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(eo.Z,{control:(0,t.jsx)(el.Z,{checked:null===(r=Z.pvp)||void 0===r||r,onChange:e=>B("pvp",e.target.checked)}),label:"Enable PvP"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"View Distance (chunks)",value:Z.viewDistance||10,onChange:e=>B("viewDistance",parseInt(e.target.value,10)),inputProps:{min:3,max:32}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Spawn Protection (blocks)",value:Z.spawnProtection||16,onChange:e=>B("spawnProtection",parseInt(e.target.value,10)),inputProps:{min:0,max:128}})})]})]})}),(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Performance Settings"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings require a server restart to take effect."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"Memory Allocation",value:Z.memory||"4G",onChange:e=>B("memory",e.target.value),helperText:"Format: 4G, 8G, etc."})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(eo.Z,{control:(0,t.jsx)(el.Z,{checked:null!==(s=Z.useAikarFlags)&&void 0!==s&&s,onChange:e=>B("useAikarFlags",e.target.checked)}),label:"Use Aikar's Flags (Optimized GC)"})})]})]})}),(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"flex-end",mb:3},children:(0,t.jsx)(l.Z,{variant:"contained",size:"large",startIcon:(0,t.jsx)(ec.Z,{}),onClick:E,disabled:!R||v.isPending,sx:{px:4},children:v.isPending?"Saving...":"Save Changes"})}),(0,t.jsx)(h.Z,{sx:{borderRadius:3,borderColor:"error.main",borderWidth:1,borderStyle:"solid"},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,color:"error",children:"Danger Zone"}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(o.Z,{sx:{mb:3},children:[(0,t.jsx)(p.Z,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Reset World"}),(0,t.jsx)(p.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,t.jsx)(l.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)(eh.Z,{}),onClick:()=>F(!0),disabled:a,children:"Reset World"}),a&&(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{ml:2},children:"Stop the server first"})]})]})}),(0,t.jsxs)(y.Z,{open:W,onClose:()=>F(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(f.Z,{children:(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ex.Z,{color:"error"}),(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Reset World"})]})}),(0,t.jsxs)(b.Z,{children:[(0,t.jsxs)(p.Z,{variant:"body1",gutterBottom:!0,children:["This will permanently delete the world for ",(0,t.jsx)("strong",{children:i})," and generate a new one."]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"This action cannot be undone. All player progress and builds will be lost."}),(0,t.jsx)(w.Z,{fullWidth:!0,label:"Type RESET to confirm",value:T,onChange:e=>D(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(l.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(l.Z,{variant:"contained",color:"error",onClick:N,disabled:"RESET"!==T||g.isPending,startIcon:g.isPending?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eu.Z,{}),children:g.isPending?"Resetting...":"Reset World"})]})]}),(0,t.jsx)(ed.Z,{open:A.open,autoHideDuration:6e3,onClose:()=>M({...A,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>M({...A,open:!1}),severity:A.severity,sx:{width:"100%"},children:A.message})})]})}var ef=s(86702),eb=s(47606),eC=s(407),ew=s(56056),eS=s(28058),ek=s(11597),eR=s(59602);let ez={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function eI(e){let{permission:r,size:s="medium"}=e,n=ez[r];return(0,t.jsx)(A.Z,{label:n.label,color:n.color,variant:n.variant,size:s})}var eP=s(99046),eW=s(68038),eF=s(34080),eT=s(39181),eD=s(5632),eA=s(58919),eM=s(20367),eO=s(42936);function eB(e){var r,s;let{open:i,onClose:a,serverId:d}=e,[u,h]=(0,n.useState)(""),[m,v]=(0,n.useState)(null),[j,g]=(0,n.useState)("view"),{data:Z,isLoading:S}=(s={enabled:i},(0,eD.a)({queryKey:["users","search",u],queryFn:()=>(0,eO.SC)("/api/users?q=".concat(encodeURIComponent(u))),enabled:(null==s?void 0:s.enabled)!==!1&&u.length>=2,staleTime:3e4})),k=function(){let e=(0,eA.NL)();return(0,eM.D)({mutationFn:e=>(0,eO.SC)("/api/user-servers",{method:"POST",body:JSON.stringify(e)}),onSuccess:(r,s)=>{e.invalidateQueries({queryKey:["user-servers",s.serverId]}),e.invalidateQueries({queryKey:["user-servers"]})}})}(),R=(0,n.useMemo)(()=>{var e;return null!==(e=null==Z?void 0:Z.users)&&void 0!==e?e:[]},[Z]),z=()=>{h(""),v(null),g("view"),k.reset(),a()};return(0,t.jsxs)(y.Z,{open:i,onClose:z,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,t.jsx)(f.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,t.jsxs)(b.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[k.isError&&(0,t.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(r=k.error)||void 0===r?void 0:r.message)||"Failed to grant access"}),(0,t.jsx)(eP.Z,{options:R,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,r)=>e.id===r.id,value:m,onChange:(e,r)=>v(r),inputValue:u,onInputChange:(e,r)=>h(r),loading:S,filterOptions:e=>e,noOptionsText:u.length<2?"Type at least 2 characters":"No users found",renderInput:e=>(0,t.jsx)(w.Z,{...e,label:"Search User",placeholder:"Search by name or email...",InputProps:{...e.InputProps,endAdornment:(0,t.jsxs)(t.Fragment,{children:[S&&(0,t.jsx)(x.Z,{size:20}),e.InputProps.endAdornment]})}}),renderOption:(e,r)=>{var s,n,i;let{key:a,...l}=e;return(0,t.jsxs)(o.Z,{component:"li",...l,sx:{display:"flex",gap:1.5,py:1},children:[(0,t.jsx)(ef.Z,{src:null!==(i=r.image)&&void 0!==i?i:void 0,sx:{width:32,height:32,bgcolor:"primary.main",fontSize:14},children:((null===(s=r.name)||void 0===s?void 0:s[0])||(null===(n=r.email)||void 0===n?void 0:n[0])||"?").toUpperCase()}),(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:r.name||"Unknown"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:r.email})]})]},a)}}),(0,t.jsxs)(ei.Z,{children:[(0,t.jsx)(eW.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,t.jsxs)(eF.Z,{value:j,onChange:e=>g(e.target.value),children:[(0,t.jsx)(eo.Z,{value:"view",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Viewer"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can view server status and logs"})]})}),(0,t.jsx)(eo.Z,{value:"manage",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Operator"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can start, stop, and configure the server"})]})}),(0,t.jsx)(eo.Z,{value:"admin",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Owner"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Full control including managing other users"})]})})]})]})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:z,color:"inherit",children:"Cancel"}),(0,t.jsx)(l.Z,{onClick:()=>{m&&k.mutate({userId:m.id,serverId:d,permission:j},{onSuccess:z})},variant:"contained",disabled:!m||k.isPending,sx:{borderRadius:2},children:k.isPending?"Adding...":"Add User"})]})]})}function eE(e){var r,s;let{serverId:i}=e,{data:a,isLoading:x,error:y}=(0,eD.a)({queryKey:["user-servers",i],queryFn:()=>(0,eO.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),f=function(){let e=(0,eA.NL)();return(0,eM.D)({mutationFn:e=>{let{id:r,permission:s}=e;return(0,eO.SC)("/api/user-servers/".concat(encodeURIComponent(r)),{method:"PATCH",body:JSON.stringify({permission:s})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),b=function(){let e=(0,eA.NL)();return(0,eM.D)({mutationFn:e=>(0,eO.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[C,w]=(0,n.useState)(!1),[S,k]=(0,n.useState)(null),[R,z]=(0,n.useState)(null),P=(e,r)=>{k(e.currentTarget),z(r)},W=()=>{k(null),z(null)},F=e=>{if(!R||R.permission===e){W();return}f.mutate({id:R.id,permission:e},{onSettled:W})},T=null!==(r=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==r?r:0,D=(null==R?void 0:R.permission)==="admin"&&T<=1;if(x)return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%",height:32}),(0,t.jsx)(u.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,t.jsx)(O.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,t.jsx)(u.Z,{variant:"circular",width:40,height:40}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%"}),(0,t.jsx)(u.Z,{variant:"text",width:"60%"})]}),(0,t.jsx)(u.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,t.jsx)(u.Z,{variant:"circular",width:32,height:32})]},e))]})});if(y)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",y.message]});let A=null!==(s=null==a?void 0:a.users)&&void 0!==s?s:[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Server Access"}),(0,t.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(eb.Z,{}),onClick:()=>w(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,t.jsx)(O.Z,{sx:{mb:1}}),0===A.length?(0,t.jsx)(o.Z,{sx:{py:4,textAlign:"center"},children:(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"No users have been granted access to this server yet."})}):A.map(e=>{var r,s,n,i,a,l,c,x;return(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,t.jsx)(ef.Z,{src:null!==(x=null===(r=e.user)||void 0===r?void 0:r.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===(s=n.name)||void 0===s?void 0:s[0])||(null===(a=e.user)||void 0===a?void 0:null===(i=a.email)||void 0===i?void 0:i[0])||"?").toUpperCase()}),(0,t.jsxs)(o.Z,{sx:{flex:1,minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(l=e.user)||void 0===l?void 0:l.name)||"Unknown User"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:(null===(c=e.user)||void 0===c?void 0:c.email)||e.userId})]}),(0,t.jsx)(eI,{permission:e.permission,size:"small"}),(0,t.jsx)(d.Z,{size:"small",onClick:r=>P(r,e),sx:{color:"text.secondary"},children:(0,t.jsx)(I.Z,{fontSize:"small"})})]},e.id)}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,t.jsx)(eR.Z,{sx:{fontSize:16,color:"text.disabled"}}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.disabled",children:"Only platform admins and server owners can manage access."})]})]})}),(0,t.jsxs)(v.Z,{anchorEl:S,open:!!S,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,t.jsxs)(j.Z,{onClick:()=>F("admin"),disabled:(null==R?void 0:R.permission)==="admin",children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(eC.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Owner"})]}),(0,t.jsxs)(j.Z,{onClick:()=>F("manage"),disabled:(null==R?void 0:R.permission)==="manage"||D,children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(ew.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Operator"})]}),(0,t.jsxs)(j.Z,{onClick:()=>F("view"),disabled:(null==R?void 0:R.permission)==="view"||D,children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(eS.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Viewer"})]}),(0,t.jsx)(O.Z,{}),(0,t.jsxs)(j.Z,{onClick:()=>{R&&b.mutate(R.id,{onSettled:W})},disabled:D,sx:{color:"error.main"},children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(ek.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Remove Access"})]})]}),(0,t.jsx)(eB,{open:C,onClose:()=>w(!1),serverId:i})]})}var eN=s(10449),eU=s(24559),eq=s(37228);function eL(e){let{text:r}=e,[s,i]=(0,n.useState)(!1),a=async()=>{try{await navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),2e3)}catch(e){console.error("Failed to copy:",e)}};return(0,t.jsx)(d.Z,{size:"small",onClick:a,sx:{ml:1,color:s?"success.main":"text.secondary","&:hover":{bgcolor:"action.hover"}},"aria-label":s?"Copied":"Copy to clipboard",children:s?(0,t.jsx)(eU.Z,{sx:{fontSize:16}}):(0,t.jsx)(eN.Z,{sx:{fontSize:16}})})}function eH(e){let{label:r,value:s,copyText:n}=e;return(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:1},children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:r}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,t.jsx)(p.Z,{variant:"body2",sx:{fontFamily:n?"monospace":"inherit",color:n?"text.primary":"text.secondary"},children:s}),n&&(0,t.jsx)(eL,{text:n})]})]})}function eK(e){let{serverName:r,hostname:s}=e,{data:n,isLoading:i}=(0,eq.UW)();if(i)return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]})]})});let a=s?"".concat(s,":25565"):"Not configured",l=(null==n?void 0:n.enabled)&&n.servers.length>0,d=null==n?void 0:n.servers.find(e=>e.serverName===r),c=(null==d?void 0:d.playitDomain)||"Not configured",x=!!(null==d?void 0:d.playitDomain);return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Connection"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(eH,{label:"LAN Address",value:a,copyText:s?a:void 0}),l&&(0,t.jsx)(eH,{label:"External Address",value:c,copyText:x?c:void 0})]})})}let eG=["Overview","Activity","Content","Files","Backups","Access","Options"];function eV(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 e_(e){var r,s,i,a,c;let{server:x,onSendCommand:u}=e,[v,j]=(0,n.useState)("Overview"),[g,Z]=(0,n.useState)(""),[f,C]=(0,n.useState)(!0),[R,z]=(0,n.useState)(!1),I=(0,n.useRef)(null),{logs:P,isConnected:W}=(0,V.Y)({serverName:x.name}),F=(0,n.useMemo)(()=>P.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[P]);(0,n.useEffect)(()=>{I.current&&f&&(I.current.scrollTop=I.current.scrollHeight)},[F,f]);let T=async()=>{g.trim()&&u&&(await u(g.trim()),Z(""))},D=null!==(a=null===(r=x.stats)||void 0===r?void 0:r.cpuPercent)&&void 0!==a?a:0;(null===(s=x.stats)||void 0===s?void 0:s.memoryUsage)&&x.stats.memoryUsage,function(e){if(!e)return;let r=e.match(/^(\d+)\s*(M|G)?$/i);if(r)parseInt(r[1],10),(r[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,t.jsxs)(o.Z,{children:[(0,t.jsx)(o.Z,{sx:{display:"flex",gap:.5,mb:3},children:eG.map(e=>(0,t.jsx)(l.Z,{onClick:()=>j(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,t.jsxs)(o.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,t.jsx)(G,{value:"".concat(D.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,t.jsx)(E.Z,{sx:{fontSize:28}}),progress:D,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:"".concat(K.toFixed(2),"%"),unit:"/ 100%",label:"Memory usage",icon:(0,t.jsx)(N.Z,{sx:{fontSize:28}}),progress:K,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:x.worldSize||"0 B",unit:"/ 10 GB",label:"World size",icon:(0,t.jsx)(U.Z,{sx:{fontSize:28}}),progress:function(e){if(!e)return 0;let r=e.match(/^([\d.]+)\s*(B|KB|MB|MiB|GB|GiB)?$/i);if(!r)return 0;let s=parseFloat(r[1]);switch((r[2]||"B").toUpperCase()){case"GB":case"GIB":return 1024*s;case"MB":case"MIB":return s;case"KB":return s/1024;default:return s/1048576}}(x.worldSize),progressMax:10240,color:"#1bd96a"})]}),(0,t.jsxs)(h.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,t.jsxs)(o.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(p.Z,{variant:"h6",sx:{fontWeight:700,color:"text.primary"},children:"Console"}),(0,t.jsx)(o.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:W?"primary.main":"error.main",boxShadow:W?"0 0 8px rgba(27, 217, 106, 0.4)":"0 0 8px rgba(239, 68, 68, 0.4)"}})]}),(0,t.jsxs)(o.Z,{sx:{position:"relative"},children:[(0,t.jsx)(o.Z,{ref:I,onScroll:()=>{if(!I.current)return;let{scrollTop:e,scrollHeight:r,clientHeight:s}=I.current;C(r-e-s<30)},sx:{height:360,overflowY:"auto",px:2.5,py:2,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', 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===F.length?(0,t.jsx)(p.Z,{sx:{color:"text.secondary",textAlign:"center",py:8},children:"Waiting for logs..."}):F.map((e,r)=>{let s=function(e){let r=eV(e).match(/\[(\d{2}:\d{2}:\d{2})\]\s*\[([^/]+)\/(\w+)\]:\s*(.+)/);return r?{time:r[1],thread:r[2],level:r[3]||"INFO",msg:r[4]}:null}(e);return s?(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,t.jsxs)(o.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",s.time,"]"]}),(0,t.jsxs)(o.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",s.thread,"/",(0,t.jsx)(o.Z,{component:"span",sx:{color:"WARN"===s.level?"#e8a848":"#6b6e80"},children:s.level}),"]:\xa0"]}),(0,t.jsx)(o.Z,{component:"span",sx:{color:"WARN"===s.level?"#c4a45a":"#b4b6c4"},children:s.msg})]},r):(0,t.jsx)(o.Z,{sx:{color:"#b4b6c4"},children:eV(e)},r)})}),(0,t.jsx)(d.Z,{onClick:()=>z(!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,t.jsx)(q.Z,{sx:{fontSize:18}})}),!f&&(0,t.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,t.jsx)(L.Z,{sx:{fontSize:18}})})]}),(0,t.jsx)(o.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(w.Z,{fullWidth:!0,size:"small",placeholder:"Send a command",value:g,onChange:e=>Z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),T())},disabled:!W,InputProps:{startAdornment:(0,t.jsx)(M.Z,{position:"start",children:(0,t.jsx)(H.Z,{sx:{fontSize:16,color:"#999"}})}),sx:{bgcolor:"#13141c",borderRadius:2,fontFamily:"'JetBrains Mono', 'Fira Code', monospace",fontSize:14,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#2a2d3e"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#3a3d4e"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}}})})]}),"Overview"===v&&(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Information"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(eJ,{label:"Name",value:x.name}),(0,t.jsx)(eJ,{label:"Container",value:x.container}),(0,t.jsx)(eJ,{label:"Hostname",value:x.hostname}),(0,t.jsx)(eJ,{label:"Type",value:x.type}),(0,t.jsx)(eJ,{label:"Version",value:x.version}),(0,t.jsx)(eJ,{label:"Memory",value:x.memory}),(0,t.jsx)(eJ,{label:"Uptime",value:x.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(x.uptimeSeconds)})]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Players"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),x.players?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eJ,{label:"Online",value:"".concat(x.players.online," / ").concat(x.players.max)}),x.players.list&&x.players.list.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mt:2,mb:1},children:"Online Players"}),(0,t.jsx)(o.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.list.map(e=>(0,t.jsx)(A.Z,{label:e,size:"small"},e))})]})]}):(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(eK,{serverName:x.name,hostname:x.hostname})})]}),"Activity"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Activity"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(et,{serverName:x.name})]})})}),"Content"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Content management coming soon"})}),"Files"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(eE,{serverId:x.name})}),"Options"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(ey,{serverName:x.name,isRunning:"running"===x.status})}),(0,t.jsxs)(y.Z,{open:R,onClose:()=>z(!1),maxWidth:"xl",fullWidth:!0,PaperProps:{sx:{height:"90vh",bgcolor:"background.paper"}},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(p.Z,{variant:"h6",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,letterSpacing:"0.05em"},children:["Console - ",x.name]}),(0,t.jsx)(d.Z,{onClick:()=>z(!1),children:(0,t.jsx)(B.Z,{})})]}),(0,t.jsx)(b.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(_.K,{serverName:x.name})})]})]})}function eJ(e){let{label:r,value:s}=e;return s?(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:r}),(0,t.jsx)(p.Z,{variant:"body2",sx:{fontWeight:500},children:s})]}):null}var eQ=s(93757);function e$(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function eY(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M21 2v6h-6"}),(0,t.jsx)("path",{d:"M3 12a9 9 0 0115.36-6.36L21 8"}),(0,t.jsx)("path",{d:"M3 22v-6h6"}),(0,t.jsx)("path",{d:"M21 12a9 9 0 01-15.36 6.36L3 16"})]})}function eX(){var e,r,s,A;let M=(0,i.useParams)(),O=(0,a.x)(),B=decodeURIComponent(M.name),{data:E,isLoading:N,error:U}=(0,em.Hy)(B),{status:q,health:L}=function(e){let{serverName:r,onStatusChange:s,enabled:t=!0,reconnectInterval:i=3e3}=e,[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{o(null),d(null)},[r]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let r=e.data.status,t=e.data.health;o(r),d(t),null==s||s(r,t)}},[s]),{isConnected:x,reconnect:u,retryCount:h}=(0,eQ.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/status"),onMessage:c,enabled:t,reconnectInterval:i});return{status:a,health:l,isConnected:x,reconnect:u,retryCount:h}}({serverName:B,enabled:!!B}),[H,K]=(0,n.useState)(null),[G,V]=(0,n.useState)(!1),[_,J]=(0,n.useState)(""),Q=(0,em.jM)(),$=(0,em.Aw)(),Y=(0,em._I)(),X=(0,em.Hq)(),ee=async()=>{try{await Q.mutateAsync(B)}catch(e){console.error("Failed to start server:",e)}},er=async()=>{try{await $.mutateAsync(B)}catch(e){console.error("Failed to stop server:",e)}},es=async()=>{try{await Y.mutateAsync(B)}catch(e){console.error("Failed to restart server:",e)}},et=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(B),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=q||(null==E?void 0:E.server.status),ei=Q.isPending||$.isPending||Y.isPending,ea=null==E?void 0:E.server;return(0,t.jsxs)(t.Fragment,{children:[U&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to load server: ",U.message]}),Q.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=Q.error)||void 0===e?void 0:e.message]}),$.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(r=$.error)||void 0===r?void 0:r.message]}),Y.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(s=Y.error)||void 0===s?void 0:s.message]}),X.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to delete server: ",null===(A=X.error)||void 0===A?void 0:A.message]}),N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:40}),(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,t.jsx)(u.Z,{variant:"text",width:100}),(0,t.jsx)(u.Z,{variant:"text",width:60}),(0,t.jsx)(u.Z,{variant:"text",width:140}),(0,t.jsx)(u.Z,{variant:"text",width:50})]})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,t.jsx)(u.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,t.jsx)(o.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,r)=>(0,t.jsx)(u.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},r))}),(0,t.jsx)(o.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,t.jsx)(u.Z,{variant:"text",width:"50%"}),(0,t.jsx)(u.Z,{variant:"circular",width:28,height:28})]}),(0,t.jsx)(u.Z,{variant:"text",width:"60%",height:36}),(0,t.jsx)(u.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,t.jsxs)(h.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,t.jsxs)(o.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(u.Z,{variant:"text",width:80,height:28}),(0,t.jsx)(u.Z,{variant:"circular",width:10,height:10})]}),(0,t.jsx)(u.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,t.jsx)(o.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(u.Z,{variant:"rounded",width:"100%",height:40,sx:{borderRadius:2}})})]}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"25%"}),(0,t.jsx)(u.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(o.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 r=e.toUpperCase();return["PAPER","SPIGOT","BUKKIT","PURPUR"].includes(r)?"\uD83D\uDD0C":["FORGE","NEOFORGE","FABRIC","QUILT"].includes(r)?"\uD83D\uDD27":"\uD83C\uDFAE"}(ea.type)}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsxs)(p.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,t.jsx)(R.Z,{sx:{fontSize:14}})," All servers"]}),(0,t.jsx)(p.Z,{variant:"h4",component:"h1",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"text.primary",letterSpacing:"0.5px",m:0,textTransform:"uppercase"},children:B}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:0,mt:.75,flexWrap:"wrap",fontSize:13,color:"text.secondary"},children:[ea.version&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(W.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(F.Z,{sx:{fontSize:14}}),ea.type]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(T.Z,{sx:{fontSize:14}}),ea.hostname]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(D.Z,{sx:{fontSize:14}}),ea.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(ea.uptimeSeconds)||"0s"]})]})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,t.jsx)(l.Z,{variant:"contained",color:"success",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(z.Z,{}),onClick:ee,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600},children:"Start"}),"running"===en&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Z,{variant:"outlined",startIcon:ei?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(e$,{}),onClick:er,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,t.jsx)(l.Z,{variant:"contained",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(eY,{}),onClick:es,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,t.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,t.jsx)(I.Z,{sx:{fontSize:18}})}),(0,t.jsx)(v.Z,{anchorEl:H,open:!!H,onClose:()=>K(null),children:(0,t.jsxs)(j.Z,{onClick:()=>{K(null),V(!0),J("")},sx:{color:"error.main"},children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(P.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Delete Server"})]})})]})]}),(0,t.jsx)(e_,{server:ea,onSendCommand:et})]}):(0,t.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,t.jsxs)(y.Z,{open:G,onClose:()=>{V(!1),J("")},maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(f.Z,{children:"Delete Server"}),(0,t.jsxs)(b.Z,{children:[(0,t.jsxs)(p.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,t.jsx)("strong",{children:B})," to confirm deletion."]}),(0,t.jsx)(w.Z,{label:"Server name",value:_,onChange:e=>J(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:()=>{V(!1),J("")},children:"Cancel"}),(0,t.jsx)(l.Z,{variant:"contained",color:"error",onClick:()=>{_===B&&X.mutate({name:B,force:!0},{onSuccess:()=>{O.push("/servers")}})},disabled:_!==B||X.isPending,startIcon:X.isPending?(0,t.jsx)(x.Z,{size:16}):null,children:X.isPending?"Deleting...":"Delete"})]})]})]})}},56813:function(e,r,s){"use strict";s.d(r,{I:function(){return a}});var t=s(94655),n=s(25333),i=s(82925);function a(e){let{action:r,size:s="small"}=e,a=i.Lu[r]||"default",o=i.n3[r]||r;return(0,t.jsx)(n.Z,{label:o,color:a,size:s,variant:"filled",sx:{fontWeight:600,fontSize:"small"===s?"0.7rem":"0.8rem"}})}},26892:function(e,r,s){"use strict";s.d(r,{c:function(){return o}});var t=s(94655),n=s(25333),i=s(46207),a=s(43436);function o(e){let{status:r,size:s="small"}=e;return(0,t.jsx)(n.Z,{icon:"success"===r?(0,t.jsx)(i.Z,{}):(0,t.jsx)(a.Z,{}),label:"success"===r?"OK":"Error",color:"success"===r?"success":"error",size:s,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===s?"0.7rem":"0.8rem"}})}},84509:function(e,r,s){"use strict";s.d(r,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return d}});var t=s(5632),n=s(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,s=function(e){let r=new URLSearchParams;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),void 0!==e.limit&&r.set("limit",String(e.limit)),void 0!==e.offset&&r.set("offset",String(e.offset)),e.sort&&r.set("sort",e.sort);let s=r.toString();return s?"?".concat(s):""}(e);return(0,t.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs".concat(s)),enabled:(null==r?void 0:r.enabled)!==!1})}function a(e){return(0,t.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,n.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,r){return(0,t.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==r?void 0:r.enabled)!==!1&&!!e})}function l(e,r){var s;return i({targetType:"server",targetName:e,limit:null!==(s=null==r?void 0:r.limit)&&void 0!==s?s:20},{enabled:(null==r?void 0:r.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,r,s){"use strict";s.d(r,{Bc:function(){return l},N$:function(){return d},UW:function(){return o}});var t=s(5632),n=s(58919),i=s(20367),a=s(42936);function o(){return(0,t.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function l(){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,r,s){"use strict";s.d(r,{KK:function(){return o},Lu:function(){return t},Xn:function(){return a},n3:function(){return n},xg:function(){return i}});let t={"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"],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,7727,8347,1658,9951,6727,6645,7305,4596,9186,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([[224],{49726:function(e,t,r){Promise.resolve().then(r.bind(r,7854))},7854:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return en}});var n=r(94655),s=r(35106),o=r(31358),i=r(7281),a=r(30417),l=r(81071),c=r(93017),d=r(69899),u=r(31317),h=r(76492),x=r(32366),m=r(78067),p=r(84840),f=r(97436),v=r(52082),g=r(89923),j=r(10297),y=r(42431),S=r(628),b=r(41565),Z=r(25935),C=r(79983),k=r(25333),w=r(95511),T=r(5501),E=r(93315),R=r(27171),I=r(96292);let P=e=>{switch(e){case"running":return"success";case"stopped":case"exited":case"not_created":return"error";case"created":return"warning";default:return"default"}},M=e=>{switch(e){case"running":return"Running";case"stopped":case"exited":return"Stopped";case"not_created":return"Not Created";case"created":return"Created";default:return e||"Unknown"}},O=e=>{if(!e)return"-";let t=e.split(",").map(e=>e.trim());return t.find(e=>e.endsWith(".local"))||t[0]||"-"};function F(e){var t;let{server:r,statusOverride:s,onClick:o,onStart:a,onStop:l,loading:c=!1}=e,d=(null==s?void 0:s.status)||r.status,h=(e,t)=>{e.stopPropagation(),t(r.name)},x="running"===d,m="stopped"===d||"exited"===d||"not_created"===d,p=O(r.hostname),f=(null===(t=r.hostname)||void 0===t?void 0:t.split(",").map(e=>e.trim()))||[];return(0,n.jsxs)(S.Z,{role:"article",onClick:()=>{o&&o(r.name)},sx:{cursor:o?"pointer":"default",transition:"all 0.2s",height:180,display:"flex",flexDirection:"column","&:hover":o?{transform:"translateY(-2px)",boxShadow:4}:{}},children:[(0,n.jsxs)(b.Z,{sx:{flex:1,pb:1},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,n.jsx)(u.Z,{variant:"h6",component:"h3",sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,mr:1},children:r.name}),(0,n.jsx)(k.Z,{label:M(d),size:"small",color:P(d),sx:{fontWeight:500,minWidth:70}})]}),(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,n.jsx)(I.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,n.jsx)(w.Z,{title:f.length>1?f.join("\n"):"",arrow:!0,children:(0,n.jsxs)(u.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[p,f.length>1&&" (+".concat(f.length-1,")")]})})]}),(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(R.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,n.jsx)(u.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.container})]})]}),(0,n.jsxs)(Z.Z,{sx:{justifyContent:"flex-end",px:2,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:[m&&a&&(0,n.jsx)(C.Z,{"aria-label":"Start server",color:"success",onClick:e=>h(e,a),disabled:c,size:"small",children:(0,n.jsx)(T.Z,{})}),x&&l&&(0,n.jsx)(C.Z,{"aria-label":"Stop server",color:"error",onClick:e=>h(e,l),disabled:c,size:"small",children:(0,n.jsx)(E.Z,{})}),!m&&!x&&(0,n.jsx)(i.Z,{sx:{height:34}})]})]})}function L(e){let{servers:t,statusMap:r={},onServerClick:o,onStart:l,onStop:c,onCreate:d,loadingServers:h=[]}=e,[m,S]=(0,s.useState)(""),[b,Z]=(0,s.useState)("all"),C=(0,s.useMemo)(()=>t.filter(e=>{if(m&&!e.name.toLowerCase().includes(m.toLowerCase()))return!1;let t=r[e.name],n=(null==t?void 0:t.status)||e.status;return("running"!==b||"running"===n)&&("stopped"!==b||"stopped"===n||"exited"===n||"not_created"===n)}),[t,r,m,b]);return 0===t.length?(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",gap:2},children:[(0,n.jsx)(u.Z,{variant:"h6",color:"text.secondary",children:"No servers found"}),d&&(0,n.jsx)(a.Z,{variant:"contained",startIcon:(0,n.jsx)(x.Z,{}),onClick:d,children:"Create Server"})]}):(0,n.jsxs)(i.Z,{children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2,mb:3,alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between"},children:[(0,n.jsxs)(j.Z,{value:b,exclusive:!0,onChange:(e,t)=>{null!==t&&Z(t)},size:"small",sx:{flexShrink:0},children:[(0,n.jsx)(g.Z,{value:"all",children:"All"}),(0,n.jsx)(g.Z,{value:"running",children:"Running"}),(0,n.jsx)(g.Z,{value:"stopped",children:"Stopped"})]}),(0,n.jsx)(f.Z,{size:"small",placeholder:"Search servers...",value:m,onChange:e=>S(e.target.value),InputProps:{startAdornment:(0,n.jsx)(v.Z,{position:"start",children:(0,n.jsx)(y.Z,{})})},sx:{flexGrow:{xs:1,sm:0},minWidth:{sm:300}}})]}),(0,n.jsxs)(u.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:[C.length," ",1===C.length?"server":"servers"]}),0===C.length?(0,n.jsx)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",gap:2},children:(0,n.jsx)(u.Z,{variant:"h6",color:"text.secondary",children:"No servers found"})}):(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:C.map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,n.jsx)(F,{server:e,statusOverride:r[e.name],onClick:o,onStart:l,onStop:c,loading:h.includes(e.name)})},e.name))})]})}var W=r(99770),A=r(62508),N=r(5682),z=r(76678),D=r(7178),_=r(40064),G=r(45547),V=r(4405),q=r(73383),U=r(82285),H=r(13609),J=r(46207),$=r(43436),B=r(87716);let Y=["VANILLA","PAPER","FABRIC","FORGE","NEOFORGE"],K=["","forge","fabric","neoforge","quilt"],Q={name:"",type:"PAPER",version:"1.21.1",memory:"4G",autoStart:!1,sudoPassword:""},X=[{key:"initializing",label:"Initializing"},{key:"creating",label:"Creating"},{key:"configuring",label:"Configuring"},{key:"starting",label:"Starting"}];function ee(e){let t,{open:r,onClose:o,onSubmit:d,loading:h=!1,status:x="idle",progress:m=0,message:p=""}=e,[v,y]=(0,s.useState)("standard"),[S,b]=(0,s.useState)(Q),[Z,C]=(0,s.useState)({}),[k,w]=(0,s.useState)(!1),T=(0,s.useRef)(null),E=(0,s.useRef)(null),R=X.findIndex(e=>e.key===x),I="idle"!==x&&"completed"!==x&&"error"!==x;(0,s.useEffect)(()=>{r||(y("standard"),b(Q),C({}),w(!1))},[r]);let P=e=>e?/^[a-z0-9-]+$/.test(e)?null:"Only lowercase letters, numbers, and hyphens are allowed":"Server name is required",M=e=>e?null:"Modpack slug is required",O=e=>t=>{let r=t.target.value;b(t=>({...t,[e]:r})),"memory"===e&&w(!0),Z[e]&&C(t=>({...t,[e]:""}))};return(0,n.jsx)(W.Z,{open:r,onClose:I?void 0:o,maxWidth:"sm",fullWidth:!0,children:(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),C({});let t=P(S.name);if(t){C({name:t});return}if("modpack"===v){let e=M(S.modpack||"");if(e){C({modpack:e});return}}let r={name:S.name,memory:S.memory,autoStart:S.autoStart,sudoPassword:S.sudoPassword};"standard"===v?(r.type=S.type,r.version=S.version):(r.type="MODRINTH",r.modpack=S.modpack,S.modpackVersion&&(r.modpackVersion=S.modpackVersion),S.modLoader&&(r.modLoader=S.modLoader)),d(r)},children:[(0,n.jsx)(A.Z,{children:"completed"===x?(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(J.Z,{color:"success"}),"Server Created Successfully"]}):"error"===x?(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)($.Z,{color:"error"}),"Creation Failed"]}):"Create New Server"}),(0,n.jsx)(N.Z,{children:I||"completed"===x||"error"===x?(0,n.jsxs)(i.Z,{sx:{py:2},children:[(0,n.jsx)(q.Z,{activeStep:R,alternativeLabel:!0,sx:{mb:3},children:X.map(e=>(0,n.jsx)(U.Z,{children:(0,n.jsx)(H.Z,{children:e.label})},e.key))}),I&&(0,n.jsxs)(i.Z,{sx:{mb:3},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,n.jsx)(u.Z,{variant:"body2",color:"text.secondary",children:p}),(0,n.jsxs)(u.Z,{variant:"body2",color:"text.secondary",children:[m,"%"]})]}),(0,n.jsx)(V.Z,{variant:"determinate",value:m})]}),"completed"===x&&(0,n.jsx)(u.Z,{color:"success.main",sx:{textAlign:"center"},children:p}),"error"===x&&(0,n.jsx)(u.Z,{color:"error.main",sx:{textAlign:"center"},children:p})]}):(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[(0,n.jsx)(i.Z,{ref:E,role:"status","aria-live":"polite",sx:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"}}),(0,n.jsx)(f.Z,{label:"Server Name",value:S.name,onChange:O("name"),error:!!Z.name,helperText:Z.name||"Only lowercase letters, numbers, and hyphens",fullWidth:!0,autoFocus:!0,disabled:I}),(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,n.jsx)(u.Z,{variant:"subtitle2",color:"text.secondary",children:"Server Type"}),(0,n.jsxs)(j.Z,{value:v,exclusive:!0,onChange:(e,t)=>{null!==t&&(y(t),E.current&&(E.current.textContent="".concat("standard"===t?"Standard Server":"Modpack"," category selected")),k||b(e=>({...e,memory:"standard"===t?"4G":"6G"})),setTimeout(()=>{"modpack"===t&&T.current&&T.current.focus()},300))},"aria-label":"Server category",fullWidth:!0,disabled:I,children:[(0,n.jsx)(g.Z,{value:"standard","aria-label":"Standard Server",children:"Standard Server"}),(0,n.jsx)(g.Z,{value:"modpack","aria-label":"Modpack",children:"Modpack"})]}),(0,n.jsx)(B.Z,{in:"standard"===v,unmountOnExit:!0,children:(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[(0,n.jsx)(f.Z,{label:"Server Type",select:!0,value:S.type,onChange:O("type"),fullWidth:!0,disabled:I,children:Y.map(e=>(0,n.jsx)(D.Z,{value:e,children:e},e))}),(0,n.jsx)(f.Z,{label:"Minecraft Version",value:S.version,onChange:O("version"),helperText:"e.g., 1.21.1, 1.20.4, latest",fullWidth:!0,disabled:I})]})}),(0,n.jsx)(B.Z,{in:"modpack"===v,unmountOnExit:!0,children:(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[(0,n.jsx)(l.Z,{severity:"info",children:"Minecraft version is automatically determined by the modpack"}),(0,n.jsx)(f.Z,{label:"Modpack Slug",value:S.modpack||"",onChange:O("modpack"),error:!!Z.modpack,helperText:Z.modpack||"e.g., cobblemon, adrenaserver (from modrinth.com/modpacks/SLUG)",fullWidth:!0,disabled:I,inputRef:T}),(0,n.jsxs)(f.Z,{label:"Mod Loader",select:!0,value:S.modLoader||"",onChange:O("modLoader"),helperText:"Leave empty to auto-detect from modpack",fullWidth:!0,disabled:I,children:[(0,n.jsx)(D.Z,{value:"",children:"Auto-detect"}),K.filter(e=>e).map(e=>(0,n.jsx)(D.Z,{value:e,children:e},e))]}),(0,n.jsx)(f.Z,{label:"Modpack Version",value:S.modpackVersion||"",onChange:O("modpackVersion"),helperText:"Leave empty for latest",fullWidth:!0,disabled:I})]})})]}),(0,n.jsx)(f.Z,{label:"Memory",value:S.memory,onChange:O("memory"),helperText:"e.g., 4G, 8G, 16G",fullWidth:!0,disabled:I}),(0,n.jsx)(f.Z,{label:"Sudo Password",type:"password",value:S.sudoPassword||"",onChange:O("sudoPassword"),helperText:"Required for mDNS hostname registration (avahi)",fullWidth:!0,disabled:I}),(0,n.jsx)(_.Z,{control:(0,n.jsx)(G.Z,{checked:S.autoStart||!1,onChange:(t="autoStart",e=>{b(r=>({...r,[t]:e.target.checked}))}),disabled:I}),label:"Auto-start after creation"})]})}),(0,n.jsx)(z.Z,{sx:{px:3,pb:2},children:"completed"===x||"error"===x?(0,n.jsx)(a.Z,{onClick:o,variant:"contained",fullWidth:!0,children:"Close"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.Z,{onClick:o,disabled:I,children:"Cancel"}),(0,n.jsx)(a.Z,{type:"submit",variant:"contained",disabled:I,startIcon:I?(0,n.jsx)(c.Z,{size:16}):null,children:I?"Creating...":"Create"})]})})]})})}var et=r(92666),er=r(59104);function en(){var e,t;let r=(0,o.x)(),[p,f]=(0,s.useState)(!1),[v,g]=(0,s.useState)([]),{data:j,isLoading:y,error:S}=(0,et.x$)(),{statusMap:b}=(0,er.d)(),Z=(0,et.jM)(),C=(0,et.Aw)(),k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onSuccess:t,onError:r,onProgress:n}=e,[o,i]=(0,s.useState)("idle"),[a,l]=(0,s.useState)(0),[c,d]=(0,s.useState)(""),[u,h]=(0,s.useState)(null),x=(0,s.useRef)(null),m=(0,s.useRef)(""),p=(0,s.useCallback)(()=>{i("idle"),l(0),d(""),h(null),x.current&&(x.current.close(),x.current=null)},[]),f=(0,s.useCallback)((e,t,r)=>{i(e),d(t),l(r),null==n||n(e,t,r)},[n]),v=(0,s.useCallback)(async e=>{if("idle"===o||"completed"===o||"error"===o){h(null),f("initializing","Initializing server creation...",0),m.current=e.name,x.current&&x.current.close();try{let r=await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let e=await r.text();throw Error(e||"Server creation failed: ".concat(r.statusText))}await r.json(),f("creating","Creating server configuration...",25),await new Promise(e=>setTimeout(e,500)),f("configuring","Configuring Docker compose...",50),await new Promise(e=>setTimeout(e,500)),f("starting","Starting server container...",75),await new Promise(e=>setTimeout(e,500)),f("completed","Server created successfully!",100),null==t||t(e.name)}catch(t){let e=t instanceof Error?t.message:"Unknown error occurred";i("error"),h(e),d("Server creation failed"),null==r||r(e)}}},[o,f,t,r]);return(0,s.useEffect)(()=>()=>{x.current&&(x.current.close(),x.current=null)},[]),{status:o,progress:a,message:c,error:u,isCreating:"idle"!==o&&"completed"!==o&&"error"!==o,createServer:v,reset:p}}({onSuccess:()=>{f(!1)},onError:e=>{console.error("Failed to create server:",e)}}),w=async e=>{g(t=>[...t,e]);try{await Z.mutateAsync(e)}catch(e){console.error("Failed to start server:",e)}finally{g(t=>t.filter(t=>t!==e))}},T=async e=>{g(t=>[...t,e]);try{await C.mutateAsync(e)}catch(e){console.error("Failed to stop server:",e)}finally{g(t=>t.filter(t=>t!==e))}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(d.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,h.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,h.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,h.Fq)(e.palette.info.main,.2)),display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,n.jsx)(m.Z,{sx:{fontSize:32}})}),(0,n.jsxs)(i.Z,{children:[(0,n.jsx)(u.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Servers"}),(0,n.jsx)(u.Z,{variant:"body1",color:"text.secondary",children:"Manage your Minecraft servers"})]})]}),(0,n.jsx)(a.Z,{variant:"contained",startIcon:(0,n.jsx)(x.Z,{}),onClick:()=>f(!0),size:"large",children:"Create Server"})]}),S&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to load servers: ",S.message]}),k.error&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to create server: ",k.error]}),Z.isError&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=Z.error)||void 0===e?void 0:e.message]}),C.isError&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(t=C.error)||void 0===t?void 0:t.message]}),y?(0,n.jsx)(i.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,n.jsx)(c.Z,{})}):(0,n.jsx)(L,{servers:(null==j?void 0:j.servers)||[],statusMap:b,onServerClick:e=>{r.push("/servers/".concat(encodeURIComponent(e)))},onStart:w,onStop:T,onCreate:()=>f(!0),loadingServers:v}),(0,n.jsx)(ee,{open:p,onClose:()=>{f(!1),k.reset()},onSubmit:e=>{k.createServer(e)},loading:k.isCreating,status:k.status,progress:k.progress,message:k.message})]})}},3454:function(e,t,r){"use strict";r.d(t,{LoadingProvider:function(){return l},startLoading:function(){return c},stopLoading:function(){return d}});var n=r(94655),s=r(35106),o=r(74228),i=r(31477),a=r.n(i);function l(e){let{children:t}=e,r=(0,o.usePathname)(),i=(0,o.useSearchParams)();return(0,s.useEffect)(()=>{a().done()},[r,i]),(0,n.jsx)(n.Fragment,{children:t})}function c(){a().start()}function d(){a().done()}a().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,t,r){"use strict";r.d(t,{Av:function(){return n.startLoading}});var n=r(3454)},31358:function(e,t,r){"use strict";r.d(t,{x:function(){return i}});var n=r(74228),s=r(35106),o=r(8690);function i(){let e=(0,n.useRouter)(),t=(0,s.useCallback)((t,r)=>{(0,o.Av)(),e.push(t,r)},[e]),r=(0,s.useCallback)((t,r)=>{(0,o.Av)(),e.replace(t,r)},[e]);return(0,s.useMemo)(()=>({...e,push:t,replace:r}),[e,t,r])}},93757:function(e,t,r){"use strict";r.d(t,{D:function(){return o}});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 o(e){let{url:t,onMessage:r,onError:o,reconnectInterval:i=3e3,maxReconnectAttempts:a=1/0,enabled:l=!0,withCredentials:c=!1}=e,[d,u]=(0,n.useState)(null),[h,x]=(0,n.useState)("disconnected"),[m,p]=(0,n.useState)(null),[f,v]=(0,n.useState)(0),g=(0,n.useRef)(null),j=(0,n.useCallback)(e=>{u(e),null==r||r(e)},[r]),y=(0,n.useCallback)(e=>{x(e),"connected"===e&&v(0)},[]),S=(0,n.useCallback)(e=>{p(e),"number"==typeof e.retryCount&&v(e.retryCount),null==o||o(e)},[o]),b=(0,n.useCallback)(()=>{g.current&&(g.current.reconnect(),v(g.current.getRetryCount()))},[]),Z=(0,n.useCallback)(()=>{g.current&&g.current.disconnect()},[]);return(0,n.useEffect)(()=>{if(!l){g.current&&(g.current.disconnect(),g.current=null);return}return g.current||(g.current=new s),g.current.connect({url:t,onMessage:j,onStateChange:y,onError:S,reconnectInterval:i,maxReconnectAttempts:a,withCredentials:c}),()=>{g.current&&(g.current.disconnect(),g.current=null)}},[t,l,i,a,c,j,y,S]),{data:d,isConnected:"connected"===h,state:h,error:m,retryCount:f,reconnect:b,disconnect:Z}}},59104:function(e,t,r){"use strict";r.d(t,{d:function(){return o}});var n=r(35106),s=r(93757);function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onStatusChange:t,enabled:r=!0,reconnectInterval:o=3e3}=e,[i,a]=(0,n.useState)({}),l=(0,n.useCallback)(e=>{if("server-status"===e.type){let{serverName:r,status:n,health:s,timestamp:o}=e.data;a(e=>({...e,[r]:{status:n,health:s,timestamp:o}})),null==t||t(r,n,s)}},[t]),{isConnected:c,reconnect:d,retryCount:u}=(0,s.D)({url:"/api/sse/servers-status",onMessage:l,enabled:r,reconnectInterval:o}),h=(0,n.useCallback)(e=>i[e]||null,[i]);return(0,n.useEffect)(()=>{r||a({})},[r]),{statusMap:i,getServerStatus:h,isConnected:c,reconnect:d,retryCount:u}}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,5511,880,1658,6909,6727,190,5386,2666,3669,2757,1744],function(){return e(e.s=49726)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4978],{70861:function(e,s,n){Promise.resolve().then(n.bind(n,32539))},87739:function(e,s,n){"use strict";var t=n(8091);s.Z=void 0;var r=t(n(66758)),c=n(94655);s.Z=(0,r.default)((0,c.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings")},32539:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return h}});var t=n(94655),r=n(35106),c=n(7281),o=n(84840),i=n(31317),l=n(37530),a=n(81071),u=n(87739),d=n(57965);function h(){let[e,s]=(0,r.useState)({open:!1,message:"",severity:"success"}),n=e=>{s({open:!0,message:e,severity:"success"})},h=e=>{s({open:!0,message:e,severity:"error"})},x=()=>{s(e=>({...e,open:!1}))};return(0,t.jsxs)(c.Z,{children:[(0,t.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:4},children:[(0,t.jsx)(u.Z,{sx:{fontSize:32},color:"primary"}),(0,t.jsx)(i.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Settings"})]}),(0,t.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(o.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(d.zd,{onSuccess:n,onError:h})}),(0,t.jsx)(o.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(d.eE,{})}),(0,t.jsx)(o.ZP,{item:!0,xs:12,children:(0,t.jsx)(d.ms,{onSuccess:n,onError:h})})]}),(0,t.jsx)(l.Z,{open:e.open,autoHideDuration:6e3,onClose:x,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(a.Z,{onClose:x,severity:e.severity,variant:"filled",sx:{width:"100%"},children:e.message})})]})}},42936:function(e,s,n){"use strict";async function t(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={...s.headers};s.body&&(n["Content-Type"]="application/json");let t=await fetch(e,{...s,headers:n});if(!t.ok){let e=await t.json().catch(()=>({error:"UnknownError",message:t.statusText})),s=Error(e.message);throw s.statusCode=t.status,s.code=e.error,s}return t.json()}n.d(s,{SC:function(){return t}})}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,5511,2542,2844,9951,5381,4596,7965,3669,2757,1744],function(){return e(e.s=70861)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7701],{6199:function(e,s,n){Promise.resolve().then(n.bind(n,36405))},33104:function(e,s,n){"use strict";var l=n(8091);s.Z=void 0;var r=l(n(66758)),t=n(94655);s.Z=(0,r.default)([(0,t.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,t.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime")},21111:function(e,s,n){"use strict";var l=n(8091);s.Z=void 0;var r=l(n(66758)),t=n(94655);s.Z=(0,r.default)((0,t.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete")},97812:function(e,s,n){"use strict";var l=n(8091);s.Z=void 0;var r=l(n(66758)),t=n(94655);s.Z=(0,r.default)((0,t.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff")},84974:function(e,s,n){"use strict";var l=n(8091);s.Z=void 0;var r=l(n(66758)),t=n(94655);s.Z=(0,r.default)((0,t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public")},36405:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return _}});var l=n(94655),r=n(35106),t=n(7281),i=n(30417),a=n(81071),o=n(93017),d=n(69899),c=n(31317),x=n(99770),h=n(62508),u=n(5682),m=n(76678),j=n(97436),Z=n(76492),v=n(32366),f=n(84974),p=n(84840),g=n(52082),y=n(89923),b=n(10297),w=n(42431),C=n(628),S=n(41565),k=n(25935),W=n(79983),z=n(25333),L=n(95511),D=n(96292),I=n(97812),A=n(21111),F=n(78067),M=n(33104);function P(e){let{world:s,onAssign:n,onRelease:r,onDelete:i,loading:a=!1}=e,o=(e,n)=>{e.stopPropagation(),n(s.name)};return(0,l.jsxs)(C.Z,{role:"article",sx:{transition:"all 0.2s",height:200,display:"flex",flexDirection:"column","&:hover":{transform:"translateY(-2px)",boxShadow:4}},children:[(0,l.jsxs)(S.Z,{sx:{flex:1,pb:1},children:[(0,l.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,l.jsx)(c.Z,{variant:"h6",component:"h3",sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,mr:1},children:s.name}),(0,l.jsx)(z.Z,{label:s.isLocked?"Locked":"Available",size:"small",color:s.isLocked?"warning":"success",sx:{fontWeight:500,minWidth:80}})]}),(0,l.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,l.jsx)(F.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,l.jsx)(c.Z,{variant:"body2",color:"text.secondary",children:s.size||"Unknown size"})]}),s.isLocked&&s.lockedBy&&(0,l.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,l.jsx)(D.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,l.jsx)(L.Z,{title:"Assigned to ".concat(s.lockedBy),arrow:!0,children:(0,l.jsx)(c.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.lockedBy})})]}),(0,l.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,l.jsx)(M.Z,{sx:{fontSize:16,color:"text.secondary"}}),(0,l.jsx)(c.Z,{variant:"body2",color:"text.secondary",children:(e=>{if(!e)return"-";try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch(s){return e}})(s.lastModified)})]})]}),(0,l.jsxs)(k.Z,{sx:{justifyContent:"flex-end",px:2,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:[!s.isLocked&&n&&(0,l.jsx)(L.Z,{title:"Assign to server",arrow:!0,children:(0,l.jsx)(W.Z,{"aria-label":"Assign world",color:"primary",onClick:e=>o(e,n),disabled:a,size:"small",children:(0,l.jsx)(D.Z,{})})}),s.isLocked&&r&&(0,l.jsx)(L.Z,{title:"Release from server",arrow:!0,children:(0,l.jsx)(W.Z,{"aria-label":"Release world",color:"warning",onClick:e=>o(e,r),disabled:a,size:"small",children:(0,l.jsx)(I.Z,{})})}),i&&(0,l.jsx)(L.Z,{title:"Delete world",arrow:!0,children:(0,l.jsx)(W.Z,{"aria-label":"Delete world",color:"error",onClick:e=>o(e,i),disabled:a,size:"small",children:(0,l.jsx)(A.Z,{})})})]})]})}function E(e){let{worlds:s,onAssign:n,onRelease:a,onDelete:o,onCreate:d,loadingWorlds:x=[]}=e,[h,u]=(0,r.useState)(""),[m,Z]=(0,r.useState)("all"),f=(0,r.useMemo)(()=>s.filter(e=>(!h||!!e.name.toLowerCase().includes(h.toLowerCase()))&&("available"!==m||!e.isLocked)&&("locked"!==m||!!e.isLocked)),[s,h,m]);return 0===s.length?(0,l.jsxs)(t.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",gap:2},children:[(0,l.jsx)(c.Z,{variant:"h6",color:"text.secondary",children:"No worlds found"}),d&&(0,l.jsx)(i.Z,{variant:"contained",startIcon:(0,l.jsx)(v.Z,{}),onClick:d,children:"Create World"})]}):(0,l.jsxs)(t.Z,{children:[(0,l.jsxs)(t.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2,mb:3,alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between"},children:[(0,l.jsxs)(b.Z,{value:m,exclusive:!0,onChange:(e,s)=>{null!==s&&Z(s)},size:"small",sx:{flexShrink:0},children:[(0,l.jsx)(y.Z,{value:"all",children:"All"}),(0,l.jsx)(y.Z,{value:"available",children:"Available"}),(0,l.jsx)(y.Z,{value:"locked",children:"Locked"})]}),(0,l.jsx)(j.Z,{size:"small",placeholder:"Search worlds...",value:h,onChange:e=>u(e.target.value),InputProps:{startAdornment:(0,l.jsx)(g.Z,{position:"start",children:(0,l.jsx)(w.Z,{})})},sx:{flexGrow:{xs:1,sm:0},minWidth:{sm:300}}})]}),(0,l.jsxs)(c.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:[f.length," ",1===f.length?"world":"worlds"]}),0===f.length?(0,l.jsx)(t.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",gap:2},children:(0,l.jsx)(c.Z,{variant:"h6",color:"text.secondary",children:"No worlds found"})}):(0,l.jsx)(p.ZP,{container:!0,spacing:2,children:f.map(e=>(0,l.jsx)(p.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,l.jsx)(P,{world:e,onAssign:n,onRelease:a,onDelete:o,loading:x.includes(e.name)})},e.name))})]})}let H={name:"",seed:""};function N(e){let{open:s,onClose:n,onSubmit:a,loading:d=!1}=e,[c,Z]=(0,r.useState)(H),[v,f]=(0,r.useState)({});(0,r.useEffect)(()=>{s||(Z(H),f({}))},[s]);let p=e=>e?/^[a-z0-9-]+$/.test(e)?null:"Only lowercase letters, numbers, and hyphens are allowed":"World name is required",g=e=>s=>{let n=s.target.value;Z(s=>({...s,[e]:n})),v[e]&&f(s=>({...s,[e]:""}))};return(0,l.jsx)(x.Z,{open:s,onClose:d?void 0:n,maxWidth:"sm",fullWidth:!0,children:(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),f({});let s=p(c.name);if(s){f({name:s});return}a({name:c.name,...c.seed?{seed:c.seed}:{}})},children:[(0,l.jsx)(h.Z,{children:"Create New World"}),(0,l.jsx)(u.Z,{children:(0,l.jsxs)(t.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[(0,l.jsx)(j.Z,{label:"World Name",value:c.name,onChange:g("name"),error:!!v.name,helperText:v.name||"Only lowercase letters, numbers, and hyphens",fullWidth:!0,autoFocus:!0,disabled:d}),(0,l.jsx)(j.Z,{label:"Seed (optional)",value:c.seed||"",onChange:g("seed"),helperText:"Leave empty for a random seed",fullWidth:!0,disabled:d})]})}),(0,l.jsxs)(m.Z,{sx:{px:3,pb:2},children:[(0,l.jsx)(i.Z,{onClick:n,disabled:d,children:"Cancel"}),(0,l.jsx)(i.Z,{type:"submit",variant:"contained",disabled:d,startIcon:d?(0,l.jsx)(o.Z,{size:16}):null,children:d?"Creating...":"Create"})]})]})})}var T=n(7178),O=n(92666);function R(e){let{open:s,worldName:n,onClose:d,onSubmit:Z,loading:v=!1}=e,[f,p]=(0,r.useState)(""),{data:g,isLoading:y}=(0,O.x$)();(0,r.useEffect)(()=>{s||p("")},[s]);let b=(null==g?void 0:g.servers)||[],w=b.filter(e=>"running"!==e.status),C=b.filter(e=>"running"===e.status);return(0,l.jsx)(x.Z,{open:s,onClose:v?void 0:d,maxWidth:"sm",fullWidth:!0,children:(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),f&&Z(n,f)},children:[(0,l.jsxs)(h.Z,{children:["Assign World: ",n]}),(0,l.jsx)(u.Z,{children:(0,l.jsx)(t.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:y?(0,l.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,l.jsx)(o.Z,{})}):0===b.length?(0,l.jsx)(c.Z,{color:"text.secondary",children:"No servers available. Create a server first."}):(0,l.jsxs)(l.Fragment,{children:[0===w.length&&C.length>0&&(0,l.jsx)(a.Z,{severity:"warning",children:"All servers are currently running. It is recommended to assign worlds to stopped servers."}),(0,l.jsxs)(j.Z,{label:"Select Server",select:!0,value:f,onChange:e=>p(e.target.value),fullWidth:!0,disabled:v,helperText:"Select a server to assign this world to",children:[w.length>0&&(0,l.jsx)(T.Z,{disabled:!0,children:(0,l.jsx)(c.Z,{variant:"caption",color:"text.secondary",children:"Available Servers"})}),w.map(e=>(0,l.jsx)(T.Z,{value:e.name,children:e.name},e.name)),C.length>0&&(0,l.jsx)(T.Z,{disabled:!0,children:(0,l.jsx)(c.Z,{variant:"caption",color:"text.secondary",children:"Running Servers (not recommended)"})}),C.map(e=>(0,l.jsx)(T.Z,{value:e.name,children:e.name},e.name))]})]})})}),(0,l.jsxs)(m.Z,{sx:{px:3,pb:2},children:[(0,l.jsx)(i.Z,{onClick:d,disabled:v,children:"Cancel"}),(0,l.jsx)(i.Z,{type:"submit",variant:"contained",disabled:v||!f||y,startIcon:v?(0,l.jsx)(o.Z,{size:16}):null,children:v?"Assigning...":"Assign"})]})]})})}function _(){var e,s,n,p;let[g,y]=(0,r.useState)(!1),[b,w]=(0,r.useState)(null),[C,S]=(0,r.useState)(null),[k,W]=(0,r.useState)(""),[z,L]=(0,r.useState)([]),{data:D,isLoading:I,error:A}=(0,O.Sr)(),F=(0,O.hy)(),M=(0,O.nq)(),P=(0,O.g2)(),H=(0,O.Fv)(),T=async e=>{L(s=>[...s,e]);try{await P.mutateAsync({worldName:e})}catch(e){console.error("Failed to release world:",e)}finally{L(s=>s.filter(s=>s!==e))}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(d.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,Z.Fq)(e.palette.success.main,.1)," 0%, ").concat((0,Z.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,Z.Fq)(e.palette.success.main,.2)),display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,l.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,l.jsx)(t.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"success.main",color:"success.contrastText"},children:(0,l.jsx)(f.Z,{sx:{fontSize:32}})}),(0,l.jsxs)(t.Z,{children:[(0,l.jsx)(c.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Worlds"}),(0,l.jsx)(c.Z,{variant:"body1",color:"text.secondary",children:"Manage your Minecraft worlds"})]})]}),(0,l.jsx)(i.Z,{variant:"contained",startIcon:(0,l.jsx)(v.Z,{}),onClick:()=>y(!0),size:"large",children:"Create World"})]}),A&&(0,l.jsxs)(a.Z,{severity:"error",sx:{mb:3},children:["Failed to load worlds: ",A.message]}),F.isError&&(0,l.jsxs)(a.Z,{severity:"error",sx:{mb:3},children:["Failed to create world: ",null===(e=F.error)||void 0===e?void 0:e.message]}),M.isError&&(0,l.jsxs)(a.Z,{severity:"error",sx:{mb:3},children:["Failed to assign world: ",null===(s=M.error)||void 0===s?void 0:s.message]}),P.isError&&(0,l.jsxs)(a.Z,{severity:"error",sx:{mb:3},children:["Failed to release world: ",null===(n=P.error)||void 0===n?void 0:n.message]}),H.isError&&(0,l.jsxs)(a.Z,{severity:"error",sx:{mb:3},children:["Failed to delete world: ",null===(p=H.error)||void 0===p?void 0:p.message]}),I?(0,l.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,l.jsx)(o.Z,{})}):(0,l.jsx)(E,{worlds:(null==D?void 0:D.worlds)||[],onAssign:e=>w(e),onRelease:T,onDelete:e=>{S(e),W("")},onCreate:()=>y(!0),loadingWorlds:z}),(0,l.jsx)(N,{open:g,onClose:()=>{y(!1),F.reset()},onSubmit:e=>{F.mutate(e,{onSuccess:()=>{y(!1)}})},loading:F.isPending}),(0,l.jsx)(R,{open:!!b,worldName:b||"",onClose:()=>w(null),onSubmit:(e,s)=>{L(s=>[...s,e]),M.mutate({worldName:e,serverName:s},{onSuccess:()=>{w(null)},onSettled:()=>{L(s=>s.filter(s=>s!==e))}})},loading:M.isPending}),(0,l.jsxs)(x.Z,{open:!!C,onClose:()=>{S(null),W("")},maxWidth:"sm",fullWidth:!0,children:[(0,l.jsx)(h.Z,{children:"Delete World"}),(0,l.jsxs)(u.Z,{children:[(0,l.jsxs)(c.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,l.jsx)("strong",{children:C})," to confirm deletion."]}),(0,l.jsx)(j.Z,{label:"World name",value:k,onChange:e=>W(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,l.jsxs)(m.Z,{sx:{px:3,pb:2},children:[(0,l.jsx)(i.Z,{onClick:()=>{S(null),W("")},children:"Cancel"}),(0,l.jsx)(i.Z,{variant:"contained",color:"error",onClick:()=>{C&&k===C&&(L(e=>[...e,C]),H.mutate({name:C,force:!0},{onSuccess:()=>{S(null),W("")},onSettled:()=>{L(e=>e.filter(e=>e!==C))}}))},disabled:k!==C||H.isPending,startIcon:H.isPending?(0,l.jsx)(o.Z,{size:16}):null,children:H.isPending?"Deleting...":"Delete"})]})]})]})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,5511,880,6909,190,2666,3669,2757,1744],function(){return e(e.s=6199)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2626],{40527:function(e,r,t){Promise.resolve().then(t.bind(t,10672))},628:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(69899),c=t(11379),x=t(9049);function h(e){return(0,x.ZP)("MuiCard",e)}(0,c.Z)("MuiCard",["root"]);var m=t(94655);let p=["className","raised"],f=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},h,r)},Z=(0,o.ZP)(u.Z,{name:"MuiCard",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({overflow:"hidden"}));var g=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCard"}),{className:i,raised:l=!1}=t,o=(0,s.Z)(t,p),u=(0,n.Z)({},t,{raised:l}),c=f(u);return(0,m.jsx)(Z,(0,n.Z)({className:(0,a.Z)(c.root,i),elevation:l?8:void 0,ref:r,ownerState:u},o))})},41565:function(e,r,t){"use strict";t.d(r,{Z:function(){return Z}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(11379),c=t(9049);function x(e){return(0,c.ZP)("MuiCardContent",e)}(0,u.Z)("MuiCardContent",["root"]);var h=t(94655);let m=["className","component"],p=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},x,r)},f=(0,o.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}}));var Z=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCardContent"}),{className:i,component:l="div"}=t,o=(0,s.Z)(t,m),u=(0,n.Z)({},t,{component:l}),c=p(u);return(0,h.jsx)(f,(0,n.Z)({as:l,className:(0,a.Z)(c.root,i),ownerState:u,ref:r},o))})},10672:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return h}});var n=t(94655),s=t(74228),i=t(67337),a=t(7281),l=t(628),o=t(41565),d=t(31317),u=t(41261),c=t(85480),x=t(46725);function h(){let e=(0,s.useRouter)();return(0,n.jsx)(i.Z,{maxWidth:"sm",children:(0,n.jsx)(a.Z,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",py:4},children:(0,n.jsx)(l.Z,{sx:{width:"100%",maxWidth:500},children:(0,n.jsxs)(o.Z,{sx:{p:4},children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",gutterBottom:!0,sx:{fontWeight:600,textAlign:"center",mb:3},children:"Welcome Back"}),(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",mb:4},children:"Sign in to manage your Minecraft servers"}),(0,n.jsx)(c.U0,{onSuccess:()=>{e.push("/dashboard")}}),(0,n.jsx)(a.Z,{sx:{mt:3,textAlign:"center"},children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:["Don't have an account?"," ",(0,n.jsx)(u.Z,{component:x.default,href:"/signup",underline:"hover",children:"Sign up"})]})})]})})})})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return m},WS:function(){return p},Ie:function(){return q}});var n=t(94655),s=t(35106),i=t(7281),a=t(81071),l=t(97436),o=t(52082),d=t(79983),u=t(30417),c=t(36848),x=t(554),h=t(6986);function m(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(!1),[j,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(null),[C,w]=(0,s.useState)(!1),S=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),v(e),0===Object.keys(e).length},P=async e=>{if(e.preventDefault(),b(null),S()){w(!0);try{let e=await h.cg.email({email:t,password:p});if(e.error){b(e.error.message||"Invalid credentials"),w(!1);return}r&&r()}catch(e){b("An unexpected error occurred. Please try again."),w(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:P,sx:{display:"flex",flexDirection:"column",gap:2},children:[y&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>b(null),children:y}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>m(e.target.value),error:!!j.email,helperText:j.email,disabled:C,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:Z?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:C,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{g(!Z)},edge:"end",children:Z?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:C,fullWidth:!0,size:"large",children:C?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(""),[j,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!1),[S,P]=(0,s.useState)({}),[k,W]=(0,s.useState)(null),[q,I]=(0,s.useState)(!1),R=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",Z?Z.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?Z!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",P(e),0===Object.keys(e).length},U=async e=>{if(e.preventDefault(),W(null),R()){I(!0);try{let e=await h.y1.email({email:p,password:Z,name:t});if(e.error){W(e.error.message||"Registration failed"),I(!1);return}r&&r()}catch(e){W("An unexpected error occurred. Please try again."),I(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:U,sx:{display:"flex",flexDirection:"column",gap:2},children:[k&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>W(null),children:k}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>m(e.target.value),error:!!S.name,helperText:S.name,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!S.email,helperText:S.email,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:y?"text":"password",value:Z,onChange:e=>g(e.target.value),error:!!S.password,helperText:S.password,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!y)},edge:"end",children:y?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:C?"text":"password",value:j,onChange:e=>v(e.target.value),error:!!S.confirmPassword,helperText:S.confirmPassword,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{w(!C)},edge:"end",children:C?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:q,fullWidth:!0,size:"large",children:q?"Creating account...":"Sign Up"})]})}var f=t(74228),Z=t(93017),g=t(86702),j=t(35694),v=t(31317),y=t(25333),b=t(69123),C=t(7178),w=t(17820),S=t(73424),P=t(25169),k=t(41094),W=t(78319);function q(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,h.kP)(),[a,l]=(0,s.useState)(null),o=()=>{l(null)},c=async()=>{o(),await (0,h.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(Z.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(u.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,m=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(x.name,x.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(g.Z,{sx:{bgcolor:"primary.main"},children:m})}),(0,n.jsxs)(j.Z,{anchorEl:a,open:!!a,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(i.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(v.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(y.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(b.Z,{}),"admin"===x.role&&(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Users"})]}),(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(k.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Settings"})]}),(0,n.jsxs)(C.Z,{onClick:c,children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(W.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Logout"})]})]})]})}},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return x},Nq:function(){return c},cg:function(){return l},kP:function(){return u},w7:function(){return o},y1:function(){return d},zB:function(){return h}});var n=t(77054),s=t(61648),i=t(35016);let a=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:d,useSession:u,updateUser:c,changePassword:x}=a,h=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,2542,55,6857,1544,563,3669,2757,1744],function(){return e(e.s=40527)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2626],{40527:function(e,r,t){Promise.resolve().then(t.bind(t,10672))},628:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(69899),c=t(11379),x=t(9049);function h(e){return(0,x.ZP)("MuiCard",e)}(0,c.Z)("MuiCard",["root"]);var m=t(94655);let p=["className","raised"],f=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},h,r)},Z=(0,o.ZP)(u.Z,{name:"MuiCard",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({overflow:"hidden"}));var g=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCard"}),{className:i,raised:l=!1}=t,o=(0,s.Z)(t,p),u=(0,n.Z)({},t,{raised:l}),c=f(u);return(0,m.jsx)(Z,(0,n.Z)({className:(0,a.Z)(c.root,i),elevation:l?8:void 0,ref:r,ownerState:u},o))})},41565:function(e,r,t){"use strict";t.d(r,{Z:function(){return Z}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(11379),c=t(9049);function x(e){return(0,c.ZP)("MuiCardContent",e)}(0,u.Z)("MuiCardContent",["root"]);var h=t(94655);let m=["className","component"],p=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},x,r)},f=(0,o.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}}));var Z=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCardContent"}),{className:i,component:l="div"}=t,o=(0,s.Z)(t,m),u=(0,n.Z)({},t,{component:l}),c=p(u);return(0,h.jsx)(f,(0,n.Z)({as:l,className:(0,a.Z)(c.root,i),ownerState:u,ref:r},o))})},10672:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return h}});var n=t(94655),s=t(74228),i=t(67337),a=t(7281),l=t(628),o=t(41565),d=t(31317),u=t(41261),c=t(85480),x=t(46725);function h(){let e=(0,s.useRouter)();return(0,n.jsx)(i.Z,{maxWidth:"sm",children:(0,n.jsx)(a.Z,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",py:4},children:(0,n.jsx)(l.Z,{sx:{width:"100%",maxWidth:500},children:(0,n.jsxs)(o.Z,{sx:{p:4},children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",gutterBottom:!0,sx:{fontWeight:600,textAlign:"center",mb:3},children:"Welcome Back"}),(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",mb:4},children:"Sign in to manage your Minecraft servers"}),(0,n.jsx)(c.U0,{onSuccess:()=>{e.push("/dashboard")}}),(0,n.jsx)(a.Z,{sx:{mt:3,textAlign:"center"},children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:["Don't have an account?"," ",(0,n.jsx)(u.Z,{component:x.default,href:"/signup",underline:"hover",children:"Sign up"})]})})]})})})})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return m},WS:function(){return p},Ie:function(){return q}});var n=t(94655),s=t(35106),i=t(7281),a=t(81071),l=t(97436),o=t(52082),d=t(79983),u=t(30417),c=t(36848),x=t(554),h=t(6986);function m(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(!1),[j,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(null),[C,w]=(0,s.useState)(!1),S=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),v(e),0===Object.keys(e).length},P=async e=>{if(e.preventDefault(),b(null),S()){w(!0);try{let e=await h.cg.email({email:t,password:p});if(e.error){b(e.error.message||"Invalid credentials"),w(!1);return}r&&r()}catch(e){b("An unexpected error occurred. Please try again."),w(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:P,sx:{display:"flex",flexDirection:"column",gap:2},children:[y&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>b(null),children:y}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>m(e.target.value),error:!!j.email,helperText:j.email,disabled:C,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:Z?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:C,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{g(!Z)},edge:"end",children:Z?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:C,fullWidth:!0,size:"large",children:C?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(""),[j,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!1),[S,P]=(0,s.useState)({}),[k,W]=(0,s.useState)(null),[q,I]=(0,s.useState)(!1),R=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",Z?Z.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?Z!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",P(e),0===Object.keys(e).length},U=async e=>{if(e.preventDefault(),W(null),R()){I(!0);try{let e=await h.y1.email({email:p,password:Z,name:t});if(e.error){W(e.error.message||"Registration failed"),I(!1);return}r&&r()}catch(e){W("An unexpected error occurred. Please try again."),I(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:U,sx:{display:"flex",flexDirection:"column",gap:2},children:[k&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>W(null),children:k}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>m(e.target.value),error:!!S.name,helperText:S.name,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!S.email,helperText:S.email,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:y?"text":"password",value:Z,onChange:e=>g(e.target.value),error:!!S.password,helperText:S.password,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!y)},edge:"end",children:y?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:C?"text":"password",value:j,onChange:e=>v(e.target.value),error:!!S.confirmPassword,helperText:S.confirmPassword,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{w(!C)},edge:"end",children:C?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:q,fullWidth:!0,size:"large",children:q?"Creating account...":"Sign Up"})]})}var f=t(74228),Z=t(93017),g=t(86702),j=t(35694),v=t(31317),y=t(25333),b=t(69123),C=t(7178),w=t(17820),S=t(73424),P=t(25169),k=t(41094),W=t(78319);function q(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,h.kP)(),[a,l]=(0,s.useState)(null),o=()=>{l(null)},c=async()=>{o(),await (0,h.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(Z.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(u.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,m=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(x.name,x.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(g.Z,{sx:{bgcolor:"primary.main"},children:m})}),(0,n.jsxs)(j.Z,{anchorEl:a,open:!!a,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(i.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(v.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(y.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(b.Z,{}),"admin"===x.role&&(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Users"})]}),(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(k.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Settings"})]}),(0,n.jsxs)(C.Z,{onClick:c,children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(W.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Logout"})]})]})]})}},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return x},Nq:function(){return c},cg:function(){return l},kP:function(){return u},w7:function(){return o},y1:function(){return d},zB:function(){return h}});var n=t(77054),s=t(61648),i=t(35016);let a=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:d,useSession:u,updateUser:c,changePassword:x}=a,h=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,2542,55,7727,9949,3669,2757,1744],function(){return e(e.s=40527)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4966],{24100:function(e,r,t){Promise.resolve().then(t.bind(t,85795))},628:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(69899),c=t(11379),x=t(9049);function h(e){return(0,x.ZP)("MuiCard",e)}(0,c.Z)("MuiCard",["root"]);var m=t(94655);let p=["className","raised"],f=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},h,r)},Z=(0,o.ZP)(u.Z,{name:"MuiCard",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({overflow:"hidden"}));var g=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCard"}),{className:i,raised:l=!1}=t,o=(0,s.Z)(t,p),u=(0,n.Z)({},t,{raised:l}),c=f(u);return(0,m.jsx)(Z,(0,n.Z)({className:(0,a.Z)(c.root,i),elevation:l?8:void 0,ref:r,ownerState:u},o))})},41565:function(e,r,t){"use strict";t.d(r,{Z:function(){return Z}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(11379),c=t(9049);function x(e){return(0,c.ZP)("MuiCardContent",e)}(0,u.Z)("MuiCardContent",["root"]);var h=t(94655);let m=["className","component"],p=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},x,r)},f=(0,o.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}}));var Z=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCardContent"}),{className:i,component:l="div"}=t,o=(0,s.Z)(t,m),u=(0,n.Z)({},t,{component:l}),c=p(u);return(0,h.jsx)(f,(0,n.Z)({as:l,className:(0,a.Z)(c.root,i),ownerState:u,ref:r},o))})},85795:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return h}});var n=t(94655),s=t(74228),i=t(67337),a=t(7281),l=t(628),o=t(41565),d=t(31317),u=t(41261),c=t(85480),x=t(46725);function h(){let e=(0,s.useRouter)();return(0,n.jsx)(i.Z,{maxWidth:"sm",children:(0,n.jsx)(a.Z,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",py:4},children:(0,n.jsx)(l.Z,{sx:{width:"100%",maxWidth:500},children:(0,n.jsxs)(o.Z,{sx:{p:4},children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",gutterBottom:!0,sx:{fontWeight:600,textAlign:"center",mb:3},children:"Create Account"}),(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",mb:4},children:"Sign up to start managing Minecraft servers"}),(0,n.jsx)(c.WS,{onSuccess:()=>{e.push("/dashboard")}}),(0,n.jsx)(a.Z,{sx:{mt:3,textAlign:"center"},children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:["Already have an account?"," ",(0,n.jsx)(u.Z,{component:x.default,href:"/login",underline:"hover",children:"Sign in"})]})})]})})})})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return m},WS:function(){return p},Ie:function(){return q}});var n=t(94655),s=t(35106),i=t(7281),a=t(81071),l=t(97436),o=t(52082),d=t(79983),u=t(30417),c=t(36848),x=t(554),h=t(6986);function m(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(!1),[j,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(null),[C,w]=(0,s.useState)(!1),S=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),v(e),0===Object.keys(e).length},P=async e=>{if(e.preventDefault(),b(null),S()){w(!0);try{let e=await h.cg.email({email:t,password:p});if(e.error){b(e.error.message||"Invalid credentials"),w(!1);return}r&&r()}catch(e){b("An unexpected error occurred. Please try again."),w(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:P,sx:{display:"flex",flexDirection:"column",gap:2},children:[y&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>b(null),children:y}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>m(e.target.value),error:!!j.email,helperText:j.email,disabled:C,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:Z?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:C,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{g(!Z)},edge:"end",children:Z?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:C,fullWidth:!0,size:"large",children:C?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(""),[j,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!1),[S,P]=(0,s.useState)({}),[k,W]=(0,s.useState)(null),[q,A]=(0,s.useState)(!1),I=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",Z?Z.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?Z!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",P(e),0===Object.keys(e).length},R=async e=>{if(e.preventDefault(),W(null),I()){A(!0);try{let e=await h.y1.email({email:p,password:Z,name:t});if(e.error){W(e.error.message||"Registration failed"),A(!1);return}r&&r()}catch(e){W("An unexpected error occurred. Please try again."),A(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:R,sx:{display:"flex",flexDirection:"column",gap:2},children:[k&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>W(null),children:k}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>m(e.target.value),error:!!S.name,helperText:S.name,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!S.email,helperText:S.email,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:y?"text":"password",value:Z,onChange:e=>g(e.target.value),error:!!S.password,helperText:S.password,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!y)},edge:"end",children:y?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:C?"text":"password",value:j,onChange:e=>v(e.target.value),error:!!S.confirmPassword,helperText:S.confirmPassword,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{w(!C)},edge:"end",children:C?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:q,fullWidth:!0,size:"large",children:q?"Creating account...":"Sign Up"})]})}var f=t(74228),Z=t(93017),g=t(86702),j=t(35694),v=t(31317),y=t(25333),b=t(69123),C=t(7178),w=t(17820),S=t(73424),P=t(25169),k=t(41094),W=t(78319);function q(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,h.kP)(),[a,l]=(0,s.useState)(null),o=()=>{l(null)},c=async()=>{o(),await (0,h.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(Z.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(u.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,m=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(x.name,x.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(g.Z,{sx:{bgcolor:"primary.main"},children:m})}),(0,n.jsxs)(j.Z,{anchorEl:a,open:!!a,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(i.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(v.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(y.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(b.Z,{}),"admin"===x.role&&(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Users"})]}),(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(k.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Settings"})]}),(0,n.jsxs)(C.Z,{onClick:c,children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(W.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Logout"})]})]})]})}},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return x},Nq:function(){return c},cg:function(){return l},kP:function(){return u},w7:function(){return o},y1:function(){return d},zB:function(){return h}});var n=t(77054),s=t(61648),i=t(35016);let a=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:d,useSession:u,updateUser:c,changePassword:x}=a,h=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,2542,55,6857,1544,563,3669,2757,1744],function(){return e(e.s=24100)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4966],{24100:function(e,r,t){Promise.resolve().then(t.bind(t,85795))},628:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(69899),c=t(11379),x=t(9049);function h(e){return(0,x.ZP)("MuiCard",e)}(0,c.Z)("MuiCard",["root"]);var m=t(94655);let p=["className","raised"],f=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},h,r)},Z=(0,o.ZP)(u.Z,{name:"MuiCard",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({overflow:"hidden"}));var g=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCard"}),{className:i,raised:l=!1}=t,o=(0,s.Z)(t,p),u=(0,n.Z)({},t,{raised:l}),c=f(u);return(0,m.jsx)(Z,(0,n.Z)({className:(0,a.Z)(c.root,i),elevation:l?8:void 0,ref:r,ownerState:u},o))})},41565:function(e,r,t){"use strict";t.d(r,{Z:function(){return Z}});var n=t(81500),s=t(32324),i=t(35106),a=t(70316),l=t(65951),o=t(34519),d=t(28057),u=t(11379),c=t(9049);function x(e){return(0,c.ZP)("MuiCardContent",e)}(0,u.Z)("MuiCardContent",["root"]);var h=t(94655);let m=["className","component"],p=e=>{let{classes:r}=e;return(0,l.Z)({root:["root"]},x,r)},f=(0,o.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,r)=>r.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}}));var Z=i.forwardRef(function(e,r){let t=(0,d.i)({props:e,name:"MuiCardContent"}),{className:i,component:l="div"}=t,o=(0,s.Z)(t,m),u=(0,n.Z)({},t,{component:l}),c=p(u);return(0,h.jsx)(f,(0,n.Z)({as:l,className:(0,a.Z)(c.root,i),ownerState:u,ref:r},o))})},85795:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return h}});var n=t(94655),s=t(74228),i=t(67337),a=t(7281),l=t(628),o=t(41565),d=t(31317),u=t(41261),c=t(85480),x=t(46725);function h(){let e=(0,s.useRouter)();return(0,n.jsx)(i.Z,{maxWidth:"sm",children:(0,n.jsx)(a.Z,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",py:4},children:(0,n.jsx)(l.Z,{sx:{width:"100%",maxWidth:500},children:(0,n.jsxs)(o.Z,{sx:{p:4},children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",gutterBottom:!0,sx:{fontWeight:600,textAlign:"center",mb:3},children:"Create Account"}),(0,n.jsx)(d.Z,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",mb:4},children:"Sign up to start managing Minecraft servers"}),(0,n.jsx)(c.WS,{onSuccess:()=>{e.push("/dashboard")}}),(0,n.jsx)(a.Z,{sx:{mt:3,textAlign:"center"},children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:["Already have an account?"," ",(0,n.jsx)(u.Z,{component:x.default,href:"/login",underline:"hover",children:"Sign in"})]})})]})})})})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return m},WS:function(){return p},Ie:function(){return q}});var n=t(94655),s=t(35106),i=t(7281),a=t(81071),l=t(97436),o=t(52082),d=t(79983),u=t(30417),c=t(36848),x=t(554),h=t(6986);function m(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(!1),[j,v]=(0,s.useState)({}),[y,b]=(0,s.useState)(null),[C,w]=(0,s.useState)(!1),S=()=>{let e={};return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)||(e.email="Invalid email address"):e.email="Email is required",p||(e.password="Password is required"),v(e),0===Object.keys(e).length},P=async e=>{if(e.preventDefault(),b(null),S()){w(!0);try{let e=await h.cg.email({email:t,password:p});if(e.error){b(e.error.message||"Invalid credentials"),w(!1);return}r&&r()}catch(e){b("An unexpected error occurred. Please try again."),w(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:P,sx:{display:"flex",flexDirection:"column",gap:2},children:[y&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>b(null),children:y}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>m(e.target.value),error:!!j.email,helperText:j.email,disabled:C,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:Z?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:C,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{g(!Z)},edge:"end",children:Z?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:C,fullWidth:!0,size:"large",children:C?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[Z,g]=(0,s.useState)(""),[j,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(!1),[S,P]=(0,s.useState)({}),[k,W]=(0,s.useState)(null),[q,A]=(0,s.useState)(!1),I=()=>{let e={};return t||(e.name="Name is required"),p?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p)||(e.email="Invalid email address"):e.email="Email is required",Z?Z.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?Z!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",P(e),0===Object.keys(e).length},R=async e=>{if(e.preventDefault(),W(null),I()){A(!0);try{let e=await h.y1.email({email:p,password:Z,name:t});if(e.error){W(e.error.message||"Registration failed"),A(!1);return}r&&r()}catch(e){W("An unexpected error occurred. Please try again."),A(!1)}}};return(0,n.jsxs)(i.Z,{component:"form",onSubmit:R,sx:{display:"flex",flexDirection:"column",gap:2},children:[k&&(0,n.jsx)(a.Z,{severity:"error",onClose:()=>W(null),children:k}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>m(e.target.value),error:!!S.name,helperText:S.name,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!S.email,helperText:S.email,disabled:q,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:y?"text":"password",value:Z,onChange:e=>g(e.target.value),error:!!S.password,helperText:S.password,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!y)},edge:"end",children:y?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:C?"text":"password",value:j,onChange:e=>v(e.target.value),error:!!S.confirmPassword,helperText:S.confirmPassword,disabled:q,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(d.Z,{"aria-label":"toggle password visibility",onClick:()=>{w(!C)},edge:"end",children:C?(0,n.jsx)(c.Z,{}):(0,n.jsx)(x.Z,{})})})}}),(0,n.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:q,fullWidth:!0,size:"large",children:q?"Creating account...":"Sign Up"})]})}var f=t(74228),Z=t(93017),g=t(86702),j=t(35694),v=t(31317),y=t(25333),b=t(69123),C=t(7178),w=t(17820),S=t(73424),P=t(25169),k=t(41094),W=t(78319);function q(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,h.kP)(),[a,l]=(0,s.useState)(null),o=()=>{l(null)},c=async()=>{o(),await (0,h.w7)(),e.push("/login")};if(t)return(0,n.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(Z.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(u.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:x}=r,m=((e,r)=>{if(e){let r=e.split(" ");return r.length>=2?"".concat(r[0][0]).concat(r[1][0]).toUpperCase():e.substring(0,2).toUpperCase()}return r?r[0].toUpperCase():"?"})(x.name,x.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(g.Z,{sx:{bgcolor:"primary.main"},children:m})}),(0,n.jsxs)(j.Z,{anchorEl:a,open:!!a,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(i.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(v.Z,{variant:"subtitle1",fontWeight:"600",children:x.name||"User"}),(0,n.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:x.email}),"admin"===x.role&&(0,n.jsx)(y.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(b.Z,{}),"admin"===x.role&&(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/admin/users")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Users"})]}),(0,n.jsxs)(C.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(k.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Settings"})]}),(0,n.jsxs)(C.Z,{onClick:c,children:[(0,n.jsx)(w.Z,{children:(0,n.jsx)(W.Z,{fontSize:"small"})}),(0,n.jsx)(S.Z,{children:"Logout"})]})]})]})}},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return x},Nq:function(){return c},cg:function(){return l},kP:function(){return u},w7:function(){return o},y1:function(){return d},zB:function(){return h}});var n=t(77054),s=t(61648),i=t(35016);let a=(0,n.X)({baseURL:i.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,s.zB)()]}),{signIn:l,signOut:o,signUp:d,useSession:u,updateUser:c,changePassword:x}=a,h=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,2542,55,7727,9949,3669,2757,1744],function(){return e(e.s=24100)}),_N_E=e.O()}]);