@minecraft-docker/mcctl-console 1.15.5 → 2.1.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 (311) 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 +183 -127
  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)/audit-logs/page.js +1 -1
  9. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js.nft.json +1 -1
  10. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js +1 -1
  12. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js.nft.json +1 -1
  13. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js +1 -1
  15. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js.nft.json +1 -1
  16. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js +1 -1
  18. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js.nft.json +1 -1
  19. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js +5 -5
  21. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js.nft.json +1 -1
  22. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page.js +1 -1
  24. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page.js.nft.json +1 -1
  25. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js +1 -1
  27. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js.nft.json +1 -1
  28. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js +1 -1
  30. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js.nft.json +1 -1
  31. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page.js +1 -0
  33. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page.js.nft.json +1 -0
  34. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -0
  35. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js +1 -1
  36. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js.nft.json +1 -1
  37. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.html +1 -1
  40. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.rsc +1 -1
  41. package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users/page.js +1 -0
  42. package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users/page.js.nft.json +1 -0
  43. package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users/page_client-reference-manifest.js +1 -0
  44. package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users.html +1 -0
  45. package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users.meta +5 -0
  46. package/.next/standalone/platform/services/mcctl-console/.next/server/app/admin/users.rsc +12 -0
  47. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/[id]/route.js +2 -2
  48. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/export/route.js +2 -2
  49. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/route.js +2 -2
  50. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/stats/route.js +2 -2
  51. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/audit-logs/stream/route.js +1 -1
  52. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/auth/[...all]/route.js +2 -2
  53. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/history/route.js +2 -2
  54. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/restore/route.js +2 -2
  55. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/backup/route.js +2 -2
  56. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/ban/route.js +2 -2
  57. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/kick/route.js +2 -2
  58. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/[player]/route.js +57 -0
  59. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/[player]/route.js.nft.json +1 -0
  60. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/op/route.js +2 -2
  61. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/route.js +2 -2
  62. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/players/whitelist/route.js +2 -2
  63. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/router/status/route.js +2 -2
  64. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/[action]/route.js +2 -2
  65. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/config/route.js +2 -2
  66. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/exec/route.js +2 -2
  67. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/route.js +2 -2
  68. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/[name]/world/reset/route.js +2 -2
  69. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/servers/route.js +2 -2
  70. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/user-servers/[id]/route.js +1 -1
  71. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/user-servers/route.js +1 -1
  72. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/users/route.js +2 -2
  73. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/[action]/route.js +2 -2
  74. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/[name]/route.js +2 -2
  75. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/worlds/route.js +2 -2
  76. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.html +1 -1
  77. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.rsc +3 -3
  78. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.html +1 -1
  79. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +3 -3
  80. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.html +1 -1
  81. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.rsc +3 -3
  82. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.html +1 -1
  83. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.rsc +2 -2
  84. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page.js +1 -1
  85. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page.js.nft.json +1 -1
  86. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page_client-reference-manifest.js +1 -1
  87. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.html +1 -1
  88. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.rsc +2 -2
  89. package/.next/standalone/platform/services/mcctl-console/.next/server/app/page.js +1 -1
  90. package/.next/standalone/platform/services/mcctl-console/.next/server/app/page_client-reference-manifest.js +1 -1
  91. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.html +1 -1
  92. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.rsc +3 -3
  93. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.html +1 -1
  94. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.rsc +3 -3
  95. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.html +1 -1
  96. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.rsc +3 -3
  97. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.html +1 -0
  98. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.meta +5 -0
  99. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.rsc +18 -0
  100. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page.js +1 -1
  101. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page.js.nft.json +1 -1
  102. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page_client-reference-manifest.js +1 -1
  103. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.html +1 -1
  104. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.rsc +2 -2
  105. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.html +1 -1
  106. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.rsc +3 -3
  107. package/.next/standalone/platform/services/mcctl-console/.next/server/app-paths-manifest.json +14 -11
  108. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1645.js +1 -0
  109. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2572.js +1 -0
  110. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2793.js +1 -0
  111. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3029.js +5 -5
  112. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3048.js +1 -0
  113. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/354.js +1 -1
  114. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4282.js +1 -0
  115. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5019.js +1 -0
  116. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/6088.js +1 -0
  117. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/609.js +1 -0
  118. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/613.js +1 -1
  119. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/6231.js +74 -0
  120. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7057.js +1 -0
  121. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7238.js +1 -0
  122. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7453.js +54 -0
  123. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7521.js +1 -0
  124. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8389.js +1 -0
  125. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8849.js +1 -0
  126. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8872.js +1 -0
  127. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/9250.js +1 -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/1189-60aed59c0e82a63d.js +1 -0
  136. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1544-d2d1404bef00d038.js +1 -0
  137. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1658-1c16e5a05aaa11ee.js +1 -0
  138. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1668-c41281dc3163e1c2.js +1 -0
  139. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1721-2758853c661770ff.js +1 -0
  140. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/190-9ecdd3c2ad7fadef.js +1 -0
  141. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3489-b8c5f08aa4922197.js +1 -0
  142. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4416-2385e5784dc036d6.js +1 -0
  143. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4474-b7d88543d50f7f58.js +1 -0
  144. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5375-a2d3a8fb915a3971.js +1 -0
  145. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5381-4e3aac97e0617278.js +1 -0
  146. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5386-a568e84580b1d208.js +1 -0
  147. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6357-a9d3501984c53429.js +1 -0
  148. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6479-82b21daf8e380c4d.js +1 -0
  149. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6571-0d9e629a91d9f630.js +1 -0
  150. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6727-e25ea0d10f0fea68.js +1 -0
  151. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6758-d0a2d1008691eff1.js +1 -0
  152. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/680-61e3cda59bad5959.js +1 -0
  153. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6857-5b9c04069853bfc4.js +1 -0
  154. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6909-9750e61adcf6f5e5.js +1 -0
  155. package/.next/{static/chunks/4840-5802e869ffd1d2a9.js → standalone/platform/services/mcctl-console/.next/static/chunks/7073-46594e6380fdda11.js} +1 -1
  156. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7436-44378c85b24787cc.js +1 -0
  157. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/765-8e911fe4e2959f8d.js +1 -0
  158. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7782-0f287c9ab0566879.js +1 -0
  159. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/787-91c6946656342fe4.js +1 -0
  160. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8625-b235421f69a178fb.js +1 -0
  161. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/880-be7151cc9c502be6.js +1 -0
  162. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9485-9510025fbd9f9555.js +1 -0
  163. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9760-3b9261fc2cfda017.js +1 -0
  164. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9810-e8bf0b092d80a553.js +1 -0
  165. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/{page-7a5d1441bb2811cf.js → page-b879c927081e59a2.js} +1 -1
  166. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/backups/{page-cc46681d519753dd.js → page-7a59c9269da2d63e.js} +1 -1
  167. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/{page-b548fe2aac951e5b.js → page-d2d8cd0c7a0a54ec.js} +1 -1
  168. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-2f8a2fe359953bbc.js +1 -0
  169. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-724151791dd69b93.js +1 -0
  170. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-909690ecbe76f31c.js +1 -0
  171. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/console/{page-ca0344337ef5da93.js → page-617a1ab914c8d828.js} +1 -1
  172. package/.next/{static/chunks/app/(main)/servers/[name]/page-55fee1f878b51fb8.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-96518534b90deb1c.js} +1 -1
  173. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-c35bb5a99e6ff107.js +1 -0
  174. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/settings/page-a805f639e14a10b0.js +1 -0
  175. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-704a3dafb5b8ec15.js +1 -0
  176. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/admin/users/page-f45f3cd30725a718.js +1 -0
  177. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-1665f285187a2a51.js +1 -0
  178. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/page-06fbf91c6bf684a9.js +1 -0
  179. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/signup/page-ae0638854e6bde34.js +1 -0
  180. package/.next/{static/chunks/main-43f98b458d773ca0.js → standalone/platform/services/mcctl-console/.next/static/chunks/main-d86dc43481acf07f.js} +1 -1
  181. package/.next/standalone/platform/services/mcctl-console/package.json +1 -1
  182. package/.next/static/chunks/1189-60aed59c0e82a63d.js +1 -0
  183. package/.next/static/chunks/1544-d2d1404bef00d038.js +1 -0
  184. package/.next/static/chunks/1658-1c16e5a05aaa11ee.js +1 -0
  185. package/.next/static/chunks/1668-c41281dc3163e1c2.js +1 -0
  186. package/.next/static/chunks/1721-2758853c661770ff.js +1 -0
  187. package/.next/static/chunks/190-9ecdd3c2ad7fadef.js +1 -0
  188. package/.next/static/chunks/3489-b8c5f08aa4922197.js +1 -0
  189. package/.next/static/chunks/4416-2385e5784dc036d6.js +1 -0
  190. package/.next/static/chunks/4474-b7d88543d50f7f58.js +1 -0
  191. package/.next/static/chunks/5375-a2d3a8fb915a3971.js +1 -0
  192. package/.next/static/chunks/5381-4e3aac97e0617278.js +1 -0
  193. package/.next/static/chunks/5386-a568e84580b1d208.js +1 -0
  194. package/.next/static/chunks/6357-a9d3501984c53429.js +1 -0
  195. package/.next/static/chunks/6479-82b21daf8e380c4d.js +1 -0
  196. package/.next/static/chunks/6571-0d9e629a91d9f630.js +1 -0
  197. package/.next/static/chunks/6727-e25ea0d10f0fea68.js +1 -0
  198. package/.next/static/chunks/6758-d0a2d1008691eff1.js +1 -0
  199. package/.next/static/chunks/680-61e3cda59bad5959.js +1 -0
  200. package/.next/static/chunks/6857-5b9c04069853bfc4.js +1 -0
  201. package/.next/static/chunks/6909-9750e61adcf6f5e5.js +1 -0
  202. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/4840-5802e869ffd1d2a9.js → static/chunks/7073-46594e6380fdda11.js} +1 -1
  203. package/.next/static/chunks/7436-44378c85b24787cc.js +1 -0
  204. package/.next/static/chunks/765-8e911fe4e2959f8d.js +1 -0
  205. package/.next/static/chunks/7782-0f287c9ab0566879.js +1 -0
  206. package/.next/static/chunks/787-91c6946656342fe4.js +1 -0
  207. package/.next/static/chunks/8625-b235421f69a178fb.js +1 -0
  208. package/.next/static/chunks/880-be7151cc9c502be6.js +1 -0
  209. package/.next/static/chunks/9485-9510025fbd9f9555.js +1 -0
  210. package/.next/static/chunks/9760-3b9261fc2cfda017.js +1 -0
  211. package/.next/static/chunks/9810-e8bf0b092d80a553.js +1 -0
  212. package/.next/static/chunks/app/(main)/audit-logs/{page-7a5d1441bb2811cf.js → page-b879c927081e59a2.js} +1 -1
  213. package/.next/static/chunks/app/(main)/backups/{page-cc46681d519753dd.js → page-7a59c9269da2d63e.js} +1 -1
  214. package/.next/static/chunks/app/(main)/dashboard/{page-b548fe2aac951e5b.js → page-d2d8cd0c7a0a54ec.js} +1 -1
  215. package/.next/static/chunks/app/(main)/layout-2f8a2fe359953bbc.js +1 -0
  216. package/.next/static/chunks/app/(main)/players/page-724151791dd69b93.js +1 -0
  217. package/.next/static/chunks/app/(main)/routing/page-909690ecbe76f31c.js +1 -0
  218. package/.next/static/chunks/app/(main)/servers/[name]/console/{page-ca0344337ef5da93.js → page-617a1ab914c8d828.js} +1 -1
  219. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-55fee1f878b51fb8.js → static/chunks/app/(main)/servers/[name]/page-96518534b90deb1c.js} +1 -1
  220. package/.next/static/chunks/app/(main)/servers/page-c35bb5a99e6ff107.js +1 -0
  221. package/.next/static/chunks/app/(main)/settings/page-a805f639e14a10b0.js +1 -0
  222. package/.next/static/chunks/app/(main)/worlds/page-704a3dafb5b8ec15.js +1 -0
  223. package/.next/static/chunks/app/admin/users/page-f45f3cd30725a718.js +1 -0
  224. package/.next/static/chunks/app/login/page-1665f285187a2a51.js +1 -0
  225. package/.next/static/chunks/app/page-06fbf91c6bf684a9.js +1 -0
  226. package/.next/static/chunks/app/signup/page-ae0638854e6bde34.js +1 -0
  227. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/main-43f98b458d773ca0.js → static/chunks/main-d86dc43481acf07f.js} +1 -1
  228. package/package.json +2 -2
  229. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1399.js +0 -1
  230. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2365.js +0 -1
  231. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3076.js +0 -1
  232. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3100.js +0 -1
  233. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4972.js +0 -1
  234. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5244.js +0 -74
  235. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5256.js +0 -1
  236. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/6010.js +0 -1
  237. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8024.js +0 -54
  238. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8243.js +0 -1
  239. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/9157.js +0 -1
  240. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/9350.js +0 -1
  241. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/959.js +0 -1
  242. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1476-a0570078fdf78fae.js +0 -1
  243. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2022-6da2f9a847a5d61c.js +0 -1
  244. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2093-bceea213e32f6b5f.js +0 -1
  245. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/212-b904d9ae152f2360.js +0 -1
  246. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2149-ba1bdd1d726ab70c.js +0 -1
  247. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/310-72d3b802b3cefa99.js +0 -1
  248. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/315-509f963f6c69d0a8.js +0 -1
  249. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3543-1ec838cbe59f6baa.js +0 -1
  250. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/406-64ea09489141e436.js +0 -1
  251. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4278-9a6acf769f296866.js +0 -1
  252. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4538-a0d2c88024f1288a.js +0 -1
  253. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5511-7a419d84918a8d64.js +0 -1
  254. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6189-d8557db379604b3e.js +0 -1
  255. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6594-e49e36eb5a5d1bef.js +0 -1
  256. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6645-68b73fe1df8dba93.js +0 -1
  257. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6655-81288236c1babc44.js +0 -1
  258. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7220-4d1d72de4109ad9b.js +0 -1
  259. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7294-ffa0013d4b0fa40a.js +0 -1
  260. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7413-419718450fadde21.js +0 -1
  261. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8006-219c9bbc650b079e.js +0 -1
  262. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8322-8ae826d4c9b38acc.js +0 -1
  263. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8657-f28db4e9df8cc7b0.js +0 -1
  264. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8696-8adf1e9b1a84f5c0.js +0 -1
  265. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9030-1dcbf06ed6e20e24.js +0 -1
  266. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9887-bff2aa500d1d1995.js +0 -1
  267. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/layout-692cb1da92b73287.js +0 -1
  268. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-706f5e796129df33.js +0 -1
  269. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-14f40cfd98e60a77.js +0 -1
  270. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/page-efa5f11aa2956719.js +0 -1
  271. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-3de10e94b77f6e45.js +0 -1
  272. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/login/page-d6a5da720238e5cf.js +0 -1
  273. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/page-8b5b6cb30448bcc5.js +0 -1
  274. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/signup/page-6e5550bc9fffa4bc.js +0 -1
  275. package/.next/static/chunks/1476-a0570078fdf78fae.js +0 -1
  276. package/.next/static/chunks/2022-6da2f9a847a5d61c.js +0 -1
  277. package/.next/static/chunks/2093-bceea213e32f6b5f.js +0 -1
  278. package/.next/static/chunks/212-b904d9ae152f2360.js +0 -1
  279. package/.next/static/chunks/2149-ba1bdd1d726ab70c.js +0 -1
  280. package/.next/static/chunks/310-72d3b802b3cefa99.js +0 -1
  281. package/.next/static/chunks/315-509f963f6c69d0a8.js +0 -1
  282. package/.next/static/chunks/3543-1ec838cbe59f6baa.js +0 -1
  283. package/.next/static/chunks/406-64ea09489141e436.js +0 -1
  284. package/.next/static/chunks/4278-9a6acf769f296866.js +0 -1
  285. package/.next/static/chunks/4538-a0d2c88024f1288a.js +0 -1
  286. package/.next/static/chunks/5511-7a419d84918a8d64.js +0 -1
  287. package/.next/static/chunks/6189-d8557db379604b3e.js +0 -1
  288. package/.next/static/chunks/6594-e49e36eb5a5d1bef.js +0 -1
  289. package/.next/static/chunks/6645-68b73fe1df8dba93.js +0 -1
  290. package/.next/static/chunks/6655-81288236c1babc44.js +0 -1
  291. package/.next/static/chunks/7220-4d1d72de4109ad9b.js +0 -1
  292. package/.next/static/chunks/7294-ffa0013d4b0fa40a.js +0 -1
  293. package/.next/static/chunks/7413-419718450fadde21.js +0 -1
  294. package/.next/static/chunks/8006-219c9bbc650b079e.js +0 -1
  295. package/.next/static/chunks/8322-8ae826d4c9b38acc.js +0 -1
  296. package/.next/static/chunks/8657-f28db4e9df8cc7b0.js +0 -1
  297. package/.next/static/chunks/8696-8adf1e9b1a84f5c0.js +0 -1
  298. package/.next/static/chunks/9030-1dcbf06ed6e20e24.js +0 -1
  299. package/.next/static/chunks/9887-bff2aa500d1d1995.js +0 -1
  300. package/.next/static/chunks/app/(main)/layout-692cb1da92b73287.js +0 -1
  301. package/.next/static/chunks/app/(main)/players/page-706f5e796129df33.js +0 -1
  302. package/.next/static/chunks/app/(main)/routing/page-14f40cfd98e60a77.js +0 -1
  303. package/.next/static/chunks/app/(main)/servers/page-efa5f11aa2956719.js +0 -1
  304. package/.next/static/chunks/app/(main)/worlds/page-3de10e94b77f6e45.js +0 -1
  305. package/.next/static/chunks/app/login/page-d6a5da720238e5cf.js +0 -1
  306. package/.next/static/chunks/app/page-8b5b6cb30448bcc5.js +0 -1
  307. package/.next/static/chunks/app/signup/page-6e5550bc9fffa4bc.js +0 -1
  308. /package/.next/standalone/platform/services/mcctl-console/.next/static/{J1RLwJBlYRYnOUdff_T8I → FpqRAxF6tnqZ99-k8eKej}/_buildManifest.js +0 -0
  309. /package/.next/standalone/platform/services/mcctl-console/.next/static/{J1RLwJBlYRYnOUdff_T8I → FpqRAxF6tnqZ99-k8eKej}/_ssgManifest.js +0 -0
  310. /package/.next/static/{J1RLwJBlYRYnOUdff_T8I → FpqRAxF6tnqZ99-k8eKej}/_buildManifest.js +0 -0
  311. /package/.next/static/{J1RLwJBlYRYnOUdff_T8I → FpqRAxF6tnqZ99-k8eKej}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4095],{16387:function(e,r,t){Promise.resolve().then(t.bind(t,6453))},6453:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return N}});var n=t(94655),i=t(35106),a=t(7281),s=t(74228),l=t(46725),o=t(56275),c=t(62108),d=t(79983),x=t(31317),h=t(78765),m=t(90158),u=t(58347),p=t(49954),f=t(17820),g=t(73424),b=t(61505),j=t(71185),y=t(76176),v=t(27171),Z=t(35847),w=t(29983),C=t(80620),k=t(84974),S=t(34675),P=t(407),z=t(85480),I=t(64779);function W(e){return(0,n.jsxs)(I.Z,{...e,viewBox:"0 0 32 32",children:[(0,n.jsx)("rect",{width:"32",height:"32",fill:"#5DA840"}),(0,n.jsx)("rect",{x:"4",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"8",width:"8",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"12",y:"16",width:"8",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"20",width:"16",height:"8",fill:"#000"}),(0,n.jsx)("rect",{x:"8",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"20",y:"28",width:"4",height:"4",fill:"#000"}),(0,n.jsx)("rect",{x:"0",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"8",y:"4",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"24",y:"0",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"28",y:"8",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"}),(0,n.jsx)("rect",{x:"0",y:"24",width:"4",height:"4",fill:"#4A9030",opacity:"0.5"})]})}var A=t(8690),D=t(6986);let T=[{label:"Dashboard",href:"/dashboard",icon:(0,n.jsx)(y.Z,{})},{label:"Servers",href:"/servers",icon:(0,n.jsx)(v.Z,{})},{label:"Worlds",href:"/worlds",icon:(0,n.jsx)(k.Z,{})},{label:"Players",href:"/players",icon:(0,n.jsx)(Z.Z,{})},{label:"Audit Log",href:"/audit-logs",icon:(0,n.jsx)(C.Z,{})},{label:"Backups",href:"/backups",icon:(0,n.jsx)(S.Z,{})},{label:"Routing",href:"/routing",icon:(0,n.jsx)(w.Z,{})}],_={label:"Admin",href:"/admin",icon:(0,n.jsx)(P.Z,{})};function E(e){var r;let{mobileOpen:t,onMenuToggle:i}=e,y=(0,s.usePathname)(),{data:v}=(0,D.kP)(),Z=e=>"/dashboard"===e?"/dashboard"===y||"/"===y:y.startsWith(e),w=(null==v?void 0:null===(r=v.user)||void 0===r?void 0:r.role)==="admin"?[...T,_]:T;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{position:"fixed",elevation:0,sx:{backgroundColor:"background.paper",borderBottom:"1px solid",borderColor:"divider",zIndex:e=>e.zIndex.drawer+1},children:(0,n.jsxs)(c.Z,{sx:{maxWidth:"1400px",width:"100%",mx:"auto",px:{xs:2,sm:3}},children:[(0,n.jsx)(d.Z,{color:"inherit","aria-label":"open menu",edge:"start",onClick:i,sx:{mr:2,display:{md:"none"}},children:(0,n.jsx)(b.Z,{})}),(0,n.jsxs)(l.default,{href:"/",style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[(0,n.jsx)(W,{sx:{fontSize:28,color:"primary.main",mr:1}}),(0,n.jsx)(x.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"common.white",letterSpacing:"0.05em",fontSize:"1.1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(a.Z,{component:"nav",sx:{display:{xs:"none",md:"flex"},alignItems:"center",gap:1,ml:4,flex:1},children:w.map(e=>{let r=Z(e.href);return(0,n.jsx)(l.default,{href:e.href,style:{textDecoration:"none"},onClick:()=>!r&&(0,A.Av)(),children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:2,color:r?"primary.main":"text.secondary",backgroundColor:r?"action.selected":"transparent",transition:"all 0.2s ease","&:hover":{backgroundColor:"action.hover",color:r?"primary.main":"text.primary"}},children:[(0,n.jsx)(a.Z,{component:"span",sx:{display:"flex",alignItems:"center","& svg":{fontSize:20}},children:e.icon}),(0,n.jsx)(x.Z,{variant:"body2",sx:{fontWeight:r?600:400},children:e.label})]})},e.href)})}),(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:(0,n.jsx)(z.Ie,{})})]})}),(0,n.jsx)(h.ZP,{variant:"temporary",anchor:"left",open:t,onClose:i,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:280,backgroundColor:"background.paper"}},children:(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:2,minHeight:64,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(W,{sx:{fontSize:24,color:"primary.main",mr:1}}),(0,n.jsx)(x.Z,{variant:"h6",component:"span",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"primary.main",letterSpacing:"0.05em",fontSize:"1rem"},children:"Minecraft Console"})]}),(0,n.jsx)(d.Z,{onClick:i,"aria-label":"close menu",children:(0,n.jsx)(j.Z,{})})]}),(0,n.jsx)(m.Z,{sx:{flex:1,px:1,py:2},children:w.map(e=>{let r=Z(e.href);return(0,n.jsx)(u.ZP,{disablePadding:!0,sx:{mb:.5},children:(0,n.jsxs)(p.Z,{component:l.default,href:e.href,onClick:()=>{i(),r||(0,A.Av)()},"aria-current":r?"page":void 0,sx:{borderRadius:2,backgroundColor:r?"action.selected":"transparent","&:hover":{backgroundColor:"action.hover"}},children:[(0,n.jsx)(f.Z,{sx:{color:r?"primary.main":"text.secondary",minWidth:40},children:e.icon}),(0,n.jsx)(g.Z,{primary:e.label,primaryTypographyProps:{fontWeight:r?600:400,color:r?"primary.main":"text.primary"}})]})},e.href)})})]})})]})}var q=t(67337),L=t(41261),M=t(69123),R=t(75845),H=t(43880);function U(e){return(0,n.jsx)(I.Z,{...e,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.186m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288z"})})}let B=[{title:"Resources",links:[{label:"Getting Started",href:"https://minecraft-server-manager.readthedocs.io/en/latest/getting-started/",external:!0},{label:"Configuration",href:"https://minecraft-server-manager.readthedocs.io/en/latest/configuration/",external:!0},{label:"Troubleshooting",href:"https://minecraft-server-manager.readthedocs.io/en/latest/troubleshooting/",external:!0}]},{title:"Documentation",links:[{label:"CLI Commands",href:"https://minecraft-server-manager.readthedocs.io/en/latest/cli/",external:!0},{label:"API Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/console/",external:!0},{label:"itzg Reference",href:"https://minecraft-server-manager.readthedocs.io/en/latest/itzg-reference/",external:!0}]},{title:"Community",links:[{label:"GitHub",href:"https://github.com/smallmiro/minecraft-server-manager",external:!0},{label:"Issues",href:"https://github.com/smallmiro/minecraft-server-manager/issues",external:!0}]},{title:"About",links:[{label:"License",href:"https://github.com/smallmiro/minecraft-server-manager/blob/main/LICENSE",external:!0},{label:"Docker Hub",href:"https://hub.docker.com/r/itzg/minecraft-server",external:!0}]}];function V(){let e=new Date().getFullYear();return(0,n.jsx)(a.Z,{component:"footer",sx:{backgroundColor:"background.paper",borderTop:"1px solid",borderColor:"divider",mt:"auto"},children:(0,n.jsxs)(q.Z,{maxWidth:"lg",sx:{py:6},children:[(0,n.jsx)(a.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(4, 1fr)"},gap:4,mb:4},children:B.map(e=>(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(x.Z,{variant:"subtitle2",sx:{fontWeight:600,color:"text.primary",mb:2},children:e.title}),(0,n.jsx)(a.Z,{component:"ul",sx:{listStyle:"none",p:0,m:0},children:e.links.map(e=>(0,n.jsx)(a.Z,{component:"li",sx:{mb:1},children:(0,n.jsx)(L.Z,{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,underline:"hover",sx:{color:"text.secondary",fontSize:"0.875rem",transition:"color 0.2s ease","&:hover":{color:"primary.main"}},children:e.label})},e.label))})]},e.title))}),(0,n.jsx)(M.Z,{sx:{mb:3}}),(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},gap:2},children:[(0,n.jsxs)(x.Z,{variant:"body2",sx:{color:"text.tertiary"},children:[e," \xa9"," ",(0,n.jsx)(L.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:{color:"primary.main"},children:"Minecraft Server Management Console"})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:2},children:[(0,n.jsx)(L.Z,{href:"https://github.com/smallmiro/minecraft-server-manager",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(R.Z,{fontSize:"small"})}),(0,n.jsx)(L.Z,{href:"https://minecraft-server-manager.readthedocs.io/",target:"_blank",rel:"noopener noreferrer","aria-label":"Documentation",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(H.Z,{fontSize:"small"})}),(0,n.jsx)(L.Z,{href:"https://hub.docker.com/r/itzg/minecraft-server",target:"_blank",rel:"noopener noreferrer","aria-label":"Docker Hub",sx:{color:"text.secondary",transition:"color 0.2s ease","&:hover":{color:"text.primary"}},children:(0,n.jsx)(U,{fontSize:"small"})})]})]})]})})}function N(e){let{children:r}=e,[t,s]=(0,i.useState)(!1);return(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",backgroundColor:"background.default"},children:[(0,n.jsx)(E,{mobileOpen:t,onMenuToggle:()=>{s(!t)}}),(0,n.jsx)(a.Z,{component:"main",sx:{flexGrow:1,display:"flex",flexDirection:"column",pt:{xs:"".concat(88,"px"),sm:"".concat(96,"px")},pb:{xs:3,sm:4},px:{xs:2,sm:3,md:4},maxWidth:"1400px",width:"100%",mx:"auto"},children:r}),(0,n.jsx)(V,{})]})}},85480:function(e,r,t){"use strict";t.d(r,{U0:function(){return u},WS:function(){return p},Ie:function(){return I}});var n=t(94655),i=t(35106),a=t(7281),s=t(81071),l=t(97436),o=t(52082),c=t(79983),d=t(30417),x=t(36848),h=t(554),m=t(6986);function u(e){let{onSuccess:r}=e,[t,u]=(0,i.useState)(""),[p,f]=(0,i.useState)(""),[g,b]=(0,i.useState)(!1),[j,y]=(0,i.useState)({}),[v,Z]=(0,i.useState)(null),[w,C]=(0,i.useState)(!1),k=()=>{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"),y(e),0===Object.keys(e).length},S=async e=>{if(e.preventDefault(),Z(null),k()){C(!0);try{let e=await m.cg.email({email:t,password:p});if(e.error){Z(e.error.message||"Invalid credentials"),C(!1);return}r&&r()}catch(e){Z("An unexpected error occurred. Please try again."),C(!1)}}};return(0,n.jsxs)(a.Z,{component:"form",onSubmit:S,sx:{display:"flex",flexDirection:"column",gap:2},children:[v&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>Z(null),children:v}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:t,onChange:e=>u(e.target.value),error:!!j.email,helperText:j.email,disabled:w,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:g?"text":"password",value:p,onChange:e=>f(e.target.value),error:!!j.password,helperText:j.password,disabled:w,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{b(!g)},edge:"end",children:g?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:w,fullWidth:!0,size:"large",children:w?"Signing in...":"Sign In"})]})}function p(e){let{onSuccess:r}=e,[t,u]=(0,i.useState)(""),[p,f]=(0,i.useState)(""),[g,b]=(0,i.useState)(""),[j,y]=(0,i.useState)(""),[v,Z]=(0,i.useState)(!1),[w,C]=(0,i.useState)(!1),[k,S]=(0,i.useState)({}),[P,z]=(0,i.useState)(null),[I,W]=(0,i.useState)(!1),A=()=>{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",g?g.length<8&&(e.password="Password must be at least 8 characters"):e.password="Password is required",j?g!==j&&(e.confirmPassword="Passwords do not match"):e.confirmPassword="Please confirm your password",S(e),0===Object.keys(e).length},D=async e=>{if(e.preventDefault(),z(null),A()){W(!0);try{let e=await m.y1.email({email:p,password:g,name:t});if(e.error){z(e.error.message||"Registration failed"),W(!1);return}r&&r()}catch(e){z("An unexpected error occurred. Please try again."),W(!1)}}};return(0,n.jsxs)(a.Z,{component:"form",onSubmit:D,sx:{display:"flex",flexDirection:"column",gap:2},children:[P&&(0,n.jsx)(s.Z,{severity:"error",onClose:()=>z(null),children:P}),(0,n.jsx)(l.Z,{label:"Name",type:"text",value:t,onChange:e=>u(e.target.value),error:!!k.name,helperText:k.name,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Email",type:"email",value:p,onChange:e=>f(e.target.value),error:!!k.email,helperText:k.email,disabled:I,fullWidth:!0,required:!0}),(0,n.jsx)(l.Z,{label:"Password",type:v?"text":"password",value:g,onChange:e=>b(e.target.value),error:!!k.password,helperText:k.password,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{Z(!v)},edge:"end",children:v?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(l.Z,{label:"Confirm Password",type:w?"text":"password",value:j,onChange:e=>y(e.target.value),error:!!k.confirmPassword,helperText:k.confirmPassword,disabled:I,fullWidth:!0,required:!0,InputProps:{endAdornment:(0,n.jsx)(o.Z,{position:"end",children:(0,n.jsx)(c.Z,{"aria-label":"toggle password visibility",onClick:()=>{C(!w)},edge:"end",children:w?(0,n.jsx)(x.Z,{}):(0,n.jsx)(h.Z,{})})})}}),(0,n.jsx)(d.Z,{type:"submit",variant:"contained",color:"primary",disabled:I,fullWidth:!0,size:"large",children:I?"Creating account...":"Sign Up"})]})}var f=t(74228),g=t(93017),b=t(86702),j=t(35694),y=t(31317),v=t(25333),Z=t(69123),w=t(7178),C=t(17820),k=t(73424),S=t(92710),P=t(41094),z=t(78319);function I(){let e=(0,f.useRouter)(),{data:r,isPending:t}=(0,m.kP)(),[s,l]=(0,i.useState)(null),o=()=>{l(null)},x=async()=>{o(),await (0,m.w7)(),e.push("/login")};if(t)return(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(g.Z,{size:24})});if(!(null==r?void 0:r.user))return(0,n.jsx)(d.Z,{variant:"contained",color:"primary",onClick:()=>{e.push("/login")},children:"Sign In"});let{user:h}=r,u=((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():"?"})(h.name,h.email);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.Z,{onClick:e=>{l(e.currentTarget)},"aria-label":"user menu",children:(0,n.jsx)(b.Z,{sx:{bgcolor:"primary.main"},children:u})}),(0,n.jsxs)(j.Z,{anchorEl:s,open:!!s,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:1},children:[(0,n.jsxs)(a.Z,{sx:{px:2,py:1.5,minWidth:200},children:[(0,n.jsx)(y.Z,{variant:"subtitle1",fontWeight:"600",children:h.name||"User"}),(0,n.jsx)(y.Z,{variant:"body2",color:"text.secondary",children:h.email}),"admin"===h.role&&(0,n.jsx)(v.Z,{label:"Admin",size:"small",color:"primary",sx:{mt:1}})]}),(0,n.jsx)(Z.Z,{}),"admin"===h.role&&(0,n.jsxs)(w.Z,{onClick:()=>{o(),e.push("/admin")},children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(S.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Admin Panel"})]}),(0,n.jsxs)(w.Z,{onClick:()=>{o(),e.push("/settings")},children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(P.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Settings"})]}),(0,n.jsxs)(w.Z,{onClick:x,children:[(0,n.jsx)(C.Z,{children:(0,n.jsx)(z.Z,{fontSize:"small"})}),(0,n.jsx)(k.Z,{children:"Logout"})]})]})]})}},3454:function(e,r,t){"use strict";t.d(r,{LoadingProvider:function(){return o},startLoading:function(){return c},stopLoading:function(){return d}});var n=t(94655),i=t(35106),a=t(74228),s=t(31477),l=t.n(s);function o(e){let{children:r}=e,t=(0,a.usePathname)(),s=(0,a.useSearchParams)();return(0,i.useEffect)(()=>{l().done()},[t,s]),(0,n.jsx)(n.Fragment,{children:r})}function c(){l().start()}function d(){l().done()}l().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,r,t){"use strict";t.d(r,{Av:function(){return n.startLoading}});var n=t(3454)},6986:function(e,r,t){"use strict";t.d(r,{Cp:function(){return h},Nq:function(){return x},cg:function(){return l},kP:function(){return d},w7:function(){return o},y1:function(){return c},zB:function(){return m}});var n=t(77054),i=t(61648),a=t(35016);let s=(0,n.X)({baseURL:a.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,i.zB)()]}),{signIn:l,signOut:o,signUp:c,useSession:d,updateUser:x,changePassword:h}=s,m=s.admin}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,2542,55,6857,8347,1544,765,8918,9485,3669,2757,1744],function(){return e(e.s=16387)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[781],{31809:function(e,n,r){Promise.resolve().then(r.bind(r,38538))},38538:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return ed}});var t=r(94655),a=r(35106),s=r(7281),l=r(31317),o=r(84840),i=r(33402),c=r(60097),d=r(29793),u=r(75726),h=r(62328),y=r(7178),p=r(69899),x=r(76492),m=r(35847),v=r(628),j=r(41565),f=r(90158),Z=r(58347),b=r(73424),g=r(69783),C=r(86702),S=r(79983),w=r(30417),k=r(25333),E=r(99770),F=r(62508),I=r(5682),P=r(65087),O=r(76678),q=r(97436),D=r(93017),N=r(81071),L=r(66561),R=r(12795),K=r(96407),T=r(69366),U=r(11597),A=r(81960),W=r(30114);function Q(e){let{onPlayerKicked:n}=e,[r,o]=(0,a.useState)(!0),[i,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[h,y]=(0,a.useState)(!1),[p,x]=(0,a.useState)(null),[m,Q]=(0,a.useState)(""),[B,z]=(0,a.useState)(!1),J=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=await fetch("/api/players");if(!e.ok)throw Error("Failed to fetch players");let n=await e.json();u(n.servers)}catch(e){c("Failed to load players"),console.error("Error fetching players:",e)}finally{o(!1)}},[]);(0,a.useEffect)(()=>{J()},[J]);let M=(e,n)=>{x({player:e,server:n}),Q(""),y(!0)},_=async()=>{if(p){z(!0);try{if(!(await fetch("/api/players/kick",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:p.player.name,server:p.server,reason:m||"Kicked by administrator"})})).ok)throw Error("Failed to kick player");y(!1),x(null),null==n||n(p.player,p.server),await J()}catch(e){console.error("Error kicking player:",e)}finally{z(!1)}}},H=d.some(e=>e.players.length>0);return(0,t.jsx)(v.Z,{"data-testid":"player-list",children:(0,t.jsxs)(j.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(l.Z,{variant:"h6",children:"Online Players"}),(0,t.jsx)(S.Z,{onClick:J,disabled:r,"aria-label":"Refresh",children:(0,t.jsx)(T.Z,{})})]}),r&&(0,t.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(D.Z,{})}),i&&(0,t.jsx)(N.Z,{severity:"error",sx:{mb:2},children:i}),!r&&!i&&!H&&(0,t.jsx)(l.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players online"}),!r&&!i&&H&&(0,t.jsx)(s.Z,{children:d.map(e=>(0,t.jsxs)(L.Z,{defaultExpanded:e.players.length>0,children:[(0,t.jsx)(R.Z,{expandIcon:(0,t.jsx)(A.Z,{}),children:(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%"},children:[(0,t.jsx)(l.Z,{variant:"subtitle1",sx:{fontWeight:500},children:e.name}),(0,t.jsx)(k.Z,{label:"".concat(e.players.length," player").concat(1!==e.players.length?"s":""),size:"small",color:e.players.length>0?"success":"default"})]})}),(0,t.jsx)(K.Z,{children:0===e.players.length?(0,t.jsx)(l.Z,{color:"text.secondary",sx:{fontStyle:"italic"},children:"No players online on this server"}):(0,t.jsx)(f.Z,{dense:!0,children:e.players.map(n=>(0,t.jsxs)(Z.ZP,{secondaryAction:(0,t.jsx)(S.Z,{edge:"end","aria-label":"Kick player",onClick:()=>M(n,e.name),color:"error",children:(0,t.jsx)(U.Z,{})}),children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(C.Z,{src:"https://mc-heads.net/avatar/".concat(n.uuid,"/40"),alt:n.name,children:(0,t.jsx)(W.Z,{})})}),(0,t.jsx)(b.Z,{primary:n.name,secondary:n.uuid.substring(0,8)+"..."})]},n.uuid))})})]},e.name))}),(0,t.jsxs)(E.Z,{open:h,onClose:()=>y(!1),children:[(0,t.jsx)(F.Z,{children:"Kick Player"}),(0,t.jsxs)(I.Z,{children:[(0,t.jsxs)(P.Z,{children:["Are you sure you want to kick ",null==p?void 0:p.player.name," from ",null==p?void 0:p.server,"?"]}),(0,t.jsx)(q.Z,{autoFocus:!0,margin:"dense",label:"Reason (optional)",fullWidth:!0,variant:"outlined",value:m,onChange:e=>Q(e.target.value),placeholder:"Kicked by administrator"})]}),(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(w.Z,{onClick:()=>y(!1),disabled:B,children:"Cancel"}),(0,t.jsx)(w.Z,{onClick:_,color:"error",variant:"contained",disabled:B,"aria-label":"Confirm kick",children:B?(0,t.jsx)(D.Z,{size:20}):"Confirm"})]})]})]})})}var B=r(70115),z=r(21111),J=r(47606);function M(e){let{serverName:n}=e,[r,o]=(0,a.useState)(!0),[i,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[h,y]=(0,a.useState)(),[p,x]=(0,a.useState)(""),[m,k]=(0,a.useState)(!1),[E,F]=(0,a.useState)(null),I=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=await fetch("/api/players/whitelist?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch whitelist");let r=await e.json();u(r.players),y(r.source)}catch(e){c("Failed to load whitelist"),console.error("Error fetching whitelist:",e)}finally{o(!1)}},[n]);(0,a.useEffect)(()=>{I()},[I]);let P=async()=>{if(p.trim()){k(!0),c(null);try{if(!(await fetch("/api/players/whitelist",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:p.trim(),server:n})})).ok)throw Error("Failed to add player");x(""),await I()}catch(e){c("Failed to add player to whitelist"),console.error("Error adding player:",e)}finally{k(!1)}}},O=async e=>{F(e),c(null);try{if(!(await fetch("/api/players/whitelist?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to remove player");await I()}catch(e){c("Failed to remove player from whitelist"),console.error("Error removing player:",e)}finally{F(null)}};return(0,t.jsx)(v.Z,{"data-testid":"whitelist-manager",children:(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(l.Z,{variant:"h6",gutterBottom:!0,children:"Whitelist"}),i&&(0,t.jsx)(N.Z,{severity:"error",sx:{mb:2},children:i}),!r&&h&&"rcon"!==h&&(0,t.jsxs)(N.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===h?"config.env":"whitelist.json",". Changes will apply on next server start."]}),(0,t.jsxs)(B.Z,{direction:"row",spacing:1,sx:{mb:2},children:[(0,t.jsx)(q.Z,{size:"small",placeholder:"Player name",value:p,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"===e.key&&P()},disabled:m,fullWidth:!0}),(0,t.jsx)(w.Z,{variant:"contained",onClick:P,disabled:!p.trim()||m,startIcon:m?(0,t.jsx)(D.Z,{size:16}):(0,t.jsx)(J.Z,{}),"aria-label":"Add player to whitelist",children:"Add"})]}),r&&(0,t.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(D.Z,{})}),!r&&0===d.length&&(0,t.jsx)(l.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players whitelisted"}),!r&&d.length>0&&(0,t.jsx)(f.Z,{dense:!0,children:d.map(e=>(0,t.jsxs)(Z.ZP,{secondaryAction:(0,t.jsx)(S.Z,{edge:"end","aria-label":"Remove from whitelist",onClick:()=>O(e.name),disabled:E===e.name,color:"error",children:E===e.name?(0,t.jsx)(D.Z,{size:20}):(0,t.jsx)(z.Z,{})}),children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,children:(0,t.jsx)(W.Z,{})})}),(0,t.jsx)(b.Z,{primary:e.name,secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))})]})})}var _=r(35694),H=r(37809),$=r(407),G=r(45813);let Y={1:{color:"info",label:"Moderator",icon:"\uD83D\uDEE1️"},2:{color:"success",label:"Gamemaster",icon:"\uD83C\uDFAE"},3:{color:"warning",label:"Admin",icon:"⚙️"},4:{color:"error",label:"Owner",icon:"\uD83D\uDC51"}};function V(e){let{level:n,showIcon:r=!1,compact:a=!1,size:l="medium",variant:o="filled"}=e,i=Y[n];if(!i)return null;let c=a?n.toString():"Level ".concat(n," - ").concat(i.label),d=r?(0,t.jsx)(s.Z,{component:"span",sx:{mr:.5},children:i.icon}):void 0;return(0,t.jsx)(k.Z,{label:(0,t.jsxs)(t.Fragment,{children:[d,c]}),color:i.color,size:l,variant:o})}var X=r(68038),ee=r(34080),en=r(40064),er=r(39181);let et=[{value:1,label:"Level 1 - Moderator",description:"Bypass spawn protection",icon:"\uD83D\uDEE1️"},{value:2,label:"Level 2 - Gamemaster",description:"Cheats, command blocks",icon:"\uD83C\uDFAE"},{value:3,label:"Level 3 - Admin",description:"Player management commands",icon:"⚙️"},{value:4,label:"Level 4 - Owner",description:"Full server control",icon:"\uD83D\uDC51"}];function ea(e){let{value:n,onChange:r,label:a,disabled:o=!1}=e;return(0,t.jsxs)(d.Z,{component:"fieldset",fullWidth:!0,disabled:o,children:[a&&(0,t.jsx)(X.Z,{component:"legend",sx:{mb:1},children:a}),(0,t.jsx)(ee.Z,{value:n,onChange:e=>{r(parseInt(e.target.value,10))},children:et.map(e=>(0,t.jsx)(en.Z,{value:e.value,control:(0,t.jsx)(er.Z,{}),label:(0,t.jsxs)(s.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(l.Z,{component:"span",children:e.icon}),(0,t.jsx)(l.Z,{component:"span",fontWeight:"medium",children:e.label})]}),(0,t.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{ml:4},children:e.description})]}),sx:{alignItems:"flex-start",py:1}},e.value))})]})}function es(e){let{serverName:n}=e,[r,o]=(0,a.useState)(!0),[i,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[h,p]=(0,a.useState)(),[x,m]=(0,a.useState)(""),[k,P]=(0,a.useState)(!1),[L,R]=(0,a.useState)(null),[K,T]=(0,a.useState)(!1),[U,A]=(0,a.useState)(4),[W,Q]=(0,a.useState)(!1),[B,M]=(0,a.useState)(null),[Y,X]=(0,a.useState)(4),[ee,en]=(0,a.useState)(!1),[er,et]=(0,a.useState)(null),[es,el]=(0,a.useState)(null),eo=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=await fetch("/api/players/op?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch operators");let r=await e.json();u(r.operators),p(r.source)}catch(e){c("Failed to load operators"),console.error("Error fetching operators:",e)}finally{o(!1)}},[n]);(0,a.useEffect)(()=>{eo()},[eo]);let ei=async()=>{if(x.trim()){P(!0),c(null);try{if(!(await fetch("/api/players/op",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:x.trim(),server:n,level:U})})).ok)throw Error("Failed to add operator");m(""),A(4),T(!1),await eo()}catch(e){c("Failed to add operator"),console.error("Error adding operator:",e)}finally{P(!1)}}},ec=async e=>{R(e),c(null),et(null),el(null);try{if(!(await fetch("/api/players/op?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to remove operator");await eo()}catch(e){c("Failed to remove operator"),console.error("Error removing operator:",e)}finally{R(null)}},ed=async()=>{if(B){en(!0),c(null);try{if(!(await fetch("/api/players/op/".concat(encodeURIComponent(B.name),"?server=").concat(encodeURIComponent(n)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:Y})})).ok)throw Error("Failed to change operator level");Q(!1),M(null),await eo()}catch(e){c("Failed to change operator level"),console.error("Error changing operator level:",e)}finally{en(!1)}}},eu=(e,n)=>{et(e.currentTarget),el(n)},eh=()=>{et(null),el(null)};return(0,t.jsxs)(v.Z,{"data-testid":"op-manager",children:[(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(l.Z,{variant:"h6",gutterBottom:!0,children:"Operators"}),i&&(0,t.jsx)(N.Z,{severity:"error",sx:{mb:2},children:i}),!r&&h&&"rcon"!==h&&(0,t.jsxs)(N.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===h?"config.env":"ops.json",". Changes will apply on next server start."]}),(0,t.jsx)(s.Z,{sx:{mb:2},children:(0,t.jsx)(w.Z,{variant:"contained",onClick:()=>T(!0),startIcon:(0,t.jsx)(J.Z,{}),"aria-label":"Add operator",fullWidth:!0,children:"Add Operator"})}),r&&(0,t.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(D.Z,{})}),!r&&0===d.length&&(0,t.jsx)(l.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No operators configured"}),!r&&d.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.Z,{dense:!0,children:d.map(e=>(0,t.jsxs)(Z.ZP,{secondaryAction:(0,t.jsx)(S.Z,{edge:"end","aria-label":"Operator actions",onClick:n=>eu(n,e),disabled:L===e.name,children:L===e.name?(0,t.jsx)(D.Z,{size:20}):(0,t.jsx)(H.Z,{})}),children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,sx:{bgcolor:"warning.main"},children:(0,t.jsx)($.Z,{})})}),(0,t.jsx)(b.Z,{primary:(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,t.jsx)(l.Z,{component:"span",children:e.name}),(0,t.jsx)(V,{level:e.level,showIcon:!0,size:"small"})]}),secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))}),(0,t.jsxs)(_.Z,{anchorEl:er,open:!!er,onClose:eh,children:[(0,t.jsxs)(y.Z,{onClick:()=>{es&&(M(es),X(es.level),Q(!0),eh())},children:[(0,t.jsx)(G.Z,{sx:{mr:1},fontSize:"small"}),"Change Level"]}),(0,t.jsxs)(y.Z,{onClick:()=>es&&ec(es.name),children:[(0,t.jsx)(z.Z,{sx:{mr:1},fontSize:"small",color:"error"}),"Remove OP"]})]})]})]}),(0,t.jsxs)(E.Z,{open:K,onClose:()=>!k&&T(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(F.Z,{children:"Add Operator"}),(0,t.jsxs)(I.Z,{children:[(0,t.jsx)(q.Z,{autoFocus:!0,margin:"dense",label:"Player Name",placeholder:"Enter player name",fullWidth:!0,value:x,onChange:e=>m(e.target.value),disabled:k,sx:{mb:2}}),(0,t.jsx)(ea,{value:U,onChange:A,label:"OP Level",disabled:k})]}),(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(w.Z,{onClick:()=>T(!1),disabled:k,children:"Cancel"}),(0,t.jsx)(w.Z,{variant:"contained",onClick:ei,disabled:!x.trim()||k,startIcon:k?(0,t.jsx)(D.Z,{size:16}):void 0,children:k?"Adding...":"Add OP"})]})]}),(0,t.jsxs)(E.Z,{open:W,onClose:()=>!ee&&Q(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsxs)(F.Z,{children:["Change OP Level - ",null==B?void 0:B.name]}),(0,t.jsx)(I.Z,{children:B&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["Current: Level ",B.level," (",B.role,")"]}),(0,t.jsx)(ea,{value:Y,onChange:X,label:"New Level",disabled:ee})]})}),(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(w.Z,{onClick:()=>Q(!1),disabled:ee,children:"Cancel"}),(0,t.jsx)(w.Z,{variant:"contained",onClick:ed,disabled:ee||Y===(null==B?void 0:B.level),startIcon:ee?(0,t.jsx)(D.Z,{size:16}):void 0,children:ee?"Saving...":"Save Changes"})]})]})]})}var el=r(397);function eo(e){let{serverName:n}=e,[r,o]=(0,a.useState)(!0),[i,c]=(0,a.useState)(null),[d,u]=(0,a.useState)([]),[h,y]=(0,a.useState)(),[p,x]=(0,a.useState)(!1),[m,k]=(0,a.useState)({player:"",reason:""}),[P,L]=(0,a.useState)(!1),[R,K]=(0,a.useState)(null),T=(0,a.useCallback)(async()=>{o(!0),c(null);try{let e=await fetch("/api/players/ban?server=".concat(encodeURIComponent(n)));if(!e.ok)throw Error("Failed to fetch bans");let r=await e.json();u(r.players),y(r.source)}catch(e){c("Failed to load ban list"),console.error("Error fetching bans:",e)}finally{o(!1)}},[n]);(0,a.useEffect)(()=>{T()},[T]);let U=()=>{x(!1),k({player:"",reason:""})},A=async()=>{if(m.player.trim()){L(!0),c(null);try{if(!(await fetch("/api/players/ban",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:m.player.trim(),reason:m.reason.trim()||"Banned by administrator",server:n})})).ok)throw Error("Failed to ban player");U(),await T()}catch(e){c("Failed to ban player"),console.error("Error banning player:",e)}finally{L(!1)}}},Q=async e=>{K(e),c(null);try{if(!(await fetch("/api/players/ban?player=".concat(encodeURIComponent(e),"&server=").concat(encodeURIComponent(n)),{method:"DELETE"})).ok)throw Error("Failed to unban player");await T()}catch(e){c("Failed to unban player"),console.error("Error unbanning player:",e)}finally{K(null)}},J=e=>{try{return new Date(e).toLocaleDateString()}catch(n){return e}};return(0,t.jsx)(v.Z,{"data-testid":"ban-manager",children:(0,t.jsxs)(j.Z,{children:[(0,t.jsxs)(s.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(l.Z,{variant:"h6",children:"Ban List"}),(0,t.jsx)(w.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)(el.Z,{}),onClick:()=>{k({player:"",reason:""}),x(!0)},"aria-label":"Ban player",children:"Ban Player"})]}),i&&(0,t.jsx)(N.Z,{severity:"error",sx:{mb:2},children:i}),!r&&h&&"rcon"!==h&&(0,t.jsxs)(N.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===h?"config.env":"banned-players.json",". Changes will apply on next server start."]}),r&&(0,t.jsx)(s.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(D.Z,{})}),!r&&0===d.length&&(0,t.jsx)(l.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players banned"}),!r&&d.length>0&&(0,t.jsx)(f.Z,{dense:!0,children:d.map(e=>(0,t.jsxs)(Z.ZP,{secondaryAction:(0,t.jsx)(S.Z,{edge:"end","aria-label":"Unban player",onClick:()=>Q(e.name),disabled:R===e.name,color:"success",children:R===e.name?(0,t.jsx)(D.Z,{size:20}):(0,t.jsx)(z.Z,{})}),children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,sx:{bgcolor:"error.main"},children:(0,t.jsx)(W.Z,{})})}),(0,t.jsx)(b.Z,{primary:e.name,secondary:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{component:"span",variant:"body2",color:"text.secondary",children:["Reason: ",e.reason||"No reason specified"]}),(0,t.jsx)("br",{}),(0,t.jsxs)(l.Z,{component:"span",variant:"caption",color:"text.secondary",children:["Banned: ",J(e.created)," by ",e.source||"Unknown"]})]})})]},e.uuid||e.name))}),(0,t.jsxs)(E.Z,{open:p,onClose:U,maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(F.Z,{children:"Ban Player"}),(0,t.jsx)(I.Z,{children:(0,t.jsxs)(B.Z,{spacing:2,sx:{mt:1},children:[(0,t.jsx)(q.Z,{label:"Player Name",placeholder:"Enter player name",value:m.player,onChange:e=>k({...m,player:e.target.value}),fullWidth:!0,required:!0}),(0,t.jsx)(q.Z,{label:"Reason",placeholder:"Banned by administrator",value:m.reason,onChange:e=>k({...m,reason:e.target.value}),fullWidth:!0,multiline:!0,rows:2})]})}),(0,t.jsxs)(O.Z,{children:[(0,t.jsx)(w.Z,{onClick:U,disabled:P,children:"Cancel"}),(0,t.jsx)(w.Z,{onClick:A,color:"error",variant:"contained",disabled:!m.player.trim()||P,startIcon:P?(0,t.jsx)(D.Z,{size:16}):(0,t.jsx)(el.Z,{}),children:"Ban"})]})]})]})})}var ei=r(92666);function ec(e){let{children:n,value:r,index:a}=e;return(0,t.jsx)("div",{role:"tabpanel",hidden:r!==a,children:r===a&&(0,t.jsx)(s.Z,{sx:{py:3},children:n})})}function ed(){let[e,n]=(0,a.useState)(0),[r,v]=(0,a.useState)(""),{data:j,isLoading:f}=(0,ei.x$)(),Z=null==j?void 0:j.servers;return(0,a.useEffect)(()=>{!r&&Z&&Z.length>0&&v(Z[0].name)},[Z,r]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,x.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,x.Fq)(e.palette.secondary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,x.Fq)(e.palette.info.main,.2))},children:(0,t.jsxs)(s.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,t.jsx)(s.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,t.jsx)(m.Z,{sx:{fontSize:32}})}),(0,t.jsxs)(s.Z,{children:[(0,t.jsx)(l.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Player Management"}),(0,t.jsx)(l.Z,{variant:"body1",color:"text.secondary",children:"Manage players, whitelist, operators, and bans across your servers"})]})]})}),(0,t.jsx)(s.Z,{sx:{mb:3},children:(0,t.jsxs)(d.Z,{sx:{minWidth:200},children:[(0,t.jsx)(u.Z,{id:"server-select-label",children:"Server"}),(0,t.jsx)(h.Z,{labelId:"server-select-label",value:r,label:"Server",onChange:e=>v(e.target.value),disabled:f,children:null==Z?void 0:Z.map(e=>(0,t.jsx)(y.Z,{value:e.name,children:e.name},e.name))})]})}),(0,t.jsx)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,t.jsxs)(i.Z,{value:e,onChange:(e,r)=>{n(r)},"aria-label":"Player management tabs",children:[(0,t.jsx)(c.Z,{label:"Online Players"}),(0,t.jsx)(c.Z,{label:"Whitelist",disabled:!r}),(0,t.jsx)(c.Z,{label:"Operators",disabled:!r}),(0,t.jsx)(c.Z,{label:"Ban List",disabled:!r})]})}),(0,t.jsx)(ec,{value:e,index:0,children:(0,t.jsx)(Q,{})}),(0,t.jsx)(ec,{value:e,index:1,children:r&&(0,t.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(o.ZP,{item:!0,xs:12,md:8,children:(0,t.jsx)(M,{serverName:r})}),(0,t.jsx)(o.ZP,{item:!0,xs:12,md:4,children:(0,t.jsxs)(s.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,t.jsx)(l.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Whitelist"}),(0,t.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"The whitelist controls which players can join your server. When enabled, only players on the whitelist can connect. Add players by their Minecraft username."})]})})]})}),(0,t.jsx)(ec,{value:e,index:2,children:r&&(0,t.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(o.ZP,{item:!0,xs:12,md:8,children:(0,t.jsx)(es,{serverName:r})}),(0,t.jsx)(o.ZP,{item:!0,xs:12,md:4,children:(0,t.jsxs)(s.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,t.jsx)(l.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Operators"}),(0,t.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"Operators (OPs) have elevated permissions on the server. They can use commands like /give, /gamemode, /tp, and more. OP levels range from 1-4, with 4 being the highest."}),(0,t.jsxs)(s.Z,{sx:{mt:2},children:[(0,t.jsx)(l.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 1: Can bypass spawn protection"}),(0,t.jsx)(l.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 2: Can use /clear, /gamemode, etc."}),(0,t.jsx)(l.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 3: Can use /ban, /kick, /op, etc."}),(0,t.jsx)(l.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 4: Can use /stop, full access"})]})]})})]})}),(0,t.jsx)(ec,{value:e,index:3,children:r&&(0,t.jsxs)(o.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(o.ZP,{item:!0,xs:12,md:8,children:(0,t.jsx)(eo,{serverName:r})}),(0,t.jsx)(o.ZP,{item:!0,xs:12,md:4,children:(0,t.jsxs)(s.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,t.jsx)(l.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Bans"}),(0,t.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"Banned players cannot connect to your server. You can ban players by username and provide an optional reason. Bans can be removed (pardoned) at any time."})]})})]})})]})}},42936:function(e,n,r){"use strict";async function t(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={...n.headers};n.body&&(r["Content-Type"]="application/json");let t=await fetch(e,{...n,headers:r});if(!t.ok){let e=await t.json().catch(()=>({error:"UnknownError",message:t.statusText})),n=Error(e.message);throw n.statusCode=t.status,n.code=e.error,n}return t.json()}r.d(n,{SC:function(){return t}})},92666:function(e,n,r){"use strict";r.d(n,{$t:function(){return C},Aw:function(){return u},Fv:function(){return v},Hq:function(){return c},Hy:function(){return i},MH:function(){return f},Sr:function(){return y},_I:function(){return h},c5:function(){return S},g2:function(){return m},gx:function(){return Z},hy:function(){return p},iC:function(){return j},jM:function(){return d},mj:function(){return g},nq:function(){return x},nv:function(){return b},s8:function(){return w},x$:function(){return o}});var t=r(5632),a=r(58919),s=r(20367),l=r(42936);function o(){return(0,t.a)({queryKey:["servers"],queryFn:()=>(0,l.SC)("/api/servers"),refetchInterval:6e4})}function i(e,n){return(0,t.a)({queryKey:["servers",e],queryFn:()=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e))),enabled:(null==n?void 0:n.enabled)!==!1&&!!e,refetchInterval:3e4})}function c(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{name:n,force:r}=e;return(0,l.SC)("/api/servers/".concat(encodeURIComponent(n)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["servers"]})}})}function d(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/start"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function u(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/stop"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function h(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/restart"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function y(){return(0,t.a)({queryKey:["worlds"],queryFn:()=>(0,l.SC)("/api/worlds"),refetchInterval:3e4})}function p(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,l.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function x(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{worldName:n,serverName:r}=e;return(0,l.SC)("/api/worlds/".concat(encodeURIComponent(n),"/assign"),{method:"POST",body:JSON.stringify({serverName:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}function m(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{worldName:n,force:r}=e;return(0,l.SC)("/api/worlds/".concat(encodeURIComponent(n),"/release").concat(r?"?force=true":""),{method:"POST"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function v(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{name:n,force:r}=e;return(0,l.SC)("/api/worlds/".concat(encodeURIComponent(n)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function j(e,n){return(0,t.a)({queryKey:["servers",e,"config"],queryFn:()=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/config")),enabled:(null==n?void 0:n.enabled)!==!1&&!!e})}function f(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{serverName:n,config:r}=e;return(0,l.SC)("/api/servers/".concat(encodeURIComponent(n),"/config"),{method:"PATCH",body:JSON.stringify(r)})},onSuccess:(n,r)=>{let{serverName:t}=r;e.invalidateQueries({queryKey:["servers",t,"config"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function Z(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,l.SC)("/api/servers/".concat(encodeURIComponent(e),"/world/reset"),{method:"POST"}),onSuccess:(n,r)=>{e.invalidateQueries({queryKey:["servers",r]}),e.invalidateQueries({queryKey:["worlds"]})}})}function b(){return(0,t.a)({queryKey:["router-status"],queryFn:()=>(0,l.SC)("/api/router/status"),refetchInterval:3e4})}function g(){return(0,t.a)({queryKey:["backup-status"],queryFn:()=>(0,l.SC)("/api/backup"),refetchInterval:6e4})}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(0,t.a)({queryKey:["backup-history",e],queryFn:()=>(0,l.SC)("/api/backup/history?limit=".concat(e)),refetchInterval:6e4})}function S(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>{let{message:n}=e;return(0,l.SC)("/api/backup",{method:"POST",body:JSON.stringify({message:n})})},onSuccess:()=>{e.invalidateQueries({queryKey:["backup-status"]}),e.invalidateQueries({queryKey:["backup-history"]})}})}function w(){let e=(0,a.NL)();return(0,s.D)({mutationFn:e=>(0,l.SC)("/api/backup/restore",{method:"POST",body:JSON.stringify({commitHash:e})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,7073,880,6857,8347,1658,5381,4474,787,7782,3669,2757,1744],function(){return e(e.s=31809)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[148],{61943:function(e,n,t){Promise.resolve().then(t.bind(t,34488))},34488:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return p}});var r=t(94655),i=t(7281),s=t(84840),o=t(31317),a=t(10721),u=t(81071),c=t(628),l=t(41565),d=t(69899),h=t(76492),x=t(29983),y=t(92666),f=t(11189);function v(e){let{rows:n}=e;return(0,r.jsx)(c.Z,{children:(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,r.jsx)(a.Z,{variant:"circular",width:24,height:24}),(0,r.jsx)(a.Z,{variant:"text",width:"50%",height:32})]}),[...Array(n)].map((e,n)=>(0,r.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,r.jsx)(a.Z,{variant:"text",width:"35%"}),(0,r.jsx)(a.Z,{variant:"text",width:"40%"})]},n))]})})}function m(){return(0,r.jsx)(c.Z,{sx:{height:"100%"},children:(0,r.jsxs)(l.Z,{children:[(0,r.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,r.jsx)(a.Z,{variant:"circular",width:24,height:24}),(0,r.jsx)(a.Z,{variant:"text",width:"40%",height:32}),(0,r.jsxs)(i.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,r.jsx)(a.Z,{variant:"rounded",width:70,height:24}),(0,r.jsx)(a.Z,{variant:"rounded",width:70,height:24})]})]}),(0,r.jsx)(a.Z,{variant:"text",width:"30%",sx:{mt:3,mb:1}}),[0,1].map(e=>(0,r.jsxs)(i.Z,{sx:{border:1,borderColor:"divider",p:2,"&:not(:last-child)":{borderBottom:0}},children:[(0,r.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,r.jsx)(a.Z,{variant:"circular",width:10,height:10}),(0,r.jsx)(a.Z,{variant:"text",width:"25%"}),(0,r.jsx)(a.Z,{variant:"text",width:"15%"}),(0,r.jsx)(a.Z,{variant:"text",width:"10%",sx:{ml:"auto"}})]}),[0,1,2].map(e=>(0,r.jsx)(a.Z,{variant:"text",width:"70%",sx:{ml:2.5}},e))]},e))]})})}function p(){let{data:e,isLoading:n,error:t}=(0,y.nv)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,h.Fq)(e.palette.warning.main,.1)," 0%, ").concat((0,h.Fq)(e.palette.info.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,h.Fq)(e.palette.warning.main,.2))},children:(0,r.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"warning.main",color:"warning.contrastText"},children:(0,r.jsx)(x.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(i.Z,{children:[(0,r.jsx)(o.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Routing"}),(0,r.jsx)(o.Z,{variant:"body1",color:"text.secondary",children:"Server routing and network configuration"})]})]})}),t&&(0,r.jsxs)(u.Z,{severity:"error",sx:{mb:3},children:["Failed to load router status: ",t.message]}),n?(0,r.jsxs)(s.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(s.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,r.jsx)(v,{rows:4}),(0,r.jsx)(v,{rows:4}),(0,r.jsx)(v,{rows:1})]})}),(0,r.jsx)(s.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(m,{})})]}):(null==e?void 0:e.router)?(0,r.jsxs)(s.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(s.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,r.jsx)(f.hI,{router:e.router}),(0,r.jsx)(f.SB,{router:e.router}),(0,r.jsx)(f.E4,{avahi:e.avahi})]})}),(0,r.jsx)(s.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(f.Ik,{router:e.router})})]}):null]})}},42936:function(e,n,t){"use strict";async function r(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={...n.headers};n.body&&(t["Content-Type"]="application/json");let r=await fetch(e,{...n,headers:t});if(!r.ok){let e=await r.json().catch(()=>({error:"UnknownError",message:r.statusText})),n=Error(e.message);throw n.statusCode=r.status,n.code=e.error,n}return r.json()}t.d(n,{SC:function(){return r}})},92666:function(e,n,t){"use strict";t.d(n,{$t:function(){return C},Aw:function(){return d},Fv:function(){return m},Hq:function(){return c},Hy:function(){return u},MH:function(){return j},Sr:function(){return x},_I:function(){return h},c5:function(){return Z},g2:function(){return v},gx:function(){return g},hy:function(){return y},iC:function(){return p},jM:function(){return l},mj:function(){return w},nq:function(){return f},nv:function(){return S},s8:function(){return q},x$:function(){return a}});var r=t(5632),i=t(58919),s=t(20367),o=t(42936);function a(){return(0,r.a)({queryKey:["servers"],queryFn:()=>(0,o.SC)("/api/servers"),refetchInterval:6e4})}function u(e,n){return(0,r.a)({queryKey:["servers",e],queryFn:()=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e))),enabled:(null==n?void 0:n.enabled)!==!1&&!!e,refetchInterval:3e4})}function c(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{name:n,force:t}=e;return(0,o.SC)("/api/servers/".concat(encodeURIComponent(n)).concat(t?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["servers"]})}})}function l(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/start"),{method:"POST"}),onSuccess:(n,t)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function d(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/stop"),{method:"POST"}),onSuccess:(n,t)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function h(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/restart"),{method:"POST"}),onSuccess:(n,t)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",t]})}})}function x(){return(0,r.a)({queryKey:["worlds"],queryFn:()=>(0,o.SC)("/api/worlds"),refetchInterval:3e4})}function y(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function f(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{worldName:n,serverName:t}=e;return(0,o.SC)("/api/worlds/".concat(encodeURIComponent(n),"/assign"),{method:"POST",body:JSON.stringify({serverName:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}function v(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{worldName:n,force:t}=e;return(0,o.SC)("/api/worlds/".concat(encodeURIComponent(n),"/release").concat(t?"?force=true":""),{method:"POST"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function m(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{name:n,force:t}=e;return(0,o.SC)("/api/worlds/".concat(encodeURIComponent(n)).concat(t?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function p(e,n){return(0,r.a)({queryKey:["servers",e,"config"],queryFn:()=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/config")),enabled:(null==n?void 0:n.enabled)!==!1&&!!e})}function j(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{serverName:n,config:t}=e;return(0,o.SC)("/api/servers/".concat(encodeURIComponent(n),"/config"),{method:"PATCH",body:JSON.stringify(t)})},onSuccess:(n,t)=>{let{serverName:r}=t;e.invalidateQueries({queryKey:["servers",r,"config"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function g(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/servers/".concat(encodeURIComponent(e),"/world/reset"),{method:"POST"}),onSuccess:(n,t)=>{e.invalidateQueries({queryKey:["servers",t]}),e.invalidateQueries({queryKey:["worlds"]})}})}function S(){return(0,r.a)({queryKey:["router-status"],queryFn:()=>(0,o.SC)("/api/router/status"),refetchInterval:3e4})}function w(){return(0,r.a)({queryKey:["backup-status"],queryFn:()=>(0,o.SC)("/api/backup"),refetchInterval:6e4})}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(0,r.a)({queryKey:["backup-history",e],queryFn:()=>(0,o.SC)("/api/backup/history?limit=".concat(e)),refetchInterval:6e4})}function Z(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>{let{message:n}=e;return(0,o.SC)("/api/backup",{method:"POST",body:JSON.stringify({message:n})})},onSuccess:()=>{e.invalidateQueries({queryKey:["backup-status"]}),e.invalidateQueries({queryKey:["backup-history"]})}})}function q(){let e=(0,i.NL)();return(0,s.D)({mutationFn:e=>(0,o.SC)("/api/backup/restore",{method:"POST",body:JSON.stringify({commitHash:e})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,9810,2542,7073,9654,5381,6571,1189,3669,2757,1744],function(){return e(e.s=61943)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3767],{32823:function(e,t,n){Promise.resolve().then(n.bind(n,32050))},32050:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var r=n(94655),s=n(35106),o=n(31358),l=n(7281),c=n(31317),i=n(26138),a=n(41261),u=n(79983),d=n(10117),h=n(73660);function p(e){let{params:t}=e,n=(0,o.x)(),{name:p}=(0,s.use)(t),m=decodeURIComponent(p);return(0,r.jsxs)(l.Z,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,r.jsxs)(l.Z,{sx:{mb:2},children:[(0,r.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,r.jsx)(u.Z,{onClick:()=>n.push("/servers/".concat(p)),size:"small","aria-label":"Back to server",children:(0,r.jsx)(d.Z,{})}),(0,r.jsxs)(i.Z,{"aria-label":"breadcrumb",children:[(0,r.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>n.push("/servers"),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:"Servers"}),(0,r.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>n.push("/servers/".concat(p)),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:m}),(0,r.jsx)(c.Z,{color:"text.primary",children:"Console"})]})]}),(0,r.jsxs)(c.Z,{variant:"h5",component:"h1",children:[m," Console"]})]}),(0,r.jsx)(l.Z,{sx:{flex:1,minHeight:0},children:(0,r.jsx)(h.K,{serverName:m})})]})}},3454:function(e,t,n){"use strict";n.d(t,{LoadingProvider:function(){return i},startLoading:function(){return a},stopLoading:function(){return u}});var r=n(94655),s=n(35106),o=n(74228),l=n(31477),c=n.n(l);function i(e){let{children:t}=e,n=(0,o.usePathname)(),l=(0,o.useSearchParams)();return(0,s.useEffect)(()=>{c().done()},[n,l]),(0,r.jsx)(r.Fragment,{children:t})}function a(){c().start()}function u(){c().done()}c().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,t,n){"use strict";n.d(t,{Av:function(){return r.startLoading}});var r=n(3454)},73660:function(e,t,n){"use strict";n.d(t,{K:function(){return w}});var r=n(94655),s=n(35106),o=n(18844),l=n.n(o),c=n(7281),i=n(69899),a=n(97436),u=n(30417),d=n(90829),h=n(79983),p=n(31317),m=n(25333),f=n(40064),x=n(45547),g=n(70115),v=n(69123),C=n(93017),b=n(11141),S=n(19127),y=n(69366),j=n(163);let R=[{label:"say",template:"say "},{label:"give",template:"give "},{label:"tp",template:"tp "},{label:"gamemode",template:"gamemode "}],Z=new(l())({fg:"#aaa",bg:"#000",newline:!1,escapeXML:!0,colors:{0:"#000000",1:"#cc0000",2:"#4e9a06",3:"#c4a000",4:"#3465a4",5:"#75507b",6:"#06989a",7:"#d3d7cf",8:"#555753",9:"#ef2929",10:"#8ae234",11:"#fce94f",12:"#729fcf",13:"#ad7fa8",14:"#34e2e2",15:"#eeeeec"}}),k=(0,s.memo)(function(e){let{log:t}=e,n=(0,s.useMemo)(()=>(function(e){let t=e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[KJH]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[KJH]/g,"").replace(/\[m/g,"").replace(/\[(\d+)m/g,"\x1b[$1m").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"");return Z.toHtml(t)})(t),[t]);return(0,r.jsx)(c.Z,{sx:{py:.25,whiteSpace:"pre-wrap",wordBreak:"break-all","& span":{}},dangerouslySetInnerHTML:{__html:n}})});function w(e){let{serverName:t}=e,[n,o]=(0,s.useState)(""),[l,Z]=(0,s.useState)([]),[w,E]=(0,s.useState)(-1),[N,O]=(0,s.useState)("ALL"),[T,A]=(0,s.useState)(!0),[I,L]=(0,s.useState)(!0),[z,D]=(0,s.useState)(!1),F=(0,s.useRef)(null),H=(0,s.useRef)(null),{logs:M,isConnected:_,clearLogs:P,reconnect:W,retryCount:K}=(0,j.Y)({serverName:t}),J=(0,s.useMemo)(()=>{let e=M;return I&&(e=e.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient"))),"ALL"!==N&&(e=e.filter(e=>(e.includes("/ERROR]")||e.includes("/ERROR:")?"ERROR":e.includes("/WARN]")||e.includes("/WARN:")?"WARN":(e.includes("/INFO]")||e.includes("/INFO:"),"INFO"))===N)),e},[M,N,I]);(0,s.useEffect)(()=>{T&&H.current&&(H.current.scrollTop=H.current.scrollHeight)},[J,T]);let U=(0,s.useCallback)(async()=>{let e=n.trim();if(e&&!z){D(!0);try{Z(t=>[...t,e]),E(-1),await fetch("/api/servers/".concat(encodeURIComponent(t),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})}),o("")}catch(e){console.error("Failed to execute command:",e)}finally{D(!1)}}},[n,t,z]),B=(0,s.useCallback)(e=>{if("Enter"===e.key)e.preventDefault(),U();else if("ArrowUp"===e.key){if(e.preventDefault(),0===l.length)return;let t=-1===w?l.length-1:Math.max(0,w-1);E(t),o(l[t])}else if("ArrowDown"===e.key){if(e.preventDefault(),-1===w)return;let t=w+1;t>=l.length?(E(-1),o("")):(E(t),o(l[t]))}},[l,w,U]),Y=(0,s.useCallback)(e=>{var t;o(e),null===(t=F.current)||void 0===t||t.focus()},[]),Q=_?{text:"Connected",color:"success"}:K>0?{text:"Disconnected (Retry ".concat(K,")"),color:"warning"}:{text:"Disconnected",color:"error"};return(0,r.jsxs)(i.Z,{"data-testid":"server-console",sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:400},children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[(0,r.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(p.Z,{variant:"subtitle2",children:"Console"}),(0,r.jsx)(m.Z,{"data-testid":"connection-status",label:Q.text,color:Q.color,size:"small"})]}),(0,r.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(d.Z,{size:"small",variant:"outlined",children:["ALL","INFO","WARN","ERROR"].map(e=>(0,r.jsx)(u.Z,{onClick:()=>O(e),variant:N===e?"contained":"outlined",children:e},e))}),(0,r.jsx)(f.Z,{control:(0,r.jsx)(x.Z,{checked:T,onChange:e=>A(e.target.checked),size:"small",inputProps:{"aria-label":"Auto-scroll"}}),label:"Auto-scroll"}),(0,r.jsx)(f.Z,{control:(0,r.jsx)(x.Z,{checked:I,onChange:e=>L(e.target.checked),size:"small",inputProps:{"aria-label":"Hide RCON"}}),label:"Hide RCON"}),(0,r.jsx)(h.Z,{size:"small",onClick:P,"aria-label":"Clear logs",title:"Clear logs",children:(0,r.jsx)(S.Z,{})}),!_&&(0,r.jsx)(u.Z,{size:"small",startIcon:(0,r.jsx)(y.Z,{}),onClick:W,"aria-label":"Reconnect",children:"Reconnect"})]})]}),(0,r.jsx)(c.Z,{ref:H,sx:{flex:1,overflow:"auto",bgcolor:"#1a1a1a",p:1,fontFamily:"monospace",fontSize:"0.85rem"},children:0===J.length?(0,r.jsx)(p.Z,{color:"text.secondary",sx:{textAlign:"center",py:4,color:"#666"},children:"Waiting for logs..."}):J.map((e,t)=>(0,r.jsx)(k,{log:e},t))}),(0,r.jsx)(v.Z,{}),(0,r.jsx)(c.Z,{sx:{px:2,py:1,bgcolor:"background.default"},children:(0,r.jsxs)(g.Z,{direction:"row",spacing:1,children:[(0,r.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{alignSelf:"center"},children:"Quick:"}),R.map(e=>(0,r.jsx)(u.Z,{size:"small",variant:"outlined",onClick:()=>Y(e.template),children:e.label},e.label))]})}),(0,r.jsx)(v.Z,{}),(0,r.jsxs)(c.Z,{sx:{display:"flex",p:1,gap:1},children:[(0,r.jsx)(a.Z,{inputRef:F,fullWidth:!0,size:"small",placeholder:"Enter command...",value:n,onChange:e=>o(e.target.value),onKeyDown:B,disabled:!_||z,InputProps:{sx:{fontFamily:"monospace"}}}),(0,r.jsx)(u.Z,{variant:"contained",onClick:U,disabled:!n.trim()||!_||z,startIcon:z?(0,r.jsx)(C.Z,{size:16}):(0,r.jsx)(b.Z,{}),"aria-label":"Send command",children:"Send"})]})]})}},31358:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(74228),s=n(35106),o=n(8690);function l(){let e=(0,r.useRouter)(),t=(0,s.useCallback)((t,n)=>{(0,o.Av)(),e.push(t,n)},[e]),n=(0,s.useCallback)((t,n)=>{(0,o.Av)(),e.replace(t,n)},[e]);return(0,s.useMemo)(()=>({...e,push:t,replace:n}),[e,t,n])}},93757:function(e,t,n){"use strict";n.d(t,{D:function(){return o}});var r=n(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,n;let r=JSON.parse(e.data);null===(n=this.options)||void 0===n||null===(t=n.onMessage)||void 0===t||t.call(n,r)}catch(e){console.warn("Failed to parse SSE message:",e)}},this.eventSource.onerror=()=>{var e,t;let n={message:"SSE connection error",code:"CONNECTION_ERROR",retryCount:this.retryCount,timestamp:new Date};this.lastError=n,this.updateState("error"),null===(t=this.options)||void 0===t||null===(e=t.onError)||void 0===e||e.call(t,n),this.shouldReconnect&&this.scheduleReconnect()})}scheduleReconnect(){var e,t;if(!this.options)return;let n=null!==(e=this.options.maxReconnectAttempts)&&void 0!==e?e:1/0;if(this.retryCount>=n)return;this.reconnectTimer&&clearTimeout(this.reconnectTimer);let r=null!==(t=this.options.reconnectInterval)&&void 0!==t?t:3e3;this.reconnectTimer=setTimeout(()=>{this.retryCount++,this.establishConnection()},r)}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,n;this.state=e,null===(n=this.options)||void 0===n||null===(t=n.onStateChange)||void 0===t||t.call(n,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:n,onError:o,reconnectInterval:l=3e3,maxReconnectAttempts:c=1/0,enabled:i=!0,withCredentials:a=!1}=e,[u,d]=(0,r.useState)(null),[h,p]=(0,r.useState)("disconnected"),[m,f]=(0,r.useState)(null),[x,g]=(0,r.useState)(0),v=(0,r.useRef)(null),C=(0,r.useCallback)(e=>{d(e),null==n||n(e)},[n]),b=(0,r.useCallback)(e=>{p(e),"connected"===e&&g(0)},[]),S=(0,r.useCallback)(e=>{f(e),"number"==typeof e.retryCount&&g(e.retryCount),null==o||o(e)},[o]),y=(0,r.useCallback)(()=>{v.current&&(v.current.reconnect(),g(v.current.getRetryCount()))},[]),j=(0,r.useCallback)(()=>{v.current&&v.current.disconnect()},[]);return(0,r.useEffect)(()=>{if(!i){v.current&&(v.current.disconnect(),v.current=null);return}return v.current||(v.current=new s),v.current.connect({url:t,onMessage:C,onStateChange:b,onError:S,reconnectInterval:l,maxReconnectAttempts:c,withCredentials:a}),()=>{v.current&&(v.current.disconnect(),v.current=null)}},[t,i,l,c,a,C,b,S]),{data:u,isConnected:"connected"===h,state:h,error:m,retryCount:x,reconnect:y,disconnect:j}}},163:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});var r=n(35106),s=n(93757);function o(e){let{serverName:t,maxLines:n=500,enabled:o=!0,reconnectInterval:l=3e3}=e,[c,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{i([])},[t]);let a=(0,r.useCallback)(e=>{let t;"server-log"===e.type?t=e.data.log:"log"in e&&"string"==typeof e.log&&(t=e.log),t&&i(e=>{let r=[...e,t];return r.length>n?r.slice(r.length-n):r})},[n]),{isConnected:u,reconnect:d,retryCount:h}=(0,s.D)({url:"/api/sse/servers/".concat(encodeURIComponent(t),"/logs"),onMessage:a,enabled:o,reconnectInterval:l});return{logs:c,isConnected:u,clearLogs:(0,r.useCallback)(()=>{i([])},[]),reconnect:d,retryCount:h}}}},function(e){e.O(0,[6812,7220,8006,7294,8696,4538,6645,1476,3669,2757,1744],function(){return e(e.s=32823)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3767],{32823:function(e,t,n){Promise.resolve().then(n.bind(n,32050))},32050:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var r=n(94655),s=n(35106),o=n(31358),l=n(7281),c=n(31317),i=n(26138),a=n(41261),u=n(79983),d=n(10117),h=n(73660);function p(e){let{params:t}=e,n=(0,o.x)(),{name:p}=(0,s.use)(t),m=decodeURIComponent(p);return(0,r.jsxs)(l.Z,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,r.jsxs)(l.Z,{sx:{mb:2},children:[(0,r.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,r.jsx)(u.Z,{onClick:()=>n.push("/servers/".concat(p)),size:"small","aria-label":"Back to server",children:(0,r.jsx)(d.Z,{})}),(0,r.jsxs)(i.Z,{"aria-label":"breadcrumb",children:[(0,r.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>n.push("/servers"),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:"Servers"}),(0,r.jsx)(a.Z,{component:"button",variant:"body1",onClick:()=>n.push("/servers/".concat(p)),sx:{cursor:"pointer"},underline:"hover",color:"inherit",children:m}),(0,r.jsx)(c.Z,{color:"text.primary",children:"Console"})]})]}),(0,r.jsxs)(c.Z,{variant:"h5",component:"h1",children:[m," Console"]})]}),(0,r.jsx)(l.Z,{sx:{flex:1,minHeight:0},children:(0,r.jsx)(h.K,{serverName:m})})]})}},3454:function(e,t,n){"use strict";n.d(t,{LoadingProvider:function(){return i},startLoading:function(){return a},stopLoading:function(){return u}});var r=n(94655),s=n(35106),o=n(74228),l=n(31477),c=n.n(l);function i(e){let{children:t}=e,n=(0,o.usePathname)(),l=(0,o.useSearchParams)();return(0,s.useEffect)(()=>{c().done()},[n,l]),(0,r.jsx)(r.Fragment,{children:t})}function a(){c().start()}function u(){c().done()}c().configure({showSpinner:!1,speed:300,minimum:.1})},8690:function(e,t,n){"use strict";n.d(t,{Av:function(){return r.startLoading}});var r=n(3454)},73660:function(e,t,n){"use strict";n.d(t,{K:function(){return w}});var r=n(94655),s=n(35106),o=n(18844),l=n.n(o),c=n(7281),i=n(69899),a=n(97436),u=n(30417),d=n(90829),h=n(79983),p=n(31317),m=n(25333),f=n(40064),x=n(45547),g=n(70115),v=n(69123),C=n(93017),b=n(11141),S=n(19127),y=n(69366),j=n(163);let R=[{label:"say",template:"say "},{label:"give",template:"give "},{label:"tp",template:"tp "},{label:"gamemode",template:"gamemode "}],Z=new(l())({fg:"#aaa",bg:"#000",newline:!1,escapeXML:!0,colors:{0:"#000000",1:"#cc0000",2:"#4e9a06",3:"#c4a000",4:"#3465a4",5:"#75507b",6:"#06989a",7:"#d3d7cf",8:"#555753",9:"#ef2929",10:"#8ae234",11:"#fce94f",12:"#729fcf",13:"#ad7fa8",14:"#34e2e2",15:"#eeeeec"}}),k=(0,s.memo)(function(e){let{log:t}=e,n=(0,s.useMemo)(()=>(function(e){let t=e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[KJH]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[KJH]/g,"").replace(/\[m/g,"").replace(/\[(\d+)m/g,"\x1b[$1m").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"");return Z.toHtml(t)})(t),[t]);return(0,r.jsx)(c.Z,{sx:{py:.25,whiteSpace:"pre-wrap",wordBreak:"break-all","& span":{}},dangerouslySetInnerHTML:{__html:n}})});function w(e){let{serverName:t}=e,[n,o]=(0,s.useState)(""),[l,Z]=(0,s.useState)([]),[w,E]=(0,s.useState)(-1),[N,O]=(0,s.useState)("ALL"),[T,A]=(0,s.useState)(!0),[I,L]=(0,s.useState)(!0),[z,D]=(0,s.useState)(!1),F=(0,s.useRef)(null),H=(0,s.useRef)(null),{logs:M,isConnected:_,clearLogs:P,reconnect:W,retryCount:K}=(0,j.Y)({serverName:t}),J=(0,s.useMemo)(()=>{let e=M;return I&&(e=e.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient"))),"ALL"!==N&&(e=e.filter(e=>(e.includes("/ERROR]")||e.includes("/ERROR:")?"ERROR":e.includes("/WARN]")||e.includes("/WARN:")?"WARN":(e.includes("/INFO]")||e.includes("/INFO:"),"INFO"))===N)),e},[M,N,I]);(0,s.useEffect)(()=>{T&&H.current&&(H.current.scrollTop=H.current.scrollHeight)},[J,T]);let U=(0,s.useCallback)(async()=>{let e=n.trim();if(e&&!z){D(!0);try{Z(t=>[...t,e]),E(-1),await fetch("/api/servers/".concat(encodeURIComponent(t),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})}),o("")}catch(e){console.error("Failed to execute command:",e)}finally{D(!1)}}},[n,t,z]),B=(0,s.useCallback)(e=>{if("Enter"===e.key)e.preventDefault(),U();else if("ArrowUp"===e.key){if(e.preventDefault(),0===l.length)return;let t=-1===w?l.length-1:Math.max(0,w-1);E(t),o(l[t])}else if("ArrowDown"===e.key){if(e.preventDefault(),-1===w)return;let t=w+1;t>=l.length?(E(-1),o("")):(E(t),o(l[t]))}},[l,w,U]),Y=(0,s.useCallback)(e=>{var t;o(e),null===(t=F.current)||void 0===t||t.focus()},[]),Q=_?{text:"Connected",color:"success"}:K>0?{text:"Disconnected (Retry ".concat(K,")"),color:"warning"}:{text:"Disconnected",color:"error"};return(0,r.jsxs)(i.Z,{"data-testid":"server-console",sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:400},children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[(0,r.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(p.Z,{variant:"subtitle2",children:"Console"}),(0,r.jsx)(m.Z,{"data-testid":"connection-status",label:Q.text,color:Q.color,size:"small"})]}),(0,r.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(d.Z,{size:"small",variant:"outlined",children:["ALL","INFO","WARN","ERROR"].map(e=>(0,r.jsx)(u.Z,{onClick:()=>O(e),variant:N===e?"contained":"outlined",children:e},e))}),(0,r.jsx)(f.Z,{control:(0,r.jsx)(x.Z,{checked:T,onChange:e=>A(e.target.checked),size:"small",inputProps:{"aria-label":"Auto-scroll"}}),label:"Auto-scroll"}),(0,r.jsx)(f.Z,{control:(0,r.jsx)(x.Z,{checked:I,onChange:e=>L(e.target.checked),size:"small",inputProps:{"aria-label":"Hide RCON"}}),label:"Hide RCON"}),(0,r.jsx)(h.Z,{size:"small",onClick:P,"aria-label":"Clear logs",title:"Clear logs",children:(0,r.jsx)(S.Z,{})}),!_&&(0,r.jsx)(u.Z,{size:"small",startIcon:(0,r.jsx)(y.Z,{}),onClick:W,"aria-label":"Reconnect",children:"Reconnect"})]})]}),(0,r.jsx)(c.Z,{ref:H,sx:{flex:1,overflow:"auto",bgcolor:"#1a1a1a",p:1,fontFamily:"monospace",fontSize:"0.85rem"},children:0===J.length?(0,r.jsx)(p.Z,{color:"text.secondary",sx:{textAlign:"center",py:4,color:"#666"},children:"Waiting for logs..."}):J.map((e,t)=>(0,r.jsx)(k,{log:e},t))}),(0,r.jsx)(v.Z,{}),(0,r.jsx)(c.Z,{sx:{px:2,py:1,bgcolor:"background.default"},children:(0,r.jsxs)(g.Z,{direction:"row",spacing:1,children:[(0,r.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{alignSelf:"center"},children:"Quick:"}),R.map(e=>(0,r.jsx)(u.Z,{size:"small",variant:"outlined",onClick:()=>Y(e.template),children:e.label},e.label))]})}),(0,r.jsx)(v.Z,{}),(0,r.jsxs)(c.Z,{sx:{display:"flex",p:1,gap:1},children:[(0,r.jsx)(a.Z,{inputRef:F,fullWidth:!0,size:"small",placeholder:"Enter command...",value:n,onChange:e=>o(e.target.value),onKeyDown:B,disabled:!_||z,InputProps:{sx:{fontFamily:"monospace"}}}),(0,r.jsx)(u.Z,{variant:"contained",onClick:U,disabled:!n.trim()||!_||z,startIcon:z?(0,r.jsx)(C.Z,{size:16}):(0,r.jsx)(b.Z,{}),"aria-label":"Send command",children:"Send"})]})]})}},31358:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(74228),s=n(35106),o=n(8690);function l(){let e=(0,r.useRouter)(),t=(0,s.useCallback)((t,n)=>{(0,o.Av)(),e.push(t,n)},[e]),n=(0,s.useCallback)((t,n)=>{(0,o.Av)(),e.replace(t,n)},[e]);return(0,s.useMemo)(()=>({...e,push:t,replace:n}),[e,t,n])}},93757:function(e,t,n){"use strict";n.d(t,{D:function(){return o}});var r=n(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,n;let r=JSON.parse(e.data);null===(n=this.options)||void 0===n||null===(t=n.onMessage)||void 0===t||t.call(n,r)}catch(e){console.warn("Failed to parse SSE message:",e)}},this.eventSource.onerror=()=>{var e,t;let n={message:"SSE connection error",code:"CONNECTION_ERROR",retryCount:this.retryCount,timestamp:new Date};this.lastError=n,this.updateState("error"),null===(t=this.options)||void 0===t||null===(e=t.onError)||void 0===e||e.call(t,n),this.shouldReconnect&&this.scheduleReconnect()})}scheduleReconnect(){var e,t;if(!this.options)return;let n=null!==(e=this.options.maxReconnectAttempts)&&void 0!==e?e:1/0;if(this.retryCount>=n)return;this.reconnectTimer&&clearTimeout(this.reconnectTimer);let r=null!==(t=this.options.reconnectInterval)&&void 0!==t?t:3e3;this.reconnectTimer=setTimeout(()=>{this.retryCount++,this.establishConnection()},r)}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,n;this.state=e,null===(n=this.options)||void 0===n||null===(t=n.onStateChange)||void 0===t||t.call(n,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:n,onError:o,reconnectInterval:l=3e3,maxReconnectAttempts:c=1/0,enabled:i=!0,withCredentials:a=!1}=e,[u,d]=(0,r.useState)(null),[h,p]=(0,r.useState)("disconnected"),[m,f]=(0,r.useState)(null),[x,g]=(0,r.useState)(0),v=(0,r.useRef)(null),C=(0,r.useCallback)(e=>{d(e),null==n||n(e)},[n]),b=(0,r.useCallback)(e=>{p(e),"connected"===e&&g(0)},[]),S=(0,r.useCallback)(e=>{f(e),"number"==typeof e.retryCount&&g(e.retryCount),null==o||o(e)},[o]),y=(0,r.useCallback)(()=>{v.current&&(v.current.reconnect(),g(v.current.getRetryCount()))},[]),j=(0,r.useCallback)(()=>{v.current&&v.current.disconnect()},[]);return(0,r.useEffect)(()=>{if(!i){v.current&&(v.current.disconnect(),v.current=null);return}return v.current||(v.current=new s),v.current.connect({url:t,onMessage:C,onStateChange:b,onError:S,reconnectInterval:l,maxReconnectAttempts:c,withCredentials:a}),()=>{v.current&&(v.current.disconnect(),v.current=null)}},[t,i,l,c,a,C,b,S]),{data:u,isConnected:"connected"===h,state:h,error:m,retryCount:x,reconnect:y,disconnect:j}}},163:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});var r=n(35106),s=n(93757);function o(e){let{serverName:t,maxLines:n=500,enabled:o=!0,reconnectInterval:l=3e3}=e,[c,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{i([])},[t]);let a=(0,r.useCallback)(e=>{let t;"server-log"===e.type?t=e.data.log:"log"in e&&"string"==typeof e.log&&(t=e.log),t&&i(e=>{let r=[...e,t];return r.length>n?r.slice(r.length-n):r})},[n]),{isConnected:u,reconnect:d,retryCount:h}=(0,s.D)({url:"/api/sse/servers/".concat(encodeURIComponent(t),"/logs"),onMessage:a,enabled:o,reconnectInterval:l});return{logs:c,isConnected:u,clearLogs:(0,r.useCallback)(()=>{i([])},[]),reconnect:d,retryCount:h}}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1658,6727,6357,5375,3669,2757,1744],function(){return e(e.s=32823)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[278],{59616:function(e,r,s){Promise.resolve().then(s.bind(s,41517))},41517:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return eL}});var t=s(94655),n=s(35106),i=s(74228),a=s(31358),l=s(7281),o=s(30417),d=s(79983),c=s(81071),x=s(93017),h=s(10721),u=s(628),m=s(41565),p=s(31317),j=s(35694),g=s(7178),v=s(17820),Z=s(73424),f=s(99770),b=s(62508),y=s(5682),C=s(76678),w=s(97436),S=s(84840),R=s(76492),k=s(10117),I=s(5501),P=s(37809),z=s(21111),W=s(17978),F=s(89573),O=s(96292),A=s(33104),M=s(25333),T=s(52082),D=s(69123),E=s(71185),B=s(30165),N=s(97293),U=s(11259),L=s(66615),H=s(89161),q=s(34071),K=s(4405);function G(e){let{value:r,unit:s,label:n,icon:i,progress:a,progressMax:o,color:d="#1bd96a"}=e;return(0,t.jsxs)(u.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,t.jsxs)(l.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)(l.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/o*100,100),sx:{mt:1,height:6,borderRadius:1.5,bgcolor:"#2a2d3a","& .MuiLinearProgress-bar":{borderRadius:1.5,background:"linear-gradient(90deg, ".concat(d," 0%, ").concat(d,"cc 100%)")}}})]})}var _=s(163),J=s(73660),V=s(90158),Q=s(58347),Y=s(95511),$=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)(l.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:60,height:24}),(0,t.jsx)(h.Z,{variant:"text",width:"60%"}),(0,t.jsx)(h.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)(l.Z,{children:[(0,t.jsx)(V.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)(l.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)(Y.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)(l.Z,{sx:{mt:2,textAlign:"center"},children:(0,t.jsx)(o.Z,{component:$.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),el=s(40064),eo=s(38393),ed=s(37530),ec=s(5942),ex=s(84420),eh=s(46121),eu=s(84775),em=s(92666);function ep(e){var r,s;let{serverName:i,isRunning:a}=e,{data:d,isLoading:h}=(0,em.iC)(i),j=(0,em.MH)(),v=(0,em.gx)(),[Z,R]=(0,n.useState)({}),[k,I]=(0,n.useState)(!1),[P,z]=(0,n.useState)(!1),[W,F]=(0,n.useState)(!1),[O,A]=(0,n.useState)(""),[M,T]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==d?void 0:d.config)&&R(d.config)},[d]);let E=(e,r)=>{R(s=>({...s,[e]:r})),I(!0),("memory"===e||"useAikarFlags"===e)&&z(!0)},B=async()=>{try{let e=await j.mutateAsync({serverName:i,config:Z});T({open:!0,message:e.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:e.restartRequired?"warning":"success"}),I(!1),z(!1)}catch(e){T({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}},N=async()=>{if("RESET"!==O){T({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await v.mutateAsync(i),T({open:!0,message:"World reset successfully",severity:"success"}),F(!1),A("")}catch(e){T({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return h?(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,t.jsx)(x.Z,{})}):(0,t.jsxs)(l.Z,{children:[P&&(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)(u.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)(D.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=>E("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=>E("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=>E("difficulty",e.target.value),children:[(0,t.jsx)(g.Z,{value:"peaceful",children:"Peaceful"}),(0,t.jsx)(g.Z,{value:"easy",children:"Easy"}),(0,t.jsx)(g.Z,{value:"normal",children:"Normal"}),(0,t.jsx)(g.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=>E("gameMode",e.target.value),children:[(0,t.jsx)(g.Z,{value:"survival",children:"Survival"}),(0,t.jsx)(g.Z,{value:"creative",children:"Creative"}),(0,t.jsx)(g.Z,{value:"adventure",children:"Adventure"}),(0,t.jsx)(g.Z,{value:"spectator",children:"Spectator"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(el.Z,{control:(0,t.jsx)(eo.Z,{checked:null===(r=Z.pvp)||void 0===r||r,onChange:e=>E("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=>E("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=>E("spawnProtection",parseInt(e.target.value,10)),inputProps:{min:0,max:128}})})]})]})}),(0,t.jsx)(u.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)(D.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=>E("memory",e.target.value),helperText:"Format: 4G, 8G, etc."})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(el.Z,{control:(0,t.jsx)(eo.Z,{checked:null!==(s=Z.useAikarFlags)&&void 0!==s&&s,onChange:e=>E("useAikarFlags",e.target.checked)}),label:"Use Aikar's Flags (Optimized GC)"})})]})]})}),(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end",mb:3},children:(0,t.jsx)(o.Z,{variant:"contained",size:"large",startIcon:(0,t.jsx)(ec.Z,{}),onClick:B,disabled:!k||j.isPending,sx:{px:4},children:j.isPending?"Saving...":"Save Changes"})}),(0,t.jsx)(u.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)(D.Z,{sx:{mb:3}}),(0,t.jsxs)(l.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)(o.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)(eu.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)(f.Z,{open:W,onClose:()=>F(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(b.Z,{children:(0,t.jsxs)(l.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)(y.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:O,onChange:e=>A(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(o.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(o.Z,{variant:"contained",color:"error",onClick:N,disabled:"RESET"!==O||v.isPending,startIcon:v.isPending?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eh.Z,{}),children:v.isPending?"Resetting...":"Reset World"})]})]}),(0,t.jsx)(ed.Z,{open:M.open,autoHideDuration:6e3,onClose:()=>T({...M,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>T({...M,open:!1}),severity:M.severity,sx:{width:"100%"},children:M.message})})]})}var ej=s(86702),eg=s(47606),ev=s(407),eZ=s(56056),ef=s(28058),eb=s(11597),ey=s(59602);let eC={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function ew(e){let{permission:r,size:s="medium"}=e,n=eC[r];return(0,t.jsx)(M.Z,{label:n.label,color:n.color,variant:n.variant,size:s})}var eS=s(99046),eR=s(68038),ek=s(34080),eI=s(39181),eP=s(5632),ez=s(58919),eW=s(20367),eF=s(42936);function eO(e){var r,s;let{open:i,onClose:a,serverId:d}=e,[h,u]=(0,n.useState)(""),[m,j]=(0,n.useState)(null),[g,v]=(0,n.useState)("view"),{data:Z,isLoading:S}=(s={enabled:i},(0,eP.a)({queryKey:["users","search",h],queryFn:()=>(0,eF.SC)("/api/users?q=".concat(encodeURIComponent(h))),enabled:(null==s?void 0:s.enabled)!==!1&&h.length>=2,staleTime:3e4})),R=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>(0,eF.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"]})}})}(),k=(0,n.useMemo)(()=>{var e;return null!==(e=null==Z?void 0:Z.users)&&void 0!==e?e:[]},[Z]),I=()=>{u(""),j(null),v("view"),R.reset(),a()};return(0,t.jsxs)(f.Z,{open:i,onClose:I,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,t.jsx)(b.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,t.jsxs)(y.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[R.isError&&(0,t.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(r=R.error)||void 0===r?void 0:r.message)||"Failed to grant access"}),(0,t.jsx)(eS.Z,{options:k,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,r)=>e.id===r.id,value:m,onChange:(e,r)=>j(r),inputValue:h,onInputChange:(e,r)=>u(r),loading:S,filterOptions:e=>e,noOptionsText:h.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,...o}=e;return(0,t.jsxs)(l.Z,{component:"li",...o,sx:{display:"flex",gap:1.5,py:1},children:[(0,t.jsx)(ej.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)(l.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)(eR.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,t.jsxs)(ek.Z,{value:g,onChange:e=>v(e.target.value),children:[(0,t.jsx)(el.Z,{value:"view",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.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)(el.Z,{value:"manage",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.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)(el.Z,{value:"admin",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.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)(o.Z,{onClick:I,color:"inherit",children:"Cancel"}),(0,t.jsx)(o.Z,{onClick:()=>{m&&R.mutate({userId:m.id,serverId:d,permission:g},{onSuccess:I})},variant:"contained",disabled:!m||R.isPending,sx:{borderRadius:2},children:R.isPending?"Adding...":"Add User"})]})]})}function eA(e){var r,s;let{serverId:i}=e,{data:a,isLoading:x,error:f}=(0,eP.a)({queryKey:["user-servers",i],queryFn:()=>(0,eF.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),b=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>{let{id:r,permission:s}=e;return(0,eF.SC)("/api/user-servers/".concat(encodeURIComponent(r)),{method:"PATCH",body:JSON.stringify({permission:s})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),y=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>(0,eF.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[C,w]=(0,n.useState)(!1),[S,R]=(0,n.useState)(null),[k,I]=(0,n.useState)(null),z=(e,r)=>{R(e.currentTarget),I(r)},W=()=>{R(null),I(null)},F=e=>{if(!k||k.permission===e){W();return}b.mutate({id:k.id,permission:e},{onSettled:W})},O=null!==(r=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==r?r:0,A=(null==k?void 0:k.permission)==="admin"&&O<=1;if(x)return(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%",height:32}),(0,t.jsx)(h.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,t.jsx)(D.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,t.jsx)(h.Z,{variant:"circular",width:40,height:40}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"40%"}),(0,t.jsx)(h.Z,{variant:"text",width:"60%"})]}),(0,t.jsx)(h.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,t.jsx)(h.Z,{variant:"circular",width:32,height:32})]},e))]})});if(f)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",f.message]});let M=null!==(s=null==a?void 0:a.users)&&void 0!==s?s:[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.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)(o.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(eg.Z,{}),onClick:()=>w(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,t.jsx)(D.Z,{sx:{mb:1}}),0===M.length?(0,t.jsx)(l.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."})}):M.map(e=>{var r,s,n,i,a,o,c,x;return(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,t.jsx)(ej.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)(l.Z,{sx:{flex:1,minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(o=e.user)||void 0===o?void 0:o.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)(ew,{permission:e.permission,size:"small"}),(0,t.jsx)(d.Z,{size:"small",onClick:r=>z(r,e),sx:{color:"text.secondary"},children:(0,t.jsx)(P.Z,{fontSize:"small"})})]},e.id)}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,t.jsx)(ey.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)(j.Z,{anchorEl:S,open:!!S,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,t.jsxs)(g.Z,{onClick:()=>F("admin"),disabled:(null==k?void 0:k.permission)==="admin",children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(ev.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Owner"})]}),(0,t.jsxs)(g.Z,{onClick:()=>F("manage"),disabled:(null==k?void 0:k.permission)==="manage"||A,children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(eZ.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Operator"})]}),(0,t.jsxs)(g.Z,{onClick:()=>F("view"),disabled:(null==k?void 0:k.permission)==="view"||A,children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(ef.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Viewer"})]}),(0,t.jsx)(D.Z,{}),(0,t.jsxs)(g.Z,{onClick:()=>{k&&y.mutate(k.id,{onSettled:W})},disabled:A,sx:{color:"error.main"},children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(eb.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Remove Access"})]})]}),(0,t.jsx)(eO,{open:C,onClose:()=>w(!1),serverId:i})]})}let eM=["Overview","Activity","Content","Files","Backups","Access","Options"];function eT(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 eD(e){var r,s,i,a,c;let{server:x,onSendCommand:h}=e,[j,g]=(0,n.useState)("Overview"),[v,Z]=(0,n.useState)(""),[b,C]=(0,n.useState)(!0),[k,I]=(0,n.useState)(!1),P=(0,n.useRef)(null),{logs:z,isConnected:W}=(0,_.Y)({serverName:x.name}),F=(0,n.useMemo)(()=>z.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[z]);(0,n.useEffect)(()=>{P.current&&b&&(P.current.scrollTop=P.current.scrollHeight)},[F,b]);let O=async()=>{v.trim()&&h&&(await h(v.trim()),Z(""))},A=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)(l.Z,{children:[(0,t.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:eM.map(e=>(0,t.jsx)(o.Z,{onClick:()=>g(e),sx:{px:2,py:1,borderRadius:5,fontSize:14,fontWeight:500,textTransform:"none",bgcolor:j===e?"primary.main":"transparent",color:j===e?"#0a0e14":"text.secondary","&:hover":{bgcolor:j===e?"primary.main":(0,R.Fq)("#1bd96a",.1)}},children:e},e))}),(0,t.jsxs)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,t.jsx)(G,{value:"".concat(A.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,t.jsx)(B.Z,{sx:{fontSize:28}}),progress:A,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)(u.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,t.jsxs)(l.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)(l.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)(l.Z,{sx:{position:"relative"},children:[(0,t.jsx)(l.Z,{ref:P,onScroll:()=>{if(!P.current)return;let{scrollTop:e,scrollHeight:r,clientHeight:s}=P.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=eT(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)(l.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,t.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",s.time,"]"]}),(0,t.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",s.thread,"/",(0,t.jsx)(l.Z,{component:"span",sx:{color:"WARN"===s.level?"#e8a848":"#6b6e80"},children:s.level}),"]:\xa0"]}),(0,t.jsx)(l.Z,{component:"span",sx:{color:"WARN"===s.level?"#c4a45a":"#b4b6c4"},children:s.msg})]},r):(0,t.jsx)(l.Z,{sx:{color:"#b4b6c4"},children:eT(e)},r)})}),(0,t.jsx)(d.Z,{onClick:()=>I(!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)(L.Z,{sx:{fontSize:18}})}),!b&&(0,t.jsx)(d.Z,{onClick:()=>{P.current&&P.current.scrollTo({top:P.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)(H.Z,{sx:{fontSize:18}})})]}),(0,t.jsx)(l.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:v,onChange:e=>Z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),O())},disabled:!W,InputProps:{startAdornment:(0,t.jsx)(T.Z,{position:"start",children:(0,t.jsx)(q.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"===j&&(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)(u.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)(D.Z,{sx:{mb:2}}),(0,t.jsx)(eE,{label:"Name",value:x.name}),(0,t.jsx)(eE,{label:"Container",value:x.container}),(0,t.jsx)(eE,{label:"Hostname",value:x.hostname}),(0,t.jsx)(eE,{label:"Type",value:x.type}),(0,t.jsx)(eE,{label:"Version",value:x.version}),(0,t.jsx)(eE,{label:"Memory",value:x.memory}),(0,t.jsx)(eE,{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)(u.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)(D.Z,{sx:{mb:2}}),x.players?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eE,{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)(l.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.list.map(e=>(0,t.jsx)(M.Z,{label:e,size:"small"},e))})]})]}):(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})})]}),"Activity"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(u.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)(D.Z,{sx:{mb:2}}),(0,t.jsx)(et,{serverName:x.name})]})})}),"Content"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Content management coming soon"})}),"Files"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(eA,{serverId:x.name})}),"Options"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(ep,{serverName:x.name,isRunning:"running"===x.status})}),(0,t.jsxs)(f.Z,{open:k,onClose:()=>I(!1),maxWidth:"xl",fullWidth:!0,PaperProps:{sx:{height:"90vh",bgcolor:"background.paper"}},children:[(0,t.jsxs)(l.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:()=>I(!1),children:(0,t.jsx)(E.Z,{})})]}),(0,t.jsx)(y.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(J.K,{serverName:x.name})})]})]})}function eE(e){let{label:r,value:s}=e;return s?(0,t.jsxs)(l.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 eB=s(93757);function eN(){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 eU(){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 eL(){var e,r,s,M;let T=(0,i.useParams)(),D=(0,a.x)(),E=decodeURIComponent(T.name),{data:B,isLoading:N,error:U}=(0,em.Hy)(E),{status:L,health:H}=function(e){let{serverName:r,onStatusChange:s,enabled:t=!0,reconnectInterval:i=3e3}=e,[a,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{l(null),d(null)},[r]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let r=e.data.status,t=e.data.health;l(r),d(t),null==s||s(r,t)}},[s]),{isConnected:x,reconnect:h,retryCount:u}=(0,eB.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/status"),onMessage:c,enabled:t,reconnectInterval:i});return{status:a,health:o,isConnected:x,reconnect:h,retryCount:u}}({serverName:E,enabled:!!E}),[q,K]=(0,n.useState)(null),[G,_]=(0,n.useState)(!1),[J,V]=(0,n.useState)(""),Q=(0,em.jM)(),Y=(0,em.Aw)(),$=(0,em._I)(),X=(0,em.Hq)(),ee=async()=>{try{await Q.mutateAsync(E)}catch(e){console.error("Failed to start server:",e)}},er=async()=>{try{await Y.mutateAsync(E)}catch(e){console.error("Failed to stop server:",e)}},es=async()=>{try{await $.mutateAsync(E)}catch(e){console.error("Failed to restart server:",e)}},et=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(E),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=L||(null==B?void 0:B.server.status),ei=Q.isPending||Y.isPending||$.isPending,ea=null==B?void 0:B.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]}),Y.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(r=Y.error)||void 0===r?void 0:r.message]}),$.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(s=$.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===(M=X.error)||void 0===M?void 0:M.message]}),N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,t.jsx)(h.Z,{variant:"text",width:"40%",height:40}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,t.jsx)(h.Z,{variant:"text",width:100}),(0,t.jsx)(h.Z,{variant:"text",width:60}),(0,t.jsx)(h.Z,{variant:"text",width:140}),(0,t.jsx)(h.Z,{variant:"text",width:50})]})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,t.jsx)(h.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,t.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,r)=>(0,t.jsx)(h.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},r))}),(0,t.jsx)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,t.jsx)(h.Z,{variant:"text",width:"50%"}),(0,t.jsx)(h.Z,{variant:"circular",width:28,height:28})]}),(0,t.jsx)(h.Z,{variant:"text",width:"60%",height:36}),(0,t.jsx)(h.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,t.jsxs)(u.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,t.jsxs)(l.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(h.Z,{variant:"text",width:80,height:28}),(0,t.jsx)(h.Z,{variant:"circular",width:10,height:10})]}),(0,t.jsx)(h.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,t.jsx)(l.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(h.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)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(h.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(h.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%"}),(0,t.jsx)(h.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,t.jsx)(h.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"25%"}),(0,t.jsx)(h.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(l.Z,{sx:{width:64,height:64,borderRadius:3,overflow:"hidden",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"1px solid",borderColor:"divider",fontSize:36},children:function(e){if(!e)return"\uD83C\uDFAE";let 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)(l.Z,{sx:{flex:1},children:[(0,t.jsxs)(p.Z,{onClick:()=>D.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)(k.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:E}),(0,t.jsxs)(l.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)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(W.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(F.Z,{sx:{fontSize:14}}),ea.type]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(O.Z,{sx:{fontSize:14}}),ea.hostname]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(A.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)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,t.jsx)(o.Z,{variant:"contained",color:"success",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(I.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)(o.Z,{variant:"outlined",startIcon:ei?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eN,{}),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,R.Fq)("#fff",.05)}},children:"Stop"}),(0,t.jsx)(o.Z,{variant:"contained",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(eU,{}),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)(P.Z,{sx:{fontSize:18}})}),(0,t.jsx)(j.Z,{anchorEl:q,open:!!q,onClose:()=>K(null),children:(0,t.jsxs)(g.Z,{onClick:()=>{K(null),_(!0),V("")},sx:{color:"error.main"},children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(z.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Delete Server"})]})})]})]}),(0,t.jsx)(eD,{server:ea,onSendCommand:et})]}):(0,t.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,t.jsxs)(f.Z,{open:G,onClose:()=>{_(!1),V("")},maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(b.Z,{children:"Delete Server"}),(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(p.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,t.jsx)("strong",{children:E})," to confirm deletion."]}),(0,t.jsx)(w.Z,{label:"Server name",value:J,onChange:e=>V(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(o.Z,{onClick:()=>{_(!1),V("")},children:"Cancel"}),(0,t.jsx)(o.Z,{variant:"contained",color:"error",onClick:()=>{J===E&&X.mutate({name:E,force:!0},{onSuccess:()=>{D.push("/servers")}})},disabled:J!==E||X.isPending,startIcon:X.isPending?(0,t.jsx)(x.Z,{size:16}):null,children:X.isPending?"Deleting...":"Delete"})]})]})]})}},73660:function(e,r,s){"use strict";s.d(r,{K:function(){return k}});var t=s(94655),n=s(35106),i=s(18844),a=s.n(i),l=s(7281),o=s(69899),d=s(97436),c=s(30417),x=s(90829),h=s(79983),u=s(31317),m=s(25333),p=s(40064),j=s(45547),g=s(70115),v=s(69123),Z=s(93017),f=s(11141),b=s(19127),y=s(69366),C=s(163);let w=[{label:"say",template:"say "},{label:"give",template:"give "},{label:"tp",template:"tp "},{label:"gamemode",template:"gamemode "}],S=new(a())({fg:"#aaa",bg:"#000",newline:!1,escapeXML:!0,colors:{0:"#000000",1:"#cc0000",2:"#4e9a06",3:"#c4a000",4:"#3465a4",5:"#75507b",6:"#06989a",7:"#d3d7cf",8:"#555753",9:"#ef2929",10:"#8ae234",11:"#fce94f",12:"#729fcf",13:"#ad7fa8",14:"#34e2e2",15:"#eeeeec"}}),R=(0,n.memo)(function(e){let{log:r}=e,s=(0,n.useMemo)(()=>(function(e){let r=e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[KJH]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[KJH]/g,"").replace(/\[m/g,"").replace(/\[(\d+)m/g,"\x1b[$1m").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"");return S.toHtml(r)})(r),[r]);return(0,t.jsx)(l.Z,{sx:{py:.25,whiteSpace:"pre-wrap",wordBreak:"break-all","& span":{}},dangerouslySetInnerHTML:{__html:s}})});function k(e){let{serverName:r}=e,[s,i]=(0,n.useState)(""),[a,S]=(0,n.useState)([]),[k,I]=(0,n.useState)(-1),[P,z]=(0,n.useState)("ALL"),[W,F]=(0,n.useState)(!0),[O,A]=(0,n.useState)(!0),[M,T]=(0,n.useState)(!1),D=(0,n.useRef)(null),E=(0,n.useRef)(null),{logs:B,isConnected:N,clearLogs:U,reconnect:L,retryCount:H}=(0,C.Y)({serverName:r}),q=(0,n.useMemo)(()=>{let e=B;return O&&(e=e.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient"))),"ALL"!==P&&(e=e.filter(e=>(e.includes("/ERROR]")||e.includes("/ERROR:")?"ERROR":e.includes("/WARN]")||e.includes("/WARN:")?"WARN":(e.includes("/INFO]")||e.includes("/INFO:"),"INFO"))===P)),e},[B,P,O]);(0,n.useEffect)(()=>{W&&E.current&&(E.current.scrollTop=E.current.scrollHeight)},[q,W]);let K=(0,n.useCallback)(async()=>{let e=s.trim();if(e&&!M){T(!0);try{S(r=>[...r,e]),I(-1),await fetch("/api/servers/".concat(encodeURIComponent(r),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})}),i("")}catch(e){console.error("Failed to execute command:",e)}finally{T(!1)}}},[s,r,M]),G=(0,n.useCallback)(e=>{if("Enter"===e.key)e.preventDefault(),K();else if("ArrowUp"===e.key){if(e.preventDefault(),0===a.length)return;let r=-1===k?a.length-1:Math.max(0,k-1);I(r),i(a[r])}else if("ArrowDown"===e.key){if(e.preventDefault(),-1===k)return;let r=k+1;r>=a.length?(I(-1),i("")):(I(r),i(a[r]))}},[a,k,K]),_=(0,n.useCallback)(e=>{var r;i(e),null===(r=D.current)||void 0===r||r.focus()},[]),J=N?{text:"Connected",color:"success"}:H>0?{text:"Disconnected (Retry ".concat(H,")"),color:"warning"}:{text:"Disconnected",color:"error"};return(0,t.jsxs)(o.Z,{"data-testid":"server-console",sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:400},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(u.Z,{variant:"subtitle2",children:"Console"}),(0,t.jsx)(m.Z,{"data-testid":"connection-status",label:J.text,color:J.color,size:"small"})]}),(0,t.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(x.Z,{size:"small",variant:"outlined",children:["ALL","INFO","WARN","ERROR"].map(e=>(0,t.jsx)(c.Z,{onClick:()=>z(e),variant:P===e?"contained":"outlined",children:e},e))}),(0,t.jsx)(p.Z,{control:(0,t.jsx)(j.Z,{checked:W,onChange:e=>F(e.target.checked),size:"small",inputProps:{"aria-label":"Auto-scroll"}}),label:"Auto-scroll"}),(0,t.jsx)(p.Z,{control:(0,t.jsx)(j.Z,{checked:O,onChange:e=>A(e.target.checked),size:"small",inputProps:{"aria-label":"Hide RCON"}}),label:"Hide RCON"}),(0,t.jsx)(h.Z,{size:"small",onClick:U,"aria-label":"Clear logs",title:"Clear logs",children:(0,t.jsx)(b.Z,{})}),!N&&(0,t.jsx)(c.Z,{size:"small",startIcon:(0,t.jsx)(y.Z,{}),onClick:L,"aria-label":"Reconnect",children:"Reconnect"})]})]}),(0,t.jsx)(l.Z,{ref:E,sx:{flex:1,overflow:"auto",bgcolor:"#1a1a1a",p:1,fontFamily:"monospace",fontSize:"0.85rem"},children:0===q.length?(0,t.jsx)(u.Z,{color:"text.secondary",sx:{textAlign:"center",py:4,color:"#666"},children:"Waiting for logs..."}):q.map((e,r)=>(0,t.jsx)(R,{log:e},r))}),(0,t.jsx)(v.Z,{}),(0,t.jsx)(l.Z,{sx:{px:2,py:1,bgcolor:"background.default"},children:(0,t.jsxs)(g.Z,{direction:"row",spacing:1,children:[(0,t.jsx)(u.Z,{variant:"caption",color:"text.secondary",sx:{alignSelf:"center"},children:"Quick:"}),w.map(e=>(0,t.jsx)(c.Z,{size:"small",variant:"outlined",onClick:()=>_(e.template),children:e.label},e.label))]})}),(0,t.jsx)(v.Z,{}),(0,t.jsxs)(l.Z,{sx:{display:"flex",p:1,gap:1},children:[(0,t.jsx)(d.Z,{inputRef:D,fullWidth:!0,size:"small",placeholder:"Enter command...",value:s,onChange:e=>i(e.target.value),onKeyDown:G,disabled:!N||M,InputProps:{sx:{fontFamily:"monospace"}}}),(0,t.jsx)(c.Z,{variant:"contained",onClick:K,disabled:!s.trim()||!N||M,startIcon:M?(0,t.jsx)(Z.Z,{size:16}):(0,t.jsx)(f.Z,{}),"aria-label":"Send command",children:"Send"})]})]})}},163:function(e,r,s){"use strict";s.d(r,{Y:function(){return i}});var t=s(35106),n=s(93757);function i(e){let{serverName:r,maxLines:s=500,enabled:i=!0,reconnectInterval:a=3e3}=e,[l,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{o([])},[r]);let d=(0,t.useCallback)(e=>{let r;"server-log"===e.type?r=e.data.log:"log"in e&&"string"==typeof e.log&&(r=e.log),r&&o(e=>{let t=[...e,r];return t.length>s?t.slice(t.length-s):t})},[s]),{isConnected:c,reconnect:x,retryCount:h}=(0,n.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/logs"),onMessage:d,enabled:i,reconnectInterval:a});return{logs:l,isConnected:c,clearLogs:(0,t.useCallback)(()=>{o([])},[]),reconnect:x,retryCount:h}}}},function(e){e.O(0,[6812,7220,8006,7294,8696,1071,540,6189,4840,5511,55,310,3543,8347,2149,4538,6645,9887,6594,2537,3669,2757,1744],function(){return e(e.s=59616)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[278],{59616:function(e,r,s){Promise.resolve().then(s.bind(s,41517))},41517:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return eL}});var t=s(94655),n=s(35106),i=s(74228),a=s(31358),l=s(7281),o=s(30417),d=s(79983),c=s(81071),x=s(93017),h=s(10721),u=s(628),m=s(41565),p=s(31317),j=s(35694),g=s(7178),v=s(17820),Z=s(73424),f=s(99770),b=s(62508),y=s(5682),C=s(76678),w=s(97436),S=s(84840),R=s(76492),k=s(10117),I=s(5501),P=s(37809),z=s(21111),W=s(17978),F=s(89573),O=s(96292),A=s(33104),M=s(25333),T=s(52082),D=s(69123),E=s(71185),B=s(30165),N=s(97293),U=s(11259),L=s(66615),H=s(89161),q=s(34071),K=s(4405);function G(e){let{value:r,unit:s,label:n,icon:i,progress:a,progressMax:o,color:d="#1bd96a"}=e;return(0,t.jsxs)(u.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,t.jsxs)(l.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)(l.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/o*100,100),sx:{mt:1,height:6,borderRadius:1.5,bgcolor:"#2a2d3a","& .MuiLinearProgress-bar":{borderRadius:1.5,background:"linear-gradient(90deg, ".concat(d," 0%, ").concat(d,"cc 100%)")}}})]})}var _=s(163),J=s(73660),V=s(90158),Q=s(58347),Y=s(95511),$=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)(l.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:60,height:24}),(0,t.jsx)(h.Z,{variant:"text",width:"60%"}),(0,t.jsx)(h.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)(l.Z,{children:[(0,t.jsx)(V.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)(l.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)(Y.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)(l.Z,{sx:{mt:2,textAlign:"center"},children:(0,t.jsx)(o.Z,{component:$.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),el=s(40064),eo=s(38393),ed=s(37530),ec=s(5942),ex=s(84420),eh=s(46121),eu=s(84775),em=s(92666);function ep(e){var r,s;let{serverName:i,isRunning:a}=e,{data:d,isLoading:h}=(0,em.iC)(i),j=(0,em.MH)(),v=(0,em.gx)(),[Z,R]=(0,n.useState)({}),[k,I]=(0,n.useState)(!1),[P,z]=(0,n.useState)(!1),[W,F]=(0,n.useState)(!1),[O,A]=(0,n.useState)(""),[M,T]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==d?void 0:d.config)&&R(d.config)},[d]);let E=(e,r)=>{R(s=>({...s,[e]:r})),I(!0),("memory"===e||"useAikarFlags"===e)&&z(!0)},B=async()=>{try{let e=await j.mutateAsync({serverName:i,config:Z});T({open:!0,message:e.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:e.restartRequired?"warning":"success"}),I(!1),z(!1)}catch(e){T({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}},N=async()=>{if("RESET"!==O){T({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await v.mutateAsync(i),T({open:!0,message:"World reset successfully",severity:"success"}),F(!1),A("")}catch(e){T({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return h?(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,t.jsx)(x.Z,{})}):(0,t.jsxs)(l.Z,{children:[P&&(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)(u.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)(D.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=>E("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=>E("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=>E("difficulty",e.target.value),children:[(0,t.jsx)(g.Z,{value:"peaceful",children:"Peaceful"}),(0,t.jsx)(g.Z,{value:"easy",children:"Easy"}),(0,t.jsx)(g.Z,{value:"normal",children:"Normal"}),(0,t.jsx)(g.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=>E("gameMode",e.target.value),children:[(0,t.jsx)(g.Z,{value:"survival",children:"Survival"}),(0,t.jsx)(g.Z,{value:"creative",children:"Creative"}),(0,t.jsx)(g.Z,{value:"adventure",children:"Adventure"}),(0,t.jsx)(g.Z,{value:"spectator",children:"Spectator"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(el.Z,{control:(0,t.jsx)(eo.Z,{checked:null===(r=Z.pvp)||void 0===r||r,onChange:e=>E("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=>E("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=>E("spawnProtection",parseInt(e.target.value,10)),inputProps:{min:0,max:128}})})]})]})}),(0,t.jsx)(u.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)(D.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=>E("memory",e.target.value),helperText:"Format: 4G, 8G, etc."})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(el.Z,{control:(0,t.jsx)(eo.Z,{checked:null!==(s=Z.useAikarFlags)&&void 0!==s&&s,onChange:e=>E("useAikarFlags",e.target.checked)}),label:"Use Aikar's Flags (Optimized GC)"})})]})]})}),(0,t.jsx)(l.Z,{sx:{display:"flex",justifyContent:"flex-end",mb:3},children:(0,t.jsx)(o.Z,{variant:"contained",size:"large",startIcon:(0,t.jsx)(ec.Z,{}),onClick:B,disabled:!k||j.isPending,sx:{px:4},children:j.isPending?"Saving...":"Save Changes"})}),(0,t.jsx)(u.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)(D.Z,{sx:{mb:3}}),(0,t.jsxs)(l.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)(o.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)(eu.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)(f.Z,{open:W,onClose:()=>F(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(b.Z,{children:(0,t.jsxs)(l.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)(y.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:O,onChange:e=>A(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(o.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(o.Z,{variant:"contained",color:"error",onClick:N,disabled:"RESET"!==O||v.isPending,startIcon:v.isPending?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eh.Z,{}),children:v.isPending?"Resetting...":"Reset World"})]})]}),(0,t.jsx)(ed.Z,{open:M.open,autoHideDuration:6e3,onClose:()=>T({...M,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>T({...M,open:!1}),severity:M.severity,sx:{width:"100%"},children:M.message})})]})}var ej=s(86702),eg=s(47606),ev=s(407),eZ=s(56056),ef=s(28058),eb=s(11597),ey=s(59602);let eC={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function ew(e){let{permission:r,size:s="medium"}=e,n=eC[r];return(0,t.jsx)(M.Z,{label:n.label,color:n.color,variant:n.variant,size:s})}var eS=s(99046),eR=s(68038),ek=s(34080),eI=s(39181),eP=s(5632),ez=s(58919),eW=s(20367),eF=s(42936);function eO(e){var r,s;let{open:i,onClose:a,serverId:d}=e,[h,u]=(0,n.useState)(""),[m,j]=(0,n.useState)(null),[g,v]=(0,n.useState)("view"),{data:Z,isLoading:S}=(s={enabled:i},(0,eP.a)({queryKey:["users","search",h],queryFn:()=>(0,eF.SC)("/api/users?q=".concat(encodeURIComponent(h))),enabled:(null==s?void 0:s.enabled)!==!1&&h.length>=2,staleTime:3e4})),R=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>(0,eF.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"]})}})}(),k=(0,n.useMemo)(()=>{var e;return null!==(e=null==Z?void 0:Z.users)&&void 0!==e?e:[]},[Z]),I=()=>{u(""),j(null),v("view"),R.reset(),a()};return(0,t.jsxs)(f.Z,{open:i,onClose:I,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,t.jsx)(b.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,t.jsxs)(y.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[R.isError&&(0,t.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(r=R.error)||void 0===r?void 0:r.message)||"Failed to grant access"}),(0,t.jsx)(eS.Z,{options:k,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,r)=>e.id===r.id,value:m,onChange:(e,r)=>j(r),inputValue:h,onInputChange:(e,r)=>u(r),loading:S,filterOptions:e=>e,noOptionsText:h.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,...o}=e;return(0,t.jsxs)(l.Z,{component:"li",...o,sx:{display:"flex",gap:1.5,py:1},children:[(0,t.jsx)(ej.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)(l.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)(eR.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,t.jsxs)(ek.Z,{value:g,onChange:e=>v(e.target.value),children:[(0,t.jsx)(el.Z,{value:"view",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.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)(el.Z,{value:"manage",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.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)(el.Z,{value:"admin",control:(0,t.jsx)(eI.Z,{size:"small"}),label:(0,t.jsxs)(l.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)(o.Z,{onClick:I,color:"inherit",children:"Cancel"}),(0,t.jsx)(o.Z,{onClick:()=>{m&&R.mutate({userId:m.id,serverId:d,permission:g},{onSuccess:I})},variant:"contained",disabled:!m||R.isPending,sx:{borderRadius:2},children:R.isPending?"Adding...":"Add User"})]})]})}function eA(e){var r,s;let{serverId:i}=e,{data:a,isLoading:x,error:f}=(0,eP.a)({queryKey:["user-servers",i],queryFn:()=>(0,eF.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),b=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>{let{id:r,permission:s}=e;return(0,eF.SC)("/api/user-servers/".concat(encodeURIComponent(r)),{method:"PATCH",body:JSON.stringify({permission:s})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),y=function(){let e=(0,ez.NL)();return(0,eW.D)({mutationFn:e=>(0,eF.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[C,w]=(0,n.useState)(!1),[S,R]=(0,n.useState)(null),[k,I]=(0,n.useState)(null),z=(e,r)=>{R(e.currentTarget),I(r)},W=()=>{R(null),I(null)},F=e=>{if(!k||k.permission===e){W();return}b.mutate({id:k.id,permission:e},{onSettled:W})},O=null!==(r=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==r?r:0,A=(null==k?void 0:k.permission)==="admin"&&O<=1;if(x)return(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%",height:32}),(0,t.jsx)(h.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,t.jsx)(D.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,t.jsx)(h.Z,{variant:"circular",width:40,height:40}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"40%"}),(0,t.jsx)(h.Z,{variant:"text",width:"60%"})]}),(0,t.jsx)(h.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,t.jsx)(h.Z,{variant:"circular",width:32,height:32})]},e))]})});if(f)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",f.message]});let M=null!==(s=null==a?void 0:a.users)&&void 0!==s?s:[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.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)(o.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(eg.Z,{}),onClick:()=>w(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,t.jsx)(D.Z,{sx:{mb:1}}),0===M.length?(0,t.jsx)(l.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."})}):M.map(e=>{var r,s,n,i,a,o,c,x;return(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,t.jsx)(ej.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)(l.Z,{sx:{flex:1,minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(o=e.user)||void 0===o?void 0:o.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)(ew,{permission:e.permission,size:"small"}),(0,t.jsx)(d.Z,{size:"small",onClick:r=>z(r,e),sx:{color:"text.secondary"},children:(0,t.jsx)(P.Z,{fontSize:"small"})})]},e.id)}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,t.jsx)(ey.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)(j.Z,{anchorEl:S,open:!!S,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,t.jsxs)(g.Z,{onClick:()=>F("admin"),disabled:(null==k?void 0:k.permission)==="admin",children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(ev.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Owner"})]}),(0,t.jsxs)(g.Z,{onClick:()=>F("manage"),disabled:(null==k?void 0:k.permission)==="manage"||A,children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(eZ.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Operator"})]}),(0,t.jsxs)(g.Z,{onClick:()=>F("view"),disabled:(null==k?void 0:k.permission)==="view"||A,children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(ef.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Viewer"})]}),(0,t.jsx)(D.Z,{}),(0,t.jsxs)(g.Z,{onClick:()=>{k&&y.mutate(k.id,{onSettled:W})},disabled:A,sx:{color:"error.main"},children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(eb.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Remove Access"})]})]}),(0,t.jsx)(eO,{open:C,onClose:()=>w(!1),serverId:i})]})}let eM=["Overview","Activity","Content","Files","Backups","Access","Options"];function eT(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 eD(e){var r,s,i,a,c;let{server:x,onSendCommand:h}=e,[j,g]=(0,n.useState)("Overview"),[v,Z]=(0,n.useState)(""),[b,C]=(0,n.useState)(!0),[k,I]=(0,n.useState)(!1),P=(0,n.useRef)(null),{logs:z,isConnected:W}=(0,_.Y)({serverName:x.name}),F=(0,n.useMemo)(()=>z.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[z]);(0,n.useEffect)(()=>{P.current&&b&&(P.current.scrollTop=P.current.scrollHeight)},[F,b]);let O=async()=>{v.trim()&&h&&(await h(v.trim()),Z(""))},A=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)(l.Z,{children:[(0,t.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:eM.map(e=>(0,t.jsx)(o.Z,{onClick:()=>g(e),sx:{px:2,py:1,borderRadius:5,fontSize:14,fontWeight:500,textTransform:"none",bgcolor:j===e?"primary.main":"transparent",color:j===e?"#0a0e14":"text.secondary","&:hover":{bgcolor:j===e?"primary.main":(0,R.Fq)("#1bd96a",.1)}},children:e},e))}),(0,t.jsxs)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,t.jsx)(G,{value:"".concat(A.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,t.jsx)(B.Z,{sx:{fontSize:28}}),progress:A,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)(u.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,t.jsxs)(l.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)(l.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)(l.Z,{sx:{position:"relative"},children:[(0,t.jsx)(l.Z,{ref:P,onScroll:()=>{if(!P.current)return;let{scrollTop:e,scrollHeight:r,clientHeight:s}=P.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=eT(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)(l.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,t.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",s.time,"]"]}),(0,t.jsxs)(l.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",s.thread,"/",(0,t.jsx)(l.Z,{component:"span",sx:{color:"WARN"===s.level?"#e8a848":"#6b6e80"},children:s.level}),"]:\xa0"]}),(0,t.jsx)(l.Z,{component:"span",sx:{color:"WARN"===s.level?"#c4a45a":"#b4b6c4"},children:s.msg})]},r):(0,t.jsx)(l.Z,{sx:{color:"#b4b6c4"},children:eT(e)},r)})}),(0,t.jsx)(d.Z,{onClick:()=>I(!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)(L.Z,{sx:{fontSize:18}})}),!b&&(0,t.jsx)(d.Z,{onClick:()=>{P.current&&P.current.scrollTo({top:P.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)(H.Z,{sx:{fontSize:18}})})]}),(0,t.jsx)(l.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:v,onChange:e=>Z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),O())},disabled:!W,InputProps:{startAdornment:(0,t.jsx)(T.Z,{position:"start",children:(0,t.jsx)(q.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"===j&&(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)(u.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)(D.Z,{sx:{mb:2}}),(0,t.jsx)(eE,{label:"Name",value:x.name}),(0,t.jsx)(eE,{label:"Container",value:x.container}),(0,t.jsx)(eE,{label:"Hostname",value:x.hostname}),(0,t.jsx)(eE,{label:"Type",value:x.type}),(0,t.jsx)(eE,{label:"Version",value:x.version}),(0,t.jsx)(eE,{label:"Memory",value:x.memory}),(0,t.jsx)(eE,{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)(u.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)(D.Z,{sx:{mb:2}}),x.players?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eE,{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)(l.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.list.map(e=>(0,t.jsx)(M.Z,{label:e,size:"small"},e))})]})]}):(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})})]}),"Activity"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(u.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)(D.Z,{sx:{mb:2}}),(0,t.jsx)(et,{serverName:x.name})]})})}),"Content"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Content management coming soon"})}),"Files"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(eA,{serverId:x.name})}),"Options"===j&&(0,t.jsx)(l.Z,{sx:{mt:3},children:(0,t.jsx)(ep,{serverName:x.name,isRunning:"running"===x.status})}),(0,t.jsxs)(f.Z,{open:k,onClose:()=>I(!1),maxWidth:"xl",fullWidth:!0,PaperProps:{sx:{height:"90vh",bgcolor:"background.paper"}},children:[(0,t.jsxs)(l.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:()=>I(!1),children:(0,t.jsx)(E.Z,{})})]}),(0,t.jsx)(y.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(J.K,{serverName:x.name})})]})]})}function eE(e){let{label:r,value:s}=e;return s?(0,t.jsxs)(l.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 eB=s(93757);function eN(){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 eU(){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 eL(){var e,r,s,M;let T=(0,i.useParams)(),D=(0,a.x)(),E=decodeURIComponent(T.name),{data:B,isLoading:N,error:U}=(0,em.Hy)(E),{status:L,health:H}=function(e){let{serverName:r,onStatusChange:s,enabled:t=!0,reconnectInterval:i=3e3}=e,[a,l]=(0,n.useState)(null),[o,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{l(null),d(null)},[r]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let r=e.data.status,t=e.data.health;l(r),d(t),null==s||s(r,t)}},[s]),{isConnected:x,reconnect:h,retryCount:u}=(0,eB.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/status"),onMessage:c,enabled:t,reconnectInterval:i});return{status:a,health:o,isConnected:x,reconnect:h,retryCount:u}}({serverName:E,enabled:!!E}),[q,K]=(0,n.useState)(null),[G,_]=(0,n.useState)(!1),[J,V]=(0,n.useState)(""),Q=(0,em.jM)(),Y=(0,em.Aw)(),$=(0,em._I)(),X=(0,em.Hq)(),ee=async()=>{try{await Q.mutateAsync(E)}catch(e){console.error("Failed to start server:",e)}},er=async()=>{try{await Y.mutateAsync(E)}catch(e){console.error("Failed to stop server:",e)}},es=async()=>{try{await $.mutateAsync(E)}catch(e){console.error("Failed to restart server:",e)}},et=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(E),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=L||(null==B?void 0:B.server.status),ei=Q.isPending||Y.isPending||$.isPending,ea=null==B?void 0:B.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]}),Y.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(r=Y.error)||void 0===r?void 0:r.message]}),$.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(s=$.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===(M=X.error)||void 0===M?void 0:M.message]}),N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,t.jsxs)(l.Z,{sx:{flex:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,t.jsx)(h.Z,{variant:"text",width:"40%",height:40}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,t.jsx)(h.Z,{variant:"text",width:100}),(0,t.jsx)(h.Z,{variant:"text",width:60}),(0,t.jsx)(h.Z,{variant:"text",width:140}),(0,t.jsx)(h.Z,{variant:"text",width:50})]})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,t.jsx)(h.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,t.jsx)(h.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,t.jsx)(l.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,r)=>(0,t.jsx)(h.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},r))}),(0,t.jsx)(l.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,t.jsx)(h.Z,{variant:"text",width:"50%"}),(0,t.jsx)(h.Z,{variant:"circular",width:28,height:28})]}),(0,t.jsx)(h.Z,{variant:"text",width:"60%",height:36}),(0,t.jsx)(h.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,t.jsxs)(u.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,t.jsxs)(l.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(h.Z,{variant:"text",width:80,height:28}),(0,t.jsx)(h.Z,{variant:"circular",width:10,height:10})]}),(0,t.jsx)(h.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,t.jsx)(l.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(h.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)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(h.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(h.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%"}),(0,t.jsx)(h.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(u.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(h.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,t.jsx)(h.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(l.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(h.Z,{variant:"text",width:"25%"}),(0,t.jsx)(h.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(l.Z,{sx:{width:64,height:64,borderRadius:3,overflow:"hidden",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"1px solid",borderColor:"divider",fontSize:36},children:function(e){if(!e)return"\uD83C\uDFAE";let 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)(l.Z,{sx:{flex:1},children:[(0,t.jsxs)(p.Z,{onClick:()=>D.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)(k.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:E}),(0,t.jsxs)(l.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)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(W.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(F.Z,{sx:{fontSize:14}}),ea.type]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(O.Z,{sx:{fontSize:14}}),ea.hostname]}),(0,t.jsx)(l.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(A.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)(l.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,t.jsx)(o.Z,{variant:"contained",color:"success",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(I.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)(o.Z,{variant:"outlined",startIcon:ei?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eN,{}),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,R.Fq)("#fff",.05)}},children:"Stop"}),(0,t.jsx)(o.Z,{variant:"contained",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(eU,{}),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)(P.Z,{sx:{fontSize:18}})}),(0,t.jsx)(j.Z,{anchorEl:q,open:!!q,onClose:()=>K(null),children:(0,t.jsxs)(g.Z,{onClick:()=>{K(null),_(!0),V("")},sx:{color:"error.main"},children:[(0,t.jsx)(v.Z,{children:(0,t.jsx)(z.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Delete Server"})]})})]})]}),(0,t.jsx)(eD,{server:ea,onSendCommand:et})]}):(0,t.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,t.jsxs)(f.Z,{open:G,onClose:()=>{_(!1),V("")},maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(b.Z,{children:"Delete Server"}),(0,t.jsxs)(y.Z,{children:[(0,t.jsxs)(p.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,t.jsx)("strong",{children:E})," to confirm deletion."]}),(0,t.jsx)(w.Z,{label:"Server name",value:J,onChange:e=>V(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(o.Z,{onClick:()=>{_(!1),V("")},children:"Cancel"}),(0,t.jsx)(o.Z,{variant:"contained",color:"error",onClick:()=>{J===E&&X.mutate({name:E,force:!0},{onSuccess:()=>{D.push("/servers")}})},disabled:J!==E||X.isPending,startIcon:X.isPending?(0,t.jsx)(x.Z,{size:16}):null,children:X.isPending?"Deleting...":"Delete"})]})]})]})}},73660:function(e,r,s){"use strict";s.d(r,{K:function(){return k}});var t=s(94655),n=s(35106),i=s(18844),a=s.n(i),l=s(7281),o=s(69899),d=s(97436),c=s(30417),x=s(90829),h=s(79983),u=s(31317),m=s(25333),p=s(40064),j=s(45547),g=s(70115),v=s(69123),Z=s(93017),f=s(11141),b=s(19127),y=s(69366),C=s(163);let w=[{label:"say",template:"say "},{label:"give",template:"give "},{label:"tp",template:"tp "},{label:"gamemode",template:"gamemode "}],S=new(a())({fg:"#aaa",bg:"#000",newline:!1,escapeXML:!0,colors:{0:"#000000",1:"#cc0000",2:"#4e9a06",3:"#c4a000",4:"#3465a4",5:"#75507b",6:"#06989a",7:"#d3d7cf",8:"#555753",9:"#ef2929",10:"#8ae234",11:"#fce94f",12:"#729fcf",13:"#ad7fa8",14:"#34e2e2",15:"#eeeeec"}}),R=(0,n.memo)(function(e){let{log:r}=e,s=(0,n.useMemo)(()=>(function(e){let r=e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[KJH]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[KJH]/g,"").replace(/\[m/g,"").replace(/\[(\d+)m/g,"\x1b[$1m").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"");return S.toHtml(r)})(r),[r]);return(0,t.jsx)(l.Z,{sx:{py:.25,whiteSpace:"pre-wrap",wordBreak:"break-all","& span":{}},dangerouslySetInnerHTML:{__html:s}})});function k(e){let{serverName:r}=e,[s,i]=(0,n.useState)(""),[a,S]=(0,n.useState)([]),[k,I]=(0,n.useState)(-1),[P,z]=(0,n.useState)("ALL"),[W,F]=(0,n.useState)(!0),[O,A]=(0,n.useState)(!0),[M,T]=(0,n.useState)(!1),D=(0,n.useRef)(null),E=(0,n.useRef)(null),{logs:B,isConnected:N,clearLogs:U,reconnect:L,retryCount:H}=(0,C.Y)({serverName:r}),q=(0,n.useMemo)(()=>{let e=B;return O&&(e=e.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient"))),"ALL"!==P&&(e=e.filter(e=>(e.includes("/ERROR]")||e.includes("/ERROR:")?"ERROR":e.includes("/WARN]")||e.includes("/WARN:")?"WARN":(e.includes("/INFO]")||e.includes("/INFO:"),"INFO"))===P)),e},[B,P,O]);(0,n.useEffect)(()=>{W&&E.current&&(E.current.scrollTop=E.current.scrollHeight)},[q,W]);let K=(0,n.useCallback)(async()=>{let e=s.trim();if(e&&!M){T(!0);try{S(r=>[...r,e]),I(-1),await fetch("/api/servers/".concat(encodeURIComponent(r),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})}),i("")}catch(e){console.error("Failed to execute command:",e)}finally{T(!1)}}},[s,r,M]),G=(0,n.useCallback)(e=>{if("Enter"===e.key)e.preventDefault(),K();else if("ArrowUp"===e.key){if(e.preventDefault(),0===a.length)return;let r=-1===k?a.length-1:Math.max(0,k-1);I(r),i(a[r])}else if("ArrowDown"===e.key){if(e.preventDefault(),-1===k)return;let r=k+1;r>=a.length?(I(-1),i("")):(I(r),i(a[r]))}},[a,k,K]),_=(0,n.useCallback)(e=>{var r;i(e),null===(r=D.current)||void 0===r||r.focus()},[]),J=N?{text:"Connected",color:"success"}:H>0?{text:"Disconnected (Retry ".concat(H,")"),color:"warning"}:{text:"Disconnected",color:"error"};return(0,t.jsxs)(o.Z,{"data-testid":"server-console",sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:400},children:[(0,t.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(u.Z,{variant:"subtitle2",children:"Console"}),(0,t.jsx)(m.Z,{"data-testid":"connection-status",label:J.text,color:J.color,size:"small"})]}),(0,t.jsxs)(g.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,t.jsx)(x.Z,{size:"small",variant:"outlined",children:["ALL","INFO","WARN","ERROR"].map(e=>(0,t.jsx)(c.Z,{onClick:()=>z(e),variant:P===e?"contained":"outlined",children:e},e))}),(0,t.jsx)(p.Z,{control:(0,t.jsx)(j.Z,{checked:W,onChange:e=>F(e.target.checked),size:"small",inputProps:{"aria-label":"Auto-scroll"}}),label:"Auto-scroll"}),(0,t.jsx)(p.Z,{control:(0,t.jsx)(j.Z,{checked:O,onChange:e=>A(e.target.checked),size:"small",inputProps:{"aria-label":"Hide RCON"}}),label:"Hide RCON"}),(0,t.jsx)(h.Z,{size:"small",onClick:U,"aria-label":"Clear logs",title:"Clear logs",children:(0,t.jsx)(b.Z,{})}),!N&&(0,t.jsx)(c.Z,{size:"small",startIcon:(0,t.jsx)(y.Z,{}),onClick:L,"aria-label":"Reconnect",children:"Reconnect"})]})]}),(0,t.jsx)(l.Z,{ref:E,sx:{flex:1,overflow:"auto",bgcolor:"#1a1a1a",p:1,fontFamily:"monospace",fontSize:"0.85rem"},children:0===q.length?(0,t.jsx)(u.Z,{color:"text.secondary",sx:{textAlign:"center",py:4,color:"#666"},children:"Waiting for logs..."}):q.map((e,r)=>(0,t.jsx)(R,{log:e},r))}),(0,t.jsx)(v.Z,{}),(0,t.jsx)(l.Z,{sx:{px:2,py:1,bgcolor:"background.default"},children:(0,t.jsxs)(g.Z,{direction:"row",spacing:1,children:[(0,t.jsx)(u.Z,{variant:"caption",color:"text.secondary",sx:{alignSelf:"center"},children:"Quick:"}),w.map(e=>(0,t.jsx)(c.Z,{size:"small",variant:"outlined",onClick:()=>_(e.template),children:e.label},e.label))]})}),(0,t.jsx)(v.Z,{}),(0,t.jsxs)(l.Z,{sx:{display:"flex",p:1,gap:1},children:[(0,t.jsx)(d.Z,{inputRef:D,fullWidth:!0,size:"small",placeholder:"Enter command...",value:s,onChange:e=>i(e.target.value),onKeyDown:G,disabled:!N||M,InputProps:{sx:{fontFamily:"monospace"}}}),(0,t.jsx)(c.Z,{variant:"contained",onClick:K,disabled:!s.trim()||!N||M,startIcon:M?(0,t.jsx)(Z.Z,{size:16}):(0,t.jsx)(f.Z,{}),"aria-label":"Send command",children:"Send"})]})]})}},163:function(e,r,s){"use strict";s.d(r,{Y:function(){return i}});var t=s(35106),n=s(93757);function i(e){let{serverName:r,maxLines:s=500,enabled:i=!0,reconnectInterval:a=3e3}=e,[l,o]=(0,t.useState)([]);(0,t.useEffect)(()=>{o([])},[r]);let d=(0,t.useCallback)(e=>{let r;"server-log"===e.type?r=e.data.log:"log"in e&&"string"==typeof e.log&&(r=e.log),r&&o(e=>{let t=[...e,r];return t.length>s?t.slice(t.length-s):t})},[s]),{isConnected:c,reconnect:x,retryCount:h}=(0,n.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/logs"),onMessage:d,enabled:i,reconnectInterval:a});return{logs:l,isConnected:c,clearLogs:(0,t.useCallback)(()=>{o([])},[]),reconnect:x,retryCount:h}}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,9810,7073,880,55,6857,8347,1658,1544,6727,6357,787,1721,3489,2537,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),u=r(69899),d=r(31317),h=r(76492),m=r(32366),p=r(78067),x=r(84840),f=r(97436),v=r(52082),y=r(89923),g=r(10297),S=r(42431),C=r(628),j=r(41565),b=r(25935),Z=r(79983),w=r(25333),k=r(95511),T=r(5501),q=r(93315),R=r(27171),I=r(96292);let E=e=>{switch(e){case"running":return"success";case"stopped":case"exited":case"not_created":return"error";case"created":return"warning";default:return"default"}},F=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"}},N=e=>{if(!e)return"-";let t=e.split(",").map(e=>e.trim());return t.find(e=>e.endsWith(".local"))||t[0]||"-"};function O(e){var t;let{server:r,statusOverride:s,onClick:o,onStart:a,onStop:l,loading:c=!1}=e,u=(null==s?void 0:s.status)||r.status,h=(e,t)=>{e.stopPropagation(),t(r.name)},m="running"===u,p="stopped"===u||"exited"===u||"not_created"===u,x=N(r.hostname),f=(null===(t=r.hostname)||void 0===t?void 0:t.split(",").map(e=>e.trim()))||[];return(0,n.jsxs)(C.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)(j.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)(d.Z,{variant:"h6",component:"h3",sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,mr:1},children:r.name}),(0,n.jsx)(w.Z,{label:F(u),size:"small",color:E(u),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)(k.Z,{title:f.length>1?f.join("\n"):"",arrow:!0,children:(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[x,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)(d.Z,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.container})]})]}),(0,n.jsxs)(b.Z,{sx:{justifyContent:"flex-end",px:2,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:[p&&a&&(0,n.jsx)(Z.Z,{"aria-label":"Start server",color:"success",onClick:e=>h(e,a),disabled:c,size:"small",children:(0,n.jsx)(T.Z,{})}),m&&l&&(0,n.jsx)(Z.Z,{"aria-label":"Stop server",color:"error",onClick:e=>h(e,l),disabled:c,size:"small",children:(0,n.jsx)(q.Z,{})}),!p&&!m&&(0,n.jsx)(i.Z,{sx:{height:34}})]})]})}function L(e){let{servers:t,statusMap:r={},onServerClick:o,onStart:l,onStop:c,onCreate:u,loadingServers:h=[]}=e,[p,C]=(0,s.useState)(""),[j,b]=(0,s.useState)("all"),Z=(0,s.useMemo)(()=>t.filter(e=>{if(p&&!e.name.toLowerCase().includes(p.toLowerCase()))return!1;let t=r[e.name],n=(null==t?void 0:t.status)||e.status;return("running"!==j||"running"===n)&&("stopped"!==j||"stopped"===n||"exited"===n||"not_created"===n)}),[t,r,p,j]);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)(d.Z,{variant:"h6",color:"text.secondary",children:"No servers found"}),u&&(0,n.jsx)(a.Z,{variant:"contained",startIcon:(0,n.jsx)(m.Z,{}),onClick:u,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)(g.Z,{value:j,exclusive:!0,onChange:(e,t)=>{null!==t&&b(t)},size:"small",sx:{flexShrink:0},children:[(0,n.jsx)(y.Z,{value:"all",children:"All"}),(0,n.jsx)(y.Z,{value:"running",children:"Running"}),(0,n.jsx)(y.Z,{value:"stopped",children:"Stopped"})]}),(0,n.jsx)(f.Z,{size:"small",placeholder:"Search servers...",value:p,onChange:e=>C(e.target.value),InputProps:{startAdornment:(0,n.jsx)(v.Z,{position:"start",children:(0,n.jsx)(S.Z,{})})},sx:{flexGrow:{xs:1,sm:0},minWidth:{sm:300}}})]}),(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:[Z.length," ",1===Z.length?"server":"servers"]}),0===Z.length?(0,n.jsx)(i.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",gap:2},children:(0,n.jsx)(d.Z,{variant:"h6",color:"text.secondary",children:"No servers found"})}):(0,n.jsx)(x.ZP,{container:!0,spacing:2,children:Z.map(e=>(0,n.jsx)(x.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,n.jsx)(O,{server:e,statusOverride:r[e.name],onClick:o,onStart:l,onStop:c,loading:h.includes(e.name)})},e.name))})]})}var P=r(99770),D=r(62508),K=r(5682),M=r(76678),A=r(7178),Q=r(40064),W=r(45547),U=r(4405),z=r(73383),_=r(82285),G=r(13609),V=r(46207),H=r(43436),J=r(87716);let $=["VANILLA","PAPER","FABRIC","FORGE","NEOFORGE"],B=["","forge","fabric","neoforge","quilt"],Y={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:u,loading:h=!1,status:m="idle",progress:p=0,message:x=""}=e,[v,S]=(0,s.useState)("standard"),[C,j]=(0,s.useState)(Y),[b,Z]=(0,s.useState)({}),[w,k]=(0,s.useState)(!1),T=(0,s.useRef)(null),q=(0,s.useRef)(null),R=X.findIndex(e=>e.key===m),I="idle"!==m&&"completed"!==m&&"error"!==m;(0,s.useEffect)(()=>{r||(S("standard"),j(Y),Z({}),k(!1))},[r]);let E=e=>e?/^[a-z0-9-]+$/.test(e)?null:"Only lowercase letters, numbers, and hyphens are allowed":"Server name is required",F=e=>e?null:"Modpack slug is required",N=e=>t=>{let r=t.target.value;j(t=>({...t,[e]:r})),"memory"===e&&k(!0),b[e]&&Z(t=>({...t,[e]:""}))};return(0,n.jsx)(P.Z,{open:r,onClose:I?void 0:o,maxWidth:"sm",fullWidth:!0,children:(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),Z({});let t=E(C.name);if(t){Z({name:t});return}if("modpack"===v){let e=F(C.modpack||"");if(e){Z({modpack:e});return}}let r={name:C.name,memory:C.memory,autoStart:C.autoStart,sudoPassword:C.sudoPassword};"standard"===v?(r.type=C.type,r.version=C.version):(r.type="MODRINTH",r.modpack=C.modpack,C.modpackVersion&&(r.modpackVersion=C.modpackVersion),C.modLoader&&(r.modLoader=C.modLoader)),u(r)},children:[(0,n.jsx)(D.Z,{children:"completed"===m?(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(V.Z,{color:"success"}),"Server Created Successfully"]}):"error"===m?(0,n.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(H.Z,{color:"error"}),"Creation Failed"]}):"Create New Server"}),(0,n.jsx)(K.Z,{children:I||"completed"===m||"error"===m?(0,n.jsxs)(i.Z,{sx:{py:2},children:[(0,n.jsx)(z.Z,{activeStep:R,alternativeLabel:!0,sx:{mb:3},children:X.map(e=>(0,n.jsx)(_.Z,{children:(0,n.jsx)(G.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)(d.Z,{variant:"body2",color:"text.secondary",children:x}),(0,n.jsxs)(d.Z,{variant:"body2",color:"text.secondary",children:[p,"%"]})]}),(0,n.jsx)(U.Z,{variant:"determinate",value:p})]}),"completed"===m&&(0,n.jsx)(d.Z,{color:"success.main",sx:{textAlign:"center"},children:x}),"error"===m&&(0,n.jsx)(d.Z,{color:"error.main",sx:{textAlign:"center"},children:x})]}):(0,n.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:2,pt:1},children:[(0,n.jsx)(i.Z,{ref:q,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:C.name,onChange:N("name"),error:!!b.name,helperText:b.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)(d.Z,{variant:"subtitle2",color:"text.secondary",children:"Server Type"}),(0,n.jsxs)(g.Z,{value:v,exclusive:!0,onChange:(e,t)=>{null!==t&&(S(t),q.current&&(q.current.textContent="".concat("standard"===t?"Standard Server":"Modpack"," category selected")),w||j(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)(y.Z,{value:"standard","aria-label":"Standard Server",children:"Standard Server"}),(0,n.jsx)(y.Z,{value:"modpack","aria-label":"Modpack",children:"Modpack"})]}),(0,n.jsx)(J.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:C.type,onChange:N("type"),fullWidth:!0,disabled:I,children:$.map(e=>(0,n.jsx)(A.Z,{value:e,children:e},e))}),(0,n.jsx)(f.Z,{label:"Minecraft Version",value:C.version,onChange:N("version"),helperText:"e.g., 1.21.1, 1.20.4, latest",fullWidth:!0,disabled:I})]})}),(0,n.jsx)(J.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:C.modpack||"",onChange:N("modpack"),error:!!b.modpack,helperText:b.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:C.modLoader||"",onChange:N("modLoader"),helperText:"Leave empty to auto-detect from modpack",fullWidth:!0,disabled:I,children:[(0,n.jsx)(A.Z,{value:"",children:"Auto-detect"}),B.filter(e=>e).map(e=>(0,n.jsx)(A.Z,{value:e,children:e},e))]}),(0,n.jsx)(f.Z,{label:"Modpack Version",value:C.modpackVersion||"",onChange:N("modpackVersion"),helperText:"Leave empty for latest",fullWidth:!0,disabled:I})]})})]}),(0,n.jsx)(f.Z,{label:"Memory",value:C.memory,onChange:N("memory"),helperText:"e.g., 4G, 8G, 16G",fullWidth:!0,disabled:I}),(0,n.jsx)(f.Z,{label:"Sudo Password",type:"password",value:C.sudoPassword||"",onChange:N("sudoPassword"),helperText:"Required for mDNS hostname registration (avahi)",fullWidth:!0,disabled:I}),(0,n.jsx)(Q.Z,{control:(0,n.jsx)(W.Z,{checked:C.autoStart||!1,onChange:(t="autoStart",e=>{j(r=>({...r,[t]:e.target.checked}))}),disabled:I}),label:"Auto-start after creation"})]})}),(0,n.jsx)(M.Z,{sx:{px:3,pb:2},children:"completed"===m||"error"===m?(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)(),[x,f]=(0,s.useState)(!1),[v,y]=(0,s.useState)([]),{data:g,isLoading:S,error:C}=(0,et.x$)(),{statusMap:j}=(0,er.d)(),b=(0,et.jM)(),Z=(0,et.Aw)(),w=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,u]=(0,s.useState)(""),[d,h]=(0,s.useState)(null),m=(0,s.useRef)(null),p=(0,s.useRef)(""),x=(0,s.useCallback)(()=>{i("idle"),l(0),u(""),h(null),m.current&&(m.current.close(),m.current=null)},[]),f=(0,s.useCallback)((e,t,r)=>{i(e),u(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),p.current=e.name,m.current&&m.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),u("Server creation failed"),null==r||r(e)}}},[o,f,t,r]);return(0,s.useEffect)(()=>()=>{m.current&&(m.current.close(),m.current=null)},[]),{status:o,progress:a,message:c,error:d,isCreating:"idle"!==o&&"completed"!==o&&"error"!==o,createServer:v,reset:x}}({onSuccess:()=>{f(!1)},onError:e=>{console.error("Failed to create server:",e)}}),k=async e=>{y(t=>[...t,e]);try{await b.mutateAsync(e)}catch(e){console.error("Failed to start server:",e)}finally{y(t=>t.filter(t=>t!==e))}},T=async e=>{y(t=>[...t,e]);try{await Z.mutateAsync(e)}catch(e){console.error("Failed to stop server:",e)}finally{y(t=>t.filter(t=>t!==e))}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(u.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)(p.Z,{sx:{fontSize:32}})}),(0,n.jsxs)(i.Z,{children:[(0,n.jsx)(d.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Servers"}),(0,n.jsx)(d.Z,{variant:"body1",color:"text.secondary",children:"Manage your Minecraft servers"})]})]}),(0,n.jsx)(a.Z,{variant:"contained",startIcon:(0,n.jsx)(m.Z,{}),onClick:()=>f(!0),size:"large",children:"Create Server"})]}),C&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to load servers: ",C.message]}),w.error&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to create server: ",w.error]}),b.isError&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=b.error)||void 0===e?void 0:e.message]}),Z.isError&&(0,n.jsxs)(l.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(t=Z.error)||void 0===t?void 0:t.message]}),S?(0,n.jsx)(i.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,n.jsx)(c.Z,{})}):(0,n.jsx)(L,{servers:(null==g?void 0:g.servers)||[],statusMap:j,onServerClick:e=>{r.push("/servers/".concat(encodeURIComponent(e)))},onStart:k,onStop:T,onCreate:()=>f(!0),loadingServers:v}),(0,n.jsx)(ee,{open:x,onClose:()=>{f(!1),w.reset()},onSubmit:e=>{w.createServer(e)},loading:w.isCreating,status:w.status,progress:w.progress,message:w.message})]})}},3454:function(e,t,r){"use strict";r.d(t,{LoadingProvider:function(){return l},startLoading:function(){return c},stopLoading:function(){return u}});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 u(){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)},42936:function(e,t,r){"use strict";async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={...t.headers};t.body&&(r["Content-Type"]="application/json");let n=await fetch(e,{...t,headers:r});if(!n.ok){let e=await n.json().catch(()=>({error:"UnknownError",message:n.statusText})),t=Error(e.message);throw t.statusCode=n.status,t.code=e.error,t}return n.json()}r.d(t,{SC:function(){return n}})},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])}},92666:function(e,t,r){"use strict";r.d(t,{$t:function(){return b},Aw:function(){return d},Fv:function(){return v},Hq:function(){return c},Hy:function(){return l},MH:function(){return g},Sr:function(){return m},_I:function(){return h},c5:function(){return Z},g2:function(){return f},gx:function(){return S},hy:function(){return p},iC:function(){return y},jM:function(){return u},mj:function(){return j},nq:function(){return x},nv:function(){return C},s8:function(){return w},x$:function(){return a}});var n=r(5632),s=r(58919),o=r(20367),i=r(42936);function a(){return(0,n.a)({queryKey:["servers"],queryFn:()=>(0,i.SC)("/api/servers"),refetchInterval:6e4})}function l(e,t){return(0,n.a)({queryKey:["servers",e],queryFn:()=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e,refetchInterval:3e4})}function c(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{name:t,force:r}=e;return(0,i.SC)("/api/servers/".concat(encodeURIComponent(t)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["servers"]})}})}function u(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/start"),{method:"POST"}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function d(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/stop"),{method:"POST"}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function h(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/restart"),{method:"POST"}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["servers"]}),e.invalidateQueries({queryKey:["servers",r]})}})}function m(){return(0,n.a)({queryKey:["worlds"],queryFn:()=>(0,i.SC)("/api/worlds"),refetchInterval:3e4})}function p(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/worlds",{method:"POST",body:JSON.stringify(e)}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function x(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{worldName:t,serverName:r}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(t),"/assign"),{method:"POST",body:JSON.stringify({serverName:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}function f(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{worldName:t,force:r}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(t),"/release").concat(r?"?force=true":""),{method:"POST"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function v(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{name:t,force:r}=e;return(0,i.SC)("/api/worlds/".concat(encodeURIComponent(t)).concat(r?"?force=true":""),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]})}})}function y(e,t){return(0,n.a)({queryKey:["servers",e,"config"],queryFn:()=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/config")),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function g(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{serverName:t,config:r}=e;return(0,i.SC)("/api/servers/".concat(encodeURIComponent(t),"/config"),{method:"PATCH",body:JSON.stringify(r)})},onSuccess:(t,r)=>{let{serverName:n}=r;e.invalidateQueries({queryKey:["servers",n,"config"]}),e.invalidateQueries({queryKey:["servers",n]})}})}function S(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/servers/".concat(encodeURIComponent(e),"/world/reset"),{method:"POST"}),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["servers",r]}),e.invalidateQueries({queryKey:["worlds"]})}})}function C(){return(0,n.a)({queryKey:["router-status"],queryFn:()=>(0,i.SC)("/api/router/status"),refetchInterval:3e4})}function j(){return(0,n.a)({queryKey:["backup-status"],queryFn:()=>(0,i.SC)("/api/backup"),refetchInterval:6e4})}function b(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(0,n.a)({queryKey:["backup-history",e],queryFn:()=>(0,i.SC)("/api/backup/history?limit=".concat(e)),refetchInterval:6e4})}function Z(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>{let{message:t}=e;return(0,i.SC)("/api/backup",{method:"POST",body:JSON.stringify({message:t})})},onSuccess:()=>{e.invalidateQueries({queryKey:["backup-status"]}),e.invalidateQueries({queryKey:["backup-history"]})}})}function w(){let e=(0,s.NL)();return(0,o.D)({mutationFn:e=>(0,i.SC)("/api/backup/restore",{method:"POST",body:JSON.stringify({commitHash:e})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worlds"]}),e.invalidateQueries({queryKey:["servers"]})}})}},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,[u,d]=(0,n.useState)(null),[h,m]=(0,n.useState)("disconnected"),[p,x]=(0,n.useState)(null),[f,v]=(0,n.useState)(0),y=(0,n.useRef)(null),g=(0,n.useCallback)(e=>{d(e),null==r||r(e)},[r]),S=(0,n.useCallback)(e=>{m(e),"connected"===e&&v(0)},[]),C=(0,n.useCallback)(e=>{x(e),"number"==typeof e.retryCount&&v(e.retryCount),null==o||o(e)},[o]),j=(0,n.useCallback)(()=>{y.current&&(y.current.reconnect(),v(y.current.getRetryCount()))},[]),b=(0,n.useCallback)(()=>{y.current&&y.current.disconnect()},[]);return(0,n.useEffect)(()=>{if(!l){y.current&&(y.current.disconnect(),y.current=null);return}return y.current||(y.current=new s),y.current.connect({url:t,onMessage:g,onStateChange:S,onError:C,reconnectInterval:i,maxReconnectAttempts:a,withCredentials:c}),()=>{y.current&&(y.current.disconnect(),y.current=null)}},[t,l,i,a,c,g,S,C]),{data:u,isConnected:"connected"===h,state:h,error:p,retryCount:f,reconnect:j,disconnect:b}}},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:u,retryCount:d}=(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:u,retryCount:d}}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,9810,7073,880,1658,6909,6727,190,5386,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,n,t){Promise.resolve().then(t.bind(t,32539))},76544:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)([(0,c.jsx)("path",{d:"m7.3 14.7 1.2-1.2c-1-1-1.5-2.3-1.5-3.5 0-1.3.5-2.6 1.5-3.5L7.3 5.3c-1.3 1.3-2 3-2 4.7s.7 3.4 2 4.7M19.1 2.9l-1.2 1.2c1.6 1.6 2.4 3.8 2.4 5.9 0 2.1-.8 4.3-2.4 5.9l1.2 1.2c2-2 2.9-4.5 2.9-7.1 0-2.6-1-5.1-2.9-7.1"},"0"),(0,c.jsx)("path",{d:"M6.1 4.1 4.9 2.9C3 4.9 2 7.4 2 10c0 2.6 1 5.1 2.9 7.1l1.2-1.2c-1.6-1.6-2.4-3.8-2.4-5.9 0-2.1.8-4.3 2.4-5.9m10.6 10.6c1.3-1.3 2-3 2-4.7-.1-1.7-.7-3.4-2-4.7l-1.2 1.2c1 1 1.5 2.3 1.5 3.5 0 1.3-.5 2.6-1.5 3.5zM14.5 10c0-1.38-1.12-2.5-2.5-2.5S9.5 8.62 9.5 10c0 .76.34 1.42.87 1.88L7 22h2l.67-2h4.67l.66 2h2l-3.37-10.12c.53-.46.87-1.12.87-1.88m-4.17 8L12 13l1.67 5z"},"1")],"CellTower")},23695:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info")},70603:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock")},21605:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M15.9 5c-.17 0-.32.09-.41.23l-.07.15-5.18 11.65c-.16.29-.26.61-.26.96 0 1.11.9 2.01 2.01 2.01.96 0 1.77-.68 1.96-1.59l.01-.03L16.4 5.5c0-.28-.22-.5-.5-.5M1 9l2 2c2.88-2.88 6.79-4.08 10.53-3.62l1.19-2.68C9.89 3.84 4.74 5.27 1 9m20 2 2-2c-1.64-1.64-3.55-2.82-5.59-3.57l-.53 2.82c1.5.62 2.9 1.53 4.12 2.75m-4 4 2-2c-.8-.8-1.7-1.42-2.66-1.89l-.55 2.92c.42.27.83.59 1.21.97M5 13l2 2c1.13-1.13 2.56-1.79 4.03-2l1.28-2.88c-2.63-.08-5.3.87-7.31 2.88"}),"NetworkCheck")},29983:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"m20.2 5.9.8-.8C19.6 3.7 17.8 3 16 3s-3.6.7-5 2.1l.8.8C13 4.8 14.5 4.2 16 4.2s3 .6 4.2 1.7m-.9.8c-.9-.9-2.1-1.4-3.3-1.4s-2.4.5-3.3 1.4l.8.8c.7-.7 1.6-1 2.5-1 .9 0 1.8.3 2.5 1zM19 13h-2V9h-2v4H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2M8 18H6v-2h2zm3.5 0h-2v-2h2zm3.5 0h-2v-2h2z"}),"Router")},87739:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.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")},42730:function(e,n,t){"use strict";var r=t(8091);n.Z=void 0;var i=r(t(66758)),c=t(94655);n.Z=(0,i.default)((0,c.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff")},66758:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=t(26505)},52082:function(e,n,t){"use strict";t.d(n,{Z:function(){return z}});var r,i=t(32324),c=t(81500),o=t(35106),s=t(70316),a=t(65951),l=t(38762),u=t(31317),d=t(14406),f=t(85016),v=t(34519),h=t(11379),p=t(9049);function Z(e){return(0,p.ZP)("MuiInputAdornment",e)}let m=(0,h.Z)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var x=t(28057),b=t(94655);let g=["children","className","component","disablePointerEvents","disableTypography","position","variant"],j=e=>{let{classes:n,disablePointerEvents:t,hiddenLabel:r,position:i,size:c,variant:o}=e,s={root:["root",t&&"disablePointerEvents",i&&"position".concat((0,l.Z)(i)),o,r&&"hiddenLabel",c&&"size".concat((0,l.Z)(c))]};return(0,a.Z)(s,Z,n)},M=(0,v.ZP)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:t}=e;return[n.root,n["position".concat((0,l.Z)(t.position))],!0===t.disablePointerEvents&&n.disablePointerEvents,n[t.variant]]}})(e=>{let{theme:n,ownerState:t}=e;return(0,c.Z)({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(n.vars||n).palette.action.active},"filled"===t.variant&&{["&.".concat(m.positionStart,"&:not(.").concat(m.hiddenLabel,")")]:{marginTop:16}},"start"===t.position&&{marginRight:8},"end"===t.position&&{marginLeft:8},!0===t.disablePointerEvents&&{pointerEvents:"none"})});var z=o.forwardRef(function(e,n){let t=(0,x.i)({props:e,name:"MuiInputAdornment"}),{children:a,className:l,component:v="div",disablePointerEvents:h=!1,disableTypography:p=!1,position:Z,variant:m}=t,z=(0,i.Z)(t,g),y=(0,f.Z)()||{},E=m;m&&y.variant,y&&!E&&(E=y.variant);let C=(0,c.Z)({},t,{hiddenLabel:y.hiddenLabel,size:y.size,disablePointerEvents:h,position:Z,variant:E}),S=j(C);return(0,b.jsx)(d.Z.Provider,{value:null,children:(0,b.jsx)(M,(0,c.Z)({as:v,ownerState:C,className:(0,s.Z)(S.root,l),ref:n},z,{children:"string"!=typeof a||p?(0,b.jsxs)(o.Fragment,{children:["start"===Z?r||(r=(0,b.jsx)("span",{className:"notranslate",children:"​"})):null,a]}):(0,b.jsx)(u.Z,{color:"text.secondary",children:a})}))})})},27350:function(e,n,t){"use strict";var r=t(34834);n.Z=r.Z},26505:function(e,n,t){"use strict";t.r(n),t.d(n,{capitalize:function(){return i.Z},createChainedFunction:function(){return c.Z},createSvgIcon:function(){return o.Z},debounce:function(){return s.Z},deprecatedPropType:function(){return a},isMuiElement:function(){return l.Z},ownerDocument:function(){return u.Z},ownerWindow:function(){return d.Z},requirePropFactory:function(){return f},setRef:function(){return v},unstable_ClassNameGenerator:function(){return j},unstable_useEnhancedEffect:function(){return h.Z},unstable_useId:function(){return p.Z},unsupportedProp:function(){return Z},useControlled:function(){return m.Z},useEventCallback:function(){return x.Z},useForkRef:function(){return b.Z},useIsFocusVisible:function(){return g.Z}});var r=t(74055),i=t(38762),c=t(27350),o=t(61626),s=t(19521),a=function(e,n){return()=>null},l=t(9290),u=t(34713),d=t(99466);t(81500);var f=function(e,n){return()=>null},v=t(25880).Z,h=t(65425),p=t(88207),Z=function(e,n,t,r,i){return null},m=t(18280),x=t(10620),b=t(38481),g=t(22125);let j={configure:e=>{r.Z.configure(e)}}},88207:function(e,n,t){"use strict";var r=t(40552);n.Z=r.Z},32539:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return d}});var r=t(94655),i=t(35106),c=t(7281),o=t(31317),s=t(37530),a=t(81071),l=t(87739),u=t(11189);function d(){let[e,n]=(0,i.useState)({open:!1,message:"",severity:"success"}),t=e=>{n({open:!0,message:e,severity:"success"})},d=e=>{n({open:!0,message:e,severity:"error"})},f=()=>{n(e=>({...e,open:!1}))};return(0,r.jsxs)(c.Z,{children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:4},children:[(0,r.jsx)(l.Z,{sx:{fontSize:32},color:"primary"}),(0,r.jsx)(o.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Settings"})]}),(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column",gap:3,maxWidth:700},children:[(0,r.jsx)(u.zd,{onSuccess:t,onError:d}),(0,r.jsx)(u.ms,{onSuccess:t,onError:d}),(0,r.jsx)(u.eE,{})]}),(0,r.jsx)(s.Z,{open:e.open,autoHideDuration:6e3,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,r.jsx)(a.Z,{onClose:f,severity:e.severity,variant:"filled",sx:{width:"100%"},children:e.message})})]})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,9810,2542,9654,5381,1721,1189,3669,2757,1744],function(){return e(e.s=70861)}),_N_E=e.O()}]);