github-issue-tower-defence-management 2.135.3 → 2.135.4

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.
@@ -88,6 +88,6 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
88
88
  `).find(e=>e.trim()!==``)??``,Zu=e=>`${e.author}:${e.createdAt}:${e.body}`,Qu=({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)(Nu,{body:e.body,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})})},$u=({comments:e,isLoading:t,error:n,now:r,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o,persistenceKey:s=null,onRequestWorkflowIssueCreate:c})=>{let[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(()=>s==null?new Set:jn(s)),p=e.length>0?Zu(e[e.length-1]):null;(0,y.useEffect)(()=>{p!==null&&f(e=>new Set([...e,p]))},[p]),(0,y.useEffect)(()=>{s!=null&&Mn(s,d)},[s,d]);let m=e=>{f(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 h=!l&&e.length>1;return(0,x.jsxs)(`div`,{className:`console-comment-list`,children:[h&&(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-show-all`,onClick:()=>{u(!0),f(t=>new Set([...t,...e.map(Zu)]))},children:[`Show all `,e.length]}),e.map(e=>{let t=Zu(e),n=d.has(t);return(0,x.jsxs)(`article`,{className:`console-comment${n?` is-expanded`:h?` console-comment--expandable`:``}`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-toggle`,onClick:()=>m(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:k(e.createdAt,r)}),!n&&(0,x.jsx)(`span`,{className:`console-comment-body-preview`,children:Q(e.body)})]}),c!==void 0&&(0,x.jsx)(`button`,{type:`button`,className:`console-comment-create-workflow-issue`,onClick:t=>{t.stopPropagation(),c(e)},title:`Create workflow improvement issue from this comment`,children:`+`}),n&&(0,x.jsx)(Qu,{comment:e,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},t)})]})},ed=e=>e.slice(0,7),td=e=>e.split(`
89
89
  `)[0],nd=({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:td(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:ed(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:k(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),rd=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(fu,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),id=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}))},ad=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,od=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:id(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,ad(e.sections),`:`,` `,e.message]},e.message))}),sd=({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`})]})},cd={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`}},ld=({mergeableStatus:e})=>{let t=cd[e],n=P(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})},ud=e=>{let t=P(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},dd=({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:ud(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:ud(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},fd=({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=ki(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)(ld,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(dd,{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)(rd,{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)(Pu,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Nu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Pu,{title:`Changed files`,count:g,children:(0,x.jsx)(Z,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Pu,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(nd,{commits:o,isLoading:s,error:c,now:l})})]})},pd=({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:te,onRequestWorkflowIssueCreate:A})=>{let j=a?.state??`open`,re=a?.merged??!1,M=!e.isPr&&j===`closed`?`Closed`:null,ie=Ai(e.nameWithOwner)??void 0,ae=P(n),oe=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,N=oe===null?null:P(oe.color),se=p||m!==null?null:f.length,ce=u||d!==null?null:l.length,le=g||_!==null?null:h.length,ue=!u&&d===null&&l.length>0,de=e=>{let t=ki(e);return t===null?e:`PR #${t.number}`},fe=[{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 ${de(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${de(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),pe=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)(Oe,{isPr:e.isPr,state:j,merged:re,isDraft:!1,stateReason:``}),te==null?(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}):(0,x.jsx)(sd,{title:e.title,onTitleRename:te}),(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:[oe!==null&&N!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:N.fg,borderColor:N.border,backgroundColor:N.bg},children:oe.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:ae.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(dd,{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:de(e.pullRequest.url)}),(0,x.jsx)(dd,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(ld,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),pe.map(e=>(0,x.jsx)(ld,{mergeableStatus:e.mergeableStatus},e.url)),M!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:M})]}),(0,x.jsx)(od,{failures:fe}),(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:ne(e.createdAt),children:[`opened `,k(e.createdAt,w)]}),(0,x.jsx)(rd,{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)(Pu,{title:`Description`,defaultCollapsed:ue,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)(Nu,{body:o,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:ie}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},ue?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(Pu,{title:`Changed files`,count:se,children:(0,x.jsx)(Z,{files:f,isLoading:p,error:m,onAddInlineComment:O})}),(0,x.jsx)(Pu,{title:`Comments`,count:ce,children:(0,x.jsx)($u,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:ie,persistenceKey:e.url,onRequestWorkflowIssueCreate:A})}),e.isPr&&(0,x.jsx)(Pu,{title:`Commits`,count:le,defaultCollapsed:!0,children:(0,x.jsx)(nd,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(fd,{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})]})]})},md=({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))]})},hd=({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)(md,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},gd=({onClose:e,onCommentAndClose:t,isDraftEmpty:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null),s=async()=>{if(!(t===void 0||r)){i(!0),o(null);try{await t()}catch(e){o(e instanceof Error?e.message:`failed to post`)}finally{i(!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`,disabled:r||n===!0,onClick:()=>{s()},children:`Comment & Close`}),a!==null&&(0,x.jsx)(`span`,{role:`alert`,className:`console-op-comment-close-error`,children:a})]})]})},_d=({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`})]})]})]})},vd=({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`})]}),yd=[{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`}],bd=`Reject needs an inline comment on the diff.`,xd=({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:bd}),yd.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)})]}),Sd=({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})]})},Cd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},wd=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=Ce.map(t=>({name:t,option:Cd(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=P(r.color),a=e===xe;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)})})},Td=({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)(md,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Ed=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l,onCommentAndClose:u,isDraftEmpty:d})=>{let[f,p]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(xd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(vd,{isManualTriage:we(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(wd,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),f&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Td,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(hd,{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:()=>p(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(Sd,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(_d,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(gd,{onClose:c.onClose,onCommentAndClose:u,isDraftEmpty:d})]})]})},Dd=(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}},Od=[],kd=[],Ad=[],jd=[],Md={state:`open`,merged:!1,isPullRequest:!1,title:``},Nd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Pd=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=Dd(e.body,r,i,``),s=Dd(e.state,r,i,Md),c=Dd(e.comments,r,i,Od),l=Dd(e.files,a?r:null,a?i:null,kd),u=Dd(e.commits,a?r:null,a?i:null,Ad),d=Dd(e.prStatus,a?r:null,a?i:null,Nd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=Dd(e.relatedPrs,f?r:null,f?i:null,jd),[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:kd,filesAreLoading:!0,filesError:null,commits:Ad,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}},Fd=e=>JSON.stringify([e.author,e.createdAt,e.body]),Id=(e,t)=>{let n=new Set(e.map(Fd));return[...e,...t.filter(e=>!n.has(Fd(e)))]},Ld=({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=ki(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(Oe,{...ji(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]})]})},Rd=(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},zd=({cache:e,href:t,fallbackText:n})=>{let r=Rd(e,t);return(0,x.jsx)(Ld,{href:t,fallbackText:n,state:r})},Bd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Vd=(e,t,n,r,i)=>({...Bd(t),apiPath:kr,requestBody:Mr(e,t,n,r,i)}),Hd=(e,t,n,r)=>({...Bd(t),apiPath:Ar,requestBody:Nr(e,t,n,r)}),Ud=(e,t)=>({...Bd(t),apiPath:jr,requestBody:Pr(e,t)}),Wd=({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=Pd(n,t,e),b=(0,y.useCallback)(e=>Pi(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(zd,{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]),[te,k]=(0,y.useState)(null),A=(0,y.useCallback)(e=>{k(e)},[]),ne=e=>{let n=e.body.split(`
90
90
  `).map(e=>`> ${e}`).join(`
91
- `);return`${t.url}\n\n${t.title}\n\n\n\n\n\n${n}`},j=(0,y.useCallback)(async e=>{_!==void 0&&await _(e.title,e.body??``)},[_]),re={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:Vd(i,t,n,e,a),overlayPatch:{done:!0}})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:Hd(i,t,e),overlayPatch:{done:!0}})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:Hd(i,t,`set_story`,{storyOptionId:e.id}),overlayPatch:{done:!0,story:{name:e.name,color:e.color}}})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:Hd(i,t,`set_agent`,{agentOptionId:e.id}),overlayPatch:{done:!0}})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:Hd(i,t,`set_status`,{statusName:e.name}),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},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:Ud(i,t),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:Hd(i,t,e),overlayPatch:{done:!0}})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},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)}},M=(0,y.useCallback)(async e=>{await r.issueRename(t,e)},[t,r]),ie=a.find(e=>e.name===`Awaiting Workspace`)??null,ae=ie===null?void 0:async e=>(p?.(``),re.onSetStatus(ie),O(e)),oe=(0,y.useRef)(``),[N,se]=(0,y.useState)((f??``).trim().length===0),ce=(0,y.useCallback)(e=>{oe.current=e,se(e.trim().length===0),p?.(e)},[p]),le=async e=>{await O(e),re.onClose(`close`)},ue=async()=>{let e=oe.current.trim();e.length!==0&&await le(e)},de=l??(t.story.trim()===``?null:t.story),fe=de===null?null:I(c,de);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(pd,{item:t,storyName:de,storyColorEnum:fe,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:Id(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:M,onRequestWorkflowIssueCreate:_===void 0?void 0:A,commentComposer:(0,x.jsx)(Di,{initiallyOpen:!0,initialDraft:f,onSubmit:O,onDraftChange:ce,onOkAndAwaitingWorkspace:ie===null?void 0:()=>re.onOkAndAwaitingWorkspace(ie),onSubmitAndMoveToAwaitingWorkspace:ae,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Ed,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:de,agentOptions:s,currentAgentName:t.agent,handlers:re,storyNameForDeletion:g,onCommentAndClose:ue,isDraftEmpty:N})}),te!==null&&_!==void 0&&(0,x.jsx)(me,{storyEntries:[],agentOptions:[],initialDraft:{title:``,body:ne(te),storyName:null,agentOptionId:null},onSubmit:j,onClose:()=>k(null)})]})},Gd=()=>{let e={};for(let t of j)e[t.name]=0;return e},Kd=`console`,qd=e=>e.replace(`https://github.com/`,``).replace(/\/issues\/new.*$/,``),Jd=()=>{let e=Zr(),t=xr(),n=Ct(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=cr(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=yi(),{pjcodes:v,projectUrls:b,fleetTaskCreateUrl:C,nameWithOwnerByPjcode:w,isLoading:ee}=Qr(),{isTimerExpired:E}=ni(e),D=Yr(e??Kd),O=ti(v),te=(0,y.useMemo)(()=>{let e=Gd();for(let t of j){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=Vr(n.items,D.overlay,t.name))}return e},[i,D.overlay]);lr(e,v,c&&r===null);let k=Or(e,te,(0,y.useMemo)(()=>{let e=new Set;for(let t of j)i[t.name]!==null&&e.add(t.name);return e},[i]),(0,y.useMemo)(()=>{let e=Gd();for(let t of j){let n=i[t.name];n!==null&&(e[t.name]=t.name===`stories`?n.stories.filter(e=>e.color!==`GRAY`).length:n.items.length)}return e},[i])),{activeTab:A,selectedItemKey:ne,openItem:re,closeItem:M}=k,ae=mi(k.selectTab),oe=$r((0,y.useCallback)(e=>gi(`/projects/${e}`),[])),N=(0,y.useRef)(new Map),se=(0,y.useCallback)(e=>{ne!==null&&(e?N.current.set(ne,e):N.current.delete(ne))},[ne]),le=pr(r),fe=Lr(e,le,(0,y.useCallback)(()=>s(`queued`),[s])),P=Wn(),[pe,F]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{F(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[I,he]=(0,y.useState)(!1),[_e,ve]=(0,y.useState)(!1),[ye,be]=(0,y.useState)({title:``,body:null,storyName:null,agentOptionId:null}),[xe,Se]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>Se(!0),t=()=>Se(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[Ce,we]=(0,y.useState)(new Map),[Te,Ee]=(0,y.useState)(new Map),[De,Oe]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(xe&&P.offlineActions.length!==0)for(let e of P.offlineActions)Ce.has(e.id)||De.has(e.id)||(we(t=>new Map(t).set(e.id,null)),le.client.fetchIssueState(e.itemUrl).then(t=>{we(n=>new Map(n).set(e.id,t)),e.isPr&&(Ee(t=>new Map(t).set(e.id,null)),le.client.fetchPullRequestStatus(e.itemUrl).then(t=>{Ee(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),Oe(t=>new Set(t).add(e.id))}))},[xe,P.offlineActions,le.client,Ce,De]);let[ke,Ae]=(0,y.useState)(!1),Ne=(0,y.useCallback)(async e=>{Ae(!0);try{await P.confirmOfflineAction(e)}finally{Ae(!1)}},[P]),Pe=(0,y.useMemo)(()=>P.offlineActions.map(e=>{let t=Ce.get(e.id)??null,n=Te.get(e.id)??null,r=De.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}}),[P.offlineActions,Ce,Te,De]),Ie=i[A],Le=(0,y.useMemo)(()=>Ie===null?[]:Hr(Ie.items,D.overlay,A),[Ie,D.overlay,A]),[Re,ze]=(0,y.useState)(null),Be=(0,y.useMemo)(()=>{if(A!==`prs`)return{};let e={};for(let t of Le)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[Le,A]);(0,y.useEffect)(()=>{A===`prs`&&Re!==null&&(Be[Re]??0)===0&&ze(null)},[Be,Re,A]);let Ve=(0,y.useMemo)(()=>A!==`prs`||Re===null?Le:Le.filter(e=>e.agent===Re),[Le,A,Re]),He=(0,y.useMemo)(()=>Ve.map(e=>zr(e)),[Ve]),Ue=Ie?.storyOrder??[],Ge=(0,y.useMemo)(()=>ge(Ve,D.overlay,Ue,Ie?.generatedAt??null),[Ve,D.overlay,Ue,Ie]),Ke=Ie?.storyColors??{},qe=Ie?.statusOptions??[],Je=Ie?.agentOptions??[],Qe=Ie?.storyOptions??[],$e=Ie?.generatedAt??null,et=Ie?.fromCache??!1,[tt,nt]=(0,y.useState)(null),rt=(0,y.useMemo)(()=>ne===null||Ie===null?null:Ie.items.find(e=>e.projectItemId===ne)??null,[ne,Ie]);yr(le,rt,Le),(0,y.useEffect)(()=>{ne!==null&&window.scrollTo({top:0})},[ne]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=ce(v,null,l);e!==null&&_i(`/projects/${e}/todo-by-human`)}},[e,c,v,l]),vi(c,te.prs,te[`todo-by-human`],e,v,l,i.prs!==null,i[`todo-by-human`]!==null,i.prs?.fromCache??!1,i[`todo-by-human`]?.fromCache??!1),hi(c,e,Ve,ne,k.openItem);let it=te[A],at=(0,y.useRef)({tab:A,count:it});(0,y.useEffect)(()=>{let e=at.current;if(at.current={tab:A,count:it},e.tab===A&&e.count>0&&it===0){let e=Sr(A,te);e!==null&&(ae(e),M())}},[A,it,te,ae,M]);let ot=rt===null?null:Ur(D.overlay,rt,i[A]?.generatedAt??null),st=rt===null?null:L(rt,D.overlay,i[A]?.generatedAt??null),R=(0,y.useCallback)(e=>{let t=bi(He,e);t===null?M():re(t)},[He,re,M]),ct=(0,y.useCallback)(t=>{if(n.status===`on`){P.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=zr(t.item),i=t.overlayPatch;P.enqueue({message:kn(t.kind,t.item,A),color:Dn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,optimistic:i===void 0?void 0:()=>D.patchOverlay(r,i,A),revertOptimistic:i===void 0?void 0:()=>D.revertOverlayEntry(r),advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&On(t.kind,A)){if(c&&E(l[e??``]??15)){let t=ce(v,e,l);t!==null&&gi(`/projects/${t}/todo-by-human`)}else R(r)}}})},[P,A,R,n.status,D,c,E,l,e,v]),lt=pi((0,y.useCallback)(e=>{if(ne===null||e===null)return;let t=e===`next`?xi(He,ne):Si(He,ne);t!==null&&re(t)},[ne,He,re])),[ut,dt]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),ft=(0,y.useCallback)(()=>{dt(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),pt=i.stories,mt=pt?.stories??[],ht=tt!==null&&tt.generatedAt===pt?.generatedAt?tt.stories:mt,gt=pt?.defaultNameWithOwner??null,_t=gt===null?null:`https://github.com/${gt}/issues/new`,vt=(0,y.useMemo)(()=>rt===null||!rt.labels.includes(`story`)?null:ht.find(e=>e.storyName===rt.story)??null,[rt,ht]),yt=(0,y.useCallback)((e,t)=>{if(C===null||rt===null)return Promise.resolve();let n=qd(C);return P.enqueue({message:`Task created — "${e}"`,color:`blue`,commit:async()=>{await nn({nameWithOwner:n,title:e,body:t})},advance:()=>{}}),Promise.resolve()},[C,rt,P]),bt=(0,y.useCallback)(async e=>{C!==null&&await nn({nameWithOwner:qd(C),title:e,body:``})},[C]),xt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(gt===null)throw Error(`No repository configured for this project.`);await en({pjcode:e,title:n,storyName:t,nameWithOwner:gt})},[e,gt]),St=(0,y.useCallback)(({storyName:t,agentOptionId:n,title:r,body:i,files:a})=>{if(e===null||gt===null)return Promise.resolve();let o=e,s=gt;return P.enqueue({message:`Task created — "${r}"`,color:`blue`,commit:async()=>{let e=await en({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=z(new Uint8Array(await t.arrayBuffer()));return Kt({pjcode:o,url:e,fileName:t.name,contentBase64:n})})),n=await Wt({pjcode:o,url:e,body:t.join(`
91
+ `);return`${t.url}\n\n${t.title}\n\n\n\n\n\n${n}`},j=(0,y.useCallback)(async e=>{_!==void 0&&await _(e.title,e.body??``)},[_]),re={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:Vd(i,t,n,e,a),overlayPatch:{done:!0}})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:Hd(i,t,e),overlayPatch:{done:!0}})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:Hd(i,t,`set_story`,{storyOptionId:e.id}),overlayPatch:{done:!0,story:{name:e.name,color:e.color}}})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:Hd(i,t,`set_agent`,{agentOptionId:e.id}),overlayPatch:{done:!0}})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:Hd(i,t,`set_status`,{statusName:e.name}),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},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:Ud(i,t),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:Hd(i,t,e),overlayPatch:{done:!0}})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},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)}},M=(0,y.useCallback)(async e=>{await r.issueRename(t,e)},[t,r]),ie=a.find(e=>e.name===`Awaiting Workspace`)??null,ae=ie===null?void 0:async e=>(p?.(``),re.onSetStatus(ie),O(e)),oe=(0,y.useRef)(``),[N,se]=(0,y.useState)((f??``).trim().length===0),ce=(0,y.useCallback)(e=>{oe.current=e,se(e.trim().length===0),p?.(e)},[p]),le=async e=>{await O(e),re.onClose(`close`)},ue=async()=>{let e=oe.current.trim();e.length!==0&&await le(e)},de=l??(t.story.trim()===``?null:t.story),fe=de===null?null:I(c,de);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(pd,{item:t,storyName:de,storyColorEnum:fe,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:Id(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:M,onRequestWorkflowIssueCreate:_===void 0?void 0:A,commentComposer:(0,x.jsx)(Di,{initiallyOpen:!0,initialDraft:f,onSubmit:O,onDraftChange:ce,onOkAndAwaitingWorkspace:ie===null?void 0:()=>re.onOkAndAwaitingWorkspace(ie),onSubmitAndMoveToAwaitingWorkspace:ae,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Ed,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:de,agentOptions:s,currentAgentName:t.agent,handlers:re,storyNameForDeletion:g,onCommentAndClose:ue,isDraftEmpty:N})}),te!==null&&_!==void 0&&(0,x.jsx)(me,{storyEntries:[],agentOptions:[],initialDraft:{title:``,body:ne(te),storyName:null,agentOptionId:null},onSubmit:j,onClose:()=>k(null)})]})},Gd=()=>{let e={};for(let t of j)e[t.name]=0;return e},Kd=`console`,qd=e=>e.replace(`https://github.com/`,``).replace(/\/issues\/new.*$/,``),Jd=()=>{let e=Zr(),t=xr(),n=Ct(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=cr(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=yi(),{pjcodes:v,projectUrls:b,fleetTaskCreateUrl:C,nameWithOwnerByPjcode:w,isLoading:ee}=Qr(),{isTimerExpired:E}=ni(e),D=Yr(e??Kd),O=ti(v),te=(0,y.useMemo)(()=>{let e=Gd();for(let t of j){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=Vr(n.items,D.overlay,t.name))}return e},[i,D.overlay]);lr(e,v,c&&r===null);let k=Or(e,te,(0,y.useMemo)(()=>{let e=new Set;for(let t of j)i[t.name]!==null&&e.add(t.name);return e},[i]),(0,y.useMemo)(()=>{let e=Gd();for(let t of j){let n=i[t.name];n!==null&&(e[t.name]=t.name===`stories`?n.stories.filter(e=>e.color!==`GRAY`).length:n.items.length)}return e},[i])),{activeTab:A,selectedItemKey:ne,openItem:re,closeItem:M}=k,ae=mi(k.selectTab),oe=$r((0,y.useCallback)(e=>gi(`/projects/${e}`),[])),N=(0,y.useRef)(new Map),se=(0,y.useCallback)(e=>{ne!==null&&(e?N.current.set(ne,e):N.current.delete(ne))},[ne]),le=pr(r),fe=Lr(e,le,(0,y.useCallback)(()=>s(`queued`),[s])),P=Wn(),[pe,F]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{F(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[I,he]=(0,y.useState)(!1),[_e,ve]=(0,y.useState)(!1),[ye,be]=(0,y.useState)({title:``,body:null,storyName:null,agentOptionId:null}),[xe,Se]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>Se(!0),t=()=>Se(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[Ce,we]=(0,y.useState)(new Map),[Te,Ee]=(0,y.useState)(new Map),[De,Oe]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(xe&&P.offlineActions.length!==0)for(let e of P.offlineActions)Ce.has(e.id)||De.has(e.id)||(we(t=>new Map(t).set(e.id,null)),le.client.fetchIssueState(e.itemUrl).then(t=>{we(n=>new Map(n).set(e.id,t)),e.isPr&&(Ee(t=>new Map(t).set(e.id,null)),le.client.fetchPullRequestStatus(e.itemUrl).then(t=>{Ee(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),Oe(t=>new Set(t).add(e.id))}))},[xe,P.offlineActions,le.client,Ce,De]);let[ke,Ae]=(0,y.useState)(!1),Ne=(0,y.useCallback)(async e=>{Ae(!0);try{await P.confirmOfflineAction(e)}finally{Ae(!1)}},[P]),Pe=(0,y.useMemo)(()=>P.offlineActions.map(e=>{let t=Ce.get(e.id)??null,n=Te.get(e.id)??null,r=De.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}}),[P.offlineActions,Ce,Te,De]),Ie=i[A],Le=(0,y.useMemo)(()=>Ie===null?[]:Hr(Ie.items,D.overlay,A),[Ie,D.overlay,A]),[Re,ze]=(0,y.useState)(null),Be=(0,y.useMemo)(()=>{if(A!==`prs`)return{};let e={};for(let t of Le)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[Le,A]);(0,y.useEffect)(()=>{A===`prs`&&Re!==null&&(Be[Re]??0)===0&&ze(null)},[Be,Re,A]);let Ve=(0,y.useMemo)(()=>A!==`prs`||Re===null?Le:Le.filter(e=>e.agent===Re),[Le,A,Re]),He=(0,y.useMemo)(()=>Ve.map(e=>zr(e)),[Ve]),Ue=Ie?.storyOrder??[],Ge=(0,y.useMemo)(()=>ge(Ve,D.overlay,Ue,Ie?.generatedAt??null),[Ve,D.overlay,Ue,Ie]),Ke=Ie?.storyColors??{},qe=Ie?.statusOptions??[],Je=Ie?.agentOptions??[],Qe=Ie?.storyOptions??[],$e=Ie?.generatedAt??null,et=Ie?.fromCache??!1,[tt,nt]=(0,y.useState)(null),rt=(0,y.useMemo)(()=>ne===null||Ie===null?null:Ie.items.find(e=>e.projectItemId===ne)??null,[ne,Ie]);yr(le,rt,Le),(0,y.useEffect)(()=>{ne!==null&&window.scrollTo({top:0})},[ne]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=ce(v,null,l);e!==null&&_i(`/projects/${e}/todo-by-human`)}},[e,c,v,l]),vi(c,te.prs,te[`todo-by-human`],e,v,l,i.prs!==null,i[`todo-by-human`]!==null,i.prs?.fromCache??!1,i[`todo-by-human`]?.fromCache??!1),hi(c,e,Ve,ne,k.openItem);let it=te[A],at=(0,y.useRef)({tab:A,count:it});(0,y.useEffect)(()=>{let e=at.current;if(at.current={tab:A,count:it},e.tab===A&&e.count>0&&it===0){let e=Sr(A,te);e!==null&&(ae(e),M())}},[A,it,te,ae,M]);let ot=rt===null?null:Ur(D.overlay,rt,i[A]?.generatedAt??null),st=rt===null?null:L(rt,D.overlay,i[A]?.generatedAt??null),R=(0,y.useCallback)(e=>{let t=bi(He,e);t===null?M():re(t)},[He,re,M]),ct=(0,y.useCallback)(t=>{if(n.status===`on`){P.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=zr(t.item),i=t.overlayPatch;P.enqueue({message:kn(t.kind,t.item,A),color:Dn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,optimistic:i===void 0?void 0:()=>D.patchOverlay(r,i,A),revertOptimistic:i===void 0?void 0:()=>D.revertOverlayEntry(r),advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&On(t.kind,A)){if(c&&E(l[e??``]??15)){let t=ce(v,e,l);t!==null&&gi(`/projects/${t}/todo-by-human`)}else R(r)}}})},[P,A,R,n.status,D,c,E,l,e,v]),lt=pi((0,y.useCallback)(e=>{if(ne===null||e===null)return;let t=e===`next`?xi(He,ne):Si(He,ne);t!==null&&re(t)},[ne,He,re])),[ut,dt]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),ft=(0,y.useCallback)(()=>{dt(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),pt=i.stories,mt=pt?.stories??[],ht=tt!==null&&tt.generatedAt===pt?.generatedAt?tt.stories:mt,gt=pt?.defaultNameWithOwner??null,_t=gt===null?null:`https://github.com/${gt}/issues/new`,vt=(0,y.useMemo)(()=>rt===null||!rt.labels.includes(`story`)?null:ht.find(e=>e.storyName===rt.story)??null,[rt,ht]),yt=(0,y.useCallback)((e,t)=>{if(C===null||rt===null)return Promise.resolve();let n=qd(C);return P.enqueue({message:`Task created — "${e}"`,color:`blue`,commit:async()=>{await nn({nameWithOwner:n,title:e,body:t})},advance:()=>{}}),Promise.resolve()},[C,rt,P]),bt=(0,y.useCallback)(e=>{if(C===null)return Promise.resolve();let t=qd(C);return P.enqueue({message:`Task created — "${e}"`,color:`blue`,commit:async()=>{await nn({nameWithOwner:t,title:e,body:``})},advance:()=>{}}),Promise.resolve()},[C,P]),xt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(gt===null)throw Error(`No repository configured for this project.`);await en({pjcode:e,title:n,storyName:t,nameWithOwner:gt})},[e,gt]),St=(0,y.useCallback)(({storyName:t,agentOptionId:n,title:r,body:i,files:a})=>{if(e===null||gt===null)return Promise.resolve();let o=e,s=gt;return P.enqueue({message:`Task created — "${r}"`,color:`blue`,commit:async()=>{let e=await en({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=z(new Uint8Array(await t.arrayBuffer()));return Kt({pjcode:o,url:e,fileName:t.name,contentBase64:n})})),n=await Wt({pjcode:o,url:e,body:t.join(`
92
92
 
93
93
  `)});if(!n.posted)throw Error(n.error)}},advance:()=>{}}),be({title:``,body:null,storyName:null,agentOptionId:null}),Promise.resolve()},[e,gt,P]),wt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await an({pjcode:e,storyOptionId:t,direction:n});let r=ht.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<ht.length){let t=[...ht],n=t[r];t[r]=t[e],t[e]=n,nt({generatedAt:pt?.generatedAt,stories:t})}}},[e,ht,pt?.generatedAt]),Tt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Jt({pjcode:e,storyName:t})},[e]),[Et,Dt]=(0,y.useState)({}),[Ot,kt]=(0,y.useState)(null),[At,jt]=(0,y.useState)({}),Mt=(0,y.useCallback)((t,n)=>{let r=ht.find(e=>e.storyOptionId===t)?.color;if(kt(t),Dt(e=>({...e,[t]:n})),jt(e=>{let n={...e};return delete n[t],n}),e===null||gt===null){Dt(e=>r===void 0?e:{...e,[t]:r}),jt(e=>({...e,[t]:`No project or repository configured.`})),kt(e=>e===t?null:e);return}$t({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:gt}).catch(e=>{Dt(e=>r===void 0?e:{...e,[t]:r}),jt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{kt(e=>e===t?null:e)})},[e,gt,ht]),Nt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await ln({pjcode:e,storyOptionId:t,deleteChildTasks:n}),nt({generatedAt:pt?.generatedAt,stories:ht.filter(e=>e.storyOptionId!==t)})},[e,ht,pt?.generatedAt]),Pt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await dn({pjcode:e,storyOptionId:t,newName:n});let r=ht.map(e=>e.storyOptionId===t?{...e,storyName:n}:e);nt({generatedAt:pt?.generatedAt,stories:r})},[e,ht,pt?.generatedAt]),Ft=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await pn({pjcode:e,storyOptionId:t,description:n});let r=ht.map(e=>e.storyOptionId===t?{...e,description:n}:e);nt({generatedAt:pt?.generatedAt,stories:r})},[e,ht,pt?.generatedAt]),It=li(Le,le.comments,A===`prs`),Lt=(0,y.useCallback)((e,t)=>{ct({kind:{type:`ok_and_awaiting_workspace`},item:e,commit:()=>fe.okAndMoveToAwaitingWorkspace(e,t),skipAdvance:!0,overlayPatch:{done:!0,status:{name:t.name,color:t.color}}})},[ct,fe]);return(0,x.jsxs)(`main`,{className:`console-app`,children:[P.pending!==null&&(0,x.jsx)(Xe,{message:P.pending.message,color:P.pending.color,remainingSeconds:P.pending.remainingSeconds,progress:P.pending.progress,onUndo:P.undo}),P.error!==null&&(0,x.jsx)(Ze,{title:P.error.message,message:`Operation failed: ${P.error.reason}`,onDismiss:P.dismissError,onRetry:P.error.retry===void 0?void 0:()=>{P.dismissError(),P.error?.retry?.()}}),(0,x.jsx)(Ye,{actions:Pe,isOnline:xe,isConfirming:ke,onConfirm:Ne,onDiscard:P.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)(ie,{activeTab:A,counts:te,pjcode:e,pjcodes:v,generatedAt:$e,fromCache:et,tabHref:k.tabHref,onSelectTab:ae,onSelectProject:oe,settingsButton:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ue,{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:gt===null||ht.length===0,onClick:()=>he(!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`})]})}),I&&(0,x.jsx)(me,{storyEntries:ht,agentOptions:Je,onSubmit:St,onClose:()=>he(!1),initialDraft:ye,onDraftChange:be,fleetTaskCreateUrl:C,newIssueUrl:_t})]})]}),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,onFleetTaskCreate:C===null?null:()=>ve(!0),now:pe}),_e&&(0,x.jsx)(de,{onSubmit:bt,onClose:()=>ve(!1)}),(0,x.jsx)(T,{timerEndsAt:Ie?.timerEndsAt??null,timerTotalSeconds:Ie?.timerTotalSeconds??null,now:pe}),A===`stories`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(We,{stories:ht,isLoading:a,error:o,showGray:ut,onCreateIssue:xt,onAddStory:Tt,onSelectColor:Mt,onToggleGray:ft,onReorderStory:wt,onDeleteStory:Nt,onRenameStory:Pt,onUpdateDescription:Ft,optimisticColors:Et,colorChangeInFlight:Ot,colorErrors:At})}):rt===null?A===`queued`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Fe,{rows:Ge,storyColors:Ke,statusOptions:qe,agentOptions:Je,activeItemId:null,isLoading:a,error:o,onSelectItem:e=>k.openItem(e.projectItemId)})}):A===`prs`?(0,x.jsxs)(`div`,{className:`console-list-screen`,children:[(0,x.jsx)(Me,{agentOptions:Je,agentCounts:Be,selectedAgent:Re,onAgentChange:ze}),(0,x.jsx)(je,{rows:Ge,storyColors:Ke,statusOptions:qe,activeItemId:null,now:pe,isLoading:a,error:o,onSelectItem:e=>k.openItem(e.projectItemId),executiveSummaries:It,onOkAndAwaitingWorkspace:Lt})]}):(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(je,{rows:Ge,storyColors:Ke,statusOptions:qe,activeItemId:null,now:pe,isLoading:a,error:o,onSelectItem:e=>k.openItem(e.projectItemId)})}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:lt,children:(0,x.jsx)(Wd,{tab:A,item:rt,caches:le,operations:fe,pjcode:e,statusOptions:qe,storyOptions:Qe,agentOptions:Je,storyColors:Ke,storyName:st,overlayStatus:ot,now:pe,initialCommentDraft:N.current.get(rt.projectItemId)??``,onCommentDraftChange:se,onQueueAction:ct,onDeleteStory:vt===null?null:async e=>{await Nt(vt.storyOptionId,e),M()},storyNameForDeletion:vt?.storyName??null,onCreateWorkflowIssue:C===null?void 0:yt},rt.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-DqAMaTBo.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-CHACqRzA.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-DPKo0NnF.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.135.3",
3
+ "version": "2.135.4",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {