zevairouter 1.0.12 → 1.0.14

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 (637) hide show
  1. package/README.md +125 -44
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +3 -3
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js +1 -1
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page.js.nft.json +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  34. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  36. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  37. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  38. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  39. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  40. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  41. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  42. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  43. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  45. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  46. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  47. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  48. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  49. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  50. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  51. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  52. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  55. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  58. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  60. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  61. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  62. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  63. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  64. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  65. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  66. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  67. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  68. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  69. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  70. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  71. package/cli/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  72. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  73. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  74. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  75. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  76. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  77. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  78. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  79. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  80. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  81. package/cli/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  82. package/cli/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  83. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  84. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  85. package/cli/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  86. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  87. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  88. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  89. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  90. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  91. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  92. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  93. package/cli/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  94. package/cli/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  95. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  96. package/cli/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  97. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  98. package/cli/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  99. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  100. package/cli/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  101. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  102. package/cli/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  103. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  104. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  105. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  106. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  107. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  108. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  109. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  110. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  111. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js +1 -1
  112. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-gateway/accounts/route.js.nft.json +1 -1
  113. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  114. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  115. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  116. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  117. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  118. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  119. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  120. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  121. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  122. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  123. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  124. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  125. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  126. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  127. package/cli/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  128. package/cli/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  129. package/cli/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  130. package/cli/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  131. package/cli/app/.next-cli-build/server/app/api/init/route.js +1 -1
  132. package/cli/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  133. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  134. package/cli/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  135. package/cli/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  136. package/cli/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  137. package/cli/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  138. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  139. package/cli/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  140. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  141. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  142. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  143. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  144. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  145. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  146. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  147. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  148. package/cli/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  149. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  150. package/cli/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  151. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  152. package/cli/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  153. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  154. package/cli/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  155. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  156. package/cli/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  157. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  158. package/cli/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  159. package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  160. package/cli/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  161. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  162. package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  163. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js +1 -1
  164. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  165. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  166. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  167. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js +1 -1
  168. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js.nft.json +1 -1
  169. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js +1 -1
  170. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js.nft.json +1 -1
  171. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js +1 -1
  172. package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js.nft.json +1 -1
  173. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js +1 -1
  174. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  175. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  176. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  177. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js +1 -1
  178. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/[jobId]/route.js.nft.json +1 -1
  179. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js +1 -1
  180. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/latest/route.js.nft.json +1 -1
  181. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js +1 -1
  182. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-import/route.js.nft.json +1 -1
  183. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js +1 -1
  184. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/bulk-token/route.js.nft.json +1 -1
  185. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js +1 -1
  186. package/cli/app/.next-cli-build/server/app/api/oauth/codebuddy/quota-cookie/route.js.nft.json +1 -1
  187. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  188. package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  189. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  190. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  191. package/cli/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  192. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  193. package/cli/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  194. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  195. package/cli/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  196. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  197. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js +1 -1
  198. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  199. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  200. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  201. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js +1 -1
  202. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/[jobId]/route.js.nft.json +1 -1
  203. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js +1 -1
  204. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/latest/route.js.nft.json +1 -1
  205. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js +1 -1
  206. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/bulk-import/route.js.nft.json +1 -1
  207. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  208. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  209. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  210. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  211. package/cli/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  212. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js +1 -1
  213. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/cancel/route.js.nft.json +1 -1
  214. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
  215. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/manual/[workerId]/route.js.nft.json +1 -1
  216. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js +1 -1
  217. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/[jobId]/route.js.nft.json +1 -1
  218. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js +1 -1
  219. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/latest/route.js.nft.json +1 -1
  220. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js +1 -1
  221. package/cli/app/.next-cli-build/server/app/api/oauth/qoder/bulk-import/route.js.nft.json +1 -1
  222. package/cli/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  223. package/cli/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  224. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  225. package/cli/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  226. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  227. package/cli/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  228. package/cli/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  229. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  230. package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  231. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  232. package/cli/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  233. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  234. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  235. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  236. package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  237. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  238. package/cli/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  239. package/cli/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  240. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  241. package/cli/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  242. package/cli/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  243. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  244. package/cli/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  245. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  246. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  247. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  248. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  249. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  250. package/cli/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  251. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
  252. package/cli/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  253. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  254. package/cli/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  255. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  256. package/cli/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  257. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  258. package/cli/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  259. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  260. package/cli/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  261. package/cli/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  262. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  263. package/cli/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  264. package/cli/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  265. package/cli/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  266. package/cli/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  267. package/cli/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  268. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  269. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  270. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  271. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  272. package/cli/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  273. package/cli/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  274. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  275. package/cli/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  276. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  277. package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  278. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  279. package/cli/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  280. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  281. package/cli/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  282. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  283. package/cli/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  284. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  285. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  286. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  287. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  288. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  289. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  290. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  291. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  292. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  293. package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  294. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  295. package/cli/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  296. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  297. package/cli/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  298. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  299. package/cli/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  300. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  301. package/cli/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  302. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  303. package/cli/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  304. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  305. package/cli/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  306. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  307. package/cli/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  308. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  309. package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  310. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  311. package/cli/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  312. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  313. package/cli/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  314. package/cli/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  315. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  316. package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  317. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  318. package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  319. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  320. package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  321. package/cli/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  322. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  323. package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  324. package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  325. package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  326. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  327. package/cli/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  328. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  329. package/cli/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  330. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  331. package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  332. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  333. package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  334. package/cli/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  335. package/cli/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  336. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  337. package/cli/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  338. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  339. package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  340. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  341. package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  342. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  343. package/cli/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  344. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  345. package/cli/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  346. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  347. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  348. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  349. package/cli/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  350. package/cli/app/.next-cli-build/server/app/callback/page.js +1 -1
  351. package/cli/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  352. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  353. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  354. package/cli/app/.next-cli-build/server/app/callback.rsc +4 -4
  355. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  356. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  357. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  358. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  359. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  360. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  361. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  362. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +6 -6
  363. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  364. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  365. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  366. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  367. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +6 -6
  368. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  369. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +4 -4
  370. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +2 -2
  371. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  372. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  373. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  374. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  375. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  376. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  377. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  378. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  379. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  380. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  381. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  382. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  383. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  384. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  385. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  386. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  387. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  388. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  389. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  390. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  391. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  392. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  393. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  394. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  395. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  396. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  397. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  398. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  399. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  400. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  401. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  402. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  403. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  404. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  405. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  406. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  407. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  408. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  409. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  410. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  411. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  412. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  413. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  414. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  415. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  416. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  417. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  418. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  419. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  420. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  421. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  422. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  423. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  424. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  425. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  426. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  427. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  428. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  429. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  430. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  431. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  432. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  433. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  434. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  435. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  436. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  437. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  438. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  439. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  440. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  441. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  442. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  443. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  444. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  445. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  446. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  447. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  448. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  449. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  450. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  451. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  452. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  453. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  454. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  455. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  456. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  457. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  458. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  459. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  460. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  461. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  462. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  463. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  464. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  465. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  466. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  467. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  468. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  469. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  470. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  471. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  472. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  473. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  474. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  475. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  476. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  477. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  478. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  479. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  480. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  481. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  482. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  483. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  484. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  485. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  486. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  487. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  488. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  489. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  490. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  491. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  492. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  493. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  494. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  495. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  496. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  497. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  498. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  499. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  500. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  501. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  502. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  503. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  504. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  505. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  506. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  507. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  508. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  509. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  510. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  511. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  512. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  513. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  514. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  515. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  516. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  517. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  518. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  519. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  520. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  521. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  522. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  523. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  524. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  525. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  526. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  527. package/cli/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  528. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  529. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  530. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  531. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  532. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  533. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  534. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  535. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  536. package/cli/app/.next-cli-build/server/app/index.rsc +4 -4
  537. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  538. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  539. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  540. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  541. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  542. package/cli/app/.next-cli-build/server/app/landing/page.js +1 -1
  543. package/cli/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  544. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  545. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  546. package/cli/app/.next-cli-build/server/app/landing.rsc +4 -4
  547. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  548. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  549. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  550. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  551. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  552. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  553. package/cli/app/.next-cli-build/server/app/login/page.js +1 -1
  554. package/cli/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  555. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  556. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  557. package/cli/app/.next-cli-build/server/app/login.rsc +5 -5
  558. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  559. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  560. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  561. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  562. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  563. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  564. package/cli/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  565. package/cli/app/.next-cli-build/server/app/page.js +1 -1
  566. package/cli/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  567. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  568. package/cli/app/.next-cli-build/server/app-paths-manifest.json +3 -3
  569. package/cli/app/.next-cli-build/server/chunks/2777.js +1 -0
  570. package/cli/app/.next-cli-build/server/chunks/3104.js +1 -1
  571. package/cli/app/.next-cli-build/server/chunks/3110.js +1 -1
  572. package/cli/app/.next-cli-build/server/chunks/3159.js +1 -0
  573. package/cli/app/.next-cli-build/server/chunks/318.js +1 -1
  574. package/cli/app/.next-cli-build/server/chunks/{7879.js → 3188.js} +3 -3
  575. package/cli/app/.next-cli-build/server/chunks/3593.js +1 -1
  576. package/cli/app/.next-cli-build/server/chunks/4043.js +14 -0
  577. package/cli/app/.next-cli-build/server/chunks/4055.js +1 -1
  578. package/cli/app/.next-cli-build/server/chunks/4161.js +1 -0
  579. package/cli/app/.next-cli-build/server/chunks/4739.js +1 -1
  580. package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
  581. package/cli/app/.next-cli-build/server/chunks/4780.js +1 -1
  582. package/cli/app/.next-cli-build/server/chunks/5024.js +1 -0
  583. package/cli/app/.next-cli-build/server/chunks/507.js +1 -1
  584. package/cli/app/.next-cli-build/server/chunks/5217.js +1 -1
  585. package/cli/app/.next-cli-build/server/chunks/5258.js +1 -1
  586. package/cli/app/.next-cli-build/server/chunks/6896.js +1 -1
  587. package/cli/app/.next-cli-build/server/chunks/698.js +1 -1
  588. package/cli/app/.next-cli-build/server/chunks/7153.js +1 -1
  589. package/cli/app/.next-cli-build/server/chunks/7965.js +1 -1
  590. package/cli/app/.next-cli-build/server/chunks/{1517.js → 8255.js} +1 -1
  591. package/cli/app/.next-cli-build/server/chunks/8520.js +1 -1
  592. package/cli/app/.next-cli-build/server/chunks/8590.js +1 -1
  593. package/cli/app/.next-cli-build/server/chunks/891.js +1 -1
  594. package/cli/app/.next-cli-build/server/chunks/915.js +1 -1
  595. package/cli/app/.next-cli-build/server/chunks/9326.js +1 -1
  596. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  597. package/cli/app/.next-cli-build/server/middleware.js +2 -2
  598. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  599. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  600. package/cli/app/.next-cli-build/static/chunks/1321-8460c1d61e66cdd9.js +1 -0
  601. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-ad6c0d386a0a9e15.js → page-ec740b92f0fead18.js} +1 -1
  602. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-00add5a971054c3c.js +1 -0
  603. package/cli/app/.next-cli-build/static/css/{705fa00a1e55feb4.css → 20176eae83d8ef2f.css} +1 -1
  604. package/cli/app/package.json +3 -3
  605. package/cli/package.json +1 -1
  606. package/open-sse/config/appConstants.js +27 -2
  607. package/open-sse/config/providers.js +2 -1
  608. package/open-sse/executors/antigravity.js +39 -8
  609. package/open-sse/services/antigravityHeaderScrub.js +75 -0
  610. package/open-sse/services/antigravityIdentity.js +115 -0
  611. package/open-sse/services/antigravityObfuscation.js +92 -0
  612. package/open-sse/services/usage.js +150 -45
  613. package/package.json +3 -3
  614. package/src/app/(dashboard)/dashboard/profile/page.js +15 -0
  615. package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.js +3 -3
  616. package/src/app/api/init/route.js +8 -0
  617. package/src/app/api/oauth/antigravity/bulk-import/route.js +2 -0
  618. package/src/app/api/usage/[connectionId]/route.js +22 -170
  619. package/src/app/globals.css +5 -7
  620. package/src/lib/db/index.js +6 -0
  621. package/src/lib/db/repos/quotaCacheRepo.js +80 -0
  622. package/src/lib/db/schema.js +15 -0
  623. package/src/lib/localDb.js +2 -0
  624. package/src/lib/oauth/services/antigravityBulkImportManager.js +1 -1
  625. package/src/lib/usage/quotaRefresh.js +61 -0
  626. package/src/lib/usage/quotaService.js +146 -0
  627. package/src/sse/services/auth.js +45 -1
  628. package/cli/app/.next-cli-build/server/chunks/1051.js +0 -1
  629. package/cli/app/.next-cli-build/server/chunks/1322.js +0 -1
  630. package/cli/app/.next-cli-build/server/chunks/4884.js +0 -13
  631. package/cli/app/.next-cli-build/server/chunks/5723.js +0 -1
  632. package/cli/app/.next-cli-build/server/chunks/6064.js +0 -1
  633. package/cli/app/.next-cli-build/server/chunks/6505.js +0 -1
  634. package/cli/app/.next-cli-build/static/chunks/1321-9e3d0d6db171adb2.js +0 -1
  635. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-be4721f0e8d602c8.js +0 -1
  636. /package/cli/app/.next-cli-build/static/{Fz9IMC9Po2I6i0Ou1e39w → AcNhouZGB-IW1HaLcuwFO}/_buildManifest.js +0 -0
  637. /package/cli/app/.next-cli-build/static/{Fz9IMC9Po2I6i0Ou1e39w → AcNhouZGB-IW1HaLcuwFO}/_ssgManifest.js +0 -0
@@ -50,7 +50,7 @@ ${c}
50
50
  `.replace(/'/g,"'\\''");await t(`printf '%s' '${e}' | tee ${q} > /dev/null`,b),await u(b)}i(`🌐 DNS ${a}: ✅ added ${d.join(", ")}`)}catch(a){throw Error(a.message?.includes("incorrect password")?"Wrong sudo password":`Failed to add DNS entry: ${a.message}`)}}async function x(a,b){let c=k[a];if(!c)throw Error(`Unknown tool: ${a}`);let d=c.filter(a=>v(a));if(0===d.length)return void i(`🌐 DNS ${a}: already inactive`);try{if(o){let a=g.readFileSync(q,"utf8"),b=a.split(/\r?\n/).filter(a=>!d.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";n(q,a,b),await l("ipconfig /flushdns | Out-Null")}else{let a=(g.readFileSync(q,"utf8").split(/\r?\n/).filter(a=>!d.some(b=>a.includes(b))).join("\n").replace(/[\r\n\s]+$/g,"")+"\n").replace(/'/g,"'\\''");await t(`printf '%s' '${a}' | tee ${q} > /dev/null`,b),await u(b)}i(`🌐 DNS ${a}: ✅ removed ${d.join(", ")}`)}catch(a){throw Error(a.message?.includes("incorrect password")?"Wrong sudo password":`Failed to remove DNS entry: ${a.message}`)}}async function y(a){for(let b of Object.keys(k))try{await x(b,a)}catch(a){j(`DNS ${b}: failed to remove — ${a.message}`)}}a.exports={TOOL_HOSTS:k,addDNSEntry:w,removeDNSEntry:x,removeAllDNSEntries:y,removeAllDNSEntriesSync:function(){try{if(!g.existsSync(q))return;let a=Object.values(k).flat(),b=g.readFileSync(q,"utf8"),c=o?"\r\n":"\n",d=b.split(/\r?\n/).filter(b=>!a.some(a=>b.includes(a))).join(c).replace(/[\r\n\s]+$/g,"")+c;if(d===b)return;if(g.writeFileSync(q,d,"utf8"),o)try{f("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}else if(p)try{f("dscacheutil -flushcache && killall -HUP mDNSResponder",{stdio:"ignore"})}catch{}else try{f("resolvectl flush-caches 2>/dev/null || true",{stdio:"ignore"})}catch{}}catch{}},execWithPassword:t,isSudoAvailable:r,canRunSudoWithoutPassword:s,isSudoPasswordRequired:function(){return!o&&r()&&!s()},checkDNSEntry:v,checkAllDNSStatus:function(){try{let a=g.readFileSync(q,"utf8"),b={};for(let[c,d]of Object.entries(k))b[c]=d.every(b=>a.includes(b));return b}catch{return Object.fromEntries(Object.keys(k).map(a=>[a,!1]))}}}},82193:(a,b,c)=>{let d=c(29021),e=c(33873),f=c(21820),g="9router";function h(){return"win32"===process.platform?e.join(process.env.APPDATA||e.join(f.homedir(),"AppData","Roaming"),g):e.join(f.homedir(),`.${g}`)}let i=function(){let a=process.env.DATA_DIR;if(!a)return h();try{return d.mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${g}`),h();throw b}}(),j=e.join(i,"mitm");a.exports={DATA_DIR:i,MITM_DIR:j}},85341:a=>{a.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},87777:(a,b,c)=>{let d=c(29021),e=c(33873),f=c(74075),{DATA_DIR:g}=c(82193),{LOG_BLACKLIST_URL_PARTS:h}=c(17511);function i(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let j=e.join(g,"logs","mitm");d.existsSync(j)||d.mkdirSync(j,{recursive:!0});let k=/^\s*(\{\s*\}|\[\s*\]|null)?\s*$/;function l(a,b=80){return String(a).replace(/[^a-zA-Z0-9]/g,"_").substring(0,b)}function m(a){return!!a&&h.some(b=>a.includes(b))}a.exports={log:a=>console.log(`[${i()}] [MITM] ${a}`),err:a=>console.error(`[${i()}] ❌ [MITM] ${a}`),dumpRequest:function(a,b,c="raw"){if(m(a.url))return null;try{let f=new Date().toISOString().replace(/[:.]/g,"-"),g=l((a.headers.host||"")+a.url),h=e.join(j,`${f}_${c}_${g}.req.json`),i=null;try{i=JSON.parse(b.toString())}catch{}return d.writeFileSync(h,JSON.stringify({method:a.method,url:a.url,host:a.headers.host,headers:a.headers,body:i??b.toString("utf8")},null,2)),h}catch{return null}},createResponseDumper:function(a,b="raw"){if(m(a.url))return null;let c=new Date().toISOString().replace(/[:.]/g,"-"),g=l((a.headers.host||"")+a.url),h=e.join(j,`${c}_${b}_${g}.res.txt`),i=0,n={},o=[];return{writeHeader:(a,b)=>{i=a,n=b||{}},writeChunk:a=>{null!=a&&o.push(Buffer.isBuffer(a)?a:Buffer.from(a))},end:()=>{try{let a=Buffer.concat(o),b=n["content-encoding"]||n["Content-Encoding"],c=(function(a,b){if(!a||0===a.length)return a;try{let c=(b||"").toLowerCase();if(c.includes("gzip"))return f.gunzipSync(a);if(c.includes("br"))return f.brotliDecompressSync(a);if(c.includes("deflate"))return f.inflateSync(a)}catch{}return a})(a,b).toString("utf8");if(k.test(c))return;let e={...n};delete e["content-encoding"],delete e["Content-Encoding"];let g=`STATUS: ${i}
51
51
  HEADERS: ${JSON.stringify(e,null,2)}
52
52
  ---BODY---
53
- ${c}`;d.writeFileSync(h,g)}catch{}},file:h}},clearDumpDir:function(){try{if(!d.existsSync(j))return;for(let a of d.readdirSync(j))try{d.rmSync(e.join(j,a),{recursive:!0,force:!0})}catch{}}catch{}}}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(9248)},96182:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(33873),h=c(29021),i=c(21820),j=c(91645),k=c(55591),l=c(55511),{addDNSEntry:m,removeDNSEntry:n,removeAllDNSEntries:o,removeAllDNSEntriesSync:p,checkAllDNSStatus:q,TOOL_HOSTS:r,isSudoAvailable:s,isSudoPasswordRequired:t}=c(66936),{isAdmin:u}=c(64809),v="win32"===process.platform,w="darwin"===process.platform,{generateCert:x}=c(26033),{installCert:y,uninstallCert:z}=c(9631),{isCertExpired:A}=c(8578),{DATA_DIR:B,MITM_DIR:C}=c(82193),{log:D,err:E}=c(87777),{LSOF_BIN:F}=c(17511),G="http://localhost:1997";function H(a){return null==a||""===a?"''":`'${String(a).replace(/'/g,"'\\''")}'`}async function I(){if(!$)return G;try{let a=await $(),b=a&&null!=a.mitmRouterBaseUrl?String(a.mitmRouterBaseUrl).trim():"";if(!b)return G;let c=new URL(b);if("http:"!==c.protocol&&"https:"!==c.protocol)return G;return b.replace(/\/+$/,"")}catch{return G}}let J=g.join(C,".mitm.pid"),K=[5e3,1e4,2e4,3e4,6e4],L=0,M=0,N=!1;function O(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let a=g.join(__dirname,"server.js");if(h.existsSync(a))return a;let b=g.join(process.cwd(),"src","mitm","server.js");if(h.existsSync(b))return b;let c=g.join(process.cwd(),"..","src","mitm","server.js");return h.existsSync(c)?c:b}function P(a){try{if(!a||!h.existsSync(a)||!a.includes(`${g.sep}node_modules${g.sep}`))return a;let b=g.join(B,"runtime","mitm"),c=g.join(b,"server.js");if(h.existsSync(c))try{if(h.statSync(a).size===h.statSync(c).size)return c}catch{}return h.mkdirSync(b,{recursive:!0}),h.copyFileSync(a,c),c}catch(b){try{D(`[MITM] runtime copy failed: ${b.message}`)}catch{}return a}}let Q=P(O()),R="aes-256-gcm",S="9router-mitm-pwd",T=null,U=null;function V(){return globalThis.__mitmSudoPassword||null}function W(a){globalThis.__mitmSudoPassword=a}function X(a){try{return process.kill(a,0),!0}catch(a){return"EACCES"===a.code}}function Y(a,b=!1,e=null){if(v)d(`taskkill ${b?"/F ":""}/PID ${a}`,{windowsHide:!0},()=>{});else{let f=b?"SIGKILL":"SIGTERM",g=`pkill -${f} -P ${a} 2>/dev/null; kill -${f} ${a} 2>/dev/null`;if(e||s()){let{execWithPassword:a}=c(66936);a(g,e||"").catch(()=>d(g,{windowsHide:!0},()=>{}))}else d(g,{windowsHide:!0},()=>{})}}function Z(){try{let{machineIdSync:a}=c(19713),b=a();return l.createHash("sha256").update(b+S).digest()}catch{return l.createHash("sha256").update(S).digest()}}let $=null,_=null;async function aa(a,b){if(_)try{let c,d,e,f,g,h={mitmEnabled:a};b&&(c=Z(),d=l.randomBytes(12),e=l.createCipheriv(R,c,d),f=Buffer.concat([e.update(b,"utf8"),e.final()]),g=e.getAuthTag(),h.mitmSudoEncrypted=`${d.toString("hex")}:${g.toString("hex")}:${f.toString("hex")}`),await _(h)}catch(a){E(`Failed to save settings: ${a.message}`)}}async function ab(){if(_)try{await _({mitmSudoEncrypted:null})}catch(a){E(`Failed to clear encrypted password: ${a.message}`)}}async function ac(){if(!$)return null;try{let a=await $();if(!a.mitmSudoEncrypted)return null;return function(a){try{let[b,c,d]=a.split(":");if(!b||!c||!d)return null;let e=Z(),f=l.createDecipheriv(R,e,Buffer.from(b,"hex"));return f.setAuthTag(Buffer.from(c,"hex")),f.update(Buffer.from(d,"hex"))+f.final("utf8")}catch{return null}}(a.mitmSudoEncrypted)}catch{return null}}async function ad(a,b){if(_&&$)try{let c={...(await $()).dnsToolEnabled||{},[a]:b};await _({dnsToolEnabled:c})}catch(a){E(`Failed to save DNS state: ${a.message}`)}}async function ae(){if(!$)return{};try{return(await $()).dnsToolEnabled||{}}catch{return{}}}async function af(a){let b=await ae(),c=a||V()||await ac();for(let[a,d]of Object.entries(b))if(d&&r[a])try{await m(a,c)}catch(b){E(`DNS ${a}: restore failed — ${b.message}`)}}async function ag(){return v?u():!(!u()&&t())||!!(V()||await ac())}function ah(a){return new Promise(a=>{v?d('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{windowsHide:!0},(b,c)=>{if(b)return a(null);let e=parseInt(c.trim(),10);if(!e||e<=4)return a(null);d(`tasklist /FI "PID eq ${e}" /FO CSV /NH`,{windowsHide:!0},(b,c)=>{let d=c?.match(/"([^"]+)"/);a({pid:e,name:d?d[1]:"unknown"})})}):d(`${F} -nP -iTCP:443 -sTCP:LISTEN -t`,{windowsHide:!0},(b,c)=>{if(b||!c?.trim())return a(null);let e=parseInt(c.trim().split("\n")[0],10);if(!e||isNaN(e))return a(null);d(`ps -p ${e} -o comm=`,{windowsHide:!0},(b,c)=>{a({pid:e,name:c?.trim()||"unknown"})})})})}async function ai(a){if(T&&!T.killed){try{T.kill("SIGKILL")}catch{}T=null,U=null}try{if(h.existsSync(J)){let b=parseInt(h.readFileSync(J,"utf-8").trim(),10);b&&X(b)&&(Y(b,!0,a),await new Promise(a=>setTimeout(a,500))),h.unlinkSync(J)}}catch{}if(!v&&Q)try{let b=Q.replace(/'/g,"'\\''");if(a||s()){let{execWithPassword:d}=c(66936);await d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,a||"").catch(()=>{})}else d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,{windowsHide:!0},()=>{});await new Promise(a=>setTimeout(a,500))}catch{}}async function aj(){let a=null!==T&&!T.killed,b=U;if(!a)try{if(h.existsSync(J)){let c=parseInt(h.readFileSync(J,"utf-8").trim(),10);c&&X(c)?(a=!0,b=c):h.unlinkSync(J)}}catch{}let d=q(),e=g.join(C,"rootCA.crt"),f=h.existsSync(e),{checkCertInstalled:i}=c(9631),j=!!f&&await i(e);return{running:a,pid:b,certExists:f,certTrusted:j,dnsStatus:d}}async function ak(a){if(N)return;if(Date.now()-M>=6e4&&(L=0),L>=5)return void E("Max restart attempts reached. Giving up.");let b=K[Math.min(L,K.length-1)];L++,N=!0,D(`Restarting in ${b/1e3}s... (${L}/5)`),await new Promise(a=>setTimeout(a,b));try{let b=$?await $():null;if(b&&!b.mitmEnabled){D("MITM disabled, skipping restart"),N=!1;return}let c=V()||await ac();if(!c&&!v){E("No cached password, cannot auto-restart"),N=!1;return}await am(a,c),D("\uD83D\uDD04 Restarted successfully"),L=0,N=!1}catch(b){E(`Restart attempt ${L}/5 failed: ${b.message}`),N=!1,ak(a)}}async function al(a,b){if(a&&a.pid){if(v)try{f(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${a.pid} -Force -ErrorAction SilentlyContinue"`,{windowsHide:!0})}catch{}else try{let{execWithPassword:d}=c(66936);b||s()?await d(`kill -9 ${a.pid}`,b||""):f(`kill -9 ${a.pid}`,{windowsHide:!0})}catch{}await new Promise(a=>setTimeout(a,800))}}async function am(a,b,l=!1){if(!T||T.killed)try{if(h.existsSync(J)){let a=parseInt(h.readFileSync(J,"utf-8").trim(),10);if(a&&X(a))return U=a,D(`♻️ Reusing existing process (PID: ${a})`),await aa(!0,b),b&&W(b),{running:!0,pid:a};h.unlinkSync(J)}}catch{}if(T&&!T.killed)throw Error("MITM server is already running");if(await ai(b),!v){let a=await new Promise(a=>{let b=j.createServer();b.once("error",b=>{"EADDRINUSE"===b.code?a("in-use"):a("no-permission")}),b.once("listening",()=>{b.close(()=>a("free"))}),b.listen(443,"127.0.0.1")});if("in-use"===a||"no-permission"===a){let a=await ah(b);if(a){let c=a.name.includes("/")?a.name.split("/").filter(Boolean).pop():a.name;if(l)D(`Killing process on port 443 (PID ${a.pid}, name=${c})...`),await al(a,b);else{let b=Error(`Port 443 is already in use by "${c}" (PID ${a.pid}).`);throw b.code="PORT_443_BUSY",b.portOwner={pid:a.pid,name:c},b}}}}let m=g.join(C,"rootCA.crt"),n=g.join(C,"rootCA.key"),o=h.existsSync(m)&&h.existsSync(n);if(!o||A(m)){if(o){D("\uD83D\uDD10 Cert expired — uninstalling old cert...");let a=b||V()||await ac();try{await z(a,m)}catch{}}D("\uD83D\uDD10 Generating Root CA..."),await x()}let{checkCertInstalled:p}=c(9631),r=await p(m),u=!v&&!w&&!s();if(r)D("\uD83D\uDD10 Cert: already trusted ✅");else{D("\uD83D\uDD10 Cert: not trusted → installing...");let a=b||V()||await ac();if(u)D(`🔐 Cert: skipping system trust (no sudo). Install ${m} as a trusted CA on machines that use this proxy.`);else{if(!a&&t())throw Error("Sudo password required to install Root CA certificate");try{await y(a,m),D("\uD83D\uDD10 Cert: ✅ trusted")}catch(a){throw Error(`Failed to trust certificate: ${a.message}`)}}}let B=Q;if((!B||!h.existsSync(B))&&(D(`[MITM] server.js missing at ${B} → recopying`),!(B=P(O()))||!h.existsSync(B)))throw Error(`MITM server.js not found at ${B}. Reinstall 9router.`);let G=await I();if(D(`🚀 Starting server... (router: ${G})`),v){let c=await ah(b);if(c)if(l)D(`Killing process on port 443 (PID ${c.pid}, name=${c.name})...`),await al(c,b);else{let a=Error(`Port 443 is already in use by "${c.name}" (PID ${c.pid}).`);throw a.code="PORT_443_BUSY",a.portOwner={pid:c.pid,name:c.name},a}T=e(process.execPath,[B],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:G}}),_&&await _({mitmCertInstalled:!0}).catch(()=>{})}else s()?((T=e("sudo",["-S","-E","sh","-c",[`HOME=${H(i.homedir())}`,`ROUTER_API_KEY=${H(a)}`,`MITM_ROUTER_BASE=${H(G)}`,"NODE_ENV=production",H(process.execPath),H(B)].join(" ")],{detached:!1,windowsHide:!0,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
53
+ ${c}`;d.writeFileSync(h,g)}catch{}},file:h}},clearDumpDir:function(){try{if(!d.existsSync(j))return;for(let a of d.readdirSync(j))try{d.rmSync(e.join(j,a),{recursive:!0,force:!0})}catch{}}catch{}}}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,LF:()=>d.LF,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(1399)},96182:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(33873),h=c(29021),i=c(21820),j=c(91645),k=c(55591),l=c(55511),{addDNSEntry:m,removeDNSEntry:n,removeAllDNSEntries:o,removeAllDNSEntriesSync:p,checkAllDNSStatus:q,TOOL_HOSTS:r,isSudoAvailable:s,isSudoPasswordRequired:t}=c(66936),{isAdmin:u}=c(64809),v="win32"===process.platform,w="darwin"===process.platform,{generateCert:x}=c(26033),{installCert:y,uninstallCert:z}=c(9631),{isCertExpired:A}=c(8578),{DATA_DIR:B,MITM_DIR:C}=c(82193),{log:D,err:E}=c(87777),{LSOF_BIN:F}=c(17511),G="http://localhost:1997";function H(a){return null==a||""===a?"''":`'${String(a).replace(/'/g,"'\\''")}'`}async function I(){if(!$)return G;try{let a=await $(),b=a&&null!=a.mitmRouterBaseUrl?String(a.mitmRouterBaseUrl).trim():"";if(!b)return G;let c=new URL(b);if("http:"!==c.protocol&&"https:"!==c.protocol)return G;return b.replace(/\/+$/,"")}catch{return G}}let J=g.join(C,".mitm.pid"),K=[5e3,1e4,2e4,3e4,6e4],L=0,M=0,N=!1;function O(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let a=g.join(__dirname,"server.js");if(h.existsSync(a))return a;let b=g.join(process.cwd(),"src","mitm","server.js");if(h.existsSync(b))return b;let c=g.join(process.cwd(),"..","src","mitm","server.js");return h.existsSync(c)?c:b}function P(a){try{if(!a||!h.existsSync(a)||!a.includes(`${g.sep}node_modules${g.sep}`))return a;let b=g.join(B,"runtime","mitm"),c=g.join(b,"server.js");if(h.existsSync(c))try{if(h.statSync(a).size===h.statSync(c).size)return c}catch{}return h.mkdirSync(b,{recursive:!0}),h.copyFileSync(a,c),c}catch(b){try{D(`[MITM] runtime copy failed: ${b.message}`)}catch{}return a}}let Q=P(O()),R="aes-256-gcm",S="9router-mitm-pwd",T=null,U=null;function V(){return globalThis.__mitmSudoPassword||null}function W(a){globalThis.__mitmSudoPassword=a}function X(a){try{return process.kill(a,0),!0}catch(a){return"EACCES"===a.code}}function Y(a,b=!1,e=null){if(v)d(`taskkill ${b?"/F ":""}/PID ${a}`,{windowsHide:!0},()=>{});else{let f=b?"SIGKILL":"SIGTERM",g=`pkill -${f} -P ${a} 2>/dev/null; kill -${f} ${a} 2>/dev/null`;if(e||s()){let{execWithPassword:a}=c(66936);a(g,e||"").catch(()=>d(g,{windowsHide:!0},()=>{}))}else d(g,{windowsHide:!0},()=>{})}}function Z(){try{let{machineIdSync:a}=c(19713),b=a();return l.createHash("sha256").update(b+S).digest()}catch{return l.createHash("sha256").update(S).digest()}}let $=null,_=null;async function aa(a,b){if(_)try{let c,d,e,f,g,h={mitmEnabled:a};b&&(c=Z(),d=l.randomBytes(12),e=l.createCipheriv(R,c,d),f=Buffer.concat([e.update(b,"utf8"),e.final()]),g=e.getAuthTag(),h.mitmSudoEncrypted=`${d.toString("hex")}:${g.toString("hex")}:${f.toString("hex")}`),await _(h)}catch(a){E(`Failed to save settings: ${a.message}`)}}async function ab(){if(_)try{await _({mitmSudoEncrypted:null})}catch(a){E(`Failed to clear encrypted password: ${a.message}`)}}async function ac(){if(!$)return null;try{let a=await $();if(!a.mitmSudoEncrypted)return null;return function(a){try{let[b,c,d]=a.split(":");if(!b||!c||!d)return null;let e=Z(),f=l.createDecipheriv(R,e,Buffer.from(b,"hex"));return f.setAuthTag(Buffer.from(c,"hex")),f.update(Buffer.from(d,"hex"))+f.final("utf8")}catch{return null}}(a.mitmSudoEncrypted)}catch{return null}}async function ad(a,b){if(_&&$)try{let c={...(await $()).dnsToolEnabled||{},[a]:b};await _({dnsToolEnabled:c})}catch(a){E(`Failed to save DNS state: ${a.message}`)}}async function ae(){if(!$)return{};try{return(await $()).dnsToolEnabled||{}}catch{return{}}}async function af(a){let b=await ae(),c=a||V()||await ac();for(let[a,d]of Object.entries(b))if(d&&r[a])try{await m(a,c)}catch(b){E(`DNS ${a}: restore failed — ${b.message}`)}}async function ag(){return v?u():!(!u()&&t())||!!(V()||await ac())}function ah(a){return new Promise(a=>{v?d('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{windowsHide:!0},(b,c)=>{if(b)return a(null);let e=parseInt(c.trim(),10);if(!e||e<=4)return a(null);d(`tasklist /FI "PID eq ${e}" /FO CSV /NH`,{windowsHide:!0},(b,c)=>{let d=c?.match(/"([^"]+)"/);a({pid:e,name:d?d[1]:"unknown"})})}):d(`${F} -nP -iTCP:443 -sTCP:LISTEN -t`,{windowsHide:!0},(b,c)=>{if(b||!c?.trim())return a(null);let e=parseInt(c.trim().split("\n")[0],10);if(!e||isNaN(e))return a(null);d(`ps -p ${e} -o comm=`,{windowsHide:!0},(b,c)=>{a({pid:e,name:c?.trim()||"unknown"})})})})}async function ai(a){if(T&&!T.killed){try{T.kill("SIGKILL")}catch{}T=null,U=null}try{if(h.existsSync(J)){let b=parseInt(h.readFileSync(J,"utf-8").trim(),10);b&&X(b)&&(Y(b,!0,a),await new Promise(a=>setTimeout(a,500))),h.unlinkSync(J)}}catch{}if(!v&&Q)try{let b=Q.replace(/'/g,"'\\''");if(a||s()){let{execWithPassword:d}=c(66936);await d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,a||"").catch(()=>{})}else d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,{windowsHide:!0},()=>{});await new Promise(a=>setTimeout(a,500))}catch{}}async function aj(){let a=null!==T&&!T.killed,b=U;if(!a)try{if(h.existsSync(J)){let c=parseInt(h.readFileSync(J,"utf-8").trim(),10);c&&X(c)?(a=!0,b=c):h.unlinkSync(J)}}catch{}let d=q(),e=g.join(C,"rootCA.crt"),f=h.existsSync(e),{checkCertInstalled:i}=c(9631),j=!!f&&await i(e);return{running:a,pid:b,certExists:f,certTrusted:j,dnsStatus:d}}async function ak(a){if(N)return;if(Date.now()-M>=6e4&&(L=0),L>=5)return void E("Max restart attempts reached. Giving up.");let b=K[Math.min(L,K.length-1)];L++,N=!0,D(`Restarting in ${b/1e3}s... (${L}/5)`),await new Promise(a=>setTimeout(a,b));try{let b=$?await $():null;if(b&&!b.mitmEnabled){D("MITM disabled, skipping restart"),N=!1;return}let c=V()||await ac();if(!c&&!v){E("No cached password, cannot auto-restart"),N=!1;return}await am(a,c),D("\uD83D\uDD04 Restarted successfully"),L=0,N=!1}catch(b){E(`Restart attempt ${L}/5 failed: ${b.message}`),N=!1,ak(a)}}async function al(a,b){if(a&&a.pid){if(v)try{f(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${a.pid} -Force -ErrorAction SilentlyContinue"`,{windowsHide:!0})}catch{}else try{let{execWithPassword:d}=c(66936);b||s()?await d(`kill -9 ${a.pid}`,b||""):f(`kill -9 ${a.pid}`,{windowsHide:!0})}catch{}await new Promise(a=>setTimeout(a,800))}}async function am(a,b,l=!1){if(!T||T.killed)try{if(h.existsSync(J)){let a=parseInt(h.readFileSync(J,"utf-8").trim(),10);if(a&&X(a))return U=a,D(`♻️ Reusing existing process (PID: ${a})`),await aa(!0,b),b&&W(b),{running:!0,pid:a};h.unlinkSync(J)}}catch{}if(T&&!T.killed)throw Error("MITM server is already running");if(await ai(b),!v){let a=await new Promise(a=>{let b=j.createServer();b.once("error",b=>{"EADDRINUSE"===b.code?a("in-use"):a("no-permission")}),b.once("listening",()=>{b.close(()=>a("free"))}),b.listen(443,"127.0.0.1")});if("in-use"===a||"no-permission"===a){let a=await ah(b);if(a){let c=a.name.includes("/")?a.name.split("/").filter(Boolean).pop():a.name;if(l)D(`Killing process on port 443 (PID ${a.pid}, name=${c})...`),await al(a,b);else{let b=Error(`Port 443 is already in use by "${c}" (PID ${a.pid}).`);throw b.code="PORT_443_BUSY",b.portOwner={pid:a.pid,name:c},b}}}}let m=g.join(C,"rootCA.crt"),n=g.join(C,"rootCA.key"),o=h.existsSync(m)&&h.existsSync(n);if(!o||A(m)){if(o){D("\uD83D\uDD10 Cert expired — uninstalling old cert...");let a=b||V()||await ac();try{await z(a,m)}catch{}}D("\uD83D\uDD10 Generating Root CA..."),await x()}let{checkCertInstalled:p}=c(9631),r=await p(m),u=!v&&!w&&!s();if(r)D("\uD83D\uDD10 Cert: already trusted ✅");else{D("\uD83D\uDD10 Cert: not trusted → installing...");let a=b||V()||await ac();if(u)D(`🔐 Cert: skipping system trust (no sudo). Install ${m} as a trusted CA on machines that use this proxy.`);else{if(!a&&t())throw Error("Sudo password required to install Root CA certificate");try{await y(a,m),D("\uD83D\uDD10 Cert: ✅ trusted")}catch(a){throw Error(`Failed to trust certificate: ${a.message}`)}}}let B=Q;if((!B||!h.existsSync(B))&&(D(`[MITM] server.js missing at ${B} → recopying`),!(B=P(O()))||!h.existsSync(B)))throw Error(`MITM server.js not found at ${B}. Reinstall 9router.`);let G=await I();if(D(`🚀 Starting server... (router: ${G})`),v){let c=await ah(b);if(c)if(l)D(`Killing process on port 443 (PID ${c.pid}, name=${c.name})...`),await al(c,b);else{let a=Error(`Port 443 is already in use by "${c.name}" (PID ${c.pid}).`);throw a.code="PORT_443_BUSY",a.portOwner={pid:c.pid,name:c.name},a}T=e(process.execPath,[B],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:G}}),_&&await _({mitmCertInstalled:!0}).catch(()=>{})}else s()?((T=e("sudo",["-S","-E","sh","-c",[`HOME=${H(i.homedir())}`,`ROUTER_API_KEY=${H(a)}`,`MITM_ROUTER_BASE=${H(G)}`,"NODE_ENV=production",H(process.execPath),H(B)].join(" ")],{detached:!1,windowsHide:!0,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
54
54
  `),T.stdin.end()):T=e(process.execPath,[B],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:G}});if(T&&(U=T.pid,h.writeFileSync(J,String(U)),M=Date.now()),w){let a=g.join(C,"rootCA.crt");h.existsSync(a)&&d(`launchctl setenv NODE_EXTRA_CA_CERTS "${a}"`,{windowsHide:!0},b=>{b?D(`[launchctl] Failed to set NODE_EXTRA_CA_CERTS: ${b.message}`):D(`[launchctl] NODE_EXTRA_CA_CERTS set to ${a}`)})}else if(v){let a=g.join(C,"rootCA.crt");h.existsSync(a)&&d(`setx NODE_EXTRA_CA_CERTS "${a}"`,{windowsHide:!0},a=>{a?D(`[setx] Failed to set NODE_EXTRA_CA_CERTS: ${a.message}`):D("[setx] NODE_EXTRA_CA_CERTS set for current user")})}let K=null;T&&(T.stdout.on("data",a=>{process.stdout.write(a)}),T.stderr.on("data",a=>{let b=a.toString().trim();b&&(v||!b.includes("Password:")&&!b.includes("password for"))&&(E(b),K=b),!v&&(b.includes("incorrect password")||b.includes("no password was provided"))&&(W(null),ab(),N=!0)}),T.on("exit",b=>{D(`Server exited (code: ${b})`),T=null,U=null;try{h.unlinkSync(J)}catch{}0===b||N||ak(a)}));let L=await function(a=443){return new Promise(b=>{let c=Date.now()+8e3,d=()=>{let e=k.request({hostname:"127.0.0.1",port:a,path:"/_mitm_health",method:"GET",rejectUnauthorized:!1},a=>{let c="";a.on("data",a=>{c+=a}),a.on("end",()=>{try{let a=JSON.parse(c);b(!0===a.ok?{ok:!0,pid:a.pid||null}:null)}catch{b(null)}})});e.on("error",()=>{Date.now()<c?setTimeout(d,500):b(null)}),e.end()};d()})}(443);if(!L){if(T&&!T.killed){try{T.kill()}catch{}T=null}let a=function(){try{if(v){let a=f('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{encoding:"utf8",windowsHide:!0}).trim(),b=parseInt(a,10);if(b&&b>4){let a=f(`tasklist /FI "PID eq ${b}" /FO CSV /NH`,{encoding:"utf8",windowsHide:!0}).match(/"([^"]+)"/);if(a)return a[1].replace(".exe","")}}else{let a=f(`${F} -i :443`,{encoding:"utf8",windowsHide:!0}).trim().split("\n");if(a.length>1)return a[1].split(/\s+/)[0]}}catch{}return null}(),b=a?` Port 443 already in use by ${a}.`:"",c=K||`Check sudo password or port 443 access.${b}`;throw Error(`MITM server failed to start. ${c}`)}for(let[a,b]of(_&&await _({mitmCertInstalled:!0}).catch(()=>{}),D(`✅ Server healthy (PID: ${U||L.pid})`),Object.entries(q())))D(`🌐 DNS ${a}: ${b?"✅ active":"❌ inactive"}`);return await aa(!0,b),b&&W(b),{running:!0,pid:U}}async function an(a){N=!0,L=0,D("⏹ Stopping server...");let b=T,e=b&&!b.killed?b.pid:(()=>{try{return parseInt(h.readFileSync(J,"utf-8").trim(),10)}catch{return null}})();if(e&&X(e)&&(D(`Killing server (PID: ${e})...`),Y(e,!1,a),await new Promise(a=>setTimeout(a,1e3)),X(e)&&Y(e,!0,a)),T=null,U=null,v){let a=g.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"),b=Object.values(r).flat();try{let{isAdmin:d,runElevatedPowerShell:e,quotePs:f}=c(64809);if(d()){let d=h.readFileSync(a,"utf8"),e=d.split(/\r?\n/).filter(a=>!b.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";e!==d&&h.writeFileSync(a,e,"utf8");try{c(79646).execSync("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}D("\uD83C\uDF10 DNS: ✅ all tool hosts removed")}else{let c=b.map(f).join(","),d=`
55
55
  $hosts = @(${c})
56
56
  $lines = Get-Content -LiteralPath ${f(a)}
@@ -1 +1 @@
1
- "use strict";exports.id=9326,exports.ids=[1998,9326],exports.modules={33342:(a,b,c)=>{c.d(b,{Q6:()=>S,cO:()=>M,go:()=>P,KY:()=>T,$w:()=>D});var d=c(55511),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(49120),j=c(71998),k=c(21820),l=c.n(k);function m(a){return Number.isFinite(a)?Math.max(0,Math.floor(a)):0}Object.freeze({RAM_GB_PER_WORKER:4,CPU_DIVISOR:2,SAFE_MIN_WORKERS:1,SAFE_MAX_WORKERS:8,FALLBACK_WORKERS:4});var n=c(62409),o=c(82506);let p=new Set(["success","failed","failed_invalid_credentials","failed_exchange","failed_timeout","cancelled"]),q=h().join(i.DATA_DIR,"kiro-bulk-import"),r=h().join(q,"meta.json"),s=new Set(["queued","running","needs_manual"]);function t(){return new Date().toISOString()}function u(a=q){f().mkdirSync(a,{recursive:!0})}function v(a,b=q){return u(b),h().join(b,`${a}.json`)}function w(a){try{if(!f().existsSync(a))return null;return JSON.parse(f().readFileSync(a,"utf8"))}catch{return null}}function x(a,b){u(h().dirname(a));let c=`${a}.${process.pid}.tmp`;f().writeFileSync(c,JSON.stringify(b,null,2),"utf8"),f().renameSync(c,a)}function y(a,b=q){return u(b),h().join(b,`${a}.resume.enc`)}function z(){return(0,d.createHash)("sha256").update(String(function(){if(process.env.BULK_IMPORT_RESUME_SECRET)return process.env.BULK_IMPORT_RESUME_SECRET;let a=h().join(i.DATA_DIR,"bulk-import-resume-key");try{return f().readFileSync(a,"utf8").trim()}catch{}try{u(i.DATA_DIR);let b=(0,d.randomBytes)(32).toString("hex");return f().writeFileSync(a,b,{mode:384}),b}catch{return(0,d.randomBytes)(32).toString("hex")}}())).digest()}function A(a){try{f().existsSync(a)&&f().rmSync(a)}catch{}}function B(a=r){return w(a)?.latestJobId||null}function C(a){if(!0===a||"string"==typeof a&&"auto"===a.trim().toLowerCase())return Math.min(8,Math.max(1,function(a=null){let b=a||function(){let a=[];try{a=l().cpus()||[]}catch{a=[]}let b=0,c=0;try{b=l().totalmem()}catch{b=0}try{c=l().freemem()}catch{c=0}let d=Array.isArray(a)?a.length:0,e=a[0]?.model?String(a[0].model).trim():null,f=b/0x40000000,g=c/0x40000000,h="unknown",i="unknown";try{h=l().platform()}catch{}try{i=l().arch()}catch{}return{cpuCount:d,cpuModel:e,totalMemBytes:b,totalMemGb:f,freeMemBytes:c,freeMemGb:g,platform:h,arch:i}}(),{cpuCount:c,totalMemGb:d}=b,e=m(d/4),f=m(c/2),g="fallback",h=0;return e>0&&f>0?(h=Math.min(e,f),g=e<=f?"ram":"cpu"):e>0?(h=e,g="ram"):f>0?(h=f,g="cpu"):(h=4,g="fallback"),{recommended:Math.min(8,Math.max(1,h||4)),limitedBy:g,ramBudget:e,cpuBudget:f,minWorkers:1,maxWorkers:8,ramGbPerWorker:4,cpuDivisor:2,specs:b}}().recommended));let b=Number.parseInt(a,10);return Number.isFinite(b)?Math.min(8,Math.max(1,b)):4}function D(a=[]){let b=Array.isArray(a)?a:[],c=[],d=[];return b.forEach((a,b)=>{let e=String(a||"").trim();if(!e||e.startsWith("#"))return;let f="",g="";if(e.includes("|")){let[a="",...b]=e.split("|");f=a.trim(),g=b.join("|").trim()}else if(e.includes(" ")){let a=e.indexOf(" ");f=e.substring(0,a).trim(),g=e.substring(a+1).trim()}else if(e.includes(":")){let a=e.indexOf(":"),b=e.substring(0,a).trim();b.includes("@")&&(f=b,g=e.substring(a+1).trim())}f&&g?c.push({line:b+1,email:f,password:g}):d.push(b+1)}),{parsed:c,invalidLines:d}}function E(a){return{total:a.length,queued:a.filter(a=>"queued"===a.status).length,running:a.filter(a=>"running"===a.status).length,success:a.filter(a=>"success"===a.status).length,failed:a.filter(a=>"failed"===a.status||"failed_invalid_credentials"===a.status||"failed_exchange"===a.status||"failed_timeout"===a.status).length,needs_manual:a.filter(a=>"needs_manual"===a.status).length}}function F(a,b,c="info"){return{id:(0,d.randomUUID)(),at:t(),step:a,message:b,level:c}}function G(a,b,c,d="info"){let e=F(b,c,d);return a.currentStep=b,a.updatedAt=e.at,a.logs=a.logs||[],a.logs.push(e),a.logs.length>40&&a.logs.splice(0,a.logs.length-40),e}function H(a){return a.flatMap(a=>(a.logs||[]).map(b=>({...b,email:a.email,line:a.line,workerId:a.workerId||null,status:a.status}))).sort((a,b)=>String(a.at).localeCompare(String(b.at))).slice(-80)}function I(a){if(!a)return null;try{let b=new URL(a);return(b.username||b.password)&&(b.username="***",b.password="***"),b.toString()}catch{return a.length>20?`${a.slice(0,10)}***${a.slice(-10)}`:a}}function J(a){return{email:a.email,status:a.status,error:a.error||null,connectionId:a.connectionId||null,workerId:a.workerId||null,line:a.line,proxyUrl:I(a.proxyUrl)||null,currentStep:a.currentStep||null,updatedAt:a.updatedAt||null,logs:(a.logs||[]).slice(-8),manualSessionAvailable:!!a.manualSession?.page&&"needs_manual"===a.status,manualSessionOpened:!!a.manualSession?.opened}}function K(a,b={}){return{jobId:a.jobId,status:a.status,summary:E(a.accounts),concurrency:a.concurrency,createdAt:a.createdAt,startedAt:a.startedAt,finishedAt:a.finishedAt,accounts:a.accounts.map(J),activity:H(a.accounts),error:a.error||null,preview:b.preview||null}}function L(a){if(!a||s.has(a.status))return!1;let b=a.finishedAt?Date.parse(a.finishedAt):NaN;return!!Number.isFinite(b)&&Date.now()-b<=18e5}function M(a,b={}){return a?{found:!0,stale:!1,recoverable:s.has(a.status)||L(a),job:a}:{found:!1,stale:!!b.stale,recoverable:!1,job:null}}async function N(a){let{launchBulkImportBrowser:b}=await c.e(5949).then(c.bind(c,75949));return b({engine:a?.engine||"chromium"})}async function O(a){let{exchangeAndSaveKiroSocialConnection:b}=await c.e(4136).then(c.bind(c,34136));return b(a)}async function P(a,b){let c=b?{proxy:{server:b}}:{},d="";try{d=a.browserType().name()}catch{}"firefox"===d&&(c.viewport=null);let e=await a.newContext(c),f=await e.newPage();return{context:e,page:f}}async function Q(a){let b,d;if(!a?.manualSession?.context)return!1;let e=a.manualSession.context,f=a.manualSession.page,g=e.browser?.(),h=null,i="";try{h=await e.storageState()}catch{h=null}try{i=f?.url?.()||""}catch{i=""}let{chromium:j}=await Promise.resolve().then(c.bind(c,83237));try{b=await j.launch({headless:!1,args:["--start-maximized"]})}catch{return!1}try{d=await b.newContext({viewport:null,...h?{storageState:h}:{}})}catch{return await b.close().catch(()=>null),!1}let k=await d.newPage();if(i)try{await k.goto(i,{waitUntil:"domcontentloaded",timeout:2e4})}catch{}let l=a.manualSession.rebind;if(a.manualSession.context=d,a.manualSession.page=k,a.manualSession.headedBrowser=b,"function"==typeof l)try{await l({context:d,page:k})}catch{}return e.close().catch(()=>null),g&&g!==b&&g.close().catch(()=>null),!0}async function R(a,{account:b}={}){if(!a)return!1;try{let c=a.context?.(),d=c?.browser?.();if(b&&function(a){if(!a)return!0;let b=a._options||a._initializer||{};return"boolean"!=typeof b.headless||b.headless}(d)&&await Q(b))return await b.manualSession.page.bringToFront?.().catch(()=>null),!0;if(!c?.newCDPSession)return await a.bringToFront?.().catch(()=>null),!0;let e=await c.newCDPSession(a),f=null;try{let a=await e.send("Target.getTargetInfo"),b=a?.targetInfo?.targetId,c=await e.send("Browser.getWindowForTarget",b?{targetId:b}:{});f=c?.windowId??null}catch{f=null}return null!=f&&await e.send("Browser.setWindowBounds",{windowId:f,bounds:{windowState:"normal",left:80,top:80,width:1280,height:960}}).catch(()=>null),await a.bringToFront?.().catch(()=>null),await e.detach?.().catch(()=>null),!0}catch{return await a.bringToFront?.().catch(()=>null),!0}}class S{constructor({browserLauncher:a=N,googleAutomation:b=o.Th,socialExchange:c=O,kiroServiceFactory:d=()=>new n.v,storageName:e="kiro-bulk-import"}={}){this.browserLauncher=a,this.googleAutomation=b,this.socialExchange=c,this.kiroServiceFactory=d,this.storageDir=h().join(i.DATA_DIR,e),this.metaFile=h().join(this.storageDir,"meta.json"),this.jobs=new Map,this.latestJobId=B(this.metaFile)}persistResumeBlob(a){try{!function(a,b){try{let c,e,g,i,j;u(h().dirname(a));let k=`${a}.${process.pid}.tmp`;f().writeFileSync(k,JSON.stringify((c=(0,d.randomBytes)(12),e=(0,d.createCipheriv)("aes-256-gcm",z(),c),g=Buffer.from(JSON.stringify(b),"utf8"),i=Buffer.concat([e.update(g),e.final()]),j=e.getAuthTag(),{v:1,alg:"aes-256-gcm",iv:c.toString("base64"),tag:j.toString("base64"),data:i.toString("base64")})),{mode:384}),f().renameSync(k,a)}catch{}}(y(a.jobId,this.storageDir),{jobId:a.jobId,concurrency:a.concurrency,engine:a.engine,proxyPoolMode:a.proxyPoolMode,proxyUrls:a.proxyUrls||[],createdAt:a.createdAt,accounts:a.accounts.map(a=>({line:a.line,email:a.email,password:a.password}))})}catch{}}hydrateInterruptedJob(a){if(!a||this.jobs.has(a))return!1;let b=w(v(a,this.storageDir));if(!b||!s.has(b.status))return!1;let c=function(a){let b=w(a);if(!b)return null;if(!b||"aes-256-gcm"!==b.alg||!b.iv||!b.tag||!b.data)return null;try{let a=(0,d.createDecipheriv)("aes-256-gcm",z(),Buffer.from(b.iv,"base64"));a.setAuthTag(Buffer.from(b.tag,"base64"));let c=Buffer.concat([a.update(Buffer.from(b.data,"base64")),a.final()]);return JSON.parse(c.toString("utf8"))}catch{return null}}(y(a,this.storageDir));if(!c||!Array.isArray(c.accounts)||0===c.accounts.length)return this.markJobInterrupted(a,b),!1;let e=new Map(c.accounts.map(a=>[a.line,a.password])),f=new Map(c.accounts.map(a=>[a.line,a.email])),g=b.createdAt||c.createdAt||t(),h=(b.accounts||[]).map(a=>{let b=p.has(a.status),c=Array.isArray(a.logs)?[...a.logs]:[],d={line:a.line,email:a.email||f.get(a.line)||"",password:b?void 0:e.get(a.line)??null,proxyUrl:null,status:a.status,error:a.error||null,connectionId:a.connectionId||null,workerId:b&&a.workerId||null,manualSession:null,runtimeSession:null,currentStep:a.currentStep||null,updatedAt:a.updatedAt||g,logs:c};return b||(d.status="queued",d.currentStep="queued",d.error=null,d.logs.push(F("resumed","Re-queued after a server restart to continue automatically"))),d}),i={jobId:a,status:"running",concurrency:C(c.concurrency),engine:c.engine||"chromium",proxyPoolMode:c.proxyPoolMode||"none",proxyUrls:Array.isArray(c.proxyUrls)?c.proxyUrls:[],createdAt:g,startedAt:b.startedAt||g,finishedAt:null,error:null,cancelRequested:!1,browser:null,nextIndex:0,manualFollowups:new Set,persistPromise:Promise.resolve(),lastPreview:b.preview||null,lastPreviewCapturedAt:0,accounts:h};return(this.jobs.set(a,i),this.latestJobId||(this.latestJobId=a),h.some(a=>"queued"===a.status))?this.runJob(a):(i.status="completed",i.finishedAt=t(),this.persistJobSnapshot(i,{forcePreview:!1}),A(y(a,this.storageDir))),!0}markJobInterrupted(a,b){let c="Job was interrupted by a server restart and could not be auto-resumed (saved credentials were unavailable). Please start a new bulk login.",d=(b.accounts||[]).map(a=>{if(p.has(a.status))return a;let b=Array.isArray(a.logs)?[...a.logs]:[];return b.push(F("failed",c,"error")),{...a,status:"failed",error:c,currentStep:"failed",updatedAt:t(),manualSessionAvailable:!1,logs:b}}),e={...b,status:"failed",error:b.error||c,finishedAt:b.finishedAt||t(),accounts:d,summary:E(d),activity:H(d)};try{x(v(a,this.storageDir),e)}catch{}A(y(a,this.storageDir))}async startJob({accounts:a,concurrency:b,engine:e,proxyPoolMode:f,proxyPoolId:g}){let{parsed:h,invalidLines:i}=D(a);if(!h.length){let a=i.length>0?"Invalid account format. Use one account per line: gmail@example.com|password":"At least one account entry is required",b={error:a};throw i.length>0&&(b.invalidLines=i),Object.assign(Error(a),b)}if(i.length>0){let a="Invalid account format. Use one account per line: gmail@example.com|password";throw Object.assign(Error(a),{error:a,invalidLines:i})}let k=[];if("all"===f)k=(await (0,j.ui)({isActive:!0})).map(a=>a.proxyUrl).filter(Boolean);else if("single"===f&&g){let a=await (0,j.hr)(g);a?.isActive&&a?.proxyUrl&&(k=[a.proxyUrl])}let l=(0,d.randomUUID)(),m=t(),{normalizeBulkImportEngine:n,DEFAULT_BULK_IMPORT_ENGINE:o}=await c.e(5949).then(c.bind(c,75949)),p=e?n(e):o,q={jobId:l,status:"running",concurrency:C(b),engine:p,proxyPoolMode:f||"none",proxyUrls:k,createdAt:m,startedAt:m,finishedAt:null,error:null,cancelRequested:!1,browser:null,nextIndex:0,manualFollowups:new Set,persistPromise:Promise.resolve(),lastPreview:null,lastPreviewCapturedAt:0,accounts:h.map(a=>({line:a.line,email:a.email,password:a.password,proxyUrl:null,status:"queued",error:null,connectionId:null,workerId:null,manualSession:null,runtimeSession:null,currentStep:"queued",updatedAt:m,logs:[F("queued","Queued and waiting for an available worker")]}))};return this.jobs.set(l,q),this.latestJobId=l,!function(a,b=r){x(b,{latestJobId:a||null,updatedAt:t()})}(l,this.metaFile),await this.persistJobSnapshot(q,{forcePreview:!1}),this.persistResumeBlob(q),this.runJob(l),K(q)}getJob(a){this.hydrateInterruptedJob(a);let b=this.jobs.get(a);return b?K(b,{preview:b.lastPreview||null}):w(v(a,this.storageDir))}async getJobWithPreview(a){this.hydrateInterruptedJob(a);let b=this.jobs.get(a);if(!b)return w(v(a,this.storageDir));let c=await this.capturePreview(b);return b.lastPreview=c||b.lastPreview||null,await this.persistJobSnapshot(b,{forcePreview:!1}),K(b,{preview:b.lastPreview||null})}async getLatestJobWithPreview({includeRecentTerminal:a=!1}={}){let b=this.latestJobId||B(this.metaFile);if(!b)return null;let c=await this.getJobWithPreview(b);return c&&(s.has(c.status)||a&&L(c))?c:null}cancelJob(a){let b=this.jobs.get(a);return b?(b.cancelRequested=!0,"queued"===b.status&&(b.status="cancelled",b.finishedAt=t(),b.accounts.forEach(a=>{"queued"===a.status&&(a.status="cancelled")})),b.browser&&(b.browser.close().catch(()=>null),b.browser=null),this.persistJobSnapshot(b,{forcePreview:!0}),K(b)):w(v(a,this.storageDir))}async openManualSession(a,b){let c=this.jobs.get(a);if(!c)return null;let d=Number.parseInt(b,10),e=c.accounts.find(a=>a.workerId===d&&"needs_manual"===a.status&&a.manualSession?.page);if(!e)return{ok:!1,error:"Manual session not found for this worker",job:K(c)};let f=await R(e.manualSession.page,{account:e});return e.manualSession.opened=f,e.manualSession.openedAt=f?e.manualSession.openedAt||t():e.manualSession.openedAt||null,await this.persistJobSnapshot(c,{forcePreview:!0}),{ok:!0,job:K(c),account:J(e)}}dequeueAccount(a,b){for(;a.nextIndex<a.accounts.length;){let c=a.accounts[a.nextIndex];if(a.nextIndex+=1,"queued"===c.status)return c.status="running",c.workerId=b,c.error=null,a.proxyUrls?.length&&(c.proxyUrl=a.proxyUrls[(a.nextIndex-1)%a.proxyUrls.length]),G(c,"worker_assigned",`Worker ${b} picked up this account${c.proxyUrl?` (proxy: ${I(c.proxyUrl)})`:""}`),this.persistJobSnapshot(a,{forcePreview:!1}),c}return null}finalizeAccount(a,b,c={}){return a.status=b,a.error=c.error||null,a.connectionId=c.connectionId||null,(c.step||c.message)&&G(a,c.step||b,c.message||c.error||b.replaceAll("_"," ")),a}setAccountStep(a,b,c,d="info"){G(a,b,c,d)}async persistJobSnapshot(a,{forcePreview:b=!1}={}){if(!a)return;let c=async()=>{if(b||Date.now()-(a.lastPreviewCapturedAt||0)>=1500){let b=await this.capturePreview(a);b&&(a.lastPreview=b),a.lastPreviewCapturedAt=Date.now()}x(v(a.jobId,this.storageDir),K(a,{preview:a.lastPreview||null}))};a.persistPromise=Promise.resolve(a.persistPromise).catch(()=>null).then(c),await a.persistPromise}async capturePreview(a){let b=a.accounts.find(a=>"running"===a.status&&a.runtimeSession?.page)||a.accounts.find(a=>"needs_manual"===a.status&&a.manualSession?.page);if(!b)return null;let c=b.runtimeSession?.page||b.manualSession?.page;if(!c)return null;try{let a=await c.screenshot({type:"jpeg",quality:55,fullPage:!1,animations:"disabled",caret:"hide"});return{email:b.email,workerId:b.workerId||null,status:b.status,step:b.currentStep||null,updatedAt:b.updatedAt||t(),imageData:`data:image/jpeg;base64,${a.toString("base64")}`}}catch{return{email:b.email,workerId:b.workerId||null,status:b.status,step:b.currentStep||null,updatedAt:b.updatedAt||t(),imageData:null}}}async runManualFollowup(a,b,c,d,e,f){let g=(async()=>{let c=async()=>{let a=b.manualSession,c=a?.context||d,e=a?.headedBrowser||null;c&&await c.close().catch(()=>null),e&&await e.close().catch(()=>null)};try{let c=await e;if(a.cancelRequested){this.finalizeAccount(b,"cancelled",{error:"Job cancelled",step:"cancelled",message:"Job cancelled while waiting for manual completion"}),await this.persistJobSnapshot(a,{forcePreview:!0});return}this.setAccountStep(b,"exchanging_tokens","Exchanging Kiro callback for OAuth tokens"),await this.persistJobSnapshot(a,{forcePreview:!0});let{connection:d}=await this.socialExchange({code:c.code,codeVerifier:f,provider:"google"});this.finalizeAccount(b,"success",{connectionId:d.id,step:"connection_saved",message:"Kiro connection saved successfully"}),await this.persistJobSnapshot(a,{forcePreview:!0})}catch(c){a.cancelRequested?this.finalizeAccount(b,"cancelled",{error:"Job cancelled",step:"cancelled",message:"Job cancelled while waiting for manual completion"}):this.finalizeAccount(b,"failed_exchange",{error:c.message||"Manual assist flow failed during token exchange.",step:"exchange_failed",message:c.message||"Manual assist flow failed during token exchange."}),await this.persistJobSnapshot(a,{forcePreview:!0})}finally{await c(),b.manualSession=null,b.runtimeSession=null,a.manualFollowups.delete(g),await this.persistJobSnapshot(a,{forcePreview:!0})}})();a.manualFollowups.add(g)}async processAccount(a,b,c){if(a.cancelRequested||!a.browser)return void this.finalizeAccount(b,"cancelled",{error:"Job cancelled"});let d=this.kiroServiceFactory().createSocialAuthorization("google"),{context:e,page:f}=await P(a.browser,b.proxyUrl),g=(0,o.zZ)(e,f);b.runtimeSession={context:e,page:f};try{this.setAccountStep(b,"preparing_worker",`Worker ${c} is preparing a browser context`),await this.persistJobSnapshot(a,{forcePreview:!0});let h=await this.googleAutomation({page:f,authUrl:d.authUrl,email:b.email,password:b.password,callbackPromise:g,onStep:(c,d)=>{this.setAccountStep(b,c,d),this.persistJobSnapshot(a,{forcePreview:!1})}});if("success"===h.status){this.setAccountStep(b,"exchanging_tokens","Exchanging Kiro callback for OAuth tokens"),await this.persistJobSnapshot(a,{forcePreview:!0});let{connection:c}=await this.socialExchange({code:h.code,codeVerifier:d.codeVerifier,provider:"google"});this.finalizeAccount(b,"success",{connectionId:c.id,step:"connection_saved",message:"Kiro connection saved successfully"}),b.runtimeSession=null,await e.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0});return}if("needs_manual"===h.status){b.manualSession={context:e,page:f,opened:!1,openedAt:null,rebind:"function"==typeof g?.rebind?g.rebind:null},this.setAccountStep(b,"awaiting_manual","Waiting for manual completion in the browser session"),this.finalizeAccount(b,"needs_manual",{error:h.error,step:"awaiting_manual",message:h.error}),await this.persistJobSnapshot(a,{forcePreview:!0}),await this.runManualFollowup(a,b,c,e,g,d.codeVerifier);return}let i=p.has(h.status)?h.status:"failed";this.finalizeAccount(b,i,{error:h.error||"Kiro Google automation failed.",step:i,message:h.error||"Kiro Google automation failed."}),b.runtimeSession=null,await e.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0})}catch(c){this.finalizeAccount(b,"failed",{error:c.message||"Unexpected Kiro bulk import failure.",step:"failed",message:c.message||"Unexpected Kiro bulk import failure."}),b.runtimeSession=null,await e.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0})}finally{b.password=void 0}}async runWorker(a,b){for(;!a.cancelRequested;){let c=this.dequeueAccount(a,b);if(!c)return;await this.processAccount(a,c,b)}}async runJob(a){let b=this.jobs.get(a);if(b)try{b.browser=await this.browserLauncher(b),b.accounts.forEach(a=>{"queued"===a.status&&1===(a.logs||[]).length&&this.setAccountStep(a,"waiting_for_worker","Waiting for a free worker")}),await this.persistJobSnapshot(b,{forcePreview:!1});let a=Math.min(b.concurrency,Math.max(b.accounts.length,1)),c=Array.from({length:a},(a,c)=>this.runWorker(b,c+1));await Promise.allSettled(c),b.manualFollowups.size>0&&await Promise.allSettled([...b.manualFollowups]),b.cancelRequested?(b.status="cancelled",b.accounts.forEach(a=>{("queued"===a.status||"running"===a.status)&&this.finalizeAccount(a,"cancelled",{error:"Job cancelled",step:"cancelled",message:"Job cancelled before completion"})})):b.status="completed",await this.persistJobSnapshot(b,{forcePreview:!0})}catch(a){b.status="failed",b.error=a.message||"Failed to start Kiro bulk import job.",b.accounts.forEach(a=>{("queued"===a.status||"running"===a.status)&&(this.finalizeAccount(a,"failed",{error:b.error,step:"failed",message:b.error}),a.password=void 0)}),await this.persistJobSnapshot(b,{forcePreview:!0})}finally{b.browser&&(await b.browser.close().catch(()=>null),b.browser=null),b.finishedAt=t(),await this.persistJobSnapshot(b,{forcePreview:!0}),A(y(b.jobId,this.storageDir))}}}function T(){return(!globalThis.__kiroBulkImportSingleton&&(globalThis.__kiroBulkImportSingleton={manager:new S}),globalThis.__kiroBulkImportSingleton).manager}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.getProviderConnections,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},82506:(a,b,c)=>{c.d(b,{$K:()=>Q,Jl:()=>E,PB:()=>T,Th:()=>V,i_:()=>P,np:()=>O,rk:()=>U,zZ:()=>S});let d='input[type="email"], input[autocomplete="username"], input#identifierId, input[name="identifier"], input[name="Email"], input[type="text"][autofocus], input[aria-label*="Email" i], input[aria-label*="email" i], input[aria-label*="phone" i], input[aria-label*="telepon" i]',e=['button:has-text("Next")','button:has-text("Berikutnya")','button:has-text("Continue")','div[role="button"]:has-text("Next")','div[role="button"]:has-text("Berikutnya")',"#identifierNext button","#passwordNext button"],f=["#submit_approve_access","#submit_approve_access button","#confirm",'form#tos_form input[type="submit"]','button[jsname]:has-text("Allow")','button:has-text("Allow")','[role="button"]:has-text("Allow")','input[type="submit"][value="Allow"]','input[type="button"][value="Allow"]','button[jsname]:has-text("Izinkan")','button:has-text("Izinkan")','[role="button"]:has-text("Izinkan")','button:has-text("Continue")','button:has-text("Next")','button:has-text("Yes")','button:has-text("Accept")','button:has-text("Lanjutkan")','button:has-text("Berikutnya")','button:has-text("Setuju")','button:has-text("Saya mengerti")','button:has-text("Oke")','button:has-text("OK")','button:has-text("Got it")','button:has-text("I understand")','div[role="button"]:has-text("Continue")','div[role="button"]:has-text("Next")','div[role="button"]:has-text("Allow")','div[role="button"]:has-text("Lanjutkan")','div[role="button"]:has-text("Berikutnya")','div[role="button"]:has-text("Izinkan")','div[role="button"]:has-text("Setuju")','div[role="button"]:has-text("Saya mengerti")','div[role="button"]:has-text("Oke")','div[role="button"]:has-text("OK")','div[role="button"]:has-text("Got it")','div[role="button"]:has-text("I understand")','input[type="button"][value="Saya mengerti"]','input[type="submit"][value="Saya mengerti"]'],g=['button:has-text("Skip")','button:has-text("Lewati")','button:has-text("Not now")','button:has-text("Bukan sekarang")','button:has-text("No thanks")','button:has-text("Tidak sekarang")','div[role="button"]:has-text("Skip")','div[role="button"]:has-text("Not now")'],h=["#social-google","a#social-google",'a:has-text("Sign up with Google")','a:has-text("Log in with Google")','button:has-text("Sign up with Google")','button:has-text("Log in with Google")','button:has-text("Google")','a:has-text("Google")','div[role="button"]:has-text("Google")','span:has-text("Google")','[aria-label*="Google"]','[data-provider*="google" i]'],i=["#agree-policy-account","#agree-policy","#agree-policy-sso",'input[type="checkbox"][id*="agree" i]','input[type="checkbox"][name*="agree" i]','input[type="checkbox"][id*="policy" i]','input[type="checkbox"][name*="policy" i]','input[type="checkbox"][id*="terms" i]','input[type="checkbox"][name*="terms" i]','.login-checkbox input[type="checkbox"]','[class*="checkbox"] input[type="checkbox"]','[class*="agree"] input[type="checkbox"]','input[type="checkbox"]'],j=['.ui-dialog button:has-text("Confirm")','dialog button:has-text("Confirm")','button:has-text("Confirm")','button:has-text("I agree")','button:has-text("Agree")','button:has-text("同意")','button:has-text("确认")'],k=['button:has-text("Continue")','[role="button"]:has-text("Continue")','button:has-text("Get started")','button:has-text("GET STARTED")','input[type="submit"][value="GET STARTED"]','button:has-text("Start")','button:has-text("Confirm")','button:has-text("Done")','button:has-text("Next")','button:has-text("Skip")','button:has-text("Not now")','button:has-text("Save")','button:has-text("Create")','button:has-text("Enter")','button:has-text("Launch")','button:has-text("Use CodeBuddy")','button:has-text("Go to CodeBuddy")'],l=["select",'[role="combobox"]','.page-region [role="combobox"]',".page-region .t-select",'.page-region [class*="t-select"]','.page-region [class*="select"]',".page-region input[placeholder]",'button:has-text("Region")','[role="button"]:has-text("Region")','button:has-text("Select region")','[role="button"]:has-text("Select region")','button:has-text("Data region")','[aria-label*="region" i]','[placeholder*="region" i]'],m=["text=/^Indonesia$/i","text=/^ID$/i","text=/^Singapore$/i","text=/^SG$/i","text=/^Japan$/i","text=/^JP$/i","text=/^Thailand$/i","text=/^TH$/i","text=/^Global$/i","text=/^International$/i","text=/^United States$/i","text=/^US$/i","text=/^Asia Pacific$/i","text=/^Hong Kong$/i","text=/^Default$/i"],n=[{selector:'input[name*="workspace" i]',value:"Default"},{selector:'input[placeholder*="workspace" i]',value:"Default"},{selector:'input[name*="team" i]',value:"Default"},{selector:'input[placeholder*="team" i]',value:"Default"},{selector:'input[name*="name" i]',value:"Default"},{selector:'input[placeholder*="name" i]',value:"Default"}],o=["wrong password","incorrect password","couldn't find your google account","couldn’t find your google account","enter a valid email","couldn’t sign you in","couldn't sign you in","invalid email or password","password is incorrect"],p=["2-step verification","2-step verification required","verify it’s you","verify it's you","check your phone","confirm it’s you","confirm it's you","recovery email","recovery phone","suspicious sign-in prevented","unusual activity detected","captcha","try again later"],q=["restricted","account has been restricted","account is restricted","account has been suspended","account is suspended","account has been disabled","account is disabled","account has been banned","account is banned","access denied","account blocked","your account has been","violation of terms","terms of service violation","temporarily locked","permanently locked","account locked","akun dibatasi","akun diblokir","akun ditangguhkan"],r=["welcome to your new google account","selamat datang di akun google baru anda","welcome to your new account","selamat datang di akun baru","privacy and terms","privasi dan persyaratan","personalize your google services","personalisasikan layanan google anda","add recovery phone","tambahkan nomor telepon pemulihan","choose your settings","pilih setelan anda"],s=["welcome to your new account","selamat datang di akun baru","your administrator decides which","administrator anda memutuskan layanan","your organisation administrator manages","your organization administrator manages"];function t(a){if(!a||!a.startsWith("kiro://kiro.kiroAgent/authenticate-success"))return null;let b=a.indexOf("?"),c=new URLSearchParams(b>=0?a.slice(b+1):""),d=c.get("code"),e=c.get("state");return d?{callbackUrl:a,code:d,state:e}:null}function u(a){let b="function"==typeof a.frames?a.frames():[];return[a,...b.filter(b=>b!==a.mainFrame?.())]}async function v(a,b){for(let c of u(a))for(let a of b){let b=c.locator(a).first();if(await b.count().catch(()=>0)&&await b.isVisible().catch(()=>!1))return await b.click({timeout:5e3}).catch(()=>null),!0}return!1}async function w(a,b){for(let c of u(a))for(let a of b){let b=c.locator(a).first();if(await b.count().catch(()=>0)){if((await b.scrollIntoViewIfNeeded().catch(()=>null),await b.isVisible().catch(()=>!1)&&await b.isEnabled().catch(()=>!0))&&await b.click({timeout:5e3}).then(()=>!0).catch(()=>!1))return!0}}return!1}async function x(a,b){for(let c of u(a))for(let a of b){let b=c.locator(a).first();if(!await b.count().catch(()=>0))continue;if(await b.isChecked().catch(()=>!1))return!0;let d=await b.isVisible().catch(()=>!1);if(d&&await b.check({force:!0,timeout:5e3}).then(()=>!0).catch(()=>!1)||d&&await b.click({force:!0,timeout:5e3}).then(()=>!0).catch(()=>!1)||await c.evaluate(a=>{let b=document.querySelector(a);return b instanceof HTMLInputElement&&(b.checked=!0,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})),b.checked)},a).catch(()=>!1))return!0}return!1}async function y(a,b){for(let c of u(a)){let a=c.locator(b).first();if(await a.count().catch(()=>0)&&await a.isVisible().catch(()=>!1))return a}return null}async function z(a,b,{timeout:c=15e3,pollInterval:d=500}={}){let e=Date.now()+c;for(;Date.now()<e;){let c=await y(a,b);if(c)return c;let f=e-Date.now();if(f<=0)break;await new Promise(a=>setTimeout(a,Math.min(d,f)))}return null}async function A(a,b,{timeout:c=15e3}={}){if(!a||null==b)return!1;try{await a.fill(b,{timeout:c})}catch{}let d="";try{d=await a.inputValue()}catch{d=""}if(d===b)return!0;try{await a.click({timeout:5e3})}catch{}try{await a.fill("")}catch{}try{await a.type(b,{delay:50,timeout:c})}catch{return!1}try{d=await a.inputValue()}catch{d=""}return d===b}async function B(a){let b=[];for(let c of u(a))try{b.push(await c.evaluate(()=>document.body?.innerText||""))}catch{}return b.join("\n")}function C(a,b){let c=String(a||"").toLowerCase();return b.some(a=>c.includes(a))}function D(a){try{let b=new URL(a.url());return"accounts.google.com"===b.hostname||b.hostname.endsWith(".accounts.google.com")}catch{return!1}}function E(a){try{let b=new URL(a.url());return/codebuddy\.(ai|cn)$/.test(b.hostname)||b.hostname.endsWith(".codebuddy.ai")||b.hostname.endsWith(".codebuddy.cn")}catch{return!1}}async function F(a,b){if(!D(a))return!1;let c=await B(a);return!!/wants to access|ingin mengakses|akses ke akun google|allow/i.test(c)&&(await a.evaluate(()=>{let a=document.scrollingElement||document.documentElement||document.body;a&&(a.scrollTop=a.scrollHeight),window.scrollTo(0,document.body?.scrollHeight||document.documentElement?.scrollHeight||0)}).catch(()=>null),await a.waitForTimeout(300),!!await w(a,f)&&(b("approving_google_consent","Approving Google OAuth consent"),await a.waitForTimeout(1e3),!0))}async function G(a,b){let c=String(b||"");if(!C(c,r))return!1;if(await a.evaluate(()=>{let a=document.scrollingElement||document.documentElement||document.body;a&&(a.scrollTop=a.scrollHeight),window.scrollTo(0,document.body?.scrollHeight||document.documentElement?.scrollHeight||0)}).catch(()=>null),await a.waitForTimeout(500),C(c,s)){if(await w(a,f))return await a.waitForTimeout(700),!0;if(await a.evaluate(()=>{let a=[document.getElementById("confirm"),document.querySelector('form#tos_form input[type="submit"]'),document.querySelector('input[type="submit"][value="Saya mengerti"]'),document.querySelector('input[type="submit"][value="I understand"]')].filter(Boolean)[0];return!!a&&(a.scrollIntoView({block:"center"}),a.click(),!0)}).catch(()=>!1)||await a.evaluate(()=>{let a=document.getElementById("tos_form");return!!a&&(a.submit(),!0)}).catch(()=>!1))return await a.waitForTimeout(800),!0}return!!(await w(a,g)||await w(a,f))&&(await a.waitForTimeout(700),!0)}async function H(a){let b=/global|international|singapore|united states|^us$|asia|hong kong|default/i;for(let c of u(a)){let a=c.locator("select"),d=await a.count().catch(()=>0);for(let c=0;c<d;c+=1){let d=a.nth(c),e=await d.isVisible().catch(()=>!1),f=await d.isEnabled().catch(()=>!0);if(!e||!f)continue;let g=await d.evaluate((a,b)=>{let c=RegExp(b,"i"),d=[...a.options].filter(a=>!a.disabled&&""!==a.value),e=d.find(a=>c.test(`${a.label} ${a.textContent} ${a.value}`));return(e||d[0])?.value||""},b.source).catch(()=>"");if(g&&await d.selectOption(g).then(()=>!0).catch(()=>!1))return!0}}return!1}async function I(a){let b=!1;for(let c of u(a))for(let{selector:a,value:d}of n){let e=c.locator(a).first();if(!await e.count().catch(()=>0))continue;let f=await e.isVisible().catch(()=>!1),g=await e.isEnabled().catch(()=>!0);!(!f||!g||await e.inputValue().catch(()=>""))&&await e.fill(d,{timeout:5e3}).then(()=>!0).catch(()=>!1)&&(b=!0)}return b}async function J(a,b){await b.scrollIntoViewIfNeeded().catch(()=>null);let c=await b.isVisible().catch(()=>!1),d=await b.isEnabled().catch(()=>!0);if(!c||!d)return!1;let e=await b.boundingBox().catch(()=>null);if(!e||e.width<=0||e.height<=0)return!1;let f=e.x+e.width/2,g=e.y+e.height/2;return await a.mouse.move(f,g),await a.mouse.down(),await a.mouse.up(),!0}async function K(a,b,c){for(let d of u(a)){let e=d.locator(b),f=Math.min(await e.count().catch(()=>0),80),g=[];for(let a=0;a<f;a+=1){let b=e.nth(a);if(!await b.isVisible().catch(()=>!1))continue;let c=(await b.innerText({timeout:1e3}).catch(()=>"")||await b.textContent({timeout:1e3}).catch(()=>"")||"").trim();c&&g.push({locator:b,text:c})}for(let b of c){let c=g.find(a=>b.test(a.text));if(c&&await J(a,c.locator).catch(()=>!1))return c.text}if(g[0]&&await J(a,g[0].locator).catch(()=>!1))return g[0].text}return""}async function L(a,b){for(let c of u(a))for(let d of b){let b=c.locator(d),e=Math.min(await b.count().catch(()=>0),20);for(let c=0;c<e;c+=1){let d=b.nth(c);if(await J(a,d).catch(()=>!1))return!0}}return!1}async function M(a,b){if(!E(a)||D(a))return!1;let c=await a.evaluate(async()=>{let a=document.body?.innerText||"";if(!(document.querySelector(".page-region")||/select\s+region|region|country|area|get started|complete/i.test(a)))return null;try{let a=await fetch("https://www.codebuddy.ai/console/login/account",{method:"POST",credentials:"include",headers:{accept:"application/json, text/plain, */*","content-type":"application/json","x-requested-with":"XMLHttpRequest","x-domain":window.location.hostname||"www.codebuddy.ai"},referrer:"https://www.codebuddy.ai/register/user/complete",body:JSON.stringify({attributes:{countryCode:["62"],countryFullName:["Indonesia"],countryName:["ID"]}})}),b=await a.text().catch(()=>""),c=null;try{c=b?JSON.parse(b):null}catch{c={raw:b}}if(a.ok&&(!c||0===c.code||200===c.code||void 0===c.code))return{action:"submitted_via_api"};return{action:"api_failed",status:a.status,code:c?.code,message:c?.msg||c?.message||b||`HTTP ${a.status}`}}catch(a){return{action:"api_failed",message:a?.message||"region submit request failed"}}}).catch(()=>null);return!!c?.action&&("submitted_via_api"===c.action?(b("submitting_codebuddy_region","Submitted CodeBuddy region via account API"),await a.waitForTimeout(1500),!0):(b("codebuddy_region_api_failed",c.message?`CodeBuddy region API submit failed: ${c.message}`:"CodeBuddy region API submit failed"),!1))}async function N(a,b){if(!E(a)||D(a)||!await a.locator(".page-region").first().count().then(Boolean).catch(()=>!1))return!1;let c=[/indonesia|^id$|\u5370\u5ea6\u5c3c\u897f\u4e9a/i,/singapore|^sg$|\u65b0\u52a0\u5761/i,/japan|^jp$|\u65e5\u672c/i,/thailand|^th$|\u6cf0\u56fd/i,/global|international|default/i];if(await L(a,[".page-region [class*='28B894']",".page-region button:has-text('Get started')",".page-region button:has-text('Start')",".page-region button:has-text('Submit')",".page-region button:has-text('Continue')",".page-region [role='button']:has-text('Get started')",".page-region [role='button']:has-text('Start')",".page-region [role='button']:has-text('Submit')",".page-region [role='button']:has-text('Continue')"]))return b("submitting_codebuddy_region","Submitted CodeBuddy region selection"),await a.waitForTimeout(1200),!0;let d=await K(a,"ul.dropdown-section li, .dropdown-section li, [role='option'], .t-select-option, [class*='option']",c);if(d)return b("selecting_codebuddy_region",`Selected CodeBuddy region: ${d}`),await a.waitForTimeout(900),!0;if(!await L(a,[".page-region .t-select",".page-region [class*='t-select']",".page-region [role='combobox']",".page-region input[placeholder]",".page-region [class*='select']",".page-region [class*='cursor-pointer']"]))return!1;b("opening_codebuddy_region_selector","Opening CodeBuddy region selector"),await a.waitForTimeout(600);let e=await K(a,"ul.dropdown-section li, .dropdown-section li, [role='option'], .t-select-option, [class*='option']",c);return e&&(b("selecting_codebuddy_region",`Selected CodeBuddy region: ${e}`),await a.waitForTimeout(900)),!0}async function O(a,b){if(!E(a)||D(a))return!1;if(await M(a,b)||await N(a,b))return!0;for(let c of u(a)){let d=await c.evaluate(()=>{let a=a=>{if(!(a instanceof HTMLElement))return!1;let b=window.getComputedStyle(a);if("hidden"===b.visibility||"none"===b.display||0===Number(b.opacity))return!1;let c=a.getBoundingClientRect();return c.width>0&&c.height>0},b=document.querySelector(".page-region"),c=document.body?.innerText||"";if(!(b||/select\s+region|region|country|area|get started|complete/i.test(c)))return null;let d=a=>{for(let b of(a.scrollIntoView({block:"center",inline:"center"}),["pointerdown","mousedown","pointerup","mouseup","click"]))a.dispatchEvent(new MouseEvent(b,{bubbles:!0,cancelable:!0,view:window,buttons:+!!b.endsWith("down")}))},e=[/indonesia|^id$|\u5370\u5ea6\u5c3c\u897f\u4e9a/i,/singapore|^sg$|\u65b0\u52a0\u5761/i,/japan|^jp$|\u65e5\u672c/i,/thailand|^th$|\u6cf0\u56fd/i,/global|international|default/i],f=b||document.body,g=["button","[role='button']","input[type='submit']",".t-button","[class*='button']","[class*='28B894']"],h=[...f.querySelectorAll(g.join(","))].filter(a).filter(a=>{let b=`${a.innerText||""} ${a.getAttribute("aria-label")||""} ${a.getAttribute("value")||""}`,c=a.getAttribute("class")||"";return/submit|start|continue|confirm|done|get started|complete|\u5b8c\u6210|\u5f00\u59cb|\u786e\u5b9a|\u4e0b\u4e00\u6b65/i.test(b)||c.includes("28B894")});if(h.length)return d(h[0]),{action:"submitted"};let i=["ul.dropdown-section li",".dropdown-section li","[role='option']",".t-select-option","[class*='option']","[class*='dropdown'] li"],j=[...document.querySelectorAll(i.join(","))].filter(a).filter(a=>(a.innerText||a.textContent||"").trim());if(j.length){let a=e.map(a=>j.find(b=>a.test((b.innerText||b.textContent||"").trim()))).find(Boolean)||j[0],b=(a.innerText||a.textContent||"").trim();return d(a),{action:"selected",label:b}}let k=["[role='combobox']",".t-select","[class*='t-select']","[class*='select']","input[placeholder]",".text-sm","[class*='cursor-pointer']"],l=[...f.querySelectorAll(k.join(","))].filter(a).filter(a=>{let b=`${a.innerText||""} ${a.getAttribute("placeholder")||""} ${a.getAttribute("aria-label")||""}`;return/region|country|area|select|placeholder|\u5730\u533a|\u56fd\u5bb6|\u9009\u62e9/i.test(b)||a.matches?.(".t-select,[class*='t-select'],input[placeholder],[class*='select']")});return l.length?(d(l[0]),{action:"opened"}):null}).catch(()=>null);if(d?.action){if("selected"===d.action)return b("selecting_codebuddy_region",`Selected CodeBuddy region${d.label?`: ${d.label}`:""}`),await a.waitForTimeout(700),!0;if("submitted"===d.action)return b("submitting_codebuddy_region","Submitted CodeBuddy region selection"),await a.waitForTimeout(1200),!0;return b("opening_codebuddy_region_selector","Opening CodeBuddy region selector"),await a.waitForTimeout(700),!0}}return!1}async function P(a,b){if(!E(a)||D(a))return!1;let c=await a.evaluate(async()=>{let a=new URL(window.location.href);if(!/\/started\/?$/.test(a.pathname))return null;let b=a.searchParams.get("platform")||"CLI",c=a.searchParams.get("state");if(!c)return null;for(let a of[...new Set([window.location.hostname||"www.codebuddy.ai"].filter(Boolean))]){let d=new URL("/console/auth/login",window.location.origin);d.searchParams.set("platform",b),d.searchParams.set("state",c),d.searchParams.set("domain",a);try{let b=await fetch(d.toString(),{method:"GET",credentials:"include",redirect:"manual",headers:{"x-requested-with":"XMLHttpRequest","X-Domain":a}});if("opaqueredirect"===b.type||b.status>=300&&b.status<400)return{action:"attempted",domain:a,message:"redirected"};let c=await b.text(),e=null;try{e=c?JSON.parse(c):null}catch{e={raw:c}}if(b.ok&&(!e||0===e.code||200===e.code||void 0===e.code))return{action:"authorized",domain:a};if(b.ok)return{action:"attempted",domain:a,code:e?.code,message:e?.msg||e?.message||""}}catch(a){}}return{action:"failed"}}).catch(()=>null);return!!c?.action&&"failed"!==c.action&&("authorized"===c.action?b("authorizing_codebuddy_cli_state","Authorized CodeBuddy CLI login state"):b("authorizing_codebuddy_cli_state",c.message?`Attempted CodeBuddy CLI login state authorization: ${c.message}`:"Attempted CodeBuddy CLI login state authorization"),await a.waitForTimeout(1200),!0)}async function Q(a,b,c){return!(!E(a)||D(a))&&(await w(a,j)?(b("accepting_provider_privacy_dialog",`Confirmed ${c} privacy or terms dialog`),await a.waitForTimeout(800),!0):!!(await P(a,b)||await O(a,b))||(await H(a)?(b("selecting_provider_region",`Selected ${c} region`),await a.waitForTimeout(700),!0):await w(a,l)?(b("opening_provider_region_selector",`Opening ${c} region selector`),await a.waitForTimeout(500),await w(a,m)&&(b("selecting_provider_region",`Selected ${c} region`),await a.waitForTimeout(700)),!0):await w(a,m)?(b("selecting_provider_region",`Selected ${c} region`),await a.waitForTimeout(700),!0):await I(a)?(b("filling_provider_onboarding",`Filled ${c} onboarding defaults`),await a.waitForTimeout(500),!0):!!await w(a,k)&&(b("continuing_provider_onboarding",`Continuing ${c} onboarding`),await a.waitForTimeout(1e3),!0)))}async function R(a,b){return!D(a)&&(await w(a,j)?(b("accepting_provider_privacy_dialog","Confirmed provider privacy agreement dialog"),await a.waitForTimeout(1e3),!0):(await x(a,i)&&(b("accepting_provider_terms","Accepted provider terms for Google login"),await a.waitForTimeout(400)),!!await w(a,h)&&(b("selecting_google_login","Selecting Google login"),await a.waitForTimeout(1e3),await w(a,j)&&(b("accepting_provider_privacy_dialog","Confirmed provider privacy agreement dialog"),await a.waitForTimeout(1e3)),!0)))}function S(a,b,c=9e5){let d,e,f=new Promise((a,b)=>{d=a,e=b}),g=!1,h=new Set,i=new Map,j=setTimeout(()=>{k(null,Error("Timed out waiting for Kiro callback"))},c);function k(a,b=null){if(!g){for(let a of(g=!0,clearTimeout(j),i.values()))for(let b of a)try{b()}catch{}i.clear(),b?e(b):d(a)}}function l(a,b){if(!a||h.has(a))return;h.add(a);let c=a=>{let b=t(a?.url?.()||"");b&&k(b)},d=a=>{let b=t(a?.url?.()||"");b&&k(b)},e=a=>{let b=t(a?.url?.()||"");b&&k(b)},f=()=>{let b=t(a.url?.()||"");b&&k(b)};a.on("framenavigated",c),a.on("request",d),a.on("requestfailed",e),a.on("domcontentloaded",f),a.on("load",f),b.push(()=>{a.off("framenavigated",c),a.off("request",d),a.off("requestfailed",e),a.off("domcontentloaded",f),a.off("load",f)});let g=t(a.url?.()||"");g&&k(g)}function m(a,b){if(g||i.has(a))return;let c=[];i.set(a,c);let d=a=>l(a,c);a.on("page",d),c.push(()=>a.off("page",d)),b&&l(b,c)}return m(a,b),f.rebind=({context:a,page:b}={})=>{a&&m(a,b)},f}function T(a,b,{prefix:c,timeoutMs:d=9e5}={}){let e,f,g=new Promise((a,b)=>{e=a,f=b}),h=!1,i=new Set,j=new Map,k=setTimeout(()=>{l(null,Error("Timed out waiting for OAuth callback"))},d);function l(a,b=null){if(!h){for(let a of(h=!0,clearTimeout(k),j.values()))for(let b of a)try{b()}catch{}j.clear(),b?f(b):e(a)}}function m(a,b){if(!a||i.has(a))return;i.add(a);let d=a=>{let b=function(a,b){if(!a||!b||!a.startsWith(b))return null;let c=a.indexOf("?"),d=new URLSearchParams(c>=0?a.slice(c+1):""),e=d.get("code"),f=d.get("state");return e?{callbackUrl:a,code:e,state:f}:null}(a||"",c);b&&l(b)},e=a=>d(a?.url?.()||""),f=a=>d(a?.url?.()||""),g=a=>d(a?.url?.()||""),h=()=>d(a.url?.()||"");a.on("framenavigated",e),a.on("request",f),a.on("requestfailed",g),a.on("domcontentloaded",h),a.on("load",h),b.push(()=>{a.off("framenavigated",e),a.off("request",f),a.off("requestfailed",g),a.off("domcontentloaded",h),a.off("load",h)}),d(a.url?.()||"")}function n(a,b){if(h||j.has(a))return;let c=[];j.set(a,c);let d=a=>m(a,c);a.on("page",d),c.push(()=>a.off("page",d)),b&&m(b,c)}return n(a,b),g.rebind=({context:a,page:b}={})=>{a&&n(a,b)},g}async function U({page:a,authUrl:b,email:c,password:g,successPromise:h,shortTimeoutMs:i=9e4,serviceLabel:j="provider",openingStep:k="opening_google_oauth",openingMessage:l="Opening Google OAuth page",successStep:m="oauth_success_received",successMessage:n="OAuth success received",onStep:r}){let s=Date.now(),t=(a,b)=>{r?.(a,b)};t(k,l),await a.goto(b,{waitUntil:"domcontentloaded",timeout:6e4}),await a.waitForTimeout(2e3),await R(a,t);let u=await z(a,d,{timeout:15e3});for(u&&(t("entering_email","Entering Google email"),await A(u,c)?(t("submitting_email","Submitting email"),await v(a,e)):t("email_fill_failed","Could not fill the Google email field; will retry in the polling loop"));Date.now()-s<i;){let b=await Promise.race([h.then(a=>({kind:"success",result:a})).catch(a=>({kind:"success_error",error:a})),new Promise(a=>setTimeout(()=>a(null),800))]);if(b?.kind==="success")return t(m,n),{status:"success",...b.result};if(b?.kind==="success_error")return t("oauth_timeout",`Timed out waiting for ${j} authorization`),{status:"failed_timeout",error:b.error?.message||`Timed out waiting for ${j} authorization`};if(await F(a,t))continue;if(function(a){try{let b=new URL(a.url());if(b.pathname.startsWith("/not-supported"))return!0;return"about.google"===b.hostname||b.hostname.endsWith(".about.google")}catch{return!1}}(a))return t("manual_assist_required","Google blocked the automated browser (not-supported). Use the Camoufox engine or complete manually."),{status:"needs_manual",error:"Google blocked the automated browser at the OAuth consent step (not-supported page). Switch to the Camoufox engine or finish this account manually."};let i=await B(a);if(C(i,o))return t("invalid_credentials","Google rejected the supplied email or password"),{status:"failed_invalid_credentials",error:"Google rejected the supplied email or password."};if(C(i,q))return t("account_restricted","Account is restricted, suspended, or banned by the provider"),{status:"failed_restricted",error:"Account is restricted, suspended, or banned. Skipping."};if(C(i,p))return t("manual_assist_required","Google requested CAPTCHA, 2FA, or recovery verification"),{status:"needs_manual",error:"Manual assist required in the browser session (CAPTCHA, 2FA, recovery, or suspicious-login challenge)."};if(await G(a,i)){t("google_onboarding","Accepted Google onboarding or privacy prompt");continue}if(await Q(a,t,j))continue;let k=await y(a,d);if(k){t("entering_email","Entering Google email"),await A(k,c)?(t("submitting_email","Submitting email"),await v(a,e)):t("email_fill_failed","Could not fill the Google email field; retrying loop"),await a.waitForTimeout(700);continue}let l=await y(a,'input[type="password"], input[name="Passwd"], input[name="password"], input[aria-label*="Password" i], input[aria-label*="password" i], input[aria-label*="Sandi" i], input[aria-label*="kata sandi" i]');if(l){t("entering_password","Entering Google password"),await A(l,g)?(t("submitting_password","Submitting password"),await v(a,e)):t("password_fill_failed","Could not fill the Google password field; retrying loop"),await a.waitForTimeout(700);continue}if(!await R(a,t)){if(await v(a,f)){t("approving_consent",`Approving Google or ${j} consent`),await a.waitForTimeout(700);continue}t("waiting_for_next_screen",`Waiting for the next Google or ${j} screen`),await a.waitForTimeout(700)}}return t("manual_assist_required",`Flow did not complete ${j} authorization automatically`),{status:"needs_manual",error:`Manual assist required in the browser session because the login flow did not complete ${j} authorization automatically.`}}async function V({page:a,authUrl:b,email:c,password:d,callbackPromise:e,shortTimeoutMs:f=9e4,onStep:g}){return U({page:a,authUrl:b,email:c,password:d,successPromise:e,shortTimeoutMs:f,serviceLabel:"Kiro",openingStep:"opening_google_oauth",openingMessage:"Opening Google OAuth page",successStep:"kiro_callback_received",successMessage:"Kiro callback received",onStep:g})}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(9248)},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};
1
+ "use strict";exports.id=9326,exports.ids=[1998,9326],exports.modules={33342:(a,b,c)=>{c.d(b,{Q6:()=>S,cO:()=>M,go:()=>P,KY:()=>T,$w:()=>D});var d=c(55511),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(49120),j=c(71998),k=c(21820),l=c.n(k);function m(a){return Number.isFinite(a)?Math.max(0,Math.floor(a)):0}Object.freeze({RAM_GB_PER_WORKER:4,CPU_DIVISOR:2,SAFE_MIN_WORKERS:1,SAFE_MAX_WORKERS:8,FALLBACK_WORKERS:4});var n=c(62409),o=c(82506);let p=new Set(["success","failed","failed_invalid_credentials","failed_exchange","failed_timeout","cancelled"]),q=h().join(i.DATA_DIR,"kiro-bulk-import"),r=h().join(q,"meta.json"),s=new Set(["queued","running","needs_manual"]);function t(){return new Date().toISOString()}function u(a=q){f().mkdirSync(a,{recursive:!0})}function v(a,b=q){return u(b),h().join(b,`${a}.json`)}function w(a){try{if(!f().existsSync(a))return null;return JSON.parse(f().readFileSync(a,"utf8"))}catch{return null}}function x(a,b){u(h().dirname(a));let c=`${a}.${process.pid}.tmp`;f().writeFileSync(c,JSON.stringify(b,null,2),"utf8"),f().renameSync(c,a)}function y(a,b=q){return u(b),h().join(b,`${a}.resume.enc`)}function z(){return(0,d.createHash)("sha256").update(String(function(){if(process.env.BULK_IMPORT_RESUME_SECRET)return process.env.BULK_IMPORT_RESUME_SECRET;let a=h().join(i.DATA_DIR,"bulk-import-resume-key");try{return f().readFileSync(a,"utf8").trim()}catch{}try{u(i.DATA_DIR);let b=(0,d.randomBytes)(32).toString("hex");return f().writeFileSync(a,b,{mode:384}),b}catch{return(0,d.randomBytes)(32).toString("hex")}}())).digest()}function A(a){try{f().existsSync(a)&&f().rmSync(a)}catch{}}function B(a=r){return w(a)?.latestJobId||null}function C(a){if(!0===a||"string"==typeof a&&"auto"===a.trim().toLowerCase())return Math.min(8,Math.max(1,function(a=null){let b=a||function(){let a=[];try{a=l().cpus()||[]}catch{a=[]}let b=0,c=0;try{b=l().totalmem()}catch{b=0}try{c=l().freemem()}catch{c=0}let d=Array.isArray(a)?a.length:0,e=a[0]?.model?String(a[0].model).trim():null,f=b/0x40000000,g=c/0x40000000,h="unknown",i="unknown";try{h=l().platform()}catch{}try{i=l().arch()}catch{}return{cpuCount:d,cpuModel:e,totalMemBytes:b,totalMemGb:f,freeMemBytes:c,freeMemGb:g,platform:h,arch:i}}(),{cpuCount:c,totalMemGb:d}=b,e=m(d/4),f=m(c/2),g="fallback",h=0;return e>0&&f>0?(h=Math.min(e,f),g=e<=f?"ram":"cpu"):e>0?(h=e,g="ram"):f>0?(h=f,g="cpu"):(h=4,g="fallback"),{recommended:Math.min(8,Math.max(1,h||4)),limitedBy:g,ramBudget:e,cpuBudget:f,minWorkers:1,maxWorkers:8,ramGbPerWorker:4,cpuDivisor:2,specs:b}}().recommended));let b=Number.parseInt(a,10);return Number.isFinite(b)?Math.min(8,Math.max(1,b)):4}function D(a=[]){let b=Array.isArray(a)?a:[],c=[],d=[];return b.forEach((a,b)=>{let e=String(a||"").trim();if(!e||e.startsWith("#"))return;let f="",g="";if(e.includes("|")){let[a="",...b]=e.split("|");f=a.trim(),g=b.join("|").trim()}else if(e.includes(" ")){let a=e.indexOf(" ");f=e.substring(0,a).trim(),g=e.substring(a+1).trim()}else if(e.includes(":")){let a=e.indexOf(":"),b=e.substring(0,a).trim();b.includes("@")&&(f=b,g=e.substring(a+1).trim())}f&&g?c.push({line:b+1,email:f,password:g}):d.push(b+1)}),{parsed:c,invalidLines:d}}function E(a){return{total:a.length,queued:a.filter(a=>"queued"===a.status).length,running:a.filter(a=>"running"===a.status).length,success:a.filter(a=>"success"===a.status).length,failed:a.filter(a=>"failed"===a.status||"failed_invalid_credentials"===a.status||"failed_exchange"===a.status||"failed_timeout"===a.status).length,needs_manual:a.filter(a=>"needs_manual"===a.status).length}}function F(a,b,c="info"){return{id:(0,d.randomUUID)(),at:t(),step:a,message:b,level:c}}function G(a,b,c,d="info"){let e=F(b,c,d);return a.currentStep=b,a.updatedAt=e.at,a.logs=a.logs||[],a.logs.push(e),a.logs.length>40&&a.logs.splice(0,a.logs.length-40),e}function H(a){return a.flatMap(a=>(a.logs||[]).map(b=>({...b,email:a.email,line:a.line,workerId:a.workerId||null,status:a.status}))).sort((a,b)=>String(a.at).localeCompare(String(b.at))).slice(-80)}function I(a){if(!a)return null;try{let b=new URL(a);return(b.username||b.password)&&(b.username="***",b.password="***"),b.toString()}catch{return a.length>20?`${a.slice(0,10)}***${a.slice(-10)}`:a}}function J(a){return{email:a.email,status:a.status,error:a.error||null,connectionId:a.connectionId||null,workerId:a.workerId||null,line:a.line,proxyUrl:I(a.proxyUrl)||null,currentStep:a.currentStep||null,updatedAt:a.updatedAt||null,logs:(a.logs||[]).slice(-8),manualSessionAvailable:!!a.manualSession?.page&&"needs_manual"===a.status,manualSessionOpened:!!a.manualSession?.opened}}function K(a,b={}){return{jobId:a.jobId,status:a.status,summary:E(a.accounts),concurrency:a.concurrency,createdAt:a.createdAt,startedAt:a.startedAt,finishedAt:a.finishedAt,accounts:a.accounts.map(J),activity:H(a.accounts),error:a.error||null,preview:b.preview||null}}function L(a){if(!a||s.has(a.status))return!1;let b=a.finishedAt?Date.parse(a.finishedAt):NaN;return!!Number.isFinite(b)&&Date.now()-b<=18e5}function M(a,b={}){return a?{found:!0,stale:!1,recoverable:s.has(a.status)||L(a),job:a}:{found:!1,stale:!!b.stale,recoverable:!1,job:null}}async function N(a){let{launchBulkImportBrowser:b}=await c.e(5949).then(c.bind(c,75949));return b({engine:a?.engine||"chromium"})}async function O(a){let{exchangeAndSaveKiroSocialConnection:b}=await c.e(4136).then(c.bind(c,34136));return b(a)}async function P(a,b){let c=b?{proxy:{server:b}}:{},d="";try{d=a.browserType().name()}catch{}"firefox"===d&&(c.viewport=null);let e=await a.newContext(c),f=await e.newPage();return{context:e,page:f}}async function Q(a){let b,d;if(!a?.manualSession?.context)return!1;let e=a.manualSession.context,f=a.manualSession.page,g=e.browser?.(),h=null,i="";try{h=await e.storageState()}catch{h=null}try{i=f?.url?.()||""}catch{i=""}let{chromium:j}=await Promise.resolve().then(c.bind(c,83237));try{b=await j.launch({headless:!1,args:["--start-maximized"]})}catch{return!1}try{d=await b.newContext({viewport:null,...h?{storageState:h}:{}})}catch{return await b.close().catch(()=>null),!1}let k=await d.newPage();if(i)try{await k.goto(i,{waitUntil:"domcontentloaded",timeout:2e4})}catch{}let l=a.manualSession.rebind;if(a.manualSession.context=d,a.manualSession.page=k,a.manualSession.headedBrowser=b,"function"==typeof l)try{await l({context:d,page:k})}catch{}return e.close().catch(()=>null),g&&g!==b&&g.close().catch(()=>null),!0}async function R(a,{account:b}={}){if(!a)return!1;try{let c=a.context?.(),d=c?.browser?.();if(b&&function(a){if(!a)return!0;let b=a._options||a._initializer||{};return"boolean"!=typeof b.headless||b.headless}(d)&&await Q(b))return await b.manualSession.page.bringToFront?.().catch(()=>null),!0;if(!c?.newCDPSession)return await a.bringToFront?.().catch(()=>null),!0;let e=await c.newCDPSession(a),f=null;try{let a=await e.send("Target.getTargetInfo"),b=a?.targetInfo?.targetId,c=await e.send("Browser.getWindowForTarget",b?{targetId:b}:{});f=c?.windowId??null}catch{f=null}return null!=f&&await e.send("Browser.setWindowBounds",{windowId:f,bounds:{windowState:"normal",left:80,top:80,width:1280,height:960}}).catch(()=>null),await a.bringToFront?.().catch(()=>null),await e.detach?.().catch(()=>null),!0}catch{return await a.bringToFront?.().catch(()=>null),!0}}class S{constructor({browserLauncher:a=N,googleAutomation:b=o.Th,socialExchange:c=O,kiroServiceFactory:d=()=>new n.v,storageName:e="kiro-bulk-import"}={}){this.browserLauncher=a,this.googleAutomation=b,this.socialExchange=c,this.kiroServiceFactory=d,this.storageDir=h().join(i.DATA_DIR,e),this.metaFile=h().join(this.storageDir,"meta.json"),this.jobs=new Map,this.latestJobId=B(this.metaFile)}persistResumeBlob(a){try{!function(a,b){try{let c,e,g,i,j;u(h().dirname(a));let k=`${a}.${process.pid}.tmp`;f().writeFileSync(k,JSON.stringify((c=(0,d.randomBytes)(12),e=(0,d.createCipheriv)("aes-256-gcm",z(),c),g=Buffer.from(JSON.stringify(b),"utf8"),i=Buffer.concat([e.update(g),e.final()]),j=e.getAuthTag(),{v:1,alg:"aes-256-gcm",iv:c.toString("base64"),tag:j.toString("base64"),data:i.toString("base64")})),{mode:384}),f().renameSync(k,a)}catch{}}(y(a.jobId,this.storageDir),{jobId:a.jobId,concurrency:a.concurrency,engine:a.engine,proxyPoolMode:a.proxyPoolMode,proxyUrls:a.proxyUrls||[],createdAt:a.createdAt,accounts:a.accounts.map(a=>({line:a.line,email:a.email,password:a.password}))})}catch{}}hydrateInterruptedJob(a){if(!a||this.jobs.has(a))return!1;let b=w(v(a,this.storageDir));if(!b||!s.has(b.status))return!1;let c=function(a){let b=w(a);if(!b)return null;if(!b||"aes-256-gcm"!==b.alg||!b.iv||!b.tag||!b.data)return null;try{let a=(0,d.createDecipheriv)("aes-256-gcm",z(),Buffer.from(b.iv,"base64"));a.setAuthTag(Buffer.from(b.tag,"base64"));let c=Buffer.concat([a.update(Buffer.from(b.data,"base64")),a.final()]);return JSON.parse(c.toString("utf8"))}catch{return null}}(y(a,this.storageDir));if(!c||!Array.isArray(c.accounts)||0===c.accounts.length)return this.markJobInterrupted(a,b),!1;let e=new Map(c.accounts.map(a=>[a.line,a.password])),f=new Map(c.accounts.map(a=>[a.line,a.email])),g=b.createdAt||c.createdAt||t(),h=(b.accounts||[]).map(a=>{let b=p.has(a.status),c=Array.isArray(a.logs)?[...a.logs]:[],d={line:a.line,email:a.email||f.get(a.line)||"",password:b?void 0:e.get(a.line)??null,proxyUrl:null,status:a.status,error:a.error||null,connectionId:a.connectionId||null,workerId:b&&a.workerId||null,manualSession:null,runtimeSession:null,currentStep:a.currentStep||null,updatedAt:a.updatedAt||g,logs:c};return b||(d.status="queued",d.currentStep="queued",d.error=null,d.logs.push(F("resumed","Re-queued after a server restart to continue automatically"))),d}),i={jobId:a,status:"running",concurrency:C(c.concurrency),engine:c.engine||"chromium",proxyPoolMode:c.proxyPoolMode||"none",proxyUrls:Array.isArray(c.proxyUrls)?c.proxyUrls:[],createdAt:g,startedAt:b.startedAt||g,finishedAt:null,error:null,cancelRequested:!1,browser:null,nextIndex:0,manualFollowups:new Set,persistPromise:Promise.resolve(),lastPreview:b.preview||null,lastPreviewCapturedAt:0,accounts:h};return(this.jobs.set(a,i),this.latestJobId||(this.latestJobId=a),h.some(a=>"queued"===a.status))?this.runJob(a):(i.status="completed",i.finishedAt=t(),this.persistJobSnapshot(i,{forcePreview:!1}),A(y(a,this.storageDir))),!0}markJobInterrupted(a,b){let c="Job was interrupted by a server restart and could not be auto-resumed (saved credentials were unavailable). Please start a new bulk login.",d=(b.accounts||[]).map(a=>{if(p.has(a.status))return a;let b=Array.isArray(a.logs)?[...a.logs]:[];return b.push(F("failed",c,"error")),{...a,status:"failed",error:c,currentStep:"failed",updatedAt:t(),manualSessionAvailable:!1,logs:b}}),e={...b,status:"failed",error:b.error||c,finishedAt:b.finishedAt||t(),accounts:d,summary:E(d),activity:H(d)};try{x(v(a,this.storageDir),e)}catch{}A(y(a,this.storageDir))}async startJob({accounts:a,concurrency:b,engine:e,proxyPoolMode:f,proxyPoolId:g}){let{parsed:h,invalidLines:i}=D(a);if(!h.length){let a=i.length>0?"Invalid account format. Use one account per line: gmail@example.com|password":"At least one account entry is required",b={error:a};throw i.length>0&&(b.invalidLines=i),Object.assign(Error(a),b)}if(i.length>0){let a="Invalid account format. Use one account per line: gmail@example.com|password";throw Object.assign(Error(a),{error:a,invalidLines:i})}let k=[];if("all"===f)k=(await (0,j.ui)({isActive:!0})).map(a=>a.proxyUrl).filter(Boolean);else if("single"===f&&g){let a=await (0,j.hr)(g);a?.isActive&&a?.proxyUrl&&(k=[a.proxyUrl])}let l=(0,d.randomUUID)(),m=t(),{normalizeBulkImportEngine:n,DEFAULT_BULK_IMPORT_ENGINE:o}=await c.e(5949).then(c.bind(c,75949)),p=e?n(e):o,q={jobId:l,status:"running",concurrency:C(b),engine:p,proxyPoolMode:f||"none",proxyUrls:k,createdAt:m,startedAt:m,finishedAt:null,error:null,cancelRequested:!1,browser:null,nextIndex:0,manualFollowups:new Set,persistPromise:Promise.resolve(),lastPreview:null,lastPreviewCapturedAt:0,accounts:h.map(a=>({line:a.line,email:a.email,password:a.password,proxyUrl:null,status:"queued",error:null,connectionId:null,workerId:null,manualSession:null,runtimeSession:null,currentStep:"queued",updatedAt:m,logs:[F("queued","Queued and waiting for an available worker")]}))};return this.jobs.set(l,q),this.latestJobId=l,!function(a,b=r){x(b,{latestJobId:a||null,updatedAt:t()})}(l,this.metaFile),await this.persistJobSnapshot(q,{forcePreview:!1}),this.persistResumeBlob(q),this.runJob(l),K(q)}getJob(a){this.hydrateInterruptedJob(a);let b=this.jobs.get(a);return b?K(b,{preview:b.lastPreview||null}):w(v(a,this.storageDir))}async getJobWithPreview(a){this.hydrateInterruptedJob(a);let b=this.jobs.get(a);if(!b)return w(v(a,this.storageDir));let c=await this.capturePreview(b);return b.lastPreview=c||b.lastPreview||null,await this.persistJobSnapshot(b,{forcePreview:!1}),K(b,{preview:b.lastPreview||null})}async getLatestJobWithPreview({includeRecentTerminal:a=!1}={}){let b=this.latestJobId||B(this.metaFile);if(!b)return null;let c=await this.getJobWithPreview(b);return c&&(s.has(c.status)||a&&L(c))?c:null}cancelJob(a){let b=this.jobs.get(a);return b?(b.cancelRequested=!0,"queued"===b.status&&(b.status="cancelled",b.finishedAt=t(),b.accounts.forEach(a=>{"queued"===a.status&&(a.status="cancelled")})),b.browser&&(b.browser.close().catch(()=>null),b.browser=null),this.persistJobSnapshot(b,{forcePreview:!0}),K(b)):w(v(a,this.storageDir))}async openManualSession(a,b){let c=this.jobs.get(a);if(!c)return null;let d=Number.parseInt(b,10),e=c.accounts.find(a=>a.workerId===d&&"needs_manual"===a.status&&a.manualSession?.page);if(!e)return{ok:!1,error:"Manual session not found for this worker",job:K(c)};let f=await R(e.manualSession.page,{account:e});return e.manualSession.opened=f,e.manualSession.openedAt=f?e.manualSession.openedAt||t():e.manualSession.openedAt||null,await this.persistJobSnapshot(c,{forcePreview:!0}),{ok:!0,job:K(c),account:J(e)}}dequeueAccount(a,b){for(;a.nextIndex<a.accounts.length;){let c=a.accounts[a.nextIndex];if(a.nextIndex+=1,"queued"===c.status)return c.status="running",c.workerId=b,c.error=null,a.proxyUrls?.length&&(c.proxyUrl=a.proxyUrls[(a.nextIndex-1)%a.proxyUrls.length]),G(c,"worker_assigned",`Worker ${b} picked up this account${c.proxyUrl?` (proxy: ${I(c.proxyUrl)})`:""}`),this.persistJobSnapshot(a,{forcePreview:!1}),c}return null}finalizeAccount(a,b,c={}){return a.status=b,a.error=c.error||null,a.connectionId=c.connectionId||null,(c.step||c.message)&&G(a,c.step||b,c.message||c.error||b.replaceAll("_"," ")),a}setAccountStep(a,b,c,d="info"){G(a,b,c,d)}async persistJobSnapshot(a,{forcePreview:b=!1}={}){if(!a)return;let c=async()=>{if(b||Date.now()-(a.lastPreviewCapturedAt||0)>=1500){let b=await this.capturePreview(a);b&&(a.lastPreview=b),a.lastPreviewCapturedAt=Date.now()}x(v(a.jobId,this.storageDir),K(a,{preview:a.lastPreview||null}))};a.persistPromise=Promise.resolve(a.persistPromise).catch(()=>null).then(c),await a.persistPromise}async capturePreview(a){let b=a.accounts.find(a=>"running"===a.status&&a.runtimeSession?.page)||a.accounts.find(a=>"needs_manual"===a.status&&a.manualSession?.page);if(!b)return null;let c=b.runtimeSession?.page||b.manualSession?.page;if(!c)return null;try{let a=await c.screenshot({type:"jpeg",quality:55,fullPage:!1,animations:"disabled",caret:"hide"});return{email:b.email,workerId:b.workerId||null,status:b.status,step:b.currentStep||null,updatedAt:b.updatedAt||t(),imageData:`data:image/jpeg;base64,${a.toString("base64")}`}}catch{return{email:b.email,workerId:b.workerId||null,status:b.status,step:b.currentStep||null,updatedAt:b.updatedAt||t(),imageData:null}}}async runManualFollowup(a,b,c,d,e,f){let g=(async()=>{let c=async()=>{let a=b.manualSession,c=a?.context||d,e=a?.headedBrowser||null;c&&await c.close().catch(()=>null),e&&await e.close().catch(()=>null)};try{let c=await e;if(a.cancelRequested){this.finalizeAccount(b,"cancelled",{error:"Job cancelled",step:"cancelled",message:"Job cancelled while waiting for manual completion"}),await this.persistJobSnapshot(a,{forcePreview:!0});return}this.setAccountStep(b,"exchanging_tokens","Exchanging Kiro callback for OAuth tokens"),await this.persistJobSnapshot(a,{forcePreview:!0});let{connection:d}=await this.socialExchange({code:c.code,codeVerifier:f,provider:"google"});this.finalizeAccount(b,"success",{connectionId:d.id,step:"connection_saved",message:"Kiro connection saved successfully"}),await this.persistJobSnapshot(a,{forcePreview:!0})}catch(c){a.cancelRequested?this.finalizeAccount(b,"cancelled",{error:"Job cancelled",step:"cancelled",message:"Job cancelled while waiting for manual completion"}):this.finalizeAccount(b,"failed_exchange",{error:c.message||"Manual assist flow failed during token exchange.",step:"exchange_failed",message:c.message||"Manual assist flow failed during token exchange."}),await this.persistJobSnapshot(a,{forcePreview:!0})}finally{await c(),b.manualSession=null,b.runtimeSession=null,a.manualFollowups.delete(g),await this.persistJobSnapshot(a,{forcePreview:!0})}})();a.manualFollowups.add(g)}async processAccount(a,b,c){if(a.cancelRequested||!a.browser)return void this.finalizeAccount(b,"cancelled",{error:"Job cancelled"});let d=this.kiroServiceFactory().createSocialAuthorization("google"),{context:e,page:f}=await P(a.browser,b.proxyUrl),g=(0,o.zZ)(e,f);b.runtimeSession={context:e,page:f};try{this.setAccountStep(b,"preparing_worker",`Worker ${c} is preparing a browser context`),await this.persistJobSnapshot(a,{forcePreview:!0});let h=await this.googleAutomation({page:f,authUrl:d.authUrl,email:b.email,password:b.password,callbackPromise:g,onStep:(c,d)=>{this.setAccountStep(b,c,d),this.persistJobSnapshot(a,{forcePreview:!1})}});if("success"===h.status){this.setAccountStep(b,"exchanging_tokens","Exchanging Kiro callback for OAuth tokens"),await this.persistJobSnapshot(a,{forcePreview:!0});let{connection:c}=await this.socialExchange({code:h.code,codeVerifier:d.codeVerifier,provider:"google"});this.finalizeAccount(b,"success",{connectionId:c.id,step:"connection_saved",message:"Kiro connection saved successfully"}),b.runtimeSession=null,await e.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0});return}if("needs_manual"===h.status){b.manualSession={context:e,page:f,opened:!1,openedAt:null,rebind:"function"==typeof g?.rebind?g.rebind:null},this.setAccountStep(b,"awaiting_manual","Waiting for manual completion in the browser session"),this.finalizeAccount(b,"needs_manual",{error:h.error,step:"awaiting_manual",message:h.error}),await this.persistJobSnapshot(a,{forcePreview:!0}),await this.runManualFollowup(a,b,c,e,g,d.codeVerifier);return}let i=p.has(h.status)?h.status:"failed";this.finalizeAccount(b,i,{error:h.error||"Kiro Google automation failed.",step:i,message:h.error||"Kiro Google automation failed."}),b.runtimeSession=null,await e.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0})}catch(c){this.finalizeAccount(b,"failed",{error:c.message||"Unexpected Kiro bulk import failure.",step:"failed",message:c.message||"Unexpected Kiro bulk import failure."}),b.runtimeSession=null,await e.close().catch(()=>null),await this.persistJobSnapshot(a,{forcePreview:!0})}finally{b.password=void 0}}async runWorker(a,b){for(;!a.cancelRequested;){let c=this.dequeueAccount(a,b);if(!c)return;await this.processAccount(a,c,b)}}async runJob(a){let b=this.jobs.get(a);if(b)try{b.browser=await this.browserLauncher(b),b.accounts.forEach(a=>{"queued"===a.status&&1===(a.logs||[]).length&&this.setAccountStep(a,"waiting_for_worker","Waiting for a free worker")}),await this.persistJobSnapshot(b,{forcePreview:!1});let a=Math.min(b.concurrency,Math.max(b.accounts.length,1)),c=Array.from({length:a},(a,c)=>this.runWorker(b,c+1));await Promise.allSettled(c),b.manualFollowups.size>0&&await Promise.allSettled([...b.manualFollowups]),b.cancelRequested?(b.status="cancelled",b.accounts.forEach(a=>{("queued"===a.status||"running"===a.status)&&this.finalizeAccount(a,"cancelled",{error:"Job cancelled",step:"cancelled",message:"Job cancelled before completion"})})):b.status="completed",await this.persistJobSnapshot(b,{forcePreview:!0})}catch(a){b.status="failed",b.error=a.message||"Failed to start Kiro bulk import job.",b.accounts.forEach(a=>{("queued"===a.status||"running"===a.status)&&(this.finalizeAccount(a,"failed",{error:b.error,step:"failed",message:b.error}),a.password=void 0)}),await this.persistJobSnapshot(b,{forcePreview:!0})}finally{b.browser&&(await b.browser.close().catch(()=>null),b.browser=null),b.finishedAt=t(),await this.persistJobSnapshot(b,{forcePreview:!0}),A(y(b.jobId,this.storageDir))}}}function T(){return(!globalThis.__kiroBulkImportSingleton&&(globalThis.__kiroBulkImportSingleton={manager:new S}),globalThis.__kiroBulkImportSingleton).manager}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.getProviderConnections,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},82506:(a,b,c)=>{c.d(b,{$K:()=>Q,Jl:()=>E,PB:()=>T,Th:()=>V,i_:()=>P,np:()=>O,rk:()=>U,zZ:()=>S});let d='input[type="email"], input[autocomplete="username"], input#identifierId, input[name="identifier"], input[name="Email"], input[type="text"][autofocus], input[aria-label*="Email" i], input[aria-label*="email" i], input[aria-label*="phone" i], input[aria-label*="telepon" i]',e=['button:has-text("Next")','button:has-text("Berikutnya")','button:has-text("Continue")','div[role="button"]:has-text("Next")','div[role="button"]:has-text("Berikutnya")',"#identifierNext button","#passwordNext button"],f=["#submit_approve_access","#submit_approve_access button","#confirm",'form#tos_form input[type="submit"]','button[jsname]:has-text("Allow")','button:has-text("Allow")','[role="button"]:has-text("Allow")','input[type="submit"][value="Allow"]','input[type="button"][value="Allow"]','button[jsname]:has-text("Izinkan")','button:has-text("Izinkan")','[role="button"]:has-text("Izinkan")','button:has-text("Continue")','button:has-text("Next")','button:has-text("Yes")','button:has-text("Accept")','button:has-text("Lanjutkan")','button:has-text("Berikutnya")','button:has-text("Setuju")','button:has-text("Saya mengerti")','button:has-text("Oke")','button:has-text("OK")','button:has-text("Got it")','button:has-text("I understand")','div[role="button"]:has-text("Continue")','div[role="button"]:has-text("Next")','div[role="button"]:has-text("Allow")','div[role="button"]:has-text("Lanjutkan")','div[role="button"]:has-text("Berikutnya")','div[role="button"]:has-text("Izinkan")','div[role="button"]:has-text("Setuju")','div[role="button"]:has-text("Saya mengerti")','div[role="button"]:has-text("Oke")','div[role="button"]:has-text("OK")','div[role="button"]:has-text("Got it")','div[role="button"]:has-text("I understand")','input[type="button"][value="Saya mengerti"]','input[type="submit"][value="Saya mengerti"]'],g=['button:has-text("Skip")','button:has-text("Lewati")','button:has-text("Not now")','button:has-text("Bukan sekarang")','button:has-text("No thanks")','button:has-text("Tidak sekarang")','div[role="button"]:has-text("Skip")','div[role="button"]:has-text("Not now")'],h=["#social-google","a#social-google",'a:has-text("Sign up with Google")','a:has-text("Log in with Google")','button:has-text("Sign up with Google")','button:has-text("Log in with Google")','button:has-text("Google")','a:has-text("Google")','div[role="button"]:has-text("Google")','span:has-text("Google")','[aria-label*="Google"]','[data-provider*="google" i]'],i=["#agree-policy-account","#agree-policy","#agree-policy-sso",'input[type="checkbox"][id*="agree" i]','input[type="checkbox"][name*="agree" i]','input[type="checkbox"][id*="policy" i]','input[type="checkbox"][name*="policy" i]','input[type="checkbox"][id*="terms" i]','input[type="checkbox"][name*="terms" i]','.login-checkbox input[type="checkbox"]','[class*="checkbox"] input[type="checkbox"]','[class*="agree"] input[type="checkbox"]','input[type="checkbox"]'],j=['.ui-dialog button:has-text("Confirm")','dialog button:has-text("Confirm")','button:has-text("Confirm")','button:has-text("I agree")','button:has-text("Agree")','button:has-text("同意")','button:has-text("确认")'],k=['button:has-text("Continue")','[role="button"]:has-text("Continue")','button:has-text("Get started")','button:has-text("GET STARTED")','input[type="submit"][value="GET STARTED"]','button:has-text("Start")','button:has-text("Confirm")','button:has-text("Done")','button:has-text("Next")','button:has-text("Skip")','button:has-text("Not now")','button:has-text("Save")','button:has-text("Create")','button:has-text("Enter")','button:has-text("Launch")','button:has-text("Use CodeBuddy")','button:has-text("Go to CodeBuddy")'],l=["select",'[role="combobox"]','.page-region [role="combobox"]',".page-region .t-select",'.page-region [class*="t-select"]','.page-region [class*="select"]',".page-region input[placeholder]",'button:has-text("Region")','[role="button"]:has-text("Region")','button:has-text("Select region")','[role="button"]:has-text("Select region")','button:has-text("Data region")','[aria-label*="region" i]','[placeholder*="region" i]'],m=["text=/^Indonesia$/i","text=/^ID$/i","text=/^Singapore$/i","text=/^SG$/i","text=/^Japan$/i","text=/^JP$/i","text=/^Thailand$/i","text=/^TH$/i","text=/^Global$/i","text=/^International$/i","text=/^United States$/i","text=/^US$/i","text=/^Asia Pacific$/i","text=/^Hong Kong$/i","text=/^Default$/i"],n=[{selector:'input[name*="workspace" i]',value:"Default"},{selector:'input[placeholder*="workspace" i]',value:"Default"},{selector:'input[name*="team" i]',value:"Default"},{selector:'input[placeholder*="team" i]',value:"Default"},{selector:'input[name*="name" i]',value:"Default"},{selector:'input[placeholder*="name" i]',value:"Default"}],o=["wrong password","incorrect password","couldn't find your google account","couldn’t find your google account","enter a valid email","couldn’t sign you in","couldn't sign you in","invalid email or password","password is incorrect"],p=["2-step verification","2-step verification required","verify it’s you","verify it's you","check your phone","confirm it’s you","confirm it's you","recovery email","recovery phone","suspicious sign-in prevented","unusual activity detected","captcha","try again later"],q=["restricted","account has been restricted","account is restricted","account has been suspended","account is suspended","account has been disabled","account is disabled","account has been banned","account is banned","access denied","account blocked","your account has been","violation of terms","terms of service violation","temporarily locked","permanently locked","account locked","akun dibatasi","akun diblokir","akun ditangguhkan"],r=["welcome to your new google account","selamat datang di akun google baru anda","welcome to your new account","selamat datang di akun baru","privacy and terms","privasi dan persyaratan","personalize your google services","personalisasikan layanan google anda","add recovery phone","tambahkan nomor telepon pemulihan","choose your settings","pilih setelan anda"],s=["welcome to your new account","selamat datang di akun baru","your administrator decides which","administrator anda memutuskan layanan","your organisation administrator manages","your organization administrator manages"];function t(a){if(!a||!a.startsWith("kiro://kiro.kiroAgent/authenticate-success"))return null;let b=a.indexOf("?"),c=new URLSearchParams(b>=0?a.slice(b+1):""),d=c.get("code"),e=c.get("state");return d?{callbackUrl:a,code:d,state:e}:null}function u(a){let b="function"==typeof a.frames?a.frames():[];return[a,...b.filter(b=>b!==a.mainFrame?.())]}async function v(a,b){for(let c of u(a))for(let a of b){let b=c.locator(a).first();if(await b.count().catch(()=>0)&&await b.isVisible().catch(()=>!1))return await b.click({timeout:5e3}).catch(()=>null),!0}return!1}async function w(a,b){for(let c of u(a))for(let a of b){let b=c.locator(a).first();if(await b.count().catch(()=>0)){if((await b.scrollIntoViewIfNeeded().catch(()=>null),await b.isVisible().catch(()=>!1)&&await b.isEnabled().catch(()=>!0))&&await b.click({timeout:5e3}).then(()=>!0).catch(()=>!1))return!0}}return!1}async function x(a,b){for(let c of u(a))for(let a of b){let b=c.locator(a).first();if(!await b.count().catch(()=>0))continue;if(await b.isChecked().catch(()=>!1))return!0;let d=await b.isVisible().catch(()=>!1);if(d&&await b.check({force:!0,timeout:5e3}).then(()=>!0).catch(()=>!1)||d&&await b.click({force:!0,timeout:5e3}).then(()=>!0).catch(()=>!1)||await c.evaluate(a=>{let b=document.querySelector(a);return b instanceof HTMLInputElement&&(b.checked=!0,b.dispatchEvent(new Event("input",{bubbles:!0})),b.dispatchEvent(new Event("change",{bubbles:!0})),b.checked)},a).catch(()=>!1))return!0}return!1}async function y(a,b){for(let c of u(a)){let a=c.locator(b).first();if(await a.count().catch(()=>0)&&await a.isVisible().catch(()=>!1))return a}return null}async function z(a,b,{timeout:c=15e3,pollInterval:d=500}={}){let e=Date.now()+c;for(;Date.now()<e;){let c=await y(a,b);if(c)return c;let f=e-Date.now();if(f<=0)break;await new Promise(a=>setTimeout(a,Math.min(d,f)))}return null}async function A(a,b,{timeout:c=15e3}={}){if(!a||null==b)return!1;try{await a.fill(b,{timeout:c})}catch{}let d="";try{d=await a.inputValue()}catch{d=""}if(d===b)return!0;try{await a.click({timeout:5e3})}catch{}try{await a.fill("")}catch{}try{await a.type(b,{delay:50,timeout:c})}catch{return!1}try{d=await a.inputValue()}catch{d=""}return d===b}async function B(a){let b=[];for(let c of u(a))try{b.push(await c.evaluate(()=>document.body?.innerText||""))}catch{}return b.join("\n")}function C(a,b){let c=String(a||"").toLowerCase();return b.some(a=>c.includes(a))}function D(a){try{let b=new URL(a.url());return"accounts.google.com"===b.hostname||b.hostname.endsWith(".accounts.google.com")}catch{return!1}}function E(a){try{let b=new URL(a.url());return/codebuddy\.(ai|cn)$/.test(b.hostname)||b.hostname.endsWith(".codebuddy.ai")||b.hostname.endsWith(".codebuddy.cn")}catch{return!1}}async function F(a,b){if(!D(a))return!1;let c=await B(a);return!!/wants to access|ingin mengakses|akses ke akun google|allow/i.test(c)&&(await a.evaluate(()=>{let a=document.scrollingElement||document.documentElement||document.body;a&&(a.scrollTop=a.scrollHeight),window.scrollTo(0,document.body?.scrollHeight||document.documentElement?.scrollHeight||0)}).catch(()=>null),await a.waitForTimeout(300),!!await w(a,f)&&(b("approving_google_consent","Approving Google OAuth consent"),await a.waitForTimeout(1e3),!0))}async function G(a,b){let c=String(b||"");if(!C(c,r))return!1;if(await a.evaluate(()=>{let a=document.scrollingElement||document.documentElement||document.body;a&&(a.scrollTop=a.scrollHeight),window.scrollTo(0,document.body?.scrollHeight||document.documentElement?.scrollHeight||0)}).catch(()=>null),await a.waitForTimeout(500),C(c,s)){if(await w(a,f))return await a.waitForTimeout(700),!0;if(await a.evaluate(()=>{let a=[document.getElementById("confirm"),document.querySelector('form#tos_form input[type="submit"]'),document.querySelector('input[type="submit"][value="Saya mengerti"]'),document.querySelector('input[type="submit"][value="I understand"]')].filter(Boolean)[0];return!!a&&(a.scrollIntoView({block:"center"}),a.click(),!0)}).catch(()=>!1)||await a.evaluate(()=>{let a=document.getElementById("tos_form");return!!a&&(a.submit(),!0)}).catch(()=>!1))return await a.waitForTimeout(800),!0}return!!(await w(a,g)||await w(a,f))&&(await a.waitForTimeout(700),!0)}async function H(a){let b=/global|international|singapore|united states|^us$|asia|hong kong|default/i;for(let c of u(a)){let a=c.locator("select"),d=await a.count().catch(()=>0);for(let c=0;c<d;c+=1){let d=a.nth(c),e=await d.isVisible().catch(()=>!1),f=await d.isEnabled().catch(()=>!0);if(!e||!f)continue;let g=await d.evaluate((a,b)=>{let c=RegExp(b,"i"),d=[...a.options].filter(a=>!a.disabled&&""!==a.value),e=d.find(a=>c.test(`${a.label} ${a.textContent} ${a.value}`));return(e||d[0])?.value||""},b.source).catch(()=>"");if(g&&await d.selectOption(g).then(()=>!0).catch(()=>!1))return!0}}return!1}async function I(a){let b=!1;for(let c of u(a))for(let{selector:a,value:d}of n){let e=c.locator(a).first();if(!await e.count().catch(()=>0))continue;let f=await e.isVisible().catch(()=>!1),g=await e.isEnabled().catch(()=>!0);!(!f||!g||await e.inputValue().catch(()=>""))&&await e.fill(d,{timeout:5e3}).then(()=>!0).catch(()=>!1)&&(b=!0)}return b}async function J(a,b){await b.scrollIntoViewIfNeeded().catch(()=>null);let c=await b.isVisible().catch(()=>!1),d=await b.isEnabled().catch(()=>!0);if(!c||!d)return!1;let e=await b.boundingBox().catch(()=>null);if(!e||e.width<=0||e.height<=0)return!1;let f=e.x+e.width/2,g=e.y+e.height/2;return await a.mouse.move(f,g),await a.mouse.down(),await a.mouse.up(),!0}async function K(a,b,c){for(let d of u(a)){let e=d.locator(b),f=Math.min(await e.count().catch(()=>0),80),g=[];for(let a=0;a<f;a+=1){let b=e.nth(a);if(!await b.isVisible().catch(()=>!1))continue;let c=(await b.innerText({timeout:1e3}).catch(()=>"")||await b.textContent({timeout:1e3}).catch(()=>"")||"").trim();c&&g.push({locator:b,text:c})}for(let b of c){let c=g.find(a=>b.test(a.text));if(c&&await J(a,c.locator).catch(()=>!1))return c.text}if(g[0]&&await J(a,g[0].locator).catch(()=>!1))return g[0].text}return""}async function L(a,b){for(let c of u(a))for(let d of b){let b=c.locator(d),e=Math.min(await b.count().catch(()=>0),20);for(let c=0;c<e;c+=1){let d=b.nth(c);if(await J(a,d).catch(()=>!1))return!0}}return!1}async function M(a,b){if(!E(a)||D(a))return!1;let c=await a.evaluate(async()=>{let a=document.body?.innerText||"";if(!(document.querySelector(".page-region")||/select\s+region|region|country|area|get started|complete/i.test(a)))return null;try{let a=await fetch("https://www.codebuddy.ai/console/login/account",{method:"POST",credentials:"include",headers:{accept:"application/json, text/plain, */*","content-type":"application/json","x-requested-with":"XMLHttpRequest","x-domain":window.location.hostname||"www.codebuddy.ai"},referrer:"https://www.codebuddy.ai/register/user/complete",body:JSON.stringify({attributes:{countryCode:["62"],countryFullName:["Indonesia"],countryName:["ID"]}})}),b=await a.text().catch(()=>""),c=null;try{c=b?JSON.parse(b):null}catch{c={raw:b}}if(a.ok&&(!c||0===c.code||200===c.code||void 0===c.code))return{action:"submitted_via_api"};return{action:"api_failed",status:a.status,code:c?.code,message:c?.msg||c?.message||b||`HTTP ${a.status}`}}catch(a){return{action:"api_failed",message:a?.message||"region submit request failed"}}}).catch(()=>null);return!!c?.action&&("submitted_via_api"===c.action?(b("submitting_codebuddy_region","Submitted CodeBuddy region via account API"),await a.waitForTimeout(1500),!0):(b("codebuddy_region_api_failed",c.message?`CodeBuddy region API submit failed: ${c.message}`:"CodeBuddy region API submit failed"),!1))}async function N(a,b){if(!E(a)||D(a)||!await a.locator(".page-region").first().count().then(Boolean).catch(()=>!1))return!1;let c=[/indonesia|^id$|\u5370\u5ea6\u5c3c\u897f\u4e9a/i,/singapore|^sg$|\u65b0\u52a0\u5761/i,/japan|^jp$|\u65e5\u672c/i,/thailand|^th$|\u6cf0\u56fd/i,/global|international|default/i];if(await L(a,[".page-region [class*='28B894']",".page-region button:has-text('Get started')",".page-region button:has-text('Start')",".page-region button:has-text('Submit')",".page-region button:has-text('Continue')",".page-region [role='button']:has-text('Get started')",".page-region [role='button']:has-text('Start')",".page-region [role='button']:has-text('Submit')",".page-region [role='button']:has-text('Continue')"]))return b("submitting_codebuddy_region","Submitted CodeBuddy region selection"),await a.waitForTimeout(1200),!0;let d=await K(a,"ul.dropdown-section li, .dropdown-section li, [role='option'], .t-select-option, [class*='option']",c);if(d)return b("selecting_codebuddy_region",`Selected CodeBuddy region: ${d}`),await a.waitForTimeout(900),!0;if(!await L(a,[".page-region .t-select",".page-region [class*='t-select']",".page-region [role='combobox']",".page-region input[placeholder]",".page-region [class*='select']",".page-region [class*='cursor-pointer']"]))return!1;b("opening_codebuddy_region_selector","Opening CodeBuddy region selector"),await a.waitForTimeout(600);let e=await K(a,"ul.dropdown-section li, .dropdown-section li, [role='option'], .t-select-option, [class*='option']",c);return e&&(b("selecting_codebuddy_region",`Selected CodeBuddy region: ${e}`),await a.waitForTimeout(900)),!0}async function O(a,b){if(!E(a)||D(a))return!1;if(await M(a,b)||await N(a,b))return!0;for(let c of u(a)){let d=await c.evaluate(()=>{let a=a=>{if(!(a instanceof HTMLElement))return!1;let b=window.getComputedStyle(a);if("hidden"===b.visibility||"none"===b.display||0===Number(b.opacity))return!1;let c=a.getBoundingClientRect();return c.width>0&&c.height>0},b=document.querySelector(".page-region"),c=document.body?.innerText||"";if(!(b||/select\s+region|region|country|area|get started|complete/i.test(c)))return null;let d=a=>{for(let b of(a.scrollIntoView({block:"center",inline:"center"}),["pointerdown","mousedown","pointerup","mouseup","click"]))a.dispatchEvent(new MouseEvent(b,{bubbles:!0,cancelable:!0,view:window,buttons:+!!b.endsWith("down")}))},e=[/indonesia|^id$|\u5370\u5ea6\u5c3c\u897f\u4e9a/i,/singapore|^sg$|\u65b0\u52a0\u5761/i,/japan|^jp$|\u65e5\u672c/i,/thailand|^th$|\u6cf0\u56fd/i,/global|international|default/i],f=b||document.body,g=["button","[role='button']","input[type='submit']",".t-button","[class*='button']","[class*='28B894']"],h=[...f.querySelectorAll(g.join(","))].filter(a).filter(a=>{let b=`${a.innerText||""} ${a.getAttribute("aria-label")||""} ${a.getAttribute("value")||""}`,c=a.getAttribute("class")||"";return/submit|start|continue|confirm|done|get started|complete|\u5b8c\u6210|\u5f00\u59cb|\u786e\u5b9a|\u4e0b\u4e00\u6b65/i.test(b)||c.includes("28B894")});if(h.length)return d(h[0]),{action:"submitted"};let i=["ul.dropdown-section li",".dropdown-section li","[role='option']",".t-select-option","[class*='option']","[class*='dropdown'] li"],j=[...document.querySelectorAll(i.join(","))].filter(a).filter(a=>(a.innerText||a.textContent||"").trim());if(j.length){let a=e.map(a=>j.find(b=>a.test((b.innerText||b.textContent||"").trim()))).find(Boolean)||j[0],b=(a.innerText||a.textContent||"").trim();return d(a),{action:"selected",label:b}}let k=["[role='combobox']",".t-select","[class*='t-select']","[class*='select']","input[placeholder]",".text-sm","[class*='cursor-pointer']"],l=[...f.querySelectorAll(k.join(","))].filter(a).filter(a=>{let b=`${a.innerText||""} ${a.getAttribute("placeholder")||""} ${a.getAttribute("aria-label")||""}`;return/region|country|area|select|placeholder|\u5730\u533a|\u56fd\u5bb6|\u9009\u62e9/i.test(b)||a.matches?.(".t-select,[class*='t-select'],input[placeholder],[class*='select']")});return l.length?(d(l[0]),{action:"opened"}):null}).catch(()=>null);if(d?.action){if("selected"===d.action)return b("selecting_codebuddy_region",`Selected CodeBuddy region${d.label?`: ${d.label}`:""}`),await a.waitForTimeout(700),!0;if("submitted"===d.action)return b("submitting_codebuddy_region","Submitted CodeBuddy region selection"),await a.waitForTimeout(1200),!0;return b("opening_codebuddy_region_selector","Opening CodeBuddy region selector"),await a.waitForTimeout(700),!0}}return!1}async function P(a,b){if(!E(a)||D(a))return!1;let c=await a.evaluate(async()=>{let a=new URL(window.location.href);if(!/\/started\/?$/.test(a.pathname))return null;let b=a.searchParams.get("platform")||"CLI",c=a.searchParams.get("state");if(!c)return null;for(let a of[...new Set([window.location.hostname||"www.codebuddy.ai"].filter(Boolean))]){let d=new URL("/console/auth/login",window.location.origin);d.searchParams.set("platform",b),d.searchParams.set("state",c),d.searchParams.set("domain",a);try{let b=await fetch(d.toString(),{method:"GET",credentials:"include",redirect:"manual",headers:{"x-requested-with":"XMLHttpRequest","X-Domain":a}});if("opaqueredirect"===b.type||b.status>=300&&b.status<400)return{action:"attempted",domain:a,message:"redirected"};let c=await b.text(),e=null;try{e=c?JSON.parse(c):null}catch{e={raw:c}}if(b.ok&&(!e||0===e.code||200===e.code||void 0===e.code))return{action:"authorized",domain:a};if(b.ok)return{action:"attempted",domain:a,code:e?.code,message:e?.msg||e?.message||""}}catch(a){}}return{action:"failed"}}).catch(()=>null);return!!c?.action&&"failed"!==c.action&&("authorized"===c.action?b("authorizing_codebuddy_cli_state","Authorized CodeBuddy CLI login state"):b("authorizing_codebuddy_cli_state",c.message?`Attempted CodeBuddy CLI login state authorization: ${c.message}`:"Attempted CodeBuddy CLI login state authorization"),await a.waitForTimeout(1200),!0)}async function Q(a,b,c){return!(!E(a)||D(a))&&(await w(a,j)?(b("accepting_provider_privacy_dialog",`Confirmed ${c} privacy or terms dialog`),await a.waitForTimeout(800),!0):!!(await P(a,b)||await O(a,b))||(await H(a)?(b("selecting_provider_region",`Selected ${c} region`),await a.waitForTimeout(700),!0):await w(a,l)?(b("opening_provider_region_selector",`Opening ${c} region selector`),await a.waitForTimeout(500),await w(a,m)&&(b("selecting_provider_region",`Selected ${c} region`),await a.waitForTimeout(700)),!0):await w(a,m)?(b("selecting_provider_region",`Selected ${c} region`),await a.waitForTimeout(700),!0):await I(a)?(b("filling_provider_onboarding",`Filled ${c} onboarding defaults`),await a.waitForTimeout(500),!0):!!await w(a,k)&&(b("continuing_provider_onboarding",`Continuing ${c} onboarding`),await a.waitForTimeout(1e3),!0)))}async function R(a,b){return!D(a)&&(await w(a,j)?(b("accepting_provider_privacy_dialog","Confirmed provider privacy agreement dialog"),await a.waitForTimeout(1e3),!0):(await x(a,i)&&(b("accepting_provider_terms","Accepted provider terms for Google login"),await a.waitForTimeout(400)),!!await w(a,h)&&(b("selecting_google_login","Selecting Google login"),await a.waitForTimeout(1e3),await w(a,j)&&(b("accepting_provider_privacy_dialog","Confirmed provider privacy agreement dialog"),await a.waitForTimeout(1e3)),!0)))}function S(a,b,c=9e5){let d,e,f=new Promise((a,b)=>{d=a,e=b}),g=!1,h=new Set,i=new Map,j=setTimeout(()=>{k(null,Error("Timed out waiting for Kiro callback"))},c);function k(a,b=null){if(!g){for(let a of(g=!0,clearTimeout(j),i.values()))for(let b of a)try{b()}catch{}i.clear(),b?e(b):d(a)}}function l(a,b){if(!a||h.has(a))return;h.add(a);let c=a=>{let b=t(a?.url?.()||"");b&&k(b)},d=a=>{let b=t(a?.url?.()||"");b&&k(b)},e=a=>{let b=t(a?.url?.()||"");b&&k(b)},f=()=>{let b=t(a.url?.()||"");b&&k(b)};a.on("framenavigated",c),a.on("request",d),a.on("requestfailed",e),a.on("domcontentloaded",f),a.on("load",f),b.push(()=>{a.off("framenavigated",c),a.off("request",d),a.off("requestfailed",e),a.off("domcontentloaded",f),a.off("load",f)});let g=t(a.url?.()||"");g&&k(g)}function m(a,b){if(g||i.has(a))return;let c=[];i.set(a,c);let d=a=>l(a,c);a.on("page",d),c.push(()=>a.off("page",d)),b&&l(b,c)}return m(a,b),f.rebind=({context:a,page:b}={})=>{a&&m(a,b)},f}function T(a,b,{prefix:c,timeoutMs:d=9e5}={}){let e,f,g=new Promise((a,b)=>{e=a,f=b}),h=!1,i=new Set,j=new Map,k=setTimeout(()=>{l(null,Error("Timed out waiting for OAuth callback"))},d);function l(a,b=null){if(!h){for(let a of(h=!0,clearTimeout(k),j.values()))for(let b of a)try{b()}catch{}j.clear(),b?f(b):e(a)}}function m(a,b){if(!a||i.has(a))return;i.add(a);let d=a=>{let b=function(a,b){if(!a||!b||!a.startsWith(b))return null;let c=a.indexOf("?"),d=new URLSearchParams(c>=0?a.slice(c+1):""),e=d.get("code"),f=d.get("state");return e?{callbackUrl:a,code:e,state:f}:null}(a||"",c);b&&l(b)},e=a=>d(a?.url?.()||""),f=a=>d(a?.url?.()||""),g=a=>d(a?.url?.()||""),h=()=>d(a.url?.()||"");a.on("framenavigated",e),a.on("request",f),a.on("requestfailed",g),a.on("domcontentloaded",h),a.on("load",h),b.push(()=>{a.off("framenavigated",e),a.off("request",f),a.off("requestfailed",g),a.off("domcontentloaded",h),a.off("load",h)}),d(a.url?.()||"")}function n(a,b){if(h||j.has(a))return;let c=[];j.set(a,c);let d=a=>m(a,c);a.on("page",d),c.push(()=>a.off("page",d)),b&&m(b,c)}return n(a,b),g.rebind=({context:a,page:b}={})=>{a&&n(a,b)},g}async function U({page:a,authUrl:b,email:c,password:g,successPromise:h,shortTimeoutMs:i=9e4,serviceLabel:j="provider",openingStep:k="opening_google_oauth",openingMessage:l="Opening Google OAuth page",successStep:m="oauth_success_received",successMessage:n="OAuth success received",onStep:r}){let s=Date.now(),t=(a,b)=>{r?.(a,b)};t(k,l),await a.goto(b,{waitUntil:"domcontentloaded",timeout:6e4}),await a.waitForTimeout(2e3),await R(a,t);let u=await z(a,d,{timeout:15e3});for(u&&(t("entering_email","Entering Google email"),await A(u,c)?(t("submitting_email","Submitting email"),await v(a,e)):t("email_fill_failed","Could not fill the Google email field; will retry in the polling loop"));Date.now()-s<i;){let b=await Promise.race([h.then(a=>({kind:"success",result:a})).catch(a=>({kind:"success_error",error:a})),new Promise(a=>setTimeout(()=>a(null),800))]);if(b?.kind==="success")return t(m,n),{status:"success",...b.result};if(b?.kind==="success_error")return t("oauth_timeout",`Timed out waiting for ${j} authorization`),{status:"failed_timeout",error:b.error?.message||`Timed out waiting for ${j} authorization`};if(await F(a,t))continue;if(function(a){try{let b=new URL(a.url());if(b.pathname.startsWith("/not-supported"))return!0;return"about.google"===b.hostname||b.hostname.endsWith(".about.google")}catch{return!1}}(a))return t("manual_assist_required","Google blocked the automated browser (not-supported). Use the Camoufox engine or complete manually."),{status:"needs_manual",error:"Google blocked the automated browser at the OAuth consent step (not-supported page). Switch to the Camoufox engine or finish this account manually."};let i=await B(a);if(C(i,o))return t("invalid_credentials","Google rejected the supplied email or password"),{status:"failed_invalid_credentials",error:"Google rejected the supplied email or password."};if(C(i,q))return t("account_restricted","Account is restricted, suspended, or banned by the provider"),{status:"failed_restricted",error:"Account is restricted, suspended, or banned. Skipping."};if(C(i,p))return t("manual_assist_required","Google requested CAPTCHA, 2FA, or recovery verification"),{status:"needs_manual",error:"Manual assist required in the browser session (CAPTCHA, 2FA, recovery, or suspicious-login challenge)."};if(await G(a,i)){t("google_onboarding","Accepted Google onboarding or privacy prompt");continue}if(await Q(a,t,j))continue;let k=await y(a,d);if(k){t("entering_email","Entering Google email"),await A(k,c)?(t("submitting_email","Submitting email"),await v(a,e)):t("email_fill_failed","Could not fill the Google email field; retrying loop"),await a.waitForTimeout(700);continue}let l=await y(a,'input[type="password"], input[name="Passwd"], input[name="password"], input[aria-label*="Password" i], input[aria-label*="password" i], input[aria-label*="Sandi" i], input[aria-label*="kata sandi" i]');if(l){t("entering_password","Entering Google password"),await A(l,g)?(t("submitting_password","Submitting password"),await v(a,e)):t("password_fill_failed","Could not fill the Google password field; retrying loop"),await a.waitForTimeout(700);continue}if(!await R(a,t)){if(await v(a,f)){t("approving_consent",`Approving Google or ${j} consent`),await a.waitForTimeout(700);continue}t("waiting_for_next_screen",`Waiting for the next Google or ${j} screen`),await a.waitForTimeout(700)}}return t("manual_assist_required",`Flow did not complete ${j} authorization automatically`),{status:"needs_manual",error:`Manual assist required in the browser session because the login flow did not complete ${j} authorization automatically.`}}async function V({page:a,authUrl:b,email:c,password:d,callbackPromise:e,shortTimeoutMs:f=9e4,onStep:g}){return U({page:a,authUrl:b,email:c,password:d,successPromise:e,shortTimeoutMs:f,serviceLabel:"Kiro",openingStep:"opening_google_oauth",openingMessage:"Opening Google OAuth page",successStep:"kiro_callback_received",successMessage:"Kiro callback received",onStep:g})}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,LF:()=>d.LF,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(1399)},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/Fz9IMC9Po2I6i0Ou1e39w/_buildManifest.js","static/Fz9IMC9Po2I6i0Ou1e39w/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-f482ccef6733ebcc.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-e569667691edc8f7.js","static/chunks/main-app-5a6578c0256da676.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/AcNhouZGB-IW1HaLcuwFO/_buildManifest.js","static/AcNhouZGB-IW1HaLcuwFO/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-f482ccef6733ebcc.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-e569667691edc8f7.js","static/chunks/main-app-5a6578c0256da676.js"],rootMainFilesTree:{},pages:{"/_app":[]}};