github-issue-tower-defence-management 2.132.8 → 2.132.10

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.
package/README.md CHANGED
@@ -78,7 +78,7 @@ Options for serveWeb (and its deprecated alias serveConsole):
78
78
  --dashboardDir <path> Directory containing the static dashboard HTML fragment tdpm.txt served at /tdpm.txt when compose mode is not active (default: the jsonpub directory)
79
79
  --dashboardDataDir <path> Directory containing the dashboard data files (projects/<projectName>.json, machine-status.json, token-status.json); when set and every required file is present the server composes the /tdpm.txt fragment from them, otherwise it falls back to serving the static tdpm.txt from --dashboardDir (unset when not configured)
80
80
  --dashboardProjectNames <names> Comma-separated project names, in display order, for the dashboard project grid; the display label of each project is its first 2 characters, which must be unique across the listed names
81
- --fleetConfigFilePath <path> Path to the fleet-wide YAML config file; falls back to the TDPM_FLEET_CONFIG environment variable. When the file contains a top-level `workflowImprovementIssueUrl` string, the console tab bar displays a link that opens that URL in a new browser tab. When the file contains a `workflowIssueReporter` section with `owner` and `repo` fields, the console tab bar displays a + link for creating fleet-level tasks; the link opens `https://github.com/{owner}/{repo}/issues/new` in a new browser tab and, when `projectUrl` is set to a GitHub org (`https://github.com/orgs/{org}/projects/{n}`) or user (`https://github.com/users/{user}/projects/{n}`) project URL, appends `?projects={owner}/{n}` so the new issue is automatically added to that project.
81
+ --fleetConfigFilePath <path> Path to the fleet-wide YAML config file; falls back to the TDPM_FLEET_CONFIG environment variable. When the file contains a top-level `workflowImprovementIssueUrl` string, the console tab bar displays a link that opens that URL in a new browser tab. When the file contains a `workflowIssueReporter` section with `owner` and `repo` fields, the console tab bar displays a + link for creating fleet-level tasks; the link opens `https://github.com/{owner}/{repo}/issues/new?assignees[]={owner}` in a new browser tab, pre-assigning the owner, and, when `projectUrl` is set to a GitHub org (`https://github.com/orgs/{org}/projects/{n}`) or user (`https://github.com/users/{user}/projects/{n}`) project URL, also appends `?projects={owner}/{n}` so the new issue is automatically added to that project.
82
82
 
83
83
  Options for selectOauthToken:
84
84
  --tokenListJsonPath <path> Path to the JSON array of { name, token, selectionWeight? } records; selectionWeight is an optional positive number (default 1) that biases how often a token is chosen among eligible candidates (falls back to the CLAUDE_CODE_OAUTH_TOKEN_LIST_JSON_PATH environment variable)
@@ -181,7 +181,7 @@ The `notifyFinishedIssuePreparation` and `revertOrphanedPreparation` commands su
181
181
 
182
182
  - `owner` (string, required): GitHub owner (organisation or user) of the repository where the workflow issue is created.
183
183
  - `repo` (string, required): repository name under that owner.
184
- - `projectUrl` (string, optional): URL of a GitHub ProjectV2 to which the newly created issue is added. When the project contains a story option whose name includes "workflow blocker" (case-insensitive), the issue's Story field is set to that option automatically. When this URL matches a GitHub org (`https://github.com/orgs/{org}/projects/{n}`) or user (`https://github.com/users/{user}/projects/{n}`) project URL, the fleet task creation console link also appends `?projects={org}/{n}` or `?projects={user}/{n}` so that any new issue created from that link is automatically added to the project.
184
+ - `projectUrl` (string, optional): URL of a GitHub ProjectV2 to which the newly created issue is added. When the project contains a story option whose name includes "workflow blocker" (case-insensitive), the issue's Story field is set to that option automatically. When this URL matches a GitHub org (`https://github.com/orgs/{org}/projects/{n}`) or user (`https://github.com/users/{user}/projects/{n}`) project URL, the fleet task creation console link also appends `?projects={org}/{n}` or `?projects={user}/{n}` (in addition to `assignees[]={owner}`) so that any new issue created from that link is automatically added to the project.
185
185
 
186
186
  Example:
187
187
 
@@ -230,14 +230,15 @@ const loadFleetTaskCreateUrl = (fleetConfigFilePath) => {
230
230
  return null;
231
231
  }
232
232
  const base = `https://github.com/${settings.owner}/${settings.repo}/issues/new`;
233
- if (settings.projectUrl == null) {
234
- return base;
235
- }
236
- const projectParam = extractGitHubProjectParam(settings.projectUrl);
237
- if (projectParam === null) {
238
- return base;
239
- }
240
- return `${base}?projects=${projectParam}`;
233
+ const queryParts = [];
234
+ if (settings.projectUrl != null) {
235
+ const projectParam = extractGitHubProjectParam(settings.projectUrl);
236
+ if (projectParam !== null) {
237
+ queryParts.push(`projects=${projectParam}`);
238
+ }
239
+ }
240
+ queryParts.push(`assignees[]=${settings.owner}`);
241
+ return `${base}?${queryParts.join('&')}`;
241
242
  };
242
243
  exports.loadFleetTaskCreateUrl = loadFleetTaskCreateUrl;
243
244
  exports.ERROR_REPORTING_REPOSITORY_KEY = 'errorReportingRepository';
@@ -1 +1 @@
1
- {"version":3,"file":"fleetConfig.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/fleetConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,oHAGqE;AACrE,8FAA2F;AAI9E,QAAA,2CAA2C,GAAG,mBAAmB,CAAC;AAElE,QAAA,8CAA8C,GACzD,gCAAgC,CAAC;AACtB,QAAA,8BAA8B,GAAG,mBAAmB,CAAC;AACrD,QAAA,6BAA6B,GAAG,kBAAkB,CAAC;AACnD,QAAA,kCAAkC,GAAG,6BAA6B,CAAC;AACnE,QAAA,mCAAmC,GAAG,uBAAuB,CAAC;AAC9D,QAAA,+BAA+B,GAAG,2BAA2B,CAAC;AAE9D,QAAA,4CAA4C,GAAG,EAAE,CAAC;AAElD,QAAA,8BAA8B,GAAG,EAAE,CAAC;AACpC,QAAA,gCAAgC,GAAG,GAAG,CAAC;AAQvC,QAAA,mCAAmC,GAA8B;IAC5E,qBAAqB,EAAE,iDAAuB;IAC9C,oBAAoB,EAAE,sCAA8B;IACpD,qBAAqB,EAAE,wCAAgC;CACxD,CAAC;AAMW,QAAA,wCAAwC,GACnD;IACE,2BAA2B,EAAE,oDAA4C;CAC1E,CAAC;AAEG,MAAM,0BAA0B,GAAG,CACxC,QAAuB,EACR,EAAE;IACjB,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,eAAe,GACnB,OAAO,CAAC,GAAG,CAAC,mDAA2C,CAAC,CAAC;I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AI,CAAC;IACd,CAAC;IACD,MAAM,GAAG,GAAG,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;IAC1D,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,sCAA8B,CAAC,CAAC;IAClD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,GAAG,sCAA8B,OAAO,mBAAmB,oBAAoB,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AApBW,QAAA,4BAA4B,gCAoBvC"}
@@ -88,6 +88,6 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
88
88
  `).map(e=>`> ${e}`).join(`
89
89
  `),Zu=e=>e.split(`
90
90
  `).find(e=>e.trim()!==``)??``,Qu=e=>`${e.author}:${e.createdAt}:${e.body}`,$u=({comment:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let e=i.current;if(!e)return;let t=e=>e.stopPropagation();return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[]),(0,x.jsx)(`div`,{ref:i,className:`console-comment-body-expanded`,children:(0,x.jsx)(Mu,{body:e.body,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})})},ed=({comments:e,isLoading:t,error:n,now:r,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o,persistenceKey:s=null,issueTitle:c,onCreateWorkflowIssue:l})=>{let[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(null),[m,h]=(0,y.useState)(()=>s==null?new Set:Cn(s)),g=e.length>0?Qu(e[e.length-1]):null;(0,y.useEffect)(()=>{g!==null&&h(e=>new Set([...e,g]))},[g]),(0,y.useEffect)(()=>{s!=null&&wn(s,m)},[s,m]);let _=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(n!==null)return(0,x.jsx)(`p`,{className:`console-comment-notloaded`,children:`Not loaded.`});if(t)return(0,x.jsx)(`p`,{className:`console-comment-loading`,children:`Loading comments...`});if(e.length===0)return(0,x.jsx)(`p`,{className:`console-comment-empty`,children:`No comments.`});let v=!u&&e.length>1;return(0,x.jsxs)(`div`,{className:`console-comment-list`,children:[v&&(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-show-all`,onClick:()=>{d(!0),h(t=>new Set([...t,...e.map(Qu)]))},children:[`Show all `,e.length]}),e.map(e=>{let t=Qu(e),n=m.has(t);return(0,x.jsxs)(`article`,{className:`console-comment${n?` is-expanded`:v?` console-comment--expandable`:``}`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-toggle`,onClick:()=>_(t),"aria-expanded":n,children:[(0,x.jsx)(`span`,{className:`console-comment-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-comment-time`,children:A(e.createdAt,r)}),!n&&(0,x.jsx)(`span`,{className:`console-comment-body-preview`,children:Zu(e.body)})]}),l!==void 0&&(0,x.jsx)(`button`,{type:`button`,className:`console-comment-create-workflow-issue`,onClick:t=>{t.stopPropagation(),p(e)},title:`Create workflow improvement issue from this comment`,children:`+`}),n&&(0,x.jsx)($u,{comment:e,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},t)}),f!==null&&l!==void 0&&(0,x.jsx)(Z,{defaultTitle:c??``,defaultBody:Q(f.body),onSubmit:l,onClose:()=>p(null)})]})},td=e=>e.slice(0,7),nd=e=>e.split(`
91
- `)[0],rd=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,x.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,x.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-commit`,children:[(0,x.jsx)(`span`,{className:`console-commit-message`,children:nd(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:td(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:A(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),id=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(du,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),ad=e=>{let t=new Map;for(let n of e){let e=t.get(n.message);if(e===void 0){t.set(n.message,[n.section]);continue}e.push(n.section)}return Array.from(t,([e,t])=>({message:e,sections:t}))},od=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,sd=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:ad(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,od(e.sections),`:`,` `,e.message]},e.message))}),cd=({title:e,onTitleRename:t})=>{let[n,r]=(0,y.useState)(e),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(e),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=(0,y.useRef)(e);(0,y.useEffect)(()=>{let t=e!==f.current;f.current=e,!i&&t&&r(e)},[e,i]);let p=()=>{s(n),d(null),a(!0)},m=()=>{a(!1),d(null)},h=async()=>{let e=o.trim();if(e===``||e===n){a(!1);return}l(!0),d(null);try{await t(e),r(e),a(!1)}catch(e){d(e instanceof Error?e.message:`Failed to rename`)}finally{l(!1)}};return i?(0,x.jsxs)(`span`,{className:`console-detail-title-text console-detail-title-text--editing`,children:[(0,x.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?h():e.key===`Escape`&&m()},disabled:c,className:`console-detail-title-input`,"aria-label":`Edit title`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>void h(),disabled:c,className:`console-detail-title-save`,children:`Save`}),(0,x.jsx)(`button`,{type:`button`,onClick:m,disabled:c,className:`console-detail-title-cancel`,children:`Cancel`}),u!==null&&(0,x.jsx)(`span`,{className:`console-detail-title-error`,role:`alert`,children:u})]}):(0,x.jsxs)(`span`,{className:`console-detail-title-text`,children:[n,(0,x.jsx)(`button`,{type:`button`,onClick:p,className:`console-detail-title-edit`,"aria-label":`Edit title`,children:`Edit`})]})},ld={MERGEABLE:{color:`GREEN`,label:`No conflict`,title:`This pull request has no merge conflicts`,modifier:`console-detail-mergeable-chip-ok`},CONFLICTING:{color:`RED`,label:`Conflict`,title:`This pull request has merge conflicts`,modifier:`console-detail-mergeable-chip-conflict`},UNKNOWN:{color:`GRAY`,label:`Checking merge status`,title:`GitHub has not finished computing the merge status yet`,modifier:`console-detail-mergeable-chip-unknown`}},ud=({mergeableStatus:e})=>{let t=ld[e],n=F(t.color);return(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-mergeable-chip ${t.modifier}`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},title:t.title,children:t.label})},dd=e=>{let t=F(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},fd=({isPassedAllCiJob:e,isCiStateSuccess:t,isBranchOutOfDate:n,missingRequiredCheckNames:r})=>{let i=e&&t,a=i?`GREEN`:`RED`,o=i?`CI passing`:`CI failing`,s=!i&&r.length>0?`missing: ${r.join(`, `)}`:null;return(0,x.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,x.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:dd(a),title:s??o,children:[o,s!==null&&(0,x.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:dd(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},pd=({pullRequest:e,body:t,bodyIsLoading:n,files:r,filesAreLoading:i,filesError:a,commits:o,commitsAreLoading:s,commitsError:c,now:l,buildImageProxyUrl:u,renderReferenceLink:d,onAddInlineComment:f})=>{let p=e.summary,m=Ei(e.url),h=m===null?void 0:{owner:m.owner,repo:m.repo},g=i||a!==null?null:r.length,_=s||c!==null?null:o.length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`console-pr-header`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,x.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,x.jsx)(ud,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(fd,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,x.jsx)(id,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,x.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,x.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,x.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,x.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,x.jsx)(Nu,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Mu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Nu,{title:`Changed files`,count:g,children:(0,x.jsx)(Xu,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Nu,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(rd,{commits:o,isLoading:s,error:c,now:l})})]})},md=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,statusOptions:i,state:a,body:o,bodyIsLoading:s,bodyError:c,comments:l,commentsAreLoading:u,commentsError:d,files:f,filesAreLoading:p,filesError:m,commits:h,commitsAreLoading:g,commitsError:_,stateError:v,pullRequestStatus:y,pullRequestStatusError:b,relatedPullRequests:S,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:ee,buildImageProxyUrl:E,renderReferenceLink:D,onAddInlineComment:O,onTitleRename:k,onCreateWorkflowIssue:j})=>{let M=a?.state??`open`,ne=a?.merged??!1,N=!e.isPr&&M===`closed`?`Closed`:null,re=Di(e.nameWithOwner)??void 0,ie=F(n),ae=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,P=ae===null?null:F(ae.color),oe=p||m!==null?null:f.length,se=u||d!==null?null:l.length,ce=g||_!==null?null:h.length,le=!u&&d===null&&l.length>0,ue=e=>{let t=Ei(e);return t===null?e:`PR #${t.number}`},I=[{section:`item state`,message:v},{section:`pull request status`,message:e.isPr?b:null},{section:`description`,message:c},{section:`comments`,message:d},{section:`changed files`,message:e.isPr?m:null},{section:`commits`,message:e.isPr?_:null},{section:`related pull requests`,message:e.isPr?null:C},...S.flatMap(e=>[{section:`changed files of ${ue(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${ue(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),de=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-header`,children:[(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,x.jsx)(be,{isPr:e.isPr,state:M,merged:ne,isDraft:!1,stateReason:``}),k==null?(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}):(0,x.jsx)(cd,{title:e.title,onTitleRename:k}),(0,x.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[ae!==null&&P!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:P.fg,borderColor:P.border,backgroundColor:P.bg},children:ae.name}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:ie.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(fd,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&S.map(e=>(0,x.jsxs)(`span`,{className:`console-related-pr-group`,children:[S.length>1&&(0,x.jsx)(`span`,{className:`console-related-pr-label`,children:ue(e.pullRequest.url)}),(0,x.jsx)(fd,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(ud,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),de.map(e=>(0,x.jsx)(ud,{mergeableStatus:e.mergeableStatus},e.url)),N!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:N})]}),(0,x.jsx)(sd,{failures:I}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsxs)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:[`#`,e.number]}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsxs)(`span`,{className:`console-detail-createdat`,title:te(e.createdAt),children:[`opened `,A(e.createdAt,w)]}),(0,x.jsx)(id,{url:e.url}),e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))]})]}),(0,x.jsxs)(`div`,{className:`console-detail-body`,children:[(0,x.jsx)(Nu,{title:`Description`,defaultCollapsed:le,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Mu,{body:o,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:re}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},le?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(Nu,{title:`Changed files`,count:oe,children:(0,x.jsx)(Xu,{files:f,isLoading:p,error:m,onAddInlineComment:O})}),(0,x.jsx)(Nu,{title:`Comments`,count:se,children:(0,x.jsx)(ed,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:re,persistenceKey:e.url,issueTitle:e.title,onCreateWorkflowIssue:j})}),e.isPr&&(0,x.jsx)(Nu,{title:`Commits`,count:ce,defaultCollapsed:!0,children:(0,x.jsx)(rd,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(pd,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:E,renderReferenceLink:D,onAddInlineComment:O},e.pullRequest.url))]}),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:ee})]})]})},hd=({className:e,ariaLabel:t,placeholder:n,currentOption:r,options:i,onSelect:a})=>{let o=(0,y.useRef)({ready:!1,currentOptionId:r?.id??null});return(0,y.useLayoutEffect)(()=>{o.current.ready=!0,o.current.currentOptionId=r?.id??null}),(0,x.jsxs)(`select`,{className:e,defaultValue:r?.id??``,onChange:e=>{if(!o.current.ready||e.target.value===(o.current.currentOptionId??``))return;let t=i.find(t=>t.id===e.target.value);t!==void 0&&a(t)},"aria-label":t,children:[(0,x.jsx)(`option`,{value:``,children:n}),i.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})},gd=({agentOptions:e,currentAgentName:t,onSetAgent:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(hd,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},_d=({onClose:e,onCommentAndClose:t})=>{let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=async()=>{let e=i.trim();if(e&&!o&&t!==void 0){s(!0),l(null);try{await t(e),a(``),r(!1)}catch(e){l(e instanceof Error?e.message:`failed to post`)}finally{s(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`}),t!==void 0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>r(e=>!e),children:`Comment & Close`}),n&&(0,x.jsxs)(`div`,{className:`console-op-comment-and-close`,children:[(0,x.jsx)(`textarea`,{className:`console-op-comment-and-close-input`,placeholder:`Leave a comment…`,value:i,onChange:e=>a(e.target.value)}),c!==null&&(0,x.jsx)(`span`,{role:`alert`,className:`console-op-comment-and-close-error`,children:c}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,disabled:o||i.trim().length===0,onClick:()=>{u()},children:`Submit`})]})]})]})},vd=({onDeleteAllComments:e,onDeleteStory:t,storyNameForDeletion:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=()=>{e(),i(!1)},f=()=>{o(!0),u(null)},p=async e=>{if(t){c(!0),u(null);try{await t(e)}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>i(e=>!e),children:`⚠`}),r&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:d,children:`Delete All Comments`}),t!=null&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:f,disabled:a,children:`Delete Story`})]}),a&&(0,x.jsxs)(`div`,{className:`console-story-delete-confirm`,role:`dialog`,"aria-modal":`true`,"aria-label":`Confirm story deletion`,children:[(0,x.jsxs)(`p`,{className:`console-story-delete-confirm-message`,children:[`Delete story option "`,n,`" from the GitHub custom field?`]}),l!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:l}),(0,x.jsxs)(`div`,{className:`console-story-delete-confirm-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(!0),disabled:s,children:s?`Deleting…`:`Delete with child tasks`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(!1),disabled:s,children:s?`Deleting…`:`Keep child tasks`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},yd=({isManualTriage:e,onSetNextActionDate:t})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1w skip`:`+1w`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1mo`})]}),bd=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve_and_merge`,label:`Approve & Merge`,variant:`approve`}],xd=`Reject needs an inline comment on the diff.`,Sd=({onReview:e,rejectEnabled:t})=>(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,x.jsx)(`p`,{className:`console-op-requirement`,children:xd}),bd.map(n=>{let r=n.action===`request_changes`&&!t;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),Cd=({onSetDependedIssueUrl:e})=>{let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);return(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-rare-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{n(e=>!e),c(null)},title:`Rare actions`,children:`⋯`}),t&&e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`input`,{type:`url`,className:`console-settings-modal-input`,placeholder:`Depended issue URL`,value:r,onChange:e=>i(e.target.value),disabled:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:async()=>{if(e!==null&&r.trim()!==``){o(!0),c(null);try{await e(r.trim()),i(``),n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to set depended issue URL`)}finally{o(!1)}}},disabled:a||r.trim()===``,children:a?`...`:`Set Depended Issue`})]}),s!==null&&(0,x.jsx)(`p`,{className:`console-settings-modal-error`,children:s})]})},wd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Td=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=he.map(t=>({name:t,option:wd(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=F(r.color),a=e===pe;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:i.fg,borderColor:i.border,backgroundColor:i.bg},onClick:()=>a?n(r):t(r),children:r.name},r.id)})})},Ed=({storyOptions:e,currentStoryName:t,onSetStory:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(hd,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Dd=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l,onCommentAndClose:u})=>{let[d,f]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(Sd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(yd,{isManualTriage:ge(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(Td,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),d&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ed,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(gd,{agentOptions:o,currentAgentName:s,onSetAgent:c.onSetAgent})]}),(0,x.jsxs)(`div`,{className:`console-op-group-bottom-row`,children:[(0,x.jsxs)(`div`,{className:`console-op-group-left-pair`,children:[(i.length>0||o.length>0)&&(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>f(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(Cd,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(vd,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(_d,{onClose:c.onClose,onCommentAndClose:u})]})]})},Od=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,y.useState)(i??r),[s,c]=(0,y.useState)(t!==null&&i===void 0),[l,u]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},kd=[],Ad=[],jd=[],Md=[],Nd={state:`open`,merged:!1,isPullRequest:!1,title:``},Pd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Fd=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=Od(e.body,r,i,``),s=Od(e.state,r,i,Nd),c=Od(e.comments,r,i,kd),l=Od(e.files,a?r:null,a?i:null,Ad),u=Od(e.commits,a?r:null,a?i:null,jd),d=Od(e.prStatus,a?r:null,a?i:null,Pd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=Od(e.relatedPrs,f?r:null,f?i:null,Md),[m,h]=(0,y.useState)([]);return(0,y.useEffect)(()=>{if(a||p.data.length===0){h([]);return}let t=!1,n=p.data.map(e=>({pullRequest:e,files:Ad,filesAreLoading:!0,filesError:null,commits:jd,commitsAreLoading:!0,commitsError:null}));h(n);let r=(e,n)=>{t||h(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of p.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,a,p.data]),{state:s.data,body:o.data,bodyIsLoading:o.isLoading,bodyError:o.error,comments:c.data,commentsAreLoading:c.isLoading,commentsError:c.error,files:l.data,filesAreLoading:l.isLoading,filesError:l.error,commits:u.data,commitsAreLoading:u.isLoading,commitsError:u.error,stateError:s.error,pullRequestStatus:a?d.data:null,pullRequestStatusError:a?d.error:null,relatedPullRequests:m,relatedPullRequestsError:a?null:p.error}},Id=e=>JSON.stringify([e.author,e.createdAt,e.body]),Ld=(e,t)=>{let n=new Set(e.map(Id));return[...e,...t.filter(e=>!n.has(Id(e)))]},Rd=({href:e,fallbackText:t,state:n})=>{if(n===null||n.title.trim()===``)return(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t});let r=Ei(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(be,{...Oi(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title}),r!==null&&(0,x.jsxs)(`span`,{className:`console-markdown-reference-number`,children:[`#`,r.number]})]})},zd=(e,t)=>{let[n,r]=(0,y.useState)(()=>e.peek(t)??null);return(0,y.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},Bd=({cache:e,href:t,fallbackText:n})=>{let r=zd(e,t);return(0,x.jsx)(Rd,{href:t,fallbackText:n,state:r})},Vd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Hd=(e,t,n,r,i)=>({...Vd(t),apiPath:kr,requestBody:Mr(e,t,n,r,i)}),Ud=(e,t,n,r)=>({...Vd(t),apiPath:Ar,requestBody:Nr(e,t,n,r)}),Wd=(e,t)=>({...Vd(t),apiPath:jr,requestBody:Pr(e,t)}),Gd=({tab:e,item:t,caches:n,operations:r,pjcode:i,statusOptions:a,storyOptions:o,agentOptions:s,storyColors:c,storyName:l,overlayStatus:u,now:d,initialCommentDraft:f,onCommentDraftChange:p,onQueueAction:m,onDeleteStory:h,storyNameForDeletion:g,onCreateWorkflowIssue:_})=>{let v=Fd(n,t,e),b=(0,y.useCallback)(e=>ji(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(Bd,{cache:n.state,href:e,fallbackText:t}),[n.state]),C=t.isPr||t.relatedOpenPullRequestUrls.length>0||v.relatedPullRequests.length>0,[w,T]=(0,y.useState)([]),ee=(0,y.useCallback)(async(e,t,n,r)=>{T(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[E,D]=(0,y.useState)([]),O=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return D(e=>[...e,n]),n},[t,r]),k={onReview:e=>{let n=t.isPr?t.url:v.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?w:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:Hd(i,t,n,e,a),...e===`approve_and_merge`?{onAdvance:()=>r.patchItemOverlay(t,!0),revertAdvance:()=>r.patchItemOverlay(t,!1)}:{}})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:Ud(i,t,e)})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:Ud(i,t,`set_story`,{storyOptionId:e.id})})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:Ud(i,t,`set_agent`,{agentOptionId:e.id})})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:Ud(i,t,`set_status`,{statusName:e.name})})},onSetInTmuxByHuman:e=>{m({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e),offline:i==null?void 0:Wd(i,t)})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:Ud(i,t,e),onAdvance:()=>r.patchItemOverlay(t,!0),revertAdvance:()=>r.patchItemOverlay(t,!1)})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e),onAdvance:()=>r.patchItemOverlay(t,!0,{name:e.name,color:e.color}),revertAdvance:()=>r.patchItemOverlay(t,!1)})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:h??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},A=(0,y.useCallback)(async e=>{await r.issueRename(t,e)},[t,r]),j=a.find(e=>e.name===`Awaiting Workspace`)??null,te=j===null?void 0:async e=>(p?.(``),k.onSetStatus(j),O(e)),M=async e=>{await O(e),k.onClose(`close`)},ne=l??(t.story.trim()===``?null:t.story),N=ne===null?null:le(c,ne);return(0,x.jsx)(md,{item:t,storyName:ne,storyColorEnum:N,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:Ld(v.comments,E),commentsAreLoading:v.commentsAreLoading,commentsError:v.commentsError,files:v.files,filesAreLoading:v.filesAreLoading,filesError:v.filesError,commits:v.commits,commitsAreLoading:v.commitsAreLoading,commitsError:v.commitsError,pullRequestStatus:v.pullRequestStatus,pullRequestStatusError:v.pullRequestStatusError,relatedPullRequests:v.relatedPullRequests,relatedPullRequestsError:v.relatedPullRequestsError,now:d,buildImageProxyUrl:b,renderReferenceLink:S,onAddInlineComment:ee,onTitleRename:A,onCreateWorkflowIssue:_,commentComposer:(0,x.jsx)(wi,{initiallyOpen:!0,initialDraft:f,onSubmit:O,onDraftChange:p,onOkAndAwaitingWorkspace:j===null?void 0:()=>k.onOkAndAwaitingWorkspace(j),onSubmitAndMoveToAwaitingWorkspace:te,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Dd,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:ne,agentOptions:s,currentAgentName:t.agent,handlers:k,storyNameForDeletion:g,onCommentAndClose:M})})},Kd=()=>{let e={};for(let t of M)e[t.name]=0;return e},qd=`console`,Jd=()=>{let e=Ur(),t=pr(),n=ht(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=er(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=gi(),{pjcodes:v,projectUrls:b,fleetTaskCreateUrl:C,nameWithOwnerByPjcode:w,isLoading:ee}=Wr(),{isTimerExpired:E}=Jr(e),D=Vr(e??qd),O=qr(v),k=(0,y.useMemo)(()=>{let e=Kd();for(let t of M){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=wr(n.items,Er(D.overlay,n.generatedAt),t.name))}return e},[i,D.overlay]);tr(e,v,c&&r===null);let A=br(e,k),{activeTab:j,selectedItemKey:te,openItem:ne,closeItem:N}=A,ie=oi(A.selectTab),P=Gr((0,y.useCallback)(e=>ci(`/projects/${e}`),[])),F=(0,y.useRef)(new Map),oe=(0,y.useCallback)(e=>{te!==null&&(e?F.current.set(te,e):F.current.delete(te))},[te]),ce=ar(r),le=Lr(e,j,D,ce,(0,y.useCallback)(()=>s(`queued`),[s])),I=In(),[fe,L]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{L(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[R,z]=(0,y.useState)(!1),[pe,me]=(0,y.useState)({title:``,body:null,storyName:null,agentOptionId:null}),[he,ge]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>ge(!0),t=()=>ge(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[_e,ve]=(0,y.useState)(new Map),[ye,be]=(0,y.useState)(new Map),[xe,Se]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(he&&I.offlineActions.length!==0)for(let e of I.offlineActions)_e.has(e.id)||xe.has(e.id)||(ve(t=>new Map(t).set(e.id,null)),ce.client.fetchIssueState(e.itemUrl).then(t=>{ve(n=>new Map(n).set(e.id,t)),e.isPr&&(be(t=>new Map(t).set(e.id,null)),ce.client.fetchPullRequestStatus(e.itemUrl).then(t=>{be(n=>new Map(n).set(e.id,t))}).catch(e=>{console.warn(`Failed to fetch PR status for offline action:`,e)}))}).catch(t=>{console.warn(`Failed to fetch current state for offline action:`,t),Se(t=>new Set(t).add(e.id))}))},[he,I.offlineActions,ce.client,_e,xe]);let[Te,Ee]=(0,y.useState)(!1),Oe=(0,y.useCallback)(async e=>{Ee(!0);try{await I.confirmOfflineAction(e)}finally{Ee(!1)}},[I]),ke=(0,y.useMemo)(()=>I.offlineActions.map(e=>{let t=_e.get(e.id)??null,n=ye.get(e.id)??null,r=xe.has(e.id);return{id:e.id,message:e.message,color:e.color,itemNumber:e.itemNumber,isPr:e.isPr,currentTitle:r?null:t?.title??null,currentState:r||t===null?null:t.merged?`closed`:t.state,currentPrStatus:n,fetchError:r}}),[I.offlineActions,_e,ye,xe]),Ae=i[j],je=(0,y.useMemo)(()=>Ae===null?[]:Tr(Ae.items,Er(D.overlay,Ae.generatedAt),j),[Ae,D.overlay,j]),[Me,Ne]=(0,y.useState)(null),Pe=(0,y.useMemo)(()=>{if(j!==`prs`)return{};let e={};for(let t of je)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[je,j]);(0,y.useEffect)(()=>{j===`prs`&&Me!==null&&(Pe[Me]??0)===0&&Ne(null)},[Pe,Me,j]);let Fe=(0,y.useMemo)(()=>j!==`prs`||Me===null?je:je.filter(e=>e.agent===Me),[je,j,Me]),Le=(0,y.useMemo)(()=>Fe.map(e=>Sr(e)),[Fe]),Re=Ae?.storyOrder??[],ze=(0,y.useMemo)(()=>de(Fe,D.overlay,Re,Ae?.generatedAt??null),[Fe,D.overlay,Re,Ae]),Be=Ae?.storyColors??{},We=Ae?.statusOptions??[],Ge=Ae?.agentOptions??[],Ke=Ae?.storyOptions??[],qe=Ae?.generatedAt??null,Je=Ae?.fromCache??!1,[Ye,Xe]=(0,y.useState)(null),B=(0,y.useMemo)(()=>te===null||Ae===null?null:Ae.items.find(e=>e.projectItemId===te)??null,[te,Ae]);dr(ce,B,je),(0,y.useEffect)(()=>{te!==null&&window.scrollTo({top:0})},[te]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=mi(v,null,l);e!==null&&li(`/projects/${e}`)}},[e,c,v,l]),hi(c,k.prs,k[`todo-by-human`],e,v,l,i.prs!==null,i[`todo-by-human`]!==null,i.prs?.fromCache??!1,i[`todo-by-human`]?.fromCache??!1),si(c,e,Fe,te,A.openItem);let Ze=k[j],Qe=(0,y.useRef)({tab:j,count:Ze});(0,y.useEffect)(()=>{let e=Qe.current;if(Qe.current={tab:j,count:Ze},e.tab===j&&e.count>0&&Ze===0){let e=mr(j,k);e!==null&&(ie(e),N())}},[j,Ze,k,ie,N]);let $e=B===null?null:Dr(D.overlay,B,i[j]?.generatedAt??null),et=B===null?null:ue(B,D.overlay,i[j]?.generatedAt??null),tt=(0,y.useCallback)(e=>{let t=_i(Le,e);t===null?N():ne(t)},[Le,ne,N]),nt=(0,y.useCallback)(t=>{if(n.status===`on`){I.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=Sr(t.item);I.enqueue({message:xn(t.kind,t.item,j),color:yn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&bn(t.kind,j)){if(c&&E(l[e??``]??0)){let t=mi(v,e,l);t!==null&&ci(`/projects/${t}`)}else tt(r)}}})},[I,j,tt,n.status,c,E,l,e,v]),rt=ai((0,y.useCallback)(e=>{if(te===null||e===null)return;let t=e===`next`?vi(Le,te):yi(Le,te);t!==null&&ne(t)},[te,Le,ne])),[it,at]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),ot=(0,y.useCallback)(()=>{at(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),st=i.stories,ct=st?.stories??[],lt=Ye!==null&&Ye.generatedAt===st?.generatedAt?Ye.stories:ct,ut=st?.defaultNameWithOwner??null,dt=ut===null?null:`https://github.com/${ut}/issues/new`,ft=(0,y.useMemo)(()=>B===null||!B.labels.includes(`story`)?null:lt.find(e=>e.storyName===B.story)??null,[B,lt]),pt=(0,y.useCallback)(async(e,t)=>{C!==null&&B!==null&&await Jt({nameWithOwner:C.replace(`https://github.com/`,``).replace(/\/issues\/new.*$/,``),title:e,sourceIssueTitle:B.title,quotedCommentBody:t})},[C,B]),mt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(ut===null)throw Error(`No repository configured for this project.`);await Kt({pjcode:e,title:n,storyName:t,nameWithOwner:ut})},[e,ut]),gt=(0,y.useCallback)(({storyName:t,agentOptionId:n,title:r,body:i,files:a})=>{if(e===null||ut===null)return Promise.resolve();let o=e,s=ut;return I.enqueue({message:`Task created — "${r}"`,color:`blue`,commit:async()=>{let e=await Kt({pjcode:o,title:r,storyName:t??``,nameWithOwner:s,agentOptionId:n??null,body:i??null});if(a.length>0){let t=await Promise.all(a.map(async t=>{let n=Rt(new Uint8Array(await t.arrayBuffer()));return zt({pjcode:o,url:e,fileName:t.name,contentBase64:n})})),n=await It({pjcode:o,url:e,body:t.join(`
91
+ `)[0],rd=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,x.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,x.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-commit`,children:[(0,x.jsx)(`span`,{className:`console-commit-message`,children:nd(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:td(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:A(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),id=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(du,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),ad=e=>{let t=new Map;for(let n of e){let e=t.get(n.message);if(e===void 0){t.set(n.message,[n.section]);continue}e.push(n.section)}return Array.from(t,([e,t])=>({message:e,sections:t}))},od=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,sd=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:ad(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,od(e.sections),`:`,` `,e.message]},e.message))}),cd=({title:e,onTitleRename:t})=>{let[n,r]=(0,y.useState)(e),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(e),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=(0,y.useRef)(e);(0,y.useEffect)(()=>{let t=e!==f.current;f.current=e,!i&&t&&r(e)},[e,i]);let p=()=>{s(n),d(null),a(!0)},m=()=>{a(!1),d(null)},h=async()=>{let e=o.trim();if(e===``||e===n){a(!1);return}l(!0),d(null);try{await t(e),r(e),a(!1)}catch(e){d(e instanceof Error?e.message:`Failed to rename`)}finally{l(!1)}};return i?(0,x.jsxs)(`span`,{className:`console-detail-title-text console-detail-title-text--editing`,children:[(0,x.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?h():e.key===`Escape`&&m()},disabled:c,className:`console-detail-title-input`,"aria-label":`Edit title`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>void h(),disabled:c,className:`console-detail-title-save`,children:`Save`}),(0,x.jsx)(`button`,{type:`button`,onClick:m,disabled:c,className:`console-detail-title-cancel`,children:`Cancel`}),u!==null&&(0,x.jsx)(`span`,{className:`console-detail-title-error`,role:`alert`,children:u})]}):(0,x.jsxs)(`span`,{className:`console-detail-title-text`,children:[n,(0,x.jsx)(`button`,{type:`button`,onClick:p,className:`console-detail-title-edit`,"aria-label":`Edit title`,children:`Edit`})]})},ld={MERGEABLE:{color:`GREEN`,label:`No conflict`,title:`This pull request has no merge conflicts`,modifier:`console-detail-mergeable-chip-ok`},CONFLICTING:{color:`RED`,label:`Conflict`,title:`This pull request has merge conflicts`,modifier:`console-detail-mergeable-chip-conflict`},UNKNOWN:{color:`GRAY`,label:`Checking merge status`,title:`GitHub has not finished computing the merge status yet`,modifier:`console-detail-mergeable-chip-unknown`}},ud=({mergeableStatus:e})=>{let t=ld[e],n=F(t.color);return(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-mergeable-chip ${t.modifier}`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},title:t.title,children:t.label})},dd=e=>{let t=F(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},fd=({isPassedAllCiJob:e,isCiStateSuccess:t,isBranchOutOfDate:n,missingRequiredCheckNames:r})=>{let i=e&&t,a=i?`GREEN`:`RED`,o=i?`CI passing`:`CI failing`,s=!i&&r.length>0?`missing: ${r.join(`, `)}`:null;return(0,x.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,x.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:dd(a),title:s??o,children:[o,s!==null&&(0,x.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:dd(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},pd=({pullRequest:e,body:t,bodyIsLoading:n,files:r,filesAreLoading:i,filesError:a,commits:o,commitsAreLoading:s,commitsError:c,now:l,buildImageProxyUrl:u,renderReferenceLink:d,onAddInlineComment:f})=>{let p=e.summary,m=Ei(e.url),h=m===null?void 0:{owner:m.owner,repo:m.repo},g=i||a!==null?null:r.length,_=s||c!==null?null:o.length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`console-pr-header`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,x.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,x.jsx)(ud,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(fd,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,x.jsx)(id,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,x.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,x.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,x.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,x.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,x.jsx)(Nu,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Mu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Nu,{title:`Changed files`,count:g,children:(0,x.jsx)(Xu,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Nu,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(rd,{commits:o,isLoading:s,error:c,now:l})})]})},md=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,statusOptions:i,state:a,body:o,bodyIsLoading:s,bodyError:c,comments:l,commentsAreLoading:u,commentsError:d,files:f,filesAreLoading:p,filesError:m,commits:h,commitsAreLoading:g,commitsError:_,stateError:v,pullRequestStatus:y,pullRequestStatusError:b,relatedPullRequests:S,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:ee,buildImageProxyUrl:E,renderReferenceLink:D,onAddInlineComment:O,onTitleRename:k,onCreateWorkflowIssue:j})=>{let M=a?.state??`open`,ne=a?.merged??!1,N=!e.isPr&&M===`closed`?`Closed`:null,re=Di(e.nameWithOwner)??void 0,ie=F(n),ae=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,P=ae===null?null:F(ae.color),oe=p||m!==null?null:f.length,se=u||d!==null?null:l.length,ce=g||_!==null?null:h.length,le=!u&&d===null&&l.length>0,ue=e=>{let t=Ei(e);return t===null?e:`PR #${t.number}`},I=[{section:`item state`,message:v},{section:`pull request status`,message:e.isPr?b:null},{section:`description`,message:c},{section:`comments`,message:d},{section:`changed files`,message:e.isPr?m:null},{section:`commits`,message:e.isPr?_:null},{section:`related pull requests`,message:e.isPr?null:C},...S.flatMap(e=>[{section:`changed files of ${ue(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${ue(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),de=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-header`,children:[(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,x.jsx)(be,{isPr:e.isPr,state:M,merged:ne,isDraft:!1,stateReason:``}),k==null?(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}):(0,x.jsx)(cd,{title:e.title,onTitleRename:k}),(0,x.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[ae!==null&&P!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:P.fg,borderColor:P.border,backgroundColor:P.bg},children:ae.name}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:ie.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(fd,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&S.map(e=>(0,x.jsxs)(`span`,{className:`console-related-pr-group`,children:[S.length>1&&(0,x.jsx)(`span`,{className:`console-related-pr-label`,children:ue(e.pullRequest.url)}),(0,x.jsx)(fd,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(ud,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),de.map(e=>(0,x.jsx)(ud,{mergeableStatus:e.mergeableStatus},e.url)),N!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:N})]}),(0,x.jsx)(sd,{failures:I}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsxs)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:[`#`,e.number]}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsxs)(`span`,{className:`console-detail-createdat`,title:te(e.createdAt),children:[`opened `,A(e.createdAt,w)]}),(0,x.jsx)(id,{url:e.url}),e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))]})]}),(0,x.jsxs)(`div`,{className:`console-detail-body`,children:[(0,x.jsx)(Nu,{title:`Description`,defaultCollapsed:le,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Mu,{body:o,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:re}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},le?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(Nu,{title:`Changed files`,count:oe,children:(0,x.jsx)(Xu,{files:f,isLoading:p,error:m,onAddInlineComment:O})}),(0,x.jsx)(Nu,{title:`Comments`,count:se,children:(0,x.jsx)(ed,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:re,persistenceKey:e.url,issueTitle:e.title,onCreateWorkflowIssue:j})}),e.isPr&&(0,x.jsx)(Nu,{title:`Commits`,count:ce,defaultCollapsed:!0,children:(0,x.jsx)(rd,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(pd,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:E,renderReferenceLink:D,onAddInlineComment:O},e.pullRequest.url))]}),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:ee})]})]})},hd=({className:e,ariaLabel:t,placeholder:n,currentOption:r,options:i,onSelect:a})=>{let o=(0,y.useRef)({ready:!1,currentOptionId:r?.id??null});return(0,y.useLayoutEffect)(()=>{o.current.ready=!0,o.current.currentOptionId=r?.id??null}),(0,x.jsxs)(`select`,{className:e,defaultValue:r?.id??``,onChange:e=>{if(!o.current.ready||e.target.value===(o.current.currentOptionId??``))return;let t=i.find(t=>t.id===e.target.value);t!==void 0&&a(t)},"aria-label":t,children:[(0,x.jsx)(`option`,{value:``,children:n}),i.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})},gd=({agentOptions:e,currentAgentName:t,onSetAgent:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(hd,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},_d=({onClose:e,onCommentAndClose:t})=>{let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=async()=>{let e=i.trim();if(e&&!o&&t!==void 0){s(!0),l(null);try{await t(e),a(``),r(!1)}catch(e){l(e instanceof Error?e.message:`failed to post`)}finally{s(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`}),t!==void 0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>r(e=>!e),children:`Comment & Close`}),n&&(0,x.jsxs)(`div`,{className:`console-op-comment-and-close`,children:[(0,x.jsx)(`textarea`,{className:`console-op-comment-and-close-input`,placeholder:`Leave a comment…`,value:i,onChange:e=>a(e.target.value)}),c!==null&&(0,x.jsx)(`span`,{role:`alert`,className:`console-op-comment-and-close-error`,children:c}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,disabled:o||i.trim().length===0,onClick:()=>{u()},children:`Submit`})]})]})]})},vd=({onDeleteAllComments:e,onDeleteStory:t,storyNameForDeletion:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=()=>{e(),i(!1)},f=()=>{o(!0),u(null)},p=async e=>{if(t){c(!0),u(null);try{await t(e)}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>i(e=>!e),children:`⚠`}),r&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:d,children:`Delete All Comments`}),t!=null&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:f,disabled:a,children:`Delete Story`})]}),a&&(0,x.jsxs)(`div`,{className:`console-story-delete-confirm`,role:`dialog`,"aria-modal":`true`,"aria-label":`Confirm story deletion`,children:[(0,x.jsxs)(`p`,{className:`console-story-delete-confirm-message`,children:[`Delete story option "`,n,`" from the GitHub custom field?`]}),l!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:l}),(0,x.jsxs)(`div`,{className:`console-story-delete-confirm-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(!0),disabled:s,children:s?`Deleting…`:`Delete with child tasks`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(!1),disabled:s,children:s?`Deleting…`:`Keep child tasks`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},yd=({isManualTriage:e,onSetNextActionDate:t})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1w skip`:`+1w`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1mo`})]}),bd=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve_and_merge`,label:`Approve & Merge`,variant:`approve`}],xd=`Reject needs an inline comment on the diff.`,Sd=({onReview:e,rejectEnabled:t})=>(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,x.jsx)(`p`,{className:`console-op-requirement`,children:xd}),bd.map(n=>{let r=n.action===`request_changes`&&!t;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),Cd=({onSetDependedIssueUrl:e})=>{let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);return(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-rare-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{n(e=>!e),c(null)},title:`Rare actions`,children:`⋯`}),t&&e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`input`,{type:`url`,className:`console-settings-modal-input`,placeholder:`Depended issue URL`,value:r,onChange:e=>i(e.target.value),disabled:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:async()=>{if(e!==null&&r.trim()!==``){o(!0),c(null);try{await e(r.trim()),i(``),n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to set depended issue URL`)}finally{o(!1)}}},disabled:a||r.trim()===``,children:a?`...`:`Set Depended Issue`})]}),s!==null&&(0,x.jsx)(`p`,{className:`console-settings-modal-error`,children:s})]})},wd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Td=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=he.map(t=>({name:t,option:wd(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=F(r.color),a=e===pe;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:i.fg,borderColor:i.border,backgroundColor:i.bg},onClick:()=>a?n(r):t(r),children:r.name},r.id)})})},Ed=({storyOptions:e,currentStoryName:t,onSetStory:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(hd,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Dd=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l,onCommentAndClose:u})=>{let[d,f]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(Sd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(yd,{isManualTriage:ge(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(Td,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),d&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ed,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(gd,{agentOptions:o,currentAgentName:s,onSetAgent:c.onSetAgent})]}),(0,x.jsxs)(`div`,{className:`console-op-group-bottom-row`,children:[(0,x.jsxs)(`div`,{className:`console-op-group-left-pair`,children:[(i.length>0||o.length>0)&&(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>f(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(Cd,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(vd,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(_d,{onClose:c.onClose,onCommentAndClose:u})]})]})},Od=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,y.useState)(i??r),[s,c]=(0,y.useState)(t!==null&&i===void 0),[l,u]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},kd=[],Ad=[],jd=[],Md=[],Nd={state:`open`,merged:!1,isPullRequest:!1,title:``},Pd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Fd=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=Od(e.body,r,i,``),s=Od(e.state,r,i,Nd),c=Od(e.comments,r,i,kd),l=Od(e.files,a?r:null,a?i:null,Ad),u=Od(e.commits,a?r:null,a?i:null,jd),d=Od(e.prStatus,a?r:null,a?i:null,Pd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=Od(e.relatedPrs,f?r:null,f?i:null,Md),[m,h]=(0,y.useState)([]);return(0,y.useEffect)(()=>{if(a||p.data.length===0){h([]);return}let t=!1,n=p.data.map(e=>({pullRequest:e,files:Ad,filesAreLoading:!0,filesError:null,commits:jd,commitsAreLoading:!0,commitsError:null}));h(n);let r=(e,n)=>{t||h(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of p.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,a,p.data]),{state:s.data,body:o.data,bodyIsLoading:o.isLoading,bodyError:o.error,comments:c.data,commentsAreLoading:c.isLoading,commentsError:c.error,files:l.data,filesAreLoading:l.isLoading,filesError:l.error,commits:u.data,commitsAreLoading:u.isLoading,commitsError:u.error,stateError:s.error,pullRequestStatus:a?d.data:null,pullRequestStatusError:a?d.error:null,relatedPullRequests:m,relatedPullRequestsError:a?null:p.error}},Id=e=>JSON.stringify([e.author,e.createdAt,e.body]),Ld=(e,t)=>{let n=new Set(e.map(Id));return[...e,...t.filter(e=>!n.has(Id(e)))]},Rd=({href:e,fallbackText:t,state:n})=>{if(n===null||n.title.trim()===``)return(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t});let r=Ei(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(be,{...Oi(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title}),r!==null&&(0,x.jsxs)(`span`,{className:`console-markdown-reference-number`,children:[`#`,r.number]})]})},zd=(e,t)=>{let[n,r]=(0,y.useState)(()=>e.peek(t)??null);return(0,y.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},Bd=({cache:e,href:t,fallbackText:n})=>{let r=zd(e,t);return(0,x.jsx)(Rd,{href:t,fallbackText:n,state:r})},Vd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Hd=(e,t,n,r,i)=>({...Vd(t),apiPath:kr,requestBody:Mr(e,t,n,r,i)}),Ud=(e,t,n,r)=>({...Vd(t),apiPath:Ar,requestBody:Nr(e,t,n,r)}),Wd=(e,t)=>({...Vd(t),apiPath:jr,requestBody:Pr(e,t)}),Gd=({tab:e,item:t,caches:n,operations:r,pjcode:i,statusOptions:a,storyOptions:o,agentOptions:s,storyColors:c,storyName:l,overlayStatus:u,now:d,initialCommentDraft:f,onCommentDraftChange:p,onQueueAction:m,onDeleteStory:h,storyNameForDeletion:g,onCreateWorkflowIssue:_})=>{let v=Fd(n,t,e),b=(0,y.useCallback)(e=>ji(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(Bd,{cache:n.state,href:e,fallbackText:t}),[n.state]),C=t.isPr||t.relatedOpenPullRequestUrls.length>0||v.relatedPullRequests.length>0,[w,T]=(0,y.useState)([]),ee=(0,y.useCallback)(async(e,t,n,r)=>{T(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[E,D]=(0,y.useState)([]),O=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return D(e=>[...e,n]),n},[t,r]),k={onReview:e=>{let n=t.isPr?t.url:v.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?w:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:Hd(i,t,n,e,a),...e===`approve_and_merge`?{onAdvance:()=>r.patchItemOverlay(t,!0),revertAdvance:()=>r.patchItemOverlay(t,!1)}:{}})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:Ud(i,t,e)})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:Ud(i,t,`set_story`,{storyOptionId:e.id})})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:Ud(i,t,`set_agent`,{agentOptionId:e.id})})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:Ud(i,t,`set_status`,{statusName:e.name})})},onSetInTmuxByHuman:e=>{m({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e),offline:i==null?void 0:Wd(i,t)})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:Ud(i,t,e),onAdvance:()=>r.patchItemOverlay(t,!0),revertAdvance:()=>r.patchItemOverlay(t,!1)})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e),onAdvance:()=>r.patchItemOverlay(t,!0,{name:e.name,color:e.color}),revertAdvance:()=>r.patchItemOverlay(t,!1)})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:h??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},A=(0,y.useCallback)(async e=>{await r.issueRename(t,e)},[t,r]),j=a.find(e=>e.name===`Awaiting Workspace`)??null,te=j===null?void 0:async e=>(p?.(``),k.onSetStatus(j),O(e)),M=async e=>{await O(e),k.onClose(`close`)},ne=l??(t.story.trim()===``?null:t.story),N=ne===null?null:le(c,ne);return(0,x.jsx)(md,{item:t,storyName:ne,storyColorEnum:N,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:Ld(v.comments,E),commentsAreLoading:v.commentsAreLoading,commentsError:v.commentsError,files:v.files,filesAreLoading:v.filesAreLoading,filesError:v.filesError,commits:v.commits,commitsAreLoading:v.commitsAreLoading,commitsError:v.commitsError,pullRequestStatus:v.pullRequestStatus,pullRequestStatusError:v.pullRequestStatusError,relatedPullRequests:v.relatedPullRequests,relatedPullRequestsError:v.relatedPullRequestsError,now:d,buildImageProxyUrl:b,renderReferenceLink:S,onAddInlineComment:ee,onTitleRename:A,onCreateWorkflowIssue:_,commentComposer:(0,x.jsx)(wi,{initiallyOpen:!0,initialDraft:f,onSubmit:O,onDraftChange:p,onOkAndAwaitingWorkspace:j===null?void 0:()=>k.onOkAndAwaitingWorkspace(j),onSubmitAndMoveToAwaitingWorkspace:te,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Dd,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:ne,agentOptions:s,currentAgentName:t.agent,handlers:k,storyNameForDeletion:g,onCommentAndClose:M})})},Kd=()=>{let e={};for(let t of M)e[t.name]=0;return e},qd=`console`,Jd=()=>{let e=Ur(),t=pr(),n=ht(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=er(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=gi(),{pjcodes:v,projectUrls:b,fleetTaskCreateUrl:C,nameWithOwnerByPjcode:w,isLoading:ee}=Wr(),{isTimerExpired:E}=Jr(e),D=Vr(e??qd),O=qr(v),k=(0,y.useMemo)(()=>{let e=Kd();for(let t of M){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=wr(n.items,Er(D.overlay,n.generatedAt),t.name))}return e},[i,D.overlay]);tr(e,v,c&&r===null);let A=br(e,k),{activeTab:j,selectedItemKey:te,openItem:ne,closeItem:N}=A,ie=oi(A.selectTab),P=Gr((0,y.useCallback)(e=>ci(`/projects/${e}`),[])),F=(0,y.useRef)(new Map),oe=(0,y.useCallback)(e=>{te!==null&&(e?F.current.set(te,e):F.current.delete(te))},[te]),ce=ar(r),le=Lr(e,j,D,ce,(0,y.useCallback)(()=>s(`queued`),[s])),I=In(),[fe,L]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{L(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[R,z]=(0,y.useState)(!1),[pe,me]=(0,y.useState)({title:``,body:null,storyName:null,agentOptionId:null}),[he,ge]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>ge(!0),t=()=>ge(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[_e,ve]=(0,y.useState)(new Map),[ye,be]=(0,y.useState)(new Map),[xe,Se]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(he&&I.offlineActions.length!==0)for(let e of I.offlineActions)_e.has(e.id)||xe.has(e.id)||(ve(t=>new Map(t).set(e.id,null)),ce.client.fetchIssueState(e.itemUrl).then(t=>{ve(n=>new Map(n).set(e.id,t)),e.isPr&&(be(t=>new Map(t).set(e.id,null)),ce.client.fetchPullRequestStatus(e.itemUrl).then(t=>{be(n=>new Map(n).set(e.id,t))}).catch(e=>{console.warn(`Failed to fetch PR status for offline action:`,e)}))}).catch(t=>{console.warn(`Failed to fetch current state for offline action:`,t),Se(t=>new Set(t).add(e.id))}))},[he,I.offlineActions,ce.client,_e,xe]);let[Te,Ee]=(0,y.useState)(!1),Oe=(0,y.useCallback)(async e=>{Ee(!0);try{await I.confirmOfflineAction(e)}finally{Ee(!1)}},[I]),ke=(0,y.useMemo)(()=>I.offlineActions.map(e=>{let t=_e.get(e.id)??null,n=ye.get(e.id)??null,r=xe.has(e.id);return{id:e.id,message:e.message,color:e.color,itemNumber:e.itemNumber,isPr:e.isPr,currentTitle:r?null:t?.title??null,currentState:r||t===null?null:t.merged?`closed`:t.state,currentPrStatus:n,fetchError:r}}),[I.offlineActions,_e,ye,xe]),Ae=i[j],je=(0,y.useMemo)(()=>Ae===null?[]:Tr(Ae.items,Er(D.overlay,Ae.generatedAt),j),[Ae,D.overlay,j]),[Me,Ne]=(0,y.useState)(null),Pe=(0,y.useMemo)(()=>{if(j!==`prs`)return{};let e={};for(let t of je)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[je,j]);(0,y.useEffect)(()=>{j===`prs`&&Me!==null&&(Pe[Me]??0)===0&&Ne(null)},[Pe,Me,j]);let Fe=(0,y.useMemo)(()=>j!==`prs`||Me===null?je:je.filter(e=>e.agent===Me),[je,j,Me]),Le=(0,y.useMemo)(()=>Fe.map(e=>Sr(e)),[Fe]),Re=Ae?.storyOrder??[],ze=(0,y.useMemo)(()=>de(Fe,D.overlay,Re,Ae?.generatedAt??null),[Fe,D.overlay,Re,Ae]),Be=Ae?.storyColors??{},We=Ae?.statusOptions??[],Ge=Ae?.agentOptions??[],Ke=Ae?.storyOptions??[],qe=Ae?.generatedAt??null,Je=Ae?.fromCache??!1,[Ye,Xe]=(0,y.useState)(null),B=(0,y.useMemo)(()=>te===null||Ae===null?null:Ae.items.find(e=>e.projectItemId===te)??null,[te,Ae]);dr(ce,B,je),(0,y.useEffect)(()=>{te!==null&&window.scrollTo({top:0})},[te]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=mi(v,null,l);e!==null&&li(`/projects/${e}`)}},[e,c,v,l]),hi(c,k.prs,k[`todo-by-human`],e,v,l,i.prs!==null,i[`todo-by-human`]!==null,i.prs?.fromCache??!1,i[`todo-by-human`]?.fromCache??!1),si(c,e,Fe,te,A.openItem);let Ze=k[j],Qe=(0,y.useRef)({tab:j,count:Ze});(0,y.useEffect)(()=>{let e=Qe.current;if(Qe.current={tab:j,count:Ze},e.tab===j&&e.count>0&&Ze===0){let e=mr(j,k);e!==null&&(ie(e),N())}},[j,Ze,k,ie,N]);let $e=B===null?null:Dr(D.overlay,B,i[j]?.generatedAt??null),et=B===null?null:ue(B,D.overlay,i[j]?.generatedAt??null),tt=(0,y.useCallback)(e=>{let t=_i(Le,e);t===null?N():ne(t)},[Le,ne,N]),nt=(0,y.useCallback)(t=>{if(n.status===`on`){I.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=Sr(t.item);I.enqueue({message:xn(t.kind,t.item,j),color:yn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&bn(t.kind,j)){if(c&&E(l[e??``]??0)){let t=mi(v,e,l);t!==null&&ci(`/projects/${t}`)}else tt(r)}}})},[I,j,tt,n.status,c,E,l,e,v]),rt=ai((0,y.useCallback)(e=>{if(te===null||e===null)return;let t=e===`next`?vi(Le,te):yi(Le,te);t!==null&&ne(t)},[te,Le,ne])),[it,at]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),ot=(0,y.useCallback)(()=>{at(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),st=i.stories,ct=st?.stories??[],lt=Ye!==null&&Ye.generatedAt===st?.generatedAt?Ye.stories:ct,ut=st?.defaultNameWithOwner??null,dt=ut===null?null:`https://github.com/${ut}/issues/new`,ft=(0,y.useMemo)(()=>B===null||!B.labels.includes(`story`)?null:lt.find(e=>e.storyName===B.story)??null,[B,lt]),pt=(0,y.useCallback)((e,t)=>{if(C===null||B===null)return Promise.resolve();let n=C.replace(`https://github.com/`,``).replace(/\/issues\/new.*$/,``),r=B.title;return I.enqueue({message:`Task created — "${e}"`,color:`blue`,commit:async()=>{await Jt({nameWithOwner:n,title:e,sourceIssueTitle:r,quotedCommentBody:t})},advance:()=>{}}),Promise.resolve()},[C,B,I]),mt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(ut===null)throw Error(`No repository configured for this project.`);await Kt({pjcode:e,title:n,storyName:t,nameWithOwner:ut})},[e,ut]),gt=(0,y.useCallback)(({storyName:t,agentOptionId:n,title:r,body:i,files:a})=>{if(e===null||ut===null)return Promise.resolve();let o=e,s=ut;return I.enqueue({message:`Task created — "${r}"`,color:`blue`,commit:async()=>{let e=await Kt({pjcode:o,title:r,storyName:t??``,nameWithOwner:s,agentOptionId:n??null,body:i??null});if(a.length>0){let t=await Promise.all(a.map(async t=>{let n=Rt(new Uint8Array(await t.arrayBuffer()));return zt({pjcode:o,url:e,fileName:t.name,contentBase64:n})})),n=await It({pjcode:o,url:e,body:t.join(`
92
92
 
93
93
  `)});if(!n.posted)throw Error(n.error)}},advance:()=>{}}),me({title:``,body:null,storyName:null,agentOptionId:null}),Promise.resolve()},[e,ut,I]),_t=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await Xt({pjcode:e,storyOptionId:t,direction:n});let r=lt.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<lt.length){let t=[...lt],n=t[r];t[r]=t[e],t[e]=n,Xe({generatedAt:st?.generatedAt,stories:t})}}},[e,lt,st?.generatedAt]),vt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Vt({pjcode:e,storyName:t})},[e]),[yt,bt]=(0,y.useState)({}),[xt,St]=(0,y.useState)(null),[Ct,wt]=(0,y.useState)({}),Tt=(0,y.useCallback)((t,n)=>{let r=lt.find(e=>e.storyOptionId===t)?.color;if(St(t),bt(e=>({...e,[t]:n})),wt(e=>{let n={...e};return delete n[t],n}),e===null||ut===null){bt(e=>r===void 0?e:{...e,[t]:r}),wt(e=>({...e,[t]:`No project or repository configured.`})),St(e=>e===t?null:e);return}Gt({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:ut}).catch(e=>{bt(e=>r===void 0?e:{...e,[t]:r}),wt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{St(e=>e===t?null:e)})},[e,ut,lt]),Et=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await en({pjcode:e,storyOptionId:t,deleteChildTasks:n}),Xe({generatedAt:st?.generatedAt,stories:lt.filter(e=>e.storyOptionId!==t)})},[e,lt,st?.generatedAt]),Dt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await nn({pjcode:e,storyOptionId:t,newName:n});let r=lt.map(e=>e.storyOptionId===t?{...e,storyName:n}:e);Xe({generatedAt:st?.generatedAt,stories:r})},[e,lt,st?.generatedAt]),Ot=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await an({pjcode:e,storyOptionId:t,description:n});let r=lt.map(e=>e.storyOptionId===t?{...e,description:n}:e);Xe({generatedAt:st?.generatedAt,stories:r})},[e,lt,st?.generatedAt]),kt=ti(je,ce.comments,j===`prs`),At=(0,y.useCallback)((e,t)=>{nt({kind:{type:`ok_and_awaiting_workspace`},item:e,commit:()=>le.okAndMoveToAwaitingWorkspace(e,t),skipAdvance:!0,onAdvance:()=>{D.patchOverlay(Sr(e),{done:!0,status:{name:t.name,color:t.color}},j)},revertAdvance:()=>{D.patchOverlay(Sr(e),{done:!1},j)}})},[nt,le,D,j]);return(0,x.jsxs)(`main`,{className:`console-app`,children:[I.pending!==null&&(0,x.jsx)(He,{message:I.pending.message,color:I.pending.color,remainingSeconds:I.pending.remainingSeconds,progress:I.pending.progress,onUndo:I.undo}),I.error!==null&&(0,x.jsx)(Ue,{title:I.error.message,message:`Operation failed: ${I.error.reason}`,onDismiss:I.dismissError,onRetry:I.error.retry===void 0?void 0:()=>{I.dismissError(),I.error?.retry?.()}}),(0,x.jsx)(Ve,{actions:ke,isOnline:he,isConfirming:Te,onConfirm:Oe,onDiscard:I.discardOfflineAction}),O.isOpen&&(0,x.jsx)(S,{pjcodes:v,inputValues:O.inputValues,onChangeInput:O.changeInput,isLoading:O.isLoading,isSaving:O.isSaving,error:O.error,nameWithOwnerByPjcode:w,onSave:O.save,onClose:O.close}),(0,x.jsx)(re,{activeTab:j,counts:k,pjcode:e,pjcodes:v,generatedAt:qe,fromCache:Je,tabHref:A.tabHref,onSelectTab:ie,onSelectProject:P,settingsButton:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ae,{isOpen:u,isTimerActive:c,timerMode:d,projectMinutes:f,pjcodes:v,isLoadingPjcodes:ee,onOpen:p,onToggleTimerMode:g,onChangeMinutes:_,onSave:h,onClose:m}),(0,x.jsx)(`button`,{type:`button`,className:`console-tab-settings-button`,"aria-label":`Open max settings`,onClick:O.open,children:`⚙`}),e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-task-create-button`,disabled:ut===null||lt.length===0,onClick:()=>z(!0),"aria-label":`Create new task`,title:`Create new task`,children:(0,x.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,x.jsx)(`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),(0,x.jsx)(`path`,{d:`M18.375 2.625a2.121 2.121 0 0 1 3 3L7 18l-4 1 1-4Z`})]})}),R&&(0,x.jsx)(se,{storyEntries:lt,agentOptions:Ge,onSubmit:gt,onClose:()=>z(!1),initialDraft:pe,onDraftChange:me,fleetTaskCreateUrl:C,newIssueUrl:dt})]})]}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff,onAirplaneModeRetryFailed:n.retryFailed,projectUrl:e===null?null:b?.[e]??null,fleetTaskCreateUrl:C,now:fe}),(0,x.jsx)(T,{timerEndsAt:Ae?.timerEndsAt??null,timerTotalSeconds:Ae?.timerTotalSeconds??null,now:fe}),j===`stories`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ie,{stories:lt,isLoading:a,error:o,showGray:it,onCreateIssue:mt,onAddStory:vt,onSelectColor:Tt,onToggleGray:ot,onReorderStory:_t,onDeleteStory:Et,onRenameStory:Dt,onUpdateDescription:Ot,optimisticColors:yt,colorChangeInFlight:xt,colorErrors:Ct})}):B===null?j===`queued`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(De,{rows:ze,storyColors:Be,statusOptions:We,agentOptions:Ge,activeItemId:null,isLoading:a,error:o,onSelectItem:e=>A.openItem(e.projectItemId)})}):j===`prs`?(0,x.jsxs)(`div`,{className:`console-list-screen`,children:[(0,x.jsx)(we,{agentOptions:Ge,agentCounts:Pe,selectedAgent:Me,onAgentChange:Ne}),(0,x.jsx)(Ce,{rows:ze,storyColors:Be,statusOptions:We,activeItemId:null,now:fe,isLoading:a,error:o,onSelectItem:e=>A.openItem(e.projectItemId),executiveSummaries:kt,onOkAndAwaitingWorkspace:At})]}):(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ce,{rows:ze,storyColors:Be,statusOptions:We,activeItemId:null,now:fe,isLoading:a,error:o,onSelectItem:e=>A.openItem(e.projectItemId)})}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:rt,children:(0,x.jsx)(Gd,{tab:j,item:B,caches:ce,operations:le,pjcode:e,statusOptions:We,storyOptions:Ke,agentOptions:Ge,storyColors:Be,storyName:et,overlayStatus:$e,now:fe,initialCommentDraft:F.current.get(B.projectItemId)??``,onCommentDraftChange:oe,onQueueAction:nt,onDeleteStory:ft===null?null:async e=>{await Et(ft.storyOptionId,e),N()},storyNameForDeletion:ft?.storyName??null,onCreateWorkflowIssue:C===null?void 0:pt},B.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var Yd=document.getElementById(`root`);if(Yd===null)throw Error(`Root container #root not found`);(0,b.createRoot)(Yd).render((0,x.jsx)(y.StrictMode,{children:(0,x.jsx)(Jd,{})}));
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
7
7
  <title>TDPM Console</title>
8
- <script type="module" crossorigin src="/assets/index-BTr_zbv-.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DGUCEmiK.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-gu35mkfL.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-issue-tower-defence-management",
3
- "version": "2.132.8",
3
+ "version": "2.132.10",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- {"version":3,"file":"fleetConfig.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/fleetConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,sCAAsC,EAC5C,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8DAA8D,CAAC;AAC7G,YAAY,EAAE,6BAA6B,EAAE,CAAC;AAE9C,eAAO,MAAM,2CAA2C,sBAAsB,CAAC;AAE/E,eAAO,MAAM,8CAA8C,mCACzB,CAAC;AACnC,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAClE,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAChE,eAAO,MAAM,kCAAkC,gCAAgC,CAAC;AAChF,eAAO,MAAM,mCAAmC,0BAA0B,CAAC;AAC3E,eAAO,MAAM,+BAA+B,8BAA8B,CAAC;AAE3E,eAAO,MAAM,4CAA4C,KAAK,CAAC;AAE/D,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAEpD,MAAM,MAAM,yBAAyB,GAAG;IACtC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,yBAIjD,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,2BAA2B,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,wCAAwC,EAAE,6BAGpD,CAAC;AAEJ,eAAO,MAAM,0BAA0B,GACrC,UAAU,MAAM,GAAG,IAAI,KACtB,MAAM,GAAG,IAUX,CAAC;AAoEF,eAAO,MAAM,0CAA0C,GACrD,qBAAqB,MAAM,GAAG,IAAI,KACjC,sCAiDF,CAAC;AAEF,eAAO,MAAM,6BA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