polyergon 0.1.0 → 0.1.1

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 (82) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +4 -4
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +4 -4
  5. package/.next/next-minimal-server.js.nft.json +1 -1
  6. package/.next/next-server.js.nft.json +1 -1
  7. package/.next/prerender-manifest.json +1 -1
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_not-found.html +1 -1
  10. package/.next/server/app/_not-found.rsc +1 -1
  11. package/.next/server/app/api/automations/existing/route.js +1 -1
  12. package/.next/server/app/api/backends/route.js +1 -1
  13. package/.next/server/app/api/diff/route.js +1 -0
  14. package/.next/server/app/api/diff/route.js.nft.json +1 -0
  15. package/.next/server/app/api/limits/route.js +1 -1
  16. package/.next/server/app/api/models/route.js +1 -1
  17. package/.next/server/app/api/orgs/[id]/route.js +1 -1
  18. package/.next/server/app/api/orgs/route.js +1 -1
  19. package/.next/server/app/api/prs/inbox/route.js +1 -1
  20. package/.next/server/app/api/prs/inbox/route.js.nft.json +1 -1
  21. package/.next/server/app/api/prs/refresh/route.js +1 -1
  22. package/.next/server/app/api/prs/refresh/route.js.nft.json +1 -1
  23. package/.next/server/app/api/prs/route.js +1 -1
  24. package/.next/server/app/api/prs/route.js.nft.json +1 -1
  25. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  26. package/.next/server/app/api/sessions/route.js +1 -1
  27. package/.next/server/app/api/settings/auth/route.js +1 -1
  28. package/.next/server/app/api/skills/[name]/route.js +1 -1
  29. package/.next/server/app/api/skills/marketplace/route.js +1 -1
  30. package/.next/server/app/api/skills/route.js +1 -1
  31. package/.next/server/app/api/skills/view/route.js +1 -1
  32. package/.next/server/app/api/slack/channels/route.js +1 -1
  33. package/.next/server/app/api/slack/configured/route.js +1 -1
  34. package/.next/server/app/api/slack/inbox/route.js +1 -1
  35. package/.next/server/app/api/tasks/route.js +1 -0
  36. package/.next/server/app/api/tasks/route.js.nft.json +1 -0
  37. package/.next/server/app/api/usage/route.js +1 -1
  38. package/.next/server/app/demo/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/demo.html +1 -1
  40. package/.next/server/app/demo.rsc +2 -2
  41. package/.next/server/app/favicon.ico/route.js +1 -1
  42. package/.next/server/app/index.html +1 -1
  43. package/.next/server/app/index.rsc +2 -2
  44. package/.next/server/app/page.js +10 -1
  45. package/.next/server/app/page_client-reference-manifest.js +1 -1
  46. package/.next/server/app-paths-manifest.json +18 -16
  47. package/.next/server/chunks/36.js +1 -0
  48. package/.next/server/chunks/590.js +1 -1
  49. package/.next/server/chunks/621.js +1 -1
  50. package/.next/server/chunks/904.js +1 -1
  51. package/.next/server/chunks/972.js +2 -2
  52. package/.next/server/functions-config-manifest.json +1 -1
  53. package/.next/server/middleware-build-manifest.js +1 -1
  54. package/.next/server/pages/404.html +1 -1
  55. package/.next/server/pages/500.html +1 -1
  56. package/.next/server/server-reference-manifest.json +1 -1
  57. package/.next/static/chunks/171-d325f9625379d70a.js +1 -0
  58. package/.next/static/chunks/app/page-fedaef1e63f186c2.js +1 -0
  59. package/.next/static/chunks/{main-960df1c7509a5a8b.js → main-e88dbd51c3bdafca.js} +1 -1
  60. package/.next/static/css/6e83ef44d507c857.css +3 -0
  61. package/.next/trace +23 -22
  62. package/.next/types/app/api/diff/route.ts +343 -0
  63. package/.next/types/app/api/tasks/route.ts +343 -0
  64. package/.server-dist/server.js +73 -27
  65. package/.server-dist/src/lib/backends.js +99 -1
  66. package/.server-dist/src/lib/diffReview.js +116 -0
  67. package/.server-dist/src/lib/liveSessionStore.js +1 -1
  68. package/.server-dist/src/lib/modelCatalog.js +10 -3
  69. package/.server-dist/src/lib/pipelines.js +34 -8
  70. package/.server-dist/src/lib/ptyManager.js +15 -6
  71. package/.server-dist/src/lib/statusDetector.js +4 -0
  72. package/.server-dist/src/lib/taskStore.js +42 -0
  73. package/.server-dist/src/lib/worktrees.js +42 -0
  74. package/.server-dist/tsconfig.server.tsbuildinfo +1 -1
  75. package/README.md +16 -4
  76. package/package.json +1 -1
  77. package/.next/server/chunks/348.js +0 -1
  78. package/.next/static/chunks/171-f72ed164561ba218.js +0 -1
  79. package/.next/static/chunks/app/page-cebeba7d6d08548a.js +0 -1
  80. package/.next/static/css/a537d3e86c0f36d2.css +0 -3
  81. /package/.next/static/{q-HMeHYZY36qljBJhsyS6 → 2gHioRND6aAzT4OB5OHDV}/_buildManifest.js +0 -0
  82. /package/.next/static/{q-HMeHYZY36qljBJhsyS6 → 2gHioRND6aAzT4OB5OHDV}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"1868","name":"*","chunks":[],"async":false}},"1060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"2242":{"*":{"id":"9147","name":"*","chunks":[],"async":false}},"2846":{"*":{"id":"2994","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"9671","name":"*","chunks":[],"async":false}},"6423":{"*":{"id":"4759","name":"*","chunks":[],"async":false}},"9107":{"*":{"id":"6114","name":"*","chunks":[],"async":false}},"9714":{"*":{"id":"6847","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/app-router.js":{"id":2846,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/app-router.js":{"id":2846,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/client-page.js":{"id":9107,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/client-page.js":{"id":9107,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/error-boundary.js":{"id":1060,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":1060,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6423,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6423,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/globals.css":{"id":2778,"name":"*","chunks":["185","static/chunks/app/layout-d058836232e72324.js"],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/demo/page.tsx":{"id":2242,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/page.tsx":{"id":9714,"name":"*","chunks":["171","static/chunks/171-f72ed164561ba218.js","931","static/chunks/app/page-cebeba7d6d08548a.js"],"async":false}},"entryCSSFiles":{"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/":[],"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/layout":["static/css/a537d3e86c0f36d2.css"],"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/page":[]}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"80":{"*":{"id":"1868","name":"*","chunks":[],"async":false}},"1060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"2242":{"*":{"id":"9147","name":"*","chunks":[],"async":false}},"2846":{"*":{"id":"2994","name":"*","chunks":[],"async":false}},"4009":{"*":{"id":"1908","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"9671","name":"*","chunks":[],"async":false}},"6423":{"*":{"id":"4759","name":"*","chunks":[],"async":false}},"9107":{"*":{"id":"6114","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/app-router.js":{"id":2846,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/app-router.js":{"id":2846,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/client-page.js":{"id":9107,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/client-page.js":{"id":9107,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/error-boundary.js":{"id":1060,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":1060,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6423,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6423,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/globals.css":{"id":2778,"name":"*","chunks":["185","static/chunks/app/layout-d058836232e72324.js"],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/demo/page.tsx":{"id":2242,"name":"*","chunks":[],"async":false},"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/page.tsx":{"id":4009,"name":"*","chunks":["171","static/chunks/171-d325f9625379d70a.js","931","static/chunks/app/page-fedaef1e63f186c2.js"],"async":false}},"entryCSSFiles":{"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/":[],"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/layout":["static/css/6e83ef44d507c857.css"],"/private/tmp/claude-503/-Users-ofiryehoshua/0b425a50-f3c5-49e8-a60e-788bd3aae351/scratchpad/npm-build/src/app/page":[]}}
@@ -1,34 +1,36 @@
1
1
  {
2
2
  "/_not-found/page": "app/_not-found/page.js",
3
- "/favicon.ico/route": "app/favicon.ico/route.js",
3
+ "/demo/page": "app/demo/page.js",
4
4
  "/api/backends/route": "app/api/backends/route.js",
5
- "/api/meetings/route": "app/api/meetings/route.js",
5
+ "/api/limits/route": "app/api/limits/route.js",
6
6
  "/api/meetings/[id]/route": "app/api/meetings/[id]/route.js",
7
- "/api/automations/existing/route": "app/api/automations/existing/route.js",
7
+ "/api/meetings/route": "app/api/meetings/route.js",
8
8
  "/api/models/route": "app/api/models/route.js",
9
+ "/api/meetings/library/route": "app/api/meetings/library/route.js",
10
+ "/api/automations/existing/route": "app/api/automations/existing/route.js",
11
+ "/api/meetings/[id]/slack/route": "app/api/meetings/[id]/slack/route.js",
12
+ "/api/prs/refresh/route": "app/api/prs/refresh/route.js",
9
13
  "/api/notes/route": "app/api/notes/route.js",
10
14
  "/api/prs/inbox/route": "app/api/prs/inbox/route.js",
11
- "/api/prs/refresh/route": "app/api/prs/refresh/route.js",
12
- "/api/prs/route": "app/api/prs/route.js",
15
+ "/api/diff/route": "app/api/diff/route.js",
13
16
  "/api/orgs/route": "app/api/orgs/route.js",
14
- "/api/sessions/route": "app/api/sessions/route.js",
15
- "/api/limits/route": "app/api/limits/route.js",
16
- "/api/meetings/[id]/slack/route": "app/api/meetings/[id]/slack/route.js",
17
+ "/api/prs/route": "app/api/prs/route.js",
18
+ "/api/session-names/route": "app/api/session-names/route.js",
17
19
  "/api/orgs/[id]/route": "app/api/orgs/[id]/route.js",
18
20
  "/api/settings/auth/route": "app/api/settings/auth/route.js",
21
+ "/api/sessions/route": "app/api/sessions/route.js",
19
22
  "/api/settings/transcription/route": "app/api/settings/transcription/route.js",
20
23
  "/api/skills/marketplace/route": "app/api/skills/marketplace/route.js",
21
- "/api/sessions/[id]/route": "app/api/sessions/[id]/route.js",
24
+ "/api/settings/route": "app/api/settings/route.js",
22
25
  "/api/skills/[name]/route": "app/api/skills/[name]/route.js",
23
- "/api/skills/view/route": "app/api/skills/view/route.js",
24
- "/api/usage/route": "app/api/usage/route.js",
25
26
  "/api/slack/channels/route": "app/api/slack/channels/route.js",
26
- "/demo/page": "app/demo/page.js",
27
27
  "/api/slack/configured/route": "app/api/slack/configured/route.js",
28
+ "/api/skills/view/route": "app/api/skills/view/route.js",
29
+ "/api/usage/route": "app/api/usage/route.js",
28
30
  "/page": "app/page.js",
29
- "/api/session-names/route": "app/api/session-names/route.js",
31
+ "/api/sessions/[id]/route": "app/api/sessions/[id]/route.js",
32
+ "/favicon.ico/route": "app/favicon.ico/route.js",
33
+ "/api/tasks/route": "app/api/tasks/route.js",
30
34
  "/api/skills/route": "app/api/skills/route.js",
31
- "/api/settings/route": "app/api/settings/route.js",
32
- "/api/slack/inbox/route": "app/api/slack/inbox/route.js",
33
- "/api/meetings/library/route": "app/api/meetings/library/route.js"
35
+ "/api/slack/inbox/route": "app/api/slack/inbox/route.js"
34
36
  }
@@ -0,0 +1 @@
1
+ "use strict";exports.id=36,exports.ids=[36],exports.modules={9210:(t,e,s)=>{s.d(e,{Q:()=>r});var i=s(5315);let r=process.env.POLYERGON_DATA_DIR||(0,i.join)(process.env.HOME,".claude-session-manager")},8829:(t,e,s)=>{s.d(e,{SK:()=>c,kZ:()=>l});var i=s(1282),r=s(1764),a=s(3158);let n=(0,r.promisify)(i.execFile),l=new Map;async function o(t){if(!a.o.test(t))return null;try{let{stdout:e}=await n("gh",["pr","view",t,"--json","state,reviewDecision,statusCheckRollup,number,title,updatedAt"],{timeout:8e3,env:{...process.env,...process.env.GITHUB_TOKEN?{GITHUB_TOKEN:process.env.GITHUB_TOKEN}:{}}}),s=JSON.parse(e),i=s.updatedAt?Date.parse(s.updatedAt):NaN,r={number:s.number,title:s.title,state:s.state,reviewDecision:s.reviewDecision??null,checks:function(t){if(!t||0===t.length)return"none";let e=new Set(["FAILURE","CANCELLED","TIMED_OUT","STARTUP_FAILURE"]),s=new Set(["FAILURE","ERROR"]),i=new Set(["QUEUED","IN_PROGRESS","PENDING","WAITING","REQUESTED"]),r=new Set(["PENDING"]),a=!1;for(let n of t){if(n.conclusion&&e.has(n.conclusion)||n.state&&s.has(n.state))return"failing";n.status&&i.has(n.status)&&!n.conclusion&&(a=!0),n.state&&r.has(n.state)&&(a=!0)}return a?"pending":"passing"}(s.statusCheckRollup??[]),updatedAt:Number.isNaN(i)?null:i,fetchedAt:Date.now()};return l.set(t,r),r}catch{return null}}async function c(t){let e=Array.from(new Set(t)),s=new Map;for(let t=0;t<e.length;t+=6){let i=e.slice(t,t+6);(await Promise.allSettled(i.map(t=>o(t)))).forEach((t,e)=>{"fulfilled"===t.status&&t.value&&s.set(i[e],t.value)})}return s}},443:(t,e,s)=>{s.d(e,{H:()=>c,W:()=>o});var i=s(9210),r=s(2048),a=s(5315);let n=i.Q,l=(0,a.join)(n,"live-sessions.json");class o{constructor(t=l){this.sessions=new Map,this.persistFile=t,this.persistDir=(0,a.join)(t,"..")}add(t){this.sessions.set(t.id,t),this.persist()}get(t){return this.sessions.get(t)}list(){return Array.from(this.sessions.values())}setStatus(t,e){let s=this.sessions.get(t);s&&(s.status=e)}setClaudeSessionId(t,e){let s=this.sessions.get(t);s&&(s.claudeSessionId=e,this.persist())}setRcUrl(t,e){let s=this.sessions.get(t);s&&(s.rcUrl=e)}setPrUrl(t,e){let s=this.sessions.get(t);s&&s.prUrl!==e&&(s.prUrl=e,this.persist())}remove(t){this.sessions.delete(t),this.persist()}persist(){try{(0,r.existsSync)(this.persistDir)||(0,r.mkdirSync)(this.persistDir,{recursive:!0});let t=Array.from(this.sessions.values()).map(t=>({id:t.id,cwd:t.cwd,gitRoot:t.gitRoot,claudeSessionId:t.claudeSessionId,createdAt:t.createdAt,prUrl:t.prUrl,orgId:t.orgId,backend:t.backend,model:t.model,rc:t.rc,worktree:t.worktree}));(0,r.writeFileSync)(this.persistFile,JSON.stringify(t))}catch{}}static backupSaved(t=l){try{if(!(0,r.existsSync)(t))return;let e=(0,a.dirname)(t);(0,r.copyFileSync)(t,(0,a.join)(e,`live-sessions.boot-${Date.now()}.json`)),(0,r.readdirSync)(e).filter(t=>t.startsWith("live-sessions.boot-")).sort().slice(0,-5).forEach(t=>(0,r.unlinkSync)((0,a.join)(e,t)))}catch{}}static loadSaved(t=l){try{return JSON.parse((0,r.readFileSync)(t,"utf-8"))}catch{return[]}}}let c=global.__liveSessionStore??(global.__liveSessionStore=new o)},4234:(t,e,s)=>{s.d(e,{B9:()=>l,b9:()=>p});var i=s(9210),r=s(2048),a=s(5315),n=s(4770);let l="default",o=i.Q,c=(0,a.join)(o,"orgs.json");class u{constructor(t=c){this.orgs=new Map,this.persistFile=t,this.persistDir=(0,a.join)(t,".."),this.load()}load(){try{let t=JSON.parse((0,r.readFileSync)(this.persistFile,"utf-8"));this.orgs=new Map(t.map(t=>[t.id,t]))}catch{}this.orgs.has(l)||(this.orgs.set(l,{id:l,name:"Default",configDir:null}),this.persist())}list(){return this.load(),Array.from(this.orgs.values())}projectRoots(){let t=new Set,e=[];for(let s of this.list()){let i=(0,a.join)(s.configDir??(0,a.join)(process.env.HOME,".claude"),"projects");t.has(i)||(t.add(i),e.push({orgId:s.id,root:i}))}return e}get(t){return this.load(),this.orgs.get(t)}add(t,e,s){this.load();let i={id:(0,n.randomUUID)(),name:t,configDir:e,model:s??null};return this.orgs.set(i.id,i),this.persist(),i}update(t,e){let s=this.get(t);if(!s)return;let i={...s,...e,id:t};return t===l&&(i.configDir=s.configDir),this.orgs.set(t,i),this.persist(),i}remove(t){return!!(t!==l&&this.get(t))&&(this.orgs.delete(t),this.persist(),!0)}persist(){try{(0,r.existsSync)(this.persistDir)||(0,r.mkdirSync)(this.persistDir,{recursive:!0}),(0,r.writeFileSync)(this.persistFile,JSON.stringify(Array.from(this.orgs.values())))}catch{}}}let p=global.__orgRegistry??(global.__orgRegistry=new u)},3158:(t,e,s)=>{s.d(e,{O:()=>a,o:()=>r});let i=/https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/\d+/g,r=/^https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/\d+$/;function a(t){let e=t.match(i);return e?e[e.length-1]:null}},4036:(t,e,s)=>{s.d(e,{Gh:()=>w,Zw:()=>v});var i=s(443),r=s(9916),a=s(9210),n=s(2048),l=s(6027),o=s(5315),c=s.n(o),u=s(3158);let p=c().join(process.env.HOME,".claude","projects"),d=c().join(a.Q,"pr-url-cache.json");class h{constructor(t=d,e=p){this.cache=new Map,this.loaded=!1,this.cacheFile=t,this.cacheDir=c().join(t,".."),this.projectsDir=e}async load(){if(!this.loaded){this.loaded=!0;try{let t=await n.promises.readFile(this.cacheFile,"utf-8"),e=JSON.parse(t);this.cache=new Map(Object.entries(e))}catch{}}}async persist(){try{await n.promises.mkdir(this.cacheDir,{recursive:!0}),await n.promises.writeFile(this.cacheFile,JSON.stringify(Object.fromEntries(this.cache)))}catch{}}async scan(t=[this.projectsDir]){await this.load();let e=new Map,s=!1;for(let i of t){let t;try{t=await n.promises.readdir(i)}catch{continue}for(let r of t){let t,a;let o=c().join(i,r);try{t=await n.promises.stat(o)}catch{continue}if(t.isDirectory()){try{a=await n.promises.readdir(o)}catch{continue}for(let t of a){let i;if(!t.endsWith(".jsonl"))continue;let r=t.replace(".jsonl",""),a=c().join(o,t);try{i=await n.promises.stat(a)}catch{continue}let p=this.cache.get(r);if(p&&p.mtimeMs===i.mtimeMs&&p.size===i.size){p.prUrl&&e.set(r,p.prUrl);continue}let d=null;try{for await(let t of(0,l.createInterface)({input:(0,n.createReadStream)(a,{encoding:"utf-8"}),crlfDelay:1/0}))d=(0,u.O)(t)??d}catch{}this.cache.set(r,{prUrl:d,mtimeMs:i.mtimeMs,size:i.size}),s=!0,d&&e.set(r,d)}}}}return s&&await this.persist(),e}}let f=global.__prUrlCache??(global.__prUrlCache=new h);var m=s(8829),g=s(4234);async function w(){let[t,e]=await Promise.all([f.scan(g.b9.projectRoots().map(t=>t.root)),(0,r.Rd)()]),s=new Map(e.map(t=>[t.sessionId,t])),a=[],n=new Set;for(let t of i.H.list())t.prUrl&&(a.push({source:"live",liveId:t.id,sessionId:t.claudeSessionId,orgId:t.orgId??g.B9,cwd:t.cwd,gitRoot:t.gitRoot,prUrl:t.prUrl,status:m.kZ.get(t.prUrl)??null,sessionDate:t.createdAt}),t.claudeSessionId&&n.add(t.claudeSessionId));return t.forEach((t,e)=>{if(n.has(e))return;let i=s.get(e),r=i?.lastTimestamp?Date.parse(i.lastTimestamp):NaN;a.push({source:"history",liveId:null,sessionId:e,orgId:i?.orgId??g.B9,cwd:i?.cwd??null,gitRoot:i?.gitRoot??null,prUrl:t,status:m.kZ.get(t)??null,sessionDate:Number.isNaN(r)?0:r})}),a}function y(t){return t.status?.state==="OPEN"&&("CHANGES_REQUESTED"===t.status.reviewDecision||"failing"===t.status.checks)?0:t.status&&"OPEN"!==t.status.state?"MERGED"===t.status.state?2:3:1}function S(t){return t.status?.updatedAt??t.sessionDate}function v(t){return[...t].sort((t,e)=>{let s=y(t),i=y(e);return s!==i?s-i:S(e)-S(t)})}},9916:(t,e,s)=>{s.d(e,{cS:()=>p,Rd:()=>h});var i=s(2048),r=s.n(i),a=s(5315),n=s.n(a),l=s(6027),o=s(1282);let c=new Map;var u=s(4234);async function p(t,e=30){let s=[];for await(let i of(0,l.createInterface)({input:r().createReadStream(t,{encoding:"utf-8"}),crlfDelay:1/0}))if(i.trim())try{let t=JSON.parse(i);if("user"===t.type&&t.message?.role==="user"){let e="string"==typeof t.message.content?t.message.content:t.message.content?.[0]?.text??"";e&&s.push({role:"user",content:e,timestamp:t.timestamp??null})}else if("assistant"===t.type&&t.message?.role==="assistant"){let e=(t.message.content??[]).filter(t=>"text"===t.type).map(t=>t.text).join("");e&&s.push({role:"assistant",content:e,timestamp:t.timestamp??null})}s.length>e&&s.shift()}catch{}return s}async function d(t,e=262144){try{let s=await r().promises.open(t,"r"),{size:i}=await s.stat(),a=Buffer.alloc(Math.min(e,i)),{bytesRead:n}=await s.read(a,0,a.length,Math.max(0,i-e));return await s.close(),function(t){let e=null,s=null;for(let i of t.split("\n"))if(i.includes('-title"'))try{let t=JSON.parse(i);"custom-title"===t.type&&t.customTitle?e=String(t.customTitle):"ai-title"===t.type&&t.aiTitle&&(s=String(t.aiTitle))}catch{}return e??s}(a.subarray(0,n).toString("utf-8"))}catch{return null}}async function h(){let t=[];for(let{orgId:e,root:s}of u.b9.projectRoots()){let i;try{i=await r().promises.readdir(s)}catch{continue}for(let a of i){let i;let l=n().join(s,a);try{i=await r().promises.stat(l)}catch{continue}if(i.isDirectory())for(let s of(await r().promises.readdir(l))){if(!s.endsWith(".jsonl"))continue;let i=n().join(l,s);try{let n=await r().promises.stat(i);t.push({filePath:i,projectDir:a,sessionId:s.replace(".jsonl",""),mtime:n.mtime,orgId:e})}catch{}}}}let e=[];return await Promise.all(t.map(async({filePath:t,projectDir:s,sessionId:i,mtime:a,orgId:n})=>{try{let l=await r().promises.open(t,"r"),u=Buffer.alloc(65536),{bytesRead:p}=await l.read(u,0,65536,0);await l.close();let h=u.subarray(0,p).toString("utf-8"),f=h.slice(0,h.lastIndexOf("\n")+1),m=function(t,e,s){let i=null,r=null,a=0,n=!1;for(let e of t.split("\n"))if(e.trim())try{let t=JSON.parse(e);if("sdk-cli"===t.entrypoint&&(n=!0),"user"===t.type&&t.message?.role==="user"){null===i&&t.cwd&&(i=t.cwd);let e="string"==typeof t.message.content?t.message.content:t.message.content?.[0]?.text??"";null===r&&e&&(r=e.slice(0,100)),a++}else"assistant"===t.type&&t.message?.role==="assistant"&&a++}catch{}return{sessionId:e,cwd:i,messageCount:a,lastTimestamp:s.toISOString(),firstUserMessage:r,headless:n}}(f,i,a);m.title=await d(t);let g=m.cwd?function(t){if(!t||/\/General(\/[^/]+)?$/.test(t))return null;if(c.has(t))return c.get(t);try{let e=(0,o.execSync)(`git -C "${t}" rev-parse --show-toplevel`,{stdio:["pipe","pipe","pipe"],timeout:3e3}).toString().trim();return c.set(t,e),e}catch{return c.set(t,null),null}}(m.cwd):null;e.push({...m,projectPath:s.replace(/-/g,"/"),projectEncoded:s,filePath:t,gitRoot:g,orgId:n})}catch{}})),e.sort((t,e)=>{let s=t.lastTimestamp??"",i=e.lastTimestamp??"";return i>s?1:i<s?-1:0})}}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=590,exports.ids=[590],exports.modules={4413:(e,t,r)=>{r.d(t,{VE:()=>l,dP:()=>o,dS:()=>a,w6:()=>i});var n=r(1282),s=r(3533);function i(e=s.L4){let t=(0,s.zi)(e),r="string"==typeof t.anthropicApiKey?t.anthropicApiKey:"";return"apiKey"===t.claudeAuth&&r?{mode:"apiKey",keyHint:"…"+r.slice(-4)}:{mode:"login",keyHint:r?"…"+r.slice(-4):null}}function a(e,t=s.L4){let r=(0,s.zi)(t);if("login"===e.mode)r.claudeAuth="login";else if("apiKey"===e.mode){let t=("string"==typeof e.apiKey?e.apiKey.trim():"")||("string"==typeof r.anthropicApiKey?r.anthropicApiKey:"");if(!t)throw Error("API key is required");if(!t.startsWith("sk-ant-"))throw Error("That does not look like an Anthropic API key (it should start with sk-ant-)");Object.assign(r,{claudeAuth:"apiKey",anthropicApiKey:t})}else throw Error("Unknown mode");return(0,s.iL)(r,t),i(t)}function o(e=s.L4){let t=(0,s.zi)(e);return"apiKey"===t.claudeAuth&&"string"==typeof t.anthropicApiKey&&t.anthropicApiKey?{ANTHROPIC_API_KEY:t.anthropicApiKey}:{}}function l(e){let t={...process.env,...e?{CLAUDE_CONFIG_DIR:e}:{}};return new Promise(e=>{(0,n.execFile)("claude",["auth","status"],{env:t,timeout:2e4},(t,r)=>{try{let t=JSON.parse(r);e({loggedIn:!!t.loggedIn,email:t.email??null,orgName:t.orgName??null,plan:t.subscriptionType??null})}catch{e(null)}})})}},3533:(e,t,r)=>{r.d(t,{L4:()=>a,iL:()=>l,zi:()=>o});var n=r(9210),s=r(2048),i=r(5315);let a=(0,i.join)(n.Q,"config.json");function o(e=a){try{return JSON.parse((0,s.readFileSync)(e,"utf-8"))}catch{return{}}}function l(e,t=a){(0,s.mkdirSync)((0,i.join)(t,".."),{recursive:!0}),(0,s.writeFileSync)(t,JSON.stringify(e,null,2),{mode:384}),(0,s.chmodSync)(t,384)}},9210:(e,t,r)=>{r.d(t,{Q:()=>s});var n=r(5315);let s=process.env.POLYERGON_DATA_DIR||(0,n.join)(process.env.HOME,".claude-session-manager")},1293:(e,t,r)=>{r.d(t,{B9:()=>o,b9:()=>h});var n=r(9210),s=r(2048),i=r(5315),a=r(4770);let o="default",l=n.Q,c=(0,i.join)(l,"orgs.json");class d{constructor(e=c){this.orgs=new Map,this.persistFile=e,this.persistDir=(0,i.join)(e,".."),this.load()}load(){try{let e=JSON.parse((0,s.readFileSync)(this.persistFile,"utf-8"));this.orgs=new Map(e.map(e=>[e.id,e]))}catch{}this.orgs.has(o)||(this.orgs.set(o,{id:o,name:"Default",configDir:null}),this.persist())}list(){return this.load(),Array.from(this.orgs.values())}projectRoots(){let e=new Set,t=[];for(let r of this.list()){let n=(0,i.join)(r.configDir??(0,i.join)(process.env.HOME,".claude"),"projects");e.has(n)||(e.add(n),t.push({orgId:r.id,root:n}))}return t}get(e){return this.load(),this.orgs.get(e)}add(e,t,r){this.load();let n={id:(0,a.randomUUID)(),name:e,configDir:t,model:r??null};return this.orgs.set(n.id,n),this.persist(),n}update(e,t){let r=this.get(e);if(!r)return;let n={...r,...t,id:e};return e===o&&(n.configDir=r.configDir),this.orgs.set(e,n),this.persist(),n}remove(e){return!!(e!==o&&this.get(e))&&(this.orgs.delete(e),this.persist(),!0)}persist(){try{(0,s.existsSync)(this.persistDir)||(0,s.mkdirSync)(this.persistDir,{recursive:!0}),(0,s.writeFileSync)(this.persistFile,JSON.stringify(Array.from(this.orgs.values())))}catch{}}}let h=global.__orgRegistry??(global.__orgRegistry=new d)},8590:(e,t,r)=>{r.d(t,{R3:()=>u,rU:()=>v,Cg:()=>h,Rh:()=>D,z0:()=>S,S9:()=>O,OW:()=>f,e8:()=>m,hO:()=>w,iH:()=>A,bJ:()=>E,Mo:()=>k,FE:()=>y});var n=r(2048),s=r(9801),i=r(5315),a=r(9210),o=r(1282),l=r(4413);function c(e,t){return new Promise((r,n)=>{let s=["-p","--output-format","json","--permission-mode","bypassPermissions",...t.model?["--model",t.model]:[],...t.resumeId?["--resume",t.resumeId,...t.forkSession?["--fork-session"]:[]]:[]],i={...Object.fromEntries(["PATH","HOME","USER","LOGNAME","SHELL","TERM","LANG","LC_ALL"].filter(e=>process.env[e]).map(e=>[e,process.env[e]])),...(0,l.dP)(),...t.configDir?{CLAUDE_CONFIG_DIR:t.configDir}:{},...t.extraEnv},a=(0,o.spawn)("claude",s,{cwd:t.cwd,env:i}),c="",d="";a.stdout.on("data",e=>{c+=e.toString()}),a.stderr.on("data",e=>{d=(d+e.toString()).slice(-1e3)});let h=setTimeout(()=>a.kill("SIGKILL"),t.timeoutMs??18e4);a.on("error",e=>{clearTimeout(h),n(e)}),a.on("exit",e=>{if(clearTimeout(h),0!==e){n(Error(null===e?"Claude took too long and was stopped":`claude -p exited ${e}: ${d.trim().slice(-300)}`));return}try{let e=JSON.parse(c);r({result:e.result??"",sessionId:e.session_id??null})}catch{n(Error(`unparseable claude output: ${c.slice(0,200)}`))}}),a.stdin.write(e),a.stdin.end()})}var d=r(1293);function h(e){return/sign(ed)? ?in|log(ged)? ?in|re-?auth|authenticat|authori[sz]|reconnect|refused the connection|expired|token/i.test(e)?"auth":/no slack|not (available|configured|connected|installed)|don'?t have (access to )?(a |the )?slack|no .*slack (tool|connector)/i.test(e)?"missing":"other"}class u extends Error{constructor(e,t){super(e),this.problem=t}}let m=(e,t=d.B9)=>(0,i.join)(a.Q,t===d.B9?`${e}.json`:`${e}.${t.replace(/[^\w-]/g,"")}.json`);function p(e="claude-haiku-5-5",t=d.B9){let r=d.b9.get(t)??d.b9.get(d.B9);return(0,n.mkdirSync)(a.Q,{recursive:!0}),{cwd:a.Q,configDir:r?.configDir??null,model:e,extraEnv:g(r?.configDir??null)}}let g=e=>e?{ENABLE_CLAUDEAI_MCP_SERVERS:"false"}:void 0;async function f(e=!1,t=d.B9){if(!e)try{let e=JSON.parse((0,n.readFileSync)(m("slack-channels",t),"utf-8"));if(Date.now()-e.fetchedAt<864e5&&e.channels?.length)return e}catch{}let{result:r}=await c('Use the Slack connector to list every Slack channel I am a member of (public and private, not DMs). Page through all results. Respond with ONLY a JSON array, no prose: [{"id": "C123", "name": "channel-name"}, ...]',p(void 0,t)),s=function(e){let t=e.indexOf("["),r=e.lastIndexOf("]");if(-1===t||r<=t)return[];try{let n=JSON.parse(e.slice(t,r+1));return(Array.isArray(n)?n:[]).filter(e=>!!e&&"string"==typeof e.name).map(e=>({id:String(e.id??""),name:e.name.replace(/^#/,"")})).sort((e,t)=>e.name.localeCompare(t.name))}catch{return[]}}(r);if(!s.length)throw new u(r.trim().slice(0,300)||"No channels came back",h(r));let i={channels:s,fetchedAt:Date.now()};return(0,n.writeFileSync)(m("slack-channels",t),JSON.stringify(i)),i}function y(e){return e.replace(/^#{1,6}\s+(.*)$/gm,"*$1*").replace(/\*\*([^*]+)\*\*/g,"*$1*").replace(/^(\s*)[-*]\s+/gm,"$1• ").trim()}async function w(e,t,r=d.B9){let n=e.id?`${e.id} (#${e.name})`:`#${e.name}`,{result:s}=await c(`Use the Slack connector to post the message below to the Slack channel ${n}. Post it exactly as written, as one message, without changes or additions. Reply with only "OK <the posted message permalink>" when posted, or "FAILED: <reason>".
1
+ "use strict";exports.id=590,exports.ids=[590],exports.modules={4413:(e,t,r)=>{r.d(t,{VE:()=>l,dP:()=>o,dS:()=>a,w6:()=>i});var n=r(1282),s=r(3533);function i(e=s.L4){let t=(0,s.zi)(e),r="string"==typeof t.anthropicApiKey?t.anthropicApiKey:"";return"apiKey"===t.claudeAuth&&r?{mode:"apiKey",keyHint:"…"+r.slice(-4)}:{mode:"login",keyHint:r?"…"+r.slice(-4):null}}function a(e,t=s.L4){let r=(0,s.zi)(t);if("login"===e.mode)r.claudeAuth="login";else if("apiKey"===e.mode){let t=("string"==typeof e.apiKey?e.apiKey.trim():"")||("string"==typeof r.anthropicApiKey?r.anthropicApiKey:"");if(!t)throw Error("API key is required");if(!t.startsWith("sk-ant-"))throw Error("That does not look like an Anthropic API key (it should start with sk-ant-)");Object.assign(r,{claudeAuth:"apiKey",anthropicApiKey:t})}else throw Error("Unknown mode");return(0,s.iL)(r,t),i(t)}function o(e=s.L4){let t=(0,s.zi)(e);return"apiKey"===t.claudeAuth&&"string"==typeof t.anthropicApiKey&&t.anthropicApiKey?{ANTHROPIC_API_KEY:t.anthropicApiKey}:{}}function l(e){let t={...process.env,...e?{CLAUDE_CONFIG_DIR:e}:{}};return new Promise(e=>{(0,n.execFile)("claude",["auth","status"],{env:t,timeout:2e4},(t,r)=>{try{let t=JSON.parse(r);e({loggedIn:!!t.loggedIn,email:t.email??null,orgName:t.orgName??null,plan:t.subscriptionType??null})}catch{e(null)}})})}},3533:(e,t,r)=>{r.d(t,{L4:()=>a,iL:()=>l,zi:()=>o});var n=r(9210),s=r(2048),i=r(5315);let a=(0,i.join)(n.Q,"config.json");function o(e=a){try{return JSON.parse((0,s.readFileSync)(e,"utf-8"))}catch{return{}}}function l(e,t=a){(0,s.mkdirSync)((0,i.join)(t,".."),{recursive:!0}),(0,s.writeFileSync)(t,JSON.stringify(e,null,2),{mode:384}),(0,s.chmodSync)(t,384)}},9210:(e,t,r)=>{r.d(t,{Q:()=>s});var n=r(5315);let s=process.env.POLYERGON_DATA_DIR||(0,n.join)(process.env.HOME,".claude-session-manager")},4234:(e,t,r)=>{r.d(t,{B9:()=>o,b9:()=>h});var n=r(9210),s=r(2048),i=r(5315),a=r(4770);let o="default",l=n.Q,c=(0,i.join)(l,"orgs.json");class d{constructor(e=c){this.orgs=new Map,this.persistFile=e,this.persistDir=(0,i.join)(e,".."),this.load()}load(){try{let e=JSON.parse((0,s.readFileSync)(this.persistFile,"utf-8"));this.orgs=new Map(e.map(e=>[e.id,e]))}catch{}this.orgs.has(o)||(this.orgs.set(o,{id:o,name:"Default",configDir:null}),this.persist())}list(){return this.load(),Array.from(this.orgs.values())}projectRoots(){let e=new Set,t=[];for(let r of this.list()){let n=(0,i.join)(r.configDir??(0,i.join)(process.env.HOME,".claude"),"projects");e.has(n)||(e.add(n),t.push({orgId:r.id,root:n}))}return t}get(e){return this.load(),this.orgs.get(e)}add(e,t,r){this.load();let n={id:(0,a.randomUUID)(),name:e,configDir:t,model:r??null};return this.orgs.set(n.id,n),this.persist(),n}update(e,t){let r=this.get(e);if(!r)return;let n={...r,...t,id:e};return e===o&&(n.configDir=r.configDir),this.orgs.set(e,n),this.persist(),n}remove(e){return!!(e!==o&&this.get(e))&&(this.orgs.delete(e),this.persist(),!0)}persist(){try{(0,s.existsSync)(this.persistDir)||(0,s.mkdirSync)(this.persistDir,{recursive:!0}),(0,s.writeFileSync)(this.persistFile,JSON.stringify(Array.from(this.orgs.values())))}catch{}}}let h=global.__orgRegistry??(global.__orgRegistry=new d)},8590:(e,t,r)=>{r.d(t,{R3:()=>u,rU:()=>v,Cg:()=>h,Rh:()=>D,z0:()=>S,S9:()=>O,OW:()=>f,e8:()=>m,hO:()=>w,iH:()=>A,bJ:()=>E,Mo:()=>k,FE:()=>y});var n=r(2048),s=r(9801),i=r(5315),a=r(9210),o=r(1282),l=r(4413);function c(e,t){return new Promise((r,n)=>{let s=["-p","--output-format","json","--permission-mode","bypassPermissions",...t.model?["--model",t.model]:[],...t.resumeId?["--resume",t.resumeId,...t.forkSession?["--fork-session"]:[]]:[]],i={...Object.fromEntries(["PATH","HOME","USER","LOGNAME","SHELL","TERM","LANG","LC_ALL"].filter(e=>process.env[e]).map(e=>[e,process.env[e]])),...(0,l.dP)(),...t.configDir?{CLAUDE_CONFIG_DIR:t.configDir}:{},...t.extraEnv},a=(0,o.spawn)("claude",s,{cwd:t.cwd,env:i}),c="",d="";a.stdout.on("data",e=>{c+=e.toString()}),a.stderr.on("data",e=>{d=(d+e.toString()).slice(-1e3)});let h=setTimeout(()=>a.kill("SIGKILL"),t.timeoutMs??18e4);a.on("error",e=>{clearTimeout(h),n(e)}),a.on("exit",e=>{if(clearTimeout(h),0!==e){n(Error(null===e?"Claude took too long and was stopped":`claude -p exited ${e}: ${d.trim().slice(-300)}`));return}try{let e=JSON.parse(c);r({result:e.result??"",sessionId:e.session_id??null})}catch{n(Error(`unparseable claude output: ${c.slice(0,200)}`))}}),a.stdin.write(e),a.stdin.end()})}var d=r(4234);function h(e){return/sign(ed)? ?in|log(ged)? ?in|re-?auth|authenticat|authori[sz]|reconnect|refused the connection|expired|token/i.test(e)?"auth":/no slack|not (available|configured|connected|installed)|don'?t have (access to )?(a |the )?slack|no .*slack (tool|connector)/i.test(e)?"missing":"other"}class u extends Error{constructor(e,t){super(e),this.problem=t}}let m=(e,t=d.B9)=>(0,i.join)(a.Q,t===d.B9?`${e}.json`:`${e}.${t.replace(/[^\w-]/g,"")}.json`);function p(e="claude-haiku-5-5",t=d.B9){let r=d.b9.get(t)??d.b9.get(d.B9);return(0,n.mkdirSync)(a.Q,{recursive:!0}),{cwd:a.Q,configDir:r?.configDir??null,model:e,extraEnv:g(r?.configDir??null)}}let g=e=>e?{ENABLE_CLAUDEAI_MCP_SERVERS:"false"}:void 0;async function f(e=!1,t=d.B9){if(!e)try{let e=JSON.parse((0,n.readFileSync)(m("slack-channels",t),"utf-8"));if(Date.now()-e.fetchedAt<864e5&&e.channels?.length)return e}catch{}let{result:r}=await c('Use the Slack connector to list every Slack channel I am a member of (public and private, not DMs). Page through all results. Respond with ONLY a JSON array, no prose: [{"id": "C123", "name": "channel-name"}, ...]',p(void 0,t)),s=function(e){let t=e.indexOf("["),r=e.lastIndexOf("]");if(-1===t||r<=t)return[];try{let n=JSON.parse(e.slice(t,r+1));return(Array.isArray(n)?n:[]).filter(e=>!!e&&"string"==typeof e.name).map(e=>({id:String(e.id??""),name:e.name.replace(/^#/,"")})).sort((e,t)=>e.name.localeCompare(t.name))}catch{return[]}}(r);if(!s.length)throw new u(r.trim().slice(0,300)||"No channels came back",h(r));let i={channels:s,fetchedAt:Date.now()};return(0,n.writeFileSync)(m("slack-channels",t),JSON.stringify(i)),i}function y(e){return e.replace(/^#{1,6}\s+(.*)$/gm,"*$1*").replace(/\*\*([^*]+)\*\*/g,"*$1*").replace(/^(\s*)[-*]\s+/gm,"$1• ").trim()}async function w(e,t,r=d.B9){let n=e.id?`${e.id} (#${e.name})`:`#${e.name}`,{result:s}=await c(`Use the Slack connector to post the message below to the Slack channel ${n}. Post it exactly as written, as one message, without changes or additions. Reply with only "OK <the posted message permalink>" when posted, or "FAILED: <reason>".
2
2
 
3
3
  <message>
4
4
  `+t+"\n</message>",p(void 0,r)),i=s.trim();if(!/^OK\b/i.test(i))throw Error(i.replace(/^FAILED:?\s*/i,"")||"Slack did not confirm the post");return{permalink:i.match(/https:\/\/\S+slack\.com\/archives\/\S+/)?.[0]??null}}async function S(e=7,t=d.B9){let{result:r}=await c(`Use the Slack connector. Find messages from the last ${e} days that @-mention me (the signed-in Slack user), and direct messages sent to me. Skip bot and automated messages. At most 40, newest first. Respond with ONLY a JSON array, no prose: [{"permalink": "https://…slack.com/archives/…", "channel": "channel name, or the person for a DM", "author": "display name", "text": "the message text", "isDm": false}]`,{...p("claude-sonnet-5-5",t),timeoutMs:24e4}),n=function(e){let t=e.indexOf("["),r=e.lastIndexOf("]");if(-1===t||r<=t)return[];try{let n=JSON.parse(e.slice(t,r+1)),s=new Set;return(Array.isArray(n)?n:[]).filter(e=>"string"==typeof e?.permalink&&/slack\.com\/archives\//.test(e.permalink)&&!s.has(e.permalink)&&!!s.add(e.permalink)).map(e=>({permalink:e.permalink,channel:String(e.channel??"").replace(/^#/,""),author:String(e.author??""),text:String(e.text??"").slice(0,2e3),time:function(e){let t=e.match(/\/p(\d{10})(\d{6})/);return t?new Date(1e3*Number(t[1])).toISOString():""}(e.permalink),isDm:!!e.isDm,checked:!1})).sort((e,t)=>t.time.localeCompare(e.time))}catch{return[]}}(r);if(!n.length&&!/^\s*\[\s*\]\s*$/.test(r.replace(/```(json)?/g,"")))throw new u(r.trim().slice(0,300),h(r));return n}async function k(e=d.B9){try{return JSON.parse((0,n.readFileSync)(m("slack-me",e),"utf-8"))}catch{}let{result:t}=await c('Use the Slack connector to look up the profile of the signed-in Slack user (me). Respond with ONLY JSON: {"id": "U…", "name": "display name"}',p(void 0,e)),r=t.match(/\{[\s\S]*\}/),s=r?JSON.parse(r[0]):null;if(!s?.id)throw new u(t.trim().slice(0,300)||"Could not find your Slack user",h(t));return(0,n.writeFileSync)(m("slack-me",e),JSON.stringify(s)),s}async function O(e,t,r=d.B9){let n=e.isDm?"This is a direct message: read the messages in that same DM conversation that come AFTER it (not just thread replies).":"Read its thread replies, and also the next messages in the channel in case I answered there.",{result:s}=await c(`Use the Slack connector. I am Slack user ${t.id} (${t.name}). Look at the Slack message at ${e.permalink}. ${n} Decide whether I (${t.id}) already answered it after it was posted, or reacted to it with ✅ / white_check_mark. Respond with ONLY JSON: {"answered": true or false, "reacted": true or false, "evidence": "the exact text of my reply, or empty"}`,{...p(void 0,r),timeoutMs:12e4});return function(e){let t=e.match(/\{[\s\S]*\}/);if(!t)throw Error("Unreadable answer check");let r=JSON.parse(t[0]),n="string"==typeof r.evidence&&r.evidence.trim()?r.evidence.trim():null;return{answered:!0===r.answered&&(!!n||!0===r.reacted),evidence:n}}(s).answered}async function A(e,t,r=d.B9){let{result:n}=await c(`Use the Slack connector to reply in the thread of the Slack message at ${e}. Post the reply below exactly as written, as one message. Reply with only "OK" when posted, or "FAILED: <reason>".
@@ -1 +1 @@
1
- exports.id=621,exports.ids=[621],exports.modules={338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION:function(){return n},FLIGHT_PARAMETERS:function(){return s},NEXT_DID_POSTPONE_HEADER:function(){return l},NEXT_ROUTER_PREFETCH_HEADER:function(){return o},NEXT_ROUTER_STATE_TREE:function(){return i},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_URL:function(){return a},RSC_CONTENT_TYPE_HEADER:function(){return u},RSC_HEADER:function(){return r}});let r="RSC",n="Next-Action",i="Next-Router-State-Tree",o="Next-Router-Prefetch",a="Next-Url",u="text/x-component",s=[[r],[i],[o]],c="_rsc",l="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7255:e=>{(()=>{"use strict";"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var t={};(()=>{t.parse=function(t,r){if("string"!=typeof t)throw TypeError("argument str must be a string");for(var i={},o=t.split(n),a=(r||{}).decode||e,u=0;u<o.length;u++){var s=o[u],c=s.indexOf("=");if(!(c<0)){var l=s.substr(0,c).trim(),f=s.substr(++c,s.length).trim();'"'==f[0]&&(f=f.slice(1,-1)),void 0==i[l]&&(i[l]=function(e,t){try{return t(e)}catch(t){return e}}(f,a))}}return i},t.serialize=function(e,t,n){var o=n||{},a=o.encode||r;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!i.test(e))throw TypeError("argument name is invalid");var u=a(t);if(u&&!i.test(u))throw TypeError("argument val is invalid");var s=e+"="+u;if(null!=o.maxAge){var c=o.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(c)}if(o.domain){if(!i.test(o.domain))throw TypeError("option domain is invalid");s+="; Domain="+o.domain}if(o.path){if(!i.test(o.path))throw TypeError("option path is invalid");s+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw TypeError("option expires is invalid");s+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:case"strict":s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"none":s+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return s};var e=decodeURIComponent,r=encodeURIComponent,n=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/})(),e.exports=t})()},1792:(e,t)=>{"use strict";function r(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"===n||"+"===n||"?"===n){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if("\\"===n){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if("{"===n){t.push({type:"OPEN",index:r,value:e[r++]});continue}if("}"===n){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(":"===n){for(var i="",o=r+1;o<e.length;){var a=e.charCodeAt(o);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){i+=e[o++];continue}break}if(!i)throw TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:i}),r=o;continue}if("("===n){var u=1,s="",o=r+1;if("?"===e[o])throw TypeError('Pattern cannot start with "?" at '+o);for(;o<e.length;){if("\\"===e[o]){s+=e[o++]+e[o++];continue}if(")"===e[o]){if(0==--u){o++;break}}else if("("===e[o]&&(u++,"?"!==e[o+1]))throw TypeError("Capturing groups are not allowed at "+o);s+=e[o++]}if(u)throw TypeError("Unbalanced pattern at "+r);if(!s)throw TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:s}),r=o;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,a="[^"+o(t.delimiter||"/#?")+"]+?",u=[],s=0,c=0,l="",f=function(e){if(c<r.length&&r[c].type===e)return r[c++].value},p=function(e){var t=f(e);if(void 0!==t)return t;var n=r[c];throw TypeError("Unexpected "+n.type+" at "+n.index+", expected "+e)},d=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};c<r.length;){var m=f("CHAR"),g=f("NAME"),h=f("PATTERN");if(g||h){var E=m||"";-1===i.indexOf(E)&&(l+=E,E=""),l&&(u.push(l),l=""),u.push({name:g||s++,prefix:E,suffix:"",pattern:h||a,modifier:f("MODIFIER")||""});continue}var y=m||f("ESCAPED_CHAR");if(y){l+=y;continue}if(l&&(u.push(l),l=""),f("OPEN")){var E=d(),R=f("NAME")||"",_=f("PATTERN")||"",v=d();p("CLOSE"),u.push({name:R||(_?s++:""),pattern:R&&!_?a:_,prefix:E,suffix:v,modifier:f("MODIFIER")||""});continue}p("END")}return u}function n(e,t){void 0===t&&(t={});var r=a(t),n=t.encode,i=void 0===n?function(e){return e}:n,o=t.validate,u=void 0===o||o,s=e.map(function(e){if("object"==typeof e)return RegExp("^(?:"+e.pattern+")$",r)});return function(t){for(var r="",n=0;n<e.length;n++){var o=e[n];if("string"==typeof o){r+=o;continue}var a=t?t[o.name]:void 0,c="?"===o.modifier||"*"===o.modifier,l="*"===o.modifier||"+"===o.modifier;if(Array.isArray(a)){if(!l)throw TypeError('Expected "'+o.name+'" to not repeat, but got an array');if(0===a.length){if(c)continue;throw TypeError('Expected "'+o.name+'" to not be empty')}for(var f=0;f<a.length;f++){var p=i(a[f],o);if(u&&!s[n].test(p))throw TypeError('Expected all "'+o.name+'" to match "'+o.pattern+'", but got "'+p+'"');r+=o.prefix+p+o.suffix}continue}if("string"==typeof a||"number"==typeof a){var p=i(String(a),o);if(u&&!s[n].test(p))throw TypeError('Expected "'+o.name+'" to match "'+o.pattern+'", but got "'+p+'"');r+=o.prefix+p+o.suffix;continue}if(!c){var d=l?"an array":"a string";throw TypeError('Expected "'+o.name+'" to be '+d)}}return r}}function i(e,t,r){void 0===r&&(r={});var n=r.decode,i=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var o=n[0],a=n.index,u=Object.create(null),s=1;s<n.length;s++)!function(e){if(void 0!==n[e]){var r=t[e-1];"*"===r.modifier||"+"===r.modifier?u[r.name]=n[e].split(r.prefix+r.suffix).map(function(e){return i(e,r)}):u[r.name]=i(n[e],r)}}(s);return{path:o,index:a,params:u}}}function o(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function a(e){return e&&e.sensitive?"":"i"}function u(e,t,r){void 0===r&&(r={});for(var n=r.strict,i=void 0!==n&&n,u=r.start,s=r.end,c=r.encode,l=void 0===c?function(e){return e}:c,f="["+o(r.endsWith||"")+"]|$",p="["+o(r.delimiter||"/#?")+"]",d=void 0===u||u?"^":"",m=0;m<e.length;m++){var g=e[m];if("string"==typeof g)d+=o(l(g));else{var h=o(l(g.prefix)),E=o(l(g.suffix));if(g.pattern){if(t&&t.push(g),h||E){if("+"===g.modifier||"*"===g.modifier){var y="*"===g.modifier?"?":"";d+="(?:"+h+"((?:"+g.pattern+")(?:"+E+h+"(?:"+g.pattern+"))*)"+E+")"+y}else d+="(?:"+h+"("+g.pattern+")"+E+")"+g.modifier}else d+="("+g.pattern+")"+g.modifier}else d+="(?:"+h+E+")"+g.modifier}}if(void 0===s||s)i||(d+=p+"?"),d+=r.endsWith?"(?="+f+")":"$";else{var R=e[e.length-1],_="string"==typeof R?p.indexOf(R[R.length-1])>-1:void 0===R;i||(d+="(?:"+p+"(?="+f+"))?"),_||(d+="(?="+p+"|"+f+")")}return new RegExp(d,a(r))}function s(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}(e,t):Array.isArray(e)?RegExp("(?:"+e.map(function(e){return s(e,t,n).source}).join("|")+")",a(n)):u(r(e,n),t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=r,t.compile=function(e,t){return n(r(e,t),t)},t.tokensToFunction=n,t.match=function(e,t){var r=[];return i(s(e,r,t),r,t)},t.regexpToFunction=i,t.tokensToRegexp=u,t.pathToRegexp=s},6621:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{fillMetadataSegment:function(){return f},normalizeMetadataRoute:function(){return p}});let n=r(616),i=function(e){return e&&e.__esModule?e:{default:e}}(r(9416)),o=r(7262),a=r(5679),u=r(8785),s=r(8168),c=r(1040);function l(e){let t="";return(e.includes("(")&&e.includes(")")||e.includes("@"))&&(t=(0,u.djb2Hash)(e).toString(36).slice(0,6)),t}function f(e,t,r){let n=(0,s.normalizeAppPath)(e),u=(0,a.getNamedRouteRegex)(n,!1),f=(0,o.interpolateDynamicPath)(n,t,u),p=l(e),d=p?`-${p}`:"",{name:m,ext:g}=i.default.parse(r);return(0,c.normalizePathSep)(i.default.join(f,`${m}${d}${g}`))}function p(e){if(!(0,n.isMetadataRoute)(e))return e;let t=e,r="";if("/robots"===e?t+=".txt":"/manifest"===e?t+=".webmanifest":e.endsWith("/sitemap")?t+=".xml":r=l(e.slice(0,-(i.default.basename(e).length+1))),!t.endsWith("/route")){let{dir:o,name:a,ext:u}=i.default.parse(t),s=(0,n.isStaticMetadataRoute)(e);t=i.default.posix.join(o,`${a}${r?`-${r}`:""}${u}`,s?"":"[[...__metadata_id__]]","route")}return t}},616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{STATIC_METADATA_IMAGES:function(){return i},isMetadataRoute:function(){return l},isMetadataRouteFile:function(){return u},isStaticMetadataRoute:function(){return c},isStaticMetadataRouteFile:function(){return s}});let n=r(1040),i={icon:{filename:"icon",extensions:["ico","jpg","jpeg","png","svg"]},apple:{filename:"apple-icon",extensions:["jpg","jpeg","png"]},favicon:{filename:"favicon",extensions:["ico"]},openGraph:{filename:"opengraph-image",extensions:["jpg","jpeg","png","gif"]},twitter:{filename:"twitter-image",extensions:["jpg","jpeg","png","gif"]}},o=["js","jsx","ts","tsx"],a=e=>`(?:${e.join("|")})`;function u(e,t,r){let o=[RegExp(`^[\\\\/]robots${r?`\\.${a(t.concat("txt"))}$`:""}`),RegExp(`^[\\\\/]manifest${r?`\\.${a(t.concat("webmanifest","json"))}$`:""}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${r?`\\.${a(t.concat("xml"))}$`:""}`),RegExp(`[\\\\/]${i.icon.filename}\\d?${r?`\\.${a(t.concat(i.icon.extensions))}$`:""}`),RegExp(`[\\\\/]${i.apple.filename}\\d?${r?`\\.${a(t.concat(i.apple.extensions))}$`:""}`),RegExp(`[\\\\/]${i.openGraph.filename}\\d?${r?`\\.${a(t.concat(i.openGraph.extensions))}$`:""}`),RegExp(`[\\\\/]${i.twitter.filename}\\d?${r?`\\.${a(t.concat(i.twitter.extensions))}$`:""}`)],u=(0,n.normalizePathSep)(e);return o.some(e=>e.test(u))}function s(e){return u(e,[],!0)}function c(e){return"/robots"===e||"/manifest"===e||s(e)}function l(e){let t=e.replace(/^\/?app\//,"").replace(/\/route$/,"");return"/"!==t[0]&&(t="/"+t),!t.endsWith("/page")&&u(t,o,!1)}},6975:(e,t,r)=>{"use strict";function n(e){return function(){let{cookie:t}=e;if(!t)return{};let{parse:n}=r(7255);return n(Array.isArray(t)?t.join("; "):t)}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getCookieParser",{enumerable:!0,get:function(){return n}})},1586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return i},extractInterceptionRouteInformation:function(){return a},isInterceptionRouteAppPath:function(){return o}});let n=r(8168),i=["(..)(..)","(.)","(..)","(...)"];function o(e){return void 0!==e.split("/").find(e=>i.find(t=>e.startsWith(t)))}function a(e){let t,r,o;for(let n of e.split("/"))if(r=i.find(e=>n.startsWith(e))){[t,o]=e.split(r,2);break}if(!t||!r||!o)throw Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(t=(0,n.normalizeAppPath)(t),r){case"(.)":o="/"===t?`/${o}`:t+"/"+o;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);o=t.split("/").slice(0,-1).concat(o).join("/");break;case"(...)":o="/"+o;break;case"(..)(..)":let a=t.split("/");if(a.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);o=a.slice(0,-2).concat(o).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:o}}},7262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getUtils:function(){return g},interpolateDynamicPath:function(){return d},normalizeDynamicRouteParams:function(){return m},normalizeVercelUrl:function(){return p}});let n=r(7360),i=r(5014),o=r(3707),a=r(5679),u=r(3525),s=r(5257),c=r(7847),l=r(8168),f=r(1943);function p(e,t,r,i,o){if(i&&t&&o){let t=(0,n.parse)(e.url,!0);for(let e of(delete t.search,Object.keys(t.query))){let n=e!==f.NEXT_QUERY_PARAM_PREFIX&&e.startsWith(f.NEXT_QUERY_PARAM_PREFIX),i=e!==f.NEXT_INTERCEPTION_MARKER_PREFIX&&e.startsWith(f.NEXT_INTERCEPTION_MARKER_PREFIX);(n||i||(r||Object.keys(o.groups)).includes(e))&&delete t.query[e]}e.url=(0,n.format)(t)}}function d(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let{optional:i,repeat:o}=r.groups[n],a=`[${o?"...":""}${n}]`;i&&(a=`[${a}]`);let u=e.indexOf(a);if(u>-1){let r;let i=t[n];r=Array.isArray(i)?i.map(e=>e&&encodeURIComponent(e)).join("/"):i?encodeURIComponent(i):"",e=e.slice(0,u)+r+e.slice(u+a.length)}}return e}function m(e,t,r,n){let i=!0;return r?{params:e=Object.keys(r.groups).reduce((o,a)=>{let u=e[a];"string"==typeof u&&(u=(0,l.normalizeRscURL)(u)),Array.isArray(u)&&(u=u.map(e=>("string"==typeof e&&(e=(0,l.normalizeRscURL)(e)),e)));let s=n[a],c=r.groups[a].optional;return((Array.isArray(s)?s.some(e=>Array.isArray(u)?u.some(t=>t.includes(e)):null==u?void 0:u.includes(e)):null==u?void 0:u.includes(s))||void 0===u&&!(c&&t))&&(i=!1),c&&(!u||Array.isArray(u)&&1===u.length&&("index"===u[0]||u[0]===`[[...${a}]]`))&&(u=void 0,delete e[a]),u&&"string"==typeof u&&r.groups[a].repeat&&(u=u.split("/")),u&&(o[a]=u),o},{}),hasValidParams:i}:{params:e,hasValidParams:!1}}function g({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:l,trailingSlash:g,caseSensitive:h}){let E,y,R;return l&&(E=(0,a.getNamedRouteRegex)(e,!1),R=(y=(0,u.getRouteMatcher)(E))(e)),{handleRewrites:function(a,u){let f={},p=u.pathname,d=n=>{let c=(0,o.getPathMatch)(n.source+(g?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!h})(u.pathname);if((n.has||n.missing)&&c){let e=(0,s.matchHas)(a,u.query,n.has,n.missing);e?Object.assign(c,e):c=!1}if(c){let{parsedDestination:o,destQuery:a}=(0,s.prepareDestination)({appendParamsToQuery:!0,destination:n.destination,params:c,query:u.query});if(o.protocol)return!0;if(Object.assign(f,a,c),Object.assign(u.query,o.query),delete o.query,Object.assign(u,o),p=u.pathname,r&&(p=p.replace(RegExp(`^${r}`),"")||"/"),t){let e=(0,i.normalizeLocalePath)(p,t.locales);p=e.pathname,u.query.nextInternalLocale=e.detectedLocale||c.nextInternalLocale}if(p===e)return!0;if(l&&y){let e=y(p);if(e)return u.query={...u.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])d(e);if(p!==e){let t=!1;for(let e of n.afterFiles||[])if(t=d(e))break;if(!t&&!(()=>{let t=(0,c.removeTrailingSlash)(p||"");return t===(0,c.removeTrailingSlash)(e)||(null==y?void 0:y(t))})()){for(let e of n.fallback||[])if(t=d(e))break}}return f},defaultRouteRegex:E,dynamicRouteMatcher:y,defaultRouteMatches:R,getParamsFromRouteMatches:function(e,r,n){return(0,u.getRouteMatcher)(function(){let{groups:e,routeKeys:i}=E;return{re:{exec:o=>{let a=Object.fromEntries(new URLSearchParams(o)),u=t&&n&&a["1"]===n;for(let e of Object.keys(a)){let t=a[e];e!==f.NEXT_QUERY_PARAM_PREFIX&&e.startsWith(f.NEXT_QUERY_PARAM_PREFIX)&&(a[e.substring(f.NEXT_QUERY_PARAM_PREFIX.length)]=t,delete a[e])}let s=Object.keys(i||{}),c=e=>{if(t){let i=Array.isArray(e),o=i?e[0]:e;if("string"==typeof o&&t.locales.some(e=>e.toLowerCase()===o.toLowerCase()&&(n=e,r.locale=n,!0)))return i&&e.splice(0,1),!i||0===e.length}return!1};return s.every(e=>a[e])?s.reduce((t,r)=>{let n=null==i?void 0:i[r];return n&&!c(a[r])&&(t[e[n].pos]=a[r]),t},{}):Object.keys(a).reduce((e,t)=>{if(!c(a[t])){let r=t;return u&&(r=parseInt(t,10)-1+""),Object.assign(e,{[r]:a[t]})}return e},{})}},groups:e}}())(e.headers["x-now-route-matches"])},normalizeDynamicRouteParams:(e,t)=>m(e,t,E,R),normalizeVercelUrl:(e,t,r)=>p(e,t,r,l,E),interpolateDynamicPath:(e,t)=>d(e,t,E)}}},4080:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return i}});let r=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function i(e){return r.test(e)?e.replace(n,"\\$&"):e}},8785:(e,t)=>{"use strict";function r(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)&4294967295;return t>>>0}function n(e){return r(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{djb2Hash:function(){return r},hexHash:function(){return n}})},5014:(e,t)=>{"use strict";function r(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return r}})},9416:(e,t,r)=>{"use strict";let n;n=r(5315),e.exports=n},1555:(e,t)=>{"use strict";function r(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return r}})},1040:(e,t)=>{"use strict";function r(e){return e.replace(/\\/g,"/")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathSep",{enumerable:!0,get:function(){return r}})},8168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return a}});let n=r(1555),i=r(5406);function o(e){return(0,n.ensureLeadingSlash)(e.split("/").reduce((e,t,r,n)=>!t||(0,i.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t,""))}function a(e){return e.replace(/\.rsc($|\?)/,"$1")}},1942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseRelativeUrl",{enumerable:!0,get:function(){return i}}),r(2569);let n=r(4869);function i(e,t){let r=new URL("http://n"),i=t?new URL(t,r):e.startsWith(".")?new URL("http://n"):r,{pathname:o,searchParams:a,search:u,hash:s,href:c,origin:l}=new URL(e,i);if(l!==r.origin)throw Error("invariant: invalid relative URL, router received "+e);return{pathname:o,query:(0,n.searchParamsToUrlQuery)(a),search:u,hash:s,href:c.slice(r.origin.length)}}},3226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseUrl",{enumerable:!0,get:function(){return o}});let n=r(4869),i=r(1942);function o(e){if(e.startsWith("/"))return(0,i.parseRelativeUrl)(e);let t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:(0,n.searchParamsToUrlQuery)(t.searchParams),search:t.search}}},3707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getPathMatch",{enumerable:!0,get:function(){return i}});let n=r(1792);function i(e,t){let r=[],i=(0,n.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof(null==t?void 0:t.sensitive)&&t.sensitive,strict:null==t?void 0:t.strict}),o=(0,n.regexpToFunction)((null==t?void 0:t.regexModifier)?new RegExp(t.regexModifier(i.source),i.flags):i,r);return(e,n)=>{if("string"!=typeof e)return!1;let i=o(e);if(!i)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete i.params[e.name];return{...n,...i.params}}}},5257:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{compileNonPath:function(){return f},matchHas:function(){return l},prepareDestination:function(){return p}});let n=r(1792),i=r(4080),o=r(3226),a=r(1586),u=r(338),s=r(6975);function c(e){return e.replace(/__ESC_COLON_/gi,":")}function l(e,t,r,n){void 0===r&&(r=[]),void 0===n&&(n=[]);let i={},o=r=>{let n;let o=r.key;switch(r.type){case"header":o=o.toLowerCase(),n=e.headers[o];break;case"cookie":n="cookies"in e?e.cookies[r.key]:(0,s.getCookieParser)(e.headers)()[r.key];break;case"query":n=t[o];break;case"host":{let{host:t}=(null==e?void 0:e.headers)||{};n=null==t?void 0:t.split(":",1)[0].toLowerCase()}}if(!r.value&&n)return i[function(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);(n>64&&n<91||n>96&&n<123)&&(t+=e[r])}return t}(o)]=n,!0;if(n){let e=RegExp("^"+r.value+"$"),t=Array.isArray(n)?n.slice(-1)[0].match(e):n.match(e);if(t)return Array.isArray(t)&&(t.groups?Object.keys(t.groups).forEach(e=>{i[e]=t.groups[e]}):"host"===r.type&&t[0]&&(i.host=t[0])),!0}return!1};return!!r.every(e=>o(e))&&!n.some(e=>o(e))&&i}function f(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(":"+r)&&(e=e.replace(RegExp(":"+r+"\\*","g"),":"+r+"--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":"+r+"\\?","g"),":"+r+"--ESCAPED_PARAM_QUESTION").replace(RegExp(":"+r+"\\+","g"),":"+r+"--ESCAPED_PARAM_PLUS").replace(RegExp(":"+r+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+r));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,n.compile)("/"+e,{validate:!1})(t).slice(1)}function p(e){let t;let r=Object.assign({},e.query);delete r.__nextLocale,delete r.__nextDefaultLocale,delete r.__nextDataReq,delete r.__nextInferredLocaleFromDefault,delete r[u.NEXT_RSC_UNION_QUERY];let s=e.destination;for(let t of Object.keys({...e.params,...r}))s=s.replace(RegExp(":"+(0,i.escapeStringRegexp)(t),"g"),"__ESC_COLON_"+t);let l=(0,o.parseUrl)(s),p=l.query,d=c(""+l.pathname+(l.hash||"")),m=c(l.hostname||""),g=[],h=[];(0,n.pathToRegexp)(d,g),(0,n.pathToRegexp)(m,h);let E=[];g.forEach(e=>E.push(e.name)),h.forEach(e=>E.push(e.name));let y=(0,n.compile)(d,{validate:!1}),R=(0,n.compile)(m,{validate:!1});for(let[t,r]of Object.entries(p))Array.isArray(r)?p[t]=r.map(t=>f(c(t),e.params)):"string"==typeof r&&(p[t]=f(c(r),e.params));let _=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!_.some(e=>E.includes(e)))for(let t of _)t in p||(p[t]=e.params[t]);if((0,a.isInterceptionRouteAppPath)(d))for(let t of d.split("/")){let r=a.INTERCEPTION_ROUTE_MARKERS.find(e=>t.startsWith(e));if(r){e.params["0"]=r;break}}try{let[r,n]=(t=y(e.params)).split("#",2);l.hostname=R(e.params),l.pathname=r,l.hash=(n?"#":"")+(n||""),delete l.search}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw e}return l.query={...r,...l.query},{newUrl:t,destQuery:p,parsedDestination:l}}},4869:(e,t)=>{"use strict";function r(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t}function n(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[r,i]=e;Array.isArray(i)?i.forEach(e=>t.append(r,n(e))):t.set(r,n(i))}),t}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.forEach(t=>{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,r)=>e.append(r,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return o},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return i}})},7847:(e,t)=>{"use strict";function r(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return r}})},3525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return i}});let n=r(2569);function i(e){let{re:t,groups:r}=e;return e=>{let i=t.exec(e);if(!i)return!1;let o=e=>{try{return decodeURIComponent(e)}catch(e){throw new n.DecodeError("failed to decode param")}},a={};return Object.keys(r).forEach(e=>{let t=r[e],n=i[t.pos];void 0!==n&&(a[e]=~n.indexOf("/")?n.split("/").map(e=>o(e)):t.repeat?[o(n)]:o(n))}),a}}},5679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getNamedMiddlewareRegex:function(){return d},getNamedRouteRegex:function(){return p},getRouteRegex:function(){return c},parseParameter:function(){return u}});let n=r(1943),i=r(1586),o=r(4080),a=r(7847);function u(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function s(e){let t=(0,a.removeTrailingSlash)(e).slice(1).split("/"),r={},n=1;return{parameterizedRoute:t.map(e=>{let t=i.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&a){let{key:e,optional:i,repeat:s}=u(a[1]);return r[e]={pos:n++,repeat:s,optional:i},"/"+(0,o.escapeStringRegexp)(t)+"([^/]+?)"}if(!a)return"/"+(0,o.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:i}=u(a[1]);return r[e]={pos:n++,repeat:t,optional:i},t?i?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}function c(e){let{parameterizedRoute:t,groups:r}=s(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:r}}function l(e){let{interceptionMarker:t,getSafeRouteKey:r,segment:n,routeKeys:i,keyPrefix:a}=e,{key:s,optional:c,repeat:l}=u(n),f=s.replace(/\W/g,"");a&&(f=""+a+f);let p=!1;(0===f.length||f.length>30)&&(p=!0),isNaN(parseInt(f.slice(0,1)))||(p=!0),p&&(f=r()),a?i[f]=""+a+s:i[f]=s;let d=t?(0,o.escapeStringRegexp)(t):"";return l?c?"(?:/"+d+"(?<"+f+">.+?))?":"/"+d+"(?<"+f+">.+?)":"/"+d+"(?<"+f+">[^/]+?)"}function f(e,t){let r;let u=(0,a.removeTrailingSlash)(e).slice(1).split("/"),s=(r=0,()=>{let e="",t=++r;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),c={};return{namedParameterizedRoute:u.map(e=>{let r=i.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(r&&a){let[r]=e.split(a[0]);return l({getSafeRouteKey:s,interceptionMarker:r,segment:a[1],routeKeys:c,keyPrefix:t?n.NEXT_INTERCEPTION_MARKER_PREFIX:void 0})}return a?l({getSafeRouteKey:s,segment:a[1],routeKeys:c,keyPrefix:t?n.NEXT_QUERY_PARAM_PREFIX:void 0}):"/"+(0,o.escapeStringRegexp)(e)}).join(""),routeKeys:c}}function p(e,t){let r=f(e,t);return{...c(e),namedRegex:"^"+r.namedParameterizedRoute+"(?:/)?$",routeKeys:r.routeKeys}}function d(e,t){let{parameterizedRoute:r}=s(e),{catchAll:n=!0}=t;if("/"===r)return{namedRegex:"^/"+(n?".*":"")+"$"};let{namedParameterizedRoute:i}=f(e,!1);return{namedRegex:"^"+i+(n?"(?:(/.*)?)":"")+"$"}}},5406:(e,t)=>{"use strict";function r(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DEFAULT_SEGMENT_KEY:function(){return i},PAGE_SEGMENT_KEY:function(){return n},isGroupSegment:function(){return r}});let n="__PAGE__",i="__DEFAULT__"},2569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return m},MiddlewareNotFoundError:function(){return y},MissingStaticPage:function(){return E},NormalizeError:function(){return g},PageNotFoundError:function(){return h},SP:function(){return p},ST:function(){return d},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return s},getLocationOrigin:function(){return a},getURL:function(){return u},isAbsoluteUrl:function(){return o},isResSent:function(){return c},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return l},stringifyError:function(){return R}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return r||(r=!0,t=e(...i)),t}}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>i.test(e);function a(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function u(){let{href:e}=window.location,t=a();return e.substring(t.length)}function s(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function c(e){return e.finished||e.headersSent}function l(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&c(r))return n;if(!n)throw Error('"'+s(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.');return n}let p="undefined"!=typeof performance,d=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class m extends Error{}class g extends Error{}class h extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class E extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class y extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function R(e){return JSON.stringify({message:e.message,stack:e.stack})}}};
1
+ exports.id=621,exports.ids=[621],exports.modules={338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION:function(){return n},FLIGHT_PARAMETERS:function(){return s},NEXT_DID_POSTPONE_HEADER:function(){return l},NEXT_ROUTER_PREFETCH_HEADER:function(){return o},NEXT_ROUTER_STATE_TREE:function(){return i},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_URL:function(){return a},RSC_CONTENT_TYPE_HEADER:function(){return u},RSC_HEADER:function(){return r}});let r="RSC",n="Next-Action",i="Next-Router-State-Tree",o="Next-Router-Prefetch",a="Next-Url",u="text/x-component",s=[[r],[i],[o]],c="_rsc",l="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7255:e=>{(()=>{"use strict";"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var t={};(()=>{t.parse=function(t,r){if("string"!=typeof t)throw TypeError("argument str must be a string");for(var i={},o=t.split(n),a=(r||{}).decode||e,u=0;u<o.length;u++){var s=o[u],c=s.indexOf("=");if(!(c<0)){var l=s.substr(0,c).trim(),f=s.substr(++c,s.length).trim();'"'==f[0]&&(f=f.slice(1,-1)),void 0==i[l]&&(i[l]=function(e,t){try{return t(e)}catch(t){return e}}(f,a))}}return i},t.serialize=function(e,t,n){var o=n||{},a=o.encode||r;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!i.test(e))throw TypeError("argument name is invalid");var u=a(t);if(u&&!i.test(u))throw TypeError("argument val is invalid");var s=e+"="+u;if(null!=o.maxAge){var c=o.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(c)}if(o.domain){if(!i.test(o.domain))throw TypeError("option domain is invalid");s+="; Domain="+o.domain}if(o.path){if(!i.test(o.path))throw TypeError("option path is invalid");s+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw TypeError("option expires is invalid");s+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:case"strict":s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"none":s+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return s};var e=decodeURIComponent,r=encodeURIComponent,n=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/})(),e.exports=t})()},1792:(e,t)=>{"use strict";function r(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"===n||"+"===n||"?"===n){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if("\\"===n){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if("{"===n){t.push({type:"OPEN",index:r,value:e[r++]});continue}if("}"===n){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(":"===n){for(var i="",o=r+1;o<e.length;){var a=e.charCodeAt(o);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){i+=e[o++];continue}break}if(!i)throw TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:i}),r=o;continue}if("("===n){var u=1,s="",o=r+1;if("?"===e[o])throw TypeError('Pattern cannot start with "?" at '+o);for(;o<e.length;){if("\\"===e[o]){s+=e[o++]+e[o++];continue}if(")"===e[o]){if(0==--u){o++;break}}else if("("===e[o]&&(u++,"?"!==e[o+1]))throw TypeError("Capturing groups are not allowed at "+o);s+=e[o++]}if(u)throw TypeError("Unbalanced pattern at "+r);if(!s)throw TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:s}),r=o;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,a="[^"+o(t.delimiter||"/#?")+"]+?",u=[],s=0,c=0,l="",f=function(e){if(c<r.length&&r[c].type===e)return r[c++].value},p=function(e){var t=f(e);if(void 0!==t)return t;var n=r[c];throw TypeError("Unexpected "+n.type+" at "+n.index+", expected "+e)},d=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};c<r.length;){var m=f("CHAR"),g=f("NAME"),h=f("PATTERN");if(g||h){var E=m||"";-1===i.indexOf(E)&&(l+=E,E=""),l&&(u.push(l),l=""),u.push({name:g||s++,prefix:E,suffix:"",pattern:h||a,modifier:f("MODIFIER")||""});continue}var y=m||f("ESCAPED_CHAR");if(y){l+=y;continue}if(l&&(u.push(l),l=""),f("OPEN")){var E=d(),R=f("NAME")||"",_=f("PATTERN")||"",v=d();p("CLOSE"),u.push({name:R||(_?s++:""),pattern:R&&!_?a:_,prefix:E,suffix:v,modifier:f("MODIFIER")||""});continue}p("END")}return u}function n(e,t){void 0===t&&(t={});var r=a(t),n=t.encode,i=void 0===n?function(e){return e}:n,o=t.validate,u=void 0===o||o,s=e.map(function(e){if("object"==typeof e)return RegExp("^(?:"+e.pattern+")$",r)});return function(t){for(var r="",n=0;n<e.length;n++){var o=e[n];if("string"==typeof o){r+=o;continue}var a=t?t[o.name]:void 0,c="?"===o.modifier||"*"===o.modifier,l="*"===o.modifier||"+"===o.modifier;if(Array.isArray(a)){if(!l)throw TypeError('Expected "'+o.name+'" to not repeat, but got an array');if(0===a.length){if(c)continue;throw TypeError('Expected "'+o.name+'" to not be empty')}for(var f=0;f<a.length;f++){var p=i(a[f],o);if(u&&!s[n].test(p))throw TypeError('Expected all "'+o.name+'" to match "'+o.pattern+'", but got "'+p+'"');r+=o.prefix+p+o.suffix}continue}if("string"==typeof a||"number"==typeof a){var p=i(String(a),o);if(u&&!s[n].test(p))throw TypeError('Expected "'+o.name+'" to match "'+o.pattern+'", but got "'+p+'"');r+=o.prefix+p+o.suffix;continue}if(!c){var d=l?"an array":"a string";throw TypeError('Expected "'+o.name+'" to be '+d)}}return r}}function i(e,t,r){void 0===r&&(r={});var n=r.decode,i=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var o=n[0],a=n.index,u=Object.create(null),s=1;s<n.length;s++)!function(e){if(void 0!==n[e]){var r=t[e-1];"*"===r.modifier||"+"===r.modifier?u[r.name]=n[e].split(r.prefix+r.suffix).map(function(e){return i(e,r)}):u[r.name]=i(n[e],r)}}(s);return{path:o,index:a,params:u}}}function o(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function a(e){return e&&e.sensitive?"":"i"}function u(e,t,r){void 0===r&&(r={});for(var n=r.strict,i=void 0!==n&&n,u=r.start,s=r.end,c=r.encode,l=void 0===c?function(e){return e}:c,f="["+o(r.endsWith||"")+"]|$",p="["+o(r.delimiter||"/#?")+"]",d=void 0===u||u?"^":"",m=0;m<e.length;m++){var g=e[m];if("string"==typeof g)d+=o(l(g));else{var h=o(l(g.prefix)),E=o(l(g.suffix));if(g.pattern){if(t&&t.push(g),h||E){if("+"===g.modifier||"*"===g.modifier){var y="*"===g.modifier?"?":"";d+="(?:"+h+"((?:"+g.pattern+")(?:"+E+h+"(?:"+g.pattern+"))*)"+E+")"+y}else d+="(?:"+h+"("+g.pattern+")"+E+")"+g.modifier}else d+="("+g.pattern+")"+g.modifier}else d+="(?:"+h+E+")"+g.modifier}}if(void 0===s||s)i||(d+=p+"?"),d+=r.endsWith?"(?="+f+")":"$";else{var R=e[e.length-1],_="string"==typeof R?p.indexOf(R[R.length-1])>-1:void 0===R;i||(d+="(?:"+p+"(?="+f+"))?"),_||(d+="(?="+p+"|"+f+")")}return new RegExp(d,a(r))}function s(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return e}(e,t):Array.isArray(e)?RegExp("(?:"+e.map(function(e){return s(e,t,n).source}).join("|")+")",a(n)):u(r(e,n),t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=r,t.compile=function(e,t){return n(r(e,t),t)},t.tokensToFunction=n,t.match=function(e,t){var r=[];return i(s(e,r,t),r,t)},t.regexpToFunction=i,t.tokensToRegexp=u,t.pathToRegexp=s},6621:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{fillMetadataSegment:function(){return f},normalizeMetadataRoute:function(){return p}});let n=r(616),i=function(e){return e&&e.__esModule?e:{default:e}}(r(1293)),o=r(7262),a=r(5679),u=r(8785),s=r(8168),c=r(1040);function l(e){let t="";return(e.includes("(")&&e.includes(")")||e.includes("@"))&&(t=(0,u.djb2Hash)(e).toString(36).slice(0,6)),t}function f(e,t,r){let n=(0,s.normalizeAppPath)(e),u=(0,a.getNamedRouteRegex)(n,!1),f=(0,o.interpolateDynamicPath)(n,t,u),p=l(e),d=p?`-${p}`:"",{name:m,ext:g}=i.default.parse(r);return(0,c.normalizePathSep)(i.default.join(f,`${m}${d}${g}`))}function p(e){if(!(0,n.isMetadataRoute)(e))return e;let t=e,r="";if("/robots"===e?t+=".txt":"/manifest"===e?t+=".webmanifest":e.endsWith("/sitemap")?t+=".xml":r=l(e.slice(0,-(i.default.basename(e).length+1))),!t.endsWith("/route")){let{dir:o,name:a,ext:u}=i.default.parse(t),s=(0,n.isStaticMetadataRoute)(e);t=i.default.posix.join(o,`${a}${r?`-${r}`:""}${u}`,s?"":"[[...__metadata_id__]]","route")}return t}},616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{STATIC_METADATA_IMAGES:function(){return i},isMetadataRoute:function(){return l},isMetadataRouteFile:function(){return u},isStaticMetadataRoute:function(){return c},isStaticMetadataRouteFile:function(){return s}});let n=r(1040),i={icon:{filename:"icon",extensions:["ico","jpg","jpeg","png","svg"]},apple:{filename:"apple-icon",extensions:["jpg","jpeg","png"]},favicon:{filename:"favicon",extensions:["ico"]},openGraph:{filename:"opengraph-image",extensions:["jpg","jpeg","png","gif"]},twitter:{filename:"twitter-image",extensions:["jpg","jpeg","png","gif"]}},o=["js","jsx","ts","tsx"],a=e=>`(?:${e.join("|")})`;function u(e,t,r){let o=[RegExp(`^[\\\\/]robots${r?`\\.${a(t.concat("txt"))}$`:""}`),RegExp(`^[\\\\/]manifest${r?`\\.${a(t.concat("webmanifest","json"))}$`:""}`),RegExp("^[\\\\/]favicon\\.ico$"),RegExp(`[\\\\/]sitemap${r?`\\.${a(t.concat("xml"))}$`:""}`),RegExp(`[\\\\/]${i.icon.filename}\\d?${r?`\\.${a(t.concat(i.icon.extensions))}$`:""}`),RegExp(`[\\\\/]${i.apple.filename}\\d?${r?`\\.${a(t.concat(i.apple.extensions))}$`:""}`),RegExp(`[\\\\/]${i.openGraph.filename}\\d?${r?`\\.${a(t.concat(i.openGraph.extensions))}$`:""}`),RegExp(`[\\\\/]${i.twitter.filename}\\d?${r?`\\.${a(t.concat(i.twitter.extensions))}$`:""}`)],u=(0,n.normalizePathSep)(e);return o.some(e=>e.test(u))}function s(e){return u(e,[],!0)}function c(e){return"/robots"===e||"/manifest"===e||s(e)}function l(e){let t=e.replace(/^\/?app\//,"").replace(/\/route$/,"");return"/"!==t[0]&&(t="/"+t),!t.endsWith("/page")&&u(t,o,!1)}},6975:(e,t,r)=>{"use strict";function n(e){return function(){let{cookie:t}=e;if(!t)return{};let{parse:n}=r(7255);return n(Array.isArray(t)?t.join("; "):t)}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getCookieParser",{enumerable:!0,get:function(){return n}})},1586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return i},extractInterceptionRouteInformation:function(){return a},isInterceptionRouteAppPath:function(){return o}});let n=r(8168),i=["(..)(..)","(.)","(..)","(...)"];function o(e){return void 0!==e.split("/").find(e=>i.find(t=>e.startsWith(t)))}function a(e){let t,r,o;for(let n of e.split("/"))if(r=i.find(e=>n.startsWith(e))){[t,o]=e.split(r,2);break}if(!t||!r||!o)throw Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(t=(0,n.normalizeAppPath)(t),r){case"(.)":o="/"===t?`/${o}`:t+"/"+o;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);o=t.split("/").slice(0,-1).concat(o).join("/");break;case"(...)":o="/"+o;break;case"(..)(..)":let a=t.split("/");if(a.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);o=a.slice(0,-2).concat(o).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:o}}},7262:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getUtils:function(){return g},interpolateDynamicPath:function(){return d},normalizeDynamicRouteParams:function(){return m},normalizeVercelUrl:function(){return p}});let n=r(7360),i=r(5014),o=r(3707),a=r(5679),u=r(3525),s=r(5257),c=r(7847),l=r(8168),f=r(1943);function p(e,t,r,i,o){if(i&&t&&o){let t=(0,n.parse)(e.url,!0);for(let e of(delete t.search,Object.keys(t.query))){let n=e!==f.NEXT_QUERY_PARAM_PREFIX&&e.startsWith(f.NEXT_QUERY_PARAM_PREFIX),i=e!==f.NEXT_INTERCEPTION_MARKER_PREFIX&&e.startsWith(f.NEXT_INTERCEPTION_MARKER_PREFIX);(n||i||(r||Object.keys(o.groups)).includes(e))&&delete t.query[e]}e.url=(0,n.format)(t)}}function d(e,t,r){if(!r)return e;for(let n of Object.keys(r.groups)){let{optional:i,repeat:o}=r.groups[n],a=`[${o?"...":""}${n}]`;i&&(a=`[${a}]`);let u=e.indexOf(a);if(u>-1){let r;let i=t[n];r=Array.isArray(i)?i.map(e=>e&&encodeURIComponent(e)).join("/"):i?encodeURIComponent(i):"",e=e.slice(0,u)+r+e.slice(u+a.length)}}return e}function m(e,t,r,n){let i=!0;return r?{params:e=Object.keys(r.groups).reduce((o,a)=>{let u=e[a];"string"==typeof u&&(u=(0,l.normalizeRscURL)(u)),Array.isArray(u)&&(u=u.map(e=>("string"==typeof e&&(e=(0,l.normalizeRscURL)(e)),e)));let s=n[a],c=r.groups[a].optional;return((Array.isArray(s)?s.some(e=>Array.isArray(u)?u.some(t=>t.includes(e)):null==u?void 0:u.includes(e)):null==u?void 0:u.includes(s))||void 0===u&&!(c&&t))&&(i=!1),c&&(!u||Array.isArray(u)&&1===u.length&&("index"===u[0]||u[0]===`[[...${a}]]`))&&(u=void 0,delete e[a]),u&&"string"==typeof u&&r.groups[a].repeat&&(u=u.split("/")),u&&(o[a]=u),o},{}),hasValidParams:i}:{params:e,hasValidParams:!1}}function g({page:e,i18n:t,basePath:r,rewrites:n,pageIsDynamic:l,trailingSlash:g,caseSensitive:h}){let E,y,R;return l&&(E=(0,a.getNamedRouteRegex)(e,!1),R=(y=(0,u.getRouteMatcher)(E))(e)),{handleRewrites:function(a,u){let f={},p=u.pathname,d=n=>{let c=(0,o.getPathMatch)(n.source+(g?"(/)?":""),{removeUnnamedParams:!0,strict:!0,sensitive:!!h})(u.pathname);if((n.has||n.missing)&&c){let e=(0,s.matchHas)(a,u.query,n.has,n.missing);e?Object.assign(c,e):c=!1}if(c){let{parsedDestination:o,destQuery:a}=(0,s.prepareDestination)({appendParamsToQuery:!0,destination:n.destination,params:c,query:u.query});if(o.protocol)return!0;if(Object.assign(f,a,c),Object.assign(u.query,o.query),delete o.query,Object.assign(u,o),p=u.pathname,r&&(p=p.replace(RegExp(`^${r}`),"")||"/"),t){let e=(0,i.normalizeLocalePath)(p,t.locales);p=e.pathname,u.query.nextInternalLocale=e.detectedLocale||c.nextInternalLocale}if(p===e)return!0;if(l&&y){let e=y(p);if(e)return u.query={...u.query,...e},!0}}return!1};for(let e of n.beforeFiles||[])d(e);if(p!==e){let t=!1;for(let e of n.afterFiles||[])if(t=d(e))break;if(!t&&!(()=>{let t=(0,c.removeTrailingSlash)(p||"");return t===(0,c.removeTrailingSlash)(e)||(null==y?void 0:y(t))})()){for(let e of n.fallback||[])if(t=d(e))break}}return f},defaultRouteRegex:E,dynamicRouteMatcher:y,defaultRouteMatches:R,getParamsFromRouteMatches:function(e,r,n){return(0,u.getRouteMatcher)(function(){let{groups:e,routeKeys:i}=E;return{re:{exec:o=>{let a=Object.fromEntries(new URLSearchParams(o)),u=t&&n&&a["1"]===n;for(let e of Object.keys(a)){let t=a[e];e!==f.NEXT_QUERY_PARAM_PREFIX&&e.startsWith(f.NEXT_QUERY_PARAM_PREFIX)&&(a[e.substring(f.NEXT_QUERY_PARAM_PREFIX.length)]=t,delete a[e])}let s=Object.keys(i||{}),c=e=>{if(t){let i=Array.isArray(e),o=i?e[0]:e;if("string"==typeof o&&t.locales.some(e=>e.toLowerCase()===o.toLowerCase()&&(n=e,r.locale=n,!0)))return i&&e.splice(0,1),!i||0===e.length}return!1};return s.every(e=>a[e])?s.reduce((t,r)=>{let n=null==i?void 0:i[r];return n&&!c(a[r])&&(t[e[n].pos]=a[r]),t},{}):Object.keys(a).reduce((e,t)=>{if(!c(a[t])){let r=t;return u&&(r=parseInt(t,10)-1+""),Object.assign(e,{[r]:a[t]})}return e},{})}},groups:e}}())(e.headers["x-now-route-matches"])},normalizeDynamicRouteParams:(e,t)=>m(e,t,E,R),normalizeVercelUrl:(e,t,r)=>p(e,t,r,l,E),interpolateDynamicPath:(e,t)=>d(e,t,E)}}},4080:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return i}});let r=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function i(e){return r.test(e)?e.replace(n,"\\$&"):e}},8785:(e,t)=>{"use strict";function r(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)&4294967295;return t>>>0}function n(e){return r(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{djb2Hash:function(){return r},hexHash:function(){return n}})},5014:(e,t)=>{"use strict";function r(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return r}})},1293:(e,t,r)=>{"use strict";let n;n=r(5315),e.exports=n},1555:(e,t)=>{"use strict";function r(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return r}})},1040:(e,t)=>{"use strict";function r(e){return e.replace(/\\/g,"/")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathSep",{enumerable:!0,get:function(){return r}})},8168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return a}});let n=r(1555),i=r(5406);function o(e){return(0,n.ensureLeadingSlash)(e.split("/").reduce((e,t,r,n)=>!t||(0,i.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t,""))}function a(e){return e.replace(/\.rsc($|\?)/,"$1")}},1942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseRelativeUrl",{enumerable:!0,get:function(){return i}}),r(2569);let n=r(4869);function i(e,t){let r=new URL("http://n"),i=t?new URL(t,r):e.startsWith(".")?new URL("http://n"):r,{pathname:o,searchParams:a,search:u,hash:s,href:c,origin:l}=new URL(e,i);if(l!==r.origin)throw Error("invariant: invalid relative URL, router received "+e);return{pathname:o,query:(0,n.searchParamsToUrlQuery)(a),search:u,hash:s,href:c.slice(r.origin.length)}}},3226:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseUrl",{enumerable:!0,get:function(){return o}});let n=r(4869),i=r(1942);function o(e){if(e.startsWith("/"))return(0,i.parseRelativeUrl)(e);let t=new URL(e);return{hash:t.hash,hostname:t.hostname,href:t.href,pathname:t.pathname,port:t.port,protocol:t.protocol,query:(0,n.searchParamsToUrlQuery)(t.searchParams),search:t.search}}},3707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getPathMatch",{enumerable:!0,get:function(){return i}});let n=r(1792);function i(e,t){let r=[],i=(0,n.pathToRegexp)(e,r,{delimiter:"/",sensitive:"boolean"==typeof(null==t?void 0:t.sensitive)&&t.sensitive,strict:null==t?void 0:t.strict}),o=(0,n.regexpToFunction)((null==t?void 0:t.regexModifier)?new RegExp(t.regexModifier(i.source),i.flags):i,r);return(e,n)=>{if("string"!=typeof e)return!1;let i=o(e);if(!i)return!1;if(null==t?void 0:t.removeUnnamedParams)for(let e of r)"number"==typeof e.name&&delete i.params[e.name];return{...n,...i.params}}}},5257:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{compileNonPath:function(){return f},matchHas:function(){return l},prepareDestination:function(){return p}});let n=r(1792),i=r(4080),o=r(3226),a=r(1586),u=r(338),s=r(6975);function c(e){return e.replace(/__ESC_COLON_/gi,":")}function l(e,t,r,n){void 0===r&&(r=[]),void 0===n&&(n=[]);let i={},o=r=>{let n;let o=r.key;switch(r.type){case"header":o=o.toLowerCase(),n=e.headers[o];break;case"cookie":n="cookies"in e?e.cookies[r.key]:(0,s.getCookieParser)(e.headers)()[r.key];break;case"query":n=t[o];break;case"host":{let{host:t}=(null==e?void 0:e.headers)||{};n=null==t?void 0:t.split(":",1)[0].toLowerCase()}}if(!r.value&&n)return i[function(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);(n>64&&n<91||n>96&&n<123)&&(t+=e[r])}return t}(o)]=n,!0;if(n){let e=RegExp("^"+r.value+"$"),t=Array.isArray(n)?n.slice(-1)[0].match(e):n.match(e);if(t)return Array.isArray(t)&&(t.groups?Object.keys(t.groups).forEach(e=>{i[e]=t.groups[e]}):"host"===r.type&&t[0]&&(i.host=t[0])),!0}return!1};return!!r.every(e=>o(e))&&!n.some(e=>o(e))&&i}function f(e,t){if(!e.includes(":"))return e;for(let r of Object.keys(t))e.includes(":"+r)&&(e=e.replace(RegExp(":"+r+"\\*","g"),":"+r+"--ESCAPED_PARAM_ASTERISKS").replace(RegExp(":"+r+"\\?","g"),":"+r+"--ESCAPED_PARAM_QUESTION").replace(RegExp(":"+r+"\\+","g"),":"+r+"--ESCAPED_PARAM_PLUS").replace(RegExp(":"+r+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+r));return e=e.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,n.compile)("/"+e,{validate:!1})(t).slice(1)}function p(e){let t;let r=Object.assign({},e.query);delete r.__nextLocale,delete r.__nextDefaultLocale,delete r.__nextDataReq,delete r.__nextInferredLocaleFromDefault,delete r[u.NEXT_RSC_UNION_QUERY];let s=e.destination;for(let t of Object.keys({...e.params,...r}))s=s.replace(RegExp(":"+(0,i.escapeStringRegexp)(t),"g"),"__ESC_COLON_"+t);let l=(0,o.parseUrl)(s),p=l.query,d=c(""+l.pathname+(l.hash||"")),m=c(l.hostname||""),g=[],h=[];(0,n.pathToRegexp)(d,g),(0,n.pathToRegexp)(m,h);let E=[];g.forEach(e=>E.push(e.name)),h.forEach(e=>E.push(e.name));let y=(0,n.compile)(d,{validate:!1}),R=(0,n.compile)(m,{validate:!1});for(let[t,r]of Object.entries(p))Array.isArray(r)?p[t]=r.map(t=>f(c(t),e.params)):"string"==typeof r&&(p[t]=f(c(r),e.params));let _=Object.keys(e.params).filter(e=>"nextInternalLocale"!==e);if(e.appendParamsToQuery&&!_.some(e=>E.includes(e)))for(let t of _)t in p||(p[t]=e.params[t]);if((0,a.isInterceptionRouteAppPath)(d))for(let t of d.split("/")){let r=a.INTERCEPTION_ROUTE_MARKERS.find(e=>t.startsWith(e));if(r){e.params["0"]=r;break}}try{let[r,n]=(t=y(e.params)).split("#",2);l.hostname=R(e.params),l.pathname=r,l.hash=(n?"#":"")+(n||""),delete l.search}catch(e){if(e.message.match(/Expected .*? to not repeat, but got an array/))throw Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match");throw e}return l.query={...r,...l.query},{newUrl:t,destQuery:p,parsedDestination:l}}},4869:(e,t)=>{"use strict";function r(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t}function n(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[r,i]=e;Array.isArray(i)?i.forEach(e=>t.append(r,n(e))):t.set(r,n(i))}),t}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.forEach(t=>{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,r)=>e.append(r,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return o},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return i}})},7847:(e,t)=>{"use strict";function r(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return r}})},3525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return i}});let n=r(2569);function i(e){let{re:t,groups:r}=e;return e=>{let i=t.exec(e);if(!i)return!1;let o=e=>{try{return decodeURIComponent(e)}catch(e){throw new n.DecodeError("failed to decode param")}},a={};return Object.keys(r).forEach(e=>{let t=r[e],n=i[t.pos];void 0!==n&&(a[e]=~n.indexOf("/")?n.split("/").map(e=>o(e)):t.repeat?[o(n)]:o(n))}),a}}},5679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getNamedMiddlewareRegex:function(){return d},getNamedRouteRegex:function(){return p},getRouteRegex:function(){return c},parseParameter:function(){return u}});let n=r(1943),i=r(1586),o=r(4080),a=r(7847);function u(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function s(e){let t=(0,a.removeTrailingSlash)(e).slice(1).split("/"),r={},n=1;return{parameterizedRoute:t.map(e=>{let t=i.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&a){let{key:e,optional:i,repeat:s}=u(a[1]);return r[e]={pos:n++,repeat:s,optional:i},"/"+(0,o.escapeStringRegexp)(t)+"([^/]+?)"}if(!a)return"/"+(0,o.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:i}=u(a[1]);return r[e]={pos:n++,repeat:t,optional:i},t?i?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}function c(e){let{parameterizedRoute:t,groups:r}=s(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:r}}function l(e){let{interceptionMarker:t,getSafeRouteKey:r,segment:n,routeKeys:i,keyPrefix:a}=e,{key:s,optional:c,repeat:l}=u(n),f=s.replace(/\W/g,"");a&&(f=""+a+f);let p=!1;(0===f.length||f.length>30)&&(p=!0),isNaN(parseInt(f.slice(0,1)))||(p=!0),p&&(f=r()),a?i[f]=""+a+s:i[f]=s;let d=t?(0,o.escapeStringRegexp)(t):"";return l?c?"(?:/"+d+"(?<"+f+">.+?))?":"/"+d+"(?<"+f+">.+?)":"/"+d+"(?<"+f+">[^/]+?)"}function f(e,t){let r;let u=(0,a.removeTrailingSlash)(e).slice(1).split("/"),s=(r=0,()=>{let e="",t=++r;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),c={};return{namedParameterizedRoute:u.map(e=>{let r=i.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),a=e.match(/\[((?:\[.*\])|.+)\]/);if(r&&a){let[r]=e.split(a[0]);return l({getSafeRouteKey:s,interceptionMarker:r,segment:a[1],routeKeys:c,keyPrefix:t?n.NEXT_INTERCEPTION_MARKER_PREFIX:void 0})}return a?l({getSafeRouteKey:s,segment:a[1],routeKeys:c,keyPrefix:t?n.NEXT_QUERY_PARAM_PREFIX:void 0}):"/"+(0,o.escapeStringRegexp)(e)}).join(""),routeKeys:c}}function p(e,t){let r=f(e,t);return{...c(e),namedRegex:"^"+r.namedParameterizedRoute+"(?:/)?$",routeKeys:r.routeKeys}}function d(e,t){let{parameterizedRoute:r}=s(e),{catchAll:n=!0}=t;if("/"===r)return{namedRegex:"^/"+(n?".*":"")+"$"};let{namedParameterizedRoute:i}=f(e,!1);return{namedRegex:"^"+i+(n?"(?:(/.*)?)":"")+"$"}}},5406:(e,t)=>{"use strict";function r(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DEFAULT_SEGMENT_KEY:function(){return i},PAGE_SEGMENT_KEY:function(){return n},isGroupSegment:function(){return r}});let n="__PAGE__",i="__DEFAULT__"},2569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return m},MiddlewareNotFoundError:function(){return y},MissingStaticPage:function(){return E},NormalizeError:function(){return g},PageNotFoundError:function(){return h},SP:function(){return p},ST:function(){return d},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return s},getLocationOrigin:function(){return a},getURL:function(){return u},isAbsoluteUrl:function(){return o},isResSent:function(){return c},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return l},stringifyError:function(){return R}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return r||(r=!0,t=e(...i)),t}}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>i.test(e);function a(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function u(){let{href:e}=window.location,t=a();return e.substring(t.length)}function s(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function c(e){return e.finished||e.headersSent}function l(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&c(r))return n;if(!n)throw Error('"'+s(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.');return n}let p="undefined"!=typeof performance,d=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class m extends Error{}class g extends Error{}class h extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class E extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class y extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function R(e){return JSON.stringify({message:e.message,stack:e.stack})}}};
@@ -1 +1 @@
1
- exports.id=904,exports.ids=[904],exports.modules={5775:(e,s,t)=>{Promise.resolve().then(t.t.bind(t,2994,23)),Promise.resolve().then(t.t.bind(t,6114,23)),Promise.resolve().then(t.t.bind(t,9727,23)),Promise.resolve().then(t.t.bind(t,9671,23)),Promise.resolve().then(t.t.bind(t,1868,23)),Promise.resolve().then(t.t.bind(t,4759,23))},8196:()=>{},6620:(e,s,t)=>{"use strict";t.d(s,{G0:()=>d,Gz:()=>n,QO:()=>x,SC:()=>o});var r=t(326);t(7577);var a=t(1954);function n({s:e,onSend:s,onDismiss:t}){let a="open-pr"===e.kind?"Ready to open a PR?":"review"===e.kind?"New review feedback":"merge"===e.kind?"Approved and green: ready to merge":"CI is failing";return(0,r.jsxs)("div",{className:"mt-2 rounded-lg border border-amber-700/50 bg-amber-950/30 p-2.5",children:[r.jsx("p",{className:"text-xs font-medium text-amber-200",children:a}),r.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"Suggested message for the session:"}),(0,r.jsxs)("p",{className:"text-xs text-gray-200 mt-0.5 italic",children:["“",e.text,"”"]}),(0,r.jsxs)("div",{className:"flex gap-2 mt-2",children:[r.jsx("button",{onClick:s,className:"text-xs px-2.5 py-1 rounded-md bg-amber-600 hover:bg-amber-500 text-white",children:"merge"===e.kind?"Merge":"Send to session"}),r.jsx("button",{onClick:t,className:"text-xs px-2 py-1 rounded-md text-gray-400 hover:text-white",children:"Dismiss"})]})]})}t(444);let l={APPROVED:"✓",CHANGES_REQUESTED:"✗",COMMENTED:"\uD83D\uDCAC",DISMISSED:"–",PENDING:"…"},i={APPROVED:"text-emerald-300",CHANGES_REQUESTED:"text-red-300",COMMENTED:"text-gray-300"},o={"in-review":["in review","bg-blue-500/15 text-blue-300"],working:["session is fixing","bg-blue-500/15 text-blue-300"],ready:["ready to merge","bg-emerald-500/15 text-emerald-300"],done:["done","bg-gray-700 text-gray-300"],"needs-you":["needs you","bg-amber-500/15 text-amber-300"]};function c({steps:e}){return r.jsx("div",{className:"flex items-start my-3",children:e.map((e,s)=>(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center text-center relative",children:[s>0&&r.jsx("span",{className:`absolute top-1.5 right-1/2 w-full h-0.5 ${e.done||e.current?"bg-blue-500/60":"bg-gray-700"}`}),r.jsx("span",{className:`relative z-10 w-3.5 h-3.5 rounded-full border-2 ${e.done?"bg-emerald-500 border-emerald-500":e.current?"bg-gray-900 border-blue-400 animate-pulse":"bg-gray-900 border-gray-600"}`}),r.jsx("span",{className:`text-[10px] mt-1 leading-tight ${e.done?"text-gray-300":e.current?"text-blue-300":"text-gray-600"}`,children:e.label})]},e.label))})}function d({t:e,slackSet:s,max:t,onSend:d,onDismiss:x,auto:g}){let m=e.view,[p,h]=o[e.state];return(0,r.jsxs)("div",{className:"rounded-lg border border-gray-800 p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"text-sm font-medium text-gray-100 hover:underline truncate",children:m?.title||(0,a.QV)(e.url)}),r.jsx("span",{className:`ml-auto flex-shrink-0 px-2 py-0.5 rounded-full text-[10px] font-medium ${h}`,children:p})]}),r.jsx("div",{className:"flex items-center gap-2 mt-0.5",children:(0,r.jsxs)("p",{className:"text-[11px] text-gray-500",children:[(0,r.jsxs)("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline",children:[(0,a.QV)(e.url)," ↗"]}),m?.isDraft?" \xb7 draft":""," \xb7 review fixes ",e.reviewRounds,"/",t," \xb7 CI fixes ",e.ciFixes,"/",t]})}),e.suggestion&&d&&x&&r.jsx(n,{s:e.suggestion,onSend:d,onDismiss:x}),e.suggestion&&g&&"open-pr"!==e.suggestion.kind&&g[e.suggestion.kind]&&("merge"===e.suggestion.kind?(e.mergeAttempts??0)<1:("review"===e.suggestion.kind?e.reviewRounds:e.ciFixes)<t)&&r.jsx("p",{className:"text-[11px] text-amber-300/80 mt-1",children:"Automatic: this goes to the session as soon as it's idle."}),r.jsx(c,{steps:(0,a.UA)(e,s)}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"GitHub"}),m?(0,r.jsxs)("ul",{className:"space-y-0.5",children:[m.reviews.map(e=>(0,r.jsxs)("li",{className:`flex gap-1.5 ${i[e.state]??"text-gray-300"}`,children:[r.jsx("span",{className:"w-3",children:l[e.state]??"•"}),e.login,r.jsx("span",{className:"text-gray-500 lowercase",children:e.state.replace("_"," ")})]},e.login)),m.requested.map(e=>(0,r.jsxs)("li",{className:"flex gap-1.5 text-gray-400",children:[r.jsx("span",{className:"w-3",children:"⏳"}),e,r.jsx("span",{className:"text-gray-600",children:"requested"})]},e)),!m.reviews.length&&!m.requested.length&&r.jsx("li",{className:"text-gray-500",children:"No reviewers yet"}),(0,r.jsxs)("li",{className:`pt-0.5 ${"failing"===m.checks?"text-red-300":"passing"===m.checks?"text-emerald-300":"text-gray-400"}`,children:["CI: ","none"===m.checks?"no checks":m.checks]})]}):r.jsx("p",{className:"text-gray-500",children:"Loading…"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:["Slack",e.slack?` \xb7 #${e.slack.channel}`:""]}),e.slack?(0,r.jsxs)("div",{className:"space-y-1",children:[e.slack.reviewers?.length?(0,r.jsxs)("p",{className:"text-gray-200",children:["\uD83D\uDC40 ",e.slack.reviewers.join(", ")]}):r.jsx("p",{className:"text-gray-500",children:e.slack.reviewers?"Nobody has claimed it yet":"Checking replies…"}),e.slack.replies?.slice(-2).map((e,s)=>r.jsxs("p",{className:"text-gray-400 line-clamp-2",children:[r.jsxs("span",{className:"text-gray-300",children:[e.user,":"]})," ",e.text]},s)),e.slack.permalink&&r.jsx("a",{href:e.slack.permalink,target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline",children:"Open thread"})]}):r.jsx("p",{className:"text-gray-500",children:s?"Posting…":"No channel set"})]})]})]})}let x=[["openPr","Open the PR","When the session has code to ship, ask it to commit, push and open a PR"],["review","Fix review comments","When reviewers comment, ask the session to address them, push and reply"],["ci","Fix failing CI","When CI fails, ask the session to fix it and push"],["merge","Merge when approved","When approved and CI is green, ask the session to merge (tried once automatically)"]]},9532:(e,s,t)=>{"use strict";t.d(s,{h:()=>n});var r=t(326),a=t(7577);function n({options:e,value:s,onChange:t,onPick:n,onEnter:l,placeholder:i,className:o}){let[c,d]=(0,a.useState)(!1),[x,g]=(0,a.useState)(0),m=s.toLowerCase().replace(/^#/,"").split(/\s+/).filter(Boolean),p=e.filter(e=>m.every(s=>e.label.toLowerCase().includes(s))).sort((e,s)=>Number(!e.label.toLowerCase().startsWith(m[0]??""))-Number(!s.label.toLowerCase().startsWith(m[0]??""))).slice(0,8);return(0,r.jsxs)("div",{className:"relative flex-1",children:[r.jsx("input",{value:s,placeholder:i,className:o,onChange:e=>{t(e.target.value),d(!0),g(0)},onFocus:()=>d(!0),onBlur:()=>setTimeout(()=>d(!1),120),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),d(!0),g(e=>Math.min(e+1,p.length-1))):"ArrowUp"===e.key?(e.preventDefault(),g(e=>Math.max(e-1,0))):"Escape"===e.key?d(!1):"Enter"===e.key&&(c&&p[x]&&s.trim()?(e.preventDefault(),n(p[x]),d(!1)):l?.())}}),c&&s.trim()&&p.length>0&&r.jsx("ul",{className:"absolute z-50 left-0 right-0 mt-1 bg-gray-900 border border-gray-700 rounded-md shadow-xl overflow-hidden",children:p.map((e,s)=>(0,r.jsxs)("li",{onMouseDown:s=>{s.preventDefault(),n(e),d(!1)},onMouseEnter:()=>g(s),className:`px-2.5 py-1.5 text-sm cursor-pointer flex items-center gap-2 ${s===x?"bg-blue-600/80 text-white":"text-gray-200"}`,children:[r.jsx("span",{className:"truncate flex-1",children:e.label}),e.hint&&r.jsx("span",{className:"text-[11px] opacity-60 flex-shrink-0",children:e.hint})]},e.id||e.label))})]})}},9952:(e,s,t)=>{"use strict";t.d(s,{C:()=>h});var r=t(326),a=t(7577),n=t(1954),l=t(444),i=t(6620);let o={"waiting-for-session":["Watching the session","bg-blue-500/15 text-blue-300 ring-blue-500/30"],"opening-pr":["Opening a PR","bg-blue-500/15 text-blue-300 ring-blue-500/30"],tracking:["Tracking PRs","bg-blue-500/15 text-blue-300 ring-blue-500/30"],done:["Done","bg-emerald-500/15 text-emerald-300 ring-emerald-500/30"],"needs-you":["Needs you","bg-amber-500/15 text-amber-300 ring-amber-500/30"],stopped:["Stopped","bg-gray-700/60 text-gray-300 ring-gray-600"]},c={APPROVED:["Approved","bg-emerald-500/15 text-emerald-300"],CHANGES_REQUESTED:["Changes requested","bg-red-500/15 text-red-300"],COMMENTED:["Commented","bg-gray-700/70 text-gray-300"],DISMISSED:["Dismissed","bg-gray-800 text-gray-500"],PENDING:["Pending","bg-gray-800 text-gray-400"]},d={passing:["●","text-emerald-400","Checks passing"],failing:["●","text-red-400","Checks failing"],pending:["◌","text-amber-300 animate-pulse","Checks running"],none:["○","text-gray-500","No checks"]};function x({login:e}){let[s,t]=(0,a.useState)(!1);return s||e.includes("[bot]")?r.jsx("span",{className:"w-7 h-7 rounded-full bg-gray-700 flex items-center justify-center text-xs font-semibold text-gray-200 flex-shrink-0",children:e[0]?.toUpperCase()}):r.jsx("img",{src:`https://github.com/${encodeURIComponent(e)}.png?size=56`,alt:"",onError:()=>t(!0),className:"w-7 h-7 rounded-full bg-gray-800 flex-shrink-0"})}function g({steps:e}){return r.jsx("div",{className:"flex items-start py-2",children:e.map((e,s)=>(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center text-center relative min-w-0",children:[s>0&&r.jsx("span",{className:`absolute top-4 right-1/2 w-full h-[3px] rounded-full ${e.done||e.current?"bg-gradient-to-r from-emerald-500 to-blue-500":"bg-gray-800"}`}),r.jsx("span",{className:`relative z-10 w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold ring-4 ring-gray-950 ${e.done?"bg-emerald-500 text-gray-950":e.current?"bg-blue-500 text-white shadow-[0_0_0_6px_rgba(59,130,246,0.18)]":"bg-gray-800 text-gray-500"}`,children:e.done?"✓":s+1}),r.jsx("span",{className:`text-xs mt-2 px-1 leading-tight ${e.done?"text-gray-200":e.current?"text-blue-300 font-medium":"text-gray-600"}`,children:e.label})]},e.label))})}function m({title:e,children:s,right:t}){return(0,r.jsxs)("div",{className:"rounded-lg bg-gray-950/60 border border-gray-800/80 p-3.5 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center mb-2.5",children:[r.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:e}),r.jsx("span",{className:"ml-auto",children:t})]}),s]})}function p({t:e,p:s,auto:t,onSend:a,onDismiss:l}){let o=e.view,[p,h]=i.SC[e.state],u=s.config.maxRounds,b=d[o?.checks??"none"]??d.none,y=e.suggestion&&"open-pr"!==e.suggestion.kind&&t[e.suggestion.kind];return(0,r.jsxs)("article",{className:"rounded-2xl border border-gray-800 bg-gradient-to-b from-gray-900/80 to-gray-900/30 p-5 shadow-lg shadow-black/20",children:[(0,r.jsxs)("header",{className:"flex items-start gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[r.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"text-base font-semibold text-gray-100 hover:text-blue-300 leading-snug",children:o?.title||(0,n.QV)(e.url)}),(0,r.jsxs)("p",{className:"text-xs text-gray-500 mt-1 flex flex-wrap gap-x-2",children:[r.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"font-mono text-blue-400 hover:underline",children:(0,n.QV)(e.url)}),o?.isDraft&&r.jsx("span",{className:"text-gray-400",children:"\xb7 draft"}),(0,r.jsxs)("span",{children:["\xb7 review fixes ",e.reviewRounds,"/",u]}),(0,r.jsxs)("span",{children:["\xb7 CI fixes ",e.ciFixes,"/",u]})]})]}),r.jsx("span",{className:`flex-shrink-0 px-2.5 py-1 rounded-full text-[11px] font-medium ${h}`,children:p}),r.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"flex-shrink-0 text-xs px-3 py-1 rounded-lg border border-gray-700 hover:bg-gray-800 text-gray-200",children:"Open PR ↗"})]}),r.jsx("div",{className:"mt-4",children:r.jsx(g,{steps:(0,n.UA)(e,!!s.config.slackChannel)})}),e.suggestion&&r.jsx("div",{className:"mt-2",children:r.jsx(i.Gz,{s:e.suggestion,onSend:a,onDismiss:l})}),y&&r.jsx("p",{className:"text-[11px] text-amber-300/80 mt-1.5",children:"Automatic: goes to the session as soon as it's idle."}),(0,r.jsxs)("div",{className:"grid sm:grid-cols-3 gap-3 mt-4",children:[r.jsx(m,{title:"Reviewers",children:o?(0,r.jsxs)("ul",{className:"space-y-2",children:[o.reviews.map(e=>{let[s,t]=c[e.state]??[e.state.toLowerCase(),"bg-gray-800 text-gray-400"];return(0,r.jsxs)("li",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(x,{login:e.login}),r.jsx("span",{className:"text-sm text-gray-200 truncate",children:e.login}),r.jsx("span",{className:`ml-auto text-[10px] px-1.5 py-0.5 rounded-full whitespace-nowrap ${t}`,children:s})]},e.login)}),o.requested.map(e=>(0,r.jsxs)("li",{className:"flex items-center gap-2 min-w-0 opacity-70",children:[r.jsx(x,{login:e}),r.jsx("span",{className:"text-sm text-gray-300 truncate",children:e}),r.jsx("span",{className:"ml-auto text-[10px] px-1.5 py-0.5 rounded-full bg-gray-800 text-gray-400 whitespace-nowrap",children:"Requested"})]},e)),!o.reviews.length&&!o.requested.length&&r.jsx("li",{className:"text-xs text-gray-500",children:"No reviewers yet"})]}):r.jsx("p",{className:"text-xs text-gray-500 animate-pulse",children:"Loading from GitHub…"})}),(0,r.jsxs)(m,{title:"CI",children:[(0,r.jsxs)("p",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:`text-lg leading-none ${b[1]}`,children:b[0]}),r.jsx("span",{className:"text-gray-200",children:b[2]})]}),o&&(0,r.jsxs)("p",{className:"text-[11px] text-gray-500 mt-2",children:["Updated ",new Date(o.fetchedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),r.jsx(m,{title:`Slack${e.slack?` \xb7 #${e.slack.channel}`:""}`,right:e.slack?.permalink&&r.jsx("a",{href:e.slack.permalink,target:"_blank",rel:"noreferrer",className:"text-[11px] text-blue-400 hover:underline",children:"Open thread ↗"}),children:e.slack?(0,r.jsxs)("div",{className:"space-y-1.5 text-xs",children:[e.slack.reviewers?.length?(0,r.jsxs)("p",{className:"text-gray-100",children:["\uD83D\uDC40 ",e.slack.reviewers.join(", ")]}):r.jsx("p",{className:"text-gray-500",children:e.slack.reviewers?"Nobody has claimed it yet":"Checking replies…"}),e.slack.replies?.slice(-2).map((e,s)=>r.jsxs("p",{className:"text-gray-400 line-clamp-2",children:[r.jsx("span",{className:"text-gray-300 font-medium",children:e.user})," ",e.text]},s))]}):r.jsx("p",{className:"text-xs text-gray-500",children:s.config.slackChannel?"Posting…":"No channel set"})})]})]})}function h({sessionName:e,pipeline:s,error:t,onOpenSession:c,onStart:d,onStop:x,onAddPr:m,onAct:h,onDismiss:u,onSetAuto:b}){let[y,f]=(0,a.useState)(""),[j,N]=(0,a.useState)(null),[v,k]=(0,a.useState)(3),[w,C]=(0,a.useState)(n.dc),[S,P]=(0,a.useState)(""),R=(0,n.An)(s),D=R&&s?{...n.dc,...s.config.auto}:w,$=(e,t)=>R&&s?b(s.id,{[e]:t}):C(s=>({...s,[e]:t})),[E,A]=s?o[s.phase]:["Not running","bg-gray-800 text-gray-400 ring-gray-700"],I="w-full bg-gray-900 border border-gray-700 focus:border-blue-500 rounded-lg px-3 py-2 text-sm text-white outline-none placeholder-gray-500";return(0,r.jsxs)("div",{className:"absolute inset-0 overflow-y-auto bg-gray-950 text-gray-100",children:[(0,r.jsxs)("div",{className:"relative border-b border-gray-800 bg-gradient-to-br from-blue-950/50 via-gray-950 to-emerald-950/20 px-8 pt-7 pb-6",children:[r.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-blue-300/80",children:"⚡ Ship it pipeline"}),(0,r.jsxs)("div",{className:"flex items-start gap-4 mt-2 flex-wrap",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[r.jsx("h1",{className:"text-2xl font-semibold truncate",children:e}),r.jsx("p",{className:"text-sm text-gray-400 mt-1",children:s?(0,n.Vm)(s):"Set it up once: it opens the PR, posts it for review, fixes feedback and CI, and asks you before merging."})]}),r.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ring-1 ring-inset ${A}`,children:E}),(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx("button",{onClick:c,className:"text-sm px-3.5 py-1.5 rounded-lg border border-gray-700 bg-gray-900/60 hover:bg-gray-800",children:"Open session"}),R?r.jsx("button",{onClick:()=>x(s.id),className:"text-sm px-3.5 py-1.5 rounded-lg border border-red-900/70 text-red-300 hover:bg-red-950/50",children:"Stop"}):r.jsx("button",{onClick:function(){let e=(j?.name??y).replace(/^#/,"").trim();d({slackChannel:e?{id:j?.id??"",name:e}:null,maxRounds:v,auto:w})},className:"text-sm px-3.5 py-1.5 rounded-lg bg-blue-600 hover:bg-blue-500 font-medium",children:s?"Start again":"Start pipeline"})]})]}),s&&!s.prs.length&&R&&r.jsx("div",{className:"mt-5 max-w-3xl",children:r.jsx(g,{steps:(0,n.YY)(s)})}),t&&r.jsx("p",{className:"text-sm text-red-400 mt-3",children:t})]}),(0,r.jsxs)("div",{className:"px-8 py-6 grid gap-6 xl:grid-cols-[minmax(0,1fr)_340px]",children:[(0,r.jsxs)("div",{className:"space-y-5 min-w-0",children:[s?.suggestion&&r.jsx(i.Gz,{s:s.suggestion,onSend:()=>h(s.id,null),onDismiss:()=>u(s.id,null)}),s?.prs.map(e=>r.jsx(p,{t:e,p:s,auto:D,onSend:()=>h(s.id,e.url),onDismiss:()=>u(s.id,e.url)},e.url)),R&&s&&(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx("input",{value:S,onChange:e=>P(e.target.value),placeholder:"Track another PR: https://github.com/org/repo/pull/123",className:I}),r.jsx("button",{onClick:()=>{m(s.id,S),P("")},disabled:!S.trim(),className:"text-sm px-4 rounded-lg border border-gray-700 hover:bg-gray-800 disabled:opacity-40 flex-shrink-0",children:"Add PR"})]}),!R&&(0,r.jsxs)("div",{className:"rounded-2xl border border-gray-800 bg-gray-900/40 p-5 space-y-4",children:[r.jsx("h2",{className:"text-sm font-semibold",children:"Set up"}),(0,r.jsxs)("label",{className:"block text-xs text-gray-400",children:['Slack channel for "ready for review" (optional)',r.jsx("div",{className:"mt-1",children:r.jsx(l.a,{value:y,onChange:(e,s)=>{f(e),N(s)},className:I})})]}),(0,r.jsxs)("label",{className:"block text-xs text-gray-400",children:["Fix rounds per PR (review and CI, each)",r.jsx("input",{type:"number",min:1,max:10,value:v,onChange:e=>k(Number(e.target.value)),className:`${I} w-24 mt-1`})]})]})]}),(0,r.jsxs)("aside",{className:"space-y-5",children:[(0,r.jsxs)("section",{className:"rounded-2xl border border-gray-800 bg-gray-900/40 p-4",children:[r.jsx("h2",{className:"text-sm font-semibold",children:"Steps"}),r.jsx("p",{className:"text-[11px] text-gray-500 mb-3",children:"Automatic steps run when the session is idle. Approving is always up to your reviewers."}),r.jsx("div",{className:"space-y-2",children:i.QO.map(([e,s,t])=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",title:t,children:[r.jsx("span",{className:"text-sm text-gray-200",children:s}),(0,r.jsxs)("span",{className:"flex rounded-lg border border-gray-700 overflow-hidden text-[11px] flex-shrink-0",children:[r.jsx("button",{onClick:()=>$(e,!0),className:`px-2.5 py-1 ${D[e]?"bg-blue-600 text-white":"text-gray-400 hover:bg-gray-800"}`,children:"Auto"}),r.jsx("button",{onClick:()=>$(e,!1),className:`px-2.5 py-1 ${D[e]?"text-gray-400 hover:bg-gray-800":"bg-gray-700 text-white"}`,children:"Ask me"})]})]},e))}),s&&(0,r.jsxs)("p",{className:"text-[11px] text-gray-500 mt-3",children:["Slack: ",s.config.slackChannel?`#${s.config.slackChannel.name}`:"none"," \xb7 up to ",s.config.maxRounds," fix rounds per PR"]})]}),s&&(0,r.jsxs)("section",{className:"rounded-2xl border border-gray-800 bg-gray-900/40 p-4",children:[r.jsx("h2",{className:"text-sm font-semibold mb-3",children:"Activity"}),r.jsx("ol",{className:"relative border-l border-gray-800 ml-1.5 space-y-3 max-h-[60vh] overflow-y-auto pr-1",children:[...s.log].reverse().map((e,s)=>(0,r.jsxs)("li",{className:"pl-4 relative",children:[r.jsx("span",{className:`absolute -left-[5px] top-1.5 w-2.5 h-2.5 rounded-full ${0===s?"bg-blue-400":"bg-gray-700"}`}),r.jsx("p",{className:"text-xs text-gray-200 leading-snug",children:e.text}),r.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5",children:new Date(e.t).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]},s))})]})]})]})]})}},444:(e,s,t)=>{"use strict";t.d(s,{a:()=>o});var r=t(326),a=t(7577),n=t(9532),l=t(3814),i=t(9849);function o({value:e,onChange:s,onEnter:t,className:o}){let[c,d]=(0,a.useState)([]),[x,g]=(0,a.useState)("loading"),[m,p]=(0,a.useState)(""),[h,u]=(0,a.useState)("other");function b(e=!1){g("loading"),fetch((0,l.X)(`/api/slack/channels${e?"?refresh=1":""}`)).then(async e=>{let s=await e.json();if(!e.ok)throw u(s.problem??"other"),Error(s.error);d(s.channels),g("ready")}).catch(e=>{p(e.message||"Could not load channels"),g("error")})}let y=e=>s(e,c.find(s=>s.name===e.replace(/^#/,""))??null);return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex gap-1.5",children:[r.jsx(n.h,{options:c.map(e=>({id:e.id||e.name,label:e.name})),value:e,onChange:y,onPick:e=>y(e.label),onEnter:t,placeholder:"loading"===x?"Loading your channels…":"Type to find a channel",className:o}),r.jsx("button",{onClick:()=>b(!0),disabled:"loading"===x,title:"Reload channels from Slack",className:"px-2 rounded-md border border-gray-700 text-gray-400 hover:text-white disabled:opacity-40 text-xs flex-shrink-0",children:"loading"===x?"…":"↻"})]}),"loading"===x&&r.jsx("p",{className:"text-[11px] text-gray-500 mt-1",children:"Asking Slack for your channels. The first time can take up to 2 minutes…"}),"ready"===x&&(0,r.jsxs)("p",{className:"text-[11px] text-gray-600 mt-1",children:[c.length," channels"]}),"error"===x&&r.jsx(i.hR,{compact:!0,problem:h,detail:m,org:"this org",onRetry:()=>b(!0)})]})}},9849:(e,s,t)=>{"use strict";t.d(s,{hR:()=>i,w0:()=>n});var r=t(326);let a=()=>window.dispatchEvent(new Event("polyergon:connect-slack")),n=()=>window.dispatchEvent(new Event("polyergon:claude-login")),l={auth:{title:e=>`Slack isn't signed in for ${e}`,why:"Polyergon's background checks use this org's \"claude.ai Slack\" connector, and it isn't signed in. (A Slack plugin working in your sessions doesn't cover background runs.)",fix:'Click Connect Slack: a new session opens in this org with /mcp. Choose "claude.ai Slack" and sign in, then come back and Retry.'},missing:{title:e=>`Slack isn't set up for ${e}`,why:"This org's Claude setup has no Slack connector, so Polyergon can't read or post to Slack for it.",fix:"Add the Slack connector to this org (claude.ai → Settings → Connectors, or /mcp in a session of this org), then Retry."},other:{title:()=>"Couldn't reach Slack",why:"Slack or the connector returned an error.",fix:"Retry in a minute. If it keeps failing, open a session in this org and run /mcp to check the Slack connector."}};function i({problem:e,detail:s,org:t,onRetry:n,compact:i=!1}){let o=l[e]??l.other;return(0,r.jsxs)("div",{className:`rounded-lg border border-amber-800/60 bg-amber-950/30 ${i?"px-2.5 py-2 mt-1":"px-4 py-3"} text-xs`,children:[r.jsx("p",{className:`font-medium text-amber-200 ${i?"":"text-sm"}`,children:o.title(t)}),!i&&r.jsx("p",{className:"text-gray-300 mt-1",children:o.why}),r.jsx("p",{className:"text-gray-400 mt-1",children:o.fix}),s&&!i&&(0,r.jsxs)("p",{className:"text-gray-500 mt-1 italic line-clamp-2",children:["Claude said: ",s]}),(0,r.jsxs)("div",{className:"flex gap-2 mt-2",children:["other"!==e&&r.jsx("button",{onClick:a,className:"px-2.5 py-1 rounded-md bg-amber-600 hover:bg-amber-500 text-white",children:"Connect Slack"}),r.jsx("button",{onClick:n,className:"px-2.5 py-1 rounded-md border border-gray-700 text-gray-200 hover:bg-gray-800",children:"Retry"})]})]})}},3814:(e,s,t)=>{"use strict";t.d(s,{X:()=>n,n:()=>a});let r="default";function a(e){r="all"===e?"default":e}function n(e){return`${e}${e.includes("?")?"&":"?"}org=${encodeURIComponent(r)}`}},1954:(e,s,t)=>{"use strict";t.d(s,{An:()=>n,QV:()=>l,UA:()=>o,Vm:()=>i,YY:()=>c,dc:()=>r});let r={openPr:!0,review:!0,ci:!0,merge:!1},a=["waiting-for-session","opening-pr","tracking"],n=e=>!!e&&a.includes(e.phase),l=e=>e.replace(/^https:\/\/github\.com\//,"").replace("/pull/","#");function i(e){let s=(e.suggestion?1:0)+e.prs.filter(e=>e.suggestion).length;return(s?`${s} suggestion${s>1?"s":""} for you \xb7 `:"")+function(e){let s,t,r,a,n,l,i;if("waiting-for-session"===e.phase)return"watching for a PR";if("opening-pr"===e.phase)return"session is opening a PR";if("stopped"===e.phase)return"stopped";if("needs-you"===e.phase&&!e.prs.length)return"needs you";if("done"===e.phase)return e.prs.length>1?`${e.prs.length} PRs done`:"done";let o=e.prs.filter(e=>"done"!==e.state),c=[(s="needs-you",o.filter(e=>e.state===s).length&&`${t="needs-you",o.filter(e=>e.state===t).length} needs you`),(r="working",o.filter(e=>e.state===r).length&&"fixing"),(a="ready",o.filter(e=>e.state===a).length&&`${n="ready",o.filter(e=>e.state===n).length} ready`),(l="in-review",o.filter(e=>e.state===l).length&&`${i="in-review",o.filter(e=>e.state===i).length} in review`)].filter(Boolean);return`${e.prs.length>1?`${e.prs.length} PRs \xb7 `:""}${c.join(" \xb7 ")||"in review"}`}(e)}function o(e,s){let t=e.view?.state==="MERGED",r=t||e.view?.reviewDecision==="APPROVED"||"ready"===e.state;return[{label:"PR opened",done:!0,current:!1},...s?[{label:"Posted to Slack",done:!!e.slack,current:!e.slack}]:[],{label:"In review",done:r,current:!r},{label:"Approved",done:r,current:!1},{label:"Merged",done:t,current:r&&!t}]}function c(e){return[{label:"opening-pr"===e.phase?"Session is opening a PR":e.suggestion?"Waiting for you to open a PR":"Watching for code to ship",done:!1,current:!0},{label:"PR opened",done:!1,current:!1},{label:"In review",done:!1,current:!1},{label:"Approved",done:!1,current:!1},{label:"Merged",done:!1,current:!1}]}},2029:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>l,metadata:()=>a,viewport:()=>n});var r=t(9510);t(5023);let a={title:"Polyergon",description:"Run every Claude Code session from one screen",manifest:"/manifest.webmanifest",icons:{icon:[{url:"/icon.svg",type:"image/svg+xml"},{url:"/icon-192.png",sizes:"192x192"}],apple:"/apple-touch-icon.png"},appleWebApp:{capable:!0,title:"Polyergon",statusBarStyle:"black-translucent"}},n={themeColor:"#030712"};function l({children:e}){return r.jsx("html",{lang:"en",className:"dark",children:r.jsx("body",{className:"bg-gray-950 text-white antialiased",children:e})})}},3881:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a});var r=t(6621);let a=e=>[{type:"image/x-icon",sizes:"16x16",url:(0,r.fillMetadataSegment)(".",e.params,"favicon.ico")+""}]},5023:()=>{}};
1
+ exports.id=904,exports.ids=[904],exports.modules={5775:(e,s,t)=>{Promise.resolve().then(t.t.bind(t,2994,23)),Promise.resolve().then(t.t.bind(t,6114,23)),Promise.resolve().then(t.t.bind(t,9727,23)),Promise.resolve().then(t.t.bind(t,9671,23)),Promise.resolve().then(t.t.bind(t,1868,23)),Promise.resolve().then(t.t.bind(t,4759,23))},8196:()=>{},6620:(e,s,t)=>{"use strict";t.d(s,{G0:()=>d,Gz:()=>n,QO:()=>x,SC:()=>o});var r=t(326);t(7577);var a=t(1954);function n({s:e,onSend:s,onDismiss:t}){let a="open-pr"===e.kind?"Ready to open a PR?":"review"===e.kind?"New review feedback":"merge"===e.kind?"Approved and green: ready to merge":"CI is failing";return(0,r.jsxs)("div",{className:"mt-2 rounded-lg border border-amber-700/50 bg-amber-950/30 p-2.5",children:[r.jsx("p",{className:"text-xs font-medium text-amber-200",children:a}),r.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"Suggested message for the session:"}),(0,r.jsxs)("p",{className:"text-xs text-gray-200 mt-0.5 italic",children:["“",e.text,"”"]}),(0,r.jsxs)("div",{className:"flex gap-2 mt-2",children:[r.jsx("button",{onClick:s,className:"text-xs px-2.5 py-1 rounded-md bg-amber-600 hover:bg-amber-500 text-white",children:"merge"===e.kind?"Merge":"Send to session"}),r.jsx("button",{onClick:t,className:"text-xs px-2 py-1 rounded-md text-gray-400 hover:text-white",children:"Dismiss"})]})]})}t(444);let l={APPROVED:"✓",CHANGES_REQUESTED:"✗",COMMENTED:"\uD83D\uDCAC",DISMISSED:"–",PENDING:"…"},i={APPROVED:"text-emerald-300",CHANGES_REQUESTED:"text-red-300",COMMENTED:"text-gray-300"},o={"in-review":["in review","bg-blue-500/15 text-blue-300"],working:["session is fixing","bg-blue-500/15 text-blue-300"],ready:["ready to merge","bg-emerald-500/15 text-emerald-300"],done:["done","bg-gray-700 text-gray-300"],"needs-you":["needs you","bg-amber-500/15 text-amber-300"]};function c({steps:e}){return r.jsx("div",{className:"flex items-start my-3",children:e.map((e,s)=>(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center text-center relative",children:[s>0&&r.jsx("span",{className:`absolute top-1.5 right-1/2 w-full h-0.5 ${e.done||e.current?"bg-blue-500/60":"bg-gray-700"}`}),r.jsx("span",{className:`relative z-10 w-3.5 h-3.5 rounded-full border-2 ${e.done?"bg-emerald-500 border-emerald-500":e.current?"bg-gray-900 border-blue-400 animate-pulse":"bg-gray-900 border-gray-600"}`}),r.jsx("span",{className:`text-[10px] mt-1 leading-tight ${e.done?"text-gray-300":e.current?"text-blue-300":"text-gray-600"}`,children:e.label})]},e.label))})}function d({t:e,slackSet:s,max:t,onSend:d,onDismiss:x,auto:g}){let m=e.view,[p,h]=o[e.state];return(0,r.jsxs)("div",{className:"rounded-lg border border-gray-800 p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"text-sm font-medium text-gray-100 hover:underline truncate",children:m?.title||(0,a.QV)(e.url)}),r.jsx("span",{className:`ml-auto flex-shrink-0 px-2 py-0.5 rounded-full text-[10px] font-medium ${h}`,children:p})]}),r.jsx("div",{className:"flex items-center gap-2 mt-0.5",children:(0,r.jsxs)("p",{className:"text-[11px] text-gray-500",children:[(0,r.jsxs)("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline",children:[(0,a.QV)(e.url)," ↗"]}),m?.isDraft?" \xb7 draft":""," \xb7 review fixes ",e.reviewRounds,"/",t," \xb7 CI fixes ",e.ciFixes,"/",t]})}),e.suggestion&&d&&x&&r.jsx(n,{s:e.suggestion,onSend:d,onDismiss:x}),e.suggestion&&g&&"open-pr"!==e.suggestion.kind&&g[e.suggestion.kind]&&("merge"===e.suggestion.kind?(e.mergeAttempts??0)<1:("review"===e.suggestion.kind?e.reviewRounds:e.ciFixes)<t)&&r.jsx("p",{className:"text-[11px] text-amber-300/80 mt-1",children:"Automatic: this goes to the session as soon as it's idle."}),r.jsx(c,{steps:(0,a.UA)(e,s)}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[(0,r.jsxs)("div",{children:[r.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"GitHub"}),m?(0,r.jsxs)("ul",{className:"space-y-0.5",children:[m.reviews.map(e=>(0,r.jsxs)("li",{className:`flex gap-1.5 ${i[e.state]??"text-gray-300"}`,children:[r.jsx("span",{className:"w-3",children:l[e.state]??"•"}),e.login,r.jsx("span",{className:"text-gray-500 lowercase",children:e.state.replace("_"," ")})]},e.login)),m.requested.map(e=>(0,r.jsxs)("li",{className:"flex gap-1.5 text-gray-400",children:[r.jsx("span",{className:"w-3",children:"⏳"}),e,r.jsx("span",{className:"text-gray-600",children:"requested"})]},e)),!m.reviews.length&&!m.requested.length&&r.jsx("li",{className:"text-gray-500",children:"No reviewers yet"}),(0,r.jsxs)("li",{className:`pt-0.5 ${"failing"===m.checks?"text-red-300":"passing"===m.checks?"text-emerald-300":"text-gray-400"}`,children:["CI: ","none"===m.checks?"no checks":m.checks]})]}):r.jsx("p",{className:"text-gray-500",children:"Loading…"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:["Slack",e.slack?` \xb7 #${e.slack.channel}`:""]}),e.slack?(0,r.jsxs)("div",{className:"space-y-1",children:[e.slack.reviewers?.length?(0,r.jsxs)("p",{className:"text-gray-200",children:["\uD83D\uDC40 ",e.slack.reviewers.join(", ")]}):r.jsx("p",{className:"text-gray-500",children:e.slack.reviewers?"Nobody has claimed it yet":"Checking replies…"}),e.slack.replies?.slice(-2).map((e,s)=>r.jsxs("p",{className:"text-gray-400 line-clamp-2",children:[r.jsxs("span",{className:"text-gray-300",children:[e.user,":"]})," ",e.text]},s)),e.slack.permalink&&r.jsx("a",{href:e.slack.permalink,target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline",children:"Open thread"})]}):r.jsx("p",{className:"text-gray-500",children:s?"Posting…":"No channel set"})]})]})]})}let x=[["openPr","Open the PR","When the session has code to ship, ask it to commit, push and open a PR"],["review","Fix review comments","When reviewers comment, ask the session to address them, push and reply"],["ci","Fix failing CI","When CI fails, ask the session to fix it and push"],["merge","Merge when approved","When approved and CI is green, ask the session to merge (tried once automatically)"]]},9532:(e,s,t)=>{"use strict";t.d(s,{h:()=>n});var r=t(326),a=t(7577);function n({options:e,value:s,onChange:t,onPick:n,onEnter:l,placeholder:i,className:o}){let[c,d]=(0,a.useState)(!1),[x,g]=(0,a.useState)(0),m=s.toLowerCase().replace(/^#/,"").split(/\s+/).filter(Boolean),p=e.filter(e=>m.every(s=>e.label.toLowerCase().includes(s))).sort((e,s)=>Number(!e.label.toLowerCase().startsWith(m[0]??""))-Number(!s.label.toLowerCase().startsWith(m[0]??""))).slice(0,8);return(0,r.jsxs)("div",{className:"relative flex-1",children:[r.jsx("input",{value:s,placeholder:i,className:o,onChange:e=>{t(e.target.value),d(!0),g(0)},onFocus:()=>d(!0),onBlur:()=>setTimeout(()=>d(!1),120),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),d(!0),g(e=>Math.min(e+1,p.length-1))):"ArrowUp"===e.key?(e.preventDefault(),g(e=>Math.max(e-1,0))):"Escape"===e.key?d(!1):"Enter"===e.key&&(c&&p[x]&&s.trim()?(e.preventDefault(),n(p[x]),d(!1)):l?.())}}),c&&s.trim()&&p.length>0&&r.jsx("ul",{className:"absolute z-50 left-0 right-0 mt-1 bg-gray-900 border border-gray-700 rounded-md shadow-xl overflow-hidden",children:p.map((e,s)=>(0,r.jsxs)("li",{onMouseDown:s=>{s.preventDefault(),n(e),d(!1)},onMouseEnter:()=>g(s),className:`px-2.5 py-1.5 text-sm cursor-pointer flex items-center gap-2 ${s===x?"bg-blue-600/80 text-white":"text-gray-200"}`,children:[r.jsx("span",{className:"truncate flex-1",children:e.label}),e.hint&&r.jsx("span",{className:"text-[11px] opacity-60 flex-shrink-0",children:e.hint})]},e.id||e.label))})]})}},9952:(e,s,t)=>{"use strict";t.d(s,{C:()=>h});var r=t(326),a=t(7577),n=t(1954),l=t(444),i=t(6620);let o={"waiting-for-session":["Watching the session","bg-blue-500/15 text-blue-300 ring-blue-500/30"],"opening-pr":["Opening a PR","bg-blue-500/15 text-blue-300 ring-blue-500/30"],tracking:["Tracking PRs","bg-blue-500/15 text-blue-300 ring-blue-500/30"],done:["Done","bg-emerald-500/15 text-emerald-300 ring-emerald-500/30"],"needs-you":["Needs you","bg-amber-500/15 text-amber-300 ring-amber-500/30"],stopped:["Stopped","bg-gray-700/60 text-gray-300 ring-gray-600"]},c={APPROVED:["Approved","bg-emerald-500/15 text-emerald-300"],CHANGES_REQUESTED:["Changes requested","bg-red-500/15 text-red-300"],COMMENTED:["Commented","bg-gray-700/70 text-gray-300"],DISMISSED:["Dismissed","bg-gray-800 text-gray-500"],PENDING:["Pending","bg-gray-800 text-gray-400"]},d={passing:["●","text-emerald-400","Checks passing"],failing:["●","text-red-400","Checks failing"],pending:["◌","text-amber-300 animate-pulse","Checks running"],none:["○","text-gray-500","No checks"]};function x({login:e}){let[s,t]=(0,a.useState)(!1);return s||e.includes("[bot]")?r.jsx("span",{className:"w-7 h-7 rounded-full bg-gray-700 flex items-center justify-center text-xs font-semibold text-gray-200 flex-shrink-0",children:e[0]?.toUpperCase()}):r.jsx("img",{src:`https://github.com/${encodeURIComponent(e)}.png?size=56`,alt:"",onError:()=>t(!0),className:"w-7 h-7 rounded-full bg-gray-800 flex-shrink-0"})}function g({steps:e,working:s=!1}){return r.jsx("div",{className:"flex items-start py-2",children:e.map((e,t)=>(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center text-center relative min-w-0",children:[t>0&&r.jsx("span",{className:`absolute top-4 right-1/2 w-full h-[3px] rounded-full ${e.done||e.current?"bg-gradient-to-r from-emerald-500 to-blue-500":"bg-gray-800"}`}),(0,r.jsxs)("span",{className:`relative z-10 w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold ring-4 ring-gray-950 ${e.done?"bg-emerald-500 text-gray-950":e.current?"bg-blue-500 text-white shadow-[0_0_0_6px_rgba(59,130,246,0.18)]":"bg-gray-800 text-gray-500"}`,children:[e.done?"✓":t+1,e.current&&s&&r.jsx("span",{className:"absolute -inset-1.5 rounded-full border-2 border-blue-300 border-t-transparent border-l-transparent animate-spin motion-reduce:animate-none","aria-hidden":!0})]}),r.jsx("span",{className:`text-xs mt-2 px-1 leading-tight ${e.done?"text-gray-200":e.current?"text-blue-300 font-medium":"text-gray-600"}`,children:e.label}),e.current&&s&&r.jsx("span",{className:"text-[10px] text-blue-300/80 animate-pulse motion-reduce:animate-none",children:"Session is working"})]},e.label))})}function m({title:e,children:s,right:t}){return(0,r.jsxs)("div",{className:"rounded-lg bg-gray-950/60 border border-gray-800/80 p-3.5 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center mb-2.5",children:[r.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider",children:e}),r.jsx("span",{className:"ml-auto",children:t})]}),s]})}function p({t:e,p:s,auto:t,onSend:a,onDismiss:l}){let o=e.view,[p,h]=i.SC[e.state],u=s.config.maxRounds,b=d[o?.checks??"none"]??d.none,y=e.suggestion&&"open-pr"!==e.suggestion.kind&&t[e.suggestion.kind];return(0,r.jsxs)("article",{className:"rounded-2xl border border-gray-800 bg-gradient-to-b from-gray-900/80 to-gray-900/30 p-5 shadow-lg shadow-black/20",children:[(0,r.jsxs)("header",{className:"flex items-start gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[r.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"text-base font-semibold text-gray-100 hover:text-blue-300 leading-snug",children:o?.title||(0,n.QV)(e.url)}),(0,r.jsxs)("p",{className:"text-xs text-gray-500 mt-1 flex flex-wrap gap-x-2",children:[r.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"font-mono text-blue-400 hover:underline",children:(0,n.QV)(e.url)}),o?.isDraft&&r.jsx("span",{className:"text-amber-300",children:"\xb7 draft"}),!!o?.unresolved&&(0,r.jsxs)("span",{className:"text-amber-300",children:["\xb7 ",o.unresolved," unresolved thread",o.unresolved>1?"s":""]}),(0,r.jsxs)("span",{children:["\xb7 review fixes ",e.reviewRounds,"/",u]}),(0,r.jsxs)("span",{children:["\xb7 CI fixes ",e.ciFixes,"/",u]})]})]}),r.jsx("span",{className:`flex-shrink-0 px-2.5 py-1 rounded-full text-[11px] font-medium ${h}`,children:p}),r.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"flex-shrink-0 text-xs px-3 py-1 rounded-lg border border-gray-700 hover:bg-gray-800 text-gray-200",children:"Open PR ↗"})]}),r.jsx("div",{className:"mt-4",children:r.jsx(g,{steps:(0,n.UA)(e,!!s.config.slackChannel),working:"working"===e.state})}),e.suggestion&&r.jsx("div",{className:"mt-2",children:r.jsx(i.Gz,{s:e.suggestion,onSend:a,onDismiss:l})}),y&&r.jsx("p",{className:"text-[11px] text-amber-300/80 mt-1.5",children:"Automatic: goes to the session as soon as it's idle."}),(0,r.jsxs)("div",{className:"grid sm:grid-cols-3 gap-3 mt-4",children:[r.jsx(m,{title:"Reviewers",children:o?(0,r.jsxs)("ul",{className:"space-y-2",children:[o.reviews.map(e=>{let[s,t]=c[e.state]??[e.state.toLowerCase(),"bg-gray-800 text-gray-400"];return(0,r.jsxs)("li",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(x,{login:e.login}),r.jsx("span",{className:"text-sm text-gray-200 truncate",children:e.login}),r.jsx("span",{className:`ml-auto text-[10px] px-1.5 py-0.5 rounded-full whitespace-nowrap ${t}`,children:s})]},e.login)}),o.requested.map(e=>(0,r.jsxs)("li",{className:"flex items-center gap-2 min-w-0 opacity-70",children:[r.jsx(x,{login:e}),r.jsx("span",{className:"text-sm text-gray-300 truncate",children:e}),r.jsx("span",{className:"ml-auto text-[10px] px-1.5 py-0.5 rounded-full bg-gray-800 text-gray-400 whitespace-nowrap",children:"Requested"})]},e)),!o.reviews.length&&!o.requested.length&&r.jsx("li",{className:"text-xs text-gray-500",children:"No reviewers yet"})]}):r.jsx("p",{className:"text-xs text-gray-500 animate-pulse",children:"Loading from GitHub…"})}),(0,r.jsxs)(m,{title:"CI",children:[(0,r.jsxs)("p",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:`text-lg leading-none ${b[1]}`,children:b[0]}),r.jsx("span",{className:"text-gray-200",children:b[2]})]}),o&&(0,r.jsxs)("p",{className:"text-[11px] text-gray-500 mt-2",children:["Updated ",new Date(o.fetchedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),r.jsx(m,{title:`Slack${e.slack?` \xb7 #${e.slack.channel}`:""}`,right:e.slack?.permalink&&r.jsx("a",{href:e.slack.permalink,target:"_blank",rel:"noreferrer",className:"text-[11px] text-blue-400 hover:underline",children:"Open thread ↗"}),children:e.slack?(0,r.jsxs)("div",{className:"space-y-1.5 text-xs",children:[e.slack.reviewers?.length?(0,r.jsxs)("p",{className:"text-gray-100",children:["\uD83D\uDC40 ",e.slack.reviewers.join(", ")]}):r.jsx("p",{className:"text-gray-500",children:e.slack.reviewers?"Nobody has claimed it yet":"Checking replies…"}),e.slack.replies?.slice(-2).map((e,s)=>r.jsxs("p",{className:"text-gray-400 line-clamp-2",children:[r.jsx("span",{className:"text-gray-300 font-medium",children:e.user})," ",e.text]},s))]}):r.jsx("p",{className:"text-xs text-gray-500",children:s.config.slackChannel?"Posting…":"No channel set"})})]})]})}function h({sessionName:e,pipeline:s,error:t,onOpenSession:c,onReview:d,onStart:x,onStop:m,onAddPr:h,onAct:u,onDismiss:b,onSetAuto:y}){let[f,j]=(0,a.useState)(""),[N,v]=(0,a.useState)(null),[k,w]=(0,a.useState)(3),[C,S]=(0,a.useState)(n.dc),[R,P]=(0,a.useState)(""),D=(0,n.An)(s),$=D&&s?{...n.dc,...s.config.auto}:C,E=(e,t)=>D&&s?y(s.id,{[e]:t}):S(s=>({...s,[e]:t})),[A,I]=s?o[s.phase]:["Not running","bg-gray-800 text-gray-400 ring-gray-700"],M="w-full bg-gray-900 border border-gray-700 focus:border-blue-500 rounded-lg px-3 py-2 text-sm text-white outline-none placeholder-gray-500";return(0,r.jsxs)("div",{className:"absolute inset-0 overflow-y-auto bg-gray-950 text-gray-100",children:[(0,r.jsxs)("div",{className:"relative border-b border-gray-800 bg-gradient-to-br from-blue-950/50 via-gray-950 to-emerald-950/20 px-8 pt-7 pb-6",children:[r.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.2em] text-blue-300/80",children:"⚡ Ship it pipeline"}),(0,r.jsxs)("div",{className:"flex items-start gap-4 mt-2 flex-wrap",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[r.jsx("h1",{className:"text-2xl font-semibold truncate",children:e}),r.jsx("p",{className:"text-sm text-gray-400 mt-1",children:s?(0,n.Vm)(s):"Set it up once: it opens the PR, posts it for review, fixes feedback and CI, and asks you before merging."})]}),r.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ring-1 ring-inset ${I}`,children:A}),(0,r.jsxs)("div",{className:"flex gap-2",children:[d&&r.jsx("button",{onClick:d,className:"text-sm px-3.5 py-1.5 rounded-lg border border-gray-700 bg-gray-900/60 hover:bg-gray-800",children:"Review changes"}),r.jsx("button",{onClick:c,className:"text-sm px-3.5 py-1.5 rounded-lg border border-gray-700 bg-gray-900/60 hover:bg-gray-800",children:"Open session"}),D?r.jsx("button",{onClick:()=>m(s.id),className:"text-sm px-3.5 py-1.5 rounded-lg border border-red-900/70 text-red-300 hover:bg-red-950/50",children:"Stop"}):r.jsx("button",{onClick:function(){let e=(N?.name??f).replace(/^#/,"").trim();x({slackChannel:e?{id:N?.id??"",name:e}:null,maxRounds:k,auto:C})},className:"text-sm px-3.5 py-1.5 rounded-lg bg-blue-600 hover:bg-blue-500 font-medium",children:s?"Start again":"Start pipeline"})]})]}),s&&!s.prs.length&&D&&r.jsx("div",{className:"mt-5 max-w-3xl",children:r.jsx(g,{steps:(0,n.YY)(s),working:"opening-pr"===s.phase})}),t&&r.jsx("p",{className:"text-sm text-red-400 mt-3",children:t})]}),(0,r.jsxs)("div",{className:"px-8 py-6 grid gap-6 xl:grid-cols-[minmax(0,1fr)_340px]",children:[(0,r.jsxs)("div",{className:"space-y-5 min-w-0",children:[s?.suggestion&&r.jsx(i.Gz,{s:s.suggestion,onSend:()=>u(s.id,null),onDismiss:()=>b(s.id,null)}),s?.prs.map(e=>r.jsx(p,{t:e,p:s,auto:$,onSend:()=>u(s.id,e.url),onDismiss:()=>b(s.id,e.url)},e.url)),D&&s&&(0,r.jsxs)("div",{className:"flex gap-2",children:[r.jsx("input",{value:R,onChange:e=>P(e.target.value),placeholder:"Track another PR: https://github.com/org/repo/pull/123",className:M}),r.jsx("button",{onClick:()=>{h(s.id,R),P("")},disabled:!R.trim(),className:"text-sm px-4 rounded-lg border border-gray-700 hover:bg-gray-800 disabled:opacity-40 flex-shrink-0",children:"Add PR"})]}),!D&&(0,r.jsxs)("div",{className:"rounded-2xl border border-gray-800 bg-gray-900/40 p-5 space-y-4",children:[r.jsx("h2",{className:"text-sm font-semibold",children:"Set up"}),(0,r.jsxs)("label",{className:"block text-xs text-gray-400",children:['Slack channel for "ready for review" (optional)',r.jsx("div",{className:"mt-1",children:r.jsx(l.a,{value:f,onChange:(e,s)=>{j(e),v(s)},className:M})})]}),(0,r.jsxs)("label",{className:"block text-xs text-gray-400",children:["Fix rounds per PR (review and CI, each)",r.jsx("input",{type:"number",min:1,max:10,value:k,onChange:e=>w(Number(e.target.value)),className:`${M} w-24 mt-1`})]})]})]}),(0,r.jsxs)("aside",{className:"space-y-5",children:[(0,r.jsxs)("section",{className:"rounded-2xl border border-gray-800 bg-gray-900/40 p-4",children:[r.jsx("h2",{className:"text-sm font-semibold",children:"Steps"}),r.jsx("p",{className:"text-[11px] text-gray-500 mb-3",children:"Automatic steps run when the session is idle. Approving is always up to your reviewers."}),r.jsx("div",{className:"space-y-2",children:i.QO.map(([e,s,t])=>(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",title:t,children:[r.jsx("span",{className:"text-sm text-gray-200",children:s}),(0,r.jsxs)("span",{className:"flex rounded-lg border border-gray-700 overflow-hidden text-[11px] flex-shrink-0",children:[r.jsx("button",{onClick:()=>E(e,!0),className:`px-2.5 py-1 ${$[e]?"bg-blue-600 text-white":"text-gray-400 hover:bg-gray-800"}`,children:"Auto"}),r.jsx("button",{onClick:()=>E(e,!1),className:`px-2.5 py-1 ${$[e]?"text-gray-400 hover:bg-gray-800":"bg-gray-700 text-white"}`,children:"Ask me"})]})]},e))}),s&&(0,r.jsxs)("p",{className:"text-[11px] text-gray-500 mt-3",children:["Slack: ",s.config.slackChannel?`#${s.config.slackChannel.name}`:"none"," \xb7 up to ",s.config.maxRounds," fix rounds per PR"]})]}),s&&(0,r.jsxs)("section",{className:"rounded-2xl border border-gray-800 bg-gray-900/40 p-4",children:[r.jsx("h2",{className:"text-sm font-semibold mb-3",children:"Activity"}),r.jsx("ol",{className:"relative border-l border-gray-800 ml-1.5 space-y-3 max-h-[60vh] overflow-y-auto pr-1",children:[...s.log].reverse().map((e,s)=>(0,r.jsxs)("li",{className:"pl-4 relative",children:[r.jsx("span",{className:`absolute -left-[5px] top-1.5 w-2.5 h-2.5 rounded-full ${0===s?"bg-blue-400":"bg-gray-700"}`}),r.jsx("p",{className:"text-xs text-gray-200 leading-snug",children:e.text}),r.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5",children:new Date(e.t).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]},s))})]})]})]})]})}},444:(e,s,t)=>{"use strict";t.d(s,{a:()=>o});var r=t(326),a=t(7577),n=t(9532),l=t(3814),i=t(9849);function o({value:e,onChange:s,onEnter:t,className:o}){let[c,d]=(0,a.useState)([]),[x,g]=(0,a.useState)("loading"),[m,p]=(0,a.useState)(""),[h,u]=(0,a.useState)("other");function b(e=!1){g("loading"),fetch((0,l.X)(`/api/slack/channels${e?"?refresh=1":""}`)).then(async e=>{let s=await e.json();if(!e.ok)throw u(s.problem??"other"),Error(s.error);d(s.channels),g("ready")}).catch(e=>{p(e.message||"Could not load channels"),g("error")})}let y=e=>s(e,c.find(s=>s.name===e.replace(/^#/,""))??null);return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex gap-1.5",children:[r.jsx(n.h,{options:c.map(e=>({id:e.id||e.name,label:e.name})),value:e,onChange:y,onPick:e=>y(e.label),onEnter:t,placeholder:"loading"===x?"Loading your channels…":"Type to find a channel",className:o}),r.jsx("button",{onClick:()=>b(!0),disabled:"loading"===x,title:"Reload channels from Slack",className:"px-2 rounded-md border border-gray-700 text-gray-400 hover:text-white disabled:opacity-40 text-xs flex-shrink-0",children:"loading"===x?"…":"↻"})]}),"loading"===x&&r.jsx("p",{className:"text-[11px] text-gray-500 mt-1",children:"Asking Slack for your channels. The first time can take up to 2 minutes…"}),"ready"===x&&(0,r.jsxs)("p",{className:"text-[11px] text-gray-600 mt-1",children:[c.length," channels"]}),"error"===x&&r.jsx(i.hR,{compact:!0,problem:h,detail:m,org:"this org",onRetry:()=>b(!0)})]})}},9849:(e,s,t)=>{"use strict";t.d(s,{hR:()=>i,w0:()=>n});var r=t(326);let a=()=>window.dispatchEvent(new Event("polyergon:connect-slack")),n=()=>window.dispatchEvent(new Event("polyergon:claude-login")),l={auth:{title:e=>`Slack isn't signed in for ${e}`,why:"Polyergon's background checks use this org's \"claude.ai Slack\" connector, and it isn't signed in. (A Slack plugin working in your sessions doesn't cover background runs.)",fix:'Click Connect Slack: a new session opens in this org with /mcp. Choose "claude.ai Slack" and sign in, then come back and Retry.'},missing:{title:e=>`Slack isn't set up for ${e}`,why:"This org's Claude setup has no Slack connector, so Polyergon can't read or post to Slack for it.",fix:"Add the Slack connector to this org (claude.ai → Settings → Connectors, or /mcp in a session of this org), then Retry."},other:{title:()=>"Couldn't reach Slack",why:"Slack or the connector returned an error.",fix:"Retry in a minute. If it keeps failing, open a session in this org and run /mcp to check the Slack connector."}};function i({problem:e,detail:s,org:t,onRetry:n,compact:i=!1}){let o=l[e]??l.other;return(0,r.jsxs)("div",{className:`rounded-lg border border-amber-800/60 bg-amber-950/30 ${i?"px-2.5 py-2 mt-1":"px-4 py-3"} text-xs`,children:[r.jsx("p",{className:`font-medium text-amber-200 ${i?"":"text-sm"}`,children:o.title(t)}),!i&&r.jsx("p",{className:"text-gray-300 mt-1",children:o.why}),r.jsx("p",{className:"text-gray-400 mt-1",children:o.fix}),s&&!i&&(0,r.jsxs)("p",{className:"text-gray-500 mt-1 italic line-clamp-2",children:["Claude said: ",s]}),(0,r.jsxs)("div",{className:"flex gap-2 mt-2",children:["other"!==e&&r.jsx("button",{onClick:a,className:"px-2.5 py-1 rounded-md bg-amber-600 hover:bg-amber-500 text-white",children:"Connect Slack"}),r.jsx("button",{onClick:n,className:"px-2.5 py-1 rounded-md border border-gray-700 text-gray-200 hover:bg-gray-800",children:"Retry"})]})]})}},3814:(e,s,t)=>{"use strict";t.d(s,{X:()=>n,n:()=>a});let r="default";function a(e){r="all"===e?"default":e}function n(e){return`${e}${e.includes("?")?"&":"?"}org=${encodeURIComponent(r)}`}},1954:(e,s,t)=>{"use strict";t.d(s,{An:()=>n,QV:()=>l,UA:()=>o,Vm:()=>i,YY:()=>c,dc:()=>r});let r={openPr:!0,review:!0,ci:!0,merge:!1},a=["waiting-for-session","opening-pr","tracking"],n=e=>!!e&&a.includes(e.phase),l=e=>e.replace(/^https:\/\/github\.com\//,"").replace("/pull/","#");function i(e){let s=(e.suggestion?1:0)+e.prs.filter(e=>e.suggestion).length;return(s?`${s} suggestion${s>1?"s":""} for you \xb7 `:"")+function(e){let s,t,r,a,n,l,i;if("waiting-for-session"===e.phase)return"watching for a PR";if("opening-pr"===e.phase)return"session is opening a PR";if("stopped"===e.phase)return"stopped";if("needs-you"===e.phase&&!e.prs.length)return"needs you";if("done"===e.phase)return e.prs.length>1?`${e.prs.length} PRs done`:"done";let o=e.prs.filter(e=>"done"!==e.state),c=[(s="needs-you",o.filter(e=>e.state===s).length&&`${t="needs-you",o.filter(e=>e.state===t).length} needs you`),(r="working",o.filter(e=>e.state===r).length&&"fixing"),(a="ready",o.filter(e=>e.state===a).length&&`${n="ready",o.filter(e=>e.state===n).length} ready`),(l="in-review",o.filter(e=>e.state===l).length&&`${i="in-review",o.filter(e=>e.state===i).length} in review`)].filter(Boolean);return`${e.prs.length>1?`${e.prs.length} PRs \xb7 `:""}${c.join(" \xb7 ")||"in review"}`}(e)}function o(e,s){let t=e.view?.state==="MERGED",r=t||e.view?.reviewDecision==="APPROVED"||"ready"===e.state;return[{label:"PR opened",done:!0,current:!1},...s?[{label:"Posted to Slack",done:!!e.slack,current:!e.slack}]:[],{label:"In review",done:r,current:!r},{label:"Approved",done:r,current:!1},{label:"Merged",done:t,current:r&&!t}]}function c(e){return[{label:"opening-pr"===e.phase?"Session is opening a PR":e.suggestion?"Waiting for you to open a PR":"Watching for code to ship",done:!1,current:!0},{label:"PR opened",done:!1,current:!1},{label:"In review",done:!1,current:!1},{label:"Approved",done:!1,current:!1},{label:"Merged",done:!1,current:!1}]}},2029:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>l,metadata:()=>a,viewport:()=>n});var r=t(9510);t(5023);let a={title:"Polyergon",description:"Run every Claude Code session from one screen",manifest:"/manifest.webmanifest",icons:{icon:[{url:"/icon.svg",type:"image/svg+xml"},{url:"/icon-192.png",sizes:"192x192"}],apple:"/apple-touch-icon.png"},appleWebApp:{capable:!0,title:"Polyergon",statusBarStyle:"black-translucent"}},n={themeColor:"#030712"};function l({children:e}){return r.jsx("html",{lang:"en",className:"dark",children:r.jsx("body",{className:"bg-gray-950 text-white antialiased",children:e})})}},3881:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a});var r=t(6621);let a=e=>[{type:"image/x-icon",sizes:"16x16",url:(0,r.fillMetadataSegment)(".",e.params,"favicon.ico")+""}]},5023:()=>{}};