agent-relay 2.0.16 → 2.0.18

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 (153) hide show
  1. package/deploy/workspace/entrypoint.sh +35 -19
  2. package/deploy/workspace/git-credential-relay +82 -7
  3. package/dist/dashboard/out/404.html +1 -1
  4. package/dist/dashboard/out/_next/static/chunks/320-402ffc8646b31da1.js +1 -0
  5. package/dist/dashboard/out/_next/static/chunks/83-26d2bde54616ee90.js +1 -0
  6. package/{packages/dashboard/ui-dist/_next/static/chunks/app/app/page-9d6bc8729b429956.js → dist/dashboard/out/_next/static/chunks/app/app/page-366fb7c078d4e9e0.js} +1 -1
  7. package/dist/dashboard/out/_next/static/chunks/app/complete-profile/page-dd64bbdf66b639cd.js +1 -0
  8. package/dist/dashboard/out/_next/static/chunks/app/login/page-435eceb0073be027.js +1 -0
  9. package/dist/dashboard/out/_next/static/chunks/app/{page-487fa38f041815c1.js → page-8119d4246743574e.js} +1 -1
  10. package/dist/dashboard/out/_next/static/chunks/app/signup/page-c7a0a28341365ae0.js +1 -0
  11. package/dist/dashboard/out/_next/static/chunks/{main-5a40a5ae29646e1b.js → main-311c3db74dcfadb7.js} +1 -1
  12. package/dist/dashboard/out/_next/static/css/{605dd4e30c91986f.css → 45361ce86b2847c4.css} +1 -1
  13. package/dist/dashboard/out/app/onboarding.html +1 -1
  14. package/dist/dashboard/out/app/onboarding.txt +1 -1
  15. package/dist/dashboard/out/app.html +1 -1
  16. package/dist/dashboard/out/app.txt +2 -2
  17. package/dist/dashboard/out/cloud/link.html +1 -1
  18. package/dist/dashboard/out/cloud/link.txt +1 -1
  19. package/dist/dashboard/out/complete-profile.html +5 -0
  20. package/dist/dashboard/out/complete-profile.txt +7 -0
  21. package/dist/dashboard/out/connect-repos.html +1 -1
  22. package/dist/dashboard/out/connect-repos.txt +1 -1
  23. package/dist/dashboard/out/history.html +1 -1
  24. package/dist/dashboard/out/history.txt +1 -1
  25. package/dist/dashboard/out/index.html +1 -1
  26. package/dist/dashboard/out/index.txt +2 -2
  27. package/dist/dashboard/out/login.html +2 -2
  28. package/dist/dashboard/out/login.txt +2 -2
  29. package/dist/dashboard/out/metrics.html +1 -1
  30. package/dist/dashboard/out/metrics.txt +1 -1
  31. package/dist/dashboard/out/pricing.html +2 -2
  32. package/dist/dashboard/out/pricing.txt +1 -1
  33. package/dist/dashboard/out/providers/setup/claude.html +1 -1
  34. package/dist/dashboard/out/providers/setup/claude.txt +1 -1
  35. package/dist/dashboard/out/providers/setup/codex.html +1 -1
  36. package/dist/dashboard/out/providers/setup/codex.txt +1 -1
  37. package/dist/dashboard/out/providers/setup/cursor.html +1 -1
  38. package/dist/dashboard/out/providers/setup/cursor.txt +1 -1
  39. package/dist/dashboard/out/providers.html +1 -1
  40. package/dist/dashboard/out/providers.txt +2 -2
  41. package/dist/dashboard/out/signup.html +2 -2
  42. package/dist/dashboard/out/signup.txt +2 -2
  43. package/dist/src/cli/index.js +3 -1
  44. package/package.json +22 -21
  45. package/packages/api-types/package.json +1 -1
  46. package/packages/bridge/package.json +8 -8
  47. package/packages/cloud/dist/api/auth.js +2 -0
  48. package/packages/cloud/dist/api/billing.js +4 -4
  49. package/packages/cloud/dist/api/email-auth.d.ts +11 -0
  50. package/packages/cloud/dist/api/email-auth.js +347 -0
  51. package/packages/cloud/dist/api/nango-auth.js +72 -5
  52. package/packages/cloud/dist/db/drizzle.d.ts +35 -1
  53. package/packages/cloud/dist/db/drizzle.js +136 -0
  54. package/packages/cloud/dist/db/index.d.ts +5 -4
  55. package/packages/cloud/dist/db/index.js +5 -3
  56. package/packages/cloud/dist/db/schema.d.ts +246 -2
  57. package/packages/cloud/dist/db/schema.js +39 -3
  58. package/packages/cloud/dist/provisioner/index.js +5 -1
  59. package/packages/cloud/dist/server.js +134 -24
  60. package/packages/cloud/dist/services/nango.d.ts +18 -0
  61. package/packages/cloud/dist/services/nango.js +32 -0
  62. package/packages/cloud/package.json +6 -6
  63. package/packages/config/package.json +2 -2
  64. package/packages/continuity/package.json +1 -1
  65. package/packages/daemon/package.json +12 -12
  66. package/packages/dashboard/dist/server.js +36 -7
  67. package/packages/dashboard/package.json +13 -13
  68. package/packages/dashboard/ui/app/complete-profile/page.tsx +204 -0
  69. package/packages/dashboard/ui/app/login/page.tsx +182 -38
  70. package/packages/dashboard/ui/app/signup/page.tsx +244 -54
  71. package/packages/dashboard/ui/lib/cloudApi.ts +1 -0
  72. package/packages/dashboard/ui/react-components/App.tsx +1 -1
  73. package/packages/dashboard/ui/react-components/ProviderAuthFlow.tsx +10 -0
  74. package/packages/dashboard/ui/react-components/RepoAccessPanel.tsx +160 -3
  75. package/packages/dashboard/ui-dist/404.html +1 -1
  76. package/packages/dashboard/ui-dist/_next/static/chunks/320-402ffc8646b31da1.js +1 -0
  77. package/packages/dashboard/ui-dist/_next/static/chunks/83-26d2bde54616ee90.js +1 -0
  78. package/{dist/dashboard/out/_next/static/chunks/app/app/page-9d6bc8729b429956.js → packages/dashboard/ui-dist/_next/static/chunks/app/app/page-366fb7c078d4e9e0.js} +1 -1
  79. package/packages/dashboard/ui-dist/_next/static/chunks/app/complete-profile/page-dd64bbdf66b639cd.js +1 -0
  80. package/packages/dashboard/ui-dist/_next/static/chunks/app/login/page-435eceb0073be027.js +1 -0
  81. package/packages/dashboard/ui-dist/_next/static/chunks/app/{page-487fa38f041815c1.js → page-8119d4246743574e.js} +1 -1
  82. package/packages/dashboard/ui-dist/_next/static/chunks/app/signup/page-c7a0a28341365ae0.js +1 -0
  83. package/packages/dashboard/ui-dist/_next/static/chunks/{main-5a40a5ae29646e1b.js → main-311c3db74dcfadb7.js} +1 -1
  84. package/packages/dashboard/ui-dist/_next/static/css/{605dd4e30c91986f.css → 45361ce86b2847c4.css} +1 -1
  85. package/packages/dashboard/ui-dist/app/onboarding.html +1 -1
  86. package/packages/dashboard/ui-dist/app/onboarding.txt +1 -1
  87. package/packages/dashboard/ui-dist/app.html +1 -1
  88. package/packages/dashboard/ui-dist/app.txt +2 -2
  89. package/packages/dashboard/ui-dist/cloud/link.html +1 -1
  90. package/packages/dashboard/ui-dist/cloud/link.txt +1 -1
  91. package/packages/dashboard/ui-dist/complete-profile.html +5 -0
  92. package/packages/dashboard/ui-dist/complete-profile.txt +7 -0
  93. package/packages/dashboard/ui-dist/connect-repos.html +1 -1
  94. package/packages/dashboard/ui-dist/connect-repos.txt +1 -1
  95. package/packages/dashboard/ui-dist/history.html +1 -1
  96. package/packages/dashboard/ui-dist/history.txt +1 -1
  97. package/packages/dashboard/ui-dist/index.html +1 -1
  98. package/packages/dashboard/ui-dist/index.txt +2 -2
  99. package/packages/dashboard/ui-dist/login.html +2 -2
  100. package/packages/dashboard/ui-dist/login.txt +2 -2
  101. package/packages/dashboard/ui-dist/metrics.html +1 -1
  102. package/packages/dashboard/ui-dist/metrics.txt +1 -1
  103. package/packages/dashboard/ui-dist/pricing.html +2 -2
  104. package/packages/dashboard/ui-dist/pricing.txt +1 -1
  105. package/packages/dashboard/ui-dist/providers/setup/claude.html +1 -1
  106. package/packages/dashboard/ui-dist/providers/setup/claude.txt +1 -1
  107. package/packages/dashboard/ui-dist/providers/setup/codex.html +1 -1
  108. package/packages/dashboard/ui-dist/providers/setup/codex.txt +1 -1
  109. package/packages/dashboard/ui-dist/providers/setup/cursor.html +1 -1
  110. package/packages/dashboard/ui-dist/providers/setup/cursor.txt +1 -1
  111. package/packages/dashboard/ui-dist/providers.html +1 -1
  112. package/packages/dashboard/ui-dist/providers.txt +2 -2
  113. package/packages/dashboard/ui-dist/signup.html +2 -2
  114. package/packages/dashboard/ui-dist/signup.txt +2 -2
  115. package/packages/dashboard-server/dist/server.js +36 -7
  116. package/packages/dashboard-server/package.json +12 -12
  117. package/packages/hooks/package.json +4 -4
  118. package/packages/mcp/package.json +2 -2
  119. package/packages/memory/package.json +2 -2
  120. package/packages/policy/package.json +2 -2
  121. package/packages/protocol/package.json +1 -1
  122. package/packages/resiliency/package.json +1 -1
  123. package/packages/sdk/package.json +2 -2
  124. package/packages/spawner/package.json +1 -1
  125. package/packages/state/package.json +1 -1
  126. package/packages/storage/package.json +2 -2
  127. package/packages/telemetry/package.json +1 -1
  128. package/packages/trajectory/package.json +2 -2
  129. package/packages/user-directory/package.json +2 -2
  130. package/packages/utils/package.json +1 -1
  131. package/packages/wrapper/dist/relay-pty-orchestrator.js +17 -3
  132. package/packages/wrapper/package.json +6 -6
  133. package/relay-snippets/agent-policy-snippet.md +40 -0
  134. package/relay-snippets/agent-relay-protocol.md +101 -0
  135. package/relay-snippets/agent-relay-snippet.md +177 -0
  136. package/SESSION_HANDOFF.md +0 -67
  137. package/dist/dashboard/out/_next/static/chunks/320-23e5ffe6aa7eb934.js +0 -1
  138. package/dist/dashboard/out/_next/static/chunks/83-4f08122d4e7e79a6.js +0 -1
  139. package/dist/dashboard/out/_next/static/chunks/app/login/page-a0ca6f7ca6a100b8.js +0 -1
  140. package/dist/dashboard/out/_next/static/chunks/app/signup/page-1ede2205b58649ca.js +0 -1
  141. package/packages/dashboard/ui-dist/_next/static/chunks/320-23e5ffe6aa7eb934.js +0 -1
  142. package/packages/dashboard/ui-dist/_next/static/chunks/83-4f08122d4e7e79a6.js +0 -1
  143. package/packages/dashboard/ui-dist/_next/static/chunks/app/login/page-a0ca6f7ca6a100b8.js +0 -1
  144. package/packages/dashboard/ui-dist/_next/static/chunks/app/signup/page-1ede2205b58649ca.js +0 -1
  145. package/test-push.txt +0 -1
  146. /package/dist/dashboard/out/_next/static/{itBGQ1M8yMA_hC42DKCqv → JIjqkuDKNeoSg7KaMMuhx}/_buildManifest.js +0 -0
  147. /package/dist/dashboard/out/_next/static/{itBGQ1M8yMA_hC42DKCqv → JIjqkuDKNeoSg7KaMMuhx}/_ssgManifest.js +0 -0
  148. /package/packages/dashboard/ui-dist/_next/static/{ML6Zby1B5OtZvl0Pa1zSZ → JIjqkuDKNeoSg7KaMMuhx}/_buildManifest.js +0 -0
  149. /package/packages/dashboard/ui-dist/_next/static/{ML6Zby1B5OtZvl0Pa1zSZ → JIjqkuDKNeoSg7KaMMuhx}/_ssgManifest.js +0 -0
  150. /package/packages/dashboard/ui-dist/_next/static/{Ni5Di0TB0PDcrvEYBFRKd → nmkOi7bqeDmLMoWBih8lz}/_buildManifest.js +0 -0
  151. /package/packages/dashboard/ui-dist/_next/static/{Ni5Di0TB0PDcrvEYBFRKd → nmkOi7bqeDmLMoWBih8lz}/_ssgManifest.js +0 -0
  152. /package/packages/dashboard/ui-dist/_next/static/{itBGQ1M8yMA_hC42DKCqv → wk_gKRNSPpWE-ZhGL6UMl}/_buildManifest.js +0 -0
  153. /package/packages/dashboard/ui-dist/_next/static/{itBGQ1M8yMA_hC42DKCqv → wk_gKRNSPpWE-ZhGL6UMl}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[83],{3083:function(e,t,s){s.d(t,{j:function(){return i}});var a=s(7437),n=s(2265);let r={codex:"openai"};function i(e){let{provider:t,workspaceId:s,csrfToken:i,onSuccess:c,onCancel:o,onError:l,useDeviceFlow:d=!1}=e,[u,h]=(0,n.useState)("idle"),[x,m]=(0,n.useState)(null),[p,b]=(0,n.useState)(null),[y,g]=(0,n.useState)(""),[f,w]=(0,n.useState)(null),[j,N]=(0,n.useState)(null),[v,k]=(0,n.useState)(null),[C,S]=(0,n.useState)(null),[T,A]=(0,n.useState)(!1),[I,E]=(0,n.useState)(!1),[O,F]=(0,n.useState)(!1),[R,L]=(0,n.useState)(!1),P=(0,n.useRef)(!1),U=(0,n.useRef)(!1),W=(0,n.useRef)(!1),z=(0,n.useRef)(!1),B=r[t.id]||t.id,M=t.requiresUrlCopy||"codex"===t.id||"openai"===B,V=(0,n.useCallback)(async()=>{h("starting"),w(null),P.current=!1;try{let e={"Content-Type":"application/json"};i&&(e["X-CSRF-Token"]=i);let t=await fetch("/api/onboarding/cli/".concat(B,"/start"),{method:"POST",credentials:"include",headers:e,body:JSON.stringify({workspaceId:s,useDeviceFlow:d})}),a=await t.json();if(!t.ok)throw Error(a.error||"Failed to start authentication");if("success"===a.status||a.alreadyAuthenticated){h("success"),c();return}b(a.sessionId),a.useDeviceFlow&&L(!0),a.authUrl?(m(a.authUrl),h("waiting"),(!M||a.useDeviceFlow)&&K(a.authUrl),H(a.sessionId)):a.sessionId&&H(a.sessionId)}catch(t){let e=t instanceof Error?t.message:"Failed to start authentication";w(e),h("error"),l(e)}},[B,s,i,d,c,l,M]),D=(0,n.useRef)(null),X=(0,n.useRef)(null),_=(0,n.useCallback)((e,t)=>{if(W.current)return;W.current=!0,F(!0);let s=0,a=async()=>{if(s>=120||!W.current){W.current=!1,F(!1);return}try{let n=await fetch("/api/auth/codex-helper/auth-status/".concat(e),{credentials:"include"});if(n.ok&&(await n.json()).authenticated){W.current=!1,F(!1),X.current&&await X.current(t);return}s++,setTimeout(a,5e3)}catch(e){console.error("CLI poll error:",e),s++,setTimeout(a,5e3)}};a()},[]),J=(0,n.useCallback)(async()=>{if(M){A(!0);try{let e={"Content-Type":"application/json"};i&&(e["X-CSRF-Token"]=i);let t=await fetch("/api/auth/codex-helper/cli-session",{method:"POST",credentials:"include",headers:e,body:JSON.stringify({workspaceId:s,authUrl:x,sessionId:p})});if(t.ok){let e=await t.json();N(e.commandWithUrl||e.command),e.workspaceId?(k(e.workspaceId),S(e.workspaceName||null),_(e.workspaceId,p||void 0)):e.authSessionId&&(k(e.authSessionId),_(e.authSessionId,p||void 0))}}catch(e){console.error("Failed to fetch CLI session:",e)}finally{A(!1)}}},[M,s,i,_,p,x]);(0,n.useEffect)(()=>{"waiting"!==u||!M||R||j||J()},[u,M,R,j,J]);let K=(0,n.useCallback)(e=>{let s=window.screenX+(window.outerWidth-600)/2,a=window.screenY+(window.outerHeight-700)/2;window.open(e,"".concat(t.displayName," Login"),"width=".concat(600,",height=").concat(700,",left=").concat(s,",top=").concat(a,",popup=yes")),P.current=!0},[t.displayName]),H=(0,n.useCallback)(e=>{if(U.current)return;U.current=!0;let t=0,s=async()=>{if(t>=60){U.current=!1,w("Authentication timed out. Please try again."),h("error"),l("Authentication timed out");return}try{let a=await fetch("/api/onboarding/cli/".concat(B,"/status/").concat(e),{credentials:"include"}),n=await a.json();if(!a.ok)throw Error(n.error||"Failed to check status");if("success"===n.status){U.current=!1,await Y(e);return}if("error"===n.status)throw Error(n.error||"Authentication failed");"waiting_auth"!==n.status||!n.authUrl||(m(n.authUrl),h("waiting"),P.current||M||K(n.authUrl)),t++,setTimeout(s,5e3)}catch(t){U.current=!1;let e=t instanceof Error?t.message:"Auth check failed";w(e),h("error"),l(e)}};s()},[B,K,l,M]),Y=(0,n.useCallback)(async e=>{let t=e||p;if(t&&!z.current){z.current=!0,U.current=!1,W.current=!1,h("submitting"),w(null);try{let e={"Content-Type":"application/json"};i&&(e["X-CSRF-Token"]=i);let s=await fetch("/api/onboarding/cli/".concat(B,"/complete/").concat(t),{method:"POST",credentials:"include",headers:e}),a=await s.json();if(!s.ok)throw Error(a.error||"Failed to complete authentication");h("success"),setTimeout(()=>c(),1500)}catch(t){z.current=!1;let e=t instanceof Error?t.message:"Failed to complete authentication";w(e),h("error"),l(e)}}},[p,B,i,c,l]);(0,n.useEffect)(()=>{X.current=Y},[Y]);let q=(0,n.useCallback)(async()=>{if(!p||!y.trim())return;h("submitting"),w(null);let e=y.trim();if(e.includes("code="))try{let t=new URL(e).searchParams.get("code");t&&(e=t)}catch(s){let t=e.match(/code=([^&\s]+)/);t&&(e=t[1])}try{let t={"Content-Type":"application/json"};i&&(t["X-CSRF-Token"]=i);let s=await fetch("/api/onboarding/cli/".concat(B,"/code/").concat(p),{method:"POST",credentials:"include",headers:t,body:JSON.stringify({code:e})}),a=await s.json();if(!s.ok){if(a.needsRestart){w('The authentication session timed out. Please click "Try Again" to restart.'),h("error");return}throw Error(a.error||"Failed to submit auth code")}g(""),a.success&&await Y()}catch(t){let e=t instanceof Error?t.message:"Failed to submit auth code";w(e),h("error"),l(e)}},[p,y,B,i,Y,l]);(0,n.useEffect)(()=>{D.current=async(e,t)=>{if(p){h("submitting"),w(null);try{let s={"Content-Type":"application/json"};i&&(s["X-CSRF-Token"]=i);let a=await fetch("/api/onboarding/cli/".concat(B,"/code/").concat(p),{method:"POST",credentials:"include",headers:s,body:JSON.stringify({code:e,state:t})}),n=await a.json();if(!a.ok){if(n.needsRestart){w('The authentication session timed out. Please click "Try Again" to restart.'),h("error");return}throw Error(n.error||"Failed to submit auth code")}n.success&&await Y()}catch(t){let e=t instanceof Error?t.message:"Failed to submit auth code";w(e),h("error"),l(e)}}}},[p,B,i,Y,l]);let G=(0,n.useCallback)(async()=>{if(U.current=!1,p)try{await fetch("/api/onboarding/cli/".concat(B,"/cancel/").concat(p),{method:"POST",credentials:"include"})}catch(e){}h("idle"),m(null),b(null),g(""),w(null),o()},[p,B,o]);(0,n.useEffect)(()=>("idle"===u&&V(),()=>{U.current=!1,W.current=!1,F(!1)}),[V,u]);let Q="anthropic"===t.id||"anthropic"===B;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold",style:{backgroundColor:t.color},children:t.displayName[0]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-white",children:t.displayName}),(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["starting"===u&&"Starting authentication...","waiting"===u&&"Complete authentication below","submitting"===u&&"Verifying...","success"===u&&"Connected!","error"===u&&(f||"Authentication failed")]})]})]}),"starting"===u&&(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3 py-4",children:[(0,a.jsxs)("svg",{className:"w-5 h-5 text-accent-cyan animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("span",{className:"text-text-muted",children:"Preparing authentication..."})]}),"waiting"===u&&x&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"p-4 bg-bg-tertiary rounded-lg border border-border-subtle",children:[(0,a.jsx)("h4",{className:"font-medium text-white mb-2",children:"Complete authentication:"}),M&&R?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Sign in with your OpenAI account in the popup window. You'll see a device code to enter - this confirms the authorization."}):M?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Run the CLI command below. It establishes an SSH tunnel to forward the OAuth callback to your workspace."}):Q?(0,a.jsxs)("ol",{className:"text-sm text-text-muted space-y-2 list-decimal list-inside",children:[(0,a.jsx)("li",{children:"Click the button below to open the login page"}),(0,a.jsx)("li",{children:"Sign in with your Anthropic account"}),(0,a.jsxs)("li",{children:["After signing in, Anthropic will display an ",(0,a.jsx)("strong",{children:"authentication code"})]}),(0,a.jsx)("li",{children:"Copy that code and paste it in the input below"}),(0,a.jsx)("li",{children:"Click Submit to complete authentication"})]}):(0,a.jsxs)("ol",{className:"text-sm text-text-muted space-y-2 list-decimal list-inside",children:[(0,a.jsx)("li",{children:"Click the button below to open the login page"}),(0,a.jsxs)("li",{children:["Sign in with your ",t.displayName," account"]}),(0,a.jsx)("li",{children:'If you receive a code, paste it below. Otherwise click "I\'ve completed login"'})]})]}),!(M&&j&&!I)&&(0,a.jsxs)("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"block w-full py-2 px-4 bg-bg-tertiary border border-border-subtle text-white font-medium rounded-lg text-center hover:border-accent-cyan/50 transition-all",children:["Open ",t.displayName," Login Page"]}),M&&R?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"p-3 bg-accent-cyan/10 border border-accent-cyan/30 rounded-lg",children:(0,a.jsxs)("p",{className:"text-sm text-accent-cyan",children:[(0,a.jsx)("strong",{children:"Device Authentication:"})," Complete the sign-in in the popup window. After signing in, you'll see a code - enter it on the OpenAI page to authorize."]})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-accent-cyan/5 border border-accent-cyan/20 rounded-lg text-sm text-accent-cyan",children:[(0,a.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("span",{children:"Waiting for authentication to complete..."})]}),(0,a.jsx)("button",{onClick:()=>Y(),className:"w-full py-2 text-text-muted hover:text-white transition-colors text-sm",children:"I've completed authentication"})]}):M?(0,a.jsxs)("div",{className:"space-y-4",children:[T&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-bg-tertiary rounded-lg border border-border-subtle",children:[(0,a.jsxs)("svg",{className:"w-5 h-5 text-accent-cyan animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Generating session token..."})]}),j&&!I&&!T&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"p-3 bg-accent-cyan/10 border border-accent-cyan/30 rounded-lg",children:[(0,a.jsxs)("p",{className:"text-sm text-accent-cyan mb-2",children:[(0,a.jsx)("strong",{children:"Step 1:"})," Copy and run this command in your terminal"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-deep rounded-lg text-xs font-mono text-white overflow-x-auto",children:j}),(0,a.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(j)},className:"px-3 py-2 bg-bg-tertiary border border-border-subtle rounded-lg text-text-muted hover:text-white hover:border-accent-cyan/50 transition-colors text-xs",children:"Copy"})]})]}),(0,a.jsxs)("div",{className:"p-3 bg-bg-tertiary border border-border-subtle rounded-lg",children:[(0,a.jsxs)("p",{className:"text-sm text-white mb-1",children:[(0,a.jsx)("strong",{children:"Step 2:"})," Sign in with OpenAI"]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"The CLI will open your browser to the OpenAI login page. Sign in with your OpenAI account."})]}),(0,a.jsxs)("div",{className:"p-3 bg-bg-tertiary border border-border-subtle rounded-lg",children:[(0,a.jsxs)("p",{className:"text-sm text-white mb-1",children:[(0,a.jsx)("strong",{children:"Step 3:"})," Authentication completes automatically"]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"After signing in, the CLI will capture the callback and this page will update automatically."})]}),O&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-success/10 border border-success/30 rounded-lg text-sm text-success",children:[(0,a.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("span",{children:"Waiting for authentication to complete..."})]}),(0,a.jsx)("button",{onClick:()=>E(!0),className:"text-xs text-text-muted hover:text-white transition-colors",children:"CLI not working? Click here for manual method"})]}),!T&&(I||!j)&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"p-3 bg-amber-500/10 border border-amber-500/30 rounded-lg",children:(0,a.jsxs)("p",{className:"text-xs text-amber-400",children:[(0,a.jsx)("strong",{children:"Manual method:"})," After login, you'll see \"This site can't be reached\" - this is expected! Copy the full URL from your browser's address bar and paste it below."]})}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",placeholder:"Paste the localhost URL here (e.g., http://localhost:...)",value:y,onChange:e=>g(e.target.value),className:"flex-1 px-4 py-3 bg-bg-tertiary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:border-accent-cyan transition-colors font-mono text-sm",onKeyDown:e=>{"Enter"===e.key&&y.trim()&&q()}}),(0,a.jsx)("button",{onClick:q,disabled:!y.trim(),className:"px-6 py-3 bg-accent-cyan text-bg-deep font-semibold rounded-xl hover:bg-accent-cyan/90 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:"Submit"})]}),j&&(0,a.jsx)("button",{onClick:()=>E(!1),className:"text-xs text-accent-cyan hover:underline",children:"← Back to CLI method"})]})]}):Q?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"p-3 bg-accent-cyan/10 border border-accent-cyan/30 rounded-lg",children:(0,a.jsxs)("p",{className:"text-xs text-accent-cyan",children:[(0,a.jsx)("strong",{children:"Look for the code:"})," After signing in, Anthropic will show you an authentication code. Copy it and paste it below."]})}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",placeholder:"Paste the authentication code here",value:y,onChange:e=>g(e.target.value),className:"flex-1 px-4 py-3 bg-bg-tertiary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:border-accent-cyan transition-colors font-mono text-sm",onKeyDown:e=>{"Enter"===e.key&&y.trim()&&q()}}),(0,a.jsx)("button",{onClick:q,disabled:!y.trim(),className:"px-6 py-3 bg-accent-cyan text-bg-deep font-semibold rounded-xl hover:bg-accent-cyan/90 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:"Submit"})]})]}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",placeholder:"Paste authentication code (if provided)",value:y,onChange:e=>g(e.target.value),className:"flex-1 px-4 py-3 bg-bg-tertiary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:border-accent-cyan transition-colors font-mono text-sm",onKeyDown:e=>{"Enter"===e.key&&y.trim()&&q()}}),(0,a.jsx)("button",{onClick:q,disabled:!y.trim(),className:"px-6 py-3 bg-accent-cyan text-bg-deep font-semibold rounded-xl hover:bg-accent-cyan/90 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:"Submit"})]}),(0,a.jsx)("button",{onClick:()=>Y(),className:"w-full py-2 text-text-muted hover:text-white transition-colors text-sm",children:"No code? Click here if you've completed login"})]}),(0,a.jsx)("button",{onClick:G,className:"w-full py-2 text-text-muted hover:text-white transition-colors text-sm",children:"Cancel"})]}),"submitting"===u&&(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3 py-4",children:[(0,a.jsxs)("svg",{className:"w-5 h-5 text-accent-cyan animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("span",{className:"text-text-muted",children:"Verifying authentication..."})]}),"success"===u&&(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3 py-4",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-success/20 rounded-full flex items-center justify-center",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-success",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),(0,a.jsxs)("span",{className:"text-white font-medium",children:[t.displayName," connected!"]})]}),"error"===u&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"p-4 bg-error/10 border border-error/30 rounded-lg text-error text-sm",children:f||"Authentication failed. Please try again."}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:V,className:"flex-1 py-2 px-4 bg-bg-tertiary border border-border-subtle text-white rounded-lg hover:border-accent-cyan/50 transition-colors",children:"Try Again"}),(0,a.jsx)("button",{onClick:G,className:"py-2 px-4 text-text-muted hover:text-white transition-colors",children:"Cancel"})]})]})]})}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[191],{1702:function(e,n,t){Promise.resolve().then(t.bind(t,3330))},3330:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return f}});var r=t(7437),a=t(2265),s=t(7320),i=t(5372),o=t(6272),l=t(9116);let c=[{id:"creating",name:"Initialize",description:"Creating workspace container",estimatedSeconds:5,icon:"◈"},{id:"networking",name:"Network",description:"Configuring DNS & IP allocation",estimatedSeconds:8,icon:"◇"},{id:"secrets",name:"Secure",description:"Encrypting credentials",estimatedSeconds:3,icon:"◆"},{id:"machine",name:"Deploy",description:"Launching cloud instance",estimatedSeconds:25,icon:"▣"},{id:"booting",name:"Boot",description:"Starting relay services",estimatedSeconds:20,icon:"▢"},{id:"health",name:"Verify",description:"Running health checks",estimatedSeconds:15,icon:"◉"}],d=["> Establishing secure connection...","> Allocating compute resources...","> Configuring agent protocols...","> Initializing relay daemon...","> Syncing workspace state...","> Warming up inference engine...","> Connecting to neural mesh...","> Deploying agent swarm..."];function p(e){let{currentStage:n,isProvisioning:t,workspaceName:s,error:i,onCancel:o}=e,[l,p]=(0,a.useState)(0),[g,u]=(0,a.useState)([]),[h,b]=(0,a.useState)(!0);(0,a.useEffect)(()=>{if(!t){p(0);return}let e=setInterval(()=>{p(e=>e+1)},1e3);return()=>clearInterval(e)},[t]),(0,a.useEffect)(()=>{let e=setInterval(()=>{b(e=>!e)},530);return()=>clearInterval(e)},[]),(0,a.useEffect)(()=>{if(!t){u([]);return}let e=()=>{let e=d[Math.floor(Math.random()*d.length)];u(n=>[...n.slice(-4),e])};e();let n=setInterval(e,3500);return()=>clearInterval(n)},[t]);let f=(0,a.useMemo)(()=>{if(n){let e=c.findIndex(e=>e.id===n);return e>=0?e:0}let e=0;for(let n=0;n<c.length;n++)if(l<(e+=c[n].estimatedSeconds))return n;return c.length-1},[n,l]),w=(0,a.useMemo)(()=>c.reduce((e,n)=>e+n.estimatedSeconds,0),[]),v=(0,a.useMemo)(()=>Math.min(95,Math.round(l/w*100)),[l,w]);return i?(0,r.jsxs)("div",{className:"prov-container prov-error",children:[(0,r.jsx)("div",{className:"error-glitch",children:(0,r.jsx)("span",{className:"error-icon",children:"✕"})}),(0,r.jsx)("h3",{className:"error-title",children:"PROVISIONING FAILED"}),(0,r.jsx)("p",{className:"error-message",children:i}),o&&(0,r.jsx)("button",{onClick:o,className:"retry-btn",children:(0,r.jsx)("span",{children:"RETRY"})}),(0,r.jsx)("style",{children:x})]}):(0,r.jsxs)("div",{className:"prov-container",children:[(0,r.jsx)("div",{className:"ambient-glow"}),(0,r.jsx)("div",{className:"scan-line"}),(0,r.jsxs)("header",{className:"prov-header",children:[(0,r.jsx)("div",{className:"header-badge",children:"PROVISIONING"}),(0,r.jsx)("h1",{className:"header-title",children:s||"Workspace"}),(0,r.jsxs)("div",{className:"header-meta",children:[(0,r.jsx)("span",{className:"meta-time",children:(e=>{let n=Math.floor(e/60),t=e%60;return n>0?"".concat(n,":").concat(t.toString().padStart(2,"0")):"0:".concat(t.toString().padStart(2,"0"))})(l)}),(0,r.jsx)("span",{className:"meta-sep",children:"•"}),(0,r.jsxs)("span",{className:"meta-percent",children:[v,"%"]})]})]}),(0,r.jsxs)("div",{className:"progress-track",children:[(0,r.jsx)("div",{className:"progress-fill",style:{width:"".concat(v,"%")}}),(0,r.jsx)("div",{className:"progress-glow",style:{left:"".concat(v,"%")}})]}),(0,r.jsx)("div",{className:"stages-timeline",children:c.map((e,n)=>{let t=n<f,a=n===f,s=n>f;return(0,r.jsxs)("div",{className:"stage-row ".concat(t?"completed":""," ").concat(a?"current":""," ").concat(s?"pending":""),children:[n>0&&(0,r.jsxs)("div",{className:"stage-connector ".concat(t?"active":""),children:[(0,r.jsx)("div",{className:"connector-line"}),t&&(0,r.jsx)("div",{className:"connector-pulse"})]}),(0,r.jsxs)("div",{className:"stage-node",children:[(0,r.jsx)("span",{className:"node-icon",children:e.icon}),a&&(0,r.jsx)("div",{className:"node-ring"})]}),(0,r.jsxs)("div",{className:"stage-content",children:[(0,r.jsx)("span",{className:"stage-name",children:e.name}),a&&(0,r.jsx)("span",{className:"stage-desc",children:e.description})]}),(0,r.jsxs)("div",{className:"stage-status",children:[t&&(0,r.jsx)("span",{className:"status-done",children:"DONE"}),a&&(0,r.jsx)("span",{className:"status-active",children:"ACTIVE"}),s&&(0,r.jsxs)("span",{className:"status-wait",children:["~",e.estimatedSeconds,"s"]})]})]},e.id)})}),(0,r.jsxs)("div",{className:"terminal-window",children:[(0,r.jsxs)("div",{className:"terminal-header",children:[(0,r.jsx)("span",{className:"terminal-dot red"}),(0,r.jsx)("span",{className:"terminal-dot yellow"}),(0,r.jsx)("span",{className:"terminal-dot green"}),(0,r.jsx)("span",{className:"terminal-title",children:"agent-relay"})]}),(0,r.jsxs)("div",{className:"terminal-body",children:[g.map((e,n)=>(0,r.jsx)("div",{className:"terminal-line",style:{animationDelay:"".concat(.1*n,"s")},children:e},n)),(0,r.jsxs)("div",{className:"terminal-cursor",children:[(0,r.jsx)("span",{className:"cursor-prompt",children:"$"}),(0,r.jsx)("span",{className:"cursor-block ".concat(h?"visible":""),children:"_"})]})]})]}),o&&(0,r.jsx)("button",{onClick:o,className:"cancel-btn",children:"Cancel"}),(0,r.jsx)("style",{children:m})]})}let m="\n .prov-container {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 40px 32px;\n background: linear-gradient(145deg, rgba(10, 15, 25, 0.95) 0%, rgba(5, 10, 18, 0.98) 100%);\n border: 1px solid rgba(6, 182, 212, 0.15);\n border-radius: 16px;\n overflow: hidden;\n font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;\n }\n\n /* Ambient effects */\n .ambient-glow {\n position: absolute;\n top: -100px;\n left: 50%;\n transform: translateX(-50%);\n width: 300px;\n height: 200px;\n background: radial-gradient(ellipse, rgba(6, 182, 212, 0.12) 0%, transparent 70%);\n pointer-events: none;\n }\n\n .scan-line {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 2px;\n background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.4), transparent);\n animation: scanMove 3s ease-in-out infinite;\n pointer-events: none;\n }\n\n @keyframes scanMove {\n 0%, 100% { top: 0; opacity: 0.5; }\n 50% { top: 100%; opacity: 0.2; }\n }\n\n /* Header */\n .prov-header {\n text-align: center;\n position: relative;\n z-index: 1;\n }\n\n .header-badge {\n display: inline-block;\n padding: 4px 12px;\n background: rgba(6, 182, 212, 0.1);\n border: 1px solid rgba(6, 182, 212, 0.3);\n border-radius: 4px;\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 2px;\n color: #06b6d4;\n margin-bottom: 12px;\n }\n\n .header-title {\n font-size: 22px;\n font-weight: 600;\n color: #f1f5f9;\n margin: 0 0 8px 0;\n letter-spacing: -0.5px;\n }\n\n .header-meta {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n font-size: 13px;\n color: #64748b;\n }\n\n .meta-time {\n font-variant-numeric: tabular-nums;\n }\n\n .meta-percent {\n color: #06b6d4;\n font-weight: 500;\n }\n\n .meta-sep {\n opacity: 0.3;\n }\n\n /* Progress bar */\n .progress-track {\n position: relative;\n height: 4px;\n background: rgba(100, 116, 139, 0.2);\n border-radius: 2px;\n overflow: visible;\n }\n\n .progress-fill {\n height: 100%;\n background: linear-gradient(90deg, #0891b2, #06b6d4, #22d3ee);\n border-radius: 2px;\n transition: width 0.5s ease;\n }\n\n .progress-glow {\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 8px;\n height: 8px;\n background: #22d3ee;\n border-radius: 50%;\n box-shadow: 0 0 16px rgba(34, 211, 238, 0.6);\n transition: left 0.5s ease;\n }\n\n /* Stages */\n .stages-timeline {\n display: flex;\n flex-direction: column;\n gap: 0;\n padding: 16px 0;\n }\n\n .stage-row {\n display: grid;\n grid-template-columns: 40px 1fr auto;\n align-items: center;\n gap: 12px;\n padding: 10px 0;\n position: relative;\n }\n\n .stage-connector {\n position: absolute;\n left: 19px;\n top: -10px;\n width: 2px;\n height: 20px;\n }\n\n .connector-line {\n width: 100%;\n height: 100%;\n background: rgba(100, 116, 139, 0.3);\n transition: background 0.3s ease;\n }\n\n .stage-connector.active .connector-line {\n background: linear-gradient(180deg, #06b6d4, rgba(6, 182, 212, 0.3));\n }\n\n .connector-pulse {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(180deg, rgba(34, 211, 238, 0.8), transparent);\n animation: pulseLine 1.5s ease-out infinite;\n }\n\n @keyframes pulseLine {\n 0% { opacity: 1; transform: translateY(-100%); }\n 100% { opacity: 0; transform: translateY(100%); }\n }\n\n .stage-node {\n width: 40px;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n }\n\n .node-icon {\n font-size: 18px;\n color: #475569;\n transition: all 0.3s ease;\n }\n\n .stage-row.completed .node-icon {\n color: #06b6d4;\n }\n\n .stage-row.current .node-icon {\n color: #22d3ee;\n text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);\n }\n\n .node-ring {\n position: absolute;\n inset: 4px;\n border: 2px solid rgba(34, 211, 238, 0.4);\n border-radius: 50%;\n animation: ringPulse 2s ease-in-out infinite;\n }\n\n @keyframes ringPulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.2); opacity: 0.5; }\n }\n\n .stage-content {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n }\n\n .stage-name {\n font-size: 13px;\n font-weight: 500;\n color: #64748b;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n transition: color 0.3s ease;\n }\n\n .stage-row.completed .stage-name {\n color: #475569;\n }\n\n .stage-row.current .stage-name {\n color: #f1f5f9;\n }\n\n .stage-desc {\n font-size: 11px;\n color: #64748b;\n animation: fadeSlideIn 0.3s ease;\n }\n\n @keyframes fadeSlideIn {\n from { opacity: 0; transform: translateX(-8px); }\n to { opacity: 1; transform: translateX(0); }\n }\n\n .stage-status {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 1px;\n }\n\n .status-done {\n color: #06b6d4;\n }\n\n .status-active {\n color: #22d3ee;\n animation: blink 1s ease-in-out infinite;\n }\n\n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.5; }\n }\n\n .status-wait {\n color: #475569;\n font-variant-numeric: tabular-nums;\n }\n\n /* Terminal */\n .terminal-window {\n background: rgba(0, 0, 0, 0.4);\n border: 1px solid rgba(100, 116, 139, 0.2);\n border-radius: 8px;\n overflow: hidden;\n }\n\n .terminal-header {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 12px;\n background: rgba(30, 41, 59, 0.5);\n border-bottom: 1px solid rgba(100, 116, 139, 0.15);\n }\n\n .terminal-dot {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n }\n\n .terminal-dot.red { background: #ef4444; }\n .terminal-dot.yellow { background: #eab308; }\n .terminal-dot.green { background: #22c55e; }\n\n .terminal-title {\n margin-left: auto;\n font-size: 11px;\n color: #64748b;\n }\n\n .terminal-body {\n padding: 12px;\n min-height: 100px;\n }\n\n .terminal-line {\n font-size: 12px;\n color: #94a3b8;\n padding: 2px 0;\n animation: typeIn 0.3s ease;\n }\n\n @keyframes typeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n .terminal-cursor {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-top: 8px;\n }\n\n .cursor-prompt {\n color: #06b6d4;\n font-weight: 600;\n }\n\n .cursor-block {\n color: #22d3ee;\n opacity: 0;\n transition: opacity 0.1s;\n }\n\n .cursor-block.visible {\n opacity: 1;\n }\n\n /* Cancel button */\n .cancel-btn {\n align-self: center;\n padding: 8px 20px;\n background: transparent;\n border: 1px solid rgba(100, 116, 139, 0.3);\n border-radius: 6px;\n color: #64748b;\n font-family: inherit;\n font-size: 12px;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .cancel-btn:hover {\n border-color: rgba(239, 68, 68, 0.5);\n color: #ef4444;\n }\n",x="\n .prov-container.prov-error {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n padding: 48px 32px;\n background: linear-gradient(145deg, rgba(25, 10, 10, 0.95) 0%, rgba(15, 5, 8, 0.98) 100%);\n border: 1px solid rgba(239, 68, 68, 0.2);\n border-radius: 16px;\n text-align: center;\n font-family: 'SF Mono', 'JetBrains Mono', monospace;\n }\n\n .error-glitch {\n position: relative;\n width: 64px;\n height: 64px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(239, 68, 68, 0.1);\n border: 1px solid rgba(239, 68, 68, 0.3);\n border-radius: 12px;\n }\n\n .error-icon {\n font-size: 28px;\n color: #ef4444;\n animation: glitch 0.3s ease infinite;\n }\n\n @keyframes glitch {\n 0%, 100% { transform: translate(0); }\n 25% { transform: translate(-2px, 1px); }\n 50% { transform: translate(2px, -1px); }\n 75% { transform: translate(-1px, -1px); }\n }\n\n .error-title {\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 2px;\n color: #ef4444;\n margin: 0;\n }\n\n .error-message {\n font-size: 13px;\n color: #94a3b8;\n max-width: 350px;\n margin: 0;\n line-height: 1.5;\n }\n\n .retry-btn {\n margin-top: 8px;\n padding: 10px 28px;\n background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);\n border: 1px solid rgba(239, 68, 68, 0.4);\n border-radius: 6px;\n color: #ef4444;\n font-family: inherit;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 1px;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .retry-btn:hover {\n background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);\n border-color: rgba(239, 68, 68, 0.6);\n transform: translateY(-1px);\n }\n";var g=t(9631),u=t(257);let h=[{id:"anthropic",name:"Anthropic",displayName:"Claude",color:"#D97757",cliCommand:"claude"},{id:"codex",name:"OpenAI",displayName:"Codex",color:"#10A37F",cliCommand:"codex login",supportsDeviceFlow:!0,requiresUrlCopy:!0},{id:"google",name:"Google",displayName:"Gemini",color:"#4285F4",cliCommand:"gemini"},{id:"opencode",name:"OpenCode",displayName:"OpenCode",color:"#00D4AA",cliCommand:"opencode"},{id:"droid",name:"Factory",displayName:"Droid",color:"#6366F1",cliCommand:"droid"},{id:"cursor",name:"Cursor",displayName:"Cursor",color:"#7C3AED",cliCommand:"agent"}],b="true"===u.env.NEXT_PUBLIC_FORCE_CLOUD_MODE;function f(){let[e,n]=(0,a.useState)("loading"),[t,c]=(0,a.useState)([]),[d,m]=(0,a.useState)([]),[x,u]=(0,a.useState)(null),[f,w]=(0,a.useState)(void 0),[v,j]=(0,a.useState)(null),[N,k]=(0,a.useState)(b),[y,C]=(0,a.useState)(null),[S,I]=(0,a.useState)(null),[E,z]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/auth/session",{credentials:"include"});if(404===e.status){if(b)throw Error("Cloud mode enforced but session endpoint returned 404. Is the cloud server running?");k(!1),n("local");return}let t=e.headers.get("X-CSRF-Token");t&&C(t);let r=await e.json();if(!r.authenticated){window.location.href="/login";return}k(!0);let a={openai:"codex"};if(r.connectedProviders){let e=[];r.connectedProviders.forEach(n=>{e.push(n.provider);let t=a[n.provider];t&&e.push(t)}),z(e)}let[s,i]=await Promise.all([fetch("/api/workspaces/accessible",{credentials:"include"}),fetch("/api/github-app/repos",{credentials:"include"})]);if(!s.ok){if(401===s.status){window.location.href="/login";return}throw Error("Failed to fetch workspaces")}let o=await s.json(),l=i.ok?await i.json():{repositories:[]};c(o.workspaces||[]),m(l.repositories||[]);let d=(o.workspaces||[]).filter(e=>"running"===e.status&&e.publicUrl);1===d.length?M(d[0]):d.length>1?n("select-workspace"):(o.workspaces||[]).length>0?n("select-workspace"):(l.repositories||[]).length>0?n("no-workspaces"):window.location.href="/connect-repos"}catch(e){if(e instanceof TypeError&&e.message.includes("Failed to fetch")){if(b){console.error("Cloud mode enforced but network request failed:",e),j("Cloud mode enforced but failed to connect to server. Is the cloud server running?"),n("error");return}k(!1),n("local");return}console.error("Init error:",e),j(e instanceof Error?e.message:"Failed to initialize"),n("error")}})()},[]);let M=(0,a.useCallback)(e=>{if(!e.publicUrl){j("Workspace has no public URL"),n("error");return}u(e),n("connecting"),(0,l.hc)(e.id);let t=new URL(e.publicUrl),r="https:"===t.protocol?"wss:":"ws:";w("".concat(r,"//").concat(t.host,"/ws")),n("connected")},[]),F=(0,a.useCallback)(async e=>{j(null);try{let t={"Content-Type":"application/json"};y&&(t["X-CSRF-Token"]=y);let r=await fetch("/api/workspaces/quick",{method:"POST",credentials:"include",headers:t,body:JSON.stringify({repositoryFullName:e})}),a=await r.json();if(!r.ok)throw Error(a.error||"Failed to create workspace");let s=Date.now();I({workspaceId:a.workspaceId,workspaceName:e.split("/")[1]||e,stage:null,startedAt:s}),n("provisioning");let i=async e=>{let t=0;for(;t<150;){var r;let a=await fetch("/api/workspaces/".concat(e,"/status"),{credentials:"include"}),s=await a.json();if((null===(r=s.provisioning)||void 0===r?void 0:r.stage)&&I(e=>e?{...e,stage:s.provisioning.stage}:null),"running"===s.status){let t=await fetch("/api/workspaces/".concat(e),{credentials:"include"}),r=await t.json();if(r.publicUrl){I(null),u(r),n("connect-provider");return}}else if("error"===s.status){let e=s.errorMessage||"Workspace provisioning failed";throw Error(e)}await new Promise(e=>setTimeout(e,2e3)),++t%15==0&&console.log("[workspace] Still provisioning... (".concat(Math.floor(2e3*t/1e3),"s elapsed)"))}throw Error("Workspace provisioning timed out after 5 minutes. Please try again or contact support.")};await i(a.workspaceId)}catch(e){console.error("Create workspace error:",e),I(null),j(e instanceof Error?e.message:"Failed to create workspace"),n("no-workspaces")}},[M,y]),P=(0,a.useCallback)(e=>{z(n=>[...new Set([...n,e])])},[]),O=(0,a.useCallback)(()=>{x&&M(x)},[x,M]),T=(0,a.useCallback)(async e=>{n("loading"),j(null);try{let n={};y&&(n["X-CSRF-Token"]=y);let t=await fetch("/api/workspaces/".concat(e.id,"/restart"),{method:"POST",credentials:"include",headers:n});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to start workspace")}let r=0;for(;r<60;){let n=await fetch("/api/workspaces/".concat(e.id,"/status"),{credentials:"include"}),t=await n.json();if("running"===t.status){let n=await fetch("/api/workspaces/".concat(e.id),{credentials:"include"}),t=await n.json();if(t.publicUrl){M({...e,...t});return}}await new Promise(e=>setTimeout(e,2e3)),r++}throw Error("Workspace start timed out")}catch(e){console.error("Start workspace error:",e),j(e instanceof Error?e.message:"Failed to start workspace"),n("select-workspace")}},[M,y]);return"loading"===e?(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,r.jsx)("p",{className:"mt-4 text-text-muted",children:"Loading..."})]})}):"local"===e?(0,r.jsx)(s.gV,{}):"connected"===e&&f?(0,r.jsx)(i.TI,{cloudMode:!0,children:(0,r.jsx)(s.gV,{wsUrl:f})}):"connecting"===e?(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,r.jsxs)("p",{className:"mt-4 text-white font-medium",children:["Connecting to ",null==x?void 0:x.name,"..."]}),(0,r.jsx)("p",{className:"mt-2 text-text-muted text-sm",children:null==x?void 0:x.publicUrl})]})}):"provisioning"===e&&S?(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-full max-w-xl",children:(0,r.jsx)(p,{isProvisioning:!0,currentStage:S.stage,workspaceName:S.workspaceName,error:v,onCancel:()=>{I(null),n("no-workspaces")}})})}):"error"===e?(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center p-4",children:(0,r.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 max-w-md w-full text-center",children:[(0,r.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-error/20 rounded-full flex items-center justify-center",children:(0,r.jsx)("svg",{className:"w-8 h-8 text-error",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Something went wrong"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:v}),(0,r.jsx)("button",{onClick:()=>window.location.reload(),className:"w-full py-3 px-4 bg-bg-tertiary border border-border-subtle rounded-xl text-white font-medium hover:bg-bg-hover transition-colors",children:"Try Again"})]})}):"connect-provider"===e&&x?(0,r.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"fixed inset-0 opacity-10 pointer-events-none",children:(0,r.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,r.jsxs)("div",{className:"relative z-10 w-full max-w-xl",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,r.jsx)(o.K7,{size:48,withGlow:!0}),(0,r.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Connect AI Provider"}),(0,r.jsxs)("p",{className:"mt-2 text-text-muted text-center",children:["Your workspace ",(0,r.jsx)("span",{className:"text-white",children:x.name})," is ready!",(0,r.jsx)("br",{}),"Connect an AI provider to start using agents."]})]}),(0,r.jsx)(g.c,{providers:h,connectedProviders:E,workspaceId:x.id,csrfToken:y||void 0,onProviderConnected:P,onContinue:O,showDetailedInfo:!0})]})]}):(0,r.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"fixed inset-0 opacity-10 pointer-events-none",children:(0,r.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,r.jsxs)("div",{className:"relative z-10 w-full max-w-2xl",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,r.jsx)(o.K7,{size:48,withGlow:!0}),(0,r.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Agent Relay"}),(0,r.jsx)("p",{className:"mt-2 text-text-muted",children:"no-workspaces"===e?"Create a workspace to get started":"Select a workspace"})]}),v&&(0,r.jsx)("div",{className:"mb-4 p-4 bg-error/10 border border-error/20 rounded-xl",children:(0,r.jsx)("p",{className:"text-error",children:v})}),"select-workspace"===e&&t.length>0&&(0,r.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Your Workspaces"}),(0,r.jsx)("div",{className:"space-y-3",children:t.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between p-4 bg-bg-tertiary rounded-xl border border-border-subtle hover:border-accent-cyan/50 transition-colors",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full ".concat("running"===e.status?"bg-success":"provisioning"===e.status?"bg-warning animate-pulse":"error"===e.status?"bg-error":"bg-gray-500")}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-medium text-white",children:e.name}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"running"===e.status?"Running":"provisioning"===e.status?"Starting...":"stopped"===e.status?"Stopped":"Error"})]})]}),(0,r.jsx)("div",{children:"running"===e.status&&e.publicUrl?(0,r.jsx)("button",{onClick:()=>M(e),className:"py-2 px-4 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-lg hover:shadow-glow-cyan transition-all",children:"Connect"}):"stopped"===e.status?(0,r.jsx)("button",{onClick:()=>T(e),className:"py-2 px-4 bg-bg-card border border-border-subtle rounded-lg text-white hover:border-accent-cyan/50 transition-colors",children:"Start"}):"provisioning"===e.status?(0,r.jsx)("span",{className:"text-text-muted text-sm",children:"Starting..."}):(0,r.jsx)("span",{className:"text-error text-sm",children:"Failed"})})]},e.id))}),d.length>0&&(0,r.jsxs)("div",{className:"mt-6 pt-6 border-t border-border-subtle",children:[(0,r.jsx)("p",{className:"text-text-muted text-sm mb-3",children:"Or create a new workspace:"}),(0,r.jsx)("div",{className:"flex gap-2 flex-wrap",children:d.slice(0,3).map(e=>(0,r.jsxs)("button",{onClick:()=>F(e.fullName),className:"py-2 px-3 bg-bg-card border border-border-subtle rounded-lg text-sm text-text-muted hover:text-white hover:border-accent-cyan/50 transition-colors",children:["+ ",e.fullName.split("/")[1]]},e.id))})]})]}),"no-workspaces"===e&&(0,r.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Create Your First Workspace"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:"Select a repository to create a workspace where agents can work on your code."}),d.length>0?(0,r.jsx)("div",{className:"space-y-3",children:d.map(e=>(0,r.jsxs)("button",{onClick:()=>F(e.fullName),className:"w-full flex items-center gap-3 p-4 bg-bg-tertiary rounded-xl border border-border-subtle hover:border-accent-cyan/50 transition-colors text-left",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-text-muted flex-shrink-0",fill:"currentColor",viewBox:"0 0 16 16",children:(0,r.jsx)("path",{d:"M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8z"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-white font-medium truncate",children:e.fullName}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:e.isPrivate?"Private":"Public"})]}),(0,r.jsx)("svg",{className:"w-5 h-5 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]},e.id))}):(0,r.jsxs)("div",{className:"text-center py-8",children:[(0,r.jsx)("p",{className:"text-text-muted mb-4",children:"No repositories connected yet."}),(0,r.jsxs)("a",{href:"/connect-repos",className:"inline-flex items-center gap-2 py-3 px-6 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all",children:[(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})}),"Connect GitHub"]})]})]}),(0,r.jsxs)("div",{className:"mt-6 flex justify-center gap-4 text-sm",children:[(0,r.jsx)("a",{href:"/connect-repos",className:"text-text-muted hover:text-white transition-colors",children:"Manage Repositories"}),(0,r.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,r.jsx)("button",{onClick:async()=>{let e={};y&&(e["X-CSRF-Token"]=y),await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:e}),window.location.href="/login"},className:"text-text-muted hover:text-white transition-colors",children:"Sign Out"})]})]})]})}}},function(e){e.O(0,[30,532,116,891,83,320,631,971,117,744],function(){return e(e.s=1702)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[191],{1702:function(e,n,t){Promise.resolve().then(t.bind(t,3330))},3330:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return f}});var r=t(7437),a=t(2265),s=t(7320),i=t(5372),o=t(6272),l=t(9116);let c=[{id:"creating",name:"Initialize",description:"Creating workspace container",estimatedSeconds:5,icon:"◈"},{id:"networking",name:"Network",description:"Configuring DNS & IP allocation",estimatedSeconds:8,icon:"◇"},{id:"secrets",name:"Secure",description:"Encrypting credentials",estimatedSeconds:3,icon:"◆"},{id:"machine",name:"Deploy",description:"Launching cloud instance",estimatedSeconds:25,icon:"▣"},{id:"booting",name:"Boot",description:"Starting relay services",estimatedSeconds:20,icon:"▢"},{id:"health",name:"Verify",description:"Running health checks",estimatedSeconds:15,icon:"◉"}],d=["> Establishing secure connection...","> Allocating compute resources...","> Configuring agent protocols...","> Initializing relay daemon...","> Syncing workspace state...","> Warming up inference engine...","> Connecting to neural mesh...","> Deploying agent swarm..."];function p(e){let{currentStage:n,isProvisioning:t,workspaceName:s,error:i,onCancel:o}=e,[l,p]=(0,a.useState)(0),[g,u]=(0,a.useState)([]),[h,b]=(0,a.useState)(!0);(0,a.useEffect)(()=>{if(!t){p(0);return}let e=setInterval(()=>{p(e=>e+1)},1e3);return()=>clearInterval(e)},[t]),(0,a.useEffect)(()=>{let e=setInterval(()=>{b(e=>!e)},530);return()=>clearInterval(e)},[]),(0,a.useEffect)(()=>{if(!t){u([]);return}let e=()=>{let e=d[Math.floor(Math.random()*d.length)];u(n=>[...n.slice(-4),e])};e();let n=setInterval(e,3500);return()=>clearInterval(n)},[t]);let f=(0,a.useMemo)(()=>{if(n){let e=c.findIndex(e=>e.id===n);return e>=0?e:0}let e=0;for(let n=0;n<c.length;n++)if(l<(e+=c[n].estimatedSeconds))return n;return c.length-1},[n,l]),w=(0,a.useMemo)(()=>c.reduce((e,n)=>e+n.estimatedSeconds,0),[]),v=(0,a.useMemo)(()=>Math.min(95,Math.round(l/w*100)),[l,w]);return i?(0,r.jsxs)("div",{className:"prov-container prov-error",children:[(0,r.jsx)("div",{className:"error-glitch",children:(0,r.jsx)("span",{className:"error-icon",children:"✕"})}),(0,r.jsx)("h3",{className:"error-title",children:"PROVISIONING FAILED"}),(0,r.jsx)("p",{className:"error-message",children:i}),o&&(0,r.jsx)("button",{onClick:o,className:"retry-btn",children:(0,r.jsx)("span",{children:"RETRY"})}),(0,r.jsx)("style",{children:x})]}):(0,r.jsxs)("div",{className:"prov-container",children:[(0,r.jsx)("div",{className:"ambient-glow"}),(0,r.jsx)("div",{className:"scan-line"}),(0,r.jsxs)("header",{className:"prov-header",children:[(0,r.jsx)("div",{className:"header-badge",children:"PROVISIONING"}),(0,r.jsx)("h1",{className:"header-title",children:s||"Workspace"}),(0,r.jsxs)("div",{className:"header-meta",children:[(0,r.jsx)("span",{className:"meta-time",children:(e=>{let n=Math.floor(e/60),t=e%60;return n>0?"".concat(n,":").concat(t.toString().padStart(2,"0")):"0:".concat(t.toString().padStart(2,"0"))})(l)}),(0,r.jsx)("span",{className:"meta-sep",children:"•"}),(0,r.jsxs)("span",{className:"meta-percent",children:[v,"%"]})]})]}),(0,r.jsxs)("div",{className:"progress-track",children:[(0,r.jsx)("div",{className:"progress-fill",style:{width:"".concat(v,"%")}}),(0,r.jsx)("div",{className:"progress-glow",style:{left:"".concat(v,"%")}})]}),(0,r.jsx)("div",{className:"stages-timeline",children:c.map((e,n)=>{let t=n<f,a=n===f,s=n>f;return(0,r.jsxs)("div",{className:"stage-row ".concat(t?"completed":""," ").concat(a?"current":""," ").concat(s?"pending":""),children:[n>0&&(0,r.jsxs)("div",{className:"stage-connector ".concat(t?"active":""),children:[(0,r.jsx)("div",{className:"connector-line"}),t&&(0,r.jsx)("div",{className:"connector-pulse"})]}),(0,r.jsxs)("div",{className:"stage-node",children:[(0,r.jsx)("span",{className:"node-icon",children:e.icon}),a&&(0,r.jsx)("div",{className:"node-ring"})]}),(0,r.jsxs)("div",{className:"stage-content",children:[(0,r.jsx)("span",{className:"stage-name",children:e.name}),a&&(0,r.jsx)("span",{className:"stage-desc",children:e.description})]}),(0,r.jsxs)("div",{className:"stage-status",children:[t&&(0,r.jsx)("span",{className:"status-done",children:"DONE"}),a&&(0,r.jsx)("span",{className:"status-active",children:"ACTIVE"}),s&&(0,r.jsxs)("span",{className:"status-wait",children:["~",e.estimatedSeconds,"s"]})]})]},e.id)})}),(0,r.jsxs)("div",{className:"terminal-window",children:[(0,r.jsxs)("div",{className:"terminal-header",children:[(0,r.jsx)("span",{className:"terminal-dot red"}),(0,r.jsx)("span",{className:"terminal-dot yellow"}),(0,r.jsx)("span",{className:"terminal-dot green"}),(0,r.jsx)("span",{className:"terminal-title",children:"agent-relay"})]}),(0,r.jsxs)("div",{className:"terminal-body",children:[g.map((e,n)=>(0,r.jsx)("div",{className:"terminal-line",style:{animationDelay:"".concat(.1*n,"s")},children:e},n)),(0,r.jsxs)("div",{className:"terminal-cursor",children:[(0,r.jsx)("span",{className:"cursor-prompt",children:"$"}),(0,r.jsx)("span",{className:"cursor-block ".concat(h?"visible":""),children:"_"})]})]})]}),o&&(0,r.jsx)("button",{onClick:o,className:"cancel-btn",children:"Cancel"}),(0,r.jsx)("style",{children:m})]})}let m="\n .prov-container {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 40px 32px;\n background: linear-gradient(145deg, rgba(10, 15, 25, 0.95) 0%, rgba(5, 10, 18, 0.98) 100%);\n border: 1px solid rgba(6, 182, 212, 0.15);\n border-radius: 16px;\n overflow: hidden;\n font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;\n }\n\n /* Ambient effects */\n .ambient-glow {\n position: absolute;\n top: -100px;\n left: 50%;\n transform: translateX(-50%);\n width: 300px;\n height: 200px;\n background: radial-gradient(ellipse, rgba(6, 182, 212, 0.12) 0%, transparent 70%);\n pointer-events: none;\n }\n\n .scan-line {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 2px;\n background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.4), transparent);\n animation: scanMove 3s ease-in-out infinite;\n pointer-events: none;\n }\n\n @keyframes scanMove {\n 0%, 100% { top: 0; opacity: 0.5; }\n 50% { top: 100%; opacity: 0.2; }\n }\n\n /* Header */\n .prov-header {\n text-align: center;\n position: relative;\n z-index: 1;\n }\n\n .header-badge {\n display: inline-block;\n padding: 4px 12px;\n background: rgba(6, 182, 212, 0.1);\n border: 1px solid rgba(6, 182, 212, 0.3);\n border-radius: 4px;\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 2px;\n color: #06b6d4;\n margin-bottom: 12px;\n }\n\n .header-title {\n font-size: 22px;\n font-weight: 600;\n color: #f1f5f9;\n margin: 0 0 8px 0;\n letter-spacing: -0.5px;\n }\n\n .header-meta {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n font-size: 13px;\n color: #64748b;\n }\n\n .meta-time {\n font-variant-numeric: tabular-nums;\n }\n\n .meta-percent {\n color: #06b6d4;\n font-weight: 500;\n }\n\n .meta-sep {\n opacity: 0.3;\n }\n\n /* Progress bar */\n .progress-track {\n position: relative;\n height: 4px;\n background: rgba(100, 116, 139, 0.2);\n border-radius: 2px;\n overflow: visible;\n }\n\n .progress-fill {\n height: 100%;\n background: linear-gradient(90deg, #0891b2, #06b6d4, #22d3ee);\n border-radius: 2px;\n transition: width 0.5s ease;\n }\n\n .progress-glow {\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 8px;\n height: 8px;\n background: #22d3ee;\n border-radius: 50%;\n box-shadow: 0 0 16px rgba(34, 211, 238, 0.6);\n transition: left 0.5s ease;\n }\n\n /* Stages */\n .stages-timeline {\n display: flex;\n flex-direction: column;\n gap: 0;\n padding: 16px 0;\n }\n\n .stage-row {\n display: grid;\n grid-template-columns: 40px 1fr auto;\n align-items: center;\n gap: 12px;\n padding: 10px 0;\n position: relative;\n }\n\n .stage-connector {\n position: absolute;\n left: 19px;\n top: -10px;\n width: 2px;\n height: 20px;\n }\n\n .connector-line {\n width: 100%;\n height: 100%;\n background: rgba(100, 116, 139, 0.3);\n transition: background 0.3s ease;\n }\n\n .stage-connector.active .connector-line {\n background: linear-gradient(180deg, #06b6d4, rgba(6, 182, 212, 0.3));\n }\n\n .connector-pulse {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(180deg, rgba(34, 211, 238, 0.8), transparent);\n animation: pulseLine 1.5s ease-out infinite;\n }\n\n @keyframes pulseLine {\n 0% { opacity: 1; transform: translateY(-100%); }\n 100% { opacity: 0; transform: translateY(100%); }\n }\n\n .stage-node {\n width: 40px;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n }\n\n .node-icon {\n font-size: 18px;\n color: #475569;\n transition: all 0.3s ease;\n }\n\n .stage-row.completed .node-icon {\n color: #06b6d4;\n }\n\n .stage-row.current .node-icon {\n color: #22d3ee;\n text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);\n }\n\n .node-ring {\n position: absolute;\n inset: 4px;\n border: 2px solid rgba(34, 211, 238, 0.4);\n border-radius: 50%;\n animation: ringPulse 2s ease-in-out infinite;\n }\n\n @keyframes ringPulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.2); opacity: 0.5; }\n }\n\n .stage-content {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n }\n\n .stage-name {\n font-size: 13px;\n font-weight: 500;\n color: #64748b;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n transition: color 0.3s ease;\n }\n\n .stage-row.completed .stage-name {\n color: #475569;\n }\n\n .stage-row.current .stage-name {\n color: #f1f5f9;\n }\n\n .stage-desc {\n font-size: 11px;\n color: #64748b;\n animation: fadeSlideIn 0.3s ease;\n }\n\n @keyframes fadeSlideIn {\n from { opacity: 0; transform: translateX(-8px); }\n to { opacity: 1; transform: translateX(0); }\n }\n\n .stage-status {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 1px;\n }\n\n .status-done {\n color: #06b6d4;\n }\n\n .status-active {\n color: #22d3ee;\n animation: blink 1s ease-in-out infinite;\n }\n\n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.5; }\n }\n\n .status-wait {\n color: #475569;\n font-variant-numeric: tabular-nums;\n }\n\n /* Terminal */\n .terminal-window {\n background: rgba(0, 0, 0, 0.4);\n border: 1px solid rgba(100, 116, 139, 0.2);\n border-radius: 8px;\n overflow: hidden;\n }\n\n .terminal-header {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 12px;\n background: rgba(30, 41, 59, 0.5);\n border-bottom: 1px solid rgba(100, 116, 139, 0.15);\n }\n\n .terminal-dot {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n }\n\n .terminal-dot.red { background: #ef4444; }\n .terminal-dot.yellow { background: #eab308; }\n .terminal-dot.green { background: #22c55e; }\n\n .terminal-title {\n margin-left: auto;\n font-size: 11px;\n color: #64748b;\n }\n\n .terminal-body {\n padding: 12px;\n min-height: 100px;\n }\n\n .terminal-line {\n font-size: 12px;\n color: #94a3b8;\n padding: 2px 0;\n animation: typeIn 0.3s ease;\n }\n\n @keyframes typeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n .terminal-cursor {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-top: 8px;\n }\n\n .cursor-prompt {\n color: #06b6d4;\n font-weight: 600;\n }\n\n .cursor-block {\n color: #22d3ee;\n opacity: 0;\n transition: opacity 0.1s;\n }\n\n .cursor-block.visible {\n opacity: 1;\n }\n\n /* Cancel button */\n .cancel-btn {\n align-self: center;\n padding: 8px 20px;\n background: transparent;\n border: 1px solid rgba(100, 116, 139, 0.3);\n border-radius: 6px;\n color: #64748b;\n font-family: inherit;\n font-size: 12px;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .cancel-btn:hover {\n border-color: rgba(239, 68, 68, 0.5);\n color: #ef4444;\n }\n",x="\n .prov-container.prov-error {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n padding: 48px 32px;\n background: linear-gradient(145deg, rgba(25, 10, 10, 0.95) 0%, rgba(15, 5, 8, 0.98) 100%);\n border: 1px solid rgba(239, 68, 68, 0.2);\n border-radius: 16px;\n text-align: center;\n font-family: 'SF Mono', 'JetBrains Mono', monospace;\n }\n\n .error-glitch {\n position: relative;\n width: 64px;\n height: 64px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(239, 68, 68, 0.1);\n border: 1px solid rgba(239, 68, 68, 0.3);\n border-radius: 12px;\n }\n\n .error-icon {\n font-size: 28px;\n color: #ef4444;\n animation: glitch 0.3s ease infinite;\n }\n\n @keyframes glitch {\n 0%, 100% { transform: translate(0); }\n 25% { transform: translate(-2px, 1px); }\n 50% { transform: translate(2px, -1px); }\n 75% { transform: translate(-1px, -1px); }\n }\n\n .error-title {\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 2px;\n color: #ef4444;\n margin: 0;\n }\n\n .error-message {\n font-size: 13px;\n color: #94a3b8;\n max-width: 350px;\n margin: 0;\n line-height: 1.5;\n }\n\n .retry-btn {\n margin-top: 8px;\n padding: 10px 28px;\n background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);\n border: 1px solid rgba(239, 68, 68, 0.4);\n border-radius: 6px;\n color: #ef4444;\n font-family: inherit;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 1px;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .retry-btn:hover {\n background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);\n border-color: rgba(239, 68, 68, 0.6);\n transform: translateY(-1px);\n }\n";var g=t(9631),u=t(257);let h=[{id:"anthropic",name:"Anthropic",displayName:"Claude",color:"#D97757",cliCommand:"claude"},{id:"codex",name:"OpenAI",displayName:"Codex",color:"#10A37F",cliCommand:"codex login",supportsDeviceFlow:!0,requiresUrlCopy:!0},{id:"google",name:"Google",displayName:"Gemini",color:"#4285F4",cliCommand:"gemini"},{id:"opencode",name:"OpenCode",displayName:"OpenCode",color:"#00D4AA",cliCommand:"opencode"},{id:"droid",name:"Factory",displayName:"Droid",color:"#6366F1",cliCommand:"droid"},{id:"cursor",name:"Cursor",displayName:"Cursor",color:"#7C3AED",cliCommand:"agent"}],b="true"===u.env.NEXT_PUBLIC_FORCE_CLOUD_MODE;function f(){let[e,n]=(0,a.useState)("loading"),[t,c]=(0,a.useState)([]),[d,m]=(0,a.useState)([]),[x,u]=(0,a.useState)(null),[f,w]=(0,a.useState)(void 0),[v,j]=(0,a.useState)(null),[N,k]=(0,a.useState)(b),[y,C]=(0,a.useState)(null),[S,I]=(0,a.useState)(null),[E,z]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/auth/session",{credentials:"include"});if(404===e.status){if(b)throw Error("Cloud mode enforced but session endpoint returned 404. Is the cloud server running?");k(!1),n("local");return}let t=e.headers.get("X-CSRF-Token");t&&C(t);let r=await e.json();if(!r.authenticated){window.location.href="/login";return}k(!0);let a={openai:"codex"};if(r.connectedProviders){let e=[];r.connectedProviders.forEach(n=>{e.push(n.provider);let t=a[n.provider];t&&e.push(t)}),z(e)}let[s,i]=await Promise.all([fetch("/api/workspaces/accessible",{credentials:"include"}),fetch("/api/github-app/repos",{credentials:"include"})]);if(!s.ok){if(401===s.status){window.location.href="/login";return}throw Error("Failed to fetch workspaces")}let o=await s.json(),l=i.ok?await i.json():{repositories:[]};c(o.workspaces||[]),m(l.repositories||[]);let d=(o.workspaces||[]).filter(e=>"running"===e.status&&e.publicUrl);1===d.length?M(d[0]):d.length>1?n("select-workspace"):(o.workspaces||[]).length>0?n("select-workspace"):(l.repositories||[]).length>0?n("no-workspaces"):window.location.href="/connect-repos"}catch(e){if(e instanceof TypeError&&e.message.includes("Failed to fetch")){if(b){console.error("Cloud mode enforced but network request failed:",e),j("Cloud mode enforced but failed to connect to server. Is the cloud server running?"),n("error");return}k(!1),n("local");return}console.error("Init error:",e),j(e instanceof Error?e.message:"Failed to initialize"),n("error")}})()},[]);let M=(0,a.useCallback)(e=>{if(!e.publicUrl){j("Workspace has no public URL"),n("error");return}u(e),n("connecting"),(0,l.hc)(e.id);let t=new URL(e.publicUrl),r="https:"===t.protocol?"wss:":"ws:";w("".concat(r,"//").concat(t.host,"/ws")),n("connected")},[]),F=(0,a.useCallback)(async e=>{j(null);try{let t={"Content-Type":"application/json"};y&&(t["X-CSRF-Token"]=y);let r=await fetch("/api/workspaces/quick",{method:"POST",credentials:"include",headers:t,body:JSON.stringify({repositoryFullName:e})}),a=await r.json();if(!r.ok)throw Error(a.error||"Failed to create workspace");let s=Date.now();I({workspaceId:a.workspaceId,workspaceName:e.split("/")[1]||e,stage:null,startedAt:s}),n("provisioning");let i=async e=>{let t=0;for(;t<150;){var r;let a=await fetch("/api/workspaces/".concat(e,"/status"),{credentials:"include"}),s=await a.json();if((null===(r=s.provisioning)||void 0===r?void 0:r.stage)&&I(e=>e?{...e,stage:s.provisioning.stage}:null),"running"===s.status){let t=await fetch("/api/workspaces/".concat(e),{credentials:"include"}),r=await t.json();if(r.publicUrl){I(null),u(r),n("connect-provider");return}}else if("error"===s.status){let e=s.errorMessage||"Workspace provisioning failed";throw Error(e)}await new Promise(e=>setTimeout(e,2e3)),++t%15==0&&console.log("[workspace] Still provisioning... (".concat(Math.floor(2e3*t/1e3),"s elapsed)"))}throw Error("Workspace provisioning timed out after 5 minutes. Please try again or contact support.")};await i(a.workspaceId)}catch(e){console.error("Create workspace error:",e),I(null),j(e instanceof Error?e.message:"Failed to create workspace"),n("no-workspaces")}},[M,y]),P=(0,a.useCallback)(e=>{z(n=>[...new Set([...n,e])])},[]),O=(0,a.useCallback)(()=>{x&&M(x)},[x,M]),T=(0,a.useCallback)(async e=>{n("loading"),j(null);try{let n={};y&&(n["X-CSRF-Token"]=y);let t=await fetch("/api/workspaces/".concat(e.id,"/restart"),{method:"POST",credentials:"include",headers:n});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to start workspace")}let r=0;for(;r<60;){let n=await fetch("/api/workspaces/".concat(e.id,"/status"),{credentials:"include"}),t=await n.json();if("running"===t.status){let n=await fetch("/api/workspaces/".concat(e.id),{credentials:"include"}),t=await n.json();if(t.publicUrl){M({...e,...t});return}}await new Promise(e=>setTimeout(e,2e3)),r++}throw Error("Workspace start timed out")}catch(e){console.error("Start workspace error:",e),j(e instanceof Error?e.message:"Failed to start workspace"),n("select-workspace")}},[M,y]);return"loading"===e?(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,r.jsx)("p",{className:"mt-4 text-text-muted",children:"Loading..."})]})}):"local"===e?(0,r.jsx)(s.gV,{}):"connected"===e&&f?(0,r.jsx)(i.TI,{cloudMode:!0,children:(0,r.jsx)(s.gV,{wsUrl:f})}):"connecting"===e?(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,r.jsxs)("p",{className:"mt-4 text-white font-medium",children:["Connecting to ",null==x?void 0:x.name,"..."]}),(0,r.jsx)("p",{className:"mt-2 text-text-muted text-sm",children:null==x?void 0:x.publicUrl})]})}):"provisioning"===e&&S?(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-full max-w-xl",children:(0,r.jsx)(p,{isProvisioning:!0,currentStage:S.stage,workspaceName:S.workspaceName,error:v,onCancel:()=>{I(null),n("no-workspaces")}})})}):"error"===e?(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center p-4",children:(0,r.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 max-w-md w-full text-center",children:[(0,r.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-error/20 rounded-full flex items-center justify-center",children:(0,r.jsx)("svg",{className:"w-8 h-8 text-error",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Something went wrong"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:v}),(0,r.jsx)("button",{onClick:()=>window.location.reload(),className:"w-full py-3 px-4 bg-bg-tertiary border border-border-subtle rounded-xl text-white font-medium hover:bg-bg-hover transition-colors",children:"Try Again"})]})}):"connect-provider"===e&&x?(0,r.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"fixed inset-0 opacity-10 pointer-events-none",children:(0,r.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,r.jsxs)("div",{className:"relative z-10 w-full max-w-xl",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,r.jsx)(o.K7,{size:48,withGlow:!0}),(0,r.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Connect AI Provider"}),(0,r.jsxs)("p",{className:"mt-2 text-text-muted text-center",children:["Your workspace ",(0,r.jsx)("span",{className:"text-white",children:x.name})," is ready!",(0,r.jsx)("br",{}),"Connect an AI provider to start using agents."]})]}),(0,r.jsx)(g.c,{providers:h,connectedProviders:E,workspaceId:x.id,csrfToken:y||void 0,onProviderConnected:P,onContinue:O,showDetailedInfo:!0})]})]}):(0,r.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"fixed inset-0 opacity-10 pointer-events-none",children:(0,r.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,r.jsxs)("div",{className:"relative z-10 w-full max-w-2xl",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,r.jsx)(o.K7,{size:48,withGlow:!0}),(0,r.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Agent Relay"}),(0,r.jsx)("p",{className:"mt-2 text-text-muted",children:"no-workspaces"===e?"Create a workspace to get started":"Select a workspace"})]}),v&&(0,r.jsx)("div",{className:"mb-4 p-4 bg-error/10 border border-error/20 rounded-xl",children:(0,r.jsx)("p",{className:"text-error",children:v})}),"select-workspace"===e&&t.length>0&&(0,r.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Your Workspaces"}),(0,r.jsx)("div",{className:"space-y-3",children:t.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between p-4 bg-bg-tertiary rounded-xl border border-border-subtle hover:border-accent-cyan/50 transition-colors",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-3 h-3 rounded-full ".concat("running"===e.status?"bg-success":"provisioning"===e.status?"bg-warning animate-pulse":"error"===e.status?"bg-error":"bg-gray-500")}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-medium text-white",children:e.name}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"running"===e.status?"Running":"provisioning"===e.status?"Starting...":"stopped"===e.status?"Stopped":"Error"})]})]}),(0,r.jsx)("div",{children:"running"===e.status&&e.publicUrl?(0,r.jsx)("button",{onClick:()=>M(e),className:"py-2 px-4 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-lg hover:shadow-glow-cyan transition-all",children:"Connect"}):"stopped"===e.status?(0,r.jsx)("button",{onClick:()=>T(e),className:"py-2 px-4 bg-bg-card border border-border-subtle rounded-lg text-white hover:border-accent-cyan/50 transition-colors",children:"Start"}):"provisioning"===e.status?(0,r.jsx)("span",{className:"text-text-muted text-sm",children:"Starting..."}):(0,r.jsx)("span",{className:"text-error text-sm",children:"Failed"})})]},e.id))}),d.length>0&&(0,r.jsxs)("div",{className:"mt-6 pt-6 border-t border-border-subtle",children:[(0,r.jsx)("p",{className:"text-text-muted text-sm mb-3",children:"Or create a new workspace:"}),(0,r.jsx)("div",{className:"flex gap-2 flex-wrap",children:d.slice(0,3).map(e=>(0,r.jsxs)("button",{onClick:()=>F(e.fullName),className:"py-2 px-3 bg-bg-card border border-border-subtle rounded-lg text-sm text-text-muted hover:text-white hover:border-accent-cyan/50 transition-colors",children:["+ ",e.fullName.split("/")[1]]},e.id))})]})]}),"no-workspaces"===e&&(0,r.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Create Your First Workspace"}),(0,r.jsx)("p",{className:"text-text-muted mb-6",children:"Select a repository to create a workspace where agents can work on your code."}),d.length>0?(0,r.jsx)("div",{className:"space-y-3",children:d.map(e=>(0,r.jsxs)("button",{onClick:()=>F(e.fullName),className:"w-full flex items-center gap-3 p-4 bg-bg-tertiary rounded-xl border border-border-subtle hover:border-accent-cyan/50 transition-colors text-left",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-text-muted flex-shrink-0",fill:"currentColor",viewBox:"0 0 16 16",children:(0,r.jsx)("path",{d:"M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8z"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-white font-medium truncate",children:e.fullName}),(0,r.jsx)("p",{className:"text-text-muted text-sm",children:e.isPrivate?"Private":"Public"})]}),(0,r.jsx)("svg",{className:"w-5 h-5 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]},e.id))}):(0,r.jsxs)("div",{className:"text-center py-8",children:[(0,r.jsx)("p",{className:"text-text-muted mb-4",children:"No repositories connected yet."}),(0,r.jsxs)("a",{href:"/connect-repos",className:"inline-flex items-center gap-2 py-3 px-6 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all",children:[(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})}),"Connect GitHub"]})]})]}),(0,r.jsxs)("div",{className:"mt-6 flex justify-center gap-4 text-sm",children:[(0,r.jsx)("a",{href:"/connect-repos",className:"text-text-muted hover:text-white transition-colors",children:"Manage Repositories"}),(0,r.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,r.jsx)("button",{onClick:async()=>{let e={};y&&(e["X-CSRF-Token"]=y),await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:e}),window.location.href="/login"},className:"text-text-muted hover:text-white transition-colors",children:"Sign Out"})]})]})]})}}},function(e){e.O(0,[30,282,532,116,891,83,320,631,971,117,744],function(){return e(e.s=1702)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[593],{2284:function(e,t,s){Promise.resolve().then(s.bind(s,6238))},6238:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return i}});var a=s(7437),r=s(2265),n=s(6272);function i(){let[e,t]=(0,r.useState)(""),[s,i]=(0,r.useState)(!0),[l,o]=(0,r.useState)(!1),[c,d]=(0,r.useState)(""),[u,x]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{try{var e;let t=await fetch("/api/auth/me",{credentials:"include"});if(!t.ok){window.location.href="/login";return}let s=await t.json();if(null===(e=s.user)||void 0===e?void 0:e.email){window.location.href="/app";return}x(s.user),i(!1)}catch(e){console.error("Error checking session:",e),window.location.href="/login"}})()},[]);let m=async t=>{t.preventDefault(),d(""),o(!0);try{let t=(await fetch("/api/auth/session",{credentials:"include"})).headers.get("x-csrf-token"),s=await fetch("/api/auth/email/set-email",{method:"POST",headers:{"Content-Type":"application/json",...t&&{"x-csrf-token":t}},credentials:"include",body:JSON.stringify({email:e})}),a=await s.json();if(!s.ok){d(a.error||"Failed to set email"),o(!1);return}window.location.href="/app"}catch(e){console.error("Error setting email:",e),d("Failed to connect. Please try again."),o(!1)}};return s?(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:(0,a.jsx)("div",{className:"relative z-10 w-full max-w-md",children:(0,a.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,a.jsx)(n.K7,{size:48,withGlow:!0}),(0,a.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Agent Relay"}),(0,a.jsx)("p",{className:"mt-2 text-text-muted",children:"Loading..."})]})})}):(0,a.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,a.jsx)("div",{className:"fixed inset-0 opacity-10",children:(0,a.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,a.jsxs)("div",{className:"relative z-10 w-full max-w-md",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,a.jsx)(n.K7,{size:48,withGlow:!0}),(0,a.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Almost there!"}),(0,a.jsx)("p",{className:"mt-2 text-text-muted text-center",children:"Please provide your email to complete your account setup"})]}),(0,a.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 shadow-xl",children:[u&&(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-6 pb-6 border-b border-border-subtle",children:[u.avatarUrl?(0,a.jsx)("img",{src:u.avatarUrl,alt:u.githubUsername||"User",className:"w-12 h-12 rounded-full"}):(0,a.jsx)("div",{className:"w-12 h-12 rounded-full bg-bg-secondary flex items-center justify-center",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-text-muted",fill:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-white",children:u.githubUsername}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Connected via GitHub"})]})]}),c&&(0,a.jsx)("div",{className:"mb-4 p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,a.jsx)("p",{className:"text-error text-sm",children:c})}),(0,a.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-text-secondary mb-2",children:"Email Address"}),(0,a.jsx)("input",{type:"email",id:"email",value:e,onChange:e=>t(e.target.value),required:!0,disabled:l,className:"w-full px-4 py-3 bg-bg-secondary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-cyan/50 focus:border-accent-cyan disabled:opacity-50",placeholder:"you@example.com"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"We'll use this email to notify you about important updates and account activity."})]}),(0,a.jsx)("button",{type:"submit",disabled:l||!e,className:"w-full py-4 px-6 bg-accent-cyan hover:bg-accent-cyan/90 rounded-xl text-black font-medium flex items-center justify-center gap-3 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("span",{children:"Saving..."})]}):(0,a.jsx)("span",{children:"Continue"})})]})]})]})]})}},6272:function(e,t,s){"use strict";s.d(t,{K7:function(){return r}});var a=s(7437);function r(e){let{size:t=24,className:s="",withGlow:r=!1}=e;return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"\n transition-all duration-300\n ".concat(r?"drop-shadow-[0_0_8px_rgba(0,217,255,0.3)]":"","\n ").concat(s,"\n "),"aria-label":"Agent Relay Logo",role:"img",children:[(0,a.jsx)("path",{d:"M30 80 L 50 20 L 70 80",stroke:"#00d9ff",strokeWidth:"5",strokeLinejoin:"round",strokeLinecap:"round",fill:"none"}),(0,a.jsx)("line",{x1:"40",y1:"50",x2:"60",y2:"50",stroke:"#00d9ff",strokeWidth:"5",strokeLinecap:"round"}),(0,a.jsx)("path",{d:"M50 20 L 50 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.7"}),(0,a.jsx)("path",{d:"M50 20 C 80 20 80 50 50 50 L 80 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:"0.7"})]})}s(2265)}},function(e){e.O(0,[971,117,744],function(){return e(e.s=2284)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[626],{9227:function(e,t,n){Promise.resolve().then(n.bind(n,6374))},6374:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(7437),s=n(2265),a=n(9376),i=n(282),o=n(6272);function c(){return(0,r.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:(0,r.jsx)("div",{className:"relative z-10 w-full max-w-md",children:(0,r.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,r.jsx)(o.K7,{size:48,withGlow:!0}),(0,r.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Agent Relay"}),(0,r.jsx)("p",{className:"mt-2 text-text-muted",children:"Loading..."})]})})})}function l(){let e=(0,a.useSearchParams)(),[t,n]=(0,s.useState)("github"),[c,l]=(0,s.useState)(!1),[d,u]=(0,s.useState)(!1),[h,x]=(0,s.useState)(""),[m,f]=(0,s.useState)(""),[p,g]=(0,s.useState)(""),[b,w]=(0,s.useState)(""),y=e.get("return"),j=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/auth/nango/login-session",{credentials:"include"}),n=await t.json();if(!e)return;if(!t.ok||!n.sessionToken){l(!0);return}j.current=new i.ZP({connectSessionToken:n.sessionToken}),l(!0)}catch(t){e&&(console.error("Init error:",t),l(!0))}})(),()=>{e=!1}},[]);let v=async e=>{let t=await fetch("/api/auth/nango/login-status/".concat(e),{credentials:"include"});if(!t.ok)throw Error("Auth status not ready");return t.json()},N=async e=>{try{x("Completing authentication...");let t=Date.now(),n=async()=>{if(Date.now()-t>3e4)throw Error("Authentication timed out. Please try again.");try{let t=await v(e);if(t&&t.ready){if(t.needsEmail){window.location.href="/complete-profile";return}y?window.location.href=y:window.location.href=t.hasRepos?"/app":"/connect-repos";return}return await new Promise(e=>setTimeout(e,1e3)),n()}catch(e){return await new Promise(e=>setTimeout(e,1e3)),n()}};await n()}catch(e){console.error("[AUTH] Authentication error:",e),f(e instanceof Error?e.message:"Authentication failed"),u(!1),x("")}},k=async()=>{if(!j.current){f("GitHub login not available. Please use email login or refresh the page.");return}u(!0),f(""),x("Connecting to GitHub...");try{let e=await j.current.auth("github");if(e&&"connectionId"in e)await N(e.connectionId);else throw Error("No connection ID returned")}catch(t){var e;if(console.error("GitHub auth error:",t),"user_cancelled"===t.type||(null===(e=t.message)||void 0===e?void 0:e.includes("closed"))){u(!1),x(""),fetch("/api/auth/nango/login-session",{credentials:"include"}).then(e=>e.json()).then(e=>{e.sessionToken&&(j.current=new i.ZP({connectSessionToken:e.sessionToken}),l(!0))});return}f(t.message||"Authentication failed"),u(!1),x("")}},C=async e=>{e.preventDefault(),f(""),u(!0),x("Signing in...");try{let e=(await fetch("/api/auth/session",{credentials:"include"})).headers.get("x-csrf-token"),t=await fetch("/api/auth/email/login",{method:"POST",headers:{"Content-Type":"application/json",...e&&{"x-csrf-token":e}},credentials:"include",body:JSON.stringify({email:p,password:b})}),r=await t.json();if(!t.ok){"GITHUB_ACCOUNT"===r.code?(f(r.error),n("github")):f(r.error||"Login failed"),u(!1),x("");return}x("Login successful! Redirecting..."),y?window.location.href=y:window.location.href="/app"}catch(e){console.error("Email login error:",e),f("Failed to connect. Please try again."),u(!1),x("")}},S=!c||d;return(0,r.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"fixed inset-0 opacity-10",children:(0,r.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,r.jsxs)("div",{className:"relative z-10 w-full max-w-md",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,r.jsx)(o.K7,{size:48,withGlow:!0}),(0,r.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Agent Relay"}),(0,r.jsx)("p",{className:"mt-2 text-text-muted",children:"Sign in to continue"})]}),(0,r.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 shadow-xl",children:[(0,r.jsxs)("div",{className:"flex mb-6 bg-bg-secondary/50 rounded-lg p-1",children:[(0,r.jsx)("button",{type:"button",onClick:()=>n("github"),className:"flex-1 py-2 px-4 rounded-md text-sm font-medium transition-colors ".concat("github"===t?"bg-bg-primary text-white shadow-sm":"text-text-muted hover:text-white"),children:"GitHub"}),(0,r.jsx)("button",{type:"button",onClick:()=>n("email"),className:"flex-1 py-2 px-4 rounded-md text-sm font-medium transition-colors ".concat("email"===t?"bg-bg-primary text-white shadow-sm":"text-text-muted hover:text-white"),children:"Email"})]}),(0,r.jsxs)("div",{children:[m&&(0,r.jsx)("div",{className:"mb-4 p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,r.jsx)("p",{className:"text-error text-sm",children:m})}),"github"===t?(0,r.jsx)("button",{type:"button",onClick:k,disabled:S,className:"w-full py-4 px-6 bg-[#24292e] hover:bg-[#2f363d] border border-[#444d56] rounded-xl text-white font-medium flex items-center justify-center gap-3 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:c?d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,r.jsx)("span",{children:h||"Connecting..."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})}),(0,r.jsx)("span",{children:"Continue with GitHub"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,r.jsx)("span",{children:"Loading..."})]})}):(0,r.jsxs)("form",{onSubmit:C,className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-text-secondary mb-2",children:"Email"}),(0,r.jsx)("input",{type:"email",id:"email",value:p,onChange:e=>g(e.target.value),required:!0,disabled:d,className:"w-full px-4 py-3 bg-bg-secondary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-cyan/50 focus:border-accent-cyan disabled:opacity-50",placeholder:"you@example.com"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-text-secondary mb-2",children:"Password"}),(0,r.jsx)("input",{type:"password",id:"password",value:b,onChange:e=>w(e.target.value),required:!0,disabled:d,className:"w-full px-4 py-3 bg-bg-secondary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-cyan/50 focus:border-accent-cyan disabled:opacity-50",placeholder:"Enter your password"})]}),(0,r.jsx)("button",{type:"submit",disabled:S||!p||!b,className:"w-full py-4 px-6 bg-accent-cyan hover:bg-accent-cyan/90 rounded-xl text-black font-medium flex items-center justify-center gap-3 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,r.jsx)("span",{children:h||"Signing in..."})]}):(0,r.jsx)("span",{children:"Sign in with Email"})})]}),(0,r.jsxs)("p",{className:"mt-6 text-center text-text-muted text-sm",children:["By signing in, you agree to our"," ",(0,r.jsx)("a",{href:"/terms",className:"text-accent-cyan hover:underline",children:"Terms of Service"})," ","and"," ",(0,r.jsx)("a",{href:"/privacy",className:"text-accent-cyan hover:underline",children:"Privacy Policy"})]})]})]}),(0,r.jsx)("div",{className:"mt-6 text-center",children:(0,r.jsxs)("p",{className:"text-text-muted",children:["Don't have an account?"," ",(0,r.jsx)("a",{href:"/signup",className:"text-accent-cyan hover:underline font-medium",children:"Sign up"})]})}),(0,r.jsx)("div",{className:"mt-4 text-center",children:(0,r.jsx)("a",{href:"/",className:"text-text-muted hover:text-white transition-colors text-sm",children:"Back to home"})})]})]})}function d(){return(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)(c,{}),children:(0,r.jsx)(l,{})})}},9376:function(e,t,n){"use strict";var r=n(5475);n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},6272:function(e,t,n){"use strict";n.d(t,{K7:function(){return s}});var r=n(7437);function s(e){let{size:t=24,className:n="",withGlow:s=!1}=e;return(0,r.jsxs)("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"\n transition-all duration-300\n ".concat(s?"drop-shadow-[0_0_8px_rgba(0,217,255,0.3)]":"","\n ").concat(n,"\n "),"aria-label":"Agent Relay Logo",role:"img",children:[(0,r.jsx)("path",{d:"M30 80 L 50 20 L 70 80",stroke:"#00d9ff",strokeWidth:"5",strokeLinejoin:"round",strokeLinecap:"round",fill:"none"}),(0,r.jsx)("line",{x1:"40",y1:"50",x2:"60",y2:"50",stroke:"#00d9ff",strokeWidth:"5",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M50 20 L 50 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.7"}),(0,r.jsx)("path",{d:"M50 20 C 80 20 80 50 50 50 L 80 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:"0.7"})]})}n(2265)}},function(e){e.O(0,[282,971,117,744],function(){return e(e.s=9227)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{9443:function(e,t,n){Promise.resolve().then(n.bind(n,7340))},7340:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return l}});var r=n(7437),u=n(2265),a=n(8766),c=n(7320);function l(){let[e,t]=(0,u.useState)(!1),[n,l]=(0,u.useState)(!1);return((0,u.useEffect)(()=>{t(function(){let e=window.location.hostname,t=new URLSearchParams(window.location.search);if("true"===t.get("landing")||"true"===t.get("cloud")||e.includes("agent-relay.com")||e.includes("agentrelay.dev")||e.includes(".fly.dev"))return!0;let n=document.querySelector('meta[name="agent-relay-cloud"]');return(null==n?void 0:n.getAttribute("content"))==="true"||"true"===localStorage.getItem("agent-relay-cloud-mode")}()),l(!0)},[]),n)?e?(0,r.jsx)(a.fy,{}):(0,r.jsx)(c.gV,{}):(0,r.jsx)("div",{className:"flex h-screen bg-bg-deep font-sans text-text-primary items-center justify-center",children:(0,r.jsx)("div",{className:"text-text-muted",children:"Loading..."})})}}},function(e){e.O(0,[732,30,532,116,891,83,320,766,971,117,744],function(){return e(e.s=9443)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{9443:function(e,t,n){Promise.resolve().then(n.bind(n,7340))},7340:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return l}});var r=n(7437),u=n(2265),a=n(8766),c=n(7320);function l(){let[e,t]=(0,u.useState)(!1),[n,l]=(0,u.useState)(!1);return((0,u.useEffect)(()=>{t(function(){let e=window.location.hostname,t=new URLSearchParams(window.location.search);if("true"===t.get("landing")||"true"===t.get("cloud")||e.includes("agent-relay.com")||e.includes("agentrelay.dev")||e.includes(".fly.dev"))return!0;let n=document.querySelector('meta[name="agent-relay-cloud"]');return(null==n?void 0:n.getAttribute("content"))==="true"||"true"===localStorage.getItem("agent-relay-cloud-mode")}()),l(!0)},[]),n)?e?(0,r.jsx)(a.fy,{}):(0,r.jsx)(c.gV,{}):(0,r.jsx)("div",{className:"flex h-screen bg-bg-deep font-sans text-text-primary items-center justify-center",children:(0,r.jsx)("div",{className:"text-text-muted",children:"Loading..."})})}}},function(e){e.O(0,[732,30,282,532,116,891,83,320,766,971,117,744],function(){return e(e.s=9443)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[966],{2679:function(e,t,s){Promise.resolve().then(s.bind(s,4665))},4665:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return o}});var n=s(7437),r=s(2265),a=s(282),i=s(6272);function o(){let[e,t]=(0,r.useState)("github"),[s,o]=(0,r.useState)(!1),[c,l]=(0,r.useState)(!1),[d,u]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[m,p]=(0,r.useState)("/app"),[f,b]=(0,r.useState)(!1),[g,y]=(0,r.useState)(""),[j,w]=(0,r.useState)(""),[v,N]=(0,r.useState)(""),[k,C]=(0,r.useState)(""),L=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=!0;return(async()=>{try{let e=await fetch("/api/auth/session",{credentials:"include"});if((await e.json()).authenticated){await S();return}}catch(e){}try{let t=await fetch("/api/auth/nango/login-session",{credentials:"include"}),s=await t.json();if(!e)return;if(!t.ok||!s.sessionToken){o(!0);return}L.current=new a.ZP({connectSessionToken:s.sessionToken}),o(!0)}catch(t){e&&(console.error("Init error:",t),o(!0))}})(),()=>{e=!1}},[]);let S=async()=>{u("Setting up your account...");try{let e=await fetch("/api/github-app/repos",{credentials:"include"}),t=await e.json();t.repositories&&t.repositories.length>0?p("/app"):p("/connect-repos"),b(!0),setTimeout(()=>{window.location.href=t.repositories&&t.repositories.length>0?"/app":"/connect-repos"},1500)}catch(e){console.error("Error checking repos:",e),p("/connect-repos"),b(!0),setTimeout(()=>{window.location.href="/connect-repos"},1500)}},A=async e=>{let t=await fetch("/api/auth/nango/login-status/".concat(e),{credentials:"include"});if(!t.ok)throw Error("Auth status not ready");return t.json()},P=async e=>{try{u("Completing authentication...");let t=Date.now(),s=async()=>{if(Date.now()-t>3e4)throw Error("Authentication timed out. Please try again.");try{let t=await A(e);if(t&&t.ready){if(t.needsEmail){window.location.href="/complete-profile";return}await S();return}return await new Promise(e=>setTimeout(e,1e3)),s()}catch(e){return await new Promise(e=>setTimeout(e,1e3)),s()}};await s()}catch(e){console.error("[AUTH] Authentication error:",e),h(e instanceof Error?e.message:"Authentication failed"),l(!1),u("")}},T=async()=>{if(!L.current){h("GitHub signup not available. Please use email signup or refresh the page.");return}l(!0),h(""),u("Connecting to GitHub...");try{let e=await L.current.auth("github");if(e&&"connectionId"in e)await P(e.connectionId);else throw Error("No connection ID returned")}catch(t){var e;if(console.error("GitHub auth error:",t),"user_cancelled"===t.type||(null===(e=t.message)||void 0===e?void 0:e.includes("closed"))){l(!1),u(""),fetch("/api/auth/nango/login-session",{credentials:"include"}).then(e=>e.json()).then(e=>{e.sessionToken&&(L.current=new a.ZP({connectSessionToken:e.sessionToken}),o(!0))});return}h(t.message||"Authentication failed"),l(!1),u("")}},M=async e=>{if(e.preventDefault(),h(""),j!==v){h("Passwords do not match");return}if(j.length<8){h("Password must be at least 8 characters long");return}l(!0),u("Creating your account...");try{let e=(await fetch("/api/auth/session",{credentials:"include"})).headers.get("x-csrf-token"),t=await fetch("/api/auth/email/signup",{method:"POST",headers:{"Content-Type":"application/json",...e&&{"x-csrf-token":e}},credentials:"include",body:JSON.stringify({email:g,password:j,displayName:k||void 0})}),s=await t.json();if(!t.ok){h(s.error||"Signup failed"),l(!1),u("");return}u("Account created! Redirecting..."),b(!0),p("/app"),setTimeout(()=>{window.location.href="/app"},1500)}catch(e){console.error("Email signup error:",e),h("Failed to connect. Please try again."),l(!1),u("")}},E=!s||c;return(0,n.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,n.jsx)("div",{className:"fixed inset-0 opacity-10",children:(0,n.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,n.jsxs)("div",{className:"fixed inset-0 overflow-hidden pointer-events-none",children:[(0,n.jsx)("div",{className:"absolute -top-40 -left-40 w-80 h-80 bg-accent-cyan/20 rounded-full blur-[100px]"}),(0,n.jsx)("div",{className:"absolute -bottom-40 -right-40 w-80 h-80 bg-[#00ffc8]/15 rounded-full blur-[100px]"})]}),(0,n.jsxs)("div",{className:"relative z-10 w-full max-w-md",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,n.jsx)(i.K7,{size:56,withGlow:!0}),(0,n.jsx)("h1",{className:"mt-4 text-3xl font-bold text-white",children:"Get Started"}),(0,n.jsx)("p",{className:"mt-2 text-text-muted text-center",children:"Create your account and start orchestrating AI agents"})]}),(0,n.jsx)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 shadow-xl",children:f?(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-success/20 rounded-full flex items-center justify-center",children:(0,n.jsx)("svg",{className:"w-8 h-8 text-success",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),(0,n.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Welcome to Agent Relay!"}),(0,n.jsx)("p",{className:"text-text-muted",children:"/connect-repos"===m?"Let's connect your repositories...":"Redirecting to dashboard..."})]}):c?(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 flex items-center justify-center",children:(0,n.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}),(0,n.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Creating Account"}),(0,n.jsx)("p",{className:"text-text-muted",children:d||"Setting things up..."})]}):(0,n.jsxs)("div",{children:[x&&(0,n.jsx)("div",{className:"mb-4 p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,n.jsx)("p",{className:"text-error text-sm",children:x})}),(0,n.jsxs)("div",{className:"flex mb-6 bg-bg-secondary/50 rounded-lg p-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>t("github"),className:"flex-1 py-2 px-4 rounded-md text-sm font-medium transition-colors ".concat("github"===e?"bg-bg-primary text-white shadow-sm":"text-text-muted hover:text-white"),children:"GitHub"}),(0,n.jsx)("button",{type:"button",onClick:()=>t("email"),className:"flex-1 py-2 px-4 rounded-md text-sm font-medium transition-colors ".concat("email"===e?"bg-bg-primary text-white shadow-sm":"text-text-muted hover:text-white"),children:"Email"})]}),"github"===e?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mb-6 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 text-sm text-text-secondary",children:[(0,n.jsx)("div",{className:"w-8 h-8 rounded-lg bg-accent-cyan/10 flex items-center justify-center flex-shrink-0",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-accent-cyan",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,n.jsx)("span",{children:"Deploy AI agents in seconds"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3 text-sm text-text-secondary",children:[(0,n.jsx)("div",{className:"w-8 h-8 rounded-lg bg-[#00ffc8]/10 flex items-center justify-center flex-shrink-0",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-[#00ffc8]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),(0,n.jsx)("span",{children:"Real-time agent collaboration"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3 text-sm text-text-secondary",children:[(0,n.jsx)("div",{className:"w-8 h-8 rounded-lg bg-[#0891b2]/10 flex items-center justify-center flex-shrink-0",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-[#0891b2]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})}),(0,n.jsx)("span",{children:"Secure credential management"})]})]}),(0,n.jsx)("button",{type:"button",onClick:T,disabled:E,className:"w-full py-4 px-6 bg-[#24292e] hover:bg-[#2f363d] border border-[#444d56] rounded-xl text-white font-medium flex items-center justify-center gap-3 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})}),(0,n.jsx)("span",{children:"Sign up with GitHub"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:"Loading..."})]})})]}):(0,n.jsxs)("form",{onSubmit:M,className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-text-secondary mb-2",children:["Name ",(0,n.jsx)("span",{className:"text-text-muted",children:"(optional)"})]}),(0,n.jsx)("input",{type:"text",id:"displayName",value:k,onChange:e=>C(e.target.value),disabled:c,className:"w-full px-4 py-3 bg-bg-secondary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-cyan/50 focus:border-accent-cyan disabled:opacity-50",placeholder:"Your name"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-text-secondary mb-2",children:"Email"}),(0,n.jsx)("input",{type:"email",id:"email",value:g,onChange:e=>y(e.target.value),required:!0,disabled:c,className:"w-full px-4 py-3 bg-bg-secondary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-cyan/50 focus:border-accent-cyan disabled:opacity-50",placeholder:"you@example.com"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-text-secondary mb-2",children:"Password"}),(0,n.jsx)("input",{type:"password",id:"password",value:j,onChange:e=>w(e.target.value),required:!0,minLength:8,disabled:c,className:"w-full px-4 py-3 bg-bg-secondary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-cyan/50 focus:border-accent-cyan disabled:opacity-50",placeholder:"At least 8 characters"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-text-secondary mb-2",children:"Confirm Password"}),(0,n.jsx)("input",{type:"password",id:"confirmPassword",value:v,onChange:e=>N(e.target.value),required:!0,disabled:c,className:"w-full px-4 py-3 bg-bg-secondary border border-border-subtle rounded-xl text-white placeholder-text-muted focus:outline-none focus:ring-2 focus:ring-accent-cyan/50 focus:border-accent-cyan disabled:opacity-50",placeholder:"Confirm your password"})]}),(0,n.jsx)("button",{type:"submit",disabled:E||!g||!j||!v,className:"w-full py-4 px-6 bg-accent-cyan hover:bg-accent-cyan/90 rounded-xl text-black font-medium flex items-center justify-center gap-3 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:d||"Creating account..."})]}):(0,n.jsx)("span",{children:"Create Account"})})]}),(0,n.jsxs)("p",{className:"mt-6 text-center text-text-muted text-sm",children:["By signing up, you agree to our"," ",(0,n.jsx)("a",{href:"/terms",className:"text-accent-cyan hover:underline",children:"Terms of Service"})," ","and"," ",(0,n.jsx)("a",{href:"/privacy",className:"text-accent-cyan hover:underline",children:"Privacy Policy"})]})]})}),(0,n.jsx)("div",{className:"mt-6 text-center",children:(0,n.jsxs)("p",{className:"text-text-muted",children:["Already have an account?"," ",(0,n.jsx)("a",{href:"/login",className:"text-accent-cyan hover:underline font-medium",children:"Sign in"})]})}),(0,n.jsx)("div",{className:"mt-4 text-center",children:(0,n.jsx)("a",{href:"/",className:"text-text-muted hover:text-white transition-colors text-sm",children:"Back to home"})})]})]})}},6272:function(e,t,s){"use strict";s.d(t,{K7:function(){return r}});var n=s(7437);function r(e){let{size:t=24,className:s="",withGlow:r=!1}=e;return(0,n.jsxs)("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"\n transition-all duration-300\n ".concat(r?"drop-shadow-[0_0_8px_rgba(0,217,255,0.3)]":"","\n ").concat(s,"\n "),"aria-label":"Agent Relay Logo",role:"img",children:[(0,n.jsx)("path",{d:"M30 80 L 50 20 L 70 80",stroke:"#00d9ff",strokeWidth:"5",strokeLinejoin:"round",strokeLinecap:"round",fill:"none"}),(0,n.jsx)("line",{x1:"40",y1:"50",x2:"60",y2:"50",stroke:"#00d9ff",strokeWidth:"5",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M50 20 L 50 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.7"}),(0,n.jsx)("path",{d:"M50 20 C 80 20 80 50 50 50 L 80 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:"0.7"})]})}s(2265)}},function(e){e.O(0,[282,971,117,744],function(){return e(e.s=2679)}),_N_E=e.O()}]);