@minecraft-docker/mcctl-console 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/.next/standalone/platform/services/mcctl-console/.next/BUILD_ID +1 -1
  2. package/.next/standalone/platform/services/mcctl-console/.next/app-build-manifest.json +94 -93
  3. package/.next/standalone/platform/services/mcctl-console/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/standalone/platform/services/mcctl-console/.next/build-manifest.json +4 -4
  5. package/.next/standalone/platform/services/mcctl-console/.next/prerender-manifest.json +1 -1
  6. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page.js +1 -1
  7. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page.js.nft.json +1 -1
  8. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/admin/users/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js +51 -1
  10. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page.js.nft.json +1 -1
  11. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/audit-logs/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js +1 -1
  13. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page.js.nft.json +1 -1
  14. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/backups/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js +51 -1
  16. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page.js.nft.json +1 -1
  17. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/dashboard/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js +1 -1
  19. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page.js.nft.json +1 -1
  20. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/players/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js +51 -1
  22. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page.js.nft.json +1 -1
  23. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/routing/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/console/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js +1 -1
  26. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page.js.nft.json +1 -1
  27. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/[name]/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js +1 -1
  29. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page.js.nft.json +1 -1
  30. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/servers/page_client-reference-manifest.js +1 -1
  31. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page.js +1 -1
  32. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page.js.nft.json +1 -1
  33. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js +1 -1
  35. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page.js.nft.json +1 -1
  36. package/.next/standalone/platform/services/mcctl-console/.next/server/app/(main)/worlds/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.html +1 -1
  39. package/.next/standalone/platform/services/mcctl-console/.next/server/app/_not-found.rsc +1 -1
  40. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/start/route.js +1 -0
  41. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/start/route.js.nft.json +1 -0
  42. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/status/route.js +1 -0
  43. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/status/route.js.nft.json +1 -0
  44. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/stop/route.js +1 -0
  45. package/.next/standalone/platform/services/mcctl-console/.next/server/app/api/playit/stop/route.js.nft.json +1 -0
  46. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.html +1 -1
  47. package/.next/standalone/platform/services/mcctl-console/.next/server/app/audit-logs.rsc +2 -2
  48. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.html +1 -1
  49. package/.next/standalone/platform/services/mcctl-console/.next/server/app/backups.rsc +2 -2
  50. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.html +1 -1
  51. package/.next/standalone/platform/services/mcctl-console/.next/server/app/dashboard.rsc +2 -2
  52. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.html +1 -1
  53. package/.next/standalone/platform/services/mcctl-console/.next/server/app/index.rsc +1 -1
  54. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.html +1 -1
  56. package/.next/standalone/platform/services/mcctl-console/.next/server/app/login.rsc +1 -1
  57. package/.next/standalone/platform/services/mcctl-console/.next/server/app/page_client-reference-manifest.js +1 -1
  58. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.html +1 -1
  59. package/.next/standalone/platform/services/mcctl-console/.next/server/app/players.rsc +2 -2
  60. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.html +1 -1
  61. package/.next/standalone/platform/services/mcctl-console/.next/server/app/routing.rsc +2 -2
  62. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.html +1 -1
  63. package/.next/standalone/platform/services/mcctl-console/.next/server/app/servers.rsc +2 -2
  64. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.html +1 -1
  65. package/.next/standalone/platform/services/mcctl-console/.next/server/app/settings.rsc +2 -2
  66. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup/page_client-reference-manifest.js +1 -1
  67. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.html +1 -1
  68. package/.next/standalone/platform/services/mcctl-console/.next/server/app/signup.rsc +1 -1
  69. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.html +1 -1
  70. package/.next/standalone/platform/services/mcctl-console/.next/server/app/worlds.rsc +2 -2
  71. package/.next/standalone/platform/services/mcctl-console/.next/server/app-paths-manifest.json +24 -21
  72. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1309.js +1 -1
  73. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/2658.js +1 -0
  74. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3810.js +1 -0
  75. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4207.js +1 -0
  76. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4609.js +1 -0
  77. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/4859.js +1 -0
  78. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5843.js +1 -0
  79. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5845.js +51 -0
  80. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7402.js +54 -0
  81. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/7445.js +1 -0
  82. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8504.js +2 -0
  83. package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-build-manifest.js +1 -1
  84. package/.next/standalone/platform/services/mcctl-console/.next/server/middleware-manifest.json +5 -5
  85. package/.next/standalone/platform/services/mcctl-console/.next/server/next-font-manifest.js +1 -1
  86. package/.next/standalone/platform/services/mcctl-console/.next/server/next-font-manifest.json +1 -1
  87. package/.next/standalone/platform/services/mcctl-console/.next/server/pages/404.html +1 -1
  88. package/.next/standalone/platform/services/mcctl-console/.next/server/pages/500.html +1 -1
  89. package/.next/standalone/platform/services/mcctl-console/.next/server/server-reference-manifest.json +1 -1
  90. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/190-9ecdd3c2ad7fadef.js +1 -0
  91. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2538-09440cfe5c38aa16.js +1 -0
  92. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2698-aeed063326ab23db.js +1 -0
  93. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2844-de6e17c136b0de1e.js +1 -0
  94. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/3468-6b2e00f103a95869.js +1 -0
  95. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4596-fa980f5e0b65f2b7.js +1 -0
  96. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/5386-a568e84580b1d208.js +1 -0
  97. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7965-9d8c883e48d2ae13.js +1 -0
  98. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/8854-11e2a182afd76dcd.js +1 -0
  99. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9186-5b49ecbdcac7ddc4.js +1 -0
  100. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9727-8e82372636a2fca6.js +1 -0
  101. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9951-34eb9e4c6b6cdd23.js +1 -0
  102. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/admin/users/page-b4483a2e5c12dce7.js +1 -0
  103. package/.next/{static/chunks/app/(main)/audit-logs/page-592b5471bbfd01e3.js → standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/page-2763a56ce0490dd1.js} +1 -1
  104. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/backups/{page-201b9f9aecc8932e.js → page-76da68ecfd3fd38f.js} +1 -1
  105. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/page-b2677b1041311201.js +1 -0
  106. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-a06b9b52377085b5.js +1 -0
  107. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-8333f2419cbdd686.js +1 -0
  108. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-00a86e5a4cd95b72.js +1 -0
  109. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/{page-9d374aef836cdbae.js → page-c5378a7bfc6472ca.js} +1 -1
  110. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/settings/page-af345917f438de8d.js +1 -0
  111. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-01447db96eaf75eb.js +1 -0
  112. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/{main-c1b58e7640294abf.js → main-0309b77c14e952d4.js} +1 -1
  113. package/.next/static/chunks/190-9ecdd3c2ad7fadef.js +1 -0
  114. package/.next/static/chunks/2538-09440cfe5c38aa16.js +1 -0
  115. package/.next/static/chunks/2698-aeed063326ab23db.js +1 -0
  116. package/.next/static/chunks/2844-de6e17c136b0de1e.js +1 -0
  117. package/.next/static/chunks/3468-6b2e00f103a95869.js +1 -0
  118. package/.next/static/chunks/4596-fa980f5e0b65f2b7.js +1 -0
  119. package/.next/static/chunks/5386-a568e84580b1d208.js +1 -0
  120. package/.next/static/chunks/7965-9d8c883e48d2ae13.js +1 -0
  121. package/.next/static/chunks/8854-11e2a182afd76dcd.js +1 -0
  122. package/.next/static/chunks/9186-5b49ecbdcac7ddc4.js +1 -0
  123. package/.next/static/chunks/9727-8e82372636a2fca6.js +1 -0
  124. package/.next/static/chunks/9951-34eb9e4c6b6cdd23.js +1 -0
  125. package/.next/static/chunks/app/(main)/admin/users/page-b4483a2e5c12dce7.js +1 -0
  126. package/.next/{standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/audit-logs/page-592b5471bbfd01e3.js → static/chunks/app/(main)/audit-logs/page-2763a56ce0490dd1.js} +1 -1
  127. package/.next/static/chunks/app/(main)/backups/{page-201b9f9aecc8932e.js → page-76da68ecfd3fd38f.js} +1 -1
  128. package/.next/static/chunks/app/(main)/dashboard/page-b2677b1041311201.js +1 -0
  129. package/.next/static/chunks/app/(main)/players/page-a06b9b52377085b5.js +1 -0
  130. package/.next/static/chunks/app/(main)/routing/page-8333f2419cbdd686.js +1 -0
  131. package/.next/static/chunks/app/(main)/servers/[name]/page-00a86e5a4cd95b72.js +1 -0
  132. package/.next/static/chunks/app/(main)/servers/{page-9d374aef836cdbae.js → page-c5378a7bfc6472ca.js} +1 -1
  133. package/.next/static/chunks/app/(main)/settings/page-af345917f438de8d.js +1 -0
  134. package/.next/static/chunks/app/(main)/worlds/page-01447db96eaf75eb.js +1 -0
  135. package/.next/static/chunks/{main-c1b58e7640294abf.js → main-0309b77c14e952d4.js} +1 -1
  136. package/package.json +2 -2
  137. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1080.js +0 -1
  138. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/1314.js +0 -54
  139. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/3434.js +0 -1
  140. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5019.js +0 -1
  141. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5068.js +0 -1
  142. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/5466.js +0 -2
  143. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/701.js +0 -1
  144. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8685.js +0 -1
  145. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8849.js +0 -1
  146. package/.next/standalone/platform/services/mcctl-console/.next/server/chunks/8913.js +0 -51
  147. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1189-9b2b752dc97065ac.js +0 -1
  148. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/1854-71dbad60b363e57e.js +0 -1
  149. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/2777-90cc701b41e837af.js +0 -1
  150. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/4668-f487c5c564e045d6.js +0 -1
  151. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/521-a5b59e2a19c8dd4f.js +0 -1
  152. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/6479-f31fbc0f2cf7ddd0.js +0 -1
  153. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/7359-45760f0e0e93f86b.js +0 -1
  154. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/892-a0f20ea0df618c15.js +0 -1
  155. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9058-02ac41562ff141d0.js +0 -1
  156. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9154-c792f0aadd25fffe.js +0 -1
  157. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/9654-84c0d7b06321aab9.js +0 -1
  158. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/admin/users/page-48f4e3bdef6c2202.js +0 -1
  159. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/dashboard/page-626f566be94160eb.js +0 -1
  160. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/players/page-a655062812711f1b.js +0 -1
  161. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/routing/page-7797d4cf74c7fa77.js +0 -1
  162. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/servers/[name]/page-f1026a973b0f8ac1.js +0 -1
  163. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/settings/page-fe918cc58acd9ed9.js +0 -1
  164. package/.next/standalone/platform/services/mcctl-console/.next/static/chunks/app/(main)/worlds/page-2e4a4b525d3b0f1d.js +0 -1
  165. package/.next/static/chunks/1189-9b2b752dc97065ac.js +0 -1
  166. package/.next/static/chunks/1854-71dbad60b363e57e.js +0 -1
  167. package/.next/static/chunks/2777-90cc701b41e837af.js +0 -1
  168. package/.next/static/chunks/4668-f487c5c564e045d6.js +0 -1
  169. package/.next/static/chunks/521-a5b59e2a19c8dd4f.js +0 -1
  170. package/.next/static/chunks/6479-f31fbc0f2cf7ddd0.js +0 -1
  171. package/.next/static/chunks/7359-45760f0e0e93f86b.js +0 -1
  172. package/.next/static/chunks/892-a0f20ea0df618c15.js +0 -1
  173. package/.next/static/chunks/9058-02ac41562ff141d0.js +0 -1
  174. package/.next/static/chunks/9154-c792f0aadd25fffe.js +0 -1
  175. package/.next/static/chunks/9654-84c0d7b06321aab9.js +0 -1
  176. package/.next/static/chunks/app/(main)/admin/users/page-48f4e3bdef6c2202.js +0 -1
  177. package/.next/static/chunks/app/(main)/dashboard/page-626f566be94160eb.js +0 -1
  178. package/.next/static/chunks/app/(main)/players/page-a655062812711f1b.js +0 -1
  179. package/.next/static/chunks/app/(main)/routing/page-7797d4cf74c7fa77.js +0 -1
  180. package/.next/static/chunks/app/(main)/servers/[name]/page-f1026a973b0f8ac1.js +0 -1
  181. package/.next/static/chunks/app/(main)/settings/page-fe918cc58acd9ed9.js +0 -1
  182. package/.next/static/chunks/app/(main)/worlds/page-2e4a4b525d3b0f1d.js +0 -1
  183. /package/.next/standalone/platform/services/mcctl-console/.next/static/{0yTJAIAp_3b6rB4bkr7KX → 6Zejk2EJ9K70rNE23ZkEu}/_buildManifest.js +0 -0
  184. /package/.next/standalone/platform/services/mcctl-console/.next/static/{0yTJAIAp_3b6rB4bkr7KX → 6Zejk2EJ9K70rNE23ZkEu}/_ssgManifest.js +0 -0
  185. /package/.next/static/{0yTJAIAp_3b6rB4bkr7KX → 6Zejk2EJ9K70rNE23ZkEu}/_buildManifest.js +0 -0
  186. /package/.next/static/{0yTJAIAp_3b6rB4bkr7KX → 6Zejk2EJ9K70rNE23ZkEu}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5931],{66289:function(e,t,r){Promise.resolve().then(r.bind(r,12256))},71185:function(e,t,r){"use strict";var i=r(8091);t.Z=void 0;var n=i(r(66758)),l=r(94655);t.Z=(0,n.default)((0,l.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},69123:function(e,t,r){"use strict";var i=r(32324),n=r(81500),l=r(35106),a=r(70316),o=r(65951),s=r(64577),c=r(34519),d=r(28057),h=r(16945),u=r(94655);let x=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],m=e=>{let{absolute:t,children:r,classes:i,flexItem:n,light:l,orientation:a,textAlign:s,variant:c}=e;return(0,o.Z)({root:["root",t&&"absolute",c,l&&"light","vertical"===a&&"vertical",n&&"flexItem",r&&"withChildren",r&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},h.V,i)},v=(0,c.ZP)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})(e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},r.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},r.light&&{borderColor:t.vars?"rgba(".concat(t.vars.palette.dividerChannel," / 0.08)"):(0,s.Fq)(t.palette.divider,.08)},"inset"===r.variant&&{marginLeft:72},"middle"===r.variant&&"horizontal"===r.orientation&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},"middle"===r.variant&&"vertical"===r.orientation&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},"vertical"===r.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},r.flexItem&&{alignSelf:"stretch",height:"auto"})},e=>{let{ownerState:t}=e;return(0,n.Z)({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}})},e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({},r.children&&"vertical"!==r.orientation&&{"&::before, &::after":{width:"100%",borderTop:"thin solid ".concat((t.vars||t).palette.divider),borderTopStyle:"inherit"}})},e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({},r.children&&"vertical"===r.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:"thin solid ".concat((t.vars||t).palette.divider),borderLeftStyle:"inherit"}})},e=>{let{ownerState:t}=e;return(0,n.Z)({},"right"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})}),Z=(0,c.ZP)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})(e=>{let{theme:t,ownerState:r}=e;return(0,n.Z)({display:"inline-block",paddingLeft:"calc(".concat(t.spacing(1)," * 1.2)"),paddingRight:"calc(".concat(t.spacing(1)," * 1.2)")},"vertical"===r.orientation&&{paddingTop:"calc(".concat(t.spacing(1)," * 1.2)"),paddingBottom:"calc(".concat(t.spacing(1)," * 1.2)")})}),f=l.forwardRef(function(e,t){let r=(0,d.i)({props:e,name:"MuiDivider"}),{absolute:l=!1,children:o,className:s,component:c=o?"div":"hr",flexItem:h=!1,light:f=!1,orientation:p="horizontal",role:g="hr"!==c?"separator":void 0,textAlign:j="center",variant:b="fullWidth"}=r,y=(0,i.Z)(r,x),w=(0,n.Z)({},r,{absolute:l,component:c,flexItem:h,light:f,orientation:p,role:g,textAlign:j,variant:b}),C=m(w);return(0,u.jsx)(v,(0,n.Z)({as:c,className:(0,a.Z)(C.root,s),role:g,ref:t,ownerState:w},y,{children:o?(0,u.jsx)(Z,{className:C.wrapper,ownerState:w,children:o}):null}))});f.muiSkipListHighlight=!0,t.Z=f},16945:function(e,t,r){"use strict";r.d(t,{V:function(){return l}});var i=r(11379),n=r(9049);function l(e){return(0,n.ZP)("MuiDivider",e)}let a=(0,i.Z)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);t.Z=a},53281:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var i=r(81500),n=r(32324),l=r(35106),a=r(70316),o=r(65951),s=r(28057),c=r(34519),d=r(11379),h=r(9049);function u(e){return(0,h.ZP)("MuiTableContainer",e)}(0,d.Z)("MuiTableContainer",["root"]);var x=r(94655);let m=["className","component"],v=e=>{let{classes:t}=e;return(0,o.Z)({root:["root"]},u,t)},Z=(0,c.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"});var f=l.forwardRef(function(e,t){let r=(0,s.i)({props:e,name:"MuiTableContainer"}),{className:l,component:o="div"}=r,c=(0,n.Z)(r,m),d=(0,i.Z)({},r,{component:o}),h=v(d);return(0,x.jsx)(Z,(0,i.Z)({ref:t,as:o,className:(0,a.Z)(h.root,l),ownerState:d},c))})},12256:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return R}});var i=r(94655),n=r(35106),l=r(7281),a=r(93017),o=r(81071),s=r(31317),c=r(5632),d=r(6986),h=r(53281),u=r(69899),x=r(21138),m=r(11254),v=r(70366),Z=r(47001),f=r(84811),p=r(25333);function g(e){let{users:t,onUserClick:r}=e;return 0===t.length?(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",p:4},children:(0,i.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"No users found"})}):(0,i.jsx)(h.Z,{component:u.Z,children:(0,i.jsxs)(x.Z,{children:[(0,i.jsx)(m.Z,{children:(0,i.jsxs)(v.Z,{children:[(0,i.jsx)(Z.Z,{children:"Email"}),(0,i.jsx)(Z.Z,{children:"Name"}),(0,i.jsx)(Z.Z,{children:"Role"}),(0,i.jsx)(Z.Z,{children:"Status"}),(0,i.jsx)(Z.Z,{children:"Created At"})]})}),(0,i.jsx)(f.Z,{children:t.map(e=>(0,i.jsxs)(v.Z,{hover:!0,onClick:()=>r(e),sx:{cursor:"pointer"},children:[(0,i.jsx)(Z.Z,{children:e.email}),(0,i.jsx)(Z.Z,{children:e.name||"N/A"}),(0,i.jsx)(Z.Z,{children:"admin"===e.role?(0,i.jsx)(p.Z,{label:"Admin",color:"primary",size:"small"}):(0,i.jsx)(p.Z,{label:"User",size:"small"})}),(0,i.jsx)(Z.Z,{children:e.banned?(0,i.jsx)(p.Z,{label:"Banned",color:"error",size:"small"}):(0,i.jsx)(p.Z,{label:"Active",color:"success",size:"small"})}),(0,i.jsx)(Z.Z,{children:new Date(e.createdAt).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]},e.id))})]})})}var j=r(99770),b=r(62508),y=r(79983),w=r(5682),C=r(69123),A=r(71185);function S(e){let{user:t,open:r,onClose:n}=e;return(0,i.jsxs)(j.Z,{open:r,onClose:n,maxWidth:"sm",fullWidth:!0,children:[(0,i.jsx)(b.Z,{children:(0,i.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(s.Z,{variant:"h6",children:"User Details"}),(0,i.jsx)(y.Z,{onClick:n,size:"small","aria-label":"close",children:(0,i.jsx)(A.Z,{})})]})}),(0,i.jsx)(w.Z,{children:(0,i.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:[(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Email"}),(0,i.jsx)(s.Z,{variant:"body1",children:t.email})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Name"}),(0,i.jsx)(s.Z,{variant:"body1",children:t.name||"N/A"})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Role"}),(0,i.jsx)(l.Z,{sx:{mt:.5},children:"admin"===t.role?(0,i.jsx)(p.Z,{label:"Admin",color:"primary",size:"small"}):(0,i.jsx)(p.Z,{label:"User",size:"small"})})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Status"}),(0,i.jsx)(l.Z,{sx:{mt:.5},children:t.banned?(0,i.jsx)(p.Z,{label:"Banned",color:"error",size:"small"}):(0,i.jsx)(p.Z,{label:"Active",color:"success",size:"small"})})]}),(0,i.jsx)(C.Z,{}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"Created At"}),(0,i.jsx)(s.Z,{variant:"body2",children:new Date(t.createdAt).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]}),(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(s.Z,{variant:"caption",color:"text.secondary",children:"User ID"}),(0,i.jsx)(s.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:t.id})]})]})})]})}function R(){let{data:e,isLoading:t,isError:r,error:h}=(0,c.a)({queryKey:["admin","users"],queryFn:async()=>{let{data:e,error:t}=await d.zB.listUsers({query:{}});if(t)throw Error(t.message||"Failed to fetch users");return(null==e?void 0:e.users)?e.users.map(e=>{var t,r,i;return{id:e.id,email:e.email,name:null!==(t=e.name)&&void 0!==t?t:null,role:null!==(r=e.role)&&void 0!==r?r:"user",banned:null!==(i=e.banned)&&void 0!==i&&i,createdAt:new Date(e.createdAt)}}):[]}}),[u,x]=(0,n.useState)(null);return t?(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"400px"},children:(0,i.jsx)(a.Z,{})}):r?(0,i.jsx)(l.Z,{sx:{p:3},children:(0,i.jsxs)(o.Z,{severity:"error",children:["Failed to load users. ",(null==h?void 0:h.message)||"Please try again later."]})}):(0,i.jsxs)(l.Z,{sx:{p:3},children:[(0,i.jsx)(s.Z,{variant:"h4",component:"h1",gutterBottom:!0,children:"User Management"}),(0,i.jsx)(g,{users:e||[],onUserClick:e=>{x(e)}}),u&&(0,i.jsx)(S,{user:u,open:!0,onClose:()=>{x(null)}})]})}},6986:function(e,t,r){"use strict";r.d(t,{Cp:function(){return u},Nq:function(){return h},cg:function(){return o},kP:function(){return d},w7:function(){return s},y1:function(){return c},zB:function(){return x}});var i=r(77054),n=r(61648),l=r(35016);let a=(0,i.X)({baseURL:l.env.NEXT_PUBLIC_BETTER_AUTH_URL||"",plugins:[(0,n.zB)()]}),{signIn:o,signOut:s,signUp:c,useSession:d,updateUser:h,changePassword:u}=a,x=a.admin}},function(e){e.O(0,[6812,9760,6758,680,1071,540,4416,2542,880,2844,3669,2757,1744],function(){return e(e.s=66289)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4743],{3590:function(e,t,r){Promise.resolve().then(r.bind(r,52791))},52791:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return eS}});var n=r(94655),s=r(35106),i=r(74228),a=r(7281),o=r(69899),l=r(31317),c=r(25333),d=r(76492),u=r(80620),x=r(78439),h=r(56813),m=r(26892),p=r(84840),g=r(628),j=r(41565),f=r(10721),v=r(69178),Z=r(46207),y=r(45354),b=r(35847);function S(e){var t,r,s;let{stats:i,isLoading:o}=e;if(o)return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:[0,1,2,3].map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{children:(0,n.jsxs)(j.Z,{children:[(0,n.jsx)(f.Z,{variant:"text",width:"60%"}),(0,n.jsx)(f.Z,{variant:"text",width:"40%",height:40}),(0,n.jsx)(f.Z,{variant:"text",width:"80%"})]})})},e))});let c=null!==(t=null==i?void 0:i.total)&&void 0!==t?t:0,d=c>0?((null!==(r=null==i?void 0:i.byStatus.success)&&void 0!==r?r:0)/c*100).toFixed(1):"0.0",u=null!==(s=null==i?void 0:i.byStatus.failure)&&void 0!==s?s:0,x=i?Object.keys(i.byActor).length:0,h=[{title:"Total Logs",value:c.toLocaleString(),icon:(0,n.jsx)(v.Z,{fontSize:"large"}),color:"#1bd96a",description:"All audit log entries"},{title:"Success Rate",value:"".concat(d,"%"),icon:(0,n.jsx)(Z.Z,{fontSize:"large"}),color:"#22c55e",description:"Successful operations"},{title:"Failures",value:u,icon:(0,n.jsx)(y.Z,{fontSize:"large"}),color:"#ef4444",description:"Failed operations"},{title:"Active Users",value:x,icon:(0,n.jsx)(b.Z,{fontSize:"large"}),color:"#3b82f6",description:"Unique actors"}];return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:h.map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:e.color}},children:(0,n.jsxs)(j.Z,{children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:e.title}),(0,n.jsx)(a.Z,{sx:{color:e.color,opacity:.8},children:e.icon})]}),(0,n.jsx)(l.Z,{variant:"h3",component:"div",sx:{fontWeight:700,color:"text.primary",mb:1},children:e.value}),(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",children:e.description})]})})},e.title))})}var C=r(97436),w=r(62328),T=r(7178),k=r(29793),z=r(75726),N=r(30417),R=r(87716),A=r(79983),E=r(89923),I=r(10297),F=r(50880),L=r(54617),D=r(42431),P=r(81960),W=r(84284),M=r(82925);function O(e){return"server"===e?M.Xn:"player"===e?M.KK:M.xg}function U(e){let t,{filters:r,onFiltersChange:i,onExport:o}=e,[d,u]=(0,s.useState)(!0),x=(t=0,r.action&&t++,r.actor&&t++,r.targetType&&t++,r.targetName&&t++,r.status&&t++,r.from&&t++,r.to&&t++,t),h=O(r.targetType),m=(e,t)=>{let n={...r};""===t||void 0===t?delete n[e]:n[e]=t,"targetType"===e&&n.action&&!O(t).includes(n.action)&&delete n.action,n.offset=0,i(n)};return(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:d?2:0},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsxs)(A.Z,{onClick:()=>u(!d),size:"small","aria-label":d?"Collapse filters":"Expand filters",children:[(0,n.jsx)(F.Z,{}),d?(0,n.jsx)(W.Z,{sx:{fontSize:14}}):(0,n.jsx)(P.Z,{sx:{fontSize:14}})]}),(0,n.jsx)(l.Z,{variant:"subtitle2",color:"text.secondary",children:"Filters"}),x>0&&(0,n.jsx)(c.Z,{label:x,size:"small",color:"primary",sx:{height:20,fontSize:"0.7rem"}})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[x>0&&(0,n.jsx)(N.Z,{size:"small",startIcon:(0,n.jsx)(L.Z,{}),onClick:()=>{i({limit:r.limit,sort:r.sort})},color:"inherit",children:"Clear All"}),o&&(0,n.jsx)(N.Z,{size:"small",variant:"outlined",onClick:o,children:"Export"})]})]}),(0,n.jsx)(R.Z,{in:d,children:(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:2,flexWrap:"wrap"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1,alignItems:"center"},children:[(0,n.jsx)(C.Z,{type:"date",label:"From",size:"small",value:r.from?r.from.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("from",t?"".concat(t,"T00:00:00Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"~"}),(0,n.jsx)(C.Z,{type:"date",label:"To",size:"small",value:r.to?r.to.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("to",t?"".concat(t,"T23:59:59Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}})]}),(0,n.jsxs)(k.Z,{size:"small",sx:{minWidth:160},children:[(0,n.jsx)(z.Z,{children:"Action"}),(0,n.jsxs)(w.Z,{value:r.action||"",label:"Action",onChange:e=>m("action",e.target.value||void 0),children:[(0,n.jsx)(T.Z,{value:"",children:"All Actions"}),h.map(e=>(0,n.jsx)(T.Z,{value:e,children:M.n3[e]||e},e))]})]}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.targetType||"",exclusive:!0,onChange:(e,t)=>m("targetType",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All targets",children:"All"}),(0,n.jsx)(E.Z,{value:"server","aria-label":"Server targets",children:"Server"}),(0,n.jsx)(E.Z,{value:"player","aria-label":"Player targets",children:"Player"})]})}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.status||"",exclusive:!0,onChange:(e,t)=>m("status",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All statuses",children:"All"}),(0,n.jsx)(E.Z,{value:"success","aria-label":"Success only",children:"Success"}),(0,n.jsx)(E.Z,{value:"failure","aria-label":"Failure only",children:"Failure"})]})}),(0,n.jsx)(C.Z,{label:"Target Name",placeholder:"Search...",size:"small",value:r.targetName||"",onChange:e=>m("targetName",e.target.value||void 0),InputProps:{startAdornment:(0,n.jsx)(D.Z,{sx:{color:"text.secondary",mr:.5,fontSize:18}})},sx:{minWidth:160}}),(0,n.jsx)(C.Z,{label:"Actor",placeholder:"e.g., api:admin",size:"small",value:r.actor||"",onChange:e=>m("actor",e.target.value||void 0),sx:{minWidth:140}})]})})]})}var q=r(21138),K=r(84811),_=r(47001),B=r(53281),V=r(11254),X=r(70366),J=r(6406),H=r(95511),G=r(81071),Q=r(89161),Y=r(60236),$=r(27171),ee=r(30114),et=r(46725);function er(e){var t,r;let{log:i,onClick:o}=e,[d,u]=(0,s.useState)("failure"===i.status),x=i.details&&Object.keys(i.details).length>0,p="failure"===i.status&&i.errorMessage,g=x||p,j=(t=i.targetType,r=i.targetName,"server"===t?"/servers/".concat(encodeURIComponent(r)):"player"===t?"/players":null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(X.Z,{hover:!0,sx:{cursor:"pointer","&:last-child td, &:last-child th":{border:0}},onClick:()=>null==o?void 0:o(i),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==o||o(i))},role:"button","aria-label":"".concat(i.action," by ").concat(i.actor," on ").concat(i.targetName),children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48},children:g&&(0,n.jsx)(A.Z,{size:"small",onClick:e=>{e.stopPropagation(),u(!d)},"aria-label":d?"Collapse details":"Expand details",children:d?(0,n.jsx)(Y.Z,{}):(0,n.jsx)(Q.Z,{})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(H.Z,{title:function(e){let t=new Date(e);return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(t)}(i.timestamp),arrow:!0,children:(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3),s=Math.floor(n/60),i=Math.floor(s/60),a=Math.floor(i/24);return n<60?"just now":s<60?"".concat(s,"m ago"):i<24?"".concat(i,"h ago"):a<7?"".concat(a,"d ago"):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(r)}(i.timestamp)})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(h.I,{action:i.action})}),(0,n.jsx)(_.Z,{children:i.actor.startsWith("cli:")?(0,n.jsx)(c.Z,{label:i.actor.replace("cli:",""),size:"small",variant:"outlined",sx:{fontSize:"0.75rem"}}):(0,n.jsx)(l.Z,{variant:"body2",children:i.actor.replace("api:","")})}),(0,n.jsx)(_.Z,{children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[function(e){switch(e){case"server":return(0,n.jsx)($.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});case"player":return(0,n.jsx)(ee.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});default:return null}}(i.targetType),j?(0,n.jsx)(et.default,{href:j,style:{textDecoration:"none"},onClick:e=>e.stopPropagation(),children:(0,n.jsx)(l.Z,{variant:"body2",sx:{color:"primary.main","&:hover":{textDecoration:"underline"}},children:i.targetName})}):(0,n.jsx)(l.Z,{variant:"body2",children:i.targetName})]})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(m.c,{status:i.status})})]}),g&&(0,n.jsx)(X.Z,{children:(0,n.jsx)(_.Z,{sx:{py:0},colSpan:6,children:(0,n.jsx)(R.Z,{in:d,timeout:"auto",unmountOnExit:!0,children:(0,n.jsxs)(a.Z,{sx:{py:2,px:2},children:[p&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:i.errorMessage}),x&&(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{mb:1,display:"block"},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",sx:{width:"auto"},children:(0,n.jsx)(K.Z,{children:Object.entries(i.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]})]})})})})]})}function en(e){let{logs:t,total:r,isLoading:s,error:i,filters:a,onFiltersChange:c,onRowClick:d,onRetry:u}=e,x=Math.floor((a.offset||0)/(a.limit||50)),h=a.limit||50;return s?(0,n.jsx)(o.Z,{children:(0,n.jsx)(B.Z,{children:(0,n.jsxs)(q.Z,{children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:"Timestamp"}),(0,n.jsx)(_.Z,{children:"Action"}),(0,n.jsx)(_.Z,{children:"Actor"}),(0,n.jsx)(_.Z,{children:"Target"}),(0,n.jsx)(_.Z,{children:"Status"})]})}),(0,n.jsx)(K.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:80})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:70,height:24})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:60})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:100})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:50,height:24})})]},t))})]})})}):i?(0,n.jsx)(G.Z,{severity:"error",action:u&&(0,n.jsx)(N.Z,{color:"inherit",size:"small",onClick:u,children:"Retry"}),children:i.message||"Failed to load audit logs"}):0===t.length?(0,n.jsxs)(o.Z,{sx:{p:6,textAlign:"center"},children:[(0,n.jsx)(v.Z,{sx:{fontSize:64,color:"text.disabled",mb:2}}),(0,n.jsx)(l.Z,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"No audit logs found"}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.disabled",sx:{mb:2},children:"Try adjusting your filters or check back later."}),(0,n.jsx)(N.Z,{variant:"outlined",size:"small",onClick:()=>c({limit:a.limit,sort:a.sort}),children:"Reset Filters"})]}):(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(B.Z,{sx:{overflowX:"auto"},children:(0,n.jsxs)(q.Z,{size:"small",children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48}}),(0,n.jsx)(_.Z,{sx:{fontWeight:600,whiteSpace:"nowrap"},children:"Timestamp"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Action"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Actor"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Target"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Status"})]})}),(0,n.jsx)(K.Z,{children:t.map(e=>(0,n.jsx)(er,{log:e,onClick:d},e.id))})]})}),(0,n.jsx)(J.Z,{component:"div",count:r,page:x,onPageChange:(e,t)=>{c({...a,offset:t*h})},rowsPerPage:h,onRowsPerPageChange:e=>{let t=parseInt(e.target.value,10);c({...a,limit:t,offset:0})},rowsPerPageOptions:[25,50,100],"aria-label":"Audit log pagination"})]})}var es=r(78765),ei=r(69123),ea=r(33402),eo=r(60097),el=r(90158),ec=r(58347),ed=r(73424),eu=r(93017),ex=r(71185),eh=r(84509);function em(e){let{logs:t}=e;return 0===t.length?(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No related logs found"}):(0,n.jsx)(el.Z,{dense:!0,sx:{py:0},children:t.map(e=>(0,n.jsx)(ec.ZP,{sx:{px:0,py:1,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,n.jsx)(ed.Z,{primary:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(h.I,{action:e.action,size:"small"}),e.targetName&&(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e.targetName})]}),secondary:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/6e4),s=Math.floor(n/60);return n<60?"".concat(n,"m ago"):s<24?"".concat(s,"h ago"):"".concat(Math.floor(s/24),"d ago")}(e.timestamp)})},e.id))})}function ep(e){var t,r,i,o,c;let{log:d,open:u,onClose:x}=e,[p,g]=(0,s.useState)(0),{data:j,isLoading:f}=(0,eh.VM)(null!==(t=null==d?void 0:d.id)&&void 0!==t?t:null,{enabled:u&&!!d});return(0,n.jsxs)(es.ZP,{anchor:"right",open:u,onClose:x,sx:{"& .MuiDrawer-paper":{width:{xs:"100%",sm:420},maxWidth:"100%"}},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:2,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsx)(l.Z,{variant:"h6",component:"h2",children:"Audit Log Detail"}),(0,n.jsx)(A.Z,{onClick:x,"aria-label":"Close detail drawer",autoFocus:!0,children:(0,n.jsx)(ex.Z,{})})]}),(0,n.jsx)(a.Z,{sx:{p:2,overflow:"auto",flex:1},children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"ID"}),(0,n.jsx)(l.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.8rem",wordBreak:"break-all"},children:d.id})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Timestamp"}),(0,n.jsx)(l.Z,{variant:"body2",children:function(e){let t=new Date(e);return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(t)}(d.timestamp)})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:3,mb:3},children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Action"}),(0,n.jsx)(h.I,{action:d.action,size:"medium"})]}),(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Status"}),(0,n.jsx)(m.c,{status:d.status,size:"medium"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Actor"}),(0,n.jsx)(l.Z,{variant:"body2",children:d.actor})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Target"}),(0,n.jsxs)(l.Z,{variant:"body2",children:[d.targetType,"/",d.targetName]})]}),"failure"===d.status&&d.errorMessage&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:3},children:d.errorMessage}),d.details&&Object.keys(d.details).length>0&&(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",children:(0,n.jsx)(K.Z,{children:Object.entries(d.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0,width:"40%"},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]}),(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Related Logs"}),f?(0,n.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",py:3},children:(0,n.jsx)(eu.Z,{size:24})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ea.Z,{value:p,onChange:(e,t)=>g(t),sx:{mb:1},children:[(0,n.jsx)(eo.Z,{label:"Same Target (".concat(null!==(r=null==j?void 0:j.relatedLogs.sameTarget.length)&&void 0!==r?r:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}}),(0,n.jsx)(eo.Z,{label:"Same Actor (".concat(null!==(i=null==j?void 0:j.relatedLogs.sameActor.length)&&void 0!==i?i:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}})]}),0===p&&(0,n.jsx)(em,{logs:null!==(o=null==j?void 0:j.relatedLogs.sameTarget)&&void 0!==o?o:[]}),1===p&&(0,n.jsx)(em,{logs:null!==(c=null==j?void 0:j.relatedLogs.sameActor)&&void 0!==c?c:[]})]})]}):(0,n.jsx)(l.Z,{color:"text.secondary",children:"No log selected"})})]})}var eg=r(99770),ej=r(62508),ef=r(5682),ev=r(76678),eZ=r(15761);function ey(e){let{open:t,onClose:r,filters:i,totalCount:o}=e,[c,d]=(0,s.useState)("csv"),[u,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),p=function(e){let t=[];return e.action&&t.push("Action: ".concat(e.action)),e.actor&&t.push("Actor: ".concat(e.actor)),e.targetType&&t.push("Type: ".concat(e.targetType)),e.targetName&&t.push("Target: ".concat(e.targetName)),e.status&&t.push("Status: ".concat(e.status)),e.from&&t.push("From: ".concat(e.from.split("T")[0])),e.to&&t.push("To: ".concat(e.to.split("T")[0])),t}(i),g=async()=>{x(!0),m(null);try{let e=function(e,t){let r=new URLSearchParams;return r.set("format",t),e.action&&r.set("action",e.action),e.actor&&r.set("actor",e.actor),e.targetType&&r.set("targetType",e.targetType),e.targetName&&r.set("targetName",e.targetName),e.status&&r.set("status",e.status),e.from&&r.set("from",e.from),e.to&&r.set("to",e.to),"/api/audit-logs/export?".concat(r.toString())}(i,c),t=await fetch(e);if(!t.ok){let e=await t.json().catch(()=>({message:"Export failed"}));throw Error(e.message||"Export failed")}let n=await t.blob(),s=window.URL.createObjectURL(n),a=document.createElement("a");a.href=s;let o=t.headers.get("Content-Disposition"),l=null==o?void 0:o.match(/filename="?([^"]+)"?/);a.download=(null==l?void 0:l[1])||"audit-logs.".concat(c),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),r()}catch(e){m(e instanceof Error?e.message:"Export failed")}finally{x(!1)}};return(0,n.jsxs)(eg.Z,{open:t,onClose:r,maxWidth:"sm",fullWidth:!0,children:[(0,n.jsx)(ej.Z,{children:"Export Audit Logs"}),(0,n.jsxs)(ef.Z,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Format"}),(0,n.jsxs)(I.Z,{value:c,exclusive:!0,onChange:(e,t)=>t&&d(t),size:"small",children:[(0,n.jsx)(E.Z,{value:"csv",children:"CSV"}),(0,n.jsx)(E.Z,{value:"json",children:"JSON"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Applied Filters"}),p.length>0?(0,n.jsx)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:p.map(e=>(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e},e))}):(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"No filters applied (all logs)"})]}),(0,n.jsxs)(a.Z,{sx:{mb:2},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:.5},children:"Estimated Rows"}),(0,n.jsxs)(l.Z,{variant:"body2",color:"text.secondary",children:[Math.min(o,5e3).toLocaleString()," rows"]})]}),o>5e3&&(0,n.jsxs)(G.Z,{severity:"warning",sx:{mb:2},children:["Export is limited to ",5e3.toLocaleString()," rows. Total matching logs: ",o.toLocaleString(),". Consider narrowing your filters for a complete export."]}),h&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:h})]}),(0,n.jsxs)(ev.Z,{children:[(0,n.jsx)(N.Z,{onClick:r,disabled:u,children:"Cancel"}),(0,n.jsx)(N.Z,{variant:"contained",startIcon:u?(0,n.jsx)(eu.Z,{size:16,color:"inherit"}):(0,n.jsx)(eZ.Z,{}),onClick:g,disabled:u,children:u?"Exporting...":"Export ".concat(c.toUpperCase())})]})]})}var eb=r(93757);function eS(){var e,t,r;let h=(0,i.useRouter)(),m=(0,i.useSearchParams)(),[p,g]=(0,s.useState)(()=>(function(e){let t={},r=e.get("action"),n=e.get("actor"),s=e.get("targetType"),i=e.get("targetName"),a=e.get("status"),o=e.get("from"),l=e.get("to"),c=e.get("limit"),d=e.get("offset"),u=e.get("sort");return r&&(t.action=r),n&&(t.actor=n),s&&(t.targetType=s),i&&(t.targetName=i),a&&(t.status=a),o&&(t.from=o),l&&(t.to=l),c&&(t.limit=parseInt(c,10)),d&&(t.offset=parseInt(d,10)),("timestamp:asc"===u||"timestamp:desc"===u)&&(t.sort=u),t})(m)),[j,f]=(0,s.useState)(null),[v,Z]=(0,s.useState)(!1),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(0),T=(0,s.useRef)(new Set),{data:k,isLoading:z,error:N,refetch:R}=(0,eh.hT)(p),{data:A,isLoading:E}=(0,eh.DM)(),{isConnected:I}=(0,eb.D)({url:"/api/audit-logs/stream",enabled:!0,onMessage:(0,s.useCallback)(e=>{if("audit-log"===e.type){let t=e.data;if("id"in t&&"string"==typeof t.id){if(T.current.has(t.id))return;if(T.current.add(t.id),T.current.size>1e3){let e=Array.from(T.current);T.current=new Set(e.slice(e.length-500))}}w(e=>e+1)}},[]),reconnectInterval:3e3,maxReconnectAttempts:1/0});(0,s.useEffect)(()=>{let e=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),e.limit&&50!==e.limit&&t.set("limit",String(e.limit)),e.offset&&e.offset>0&&t.set("offset",String(e.offset)),e.sort&&"timestamp:desc"!==e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(p);e!==(m.toString()?"?".concat(m.toString()):"")&&h.replace("/audit-logs".concat(e),{scroll:!1})},[p,h,m]);let F=(0,s.useCallback)(e=>{g(e),w(0)},[]),L=(0,s.useCallback)(e=>{f(e),Z(!0)},[]),D=(0,s.useCallback)(()=>{w(0),R()},[R]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,d.Fq)(e.palette.warning.main,.1)," 0%, ").concat((0,d.Fq)(e.palette.error.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,d.Fq)(e.palette.warning.main,.2))},children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"warning.main",color:"warning.contrastText"},children:(0,n.jsx)(u.Z,{sx:{fontSize:32}})}),(0,n.jsxs)(a.Z,{sx:{flex:1},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[(0,n.jsx)(l.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Audit Log"}),(0,n.jsx)(c.Z,{icon:(0,n.jsx)(x.Z,{sx:{fontSize:10,color:I?"success.main":"text.disabled",animation:I?"pulse 2s infinite":"none","@keyframes pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}}),label:I?"Live":"Offline",size:"small",variant:"outlined",sx:{fontSize:"0.7rem"}})]}),(0,n.jsx)(l.Z,{variant:"body1",color:"text.secondary",children:"Monitor all management activities across your servers"})]})]})}),(0,n.jsx)(a.Z,{sx:{mb:3},children:(0,n.jsx)(S,{stats:A,isLoading:E})}),C>0&&(0,n.jsx)(a.Z,{sx:{mb:2,p:1.5,textAlign:"center",bgcolor:"primary.main",color:"primary.contrastText",borderRadius:1,cursor:"pointer","&:hover":{opacity:.9}},onClick:D,role:"button","aria-label":"".concat(C," new logs, click to refresh"),children:(0,n.jsxs)(l.Z,{variant:"body2",fontWeight:600,children:[C," new ",1===C?"log":"logs"," available - Click to refresh"]})}),(0,n.jsx)(U,{filters:p,onFiltersChange:F,onExport:()=>b(!0)}),(0,n.jsx)(en,{logs:null!==(e=null==k?void 0:k.logs)&&void 0!==e?e:[],total:null!==(t=null==k?void 0:k.total)&&void 0!==t?t:0,isLoading:z,error:N,filters:p,onFiltersChange:F,onRowClick:L,onRetry:()=>R()}),(0,n.jsx)(ep,{log:j,open:v,onClose:()=>{Z(!1),f(null)}}),(0,n.jsx)(ey,{open:y,onClose:()=>b(!1),filters:p,totalCount:null!==(r=null==k?void 0:k.total)&&void 0!==r?r:0})]})}},56813:function(e,t,r){"use strict";r.d(t,{I:function(){return a}});var n=r(94655),s=r(25333),i=r(82925);function a(e){let{action:t,size:r="small"}=e,a=i.Lu[t]||"default",o=i.n3[t]||t;return(0,n.jsx)(s.Z,{label:o,color:a,size:r,variant:"filled",sx:{fontWeight:600,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},26892:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var n=r(94655),s=r(25333),i=r(46207),a=r(43436);function o(e){let{status:t,size:r="small"}=e;return(0,n.jsx)(s.Z,{icon:"success"===t?(0,n.jsx)(i.Z,{}):(0,n.jsx)(a.Z,{}),label:"success"===t?"OK":"Error",color:"success"===t?"success":"error",size:r,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},42936:function(e,t,r){"use strict";async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={...t.headers};t.body&&(r["Content-Type"]="application/json");let n=await fetch(e,{...t,headers:r});if(!n.ok){let e=await n.json().catch(()=>({error:"UnknownError",message:n.statusText})),t=Error(e.message);throw t.statusCode=n.status,t.code=e.error,t}return n.json()}r.d(t,{SC:function(){return n}})},84509:function(e,t,r){"use strict";r.d(t,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return c}});var n=r(5632),s=r(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),void 0!==e.limit&&t.set("limit",String(e.limit)),void 0!==e.offset&&t.set("offset",String(e.offset)),e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(e);return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1})}function a(e){return(0,n.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,s.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,t){return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function l(e,t){var r;return i({targetType:"server",targetName:e,limit:null!==(r=null==t?void 0:t.limit)&&void 0!==r?r:20},{enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},93757:function(e,t,r){"use strict";r.d(t,{D:function(){return i}});var n=r(35106);class s{connect(e){this.options=e,this.shouldReconnect=!0,this.establishConnection()}establishConnection(){this.options&&(this.updateState("connecting"),this.eventSource&&this.eventSource.close(),this.eventSource=new EventSource(this.options.url,{withCredentials:this.options.withCredentials||!1}),this.eventSource.onopen=()=>{this.updateState("connected"),this.retryCount=0,this.lastError=null},this.eventSource.onmessage=e=>{if(!e.data.startsWith(":"))try{var t,r;let n=JSON.parse(e.data);null===(r=this.options)||void 0===r||null===(t=r.onMessage)||void 0===t||t.call(r,n)}catch(e){console.warn("Failed to parse SSE message:",e)}},this.eventSource.onerror=()=>{var e,t;let r={message:"SSE connection error",code:"CONNECTION_ERROR",retryCount:this.retryCount,timestamp:new Date};this.lastError=r,this.updateState("error"),null===(t=this.options)||void 0===t||null===(e=t.onError)||void 0===e||e.call(t,r),this.shouldReconnect&&this.scheduleReconnect()})}scheduleReconnect(){var e,t;if(!this.options)return;let r=null!==(e=this.options.maxReconnectAttempts)&&void 0!==e?e:1/0;if(this.retryCount>=r)return;this.reconnectTimer&&clearTimeout(this.reconnectTimer);let n=null!==(t=this.options.reconnectInterval)&&void 0!==t?t:3e3;this.reconnectTimer=setTimeout(()=>{this.retryCount++,this.establishConnection()},n)}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.updateState("disconnected")}getState(){return this.state}isConnected(){return"connected"===this.state}getLastError(){return this.lastError}getRetryCount(){return this.retryCount}reconnect(){this.retryCount++,this.shouldReconnect=!0,this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.establishConnection()}updateState(e){var t,r;this.state=e,null===(r=this.options)||void 0===r||null===(t=r.onStateChange)||void 0===t||t.call(r,e)}constructor(){this.eventSource=null,this.state="disconnected",this.retryCount=0,this.lastError=null,this.reconnectTimer=null,this.options=null,this.shouldReconnect=!0}}function i(e){let{url:t,onMessage:r,onError:i,reconnectInterval:a=3e3,maxReconnectAttempts:o=1/0,enabled:l=!0,withCredentials:c=!1}=e,[d,u]=(0,n.useState)(null),[x,h]=(0,n.useState)("disconnected"),[m,p]=(0,n.useState)(null),[g,j]=(0,n.useState)(0),f=(0,n.useRef)(null),v=(0,n.useCallback)(e=>{u(e),null==r||r(e)},[r]),Z=(0,n.useCallback)(e=>{h(e),"connected"===e&&j(0)},[]),y=(0,n.useCallback)(e=>{p(e),"number"==typeof e.retryCount&&j(e.retryCount),null==i||i(e)},[i]),b=(0,n.useCallback)(()=>{f.current&&(f.current.reconnect(),j(f.current.getRetryCount()))},[]),S=(0,n.useCallback)(()=>{f.current&&f.current.disconnect()},[]);return(0,n.useEffect)(()=>{if(!l){f.current&&(f.current.disconnect(),f.current=null);return}return f.current||(f.current=new s),f.current.connect({url:t,onMessage:v,onStateChange:Z,onError:y,reconnectInterval:a,maxReconnectAttempts:o,withCredentials:c}),()=>{f.current&&(f.current.disconnect(),f.current=null)}},[t,l,a,o,c,v,Z,y]),{data:d,isConnected:"connected"===x,state:x,error:m,retryCount:g,reconnect:b,disconnect:S}}},82925:function(e,t,r){"use strict";r.d(t,{KK:function(){return o},Lu:function(){return n},Xn:function(){return a},n3:function(){return s},xg:function(){return i}});let n={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},s={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],o=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,521,5511,880,55,9654,8347,6909,4474,8918,6479,3669,2757,1744],function(){return e(e.s=3590)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4743],{3590:function(e,t,r){Promise.resolve().then(r.bind(r,52791))},52791:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return eS}});var n=r(94655),s=r(35106),i=r(74228),a=r(7281),o=r(69899),l=r(31317),c=r(25333),d=r(76492),u=r(80620),x=r(78439),h=r(56813),m=r(26892),p=r(84840),g=r(628),j=r(41565),f=r(10721),v=r(69178),Z=r(46207),y=r(45354),b=r(35847);function S(e){var t,r,s;let{stats:i,isLoading:o}=e;if(o)return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:[0,1,2,3].map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{children:(0,n.jsxs)(j.Z,{children:[(0,n.jsx)(f.Z,{variant:"text",width:"60%"}),(0,n.jsx)(f.Z,{variant:"text",width:"40%",height:40}),(0,n.jsx)(f.Z,{variant:"text",width:"80%"})]})})},e))});let c=null!==(t=null==i?void 0:i.total)&&void 0!==t?t:0,d=c>0?((null!==(r=null==i?void 0:i.byStatus.success)&&void 0!==r?r:0)/c*100).toFixed(1):"0.0",u=null!==(s=null==i?void 0:i.byStatus.failure)&&void 0!==s?s:0,x=i?Object.keys(i.byActor).length:0,h=[{title:"Total Logs",value:c.toLocaleString(),icon:(0,n.jsx)(v.Z,{fontSize:"large"}),color:"#1bd96a",description:"All audit log entries"},{title:"Success Rate",value:"".concat(d,"%"),icon:(0,n.jsx)(Z.Z,{fontSize:"large"}),color:"#22c55e",description:"Successful operations"},{title:"Failures",value:u,icon:(0,n.jsx)(y.Z,{fontSize:"large"}),color:"#ef4444",description:"Failed operations"},{title:"Active Users",value:x,icon:(0,n.jsx)(b.Z,{fontSize:"large"}),color:"#3b82f6",description:"Unique actors"}];return(0,n.jsx)(p.ZP,{container:!0,spacing:2,children:h.map(e=>(0,n.jsx)(p.ZP,{item:!0,xs:6,md:3,children:(0,n.jsx)(g.Z,{sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:e.color}},children:(0,n.jsxs)(j.Z,{children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:e.title}),(0,n.jsx)(a.Z,{sx:{color:e.color,opacity:.8},children:e.icon})]}),(0,n.jsx)(l.Z,{variant:"h3",component:"div",sx:{fontWeight:700,color:"text.primary",mb:1},children:e.value}),(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",children:e.description})]})})},e.title))})}var C=r(97436),w=r(62328),T=r(7178),k=r(29793),z=r(75726),N=r(30417),R=r(87716),A=r(79983),E=r(89923),I=r(10297),F=r(50880),L=r(54617),D=r(42431),P=r(81960),W=r(84284),M=r(82925);function O(e){return"server"===e?M.Xn:"player"===e?M.KK:M.xg}function U(e){let t,{filters:r,onFiltersChange:i,onExport:o}=e,[d,u]=(0,s.useState)(!0),x=(t=0,r.action&&t++,r.actor&&t++,r.targetType&&t++,r.targetName&&t++,r.status&&t++,r.from&&t++,r.to&&t++,t),h=O(r.targetType),m=(e,t)=>{let n={...r};""===t||void 0===t?delete n[e]:n[e]=t,"targetType"===e&&n.action&&!O(t).includes(n.action)&&delete n.action,n.offset=0,i(n)};return(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:d?2:0},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsxs)(A.Z,{onClick:()=>u(!d),size:"small","aria-label":d?"Collapse filters":"Expand filters",children:[(0,n.jsx)(F.Z,{}),d?(0,n.jsx)(W.Z,{sx:{fontSize:14}}):(0,n.jsx)(P.Z,{sx:{fontSize:14}})]}),(0,n.jsx)(l.Z,{variant:"subtitle2",color:"text.secondary",children:"Filters"}),x>0&&(0,n.jsx)(c.Z,{label:x,size:"small",color:"primary",sx:{height:20,fontSize:"0.7rem"}})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[x>0&&(0,n.jsx)(N.Z,{size:"small",startIcon:(0,n.jsx)(L.Z,{}),onClick:()=>{i({limit:r.limit,sort:r.sort})},color:"inherit",children:"Clear All"}),o&&(0,n.jsx)(N.Z,{size:"small",variant:"outlined",onClick:o,children:"Export"})]})]}),(0,n.jsx)(R.Z,{in:d,children:(0,n.jsxs)(a.Z,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:2,flexWrap:"wrap"},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:1,alignItems:"center"},children:[(0,n.jsx)(C.Z,{type:"date",label:"From",size:"small",value:r.from?r.from.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("from",t?"".concat(t,"T00:00:00Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"~"}),(0,n.jsx)(C.Z,{type:"date",label:"To",size:"small",value:r.to?r.to.split("T")[0]:"",onChange:e=>{let t=e.target.value;m("to",t?"".concat(t,"T23:59:59Z"):void 0)},InputLabelProps:{shrink:!0},sx:{minWidth:150}})]}),(0,n.jsxs)(k.Z,{size:"small",sx:{minWidth:160},children:[(0,n.jsx)(z.Z,{children:"Action"}),(0,n.jsxs)(w.Z,{value:r.action||"",label:"Action",onChange:e=>m("action",e.target.value||void 0),children:[(0,n.jsx)(T.Z,{value:"",children:"All Actions"}),h.map(e=>(0,n.jsx)(T.Z,{value:e,children:M.n3[e]||e},e))]})]}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.targetType||"",exclusive:!0,onChange:(e,t)=>m("targetType",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All targets",children:"All"}),(0,n.jsx)(E.Z,{value:"server","aria-label":"Server targets",children:"Server"}),(0,n.jsx)(E.Z,{value:"player","aria-label":"Player targets",children:"Player"})]})}),(0,n.jsx)(a.Z,{children:(0,n.jsxs)(I.Z,{value:r.status||"",exclusive:!0,onChange:(e,t)=>m("status",t||void 0),size:"small",children:[(0,n.jsx)(E.Z,{value:"","aria-label":"All statuses",children:"All"}),(0,n.jsx)(E.Z,{value:"success","aria-label":"Success only",children:"Success"}),(0,n.jsx)(E.Z,{value:"failure","aria-label":"Failure only",children:"Failure"})]})}),(0,n.jsx)(C.Z,{label:"Target Name",placeholder:"Search...",size:"small",value:r.targetName||"",onChange:e=>m("targetName",e.target.value||void 0),InputProps:{startAdornment:(0,n.jsx)(D.Z,{sx:{color:"text.secondary",mr:.5,fontSize:18}})},sx:{minWidth:160}}),(0,n.jsx)(C.Z,{label:"Actor",placeholder:"e.g., api:admin",size:"small",value:r.actor||"",onChange:e=>m("actor",e.target.value||void 0),sx:{minWidth:140}})]})})]})}var q=r(21138),K=r(84811),_=r(47001),B=r(53281),V=r(11254),X=r(70366),J=r(6406),H=r(95511),G=r(81071),Q=r(89161),Y=r(60236),$=r(27171),ee=r(30114),et=r(46725);function er(e){var t,r;let{log:i,onClick:o}=e,[d,u]=(0,s.useState)("failure"===i.status),x=i.details&&Object.keys(i.details).length>0,p="failure"===i.status&&i.errorMessage,g=x||p,j=(t=i.targetType,r=i.targetName,"server"===t?"/servers/".concat(encodeURIComponent(r)):"player"===t?"/players":null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(X.Z,{hover:!0,sx:{cursor:"pointer","&:last-child td, &:last-child th":{border:0}},onClick:()=>null==o?void 0:o(i),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==o||o(i))},role:"button","aria-label":"".concat(i.action," by ").concat(i.actor," on ").concat(i.targetName),children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48},children:g&&(0,n.jsx)(A.Z,{size:"small",onClick:e=>{e.stopPropagation(),u(!d)},"aria-label":d?"Collapse details":"Expand details",children:d?(0,n.jsx)(Y.Z,{}):(0,n.jsx)(Q.Z,{})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(H.Z,{title:function(e){let t=new Date(e);return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(t)}(i.timestamp),arrow:!0,children:(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/1e3),s=Math.floor(n/60),i=Math.floor(s/60),a=Math.floor(i/24);return n<60?"just now":s<60?"".concat(s,"m ago"):i<24?"".concat(i,"h ago"):a<7?"".concat(a,"d ago"):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(r)}(i.timestamp)})})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(h.I,{action:i.action})}),(0,n.jsx)(_.Z,{children:i.actor.startsWith("cli:")?(0,n.jsx)(c.Z,{label:i.actor.replace("cli:",""),size:"small",variant:"outlined",sx:{fontSize:"0.75rem"}}):(0,n.jsx)(l.Z,{variant:"body2",children:i.actor.replace("api:","")})}),(0,n.jsx)(_.Z,{children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[function(e){switch(e){case"server":return(0,n.jsx)($.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});case"player":return(0,n.jsx)(ee.Z,{sx:{fontSize:16,mr:.5,color:"text.secondary"}});default:return null}}(i.targetType),j?(0,n.jsx)(et.default,{href:j,style:{textDecoration:"none"},onClick:e=>e.stopPropagation(),children:(0,n.jsx)(l.Z,{variant:"body2",sx:{color:"primary.main","&:hover":{textDecoration:"underline"}},children:i.targetName})}):(0,n.jsx)(l.Z,{variant:"body2",children:i.targetName})]})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(m.c,{status:i.status})})]}),g&&(0,n.jsx)(X.Z,{children:(0,n.jsx)(_.Z,{sx:{py:0},colSpan:6,children:(0,n.jsx)(R.Z,{in:d,timeout:"auto",unmountOnExit:!0,children:(0,n.jsxs)(a.Z,{sx:{py:2,px:2},children:[p&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:i.errorMessage}),x&&(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{mb:1,display:"block"},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",sx:{width:"auto"},children:(0,n.jsx)(K.Z,{children:Object.entries(i.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]})]})})})})]})}function en(e){let{logs:t,total:r,isLoading:s,error:i,filters:a,onFiltersChange:c,onRowClick:d,onRetry:u}=e,x=Math.floor((a.offset||0)/(a.limit||50)),h=a.limit||50;return s?(0,n.jsx)(o.Z,{children:(0,n.jsx)(B.Z,{children:(0,n.jsxs)(q.Z,{children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:"Timestamp"}),(0,n.jsx)(_.Z,{children:"Action"}),(0,n.jsx)(_.Z,{children:"Actor"}),(0,n.jsx)(_.Z,{children:"Target"}),(0,n.jsx)(_.Z,{children:"Status"})]})}),(0,n.jsx)(K.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox"}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:80})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:70,height:24})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:60})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"text",width:100})}),(0,n.jsx)(_.Z,{children:(0,n.jsx)(f.Z,{variant:"rounded",width:50,height:24})})]},t))})]})})}):i?(0,n.jsx)(G.Z,{severity:"error",action:u&&(0,n.jsx)(N.Z,{color:"inherit",size:"small",onClick:u,children:"Retry"}),children:i.message||"Failed to load audit logs"}):0===t.length?(0,n.jsxs)(o.Z,{sx:{p:6,textAlign:"center"},children:[(0,n.jsx)(v.Z,{sx:{fontSize:64,color:"text.disabled",mb:2}}),(0,n.jsx)(l.Z,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"No audit logs found"}),(0,n.jsx)(l.Z,{variant:"body2",color:"text.disabled",sx:{mb:2},children:"Try adjusting your filters or check back later."}),(0,n.jsx)(N.Z,{variant:"outlined",size:"small",onClick:()=>c({limit:a.limit,sort:a.sort}),children:"Reset Filters"})]}):(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(B.Z,{sx:{overflowX:"auto"},children:(0,n.jsxs)(q.Z,{size:"small",children:[(0,n.jsx)(V.Z,{children:(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{padding:"checkbox",sx:{width:48}}),(0,n.jsx)(_.Z,{sx:{fontWeight:600,whiteSpace:"nowrap"},children:"Timestamp"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Action"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Actor"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Target"}),(0,n.jsx)(_.Z,{sx:{fontWeight:600},children:"Status"})]})}),(0,n.jsx)(K.Z,{children:t.map(e=>(0,n.jsx)(er,{log:e,onClick:d},e.id))})]})}),(0,n.jsx)(J.Z,{component:"div",count:r,page:x,onPageChange:(e,t)=>{c({...a,offset:t*h})},rowsPerPage:h,onRowsPerPageChange:e=>{let t=parseInt(e.target.value,10);c({...a,limit:t,offset:0})},rowsPerPageOptions:[25,50,100],"aria-label":"Audit log pagination"})]})}var es=r(78765),ei=r(69123),ea=r(33402),eo=r(60097),el=r(90158),ec=r(58347),ed=r(73424),eu=r(93017),ex=r(71185),eh=r(84509);function em(e){let{logs:t}=e;return 0===t.length?(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{py:2,textAlign:"center"},children:"No related logs found"}):(0,n.jsx)(el.Z,{dense:!0,sx:{py:0},children:t.map(e=>(0,n.jsx)(ec.ZP,{sx:{px:0,py:1,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,n.jsx)(ed.Z,{primary:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,n.jsx)(h.I,{action:e.action,size:"small"}),e.targetName&&(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e.targetName})]}),secondary:function(e){let t=new Date,r=new Date(e),n=Math.floor((t.getTime()-r.getTime())/6e4),s=Math.floor(n/60);return n<60?"".concat(n,"m ago"):s<24?"".concat(s,"h ago"):"".concat(Math.floor(s/24),"d ago")}(e.timestamp)})},e.id))})}function ep(e){var t,r,i,o,c;let{log:d,open:u,onClose:x}=e,[p,g]=(0,s.useState)(0),{data:j,isLoading:f}=(0,eh.VM)(null!==(t=null==d?void 0:d.id)&&void 0!==t?t:null,{enabled:u&&!!d});return(0,n.jsxs)(es.ZP,{anchor:"right",open:u,onClose:x,sx:{"& .MuiDrawer-paper":{width:{xs:"100%",sm:420},maxWidth:"100%"}},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:2,borderBottom:"1px solid",borderColor:"divider"},children:[(0,n.jsx)(l.Z,{variant:"h6",component:"h2",children:"Audit Log Detail"}),(0,n.jsx)(A.Z,{onClick:x,"aria-label":"Close detail drawer",autoFocus:!0,children:(0,n.jsx)(ex.Z,{})})]}),(0,n.jsx)(a.Z,{sx:{p:2,overflow:"auto",flex:1},children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"ID"}),(0,n.jsx)(l.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.8rem",wordBreak:"break-all"},children:d.id})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Timestamp"}),(0,n.jsx)(l.Z,{variant:"body2",children:function(e){let t=new Date(e);return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(t)}(d.timestamp)})]}),(0,n.jsxs)(a.Z,{sx:{display:"flex",gap:3,mb:3},children:[(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Action"}),(0,n.jsx)(h.I,{action:d.action,size:"medium"})]}),(0,n.jsxs)(a.Z,{children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Status"}),(0,n.jsx)(m.c,{status:d.status,size:"medium"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Actor"}),(0,n.jsx)(l.Z,{variant:"body2",children:d.actor})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Target"}),(0,n.jsxs)(l.Z,{variant:"body2",children:[d.targetType,"/",d.targetName]})]}),"failure"===d.status&&d.errorMessage&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:3},children:d.errorMessage}),d.details&&Object.keys(d.details).length>0&&(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Details"}),(0,n.jsx)(q.Z,{size:"small",children:(0,n.jsx)(K.Z,{children:Object.entries(d.details).map(e=>{let[t,r]=e;return(0,n.jsxs)(X.Z,{children:[(0,n.jsx)(_.Z,{sx:{fontWeight:600,color:"text.secondary",border:"none",py:.5,pl:0,width:"40%"},children:t}),(0,n.jsx)(_.Z,{sx:{border:"none",py:.5},children:String(r)})]},t)})})})]}),(0,n.jsx)(ei.Z,{sx:{mb:2}}),(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Related Logs"}),f?(0,n.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",py:3},children:(0,n.jsx)(eu.Z,{size:24})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ea.Z,{value:p,onChange:(e,t)=>g(t),sx:{mb:1},children:[(0,n.jsx)(eo.Z,{label:"Same Target (".concat(null!==(r=null==j?void 0:j.relatedLogs.sameTarget.length)&&void 0!==r?r:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}}),(0,n.jsx)(eo.Z,{label:"Same Actor (".concat(null!==(i=null==j?void 0:j.relatedLogs.sameActor.length)&&void 0!==i?i:0,")"),sx:{textTransform:"none",fontSize:"0.8rem"}})]}),0===p&&(0,n.jsx)(em,{logs:null!==(o=null==j?void 0:j.relatedLogs.sameTarget)&&void 0!==o?o:[]}),1===p&&(0,n.jsx)(em,{logs:null!==(c=null==j?void 0:j.relatedLogs.sameActor)&&void 0!==c?c:[]})]})]}):(0,n.jsx)(l.Z,{color:"text.secondary",children:"No log selected"})})]})}var eg=r(99770),ej=r(62508),ef=r(5682),ev=r(76678),eZ=r(15761);function ey(e){let{open:t,onClose:r,filters:i,totalCount:o}=e,[c,d]=(0,s.useState)("csv"),[u,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),p=function(e){let t=[];return e.action&&t.push("Action: ".concat(e.action)),e.actor&&t.push("Actor: ".concat(e.actor)),e.targetType&&t.push("Type: ".concat(e.targetType)),e.targetName&&t.push("Target: ".concat(e.targetName)),e.status&&t.push("Status: ".concat(e.status)),e.from&&t.push("From: ".concat(e.from.split("T")[0])),e.to&&t.push("To: ".concat(e.to.split("T")[0])),t}(i),g=async()=>{x(!0),m(null);try{let e=function(e,t){let r=new URLSearchParams;return r.set("format",t),e.action&&r.set("action",e.action),e.actor&&r.set("actor",e.actor),e.targetType&&r.set("targetType",e.targetType),e.targetName&&r.set("targetName",e.targetName),e.status&&r.set("status",e.status),e.from&&r.set("from",e.from),e.to&&r.set("to",e.to),"/api/audit-logs/export?".concat(r.toString())}(i,c),t=await fetch(e);if(!t.ok){let e=await t.json().catch(()=>({message:"Export failed"}));throw Error(e.message||"Export failed")}let n=await t.blob(),s=window.URL.createObjectURL(n),a=document.createElement("a");a.href=s;let o=t.headers.get("Content-Disposition"),l=null==o?void 0:o.match(/filename="?([^"]+)"?/);a.download=(null==l?void 0:l[1])||"audit-logs.".concat(c),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(s),r()}catch(e){m(e instanceof Error?e.message:"Export failed")}finally{x(!1)}};return(0,n.jsxs)(eg.Z,{open:t,onClose:r,maxWidth:"sm",fullWidth:!0,children:[(0,n.jsx)(ej.Z,{children:"Export Audit Logs"}),(0,n.jsxs)(ef.Z,{children:[(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Format"}),(0,n.jsxs)(I.Z,{value:c,exclusive:!0,onChange:(e,t)=>t&&d(t),size:"small",children:[(0,n.jsx)(E.Z,{value:"csv",children:"CSV"}),(0,n.jsx)(E.Z,{value:"json",children:"JSON"})]})]}),(0,n.jsxs)(a.Z,{sx:{mb:3},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:1},children:"Applied Filters"}),p.length>0?(0,n.jsx)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:.5},children:p.map(e=>(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:e},e))}):(0,n.jsx)(l.Z,{variant:"body2",color:"text.secondary",children:"No filters applied (all logs)"})]}),(0,n.jsxs)(a.Z,{sx:{mb:2},children:[(0,n.jsx)(l.Z,{variant:"subtitle2",sx:{mb:.5},children:"Estimated Rows"}),(0,n.jsxs)(l.Z,{variant:"body2",color:"text.secondary",children:[Math.min(o,5e3).toLocaleString()," rows"]})]}),o>5e3&&(0,n.jsxs)(G.Z,{severity:"warning",sx:{mb:2},children:["Export is limited to ",5e3.toLocaleString()," rows. Total matching logs: ",o.toLocaleString(),". Consider narrowing your filters for a complete export."]}),h&&(0,n.jsx)(G.Z,{severity:"error",sx:{mb:2},children:h})]}),(0,n.jsxs)(ev.Z,{children:[(0,n.jsx)(N.Z,{onClick:r,disabled:u,children:"Cancel"}),(0,n.jsx)(N.Z,{variant:"contained",startIcon:u?(0,n.jsx)(eu.Z,{size:16,color:"inherit"}):(0,n.jsx)(eZ.Z,{}),onClick:g,disabled:u,children:u?"Exporting...":"Export ".concat(c.toUpperCase())})]})]})}var eb=r(93757);function eS(){var e,t,r;let h=(0,i.useRouter)(),m=(0,i.useSearchParams)(),[p,g]=(0,s.useState)(()=>(function(e){let t={},r=e.get("action"),n=e.get("actor"),s=e.get("targetType"),i=e.get("targetName"),a=e.get("status"),o=e.get("from"),l=e.get("to"),c=e.get("limit"),d=e.get("offset"),u=e.get("sort");return r&&(t.action=r),n&&(t.actor=n),s&&(t.targetType=s),i&&(t.targetName=i),a&&(t.status=a),o&&(t.from=o),l&&(t.to=l),c&&(t.limit=parseInt(c,10)),d&&(t.offset=parseInt(d,10)),("timestamp:asc"===u||"timestamp:desc"===u)&&(t.sort=u),t})(m)),[j,f]=(0,s.useState)(null),[v,Z]=(0,s.useState)(!1),[y,b]=(0,s.useState)(!1),[C,w]=(0,s.useState)(0),T=(0,s.useRef)(new Set),{data:k,isLoading:z,error:N,refetch:R}=(0,eh.hT)(p),{data:A,isLoading:E}=(0,eh.DM)(),{isConnected:I}=(0,eb.D)({url:"/api/audit-logs/stream",enabled:!0,onMessage:(0,s.useCallback)(e=>{if("audit-log"===e.type){let t=e.data;if("id"in t&&"string"==typeof t.id){if(T.current.has(t.id))return;if(T.current.add(t.id),T.current.size>1e3){let e=Array.from(T.current);T.current=new Set(e.slice(e.length-500))}}w(e=>e+1)}},[]),reconnectInterval:3e3,maxReconnectAttempts:1/0});(0,s.useEffect)(()=>{let e=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),e.limit&&50!==e.limit&&t.set("limit",String(e.limit)),e.offset&&e.offset>0&&t.set("offset",String(e.offset)),e.sort&&"timestamp:desc"!==e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(p);e!==(m.toString()?"?".concat(m.toString()):"")&&h.replace("/audit-logs".concat(e),{scroll:!1})},[p,h,m]);let F=(0,s.useCallback)(e=>{g(e),w(0)},[]),L=(0,s.useCallback)(e=>{f(e),Z(!0)},[]),D=(0,s.useCallback)(()=>{w(0),R()},[R]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,d.Fq)(e.palette.warning.main,.1)," 0%, ").concat((0,d.Fq)(e.palette.error.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,d.Fq)(e.palette.warning.main,.2))},children:(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,n.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"warning.main",color:"warning.contrastText"},children:(0,n.jsx)(u.Z,{sx:{fontSize:32}})}),(0,n.jsxs)(a.Z,{sx:{flex:1},children:[(0,n.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[(0,n.jsx)(l.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Audit Log"}),(0,n.jsx)(c.Z,{icon:(0,n.jsx)(x.Z,{sx:{fontSize:10,color:I?"success.main":"text.disabled",animation:I?"pulse 2s infinite":"none","@keyframes pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}}),label:I?"Live":"Offline",size:"small",variant:"outlined",sx:{fontSize:"0.7rem"}})]}),(0,n.jsx)(l.Z,{variant:"body1",color:"text.secondary",children:"Monitor all management activities across your servers"})]})]})}),(0,n.jsx)(a.Z,{sx:{mb:3},children:(0,n.jsx)(S,{stats:A,isLoading:E})}),C>0&&(0,n.jsx)(a.Z,{sx:{mb:2,p:1.5,textAlign:"center",bgcolor:"primary.main",color:"primary.contrastText",borderRadius:1,cursor:"pointer","&:hover":{opacity:.9}},onClick:D,role:"button","aria-label":"".concat(C," new logs, click to refresh"),children:(0,n.jsxs)(l.Z,{variant:"body2",fontWeight:600,children:[C," new ",1===C?"log":"logs"," available - Click to refresh"]})}),(0,n.jsx)(U,{filters:p,onFiltersChange:F,onExport:()=>b(!0)}),(0,n.jsx)(en,{logs:null!==(e=null==k?void 0:k.logs)&&void 0!==e?e:[],total:null!==(t=null==k?void 0:k.total)&&void 0!==t?t:0,isLoading:z,error:N,filters:p,onFiltersChange:F,onRowClick:L,onRetry:()=>R()}),(0,n.jsx)(ep,{log:j,open:v,onClose:()=>{Z(!1),f(null)}}),(0,n.jsx)(ey,{open:y,onClose:()=>b(!1),filters:p,totalCount:null!==(r=null==k?void 0:k.total)&&void 0!==r?r:0})]})}},56813:function(e,t,r){"use strict";r.d(t,{I:function(){return a}});var n=r(94655),s=r(25333),i=r(82925);function a(e){let{action:t,size:r="small"}=e,a=i.Lu[t]||"default",o=i.n3[t]||t;return(0,n.jsx)(s.Z,{label:o,color:a,size:r,variant:"filled",sx:{fontWeight:600,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},26892:function(e,t,r){"use strict";r.d(t,{c:function(){return o}});var n=r(94655),s=r(25333),i=r(46207),a=r(43436);function o(e){let{status:t,size:r="small"}=e;return(0,n.jsx)(s.Z,{icon:"success"===t?(0,n.jsx)(i.Z,{}):(0,n.jsx)(a.Z,{}),label:"success"===t?"OK":"Error",color:"success"===t?"success":"error",size:r,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===r?"0.7rem":"0.8rem"}})}},42936:function(e,t,r){"use strict";async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={...t.headers};t.body&&(r["Content-Type"]="application/json");let n=await fetch(e,{...t,headers:r});if(!n.ok){let e=await n.json().catch(()=>({error:"UnknownError",message:n.statusText})),t=Error(e.message);throw t.statusCode=n.status,t.code=e.error,t}return n.json()}r.d(t,{SC:function(){return n}})},84509:function(e,t,r){"use strict";r.d(t,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return c}});var n=r(5632),s=r(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),void 0!==e.limit&&t.set("limit",String(e.limit)),void 0!==e.offset&&t.set("offset",String(e.offset)),e.sort&&t.set("sort",e.sort);let r=t.toString();return r?"?".concat(r):""}(e);return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs".concat(r)),enabled:(null==t?void 0:t.enabled)!==!1})}function a(e){return(0,n.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,s.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,t){return(0,n.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function l(e,t){var r;return i({targetType:"server",targetName:e,limit:null!==(r=null==t?void 0:t.limit)&&void 0!==r?r:20},{enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},93757:function(e,t,r){"use strict";r.d(t,{D:function(){return i}});var n=r(35106);class s{connect(e){this.options=e,this.shouldReconnect=!0,this.establishConnection()}establishConnection(){this.options&&(this.updateState("connecting"),this.eventSource&&this.eventSource.close(),this.eventSource=new EventSource(this.options.url,{withCredentials:this.options.withCredentials||!1}),this.eventSource.onopen=()=>{this.updateState("connected"),this.retryCount=0,this.lastError=null},this.eventSource.onmessage=e=>{if(!e.data.startsWith(":"))try{var t,r;let n=JSON.parse(e.data);null===(r=this.options)||void 0===r||null===(t=r.onMessage)||void 0===t||t.call(r,n)}catch(e){console.warn("Failed to parse SSE message:",e)}},this.eventSource.onerror=()=>{var e,t;let r={message:"SSE connection error",code:"CONNECTION_ERROR",retryCount:this.retryCount,timestamp:new Date};this.lastError=r,this.updateState("error"),null===(t=this.options)||void 0===t||null===(e=t.onError)||void 0===e||e.call(t,r),this.shouldReconnect&&this.scheduleReconnect()})}scheduleReconnect(){var e,t;if(!this.options)return;let r=null!==(e=this.options.maxReconnectAttempts)&&void 0!==e?e:1/0;if(this.retryCount>=r)return;this.reconnectTimer&&clearTimeout(this.reconnectTimer);let n=null!==(t=this.options.reconnectInterval)&&void 0!==t?t:3e3;this.reconnectTimer=setTimeout(()=>{this.retryCount++,this.establishConnection()},n)}disconnect(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.updateState("disconnected")}getState(){return this.state}isConnected(){return"connected"===this.state}getLastError(){return this.lastError}getRetryCount(){return this.retryCount}reconnect(){this.retryCount++,this.shouldReconnect=!0,this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.establishConnection()}updateState(e){var t,r;this.state=e,null===(r=this.options)||void 0===r||null===(t=r.onStateChange)||void 0===t||t.call(r,e)}constructor(){this.eventSource=null,this.state="disconnected",this.retryCount=0,this.lastError=null,this.reconnectTimer=null,this.options=null,this.shouldReconnect=!0}}function i(e){let{url:t,onMessage:r,onError:i,reconnectInterval:a=3e3,maxReconnectAttempts:o=1/0,enabled:l=!0,withCredentials:c=!1}=e,[d,u]=(0,n.useState)(null),[x,h]=(0,n.useState)("disconnected"),[m,p]=(0,n.useState)(null),[g,j]=(0,n.useState)(0),f=(0,n.useRef)(null),v=(0,n.useCallback)(e=>{u(e),null==r||r(e)},[r]),Z=(0,n.useCallback)(e=>{h(e),"connected"===e&&j(0)},[]),y=(0,n.useCallback)(e=>{p(e),"number"==typeof e.retryCount&&j(e.retryCount),null==i||i(e)},[i]),b=(0,n.useCallback)(()=>{f.current&&(f.current.reconnect(),j(f.current.getRetryCount()))},[]),S=(0,n.useCallback)(()=>{f.current&&f.current.disconnect()},[]);return(0,n.useEffect)(()=>{if(!l){f.current&&(f.current.disconnect(),f.current=null);return}return f.current||(f.current=new s),f.current.connect({url:t,onMessage:v,onStateChange:Z,onError:y,reconnectInterval:a,maxReconnectAttempts:o,withCredentials:c}),()=>{f.current&&(f.current.disconnect(),f.current=null)}},[t,l,a,o,c,v,Z,y]),{data:d,isConnected:"connected"===x,state:x,error:m,retryCount:g,reconnect:b,disconnect:S}}},82925:function(e,t,r){"use strict";r.d(t,{KK:function(){return o},Lu:function(){return n},Xn:function(){return a},n3:function(){return s},xg:function(){return i}});let n={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},s={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],o=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,5511,880,55,2844,8347,6909,4474,8918,2698,3669,2757,1744],function(){return e(e.s=3590)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6302],{1366:function(e,s,n){Promise.resolve().then(n.bind(n,6643))},6643:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return N}});var t=n(94655),r=n(31317),i=n(7281),a=n(69899),o=n(70115),c=n(76492),l=n(91606),d=n(628),h=n(41565),x=n(25333),u=n(46207),j=n(43436),Z=n(92666);function m(){let{data:e,isLoading:s,error:n}=(0,Z.mj)();if(s)return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,t.jsx)(r.Z,{color:"text.secondary",children:"Loading..."})]})});if(n)return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,t.jsx)(r.Z,{color:"error",children:"Failed to load backup status"})]})});let{configured:a,lastBackup:o,repository:c}=e||{};return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(r.Z,{variant:"h6",children:"Backup Status"}),(0,t.jsx)(x.Z,{icon:a?(0,t.jsx)(u.Z,{}):(0,t.jsx)(j.Z,{}),label:a?"Configured":"Not Configured",color:a?"success":"error",size:"small"})]}),a?(0,t.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c&&(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Repository"}),(0,t.jsx)(r.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:c})]}),o&&(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Last Backup"}),(0,t.jsx)(r.Z,{variant:"body2",children:function(e){let s=new Date,n=new Date(e),t=Math.floor((s.getTime()-n.getTime())/6e4),r=Math.floor(t/60);return t<1?"just now":t<60?"".concat(t," minutes ago"):r<24?"".concat(r," hours ago"):"".concat(Math.floor(r/24)," days ago")}(o)})]}),!o&&(0,t.jsx)(r.Z,{variant:"body2",color:"text.secondary",children:"No backups yet"})]}):(0,t.jsx)(r.Z,{variant:"body2",color:"text.secondary",children:"GitHub backup is not configured. Please configure BACKUP_REPO_URL in your environment."})]})})}var p=n(35106),g=n(21138),y=n(84811),b=n(47001),f=n(53281),v=n(11254),k=n(70366),C=n(79983),w=n(97731),B=n(30417),S=n(99770),F=n(76678),D=n(5682),I=n(65087),T=n(62508),R=n(81071),z=n(93017);function P(e){var s;let{open:n,commit:a,onClose:o}=e,{mutate:c,isPending:l}=(0,Z.s8)(),[d,h]=(0,p.useState)(""),[x,u]=(0,p.useState)(""),j=()=>{l||(h(""),u(""),o())};return(0,t.jsxs)(S.Z,{open:n,onClose:j,maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(T.Z,{children:"Restore Backup"}),(0,t.jsxs)(D.Z,{children:[(0,t.jsx)(R.Z,{severity:"warning",sx:{mb:2},children:"This will restore all worlds from the selected backup. Current world data will be overwritten."}),d&&(0,t.jsx)(R.Z,{severity:"success",sx:{mb:2},children:d}),x&&(0,t.jsx)(R.Z,{severity:"error",sx:{mb:2},children:x}),(0,t.jsx)(I.Z,{sx:{mb:2},children:"Are you sure you want to restore from this backup?"}),(0,t.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Commit Hash"}),(0,t.jsx)(r.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:a.hash})]}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Date"}),(0,t.jsx)(r.Z,{variant:"body2",children:(s=a.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(s)))})]}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Message"}),(0,t.jsx)(r.Z,{variant:"body2",children:a.message})]}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Author"}),(0,t.jsx)(r.Z,{variant:"body2",children:a.author})]})]})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(B.Z,{onClick:j,disabled:l,children:"Cancel"}),(0,t.jsx)(B.Z,{onClick:()=>{h(""),u(""),c(a.hash,{onSuccess:()=>{h("Backup restored successfully from ".concat(a.hash.substring(0,7))),setTimeout(()=>{o()},2e3)},onError:e=>{u("Failed to restore backup: ".concat(e.message))}})},variant:"contained",color:"warning",disabled:l,startIcon:l?(0,t.jsx)(z.Z,{size:16}):(0,t.jsx)(w.Z,{}),children:l?"Restoring...":"Restore"})]})]})}function _(){let{data:e,isLoading:s,error:n}=(0,Z.$t)(20),[i,a]=(0,p.useState)(null),o=e=>{a(e)};if(s)return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,t.jsx)(r.Z,{color:"text.secondary",children:"Loading..."})]})});if(n)return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,t.jsx)(r.Z,{color:"error",children:"Failed to load backup history"})]})});let c=(null==e?void 0:e.commits)||[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),0===c.length?(0,t.jsx)(r.Z,{color:"text.secondary",children:"No backup history available"}):(0,t.jsx)(f.Z,{children:(0,t.jsxs)(g.Z,{children:[(0,t.jsx)(v.Z,{children:(0,t.jsxs)(k.Z,{children:[(0,t.jsx)(b.Z,{children:"Commit"}),(0,t.jsx)(b.Z,{children:"Date"}),(0,t.jsx)(b.Z,{children:"Message"}),(0,t.jsx)(b.Z,{children:"Author"}),(0,t.jsx)(b.Z,{align:"right",children:"Actions"})]})}),(0,t.jsx)(y.Z,{children:c.map(e=>{var s;return(0,t.jsxs)(k.Z,{children:[(0,t.jsx)(b.Z,{children:(0,t.jsx)(x.Z,{label:e.hash.substring(0,7),size:"small",variant:"outlined",sx:{fontFamily:"monospace"}})}),(0,t.jsx)(b.Z,{children:(0,t.jsx)(r.Z,{variant:"body2",children:(s=e.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(s)))})}),(0,t.jsx)(b.Z,{children:(0,t.jsx)(r.Z,{variant:"body2",children:e.message})}),(0,t.jsx)(b.Z,{children:(0,t.jsx)(r.Z,{variant:"body2",color:"text.secondary",children:e.author})}),(0,t.jsx)(b.Z,{align:"right",children:(0,t.jsx)(C.Z,{size:"small",color:"primary",onClick:()=>o(e),title:"Restore this backup",children:(0,t.jsx)(w.Z,{})})})]},e.hash)})})]})})]})}),i&&(0,t.jsx)(P,{open:!!i,commit:i,onClose:()=>{a(null)}})]})}var H=n(97436),M=n(34675);function E(e){let{disabled:s}=e,[n,r]=(0,p.useState)(!1),[i,a]=(0,p.useState)(""),[o,c]=(0,p.useState)(""),[l,d]=(0,p.useState)(""),{mutate:h,isPending:x}=(0,Z.c5)(),u=()=>{x||(r(!1),a(""),c(""),d(""))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Z,{variant:"contained",startIcon:(0,t.jsx)(M.Z,{}),onClick:()=>{r(!0),c(""),d(""),a("Backup ".concat(new Date().toISOString().split("T")[0]))},disabled:s||x,children:"Push Backup"}),(0,t.jsxs)(S.Z,{open:n,onClose:u,maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(T.Z,{children:"Push Backup"}),(0,t.jsxs)(D.Z,{children:[o&&(0,t.jsx)(R.Z,{severity:"success",sx:{mb:2},children:o}),l&&(0,t.jsx)(R.Z,{severity:"error",sx:{mb:2},children:l}),(0,t.jsx)(H.Z,{autoFocus:!0,margin:"dense",label:"Commit Message",type:"text",fullWidth:!0,variant:"outlined",value:i,onChange:e=>a(e.target.value),disabled:x,helperText:"Optional message describing this backup"})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(B.Z,{onClick:u,disabled:x,children:"Cancel"}),(0,t.jsx)(B.Z,{onClick:()=>{c(""),d(""),h({message:i||void 0},{onSuccess:e=>{c(e.commitHash?"Backup pushed successfully (".concat(e.commitHash.substring(0,7),")"):"Backup pushed successfully"),setTimeout(()=>{u()},2e3)},onError:e=>{d("Failed to push backup: ".concat(e.message))}})},variant:"contained",disabled:x,startIcon:x?(0,t.jsx)(z.Z,{size:16}):(0,t.jsx)(M.Z,{}),children:x?"Pushing...":"Push"})]})]})]})}function N(){var e;let{data:s}=(0,Z.mj)(),n=null!==(e=null==s?void 0:s.configured)&&void 0!==e&&e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,c.Fq)(e.palette.secondary.main,.1)," 0%, ").concat((0,c.Fq)(e.palette.info.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,c.Fq)(e.palette.secondary.main,.2)),display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,t.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"secondary.main",color:"secondary.contrastText"},children:(0,t.jsx)(l.Z,{sx:{fontSize:32}})}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Backups"}),(0,t.jsx)(r.Z,{variant:"body1",color:"text.secondary",children:"Manage world backups and restore points"})]})]}),(0,t.jsx)(E,{disabled:!n})]}),(0,t.jsxs)(o.Z,{spacing:3,children:[(0,t.jsx)(m,{}),n&&(0,t.jsx)(_,{})]})]})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,7359,880,9654,892,2666,3669,2757,1744],function(){return e(e.s=1366)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6302],{1366:function(e,s,n){Promise.resolve().then(n.bind(n,6643))},6643:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return N}});var t=n(94655),r=n(31317),i=n(7281),a=n(69899),o=n(70115),c=n(76492),l=n(91606),d=n(628),h=n(41565),x=n(25333),u=n(46207),j=n(43436),Z=n(92666);function m(){let{data:e,isLoading:s,error:n}=(0,Z.mj)();if(s)return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,t.jsx)(r.Z,{color:"text.secondary",children:"Loading..."})]})});if(n)return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup Status"}),(0,t.jsx)(r.Z,{color:"error",children:"Failed to load backup status"})]})});let{configured:a,lastBackup:o,repository:c}=e||{};return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(r.Z,{variant:"h6",children:"Backup Status"}),(0,t.jsx)(x.Z,{icon:a?(0,t.jsx)(u.Z,{}):(0,t.jsx)(j.Z,{}),label:a?"Configured":"Not Configured",color:a?"success":"error",size:"small"})]}),a?(0,t.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[c&&(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Repository"}),(0,t.jsx)(r.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:c})]}),o&&(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Last Backup"}),(0,t.jsx)(r.Z,{variant:"body2",children:function(e){let s=new Date,n=new Date(e),t=Math.floor((s.getTime()-n.getTime())/6e4),r=Math.floor(t/60);return t<1?"just now":t<60?"".concat(t," minutes ago"):r<24?"".concat(r," hours ago"):"".concat(Math.floor(r/24)," days ago")}(o)})]}),!o&&(0,t.jsx)(r.Z,{variant:"body2",color:"text.secondary",children:"No backups yet"})]}):(0,t.jsx)(r.Z,{variant:"body2",color:"text.secondary",children:"GitHub backup is not configured. Please configure BACKUP_REPO_URL in your environment."})]})})}var p=n(35106),g=n(21138),y=n(84811),b=n(47001),f=n(53281),v=n(11254),k=n(70366),C=n(79983),w=n(97731),B=n(30417),S=n(99770),F=n(76678),D=n(5682),I=n(65087),T=n(62508),R=n(81071),z=n(93017);function P(e){var s;let{open:n,commit:a,onClose:o}=e,{mutate:c,isPending:l}=(0,Z.s8)(),[d,h]=(0,p.useState)(""),[x,u]=(0,p.useState)(""),j=()=>{l||(h(""),u(""),o())};return(0,t.jsxs)(S.Z,{open:n,onClose:j,maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(T.Z,{children:"Restore Backup"}),(0,t.jsxs)(D.Z,{children:[(0,t.jsx)(R.Z,{severity:"warning",sx:{mb:2},children:"This will restore all worlds from the selected backup. Current world data will be overwritten."}),d&&(0,t.jsx)(R.Z,{severity:"success",sx:{mb:2},children:d}),x&&(0,t.jsx)(R.Z,{severity:"error",sx:{mb:2},children:x}),(0,t.jsx)(I.Z,{sx:{mb:2},children:"Are you sure you want to restore from this backup?"}),(0,t.jsxs)(i.Z,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Commit Hash"}),(0,t.jsx)(r.Z,{variant:"body2",sx:{fontFamily:"monospace",fontSize:"0.875rem"},children:a.hash})]}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Date"}),(0,t.jsx)(r.Z,{variant:"body2",children:(s=a.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(s)))})]}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Message"}),(0,t.jsx)(r.Z,{variant:"body2",children:a.message})]}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"caption",color:"text.secondary",children:"Author"}),(0,t.jsx)(r.Z,{variant:"body2",children:a.author})]})]})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(B.Z,{onClick:j,disabled:l,children:"Cancel"}),(0,t.jsx)(B.Z,{onClick:()=>{h(""),u(""),c(a.hash,{onSuccess:()=>{h("Backup restored successfully from ".concat(a.hash.substring(0,7))),setTimeout(()=>{o()},2e3)},onError:e=>{u("Failed to restore backup: ".concat(e.message))}})},variant:"contained",color:"warning",disabled:l,startIcon:l?(0,t.jsx)(z.Z,{size:16}):(0,t.jsx)(w.Z,{}),children:l?"Restoring...":"Restore"})]})]})}function _(){let{data:e,isLoading:s,error:n}=(0,Z.$t)(20),[i,a]=(0,p.useState)(null),o=e=>{a(e)};if(s)return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,t.jsx)(r.Z,{color:"text.secondary",children:"Loading..."})]})});if(n)return(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),(0,t.jsx)(r.Z,{color:"error",children:"Failed to load backup history"})]})});let c=(null==e?void 0:e.commits)||[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Z,{children:(0,t.jsxs)(h.Z,{children:[(0,t.jsx)(r.Z,{variant:"h6",gutterBottom:!0,children:"Backup History"}),0===c.length?(0,t.jsx)(r.Z,{color:"text.secondary",children:"No backup history available"}):(0,t.jsx)(f.Z,{children:(0,t.jsxs)(g.Z,{children:[(0,t.jsx)(v.Z,{children:(0,t.jsxs)(k.Z,{children:[(0,t.jsx)(b.Z,{children:"Commit"}),(0,t.jsx)(b.Z,{children:"Date"}),(0,t.jsx)(b.Z,{children:"Message"}),(0,t.jsx)(b.Z,{children:"Author"}),(0,t.jsx)(b.Z,{align:"right",children:"Actions"})]})}),(0,t.jsx)(y.Z,{children:c.map(e=>{var s;return(0,t.jsxs)(k.Z,{children:[(0,t.jsx)(b.Z,{children:(0,t.jsx)(x.Z,{label:e.hash.substring(0,7),size:"small",variant:"outlined",sx:{fontFamily:"monospace"}})}),(0,t.jsx)(b.Z,{children:(0,t.jsx)(r.Z,{variant:"body2",children:(s=e.date,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(s)))})}),(0,t.jsx)(b.Z,{children:(0,t.jsx)(r.Z,{variant:"body2",children:e.message})}),(0,t.jsx)(b.Z,{children:(0,t.jsx)(r.Z,{variant:"body2",color:"text.secondary",children:e.author})}),(0,t.jsx)(b.Z,{align:"right",children:(0,t.jsx)(C.Z,{size:"small",color:"primary",onClick:()=>o(e),title:"Restore this backup",children:(0,t.jsx)(w.Z,{})})})]},e.hash)})})]})})]})}),i&&(0,t.jsx)(P,{open:!!i,commit:i,onClose:()=>{a(null)}})]})}var H=n(97436),M=n(34675);function E(e){let{disabled:s}=e,[n,r]=(0,p.useState)(!1),[i,a]=(0,p.useState)(""),[o,c]=(0,p.useState)(""),[l,d]=(0,p.useState)(""),{mutate:h,isPending:x}=(0,Z.c5)(),u=()=>{x||(r(!1),a(""),c(""),d(""))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Z,{variant:"contained",startIcon:(0,t.jsx)(M.Z,{}),onClick:()=>{r(!0),c(""),d(""),a("Backup ".concat(new Date().toISOString().split("T")[0]))},disabled:s||x,children:"Push Backup"}),(0,t.jsxs)(S.Z,{open:n,onClose:u,maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(T.Z,{children:"Push Backup"}),(0,t.jsxs)(D.Z,{children:[o&&(0,t.jsx)(R.Z,{severity:"success",sx:{mb:2},children:o}),l&&(0,t.jsx)(R.Z,{severity:"error",sx:{mb:2},children:l}),(0,t.jsx)(H.Z,{autoFocus:!0,margin:"dense",label:"Commit Message",type:"text",fullWidth:!0,variant:"outlined",value:i,onChange:e=>a(e.target.value),disabled:x,helperText:"Optional message describing this backup"})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(B.Z,{onClick:u,disabled:x,children:"Cancel"}),(0,t.jsx)(B.Z,{onClick:()=>{c(""),d(""),h({message:i||void 0},{onSuccess:e=>{c(e.commitHash?"Backup pushed successfully (".concat(e.commitHash.substring(0,7),")"):"Backup pushed successfully"),setTimeout(()=>{u()},2e3)},onError:e=>{d("Failed to push backup: ".concat(e.message))}})},variant:"contained",disabled:x,startIcon:x?(0,t.jsx)(z.Z,{size:16}):(0,t.jsx)(M.Z,{}),children:x?"Pushing...":"Push"})]})]})]})}function N(){var e;let{data:s}=(0,Z.mj)(),n=null!==(e=null==s?void 0:s.configured)&&void 0!==e&&e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,c.Fq)(e.palette.secondary.main,.1)," 0%, ").concat((0,c.Fq)(e.palette.info.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,c.Fq)(e.palette.secondary.main,.2)),display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,t.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"secondary.main",color:"secondary.contrastText"},children:(0,t.jsx)(l.Z,{sx:{fontSize:32}})}),(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(r.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Backups"}),(0,t.jsx)(r.Z,{variant:"body1",color:"text.secondary",children:"Manage world backups and restore points"})]})]}),(0,t.jsx)(E,{disabled:!n})]}),(0,t.jsxs)(o.Z,{spacing:3,children:[(0,t.jsx)(m,{}),n&&(0,t.jsx)(_,{})]})]})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,880,2844,8854,2666,3669,2757,1744],function(){return e(e.s=1366)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2248],{12121:function(e,t,n){Promise.resolve().then(n.bind(n,64924))},64924:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return U}});var r=n(94655),s=n(69899),i=n(76492),a=n(7281),o=n(31317),l=n(84840),c=n(628),d=n(41565),u=n(10721),h=n(25065),x=n(91179),p=n(11767),m=n(53832),f=n(30164),g=n(92666),v=n(59104);function j(e){let{title:t,value:n,icon:s,color:i="primary",description:l}=e,u={primary:"#1bd96a",success:"#22c55e",info:"#3b82f6",secondary:"#7c3aed"};return(0,r.jsx)(c.Z,{"data-testid":"stat-card",sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:u[i]}},children:(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,r.jsx)(o.Z,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:t}),s&&(0,r.jsx)(a.Z,{sx:{color:u[i],opacity:.8},children:s})]}),(0,r.jsx)(o.Z,{variant:"h3",component:"div",sx:{fontWeight:700,color:"text.primary",mb:l?1:0},children:n}),l&&(0,r.jsx)(o.Z,{variant:"caption",color:"text.secondary",children:l})]})})}var y=n(98406),Z=n(93017),b=n(25333),w=n(46725),S=n(8690),C=n(31358);function T(e){let{servers:t,statusMap:n={},isLoading:s,maxItems:i,showViewAll:l=!1,onServerClick:u}=e,h=(0,C.x)(),x=i?t.slice(0,i):t,p=e=>{u?u(e):h.push("/servers/".concat(e))},m=e=>{switch(e){case"running":return"success";case"stopped":case"exited":return"error";case"created":return"warning";default:return"default"}},f=e=>{switch(e){case"healthy":return"success";case"unhealthy":return"error";case"starting":return"warning";default:return"default"}};return s?(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(y.Z,{title:"Servers"}),(0,r.jsx)(d.Z,{children:(0,r.jsx)(a.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(Z.Z,{})})})]}):0===t.length?(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(y.Z,{title:"Servers"}),(0,r.jsx)(d.Z,{children:(0,r.jsx)(o.Z,{color:"text.secondary",align:"center",children:"No servers found. Create your first server to get started."})})]}):(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(y.Z,{title:"Servers",action:l&&t.length>(i||0)?(0,r.jsxs)(w.default,{href:"/servers",onClick:()=>(0,S.Av)(),style:{textDecoration:"none",color:"inherit",fontSize:"0.875rem"},children:["View All (",t.length,")"]}):null}),(0,r.jsx)(d.Z,{children:(0,r.jsx)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:2},children:x.map(e=>{let t=n[e.name],s=(null==t?void 0:t.status)||e.status,i=(null==t?void 0:t.health)||e.health;return(0,r.jsx)(a.Z,{role:"button",onClick:()=>p(e.name),sx:{p:2,borderRadius:1,border:"1px solid",borderColor:"divider",cursor:"pointer",transition:"all 0.2s","&:hover":{borderColor:"primary.main",backgroundColor:"action.hover"}},children:(0,r.jsxs)(a.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(o.Z,{variant:"subtitle1",fontWeight:600,children:e.name}),(0,r.jsx)(o.Z,{variant:"caption",color:"text.secondary",children:e.hostname})]}),(0,r.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[(0,r.jsx)(b.Z,{label:s,color:m(s),size:"small"}),"none"!==i&&(0,r.jsx)(b.Z,{label:i,color:f(i),size:"small",variant:"outlined"})]})]})},e.name)})})})]})}var k=n(35106),z=n(41261);function I(e){let{maxVersions:t=2,title:n="Recent Updates"}=e,[s,i]=(0,k.useState)([]),[l,h]=(0,k.useState)(!0),[x,p]=(0,k.useState)(null);return((0,k.useEffect)(()=>{(async function(){try{let e=await fetch("https://api.github.com/repos/smallmiro/minecraft-server-manager/contents/CHANGELOG.md",{headers:{Accept:"application/vnd.github.v3+json"}});if(!e.ok)throw Error("Failed to fetch changelog");let n=await e.json(),r=atob(n.content),s=function(e,t){let n=[],r=e.split("\n"),s=null,i="added";for(let e of r){let r=e.match(/^## \[([^\]]+)\] - (\d{4}-\d{2}-\d{2})/);if(r){if(s&&(n.push(s),n.length>=t))break;s={version:r[1],date:r[2],items:[]};continue}let a=e.match(/^### (Added|Fixed|Changed)/i);if(a){i=a[1].toLowerCase();continue}let o=e.match(/^- \*\*([^*]+)\*\*\s*[-–]?\s*(.*)$/);o&&s&&s.items.push({type:i,message:o[1].trim()})}return s&&n.length<t&&n.push(s),n}(r,t);i(s)}catch(e){p(e instanceof Error?e.message:"Unknown error")}finally{h(!1)}})()},[t]),l)?(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(y.Z,{title:n}),(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(u.Z,{variant:"text",width:"60%",height:28}),(0,r.jsx)(u.Z,{variant:"text",width:"80%"}),(0,r.jsx)(u.Z,{variant:"text",width:"70%"}),(0,r.jsxs)(a.Z,{sx:{mt:2},children:[(0,r.jsx)(u.Z,{variant:"text",width:"60%",height:28}),(0,r.jsx)(u.Z,{variant:"text",width:"75%"})]})]})]}):x?(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(y.Z,{title:n}),(0,r.jsx)(d.Z,{children:(0,r.jsx)(o.Z,{color:"text.secondary",align:"center",children:"Unable to load updates"})})]}):(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(y.Z,{title:n,action:(0,r.jsx)(z.Z,{href:"https://github.com/smallmiro/minecraft-server-manager/blob/develop/CHANGELOG.md",target:"_blank",rel:"noopener",sx:{fontSize:13,mr:1},children:"View all"})}),(0,r.jsx)(d.Z,{sx:{pt:0},children:s.map((e,t)=>{let n=e.items.filter(e=>"added"===e.type),i=e.items.filter(e=>"fixed"===e.type),l=e.items.filter(e=>"changed"===e.type);return(0,r.jsxs)(a.Z,{sx:{mb:t<s.length-1?2.5:0,pb:t<s.length-1?2:0,borderBottom:t<s.length-1?"1px solid":"none",borderColor:"divider"},children:[(0,r.jsxs)(o.Z,{variant:"subtitle2",sx:{fontWeight:600,color:"primary.main",mb:1},children:["[",e.version,"] - ",e.date]}),n.length>0&&(0,r.jsxs)(a.Z,{sx:{mb:1},children:[(0,r.jsx)(b.Z,{label:"Added",size:"small",sx:{bgcolor:"success.main",color:"success.contrastText",fontSize:11,height:20,mb:.5}}),n.map((e,t)=>(0,r.jsxs)(o.Z,{variant:"body2",sx:{color:"text.secondary",pl:1},children:["• ",e.message]},t))]}),i.length>0&&(0,r.jsxs)(a.Z,{sx:{mb:1},children:[(0,r.jsx)(b.Z,{label:"Fixed",size:"small",sx:{bgcolor:"warning.main",color:"warning.contrastText",fontSize:11,height:20,mb:.5}}),i.map((e,t)=>(0,r.jsxs)(o.Z,{variant:"body2",sx:{color:"text.secondary",pl:1},children:["• ",e.message]},t))]}),l.length>0&&(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(b.Z,{label:"Changed",size:"small",sx:{bgcolor:"info.main",color:"info.contrastText",fontSize:11,height:20,mb:.5}}),l.map((e,t)=>(0,r.jsxs)(o.Z,{variant:"body2",sx:{color:"text.secondary",pl:1},children:["• ",e.message]},t))]})]},e.version)})})]})}var R=n(30417),E=n(90158),P=n(58347),A=n(73424),F=n(95511),N=n(26577),D=n(56813),W=n(26892),L=n(84509);function q(e){var t;let{maxItems:n=5}=e,{data:s,isLoading:i,error:l}=(0,L.oL)(n),h=null!==(t=null==s?void 0:s.logs)&&void 0!==t?t:[];return(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(y.Z,{title:"Recent Activity",action:(0,r.jsx)(R.Z,{component:w.default,href:"/audit-logs",size:"small",endIcon:(0,r.jsx)(N.Z,{}),sx:{textTransform:"none"},children:"View All"})}),(0,r.jsx)(d.Z,{sx:{pt:0},children:i?(0,r.jsx)(E.Z,{sx:{py:0},children:[...Array(n)].map((e,t)=>(0,r.jsx)(P.ZP,{sx:{px:0,py:1.5},children:(0,r.jsx)(A.Z,{primary:(0,r.jsxs)(a.Z,{sx:{display:"flex",gap:1},children:[(0,r.jsx)(u.Z,{variant:"rounded",width:60,height:24}),(0,r.jsx)(u.Z,{variant:"text",width:80}),(0,r.jsx)(u.Z,{variant:"text",width:60})]}),secondary:(0,r.jsx)(u.Z,{variant:"text",width:50})})},t))}):l?(0,r.jsx)(o.Z,{color:"text.secondary",align:"center",children:"Failed to load recent activity"}):0===h.length?(0,r.jsx)(o.Z,{color:"text.secondary",align:"center",sx:{py:2},children:"No recent activity"}):(0,r.jsx)(E.Z,{sx:{py:0},children:h.map(e=>{var t;return(0,r.jsx)(P.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,r.jsx)(A.Z,{primary:(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,r.jsx)(D.I,{action:e.action,size:"small"}),(0,r.jsx)(o.Z,{variant:"body2",sx:{fontWeight:500},children:e.targetName}),(0,r.jsxs)(o.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),"failure"===e.status&&(0,r.jsx)(W.c,{status:e.status,size:"small"})]}),secondary:(0,r.jsx)(F.Z,{title:(t=e.timestamp,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(new Date(t))),arrow:!0,children:(0,r.jsx)(o.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let t=new Date,n=new Date(e),r=Math.floor((t.getTime()-n.getTime())/6e4),s=Math.floor(r/60);return r<1?"just now":r<60?"".concat(r,"m ago"):s<24?"".concat(s,"h ago"):"".concat(Math.floor(s/24),"d ago")}(e.timestamp)})})})},e.id)})})})]})}var O=n(84974),M=n(37228);function K(){let{data:e,isLoading:t}=(0,M.UW)();if(t)return(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(u.Z,{variant:"circular",width:20,height:20}),(0,r.jsx)(u.Z,{variant:"text",width:120})]}),(0,r.jsx)(u.Z,{variant:"rounded",width:60,height:24})]}),(0,r.jsx)(u.Z,{variant:"text",width:"50%",height:32}),(0,r.jsx)(u.Z,{variant:"text",width:"70%"})]})});if(!(null==e?void 0:e.enabled))return(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(O.Z,{sx:{fontSize:20,color:"text.secondary"}}),(0,r.jsx)(o.Z,{variant:"body2",fontWeight:500,color:"text.secondary",children:"External Access"})]}),(0,r.jsx)(b.Z,{label:"Not configured",size:"small",variant:"outlined"})]}),(0,r.jsx)(o.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"playit.gg is not configured"}),(0,r.jsx)(R.Z,{component:w.default,href:"/routing",size:"small",endIcon:(0,r.jsx)(N.Z,{}),sx:{fontSize:12},children:"Manage"})]})});let n=e.agentRunning&&"running"===e.containerStatus,s=e.servers.length,i=e.servers.filter(e=>e.playitDomain).length;return(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(O.Z,{sx:{fontSize:20,color:"primary.main"}}),(0,r.jsx)(o.Z,{variant:"body2",fontWeight:500,children:"External Access"})]}),(0,r.jsx)(b.Z,{label:n?"Running":"Stopped",size:"small",color:n?"success":"default",variant:"outlined"})]}),(0,r.jsxs)(o.Z,{variant:"h6",sx:{mb:.5},children:[i," / ",s," servers"]}),(0,r.jsx)(o.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"With external domains"}),(0,r.jsx)(R.Z,{component:w.default,href:"/routing",size:"small",endIcon:(0,r.jsx)(N.Z,{}),sx:{fontSize:12},children:"Manage"})]})})}function U(){let{data:e,isLoading:t}=(0,g.x$)(),{data:n,isLoading:y}=(0,g.Sr)(),{statusMap:Z}=(0,v.d)(),b=t||y,w=(null==e?void 0:e.total)||0,S=(null==e?void 0:e.servers.filter(e=>{let t=Z[e.name];return"running"===((null==t?void 0:t.status)||e.status)}).length)||0,C=(null==n?void 0:n.total)||0;return b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,i.Fq)(e.palette.secondary.main,.1)," 0%, ").concat((0,i.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,i.Fq)(e.palette.secondary.main,.2))},children:(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"primary.main",color:"primary.contrastText"},children:(0,r.jsx)(h.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(o.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Dashboard"}),(0,r.jsx)(o.Z,{variant:"body1",color:"text.secondary",children:"Overview of your Minecraft server infrastructure"})]})]})}),(0,r.jsx)(l.ZP,{container:!0,spacing:3,sx:{mb:4},children:[0,1,2,3].map(e=>(0,r.jsx)(l.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(c.Z,{sx:{height:"100%",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:"4px",background:"grey.300"}},children:(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[(0,r.jsx)(u.Z,{variant:"text",width:"60%"}),(0,r.jsx)(u.Z,{variant:"circular",width:32,height:32})]}),(0,r.jsx)(u.Z,{variant:"text",width:"40%",height:48}),(0,r.jsx)(u.Z,{variant:"text",width:"70%"})]})})},e))}),(0,r.jsxs)(l.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(l.ZP,{item:!0,xs:12,lg:7,children:(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(u.Z,{variant:"text",width:"30%",height:32,sx:{mb:2}}),[0,1,2,3,4].map(e=>(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,r.jsx)(u.Z,{variant:"circular",width:10,height:10}),(0,r.jsx)(u.Z,{variant:"text",width:"25%"}),(0,r.jsx)(u.Z,{variant:"rounded",width:60,height:24,sx:{ml:"auto"}})]},e))]})})}),(0,r.jsx)(l.ZP,{item:!0,xs:12,lg:5,children:(0,r.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(u.Z,{variant:"text",width:"40%",height:32,sx:{mb:2}}),[0,1,2,3].map(e=>(0,r.jsxs)(a.Z,{sx:{display:"flex",gap:1.5,py:1,borderBottom:"1px solid",borderColor:"divider"},children:[(0,r.jsx)(u.Z,{variant:"circular",width:24,height:24}),(0,r.jsxs)(a.Z,{sx:{flex:1},children:[(0,r.jsx)(u.Z,{variant:"text",width:"80%"}),(0,r.jsx)(u.Z,{variant:"text",width:"50%"})]})]},e))]})}),(0,r.jsx)(c.Z,{children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)(u.Z,{variant:"text",width:"35%",height:32,sx:{mb:2}}),[0,1].map(e=>(0,r.jsxs)(a.Z,{sx:{py:1,borderBottom:"1px solid",borderColor:"divider"},children:[(0,r.jsx)(u.Z,{variant:"text",width:"60%"}),(0,r.jsx)(u.Z,{variant:"text",width:"90%"})]},e))]})})]})})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,i.Fq)(e.palette.secondary.main,.1)," 0%, ").concat((0,i.Fq)(e.palette.primary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,i.Fq)(e.palette.secondary.main,.2))},children:(0,r.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"secondary.main",color:"secondary.contrastText"},children:(0,r.jsx)(h.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(o.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Dashboard"}),(0,r.jsx)(o.Z,{variant:"body1",color:"text.secondary",children:"Overview of your Minecraft server infrastructure"})]})]})}),(0,r.jsxs)(l.ZP,{container:!0,spacing:3,sx:{mb:4},children:[(0,r.jsx)(l.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(j,{title:"Total Servers",value:w,icon:(0,r.jsx)(x.Z,{fontSize:"large"}),color:"primary",description:"All configured servers"})}),(0,r.jsx)(l.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(j,{title:"Online Servers",value:S,icon:(0,r.jsx)(p.Z,{fontSize:"large"}),color:"success",description:"Currently running"})}),(0,r.jsx)(l.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(j,{title:"Total Players",value:0,icon:(0,r.jsx)(m.Z,{fontSize:"large"}),color:"info",description:"Across all servers"})}),(0,r.jsx)(l.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsx)(j,{title:"Total Worlds",value:C,icon:(0,r.jsx)(f.Z,{fontSize:"large"}),color:"secondary",description:"Available worlds"})})]}),(0,r.jsxs)(l.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(l.ZP,{item:!0,xs:12,lg:7,children:(0,r.jsx)(T,{servers:(null==e?void 0:e.servers)||[],statusMap:Z,isLoading:t,maxItems:5,showViewAll:!0})}),(0,r.jsx)(l.ZP,{item:!0,xs:12,lg:5,children:(0,r.jsxs)(a.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,r.jsx)(K,{}),(0,r.jsx)(q,{maxItems:5}),(0,r.jsx)(I,{maxVersions:2})]})})]})]})}},56813:function(e,t,n){"use strict";n.d(t,{I:function(){return a}});var r=n(94655),s=n(25333),i=n(82925);function a(e){let{action:t,size:n="small"}=e,a=i.Lu[t]||"default",o=i.n3[t]||t;return(0,r.jsx)(s.Z,{label:o,color:a,size:n,variant:"filled",sx:{fontWeight:600,fontSize:"small"===n?"0.7rem":"0.8rem"}})}},26892:function(e,t,n){"use strict";n.d(t,{c:function(){return o}});var r=n(94655),s=n(25333),i=n(46207),a=n(43436);function o(e){let{status:t,size:n="small"}=e;return(0,r.jsx)(s.Z,{icon:"success"===t?(0,r.jsx)(i.Z,{}):(0,r.jsx)(a.Z,{}),label:"success"===t?"OK":"Error",color:"success"===t?"success":"error",size:n,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===n?"0.7rem":"0.8rem"}})}},3454:function(e,t,n){"use strict";n.d(t,{LoadingProvider:function(){return l},startLoading:function(){return c},stopLoading:function(){return d}});var r=n(94655),s=n(35106),i=n(74228),a=n(31477),o=n.n(a);function l(e){let{children:t}=e,n=(0,i.usePathname)(),a=(0,i.useSearchParams)();return(0,s.useEffect)(()=>{o().done()},[n,a]),(0,r.jsx)(r.Fragment,{children:t})}function c(){o().start()}function d(){o().done()}o().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)},31358:function(e,t,n){"use strict";n.d(t,{x:function(){return a}});var r=n(74228),s=n(35106),i=n(8690);function a(){let e=(0,r.useRouter)(),t=(0,s.useCallback)((t,n)=>{(0,i.Av)(),e.push(t,n)},[e]),n=(0,s.useCallback)((t,n)=>{(0,i.Av)(),e.replace(t,n)},[e]);return(0,s.useMemo)(()=>({...e,push:t,replace:n}),[e,t,n])}},84509:function(e,t,n){"use strict";n.d(t,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return c}});var r=n(5632),s=n(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=function(e){let t=new URLSearchParams;e.action&&t.set("action",e.action),e.actor&&t.set("actor",e.actor),e.targetType&&t.set("targetType",e.targetType),e.targetName&&t.set("targetName",e.targetName),e.status&&t.set("status",e.status),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),void 0!==e.limit&&t.set("limit",String(e.limit)),void 0!==e.offset&&t.set("offset",String(e.offset)),e.sort&&t.set("sort",e.sort);let n=t.toString();return n?"?".concat(n):""}(e);return(0,r.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs".concat(n)),enabled:(null==t?void 0:t.enabled)!==!1})}function a(e){return(0,r.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,s.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,t){return(0,r.a)({queryKey:["audit-logs",e],queryFn:()=>(0,s.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function l(e,t){var n;return i({targetType:"server",targetName:e,limit:null!==(n=null==t?void 0:t.limit)&&void 0!==n?n:20},{enabled:(null==t?void 0:t.enabled)!==!1&&!!e})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},37228:function(e,t,n){"use strict";n.d(t,{Bc:function(){return l},N$:function(){return c},UW:function(){return o}});var r=n(5632),s=n(58919),i=n(20367),a=n(42936);function o(){return(0,r.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function l(){let e=(0,s.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/start",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}function c(){let e=(0,s.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/stop",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}},93757:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});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 i(e){let{url:t,onMessage:n,onError:i,reconnectInterval:a=3e3,maxReconnectAttempts:o=1/0,enabled:l=!0,withCredentials:c=!1}=e,[d,u]=(0,r.useState)(null),[h,x]=(0,r.useState)("disconnected"),[p,m]=(0,r.useState)(null),[f,g]=(0,r.useState)(0),v=(0,r.useRef)(null),j=(0,r.useCallback)(e=>{u(e),null==n||n(e)},[n]),y=(0,r.useCallback)(e=>{x(e),"connected"===e&&g(0)},[]),Z=(0,r.useCallback)(e=>{m(e),"number"==typeof e.retryCount&&g(e.retryCount),null==i||i(e)},[i]),b=(0,r.useCallback)(()=>{v.current&&(v.current.reconnect(),g(v.current.getRetryCount()))},[]),w=(0,r.useCallback)(()=>{v.current&&v.current.disconnect()},[]);return(0,r.useEffect)(()=>{if(!l){v.current&&(v.current.disconnect(),v.current=null);return}return v.current||(v.current=new s),v.current.connect({url:t,onMessage:j,onStateChange:y,onError:Z,reconnectInterval:a,maxReconnectAttempts:o,withCredentials:c}),()=>{v.current&&(v.current.disconnect(),v.current=null)}},[t,l,a,o,c,j,y,Z]),{data:d,isConnected:"connected"===h,state:h,error:p,retryCount:f,reconnect:b,disconnect:w}}},59104:function(e,t,n){"use strict";n.d(t,{d:function(){return i}});var r=n(35106),s=n(93757);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onStatusChange:t,enabled:n=!0,reconnectInterval:i=3e3}=e,[a,o]=(0,r.useState)({}),l=(0,r.useCallback)(e=>{if("server-status"===e.type){let{serverName:n,status:r,health:s,timestamp:i}=e.data;o(e=>({...e,[n]:{status:r,health:s,timestamp:i}})),null==t||t(n,r,s)}},[t]),{isConnected:c,reconnect:d,retryCount:u}=(0,s.D)({url:"/api/sse/servers-status",onMessage:l,enabled:n,reconnectInterval:i}),h=(0,r.useCallback)(e=>a[e]||null,[a]);return(0,r.useEffect)(()=>{n||o({})},[n]),{statusMap:a,getServerStatus:h,isConnected:c,reconnect:d,retryCount:u}}},82925:function(e,t,n){"use strict";n.d(t,{KK:function(){return o},Lu:function(){return r},Xn:function(){return a},n3:function(){return s},xg:function(){return i}});let r={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},s={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],o=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,9760,6758,1668,540,4416,2538,5511,55,8347,9951,9727,2666,3669,2757,1744],function(){return e(e.s=12121)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[781],{31809:function(e,n,a){Promise.resolve().then(a.bind(a,38538))},38538:function(e,n,a){"use strict";a.r(n),a.d(n,{default:function(){return ep}});var r=a(94655),l=a(35106),t=a(7281),s=a(31317),i=a(84840),o=a(33402),c=a(60097),d=a(29793),h=a(75726),x=a(62328),u=a(7178),p=a(69899),m=a(76492),j=a(35847),y=a(628),Z=a(41565),v=a(90158),b=a(58347),g=a(73424),f=a(69783),C=a(86702),w=a(79983),k=a(30417),S=a(25333),E=a(99770),P=a(62508),F=a(5682),I=a(65087),A=a(76678),O=a(97436),W=a(93017),D=a(81071),L=a(66561),N=a(12795),z=a(96407),B=a(69366),R=a(11597),T=a(81960),U=a(30114);function M(e){let{onPlayerKicked:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),[j,M]=(0,l.useState)(""),[_,K]=(0,l.useState)(!1),q=(0,l.useCallback)(async()=>{i(!0),c(null);try{let e=await fetch("/api/players");if(!e.ok)throw Error("Failed to fetch players");let n=await e.json();h(n.servers)}catch(e){c("Failed to load players"),console.error("Error fetching players:",e)}finally{i(!1)}},[]);(0,l.useEffect)(()=>{q()},[q]);let J=(e,n)=>{m({player:e,server:n}),M(""),u(!0)},G=async()=>{if(p){K(!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:j||"Kicked by administrator"})})).ok)throw Error("Failed to kick player");u(!1),m(null),null==n||n(p.player,p.server),await q()}catch(e){console.error("Error kicking player:",e)}finally{K(!1)}}},Y=d.some(e=>e.players.length>0);return(0,r.jsx)(y.Z,{"data-testid":"player-list",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Online Players"}),(0,r.jsx)(w.Z,{onClick:q,disabled:a,"aria-label":"Refresh",children:(0,r.jsx)(B.Z,{})})]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&!o&&!Y&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players online"}),!a&&!o&&Y&&(0,r.jsx)(t.Z,{children:d.map(e=>(0,r.jsxs)(L.Z,{defaultExpanded:e.players.length>0,children:[(0,r.jsx)(N.Z,{expandIcon:(0,r.jsx)(T.Z,{}),children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2,width:"100%"},children:[(0,r.jsx)(s.Z,{variant:"subtitle1",sx:{fontWeight:500},children:e.name}),(0,r.jsx)(S.Z,{label:"".concat(e.players.length," player").concat(1!==e.players.length?"s":""),size:"small",color:e.players.length>0?"success":"default"})]})}),(0,r.jsx)(z.Z,{children:0===e.players.length?(0,r.jsx)(s.Z,{color:"text.secondary",sx:{fontStyle:"italic"},children:"No players online on this server"}):(0,r.jsx)(v.Z,{dense:!0,children:e.players.map(n=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Kick player",onClick:()=>J(n,e.name),color:"error",children:(0,r.jsx)(R.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:"https://mc-heads.net/avatar/".concat(n.uuid,"/40"),alt:n.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:n.name,secondary:n.uuid.substring(0,8)+"..."})]},n.uuid))})})]},e.name))}),(0,r.jsxs)(E.Z,{open:x,onClose:()=>u(!1),children:[(0,r.jsx)(P.Z,{children:"Kick Player"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsxs)(I.Z,{children:["Are you sure you want to kick ",null==p?void 0:p.player.name," from ",null==p?void 0:p.server,"?"]}),(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Reason (optional)",fullWidth:!0,variant:"outlined",value:j,onChange:e=>M(e.target.value),placeholder:"Kicked by administrator"})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>u(!1),disabled:_,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:G,color:"error",variant:"contained",disabled:_,"aria-label":"Confirm kick",children:_?(0,r.jsx)(W.Z,{size:20}):"Confirm"})]})]})]})})}var _=a(70115),K=a(38393),q=a(52082),J=a(21111),G=a(47606),Y=a(42431),H=a(29114),$=a(92666);function Q(e){var n,a;let{serverName:i}=e,[o,c]=(0,l.useState)(""),[d,h]=(0,l.useState)(null),[x,u]=(0,l.useState)(!1),[p,m]=(0,l.useState)(""),[j,E]=(0,l.useState)(null),[P,F]=(0,l.useState)(""),{data:I,isLoading:A,error:L}=(0,$.ox)(i),{data:N}=(0,$.Yo)(i),z=(0,$.zF)(),B=(0,$.Ll)(),R=(0,$.S0)(),T=null!==(n=null==I?void 0:I.players)&&void 0!==n?n:[],M=null==I?void 0:I.source,Q=null!==(a=null==N?void 0:N.enabled)&&void 0!==a&&a,V=(0,l.useMemo)(()=>{if(!P.trim())return T;let e=P.toLowerCase();return T.filter(n=>n.name.toLowerCase().includes(e))},[T,P]),X=(null==L?void 0:L.message)||(B.error?"Failed to add player to whitelist":null)||(R.error&&!d?"Failed to remove player from whitelist":null)||(z.error?"Failed to update whitelist status":null),ee=()=>{o.trim()&&B.mutate({serverName:i,player:o.trim()},{onSuccess:()=>c("")})},en=e=>{h(e),R.mutate({serverName:i,player:e},{onSettled:()=>h(null)})},ea=async()=>{let e=p.split(/[,\n]/).map(e=>e.trim()).filter(Boolean);if(0===e.length)return;E(null);let n=0;for(let a of e)try{await B.mutateAsync({serverName:i,player:a}),n++}catch(e){}E("Added ".concat(n," of ").concat(e.length," players")),n>0&&m("")},er=B.isPending;return(0,r.jsx)(y.Z,{"data-testid":"whitelist-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mb:2},children:[(0,r.jsxs)(_.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Whitelist"}),(0,r.jsx)(S.Z,{label:Q?"ON":"OFF",color:Q?"success":"default",size:"small","data-testid":"whitelist-status-chip"})]}),(0,r.jsx)(K.Z,{checked:Q,onChange:()=>{z.mutate({serverName:i,enabled:!Q})},disabled:z.isPending,inputProps:{"aria-label":"Toggle whitelist"},"data-testid":"whitelist-toggle"})]}),X&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:X}),!A&&M&&"rcon"!==M&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===M?"config.env":"whitelist.json",". Changes will apply on next server start."]}),(0,r.jsxs)(_.Z,{direction:"row",spacing:1,alignItems:"flex-start",sx:{mb:2},children:[x?(0,r.jsxs)(t.Z,{sx:{flex:1},children:[(0,r.jsx)(O.Z,{size:"small",placeholder:"player1, player2, player3",value:p,onChange:e=>m(e.target.value),disabled:er,fullWidth:!0,multiline:!0,rows:3,"data-testid":"bulk-input"}),j&&(0,r.jsx)(D.Z,{severity:"info",sx:{mt:1},"data-testid":"bulk-result",children:j})]}):(0,r.jsx)(O.Z,{size:"small",placeholder:"Player name",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ee()},disabled:er,fullWidth:!0}),x?(0,r.jsx)(k.Z,{variant:"contained",onClick:ea,disabled:!p.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(H.Z,{}),"aria-label":"Add players in bulk",children:"Add All"}):(0,r.jsx)(k.Z,{variant:"contained",onClick:ee,disabled:!o.trim()||er,startIcon:er?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(G.Z,{}),"aria-label":"Add player to whitelist",children:"Add"}),(0,r.jsx)(k.Z,{variant:x?"contained":"outlined",onClick:()=>{u(!x),E(null)},"aria-label":"Toggle bulk mode","data-testid":"bulk-toggle",sx:{whiteSpace:"nowrap"},children:"Bulk"})]}),T.length>=5&&(0,r.jsx)(O.Z,{size:"small",placeholder:"Search players...",value:P,onChange:e=>F(e.target.value),fullWidth:!0,sx:{mb:2},InputProps:{startAdornment:(0,r.jsx)(q.Z,{position:"start",children:(0,r.jsx)(Y.Z,{})})},"data-testid":"search-input"}),A&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!A&&0===T.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players whitelisted"}),!A&&T.length>0&&0===V.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},"data-testid":"no-match-message",children:"No matching players"}),!A&&V.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:V.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Remove from whitelist",onClick:()=>en(e.name),disabled:d===e.name,color:"error",children:d===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.jsx)(C.Z,{src:e.uuid?"https://mc-heads.net/avatar/".concat(e.uuid,"/40"):void 0,alt:e.name,children:(0,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))})]})})}var V=a(35694),X=a(37809),ee=a(407),en=a(45813);let ea={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 er(e){let{level:n,showIcon:a=!1,compact:l=!1,size:s="medium",variant:i="filled"}=e,o=ea[n];if(!o)return null;let c=l?n.toString():"Level ".concat(n," - ").concat(o.label),d=a?(0,r.jsx)(t.Z,{component:"span",sx:{mr:.5},children:o.icon}):void 0;return(0,r.jsx)(S.Z,{label:(0,r.jsxs)(r.Fragment,{children:[d,c]}),color:o.color,size:s,variant:i})}var el=a(68038),et=a(34080),es=a(40064),ei=a(39181);let eo=[{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 ec(e){let{value:n,onChange:a,label:l,disabled:i=!1}=e;return(0,r.jsxs)(d.Z,{component:"fieldset",fullWidth:!0,disabled:i,children:[l&&(0,r.jsx)(el.Z,{component:"legend",sx:{mb:1},children:l}),(0,r.jsx)(et.Z,{value:n,onChange:e=>{a(parseInt(e.target.value,10))},children:eo.map(e=>(0,r.jsx)(es.Z,{value:e.value,control:(0,r.jsx)(ei.Z,{}),label:(0,r.jsxs)(t.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(s.Z,{component:"span",children:e.icon}),(0,r.jsx)(s.Z,{component:"span",fontWeight:"medium",children:e.label})]}),(0,r.jsx)(s.Z,{variant:"body2",color:"text.secondary",sx:{ml:4},children:e.description})]}),sx:{alignItems:"flex-start",py:1}},e.value))})]})}function ed(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,p]=(0,l.useState)(),[m,j]=(0,l.useState)(""),[S,I]=(0,l.useState)(!1),[L,N]=(0,l.useState)(null),[z,B]=(0,l.useState)(!1),[R,T]=(0,l.useState)(4),[U,M]=(0,l.useState)(!1),[_,K]=(0,l.useState)(null),[q,Y]=(0,l.useState)(4),[H,$]=(0,l.useState)(!1),[Q,ea]=(0,l.useState)(null),[el,et]=(0,l.useState)(null),es=(0,l.useCallback)(async()=>{i(!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 a=await e.json();h(a.operators),p(a.source)}catch(e){c("Failed to load operators"),console.error("Error fetching operators:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{es()},[es]);let ei=async()=>{if(m.trim()){I(!0),c(null);try{if(!(await fetch("/api/players/op",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:m.trim(),server:n,level:R})})).ok)throw Error("Failed to add operator");j(""),T(4),B(!1),await es()}catch(e){c("Failed to add operator"),console.error("Error adding operator:",e)}finally{I(!1)}}},eo=async e=>{N(e),c(null),ea(null),et(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 es()}catch(e){c("Failed to remove operator"),console.error("Error removing operator:",e)}finally{N(null)}},ed=async()=>{if(_){$(!0),c(null);try{if(!(await fetch("/api/players/op/".concat(encodeURIComponent(_.name),"?server=").concat(encodeURIComponent(n)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({level:q})})).ok)throw Error("Failed to change operator level");M(!1),K(null),await es()}catch(e){c("Failed to change operator level"),console.error("Error changing operator level:",e)}finally{$(!1)}}},eh=(e,n)=>{ea(e.currentTarget),et(n)},ex=()=>{ea(null),et(null)};return(0,r.jsxs)(y.Z,{"data-testid":"op-manager",children:[(0,r.jsxs)(Z.Z,{children:[(0,r.jsx)(s.Z,{variant:"h6",gutterBottom:!0,children:"Operators"}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"ops.json",". Changes will apply on next server start."]}),(0,r.jsx)(t.Z,{sx:{mb:2},children:(0,r.jsx)(k.Z,{variant:"contained",onClick:()=>B(!0),startIcon:(0,r.jsx)(G.Z,{}),"aria-label":"Add operator",fullWidth:!0,children:"Add Operator"})}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No operators configured"}),!a&&d.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Operator actions",onClick:n=>eh(n,e),disabled:L===e.name,children:L===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(X.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.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,r.jsx)(ee.Z,{})})}),(0,r.jsx)(g.Z,{primary:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[(0,r.jsx)(s.Z,{component:"span",children:e.name}),(0,r.jsx)(er,{level:e.level,showIcon:!0,size:"small"})]}),secondary:e.uuid?e.uuid.substring(0,8)+"...":"UUID not available"})]},e.uuid||e.name))}),(0,r.jsxs)(V.Z,{anchorEl:Q,open:!!Q,onClose:ex,children:[(0,r.jsxs)(u.Z,{onClick:()=>{el&&(K(el),Y(el.level),M(!0),ex())},children:[(0,r.jsx)(en.Z,{sx:{mr:1},fontSize:"small"}),"Change Level"]}),(0,r.jsxs)(u.Z,{onClick:()=>el&&eo(el.name),children:[(0,r.jsx)(J.Z,{sx:{mr:1},fontSize:"small",color:"error"}),"Remove OP"]})]})]})]}),(0,r.jsxs)(E.Z,{open:z,onClose:()=>!S&&B(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Add Operator"}),(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(O.Z,{autoFocus:!0,margin:"dense",label:"Player Name",placeholder:"Enter player name",fullWidth:!0,value:m,onChange:e=>j(e.target.value),disabled:S,sx:{mb:2}}),(0,r.jsx)(ec,{value:R,onChange:T,label:"OP Level",disabled:S})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>B(!1),disabled:S,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ei,disabled:!m.trim()||S,startIcon:S?(0,r.jsx)(W.Z,{size:16}):void 0,children:S?"Adding...":"Add OP"})]})]}),(0,r.jsxs)(E.Z,{open:U,onClose:()=>!H&&M(!1),maxWidth:"sm",fullWidth:!0,children:[(0,r.jsxs)(P.Z,{children:["Change OP Level - ",null==_?void 0:_.name]}),(0,r.jsx)(F.Z,{children:_&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["Current: Level ",_.level," (",_.role,")"]}),(0,r.jsx)(ec,{value:q,onChange:Y,label:"New Level",disabled:H})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:()=>M(!1),disabled:H,children:"Cancel"}),(0,r.jsx)(k.Z,{variant:"contained",onClick:ed,disabled:H||q===(null==_?void 0:_.level),startIcon:H?(0,r.jsx)(W.Z,{size:16}):void 0,children:H?"Saving...":"Save Changes"})]})]})]})}var eh=a(397);function ex(e){let{serverName:n}=e,[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(null),[d,h]=(0,l.useState)([]),[x,u]=(0,l.useState)(),[p,m]=(0,l.useState)(!1),[j,S]=(0,l.useState)({player:"",reason:""}),[I,L]=(0,l.useState)(!1),[N,z]=(0,l.useState)(null),B=(0,l.useCallback)(async()=>{i(!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 a=await e.json();h(a.players),u(a.source)}catch(e){c("Failed to load ban list"),console.error("Error fetching bans:",e)}finally{i(!1)}},[n]);(0,l.useEffect)(()=>{B()},[B]);let R=()=>{m(!1),S({player:"",reason:""})},T=async()=>{if(j.player.trim()){L(!0),c(null);try{if(!(await fetch("/api/players/ban",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({player:j.player.trim(),reason:j.reason.trim()||"Banned by administrator",server:n})})).ok)throw Error("Failed to ban player");R(),await B()}catch(e){c("Failed to ban player"),console.error("Error banning player:",e)}finally{L(!1)}}},M=async e=>{z(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 B()}catch(e){c("Failed to unban player"),console.error("Error unbanning player:",e)}finally{z(null)}},K=e=>{try{return new Date(e).toLocaleDateString()}catch(n){return e}};return(0,r.jsx)(y.Z,{"data-testid":"ban-manager",children:(0,r.jsxs)(Z.Z,{children:[(0,r.jsxs)(t.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(s.Z,{variant:"h6",children:"Ban List"}),(0,r.jsx)(k.Z,{variant:"outlined",color:"error",startIcon:(0,r.jsx)(eh.Z,{}),onClick:()=>{S({player:"",reason:""}),m(!0)},"aria-label":"Ban player",children:"Ban Player"})]}),o&&(0,r.jsx)(D.Z,{severity:"error",sx:{mb:2},children:o}),!a&&x&&"rcon"!==x&&(0,r.jsxs)(D.Z,{severity:"info",sx:{mb:2},children:["Server is offline. Showing data from ","config"===x?"config.env":"banned-players.json",". Changes will apply on next server start."]}),a&&(0,r.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,r.jsx)(W.Z,{})}),!a&&0===d.length&&(0,r.jsx)(s.Z,{color:"text.secondary",sx:{textAlign:"center",py:4},children:"No players banned"}),!a&&d.length>0&&(0,r.jsx)(v.Z,{dense:!0,children:d.map(e=>(0,r.jsxs)(b.ZP,{secondaryAction:(0,r.jsx)(w.Z,{edge:"end","aria-label":"Unban player",onClick:()=>M(e.name),disabled:N===e.name,color:"success",children:N===e.name?(0,r.jsx)(W.Z,{size:20}):(0,r.jsx)(J.Z,{})}),children:[(0,r.jsx)(f.Z,{children:(0,r.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,r.jsx)(U.Z,{})})}),(0,r.jsx)(g.Z,{primary:e.name,secondary:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{component:"span",variant:"body2",color:"text.secondary",children:["Reason: ",e.reason||"No reason specified"]}),(0,r.jsx)("br",{}),(0,r.jsxs)(s.Z,{component:"span",variant:"caption",color:"text.secondary",children:["Banned: ",K(e.created)," by ",e.source||"Unknown"]})]})})]},e.uuid||e.name))}),(0,r.jsxs)(E.Z,{open:p,onClose:R,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(P.Z,{children:"Ban Player"}),(0,r.jsx)(F.Z,{children:(0,r.jsxs)(_.Z,{spacing:2,sx:{mt:1},children:[(0,r.jsx)(O.Z,{label:"Player Name",placeholder:"Enter player name",value:j.player,onChange:e=>S({...j,player:e.target.value}),fullWidth:!0,required:!0}),(0,r.jsx)(O.Z,{label:"Reason",placeholder:"Banned by administrator",value:j.reason,onChange:e=>S({...j,reason:e.target.value}),fullWidth:!0,multiline:!0,rows:2})]})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(k.Z,{onClick:R,disabled:I,children:"Cancel"}),(0,r.jsx)(k.Z,{onClick:T,color:"error",variant:"contained",disabled:!j.player.trim()||I,startIcon:I?(0,r.jsx)(W.Z,{size:16}):(0,r.jsx)(eh.Z,{}),children:"Ban"})]})]})]})})}function eu(e){let{children:n,value:a,index:l}=e;return(0,r.jsx)("div",{role:"tabpanel",hidden:a!==l,children:a===l&&(0,r.jsx)(t.Z,{sx:{py:3},children:n})})}function ep(){let[e,n]=(0,l.useState)(0),[a,y]=(0,l.useState)(""),{data:Z,isLoading:v}=(0,$.x$)(),b=null==Z?void 0:Z.servers;return(0,l.useEffect)(()=>{!a&&b&&b.length>0&&y(b[0].name)},[b,a]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Z,{elevation:0,sx:{mb:4,p:3,background:e=>"linear-gradient(135deg, ".concat((0,m.Fq)(e.palette.info.main,.1)," 0%, ").concat((0,m.Fq)(e.palette.secondary.main,.1)," 100%)"),borderRadius:2,border:e=>"1px solid ".concat((0,m.Fq)(e.palette.info.main,.2))},children:(0,r.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(t.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"info.main",color:"info.contrastText"},children:(0,r.jsx)(j.Z,{sx:{fontSize:32}})}),(0,r.jsxs)(t.Z,{children:[(0,r.jsx)(s.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Player Management"}),(0,r.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:"Manage players, whitelist, operators, and bans across your servers"})]})]})}),(0,r.jsx)(t.Z,{sx:{mb:3},children:(0,r.jsxs)(d.Z,{sx:{minWidth:200},children:[(0,r.jsx)(h.Z,{id:"server-select-label",children:"Server"}),(0,r.jsx)(x.Z,{labelId:"server-select-label",value:a,label:"Server",onChange:e=>y(e.target.value),disabled:v,children:null==b?void 0:b.map(e=>(0,r.jsx)(u.Z,{value:e.name,children:e.name},e.name))})]})}),(0,r.jsx)(t.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)(o.Z,{value:e,onChange:(e,a)=>{n(a)},"aria-label":"Player management tabs",children:[(0,r.jsx)(c.Z,{label:"Online Players"}),(0,r.jsx)(c.Z,{label:"Whitelist",disabled:!a}),(0,r.jsx)(c.Z,{label:"Operators",disabled:!a}),(0,r.jsx)(c.Z,{label:"Ban List",disabled:!a})]})}),(0,r.jsx)(eu,{value:e,index:0,children:(0,r.jsx)(M,{})}),(0,r.jsx)(eu,{value:e,index:1,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(Q,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Whitelist"}),(0,r.jsx)(s.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,r.jsx)(eu,{value:e,index:2,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ed,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Operators"}),(0,r.jsx)(s.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,r.jsxs)(t.Z,{sx:{mt:2},children:[(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 1: Can bypass spawn protection"}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 2: Can use /clear, /gamemode, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 3: Can use /ban, /kick, /op, etc."}),(0,r.jsx)(s.Z,{variant:"caption",color:"text.secondary",component:"div",children:"Level 4: Can use /stop, full access"})]})]})})]})}),(0,r.jsx)(eu,{value:e,index:3,children:a&&(0,r.jsxs)(i.ZP,{container:!0,spacing:3,children:[(0,r.jsx)(i.ZP,{item:!0,xs:12,md:8,children:(0,r.jsx)(ex,{serverName:a})}),(0,r.jsx)(i.ZP,{item:!0,xs:12,md:4,children:(0,r.jsxs)(t.Z,{sx:{p:2,bgcolor:"background.paper",borderRadius:1},children:[(0,r.jsx)(s.Z,{variant:"subtitle2",color:"text.secondary",gutterBottom:!0,children:"About Bans"}),(0,r.jsx)(s.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."})]})})]})})]})}}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,880,7727,8347,1658,5381,4474,7305,3468,2666,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(t,e,i){Promise.resolve().then(i.bind(i,34488))},24559:function(t,e,i){"use strict";var s=i(8091);e.Z=void 0;var r=s(i(66758)),n=i(94655);e.Z=(0,r.default)((0,n.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check")},10449:function(t,e,i){"use strict";var s=i(8091);e.Z=void 0;var r=s(i(66758)),n=i(94655);e.Z=(0,r.default)((0,n.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy")},59602:function(t,e,i){"use strict";var s=i(8091);e.Z=void 0;var r=s(i(66758)),n=i(94655);e.Z=(0,r.default)((0,n.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},70603:function(t,e,i){"use strict";var s=i(8091);e.Z=void 0;var r=s(i(66758)),n=i(94655);e.Z=(0,r.default)((0,n.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")},5501:function(t,e,i){"use strict";var s=i(8091);e.Z=void 0;var r=s(i(66758)),n=i(94655);e.Z=(0,r.default)((0,n.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow")},28058:function(t,e,i){"use strict";var s=i(8091);e.Z=void 0;var r=s(i(66758)),n=i(94655);e.Z=(0,r.default)((0,n.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility")},34488:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return f}});var s=i(94655),r=i(7281),n=i(84840),a=i(31317),c=i(10721),d=i(81071),x=i(628),l=i(41565),o=i(69899),h=i(76492),u=i(29983),j=i(92666),Z=i(57965);function v(t){let{rows:e}=t;return(0,s.jsx)(x.Z,{children:(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,s.jsx)(c.Z,{variant:"circular",width:24,height:24}),(0,s.jsx)(c.Z,{variant:"text",width:"50%",height:32})]}),[...Array(e)].map((t,e)=>(0,s.jsxs)(r.Z,{sx:{display:"flex",justifyContent:"space-between",py:.75},children:[(0,s.jsx)(c.Z,{variant:"text",width:"35%"}),(0,s.jsx)(c.Z,{variant:"text",width:"40%"})]},e))]})})}function m(){return(0,s.jsx)(x.Z,{sx:{height:"100%"},children:(0,s.jsxs)(l.Z,{children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[(0,s.jsx)(c.Z,{variant:"circular",width:24,height:24}),(0,s.jsx)(c.Z,{variant:"text",width:"40%",height:32}),(0,s.jsxs)(r.Z,{sx:{ml:"auto",display:"flex",gap:1},children:[(0,s.jsx)(c.Z,{variant:"rounded",width:70,height:24}),(0,s.jsx)(c.Z,{variant:"rounded",width:70,height:24})]})]}),(0,s.jsx)(c.Z,{variant:"text",width:"30%",sx:{mt:3,mb:1}}),[0,1].map(t=>(0,s.jsxs)(r.Z,{sx:{border:1,borderColor:"divider",p:2,"&:not(:last-child)":{borderBottom:0}},children:[(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,s.jsx)(c.Z,{variant:"circular",width:10,height:10}),(0,s.jsx)(c.Z,{variant:"text",width:"25%"}),(0,s.jsx)(c.Z,{variant:"text",width:"15%"}),(0,s.jsx)(c.Z,{variant:"text",width:"10%",sx:{ml:"auto"}})]}),[0,1,2].map(t=>(0,s.jsx)(c.Z,{variant:"text",width:"70%",sx:{ml:2.5}},t))]},t))]})})}function f(){let{data:t,isLoading:e,error:i}=(0,j.nv)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Z,{elevation:0,sx:{mb:4,p:3,background:t=>"linear-gradient(135deg, ".concat((0,h.Fq)(t.palette.warning.main,.1)," 0%, ").concat((0,h.Fq)(t.palette.info.main,.1)," 100%)"),borderRadius:2,border:t=>"1px solid ".concat((0,h.Fq)(t.palette.warning.main,.2))},children:(0,s.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,s.jsx)(r.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:2,bgcolor:"warning.main",color:"warning.contrastText"},children:(0,s.jsx)(u.Z,{sx:{fontSize:32}})}),(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(a.Z,{variant:"h4",component:"h1",fontWeight:"bold",children:"Routing"}),(0,s.jsx)(a.Z,{variant:"body1",color:"text.secondary",children:"Server routing and network configuration"})]})]})}),i&&(0,s.jsxs)(d.Z,{severity:"error",sx:{mb:3},children:["Failed to load router status: ",i.message]}),e?(0,s.jsxs)(n.ZP,{container:!0,spacing:3,children:[(0,s.jsx)(n.ZP,{item:!0,xs:12,md:4,children:(0,s.jsxs)(r.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,s.jsx)(v,{rows:4}),(0,s.jsx)(v,{rows:4}),(0,s.jsx)(v,{rows:1})]})}),(0,s.jsx)(n.ZP,{item:!0,xs:12,md:8,children:(0,s.jsx)(m,{})})]}):(null==t?void 0:t.router)?(0,s.jsxs)(n.ZP,{container:!0,spacing:3,children:[(0,s.jsx)(n.ZP,{item:!0,xs:12,md:4,children:(0,s.jsxs)(r.Z,{sx:{display:"flex",flexDirection:"column",gap:3},children:[(0,s.jsx)(Z.hI,{router:t.router}),(0,s.jsx)(Z.SB,{router:t.router}),(0,s.jsx)(Z.E4,{avahi:t.avahi}),(0,s.jsx)(Z.aY,{})]})}),(0,s.jsx)(n.ZP,{item:!0,xs:12,md:8,children:(0,s.jsx)(Z.Ik,{router:t.router})})]}):null]})}}},function(t){t.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,5511,2542,2844,9951,5381,2666,7965,3669,2757,1744],function(){return t(t.s=61943)}),_N_E=t.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[278],{59616:function(e,r,s){Promise.resolve().then(s.bind(s,50924))},50924:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return eX}});var t=s(94655),n=s(35106),i=s(74228),a=s(31358),o=s(7281),l=s(30417),d=s(79983),c=s(81071),x=s(93017),u=s(10721),h=s(628),m=s(41565),p=s(31317),v=s(35694),j=s(7178),g=s(17820),Z=s(73424),y=s(99770),f=s(62508),b=s(5682),C=s(76678),w=s(97436),S=s(84840),k=s(76492),R=s(10117),z=s(5501),I=s(37809),P=s(21111),W=s(17978),F=s(89573),T=s(96292),D=s(33104),A=s(25333),M=s(52082),O=s(69123),B=s(71185),E=s(30165),N=s(97293),U=s(11259),q=s(66615),L=s(89161),H=s(34071),K=s(4405);function G(e){let{value:r,unit:s,label:n,icon:i,progress:a,progressMax:l,color:d="#1bd96a"}=e;return(0,t.jsxs)(h.Z,{"data-testid":"resource-stat-card",sx:{p:2.5,bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"baseline",gap:.75,flexWrap:"wrap",minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"h4",component:"span",sx:{fontWeight:700,color:"text.primary",fontFamily:"'JetBrains Mono', 'Fira Code', monospace",letterSpacing:"-0.5px"},children:r}),(0,t.jsx)(p.Z,{variant:"body2",component:"span",sx:{color:"text.secondary",fontWeight:500},children:s})]}),(0,t.jsx)(o.Z,{sx:{color:"text.secondary",flexShrink:0},children:i})]}),(0,t.jsx)(p.Z,{variant:"body2",sx:{color:"text.secondary",fontWeight:500,mt:.5},children:n}),(0,t.jsx)(K.Z,{variant:"determinate",value:Math.min(a/l*100,100),sx:{mt:1,height:6,borderRadius:1.5,bgcolor:"#2a2d3a","& .MuiLinearProgress-bar":{borderRadius:1.5,background:"linear-gradient(90deg, ".concat(d," 0%, ").concat(d,"cc 100%)")}}})]})}var V=s(163),_=s(73660),J=s(90158),Q=s(58347),$=s(95511),Y=s(46725),X=s(26577),ee=s(56813),er=s(26892),es=s(84509);function et(e){var r;let{serverName:s}=e,{data:n,isLoading:i,error:a}=(0,es.HZ)(s,{limit:20});if(i)return(0,t.jsx)(o.Z,{children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:2,py:1.5},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:60,height:24}),(0,t.jsx)(u.Z,{variant:"text",width:"60%"}),(0,t.jsx)(u.Z,{variant:"text",width:50})]},r))});if(a)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load activity: ",a.message]});let d=null!==(r=null==n?void 0:n.logs)&&void 0!==r?r:[];if(0===d.length)return(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{py:4,textAlign:"center"},children:"No activity recorded for this server yet."});let x="/audit-logs?targetType=server&targetName=".concat(encodeURIComponent(s));return(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(J.Z,{sx:{py:0},children:d.map(e=>{var r;return(0,t.jsx)(Q.ZP,{sx:{px:0,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:(0,t.jsx)(Z.Z,{primary:(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ee.I,{action:e.action,size:"small"}),(0,t.jsxs)(p.Z,{variant:"body2",color:"text.secondary",children:["by ",e.actor.replace("api:","").replace("cli:","")]}),(0,t.jsx)(er.c,{status:e.status,size:"small"})]}),secondary:(0,t.jsx)($.Z,{title:(r=e.timestamp,new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"}).format(new Date(r))),arrow:!0,children:(0,t.jsx)(p.Z,{variant:"caption",component:"span",color:"text.disabled",children:function(e){let r=new Date,s=new Date(e),t=Math.floor((r.getTime()-s.getTime())/6e4),n=Math.floor(t/60);return t<1?"just now":t<60?"".concat(t,"m ago"):n<24?"".concat(n,"h ago"):"".concat(Math.floor(n/24),"d ago")}(e.timestamp)})})})},e.id)})}),(0,t.jsx)(o.Z,{sx:{mt:2,textAlign:"center"},children:(0,t.jsx)(l.Z,{component:Y.default,href:x,size:"small",endIcon:(0,t.jsx)(X.Z,{}),sx:{textTransform:"none"},children:"View Full History"})})]})}var en=s(62328),ei=s(29793),ea=s(75726),eo=s(40064),el=s(38393),ed=s(37530),ec=s(5942),ex=s(84420),eu=s(46121),eh=s(84775),em=s(92666),ep=s(70115),ev=s(70603),ej=s(32366),eg=s(25523);function eZ(e){let{serverName:r}=e,{data:s,isLoading:i}=(0,em.Js)(r),a=(0,em.Bx)(),[u,v]=(0,n.useState)([]),[j,g]=(0,n.useState)(!1),[Z,y]=(0,n.useState)(!1),[f,b]=(0,n.useState)(""),[C,S]=(0,n.useState)(""),[k,R]=(0,n.useState)(!1),[z,I]=(0,n.useState)({open:!1,message:"",severity:"success"});(0,n.useEffect)(()=>{(null==s?void 0:s.customHostnames)&&(v(s.customHostnames),g(!1),R(!1))},[s]);let W=e=>{let r=e.trim().toLowerCase();return r?r.length>253?"Domain exceeds 253 characters":/^[a-z0-9]([a-z0-9\-.]*[a-z0-9])?$/.test(r)?r.endsWith(".local")?"Cannot use .local system domain":r.endsWith(".nip.io")?"Cannot use .nip.io system domain":u.includes(r)?"Domain already exists":"":"Invalid domain format":"Domain cannot be empty"},F=()=>{let e=f.trim().toLowerCase(),r=W(e);if(r){S(r);return}v(r=>[...r,e]),b(""),S(""),y(!1),g(!0)},T=e=>{v(r=>r.filter(r=>r!==e)),g(!0)},D=async()=>{try{await a.mutateAsync({serverName:r,customHostnames:u}),g(!1),R(!0),I({open:!0,message:"Hostnames saved. Container recreation required to apply changes.",severity:"warning"})}catch(e){I({open:!0,message:e instanceof Error?e.message:"Failed to save hostnames",severity:"error"})}},M=()=>{y(!1),b(""),S("")};return i?(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsx)(m.Z,{children:(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,t.jsx)(x.Z,{size:24})})})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,t.jsx)(eg.Z,{color:"primary"}),(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Hostnames / Domains"})]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Manage hostnames used by mc-router to route connections to this server."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(null==s?void 0:s.systemHostnames)&&s.systemHostnames.length>0&&(0,t.jsxs)(o.Z,{sx:{mb:3},children:[(0,t.jsx)(p.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"System Hostnames (read-only)"}),(0,t.jsx)(ep.Z,{direction:"row",flexWrap:"wrap",gap:1,children:s.systemHostnames.map(e=>(0,t.jsx)(A.Z,{icon:(0,t.jsx)(ev.Z,{sx:{fontSize:16}}),label:e.hostname,title:e.description,variant:"outlined",color:"default",size:"small"},e.hostname))})]}),(0,t.jsxs)(o.Z,{sx:{mb:2},children:[(0,t.jsx)(p.Z,{variant:"subtitle2",color:"text.secondary",sx:{mb:1},children:"Custom Domains"}),0===u.length&&!Z&&(0,t.jsx)(p.Z,{variant:"body2",color:"text.disabled",sx:{mb:1},children:"No custom domains configured."}),(0,t.jsx)(ep.Z,{spacing:1,children:u.map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",py:.5,px:1.5,borderRadius:1,bgcolor:"action.hover"},children:[(0,t.jsx)(p.Z,{variant:"body2",fontFamily:"monospace",children:e}),(0,t.jsx)(d.Z,{size:"small",color:"error",onClick:()=>T(e),title:"Remove domain",children:(0,t.jsx)(P.Z,{fontSize:"small"})})]},e))}),Z?(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"flex-start",gap:1,mt:1},children:[(0,t.jsx)(w.Z,{size:"small",placeholder:"e.g. play.example.com",value:f,onChange:e=>{b(e.target.value),S("")},onKeyDown:e=>{"Enter"===e.key&&F(),"Escape"===e.key&&M()},error:!!C,helperText:C,autoFocus:!0,sx:{flex:1}}),(0,t.jsx)(l.Z,{size:"small",variant:"contained",onClick:F,children:"Add"}),(0,t.jsx)(d.Z,{size:"small",onClick:M,children:(0,t.jsx)(B.Z,{fontSize:"small"})})]}):(0,t.jsx)(l.Z,{size:"small",startIcon:(0,t.jsx)(ej.Z,{}),onClick:()=>y(!0),sx:{mt:1},children:"Add Domain"})]}),k&&(0,t.jsxs)(c.Z,{severity:"warning",sx:{mb:2},children:["Container recreation is required for hostname changes to take effect. Run ",(0,t.jsx)("code",{children:"docker compose up -d"})," or restart the server from the dashboard."]}),(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,t.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(ec.Z,{}),onClick:D,disabled:!j||a.isPending,children:a.isPending?"Saving...":"Save Hostnames"})})]})}),(0,t.jsx)(ed.Z,{open:z.open,autoHideDuration:6e3,onClose:()=>I({...z,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>I({...z,open:!1}),severity:z.severity,sx:{width:"100%"},children:z.message})})]})}function ey(e){var r,s;let{serverName:i,isRunning:a}=e,{data:d,isLoading:u}=(0,em.iC)(i),v=(0,em.MH)(),g=(0,em.gx)(),[Z,k]=(0,n.useState)({}),[R,z]=(0,n.useState)(!1),[I,P]=(0,n.useState)(!1),[W,F]=(0,n.useState)(!1),[T,D]=(0,n.useState)(""),[A,M]=(0,n.useState)({open:!1,message:"",severity:"info"});(0,n.useEffect)(()=>{(null==d?void 0:d.config)&&k(d.config)},[d]);let B=(e,r)=>{k(s=>({...s,[e]:r})),z(!0),("memory"===e||"useAikarFlags"===e)&&P(!0)},E=async()=>{try{let e=await v.mutateAsync({serverName:i,config:Z});M({open:!0,message:e.restartRequired?"Settings saved. Restart required for some changes to take effect.":"Settings saved successfully.",severity:e.restartRequired?"warning":"success"}),z(!1),P(!1)}catch(e){M({open:!0,message:e instanceof Error?e.message:"Failed to save settings",severity:"error"})}},N=async()=>{if("RESET"!==T){M({open:!0,message:"Please type RESET to confirm",severity:"warning"});return}try{await g.mutateAsync(i),M({open:!0,message:"World reset successfully",severity:"success"}),F(!1),D("")}catch(e){M({open:!0,message:e instanceof Error?e.message:"Failed to reset world",severity:"error"})}};return u?(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,t.jsx)(x.Z,{})}):(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(eZ,{serverName:i}),I&&(0,t.jsx)(c.Z,{severity:"warning",icon:(0,t.jsx)(ex.Z,{}),sx:{mb:3},children:"Performance settings require a server restart to take effect."}),(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Properties"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings can be changed without restarting the server."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"MOTD (Message of the Day)",value:Z.motd||"",onChange:e=>B("motd",e.target.value),helperText:"The message displayed in the server list"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Max Players",value:Z.maxPlayers||20,onChange:e=>B("maxPlayers",parseInt(e.target.value,10)),inputProps:{min:1,max:100}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Difficulty"}),(0,t.jsxs)(en.Z,{value:Z.difficulty||"normal",label:"Difficulty",onChange:e=>B("difficulty",e.target.value),children:[(0,t.jsx)(j.Z,{value:"peaceful",children:"Peaceful"}),(0,t.jsx)(j.Z,{value:"easy",children:"Easy"}),(0,t.jsx)(j.Z,{value:"normal",children:"Normal"}),(0,t.jsx)(j.Z,{value:"hard",children:"Hard"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsxs)(ei.Z,{fullWidth:!0,children:[(0,t.jsx)(ea.Z,{children:"Game Mode"}),(0,t.jsxs)(en.Z,{value:Z.gameMode||"survival",label:"Game Mode",onChange:e=>B("gameMode",e.target.value),children:[(0,t.jsx)(j.Z,{value:"survival",children:"Survival"}),(0,t.jsx)(j.Z,{value:"creative",children:"Creative"}),(0,t.jsx)(j.Z,{value:"adventure",children:"Adventure"}),(0,t.jsx)(j.Z,{value:"spectator",children:"Spectator"})]})]})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(eo.Z,{control:(0,t.jsx)(el.Z,{checked:null===(r=Z.pvp)||void 0===r||r,onChange:e=>B("pvp",e.target.checked)}),label:"Enable PvP"})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"View Distance (chunks)",value:Z.viewDistance||10,onChange:e=>B("viewDistance",parseInt(e.target.value,10)),inputProps:{min:3,max:32}})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,type:"number",label:"Spawn Protection (blocks)",value:Z.spawnProtection||16,onChange:e=>B("spawnProtection",parseInt(e.target.value,10)),inputProps:{min:0,max:128}})})]})]})}),(0,t.jsx)(h.Z,{sx:{mb:3,borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Performance Settings"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"These settings require a server restart to take effect."}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(w.Z,{fullWidth:!0,label:"Memory Allocation",value:Z.memory||"4G",onChange:e=>B("memory",e.target.value),helperText:"Format: 4G, 8G, etc."})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,sm:6,children:(0,t.jsx)(eo.Z,{control:(0,t.jsx)(el.Z,{checked:null!==(s=Z.useAikarFlags)&&void 0!==s&&s,onChange:e=>B("useAikarFlags",e.target.checked)}),label:"Use Aikar's Flags (Optimized GC)"})})]})]})}),(0,t.jsx)(o.Z,{sx:{display:"flex",justifyContent:"flex-end",mb:3},children:(0,t.jsx)(l.Z,{variant:"contained",size:"large",startIcon:(0,t.jsx)(ec.Z,{}),onClick:E,disabled:!R||v.isPending,sx:{px:4},children:v.isPending?"Saving...":"Save Changes"})}),(0,t.jsx)(h.Z,{sx:{borderRadius:3,borderColor:"error.main",borderWidth:1,borderStyle:"solid"},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,color:"error",children:"Danger Zone"}),(0,t.jsx)(O.Z,{sx:{mb:3}}),(0,t.jsxs)(o.Z,{sx:{mb:3},children:[(0,t.jsx)(p.Z,{variant:"subtitle1",fontWeight:600,gutterBottom:!0,children:"Reset World"}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"This will permanently delete the current world and generate a new one. This action cannot be undone."}),(0,t.jsx)(l.Z,{variant:"outlined",color:"error",startIcon:(0,t.jsx)(eh.Z,{}),onClick:()=>F(!0),disabled:a,children:"Reset World"}),a&&(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",sx:{ml:2},children:"Stop the server first"})]})]})}),(0,t.jsxs)(y.Z,{open:W,onClose:()=>F(!1),maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(f.Z,{children:(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(ex.Z,{color:"error"}),(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Reset World"})]})}),(0,t.jsxs)(b.Z,{children:[(0,t.jsxs)(p.Z,{variant:"body1",gutterBottom:!0,children:["This will permanently delete the world for ",(0,t.jsx)("strong",{children:i})," and generate a new one."]}),(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:"This action cannot be undone. All player progress and builds will be lost."}),(0,t.jsx)(w.Z,{fullWidth:!0,label:"Type RESET to confirm",value:T,onChange:e=>D(e.target.value),sx:{mt:3},autoFocus:!0})]}),(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(l.Z,{onClick:()=>F(!1),children:"Cancel"}),(0,t.jsx)(l.Z,{variant:"contained",color:"error",onClick:N,disabled:"RESET"!==T||g.isPending,startIcon:g.isPending?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(eu.Z,{}),children:g.isPending?"Resetting...":"Reset World"})]})]}),(0,t.jsx)(ed.Z,{open:A.open,autoHideDuration:6e3,onClose:()=>M({...A,open:!1}),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,t.jsx)(c.Z,{onClose:()=>M({...A,open:!1}),severity:A.severity,sx:{width:"100%"},children:A.message})})]})}var ef=s(86702),eb=s(47606),eC=s(407),ew=s(56056),eS=s(28058),ek=s(11597),eR=s(59602);let ez={admin:{label:"Owner",color:"primary",variant:"filled"},manage:{label:"Operator",color:"info",variant:"outlined"},view:{label:"Viewer",color:"default",variant:"outlined"}};function eI(e){let{permission:r,size:s="medium"}=e,n=ez[r];return(0,t.jsx)(A.Z,{label:n.label,color:n.color,variant:n.variant,size:s})}var eP=s(99046),eW=s(68038),eF=s(34080),eT=s(39181),eD=s(5632),eA=s(58919),eM=s(20367),eO=s(42936);function eB(e){var r,s;let{open:i,onClose:a,serverId:d}=e,[u,h]=(0,n.useState)(""),[m,v]=(0,n.useState)(null),[j,g]=(0,n.useState)("view"),{data:Z,isLoading:S}=(s={enabled:i},(0,eD.a)({queryKey:["users","search",u],queryFn:()=>(0,eO.SC)("/api/users?q=".concat(encodeURIComponent(u))),enabled:(null==s?void 0:s.enabled)!==!1&&u.length>=2,staleTime:3e4})),k=function(){let e=(0,eA.NL)();return(0,eM.D)({mutationFn:e=>(0,eO.SC)("/api/user-servers",{method:"POST",body:JSON.stringify(e)}),onSuccess:(r,s)=>{e.invalidateQueries({queryKey:["user-servers",s.serverId]}),e.invalidateQueries({queryKey:["user-servers"]})}})}(),R=(0,n.useMemo)(()=>{var e;return null!==(e=null==Z?void 0:Z.users)&&void 0!==e?e:[]},[Z]),z=()=>{h(""),v(null),g("view"),k.reset(),a()};return(0,t.jsxs)(y.Z,{open:i,onClose:z,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:3}},children:[(0,t.jsx)(f.Z,{sx:{fontWeight:600},children:"Add User Access"}),(0,t.jsxs)(b.Z,{sx:{display:"flex",flexDirection:"column",gap:3,pt:"8px !important"},children:[k.isError&&(0,t.jsx)(c.Z,{severity:"error",sx:{mb:1},children:(null===(r=k.error)||void 0===r?void 0:r.message)||"Failed to grant access"}),(0,t.jsx)(eP.Z,{options:R,getOptionLabel:e=>e.name||e.email,isOptionEqualToValue:(e,r)=>e.id===r.id,value:m,onChange:(e,r)=>v(r),inputValue:u,onInputChange:(e,r)=>h(r),loading:S,filterOptions:e=>e,noOptionsText:u.length<2?"Type at least 2 characters":"No users found",renderInput:e=>(0,t.jsx)(w.Z,{...e,label:"Search User",placeholder:"Search by name or email...",InputProps:{...e.InputProps,endAdornment:(0,t.jsxs)(t.Fragment,{children:[S&&(0,t.jsx)(x.Z,{size:20}),e.InputProps.endAdornment]})}}),renderOption:(e,r)=>{var s,n,i;let{key:a,...l}=e;return(0,t.jsxs)(o.Z,{component:"li",...l,sx:{display:"flex",gap:1.5,py:1},children:[(0,t.jsx)(ef.Z,{src:null!==(i=r.image)&&void 0!==i?i:void 0,sx:{width:32,height:32,bgcolor:"primary.main",fontSize:14},children:((null===(s=r.name)||void 0===s?void 0:s[0])||(null===(n=r.email)||void 0===n?void 0:n[0])||"?").toUpperCase()}),(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:r.name||"Unknown"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:r.email})]})]},a)}}),(0,t.jsxs)(ei.Z,{children:[(0,t.jsx)(eW.Z,{sx:{fontWeight:500,mb:1},children:"Permission Level"}),(0,t.jsxs)(eF.Z,{value:j,onChange:e=>g(e.target.value),children:[(0,t.jsx)(eo.Z,{value:"view",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Viewer"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can view server status and logs"})]})}),(0,t.jsx)(eo.Z,{value:"manage",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Operator"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Can start, stop, and configure the server"})]})}),(0,t.jsx)(eo.Z,{value:"admin",control:(0,t.jsx)(eT.Z,{size:"small"}),label:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,children:"Owner"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",children:"Full control including managing other users"})]})})]})]})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:z,color:"inherit",children:"Cancel"}),(0,t.jsx)(l.Z,{onClick:()=>{m&&k.mutate({userId:m.id,serverId:d,permission:j},{onSuccess:z})},variant:"contained",disabled:!m||k.isPending,sx:{borderRadius:2},children:k.isPending?"Adding...":"Add User"})]})]})}function eE(e){var r,s;let{serverId:i}=e,{data:a,isLoading:x,error:y}=(0,eD.a)({queryKey:["user-servers",i],queryFn:()=>(0,eO.SC)("/api/user-servers?serverId=".concat(encodeURIComponent(i))),enabled:!!i}),f=function(){let e=(0,eA.NL)();return(0,eM.D)({mutationFn:e=>{let{id:r,permission:s}=e;return(0,eO.SC)("/api/user-servers/".concat(encodeURIComponent(r)),{method:"PATCH",body:JSON.stringify({permission:s})})},onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),b=function(){let e=(0,eA.NL)();return(0,eM.D)({mutationFn:e=>(0,eO.SC)("/api/user-servers/".concat(encodeURIComponent(e)),{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["user-servers"]})}})}(),[C,w]=(0,n.useState)(!1),[S,k]=(0,n.useState)(null),[R,z]=(0,n.useState)(null),P=(e,r)=>{k(e.currentTarget),z(r)},W=()=>{k(null),z(null)},F=e=>{if(!R||R.permission===e){W();return}f.mutate({id:R.id,permission:e},{onSettled:W})},T=null!==(r=null==a?void 0:a.users.filter(e=>"admin"===e.permission).length)&&void 0!==r?r:0,D=(null==R?void 0:R.permission)==="admin"&&T<=1;if(x)return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%",height:32}),(0,t.jsx)(u.Z,{variant:"rounded",width:120,height:36,sx:{borderRadius:2}})]}),(0,t.jsx)(O.Z,{sx:{mb:2}}),[0,1,2].map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,t.jsx)(u.Z,{variant:"circular",width:40,height:40}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%"}),(0,t.jsx)(u.Z,{variant:"text",width:"60%"})]}),(0,t.jsx)(u.Z,{variant:"rounded",width:80,height:28,sx:{borderRadius:10}}),(0,t.jsx)(u.Z,{variant:"circular",width:32,height:32})]},e))]})});if(y)return(0,t.jsxs)(c.Z,{severity:"error",children:["Failed to load access list: ",y.message]});let A=null!==(s=null==a?void 0:a.users)&&void 0!==s?s:[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,t.jsx)(p.Z,{variant:"h6",fontWeight:600,children:"Server Access"}),(0,t.jsx)(l.Z,{variant:"contained",size:"small",startIcon:(0,t.jsx)(eb.Z,{}),onClick:()=>w(!0),sx:{borderRadius:2},children:"Add User"})]}),(0,t.jsx)(O.Z,{sx:{mb:1}}),0===A.length?(0,t.jsx)(o.Z,{sx:{py:4,textAlign:"center"},children:(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"No users have been granted access to this server yet."})}):A.map(e=>{var r,s,n,i,a,l,c,x;return(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,py:1.5,"&:not(:last-child)":{borderBottom:"1px solid",borderColor:"divider"}},children:[(0,t.jsx)(ef.Z,{src:null!==(x=null===(r=e.user)||void 0===r?void 0:r.image)&&void 0!==x?x:void 0,sx:{width:40,height:40,bgcolor:"primary.main",fontSize:16},children:((null===(n=e.user)||void 0===n?void 0:null===(s=n.name)||void 0===s?void 0:s[0])||(null===(a=e.user)||void 0===a?void 0:null===(i=a.email)||void 0===i?void 0:i[0])||"?").toUpperCase()}),(0,t.jsxs)(o.Z,{sx:{flex:1,minWidth:0},children:[(0,t.jsx)(p.Z,{variant:"body2",fontWeight:500,noWrap:!0,children:(null===(l=e.user)||void 0===l?void 0:l.name)||"Unknown User"}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.secondary",noWrap:!0,children:(null===(c=e.user)||void 0===c?void 0:c.email)||e.userId})]}),(0,t.jsx)(eI,{permission:e.permission,size:"small"}),(0,t.jsx)(d.Z,{size:"small",onClick:r=>P(r,e),sx:{color:"text.secondary"},children:(0,t.jsx)(I.Z,{fontSize:"small"})})]},e.id)}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:2,pt:1},children:[(0,t.jsx)(eR.Z,{sx:{fontSize:16,color:"text.disabled"}}),(0,t.jsx)(p.Z,{variant:"caption",color:"text.disabled",children:"Only platform admins and server owners can manage access."})]})]})}),(0,t.jsxs)(v.Z,{anchorEl:S,open:!!S,onClose:W,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},disableScrollLock:!0,children:[(0,t.jsxs)(j.Z,{onClick:()=>F("admin"),disabled:(null==R?void 0:R.permission)==="admin",children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(eC.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Owner"})]}),(0,t.jsxs)(j.Z,{onClick:()=>F("manage"),disabled:(null==R?void 0:R.permission)==="manage"||D,children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(ew.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Operator"})]}),(0,t.jsxs)(j.Z,{onClick:()=>F("view"),disabled:(null==R?void 0:R.permission)==="view"||D,children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(eS.Z,{fontSize:"small"})}),(0,t.jsx)(Z.Z,{children:"Change to Viewer"})]}),(0,t.jsx)(O.Z,{}),(0,t.jsxs)(j.Z,{onClick:()=>{R&&b.mutate(R.id,{onSettled:W})},disabled:D,sx:{color:"error.main"},children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(ek.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Remove Access"})]})]}),(0,t.jsx)(eB,{open:C,onClose:()=>w(!1),serverId:i})]})}var eN=s(10449),eU=s(24559),eq=s(37228);function eL(e){let{text:r}=e,[s,i]=(0,n.useState)(!1),a=async()=>{try{await navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),2e3)}catch(e){console.error("Failed to copy:",e)}};return(0,t.jsx)(d.Z,{size:"small",onClick:a,sx:{ml:1,color:s?"success.main":"text.secondary","&:hover":{bgcolor:"action.hover"}},"aria-label":s?"Copied":"Copy to clipboard",children:s?(0,t.jsx)(eU.Z,{sx:{fontSize:16}}):(0,t.jsx)(eN.Z,{sx:{fontSize:16}})})}function eH(e){let{label:r,value:s,copyText:n}=e;return(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",py:1},children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:r}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,t.jsx)(p.Z,{variant:"body2",sx:{fontFamily:n?"monospace":"inherit",color:n?"text.primary":"text.secondary"},children:s}),n&&(0,t.jsx)(eL,{text:n})]})]})}function eK(e){let{serverName:r,hostname:s}=e,{data:n,isLoading:i}=(0,eq.UW)();if(i)return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]})]})});let a=s?"".concat(s,":25565"):"Not configured",l=(null==n?void 0:n.enabled)&&n.servers.length>0,d=null==n?void 0:n.servers.find(e=>e.serverName===r),c=(null==d?void 0:d.playitDomain)||"Not configured",x=!!(null==d?void 0:d.playitDomain);return(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Connection"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(eH,{label:"LAN Address",value:a,copyText:s?a:void 0}),l&&(0,t.jsx)(eH,{label:"External Address",value:c,copyText:x?c:void 0})]})})}let eG=["Overview","Activity","Content","Files","Backups","Access","Options"];function eV(e){return e.replace(/\x1b\[\?[\d;]*[a-zA-Z]/g,"").replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"").replace(/\x1b=/g,"").replace(/\[\?[\d;]*[a-zA-Z]/g,"").replace(/\[[0-9;]*[a-zA-Z]/g,"").replace(/\[m/g,"").replace(/>\.\.\.\.\r?/g,"").replace(/\r/g,"").trim()}function e_(e){var r,s,i,a,c;let{server:x,onSendCommand:u}=e,[v,j]=(0,n.useState)("Overview"),[g,Z]=(0,n.useState)(""),[f,C]=(0,n.useState)(!0),[R,z]=(0,n.useState)(!1),I=(0,n.useRef)(null),{logs:P,isConnected:W}=(0,V.Y)({serverName:x.name}),F=(0,n.useMemo)(()=>P.filter(e=>!e.includes("RCON Listener")&&!e.includes("RCON Client")&&!e.includes("RconClient")),[P]);(0,n.useEffect)(()=>{I.current&&f&&(I.current.scrollTop=I.current.scrollHeight)},[F,f]);let T=async()=>{g.trim()&&u&&(await u(g.trim()),Z(""))},D=null!==(a=null===(r=x.stats)||void 0===r?void 0:r.cpuPercent)&&void 0!==a?a:0;(null===(s=x.stats)||void 0===s?void 0:s.memoryUsage)&&x.stats.memoryUsage,function(e){if(!e)return;let r=e.match(/^(\d+)\s*(M|G)?$/i);if(r)parseInt(r[1],10),(r[2]||"M").toUpperCase()}(x.memory);let K=null!==(c=null===(i=x.stats)||void 0===i?void 0:i.memoryPercent)&&void 0!==c?c:0;return(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(o.Z,{sx:{display:"flex",gap:.5,mb:3},children:eG.map(e=>(0,t.jsx)(l.Z,{onClick:()=>j(e),sx:{px:2,py:1,borderRadius:5,fontSize:14,fontWeight:500,textTransform:"none",bgcolor:v===e?"primary.main":"transparent",color:v===e?"#0a0e14":"text.secondary","&:hover":{bgcolor:v===e?"primary.main":(0,k.Fq)("#1bd96a",.1)}},children:e},e))}),(0,t.jsxs)(o.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[(0,t.jsx)(G,{value:"".concat(D.toFixed(2),"%"),unit:"/ 100%",label:"CPU usage",icon:(0,t.jsx)(E.Z,{sx:{fontSize:28}}),progress:D,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:"".concat(K.toFixed(2),"%"),unit:"/ 100%",label:"Memory usage",icon:(0,t.jsx)(N.Z,{sx:{fontSize:28}}),progress:K,progressMax:100,color:"#1bd96a"}),(0,t.jsx)(G,{value:x.worldSize||"0 B",unit:"/ 10 GB",label:"World size",icon:(0,t.jsx)(U.Z,{sx:{fontSize:28}}),progress:function(e){if(!e)return 0;let r=e.match(/^([\d.]+)\s*(B|KB|MB|MiB|GB|GiB)?$/i);if(!r)return 0;let s=parseFloat(r[1]);switch((r[2]||"B").toUpperCase()){case"GB":case"GIB":return 1024*s;case"MB":case"MIB":return s;case"KB":return s/1024;default:return s/1048576}}(x.worldSize),progressMax:10240,color:"#1bd96a"})]}),(0,t.jsxs)(h.Z,{sx:{bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider",overflow:"hidden"},children:[(0,t.jsxs)(o.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(p.Z,{variant:"h6",sx:{fontWeight:700,color:"text.primary"},children:"Console"}),(0,t.jsx)(o.Z,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:W?"primary.main":"error.main",boxShadow:W?"0 0 8px rgba(27, 217, 106, 0.4)":"0 0 8px rgba(239, 68, 68, 0.4)"}})]}),(0,t.jsxs)(o.Z,{sx:{position:"relative"},children:[(0,t.jsx)(o.Z,{ref:I,onScroll:()=>{if(!I.current)return;let{scrollTop:e,scrollHeight:r,clientHeight:s}=I.current;C(r-e-s<30)},sx:{height:360,overflowY:"auto",px:2.5,py:2,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace",fontSize:13,lineHeight:1.85,color:"#b4b6c4",bgcolor:"#0a0a0a",scrollbarWidth:"thin",scrollbarColor:"#3a3d4e #0a0a0a","&::-webkit-scrollbar":{width:8},"&::-webkit-scrollbar-track":{bgcolor:"#0a0a0a"},"&::-webkit-scrollbar-thumb":{bgcolor:"#3a3d4e",borderRadius:4}},children:0===F.length?(0,t.jsx)(p.Z,{sx:{color:"text.secondary",textAlign:"center",py:8},children:"Waiting for logs..."}):F.map((e,r)=>{let s=function(e){let r=eV(e).match(/\[(\d{2}:\d{2}:\d{2})\]\s*\[([^/]+)\/(\w+)\]:\s*(.+)/);return r?{time:r[1],thread:r[2],level:r[3]||"INFO",msg:r[4]}:null}(e);return s?(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,t.jsxs)(o.Z,{component:"span",sx:{color:"#4a4d60"},children:["[",s.time,"]"]}),(0,t.jsxs)(o.Z,{component:"span",sx:{color:"#4a4d60"},children:["\xa0[",s.thread,"/",(0,t.jsx)(o.Z,{component:"span",sx:{color:"WARN"===s.level?"#e8a848":"#6b6e80"},children:s.level}),"]:\xa0"]}),(0,t.jsx)(o.Z,{component:"span",sx:{color:"WARN"===s.level?"#c4a45a":"#b4b6c4"},children:s.msg})]},r):(0,t.jsx)(o.Z,{sx:{color:"#b4b6c4"},children:eV(e)},r)})}),(0,t.jsx)(d.Z,{onClick:()=>z(!0),sx:{position:"absolute",top:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,t.jsx)(q.Z,{sx:{fontSize:18}})}),!f&&(0,t.jsx)(d.Z,{onClick:()=>{I.current&&I.current.scrollTo({top:I.current.scrollHeight,behavior:"smooth"})},sx:{position:"absolute",bottom:12,right:12,width:36,height:36,borderRadius:2,bgcolor:"#282a3a",border:"1px solid #3a3d4e",color:"#8b8da0","&:hover":{bgcolor:"#313440"}},children:(0,t.jsx)(L.Z,{sx:{fontSize:18}})})]}),(0,t.jsx)(o.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(w.Z,{fullWidth:!0,size:"small",placeholder:"Send a command",value:g,onChange:e=>Z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),T())},disabled:!W,InputProps:{startAdornment:(0,t.jsx)(M.Z,{position:"start",children:(0,t.jsx)(H.Z,{sx:{fontSize:16,color:"#999"}})}),sx:{bgcolor:"#13141c",borderRadius:2,fontFamily:"'JetBrains Mono', 'Fira Code', monospace",fontSize:14,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#2a2d3e"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#3a3d4e"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}}})})]}),"Overview"===v&&(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Information"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(eJ,{label:"Name",value:x.name}),(0,t.jsx)(eJ,{label:"Container",value:x.container}),(0,t.jsx)(eJ,{label:"Hostname",value:x.hostname}),(0,t.jsx)(eJ,{label:"Type",value:x.type}),(0,t.jsx)(eJ,{label:"Version",value:x.version}),(0,t.jsx)(eJ,{label:"Memory",value:x.memory}),(0,t.jsx)(eJ,{label:"Uptime",value:x.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(x.uptimeSeconds)})]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Players"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),x.players?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eJ,{label:"Online",value:"".concat(x.players.online," / ").concat(x.players.max)}),x.players.list&&x.players.list.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",sx:{mt:2,mb:1},children:"Online Players"}),(0,t.jsx)(o.Z,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:x.players.list.map(e=>(0,t.jsx)(A.Z,{label:e,size:"small"},e))})]})]}):(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:"Player information unavailable"})]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(eK,{serverName:x.name,hostname:x.hostname})})]}),"Activity"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(p.Z,{variant:"h6",gutterBottom:!0,fontWeight:600,children:"Server Activity"}),(0,t.jsx)(O.Z,{sx:{mb:2}}),(0,t.jsx)(et,{serverName:x.name})]})})}),"Content"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Content management coming soon"})}),"Files"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"File browser coming soon"})}),"Backups"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(p.Z,{variant:"body1",color:"text.secondary",children:"Backup management coming soon"})}),"Access"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(eE,{serverId:x.name})}),"Options"===v&&(0,t.jsx)(o.Z,{sx:{mt:3},children:(0,t.jsx)(ey,{serverName:x.name,isRunning:"running"===x.status})}),(0,t.jsxs)(y.Z,{open:R,onClose:()=>z(!1),maxWidth:"xl",fullWidth:!0,PaperProps:{sx:{height:"90vh",bgcolor:"background.paper"}},children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:2,borderBottom:1,borderColor:"divider"},children:[(0,t.jsxs)(p.Z,{variant:"h6",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,letterSpacing:"0.05em"},children:["Console - ",x.name]}),(0,t.jsx)(d.Z,{onClick:()=>z(!1),children:(0,t.jsx)(B.Z,{})})]}),(0,t.jsx)(b.Z,{sx:{p:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(_.K,{serverName:x.name})})]})]})}function eJ(e){let{label:r,value:s}=e;return s?(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(p.Z,{variant:"body2",color:"text.secondary",children:r}),(0,t.jsx)(p.Z,{variant:"body2",sx:{fontWeight:500},children:s})]}):null}var eQ=s(93757);function e$(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]})}function eY(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M21 2v6h-6"}),(0,t.jsx)("path",{d:"M3 12a9 9 0 0115.36-6.36L21 8"}),(0,t.jsx)("path",{d:"M3 22v-6h6"}),(0,t.jsx)("path",{d:"M21 12a9 9 0 01-15.36 6.36L3 16"})]})}function eX(){var e,r,s,A;let M=(0,i.useParams)(),O=(0,a.x)(),B=decodeURIComponent(M.name),{data:E,isLoading:N,error:U}=(0,em.Hy)(B),{status:q,health:L}=function(e){let{serverName:r,onStatusChange:s,enabled:t=!0,reconnectInterval:i=3e3}=e,[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{o(null),d(null)},[r]);let c=(0,n.useCallback)(e=>{if("server-status"===e.type){let r=e.data.status,t=e.data.health;o(r),d(t),null==s||s(r,t)}},[s]),{isConnected:x,reconnect:u,retryCount:h}=(0,eQ.D)({url:"/api/sse/servers/".concat(encodeURIComponent(r),"/status"),onMessage:c,enabled:t,reconnectInterval:i});return{status:a,health:l,isConnected:x,reconnect:u,retryCount:h}}({serverName:B,enabled:!!B}),[H,K]=(0,n.useState)(null),[G,V]=(0,n.useState)(!1),[_,J]=(0,n.useState)(""),Q=(0,em.jM)(),$=(0,em.Aw)(),Y=(0,em._I)(),X=(0,em.Hq)(),ee=async()=>{try{await Q.mutateAsync(B)}catch(e){console.error("Failed to start server:",e)}},er=async()=>{try{await $.mutateAsync(B)}catch(e){console.error("Failed to stop server:",e)}},es=async()=>{try{await Y.mutateAsync(B)}catch(e){console.error("Failed to restart server:",e)}},et=async e=>{try{await fetch("/api/servers/".concat(encodeURIComponent(B),"/exec"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:e})})}catch(e){console.error("Failed to send command:",e)}},en=q||(null==E?void 0:E.server.status),ei=Q.isPending||$.isPending||Y.isPending,ea=null==E?void 0:E.server;return(0,t.jsxs)(t.Fragment,{children:[U&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to load server: ",U.message]}),Q.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to start server: ",null===(e=Q.error)||void 0===e?void 0:e.message]}),$.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to stop server: ",null===(r=$.error)||void 0===r?void 0:r.message]}),Y.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to restart server: ",null===(s=Y.error)||void 0===s?void 0:s.message]}),X.isError&&(0,t.jsxs)(c.Z,{severity:"error",sx:{mb:3},children:["Failed to delete server: ",null===(A=X.error)||void 0===A?void 0:A.message]}),N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:64,height:64,sx:{borderRadius:3,flexShrink:0}}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:80,height:18,sx:{mb:.5}}),(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:40}),(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:2,mt:.75},children:[(0,t.jsx)(u.Z,{variant:"text",width:100}),(0,t.jsx)(u.Z,{variant:"text",width:60}),(0,t.jsx)(u.Z,{variant:"text",width:140}),(0,t.jsx)(u.Z,{variant:"text",width:50})]})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",gap:1,flexShrink:0},children:[(0,t.jsx)(u.Z,{variant:"rounded",width:90,height:40,sx:{borderRadius:2}}),(0,t.jsx)(u.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:2}})]})]}),(0,t.jsx)(o.Z,{sx:{display:"flex",gap:.5,mb:3},children:[80,70,65,50,65,65].map((e,r)=>(0,t.jsx)(u.Z,{variant:"rounded",width:e,height:36,sx:{borderRadius:5}},r))}),(0,t.jsx)(o.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:2.5},children:[0,1,2].map(e=>(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[(0,t.jsx)(u.Z,{variant:"text",width:"50%"}),(0,t.jsx)(u.Z,{variant:"circular",width:28,height:28})]}),(0,t.jsx)(u.Z,{variant:"text",width:"60%",height:36}),(0,t.jsx)(u.Z,{variant:"rounded",width:"100%",height:6,sx:{borderRadius:3,mt:1}})]})},e))}),(0,t.jsxs)(h.Z,{sx:{borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,t.jsxs)(o.Z,{sx:{px:3,py:2,borderBottom:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:1.25},children:[(0,t.jsx)(u.Z,{variant:"text",width:80,height:28}),(0,t.jsx)(u.Z,{variant:"circular",width:10,height:10})]}),(0,t.jsx)(u.Z,{variant:"rectangular",height:360,sx:{bgcolor:"#0a0a0a"}}),(0,t.jsx)(o.Z,{sx:{px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider"},children:(0,t.jsx)(u.Z,{variant:"rounded",width:"100%",height:40,sx:{borderRadius:2}})})]}),(0,t.jsxs)(S.ZP,{container:!0,spacing:3,sx:{mt:1},children:[(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"40%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),[0,1,2,3,4,5,6].map(e=>(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%"}),(0,t.jsx)(u.Z,{variant:"text",width:"40%"})]},e))]})})}),(0,t.jsx)(S.ZP,{item:!0,xs:12,md:6,children:(0,t.jsx)(h.Z,{sx:{borderRadius:3},children:(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(u.Z,{variant:"text",width:"30%",height:28,sx:{mb:1}}),(0,t.jsx)(u.Z,{variant:"rectangular",height:1,sx:{mb:2}}),(0,t.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"space-between",py:1},children:[(0,t.jsx)(u.Z,{variant:"text",width:"25%"}),(0,t.jsx)(u.Z,{variant:"text",width:"20%"})]})]})})})]})]}):ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:2,mb:2.5},children:[(0,t.jsx)(o.Z,{sx:{width:64,height:64,borderRadius:3,overflow:"hidden",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"1px solid",borderColor:"divider",fontSize:36},children:function(e){if(!e)return"\uD83C\uDFAE";let r=e.toUpperCase();return["PAPER","SPIGOT","BUKKIT","PURPUR"].includes(r)?"\uD83D\uDD0C":["FORGE","NEOFORGE","FABRIC","QUILT"].includes(r)?"\uD83D\uDD27":"\uD83C\uDFAE"}(ea.type)}),(0,t.jsxs)(o.Z,{sx:{flex:1},children:[(0,t.jsxs)(p.Z,{onClick:()=>O.push("/servers"),sx:{fontSize:12,color:"primary.main",cursor:"pointer",mb:.25,display:"flex",alignItems:"center",gap:.5,"&:hover":{textDecoration:"underline"}},children:[(0,t.jsx)(R.Z,{sx:{fontSize:14}})," All servers"]}),(0,t.jsx)(p.Z,{variant:"h4",component:"h1",sx:{fontFamily:'"Minecraft", sans-serif',fontWeight:400,color:"text.primary",letterSpacing:"0.5px",m:0,textTransform:"uppercase"},children:B}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:0,mt:.75,flexWrap:"wrap",fontSize:13,color:"text.secondary"},children:[ea.version&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(W.Z,{sx:{fontSize:14}}),"Minecraft ",ea.version]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(F.Z,{sx:{fontSize:14}}),ea.type]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),ea.hostname&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(T.Z,{sx:{fontSize:14}}),ea.hostname]}),(0,t.jsx)(o.Z,{component:"span",sx:{mx:1.25,color:"#3a3d4e"},children:"|"})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:.5},children:[(0,t.jsx)(D.Z,{sx:{fontSize:14}}),ea.uptime||function(e){if(!e||e<0)return"0s";let r=Math.floor(e/3600),s=Math.floor(e%3600/60),t=e%60;return r>0?"".concat(r,"h ").concat(s,"m"):s>0?"".concat(s,"m ").concat(t,"s"):"".concat(t,"s")}(ea.uptimeSeconds)||"0s"]})]})]}),(0,t.jsxs)(o.Z,{sx:{display:"flex",alignItems:"center",gap:1.25,flexShrink:0},children:[("stopped"===en||"exited"===en||"not_created"===en)&&(0,t.jsx)(l.Z,{variant:"contained",color:"success",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(z.Z,{}),onClick:ee,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600},children:"Start"}),"running"===en&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Z,{variant:"outlined",startIcon:ei?(0,t.jsx)(x.Z,{size:16}):(0,t.jsx)(e$,{}),onClick:er,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:500,borderColor:"divider",color:"text.secondary","&:hover":{borderColor:"text.secondary",bgcolor:(0,k.Fq)("#fff",.05)}},children:"Stop"}),(0,t.jsx)(l.Z,{variant:"contained",startIcon:ei?(0,t.jsx)(x.Z,{size:16,color:"inherit"}):(0,t.jsx)(eY,{}),onClick:es,disabled:ei,sx:{px:2,py:1,borderRadius:2,fontSize:14,fontWeight:600,bgcolor:"primary.main",color:"#0a0e14","&:hover":{bgcolor:"primary.dark"}},children:"Restart"})]}),(0,t.jsx)(d.Z,{onClick:e=>K(e.currentTarget),sx:{width:36,height:36,borderRadius:2,border:"1px solid",borderColor:"divider",color:"text.secondary"},children:(0,t.jsx)(I.Z,{sx:{fontSize:18}})}),(0,t.jsx)(v.Z,{anchorEl:H,open:!!H,onClose:()=>K(null),children:(0,t.jsxs)(j.Z,{onClick:()=>{K(null),V(!0),J("")},sx:{color:"error.main"},children:[(0,t.jsx)(g.Z,{children:(0,t.jsx)(P.Z,{fontSize:"small",sx:{color:"error.main"}})}),(0,t.jsx)(Z.Z,{children:"Delete Server"})]})})]})]}),(0,t.jsx)(e_,{server:ea,onSendCommand:et})]}):(0,t.jsx)(c.Z,{severity:"warning",children:"Server not found"}),(0,t.jsxs)(y.Z,{open:G,onClose:()=>{V(!1),J("")},maxWidth:"sm",fullWidth:!0,children:[(0,t.jsx)(f.Z,{children:"Delete Server"}),(0,t.jsxs)(b.Z,{children:[(0,t.jsxs)(p.Z,{sx:{mb:2},children:["This action cannot be undone. Type ",(0,t.jsx)("strong",{children:B})," to confirm deletion."]}),(0,t.jsx)(w.Z,{label:"Server name",value:_,onChange:e=>J(e.target.value),fullWidth:!0,autoFocus:!0})]}),(0,t.jsxs)(C.Z,{sx:{px:3,pb:2},children:[(0,t.jsx)(l.Z,{onClick:()=>{V(!1),J("")},children:"Cancel"}),(0,t.jsx)(l.Z,{variant:"contained",color:"error",onClick:()=>{_===B&&X.mutate({name:B,force:!0},{onSuccess:()=>{O.push("/servers")}})},disabled:_!==B||X.isPending,startIcon:X.isPending?(0,t.jsx)(x.Z,{size:16}):null,children:X.isPending?"Deleting...":"Delete"})]})]})]})}},56813:function(e,r,s){"use strict";s.d(r,{I:function(){return a}});var t=s(94655),n=s(25333),i=s(82925);function a(e){let{action:r,size:s="small"}=e,a=i.Lu[r]||"default",o=i.n3[r]||r;return(0,t.jsx)(n.Z,{label:o,color:a,size:s,variant:"filled",sx:{fontWeight:600,fontSize:"small"===s?"0.7rem":"0.8rem"}})}},26892:function(e,r,s){"use strict";s.d(r,{c:function(){return o}});var t=s(94655),n=s(25333),i=s(46207),a=s(43436);function o(e){let{status:r,size:s="small"}=e;return(0,t.jsx)(n.Z,{icon:"success"===r?(0,t.jsx)(i.Z,{}):(0,t.jsx)(a.Z,{}),label:"success"===r?"OK":"Error",color:"success"===r?"success":"error",size:s,variant:"outlined",sx:{fontWeight:500,fontSize:"small"===s?"0.7rem":"0.8rem"}})}},84509:function(e,r,s){"use strict";s.d(r,{DM:function(){return a},HZ:function(){return l},VM:function(){return o},hT:function(){return i},oL:function(){return d}});var t=s(5632),n=s(42936);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,s=function(e){let r=new URLSearchParams;e.action&&r.set("action",e.action),e.actor&&r.set("actor",e.actor),e.targetType&&r.set("targetType",e.targetType),e.targetName&&r.set("targetName",e.targetName),e.status&&r.set("status",e.status),e.from&&r.set("from",e.from),e.to&&r.set("to",e.to),void 0!==e.limit&&r.set("limit",String(e.limit)),void 0!==e.offset&&r.set("offset",String(e.offset)),e.sort&&r.set("sort",e.sort);let s=r.toString();return s?"?".concat(s):""}(e);return(0,t.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs".concat(s)),enabled:(null==r?void 0:r.enabled)!==!1})}function a(e){return(0,t.a)({queryKey:["audit-logs","stats"],queryFn:()=>(0,n.SC)("/api/audit-logs/stats"),enabled:(null==e?void 0:e.enabled)!==!1,refetchInterval:3e4})}function o(e,r){return(0,t.a)({queryKey:["audit-logs",e],queryFn:()=>(0,n.SC)("/api/audit-logs/".concat(encodeURIComponent(e))),enabled:(null==r?void 0:r.enabled)!==!1&&!!e})}function l(e,r){var s;return i({targetType:"server",targetName:e,limit:null!==(s=null==r?void 0:r.limit)&&void 0!==s?s:20},{enabled:(null==r?void 0:r.enabled)!==!1&&!!e})}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return i({limit:e,sort:"timestamp:desc"})}},37228:function(e,r,s){"use strict";s.d(r,{Bc:function(){return l},N$:function(){return d},UW:function(){return o}});var t=s(5632),n=s(58919),i=s(20367),a=s(42936);function o(){return(0,t.a)({queryKey:["playit-status"],queryFn:()=>(0,a.SC)("/api/playit/status"),refetchInterval:3e4})}function l(){let e=(0,n.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/start",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}function d(){let e=(0,n.NL)();return(0,i.D)({mutationFn:()=>(0,a.SC)("/api/playit/stop",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["playit-status"]})}})}},82925:function(e,r,s){"use strict";s.d(r,{KK:function(){return o},Lu:function(){return t},Xn:function(){return a},n3:function(){return n},xg:function(){return i}});let t={"server.create":"success","server.delete":"error","server.start":"info","server.stop":"warning","server.restart":"secondary","player.whitelist.add":"success","player.whitelist.remove":"warning","player.ban":"error","player.unban":"success","player.op":"info","player.deop":"warning","player.kick":"error","audit.purge":"default"},n={"server.create":"Create","server.delete":"Delete","server.start":"Start","server.stop":"Stop","server.restart":"Restart","player.whitelist.add":"Whitelist Add","player.whitelist.remove":"Whitelist Remove","player.ban":"Ban","player.unban":"Unban","player.op":"Op","player.deop":"Deop","player.kick":"Kick","audit.purge":"Purge"},i=["server.create","server.delete","server.start","server.stop","server.restart","player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick","audit.purge"],a=["server.create","server.delete","server.start","server.stop","server.restart"],o=["player.whitelist.add","player.whitelist.remove","player.ban","player.unban","player.op","player.deop","player.kick"]}},function(e){e.O(0,[6812,9760,6758,680,1668,7436,1071,540,4416,2538,5511,880,55,7727,8347,1658,9951,6727,6645,7305,4596,9186,2666,5787,3669,2757,1744],function(){return e(e.s=59616)}),_N_E=e.O()}]);