copilot-operator 0.1.38 → 0.1.40

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 (55) hide show
  1. package/dist/src/api/operator.controller.js +128 -2
  2. package/dist/src/api/operator.service.js +473 -39
  3. package/dist/src/api/server.js +7 -0
  4. package/dist/src/log/terminal.js +145 -0
  5. package/dist/src/orchestrator/contract.js +77 -6
  6. package/dist/src/plan/brief.js +1375 -1369
  7. package/dist/src/plan/schema.js +5 -0
  8. package/dist/src/plan/systemGuide.js +218 -20
  9. package/dist/src/session/exports.js +1 -0
  10. package/dist/src/session/startFailure.js +91 -0
  11. package/dist/src/vcs/prepareFromRemote.js +7 -20
  12. package/dist/src/vcs/remoteAuth.js +26 -1
  13. package/dist/src/vcs/runPreflight.js +31 -14
  14. package/dist/src/vcs/snapshot.js +3 -1
  15. package/dist/src/vcs/startChoice.js +295 -0
  16. package/dist/src/vcs/taskVcs.js +61 -5
  17. package/dist/web/404.html +2 -2
  18. package/dist/web/_next/static/chunks/499-28e118e33ce07935.js +1 -0
  19. package/dist/web/_next/static/chunks/{549-7e35e4fdefadb05d.js → 549-f295c8429e83b25b.js} +1 -1
  20. package/dist/web/_next/static/chunks/584-578be94a0786334b.js +1 -0
  21. package/dist/web/_next/static/chunks/867-8dc5bbb092ca2c5c.js +1 -0
  22. package/dist/web/_next/static/chunks/app/history/page-9f69ccde726c9be2.js +1 -0
  23. package/dist/web/_next/static/chunks/app/layout-73f28bc065a46ed3.js +1 -0
  24. package/dist/web/_next/static/chunks/app/page-e557d58476ae6383.js +1 -0
  25. package/dist/web/_next/static/chunks/app/sessions/view/page-0485ee7f781156ec.js +1 -0
  26. package/dist/web/_next/static/chunks/app/system/{page-5ae1f8054208e6eb.js → page-227a259e383ca2a0.js} +1 -1
  27. package/dist/web/_next/static/css/cea7913ba416dbb7.css +1 -0
  28. package/dist/web/appearance.html +2 -2
  29. package/dist/web/appearance.txt +28 -26
  30. package/dist/web/defaults.html +2 -2
  31. package/dist/web/defaults.txt +28 -26
  32. package/dist/web/history.html +2 -2
  33. package/dist/web/history.txt +28 -26
  34. package/dist/web/import.html +2 -2
  35. package/dist/web/import.txt +28 -26
  36. package/dist/web/index.html +2 -2
  37. package/dist/web/index.txt +28 -26
  38. package/dist/web/level1.html +2 -2
  39. package/dist/web/level1.txt +28 -26
  40. package/dist/web/presets.html +2 -2
  41. package/dist/web/presets.txt +28 -26
  42. package/dist/web/sessions/view.html +2 -2
  43. package/dist/web/sessions/view.txt +28 -26
  44. package/dist/web/system.html +2 -2
  45. package/dist/web/system.txt +28 -26
  46. package/package.json +158 -156
  47. package/dist/web/_next/static/chunks/36-94660f1cde2da529.js +0 -1
  48. package/dist/web/_next/static/chunks/867-d4f5bd8c5805bffb.js +0 -1
  49. package/dist/web/_next/static/chunks/app/history/page-a0bd59986f7c8beb.js +0 -1
  50. package/dist/web/_next/static/chunks/app/layout-630b663626cebe4a.js +0 -1
  51. package/dist/web/_next/static/chunks/app/page-4defcfd1eb482644.js +0 -1
  52. package/dist/web/_next/static/chunks/app/sessions/view/page-ce99494b1997ee25.js +0 -1
  53. package/dist/web/_next/static/css/c37978b44194c37b.css +0 -1
  54. /package/dist/web/_next/static/{8C2D7RnTerPO3g_WyLEC3 → Y9tuV5LV-O0XyCREkeGc5}/_buildManifest.js +0 -0
  55. /package/dist/web/_next/static/{8C2D7RnTerPO3g_WyLEC3 → Y9tuV5LV-O0XyCREkeGc5}/_ssgManifest.js +0 -0
package/dist/web/404.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--8C2D7RnTerPO3g_WyLEC3--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/c37978b44194c37b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-d4f5bd8c5805bffb.js" async=""></script><script src="/_next/static/chunks/549-7e35e4fdefadb05d.js" async=""></script><script src="/_next/static/chunks/app/layout-630b663626cebe4a.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
1
+ <!DOCTYPE html><!--Y9tuV5LV_O0XyCREkeGc5--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/cea7913ba416dbb7.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-8dc5bbb092ca2c5c.js" async=""></script><script src="/_next/static/chunks/549-f295c8429e83b25b.js" async=""></script><script src="/_next/static/chunks/499-28e118e33ce07935.js" async=""></script><script src="/_next/static/chunks/app/layout-73f28bc065a46ed3.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
2
2
  (function () {
3
3
  try {
4
4
  var d = document.documentElement;
@@ -13,4 +13,4 @@
13
13
  d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
14
14
  } catch (e) {}
15
15
  })();
16
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d4f5bd8c5805bffb.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-630b663626cebe4a.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d4f5bd8c5805bffb.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-630b663626cebe4a.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d4f5bd8c5805bffb.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-630b663626cebe4a.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d4f5bd8c5805bffb.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-630b663626cebe4a.js\"],\"SkipLink\"]\n6:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d4f5bd8c5805bffb.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-630b663626cebe4a.js\"],\"\"]\n7:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d4f5bd8c5805bffb.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-630b663626cebe4a.js\"],\"Nav\"]\n8:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d4f5bd8c5805bffb.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-630b663626cebe4a.js\"],\"GlobalApprovals\"]\n9:I[5204,[],\"\"]\na:I[2642,[],\"\"]\nb:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d4f5bd8c5805bffb.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-630b663626cebe4a.js\"],\"ScrollJump\"]\nc:I[433,[],\"OutletBoundary\"]\ne:I[9884,[],\"AsyncMetadataOutlet\"]\n10:I[433,[],\"ViewportBoundary\"]\n12:I[433,[],\"MetadataBoundary\"]\n13:\"$Sreact.suspense\"\n15:I[3536,[],\"\"]\n:HL[\"/_next/static/css/c37978b44194c37b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"8C2D7RnTerPO3g_WyLEC3\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c37978b44194c37b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\n var a = raw ? JSON.parse(raw) : {};\\n if (!a || typeof a !== 'object') a = {};\\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\\n d.dataset.textsize = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 0 ? a.textSize : 'normal';\\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\\n } catch (e) {}\\n})();\\n\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L6\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L7\",null,{}]]}],[\"$\",\"$L8\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lb\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$Lc\",null,{\"children\":[\"$Ld\",[\"$\",\"$Le\",null,{\"promise\":\"$@f\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L10\",null,{\"children\":\"$L11\"}],null],[\"$\",\"$L12\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$13\",null,{\"fallback\":null,\"children\":\"$L14\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$15\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"11:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nd:null\n"])</script><script>self.__next_f.push([1,"f:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"14:\"$f:metadata\"\n"])</script></body></html>
16
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"SkipLink\"]\n6:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"\"]\n7:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"Nav\"]\n8:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"GlobalApprovals\"]\n9:I[3069,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\","])</script><script>self.__next_f.push([1,"\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"StartFailureBanner\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"ScrollJump\"]\nd:I[1701,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-8dc5bbb092ca2c5c.js\",\"549\",\"static/chunks/549-f295c8429e83b25b.js\",\"499\",\"static/chunks/499-28e118e33ce07935.js\",\"177\",\"static/chunks/app/layout-73f28bc065a46ed3.js\"],\"StartDialogHost\"]\ne:I[433,[],\"OutletBoundary\"]\n10:I[9884,[],\"AsyncMetadataOutlet\"]\n12:I[433,[],\"ViewportBoundary\"]\n14:I[433,[],\"MetadataBoundary\"]\n15:\"$Sreact.suspense\"\n17:I[3536,[],\"\"]\n:HL[\"/_next/static/css/cea7913ba416dbb7.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"Y9tuV5LV-O0XyCREkeGc5\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/cea7913ba416dbb7.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\n var a = raw ? JSON.parse(raw) : {};\\n if (!a || typeof a !== 'object') a = {};\\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\\n d.dataset.textsize = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 0 ? a.textSize : 'normal';\\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\\n } catch (e) {}\\n})();\\n\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L6\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L7\",null,{}]]}],[\"$\",\"$L8\",null,{}],[\"$\",\"$L9\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lc\",null,{}],[\"$\",\"$Ld\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$Le\",null,{\"children\":[\"$Lf\",[\"$\",\"$L10\",null,{\"promise\":\"$@11\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L12\",null,{\"children\":\"$L13\"}],null],[\"$\",\"$L14\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$15\",null,{\"fallback\":null,\"children\":\"$L16\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$17\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nf:null\n"])</script><script>self.__next_f.push([1,"11:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"16:\"$11:metadata\"\n"])</script></body></html>
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[499],{1035:(e,l,s)=>{s.d(l,{DialogHost:()=>d,Z:()=>c});var t=s(3365),n=s(1521),a=s(867),r=s(4969);let i=null,o=[];function c(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(s=>{var t;return t={kind:"confirm",message:e,...l,resolve:s},void(i?i(t):o.push(t))})}function d(e){var l,s;let{children:c}=e,{t:d}=(0,a.kj)(),[h,u]=(0,n.useState)([]),m=(0,n.useRef)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(i=e=>u(l=>[...l,e]),o.length>0){let e=o.splice(0,o.length);u(l=>[...l,...e])}return()=>{i=null}},[]);let g=h[0],x=(0,n.useCallback)(e=>{g&&(g.resolve(e),u(e=>e.slice(1)))},[g]);return(0,r.V)(p,!!g,m),(0,n.useEffect)(()=>{if(!g)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),x(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,x]),(0,t.jsxs)(t.Fragment,{children:[c,g&&(0,t.jsx)("div",{className:"modal-backdrop",onClick:()=>x(!1),role:"presentation",children:(0,t.jsxs)("div",{ref:p,className:"modal".concat(g.danger?" danger":""),role:"confirm"===g.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("h2",{id:"modal-title",children:null!=(l=g.title)?l:d("confirm"===g.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,t.jsx)("div",{id:"modal-body",className:"modal-body",children:g.message}),(0,t.jsxs)("div",{className:"row modal-actions",children:["confirm"===g.kind&&(0,t.jsx)("button",{type:"button",className:"quiet",onClick:()=>x(!1),children:d("dialog.cancel")}),(0,t.jsx)("button",{ref:m,type:"button",className:g.danger?"danger":"primary",onClick:()=>x(!0),children:null!=(s=g.okLabel)?s:d("dialog.ok")})]})]})})]})}},1701:(e,l,s)=>{s.d(l,{L:()=>m,StartDialogHost:()=>p});var t=s(3365),n=s(1521),a=s(5549),r=s(867),i=s(4969),o=s(3486),c=s(3069);let d=null,h=[],u=1;function m(e){return new Promise(l=>{let s={...e,id:u++,resolve:l};d?d(s):h.push(s)})}function p(){let[e,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(d=e=>l(l=>[...l,e]),h.length>0){let e=h.splice(0,h.length);l(l=>[...l,...e])}return()=>{d=null}},[]);let s=e[0];return s?(0,t.jsx)(x,{req:s,onDone:e=>{s.resolve(e),l(e=>e.slice(1))}},s.id):null}let g=e=>e.trim().replace(/[\\/]+$/,"").replace(/\//g,"\\").toLowerCase();function x(e){var l,s,d,h,u;let{req:m,onDone:p}=e,{t:x}=(0,r.kj)(),f=(0,r.W3)(),j=(0,n.useId)(),v=(0,n.useRef)(null),b=(0,n.useRef)(null),[y,k]=(0,n.useState)(null),[w,N]=(0,n.useState)(""),[F,C]=(0,n.useState)({}),[B,S]=(0,n.useState)({}),[D,E]=(0,n.useState)({kind:"choose"}),[T,H]=(0,n.useState)(""),[W,I]=(0,n.useState)(""),[L,R]=(0,n.useState)({}),[A,O]=(0,n.useState)([]),[P,q]=(0,n.useState)(!1),z=(0,n.useRef)(new Set),V=(0,n.useRef)(void 0),K=e=>p({started:e,...V.current?{reply:V.current}:{}}),U="fetching"===D.kind||"starting"===D.kind||""!==W,_=()=>a.FH.startOptions(m.sessionIds).then(e=>{k(e);let l={};for(let s of e.repos)l[g(s.repoDir)]=s;C(l);let s={};for(let t of e.sessions){if(!t.vcs||t.fixed||!t.repoDir)continue;let e=function(e,l){var s,t,n,a,r,i,o;let c=null!=(r=null!=(a=null==l||null==(s=l.remotes.find(e=>"origin"===e.name))?void 0:s.name)?a:null==l||null==(t=l.remotes[0])?void 0:t.name)?r:"",d=null!=(o=null!=(i=null==l?void 0:l.current)?i:null==l||null==(n=l.local[0])?void 0:n.name)?o:"main";return e?"previous-session"===e.from?{from:"previous-session",local:d,remote:c,remoteBranch:d,onBranch:!1}:"local"===e.from?{from:"local",local:e.branch,remote:c,remoteBranch:e.branch,onBranch:!!e.onBranch}:{from:"remote",local:(null==l?void 0:l.local.some(l=>l.name===e.branch))?e.branch:d,remote:e.remote,remoteBranch:e.branch,onBranch:!!e.onBranch}:{from:"local",local:d,remote:c,remoteBranch:"main",onBranch:!1}}(t.choice,l[g(t.repoDir)]);s[t.id]=t.prepared?{...e,from:"keep"}:e}S(s)}).catch(e=>N(e.message));(0,n.useEffect)(()=>{_()},[m.sessionIds]),(0,i.V)(v,!0,b),(0,n.useEffect)(()=>{let e=e=>{"Escape"===e.key&&!e.defaultPrevented&&(e.preventDefault(),U||K(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[U,K]);let X=e=>e?F[g(e)]:void 0,J=(e,l)=>S(s=>({...s,[e]:{...s[e],...l}})),M=e=>{e&&C(l=>({...l,[g(e.repoDir)]:e}))},Z=()=>{a.FH.runVcs(m.sessionIds).then(O).catch(()=>O([]))},$=()=>{z.current.clear(),E({kind:"choose"})},G=async function(){var e;let l,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};H("");let t=(()=>{var e,l;let s={},t=new Map;for(let n of null!=(e=null==y?void 0:y.sessions)?e:[]){let e=B[n.id],a=X(n.repoDir);if(e&&n.repoDir&&a&&!a.problem&&"keep"!==e.from)if("previous-session"===e.from)s[n.id]={from:"previous-session"};else if("local"===e.from){if(!e.local||!a.local.some(l=>l.name===e.local))return{problem:x("startdlg.needBranch",{name:n.name})};s[n.id]={from:"local",branch:e.local,...e.onBranch?{onBranch:!0}:{}}}else{let r=e.remoteBranch.trim();if(!e.remote||!r)return{problem:x("startdlg.needBranch",{name:n.name})};s[n.id]={from:"remote",remote:e.remote,branch:r,...e.onBranch?{onBranch:!0}:{}};let i="".concat(g(n.repoDir),"|").concat(e.remote),o=null!=(l=t.get(i))?l:{key:i,dir:a.repoDir,remote:e.remote,branches:[]};o.branches.includes(r)||o.branches.push(r),t.set(i,o)}}return{starts:s,groups:[...t.values()].map(e=>({...e,key:"".concat(e.key,"|").concat([...e.branches].sort().join(","))}))}})();if("problem"in t)return void H(t.problem);if(!s.skipFetch)for(let e of t.groups){if(z.current.has(e.key))continue;E({kind:"fetching",what:e.branches.map(l=>"".concat(e.remote,"/").concat(l)).join(", ")});let l=await a.FH.startFetch(e.dir,e.remote,e.branches).catch(e=>({ok:!1,problem:e.message,missing:[]}));if(M(l.repo),!l.ok)return void E({kind:"fetchFailed",group:e,result:l})}E({kind:"starting"});try{l=await m.start(t.starts)}catch(e){l={started:!1,reason:e.message}}if(V.current=l,l.started)return void K(!0);E({kind:"failed",reply:l}),(null==(e=l.failure)?void 0:e.stage)==="preflight"&&Z()},Q=async(e,l)=>{I("".concat(g(e),"|").concat(l)),R(s=>({...s,[g(e)]:x("startdlg.fetching",{what:l})}));try{let s=await a.FH.startFetch(e,l);M(s.repo),R(t=>{var n,a,r,i;return{...t,[g(e)]:s.ok?"":"".concat(x("startdlg.fetchFailed",{what:l})," ").concat(null!=(i=null!=(r=s.problem)?r:null==(n=s.fetched)?void 0:n.detail)?i:"").concat((null==(a=s.fetched)?void 0:a.auth)?" ".concat(x("prep.fetchAuth")):"")}})}catch(l){R(s=>({...s,[g(e)]:l.message}))}finally{I("")}},Y=async e=>{try{await navigator.clipboard.writeText(e),q(!0),window.setTimeout(()=>q(!1),2500)}catch(e){H(x("plan.copyFailed"))}},ee=Object.values(B).some(e=>"remote"===e.from),el="unattended"===m.mode?x("startdlg.goUnattended"):x("startdlg.goStep");return(0,t.jsx)("div",{className:"modal-backdrop",role:"presentation",onClick:()=>!U&&K(!1),children:(0,t.jsxs)("div",{ref:v,className:"modal wide start-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"".concat(j,"-title"),onClick:e=>e.stopPropagation(),style:{overflowWrap:"anywhere"},children:[(0,t.jsx)("h2",{id:"".concat(j,"-title"),children:x("startdlg.title")}),(0,t.jsx)("p",{className:"small muted",style:{marginTop:0},children:x("startdlg.intro")}),w&&(0,t.jsx)(c.X,{reason:w}),!y&&!w&&(0,t.jsx)("p",{className:"small",role:"status",children:x("startdlg.loading")}),y&&("choose"===D.kind||"fetching"===D.kind||"starting"===D.kind)&&y.sessions.map(e=>{var l,s,n,a;let r=X(e.repoDir),i=B[e.id],o="start-".concat(j,"-").concat(e.id),c=null!=(s=null==r||null==(l=r.remotes.find(e=>e.name===(null==i?void 0:i.remote)))?void 0:l.branches)?s:[];return(0,t.jsxs)("fieldset",{className:"option",style:{border:"1px solid var(--line)",borderRadius:"var(--radius)",padding:"8px 12px",margin:"10px 0"},children:[(0,t.jsx)("legend",{style:{padding:"0 4px"},children:(0,t.jsx)("strong",{children:e.name})}),e.repoDir&&(0,t.jsx)("p",{className:"muted small",style:{margin:"2px 0 6px"},children:x("startdlg.repoOn",{repo:e.repoDir,branch:null!=(n=null==r?void 0:r.current)?n:"HEAD"})}),e.vcs?e.fixed?(0,t.jsx)("p",{className:"small",children:x("startdlg.fixed",{start:e.fixed})}):r&&!r.problem&&i?(0,t.jsxs)(t.Fragment,{children:[e.prepared&&(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"radio",name:o,checked:"keep"===i.from,onChange:()=>J(e.id,{from:"keep"}),disabled:U}),(0,t.jsx)("span",{children:x("startdlg.keep")})]}),(0,t.jsx)("p",{className:"why",children:x("startdlg.prepared",{start:e.prepared})})]}),(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"radio",name:o,checked:"local"===i.from,onChange:()=>J(e.id,{from:"local"}),disabled:U}),(0,t.jsx)("span",{children:x("startdlg.local")})]}),(0,t.jsx)("div",{className:"row",style:{marginTop:4},children:(0,t.jsxs)("select",{"aria-label":x("startdlg.localBranch"),value:i.local,onChange:l=>J(e.id,{from:"local",local:l.target.value}),disabled:U,style:{width:"auto",minWidth:240,maxWidth:"100%"},children:[!r.local.some(e=>e.name===i.local)&&(0,t.jsx)("option",{value:i.local,children:i.local}),r.local.map(e=>(0,t.jsxs)("option",{value:e.name,children:[e.name," \xb7 ",e.commit.slice(0,8)]},e.name))]})}),(0,t.jsx)("p",{className:"why",children:x("startdlg.localWhy")})]}),(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"radio",name:o,checked:"remote"===i.from,onChange:()=>J(e.id,{from:"remote"}),disabled:U||0===r.remotes.length}),(0,t.jsx)("span",{children:x("startdlg.remote")})]}),0===r.remotes.length?(0,t.jsx)("p",{className:"muted small",children:x("startdlg.noRemote")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"row",style:{marginTop:4},children:[r.remotes.length>1&&(0,t.jsx)("select",{"aria-label":x("startdlg.remoteName"),value:i.remote,onChange:l=>J(e.id,{from:"remote",remote:l.target.value}),disabled:U,style:{width:"auto"},children:r.remotes.map(e=>(0,t.jsx)("option",{value:e.name,children:e.name},e.name))}),1===r.remotes.length&&(0,t.jsxs)("code",{children:[i.remote,"/"]}),(0,t.jsx)("input",{type:"text","aria-label":x("startdlg.remoteBranch"),list:"".concat(o,"-remote"),value:i.remoteBranch,onChange:l=>J(e.id,{from:"remote",remoteBranch:l.target.value}),onFocus:()=>"remote"!==i.from&&J(e.id,{from:"remote"}),disabled:U,style:{width:"auto",minWidth:240,flex:"1 1 240px"},placeholder:"main"}),(0,t.jsx)("datalist",{id:"".concat(o,"-remote"),children:c.map(e=>(0,t.jsx)("option",{value:e.name},e.name))}),(0,t.jsx)("button",{type:"button",onClick:()=>void Q(r.repoDir,i.remote),disabled:U||!i.remote,children:x("startdlg.refreshRemote")})]}),(0,t.jsx)("p",{className:"why",children:x("startdlg.remoteWhy")}),(0,t.jsx)("p",{className:"muted small",style:{margin:"2px 0"},children:r.lastFetched?x("startdlg.lastFetched",{when:f(r.lastFetched)}):c.length>0?x("startdlg.lastFetchedUnknown"):x("startdlg.neverFetched")}),L[g(r.repoDir)]&&(0,t.jsx)("p",{className:"small",role:"status",children:L[g(r.repoDir)]})]})]}),e.previousOffered&&(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"radio",name:o,checked:"previous-session"===i.from,onChange:()=>J(e.id,{from:"previous-session"}),disabled:U}),(0,t.jsx)("span",{children:x("startdlg.previous")})]}),(0,t.jsx)("p",{className:"why",children:x("startdlg.previousWhy")})]}),(0,t.jsxs)("div",{className:"option",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"checkbox",checked:i.onBranch&&("local"===i.from||"remote"===i.from),onChange:l=>J(e.id,{onBranch:l.target.checked}),disabled:U||"local"!==i.from&&"remote"!==i.from}),(0,t.jsx)("span",{children:x("startdlg.onBranch")})]}),(0,t.jsx)("p",{className:"why",children:x("startdlg.onBranchWhy")})]})]}):(0,t.jsx)("p",{className:"err small",children:x("startdlg.repoProblem",{problem:null!=(a=null==r?void 0:r.problem)?a:""})}):(0,t.jsx)("p",{className:"small",children:x("startdlg.vcsOff")})]},e.id)}),"fetching"===D.kind&&(0,t.jsx)("p",{className:"notice small",role:"status",children:x("startdlg.fetching",{what:D.what})}),"starting"===D.kind&&(0,t.jsx)("p",{className:"notice small",role:"status",children:x("startdlg.starting")}),"fetchFailed"===D.kind&&(0,t.jsxs)("div",{className:"notice caution",role:"alert",children:[(0,t.jsxs)("p",{style:{marginTop:0},children:[(0,t.jsx)("strong",{children:x("startdlg.fetchFailed",{what:D.group.branches.map(e=>"".concat(D.group.remote,"/").concat(e)).join(", ")})})," ",(0,t.jsx)("code",{children:null!=(u=null!=(h=D.result.problem)?h:null==(l=D.result.fetched)?void 0:l.detail)?u:""})]}),D.result.missing.length>0&&(0,t.jsx)("p",{className:"small",children:x("startdlg.missing",{names:D.result.missing.join(", ")})}),(null==(s=D.result.fetched)?void 0:s.auth)&&(0,t.jsx)("p",{className:"small",children:x("prep.fetchAuth")}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("button",{type:"button",className:"primary",onClick:()=>void G(),children:x("startdlg.retryFetch")}),(()=>{var e,l;let s=X(D.group.dir),n=null!=(l=null==s||null==(e=s.remotes.find(e=>e.name===D.group.remote))?void 0:e.branches)?l:[];return D.group.branches.every(e=>n.some(l=>l.name===e))?(0,t.jsx)("button",{type:"button",onClick:()=>{z.current.add(D.group.key),G()},children:x("startdlg.useFetched")}):null})(),(0,t.jsx)("button",{type:"button",className:"quiet",onClick:$,children:x("startdlg.back")})]}),(()=>{var e,l;let s=X(D.group.dir),n=null!=(l=null==s||null==(e=s.remotes.find(e=>e.name===D.group.remote))?void 0:e.branches)?l:[],a=D.group.branches.filter(e=>!n.some(l=>l.name===e));return a.length>0?(0,t.jsx)("p",{className:"muted small",children:x("startdlg.useFetchedNo",{what:a.map(e=>"".concat(D.group.remote,"/").concat(e)).join(", ")})}):D.result.lastFetched?(0,t.jsx)("p",{className:"muted small",children:x("prep.lastFetched",{when:f(D.result.lastFetched)})}):null})(),D.result.fetchCommand&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",style:{marginTop:8},children:x("prep.ownTerminal")}),(0,t.jsx)("pre",{className:"sync-cmd",children:D.result.fetchCommand}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{var e;Y(null!=(e=D.result.fetchCommand)?e:"")},children:x("prep.copyFetch")}),P&&(0,t.jsx)("span",{className:"badge done",children:x("prep.copied")})]})]})]}),"failed"===D.kind&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.X,{failure:D.reply.failure,reason:D.reply.reason}),(null==(d=D.reply.failure)?void 0:d.stage)==="preflight"&&A.some(e=>!e.ready)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",children:x("startdlg.vcsFix")}),(0,t.jsx)(o.w,{groups:A,sessionIds:m.sessionIds,onChange:()=>{Z(),_()}})]})]}),T&&(0,t.jsx)("p",{className:"err small",role:"alert",children:T}),"choose"===D.kind&&ee&&(0,t.jsx)("p",{className:"why",children:x("prep.password")}),(0,t.jsxs)("div",{className:"row modal-actions",children:[(0,t.jsx)("button",{type:"button",className:"quiet",onClick:()=>K(!1),disabled:U,children:x("dialog.cancel")}),"failed"===D.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:$,children:x("startdlg.back")}),(0,t.jsx)("button",{type:"button",className:"primary",onClick:()=>void G({skipFetch:!0}),children:x("startdlg.tryAgain")})]}):"fetchFailed"!==D.kind&&(0,t.jsx)("button",{ref:b,type:"button",className:"primary",onClick:()=>void G(),disabled:U||!y,children:el})]})]})})}},3069:(e,l,s)=>{s.d(l,{StartFailureBanner:()=>h,X:()=>o});var t=s(3365),n=s(1521),a=s(5549),r=s(867),i=s(7527);function o(e){var l,s;let{failure:n,reason:i,onDismiss:o,intro:c,children:d}=e,{t:h}=(0,r.kj)(),u=(0,r.W3)(),m=null!=(s=null!=(l=null==n?void 0:n.message)?l:i)?s:"";return(0,t.jsxs)("div",{className:"notice caution start-failure",role:"alert",style:{overflowWrap:"anywhere"},children:[c&&(0,t.jsx)("p",{className:"small",style:{marginTop:0},children:c}),(0,t.jsx)("strong",{children:h("startfail.title")}),n&&(0,t.jsx)("p",{className:"small",style:{margin:"4px 0"},children:h("startfail.where",{stage:h("startfail.stage.".concat(n.stage))})}),(0,t.jsx)("pre",{className:"sync-cmd small",style:{margin:"6px 0"},children:m}),d,n&&(0,t.jsxs)("p",{className:"muted small",style:{margin:"4px 0"},children:[n.runId?h("startfail.when",{when:u(n.at),run:n.runId}):h("startfail.whenNoRun",{when:u(n.at)}),n.sessions.length>0?" \xb7 ".concat(n.sessions.map(e=>'"'.concat(e,'"')).join(", ")):""]}),(0,t.jsxs)("div",{className:"row",style:{marginTop:6},children:[n&&(0,t.jsx)("a",{className:"button-link",href:a.FH.startFailureUrl(n.id),download:!0,children:h("startfail.download")}),(0,t.jsx)("a",{className:n?"button-link":"button-link plain",href:a.FH.terminalUrl(),download:!0,children:h("startfail.terminal")}),o&&(0,t.jsx)("button",{type:"button",className:"quiet",onClick:o,children:h("startfail.dismiss")})]}),(0,t.jsx)("p",{className:"why",children:h("startfail.downloadWhy")})]})}let c="cop.startFailure.dismissed";function d(){try{var e;let l=JSON.parse(null!=(e=window.localStorage.getItem(c))?e:"[]");return Array.isArray(l)?l.filter(e=>"string"==typeof e):[]}catch(e){return[]}}function h(){let{t:e}=(0,r.kj)(),[l,s]=(0,n.useState)([]),[h,u]=(0,n.useState)([]);(0,i.z)(()=>a.FH.startFailures(!0).then(e=>{s(e),u(d())}).catch(()=>void 0),5e3);let m=l.find(e=>!h.includes(e.id));return m?(0,t.jsx)("div",{style:{marginBottom:12},children:(0,t.jsx)(o,{failure:m,intro:e("at-turn"===m.stage?"startfail.laterSession":"startfail.later"),onDismiss:()=>{let e=[...new Set([...d(),m.id])].slice(-50);try{window.localStorage.setItem(c,JSON.stringify(e))}catch(e){}u(e)}})}):null}},3486:(e,l,s)=>{s.d(l,{w:()=>o});var t=s(3365),n=s(1521),a=s(5549),r=s(867);let i={"review-inputs":"runvcs.review","snapshot-on-base":"runvcs.snapshotOnBase","snapshot-here":"runvcs.snapshotHere","use-current-branch":"runvcs.useCurrent","allow-snapshot":"runvcs.allowSnapshot"};function o(e){let{groups:l,sessionIds:s,onChange:a}=e,{t:i}=(0,r.kj)(),[o,d]=(0,n.useState)(""),h=l.filter(e=>!e.ready);return 0===h.length?o?(0,t.jsxs)("p",{className:"notice small",role:"status",children:[(0,t.jsx)("strong",{children:i("runvcs.ready")})," ",o]}):null:(0,t.jsxs)("section",{className:"notice caution","aria-labelledby":"runvcs-title",children:[(0,t.jsx)("h3",{id:"runvcs-title",style:{marginTop:0},children:i("runvcs.title")}),(0,t.jsx)("p",{className:"small",children:i("runvcs.why")}),h.map(e=>(0,t.jsx)(c,{group:e,sessionIds:s,onChange:a,onDone:d},e.repoDir))]})}function c(e){var l;let{group:s,sessionIds:o,onChange:c,onDone:d}=e,{t:h}=(0,r.kj)(),[u,m]=(0,n.useState)(!1),[p,g]=(0,n.useState)(!1),[x,f]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[b,y]=(0,n.useState)({}),k=(e,l)=>{var s,t;return null!=(t=null!=(s=b[e])?s:l)?t:void 0},w=s.actions.find(e=>"snapshot-here"===e.id&&e.available),N=e=>(null!=e?e:"—").slice(0,8),F=async e=>{if("review-inputs"===e)return void m(e=>!e);f(!0),v("");try{var l,t,n;let r="snapshot-on-base"===e?Object.fromEntries(s.inputs.map(e=>[e.path,"include"])):Object.fromEntries(s.entries.filter(e=>k(e.path,e.choice)).map(e=>[e.path,k(e.path,e.choice)])),i=await a.FH.runVcsPrepare(o,s.repoDir,e,r);v(i.ok?null!=(l=i.result)?l:"":null!=(t=i.problem)?t:""),i.ok&&d("".concat(s.repoDir,": ").concat(null!=(n=i.result)?n:"")),c()}catch(e){v(e.message)}finally{f(!1)}};return(0,t.jsxs)("div",{className:"option",style:{overflowWrap:"anywhere"},children:[(0,t.jsx)("table",{className:"small",children:(0,t.jsxs)("tbody",{children:[(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.repo")}),(0,t.jsx)("td",{children:(0,t.jsx)("code",{children:s.repoDir})})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.current")}),(0,t.jsxs)("td",{children:[(0,t.jsx)("code",{children:null!=(l=s.branch)?l:"HEAD"})," @ ",(0,t.jsx)("code",{children:N(s.head)})]})]}),s.workBranch&&(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.workBranch")}),(0,t.jsxs)("td",{children:[(0,t.jsx)("code",{children:s.workBranch.name})," @ ",(0,t.jsx)("code",{children:N(s.workBranch.head)})]})]}),s.baseBranch&&(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.base")}),(0,t.jsxs)("td",{children:[(0,t.jsx)("code",{children:s.baseBranch})," @ ",(0,t.jsx)("code",{children:N(s.baseHead)})]})]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.sessions")}),(0,t.jsx)("td",{children:s.sessions.map(e=>"".concat(e.name," (").concat(h("runvcs.role.".concat(e.role)),")")).join(", ")})]}),s.inputPatterns.length>0&&(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:h("runvcs.patterns")}),(0,t.jsx)("td",{children:s.inputPatterns.map(e=>(0,t.jsx)("code",{style:{marginRight:6},children:e},e))})]})]})}),s.problem&&(0,t.jsxs)("p",{className:"small",children:[(0,t.jsx)("strong",{children:h("runvcs.problem")})," ",s.problem]}),s.inputs.length>0&&(0,t.jsx)("p",{className:"small",children:h("runvcs.inputsCount",{n:s.inputs.length})}),u&&s.inputs.length>0&&(0,t.jsx)("ul",{className:"small",style:{margin:"4px 0"},children:s.inputs.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{children:e.path})," — ",h("vcs.snapshotKind.".concat(e.kind)),void 0!==e.size?", ".concat((0,a.zi)(e.size)):"",0===e.allowed.length&&e.reason?(0,t.jsxs)("span",{className:"err",children:[" — ",e.reason]}):null]},e.path))}),s.unrelated.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",children:(0,t.jsx)("strong",{children:h("runvcs.unrelated",{n:s.unrelated.length})})}),(0,t.jsx)("ul",{className:"small",style:{margin:"4px 0"},children:s.unrelated.slice(0,30).map(e=>(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{children:e.path}),e.reason?" — ".concat(e.reason):""]},e.path))})]}),w&&s.entries.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",children:(0,t.jsx)("strong",{children:h("runvcs.choose",{n:s.entries.length})})}),(0,t.jsx)("ul",{className:"small",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:s.entries.map(e=>{var l;return(0,t.jsxs)("li",{style:{marginBottom:4},children:[(0,t.jsx)("code",{children:e.path})," ",(0,t.jsxs)("span",{className:"muted",children:["(",e.input?"".concat(h("vcs.snapshotInput"),", "):"",h("vcs.snapshotKind.".concat(e.kind)),void 0!==e.size?", ".concat((0,a.zi)(e.size)):"",")"]})," ",0===e.allowed.length?(0,t.jsx)("span",{className:"err",children:h("vcs.snapshotBlocked")}):(0,t.jsx)("select",{"aria-label":e.path,value:null!=(l=k(e.path,e.choice))?l:"",onChange:l=>y({...b,[e.path]:l.target.value}),disabled:x||e.allowed.length<2,children:e.allowed.map(e=>(0,t.jsx)("option",{value:e,children:h("include"===e?"vcs.snapshotInclude":"vcs.snapshotLeaveOut")},e))}),e.reason&&(0,t.jsx)("div",{className:"muted",children:e.reason})]},e.path)})})]}),p?(0,t.jsxs)("p",{className:"small muted",children:[h("runvcs.cancelled")," ",(0,t.jsx)("button",{className:"quiet",onClick:()=>g(!1),children:h("runvcs.showAgain")})]}):(0,t.jsxs)("div",{children:[s.actions.map(e=>{var l,n,a;return(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsxs)("button",{className:e.recommended?"primary":void 0,onClick:()=>void F(e.id),disabled:x||!e.available,children:[h(i[e.id],{branch:null!=(l=s.baseBranch)?l:"",current:null!=(n=s.branch)?n:"HEAD"}),"review-inputs"===e.id&&u?" ✓":""]}),e.recommended&&(0,t.jsx)("span",{className:"badge done",style:{marginLeft:6},children:h("runvcs.recommended")}),(0,t.jsx)("p",{className:"why",children:e.available?e.result:"".concat(h("runvcs.notNow")," ").concat(null!=(a=e.why)?a:"")})]},e.id)}),(0,t.jsxs)("div",{style:{marginTop:8},children:[(0,t.jsx)("button",{className:"quiet",onClick:()=>g(!0),disabled:x,children:h("runvcs.cancel")}),(0,t.jsx)("p",{className:"why",children:h("runvcs.cancelWhy")})]})]}),j&&(0,t.jsx)("p",{className:"small",role:"status",children:j})]})}},4969:(e,l,s)=>{s.d(l,{V:()=>a});var t=s(1521);let n='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function a(e,l,s){(0,t.useEffect)(()=>{var t,a;if(!l)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=e.current,o=null!=(a=null!=(t=null==s?void 0:s.current)?t:null==i?void 0:i.querySelector(n))?a:null;null==o||o.focus();let c=e=>{if("Tab"!==e.key||!i)return;let l=Array.from(i.querySelectorAll(n)).filter(e=>null!==e.offsetParent);if(0===l.length)return;let s=l[0],t=l[l.length-1],a=i.contains(document.activeElement);e.shiftKey&&(document.activeElement===s||!a)?(e.preventDefault(),t.focus()):e.shiftKey||document.activeElement!==t&&a||(e.preventDefault(),s.focus())};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),r&&document.contains(r)&&r.focus()}},[e,l,s])}},7527:(e,l,s)=>{s.d(l,{z:()=>n});var t=s(1521);function n(e,l){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=(0,t.useRef)(e);n.current=e,(0,t.useEffect)(()=>{let e;if(!s)return;let t=!1,a=async()=>{try{await n.current()}catch(e){}finally{t||(e=setTimeout(()=>void a(),l))}};return a(),()=>{t=!0,e&&clearTimeout(e)}},[l,s])}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{5549:(t,e,o)=>{o.d(e,{AV:()=>a,FH:()=>h,FZ:()=>r,Zm:()=>u,aT:()=>s,c5:()=>y,dK:()=>l,nC:()=>n,rt:()=>d,ub:()=>i,zi:()=>p});let n="/api";function s(t,e){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(e?"#".concat(e):"")}let c="cop-api-token";function a(){try{let t=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(t)return window.localStorage.setItem(c,t[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),t[1];return window.localStorage.getItem(c)||""}catch(t){return""}}function i(t){let e=a();return e?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(e)):t}let r=["exit-zero","exit-nonzero","output-contains","output-omits","output-matches","file-exists","file-missing","file-contains"];function d(t){return t.startsWith("exit-")||t.startsWith("output-")}function l(t){return"output-contains"===t||"output-omits"===t||"output-matches"===t||"file-contains"===t}function u(t){return"limit-reached"===t.status||"aborted"===t.status||!!t.limit&&("failed"===t.status||"blocked"===t.status)}async function m(t,e){let o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=void 0===s.timeoutMs?3e4:s.timeoutMs;try{var i;o=await fetch("".concat(n).concat(t),{...e,...null!==c&&!(null==e?void 0:e.signal)?{signal:AbortSignal.timeout(c)}:{},headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{},...null!=(i=null==e?void 0:e.headers)?i:{}}})}catch(e){if("TimeoutError"===e.name)throw Error("The API did not answer within ".concat(Math.round((null!=c?c:0)/1e3)," s (").concat(t.split("?")[0],"). It may be busy; try again."));throw e}if(!o.ok){let t="".concat(o.status," ").concat(o.statusText);try{let e=await o.json();(null==e?void 0:e.message)&&(t=Array.isArray(e.message)?e.message.join("; "):e.message)}catch(t){}throw Error(t)}let r=await o.text();return r?JSON.parse(r):void 0}let h={health:()=>m("/health"),doctor:()=>m("/doctor"),settings:()=>m("/settings"),saveSettings:t=>m("/settings",{method:"PUT",body:JSON.stringify(t)}),level1:()=>m("/level1"),setLevel1:t=>m("/level1",{method:"PUT",body:JSON.stringify({content:t})}),resetLevel1:()=>m("/level1",{method:"DELETE"}),presets:()=>m("/presets"),savePreset:(t,e)=>m("/presets/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:e})}),deletePreset:t=>m("/presets/".concat(encodeURIComponent(t)),{method:"DELETE"}),personas:()=>m("/personas"),savePersona:(t,e)=>m("/personas/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:e})}),deletePersona:t=>m("/personas/".concat(encodeURIComponent(t)),{method:"DELETE"}),sessions:()=>m("/sessions"),reorderSessions:t=>m("/sessions-order",{method:"PUT",body:JSON.stringify({ids:t})}),metrics:()=>m("/metrics"),preparePreview:function(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return m("/repo/prepare/preview",{method:"POST",body:JSON.stringify({dir:t,fetch:e})},{timeoutMs:33e4})},prepareProject:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m("/repo/prepare",{method:"POST",body:JSON.stringify({dir:t,fingerprint:e,...o})})},session:t=>m("/sessions/".concat(t)),createSession:(t,e)=>m("/sessions",{method:"POST",body:JSON.stringify({name:t,projectDir:e})}),updateSession:(t,e)=>m("/sessions/".concat(t),{method:"PUT",body:JSON.stringify(e)}),deleteSession:t=>m("/sessions/".concat(t),{method:"DELETE"}),addTask:(t,e)=>m("/sessions/".concat(t,"/tasks"),{method:"POST",body:JSON.stringify(e)}),updateTask:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e),{method:"PUT",body:JSON.stringify(o)}),deleteTask:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e),{method:"DELETE"}),continueTask:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/continue"),{method:"POST",body:"{}"}),rerunTask:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m("/sessions/".concat(t,"/tasks/").concat(e,"/rerun"),{method:"POST",body:JSON.stringify({...o,...n.buildOnFinished?{buildOnFinished:!0}:{}})})},taskChanges:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/changes").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskChangeFile:(t,e,o,n)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/changes/file?path=").concat(encodeURIComponent(o)).concat(n?"&run=".concat(encodeURIComponent(n)):"")),taskStory:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/story").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskFiles:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/files").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskLogUrl:(t,e,o)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),taskFileUrl:(t,e,o,s,c)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(s)).concat(c?"?run=".concat(encodeURIComponent(c)):""),saveTaskLog:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),{method:"POST",body:"{}"}),saveTaskFile:(t,e,o,n,s)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(n)).concat(s?"?run=".concat(encodeURIComponent(s)):""),{method:"POST",body:"{}"}),start:(t,e,o)=>m("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:e,name:o})}),stop:t=>m("/sessions/".concat(t,"/stop"),{method:"POST",body:"{}"}),approvals:t=>m("/approvals".concat(t?"?session=".concat(encodeURIComponent(t)):"")),decide:(t,e)=>m("/approvals/".concat(t),{method:"POST",body:JSON.stringify({action:e})}),setRunMode:(t,e)=>m("/sessions/".concat(t,"/mode"),{method:"POST",body:JSON.stringify({mode:e})}),streamUrl:t=>i("".concat(n,"/sessions/").concat(t,"/stream")),batch:()=>m("/batch").then(t=>null!=t?t:null),startBatch:(t,e,o,n,s,c,a)=>m("/batch/start",{method:"POST",body:JSON.stringify({sessionIds:t,mode:e,onFailure:o,model:n,reviewModel:s,name:c,taskIds:a})}),suggestedRunName:t=>m("/batch/name?sessions=".concat(encodeURIComponent(t.join(",")))),stopBatch:()=>m("/batch/stop",{method:"POST",body:"{}"}),pauseBatch:()=>m("/batch/pause",{method:"POST",body:"{}"}),resumeBatch:()=>m("/batch/resume",{method:"POST",body:"{}"}),planBrief:t=>m("/plan/brief?lang=".concat(encodeURIComponent(t))),context:(t,e)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(e))),setContext:(t,e)=>m("/context/".concat(t),{method:"PUT",body:JSON.stringify({content:e})}),resetContext:(t,e)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(e)),{method:"DELETE"}),checkPlan:t=>m("/plan/check",{method:"POST",body:JSON.stringify({text:t})}),importPlan:t=>m("/plan/import",{method:"POST",body:JSON.stringify({text:t})}),browseFolder:t=>m("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),tasks:()=>m("/tasks"),activity:()=>m("/activity"),downloadBundle:async t=>{var e,o,s;let c=await fetch("".concat(n,"/export/bundle"),{method:"POST",headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{}},body:JSON.stringify({tasks:t})});if(!c.ok)throw Error(await c.text()||"".concat(c.status," ").concat(c.statusText));let i=null!=(s=c.headers.get("content-disposition"))?s:"",r=null==(e=/filename\*=UTF-8''([^;]+)/i.exec(i))?void 0:e[1],d=null==(o=/filename="([^"]+)"/i.exec(i))?void 0:o[1],l=null!=d?d:"copilot-operator-bundle.json";if(r)try{l=decodeURIComponent(r)}catch(t){}let u=URL.createObjectURL(await c.blob()),m=document.createElement("a");return m.href=u,m.download=l,document.body.appendChild(m),m.click(),m.remove(),setTimeout(()=>URL.revokeObjectURL(u),1e4),l},exportUrl:(t,e)=>{let o=new URLSearchParams;return e.run&&o.set("run",e.run),e.session&&o.set("session",e.session),e.task&&o.set("task",e.task),i("".concat(n,"/export/").concat(t,"?").concat(o.toString()))},debugExportUrl:t=>i("".concat(n,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>m("/sessions/".concat(t,"/vcs")),runVcs:t=>m("/batch/vcs?ids=".concat(encodeURIComponent(t.join(",")))),runVcsPrepare:function(t,e,o){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m("/batch/vcs/prepare",{method:"POST",body:JSON.stringify({sessionIds:t,repoDir:e,action:o,choices:n})})},vcsSnapshot:(t,e)=>m("/sessions/".concat(t,"/vcs/snapshot"),{method:"POST",body:JSON.stringify({choices:e})}),restorePreview:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restore")),restore:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restore"),{method:"POST",body:"{}"}),restartPlan:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restart")),restartFrom:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m("/sessions/".concat(t,"/tasks/").concat(e,"/restart"),{method:"POST",body:JSON.stringify(o)})},repoCheck:t=>m("/repo?dir=".concat(encodeURIComponent(t))),project:()=>m("/project"),setProject:t=>m("/project",{method:"PUT",body:JSON.stringify(t)}),models:()=>m("/models"),setDefaultModel:t=>m("/models/default",{method:"PUT",body:JSON.stringify({model:t})}),setDefaultReviewModel:t=>m("/models/review-default",{method:"PUT",body:JSON.stringify({model:t})}),refreshModels:()=>m("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null}),login:t=>m("/login",{method:"POST",body:JSON.stringify({account:(null==t?void 0:t.trim())||void 0})},{timeoutMs:null})};function p(t){return t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}function y(t){if(void 0===t)return"";let e=Math.round(t/1e3);if(e<60)return"".concat(e,"s");let o=Math.floor(e/60);return o<60?"".concat(o,"m ").concat(e%60,"s"):"".concat(Math.floor(o/60),"h ").concat(o%60,"m")}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[549],{5549:(t,e,o)=>{o.d(e,{AV:()=>a,FH:()=>h,FZ:()=>r,Zm:()=>u,aT:()=>s,c5:()=>y,dK:()=>l,nC:()=>n,rt:()=>d,ub:()=>i,zi:()=>p});let n="/api";function s(t,e){return"/sessions/view?id=".concat(encodeURIComponent(t)).concat(e?"#".concat(e):"")}let c="cop-api-token";function a(){try{let t=/(?:^#|&)token=([0-9a-f]{16,})/i.exec(window.location.hash);if(t)return window.localStorage.setItem(c,t[1]),window.history.replaceState(null,"",window.location.pathname+window.location.search),t[1];return window.localStorage.getItem(c)||""}catch(t){return""}}function i(t){let e=a();return e?"".concat(t).concat(t.includes("?")?"&":"?","token=").concat(encodeURIComponent(e)):t}let r=["exit-zero","exit-nonzero","output-contains","output-omits","output-matches","file-exists","file-missing","file-contains"];function d(t){return t.startsWith("exit-")||t.startsWith("output-")}function l(t){return"output-contains"===t||"output-omits"===t||"output-matches"===t||"file-contains"===t}function u(t){return"limit-reached"===t.status||"aborted"===t.status||!!t.limit&&("failed"===t.status||"blocked"===t.status)}async function m(t,e){let o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=void 0===s.timeoutMs?3e4:s.timeoutMs;try{var i;o=await fetch("".concat(n).concat(t),{...e,...null!==c&&!(null==e?void 0:e.signal)?{signal:AbortSignal.timeout(c)}:{},headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{},...null!=(i=null==e?void 0:e.headers)?i:{}}})}catch(e){if("TimeoutError"===e.name)throw Error("The API did not answer within ".concat(Math.round((null!=c?c:0)/1e3)," s (").concat(t.split("?")[0],"). It may be busy; try again."));throw e}if(!o.ok){let t="".concat(o.status," ").concat(o.statusText);try{let e=await o.json();(null==e?void 0:e.message)&&(t=Array.isArray(e.message)?e.message.join("; "):e.message)}catch(t){}throw Error(t)}let r=await o.text();return r?JSON.parse(r):void 0}let h={health:()=>m("/health"),doctor:()=>m("/doctor"),settings:()=>m("/settings"),saveSettings:t=>m("/settings",{method:"PUT",body:JSON.stringify(t)}),level1:()=>m("/level1"),setLevel1:t=>m("/level1",{method:"PUT",body:JSON.stringify({content:t})}),resetLevel1:()=>m("/level1",{method:"DELETE"}),presets:()=>m("/presets"),savePreset:(t,e)=>m("/presets/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:e})}),deletePreset:t=>m("/presets/".concat(encodeURIComponent(t)),{method:"DELETE"}),personas:()=>m("/personas"),savePersona:(t,e)=>m("/personas/".concat(encodeURIComponent(t)),{method:"PUT",body:JSON.stringify({content:e})}),deletePersona:t=>m("/personas/".concat(encodeURIComponent(t)),{method:"DELETE"}),sessions:()=>m("/sessions"),reorderSessions:t=>m("/sessions-order",{method:"PUT",body:JSON.stringify({ids:t})}),metrics:()=>m("/metrics"),preparePreview:function(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return m("/repo/prepare/preview",{method:"POST",body:JSON.stringify({dir:t,fetch:e})},{timeoutMs:33e4})},prepareProject:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m("/repo/prepare",{method:"POST",body:JSON.stringify({dir:t,fingerprint:e,...o})})},session:t=>m("/sessions/".concat(t)),createSession:(t,e)=>m("/sessions",{method:"POST",body:JSON.stringify({name:t,projectDir:e})}),updateSession:(t,e)=>m("/sessions/".concat(t),{method:"PUT",body:JSON.stringify(e)}),deleteSession:t=>m("/sessions/".concat(t),{method:"DELETE"}),addTask:(t,e)=>m("/sessions/".concat(t,"/tasks"),{method:"POST",body:JSON.stringify(e)}),updateTask:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e),{method:"PUT",body:JSON.stringify(o)}),deleteTask:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e),{method:"DELETE"}),continueTask:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/continue"),{method:"POST",body:"{}"}),rerunTask:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m("/sessions/".concat(t,"/tasks/").concat(e,"/rerun"),{method:"POST",body:JSON.stringify({...o,...n.buildOnFinished?{buildOnFinished:!0}:{}})})},taskChanges:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/changes").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskChangeFile:(t,e,o,n)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/changes/file?path=").concat(encodeURIComponent(o)).concat(n?"&run=".concat(encodeURIComponent(n)):"")),taskStory:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/story").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskFiles:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/files").concat(o?"?run=".concat(encodeURIComponent(o)):"")),taskLogUrl:(t,e,o)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),taskFileUrl:(t,e,o,s,c)=>"".concat(n,"/sessions/").concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(s)).concat(c?"?run=".concat(encodeURIComponent(c)):""),saveTaskLog:(t,e,o)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/log").concat(o?"?run=".concat(encodeURIComponent(o)):""),{method:"POST",body:"{}"}),saveTaskFile:(t,e,o,n,s)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/files/").concat(o,"/").concat(encodeURIComponent(n)).concat(s?"?run=".concat(encodeURIComponent(s)):""),{method:"POST",body:"{}"}),start:(t,e,o,n)=>m("/sessions/".concat(t,"/start"),{method:"POST",body:JSON.stringify({mode:e,name:o,starts:n})},{timeoutMs:12e4}),startOptions:t=>m("/start/options?sessions=".concat(encodeURIComponent(t.join(",")))),startFetch:(t,e,o)=>m("/start/fetch",{method:"POST",body:JSON.stringify({dir:t,remote:e,...o?{branches:o}:{}})},{timeoutMs:33e4}),startFailures:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return m("/start/failures".concat(t?"?unanswered=1":""))},startFailureUrl:t=>i("".concat(n,"/start/failures/").concat(encodeURIComponent(t),"/report")),terminalUrl:()=>i("".concat(n,"/terminal")),stop:t=>m("/sessions/".concat(t,"/stop"),{method:"POST",body:"{}"}),approvals:t=>m("/approvals".concat(t?"?session=".concat(encodeURIComponent(t)):"")),decide:(t,e)=>m("/approvals/".concat(t),{method:"POST",body:JSON.stringify({action:e})}),setRunMode:(t,e)=>m("/sessions/".concat(t,"/mode"),{method:"POST",body:JSON.stringify({mode:e})}),streamUrl:t=>i("".concat(n,"/sessions/").concat(t,"/stream")),batch:()=>m("/batch").then(t=>null!=t?t:null),startBatch:(t,e,o,n,s,c,a,i)=>m("/batch/start",{method:"POST",body:JSON.stringify({sessionIds:t,mode:e,onFailure:o,model:n,reviewModel:s,name:c,taskIds:a,starts:i})},{timeoutMs:12e4}),suggestedRunName:t=>m("/batch/name?sessions=".concat(encodeURIComponent(t.join(",")))),stopBatch:()=>m("/batch/stop",{method:"POST",body:"{}"}),pauseBatch:()=>m("/batch/pause",{method:"POST",body:"{}"}),resumeBatch:()=>m("/batch/resume",{method:"POST",body:"{}"}),planBrief:t=>m("/plan/brief?lang=".concat(encodeURIComponent(t))),context:(t,e)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(e))),setContext:(t,e)=>m("/context/".concat(t),{method:"PUT",body:JSON.stringify({content:e})}),resetContext:(t,e)=>m("/context/".concat(t,"?lang=").concat(encodeURIComponent(e)),{method:"DELETE"}),checkPlan:t=>m("/plan/check",{method:"POST",body:JSON.stringify({text:t})}),importPlan:t=>m("/plan/import",{method:"POST",body:JSON.stringify({text:t})}),browseFolder:t=>m("/browse-folder",{method:"POST",body:JSON.stringify({start:t})},{timeoutMs:null}),tasks:()=>m("/tasks"),activity:()=>m("/activity"),downloadBundle:async t=>{var e,o,s;let c=await fetch("".concat(n,"/export/bundle"),{method:"POST",headers:{"content-type":"application/json",...a()?{"x-cop-token":a()}:{}},body:JSON.stringify({tasks:t})});if(!c.ok)throw Error(await c.text()||"".concat(c.status," ").concat(c.statusText));let i=null!=(s=c.headers.get("content-disposition"))?s:"",r=null==(e=/filename\*=UTF-8''([^;]+)/i.exec(i))?void 0:e[1],d=null==(o=/filename="([^"]+)"/i.exec(i))?void 0:o[1],l=null!=d?d:"copilot-operator-bundle.json";if(r)try{l=decodeURIComponent(r)}catch(t){}let u=URL.createObjectURL(await c.blob()),m=document.createElement("a");return m.href=u,m.download=l,document.body.appendChild(m),m.click(),m.remove(),setTimeout(()=>URL.revokeObjectURL(u),1e4),l},exportUrl:(t,e)=>{let o=new URLSearchParams;return e.run&&o.set("run",e.run),e.session&&o.set("session",e.session),e.task&&o.set("task",e.task),i("".concat(n,"/export/").concat(t,"?").concat(o.toString()))},debugExportUrl:t=>i("".concat(n,"/debug/export").concat(t.length>0?"?sessions=".concat(encodeURIComponent(t.join(","))):"")),vcsStatus:t=>m("/sessions/".concat(t,"/vcs")),runVcs:t=>m("/batch/vcs?ids=".concat(encodeURIComponent(t.join(",")))),runVcsPrepare:function(t,e,o){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m("/batch/vcs/prepare",{method:"POST",body:JSON.stringify({sessionIds:t,repoDir:e,action:o,choices:n})})},vcsSnapshot:(t,e)=>m("/sessions/".concat(t,"/vcs/snapshot"),{method:"POST",body:JSON.stringify({choices:e})}),restorePreview:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restore")),restore:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restore"),{method:"POST",body:"{}"}),contractCheck:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/contract")),applyContractFix:(t,e,o,n)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/contract-fix"),{method:"POST",body:JSON.stringify({choices:o,expect:n})}),restartPlan:(t,e)=>m("/sessions/".concat(t,"/tasks/").concat(e,"/restart")),restartFrom:function(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return m("/sessions/".concat(t,"/tasks/").concat(e,"/restart"),{method:"POST",body:JSON.stringify(o)})},repoCheck:t=>m("/repo?dir=".concat(encodeURIComponent(t))),project:()=>m("/project"),setProject:t=>m("/project",{method:"PUT",body:JSON.stringify(t)}),models:()=>m("/models"),setDefaultModel:t=>m("/models/default",{method:"PUT",body:JSON.stringify({model:t})}),setDefaultReviewModel:t=>m("/models/review-default",{method:"PUT",body:JSON.stringify({model:t})}),refreshModels:()=>m("/models/refresh",{method:"POST",body:"{}"},{timeoutMs:null}),login:t=>m("/login",{method:"POST",body:JSON.stringify({account:(null==t?void 0:t.trim())||void 0})},{timeoutMs:null})};function p(t){return t<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}function y(t){if(void 0===t)return"";let e=Math.round(t/1e3);if(e<60)return"".concat(e,"s");let o=Math.floor(e/60);return o<60?"".concat(o,"m ").concat(e%60,"s"):"".concat(Math.floor(o/60),"h ").concat(o%60,"m")}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[584],{287:(e,t,s)=>{s.d(t,{y:()=>h,f:()=>u});var n=s(3365),l=s(1521),a=s(5549),i=s(867),r=s(7527),c=s(1035),o=s(1701),d=s(4811);function u(e){var t,s,u;let{target:m,intro:f,initial:p="one",focusFirst:x=!1,checkContract:g=!0,onClose:j}=e,{t:y}=(0,i.kj)(),k=(0,d.p)(),[v,b]=(0,l.useState)(null),[N,w]=(0,l.useState)(p),[S,I]=(0,l.useState)(!1),[C,q]=(0,l.useState)(""),[F,R]=(0,l.useState)(!1),E=(0,l.useRef)(null),M=(0,l.useRef)(null),L=(0,l.useRef)(null),H=(0,l.useId)(),T=()=>a.FH.session(m.sessionId).then(b).catch(e=>q(e.message));(0,l.useEffect)(()=>{T(),g&&a.FH.contractCheck(m.sessionId,m.taskId).then(e=>R(e.conflicts.length>0)).catch(()=>void 0)},[m.sessionId,m.taskId]),(0,r.z)(T,3e3,!!(null==v?void 0:v.running));let D=null!==v;if((0,l.useEffect)(()=>{var e,t,s;if(!D||(null==(t=E.current)||null==(e=t.scrollIntoView)||e.call(t,{block:"nearest"}),!x))return;let n=M.current;n&&!n.disabled?n.focus():null==(s=L.current)||s.focus()},[D,x]),!v)return(0,n.jsx)("div",{className:"notice calm",style:{marginTop:8},children:(0,n.jsx)("span",{className:"small",children:C||y("runq.loading")})});let O=function(e,t){let s=e.tasks.findIndex(e=>e.id===t),n=s>=0?e.tasks[s]:void 0,l=s>=0?e.tasks.slice(0,s):[],a=s>=0?e.tasks.slice(s+1):[],i="continue"!==e.onFailure,r=-1;return a.forEach((e,t)=>{"queued"===e.status&&(r=t)}),{task:n,followingQueued:a.filter(e=>"queued"===e.status),laterRan:a.filter(e=>"queued"!==e.status),earlierRan:l.filter(e=>"queued"!==e.status),chain:i,chainGap:i?l.find(e=>"done"!==e.status):void 0,chainGapLater:i&&r>0?a.slice(0,r).find(e=>"queued"!==e.status&&"done"!==e.status):void 0}}(v,m.taskId),B=(null==(t=O.task)?void 0:t.status)==="queued",G="following"===N?[O.task,...O.followingQueued]:O.task?[O.task]:[],W=v.running?y("runq.sessionRunning"):!1===v.active?y("runq.sessionInactive"):"",A=async e=>{if("unattended"!==e||k||await (0,c.Z)(y("batch.unattendedConfirm",{n:1}))){I(!0),q(""),R(!1);try{var t,s;let n=await a.FH.suggestedRunName([m.sessionId]).then(e=>e.name).catch(()=>void 0),l=await (0,o.L)({sessionIds:[m.sessionId],mode:e,start:t=>a.FH.startBatch([m.sessionId],e,"stop",void 0,void 0,n,G.map(e=>e.id),t)});if(!l.started&&!l.reply)return;let i=null!=(t=l.reply)?t:{started:!0};if(!l.started){q(y("batch.notStarted",{reason:null!=(s=i.reason)?s:""}));let e=await a.FH.contractCheck(m.sessionId,m.taskId).catch(()=>({conflicts:[]}));R(e.conflicts.length>0);return}q(y("runq.started",{n:G.length})),j(!0)}catch(e){q(e.message)}finally{I(!1)}}},Q=y("runq.title",{title:m.title});return(0,n.jsxs)("div",{ref:E,className:"notice calm",role:"group","aria-label":Q,style:{marginTop:8},children:[f&&(0,n.jsx)("p",{className:"small",style:{marginTop:0},children:f}),(0,n.jsx)("strong",{children:Q}),B?(0,n.jsxs)(n.Fragment,{children:[O.followingQueued.length>0&&(0,n.jsxs)("div",{className:"small",role:"radiogroup","aria-label":Q,style:{marginTop:6},children:[(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"radio",name:"runq-".concat(H),checked:"one"===N,onChange:()=>w("one"),disabled:S}),y("runq.onlyThis")]}),(0,n.jsxs)("label",{className:"option-inline",title:y("runq.followingWhy"),children:[(0,n.jsx)("input",{type:"radio",name:"runq-".concat(H),checked:"following"===N,onChange:()=>w("following"),disabled:S}),y("runq.following",{n:O.followingQueued.length,session:v.name})]})]}),(0,n.jsx)("div",{className:"small",style:{marginTop:6},children:y("runq.willRun")}),(0,n.jsx)("ol",{className:"small",style:{margin:"4px 0",paddingLeft:22},children:G.map(e=>(0,n.jsx)("li",{children:e.title},e.id))}),(0,n.jsxs)("ul",{className:"small",style:{margin:"4px 0",paddingLeft:18},children:[O.chain&&G.length>1&&(0,n.jsx)("li",{children:y("runq.chainStops")}),O.earlierRan.length>0&&(0,n.jsx)("li",{children:y("runq.untouched",{n:O.earlierRan.length})}),O.laterRan.length>0&&(0,n.jsx)("li",{children:y("runq.laterRan",{list:O.laterRan.map(e=>'"'.concat(e.title,'"')).join(", ")})}),"one"===N&&O.followingQueued.length>0&&(0,n.jsx)("li",{children:y("runq.restWait",{n:O.followingQueued.length})})]}),O.chainGap&&(0,n.jsx)("div",{className:"notice caution small",style:{marginTop:6},children:y("runq.chainGap",{before:O.chainGap.title,status:y("status.".concat(O.chainGap.status))})}),"following"===N&&O.chainGapLater&&(0,n.jsx)("div",{className:"notice caution small",style:{marginTop:6},children:y("runq.chainGapLater",{between:O.chainGapLater.title,status:y("status.".concat(O.chainGapLater.status))})}),W&&(0,n.jsx)("p",{className:"small",children:W})]}):(0,n.jsx)("p",{className:"small",children:y("runq.notQueued",{status:y("status.".concat(null!=(u=null==(s=O.task)?void 0:s.status)?u:"queued"))})}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[B&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{ref:M,className:"primary",disabled:S||!!W,onClick:()=>void A("confirm"),title:y("runq.goWhy"),children:y("runq.go")}),(0,n.jsx)("button",{disabled:S||!!W,onClick:()=>void A("unattended"),title:y("runq.unattendedWhy"),children:y("runq.unattended")})]}),(0,n.jsx)("button",{ref:L,className:"quiet",disabled:S,onClick:()=>j(!1),children:f?y("runq.later"):y("dialog.cancel")}),C&&(0,n.jsx)("span",{className:"small",role:"status",children:C})]}),F&&(0,n.jsx)(h,{target:m,onApplied:(e,t)=>{T(),0===e&&(R(!1),q(t))}})]})}function h(e){let{target:t,onApplied:s}=e,{t:r}=(0,i.kj)(),[c,o]=(0,l.useState)(null),[d,u]=(0,l.useState)([]),[h,m]=(0,l.useState)(!1),[f,p]=(0,l.useState)(""),[x,g]=(0,l.useState)(null),[j,y]=(0,l.useState)(null),k=(0,l.useId)();(0,l.useEffect)(()=>{o(null),Promise.all([a.FH.contractCheck(t.sessionId,t.taskId),a.FH.session(t.sessionId)]).then(e=>{var s;let[n,l]=e,a=l.tasks.find(e=>e.id===t.taskId);o(n.conflicts),u(n.conflicts.map(e=>e.fixes.length>0?0:-1)),g(null!=(s=null==a?void 0:a.status)?s:null),y(a?{readOnly:a.readOnly,scope:a.scope,checks:a.checks}:null)}).catch(e=>p(e.message))},[t.sessionId,t.taskId]);let v=async()=>{if(c){m(!0),p("");try{let e=await a.FH.applyContractFix(t.sessionId,t.taskId,d,c.map(e=>e.text)),n=r("cfix.applied",{list:(j?function(e,t,s){var n,l,a,i;let r=[];!!t.readOnly!=!!s.readOnly&&r.push(e(s.readOnly?"cfix.chReadOnlyOn":"cfix.chReadOnlyOff"));let c=(null!=(n=t.scope)?n:[]).join(", "),o=(null!=(l=s.scope)?l:[]).join(", ");c!==o&&r.push(o?e("cfix.chScope",{paths:o}):e("cfix.chScopeRemoved"));let d=new Set((null!=(a=s.checks)?a:[]).map(e=>e.name));for(let s of null!=(i=t.checks)?i:[])d.has(s.name)||r.push(e("cfix.chDropped",{check:s.name}));return r.join("; ")}(r,j,e.task):e.applied.join("; "))||r("cfix.chNothing")});p(n+(e.remaining.length>0?" ".concat(r("cfix.remaining",{n:e.remaining.length})):"")),o(e.remaining),u(e.remaining.map(e=>e.fixes.length>0?0:-1)),g("queued"),y({readOnly:e.task.readOnly,scope:e.task.scope,checks:e.task.checks}),s(e.remaining.length,n)}catch(e){p(e.message)}finally{m(!1)}}},b=r("cfix.title",{title:t.title});return(0,n.jsxs)("div",{className:"notice caution",role:"group","aria-label":b,style:{marginTop:8},children:[(0,n.jsx)("strong",{children:b}),(0,n.jsx)("p",{className:"why",children:r("cfix.why")}),null===c?(0,n.jsx)("p",{className:"small",children:f||r("cfix.loading")}):0===c.length?(0,n.jsx)("p",{className:"small",role:"status",children:f||r("cfix.none")}):(0,n.jsxs)(n.Fragment,{children:[c.map((e,t)=>(0,n.jsxs)("fieldset",{className:"small",style:{margin:"8px 0",border:0,padding:0},children:[(0,n.jsx)("legend",{style:{fontWeight:600},children:e.text}),e.fixes.map((e,s)=>(0,n.jsxs)("label",{className:"option-inline",style:{display:"block"},children:[(0,n.jsx)("input",{type:"radio",name:"cfix-".concat(k,"-").concat(t),checked:d[t]===s,onChange:()=>u(e=>e.map((e,n)=>n===t?s:e)),disabled:h}),"add-to-scope"===e.kind?r("cfix.addToScope",{path:e.path}):"not-read-only"===e.kind?e.scope.length>0?r("cfix.notReadOnly",{paths:e.scope.join(", ")}):r("cfix.notReadOnlyAll"):"drop-scope"===e.kind?r("cfix.dropScope"):r("cfix.dropCheck",{check:e.check}),0===s&&(0,n.jsxs)("span",{className:"muted",children:[" ",r("cfix.minimal")]})]},s)),(0,n.jsxs)("label",{className:"option-inline",style:{display:"block"},children:[(0,n.jsx)("input",{type:"radio",name:"cfix-".concat(k,"-").concat(t),checked:-1===d[t],onChange:()=>u(e=>e.map((e,s)=>s===t?-1:e)),disabled:h}),e.fixes.length>0?r("cfix.leave"):r("cfix.noFix")]})]},t)),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{className:"primary",disabled:h||d.every(e=>-1===e),onClick:()=>void v(),children:"queued"===x?r("cfix.applyQueued"):r("cfix.apply")}),f&&(0,n.jsx)("span",{className:"small",role:"status",children:f})]})]})]})}},1366:(e,t,s)=>{s.d(t,{w:()=>r,y:()=>i});var n=s(3365),l=s(1521),a=s(867);function i(e){let{readOnly:t,scope:s,onReadOnly:i,onScope:r}=e,{t:c}=(0,a.kj)(),o=(0,l.useId)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"option",style:{marginTop:10},children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:t,onChange:e=>i(e.target.checked)}),(0,n.jsx)("span",{children:c("task.readOnlyEdit")})]}),(0,n.jsx)("p",{className:"why",children:c("task.readOnlyEditWhy")})]}),(0,n.jsx)("label",{htmlFor:"".concat(o,"-scope"),children:c("task.scopeEdit")}),(0,n.jsx)("textarea",{id:"".concat(o,"-scope"),value:s,onChange:e=>r(e.target.value),placeholder:"tests/e2e/\nsrc/**/*.ts",style:{minHeight:60},disabled:t}),(0,n.jsx)("p",{className:"why",children:c("task.scopeEditWhy")})]})}function r(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}},1910:(e,t,s)=>{s.d(t,{H:()=>c,u:()=>r});var n=s(3365),l=s(1521),a=s(867),i=s(5549);function r(e){let{label:t,save:s}=e,{t:i}=(0,a.kj)(),[r,c]=(0,l.useState)(!1),[o,d]=(0,l.useState)(""),[u,h]=(0,l.useState)(!1),m=async()=>{c(!0),d("");try{var e;let t=await s();h(!1),d(t.revealed?i("save.done",{path:t.path}):i("save.savedOnly",{path:t.path,note:null!=(e=t.note)?e:""}))}catch(e){h(!0),d(i("save.failed",{problem:e.message}))}finally{c(!1)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish",disabled:r,title:i("save.why"),onClick:()=>void m(),children:r?i("save.saving"):t}),o&&(0,n.jsx)("span",{className:u?"err small":"muted small",children:o})]})}function c(e){let{sessionId:t,taskId:s,attempt:r}=e,{t:c}=(0,a.kj)(),[o,d]=(0,l.useState)(!1),[u,h]=(0,l.useState)(""),[m,f]=(0,l.useState)(!1),p=async()=>{d(!0),h("");try{let e=await i.FH.downloadBundle([{sessionId:t,taskId:s,attempt:r}]);f(!1),h(c("reg.bundleSaved",{name:e}))}catch(e){f(!0),h(c("save.failed",{problem:e.message}))}finally{d(!1)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish",disabled:o,title:c("save.attemptRecordWhy"),onClick:()=>void p(),children:o?c("save.saving"):c("save.attemptRecord")}),u&&(0,n.jsx)("span",{className:m?"err small":"muted small",children:u})]})}},2876:(e,t,s)=>{s.d(t,{P:()=>d});var n=s(3365),l=s(1521),a=s(5549),i=s(867);function r(e,t){let[s,n]=(0,l.useState)(null),a=(0,l.useRef)(!0),[i,r]=(0,l.useState)(!0),c=(0,l.useCallback)(e=>n(e),[]);return(0,l.useLayoutEffect)(()=>{if(!s)return;let e=()=>{let e=s.scrollHeight-s.scrollTop-s.clientHeight<=24;a.current=e,r(e)};return s.addEventListener("scroll",e,{passive:!0}),()=>s.removeEventListener("scroll",e)},[s]),(0,l.useLayoutEffect)(()=>{s&&e&&a.current&&(s.scrollTop=s.scrollHeight)},[s,e,t]),{ref:c,following:i,follow:(0,l.useCallback)(()=>{a.current=!0,r(!0),s&&(s.scrollTop=s.scrollHeight)},[s])}}var c=s(5132);function o(e){let{text:t,follow:s}=e,{ref:l}=r(s,t);return(0,n.jsx)("pre",{ref:l,className:"story-out".concat(s?" terminal":""),children:t})}function d(e){let{sessionId:t,taskId:s,runId:d,live:h}=e,{t:m}=(0,i.kj)(),[f,p]=(0,l.useState)(null),[x,g]=(0,l.useState)(""),[j,y]=(0,l.useState)(!0),[k,v]=(0,l.useState)(!0),[b,N]=(0,l.useState)(new Set),[w,S]=(0,l.useState)(new Set),[I,C]=(0,l.useState)(new Set),q=!!(null==f?void 0:f.live),F=(0,l.useRef)(0);F.current+=1;let R=r(q,F.current),E=(0,l.useRef)(null),M=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!f)return;let e=[],t=(s,n)=>s.forEach((s,l)=>{let a="".concat(n).concat(l);"review"===s.kind?t(s.entries,"".concat(a,"-")):"step"!==s.kind||s.outcome||e.push(a)});t(f.entries,"e"),e.some(e=>!w.has(e))&&S(t=>new Set([...t,...e])),f.live&&!M.current&&E.current&&(M.current=!0,E.current.scrollIntoView({block:"nearest",behavior:"smooth"}))},[f,w]),(0,l.useEffect)(()=>{let e,n=!0,l=async()=>{try{let i=await a.FH.taskStory(t,s,d);if(!n)return;p(i),g(""),(i.live||h)&&(e=setTimeout(l,2e3))}catch(t){if(!n)return;g(t.message),h&&(e=setTimeout(l,2e3))}};return l(),()=>{n=!1,e&&clearTimeout(e)}},[t,s,d,h]),x&&!f)return(0,n.jsx)("div",{className:"err small",children:x});if(!f)return(0,n.jsx)("div",{className:"muted small",children:m("story.loading")});let L=e=>b.has(e)||w.has(e)&&!I.has(e),H=e=>{let t=L(e);N(s=>{let n=new Set(s);return t?n.delete(e):n.add(e),n}),C(s=>{let n=new Set(s);return t?n.add(e):n.delete(e),n})},T=(e,t)=>{if(!("review"===e.kind?j||k:"step"===e.kind?k:j))return null;if("review"===e.kind)return(0,n.jsxs)("li",{className:"story-review",children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)(u,{at:e.at}),(0,n.jsx)("span",{className:"chip",children:m("story.review",{n:e.round})})]}),(0,n.jsx)("ol",{className:"story",children:e.entries.map((e,s)=>T(e,"".concat(t,"-").concat(s)))})]},t);if("step"===e.kind){let s=L(t),l=!e.outcome&&f.live;return(0,n.jsxs)("li",{className:"story-step".concat(e.failed?" failed":""),children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)(u,{at:e.at}),(0,n.jsx)("span",{className:"chip",children:m("story.step",{it:e.iteration,id:e.id})}),e.outcome&&(0,n.jsxs)("span",{className:"badge ".concat(e.failed?"failed":"done"),children:[e.outcome,void 0!==e.exitCode?" \xb7 exit ".concat(e.exitCode):"",void 0!==e.durationMs?" \xb7 ".concat((0,a.c5)(e.durationMs)):""]}),!e.outcome&&(0,n.jsx)("span",{className:"badge running",children:m("story.running")}),e.failed&&(0,n.jsx)("span",{className:"badge failed",children:m("story.failedHere")})]}),(0,n.jsx)("pre",{className:"story-cmd",children:e.command}),e.output&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>H(t),children:s?m("story.hideOutput"):m("story.showOutput",{n:e.output.length})}),s&&(0,n.jsx)(o,{text:e.output,follow:l})]})]},t)}let s=b.has(t),l="sent"===e.kind?m("story.bot"):m("story.chat"),i="reply"===e.kind&&("blocked"===e.status||"failed"===e.status);return(0,n.jsxs)("li",{className:"story-msg ".concat(e.kind).concat(i?" failed":""),children:[(0,n.jsxs)("div",{className:"story-head",children:[(0,n.jsx)(u,{at:e.at}),(0,n.jsx)("strong",{children:l}),(0,n.jsx)("span",{className:"muted small",children:e.label}),"reply"===e.kind&&e.status&&(0,n.jsx)("span",{className:"badge ".concat(i?"failed":"done"===e.status?"done":""),children:e.status})]}),"reply"===e.kind&&e.notes&&(0,n.jsx)("p",{className:"story-notes",children:e.notes}),(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>H(t),children:s?m("story.hideText"):m("story.showText",{n:e.text.length})}),s&&(0,n.jsx)("pre",{className:"story-out",children:e.text})]},t)},D=f.close,O=D&&"done"!==D.status;return(0,n.jsxs)("div",{className:"story-box",ref:E,children:[(0,n.jsxs)("div",{className:"row small",style:{marginBottom:6},children:[(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:j,onChange:e=>y(e.target.checked)})," ",m("story.showChat")]}),(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:k,onChange:e=>v(e.target.checked)})," ",m("story.showCommands")]}),f.live&&(0,n.jsxs)("span",{className:"live",children:[(0,n.jsx)("span",{className:"dot","aria-hidden":"true"})," ",m("story.live")]}),f.live&&!R.following&&(0,n.jsx)("button",{type:"button",className:"quiet small",onClick:R.follow,title:m("story.followWhy"),children:m("story.follow")}),x&&(0,n.jsx)("span",{className:"err",children:x})]}),(0,n.jsxs)("div",{className:"story-fixed",children:[(0,n.jsx)("strong",{children:m("story.prompt")}),(0,n.jsx)("pre",{className:"story-out always",children:f.prompt})]}),(0,n.jsx)("div",{ref:R.ref,className:"story-scroll".concat(f.live?" live":""),children:(0,n.jsx)("ol",{className:"story",children:f.entries.map((e,t)=>T(e,"e".concat(t)))})}),D?(0,n.jsxs)("div",{className:"story-fixed close".concat(O?" failed":""),children:[(0,n.jsx)("strong",{children:O?m("story.endedBadly",{status:D.status}):m("story.ended")}),D.reason&&(0,n.jsx)("p",{className:"err small",children:D.reason}),D.summary&&(0,n.jsx)(c.s,{text:D.summary,className:"what"}),D.checks&&D.checks.length>0&&(0,n.jsx)("ul",{className:"small",style:{margin:"6px 0 0",paddingLeft:18},children:D.checks.map((e,t)=>(0,n.jsxs)("li",{className:e.passed?"":"err",children:[e.passed?"✓":"✗"," ",e.name,!e.passed&&e.detail?" — ".concat(e.detail):""]},t))})]}):(0,n.jsx)("div",{className:"story-fixed muted small",children:m("story.notEnded")})]})}function u(e){let{at:t}=e,s=(0,i.W3)(),{locale:l}=(0,i.kj)();if(!t)return null;let a=new Date(t),r="bg"===l?"bg-BG":void 0,c=a.toLocaleTimeString(r,{hour12:!1}),o=new Date().toDateString()===a.toDateString();return(0,n.jsx)("time",{className:"story-when",dateTime:t,title:s(t),children:o?c:"".concat(a.toLocaleDateString(r)," ").concat(c)})}},3041:(e,t,s)=>{s.d(t,{e:()=>r});var n=s(1521),l=s(5549),a=s(1035),i=s(867);function r(e){let{t}=(0,i.kj)(),[s,r]=(0,n.useState)(""),[c,o]=(0,n.useState)({taskId:"",text:""}),d=(e,t)=>o({taskId:e,text:t}),u=(0,n.useCallback)(async s=>{r("restore"),d(s.taskId,"");try{var n,i,c,o,u,h,m,f,p,x,g,j,y,k;let r=await l.FH.restorePreview(s.sessionId,s.taskId);if(!r.ok)return void d(s.taskId,t("restore.cannot",{problem:null!=(c=r.problem)?c:""}));let v={repo:r.repoDir,title:s.title,branch:null!=(o=r.branchName)?o:"",commit:(null!=(u=r.baseCommit)?u:"").slice(0,8)},b=r.leftBehind.length>0?t("restore.confirmLosing",{...v,n:r.leftBehind.length,kept:null!=(h=r.keptOn)?h:"",list:r.leftBehind.slice(0,10).join("\n")}):t("restore.confirm",v);if(!await (0,a.Z)(b))return;let N=await l.FH.restore(s.sessionId,s.taskId);if(!N.ok)return void d(s.taskId,t("restore.failed",{problem:null!=(m=N.problem)?m:""}));d(s.taskId,(null!=(f=null==(n=N.leftBehind)?void 0:n.length)?f:0)>0?t("restore.done",{branch:null!=(p=N.branch)?p:"",commit:(null!=(x=N.commit)?x:"").slice(0,8),n:null!=(g=null==(i=N.leftBehind)?void 0:i.length)?g:0,kept:null!=(j=N.keptOn)?j:""}):t("restore.doneNothing",{branch:null!=(y=N.branch)?y:"",commit:(null!=(k=N.commit)?k:"").slice(0,8)})),e()}catch(e){d(s.taskId,e.message)}finally{r("")}},[t,e]),h=(0,n.useCallback)(async s=>{r("restart"),d(s.taskId,"");try{var n,i,c;let r=await l.FH.restartPlan(s.sessionId,s.taskId);if(!r.ok)return void d(s.taskId,t("restart.cannot",{problem:null!=(n=r.problem)?n:""}));let o=r.restores.filter(e=>!e.ok);if(o.length>0)return void d(s.taskId,t("restart.cannot",{problem:o.map(e=>{var t;return"".concat(e.repoDir,": ").concat(null!=(t=e.problem)?t:"")}).join(" | ")}));let u=r.restores.map(e=>{var s,n,l,a,i;return[t("restart.repoLine",{repo:e.repoDir,commit:(null!=(s=e.baseCommit)?s:"").slice(0,8),branch:null!=(n=e.branchName)?n:"",n:e.leftBehind.length,kept:null!=(l=e.keptOn)?l:""}),...e.leftBehind.length>0?[t("restart.commitsHead",{kept:null!=(a=e.keptOn)?a:""})]:[],...e.leftBehind.slice(0,15).map(e=>" ".concat(e)),...e.leftBehind.length>15?[t("restart.commitsMore",{n:e.leftBehind.length-15})]:[],...(null!=(i=e.laterSessions)?i:[]).flatMap(e=>[t("restart.laterSession",{session:e.sessionName,n:e.commits.length,branch:e.branch}),...e.commits.slice(0,15).map(e=>" ".concat(e)),...e.commits.length>15?[t("restart.commitsMore",{n:e.commits.length-15})]:[]])].join("\n")}).join("\n"),h=r.tasks.map(e=>" ".concat(e.sessionName," / ").concat(e.title).concat(e.alreadyQueued?t("restart.alreadyQueued"):t("restart.taskRedo",{status:t("status.".concat(e.status))}))).join("\n"),m="unattended"===r.mode&&!!r.unattendedRefused,f=t("restart.confirm",{title:r.from.title,tasks:r.tasks.length,sessions:r.sessions.length,list:h,repos:u||t("restart.noRepo"),mode:t("unattended"!==r.mode||m?"run.confirm":"run.unattended")})+(m?t("restart.stepByStep",{reason:null!=(i=r.unattendedRefused)?i:""}):"");if(!await (0,a.Z)(f))return;let p=await l.FH.restartFrom(s.sessionId,s.taskId,m?{mode:"confirm"}:{});if(!p.started){d(s.taskId,t("restart.failed",{problem:null!=(c=p.reason)?c:""})),e();return}d(s.taskId,t("restart.started",{requeued:p.requeued,repos:p.restored.length})),e()}catch(e){d(s.taskId,e.message)}finally{r("")}},[t,e]);return{busy:s,message:c.text,messageTask:c.taskId,clearMessage:()=>d("",""),restore:u,restartFrom:h}}},3374:(e,t,s)=>{s.d(t,{c:()=>l});var n=s(1521);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,[s,l]=(0,n.useState)(()=>Date.now());return(0,n.useEffect)(()=>{if(!e)return;l(Date.now());let s=window.setInterval(()=>l(Date.now()),t);return()=>window.clearInterval(s)},[e,t]),s}},3523:(e,t,s)=>{function n(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();if(!e)return;let n=Date.parse(e);if(Number.isNaN(n))return;let l=t?Date.parse(t):s;return Number.isNaN(l)?void 0:Math.max(0,l-n)}function l(e){return!!e.startedAt&&!e.finishedAt&&"queued"!==e.status}function a(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),n=t.some(e=>l(e)),a=t.map(e=>e.finishedAt?Date.parse(e.finishedAt):NaN).filter(e=>!Number.isNaN(e)),i=Date.parse(e.startedAt),r=n||0===a.length?s:Math.max(...a);return{ms:Number.isNaN(i)?0:Math.max(0,r-i),live:n,tasks:t.length}}function i(e){var t,s;let n=new Map;for(let s of e){if(!s.runGroup)continue;let e=null!=(t=n.get(s.runGroup.id))?t:{run:s.runGroup,tasks:[]};e.tasks.push(s),n.set(s.runGroup.id,e)}return null!=(s=[...n.values()].sort((e,t)=>Date.parse(t.run.startedAt)-Date.parse(e.run.startedAt))[0])?s:null}s.d(t,{DG:()=>l,d5:()=>n,eZ:()=>a,hH:()=>i})},4811:(e,t,s)=>{s.d(t,{p:()=>a});var n=s(1521),l=s(5549);function a(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=!0;return l.FH.settings().then(s=>{var n;let l=null!=(n=s.raw.execution)?n:{};e&&t("unattended"===l.mode)}).catch(()=>void 0),()=>{e=!1}},[]),e}},5132:(e,t,s)=>{s.d(t,{s:()=>r});var n=s(3365),l=s(1521);function a(e,t){let s,l=[],a=/(`[^`\n]+`)|(\*\*[^*\n]+\*\*)|(\*[^*\n]+\*)/g,i=0,r=0;for(;null!==(s=a.exec(e));){s.index>i&&l.push(e.slice(i,s.index));let a=s[0],c="".concat(t,"-i").concat(r+=1);a.startsWith("`")?l.push((0,n.jsx)("code",{children:a.slice(1,-1)},c)):a.startsWith("**")?l.push((0,n.jsx)("strong",{children:a.slice(2,-2)},c)):l.push((0,n.jsx)("em",{children:a.slice(1,-1)},c)),i=s.index+a.length}return i<e.length&&l.push(e.slice(i)),l}function i(e){let t=/^\s*[-*•]\s+(.*)$/.exec(e);if(t)return t[1];let s=/^\s*\d+[.)]\s+(.*)$/.exec(e);return s?s[1]:null}function r(e){let{text:t,className:s}=e,r=[],c=t.replace(/\r\n/g,"\n").split("\n"),o=0,d=0;for(;o<c.length;){let e=c[o];if(e.trim().startsWith("```")){let e=[];for(o+=1;o<c.length&&!c[o].trim().startsWith("```");)e.push(c[o++]);o+=1,e.length>0&&r.push((0,n.jsx)("pre",{children:e.join("\n")},"b".concat(d+=1)));continue}if(null!==i(e)){let e=[];for(;o<c.length&&null!==i(c[o]);)e.push(i(c[o++]));r.push((0,n.jsx)("ul",{children:e.map((e,t)=>(0,n.jsx)("li",{children:a(e,"b".concat(d,"-").concat(t))},t))},"b".concat(d+=1)));continue}if(""===e.trim()){o+=1;continue}let t=[];for(;o<c.length&&""!==c[o].trim()&&null===i(c[o])&&!c[o].trim().startsWith("```");)t.push(c[o++]);let s=d+=1;r.push((0,n.jsx)("p",{children:t.map((e,t)=>(0,n.jsxs)(l.Fragment,{children:[t>0&&(0,n.jsx)("br",{}),a(e,"b".concat(s,"-").concat(t))]},t))},"b".concat(s)))}return(0,n.jsx)("div",{className:"rich ".concat(null!=s?s:""),children:r})}},8934:(e,t,s)=>{s.d(t,{C:()=>o});var n=s(3365),l=s(1521),a=s(5549),i=s(4969),r=s(867);function c(e){if(null===e||""===e)return[];let t=e.split(/\r?\n/);return""===t[t.length-1]&&t.pop(),t}function o(e){let{sessionId:t,taskId:s,runId:a,title:i,files:c}=e,{t:o}=(0,r.kj)(),[u,h]=(0,l.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"linkish",onClick:()=>h(!0),title:o("diff.openWhy"),children:o("diff.open",{n:c})}),u&&(0,n.jsx)(d,{sessionId:t,taskId:s,runId:a,title:i,onClose:()=>h(!1)})]})}function d(e){var t,s,o,d,h,m,f;let{sessionId:p,taskId:x,runId:g,title:j,onClose:y}=e,{t:k}=(0,r.kj)(),[v,b]=(0,l.useState)(null),[N,w]=(0,l.useState)(""),[S,I]=(0,l.useState)(0),[C,q]=(0,l.useState)(new Map),[F,R]=(0,l.useState)(!1),[E,M]=(0,l.useState)(!0),[L,H]=(0,l.useState)(new Map),[T,D]=(0,l.useState)(-1),O=(0,l.useRef)(null),B=(0,l.useRef)(null),G=(0,l.useRef)(null);(0,i.V)(B,!0,G),(0,l.useEffect)(()=>{a.FH.taskChanges(p,x,g).then(b).catch(e=>w(e.message))},[p,x,g]);let W=null!=(o=null==v?void 0:v.files)?o:[],A=W[S];(0,l.useEffect)(()=>{!A||C.has(A.path)||a.FH.taskChangeFile(p,x,A.path,g).then(e=>q(t=>new Map(t).set(A.path,e))).catch(e=>q(t=>new Map(t).set(A.path,e.message)))},[A,C,p,x,g]);let Q=A?C.get(A.path):void 0,P=(0,l.useMemo)(()=>!Q||"string"==typeof Q||Q.binary||Q.tooLarge?[]:function(e,t){let s=function(e,t){let s=0;for(;s<e.length&&s<t.length&&e[s]===t[s];)s+=1;let n=e.length,l=t.length;for(;n>s&&l>s&&e[n-1]===t[l-1];)n-=1,l-=1;let a=[];for(let e=0;e<s;e+=1)a.push({kind:"same",a:e,b:e});for(let i of function(e,t){let s=e.length,n=t.length;if(0===s)return t.map((e,t)=>({kind:"add",b:t}));if(0===n)return e.map((e,t)=>({kind:"del",a:t}));let l=s+n,a=l+1,i=new Int32Array(2*l+3),r=[];for(let c=0;c<=Math.min(l,2e3);c+=1){r.push(i.slice(a-c-1,a+c+2));for(let l=-c;l<=c;l+=2){let o=l===-c||l!==c&&i[a+l-1]<i[a+l+1]?i[a+l+1]:i[a+l-1]+1,d=o-l;for(;o<s&&d<n&&e[o]===t[d];)o+=1,d+=1;if(i[a+l]=o,o>=s&&d>=n)return function(e,t,s,n){let l=[],a=t.length,i=s.length;for(let t=n;t>0;t-=1){let s=e[t],n=e=>s[e+t+1],r=a-i,c=r===-t||r!==t&&n(r-1)<n(r+1)?r+1:r-1,o=n(c),d=o-c;for(;a>o&&i>d;)a-=1,i-=1,l.push({kind:"same",a:a,b:i});a===o?l.push({kind:"add",b:d}):l.push({kind:"del",a:o}),a=o,i=d}for(;a>0&&i>0;)a-=1,i-=1,l.push({kind:"same",a:a,b:i});return l.reverse()}(r,e,t,c)}}return[...e.map((e,t)=>({kind:"del",a:t})),...t.map((e,t)=>({kind:"add",b:t}))]}(e.slice(s,n),t.slice(s,l)))a.push({kind:i.kind,...void 0!==i.a?{a:i.a+s}:{},...void 0!==i.b?{b:i.b+s}:{}});for(let t=0;n+t<e.length;t+=1)a.push({kind:"same",a:n+t,b:l+t});return a}(e,t),n=[];for(let l=0;l<s.length;){let a=s[l];if("same"===a.kind){n.push({kind:"same",left:{no:a.a+1,text:e[a.a]},right:{no:a.b+1,text:t[a.b]}}),l+=1;continue}let i=[],r=[];for(;l<s.length&&"same"!==s[l].kind;){let e=s[l];"del"===e.kind?i.push(e.a):r.push(e.b),l+=1}let c=Math.max(i.length,r.length);for(let s=0;s<c;s+=1){let l=i[s],a=r[s];n.push({kind:void 0!==l&&void 0!==a?"change":void 0!==l?"del":"add",...void 0!==l?{left:{no:l+1,text:e[l]}}:{},...void 0!==a?{right:{no:a+1,text:t[a]}}:{}})}}return n}(c(Q.before),c(Q.after)),[Q]),V=A&&L.get(A.path)||new Set,Z=(0,l.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(n)return e.map((e,t)=>({type:"row",row:e,index:t}));let l=[];for(let n=0;n<e.length;){if("same"!==e[n].kind){l.push({type:"row",row:e[n],index:n}),n+=1;continue}let a=n;for(;a<e.length&&"same"===e[a].kind;)a+=1;let i=0===n?0:t,r=a===e.length?0:t,c=a-n-i-r;if(c>1&&!s.has(n+i)){for(let t=n;t<n+i;t+=1)l.push({type:"row",row:e[t],index:t});l.push({type:"gap",from:n+i,count:c});for(let t=a-r;t<a;t+=1)l.push({type:"row",row:e[t],index:t})}else for(let t=n;t<a;t+=1)l.push({type:"row",row:e[t],index:t});n=a}return l})(P,3,V,F),[P,V,F]),_=(0,l.useMemo)(()=>P.flatMap((e,t)=>"same"!==e.kind&&(0===t||"same"===P[t-1].kind)?[t]:[]),[P]);(0,l.useEffect)(()=>{D(-1),O.current&&(O.current.scrollTop=0)},[S]);let K=(0,l.useCallback)(e=>{var t;if(0===_.length)return;let s=T<0?1===e?0:_.length-1:Math.min(_.length-1,Math.max(0,T+e));D(s);let n=null==(t=O.current)?void 0:t.querySelector('[data-row="'.concat(_[s],'"]'));null==n||n.scrollIntoView({block:"center"})},[T,_]),$=(0,l.useCallback)(e=>I(t=>Math.min(Math.max(0,t+e),Math.max(0,W.length-1))),[W.length]);(0,l.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey&&!e.altKey){if("Escape"===e.key)y();else if("n"===e.key)K(1);else if("p"===e.key)K(-1);else if("]"===e.key)$(1);else{if("["!==e.key)return;$(-1)}e.preventDefault()}};window.addEventListener("keydown",e);let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=t}},[K,$,y]);let z=W.reduce((e,t)=>({added:e.added+Math.max(0,t.added),removed:e.removed+Math.max(0,t.removed)}),{added:0,removed:0});return(0,n.jsxs)("div",{ref:B,className:"diff-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"diff-title",children:[(0,n.jsxs)("div",{className:"diff-head",children:[(0,n.jsx)("h2",{id:"diff-title",children:k("diff.title",{title:j})}),(null==v?void 0:v.ok)&&(0,n.jsxs)("span",{className:"muted small",children:[v.branch?"".concat(v.branch," \xb7 "):"",null==(t=v.base)?void 0:t.slice(0,8)," → ",null==(s=v.commit)?void 0:s.slice(0,8)," \xb7 ",k("diff.summary",{n:W.length,a:z.added,r:z.removed})]}),(0,n.jsx)("span",{className:"grow"}),(0,n.jsx)("span",{className:"muted small",children:k("diff.keys")}),(0,n.jsx)("button",{ref:G,type:"button",onClick:y,children:k("diff.close")})]}),N&&(0,n.jsx)("div",{className:"err",style:{padding:12},children:N}),!v&&!N&&(0,n.jsx)("div",{className:"muted",style:{padding:12},children:k("diff.loading")}),v&&!v.ok&&(0,n.jsx)("div",{className:"notice caution",style:{margin:12},children:v.problem}),(null==v?void 0:v.ok)&&0===W.length&&(0,n.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.nothing")}),(null==v?void 0:v.ok)&&W.length>0&&(0,n.jsxs)("div",{className:"diff-body",children:[(0,n.jsx)("nav",{className:"diff-files","aria-label":k("diff.files"),children:W.map((e,t)=>{let s=e.path.lastIndexOf("/");return(0,n.jsxs)("button",{type:"button",className:"diff-file".concat(t===S?" on":""),onClick:()=>I(t),title:e.oldPath?"".concat(e.oldPath," → ").concat(e.path):e.path,children:[(0,n.jsx)("span",{className:"diff-status s-".concat(e.status),children:e.status}),(0,n.jsxs)("span",{className:"diff-path",children:[s>=0&&(0,n.jsx)("span",{className:"muted",children:e.path.slice(0,s+1)}),(0,n.jsx)("strong",{children:e.path.slice(s+1)})]}),(0,n.jsx)("span",{className:"diff-counts",children:e.added<0?k("diff.binaryShort"):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"plus",children:["+",e.added]})," ",(0,n.jsxs)("span",{className:"minus",children:["−",e.removed]})]})})]},e.path)})}),(0,n.jsxs)("div",{className:"diff-main",children:[A&&(0,n.jsxs)("div",{className:"diff-toolbar",children:[(0,n.jsx)("strong",{className:"diff-name",children:A.oldPath?"".concat(A.oldPath," → ").concat(A.path):A.path}),(0,n.jsx)("span",{className:"muted small",children:"A"===A.status?k("diff.added"):"D"===A.status?k("diff.deleted"):"R"===A.status?k("diff.renamed"):""}),(0,n.jsx)("span",{className:"grow"}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>K(-1),disabled:0===_.length,children:k("diff.prevChange")}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>K(1),disabled:0===_.length,children:k("diff.nextChange")}),(0,n.jsx)("span",{className:"muted small",children:_.length>0?k("diff.changeN",{i:T<0?"–":T+1,n:_.length}):""}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>$(-1),disabled:0===S,children:k("diff.prevFile")}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>$(1),disabled:S>=W.length-1,children:k("diff.nextFile")}),(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:F,onChange:e=>R(e.target.checked)})," ",k("diff.whole")]}),(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:E,onChange:e=>M(e.target.checked)})," ",k("diff.wrap")]})]}),(0,n.jsxs)("div",{className:"diff-scroll",ref:O,children:[void 0===Q&&(0,n.jsx)("div",{className:"muted",style:{padding:12},children:k("diff.loading")}),"string"==typeof Q&&(0,n.jsx)("div",{className:"err",style:{padding:12},children:Q}),Q&&"string"!=typeof Q&&Q.binary&&(0,n.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.binary")}),Q&&"string"!=typeof Q&&Q.tooLarge&&(0,n.jsx)("div",{className:"notice",style:{margin:12},children:k("diff.tooLarge")}),Q&&"string"!=typeof Q&&!Q.binary&&!Q.tooLarge&&(0,n.jsxs)(n.Fragment,{children:[(null!=(d=Q.before)?d:"").includes("\r\n")!==(null!=(h=Q.after)?h:"").includes("\r\n")&&null!==Q.before&&null!==Q.after&&(0,n.jsx)("div",{className:"notice small",style:{margin:8},children:k("diff.eol",{from:(null!=(m=Q.before)?m:"").includes("\r\n")?"CRLF":"LF",to:(null!=(f=Q.after)?f:"").includes("\r\n")?"CRLF":"LF"})}),P.length>0&&0===_.length&&(0,n.jsx)("div",{className:"notice small",style:{margin:8},children:k("diff.sameText")}),(0,n.jsxs)("table",{className:"diff-table".concat(E?"":" nowrap"),children:[(0,n.jsxs)("colgroup",{children:[(0,n.jsx)("col",{className:"num"}),(0,n.jsx)("col",{}),(0,n.jsx)("col",{className:"num"}),(0,n.jsx)("col",{})]}),(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{colSpan:2,children:k("diff.before")}),(0,n.jsx)("th",{colSpan:2,children:k("diff.after")})]})}),(0,n.jsx)("tbody",{children:Z.map(e=>"gap"===e.type?(0,n.jsx)("tr",{className:"diff-gap",children:(0,n.jsx)("td",{colSpan:4,children:(0,n.jsx)("button",{type:"button",className:"linkish small",onClick:()=>{var t;return t=e.from,void(A&&H(e=>{var s;return new Map(e).set(A.path,new Set([...null!=(s=e.get(A.path))?s:[],t]))}))},children:k("diff.gap",{n:e.count})})})},"g".concat(e.from)):(0,n.jsx)(u,{row:e.row,index:e.index,current:T>=0&&_[T]===e.index},e.index))})]})]})]})]})]})]})}function u(e){var t,s,a,i;let{row:r,index:c,current:o}=e,d="change"===r.kind?function(e,t){let s=0;for(;s<e.length&&s<t.length&&e[s]===t[s];)s+=1;let n=e.length,l=t.length;for(;n>s&&l>s&&e[n-1]===t[l-1];)n-=1,l-=1;return{start:s,leftEnd:n,rightEnd:l}}(r.left.text,r.right.text):null,u=e=>{let t=r[e];if(!t)return null;if(!d)return t.text;let s="left"===e?d.leftEnd:d.rightEnd;return(0,n.jsxs)(l.Fragment,{children:[t.text.slice(0,d.start),(0,n.jsx)("mark",{children:t.text.slice(d.start,s)}),t.text.slice(s)]})};return(0,n.jsxs)("tr",{className:"diff-row ".concat(r.kind).concat(o?" current":""),"data-row":c,children:[(0,n.jsx)("td",{className:"num",children:null!=(a=null==(t=r.left)?void 0:t.no)?a:""}),(0,n.jsx)("td",{className:"code l".concat(r.left?"":" empty"),children:u("left")}),(0,n.jsx)("td",{className:"num",children:null!=(i=null==(s=r.right)?void 0:s.no)?i:""}),(0,n.jsx)("td",{className:"code r".concat(r.right?"":" empty"),children:u("right")})]})}}}]);