github-issue-tower-defence-management 2.88.0 → 2.88.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ Error generating stack: `+e.message+`
10
10
 
11
11
  `),le=`In Tmux by human`,ue=`Awaiting Workspace`,de=[`In Tmux by human`,`Todo by human`,ue],L=e=>e===`todo-by-human`||e===`todo-by-agent`,fe=({statusOptions:e,onOkAndAwaitingWorkspace:t})=>{let n=e.find(e=>e.name.toLowerCase()===ue.toLowerCase());if(n===void 0)return null;let r=se(n.color);return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:r.fg,borderColor:r.border,backgroundColor:r.bg},onClick:()=>t(n),children:`ok & Awaiting Workspace`})})},R=1e3,pe=60*R,me=60*pe,he=24*me,ge=(e,t)=>{let n=Date.parse(e);if(Number.isNaN(n))return``;let r=t-n;if(r<45*R)return`just now`;if(r<me){let e=Math.round(r/pe);return`${e} minute${e===1?``:`s`} ago`}if(r<he){let e=Math.round(r/me);return`${e} hour${e===1?``:`s`} ago`}let i=Math.round(r/he);if(i===1)return`yesterday`;if(i<30)return`${i} days ago`;let a=new Date(n),o=a.getUTCFullYear()===new Date(t).getUTCFullYear();return a.toLocaleDateString(`en-US`,{timeZone:`UTC`,year:o?void 0:`numeric`,month:`short`,day:`numeric`})},_e=e=>{let t=Date.parse(e);return Number.isNaN(t)?``:new Date(t).toLocaleString(`ja-JP`,{timeZone:`UTC`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`})},ve={issueOpen:{color:`#3fb950`,paths:[`M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z`,`M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z`]},issueClosed:{color:`#a371f7`,paths:[`M11.28 6.78a.75.75 0 0 0-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.06 0l3.5-3.5Z`,`M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 1 0-13 0 6.5 6.5 0 0 0 13 0Z`]},issueClosedNotPlanned:{color:`#848d97`,paths:[`M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm9.78-2.22-5.5 5.5a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l5.5-5.5a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z`]},prOpen:{color:`#3fb950`,paths:[`M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z`]},prMerged:{color:`#a371f7`,paths:[`M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218ZM4.25 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm8.5-4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM5 3.25a.75.75 0 1 0 0 .005V3.25Z`]},prClosed:{color:`#f85149`,paths:[`M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1Zm9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75Zm-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97.97-.97a.748.748 0 0 1 1.265.332.75.75 0 0 1-.205.729l-.97.97.97.97a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-.97-.97-.97.97a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l.97-.97-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0ZM3.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm9.5 0a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z`]},prDraft:{color:`#8b949e`,paths:[`M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1Zm9.5 14a2.25 2.25 0 1 1 0-4.5 2.25 2.25 0 0 1 0 4.5ZM2.5 3.25a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0ZM3.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm9.5 0a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM14 7.5a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm0-4.25a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Z`]}},ye=({isPr:e,state:t,merged:n,isDraft:r,stateReason:i})=>e?r?`prDraft`:n?`prMerged`:t===`closed`?`prClosed`:`prOpen`:t===`closed`?i===`not_planned`?`issueClosedNotPlanned`:`issueClosed`:`issueOpen`,be=({size:e=12,...t})=>{let n=ye(t),r=ve[n];return(0,x.jsx)(`svg`,{className:`console-item-icon`,viewBox:`0 0 16 16`,width:e,height:e,fill:r.color,role:`img`,"aria-label":n,children:r.paths.map(e=>(0,x.jsx)(`path`,{d:e},e))})},xe=({item:e,isActive:t,now:n,statusOptions:r=[],onSelect:i})=>(0,x.jsx)(`button`,{type:`button`,className:`console-item-row`,"aria-current":t?`true`:void 0,"data-active":t?`true`:void 0,onClick:()=>i(e),children:(0,x.jsxs)(`span`,{className:`console-item-meta`,children:[(0,x.jsxs)(`span`,{className:`console-item-title`,children:[(0,x.jsx)(be,{isPr:e.isPr,state:`open`,merged:!1,isDraft:!1,stateReason:``}),e.title]}),(0,x.jsxs)(`span`,{className:`console-item-sub`,children:[(0,x.jsxs)(`span`,{className:`console-item-pill`,children:[`#`,e.number]}),e.repo!==``&&(0,x.jsx)(`span`,{className:`console-item-pill`,children:e.repo}),(0,x.jsx)(`span`,{className:`console-item-pill`,children:e.isPr?`PR`:`Issue`}),e.createdAt!==``&&(0,x.jsxs)(`span`,{className:`console-item-opened`,children:[` · opened `,(0,x.jsx)(`span`,{className:`console-item-createdat`,title:_e(e.createdAt),children:ge(e.createdAt,n)})]}),e.status!==null&&e.status!==``&&(0,x.jsx)(`span`,{className:`console-item-status-badge`,style:N(r.find(t=>t.name===e.status)?.color??null),children:e.status})]}),(e.nextActionDate!==null||e.nextActionHour!==null||e.dependedIssueUrls.length>0)&&(0,x.jsxs)(`span`,{className:`console-item-fields`,children:[e.nextActionDate!==null&&(0,x.jsxs)(`span`,{className:`console-item-field`,children:[(0,x.jsx)(`span`,{className:`console-item-field-label`,children:`Next Action Date`}),e.nextActionDate.slice(0,10)]}),e.nextActionHour!==null&&(0,x.jsxs)(`span`,{className:`console-item-field`,children:[(0,x.jsx)(`span`,{className:`console-item-field-label`,children:`Next Action Hour`}),e.nextActionHour]}),e.dependedIssueUrls.length>0&&(0,x.jsxs)(`span`,{className:`console-item-field`,children:[(0,x.jsx)(`span`,{className:`console-item-field-label`,children:`Depended Issue URL`}),e.dependedIssueUrls.join(`, `)]})]}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-item-status-agent`,children:(0,x.jsxs)(`span`,{className:`console-item-field`,children:[(0,x.jsx)(`span`,{className:`console-item-field-label`,children:`Agent`}),e.agent]})})]})}),Se=({story:e,count:t,colorEnum:n})=>{let r=se(n);return(0,x.jsxs)(`div`,{className:`console-group-header`,children:[(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:r.dot}}),e]}),(0,x.jsx)(`span`,{className:`console-group-count`,children:t})]})},Ce=({rows:e,storyColors:t,statusOptions:n=[],activeItemId:r,now:i,isLoading:a,error:o,onSelectItem:s,executiveSummaries:c,onOkAndAwaitingWorkspace:l})=>o===null?a?(0,x.jsx)(`p`,{className:`console-list-message`,children:`Loading list...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-list-empty`,children:`No items`}):(0,x.jsx)(`ul`,{className:`console-list`,children:e.map(e=>{if(e.kind===`group-header`)return(0,x.jsx)(`li`,{className:`console-list-group`,children:(0,x.jsx)(Se,{story:e.story,count:e.count,colorEnum:ae(t,e.story)})},`group:${e.story}`);let a=c?.[e.item.projectItemId]??null;return(0,x.jsxs)(`li`,{className:`console-list-row`,children:[(0,x.jsx)(xe,{item:e.item,isActive:e.item.itemId===r,now:i,statusOptions:n,onSelect:s}),a!==null&&a!==``&&(0,x.jsx)(`span`,{className:`console-item-executive-summary`,children:a}),l!==void 0&&(0,x.jsx)(fe,{statusOptions:n,onOkAndAwaitingWorkspace:t=>l(e.item,t)})]},e.item.itemId)})}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-list-message console-list-error`,children:[`Failed to load list: `,o]}),we=({agentOptions:e,agentCounts:t,selectedAgent:n,onAgentChange:r})=>{let i=e.filter(e=>(t[e.name]??0)>0);return i.length===0?null:(0,x.jsx)(`div`,{className:`console-prs-agent-filter`,children:(0,x.jsxs)(`select`,{value:n??``,onChange:e=>r(e.target.value===``?null:e.target.value),"aria-label":`Filter by agent`,children:[(0,x.jsx)(`option`,{value:``,children:`All agents`}),i.map(e=>(0,x.jsxs)(`option`,{value:e.name,children:[e.name,` (`,t[e.name],`)`]},e.id))]})})},Te=e=>({...N(e),fontSize:`12px`,whiteSpace:`nowrap`,flexShrink:0}),Ee=({item:e,isActive:t,statusOptions:n,agentOptions:r,onSelect:i})=>{let a=n.find(t=>t.name===e.status),o=r.find(t=>t.name===e.agent);return(0,x.jsxs)(`button`,{type:`button`,className:`console-item-row console-queued-item-row`,"aria-current":t?`true`:void 0,"data-active":t?`true`:void 0,onClick:()=>i(e),children:[(0,x.jsx)(be,{isPr:e.isPr,state:`open`,merged:!1,isDraft:!1,stateReason:``}),(0,x.jsx)(`span`,{className:`console-queued-item-title`,children:e.title}),(0,x.jsxs)(`span`,{className:`console-queued-item-badges`,children:[e.status!==null&&e.status!==``&&(0,x.jsx)(`span`,{className:`console-queued-item-badge`,style:Te(a?.color??null),children:e.status}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-queued-item-badge`,style:Te(o?.color??null),children:e.agent})]}),(0,x.jsx)(`span`,{className:`console-queued-item-actions`})]})},De=({rows:e,storyColors:t,statusOptions:n,agentOptions:r,activeItemId:i,isLoading:a,error:o,onSelectItem:s})=>o===null?a?(0,x.jsx)(`p`,{className:`console-list-message`,children:`Loading list...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-list-empty`,children:`No items`}):(0,x.jsx)(`ul`,{className:`console-list`,children:e.map(e=>e.kind===`group-header`?(0,x.jsx)(`li`,{className:`console-list-group`,children:(0,x.jsx)(Se,{story:e.story,count:e.count,colorEnum:ae(t,e.story)})},`group:${e.story}`):(0,x.jsx)(`li`,{className:`console-list-row`,children:(0,x.jsx)(Ee,{item:e.item,isActive:e.item.itemId===i,statusOptions:n,agentOptions:r,onSelect:s})},e.item.itemId))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-list-message console-list-error`,children:[`Failed to load list: `,o]}),Oe=Object.defineProperty,ke=(e,t)=>Oe(e,`name`,{value:t,configurable:!0});function Ae(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ke(Ae,`setRef`);function je(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ae(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ae(e[t],null)}}}}ke(je,`composeRefs`);function Me(...e){return y.useCallback(je(...e),e)}ke(Me,`useComposedRefs`);var Ne=Object.defineProperty,Pe=(e,t)=>Ne(e,`name`,{value:t,configurable:!0});function Fe(e){let t=y.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];We(r)&&typeof Je==`function`&&(r=Je(r._payload)),y.Children.forEach(r,e=>{if(He(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;We(n)&&typeof Je==`function`&&(n=Je(n._payload)),a=ze(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=y.cloneElement(a,void 0,s):!o&&y.Children.count(r)===1&&y.isValidElement(r)&&(a=r);let c=a?Ve(a):void 0,l=Me(n,c);if(!a){if(r||r===0)throw Error(o?qe(e):Ke(e));return r}let u=Be(i,a.props??{});return a.type!==y.Fragment&&(u.ref=n?l:c),y.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Pe(Fe,`createSlot`);var Ie=Fe(`Slot`),Le=Symbol.for(`radix.slottable`);function Re(e){let t=Pe(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Le,t}Pe(Re,`createSlottable`);var ze=Pe((e,t)=>{if(`child`in e.props){let t=e.props.child;return y.isValidElement(t)?y.cloneElement(t,void 0,e.props.children(t.props.children)):null}return y.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Be(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Pe(Be,`mergeProps`);function Ve(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Pe(Ve,`getElementRef`);function He(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Le}Pe(He,`isSlottable`);var Ue=Symbol.for(`react.lazy`);function We(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ue&&`_payload`in e&&Ge(e._payload)}Pe(We,`isLazyComponent`);function Ge(e){return typeof e==`object`&&!!e&&`then`in e}Pe(Ge,`isPromiseLike`);var Ke=Pe(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),qe=Pe(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Je=y.use;function Ye(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ye(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Xe(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ye(e))&&(r&&(r+=` `),r+=t);return r}var Ze=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Qe=Xe,$e=(e,t)=>n=>{if(t?.variants==null)return Qe(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ze(t)||Ze(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Qe(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},et=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},tt=(e,t)=>({classGroupId:e,validator:t}),nt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rt=`-`,it=[],at=`arbitrary..`,ot=e=>{let t=lt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ct(e);let n=e.split(rt);return st(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?et(i,t):t:i||it}return n[e]||it}}},st=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=st(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(rt):e.slice(t).join(rt),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ct=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?at+r:void 0})(),lt=e=>{let{theme:t,classGroups:n}=e;return ut(n,t)},ut=(e,t)=>{let n=nt();for(let r in e){let i=e[r];dt(i,n,r,t)}return n},dt=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ft(i,t,n,r)}},ft=(e,t,n,r)=>{if(typeof e==`string`){pt(e,t,n);return}if(typeof e==`function`){mt(e,t,n,r);return}ht(e,t,n,r)},pt=(e,t,n)=>{let r=e===``?t:gt(t,e);r.classGroupId=n},mt=(e,t,n,r)=>{if(_t(e)){dt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(tt(n,e))},ht=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];dt(o,gt(t,a),n,r)}},gt=(e,t)=>{let n=e,r=t.split(rt),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=nt(),n.nextPart.set(t,i)),n=i}return n},_t=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,vt=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},yt=`!`,bt=`:`,xt=[],St=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ct=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===bt){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(yt)?(c=s.slice(0,-1),l=!0):s.startsWith(yt)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return St(t,l,c,u)};if(t){let e=t+bt,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):St(xt,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},wt=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Tt=e=>({cache:vt(e.cacheSize),parseClassName:Ct(e),sortModifiers:wt(e),postfixLookupClassGroupIds:Et(e),...ot(e)}),Et=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Dt=/\s+/,Ot=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Dt),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+yt:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},kt=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=At(n))&&(i&&(i+=` `),i+=r);return i},At=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=At(e[r]))&&(n&&(n+=` `),n+=t);return n},jt=(e,...t)=>{let n,r,i,a,o=o=>(n=Tt(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ot(e,n);return i(e,a),a};return a=o,(...e)=>a(kt(...e))},Mt=[],Nt=e=>{let t=t=>t[e]||Mt;return t.isThemeGetter=!0,t},Pt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ft=/^\((?:(\w[\w-]*):)?(.+)\)$/i,It=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Lt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Rt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Bt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ht=e=>It.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),Ut=e=>!!e&&Number.isInteger(Number(e)),Wt=e=>e.endsWith(`%`)&&z(e.slice(0,-1)),Gt=e=>Lt.test(e),Kt=()=>!0,qt=e=>Rt.test(e)&&!zt.test(e),Jt=()=>!1,Yt=e=>Bt.test(e),Xt=e=>Vt.test(e),Zt=e=>!B(e)&&!V(e),Qt=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),$t=e=>hn(e,yn,Jt),B=e=>Pt.test(e),en=e=>hn(e,bn,qt),tn=e=>hn(e,xn,z),nn=e=>hn(e,Cn,Kt),rn=e=>hn(e,Sn,Jt),an=e=>hn(e,_n,Jt),on=e=>hn(e,vn,Xt),sn=e=>hn(e,wn,Yt),V=e=>Ft.test(e),cn=e=>gn(e,bn),ln=e=>gn(e,Sn),un=e=>gn(e,_n),dn=e=>gn(e,yn),fn=e=>gn(e,vn),pn=e=>gn(e,wn,!0),mn=e=>gn(e,Cn,!0),hn=(e,t,n)=>{let r=Pt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gn=(e,t,n=!1)=>{let r=Ft.exec(e);return r?r[1]?t(r[1]):n:!1},_n=e=>e===`position`||e===`percentage`,vn=e=>e===`image`||e===`url`,yn=e=>e===`length`||e===`size`||e===`bg-size`,bn=e=>e===`length`,xn=e=>e===`number`,Sn=e=>e===`family-name`,Cn=e=>e===`number`||e===`weight`,wn=e=>e===`shadow`,Tn=jt(()=>{let e=Nt(`color`),t=Nt(`font`),n=Nt(`text`),r=Nt(`font-weight`),i=Nt(`tracking`),a=Nt(`leading`),o=Nt(`breakpoint`),s=Nt(`container`),c=Nt(`spacing`),l=Nt(`radius`),u=Nt(`shadow`),d=Nt(`inset-shadow`),f=Nt(`text-shadow`),p=Nt(`drop-shadow`),m=Nt(`blur`),h=Nt(`perspective`),g=Nt(`aspect`),_=Nt(`ease`),v=Nt(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),V,B],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[V,B,c],T=()=>[Ht,`full`,`auto`,...w()],E=()=>[Ut,`none`,`subgrid`,V,B],ee=()=>[`auto`,{span:[`full`,Ut,V,B]},Ut,V,B],D=()=>[Ut,`auto`,V,B],te=()=>[`auto`,`min`,`max`,`fr`,V,B],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],O=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],re=()=>[`auto`,...w()],ie=()=>[Ht,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[Ht,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ae=()=>[Ht,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],A=()=>[e,V,B],j=()=>[...b(),un,an,{position:[V,B]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],M=()=>[`auto`,`cover`,`contain`,dn,$t,{size:[V,B]}],se=()=>[Wt,cn,en],N=()=>[``,`none`,`full`,l,V,B],P=()=>[``,z,cn,en],F=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],I=()=>[z,Wt,un,an],le=()=>[``,`none`,m,V,B],ue=()=>[`none`,z,V,B],de=()=>[`none`,z,V,B],L=()=>[z,V,B],fe=()=>[Ht,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Gt],breakpoint:[Gt],color:[Kt],container:[Gt],"drop-shadow":[Gt],ease:[`in`,`out`,`in-out`],font:[Zt],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Gt],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Gt],shadow:[Gt],spacing:[`px`,z],text:[Gt],"text-shadow":[Gt],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ht,B,V,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,V,B]}],"container-named":[Qt],columns:[{columns:[z,B,V,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ut,`auto`,V,B]}],basis:[{basis:[Ht,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[z,Ht,`auto`,`initial`,`none`,B]}],grow:[{grow:[``,z,V,B]}],shrink:[{shrink:[``,z,V,B]}],order:[{order:[Ut,`first`,`last`,`none`,V,B]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...O(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...O()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...O(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...O(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...O(),`baseline`]}],"place-self":[{"place-self":[`auto`,...O()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mbs:[{mbs:re()}],mbe:[{mbe:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...k()]}],"min-inline-size":[{"min-inline":[`auto`,...k()]}],"max-inline-size":[{"max-inline":[`none`,...k()]}],"block-size":[{block:[`auto`,...ae()]}],"min-block-size":[{"min-block":[`auto`,...ae()]}],"max-block-size":[{"max-block":[`none`,...ae()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,...ie()]}],"font-size":[{text:[`base`,n,cn,en]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,mn,nn]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Wt,B]}],"font-family":[{font:[ln,rn,t]}],"font-features":[{"font-features":[B]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,V,B]}],"line-clamp":[{"line-clamp":[z,`none`,V,tn]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,V,B]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,V,B]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...F(),`wavy`]}],"text-decoration-thickness":[{decoration:[z,`from-font`,`auto`,V,en]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[z,`auto`,V,B]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ut,V,B]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,V,B]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,V,B]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:M()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ut,V,B],radial:[``,V,B],conic:[Ut,V,B]},fn,on]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-bs":[{"border-bs":P()}],"border-w-be":[{"border-be":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":P()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...F(),`hidden`,`none`]}],"divide-style":[{divide:[...F(),`hidden`,`none`]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...F(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[z,V,B]}],"outline-w":[{outline:[``,z,cn,en]}],"outline-color":[{outline:A()}],shadow:[{shadow:[``,`none`,u,pn,sn]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":[`none`,d,pn,sn]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:P()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[z,en]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":[`none`,f,pn,sn]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[z,V,B]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":I()}],"mask-image-linear-to-pos":[{"mask-linear-to":I()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":I()}],"mask-image-t-to-pos":[{"mask-t-to":I()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":I()}],"mask-image-r-to-pos":[{"mask-r-to":I()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":I()}],"mask-image-b-to-pos":[{"mask-b-to":I()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":I()}],"mask-image-l-to-pos":[{"mask-l-to":I()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":I()}],"mask-image-x-to-pos":[{"mask-x-to":I()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":I()}],"mask-image-y-to-pos":[{"mask-y-to":I()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[V,B]}],"mask-image-radial-from-pos":[{"mask-radial-from":I()}],"mask-image-radial-to-pos":[{"mask-radial-to":I()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":I()}],"mask-image-conic-to-pos":[{"mask-conic-to":I()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,V,B]}],filter:[{filter:[``,`none`,V,B]}],blur:[{blur:le()}],brightness:[{brightness:[z,V,B]}],contrast:[{contrast:[z,V,B]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,pn,sn]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:[``,z,V,B]}],"hue-rotate":[{"hue-rotate":[z,V,B]}],invert:[{invert:[``,z,V,B]}],saturate:[{saturate:[z,V,B]}],sepia:[{sepia:[``,z,V,B]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,V,B]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[z,V,B]}],"backdrop-contrast":[{"backdrop-contrast":[z,V,B]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,z,V,B]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,V,B]}],"backdrop-invert":[{"backdrop-invert":[``,z,V,B]}],"backdrop-opacity":[{"backdrop-opacity":[z,V,B]}],"backdrop-saturate":[{"backdrop-saturate":[z,V,B]}],"backdrop-sepia":[{"backdrop-sepia":[``,z,V,B]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,V,B]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[z,`initial`,V,B]}],ease:[{ease:[`linear`,`initial`,_,V,B]}],delay:[{delay:[z,V,B]}],animate:[{animate:[`none`,v,V,B]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,V,B]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[V,B,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ut,V,B]}],accent:[{accent:A()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,V,B]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,V,B]}],fill:[{fill:[`none`,...A()]}],"stroke-w":[{stroke:[z,cn,en,tn]}],stroke:[{stroke:[`none`,...A()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),En=(...e)=>Tn(Xe(e)),Dn=$e(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`}},defaultVariants:{variant:`default`,size:`default`}}),On=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,x.jsx)(r?Ie:`button`,{className:En(Dn({variant:t,size:n,className:e})),ref:a,...i}));On.displayName=`Button`;var kn=`Copying to the clipboard is not available in this browser context.`,An=e=>{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`0`,t.style.left=`0`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length);let n=document.execCommand(`copy`);return t.remove(),n},jn=async e=>{let t=navigator.clipboard;if(t!==void 0&&typeof t.writeText==`function`)try{await t.writeText(e);return}catch{if(An(e))return;throw Error(kn)}if(!An(e))throw Error(kn)},Mn=1500,Nn=`Copy failed`,Pn=`Copying to the clipboard failed`,Fn=({value:e,idleText:t,idleAriaLabel:n,copiedAriaLabel:r,className:i})=>{let[a,o]=(0,y.useState)(`idle`),s=(0,y.useRef)(null);return(0,y.useEffect)(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),(0,x.jsx)(On,{type:`button`,variant:`ghost`,size:`sm`,className:i,"aria-label":a===`copied`?r:a===`failed`?Pn:n,onClick:async()=>{try{await jn(e),o(`copied`)}catch(e){console.error(e),o(`failed`)}s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(`idle`),s.current=null},Mn)},children:a===`copied`?`Copied`:a===`failed`?Nn:t})},In=({storyName:e})=>(0,x.jsx)(Fn,{value:e,idleText:`Copy name`,idleAriaLabel:`Copy story name`,copiedAriaLabel:`Story name copied to clipboard`,className:`console-copy-story-name-button`}),Ln=Object.keys(M),Rn=({placeholder:e,emptyValueError:t,onSubmit:n,onCancel:r,initialValue:i=``,submitLabel:a=`Create`,selectAllOnFocus:o=!1})=>{let[s,c]=(0,y.useState)(i),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),p=(0,y.useRef)(null),m=(0,y.useRef)(o);(0,y.useEffect)(()=>{p.current?.focus(),m.current&&p.current?.select()},[]);let h=async()=>{let e=s.trim();if(e.length===0){f(t);return}u(!0),f(null);try{await n(e)}catch(e){f(e instanceof Error?e.message:String(e))}finally{u(!1)}};return(0,x.jsxs)(`form`,{className:`console-inline-input-form`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,x.jsx)(`input`,{ref:p,type:`text`,className:`console-inline-input-form-input`,placeholder:e,value:s,onChange:e=>c(e.target.value),disabled:l}),(0,x.jsx)(`button`,{type:`submit`,className:`console-op-button`,disabled:l,children:l?`${a.replace(/e$/,``)}ing…`:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:r,disabled:l,children:`Cancel`}),d!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:d})]})},zn=({storyOptionId:e,onSubmit:t,onCancel:n})=>(0,x.jsx)(Rn,{placeholder:`Issue title`,emptyValueError:`Title is required`,onSubmit:n=>t(e,n),onCancel:n}),Bn=({currentName:e,onSubmit:t,onCancel:n})=>(0,x.jsx)(Rn,{placeholder:`Story name`,emptyValueError:`Story name is required`,initialValue:e,submitLabel:`Rename`,selectAllOnFocus:!0,onSubmit:t,onCancel:n}),Vn=({onSelectColor:e,disabled:t})=>(0,x.jsx)(`div`,{className:`console-story-color-palette`,children:Ln.map(n=>{let r=M[n];return(0,x.jsx)(`button`,{type:`button`,className:`console-story-color-swatch`,"aria-label":n===`GRAY`?`${n} (disable)`:n,style:{backgroundColor:r.dot},onClick:()=>e(n),disabled:t,children:n===`GRAY`&&(0,x.jsx)(`span`,{className:`console-story-color-swatch-label`,children:`disable`})},n)})}),Hn=({storyName:e,isDeleting:t,deleteError:n,onConfirm:r,onCancel:i})=>(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 "`,e,`" from the GitHub custom field? Tasks assigned to this story will not be deleted.`]}),n!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:n}),(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:r,disabled:t,children:t?`Deleting…`:`Delete`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:i,disabled:t,children:`Cancel`})]})]}),Un=({items:e})=>(0,x.jsx)(`ul`,{className:`console-story-task-list`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-story-task-row`,children:[(0,x.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`console-story-task-title`,children:e.title}),(0,x.jsx)(`span`,{className:`console-story-task-agent`,children:e.agent??`—`}),(0,x.jsx)(`span`,{className:`console-story-task-depended-urls`,children:e.dependedIssueUrls.length>0?e.dependedIssueUrls.join(`, `):`—`}),(0,x.jsx)(`span`,{className:`console-story-task-next-action-date`,children:e.nextActionDate===null?`—`:e.nextActionDate.slice(0,10)}),(0,x.jsx)(`span`,{className:`console-story-task-next-action-hour`,children:e.nextActionHour===null?`—`:String(e.nextActionHour)})]},e.url))}),Wn=({stories:e,isLoading:t,error:n,showGray:r,onCreateIssue:i,onAddStory:a,onSelectColor:o,onToggleGray:s,onReorderStory:c,onDeleteStory:l,onRenameStory:u,optimisticColors:d,colorChangeInFlight:f,colorErrors:p})=>{let[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(null),[v,b]=(0,y.useState)(!1),[S,C]=(0,y.useState)(null),[w,T]=(0,y.useState)({}),[E,ee]=(0,y.useState)(null),[D,te]=(0,y.useState)({}),[ne,O]=(0,y.useState)(null),re=e=>w[e]??{inProgress:!1,error:null},ie=async(e,t)=>{T(t=>({...t,[e]:{inProgress:!0,error:null}}));try{await c(e,t),T(t=>({...t,[e]:{inProgress:!1,error:null}}))}catch(t){T(n=>({...n,[e]:{inProgress:!1,error:t instanceof Error?t.message:String(t)}}))}};if(n!==null)return(0,x.jsxs)(`p`,{role:`alert`,className:`console-list-message console-list-error`,children:[`Failed to load stories: `,n]});if(t)return(0,x.jsx)(`p`,{className:`console-list-message`,children:`Loading stories...`});let k=e=>{h(m===e?null:e)},ae=async(e,t)=>{await i(e,t),h(null)},A=e=>{C(S===e?null:e)},j=(e,t)=>{C(null),o(e,t)},oe=e=>{ee(e)},M=async e=>{te(t=>({...t,[e]:{isDeleting:!0,error:null}}));try{await l(e),ee(null),te(t=>({...t,[e]:{isDeleting:!1,error:null}}))}catch(t){te(n=>({...n,[e]:{isDeleting:!1,error:t instanceof Error?t.message:String(t)}}))}},N=()=>{ee(null),te({})},P=e=>{O(ne===e?null:e)},F=async(e,t)=>{await u(e,t),O(null)},ce=r?e:e.filter(e=>e.color!==`GRAY`),I=e.some(e=>e.color===`GRAY`);return(0,x.jsxs)(`div`,{className:`console-story-list-container`,children:[ce.length===0?(0,x.jsx)(`p`,{className:`console-list-empty`,children:`No active stories`}):(0,x.jsx)(`ul`,{className:`console-story-list`,children:ce.map((e,t)=>{let n=se(d[e.storyOptionId]??e.color),r=m===e.storyOptionId,i=S===e.storyOptionId,a=f===e.storyOptionId,o=p[e.storyOptionId]??null,{inProgress:s,error:c}=re(e.storyOptionId),l=t===0,u=t===ce.length-1,v=E===e.storyOptionId,y=D[e.storyOptionId]??{isDeleting:!1,error:null},b=ne===e.storyOptionId,C=g===e.storyOptionId;return(0,x.jsxs)(`li`,{className:`console-story-list-row`,children:[(0,x.jsxs)(`div`,{className:`console-story-list-row-main`,children:[e.storyViewUrl?(0,x.jsxs)(`a`,{href:e.storyViewUrl,target:`_blank`,rel:`noopener noreferrer`,className:`console-storytag`,style:{color:n.fg,borderColor:n.border},children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:n.dot}}),e.storyName]}):(0,x.jsxs)(`span`,{className:`console-storytag`,style:{color:n.fg,borderColor:n.border},children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:n.dot}}),e.storyName]}),(0,x.jsx)(In,{storyName:e.storyName}),(0,x.jsx)(`span`,{className:`console-story-count`,children:e.openItemCount}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>k(e.storyOptionId),children:`Add task`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>A(e.storyOptionId),disabled:a,children:`Change color`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,"aria-label":`Move up`,disabled:l||s,onClick:()=>void ie(e.storyOptionId,`up`),children:`↑`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,"aria-label":`Move down`,disabled:u||s,onClick:()=>void ie(e.storyOptionId,`down`),children:`↓`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,"aria-label":`Delete story`,onClick:()=>oe(e.storyOptionId),children:`Delete`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,"aria-label":`Rename story`,onClick:()=>P(e.storyOptionId),children:`Rename`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>_(C?null:e.storyOptionId),children:C?`Hide tasks`:`Show tasks`})]}),C&&(0,x.jsx)(Un,{items:e.items}),c!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:c}),i&&(0,x.jsx)(Vn,{onSelectColor:t=>j(e.storyOptionId,t),disabled:a}),o!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:o}),r&&(0,x.jsx)(zn,{storyOptionId:e.storyOptionId,onSubmit:ae,onCancel:()=>h(null)}),v&&(0,x.jsx)(Hn,{storyName:e.storyName,isDeleting:y.isDeleting,deleteError:y.error,onConfirm:()=>void M(e.storyOptionId),onCancel:N}),b&&(0,x.jsx)(Bn,{currentName:e.storyName,onSubmit:t=>F(e.storyOptionId,t),onCancel:()=>O(null)})]},e.storyOptionId)})}),I&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:s,children:r?`Hide archived`:`Show archived`}),(0,x.jsxs)(`div`,{className:`console-add-story-section`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>b(!v),children:`Add story`}),v&&(0,x.jsx)(Rn,{placeholder:`Story name`,emptyValueError:`Story name is required`,onSubmit:async e=>{await a(e),b(!1)},onCancel:()=>b(!1)})]})]})},Gn=e=>`${e.isPr?`PR`:`Issue`} #${e.itemNumber}`,Kn=e=>e===null?`loading…`:e,qn=e=>{let t=[];return t.push(`CI: ${e.isCiStateSuccess?`pass`:`fail`}`),t.push(`Merge: ${e.mergeableStatus.toLowerCase()}`),e.isBranchOutOfDate&&t.push(`branch out of date`),t.join(` · `)},Jn=e=>e.fetchError?`${Gn(e)} — failed to load current state`:e.currentTitle===null?`${Gn(e)} — loading current state…`:`${Gn(e)} — ${e.currentTitle} (${Kn(e.currentState)})`,Yn=({actions:e,isOnline:t,isConfirming:n,onConfirm:r,onDiscard:i})=>e.length===0?null:(0,x.jsxs)(`section`,{className:`console-offline-panel`,"aria-label":`Offline actions queue`,children:[(0,x.jsxs)(`div`,{className:`console-offline-panel-header`,children:[e.length,` action`,e.length===1?``:`s`,` held`,t?` — confirm each before sending`:` — awaiting connectivity`]}),e.map(e=>(0,x.jsxs)(`div`,{className:`console-offline-panel-item console-offline-panel-item-${e.color}`,children:[(0,x.jsx)(`div`,{className:`console-offline-panel-item-message`,children:e.message}),(0,x.jsx)(`div`,{className:`console-offline-panel-item-target`,children:Jn(e)}),e.fetchError&&(0,x.jsx)(`div`,{className:`console-offline-panel-item-fetch-error`,children:`Failed to load current state — sending will act on the last known state`}),t&&e.isPr&&e.currentPrStatus!==null&&!e.fetchError&&(0,x.jsx)(`div`,{className:`console-offline-panel-item-pr-status`,children:qn(e.currentPrStatus)}),(0,x.jsxs)(`div`,{className:`console-offline-panel-item-controls`,children:[t&&(0,x.jsx)(`button`,{type:`button`,className:`console-offline-panel-confirm`,disabled:n||e.currentTitle===null&&!e.fetchError,onClick:()=>r(e.id),children:`Send`}),(0,x.jsx)(`button`,{type:`button`,className:`console-offline-panel-discard`,onClick:()=>i(e.id),children:`Discard`})]})]},e.id))]}),Xn=({message:e,color:t,remainingSeconds:n,progress:r,onUndo:i})=>(0,x.jsxs)(`div`,{className:`console-undo-toast console-undo-toast-${t}`,role:`status`,"aria-live":`polite`,children:[(0,x.jsx)(`span`,{className:`console-undo-toast-message`,children:e}),(0,x.jsx)(`button`,{type:`button`,className:`console-undo-toast-undo`,onClick:i,children:`Undo`}),(0,x.jsxs)(`span`,{className:`console-undo-toast-countdown`,"aria-hidden":`true`,children:[n,`s`]}),(0,x.jsx)(`span`,{className:`console-undo-toast-bar`,"aria-hidden":`true`,style:{width:`${Math.max(0,Math.min(100,r*100))}%`}})]}),Zn=({title:e,message:t,onDismiss:n})=>(0,x.jsxs)(`div`,{className:`console-undo-toast-error console-error-toast`,role:`alert`,"aria-live":`assertive`,children:[e!==void 0&&(0,x.jsx)(`span`,{className:`console-error-toast-title`,children:e}),(0,x.jsx)(`span`,{className:`console-error-toast-message`,children:t}),(0,x.jsx)(`button`,{type:`button`,className:`console-error-toast-dismiss`,onClick:n,children:`Dismiss`})]}),Qn=`tdpm-airplane-v1`,$n=`/airplane-snapshot-data`,er=`tdpm_airplane_mode_on`,tr=()=>typeof localStorage>`u`?!1:localStorage.getItem(er)===`1`,nr=e=>{typeof localStorage>`u`||(e?localStorage.setItem(er,`1`):localStorage.removeItem(er))},rr=async e=>{if(typeof caches>`u`)throw Error(`Cache API unavailable`);try{await(await caches.open(Qn)).put($n,new Response(JSON.stringify(e),{headers:{"Content-Type":`application/json`}}))}catch(e){throw e instanceof Error&&e.name===`QuotaExceededError`?Error(`Not enough browser storage to save the offline snapshot. Free up storage and retry.`):e}},ir=async()=>{if(typeof caches>`u`)return null;let e=await(await caches.open(Qn)).match($n);return e===void 0?null:e.json()},ar=async()=>{typeof caches>`u`||await caches.delete(Qn)},or=e=>typeof e==`object`&&!!e&&!Array.isArray(e),sr=e=>typeof e==`string`?e:``,cr=e=>typeof e==`number`?e:0,lr=e=>e===!0,ur=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],dr=e=>e===`MERGEABLE`?`MERGEABLE`:e===`CONFLICTING`?`CONFLICTING`:`UNKNOWN`,fr=e=>or(e)?{number:cr(e.number),title:sr(e.title),url:sr(e.url),repo:sr(e.repo),nameWithOwner:sr(e.nameWithOwner),projectItemId:sr(e.projectItemId),itemId:sr(e.itemId),isPr:lr(e.isPr),story:sr(e.story),status:typeof e.status==`string`?e.status:null,nextActionDate:typeof e.nextActionDate==`string`?e.nextActionDate:null,nextActionHour:typeof e.nextActionHour==`number`?e.nextActionHour:null,dependedIssueUrls:ur(e.dependedIssueUrls),labels:ur(e.labels),createdAt:sr(e.createdAt),relatedOpenPullRequestUrls:ur(e.relatedOpenPullRequestUrls),agent:typeof e.agent==`string`?e.agent:null}:null,pr=e=>{if(!or(e))return{items:[],generatedAt:``,statusOptions:[],agentOptions:[],storyOptions:[],storyColors:{},stories:[],defaultNameWithOwner:null,fromCache:!1,storyOrder:[],timerEndsAt:null,timerTotalSeconds:null};let t=Array.isArray(e.items)?e.items.map(fr).filter(e=>e!==null):[],n=Array.isArray(e.statusOptions)?e.statusOptions.filter(or):[],r=Array.isArray(e.agentOptions)?e.agentOptions.filter(or):[],i=Array.isArray(e.storyOptions)?e.storyOptions.filter(or):[],a=Array.isArray(e.stories)?e.stories.filter(or):[],o=Array.isArray(e.storyOrder)?e.storyOrder.filter(e=>typeof e==`string`):[];return{items:t,generatedAt:typeof e.generatedAt==`string`?e.generatedAt:``,statusOptions:n,agentOptions:r,storyOptions:i,storyColors:or(e.storyColors)?e.storyColors:{},stories:a,defaultNameWithOwner:typeof e.defaultNameWithOwner==`string`?e.defaultNameWithOwner:null,fromCache:!1,storyOrder:o,timerEndsAt:null,timerTotalSeconds:null}},mr=e=>or(e)?{author:sr(e.author),body:sr(e.body),createdAt:sr(e.createdAt),url:typeof e.url==`string`?e.url:null}:null,hr=e=>or(e)?{path:sr(e.path),additions:cr(e.additions),deletions:cr(e.deletions),status:sr(e.status),patch:typeof e.patch==`string`?e.patch:null,rawUrl:typeof e.rawUrl==`string`?e.rawUrl:null}:null,gr=e=>or(e)?{sha:sr(e.sha),message:sr(e.message),author:sr(e.author),authoredAt:sr(e.authoredAt)}:null,_r=e=>or(e)?{found:lr(e.found),isConflicted:lr(e.isConflicted),mergeableStatus:dr(e.mergeableStatus),isPassedAllCiJob:lr(e.isPassedAllCiJob),isCiStateSuccess:lr(e.isCiStateSuccess),isBranchOutOfDate:lr(e.isBranchOutOfDate),missingRequiredCheckNames:ur(e.missingRequiredCheckNames)}:{found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},vr=e=>{if(!or(e))return null;let t=or(e.summary)?{title:sr(e.summary.title),body:sr(e.summary.body),additions:cr(e.summary.additions),deletions:cr(e.summary.deletions),changedFiles:cr(e.summary.changedFiles)}:null;return{url:sr(e.url),branchName:typeof e.branchName==`string`?e.branchName:null,createdAt:sr(e.createdAt),isDraft:lr(e.isDraft),isConflicted:lr(e.isConflicted),mergeableStatus:dr(e.mergeableStatus),isPassedAllCiJob:lr(e.isPassedAllCiJob),isCiStateSuccess:lr(e.isCiStateSuccess),isResolvedAllReviewComments:lr(e.isResolvedAllReviewComments),isBranchOutOfDate:lr(e.isBranchOutOfDate),missingRequiredCheckNames:ur(e.missingRequiredCheckNames),summary:t}},yr=e=>{if(!or(e))return{body:``,comments:[],state:{state:`open`,merged:!1,isPullRequest:!1,title:``},files:null,commits:null,prStatus:null,relatedPrs:null};let t=or(e.state)?e.state:{},n={state:sr(t.state)||`open`,merged:lr(t.merged),isPullRequest:lr(t.isPullRequest),title:sr(t.title)},r=e.files===null?null:Array.isArray(e.files)?e.files.map(hr).filter(e=>e!==null):null,i=e.commits===null?null:Array.isArray(e.commits)?e.commits.map(gr).filter(e=>e!==null):null,a=e.prStatus===null?null:_r(e.prStatus),o=e.relatedPrs===null?null:Array.isArray(e.relatedPrs)?e.relatedPrs.map(vr).filter(e=>e!==null):null;return{body:sr(e.body),comments:Array.isArray(e.comments)?e.comments.map(mr).filter(e=>e!==null):[],state:n,files:r,commits:i,prStatus:a,relatedPrs:o}},br=e=>{if(!or(e))return null;let t=typeof e.capturedAt==`string`?e.capturedAt:``,n=ur(e.failures),r={};if(or(e.tabs))for(let[t,n]of Object.entries(e.tabs)){if(!or(n))continue;let e={};for(let[t,r]of Object.entries(n))e[t]=pr(r);r[t]=e}let i={};if(or(e.items))for(let[t,n]of Object.entries(e.items))i[t]=yr(n);return{capturedAt:t,tabs:r,items:i,failures:n}},xr=`/api/airplanesync`,Sr=e=>{try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)&&`type`in t&&typeof t.type==`string`?t:null}catch{return null}},Cr=()=>{let[e,t]=(0,y.useState)(`off`),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)([]),c=(0,y.useRef)(null);return(0,y.useEffect)(()=>{if(!tr())return;let e=!1;return ir().then(n=>{e||n===null||(a(n),t(`on`))}).catch(()=>{nr(!1)}),()=>{e=!0}},[]),{status:e,progress:n,snapshot:i,failures:o,startSync:(0,y.useCallback)(()=>{c.current!==null&&c.current.abort();let e=new AbortController;c.current=e,t(`syncing`),r({fetched:0,total:0}),s([]),fetch(xr,{signal:e.signal}).then(async e=>{if(!e.ok||e.body===null){t(`error`),s([`HTTP ${e.status}`]);return}let n=e.body.pipeThrough(new TextDecoderStream).getReader(),i=``;for(;;){let{done:e,value:o}=await n.read();if(e)break;i+=o;let c=i.split(`
12
12
 
13
- `);i=c.pop()??``;for(let e of c){if(!e.startsWith(`data: `))continue;let n=Sr(e.slice(6));if(n!==null){if(n.type===`progress`)r({fetched:typeof n.fetched==`number`?n.fetched:0,total:typeof n.total==`number`?n.total:0});else if(n.type===`done`){let e=br(n.snapshot);if(e===null){t(`error`),s([`Failed to parse snapshot`]);return}if(e.failures.length>0){s(e.failures),t(`error`);return}await rr(e),nr(!0),a(e),t(`on`),s([])}}}}}).catch(e=>{e instanceof Error&&e.name===`AbortError`||(t(`error`),s([e instanceof Error?e.message:String(e)]))})},[]),turnOff:(0,y.useCallback)(()=>{c.current!==null&&(c.current.abort(),c.current=null),t(`off`),a(null),r(null),s([]),nr(!1),ar().catch(()=>{})},[])}},wr=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Tr=e=>typeof e==`string`?e:``,Er=e=>typeof e==`number`?e:0,Dr=e=>e===!0,Or=`console-api-v1`,kr=async(e,t)=>{let n=`${e}?url=${encodeURIComponent(t)}`;try{let e=await fetch(n);if(!e.ok){let t=`HTTP ${e.status}`;try{let n=await e.json();wr(n)&&typeof n.error==`string`&&n.error.length>0&&(t=n.error)}catch(e){console.warn(`Failed to parse error body from non-ok response:`,e)}throw Error(t)}let t=await e.json();try{`caches`in globalThis&&globalThis.caches.open(Or).then(e=>e.put(n,new Response(JSON.stringify(t),{headers:{"Content-Type":`application/json`}}))).catch(e=>{console.warn(`Failed to persist API response to cache:`,e)})}catch(e){console.warn(`Failed to access cache storage:`,e)}return t}catch(e){try{if(`caches`in globalThis){let e=await(await globalThis.caches.open(Or)).match(n);if(e!==void 0)return e.json()}}catch{}throw e}},Ar=e=>!wr(e)||!Array.isArray(e.comments)?[]:e.comments.filter(wr).map(e=>({author:Tr(e.author),body:Tr(e.body),createdAt:Tr(e.createdAt),url:typeof e.url==`string`?e.url:null})),jr=e=>!wr(e)||!Array.isArray(e.files)?[]:e.files.filter(wr).map(e=>({path:Tr(e.path)||Tr(e.filename),additions:Er(e.additions),deletions:Er(e.deletions),status:Tr(e.status),patch:typeof e.patch==`string`?e.patch:null,rawUrl:typeof e.rawUrl==`string`?e.rawUrl:null})),Mr=e=>!wr(e)||!Array.isArray(e.commits)?[]:e.commits.filter(wr).map(e=>({sha:Tr(e.sha),message:Tr(e.message),author:Tr(e.author),authoredAt:Tr(e.authoredAt)})),Nr=e=>wr(e)?{title:Tr(e.title),body:Tr(e.body),additions:Er(e.additions),deletions:Er(e.deletions),changedFiles:Er(e.changedFiles)}:null,Pr=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Fr=e=>e===`MERGEABLE`?`MERGEABLE`:e===`CONFLICTING`?`CONFLICTING`:`UNKNOWN`,Ir=e=>!wr(e)||!Array.isArray(e.relatedPullRequests)?[]:e.relatedPullRequests.filter(wr).map(e=>({url:Tr(e.url),branchName:typeof e.branchName==`string`?e.branchName:null,createdAt:Tr(e.createdAt),isDraft:Dr(e.isDraft),isConflicted:Dr(e.isConflicted),mergeableStatus:Fr(e.mergeableStatus),isPassedAllCiJob:Dr(e.isPassedAllCiJob),isCiStateSuccess:Dr(e.isCiStateSuccess),isResolvedAllReviewComments:Dr(e.isResolvedAllReviewComments),isBranchOutOfDate:Dr(e.isBranchOutOfDate),missingRequiredCheckNames:Pr(e.missingRequiredCheckNames),summary:Nr(e.summary)})),Lr=e=>{if(!wr(e)||!wr(e.status))return{found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]};let t=e.status;return{found:!0,isConflicted:Dr(t.isConflicted),mergeableStatus:Fr(t.mergeableStatus),isPassedAllCiJob:Dr(t.isPassedAllCiJob),isCiStateSuccess:Dr(t.isCiStateSuccess),isBranchOutOfDate:Dr(t.isBranchOutOfDate),missingRequiredCheckNames:Pr(t.missingRequiredCheckNames)}},Rr=e=>wr(e)?{state:Tr(e.state)||`open`,merged:Dr(e.merged),isPullRequest:Dr(e.isPullRequest),title:Tr(e.title)}:{state:`open`,merged:!1,isPullRequest:!1,title:``},zr=()=>({fetchItemBody:async e=>{let t=await kr(`/api/itembody`,e);return wr(t)?Tr(t.body):``},fetchComments:async e=>Ar(await kr(`/api/comments`,e)),fetchPrFiles:async e=>jr(await kr(`/api/prfiles`,e)),fetchPrCommits:async e=>Mr(await kr(`/api/prcommits`,e)),fetchRelatedPrs:async e=>Ir(await kr(`/api/relatedprs`,e)),fetchIssueState:async e=>Rr(await kr(`/api/issuetitle`,e)),fetchPullRequestStatus:async e=>Lr(await kr(`/api/pullrequeststatus`,e))}),Br=async e=>{let t=await e.text().catch(()=>``);if(t.length===0)return`HTTP ${e.status}`;try{let e=JSON.parse(t);if(wr(e)&&typeof e.error==`string`)return e.error}catch{return t}return t},Vr=async(e,t)=>{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(await Br(n))},Hr=`/api/comment`,Ur=e=>({author:Tr(e.author),body:Tr(e.body),createdAt:Tr(e.createdAt),url:typeof e.url==`string`?e.url:null}),Wr=async e=>{let t=await fetch(Hr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{posted:!1,error:await Br(t),rateLimitResetAt:null};let n=await t.json();return wr(n)?n.ok===!1?{posted:!1,error:typeof n.error==`string`?n.error:`upstream error`,rateLimitResetAt:typeof n.rateLimitResetAt==`string`?n.rateLimitResetAt:null}:wr(n.comment)?{posted:!0,comment:Ur(n.comment)}:{posted:!1,error:`comment was not returned`,rateLimitResetAt:null}:{posted:!1,error:`unexpected response shape`,rateLimitResetAt:null}},Gr=`/api/upload`,Kr=e=>{let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)},qr=async e=>{let t=await fetch(Gr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t));let n=await t.json();if(!wr(n)||typeof n.markdown!=`string`)throw Error(`markdown was not returned`);return n.markdown},Jr=`/api/addstory`,Yr=async e=>{let t=await fetch(Jr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},Xr=`/api/reviewcomment`,Zr=async e=>{let t=await fetch(Xr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},Qr=`/api/createissue`,$r=`/api/storycolor`,ei=async e=>{let t=await fetch($r,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},ti=async e=>{let t=await fetch(Qr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t));let n=await t.json();if(!(e=>typeof e==`object`&&!!e&&!Array.isArray(e))(n)||typeof n.issueUrl!=`string`)throw Error(`issueUrl was not returned`);return n.issueUrl},ni=`/api/reorderstory`,ri=async e=>{let t=await fetch(ni,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},ii=`/api/deleteallcomments`,ai=async e=>{let t=await fetch(ii,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},oi=`/api/deletestory`,si=async e=>{let t=await fetch(oi,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},ci=`/api/renamestory`,li=async e=>{let t=await fetch(ci,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},ui=async()=>{let e=await fetch(`/api/projects`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if(typeof t!=`object`||!t||Array.isArray(t))return{pjcodes:[],workflowImprovementIssueUrl:null};let n=t;return{pjcodes:Array.isArray(n.pjcodes)?n.pjcodes.filter(e=>typeof e==`string`):[],workflowImprovementIssueUrl:typeof n.workflowImprovementIssueUrl==`string`?n.workflowImprovementIssueUrl:null}},di=`/api/projectreadmeconfig`,fi=async e=>{let t=`${di}?pjcode=${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(await Br(n));let r=await n.json();return{maximumPreparingIssuesCount:wr(r)&&typeof r.maximumPreparingIssuesCount==`number`?r.maximumPreparingIssuesCount:null}},pi=`/api/setdependedissueurl`,mi=async e=>{let t=await fetch(pi,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},hi=`/api/projectsettings`,gi=async e=>{let t=await fetch(hi,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},_i=5e3,vi=e=>`${e.isPr?`PR #`:`#`}${e.number}`,yi=(e,t)=>{switch(e.type){case`review`:return e.action===`approve_and_merge`?`Approved & Merged`:e.action===`request_changes`?`Rejected`:e.action===`totally_wrong`?`Marked totally wrong`:`Marked unnecessary`;case`next_action_date`:return e.action===`snooze_1hour`?`Next Action Hour +1 hour`:e.action===`snooze_3hours`?`Next Action Hour +3 hours`:e.action===`snooze_6hours`?`Next Action Hour +6 hours`:e.action===`snooze_1day`?`Next Action Date +1 day`:e.action===`snooze_2days`?`Next Action Date +2 days`:e.action===`snooze_3days`?`Next Action Date +3 days`:e.action===`snooze_5days`?`Next Action Date +5 days`:e.action===`snooze_1month`?`Next Action Date +1 month`:L(t)?`Next Action Date +1 week and skip`:`Next Action Date +1 week`;case`set_story`:return`Story → ${e.optionName}`;case`set_agent`:return`Agent → ${e.optionName}`;case`set_status`:return`Status → ${e.optionName}`;case`set_in_tmux_by_human`:return`Added to In Tmux by human`;case`ok_and_awaiting_workspace`:return`ok → Awaiting Workspace`;case`close`:return e.action===`close`?`Closed`:`Closed as not planned`;case`delete_all_comments`:return`Deleted all comments`}},bi=e=>{switch(e.type){case`review`:return e.action===`approve_and_merge`?`green`:e.action===`request_changes`?`amber`:e.action===`totally_wrong`?`red`:`gray`;case`next_action_date`:return`amber`;case`set_story`:case`set_agent`:case`set_status`:case`set_in_tmux_by_human`:case`ok_and_awaiting_workspace`:return`blue`;case`close`:return`red`;case`delete_all_comments`:return`red`}},xi=(e,t)=>e.type===`next_action_date`?L(t):e.type!==`delete_all_comments`,Si=(e,t,n)=>`${yi(e,n)} — ${vi(t)}`,Ci=`console-offline-action-queue`,wi=e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.message==`string`&&typeof t.color==`string`&&typeof t.enqueuedAt==`number`&&typeof t.itemUrl==`string`&&typeof t.projectItemId==`string`&&typeof t.itemNumber==`number`&&typeof t.repo==`string`&&typeof t.isPr==`boolean`&&typeof t.apiPath==`string`&&typeof t.requestBody==`object`&&t.requestBody!==null},Ti=()=>{try{let e=localStorage.getItem(Ci);if(e===null)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(wi):[]}catch{return[]}},Ei=e=>{localStorage.setItem(Ci,JSON.stringify(e))},Di=()=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`,Oi=e=>e instanceof TypeError,ki=e=>e instanceof Error&&e.message.length>0?e.message:String(e),Ai=100,ji=e=>Math.max(0,Math.ceil((_i-e)/1e3)),H=e=>Math.max(0,1-e/_i),Mi=()=>{let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(Ti),o=(0,y.useRef)(i);o.current=i;let s=(0,y.useRef)(null),c=(0,y.useRef)(0),l=(0,y.useRef)(null),u=(0,y.useRef)(!1),d=(0,y.useCallback)(()=>{l.current!==null&&(clearInterval(l.current),l.current=null)},[]),f=(0,y.useCallback)(e=>{if(e.offline===void 0)return;let t={id:Di(),message:e.message,color:e.color,enqueuedAt:Date.now(),...e.offline};a(e=>{let n=[...e,t];return Ei(n),n})},[]),p=(0,y.useCallback)(e=>{e.commit().catch(t=>{Oi(t)&&e.offline!==void 0?f(e):r({message:e.message,reason:ki(t)})})},[f]),m=(0,y.useCallback)(()=>{let e=s.current;d(),s.current=null,t(null),e!==null&&!u.current&&(u.current=!0,p(e))},[d,p]),h=(0,y.useCallback)(()=>{let e=s.current;d(),s.current=null,u.current=!0,t(null),e?.revertAdvance?.()},[d]),g=(0,y.useCallback)(()=>{r(null)},[]),_=(0,y.useCallback)((e,t)=>{r({message:e,reason:t})},[]),v=(0,y.useCallback)(e=>{a(t=>{let n=t.filter(t=>t.id!==e);return Ei(n),n})},[]),b=(0,y.useCallback)(async e=>{let t=o.current.find(t=>t.id===e);if(t!==void 0)try{await Vr(t.apiPath,t.requestBody),v(e)}catch(n){Oi(n)?r({message:t.message,reason:`Still offline — action is still held in the queue`}):(r({message:t.message,reason:ki(n)}),v(e))}},[v]),x=(0,y.useCallback)(e=>{if(s.current!==null&&!u.current){let e=s.current;d(),u.current=!0,p(e)}u.current=!1,s.current=e,c.current=Date.now(),t({message:e.message,color:e.color,remainingSeconds:ji(0),progress:H(0)}),e.advance(),l.current=setInterval(()=>{let n=Date.now()-c.current;if(n>=5e3){m();return}t({message:e.message,color:e.color,remainingSeconds:ji(n),progress:H(n)})},Ai)},[d,m,p]);return(0,y.useEffect)(()=>d,[d]),{pending:e,error:n,offlineActions:i,enqueue:x,showError:_,undo:h,dismissError:g,confirmOfflineAction:b,discardOfflineAction:v}},Ni=class{fetcher;cache=new Map;inFlight=new Map;prefetchInFlight=new Set;constructor(e){this.fetcher=e}peek=e=>this.cache.get(e);has=e=>this.cache.has(e);load=(e,t)=>{let n=this.cache.get(e);if(n!==void 0)return Promise.resolve(n);let r=this.inFlight.get(e);if(r!==void 0)return r;let i=this.fetcher(t).then(t=>(this.cache.set(e,t),t)).finally(()=>{this.inFlight.delete(e)});return this.inFlight.set(e,i),i};prefetch=(e,t)=>{this.cache.has(e)||this.inFlight.has(e)||this.prefetchInFlight.has(e)||(this.prefetchInFlight.add(e),this.fetcher(t).then(t=>{this.cache.set(e,t)}).catch(()=>{}).finally(()=>{this.prefetchInFlight.delete(e)}))};seed(e,t){this.cache.set(e,t)}invalidate=e=>{this.cache.delete(e)}},Pi=e=>{try{let t=new URL(e).pathname.split(`/`).filter(Boolean);if(t.length>=4)return`${t[0]}/${t[1]}#${t[3]}`}catch{}return e},Fi=(e,t)=>{for(let[n,r]of Object.entries(t.items)){let t=Pi(n);e.body.seed(t,r.body),e.comments.seed(t,r.comments),e.state.seed(t,r.state),r.files!==null&&e.files.seed(t,r.files),r.commits!==null&&e.commits.seed(t,r.commits),r.prStatus!==null&&e.prStatus.seed(t,r.prStatus),r.relatedPrs!==null&&e.relatedPrs.seed(t,r.relatedPrs)}},Ii=(e=null)=>(0,y.useMemo)(()=>{let t=zr(),n={client:t,body:new Ni(t.fetchItemBody),comments:new Ni(t.fetchComments),files:new Ni(t.fetchPrFiles),commits:new Ni(t.fetchPrCommits),relatedPrs:new Ni(t.fetchRelatedPrs),state:new Ni(t.fetchIssueState),prStatus:new Ni(t.fetchPullRequestStatus)};return e!==null&&Fi(n,e),n},[e]),Li=0,Ri=500,zi=2e3,Bi=e=>{let t=window;if(typeof t.requestIdleCallback==`function`&&typeof t.cancelIdleCallback==`function`){let n=t.requestIdleCallback(e,{timeout:zi});return{cancel:()=>t.cancelIdleCallback?.(n)}}let n=window.setTimeout(e,0);return{cancel:()=>window.clearTimeout(n)}},Vi=(e,t)=>{let n=`${t.repo}#${t.number}`;e.body.prefetch(n,t.url),e.state.prefetch(n,t.url),e.comments.prefetch(n,t.url),t.isPr?(e.files.prefetch(n,t.url),e.commits.prefetch(n,t.url),e.prStatus.prefetch(n,t.url)):e.relatedPrs.prefetch(n,t.url)},Hi=(e,t,n)=>{(0,y.useEffect)(()=>{if(t===null)return;let r=n.findIndex(e=>e.projectItemId===t.projectItemId);if(r===-1)return;let i=n.slice(r+1,r+1+Li);if(i.length===0)return;let a=null,o=window.setTimeout(()=>{a=Bi(()=>{for(let t of i)Vi(e,t)})},Ri);return()=>{window.clearTimeout(o),a?.cancel()}},[e,t,n])},Ui=`/api/features`,Wi=()=>{let[e,t]=(0,y.useState)({airplaneMode:!1});return(0,y.useEffect)(()=>{fetch(Ui).then(async e=>{if(!e.ok)return;let n=await e.json();typeof n==`object`&&n&&!Array.isArray(n)&&`airplaneMode`in n&&typeof n.airplaneMode==`boolean`&&t({airplaneMode:n.airplaneMode})}).catch(e=>{console.warn(`Failed to fetch /api/features`,e)})},[]),e},Gi=(e,t)=>{let n=ee.findIndex(t=>t.name===e);if(n===-1)return null;for(let e=n+1;e<ee.length;e+=1){let n=ee[e].name;if((t[n]??0)>0)return n}return null},Ki=e=>{for(let t of ee)if((e[t.name]??0)>0)return t.name;return ee[0].name},qi=new Set(ee.map(e=>e.name)),Ji=e=>{let t=e.split(`/`).filter(e=>e.length>0);if(t.length<3||t[0]!==`projects`)return null;let n=t[2];return qi.has(n)?n:null},Yi=e=>{if(!e.startsWith(`#item/`))return null;let t=e.slice(6);return t.length===0?null:decodeURIComponent(t)},Xi=`#settings`,Zi=(e,t)=>{let n=(0,y.useCallback)(()=>{let e=Ki(t);return typeof window>`u`?{activeTab:e,selectedItemKey:null}:{activeTab:Ji(window.location.pathname)??e,selectedItemKey:Yi(window.location.hash)}},[t]),[r,i]=(0,y.useState)(n);(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{i(n())};return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,e)}},[n]),(0,y.useEffect)(()=>{if(typeof window>`u`||Ji(window.location.pathname)!==null)return;let e=Ki(t);i(t=>t.activeTab===e?t:{...t,activeTab:e})},[t]);let a=(0,y.useCallback)(t=>e===null?`#${t}`:`/projects/${e}/${t}`,[e]),o=(0,y.useCallback)(e=>{if(typeof window>`u`){i({activeTab:e,selectedItemKey:null});return}window.history.pushState({},``,a(e)),i({activeTab:e,selectedItemKey:null})},[a]),s=(0,y.useCallback)(e=>{typeof window<`u`&&(window.location.hash=`#item/${encodeURIComponent(e)}`),i(t=>({...t,selectedItemKey:e}))},[]),c=(0,y.useCallback)(()=>{if(typeof window<`u`&&window.location.hash!==``){let e=`${window.location.pathname}${window.location.search}`;window.history.pushState({},``,e)}i(e=>({...e,selectedItemKey:null}))},[]);return{activeTab:r.activeTab,selectedItemKey:r.selectedItemKey,tabHref:a,selectTab:o,openItem:s,closeItem:c}},Qi=e=>`pv_overlay_${e}`,$i=e=>e.projectItemId===``?e.itemId:e.projectItemId,ea=(e,t)=>e!==void 0&&e.done===!0&&e.mode===t,ta=(e,t,n)=>e.filter(e=>!ea(t[$i(e)],n)).length,na=(e,t,n)=>e.filter(e=>!ea(t[$i(e)],n)),ra=(e,t)=>{let n=Date.parse(t);if(Number.isNaN(n))return{};let r={};for(let[t,i]of Object.entries(e))i.ts>=n&&(r[t]=i);return r},ia=(e,t,n)=>{if(n===null)return null;let r=Date.parse(n);if(Number.isNaN(r))return null;let i=e[$i(t)];return i===void 0||i.ts<r?null:i.status??null},aa=(e,t,n,r,i)=>{let a={...e[t]??{},...n,ts:i,mode:r};return{...e,[t]:a}},oa=`/api/review`,sa=`/api/triage`,ca=`/api/intmux`,la=(e,t,n,r,i)=>{if(r===`approve_and_merge`)return{pjcode:e,action:`approve_and_merge`,prUrl:n,projectItemId:t.projectItemId};if(r===`request_changes`){let r=i[0];return{pjcode:e,action:`request_changes`,prUrl:n,projectItemId:t.projectItemId,commentBody:I(i),...r===void 0?{}:{changedFilePath:r.path,line:r.line,side:r.side}}}return r===`totally_wrong`?{pjcode:e,action:`close`,prUrl:n,issueUrl:t.url,projectItemId:t.projectItemId,commentBody:P}:{pjcode:e,action:`unnecessary`,prUrl:n,projectItemId:t.projectItemId,issueUrl:t.url,commentBody:F,issueCommentBody:ce(n)}},ua=(e,t,n,r)=>({pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId,...r??{}}),da=(e,t)=>({pjcode:e,action:`set_intmux`,issueUrl:t.url,projectItemId:t.projectItemId}),fa=()=>Error(`No project specified in the URL path.`),pa=`ok`,ma=(e,t,n,r,i)=>{let{patchOverlay:a}=n,o=(0,y.useCallback)(e=>{if(r===void 0)return;let t=`${e.repo}#${e.number}`;r.body.invalidate(t),r.comments.invalidate(t)},[r]),s=(0,y.useCallback)(e=>{a($i(e),{done:!0},t)},[a,t]),c=(0,y.useCallback)(async(t,n,r,i=[])=>{if(e===null)throw fa();await Vr(oa,la(e,t,n,r,i)),s(t),o(t)},[e,s,o]),l=(0,y.useCallback)(async(t,n)=>{if(e===null)throw fa();let r={pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId};s(t),await Vr(sa,r),o(t)},[e,s,o]),u=(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();let i={pjcode:e,action:`set_agent`,issueUrl:n.url,projectItemId:n.projectItemId,agentOptionId:r.id};a($i(n),{done:!0},t),await Vr(sa,i),o(n)},[e,o,a,t]);return{reviewPullRequest:c,setNextActionDate:l,setStory:(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();let i={pjcode:e,action:`set_story`,issueUrl:n.url,projectItemId:n.projectItemId,storyOptionId:r.id};a($i(n),{done:!0,story:{name:r.name,color:r.color}},t),await Vr(sa,i),o(n)},[e,o,a,t]),setAgent:u,setStatus:(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();let i={pjcode:e,action:`set_status`,issueUrl:n.url,projectItemId:n.projectItemId,statusName:r.name};a($i(n),{done:!0,status:{name:r.name,color:r.color}},t),await Vr(sa,i),o(n)},[e,o,a,t]),setInTmuxByHuman:(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();let i={pjcode:e,action:`set_intmux`,issueUrl:n.url,projectItemId:n.projectItemId};a($i(n),{done:!0,status:{name:r.name,color:r.color}},t),await Vr(ca,i),o(n)},[e,o,a,t]),closeIssue:(0,y.useCallback)(async(t,n)=>{if(e===null)throw fa();let r={pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId};s(t),await Vr(sa,r),o(t)},[e,s,o]),okAndMoveToAwaitingWorkspace:(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();a($i(n),{done:!0,status:{name:r.name,color:r.color}},t);let s=await Wr({pjcode:e,url:n.url,body:pa});if(await Vr(sa,{pjcode:e,action:`set_status`,issueUrl:n.url,projectItemId:n.projectItemId,statusName:r.name}),o(n),await i?.(),!s.posted){let e=s.rateLimitResetAt===null?``:` Rate limit resets at ${s.rateLimitResetAt}.`;throw Error(`Comment not posted — ${s.error}.${e} Status was changed. Re-post: ${pa}`)}},[e,o,a,t,i]),addComment:(0,y.useCallback)(async(t,n)=>{if(e===null)throw fa();let r=await Wr({pjcode:e,url:t.url,body:n});if(!r.posted){let e=r.rateLimitResetAt===null?``:` Rate limit resets at ${r.rateLimitResetAt}.`;throw Error(`${r.error}.${e}`)}return o(t),r.comment},[e,o]),uploadAttachment:(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`no project in the URL path`);let r=Kr(new Uint8Array(await n.arrayBuffer()));return qr({pjcode:e,url:t.url,fileName:n.name,contentBase64:r})},[e]),addInlineReviewComment:(0,y.useCallback)(async(t,n,r,i,a)=>{if(e===null)throw fa();await Zr({pjcode:e,url:t,path:n,line:r,side:i,body:a})},[e]),deleteAllComments:(0,y.useCallback)(async e=>{await ai({issueUrl:e.url}),o(e)},[o]),setDependedIssueUrl:(0,y.useCallback)(async(t,n)=>{if(e===null)throw fa();await mi({pjcode:e,issueUrl:t.url,dependedIssueUrl:n})},[e])}},ha=e=>typeof e==`object`&&!!e&&typeof e.ts==`number`,ga=e=>{if(typeof localStorage>`u`)return{};let t=localStorage.getItem(Qi(e));if(t===null)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{};let r={};for(let[e,t]of Object.entries(n))ha(t)&&(r[e]=t);return r},_a=(e,t)=>{typeof localStorage<`u`&&localStorage.setItem(Qi(e),JSON.stringify(t))},va=e=>{let[t,n]=(0,y.useState)(()=>ga(e));return{overlay:t,patchOverlay:(0,y.useCallback)((t,r,i)=>{n(n=>{let a=aa(n,t,r,i,Date.now());return _a(e,a),a})},[e])}},ya=e=>{let t=e.split(`/`).filter(e=>e.length>0);if(t.length<2||t[0]!==`projects`)return null;let n=t[1];return n.length===0?null:n},ba=()=>{let[e,t]=(0,y.useState)(()=>ya(typeof window>`u`?``:window.location.pathname));return(0,y.useEffect)(()=>{let e=()=>{t(ya(window.location.pathname))};return window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`popstate`,e)}},[]),e},xa=()=>{let[e,t]=(0,y.useState)([]),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!0),[o,s]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let e=!1;return a(!0),s(null),ui().then(n=>{e||(t(n.pjcodes),r(n.workflowImprovementIssueUrl),a(!1))}).catch(t=>{e||(s(t instanceof Error?t:Error(String(t))),a(!1))}),()=>{e=!0}},[]),{pjcodes:e,workflowImprovementIssueUrl:n,isLoading:i,error:o}},Sa=()=>typeof window<`u`&&window.location.hash===`#settings`,Ca=e=>{let[t,n]=(0,y.useState)(Sa),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(``),d=(0,y.useRef)(``);(0,y.useEffect)(()=>{if(!t||e===null)return;let n=!1;return u(``),i(!0),c(null),fi(e).then(e=>{n||u(e.maximumPreparingIssuesCount===null?``:String(e.maximumPreparingIssuesCount))}).catch(e=>{n||c(e instanceof Error?e.message:`Failed to load settings`)}).finally(()=>{n||i(!1)}),()=>{n=!0}},[t,e]),(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=window.location.hash===Xi;e||c(null),n(e)};return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,e)}},[]);let f=(0,y.useCallback)(()=>{e!==null&&(typeof window<`u`&&(d.current=window.location.hash,window.history.pushState({},``,Xi)),n(!0))},[e]),p=(0,y.useCallback)(()=>{if(typeof window<`u`){let e=d.current,t=`${window.location.pathname}${window.location.search}${e}`;window.history.replaceState({},``,t)}n(!1),c(null)},[]),m=(0,y.useCallback)(e=>{u(e)},[]),h=(0,y.useCallback)(async t=>{if(e!==null){o(!0),c(null);try{if(await gi({pjcode:e,maximumPreparingIssuesCount:t}),typeof window<`u`){let e=d.current,t=`${window.location.pathname}${window.location.search}${e}`;window.history.replaceState({},``,t)}n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to save settings`)}finally{o(!1)}}},[e]);return(0,y.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&p()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,p]),{isOpen:t,isLoading:r,isSaving:a,error:s,inputValue:l,open:f,close:p,changeInput:m,save:h}},wa=e=>{let t=(0,y.useRef)(e),n=(0,y.useRef)(Date.now());return t.current!==e&&(t.current=e,n.current=Date.now()),{isTimerExpired:(0,y.useCallback)(e=>e<=0?!1:Date.now()-n.current>=e*60*1e3,[])}},Ta=/##\s+エグゼクティブサマリ(?:\s*\/\s*Executive\s+Summary)?\s*\n/i,Ea=/^From:\s+:robot:/m,Da=/^##\s/m,Oa=e=>{let t=Ta.exec(e);if(t===null)return null;let n=e.slice(t.index+t[0].length),r=Ea.exec(n),i=Da.exec(n),a=n.length;r!==null&&(a=Math.min(a,r.index)),i!==null&&(a=Math.min(a,i.index));let o=n.slice(0,a).trim();return o.length>0?o:null},ka=e=>{if(e.length===0)return null;let t=e[e.length-1],n=Oa(t.body);if(n!==null)return n;let r=t.body.trim();return r.length>0?r:null},Aa=e=>`${e.repo}#${e.number}`,ja=(e,t,n)=>{let[r,i]=(0,y.useState)({});return(0,y.useEffect)(()=>{if(!n)return;let r=!1;for(let n of e){let e=Aa(n),a=t.peek(e);if(a!==void 0){let e=ka(a);r||i(t=>t[n.projectItemId]===e?t:{...t,[n.projectItemId]:e});continue}t.load(e,n.url).then(e=>{if(r)return;let t=ka(e);i(e=>e[n.projectItemId]===t?e:{...e,[n.projectItemId]:t})}).catch(()=>{r||i(e=>e[n.projectItemId]===null?e:{...e,[n.projectItemId]:null})})}return()=>{r=!0}},[e,t,n]),r},Ma=(e,t)=>{let n=Math.abs(e);return n<60||n<=Math.abs(t)*1.5?null:e<0?`next`:`previous`},Na=(e,t)=>{let n=Math.abs(e),r=Math.abs(t);return r>n*1.5&&r>20},Pa=e=>{let t=e instanceof Element?e:null;for(;t!==null&&t!==document.body;){let e=window.getComputedStyle(t).overflowX;if((e===`auto`||e===`scroll`)&&t.scrollWidth>t.clientWidth&&t.scrollLeft>0)return!0;t=t.parentElement}return!1},Fa=e=>{let t=(0,y.useRef)(e);t.current=e;let n=(0,y.useRef)(null),r=(0,y.useCallback)(e=>{let n=0,r=0,i=!1,a=e=>{if(e.touches.length!==1){i=!1;return}if(Pa(e.target)){i=!1;return}let t=e.touches[0];n=t.clientX,r=t.clientY,i=!0},o=e=>{if(!i)return;let t=e.touches[0];Na(t.clientX-n,t.clientY-r)&&(i=!1)},s=e=>{if(!i||(i=!1,e.changedTouches.length!==1))return;let a=e.changedTouches[0],o=Ma(a.clientX-n,a.clientY-r);o!==null&&t.current(o)};return e.addEventListener(`touchstart`,a,{passive:!0}),e.addEventListener(`touchmove`,o,{passive:!0}),e.addEventListener(`touchend`,s,{passive:!0}),()=>{e.removeEventListener(`touchstart`,a),e.removeEventListener(`touchmove`,o),e.removeEventListener(`touchend`,s)}},[]),i=(0,y.useCallback)(e=>{n.current!==null&&(n.current(),n.current=null),e!==null&&(n.current=r(e))},[r]);return(0,y.useEffect)(()=>()=>{n.current!==null&&(n.current(),n.current=null)},[]),i},Ia=e=>typeof e==`object`&&!!e&&!Array.isArray(e),La=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Ra=e=>Array.isArray(e)?e.filter(Ia).map(e=>({...e,relatedOpenPullRequestUrls:La(e.relatedOpenPullRequestUrls)})):[],za=e=>!Ia(e)||!Array.isArray(e.items)?[]:Ra(e.items),Ba=e=>Array.isArray(e)?e.filter(Ia):[],Va=e=>Array.isArray(e)?e.filter(Ia).map(e=>({...e,items:Ra(e.items)})):[],Ha=e=>({items:za(e),generatedAt:Ia(e)&&typeof e.generatedAt==`string`?e.generatedAt:``,statusOptions:Ia(e)?Ba(e.statusOptions):[],agentOptions:Ia(e)?Ba(e.agentOptions):[],storyOptions:Ia(e)?Ba(e.storyOptions):[],storyColors:Ia(e)&&Ia(e.storyColors)?e.storyColors:{},stories:Ia(e)?Va(e.stories):[],defaultNameWithOwner:Ia(e)&&typeof e.defaultNameWithOwner==`string`?e.defaultNameWithOwner:null,storyOrder:Ia(e)?La(e.storyOrder):[],timerEndsAt:Ia(e)&&typeof e.timerEndsAt==`string`?e.timerEndsAt:null,timerTotalSeconds:Ia(e)&&typeof e.timerTotalSeconds==`number`&&e.timerTotalSeconds>0?e.timerTotalSeconds:null}),Ua=()=>{let e={};for(let t of ee)e[t.name]=null;return e},Wa=(e,t)=>`/projects/${e}/${t}/list.json`,Ga=6e4,Ka=`console-list-v1`,qa=(e,t)=>{try{if(!(`caches`in globalThis))return;globalThis.caches.open(Ka).then(n=>n.put(e,new Response(JSON.stringify(t),{headers:{"Content-Type":`application/json`}}))).catch(e=>{console.warn(`Failed to persist tab snapshot to cache:`,e)})}catch(e){console.warn(`Failed to access cache storage:`,e)}},Ja=async e=>{if(!(`caches`in globalThis))return null;try{let t=await(await globalThis.caches.open(Ka)).match(e);return t===void 0?null:{...Ha(await t.json()),fromCache:!0}}catch{return null}},Ya=async(e,t)=>{let n=Wa(e,t);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();return qa(n,t),{snapshot:{...Ha(t),fromCache:!1},error:null}}catch(e){let t=await Ja(n);return t===null?{snapshot:null,error:e instanceof Error?e:Error(String(e))}:{snapshot:t,error:null}}},Xa=async e=>{let t=await Promise.all(ee.map(async t=>{let{snapshot:n,error:r}=await Ya(e,t.name);return{tabName:t.name,snapshot:n,error:r}})),n=Ua(),r=null;for(let{tabName:e,snapshot:i,error:a}of t)n[e]=i,a!==null&&r===null&&(r=a);return{snapshots:n,firstError:Object.values(n).every(e=>e===null)?r:null}},Za=(e,t=null)=>{let[n,r]=(0,y.useState)(Ua),[i,a]=(0,y.useState)(!0),[o,s]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(t!==null&&e!==null){let n=t.tabs[e];if(n!==void 0){let e=Ua();for(let t of ee){let r=n[t.name];r!==void 0&&(e[t.name]={...r})}r(e),a(!1),s(null);return}}let n=!1;if(a(!0),s(null),e===null)return r(Ua()),a(!1),s(`No project specified in the URL path.`),()=>{n=!0};let i=()=>{Xa(e).then(({snapshots:e,firstError:t})=>{n||(r(e),s(t===null?null:t.message),a(!1))}).catch(e=>{n||(s(e instanceof Error?e.message:String(e)),a(!1))})};i();let o=setInterval(i,Ga);return()=>{n=!0,clearInterval(o)}},[e,t]),{snapshots:n,isLoading:i,error:o,refreshSingleTab:(0,y.useCallback)(async t=>{if(e===null)return;let{snapshot:n}=await Ya(e,t);n!==null&&r(e=>({...e,[t]:n}))},[e])}},Qa=`console-comment-expanded:`,$a=e=>{try{let t=localStorage.getItem(Qa+e);if(t===null)return new Set;let n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(e=>typeof e==`string`)):new Set}catch(e){return console.error(`Failed to load comment expanded state from storage:`,e),new Set}},eo=(e,t)=>{try{localStorage.setItem(Qa+e,JSON.stringify([...t]))}catch(e){console.error(`Failed to save comment expanded state to storage:`,e)}},to=()=>{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(Qa)&&e.push(n)}for(let t of e)localStorage.removeItem(t)},no=e=>(0,y.useCallback)(t=>{to(),e(t)},[e]),ro=`tdpm-timer-settings`,io=()=>({timerMode:!1,projectMinutes:{}}),ao=()=>{if(typeof localStorage>`u`)return io();let e=localStorage.getItem(ro);if(e===null)return io();try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return io();let n=t,r=typeof n.timerMode==`boolean`&&n.timerMode,i=n.projectMinutes;return{timerMode:r,projectMinutes:typeof i==`object`&&i&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).filter(([,e])=>typeof e==`number`).map(([e,t])=>[e,t])):{}}}catch{return io()}},oo=e=>{typeof localStorage<`u`&&localStorage.setItem(ro,JSON.stringify(e))},so=(e,t,n)=>{if(e.length===0)return null;let r=t===null?-1:e.indexOf(t),i=r===-1?0:(r+1)%e.length,a=r===-1?e.length:e.length-1;for(let t=0;t<a;t++){let r=e[(i+t)%e.length];if((n[r]??0)>0)return r}return null},co=()=>{let[e,t]=(0,y.useState)(ao),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(e),o=(0,y.useCallback)(()=>{t(e=>(a(e),e)),r(!0)},[]),s=(0,y.useCallback)(()=>{r(!1)},[]),c=(0,y.useCallback)(()=>{a(e=>(oo(e),t(e),e)),r(!1)},[]),l=(0,y.useCallback)(e=>{a(t=>({...t,timerMode:e}))},[]),u=(0,y.useCallback)((e,t)=>{a(n=>({...n,projectMinutes:{...n.projectMinutes,[e]:t}}))},[]);return{timerMode:e.timerMode,projectMinutes:e.projectMinutes,isOpen:n,draftTimerMode:i.timerMode,draftProjectMinutes:i.projectMinutes,openSettings:o,closeSettings:s,saveSettings:c,toggleDraftTimerMode:l,changeDraftMinutes:u}},lo=e=>{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`))},U=e=>{window.history.replaceState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`))},uo=(e,t)=>{let n=e.indexOf(t);if(n<0)return e.length>0?e[0]:null;let r=n+1;return r<e.length?e[r]:null},fo=(e,t)=>{let n=e.indexOf(t);return n<0||n>=e.length-1?null:e[n+1]},po=(e,t)=>{let n=e.indexOf(t);return n<=0?null:e[n-1]},mo=(e,t)=>e.length===0?`${t}\n`:e.endsWith(`
13
+ `);i=c.pop()??``;for(let e of c){if(!e.startsWith(`data: `))continue;let n=Sr(e.slice(6));if(n!==null){if(n.type===`progress`)r({fetched:typeof n.fetched==`number`?n.fetched:0,total:typeof n.total==`number`?n.total:0});else if(n.type===`done`){let e=br(n.snapshot);if(e===null){t(`error`),s([`Failed to parse snapshot`]);return}if(e.failures.length>0){s(e.failures),t(`error`);return}await rr(e),nr(!0),a(e),t(`on`),s([])}}}}}).catch(e=>{e instanceof Error&&e.name===`AbortError`||(t(`error`),s([e instanceof Error?e.message:String(e)]))})},[]),turnOff:(0,y.useCallback)(()=>{c.current!==null&&(c.current.abort(),c.current=null),t(`off`),a(null),r(null),s([]),nr(!1),ar().catch(()=>{})},[])}},wr=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Tr=e=>typeof e==`string`?e:``,Er=e=>typeof e==`number`?e:0,Dr=e=>e===!0,Or=`console-api-v1`,kr=async(e,t)=>{let n=`${e}?url=${encodeURIComponent(t)}`;try{let e=await fetch(n);if(!e.ok){let t=`HTTP ${e.status}`;try{let n=await e.json();wr(n)&&typeof n.error==`string`&&n.error.length>0&&(t=n.error)}catch(e){console.warn(`Failed to parse error body from non-ok response:`,e)}throw Error(t)}let t=await e.json();try{`caches`in globalThis&&globalThis.caches.open(Or).then(e=>e.put(n,new Response(JSON.stringify(t),{headers:{"Content-Type":`application/json`}}))).catch(e=>{console.warn(`Failed to persist API response to cache:`,e)})}catch(e){console.warn(`Failed to access cache storage:`,e)}return t}catch(e){try{if(`caches`in globalThis){let e=await(await globalThis.caches.open(Or)).match(n);if(e!==void 0)return e.json()}}catch{}throw e}},Ar=e=>!wr(e)||!Array.isArray(e.comments)?[]:e.comments.filter(wr).map(e=>({author:Tr(e.author),body:Tr(e.body),createdAt:Tr(e.createdAt),url:typeof e.url==`string`?e.url:null})),jr=e=>!wr(e)||!Array.isArray(e.files)?[]:e.files.filter(wr).map(e=>({path:Tr(e.path)||Tr(e.filename),additions:Er(e.additions),deletions:Er(e.deletions),status:Tr(e.status),patch:typeof e.patch==`string`?e.patch:null,rawUrl:typeof e.rawUrl==`string`?e.rawUrl:null})),Mr=e=>!wr(e)||!Array.isArray(e.commits)?[]:e.commits.filter(wr).map(e=>({sha:Tr(e.sha),message:Tr(e.message),author:Tr(e.author),authoredAt:Tr(e.authoredAt)})),Nr=e=>wr(e)?{title:Tr(e.title),body:Tr(e.body),additions:Er(e.additions),deletions:Er(e.deletions),changedFiles:Er(e.changedFiles)}:null,Pr=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Fr=e=>e===`MERGEABLE`?`MERGEABLE`:e===`CONFLICTING`?`CONFLICTING`:`UNKNOWN`,Ir=e=>!wr(e)||!Array.isArray(e.relatedPullRequests)?[]:e.relatedPullRequests.filter(wr).map(e=>({url:Tr(e.url),branchName:typeof e.branchName==`string`?e.branchName:null,createdAt:Tr(e.createdAt),isDraft:Dr(e.isDraft),isConflicted:Dr(e.isConflicted),mergeableStatus:Fr(e.mergeableStatus),isPassedAllCiJob:Dr(e.isPassedAllCiJob),isCiStateSuccess:Dr(e.isCiStateSuccess),isResolvedAllReviewComments:Dr(e.isResolvedAllReviewComments),isBranchOutOfDate:Dr(e.isBranchOutOfDate),missingRequiredCheckNames:Pr(e.missingRequiredCheckNames),summary:Nr(e.summary)})),Lr=e=>{if(!wr(e)||!wr(e.status))return{found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]};let t=e.status;return{found:!0,isConflicted:Dr(t.isConflicted),mergeableStatus:Fr(t.mergeableStatus),isPassedAllCiJob:Dr(t.isPassedAllCiJob),isCiStateSuccess:Dr(t.isCiStateSuccess),isBranchOutOfDate:Dr(t.isBranchOutOfDate),missingRequiredCheckNames:Pr(t.missingRequiredCheckNames)}},Rr=e=>wr(e)?{state:Tr(e.state)||`open`,merged:Dr(e.merged),isPullRequest:Dr(e.isPullRequest),title:Tr(e.title)}:{state:`open`,merged:!1,isPullRequest:!1,title:``},zr=()=>({fetchItemBody:async e=>{let t=await kr(`/api/itembody`,e);return wr(t)?Tr(t.body):``},fetchComments:async e=>Ar(await kr(`/api/comments`,e)),fetchPrFiles:async e=>jr(await kr(`/api/prfiles`,e)),fetchPrCommits:async e=>Mr(await kr(`/api/prcommits`,e)),fetchRelatedPrs:async e=>Ir(await kr(`/api/relatedprs`,e)),fetchIssueState:async e=>Rr(await kr(`/api/issuetitle`,e)),fetchPullRequestStatus:async e=>Lr(await kr(`/api/pullrequeststatus`,e))}),Br=async e=>{let t=await e.text().catch(()=>``);if(t.length===0)return`HTTP ${e.status}`;try{let e=JSON.parse(t);if(wr(e)&&typeof e.error==`string`)return e.error}catch{return t}return t},Vr=async(e,t)=>{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(await Br(n))},Hr=`/api/comment`,Ur=e=>({author:Tr(e.author),body:Tr(e.body),createdAt:Tr(e.createdAt),url:typeof e.url==`string`?e.url:null}),Wr=async e=>{let t=await fetch(Hr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{posted:!1,error:await Br(t),rateLimitResetAt:null};let n=await t.json();return wr(n)?n.ok===!1?{posted:!1,error:typeof n.error==`string`?n.error:`upstream error`,rateLimitResetAt:typeof n.rateLimitResetAt==`string`?n.rateLimitResetAt:null}:wr(n.comment)?{posted:!0,comment:Ur(n.comment)}:{posted:!1,error:`comment was not returned`,rateLimitResetAt:null}:{posted:!1,error:`unexpected response shape`,rateLimitResetAt:null}},Gr=`/api/upload`,Kr=e=>{let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)},qr=async e=>{let t=await fetch(Gr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t));let n=await t.json();if(!wr(n)||typeof n.markdown!=`string`)throw Error(`markdown was not returned`);return n.markdown},Jr=`/api/addstory`,Yr=async e=>{let t=await fetch(Jr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},Xr=`/api/reviewcomment`,Zr=async e=>{let t=await fetch(Xr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},Qr=`/api/createissue`,$r=`/api/storycolor`,ei=async e=>{let t=await fetch($r,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},ti=async e=>{let t=await fetch(Qr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t));let n=await t.json();if(!(e=>typeof e==`object`&&!!e&&!Array.isArray(e))(n)||typeof n.issueUrl!=`string`)throw Error(`issueUrl was not returned`);return n.issueUrl},ni=`/api/reorderstory`,ri=async e=>{let t=await fetch(ni,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},ii=`/api/deleteallcomments`,ai=async e=>{let t=await fetch(ii,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},oi=`/api/deletestory`,si=async e=>{let t=await fetch(oi,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},ci=`/api/renamestory`,li=async e=>{let t=await fetch(ci,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},ui=async()=>{let e=await fetch(`/api/projects`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if(typeof t!=`object`||!t||Array.isArray(t))return{pjcodes:[],workflowImprovementIssueUrl:null};let n=t;return{pjcodes:Array.isArray(n.pjcodes)?n.pjcodes.filter(e=>typeof e==`string`):[],workflowImprovementIssueUrl:typeof n.workflowImprovementIssueUrl==`string`?n.workflowImprovementIssueUrl:null}},di=`/api/projectreadmeconfig`,fi=async e=>{let t=`${di}?pjcode=${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(await Br(n));let r=await n.json();return{maximumPreparingIssuesCount:wr(r)&&typeof r.maximumPreparingIssuesCount==`number`?r.maximumPreparingIssuesCount:null}},pi=`/api/setdependedissueurl`,mi=async e=>{let t=await fetch(pi,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},hi=`/api/projectsettings`,gi=async e=>{let t=await fetch(hi,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Br(t))},_i=5e3,vi=e=>`${e.isPr?`PR #`:`#`}${e.number}`,yi=(e,t)=>{switch(e.type){case`review`:return e.action===`approve_and_merge`?`Approved & Merged`:e.action===`request_changes`?`Rejected`:e.action===`totally_wrong`?`Marked totally wrong`:`Marked unnecessary`;case`next_action_date`:return e.action===`snooze_1hour`?`Next Action Hour +1 hour`:e.action===`snooze_3hours`?`Next Action Hour +3 hours`:e.action===`snooze_6hours`?`Next Action Hour +6 hours`:e.action===`snooze_1day`?`Next Action Date +1 day`:e.action===`snooze_2days`?`Next Action Date +2 days`:e.action===`snooze_3days`?`Next Action Date +3 days`:e.action===`snooze_5days`?`Next Action Date +5 days`:e.action===`snooze_1month`?`Next Action Date +1 month`:L(t)?`Next Action Date +1 week and skip`:`Next Action Date +1 week`;case`set_story`:return`Story → ${e.optionName}`;case`set_agent`:return`Agent → ${e.optionName}`;case`set_status`:return`Status → ${e.optionName}`;case`set_in_tmux_by_human`:return`Added to In Tmux by human`;case`ok_and_awaiting_workspace`:return`ok → Awaiting Workspace`;case`close`:return e.action===`close`?`Closed`:`Closed as not planned`;case`delete_all_comments`:return`Deleted all comments`}},bi=e=>{switch(e.type){case`review`:return e.action===`approve_and_merge`?`green`:e.action===`request_changes`?`amber`:e.action===`totally_wrong`?`red`:`gray`;case`next_action_date`:return`amber`;case`set_story`:case`set_agent`:case`set_status`:case`set_in_tmux_by_human`:case`ok_and_awaiting_workspace`:return`blue`;case`close`:return`red`;case`delete_all_comments`:return`red`}},xi=(e,t)=>e.type===`next_action_date`?L(t):e.type!==`delete_all_comments`,Si=(e,t,n)=>`${yi(e,n)} — ${vi(t)}`,Ci=`console-offline-action-queue`,wi=e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.message==`string`&&typeof t.color==`string`&&typeof t.enqueuedAt==`number`&&typeof t.itemUrl==`string`&&typeof t.projectItemId==`string`&&typeof t.itemNumber==`number`&&typeof t.repo==`string`&&typeof t.isPr==`boolean`&&typeof t.apiPath==`string`&&typeof t.requestBody==`object`&&t.requestBody!==null},Ti=()=>{try{let e=localStorage.getItem(Ci);if(e===null)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(wi):[]}catch{return[]}},Ei=e=>{localStorage.setItem(Ci,JSON.stringify(e))},Di=()=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`,Oi=e=>e instanceof TypeError,ki=e=>e instanceof Error&&e.message.length>0?e.message:String(e),Ai=100,ji=e=>Math.max(0,Math.ceil((_i-e)/1e3)),H=e=>Math.max(0,1-e/_i),Mi=()=>{let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(Ti),o=(0,y.useRef)(i);o.current=i;let s=(0,y.useRef)(null),c=(0,y.useRef)(0),l=(0,y.useRef)(null),u=(0,y.useRef)(!1),d=(0,y.useCallback)(()=>{l.current!==null&&(clearInterval(l.current),l.current=null)},[]),f=(0,y.useCallback)(e=>{if(e.offline===void 0)return;let t={id:Di(),message:e.message,color:e.color,enqueuedAt:Date.now(),...e.offline};a(e=>{let n=[...e,t];return Ei(n),n})},[]),p=(0,y.useCallback)(e=>{e.commit().catch(t=>{Oi(t)&&e.offline!==void 0?f(e):r({message:e.message,reason:ki(t)})})},[f]),m=(0,y.useCallback)(()=>{let e=s.current;d(),s.current=null,t(null),e!==null&&!u.current&&(u.current=!0,p(e))},[d,p]),h=(0,y.useCallback)(()=>{let e=s.current;d(),s.current=null,u.current=!0,t(null),e?.revertAdvance?.()},[d]),g=(0,y.useCallback)(()=>{r(null)},[]),_=(0,y.useCallback)((e,t)=>{r({message:e,reason:t})},[]),v=(0,y.useCallback)(e=>{a(t=>{let n=t.filter(t=>t.id!==e);return Ei(n),n})},[]),b=(0,y.useCallback)(async e=>{let t=o.current.find(t=>t.id===e);if(t!==void 0)try{await Vr(t.apiPath,t.requestBody),v(e)}catch(n){Oi(n)?r({message:t.message,reason:`Still offline — action is still held in the queue`}):(r({message:t.message,reason:ki(n)}),v(e))}},[v]),x=(0,y.useCallback)(e=>{if(s.current!==null&&!u.current){let e=s.current;d(),u.current=!0,p(e)}u.current=!1,s.current=e,c.current=Date.now(),t({message:e.message,color:e.color,remainingSeconds:ji(0),progress:H(0)}),e.advance(),l.current=setInterval(()=>{let n=Date.now()-c.current;if(n>=5e3){m();return}t({message:e.message,color:e.color,remainingSeconds:ji(n),progress:H(n)})},Ai)},[d,m,p]);return(0,y.useEffect)(()=>d,[d]),{pending:e,error:n,offlineActions:i,enqueue:x,showError:_,undo:h,dismissError:g,confirmOfflineAction:b,discardOfflineAction:v}},Ni=class{fetcher;cache=new Map;inFlight=new Map;prefetchInFlight=new Set;constructor(e){this.fetcher=e}peek=e=>this.cache.get(e);has=e=>this.cache.has(e);load=(e,t)=>{let n=this.cache.get(e);if(n!==void 0)return Promise.resolve(n);let r=this.inFlight.get(e);if(r!==void 0)return r;let i=this.fetcher(t).then(t=>(this.cache.set(e,t),t)).finally(()=>{this.inFlight.delete(e)});return this.inFlight.set(e,i),i};prefetch=(e,t)=>{this.cache.has(e)||this.inFlight.has(e)||this.prefetchInFlight.has(e)||(this.prefetchInFlight.add(e),this.fetcher(t).then(t=>{this.cache.set(e,t)}).catch(()=>{}).finally(()=>{this.prefetchInFlight.delete(e)}))};seed(e,t){this.cache.set(e,t)}invalidate=e=>{this.cache.delete(e)}},Pi=e=>{try{let t=new URL(e).pathname.split(`/`).filter(Boolean);if(t.length>=4)return`${t[0]}/${t[1]}#${t[3]}`}catch{}return e},Fi=(e,t)=>{for(let[n,r]of Object.entries(t.items)){let t=Pi(n);e.body.seed(t,r.body),e.comments.seed(t,r.comments),e.state.seed(t,r.state),r.files!==null&&e.files.seed(t,r.files),r.commits!==null&&e.commits.seed(t,r.commits),r.prStatus!==null&&e.prStatus.seed(t,r.prStatus),r.relatedPrs!==null&&e.relatedPrs.seed(t,r.relatedPrs)}},Ii=(e=null)=>(0,y.useMemo)(()=>{let t=zr(),n={client:t,body:new Ni(t.fetchItemBody),comments:new Ni(t.fetchComments),files:new Ni(t.fetchPrFiles),commits:new Ni(t.fetchPrCommits),relatedPrs:new Ni(t.fetchRelatedPrs),state:new Ni(t.fetchIssueState),prStatus:new Ni(t.fetchPullRequestStatus)};return e!==null&&Fi(n,e),n},[e]),Li=0,Ri=500,zi=2e3,Bi=e=>{let t=window;if(typeof t.requestIdleCallback==`function`&&typeof t.cancelIdleCallback==`function`){let n=t.requestIdleCallback(e,{timeout:zi});return{cancel:()=>t.cancelIdleCallback?.(n)}}let n=window.setTimeout(e,0);return{cancel:()=>window.clearTimeout(n)}},Vi=(e,t)=>{let n=`${t.repo}#${t.number}`;e.body.prefetch(n,t.url),e.state.prefetch(n,t.url),e.comments.prefetch(n,t.url),t.isPr?(e.files.prefetch(n,t.url),e.commits.prefetch(n,t.url),e.prStatus.prefetch(n,t.url)):e.relatedPrs.prefetch(n,t.url)},Hi=(e,t,n)=>{(0,y.useEffect)(()=>{if(t===null)return;let r=n.findIndex(e=>e.projectItemId===t.projectItemId);if(r===-1)return;let i=n.slice(r+1,r+1+Li);if(i.length===0)return;let a=null,o=window.setTimeout(()=>{a=Bi(()=>{for(let t of i)Vi(e,t)})},Ri);return()=>{window.clearTimeout(o),a?.cancel()}},[e,t,n])},Ui=`/api/features`,Wi=()=>{let[e,t]=(0,y.useState)({airplaneMode:!1});return(0,y.useEffect)(()=>{fetch(Ui).then(async e=>{if(!e.ok)return;let n=await e.json();typeof n==`object`&&n&&!Array.isArray(n)&&`airplaneMode`in n&&typeof n.airplaneMode==`boolean`&&t({airplaneMode:n.airplaneMode})}).catch(e=>{console.warn(`Failed to fetch /api/features`,e)})},[]),e},Gi=(e,t)=>{let n=ee.findIndex(t=>t.name===e);if(n===-1)return null;for(let e=n+1;e<ee.length;e+=1){let n=ee[e].name;if((t[n]??0)>0)return n}return null},Ki=e=>{for(let t of ee)if((e[t.name]??0)>0)return t.name;return ee[0].name},qi=new Set(ee.map(e=>e.name)),Ji=e=>{let t=e.split(`/`).filter(e=>e.length>0);if(t.length<3||t[0]!==`projects`)return null;let n=t[2];return qi.has(n)?n:null},Yi=e=>{if(!e.startsWith(`#item/`))return null;let t=e.slice(6);return t.length===0?null:decodeURIComponent(t)},Xi=`#settings`,Zi=(e,t)=>{let n=(0,y.useCallback)(()=>{let e=Ki(t);return typeof window>`u`?{activeTab:e,selectedItemKey:null}:{activeTab:Ji(window.location.pathname)??e,selectedItemKey:Yi(window.location.hash)}},[t]),[r,i]=(0,y.useState)(n);(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{i(n())};return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,e)}},[n]),(0,y.useEffect)(()=>{if(typeof window>`u`||Ji(window.location.pathname)!==null)return;let e=Ki(t);i(t=>t.activeTab===e?t:{...t,activeTab:e})},[t]);let a=(0,y.useCallback)(t=>e===null?`#${t}`:`/projects/${e}/${t}`,[e]),o=(0,y.useCallback)(e=>{if(typeof window>`u`){i({activeTab:e,selectedItemKey:null});return}window.history.pushState({},``,a(e)),i({activeTab:e,selectedItemKey:null})},[a]),s=(0,y.useCallback)(e=>{typeof window<`u`&&(window.location.hash=`#item/${encodeURIComponent(e)}`),i(t=>({...t,selectedItemKey:e}))},[]),c=(0,y.useCallback)(()=>{if(typeof window<`u`&&window.location.hash!==``){let e=`${window.location.pathname}${window.location.search}`;window.history.pushState({},``,e)}i(e=>({...e,selectedItemKey:null}))},[]);return{activeTab:r.activeTab,selectedItemKey:r.selectedItemKey,tabHref:a,selectTab:o,openItem:s,closeItem:c}},Qi=e=>`pv_overlay_${e}`,$i=e=>e.projectItemId===``?e.itemId:e.projectItemId,ea=(e,t)=>e!==void 0&&e.done===!0&&e.mode===t,ta=(e,t,n)=>e.filter(e=>!ea(t[$i(e)],n)).length,na=(e,t,n)=>e.filter(e=>!ea(t[$i(e)],n)),ra=(e,t)=>{let n=Date.parse(t);if(Number.isNaN(n))return{};let r={};for(let[t,i]of Object.entries(e))i.ts>=n&&(r[t]=i);return r},ia=(e,t,n)=>{if(n===null)return null;let r=Date.parse(n);if(Number.isNaN(r))return null;let i=e[$i(t)];return i===void 0||i.ts<r?null:i.status??null},aa=(e,t,n,r,i)=>{let a={...e[t]??{},...n,ts:i,mode:r};return{...e,[t]:a}},oa=`/api/review`,sa=`/api/triage`,ca=`/api/intmux`,la=(e,t,n,r,i)=>{if(r===`approve_and_merge`)return{pjcode:e,action:`approve_and_merge`,prUrl:n,projectItemId:t.projectItemId};if(r===`request_changes`){let r=i[0];return{pjcode:e,action:`request_changes`,prUrl:n,projectItemId:t.projectItemId,commentBody:I(i),...r===void 0?{}:{changedFilePath:r.path,line:r.line,side:r.side}}}return r===`totally_wrong`?{pjcode:e,action:`close`,prUrl:n,issueUrl:t.url,projectItemId:t.projectItemId,commentBody:P}:{pjcode:e,action:`unnecessary`,prUrl:n,projectItemId:t.projectItemId,issueUrl:t.url,commentBody:F,issueCommentBody:ce(n)}},ua=(e,t,n,r)=>({pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId,...r??{}}),da=(e,t)=>({pjcode:e,action:`set_intmux`,issueUrl:t.url,projectItemId:t.projectItemId}),fa=()=>Error(`No project specified in the URL path.`),pa=`ok`,ma=(e,t,n,r,i)=>{let{patchOverlay:a}=n,o=(0,y.useCallback)(e=>{if(r===void 0)return;let t=`${e.repo}#${e.number}`;r.body.invalidate(t),r.comments.invalidate(t)},[r]),s=(0,y.useCallback)(e=>{a($i(e),{done:!0},t)},[a,t]),c=(0,y.useCallback)(async(t,n,r,i=[])=>{if(e===null)throw fa();await Vr(oa,la(e,t,n,r,i)),s(t),o(t)},[e,s,o]),l=(0,y.useCallback)(async(t,n)=>{if(e===null)throw fa();let r={pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId};s(t),await Vr(sa,r),o(t)},[e,s,o]),u=(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();let i={pjcode:e,action:`set_agent`,issueUrl:n.url,projectItemId:n.projectItemId,agentOptionId:r.id};a($i(n),{done:!0},t),await Vr(sa,i),o(n)},[e,o,a,t]);return{reviewPullRequest:c,setNextActionDate:l,setStory:(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();let i={pjcode:e,action:`set_story`,issueUrl:n.url,projectItemId:n.projectItemId,storyOptionId:r.id};a($i(n),{done:!0,story:{name:r.name,color:r.color}},t),await Vr(sa,i),o(n)},[e,o,a,t]),setAgent:u,setStatus:(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();let i={pjcode:e,action:`set_status`,issueUrl:n.url,projectItemId:n.projectItemId,statusName:r.name};a($i(n),{done:!0,status:{name:r.name,color:r.color}},t),await Vr(sa,i),o(n)},[e,o,a,t]),setInTmuxByHuman:(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();let i={pjcode:e,action:`set_intmux`,issueUrl:n.url,projectItemId:n.projectItemId};a($i(n),{done:!0,status:{name:r.name,color:r.color}},t),await Vr(ca,i),o(n)},[e,o,a,t]),closeIssue:(0,y.useCallback)(async(t,n)=>{if(e===null)throw fa();let r={pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId};s(t),await Vr(sa,r),o(t)},[e,s,o]),okAndMoveToAwaitingWorkspace:(0,y.useCallback)(async(n,r)=>{if(e===null)throw fa();a($i(n),{done:!0,status:{name:r.name,color:r.color}},t);let s=await Wr({pjcode:e,url:n.url,body:pa});if(await Vr(sa,{pjcode:e,action:`set_status`,issueUrl:n.url,projectItemId:n.projectItemId,statusName:r.name}),o(n),await i?.(),!s.posted){let e=s.rateLimitResetAt===null?``:` Rate limit resets at ${s.rateLimitResetAt}.`;throw Error(`Comment not posted — ${s.error}.${e} Status was changed. Re-post: ${pa}`)}},[e,o,a,t,i]),addComment:(0,y.useCallback)(async(t,n)=>{if(e===null)throw fa();let r=await Wr({pjcode:e,url:t.url,body:n});if(!r.posted){let e=r.rateLimitResetAt===null?``:` Rate limit resets at ${r.rateLimitResetAt}.`;throw Error(`${r.error}.${e}`)}return o(t),r.comment},[e,o]),uploadAttachment:(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`no project in the URL path`);let r=Kr(new Uint8Array(await n.arrayBuffer()));return qr({pjcode:e,url:t.url,fileName:n.name,contentBase64:r})},[e]),addInlineReviewComment:(0,y.useCallback)(async(t,n,r,i,a)=>{if(e===null)throw fa();await Zr({pjcode:e,url:t,path:n,line:r,side:i,body:a})},[e]),deleteAllComments:(0,y.useCallback)(async e=>{await ai({issueUrl:e.url}),o(e)},[o]),setDependedIssueUrl:(0,y.useCallback)(async(t,n)=>{if(e===null)throw fa();await mi({pjcode:e,issueUrl:t.url,dependedIssueUrl:n})},[e])}},ha=e=>typeof e==`object`&&!!e&&typeof e.ts==`number`,ga=e=>{if(typeof localStorage>`u`)return{};let t=localStorage.getItem(Qi(e));if(t===null)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{};let r={};for(let[e,t]of Object.entries(n))ha(t)&&(r[e]=t);return r},_a=(e,t)=>{typeof localStorage<`u`&&localStorage.setItem(Qi(e),JSON.stringify(t))},va=e=>{let[t,n]=(0,y.useState)(()=>ga(e));return{overlay:t,patchOverlay:(0,y.useCallback)((t,r,i)=>{n(n=>{let a=aa(n,t,r,i,Date.now());return _a(e,a),a})},[e])}},ya=e=>{let t=e.split(`/`).filter(e=>e.length>0);if(t.length<2||t[0]!==`projects`)return null;let n=t[1];return n.length===0?null:n},ba=()=>{let[e,t]=(0,y.useState)(()=>ya(typeof window>`u`?``:window.location.pathname));return(0,y.useEffect)(()=>{let e=()=>{t(ya(window.location.pathname))};return window.addEventListener(`popstate`,e),()=>{window.removeEventListener(`popstate`,e)}},[]),e},xa=()=>{let[e,t]=(0,y.useState)([]),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!0),[o,s]=(0,y.useState)(null);return(0,y.useEffect)(()=>{let e=!1;return a(!0),s(null),ui().then(n=>{e||(t(n.pjcodes),r(n.workflowImprovementIssueUrl),a(!1))}).catch(t=>{e||(s(t instanceof Error?t:Error(String(t))),a(!1))}),()=>{e=!0}},[]),{pjcodes:e,workflowImprovementIssueUrl:n,isLoading:i,error:o}},Sa=()=>typeof window<`u`&&window.location.hash===`#settings`,Ca=e=>{let[t,n]=(0,y.useState)(Sa),[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(``),d=(0,y.useRef)(``);(0,y.useEffect)(()=>{if(!t||e===null)return;let n=!1;return u(``),i(!0),c(null),fi(e).then(e=>{n||u(e.maximumPreparingIssuesCount===null?``:String(e.maximumPreparingIssuesCount))}).catch(e=>{n||c(e instanceof Error?e.message:`Failed to load settings`)}).finally(()=>{n||i(!1)}),()=>{n=!0}},[t,e]),(0,y.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=window.location.hash===Xi;e||c(null),n(e)};return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,e)}},[]);let f=(0,y.useCallback)(()=>{e!==null&&(typeof window<`u`&&(d.current=window.location.hash,window.history.pushState({},``,Xi)),n(!0))},[e]),p=(0,y.useCallback)(()=>{if(typeof window<`u`){let e=d.current,t=`${window.location.pathname}${window.location.search}${e}`;window.history.replaceState({},``,t)}n(!1),c(null)},[]),m=(0,y.useCallback)(e=>{u(e)},[]),h=(0,y.useCallback)(async t=>{if(e!==null){o(!0),c(null);try{if(await gi({pjcode:e,maximumPreparingIssuesCount:t}),typeof window<`u`){let e=d.current,t=`${window.location.pathname}${window.location.search}${e}`;window.history.replaceState({},``,t)}n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to save settings`)}finally{o(!1)}}},[e]);return(0,y.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&p()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,p]),{isOpen:t,isLoading:r,isSaving:a,error:s,inputValue:l,open:f,close:p,changeInput:m,save:h}},wa=e=>{let t=(0,y.useRef)(e),n=(0,y.useRef)(Date.now());return t.current!==e&&(t.current=e,n.current=Date.now()),{isTimerExpired:(0,y.useCallback)(e=>e<=0?!1:Date.now()-n.current>=e*60*1e3,[])}},Ta=/##\s+(?:エグゼクティブサマリ(?:\s*\/\s*Executive\s+Summary)?|Executive\s+Summary)\s*\n/i,Ea=/^From:\s+:robot:/m,Da=/^##\s/m,Oa=e=>{let t=Ta.exec(e);if(t===null)return null;let n=e.slice(t.index+t[0].length),r=Ea.exec(n),i=Da.exec(n),a=n.length;r!==null&&(a=Math.min(a,r.index)),i!==null&&(a=Math.min(a,i.index));let o=n.slice(0,a).trim();return o.length>0?o:null},ka=e=>{if(e.length===0)return null;let t=e[e.length-1],n=Oa(t.body);if(n!==null)return n;let r=t.body.trim();return r.length>0?r:null},Aa=e=>`${e.repo}#${e.number}`,ja=(e,t,n)=>{let[r,i]=(0,y.useState)({});return(0,y.useEffect)(()=>{if(!n)return;let r=!1;for(let n of e){let e=Aa(n),a=t.peek(e);if(a!==void 0){let e=ka(a);r||i(t=>t[n.projectItemId]===e?t:{...t,[n.projectItemId]:e});continue}t.load(e,n.url).then(e=>{if(r)return;let t=ka(e);i(e=>e[n.projectItemId]===t?e:{...e,[n.projectItemId]:t})}).catch(()=>{r||i(e=>e[n.projectItemId]===null?e:{...e,[n.projectItemId]:null})})}return()=>{r=!0}},[e,t,n]),r},Ma=(e,t)=>{let n=Math.abs(e);return n<60||n<=Math.abs(t)*1.5?null:e<0?`next`:`previous`},Na=(e,t)=>{let n=Math.abs(e),r=Math.abs(t);return r>n*1.5&&r>20},Pa=e=>{let t=e instanceof Element?e:null;for(;t!==null&&t!==document.body;){let e=window.getComputedStyle(t).overflowX;if((e===`auto`||e===`scroll`)&&t.scrollWidth>t.clientWidth&&t.scrollLeft>0)return!0;t=t.parentElement}return!1},Fa=e=>{let t=(0,y.useRef)(e);t.current=e;let n=(0,y.useRef)(null),r=(0,y.useCallback)(e=>{let n=0,r=0,i=!1,a=e=>{if(e.touches.length!==1){i=!1;return}if(Pa(e.target)){i=!1;return}let t=e.touches[0];n=t.clientX,r=t.clientY,i=!0},o=e=>{if(!i)return;let t=e.touches[0];Na(t.clientX-n,t.clientY-r)&&(i=!1)},s=e=>{if(!i||(i=!1,e.changedTouches.length!==1))return;let a=e.changedTouches[0],o=Ma(a.clientX-n,a.clientY-r);o!==null&&t.current(o)};return e.addEventListener(`touchstart`,a,{passive:!0}),e.addEventListener(`touchmove`,o,{passive:!0}),e.addEventListener(`touchend`,s,{passive:!0}),()=>{e.removeEventListener(`touchstart`,a),e.removeEventListener(`touchmove`,o),e.removeEventListener(`touchend`,s)}},[]),i=(0,y.useCallback)(e=>{n.current!==null&&(n.current(),n.current=null),e!==null&&(n.current=r(e))},[r]);return(0,y.useEffect)(()=>()=>{n.current!==null&&(n.current(),n.current=null)},[]),i},Ia=e=>typeof e==`object`&&!!e&&!Array.isArray(e),La=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Ra=e=>Array.isArray(e)?e.filter(Ia).map(e=>({...e,relatedOpenPullRequestUrls:La(e.relatedOpenPullRequestUrls)})):[],za=e=>!Ia(e)||!Array.isArray(e.items)?[]:Ra(e.items),Ba=e=>Array.isArray(e)?e.filter(Ia):[],Va=e=>Array.isArray(e)?e.filter(Ia).map(e=>({...e,items:Ra(e.items)})):[],Ha=e=>({items:za(e),generatedAt:Ia(e)&&typeof e.generatedAt==`string`?e.generatedAt:``,statusOptions:Ia(e)?Ba(e.statusOptions):[],agentOptions:Ia(e)?Ba(e.agentOptions):[],storyOptions:Ia(e)?Ba(e.storyOptions):[],storyColors:Ia(e)&&Ia(e.storyColors)?e.storyColors:{},stories:Ia(e)?Va(e.stories):[],defaultNameWithOwner:Ia(e)&&typeof e.defaultNameWithOwner==`string`?e.defaultNameWithOwner:null,storyOrder:Ia(e)?La(e.storyOrder):[],timerEndsAt:Ia(e)&&typeof e.timerEndsAt==`string`?e.timerEndsAt:null,timerTotalSeconds:Ia(e)&&typeof e.timerTotalSeconds==`number`&&e.timerTotalSeconds>0?e.timerTotalSeconds:null}),Ua=()=>{let e={};for(let t of ee)e[t.name]=null;return e},Wa=(e,t)=>`/projects/${e}/${t}/list.json`,Ga=6e4,Ka=`console-list-v1`,qa=(e,t)=>{try{if(!(`caches`in globalThis))return;globalThis.caches.open(Ka).then(n=>n.put(e,new Response(JSON.stringify(t),{headers:{"Content-Type":`application/json`}}))).catch(e=>{console.warn(`Failed to persist tab snapshot to cache:`,e)})}catch(e){console.warn(`Failed to access cache storage:`,e)}},Ja=async e=>{if(!(`caches`in globalThis))return null;try{let t=await(await globalThis.caches.open(Ka)).match(e);return t===void 0?null:{...Ha(await t.json()),fromCache:!0}}catch{return null}},Ya=async(e,t)=>{let n=Wa(e,t);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();return qa(n,t),{snapshot:{...Ha(t),fromCache:!1},error:null}}catch(e){let t=await Ja(n);return t===null?{snapshot:null,error:e instanceof Error?e:Error(String(e))}:{snapshot:t,error:null}}},Xa=async e=>{let t=await Promise.all(ee.map(async t=>{let{snapshot:n,error:r}=await Ya(e,t.name);return{tabName:t.name,snapshot:n,error:r}})),n=Ua(),r=null;for(let{tabName:e,snapshot:i,error:a}of t)n[e]=i,a!==null&&r===null&&(r=a);return{snapshots:n,firstError:Object.values(n).every(e=>e===null)?r:null}},Za=(e,t=null)=>{let[n,r]=(0,y.useState)(Ua),[i,a]=(0,y.useState)(!0),[o,s]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(t!==null&&e!==null){let n=t.tabs[e];if(n!==void 0){let e=Ua();for(let t of ee){let r=n[t.name];r!==void 0&&(e[t.name]={...r})}r(e),a(!1),s(null);return}}let n=!1;if(a(!0),s(null),e===null)return r(Ua()),a(!1),s(`No project specified in the URL path.`),()=>{n=!0};let i=()=>{Xa(e).then(({snapshots:e,firstError:t})=>{n||(r(e),s(t===null?null:t.message),a(!1))}).catch(e=>{n||(s(e instanceof Error?e.message:String(e)),a(!1))})};i();let o=setInterval(i,Ga);return()=>{n=!0,clearInterval(o)}},[e,t]),{snapshots:n,isLoading:i,error:o,refreshSingleTab:(0,y.useCallback)(async t=>{if(e===null)return;let{snapshot:n}=await Ya(e,t);n!==null&&r(e=>({...e,[t]:n}))},[e])}},Qa=`console-comment-expanded:`,$a=e=>{try{let t=localStorage.getItem(Qa+e);if(t===null)return new Set;let n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(e=>typeof e==`string`)):new Set}catch(e){return console.error(`Failed to load comment expanded state from storage:`,e),new Set}},eo=(e,t)=>{try{localStorage.setItem(Qa+e,JSON.stringify([...t]))}catch(e){console.error(`Failed to save comment expanded state to storage:`,e)}},to=()=>{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(Qa)&&e.push(n)}for(let t of e)localStorage.removeItem(t)},no=e=>(0,y.useCallback)(t=>{to(),e(t)},[e]),ro=`tdpm-timer-settings`,io=()=>({timerMode:!1,projectMinutes:{}}),ao=()=>{if(typeof localStorage>`u`)return io();let e=localStorage.getItem(ro);if(e===null)return io();try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return io();let n=t,r=typeof n.timerMode==`boolean`&&n.timerMode,i=n.projectMinutes;return{timerMode:r,projectMinutes:typeof i==`object`&&i&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).filter(([,e])=>typeof e==`number`).map(([e,t])=>[e,t])):{}}}catch{return io()}},oo=e=>{typeof localStorage<`u`&&localStorage.setItem(ro,JSON.stringify(e))},so=(e,t,n)=>{if(e.length===0)return null;let r=t===null?-1:e.indexOf(t),i=r===-1?0:(r+1)%e.length,a=r===-1?e.length:e.length-1;for(let t=0;t<a;t++){let r=e[(i+t)%e.length];if((n[r]??0)>0)return r}return null},co=()=>{let[e,t]=(0,y.useState)(ao),[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(e),o=(0,y.useCallback)(()=>{t(e=>(a(e),e)),r(!0)},[]),s=(0,y.useCallback)(()=>{r(!1)},[]),c=(0,y.useCallback)(()=>{a(e=>(oo(e),t(e),e)),r(!1)},[]),l=(0,y.useCallback)(e=>{a(t=>({...t,timerMode:e}))},[]),u=(0,y.useCallback)((e,t)=>{a(n=>({...n,projectMinutes:{...n.projectMinutes,[e]:t}}))},[]);return{timerMode:e.timerMode,projectMinutes:e.projectMinutes,isOpen:n,draftTimerMode:i.timerMode,draftProjectMinutes:i.projectMinutes,openSettings:o,closeSettings:s,saveSettings:c,toggleDraftTimerMode:l,changeDraftMinutes:u}},lo=e=>{window.history.pushState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`))},U=e=>{window.history.replaceState({},``,e),window.dispatchEvent(new PopStateEvent(`popstate`))},uo=(e,t)=>{let n=e.indexOf(t);if(n<0)return e.length>0?e[0]:null;let r=n+1;return r<e.length?e[r]:null},fo=(e,t)=>{let n=e.indexOf(t);return n<0||n>=e.length-1?null:e[n+1]},po=(e,t)=>{let n=e.indexOf(t);return n<=0?null:e[n-1]},mo=(e,t)=>e.length===0?`${t}\n`:e.endsWith(`
14
14
  `)?`${e}${t}\n`:`${e}\n${t}\n`,ho=(e,t)=>{let n=`![uploading ${t}]()`;return`${e.length===0?``:e.replace(/\n*$/,`
15
15
  `)}\n\n\n${n}\n`},go=(e,t,n)=>{let r=`![uploading ${t}]()`,i=e.indexOf(r);return i===-1?mo(e,n):e.slice(0,i)+n+e.slice(i+r.length)},_o=(e,t)=>{let n=`![uploading ${t}]()`,r=e.indexOf(n);if(r===-1)return e;let i=r,a=0;for(;a<3&&i>0&&e[i-1]===`
16
16
  `;)i--,a++;let o=+(e[r+n.length]===`
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>TDPM Console</title>
7
- <script type="module" crossorigin src="/assets/index-Dx4hKlR7.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-CEuMuVO6.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-CGY7GLne.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-issue-tower-defence-management",
3
- "version": "2.88.0",
3
+ "version": "2.88.1",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {