@jheavenknows/bluerouter 5.5.32 → 5.5.33

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 (580) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +12 -12
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/ai-power-index/page.js.nft.json +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/ai-power-index/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/model-profiles/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/model-profiles/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cluster/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cluster/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/console/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/console/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personal/page.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personal/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personal/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudcombo/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudcombo/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/[id]/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/[id]/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/[id]/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/[id]/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/[id]/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/[id]/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/[id]/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/[id]/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/page.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/page_client-reference-manifest.js +1 -1
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/[id]/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/[id]/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/page.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/page_client-reference-manifest.js +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/[kind]/[id]/page.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/[kind]/[id]/page_client-reference-manifest.js +1 -1
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  92. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  94. package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page_client-reference-manifest.js +1 -1
  96. package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  98. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  100. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  102. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  104. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  106. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  108. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  109. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  110. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  112. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  115. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  116. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  117. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  118. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  119. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  120. package/app/.next-cli-build/server/app/api/audit-proxy/ca/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/audit-proxy/ca/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/audit-proxy/me/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/audit-proxy/me/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/audit-proxy/root-ca/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/audit-proxy/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/audit-proxy/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/audit-proxy/users/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/audit-proxy/users/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  136. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/auth/view-mode/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/auth/view-mode/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/branding/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/branding/upload/route.js +1 -1
  147. package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-model-profiles/cloud-models/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-model-profiles/model-catalog/route.js +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-model-profiles/model-catalog/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-model-profiles/route.js +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-model-profiles/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/cli-tools/qwen-settings/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/cluster/config/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/cluster/config/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/cluster/heartbeat/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/command/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/command/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/cluster/peers/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/cluster/peers/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/cluster/snapshot/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/cluster/sync/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/cluster/test/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/codex-catalog/download/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/codex-catalog/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/codex-catalog/upload/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/dashboard/ai-power-index/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/dashboard/ai-power-index/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/dashboard/analytics/ai-models/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/dashboard/analytics/ai-models/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/dashboard/analytics/analyze/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/keys/[id]/caveman-test/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/grok-cli/device-code/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/grok-cli/device-code/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/grok-cli/poll/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/grok-cli/poll/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/api-key-models/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/api-key-models/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/personal-cloud-combos/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/move/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/personal-cloud-providers/account-emails/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/personal-cloud-providers/account-emails/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/personal-cloud-providers/account-policy/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/personal-cloud-providers/account-policy/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/personal-cloud-providers/shares/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/personal-cloud-providers/visibility/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/personal-oauth-email/verify/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/personal-oauth-email/verify/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/pricing/catalog/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/provider-nodes/combo-references/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/provider-nodes/custom-embedding/manage/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/provider-nodes/openai-compatible/manage/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/resource-monitor/[id]/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/resource-monitor/ai-models/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/resource-monitor/ai-models/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/resource-monitor/analyze/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/resource-monitor/history/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/resource-monitor/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/settings/database/export/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/settings/prompt-log-db/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/settings/smtp/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/statusline/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  313. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/v1/rate-limits/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/version/restart/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  365. package/app/.next-cli-build/server/app/callback.html +1 -1
  366. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  367. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  368. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  369. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  370. package/app/.next-cli-build/server/app/dashboard/ai-power-index.html +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/ai-power-index.rsc +6 -6
  372. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard/ai-power-index/__PAGE__.segment.rsc +6 -6
  373. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_full.segment.rsc +6 -6
  374. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_tree.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +9 -9
  377. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +9 -9
  378. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +9 -9
  379. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  382. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +7 -7
  383. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  384. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.html +1 -1
  386. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.rsc +8 -8
  387. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/model-profiles/__PAGE__.segment.rsc +8 -8
  388. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_full.segment.rsc +8 -8
  389. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_tree.segment.rsc +1 -1
  390. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  392. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
  393. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  394. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/cluster.html +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/cluster.rsc +6 -6
  397. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster/__PAGE__.segment.rsc +6 -6
  398. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_full.segment.rsc +6 -6
  399. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_tree.segment.rsc +1 -1
  400. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  401. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  402. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +7 -7
  403. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  404. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  406. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  407. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
  408. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  409. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  410. package/app/.next-cli-build/server/app/dashboard/logs.html +1 -1
  411. package/app/.next-cli-build/server/app/dashboard/logs.rsc +6 -6
  412. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs/__PAGE__.segment.rsc +6 -6
  413. package/app/.next-cli-build/server/app/dashboard/logs.segments/_full.segment.rsc +6 -6
  414. package/app/.next-cli-build/server/app/dashboard/logs.segments/_tree.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  416. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  417. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +7 -7
  418. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  419. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/personal.html +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/personal.rsc +7 -7
  422. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard/personal/__PAGE__.segment.rsc +7 -7
  423. package/app/.next-cli-build/server/app/dashboard/personal.segments/_full.segment.rsc +7 -7
  424. package/app/.next-cli-build/server/app/dashboard/personal.segments/_tree.segment.rsc +1 -1
  425. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  427. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +7 -7
  428. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  429. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +6 -6
  432. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +6 -6
  433. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +6 -6
  434. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
  435. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +6 -6
  437. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +6 -6
  438. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +6 -6
  439. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/providers/embedding.html +1 -1
  441. package/app/.next-cli-build/server/app/dashboard/providers/embedding.rsc +7 -7
  442. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard/providers/embedding/__PAGE__.segment.rsc +7 -7
  443. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_full.segment.rsc +7 -7
  444. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_tree.segment.rsc +1 -1
  445. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.html +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.rsc +7 -7
  447. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard/providers/image-to-text/__PAGE__.segment.rsc +7 -7
  448. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_full.segment.rsc +7 -7
  449. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_tree.segment.rsc +1 -1
  450. package/app/.next-cli-build/server/app/dashboard/providers/image.html +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/providers/image.rsc +7 -7
  452. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard/providers/image/__PAGE__.segment.rsc +7 -7
  453. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_full.segment.rsc +7 -7
  454. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_tree.segment.rsc +1 -1
  455. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  456. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  457. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +7 -7
  458. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  459. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  460. package/app/.next-cli-build/server/app/dashboard/providers/stt.html +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/providers/stt.rsc +7 -7
  462. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers/stt/__PAGE__.segment.rsc +7 -7
  463. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_full.segment.rsc +7 -7
  464. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_tree.segment.rsc +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/providers/tts.html +1 -1
  466. package/app/.next-cli-build/server/app/dashboard/providers/tts.rsc +7 -7
  467. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers/tts/__PAGE__.segment.rsc +7 -7
  468. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_full.segment.rsc +7 -7
  469. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_tree.segment.rsc +1 -1
  470. package/app/.next-cli-build/server/app/dashboard/providers/web.html +1 -1
  471. package/app/.next-cli-build/server/app/dashboard/providers/web.rsc +7 -7
  472. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard/providers/web/__PAGE__.segment.rsc +7 -7
  473. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_full.segment.rsc +7 -7
  474. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_tree.segment.rsc +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  476. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  477. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +7 -7
  478. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  479. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  480. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  481. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  482. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +7 -7
  483. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  484. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  486. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  487. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +8 -8
  488. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  489. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/resource-monitor.html +1 -1
  491. package/app/.next-cli-build/server/app/dashboard/resource-monitor.rsc +6 -6
  492. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor/__PAGE__.segment.rsc +6 -6
  493. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_full.segment.rsc +6 -6
  494. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_tree.segment.rsc +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  496. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  497. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +6 -6
  498. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  499. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  500. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  501. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  502. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +7 -7
  503. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  504. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  505. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  506. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  507. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  508. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  509. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  511. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  512. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +7 -7
  513. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  514. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  517. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +7 -7
  518. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  519. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  520. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  521. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  522. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
  523. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  524. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  526. package/app/.next-cli-build/server/app/index.html +1 -1
  527. package/app/.next-cli-build/server/app/index.rsc +5 -5
  528. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  529. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  530. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  531. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  532. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  533. package/app/.next-cli-build/server/app/landing.html +1 -1
  534. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  535. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  536. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  537. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  538. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  539. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  540. package/app/.next-cli-build/server/app/login.html +1 -1
  541. package/app/.next-cli-build/server/app/login.rsc +6 -6
  542. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  543. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  544. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
  545. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  546. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  547. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  548. package/app/.next-cli-build/server/app-paths-manifest.json +12 -12
  549. package/app/.next-cli-build/server/chunks/2428.js +1 -1
  550. package/app/.next-cli-build/server/chunks/3104.js +1 -1
  551. package/app/.next-cli-build/server/chunks/3399.js +1 -1
  552. package/app/.next-cli-build/server/chunks/3408.js +7 -0
  553. package/app/.next-cli-build/server/chunks/4003.js +1 -1
  554. package/app/.next-cli-build/server/chunks/427.js +1 -1
  555. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  556. package/app/.next-cli-build/server/chunks/4778.js +1 -1
  557. package/app/.next-cli-build/server/chunks/5576.js +1 -1
  558. package/app/.next-cli-build/server/chunks/607.js +1 -1
  559. package/app/.next-cli-build/server/chunks/6236.js +1 -0
  560. package/app/.next-cli-build/server/chunks/6811.js +1 -1
  561. package/app/.next-cli-build/server/chunks/6992.js +1 -1
  562. package/app/.next-cli-build/server/chunks/7307.js +1 -1
  563. package/app/.next-cli-build/server/chunks/9293.js +1 -1
  564. package/app/.next-cli-build/server/chunks/9588.js +1 -0
  565. package/app/.next-cli-build/server/chunks/9905.js +1 -1
  566. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  567. package/app/.next-cli-build/server/pages/404.html +1 -1
  568. package/app/.next-cli-build/server/pages/500.html +1 -1
  569. package/app/.next-cli-build/static/chunks/{5263-9071334fbf7c8010.js → 5263-2ebe5ca7c9f72723.js} +1 -1
  570. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personal/page-ed31330e2add160e.js +1 -0
  571. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.5.15-to-5.5.23-5.5.23-20260922-195909 → upgrade-5.5.30-to-5.5.31-5.5.31-20260924-165740}/data.sqlite +0 -0
  572. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
  573. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
  574. package/app/package.json +1 -1
  575. package/package.json +1 -1
  576. package/app/.next-cli-build/server/chunks/7110.js +0 -1
  577. package/app/.next-cli-build/server/chunks/888.js +0 -7
  578. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personal/page-4bdfd071a3f247b9.js +0 -1
  579. /package/app/.next-cli-build/static/{r07zildwt0dchgGMsEw5_ → KA9-e1O_C4hGJQRukAmIG}/_buildManifest.js +0 -0
  580. /package/app/.next-cli-build/static/{r07zildwt0dchgGMsEw5_ → KA9-e1O_C4hGJQRukAmIG}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=3674,a.ids=[3674],a.modules={1932:a=>{"use strict";a.exports=require("url")},2125:a=>{a.exports={page:"PersonalCloudProviderPage_page__WEiqp"}},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},8526:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\app\\\\(dashboard)\\\\dashboard\\\\personal\\\\page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\app\\(dashboard)\\dashboard\\personal\\page.js","default")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19288:(a,b,c)=>{Promise.resolve().then(c.bind(c,37627))},19771:a=>{"use strict";a.exports=require("process")},21820:a=>{"use strict";a.exports=require("os")},25912:(a,b,c)=>{Promise.resolve().then(c.bind(c,8526))},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34631:a=>{"use strict";a.exports=require("tls")},36559:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>w,handler:()=>y,routeModule:()=>x});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,32059))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u={children:["",{children:["(dashboard)",{children:["dashboard",{children:["personal",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,8526))),"D:\\bluerouter\\src\\app\\(dashboard)\\dashboard\\personal\\page.js"]}]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"D:\\bluerouter\\src\\app\\(dashboard)\\layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"D:\\bluerouter\\src\\app\\layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,v=(0,e.H)({tree:u,page:"/(dashboard)/dashboard/personal/page",pathname:"/dashboard/personal",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),w=v.__next_app__,x=v.routeModule,y=v.handler},37627:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>J});var d=c(48249),e=c(67484),f=c(74812),g=c(20151),h=c(69683),i=c(66979),j=c(4298),k=c(50412),l=c(72738),m=c(17194);function n(a){return String(a||"").trim().toLowerCase()}function o(){let{isAdmin:a}=(0,g.s)(),[b,c]=(0,e.useState)([]),[f,h]=(0,e.useState)({}),[i,j]=(0,e.useState)({}),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)({}),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)({}),[w,x]=(0,e.useState)(3),[y,z]=(0,e.useState)("3"),[A,B]=(0,e.useState)(!0),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(!1),W=(0,e.useCallback)(a=>{h(a.permissions||{}),j(a.connectionsByUser||{}),"number"==typeof a.globalConnectionsPerProviderLimit&&a.globalConnectionsPerProviderLimit>0&&(x(a.globalConnectionsPerProviderLimit),z(String(a.globalConnectionsPerProviderLimit))),a.connectionsPerProviderLimitOverrides&&"object"==typeof a.connectionsPerProviderLimitOverrides&&v(a.connectionsPerProviderLimitOverrides)},[]),X=(0,e.useCallback)(async()=>{if(a){B(!0),J("");try{let[a,b]=await Promise.all([fetch("/api/personal-cloud-providers",{cache:"no-store"}),fetch("/api/personal-cloud-providers/permissions",{cache:"no-store"})]),d=await a.json().catch(()=>({})),e=await b.json().catch(()=>({}));if(!a.ok)throw Error(d.error||"Kh\xf4ng tải được personal OAuth providers");if(!b.ok)throw Error(e.error||"Kh\xf4ng tải được quyền OAuth");c(Array.isArray(d.providers)?d.providers:[]),W(e)}catch(a){J(a?.message||"Kh\xf4ng tải được cấu h\xecnh OAuth access")}finally{B(!1)}}},[W,a]),Y=(0,e.useRef)(0),Z=(0,e.useCallback)(async a=>{let b=a.trim();if(!b)return;let c=++Y.current;R(!0);try{let a=await fetch(`/api/personal-cloud-providers/permissions?search=${encodeURIComponent(b)}`,{cache:"no-store"}),d=await a.json().catch(()=>({}));if(c!==Y.current)return;if(!a.ok)throw Error(d.error||"Kh\xf4ng t\xecm được t\xe0i khoản");P(Array.isArray(d.accounts)?d.accounts:[]),T(!!d.accountsTruncated)}catch(a){if(c!==Y.current)return;P([]),J(a?.message||"Kh\xf4ng t\xecm được t\xe0i khoản")}finally{c===Y.current&&R(!1)}},[]),$=(0,e.useMemo)(()=>Array.from(new Set([...Object.keys(f||{}),...Object.keys(i||{})])).map(a=>{let c=f[a]||{},d=i[a]||{},e=b.filter(a=>c?.[a.id]===!0),g=b.some(a=>Number(d[a.id]||0)>0);return{userId:a,providerState:c,connectionsByProvider:d,enabledProviders:e,hasAnyConnection:g}}).filter(a=>a.enabledProviders.length>0||a.hasAnyConnection).sort((a,b)=>a.userId.localeCompare(b.userId)),[i,f,b]),_=null!==O,aa=(0,e.useMemo)(()=>_?O.map(a=>{let c=a.providerState||{},d=a.connectionsByProvider||{},e=b.filter(a=>c?.[a.id]===!0),f=b.some(a=>Number(d[a.id]||0)>0);return{userId:a.userId,displayName:a.displayName,email:a.email,providerState:c,connectionsByProvider:d,enabledProviders:e,hasAnyConnection:f}}).sort((a,b)=>a.userId.localeCompare(b.userId)):$,[_,O,$,b]),ab=(0,e.useMemo)(()=>{let a=0,c=0,d=0,e=new Map(b.map(a=>[a.id,{grantedUsers:0,connections:0}]));for(let f of $){for(let c of b){let b=Number(f.connectionsByProvider?.[c.id]||0);a+=b;let d=e.get(c.id);f.providerState?.[c.id]===!0?(d.grantedUsers+=1,d.connections+=b):b>0&&(d.connections+=b)}f.enabledProviders.length>0&&!f.hasAnyConnection&&(c+=1),0===f.enabledProviders.length&&f.hasAnyConnection&&(d+=1)}return{totalUsers:$.length,totalConnections:a,grantedNoConnection:c,connectionNoGrant:d,perProvider:b.map(a=>({provider:a,...e.get(a.id)}))}},[$,b]),ac=async()=>{let a,b=n(o);if(!b)return void J("Nhập username/email cần cấp quyền.");let c=String(s||"").trim();if(""===c)a=null;else{let b=Number.parseInt(c,10);if(!Number.isFinite(b)||b<=0)return void J("Per-user override phải l\xe0 số nguy\xean dương hoặc bỏ trống.");a=b}D(!0),J(""),L("");try{let c=await fetch("/api/personal-cloud-providers/permissions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:b,providers:q,connectionsPerProviderLimit:a})}),d=await c.json().catch(()=>({}));if(!c.ok)throw Error(d.error||"Kh\xf4ng lưu được quyền OAuth");W(d);let e=d.user?.id||b;p(e),L(`Đ\xe3 lưu quyền OAuth cho ${e}.`),V(!1),M.trim()&&Z(M)}catch(a){J(a?.message||"Kh\xf4ng lưu được quyền OAuth")}finally{D(!1)}},ad=async()=>{let a=Number.parseInt(y,10);if(!Number.isFinite(a)||a<=0)return void J("Global limit phải l\xe0 số nguy\xean dương.");F(!0),J(""),L("");try{let b=await fetch("/api/personal-cloud-providers/permissions",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({globalConnectionsPerProviderLimit:a})}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||"Kh\xf4ng lưu được global limit");W(c),L(`Đ\xe3 đặt global limit = ${a} account / provider / user.`)}catch(a){J(a?.message||"Kh\xf4ng lưu được global limit")}finally{F(!1)}},ae=async a=>{let b=n(a);if(b){D(!0),J(""),L("");try{let a=await fetch(`/api/personal-cloud-providers/permissions?userId=${encodeURIComponent(b)}`,{method:"DELETE"}),c=await a.json().catch(()=>({}));if(!a.ok)throw Error(c.error||"Kh\xf4ng thu hồi được quyền OAuth");W(c),n(o)===b&&p("");let d=c.disconnectSummary||{},e=Number(d.manualActionRequired)||0;L(`Đ\xe3 x\xf3a ${d.deletedCount||0} OAuth connection của ${b}; ${d.upstreamRevokedCount||0} token đ\xe3 revoke upstream.${e>0?` ${e} connection cần thu hồi thủ c\xf4ng tại provider.`:""}`),H(""),M.trim()&&Z(M)}catch(a){J(a?.message||"Kh\xf4ng thu hồi được quyền OAuth")}finally{D(!1)}}};if(!a)return null;let af=$.find(a=>a.userId===n(G)),ag=b.reduce((a,b)=>a+Number(af?.connectionsByProvider?.[b.id]||0),0);return(0,d.jsxs)("div",{className:"space-y-5",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/50 p-4",children:[(0,d.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:"Admin: OAuth provider access"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Quản l\xfd provider n\xe0o user được ph\xe9p d\xf9ng, giới hạn số account OAuth c\xe1 nh\xe2n v\xe0 thu hồi to\xe0n bộ quyền/token khi cần. C\xe1c thao t\xe1c trong tab n\xe0y chỉ d\xe0nh cho admin."})]}),(0,d.jsx)(m.default,{}),I?(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:I}):null,K?(0,d.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:K}):null,(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Access policy"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Default l\xe0 kh\xf4ng c\xf3 quyền. Tắt provider giữ nguy\xean connection/token để c\xf3 thể bật lại; Revoke all sẽ thử revoke upstream rồi x\xf3a connection/token local."})]}),(0,d.jsx)(k.$n,{variant:"outline",size:"sm",onClick:X,loading:A,icon:"refresh",children:"Refresh"})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium",children:"Global limit — số account OAuth c\xe1 nh\xe2n / provider / user thường"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"\xc1p dụng cho user kh\xf4ng c\xf3 per-user override. Admin kh\xf4ng bị chặn bởi limit n\xe0y."}),(0,d.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsx)(k.pd,{type:"number",min:1,value:y,onChange:a=>z(a.target.value),className:"sm:w-48"}),(0,d.jsx)(k.$n,{onClick:ad,loading:E,disabled:E||Number.parseInt(y,10)===w,children:"Lưu global"}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Đang lưu: ",w]})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Granted OAuth Access"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"T\xecm một t\xe0i khoản (username/email) để xem v\xe0 chỉnh quyền — kể cả t\xe0i khoản chưa được cấp quyền g\xec. Kh\xf4ng t\xecm kiếm th\xec hiển thị c\xe1c t\xe0i khoản đang c\xf3 quyền hoặc c\xf2n OAuth connection."})]}),A?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải quyền..."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"mb-4 grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Tổng user"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:ab.totalUsers})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Tổng OAuth connection"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:ab.totalConnections})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Cấp quyền, chưa connect"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:ab.grantedNoConnection})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"C\xf2n connection, đ\xe3 thu hồi quyền"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:ab.connectionNoGrant})]})]}),ab.perProvider.some(a=>a.grantedUsers>0||a.connections>0)?(0,d.jsxs)("div",{className:"mb-4 rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium text-text-main",children:"Breakdown theo provider"}),(0,d.jsx)("div",{className:"mt-3 space-y-2",children:ab.perProvider.map(({provider:a,grantedUsers:b,connections:c})=>(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 text-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(l.A,{src:`/providers/${a.id}.png`,alt:a.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:a.id.slice(0,2).toUpperCase(),fallbackColor:a.color||"#64748b"}),(0,d.jsx)("span",{className:"text-text-main",children:a.name})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,d.jsxs)("span",{children:[b," user được cấp quyền"]}),(0,d.jsxs)("span",{children:[c," connection"]})]})]},a.id))})]}):null,(0,d.jsx)("div",{className:"mb-4",children:(0,d.jsx)(k.pd,{label:"T\xecm t\xe0i khoản",value:M,onChange:a=>N(a.target.value),placeholder:"Nhập username hoặc email, vd: anh-tct hoặc anh-tct@fujinet.net",hint:Q?"Đang t\xecm…":void 0})}),_&&Q&&0===aa.length?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang t\xecm t\xe0i khoản..."}):_&&0===aa.length?(0,d.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:['Kh\xf4ng t\xecm thấy t\xe0i khoản n\xe0o khớp với "',M.trim(),'".']}):_||0!==$.length?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),b.map(a=>(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:a.name},a.id)),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Limit / provider"}),(0,d.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border bg-background",children:aa.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsxs)("td",{className:"px-4 py-4",children:[(0,d.jsx)("div",{className:"break-all font-mono text-text-main",children:a.userId}),a.displayName||a.email?(0,d.jsx)("div",{className:"mt-0.5 text-xs text-text-muted",children:[a.displayName,a.email].filter(Boolean).join(" \xb7 ")}):null]}),b.map(b=>{let c=!0===a.providerState[b.id],e=Number(a.connectionsByProvider?.[b.id]||0);return(0,d.jsx)("td",{className:"px-4 py-4",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(k.Ex,{variant:c?"success":"default",size:"sm",children:c?"ON":"OFF"}),e>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-0.5",title:`User đ\xe3 add ${e} ${b.name} account`,children:[(0,d.jsx)(l.A,{src:`/providers/${b.id}.png`,alt:b.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:b.id.slice(0,2).toUpperCase(),fallbackColor:b.color||"#64748b"}),e>1?(0,d.jsxs)("span",{className:"text-[10px] font-semibold text-text-muted",children:["\xd7",e]}):null]}):null]})},b.id)}),(0,d.jsx)("td",{className:"px-4 py-4 text-xs",children:u[a.userId]>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,d.jsx)(k.Ex,{variant:"warning",size:"sm",children:"Override"}),(0,d.jsx)("span",{className:"font-mono",children:u[a.userId]})]}):(0,d.jsxs)("span",{className:"text-text-muted",children:["Global \xb7 ",w]})}),(0,d.jsx)("td",{className:"px-4 py-4",children:(0,d.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,d.jsx)(k.$n,{variant:"outline",size:"sm",onClick:()=>(a=>{let c=n(a);p(c);let d=f[c]||{},e={};for(let a of b)e[a.id]=!0===d[a.id];r(e),J(""),L(""),V(!0)})(a.userId),children:"Edit"}),a.enabledProviders.length>0||a.hasAnyConnection?(0,d.jsx)(k.$n,{variant:"danger",size:"sm",loading:C&&G===a.userId,onClick:()=>H(a.userId),children:"Revoke all & delete"}):null]})})]},a.userId))})]})}),_&&S?(0,d.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Chỉ hiển thị ",aa.length," kết quả đầu, thu hẹp từ kh\xf3a t\xecm kiếm để ch\xednh x\xe1c hơn."]}):null]}):(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 user n\xe0o được cấp quyền OAuth provider. D\xf9ng \xf4 t\xecm kiếm ở tr\xean để cấp quyền cho một t\xe0i khoản."})]})]})]}),G?(0,d.jsx)(k.aF,{isOpen:!0,onClose:()=>H(""),title:"Thu hồi to\xe0n bộ quyền OAuth",size:"lg",busy:C,closeOnOverlay:!C,footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{variant:"ghost",onClick:()=>H(""),disabled:C,children:"Hủy"}),(0,d.jsx)(k.$n,{variant:"danger",icon:"delete_forever",loading:C,onClick:()=>ae(G),children:"Thu hồi v\xe0 x\xf3a to\xe0n bộ"})]}),children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 p-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium text-red-700 dark:text-red-300",children:"H\xe0nh động nguy hiểm, kh\xf4ng thể ho\xe0n t\xe1c"}),(0,d.jsx)("div",{className:"mt-1 break-all text-lg font-semibold text-text-main",children:G}),(0,d.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:"To\xe0n bộ quyền OAuth provider v\xe0 connection/token local của user n\xe0y sẽ bị x\xf3a; gateway sẽ thử revoke upstream trước."})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-surface p-3 text-sm",children:[(0,d.jsx)("span",{className:"text-text-muted",children:"Connection t\xecm thấy"}),(0,d.jsx)(k.Ex,{variant:ag>0?"warning":"default",size:"sm",children:ag})]}),af?(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(a=>{let b=Number(af.connectionsByProvider?.[a.id]||0);return b>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-2.5 py-1 text-xs text-text-muted",children:[(0,d.jsx)(l.A,{src:`/providers/${a.id}.png`,alt:a.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:a.id.slice(0,2).toUpperCase()}),a.name," \xd7",b]},a.id):null})}):null]})}):null,U?(0,d.jsx)(k.aF,{isOpen:!0,onClose:()=>V(!1),title:"Chỉnh quyền OAuth provider",size:"lg",busy:C,closeOnOverlay:!C,footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{variant:"ghost",onClick:()=>V(!1),disabled:C,children:"Hủy"}),(0,d.jsx)(k.$n,{onClick:ac,loading:C,icon:"save",children:"Save permissions"})]}),children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)(k.pd,{label:"User ID / Email",value:o,disabled:!0}),(0,d.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:b.map(a=>(0,d.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,d.jsx)(k.lM,{checked:!0===q[a.id],onChange:b=>r(c=>({...c,[a.id]:b})),label:a.name,description:q[a.id]?"User được ph\xe9p add account":"User chưa được cấp quyền"})},a.id))}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium",children:"Per-user override — account / provider"}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Ghi đ\xe8 global cho ",(0,d.jsx)("span",{className:"font-mono",children:n(o)||"user đang chọn"}),". Để trống để d\xf9ng global (",w,")."]}),(0,d.jsx)("div",{className:"mt-3 max-w-xs",children:(0,d.jsx)(k.pd,{type:"number",min:1,value:s,onChange:a=>t(a.target.value),placeholder:`Để trống = d\xf9ng global (${w})`})})]})]})}):null]})}let p="/api/settings/smtp",q=[{value:"starttls",label:"STARTTLS (587)"},{value:"ssl",label:"SSL/TLS (465)"},{value:"none",label:"Kh\xf4ng m\xe3 ho\xe1 (25)"}],r={starttls:"587",ssl:"465",none:"25"};function s(a={}){return{host:a.host||"",port:a.port?String(a.port):"587",security:a.security||"starttls",username:a.username||"",password:"",fromEmail:a.fromEmail||"",fromName:a.fromName||"BlueRouter",allowInvalidCert:!0===a.allowInvalidCert}}function t(a){return{...a,port:Number.parseInt(a.port,10)||void 0}}function u({defaultTestRecipient:a=""}){let[b,c]=(0,e.useState)(null),[f,g]=(0,e.useState)(s()),[h,i]=(0,e.useState)(a),[j,l]=(0,e.useState)(!0),[m,n]=(0,e.useState)(!1),[o,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(""),A=(0,e.useCallback)(a=>{c(a||null),g(s(a||{}))},[]),B=(0,e.useCallback)(async()=>{l(!0),x("");try{let a=await fetch(p,{cache:"no-store"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Kh\xf4ng tải được SMTP settings");A(b.smtp)}catch(a){x(a?.message||"Kh\xf4ng tải được SMTP settings")}finally{l(!1)}},[A]),C=a=>b=>g(c=>({...c,[a]:b.target.value})),D=async()=>{n(!0),x(""),z("");try{let a=await fetch(p,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t(f))}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Kh\xf4ng lưu được SMTP settings");A(b.smtp),z("Đ\xe3 lưu SMTP settings.")}catch(a){x(a?.message||"Kh\xf4ng lưu được SMTP settings")}finally{n(!1)}},E=async()=>{n(!0),x(""),z("");try{let a=await fetch(p,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t(f),password:"",clearPassword:!0})}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Kh\xf4ng xo\xe1 được password");A(b.smtp),z("Đ\xe3 xo\xe1 SMTP password.")}catch(a){x(a?.message||"Kh\xf4ng xo\xe1 được password")}finally{n(!1)}},F=async()=>{v(!0),x(""),z("");try{let a=await fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:h.trim(),settings:t(f)})}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Gửi mail test thất bại");z(`Đ\xe3 gửi mail test tới ${h.trim()}.${b.response?` Server: ${b.response}`:""}`)}catch(a){x(a?.message||"Gửi mail test thất bại")}finally{v(!1)}};return(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"SMTP settings"}),b?(0,d.jsx)(k.Ex,{variant:b.configured?"success":"warning",size:"sm",children:b.configured?"Đ\xe3 cấu h\xecnh":"Chưa cấu h\xecnh"}):null]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"D\xf9ng để gửi email x\xe1c thực khi user add account ngo\xe0i domain được ph\xe9p. Password được m\xe3 ho\xe1 khi lưu."})]}),(0,d.jsx)(k.$n,{variant:"outline",size:"sm",onClick:B,loading:j,icon:"refresh",children:"Refresh"})]}),w?(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:w}):null,y?(0,d.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:y}):null,j?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải SMTP settings..."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)]",children:[(0,d.jsx)(k.pd,{label:"SMTP host",value:f.host,onChange:C("host"),placeholder:"vd: smtp.fujinet.net"}),(0,d.jsx)(k.l6,{label:"Bảo mật",value:f.security,onChange:a=>{let b=a.target.value;g(a=>({...a,security:b,port:Object.values(r).includes(a.port)?r[b]:a.port}))},options:q}),(0,d.jsx)(k.pd,{label:"Port",type:"number",min:1,max:65535,value:f.port,onChange:C("port")})]}),(0,d.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,d.jsx)(k.pd,{label:"Username",value:f.username,onChange:C("username"),placeholder:"Để trống nếu SMTP kh\xf4ng cần auth",autoComplete:"off"}),(0,d.jsx)(k.pd,{label:"Password",type:"password",value:f.password,onChange:C("password"),placeholder:b?.hasPassword?"•••••••• (đ\xe3 lưu — để trống để giữ nguy\xean)":"Nhập password",autoComplete:"new-password",hint:b?.hasPassword?"Đ\xe3 c\xf3 password được lưu.":void 0})]}),(0,d.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,d.jsx)(k.pd,{label:"From email",value:f.fromEmail,onChange:C("fromEmail"),placeholder:"vd: bluerouter@fujinet.net"}),(0,d.jsx)(k.pd,{label:"From name",value:f.fromName,onChange:C("fromName"),placeholder:"BlueRouter"})]}),(0,d.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,d.jsx)(k.lM,{checked:f.allowInvalidCert,onChange:a=>g(b=>({...b,allowInvalidCert:a})),label:"Bỏ qua kiểm tra chứng chỉ TLS",description:"Chỉ bật khi SMTP nội bộ d\xf9ng chứng chỉ self-signed."})}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(k.$n,{onClick:D,loading:m,disabled:m||o,icon:"save",children:"Lưu SMTP"}),b?.hasPassword?(0,d.jsx)(k.$n,{variant:"ghost",onClick:E,disabled:m||o,icon:"key_off",children:"Xo\xe1 password"}):null]}),(0,d.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium text-text-main",children:"Gửi mail test"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Test với th\xf4ng tin đang nhập ở tr\xean (chưa cần lưu)."}),(0,d.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsx)(k.pd,{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"===a.key&&h.trim()&&F()},placeholder:"Email nhận test",className:"sm:w-96"}),(0,d.jsx)(k.$n,{variant:"outline",onClick:F,loading:o,disabled:o||m||!h.trim()||!f.host.trim(),icon:"send",children:"Gửi test"})]})]})]})]})}let v="/api/personal-cloud-providers/account-policy",w={domain:"Domain",email:"Allowlist","not-enforced":"Kh\xf4ng \xe1p dụng",disabled:"Policy tắt","missing-email":"Thiếu email","not-listed":"Chưa được ph\xe9p"};function x(a){return String(a||"").split(/[\s,;]+/).map(a=>a.trim().toLowerCase()).filter(Boolean)}function y(a){return`${a.email}|${a.ownerUser||""}`}function z(){let{isAdmin:a}=(0,g.s)(),[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)([]),[i,j]=(0,e.useState)([]),[m,n]=(0,e.useState)(0),[o,p]=(0,e.useState)(!0),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(!1),N=(0,e.useCallback)(a=>{c(a.policy||null),h(Array.isArray(a.providers)?a.providers:[]),j(Array.isArray(a.connections)?a.connections:[]),n(Number(a.pendingImportCount)||0)},[]),O=(0,e.useCallback)(async()=>{if(a){p(!0),t("");try{let a=await fetch(v,{cache:"no-store"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Kh\xf4ng tải được account policy");N(b)}catch(a){t(a?.message||"Kh\xf4ng tải được account policy")}finally{p(!1)}}},[N,a]),P=async(a,b,c)=>{r(!0),t(""),A("");try{let d=await fetch(v,{method:a,headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),e=await d.json().catch(()=>({}));if(!d.ok)throw Error(e.error||"Kh\xf4ng lưu được account policy");return N(e),A("function"==typeof c?c(e):c),!0}catch(a){return t(a?.message||"Kh\xf4ng lưu được account policy"),!1}finally{r(!1)}},Q=(a,c)=>P("PUT",{enabled:b.enabled,allowedDomains:b.allowedDomains,allowedEmails:b.allowedEmails,enforcedProviders:Object.fromEntries(f.map(a=>[a.id,a.enforced])),...a},c),R=async()=>{let a=x(B).map(a=>a.replace(/^@+/,"")),c=a.filter(a=>!b.allowedDomains.includes(a));0===c.length?t(a.length?"Domain đ\xe3 c\xf3 trong danh s\xe1ch.":"Nhập domain cần th\xeam, vd: fujinet.net"):await Q({allowedDomains:[...b.allowedDomains,...c]},`Đ\xe3 th\xeam domain: ${c.join(", ")}.`)&&C("")},S=async()=>{let a=x(D),c=H.trim().toLowerCase(),d=new Set(b.allowedEmails.map(y)),e=Array.from(new Set(a)).filter(a=>!d.has(y({email:a,ownerUser:c})));if(0===e.length)return void t(a.length?"Email đ\xe3 c\xf3 trong danh s\xe1ch.":"Nhập email cần cho ph\xe9p.");let f=F.trim();await Q({allowedEmails:[...b.allowedEmails,...e.map(a=>({email:a,note:f,ownerUser:c}))]},`Đ\xe3 cho ph\xe9p ${e.length} email${c?` cho user ${c}`:" cho mọi user"}.`)&&(E(""),G(""),I(""))},T=(0,e.useMemo)(()=>{let a=J.trim().toLowerCase(),c=b?.allowedEmails||[];return a?c.filter(b=>[b.email,b.note,b.addedBy,b.ownerUser].some(b=>String(b||"").toLowerCase().includes(a))):c},[J,b]),U=(0,e.useMemo)(()=>i.filter(a=>!a.allowed),[i]),V=L?i:U,W=(0,e.useMemo)(()=>new Map(f.map(a=>[a.id,a])),[f]);if(!a)return null;let X=(a,b=16)=>{let c=W.get(a)||{id:a,name:a};return(0,d.jsx)(l.A,{src:`/providers/${c.id}.png`,alt:c.name,size:b,className:b>16?"max-h-[20px] max-w-[20px] rounded object-contain":"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:String(c.id).slice(0,2).toUpperCase(),fallbackColor:c.color||"#64748b"})};return(0,d.jsxs)("div",{className:"space-y-5",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/50 p-4",children:[(0,d.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:"Admin: Account allowlist"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Giới hạn account upstream n\xe0o được add v\xe0o Personal OAuth. Account c\xf3 email thuộc domain được ph\xe9p lu\xf4n được add (khi user đ\xe3 được cấp quyền provider); account kh\xe1c phải c\xf3 trong danh s\xe1ch email do admin thiết lập."})]}),s?(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:s}):null,z?(0,d.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:z}):null,o||!b?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải account policy..."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Account policy"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"\xc1p dụng khi user add account mới hoặc reauth. Connection đang chạy kh\xf4ng bị ngắt khi đổi policy."})]}),(0,d.jsx)(k.$n,{variant:"outline",size:"sm",onClick:O,loading:o,icon:"refresh",children:"Refresh"})]}),(0,d.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,d.jsx)(k.lM,{checked:b.enabled,disabled:q,onChange:a=>Q({enabled:a},a?"Đ\xe3 bật account policy.":"Đ\xe3 tắt account policy — mọi account đều được add."),label:"Bật kiểm tra account email",description:b.enabled?"Chỉ domain / email được ph\xe9p mới add được":"Đang tắt: mọi account đều được add"})}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Domain được ph\xe9p"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:b.allowedDomains.length})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Email ngoại lệ"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:b.allowedEmails.length})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Connection hiện c\xf3"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:i.length})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Sẽ bị chặn khi reauth"}),(0,d.jsx)("div",{className:`mt-1 text-2xl font-bold ${U.length>0?"text-red-600 dark:text-red-400":"text-text-main"}`,children:U.length})]})]})]}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Domain được ph\xe9p"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Account c\xf3 email thuộc c\xe1c domain n\xe0y lu\xf4n được add. Chỉ khớp ch\xednh x\xe1c domain (kh\xf4ng gồm subdomain)."})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:0===b.allowedDomains.length?(0,d.jsx)("span",{className:"text-sm text-text-muted",children:"Chưa c\xf3 domain n\xe0o — mọi account đều phải nằm trong danh s\xe1ch email."}):b.allowedDomains.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-3 py-1 text-sm text-text-main",children:[(0,d.jsxs)("span",{className:"font-mono",children:["@",a]}),(0,d.jsx)("button",{type:"button",className:"material-symbols-outlined text-[16px] text-text-muted hover:text-red-500 disabled:opacity-50",onClick:()=>Q({allowedDomains:b.allowedDomains.filter(b=>b!==a)},`Đ\xe3 x\xf3a domain ${a}.`),disabled:q,"aria-label":`X\xf3a domain ${a}`,title:"X\xf3a domain",children:"close"})]},a))}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsx)(k.pd,{label:"Th\xeam domain",value:B,onChange:a=>C(a.target.value),onKeyDown:a=>{"Enter"===a.key&&R()},placeholder:"vd: fujinet.net, partner.com",className:"sm:w-96"}),(0,d.jsx)(k.$n,{onClick:R,loading:q,disabled:q||!B.trim(),icon:"add",children:"Th\xeam"})]})]}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Provider \xe1p dụng"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Provider tắt ở đ\xe2y sẽ kh\xf4ng kiểm tra email. Kiro v\xe0 GitHub mặc định tắt v\xec OAuth của ch\xfang thường kh\xf4ng trả về email."})]}),(0,d.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:f.map(a=>(0,d.jsxs)("div",{className:"flex items-start gap-3 rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"pt-0.5",children:X(a.id,20)}),(0,d.jsx)(k.lM,{checked:a.enforced,disabled:q||!b.enabled,onChange:b=>{let c;return c=a.id,Q({enforcedProviders:Object.fromEntries(f.map(a=>[a.id,a.id===c?b:a.enforced]))},`${b?"Đ\xe3 \xe1p dụng":"Đ\xe3 bỏ \xe1p dụng"} policy cho ${f.find(a=>a.id===c)?.name||c}.`)},label:a.name,description:a.enforced?"Kiểm tra domain / email":"Kh\xf4ng kiểm tra"})]},a.id))})]}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Email được ph\xe9p (ngoại lệ)"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Account ngo\xe0i domain được ph\xe9p phải c\xf3 trong danh s\xe1ch n\xe0y. Email gắn với một user chỉ user đ\xf3 được add; để trống User để cho mọi user. User cũng c\xf3 thể tự th\xeam email của m\xecnh bằng c\xe1ch x\xe1c thực qua mail."})]}),(0,d.jsxs)(k.$n,{variant:"outline",size:"sm",icon:"download",onClick:()=>P("POST",{action:"import-existing"},a=>a.importedCount>0?`Đ\xe3 import ${a.importedCount} email từ connection hiện c\xf3.`:"Kh\xf4ng c\xf3 email mới cần import."),loading:q,disabled:q,children:["Import từ connection hiện c\xf3",m>0?` (${m})`:""]})]}),(0,d.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)_auto] md:items-end",children:[(0,d.jsx)(k.pd,{label:"Email",value:D,onChange:a=>E(a.target.value),onKeyDown:a=>{"Enter"===a.key&&S()},placeholder:"vd: someone@gmail.com, other@partner.com"}),(0,d.jsx)(k.pd,{label:"Chỉ cho user (tuỳ chọn)",value:H,onChange:a=>I(a.target.value),onKeyDown:a=>{"Enter"===a.key&&S()},placeholder:"vd: anh-tct — trống = mọi user"}),(0,d.jsx)(k.pd,{label:"Ghi ch\xfa",value:F,onChange:a=>G(a.target.value),onKeyDown:a=>{"Enter"===a.key&&S()},placeholder:"vd: account c\xe1 nh\xe2n của anh-tct"}),(0,d.jsx)(k.$n,{onClick:S,loading:q,disabled:q||!D.trim(),icon:"person_add",children:"Cho ph\xe9p"})]}),b.allowedEmails.length>0?(0,d.jsx)(k.pd,{value:J,onChange:a=>K(a.target.value),placeholder:"Lọc theo email, ghi ch\xfa, người th\xeam..."}):null,0===b.allowedEmails.length?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 email ngoại lệ n\xe0o."}):0===T.length?(0,d.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:['Kh\xf4ng c\xf3 email n\xe0o khớp với "',J.trim(),'".']}):(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Email"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Ghi ch\xfa"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Th\xeam bởi"}),(0,d.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border bg-background",children:T.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsxs)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:[a.email,a.verifiedAt?(0,d.jsx)(k.Ex,{variant:"success",size:"sm",className:"ml-2",children:"Verified"}):null]}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs",children:a.ownerUser?(0,d.jsx)("span",{className:"font-mono text-text-main",children:a.ownerUser}):(0,d.jsx)(k.Ex,{variant:"info",size:"sm",children:"Mọi user"})}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs text-text-muted",children:a.note||"—"}),(0,d.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,d.jsx)("div",{children:a.addedBy||"—"}),a.addedAt?(0,d.jsx)("div",{className:"mt-0.5",children:function(a){if(!a)return"";let b=new Date(a);return Number.isNaN(b.getTime())?"":b.toLocaleString("vi-VN")}(a.addedAt)}):null]}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("div",{className:"flex justify-end",children:(0,d.jsx)(k.$n,{variant:"outline",size:"sm",icon:"delete",onClick:()=>Q({allowedEmails:b.allowedEmails.filter(b=>y(b)!==y(a))},`Đ\xe3 x\xf3a ${a.email}${a.ownerUser?` (${a.ownerUser})`:""} khỏi danh s\xe1ch.`),disabled:q,children:"X\xf3a"})})})]},y(a)))})]})})]}),(0,d.jsx)(u,{}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Kiểm tra connection hiện c\xf3"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Kết quả nếu c\xe1c personal connection hiện c\xf3 được add / reauth lại với policy hiện tại."})]}),(0,d.jsx)(k.lM,{size:"sm",checked:L,onChange:M,label:"Hiện tất cả"})]}),0===V.length?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:L?"Chưa c\xf3 personal connection n\xe0o.":"Kh\xf4ng c\xf3 connection n\xe0o bị chặn bởi policy hiện tại."}):(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Provider"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Account email"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Kết quả"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border bg-background",children:V.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:a.ownerUser||"—"}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[X(a.provider),(0,d.jsx)("span",{className:"text-text-main",children:W.get(a.provider)?.name||a.provider}),a.isActive?null:(0,d.jsx)(k.Ex,{size:"sm",children:"Inactive"})]})}),(0,d.jsx)("td",{className:"px-4 py-3 break-all font-mono text-xs text-text-muted",children:a.email||"—"}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)(k.Ex,{variant:a.allowed?"success":"error",size:"sm",children:w[a.reason]||a.reason})})]},a.id))})]})})]})]})]})}var A=c(8385),B=c(26941),C=c(38825),D=c(2125),E=c.n(D);let F="/api/personal-cloud-providers/account-emails";function G(a){if(!a)return"";let b=new Date(a);return Number.isNaN(b.getTime())?"":b.toLocaleString("vi-VN")}function H(){let[a,b]=(0,e.useState)(null),[c,f]=(0,e.useState)(""),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(!1),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)("");(0,e.useCallback)(async()=>{h(!0);try{let a=await fetch(F,{cache:"no-store"}),c=await a.json().catch(()=>({}));if(!a.ok)throw Error(c.error||"Kh\xf4ng tải được danh s\xe1ch email");b(c)}catch(a){m(a?.message||"Kh\xf4ng tải được danh s\xe1ch email")}finally{h(!1)}},[]);let p=async(a,{query:c="",body:d}={},e)=>{j(!0),m(""),o("");try{let f=await fetch(`${F}${c}`,{method:a,headers:d?{"Content-Type":"application/json"}:void 0,body:d?JSON.stringify(d):void 0}),g=await f.json().catch(()=>({}));if(!f.ok)throw Error(g.error||"Thao t\xe1c thất bại");return b(g),o(e),!0}catch(a){return m(a?.message||"Thao t\xe1c thất bại"),!1}finally{j(!1)}},q=async a=>{let b=String(a||"").trim().toLowerCase();!b||await p("POST",{body:{email:b}},`Đ\xe3 gửi email x\xe1c thực tới ${b}. Mở hộp thư v\xe0 bấm link để ho\xe0n tất.`)&&b===c.trim().toLowerCase()&&f("")},r=a=>p("DELETE",{query:`?email=${encodeURIComponent(a)}`},`Đ\xe3 xo\xe1 ${a}.`);if(g&&!a||!a||!a.policyEnabled)return null;let s=a.allowedDomains||[],t=a.verified||[],u=a.pending||[];return(0,d.jsxs)(k.Zp,{className:"mb-5 space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Email account ngo\xe0i domain"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:[s.length>0?(0,d.jsxs)(d.Fragment,{children:["Account c\xf3 email ",(0,d.jsx)("span",{className:"font-mono",children:s.map(a=>`@${a}`).join(", ")})," được add trực tiếp. "]}):null,"Account d\xf9ng email kh\xe1c (vd: Gmail) cần x\xe1c thực qua mail trước khi add v\xe0o Personal OAuth. Email đ\xe3 x\xe1c thực chỉ \xe1p dụng cho t\xe0i khoản của bạn."]})]}),l?(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:l}):null,n?(0,d.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:n}):null,a.smtpConfigured?(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsx)(k.pd,{label:"Email account cần add",value:c,onChange:a=>f(a.target.value),onKeyDown:a=>{"Enter"===a.key&&q(c)},placeholder:"vd: yourname@gmail.com",className:"sm:w-96"}),(0,d.jsx)(k.$n,{onClick:()=>q(c),loading:i,disabled:i||!c.trim(),icon:"mark_email_unread",children:"Gửi email x\xe1c thực"})]}):(0,d.jsx)("div",{className:"rounded-xl border border-yellow-500/30 bg-yellow-500/10 px-4 py-3 text-sm text-yellow-800 dark:text-yellow-300",children:"Hệ thống chưa cấu h\xecnh gửi mail. Li\xean hệ admin để được th\xeam email v\xe0o danh s\xe1ch cho ph\xe9p."}),t.length>0||u.length>0?(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Email"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Trạng th\xe1i"}),(0,d.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border bg-background",children:[t.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:a.email}),(0,d.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,d.jsx)(k.Ex,{variant:"success",size:"sm",children:"Đ\xe3 cho ph\xe9p"}),(0,d.jsx)("span",{className:"ml-2",children:G(a.verifiedAt||a.addedAt)})]}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("div",{className:"flex justify-end",children:(0,d.jsx)(k.$n,{variant:"outline",size:"sm",icon:"delete",onClick:()=>r(a.email),disabled:i,children:"Xo\xe1"})})})]},`verified:${a.email}`)),u.filter(a=>!t.some(b=>b.email===a.email)).map(b=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:b.email}),(0,d.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,d.jsx)(k.Ex,{variant:"warning",size:"sm",children:"Chờ x\xe1c thực"}),(0,d.jsxs)("span",{className:"ml-2",children:["hết hạn ",G(b.expiresAt)]})]}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[a.smtpConfigured?(0,d.jsx)(k.$n,{variant:"outline",size:"sm",icon:"send",onClick:()=>q(b.email),disabled:i,children:"Gửi lại"}):null,(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",icon:"close",onClick:()=>r(b.email),disabled:i,children:"Huỷ"})]})})]},`pending:${b.email}`))]})]})}):null]})}function I(){let a=(0,e.useRef)(null);return(0,d.jsxs)("div",{ref:a,className:E().page,children:[(0,d.jsx)(H,{}),(0,d.jsx)(A.default,{}),(0,d.jsx)(C.default,{}),(0,d.jsx)(B.default,{})]})}function J(){let{isAdmin:a}=(0,g.s)(),[b,c]=(0,e.useState)("oauth"),k=(0,e.useMemo)(()=>[{id:"oauth",label:"Personal OAuth",icon:"cloud_sync"},...a?[{id:"monitor",label:"OAuth Monitor",icon:"manage_accounts"}]:[],{id:"quota",label:"Personal Quota",icon:"data_usage"},...a?[{id:"admin-access",label:"Admin: OAuth Access",icon:"admin_panel_settings"}]:[],...a?[{id:"admin-accounts",label:"Admin: Account Allowlist",icon:"verified_user"}]:[]],[a]),l=k.some(a=>a.id===b)?b:"oauth";return(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)(h.A,{tabs:k,activeId:l,onChange:c}),"oauth"===l?(0,d.jsx)(I,{}):null,"monitor"===l&&a?(0,d.jsx)(i.default,{}):null,"quota"===l?(0,d.jsx)(e.Suspense,{fallback:(0,d.jsx)(f.CardSkeleton,{}),children:(0,d.jsx)(j.default,{})}):null,"admin-access"===l&&a?(0,d.jsx)(o,{}):null,"admin-accounts"===l&&a?(0,d.jsx)(z,{}):null]})}},38522:a=>{"use strict";a.exports=require("node:zlib")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41204:a=>{"use strict";a.exports=require("string_decoder")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{"use strict";a.exports=import("pg")},66136:a=>{"use strict";a.exports=require("timers")},69683:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(2116),f=c.n(e),g=c(49885),h=c.n(g),i=c(71404);function j({tabs:a,activeId:b,onChange:c,className:e=""}){return(0,d.jsx)("div",{className:(0,i.cn)("mb-5 overflow-x-auto border-b border-border",e),children:(0,d.jsx)("div",{className:"flex min-w-max items-center gap-1",children:a.map(a=>{let e=a.id===b,g=(0,i.cn)("inline-flex items-center gap-2 border-b-2 px-4 py-3 text-sm font-semibold transition-colors",e?"border-primary text-primary":"border-transparent text-text-muted hover:border-border-strong hover:text-text-main"),h=(0,d.jsxs)(d.Fragment,{children:[a.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:a.icon}):null,(0,d.jsx)("span",{children:a.label})]});return a.href?(0,d.jsx)(f(),{href:a.href,className:g,"aria-current":e?"page":void 0,children:h},a.id):(0,d.jsx)("button",{type:"button",onClick:()=>c?.(a.id),className:g,"aria-pressed":e,children:h},a.id)})})})}j.propTypes={tabs:h().arrayOf(h().shape({id:h().string.isRequired,label:h().string.isRequired,icon:h().string,href:h().string})).isRequired,activeId:h().string.isRequired,onChange:h().func,className:h().string}},73024:a=>{"use strict";a.exports=require("node:fs")},74075:a=>{"use strict";a.exports=require("zlib")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79428:a=>{"use strict";a.exports=require("buffer")},79748:a=>{"use strict";a.exports=require("fs/promises")},80099:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},91645:a=>{"use strict";a.exports=require("net")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,2430,8316,8946,402,5681,4404,5024,2428,1240,3738,7126,4298,6979],()=>b(b.s=36559));module.exports=c})();
1
+ (()=>{var a={};a.id=3674,a.ids=[3674],a.modules={1932:a=>{"use strict";a.exports=require("url")},2125:a=>{a.exports={page:"PersonalCloudProviderPage_page__WEiqp"}},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},8526:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"D:\\\\bluerouter\\\\src\\\\app\\\\(dashboard)\\\\dashboard\\\\personal\\\\page.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"D:\\bluerouter\\src\\app\\(dashboard)\\dashboard\\personal\\page.js","default")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19288:(a,b,c)=>{Promise.resolve().then(c.bind(c,37627))},19771:a=>{"use strict";a.exports=require("process")},21820:a=>{"use strict";a.exports=require("os")},25912:(a,b,c)=>{Promise.resolve().then(c.bind(c,8526))},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34631:a=>{"use strict";a.exports=require("tls")},36559:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>w,handler:()=>y,routeModule:()=>x});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,32059))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,30508))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),u={children:["",{children:["(dashboard)",{children:["dashboard",{children:["personal",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,8526))),"D:\\bluerouter\\src\\app\\(dashboard)\\dashboard\\personal\\page.js"]}]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"D:\\bluerouter\\src\\app\\(dashboard)\\layout.js"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"D:\\bluerouter\\src\\app\\layout.js"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,v=(0,e.H)({tree:u,page:"/(dashboard)/dashboard/personal/page",pathname:"/dashboard/personal",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),w=v.__next_app__,x=v.routeModule,y=v.handler},37627:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>L});var d=c(48249),e=c(67484),f=c(74812),g=c(20151),h=c(69683),i=c(66979),j=c(4298),k=c(50412),l=c(72738),m=c(17194);function n(a){return String(a||"").trim().toLowerCase()}function o(){let{isAdmin:a}=(0,g.s)(),[b,c]=(0,e.useState)([]),[f,h]=(0,e.useState)({}),[i,j]=(0,e.useState)({}),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)({}),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)({}),[w,x]=(0,e.useState)(3),[y,z]=(0,e.useState)("3"),[A,B]=(0,e.useState)(!0),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(!1),W=(0,e.useCallback)(a=>{h(a.permissions||{}),j(a.connectionsByUser||{}),"number"==typeof a.globalConnectionsPerProviderLimit&&a.globalConnectionsPerProviderLimit>0&&(x(a.globalConnectionsPerProviderLimit),z(String(a.globalConnectionsPerProviderLimit))),a.connectionsPerProviderLimitOverrides&&"object"==typeof a.connectionsPerProviderLimitOverrides&&v(a.connectionsPerProviderLimitOverrides)},[]),X=(0,e.useCallback)(async()=>{if(a){B(!0),J("");try{let[a,b]=await Promise.all([fetch("/api/personal-cloud-providers",{cache:"no-store"}),fetch("/api/personal-cloud-providers/permissions",{cache:"no-store"})]),d=await a.json().catch(()=>({})),e=await b.json().catch(()=>({}));if(!a.ok)throw Error(d.error||"Kh\xf4ng tải được personal OAuth providers");if(!b.ok)throw Error(e.error||"Kh\xf4ng tải được quyền OAuth");c(Array.isArray(d.providers)?d.providers:[]),W(e)}catch(a){J(a?.message||"Kh\xf4ng tải được cấu h\xecnh OAuth access")}finally{B(!1)}}},[W,a]),Y=(0,e.useRef)(0),Z=(0,e.useCallback)(async a=>{let b=a.trim();if(!b)return;let c=++Y.current;R(!0);try{let a=await fetch(`/api/personal-cloud-providers/permissions?search=${encodeURIComponent(b)}`,{cache:"no-store"}),d=await a.json().catch(()=>({}));if(c!==Y.current)return;if(!a.ok)throw Error(d.error||"Kh\xf4ng t\xecm được t\xe0i khoản");P(Array.isArray(d.accounts)?d.accounts:[]),T(!!d.accountsTruncated)}catch(a){if(c!==Y.current)return;P([]),J(a?.message||"Kh\xf4ng t\xecm được t\xe0i khoản")}finally{c===Y.current&&R(!1)}},[]),$=(0,e.useMemo)(()=>Array.from(new Set([...Object.keys(f||{}),...Object.keys(i||{})])).map(a=>{let c=f[a]||{},d=i[a]||{},e=b.filter(a=>c?.[a.id]===!0),g=b.some(a=>Number(d[a.id]||0)>0);return{userId:a,providerState:c,connectionsByProvider:d,enabledProviders:e,hasAnyConnection:g}}).filter(a=>a.enabledProviders.length>0||a.hasAnyConnection).sort((a,b)=>a.userId.localeCompare(b.userId)),[i,f,b]),_=null!==O,aa=(0,e.useMemo)(()=>_?O.map(a=>{let c=a.providerState||{},d=a.connectionsByProvider||{},e=b.filter(a=>c?.[a.id]===!0),f=b.some(a=>Number(d[a.id]||0)>0);return{userId:a.userId,displayName:a.displayName,email:a.email,providerState:c,connectionsByProvider:d,enabledProviders:e,hasAnyConnection:f}}).sort((a,b)=>a.userId.localeCompare(b.userId)):$,[_,O,$,b]),ab=(0,e.useMemo)(()=>{let a=0,c=0,d=0,e=new Map(b.map(a=>[a.id,{grantedUsers:0,connections:0}]));for(let f of $){for(let c of b){let b=Number(f.connectionsByProvider?.[c.id]||0);a+=b;let d=e.get(c.id);f.providerState?.[c.id]===!0?(d.grantedUsers+=1,d.connections+=b):b>0&&(d.connections+=b)}f.enabledProviders.length>0&&!f.hasAnyConnection&&(c+=1),0===f.enabledProviders.length&&f.hasAnyConnection&&(d+=1)}return{totalUsers:$.length,totalConnections:a,grantedNoConnection:c,connectionNoGrant:d,perProvider:b.map(a=>({provider:a,...e.get(a.id)}))}},[$,b]),ac=async()=>{let a,b=n(o);if(!b)return void J("Nhập username/email cần cấp quyền.");let c=String(s||"").trim();if(""===c)a=null;else{let b=Number.parseInt(c,10);if(!Number.isFinite(b)||b<=0)return void J("Per-user override phải l\xe0 số nguy\xean dương hoặc bỏ trống.");a=b}D(!0),J(""),L("");try{let c=await fetch("/api/personal-cloud-providers/permissions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:b,providers:q,connectionsPerProviderLimit:a})}),d=await c.json().catch(()=>({}));if(!c.ok)throw Error(d.error||"Kh\xf4ng lưu được quyền OAuth");W(d);let e=d.user?.id||b;p(e),L(`Đ\xe3 lưu quyền OAuth cho ${e}.`),V(!1),M.trim()&&Z(M)}catch(a){J(a?.message||"Kh\xf4ng lưu được quyền OAuth")}finally{D(!1)}},ad=async()=>{let a=Number.parseInt(y,10);if(!Number.isFinite(a)||a<=0)return void J("Global limit phải l\xe0 số nguy\xean dương.");F(!0),J(""),L("");try{let b=await fetch("/api/personal-cloud-providers/permissions",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({globalConnectionsPerProviderLimit:a})}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||"Kh\xf4ng lưu được global limit");W(c),L(`Đ\xe3 đặt global limit = ${a} account / provider / user.`)}catch(a){J(a?.message||"Kh\xf4ng lưu được global limit")}finally{F(!1)}},ae=async a=>{let b=n(a);if(b){D(!0),J(""),L("");try{let a=await fetch(`/api/personal-cloud-providers/permissions?userId=${encodeURIComponent(b)}`,{method:"DELETE"}),c=await a.json().catch(()=>({}));if(!a.ok)throw Error(c.error||"Kh\xf4ng thu hồi được quyền OAuth");W(c),n(o)===b&&p("");let d=c.disconnectSummary||{},e=Number(d.manualActionRequired)||0;L(`Đ\xe3 x\xf3a ${d.deletedCount||0} OAuth connection của ${b}; ${d.upstreamRevokedCount||0} token đ\xe3 revoke upstream.${e>0?` ${e} connection cần thu hồi thủ c\xf4ng tại provider.`:""}`),H(""),M.trim()&&Z(M)}catch(a){J(a?.message||"Kh\xf4ng thu hồi được quyền OAuth")}finally{D(!1)}}};if(!a)return null;let af=$.find(a=>a.userId===n(G)),ag=b.reduce((a,b)=>a+Number(af?.connectionsByProvider?.[b.id]||0),0);return(0,d.jsxs)("div",{className:"space-y-5",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/50 p-4",children:[(0,d.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:"Admin: OAuth provider access"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Quản l\xfd provider n\xe0o user được ph\xe9p d\xf9ng, giới hạn số account OAuth c\xe1 nh\xe2n v\xe0 thu hồi to\xe0n bộ quyền/token khi cần. C\xe1c thao t\xe1c trong tab n\xe0y chỉ d\xe0nh cho admin."})]}),(0,d.jsx)(m.default,{}),I?(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:I}):null,K?(0,d.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:K}):null,(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Access policy"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Default l\xe0 kh\xf4ng c\xf3 quyền. Tắt provider giữ nguy\xean connection/token để c\xf3 thể bật lại; Revoke all sẽ thử revoke upstream rồi x\xf3a connection/token local."})]}),(0,d.jsx)(k.$n,{variant:"outline",size:"sm",onClick:X,loading:A,icon:"refresh",children:"Refresh"})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium",children:"Global limit — số account OAuth c\xe1 nh\xe2n / provider / user thường"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"\xc1p dụng cho user kh\xf4ng c\xf3 per-user override. Admin kh\xf4ng bị chặn bởi limit n\xe0y."}),(0,d.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsx)(k.pd,{type:"number",min:1,value:y,onChange:a=>z(a.target.value),className:"sm:w-48"}),(0,d.jsx)(k.$n,{onClick:ad,loading:E,disabled:E||Number.parseInt(y,10)===w,children:"Lưu global"}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Đang lưu: ",w]})]})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Granted OAuth Access"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"T\xecm một t\xe0i khoản (username/email) để xem v\xe0 chỉnh quyền — kể cả t\xe0i khoản chưa được cấp quyền g\xec. Kh\xf4ng t\xecm kiếm th\xec hiển thị c\xe1c t\xe0i khoản đang c\xf3 quyền hoặc c\xf2n OAuth connection."})]}),A?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải quyền..."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"mb-4 grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Tổng user"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:ab.totalUsers})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Tổng OAuth connection"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:ab.totalConnections})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Cấp quyền, chưa connect"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:ab.grantedNoConnection})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"C\xf2n connection, đ\xe3 thu hồi quyền"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:ab.connectionNoGrant})]})]}),ab.perProvider.some(a=>a.grantedUsers>0||a.connections>0)?(0,d.jsxs)("div",{className:"mb-4 rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium text-text-main",children:"Breakdown theo provider"}),(0,d.jsx)("div",{className:"mt-3 space-y-2",children:ab.perProvider.map(({provider:a,grantedUsers:b,connections:c})=>(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 text-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(l.A,{src:`/providers/${a.id}.png`,alt:a.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:a.id.slice(0,2).toUpperCase(),fallbackColor:a.color||"#64748b"}),(0,d.jsx)("span",{className:"text-text-main",children:a.name})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[(0,d.jsxs)("span",{children:[b," user được cấp quyền"]}),(0,d.jsxs)("span",{children:[c," connection"]})]})]},a.id))})]}):null,(0,d.jsx)("div",{className:"mb-4",children:(0,d.jsx)(k.pd,{label:"T\xecm t\xe0i khoản",value:M,onChange:a=>N(a.target.value),placeholder:"Nhập username hoặc email, vd: anh-tct hoặc anh-tct@fujinet.net",hint:Q?"Đang t\xecm…":void 0})}),_&&Q&&0===aa.length?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang t\xecm t\xe0i khoản..."}):_&&0===aa.length?(0,d.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:['Kh\xf4ng t\xecm thấy t\xe0i khoản n\xe0o khớp với "',M.trim(),'".']}):_||0!==$.length?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),b.map(a=>(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:a.name},a.id)),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Limit / provider"}),(0,d.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border bg-background",children:aa.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsxs)("td",{className:"px-4 py-4",children:[(0,d.jsx)("div",{className:"break-all font-mono text-text-main",children:a.userId}),a.displayName||a.email?(0,d.jsx)("div",{className:"mt-0.5 text-xs text-text-muted",children:[a.displayName,a.email].filter(Boolean).join(" \xb7 ")}):null]}),b.map(b=>{let c=!0===a.providerState[b.id],e=Number(a.connectionsByProvider?.[b.id]||0);return(0,d.jsx)("td",{className:"px-4 py-4",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(k.Ex,{variant:c?"success":"default",size:"sm",children:c?"ON":"OFF"}),e>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-0.5",title:`User đ\xe3 add ${e} ${b.name} account`,children:[(0,d.jsx)(l.A,{src:`/providers/${b.id}.png`,alt:b.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:b.id.slice(0,2).toUpperCase(),fallbackColor:b.color||"#64748b"}),e>1?(0,d.jsxs)("span",{className:"text-[10px] font-semibold text-text-muted",children:["\xd7",e]}):null]}):null]})},b.id)}),(0,d.jsx)("td",{className:"px-4 py-4 text-xs",children:u[a.userId]>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,d.jsx)(k.Ex,{variant:"warning",size:"sm",children:"Override"}),(0,d.jsx)("span",{className:"font-mono",children:u[a.userId]})]}):(0,d.jsxs)("span",{className:"text-text-muted",children:["Global \xb7 ",w]})}),(0,d.jsx)("td",{className:"px-4 py-4",children:(0,d.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,d.jsx)(k.$n,{variant:"outline",size:"sm",onClick:()=>(a=>{let c=n(a);p(c);let d=f[c]||{},e={};for(let a of b)e[a.id]=!0===d[a.id];r(e),J(""),L(""),V(!0)})(a.userId),children:"Edit"}),a.enabledProviders.length>0||a.hasAnyConnection?(0,d.jsx)(k.$n,{variant:"danger",size:"sm",loading:C&&G===a.userId,onClick:()=>H(a.userId),children:"Revoke all & delete"}):null]})})]},a.userId))})]})}),_&&S?(0,d.jsxs)("p",{className:"mt-2 text-xs text-text-muted",children:["Chỉ hiển thị ",aa.length," kết quả đầu, thu hẹp từ kh\xf3a t\xecm kiếm để ch\xednh x\xe1c hơn."]}):null]}):(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 user n\xe0o được cấp quyền OAuth provider. D\xf9ng \xf4 t\xecm kiếm ở tr\xean để cấp quyền cho một t\xe0i khoản."})]})]})]}),G?(0,d.jsx)(k.aF,{isOpen:!0,onClose:()=>H(""),title:"Thu hồi to\xe0n bộ quyền OAuth",size:"lg",busy:C,closeOnOverlay:!C,footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{variant:"ghost",onClick:()=>H(""),disabled:C,children:"Hủy"}),(0,d.jsx)(k.$n,{variant:"danger",icon:"delete_forever",loading:C,onClick:()=>ae(G),children:"Thu hồi v\xe0 x\xf3a to\xe0n bộ"})]}),children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 p-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium text-red-700 dark:text-red-300",children:"H\xe0nh động nguy hiểm, kh\xf4ng thể ho\xe0n t\xe1c"}),(0,d.jsx)("div",{className:"mt-1 break-all text-lg font-semibold text-text-main",children:G}),(0,d.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:"To\xe0n bộ quyền OAuth provider v\xe0 connection/token local của user n\xe0y sẽ bị x\xf3a; gateway sẽ thử revoke upstream trước."})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-surface p-3 text-sm",children:[(0,d.jsx)("span",{className:"text-text-muted",children:"Connection t\xecm thấy"}),(0,d.jsx)(k.Ex,{variant:ag>0?"warning":"default",size:"sm",children:ag})]}),af?(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(a=>{let b=Number(af.connectionsByProvider?.[a.id]||0);return b>0?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-2.5 py-1 text-xs text-text-muted",children:[(0,d.jsx)(l.A,{src:`/providers/${a.id}.png`,alt:a.name,size:16,className:"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:a.id.slice(0,2).toUpperCase()}),a.name," \xd7",b]},a.id):null})}):null]})}):null,U?(0,d.jsx)(k.aF,{isOpen:!0,onClose:()=>V(!1),title:"Chỉnh quyền OAuth provider",size:"lg",busy:C,closeOnOverlay:!C,footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.$n,{variant:"ghost",onClick:()=>V(!1),disabled:C,children:"Hủy"}),(0,d.jsx)(k.$n,{onClick:ac,loading:C,icon:"save",children:"Save permissions"})]}),children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)(k.pd,{label:"User ID / Email",value:o,disabled:!0}),(0,d.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:b.map(a=>(0,d.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,d.jsx)(k.lM,{checked:!0===q[a.id],onChange:b=>r(c=>({...c,[a.id]:b})),label:a.name,description:q[a.id]?"User được ph\xe9p add account":"User chưa được cấp quyền"})},a.id))}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium",children:"Per-user override — account / provider"}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Ghi đ\xe8 global cho ",(0,d.jsx)("span",{className:"font-mono",children:n(o)||"user đang chọn"}),". Để trống để d\xf9ng global (",w,")."]}),(0,d.jsx)("div",{className:"mt-3 max-w-xs",children:(0,d.jsx)(k.pd,{type:"number",min:1,value:s,onChange:a=>t(a.target.value),placeholder:`Để trống = d\xf9ng global (${w})`})})]})]})}):null]})}let p="/api/settings/smtp",q=[{value:"starttls",label:"STARTTLS (587)"},{value:"ssl",label:"SSL/TLS (465)"},{value:"none",label:"Kh\xf4ng m\xe3 ho\xe1 (25)"}],r={starttls:"587",ssl:"465",none:"25"};function s(a={}){return{host:a.host||"",port:a.port?String(a.port):"587",security:a.security||"starttls",username:a.username||"",password:"",fromEmail:a.fromEmail||"",fromName:a.fromName||"BlueRouter",allowInvalidCert:!0===a.allowInvalidCert}}function t(a){return{...a,port:Number.parseInt(a.port,10)||void 0}}function u({defaultTestRecipient:a=""}){let[b,c]=(0,e.useState)(null),[f,g]=(0,e.useState)(s()),[h,i]=(0,e.useState)(a),[j,l]=(0,e.useState)(!0),[m,n]=(0,e.useState)(!1),[o,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(""),A=(0,e.useCallback)(a=>{c(a||null),g(s(a||{}))},[]),B=(0,e.useCallback)(async()=>{l(!0),x("");try{let a=await fetch(p,{cache:"no-store"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Kh\xf4ng tải được SMTP settings");A(b.smtp)}catch(a){x(a?.message||"Kh\xf4ng tải được SMTP settings")}finally{l(!1)}},[A]),C=a=>b=>g(c=>({...c,[a]:b.target.value})),D=async()=>{n(!0),x(""),z("");try{let a=await fetch(p,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t(f))}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Kh\xf4ng lưu được SMTP settings");A(b.smtp),z("Đ\xe3 lưu SMTP settings.")}catch(a){x(a?.message||"Kh\xf4ng lưu được SMTP settings")}finally{n(!1)}},E=async()=>{n(!0),x(""),z("");try{let a=await fetch(p,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t(f),password:"",clearPassword:!0})}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Kh\xf4ng xo\xe1 được password");A(b.smtp),z("Đ\xe3 xo\xe1 SMTP password.")}catch(a){x(a?.message||"Kh\xf4ng xo\xe1 được password")}finally{n(!1)}},F=async()=>{v(!0),x(""),z("");try{let a=await fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:h.trim(),settings:t(f)})}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Gửi mail test thất bại");z(`Đ\xe3 gửi mail test tới ${h.trim()}.${b.response?` Server: ${b.response}`:""}`)}catch(a){x(a?.message||"Gửi mail test thất bại")}finally{v(!1)}};return(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"SMTP settings"}),b?(0,d.jsx)(k.Ex,{variant:b.configured?"success":"warning",size:"sm",children:b.configured?"Đ\xe3 cấu h\xecnh":"Chưa cấu h\xecnh"}):null]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"D\xf9ng để gửi email x\xe1c thực khi user add account ngo\xe0i domain được ph\xe9p. Password được m\xe3 ho\xe1 khi lưu."})]}),(0,d.jsx)(k.$n,{variant:"outline",size:"sm",onClick:B,loading:j,icon:"refresh",children:"Refresh"})]}),w?(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:w}):null,y?(0,d.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:y}):null,j?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải SMTP settings..."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)]",children:[(0,d.jsx)(k.pd,{label:"SMTP host",value:f.host,onChange:C("host"),placeholder:"vd: smtp.fujinet.net"}),(0,d.jsx)(k.l6,{label:"Bảo mật",value:f.security,onChange:a=>{let b=a.target.value;g(a=>({...a,security:b,port:Object.values(r).includes(a.port)?r[b]:a.port}))},options:q}),(0,d.jsx)(k.pd,{label:"Port",type:"number",min:1,max:65535,value:f.port,onChange:C("port")})]}),(0,d.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,d.jsx)(k.pd,{label:"Username",value:f.username,onChange:C("username"),placeholder:"Để trống nếu SMTP kh\xf4ng cần auth",autoComplete:"off"}),(0,d.jsx)(k.pd,{label:"Password",type:"password",value:f.password,onChange:C("password"),placeholder:b?.hasPassword?"•••••••• (đ\xe3 lưu — để trống để giữ nguy\xean)":"Nhập password",autoComplete:"new-password",hint:b?.hasPassword?"Đ\xe3 c\xf3 password được lưu.":void 0})]}),(0,d.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,d.jsx)(k.pd,{label:"From email",value:f.fromEmail,onChange:C("fromEmail"),placeholder:"vd: bluerouter@fujinet.net"}),(0,d.jsx)(k.pd,{label:"From name",value:f.fromName,onChange:C("fromName"),placeholder:"BlueRouter"})]}),(0,d.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,d.jsx)(k.lM,{checked:f.allowInvalidCert,onChange:a=>g(b=>({...b,allowInvalidCert:a})),label:"Bỏ qua kiểm tra chứng chỉ TLS",description:"Chỉ bật khi SMTP nội bộ d\xf9ng chứng chỉ self-signed."})}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(k.$n,{onClick:D,loading:m,disabled:m||o,icon:"save",children:"Lưu SMTP"}),b?.hasPassword?(0,d.jsx)(k.$n,{variant:"ghost",onClick:E,disabled:m||o,icon:"key_off",children:"Xo\xe1 password"}):null]}),(0,d.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,d.jsx)("div",{className:"text-sm font-medium text-text-main",children:"Gửi mail test"}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Test với th\xf4ng tin đang nhập ở tr\xean (chưa cần lưu)."}),(0,d.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsx)(k.pd,{value:h,onChange:a=>i(a.target.value),onKeyDown:a=>{"Enter"===a.key&&h.trim()&&F()},placeholder:"Email nhận test",className:"sm:w-96"}),(0,d.jsx)(k.$n,{variant:"outline",onClick:F,loading:o,disabled:o||m||!h.trim()||!f.host.trim(),icon:"send",children:"Gửi test"})]})]})]})]})}let v="/api/personal-cloud-providers/account-policy",w={domain:"Domain",email:"Allowlist","not-enforced":"Kh\xf4ng \xe1p dụng",disabled:"Policy tắt","missing-email":"Thiếu email","github-account":"GitHub allowlist","missing-identity":"Thiếu GitHub id","not-listed":"Chưa được ph\xe9p"};function x(a){return String(a||"").split(/[\s,;]+/).map(a=>a.trim().toLowerCase()).filter(Boolean)}function y(a){return`${a.email}|${a.ownerUser||""}`}function z(a){return`${a.githubUserId}|${a.ownerUser||""}`}function A(a){if(!a)return"";let b=new Date(a);return Number.isNaN(b.getTime())?"":b.toLocaleString("vi-VN")}function B(){let{isAdmin:a}=(0,g.s)(),[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)([]),[i,j]=(0,e.useState)([]),[m,n]=(0,e.useState)(0),[o,p]=(0,e.useState)(!0),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(""),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(""),[R,S]=(0,e.useState)(""),[T,U]=(0,e.useState)(!1),V=(0,e.useCallback)(a=>{c(a.policy||null),h(Array.isArray(a.providers)?a.providers:[]),j(Array.isArray(a.connections)?a.connections:[]),n(Number(a.pendingImportCount)||0)},[]),W=(0,e.useCallback)(async()=>{if(a){p(!0),t("");try{let a=await fetch(v,{cache:"no-store"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Kh\xf4ng tải được account policy");V(b)}catch(a){t(a?.message||"Kh\xf4ng tải được account policy")}finally{p(!1)}}},[V,a]),X=async(a,b,c)=>{r(!0),t(""),C("");try{let d=await fetch(v,{method:a,headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),e=await d.json().catch(()=>({}));if(!d.ok)throw Error(e.error||"Kh\xf4ng lưu được account policy");return V(e),C("function"==typeof c?c(e):c),!0}catch(a){return t(a?.message||"Kh\xf4ng lưu được account policy"),!1}finally{r(!1)}},Y=(a,c)=>X("PUT",{enabled:b.enabled,allowedDomains:b.allowedDomains,allowedEmails:b.allowedEmails,allowedGithubAccounts:b.allowedGithubAccounts||[],enforcedProviders:Object.fromEntries(f.map(a=>[a.id,a.enforced])),...a},c),Z=async()=>{let a=x(D).map(a=>a.replace(/^@+/,"")),c=a.filter(a=>!b.allowedDomains.includes(a));0===c.length?t(a.length?"Domain đ\xe3 c\xf3 trong danh s\xe1ch.":"Nhập domain cần th\xeam, vd: fujinet.net"):await Y({allowedDomains:[...b.allowedDomains,...c]},`Đ\xe3 th\xeam domain: ${c.join(", ")}.`)&&E("")},$=async()=>{let a=x(F),c=J.trim().toLowerCase(),d=new Set(b.allowedEmails.map(y)),e=Array.from(new Set(a)).filter(a=>!d.has(y({email:a,ownerUser:c})));if(0===e.length)return void t(a.length?"Email đ\xe3 c\xf3 trong danh s\xe1ch.":"Nhập email cần cho ph\xe9p.");let f=H.trim();await Y({allowedEmails:[...b.allowedEmails,...e.map(a=>({email:a,note:f,ownerUser:c}))]},`Đ\xe3 cho ph\xe9p ${e.length} email${c?` cho user ${c}`:" cho mọi user"}.`)&&(G(""),I(""),K(""))},_=async()=>{let a=Array.from(new Set(x(L).map(a=>a.replace(/^@+/,""))));if(0===a.length)return void t("Nhập GitHub login hoặc id cần cho ph\xe9p.");let c=N.trim().toLowerCase(),d=P.trim();await Y({allowedGithubAccounts:[...b.allowedGithubAccounts||[],...a.map(a=>({login:a,ownerUser:c,note:d}))]},`Đ\xe3 cho ph\xe9p ${a.length} GitHub account${c?` cho user ${c}`:" cho mọi user"}.`)&&(M(""),O(""),Q(""))},aa=(0,e.useMemo)(()=>{let a=R.trim().toLowerCase(),c=b?.allowedEmails||[];return a?c.filter(b=>[b.email,b.note,b.addedBy,b.ownerUser].some(b=>String(b||"").toLowerCase().includes(a))):c},[R,b]),ab=(0,e.useMemo)(()=>i.filter(a=>!a.allowed),[i]),ac=T?i:ab,ad=(0,e.useMemo)(()=>new Map(f.map(a=>[a.id,a])),[f]);if(!a)return null;let ae=(a,b=16)=>{let c=ad.get(a)||{id:a,name:a};return(0,d.jsx)(l.A,{src:`/providers/${c.id}.png`,alt:c.name,size:b,className:b>16?"max-h-[20px] max-w-[20px] rounded object-contain":"max-h-[16px] max-w-[16px] rounded object-contain",fallbackText:String(c.id).slice(0,2).toUpperCase(),fallbackColor:c.color||"#64748b"})};return(0,d.jsxs)("div",{className:"space-y-5",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/50 p-4",children:[(0,d.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:"Admin: Account allowlist"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Giới hạn account upstream n\xe0o được add v\xe0o Personal OAuth. Account c\xf3 email thuộc domain được ph\xe9p lu\xf4n được add (khi user đ\xe3 được cấp quyền provider); account kh\xe1c phải c\xf3 trong danh s\xe1ch email do admin thiết lập."})]}),s?(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:s}):null,B?(0,d.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:B}):null,o||!b?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Đang tải account policy..."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Account policy"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"\xc1p dụng khi user add account mới hoặc reauth. Connection đang chạy kh\xf4ng bị ngắt khi đổi policy."})]}),(0,d.jsx)(k.$n,{variant:"outline",size:"sm",onClick:W,loading:o,icon:"refresh",children:"Refresh"})]}),(0,d.jsx)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:(0,d.jsx)(k.lM,{checked:b.enabled,disabled:q,onChange:a=>Y({enabled:a},a?"Đ\xe3 bật account policy.":"Đ\xe3 tắt account policy — mọi account đều được add."),label:"Bật kiểm tra account email",description:b.enabled?"Chỉ domain / email được ph\xe9p mới add được":"Đang tắt: mọi account đều được add"})}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4",children:[(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Domain được ph\xe9p"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:b.allowedDomains.length})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Email / GitHub ngoại lệ"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:b.allowedEmails.length+(b.allowedGithubAccounts||[]).length})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Connection hiện c\xf3"}),(0,d.jsx)("div",{className:"mt-1 text-2xl font-bold text-text-main",children:i.length})]}),(0,d.jsxs)("div",{className:"rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"text-xs font-semibold uppercase text-text-muted",children:"Sẽ bị chặn khi reauth"}),(0,d.jsx)("div",{className:`mt-1 text-2xl font-bold ${ab.length>0?"text-red-600 dark:text-red-400":"text-text-main"}`,children:ab.length})]})]})]}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Domain được ph\xe9p"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Account c\xf3 email thuộc c\xe1c domain n\xe0y lu\xf4n được add. Chỉ khớp ch\xednh x\xe1c domain (kh\xf4ng gồm subdomain)."})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-2",children:0===b.allowedDomains.length?(0,d.jsx)("span",{className:"text-sm text-text-muted",children:"Chưa c\xf3 domain n\xe0o — mọi account đều phải nằm trong danh s\xe1ch email."}):b.allowedDomains.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-background px-3 py-1 text-sm text-text-main",children:[(0,d.jsxs)("span",{className:"font-mono",children:["@",a]}),(0,d.jsx)("button",{type:"button",className:"material-symbols-outlined text-[16px] text-text-muted hover:text-red-500 disabled:opacity-50",onClick:()=>Y({allowedDomains:b.allowedDomains.filter(b=>b!==a)},`Đ\xe3 x\xf3a domain ${a}.`),disabled:q,"aria-label":`X\xf3a domain ${a}`,title:"X\xf3a domain",children:"close"})]},a))}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsx)(k.pd,{label:"Th\xeam domain",value:D,onChange:a=>E(a.target.value),onKeyDown:a=>{"Enter"===a.key&&Z()},placeholder:"vd: fujinet.net, partner.com",className:"sm:w-96"}),(0,d.jsx)(k.$n,{onClick:Z,loading:q,disabled:q||!D.trim(),icon:"add",children:"Th\xeam"})]})]}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Provider \xe1p dụng"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Provider tắt ở đ\xe2y sẽ kh\xf4ng kiểm tra. Kiro lấy email qua API usage của Kiro. GitHub kh\xf4ng trả email n\xean được kiểm tra theo danh s\xe1ch GitHub account b\xean dưới, mặc định tắt."})]}),(0,d.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:f.map(a=>(0,d.jsxs)("div",{className:"flex items-start gap-3 rounded-2xl border border-border bg-surface p-4",children:[(0,d.jsx)("div",{className:"pt-0.5",children:ae(a.id,20)}),(0,d.jsx)(k.lM,{checked:a.enforced,disabled:q||!b.enabled,onChange:b=>{let c;return c=a.id,Y({enforcedProviders:Object.fromEntries(f.map(a=>[a.id,a.id===c?b:a.enforced]))},`${b?"Đ\xe3 \xe1p dụng":"Đ\xe3 bỏ \xe1p dụng"} policy cho ${f.find(a=>a.id===c)?.name||c}.`)},label:a.name,description:a.enforced?"Kiểm tra domain / email":"Kh\xf4ng kiểm tra"})]},a.id))})]}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Email được ph\xe9p (ngoại lệ)"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Account ngo\xe0i domain được ph\xe9p phải c\xf3 trong danh s\xe1ch n\xe0y. Email gắn với một user chỉ user đ\xf3 được add; để trống User để cho mọi user. User cũng c\xf3 thể tự th\xeam email của m\xecnh bằng c\xe1ch x\xe1c thực qua mail."})]}),(0,d.jsxs)(k.$n,{variant:"outline",size:"sm",icon:"download",onClick:()=>X("POST",{action:"import-existing"},a=>a.importedCount>0?`Đ\xe3 import ${a.importedCount} email từ connection hiện c\xf3.`:"Kh\xf4ng c\xf3 email mới cần import."),loading:q,disabled:q,children:["Import từ connection hiện c\xf3",m>0?` (${m})`:""]})]}),(0,d.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)_auto] md:items-end",children:[(0,d.jsx)(k.pd,{label:"Email",value:F,onChange:a=>G(a.target.value),onKeyDown:a=>{"Enter"===a.key&&$()},placeholder:"vd: someone@gmail.com, other@partner.com"}),(0,d.jsx)(k.pd,{label:"Chỉ cho user (tuỳ chọn)",value:J,onChange:a=>K(a.target.value),onKeyDown:a=>{"Enter"===a.key&&$()},placeholder:"vd: anh-tct — trống = mọi user"}),(0,d.jsx)(k.pd,{label:"Ghi ch\xfa",value:H,onChange:a=>I(a.target.value),onKeyDown:a=>{"Enter"===a.key&&$()},placeholder:"vd: account c\xe1 nh\xe2n của anh-tct"}),(0,d.jsx)(k.$n,{onClick:$,loading:q,disabled:q||!F.trim(),icon:"person_add",children:"Cho ph\xe9p"})]}),b.allowedEmails.length>0?(0,d.jsx)(k.pd,{value:R,onChange:a=>S(a.target.value),placeholder:"Lọc theo email, ghi ch\xfa, người th\xeam..."}):null,0===b.allowedEmails.length?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 email ngoại lệ n\xe0o."}):0===aa.length?(0,d.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:['Kh\xf4ng c\xf3 email n\xe0o khớp với "',R.trim(),'".']}):(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Email"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Ghi ch\xfa"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Th\xeam bởi"}),(0,d.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border bg-background",children:aa.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsxs)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:[a.email,a.verifiedAt?(0,d.jsx)(k.Ex,{variant:"success",size:"sm",className:"ml-2",children:"Verified"}):null]}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs",children:a.ownerUser?(0,d.jsx)("span",{className:"font-mono text-text-main",children:a.ownerUser}):(0,d.jsx)(k.Ex,{variant:"info",size:"sm",children:"Mọi user"})}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs text-text-muted",children:a.note||"—"}),(0,d.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,d.jsx)("div",{children:a.addedBy||"—"}),a.addedAt?(0,d.jsx)("div",{className:"mt-0.5",children:A(a.addedAt)}):null]}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("div",{className:"flex justify-end",children:(0,d.jsx)(k.$n,{variant:"outline",size:"sm",icon:"delete",onClick:()=>Y({allowedEmails:b.allowedEmails.filter(b=>y(b)!==y(a))},`Đ\xe3 x\xf3a ${a.email}${a.ownerUser?` (${a.ownerUser})`:""} khỏi danh s\xe1ch.`),disabled:q,children:"X\xf3a"})})})]},y(a)))})]})})]}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"GitHub account được ph\xe9p"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"GitHub Copilot kh\xf4ng cho đọc email n\xean account GitHub được so theo id (kh\xf4ng đổi kể cả khi user đổi t\xean). Chỉ c\xf3 hiệu lực khi GitHub được bật ở mục Provider \xe1p dụng. Nhập login hoặc id, c\xe1ch nhau bởi dấu phẩy."})]}),(0,d.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)_auto] md:items-end",children:[(0,d.jsx)(k.pd,{label:"GitHub login / id",value:L,onChange:a=>M(a.target.value),onKeyDown:a=>{"Enter"===a.key&&_()},placeholder:"vd: octocat, 34310938"}),(0,d.jsx)(k.pd,{label:"Chỉ cho user (tuỳ chọn)",value:N,onChange:a=>O(a.target.value),onKeyDown:a=>{"Enter"===a.key&&_()},placeholder:"trống = mọi user"}),(0,d.jsx)(k.pd,{label:"Ghi ch\xfa",value:P,onChange:a=>Q(a.target.value),onKeyDown:a=>{"Enter"===a.key&&_()},placeholder:"tuỳ chọn"}),(0,d.jsx)(k.$n,{onClick:_,loading:q,disabled:q||!L.trim(),icon:"person_add",children:"Cho ph\xe9p"})]}),0===(b.allowedGithubAccounts||[]).length?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:"Chưa c\xf3 GitHub account n\xe0o."}):(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"GitHub account"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Ghi ch\xfa"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Th\xeam bởi"}),(0,d.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border bg-background",children:b.allowedGithubAccounts.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsxs)("td",{className:"px-4 py-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[ae("github"),(0,d.jsx)("span",{className:"font-mono text-text-main",children:a.login||"—"})]}),(0,d.jsxs)("div",{className:"mt-0.5 font-mono text-xs text-text-muted",children:["id ",a.githubUserId]})]}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs",children:a.ownerUser?(0,d.jsx)("span",{className:"font-mono text-text-main",children:a.ownerUser}):(0,d.jsx)(k.Ex,{variant:"info",size:"sm",children:"Mọi user"})}),(0,d.jsx)("td",{className:"px-4 py-3 text-xs text-text-muted",children:a.note||"—"}),(0,d.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,d.jsx)("div",{children:a.addedBy||"—"}),a.addedAt?(0,d.jsx)("div",{className:"mt-0.5",children:A(a.addedAt)}):null]}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("div",{className:"flex justify-end",children:(0,d.jsx)(k.$n,{variant:"outline",size:"sm",icon:"delete",onClick:()=>Y({allowedGithubAccounts:(b.allowedGithubAccounts||[]).filter(b=>z(b)!==z(a))},`Đ\xe3 x\xf3a GitHub account ${a.login||a.githubUserId} khỏi danh s\xe1ch.`),disabled:q,children:"X\xf3a"})})})]},z(a)))})]})})]}),(0,d.jsx)(u,{}),(0,d.jsxs)(k.Zp,{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Kiểm tra connection hiện c\xf3"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Kết quả nếu c\xe1c personal connection hiện c\xf3 được add / reauth lại với policy hiện tại."})]}),(0,d.jsx)(k.lM,{size:"sm",checked:T,onChange:U,label:"Hiện tất cả"})]}),0===ac.length?(0,d.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-6 text-center text-sm text-text-muted",children:T?"Chưa c\xf3 personal connection n\xe0o.":"Kh\xf4ng c\xf3 connection n\xe0o bị chặn bởi policy hiện tại."}):(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"User"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Provider"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Account"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Kết quả"})]})}),(0,d.jsx)("tbody",{className:"divide-y divide-border bg-background",children:ac.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:a.ownerUser||"—"}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[ae(a.provider),(0,d.jsx)("span",{className:"text-text-main",children:ad.get(a.provider)?.name||a.provider}),a.isActive?null:(0,d.jsx)(k.Ex,{size:"sm",children:"Inactive"})]})}),(0,d.jsx)("td",{className:"px-4 py-3 break-all font-mono text-xs text-text-muted",children:a.email||(a.githubLogin?`github: ${a.githubLogin}`:"—")}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)(k.Ex,{variant:a.allowed?"success":"error",size:"sm",children:w[a.reason]||a.reason})})]},a.id))})]})})]})]})]})}var C=c(8385),D=c(26941),E=c(38825),F=c(2125),G=c.n(F);let H="/api/personal-cloud-providers/account-emails";function I(a){if(!a)return"";let b=new Date(a);return Number.isNaN(b.getTime())?"":b.toLocaleString("vi-VN")}function J(){let[a,b]=(0,e.useState)(null),[c,f]=(0,e.useState)(""),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(!1),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)("");(0,e.useCallback)(async()=>{h(!0);try{let a=await fetch(H,{cache:"no-store"}),c=await a.json().catch(()=>({}));if(!a.ok)throw Error(c.error||"Kh\xf4ng tải được danh s\xe1ch email");b(c)}catch(a){m(a?.message||"Kh\xf4ng tải được danh s\xe1ch email")}finally{h(!1)}},[]);let p=async(a,{query:c="",body:d}={},e)=>{j(!0),m(""),o("");try{let f=await fetch(`${H}${c}`,{method:a,headers:d?{"Content-Type":"application/json"}:void 0,body:d?JSON.stringify(d):void 0}),g=await f.json().catch(()=>({}));if(!f.ok)throw Error(g.error||"Thao t\xe1c thất bại");return b(g),o(e),!0}catch(a){return m(a?.message||"Thao t\xe1c thất bại"),!1}finally{j(!1)}},q=async a=>{let b=String(a||"").trim().toLowerCase();!b||await p("POST",{body:{email:b}},`Đ\xe3 gửi email x\xe1c thực tới ${b}. Mở hộp thư v\xe0 bấm link để ho\xe0n tất.`)&&b===c.trim().toLowerCase()&&f("")},r=a=>p("DELETE",{query:`?email=${encodeURIComponent(a)}`},`Đ\xe3 xo\xe1 ${a}.`);if(g&&!a||!a||!a.policyEnabled)return null;let s=a.allowedDomains||[],t=a.verified||[],u=a.pending||[];return(0,d.jsxs)(k.Zp,{className:"mb-5 space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Email account ngo\xe0i domain"}),(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:[s.length>0?(0,d.jsxs)(d.Fragment,{children:["Account c\xf3 email ",(0,d.jsx)("span",{className:"font-mono",children:s.map(a=>`@${a}`).join(", ")})," được add trực tiếp. "]}):null,"Account d\xf9ng email kh\xe1c (vd: Gmail) cần x\xe1c thực qua mail trước khi add v\xe0o Personal OAuth. Email đ\xe3 x\xe1c thực chỉ \xe1p dụng cho t\xe0i khoản của bạn."]})]}),l?(0,d.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-700 dark:text-red-300",children:l}):null,n?(0,d.jsx)("div",{className:"rounded-xl border border-green-500/30 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300",children:n}):null,a.smtpConfigured?(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsx)(k.pd,{label:"Email account cần add",value:c,onChange:a=>f(a.target.value),onKeyDown:a=>{"Enter"===a.key&&q(c)},placeholder:"vd: yourname@gmail.com",className:"sm:w-96"}),(0,d.jsx)(k.$n,{onClick:()=>q(c),loading:i,disabled:i||!c.trim(),icon:"mark_email_unread",children:"Gửi email x\xe1c thực"})]}):(0,d.jsx)("div",{className:"rounded-xl border border-yellow-500/30 bg-yellow-500/10 px-4 py-3 text-sm text-yellow-800 dark:text-yellow-300",children:"Hệ thống chưa cấu h\xecnh gửi mail. Li\xean hệ admin để được th\xeam email v\xe0o danh s\xe1ch cho ph\xe9p."}),t.length>0||u.length>0?(0,d.jsx)("div",{className:"overflow-x-auto rounded-2xl border border-border",children:(0,d.jsxs)("table",{className:"min-w-full divide-y divide-border text-sm",children:[(0,d.jsx)("thead",{className:"bg-surface/80 text-left text-xs uppercase tracking-wide text-text-muted",children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Email"}),(0,d.jsx)("th",{className:"px-4 py-3 font-medium",children:"Trạng th\xe1i"}),(0,d.jsx)("th",{className:"px-4 py-3 text-right font-medium",children:"Actions"})]})}),(0,d.jsxs)("tbody",{className:"divide-y divide-border bg-background",children:[t.map(a=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:a.email}),(0,d.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,d.jsx)(k.Ex,{variant:"success",size:"sm",children:"Đ\xe3 cho ph\xe9p"}),(0,d.jsx)("span",{className:"ml-2",children:I(a.verifiedAt||a.addedAt)})]}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsx)("div",{className:"flex justify-end",children:(0,d.jsx)(k.$n,{variant:"outline",size:"sm",icon:"delete",onClick:()=>r(a.email),disabled:i,children:"Xo\xe1"})})})]},`verified:${a.email}`)),u.filter(a=>!t.some(b=>b.email===a.email)).map(b=>(0,d.jsxs)("tr",{className:"hover:bg-surface/50",children:[(0,d.jsx)("td",{className:"px-4 py-3 break-all font-mono text-text-main",children:b.email}),(0,d.jsxs)("td",{className:"px-4 py-3 text-xs text-text-muted",children:[(0,d.jsx)(k.Ex,{variant:"warning",size:"sm",children:"Chờ x\xe1c thực"}),(0,d.jsxs)("span",{className:"ml-2",children:["hết hạn ",I(b.expiresAt)]})]}),(0,d.jsx)("td",{className:"px-4 py-3",children:(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[a.smtpConfigured?(0,d.jsx)(k.$n,{variant:"outline",size:"sm",icon:"send",onClick:()=>q(b.email),disabled:i,children:"Gửi lại"}):null,(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",icon:"close",onClick:()=>r(b.email),disabled:i,children:"Huỷ"})]})})]},`pending:${b.email}`))]})]})}):null]})}function K(){let a=(0,e.useRef)(null);return(0,d.jsxs)("div",{ref:a,className:G().page,children:[(0,d.jsx)(J,{}),(0,d.jsx)(C.default,{}),(0,d.jsx)(E.default,{}),(0,d.jsx)(D.default,{})]})}function L(){let{isAdmin:a}=(0,g.s)(),[b,c]=(0,e.useState)("oauth"),k=(0,e.useMemo)(()=>[{id:"oauth",label:"Personal OAuth",icon:"cloud_sync"},...a?[{id:"monitor",label:"OAuth Monitor",icon:"manage_accounts"}]:[],{id:"quota",label:"Personal Quota",icon:"data_usage"},...a?[{id:"admin-access",label:"Admin: OAuth Access",icon:"admin_panel_settings"}]:[],...a?[{id:"admin-accounts",label:"Admin: Account Allowlist",icon:"verified_user"}]:[]],[a]),l=k.some(a=>a.id===b)?b:"oauth";return(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)(h.A,{tabs:k,activeId:l,onChange:c}),"oauth"===l?(0,d.jsx)(K,{}):null,"monitor"===l&&a?(0,d.jsx)(i.default,{}):null,"quota"===l?(0,d.jsx)(e.Suspense,{fallback:(0,d.jsx)(f.CardSkeleton,{}),children:(0,d.jsx)(j.default,{})}):null,"admin-access"===l&&a?(0,d.jsx)(o,{}):null,"admin-accounts"===l&&a?(0,d.jsx)(B,{}):null]})}},38522:a=>{"use strict";a.exports=require("node:zlib")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41204:a=>{"use strict";a.exports=require("string_decoder")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{"use strict";a.exports=import("pg")},66136:a=>{"use strict";a.exports=require("timers")},69683:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(2116),f=c.n(e),g=c(49885),h=c.n(g),i=c(71404);function j({tabs:a,activeId:b,onChange:c,className:e=""}){return(0,d.jsx)("div",{className:(0,i.cn)("mb-5 overflow-x-auto border-b border-border",e),children:(0,d.jsx)("div",{className:"flex min-w-max items-center gap-1",children:a.map(a=>{let e=a.id===b,g=(0,i.cn)("inline-flex items-center gap-2 border-b-2 px-4 py-3 text-sm font-semibold transition-colors",e?"border-primary text-primary":"border-transparent text-text-muted hover:border-border-strong hover:text-text-main"),h=(0,d.jsxs)(d.Fragment,{children:[a.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:a.icon}):null,(0,d.jsx)("span",{children:a.label})]});return a.href?(0,d.jsx)(f(),{href:a.href,className:g,"aria-current":e?"page":void 0,children:h},a.id):(0,d.jsx)("button",{type:"button",onClick:()=>c?.(a.id),className:g,"aria-pressed":e,children:h},a.id)})})})}j.propTypes={tabs:h().arrayOf(h().shape({id:h().string.isRequired,label:h().string.isRequired,icon:h().string,href:h().string})).isRequired,activeId:h().string.isRequired,onChange:h().func,className:h().string}},73024:a=>{"use strict";a.exports=require("node:fs")},74075:a=>{"use strict";a.exports=require("zlib")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79428:a=>{"use strict";a.exports=require("buffer")},79748:a=>{"use strict";a.exports=require("fs/promises")},80099:a=>{"use strict";a.exports=require("node:sqlite")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},91645:a=>{"use strict";a.exports=require("net")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,2430,8316,8946,402,5681,4404,5024,2428,1240,3738,7126,4298,6979],()=>b(b.s=36559));module.exports=c})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../../node_modules/@swc/helpers/esm/_interop_require_default.js","../../../../../../node_modules/@swc/helpers/package.json","../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../node_modules/better-sqlite3/package.json","../../../../../../node_modules/bindings/bindings.js","../../../../../../node_modules/bindings/package.json","../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../../node_modules/next/dist/client/lib/console.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../node_modules/next/dist/server/app-render/blocking-route-messages.js","../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../../node_modules/next/dist/server/app-render/sync-io-messages.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../../node_modules/next/dist/server/node-environment.js","../../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../../node_modules/next/dist/server/require-hook.js","../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../node_modules/next/dist/shared/lib/instant-messages.js","../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../node_modules/next/package.json","../../../../../../node_modules/pg-cloudflare/dist/empty.js","../../../../../../node_modules/pg-cloudflare/dist/index.js","../../../../../../node_modules/pg-cloudflare/package.json","../../../../../../node_modules/pg-connection-string/index.js","../../../../../../node_modules/pg-connection-string/package.json","../../../../../../node_modules/pg-int8/index.js","../../../../../../node_modules/pg-int8/package.json","../../../../../../node_modules/pg-pool/index.js","../../../../../../node_modules/pg-pool/package.json","../../../../../../node_modules/pg-protocol/dist/buffer-reader.js","../../../../../../node_modules/pg-protocol/dist/buffer-writer.js","../../../../../../node_modules/pg-protocol/dist/index.js","../../../../../../node_modules/pg-protocol/dist/messages.js","../../../../../../node_modules/pg-protocol/dist/parser.js","../../../../../../node_modules/pg-protocol/dist/serializer.js","../../../../../../node_modules/pg-protocol/package.json","../../../../../../node_modules/pg-types/index.js","../../../../../../node_modules/pg-types/lib/arrayParser.js","../../../../../../node_modules/pg-types/lib/binaryParsers.js","../../../../../../node_modules/pg-types/lib/builtins.js","../../../../../../node_modules/pg-types/lib/textParsers.js","../../../../../../node_modules/pg-types/package.json","../../../../../../node_modules/pg/esm/index.mjs","../../../../../../node_modules/pg/lib/client.js","../../../../../../node_modules/pg/lib/connection-parameters.js","../../../../../../node_modules/pg/lib/connection.js","../../../../../../node_modules/pg/lib/crypto/cert-signatures.js","../../../../../../node_modules/pg/lib/crypto/sasl.js","../../../../../../node_modules/pg/lib/crypto/utils.js","../../../../../../node_modules/pg/lib/defaults.js","../../../../../../node_modules/pg/lib/index.js","../../../../../../node_modules/pg/lib/native/client.js","../../../../../../node_modules/pg/lib/native/index.js","../../../../../../node_modules/pg/lib/native/query.js","../../../../../../node_modules/pg/lib/query.js","../../../../../../node_modules/pg/lib/result.js","../../../../../../node_modules/pg/lib/stream.js","../../../../../../node_modules/pg/lib/type-overrides.js","../../../../../../node_modules/pg/lib/utils.js","../../../../../../node_modules/pg/package.json","../../../../../../node_modules/pgpass/lib/helper.js","../../../../../../node_modules/pgpass/lib/index.js","../../../../../../node_modules/pgpass/package.json","../../../../../../node_modules/postgres-array/index.js","../../../../../../node_modules/postgres-array/package.json","../../../../../../node_modules/postgres-bytea/index.js","../../../../../../node_modules/postgres-bytea/package.json","../../../../../../node_modules/postgres-date/index.js","../../../../../../node_modules/postgres-date/package.json","../../../../../../node_modules/postgres-interval/index.js","../../../../../../node_modules/postgres-interval/package.json","../../../../../../node_modules/react/cjs/react.development.js","../../../../../../node_modules/react/cjs/react.production.js","../../../../../../node_modules/react/index.js","../../../../../../node_modules/react/package.json","../../../../../../node_modules/split2/index.js","../../../../../../node_modules/split2/package.json","../../../../../../node_modules/sql.js/dist/sql-wasm.js","../../../../../../node_modules/sql.js/package.json","../../../../../../node_modules/xtend/mutable.js","../../../../../../node_modules/xtend/package.json","../../../../../../package.json","../../../../../package.json","../../../../chunks/1002.js","../../../../chunks/1220.js","../../../../chunks/1240.js","../../../../chunks/1455.js","../../../../chunks/1470.js","../../../../chunks/1583.js","../../../../chunks/181.js","../../../../chunks/1817.js","../../../../chunks/1893.js","../../../../chunks/1998.js","../../../../chunks/2155.js","../../../../chunks/238.js","../../../../chunks/241.js","../../../../chunks/2428.js","../../../../chunks/2430.js","../../../../chunks/2512.js","../../../../chunks/2566.js","../../../../chunks/2661.js","../../../../chunks/2664.js","../../../../chunks/2731.js","../../../../chunks/2763.js","../../../../chunks/2944.js","../../../../chunks/2947.js","../../../../chunks/3042.js","../../../../chunks/3056.js","../../../../chunks/3104.js","../../../../chunks/318.js","../../../../chunks/3249.js","../../../../chunks/3399.js","../../../../chunks/3433.js","../../../../chunks/3593.js","../../../../chunks/3696.js","../../../../chunks/3738.js","../../../../chunks/3792.js","../../../../chunks/3824.js","../../../../chunks/395.js","../../../../chunks/3958.js","../../../../chunks/3960.js","../../../../chunks/4003.js","../../../../chunks/4013.js","../../../../chunks/4017.js","../../../../chunks/402.js","../../../../chunks/4123.js","../../../../chunks/4177.js","../../../../chunks/427.js","../../../../chunks/4298.js","../../../../chunks/4315.js","../../../../chunks/4350.js","../../../../chunks/4404.js","../../../../chunks/4432.js","../../../../chunks/4462.js","../../../../chunks/4632.js","../../../../chunks/4739.js","../../../../chunks/4741.js","../../../../chunks/4746.js","../../../../chunks/4778.js","../../../../chunks/4780.js","../../../../chunks/4790.js","../../../../chunks/4803.js","../../../../chunks/4939.js","../../../../chunks/5019.js","../../../../chunks/5024.js","../../../../chunks/507.js","../../../../chunks/5074.js","../../../../chunks/5206.js","../../../../chunks/5210.js","../../../../chunks/5213.js","../../../../chunks/5258.js","../../../../chunks/5296.js","../../../../chunks/5312.js","../../../../chunks/5334.js","../../../../chunks/541.js","../../../../chunks/5424.js","../../../../chunks/5433.js","../../../../chunks/5573.js","../../../../chunks/5576.js","../../../../chunks/5592.js","../../../../chunks/5681.js","../../../../chunks/5846.js","../../../../chunks/5870.js","../../../../chunks/5901.js","../../../../chunks/5924.js","../../../../chunks/6053.js","../../../../chunks/607.js","../../../../chunks/6103.js","../../../../chunks/6108.js","../../../../chunks/6118.js","../../../../chunks/6198.js","../../../../chunks/6252.js","../../../../chunks/6376.js","../../../../chunks/6404.js","../../../../chunks/6492.js","../../../../chunks/6544.js","../../../../chunks/6684.js","../../../../chunks/6811.js","../../../../chunks/6844.js","../../../../chunks/689.js","../../../../chunks/6956.js","../../../../chunks/6977.js","../../../../chunks/6979.js","../../../../chunks/698.js","../../../../chunks/6992.js","../../../../chunks/7110.js","../../../../chunks/7126.js","../../../../chunks/7242.js","../../../../chunks/7307.js","../../../../chunks/7341.js","../../../../chunks/7464.js","../../../../chunks/7478.js","../../../../chunks/7753.js","../../../../chunks/7774.js","../../../../chunks/7870.js","../../../../chunks/7965.js","../../../../chunks/8023.js","../../../../chunks/8049.js","../../../../chunks/8062.js","../../../../chunks/8099.js","../../../../chunks/8255.js","../../../../chunks/8292.js","../../../../chunks/8294.js","../../../../chunks/8316.js","../../../../chunks/834.js","../../../../chunks/8352.js","../../../../chunks/8469.js","../../../../chunks/8491.js","../../../../chunks/8520.js","../../../../chunks/8590.js","../../../../chunks/8627.js","../../../../chunks/888.js","../../../../chunks/8895.js","../../../../chunks/8946.js","../../../../chunks/9.js","../../../../chunks/9004.js","../../../../chunks/9012.js","../../../../chunks/9083.js","../../../../chunks/9293.js","../../../../chunks/9483.js","../../../../chunks/9489.js","../../../../chunks/9609.js","../../../../chunks/973.js","../../../../chunks/9841.js","../../../../chunks/9905.js","../../../../webpack-runtime.js","page_client-reference-manifest.js"]}
1
+ {"version":1,"files":["../../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../../node_modules/@swc/helpers/esm/_interop_require_default.js","../../../../../../node_modules/@swc/helpers/package.json","../../../../../../node_modules/better-sqlite3/build/Release/better_sqlite3.node","../../../../../../node_modules/better-sqlite3/lib/database.js","../../../../../../node_modules/better-sqlite3/lib/index.js","../../../../../../node_modules/better-sqlite3/lib/methods/aggregate.js","../../../../../../node_modules/better-sqlite3/lib/methods/backup.js","../../../../../../node_modules/better-sqlite3/lib/methods/function.js","../../../../../../node_modules/better-sqlite3/lib/methods/inspect.js","../../../../../../node_modules/better-sqlite3/lib/methods/pragma.js","../../../../../../node_modules/better-sqlite3/lib/methods/serialize.js","../../../../../../node_modules/better-sqlite3/lib/methods/table.js","../../../../../../node_modules/better-sqlite3/lib/methods/transaction.js","../../../../../../node_modules/better-sqlite3/lib/methods/wrappers.js","../../../../../../node_modules/better-sqlite3/lib/sqlite-error.js","../../../../../../node_modules/better-sqlite3/lib/util.js","../../../../../../node_modules/better-sqlite3/package.json","../../../../../../node_modules/bindings/bindings.js","../../../../../../node_modules/bindings/package.json","../../../../../../node_modules/file-uri-to-path/index.js","../../../../../../node_modules/file-uri-to-path/package.json","../../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../../node_modules/next/dist/client/lib/console.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../node_modules/next/dist/server/app-render/blocking-route-messages.js","../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../../node_modules/next/dist/server/app-render/sync-io-messages.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../../node_modules/next/dist/server/node-environment.js","../../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../../node_modules/next/dist/server/require-hook.js","../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../node_modules/next/dist/shared/lib/instant-messages.js","../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../node_modules/next/package.json","../../../../../../node_modules/pg-cloudflare/dist/empty.js","../../../../../../node_modules/pg-cloudflare/dist/index.js","../../../../../../node_modules/pg-cloudflare/package.json","../../../../../../node_modules/pg-connection-string/index.js","../../../../../../node_modules/pg-connection-string/package.json","../../../../../../node_modules/pg-int8/index.js","../../../../../../node_modules/pg-int8/package.json","../../../../../../node_modules/pg-pool/index.js","../../../../../../node_modules/pg-pool/package.json","../../../../../../node_modules/pg-protocol/dist/buffer-reader.js","../../../../../../node_modules/pg-protocol/dist/buffer-writer.js","../../../../../../node_modules/pg-protocol/dist/index.js","../../../../../../node_modules/pg-protocol/dist/messages.js","../../../../../../node_modules/pg-protocol/dist/parser.js","../../../../../../node_modules/pg-protocol/dist/serializer.js","../../../../../../node_modules/pg-protocol/package.json","../../../../../../node_modules/pg-types/index.js","../../../../../../node_modules/pg-types/lib/arrayParser.js","../../../../../../node_modules/pg-types/lib/binaryParsers.js","../../../../../../node_modules/pg-types/lib/builtins.js","../../../../../../node_modules/pg-types/lib/textParsers.js","../../../../../../node_modules/pg-types/package.json","../../../../../../node_modules/pg/esm/index.mjs","../../../../../../node_modules/pg/lib/client.js","../../../../../../node_modules/pg/lib/connection-parameters.js","../../../../../../node_modules/pg/lib/connection.js","../../../../../../node_modules/pg/lib/crypto/cert-signatures.js","../../../../../../node_modules/pg/lib/crypto/sasl.js","../../../../../../node_modules/pg/lib/crypto/utils.js","../../../../../../node_modules/pg/lib/defaults.js","../../../../../../node_modules/pg/lib/index.js","../../../../../../node_modules/pg/lib/native/client.js","../../../../../../node_modules/pg/lib/native/index.js","../../../../../../node_modules/pg/lib/native/query.js","../../../../../../node_modules/pg/lib/query.js","../../../../../../node_modules/pg/lib/result.js","../../../../../../node_modules/pg/lib/stream.js","../../../../../../node_modules/pg/lib/type-overrides.js","../../../../../../node_modules/pg/lib/utils.js","../../../../../../node_modules/pg/package.json","../../../../../../node_modules/pgpass/lib/helper.js","../../../../../../node_modules/pgpass/lib/index.js","../../../../../../node_modules/pgpass/package.json","../../../../../../node_modules/postgres-array/index.js","../../../../../../node_modules/postgres-array/package.json","../../../../../../node_modules/postgres-bytea/index.js","../../../../../../node_modules/postgres-bytea/package.json","../../../../../../node_modules/postgres-date/index.js","../../../../../../node_modules/postgres-date/package.json","../../../../../../node_modules/postgres-interval/index.js","../../../../../../node_modules/postgres-interval/package.json","../../../../../../node_modules/react/cjs/react.development.js","../../../../../../node_modules/react/cjs/react.production.js","../../../../../../node_modules/react/index.js","../../../../../../node_modules/react/package.json","../../../../../../node_modules/split2/index.js","../../../../../../node_modules/split2/package.json","../../../../../../node_modules/sql.js/dist/sql-wasm.js","../../../../../../node_modules/sql.js/package.json","../../../../../../node_modules/xtend/mutable.js","../../../../../../node_modules/xtend/package.json","../../../../../../package.json","../../../../../package.json","../../../../chunks/1002.js","../../../../chunks/1220.js","../../../../chunks/1240.js","../../../../chunks/1455.js","../../../../chunks/1470.js","../../../../chunks/1583.js","../../../../chunks/181.js","../../../../chunks/1817.js","../../../../chunks/1893.js","../../../../chunks/1998.js","../../../../chunks/2155.js","../../../../chunks/238.js","../../../../chunks/241.js","../../../../chunks/2428.js","../../../../chunks/2430.js","../../../../chunks/2512.js","../../../../chunks/2566.js","../../../../chunks/2661.js","../../../../chunks/2664.js","../../../../chunks/2731.js","../../../../chunks/2763.js","../../../../chunks/2944.js","../../../../chunks/2947.js","../../../../chunks/3042.js","../../../../chunks/3056.js","../../../../chunks/3104.js","../../../../chunks/318.js","../../../../chunks/3249.js","../../../../chunks/3399.js","../../../../chunks/3408.js","../../../../chunks/3433.js","../../../../chunks/3593.js","../../../../chunks/3696.js","../../../../chunks/3738.js","../../../../chunks/3792.js","../../../../chunks/3824.js","../../../../chunks/395.js","../../../../chunks/3958.js","../../../../chunks/3960.js","../../../../chunks/4003.js","../../../../chunks/4013.js","../../../../chunks/4017.js","../../../../chunks/402.js","../../../../chunks/4123.js","../../../../chunks/4177.js","../../../../chunks/427.js","../../../../chunks/4298.js","../../../../chunks/4315.js","../../../../chunks/4350.js","../../../../chunks/4404.js","../../../../chunks/4432.js","../../../../chunks/4462.js","../../../../chunks/4632.js","../../../../chunks/4739.js","../../../../chunks/4741.js","../../../../chunks/4746.js","../../../../chunks/4778.js","../../../../chunks/4780.js","../../../../chunks/4790.js","../../../../chunks/4803.js","../../../../chunks/4939.js","../../../../chunks/5019.js","../../../../chunks/5024.js","../../../../chunks/507.js","../../../../chunks/5074.js","../../../../chunks/5206.js","../../../../chunks/5210.js","../../../../chunks/5213.js","../../../../chunks/5258.js","../../../../chunks/5296.js","../../../../chunks/5312.js","../../../../chunks/5334.js","../../../../chunks/541.js","../../../../chunks/5424.js","../../../../chunks/5433.js","../../../../chunks/5573.js","../../../../chunks/5576.js","../../../../chunks/5592.js","../../../../chunks/5681.js","../../../../chunks/5846.js","../../../../chunks/5870.js","../../../../chunks/5901.js","../../../../chunks/5924.js","../../../../chunks/6053.js","../../../../chunks/607.js","../../../../chunks/6103.js","../../../../chunks/6108.js","../../../../chunks/6118.js","../../../../chunks/6198.js","../../../../chunks/6236.js","../../../../chunks/6252.js","../../../../chunks/6376.js","../../../../chunks/6404.js","../../../../chunks/6492.js","../../../../chunks/6544.js","../../../../chunks/6684.js","../../../../chunks/6811.js","../../../../chunks/6844.js","../../../../chunks/689.js","../../../../chunks/6956.js","../../../../chunks/6977.js","../../../../chunks/6979.js","../../../../chunks/698.js","../../../../chunks/6992.js","../../../../chunks/7126.js","../../../../chunks/7242.js","../../../../chunks/7307.js","../../../../chunks/7341.js","../../../../chunks/7464.js","../../../../chunks/7478.js","../../../../chunks/7753.js","../../../../chunks/7774.js","../../../../chunks/7870.js","../../../../chunks/7965.js","../../../../chunks/8023.js","../../../../chunks/8049.js","../../../../chunks/8062.js","../../../../chunks/8099.js","../../../../chunks/8255.js","../../../../chunks/8292.js","../../../../chunks/8294.js","../../../../chunks/8316.js","../../../../chunks/834.js","../../../../chunks/8352.js","../../../../chunks/8469.js","../../../../chunks/8491.js","../../../../chunks/8520.js","../../../../chunks/8590.js","../../../../chunks/8627.js","../../../../chunks/8895.js","../../../../chunks/8946.js","../../../../chunks/9.js","../../../../chunks/9004.js","../../../../chunks/9012.js","../../../../chunks/9083.js","../../../../chunks/9293.js","../../../../chunks/9483.js","../../../../chunks/9489.js","../../../../chunks/9588.js","../../../../chunks/9609.js","../../../../chunks/973.js","../../../../chunks/9841.js","../../../../chunks/9905.js","../../../../webpack-runtime.js","page_client-reference-manifest.js"]}