@teammy/server 0.2.24 → 0.2.25

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.
@@ -1 +1 @@
1
- import{A as e,B as t,E as n,H as r,M as i,O as a,P as o,Qt as s,V as c,Z as l,Zt as u,a as d,at as f,d as p,en as m,f as h,h as g,i as _,it as v,j as y,k as b,l as x,p as S,s as C,t as w,tt as T,v as E,x as D}from"./project-links-BwYckk7L.js";import{G as O,W as k,it as A,rt as j,tt as M}from"./index-BCj5CDtq.js";import"./file-links-CQ6ShuxD.js";var N=s(((e,t)=>{t.exports=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),P=s(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),F=s(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=P(),a=N();e=t.exports={};var o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),I=s(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),L=s(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),R=s(((e,t)=>{var n=N(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=P(),{safeRe:a,t:o}=F(),s=I(),{compareIdentifiers:c}=L(),l=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(c(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=l[4]?l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),l(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),z=s(((e,t)=>{var n=R();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),B=m(u(),1),V=m(z(),1),H=r();function U({className:e=``,...t}){return c(),(0,H.jsx)(`button`,{type:`button`,...t,className:`pill-control ${e}`})}function W({className:e=``,...t}){return c(),(0,H.jsx)(d,{...t,className:`pill-menu ${e}`})}var G=[{value:`time`,get label(){return f(`web.TaskBoard.1`)},icon:`clock`},{value:`owner`,get label(){return f(`web.TaskBoard.2`)},icon:`members`}];function K(e){e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),history.pushState(null,``,e.currentTarget.href),window.dispatchEvent(new PopStateEvent(`popstate`)))}var q=[{status:`planned`,get label(){return f(`web.TaskBoard.3`)}},{status:`in_progress`,get label(){return f(`web.Computers.13`)}},{status:`in_review`,get label(){return f(`web.TaskBoard.4`)}},{status:`completed`,get label(){return f(`web.Computers.12`)}},{status:null,get label(){return f(`web.TaskBoard.5`)}}];function J({members:e,project:t,memberId:r}){c();let{request:a,projectId:s}=M(),u=`teammy-board-mine:${r}:${s}`,[d,p]=(0,B.useState)(()=>{try{return localStorage.getItem(u)===`true`}catch{return!1}}),m=`teammy-board-order:${r}:${s}`,[g,_]=(0,B.useState)(()=>{try{return localStorage.getItem(m)===`owner`?`owner`:`time`}catch{return`time`}}),v=G.find(e=>e.value===g),y=(0,B.useCallback)(e=>a(`tasks`,j,{signal:e}),[a]),b=i(y,3e3,o(s,`tasks`)),[S,w]=(0,B.useState)(),[T,D]=(0,B.useState)(!1),[O,A]=(0,B.useState)(Date.now);(0,B.useEffect)(()=>{let e=setInterval(()=>A(Date.now()),6e4);return()=>clearInterval(e)},[]);let N=b.data,P=k(location.href),F=N?.tasks.filter(e=>!d||e.owner===r)??[],I=new Set(e.map(e=>e.id));return(0,H.jsxs)(`div`,{className:`task-board`,children:[(0,H.jsx)(E,{title:t?.projectName.trim()?f(`web.TaskBoard.6`,{p0:t.projectName.trim()}):f(`web.labels.22`),description:t?.description.trim()||``,children:(0,H.jsxs)(`div`,{className:`task-board-brand`,children:[(0,H.jsx)(`a`,{className:`task-board-home`,"data-testid":`home-link`,href:l(`/projects`),onClick:K,"aria-label":f(`web.TaskBoard.7`),"data-tooltip":f(`web.TaskBoard.7`),children:(0,H.jsx)(C,{})}),e.some(e=>e.id===r&&e.bound)&&(0,H.jsx)(Y,{memberId:r})]})}),(0,H.jsxs)(`div`,{className:`task-board-toolbar`,role:`group`,"aria-label":f(`web.TaskBoard.8`),children:[(0,H.jsxs)(U,{"aria-pressed":d,"data-testid":`task-board-mine`,onClick:()=>{let e=!d;p(e),D(!1);try{localStorage.setItem(u,String(e))}catch{}},children:[(0,H.jsx)(h,{name:d?`enable`:`account`,size:`small`}),f(`web.TaskBoard.9`)]}),(0,H.jsx)(W,{id:`task-board-sort-menu`,triggerId:`task-board-sort`,label:f(`web.TaskBoard.10`,{p0:v.label}),routeKey:g,trigger:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(h,{name:v.icon,size:`small`}),(0,H.jsx)(`span`,{children:v.label}),(0,H.jsx)(h,{name:`chevronDown`,size:`small`})]}),children:e=>G.map(t=>(0,H.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-label":t.label,onClick:()=>{e(),_(t.value),D(!1);try{localStorage.setItem(m,t.value)}catch{}},children:[(0,H.jsx)(h,{name:t.icon,size:`small`}),(0,H.jsx)(`span`,{children:t.label}),g===t.value&&(0,H.jsx)(h,{name:`check`,size:`small`})]},t.value))})]}),(0,H.jsx)(n,{resource:b}),(0,H.jsx)(`section`,{className:`task-board-lanes`,"aria-label":f(`web.TaskBoard.11`),"data-testid":`progress-board`,children:q.filter(e=>e.status!==null||F.some(e=>e.status===null)).map(e=>{let t=F.filter(t=>t.status===e.status);t.sort((t,n)=>(g===`owner`?t.owner.localeCompare(n.owner,`en`,{numeric:!0}):0)||(e.status===`completed`?n.statusSince.localeCompare(t.statusSince):t.statusSince.localeCompare(n.statusSince))||t.id.localeCompare(n.id));let n=e.status===`completed`&&!T?t.slice(0,5):t;return(0,H.jsxs)(`section`,{className:`task-lane`,"aria-label":e.label,"data-stage":e.status??`unknown`,children:[(0,H.jsxs)(`h2`,{children:[(0,H.jsx)(`span`,{className:`lane-dot`}),e.label,(0,H.jsx)(x,{children:N?t.length:`—`})]}),(0,H.jsxs)(`div`,{className:`task-lane-content`,children:[t.length?n.map(e=>(0,H.jsx)(X,{task:e,number:N?.taskNumbers[e.id],memberIds:I,now:O,onEdit:()=>w(e),onSaved:()=>void b.reload()},e.id)):(0,H.jsx)(`p`,{className:`task-lane-empty`,children:b.error&&!N?f(`web.TaskBoard.12`):f(N?`web.TaskBoard.13`:`web.TaskBoard.14`)}),e.status===`completed`&&t.length>5&&(0,H.jsxs)(`button`,{type:`button`,className:`task-lane-expand`,"aria-expanded":T,onClick:()=>D(!T),children:[(0,H.jsx)(h,{name:T?`chevronUp`:`chevronDown`,size:`small`}),T?f(`web.TaskBoard.15`):f(`web.TaskBoard.16`,{p0:t.length-5})]})]})]},e.label)})}),P&&(0,H.jsx)(Q,{project:s,id:P.id,memberIds:I,onClose:()=>{let e=new URL(location.href);e.searchParams.delete(`task`),history.replaceState(history.state,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))}}),S&&(0,H.jsx)(te,{task:S,onClose:()=>w(void 0),onSaved:()=>{w(void 0),b.reload()}},S.id)]})}function Y({memberId:t}){c();let{api:n,projectId:r}=M(),a=i(n.devices,!0),o=e();if(!a.data||!o.data||a.error||o.error)return null;let s=(0,V.default)(o.data.version),[l]=a.data.devices.filter(e=>e.memberId===t&&e.bound).map(e=>(0,V.default)(e.status?.clientVersion)).filter(e=>e!==null).sort((e,t)=>e.compare(t));if(!l||!s||l.compare(s)>=0)return null;let u=o.data.versions.filter(e=>{let t=(0,V.default)(e);return t&&(!t.prerelease.length||e===s.raw)&&t.compare(l)>0&&t.compare(s)<=0}).length;return(0,H.jsx)(`p`,{className:`task-board-update${u>5?` overdue`:``}`,children:(0,H.jsxs)(`a`,{href:T(r,`settings/client-maintenance.md`,`#升级与修复`),onClick:K,children:[(0,H.jsx)(h,{name:`attention`,size:`small`}),(0,H.jsxs)(`span`,{children:[f(`web.TaskBoard.17`),l.raw,` → `,s.raw]})]})})}function X({task:e,number:t,memberIds:n,onEdit:r,onSaved:i,now:o}){c();let{request:s}=M(),l=y(),[u,d]=(0,B.useState)(!1),p=a();async function m(){if(!u){d(!0),p(``);try{await s(`tasks/${e.id}/correction`,A,{method:`PATCH`,signal:l,body:{needsConfirmation:!1,expectedRevision:e.revision}}),l.aborted||i()}catch(e){l.aborted||p(e)}finally{d(!1)}}}return(0,H.jsxs)(`details`,{className:`task-card`,"data-testid":`task-card`,"data-task-id":e.id,"data-owner":e.owner,"data-status":e.status??`unknown`,children:[(0,H.jsxs)(`summary`,{className:`task-card-heading`,"data-testid":`task-toggle`,children:[(0,H.jsxs)(`h3`,{children:[t!==void 0&&(0,H.jsxs)(`span`,{className:`task-card-number`,children:[`#`,t]}),(0,H.jsx)(`span`,{className:`task-card-title`,children:e.title})]}),(0,H.jsxs)(`span`,{className:`task-card-meta`,children:[(0,H.jsx)(`small`,{title:e.owner,children:e.owner}),e.needsConfirmation&&(0,H.jsxs)(`span`,{className:`task-confirmation`,"data-testid":`task-confirmation`,children:[(0,H.jsx)(h,{name:`attention`,size:`small`}),f(`web.TaskBoard.18`)]}),e.status!==`completed`&&(0,H.jsx)(ee,{since:e.statusSince,now:o})]})]}),(0,H.jsx)(S,{icon:`edit`,className:`task-card-edit`,label:f(`web.TaskBoard.19`,{p0:e.title}),"data-testid":`task-correct`,disabled:u,onClick:r}),(0,H.jsxs)(`div`,{className:`task-card-details`,children:[(0,H.jsx)(Z,{task:e,memberIds:n}),e.needsConfirmation&&(0,H.jsx)(`div`,{className:`task-card-confirm`,children:(0,H.jsx)(`button`,{className:`primary`,"data-testid":`task-confirm-save`,disabled:u,onClick:()=>void m(),children:f(u?`web.labels.15`:`web.labels.14`)})})]})]})}function Z({task:e,memberIds:n}){c();let{projectId:r}=M(),[i,o]=t(),s=a();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h4`,{children:f(`web.TaskBoard.20`)}),(0,H.jsx)(`p`,{children:e.goal?(0,H.jsx)($,{value:e.goal,memberIds:n}):f(`web.TaskBoard.21`)}),(0,H.jsx)(`h4`,{children:f(`web.TaskBoard.22`)}),(0,H.jsx)(`p`,{className:`task-progress`,children:(0,H.jsx)($,{value:e.progress,memberIds:n})}),(0,H.jsx)(`div`,{className:`task-card-sources`,children:e.sources.map(t=>(0,H.jsxs)(`a`,{"data-testid":`task-source`,href:l(t.kind===`material`?`/projects/${r}/materials?id=${t.materialId}&revision=${t.revision}`:w(r,e.owner,t.path)),children:[(0,H.jsx)(h,{name:`file`,size:`small`}),(0,H.jsx)(`span`,{children:t.path})]},t.path))}),(0,H.jsxs)(`div`,{className:`task-card-footer`,children:[e.syncedAt&&(0,H.jsxs)(`small`,{children:[f(`web.TaskBoard.23`),(0,H.jsx)(D,{value:e.syncedAt})]}),(0,H.jsx)(`span`,{role:`status`,children:i}),(0,H.jsx)(S,{icon:`link`,label:f(`web.TaskBoard.24`),onBlur:()=>o(``),onClick:async()=>{s(``);try{await b(new URL(l(_(r,e.id)),location.origin).href),o(()=>f(`web.labels.100`))}catch{o(``),s(f(`web.TaskBoard.25`))}}})]})]})}function Q({project:e,id:t,memberIds:r,onClose:i}){c();let a=O(e,t,!0),{data:o,error:s}=a;return(0,H.jsxs)(g,{id:`shared-task`,title:o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`task-card-number`,children:[`#`,o.number]}),` `,o.task.title]}):f(`web.TaskBoard.26`),onClose:i,children:[(0,H.jsx)(n,{resource:a}),o?(0,H.jsxs)(`div`,{className:`task-card-details`,children:[(0,H.jsxs)(`small`,{children:[o.task.owner,` · `,q.find(e=>e.status===o.task.status)?.label,!o.active&&f(`web.TaskBoard.27`)]}),(0,H.jsx)(Z,{task:o.task,memberIds:r},t)]}):!s&&(0,H.jsx)(`p`,{role:`status`,children:f(`web.TaskBoard.14`)})]})}function ee({since:e,now:t}){c();let n=Math.max(0,t-Date.parse(e)),r=Math.floor(n/6e4),i=r<1?f(`web.TaskBoard.28`):r<60?f(`web.TaskBoard.29`,{p0:r}):r<1440?f(`web.TaskBoard.30`,{p0:Math.floor(r/60)}):f(`web.TaskBoard.31`,{p0:Math.floor(r/1440)});return(0,H.jsxs)(`span`,{className:`task-age${n>6048e5?` stale`:``}`,"data-testid":`task-age`,title:f(`web.TaskBoard.32`,{p0:new Date(e).toLocaleString(v())}),"aria-label":f(`web.TaskBoard.33`,{p0:i}),children:[(0,H.jsx)(h,{name:`clock`,size:`small`}),i]})}function $({value:e,memberIds:t}){return c(),e.split(/(@[a-z][a-z0-9_-]*)/gi).map((e,n)=>e.startsWith(`@`)&&t.has(e.slice(1))?(0,H.jsx)(`mark`,{className:`task-mention`,children:e},n):e)}function te({task:e,onClose:t,onSaved:n}){c();let{request:r}=M(),i=y(),[o,s]=(0,B.useState)(e.title),[l,u]=(0,B.useState)(e.status??``),[d,m]=(0,B.useState)(e.goal??``),[h,_]=(0,B.useState)(e.progress),[v,b]=(0,B.useState)(!1),x=a(),S={...o===e.title?{}:{title:o},...l===(e.status??``)?{}:{status:l||null},...d===(e.goal??``)?{}:{goal:d||null},...h===e.progress?{}:{progress:h},...e.needsConfirmation?{needsConfirmation:!1}:{}};async function C(){if(!v&&Object.keys(S).length){b(!0),x(``);try{await r(`tasks/${e.id}/correction`,A,{method:`PATCH`,signal:i,body:{...S,expectedRevision:e.revision}}),i.aborted||n()}catch(e){i.aborted||x(e)}finally{b(!1)}}}return(0,H.jsx)(g,{id:`task-correction`,title:f(`web.TaskBoard.34`),onClose:t,children:(0,H.jsxs)(`form`,{className:`stack`,"aria-busy":v,onSubmit:e=>{e.preventDefault(),C()},children:[(0,H.jsx)(p,{id:`task-title`,label:f(`web.Assistant.14`),children:(0,H.jsx)(`input`,{value:o,required:!0,onChange:e=>s(e.target.value)})}),(0,H.jsxs)(`fieldset`,{className:`task-status-field`,disabled:v,children:[(0,H.jsx)(`legend`,{children:f(`web.TaskBoard.35`)}),(0,H.jsx)(`div`,{className:`task-status-options`,"data-testid":`task-status`,children:q.filter(e=>e.status!==null).map(e=>(0,H.jsxs)(`label`,{className:`task-status-choice`,children:[(0,H.jsx)(`input`,{type:`radio`,name:`task-status`,value:e.status,checked:l===e.status,onChange:()=>u(e.status)}),(0,H.jsx)(`span`,{children:e.label})]},e.status))}),(0,H.jsx)(`small`,{children:f(`web.TaskBoard.36`)})]}),(0,H.jsx)(p,{id:`task-goal`,label:f(`web.TaskBoard.20`),children:(0,H.jsx)(`textarea`,{value:d,onChange:e=>m(e.target.value)})}),(0,H.jsx)(p,{id:`task-progress`,label:f(`web.TaskBoard.22`),children:(0,H.jsx)(`textarea`,{value:h,onChange:e=>_(e.target.value)})}),(0,H.jsx)(`div`,{className:`row wrap`,children:(0,H.jsx)(`button`,{type:`submit`,className:`primary`,disabled:v||!Object.keys(S).length,"data-testid":`task-correction-save`,children:f(`web.labels.14`)})})]})})}function ne({members:e,config:t,memberId:n}){return c(),(0,H.jsx)(J,{members:e,project:t,memberId:n})}export{ne as Dashboard};
1
+ import{A as e,B as t,E as n,H as r,M as i,O as a,P as o,Qt as s,V as c,Z as l,Zt as u,a as d,at as f,d as p,en as m,f as h,h as g,i as _,it as v,j as y,k as b,l as x,p as S,s as C,t as w,tt as T,v as E,x as D}from"./project-links-CodATITq.js";import{G as O,W as k,it as A,rt as j,tt as M}from"./index-Ck_8bv0N.js";import"./file-links-BnaVOi2G.js";var N=s(((e,t)=>{t.exports=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),P=s(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),F=s(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=P(),a=N();e=t.exports={};var o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),I=s(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),L=s(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),R=s(((e,t)=>{var n=N(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=P(),{safeRe:a,t:o}=F(),s=I(),{compareIdentifiers:c}=L(),l=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(c(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=l[4]?l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),l(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),z=s(((e,t)=>{var n=R();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),B=m(u(),1),V=m(z(),1),H=r();function U({className:e=``,...t}){return c(),(0,H.jsx)(`button`,{type:`button`,...t,className:`pill-control ${e}`})}function W({className:e=``,...t}){return c(),(0,H.jsx)(d,{...t,className:`pill-menu ${e}`})}var G=[{value:`time`,get label(){return f(`web.TaskBoard.1`)},icon:`clock`},{value:`owner`,get label(){return f(`web.TaskBoard.2`)},icon:`members`}];function K(e){e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),history.pushState(null,``,e.currentTarget.href),window.dispatchEvent(new PopStateEvent(`popstate`)))}var q=[{status:`planned`,get label(){return f(`web.TaskBoard.3`)}},{status:`in_progress`,get label(){return f(`web.Computers.13`)}},{status:`in_review`,get label(){return f(`web.TaskBoard.4`)}},{status:`completed`,get label(){return f(`web.Computers.12`)}},{status:null,get label(){return f(`web.TaskBoard.5`)}}];function J({members:e,project:t,memberId:r}){c();let{request:a,projectId:s}=M(),u=`teammy-board-mine:${r}:${s}`,[d,p]=(0,B.useState)(()=>{try{return localStorage.getItem(u)===`true`}catch{return!1}}),m=`teammy-board-order:${r}:${s}`,[g,_]=(0,B.useState)(()=>{try{return localStorage.getItem(m)===`owner`?`owner`:`time`}catch{return`time`}}),v=G.find(e=>e.value===g),y=(0,B.useCallback)(e=>a(`tasks`,j,{signal:e}),[a]),b=i(y,3e3,o(s,`tasks`)),[S,w]=(0,B.useState)(),[T,D]=(0,B.useState)(!1),[O,A]=(0,B.useState)(Date.now);(0,B.useEffect)(()=>{let e=setInterval(()=>A(Date.now()),6e4);return()=>clearInterval(e)},[]);let N=b.data,P=k(location.href),F=N?.tasks.filter(e=>!d||e.owner===r)??[],I=new Set(e.map(e=>e.id));return(0,H.jsxs)(`div`,{className:`task-board`,children:[(0,H.jsx)(E,{title:t?.projectName.trim()?f(`web.TaskBoard.6`,{p0:t.projectName.trim()}):f(`web.labels.22`),description:t?.description.trim()||``,children:(0,H.jsxs)(`div`,{className:`task-board-brand`,children:[(0,H.jsx)(`a`,{className:`task-board-home`,"data-testid":`home-link`,href:l(`/projects`),onClick:K,"aria-label":f(`web.TaskBoard.7`),"data-tooltip":f(`web.TaskBoard.7`),children:(0,H.jsx)(C,{})}),e.some(e=>e.id===r&&e.bound)&&(0,H.jsx)(Y,{memberId:r})]})}),(0,H.jsxs)(`div`,{className:`task-board-toolbar`,role:`group`,"aria-label":f(`web.TaskBoard.8`),children:[(0,H.jsxs)(U,{"aria-pressed":d,"data-testid":`task-board-mine`,onClick:()=>{let e=!d;p(e),D(!1);try{localStorage.setItem(u,String(e))}catch{}},children:[(0,H.jsx)(h,{name:d?`enable`:`account`,size:`small`}),f(`web.TaskBoard.9`)]}),(0,H.jsx)(W,{id:`task-board-sort-menu`,triggerId:`task-board-sort`,label:f(`web.TaskBoard.10`,{p0:v.label}),routeKey:g,trigger:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(h,{name:v.icon,size:`small`}),(0,H.jsx)(`span`,{children:v.label}),(0,H.jsx)(h,{name:`chevronDown`,size:`small`})]}),children:e=>G.map(t=>(0,H.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-label":t.label,onClick:()=>{e(),_(t.value),D(!1);try{localStorage.setItem(m,t.value)}catch{}},children:[(0,H.jsx)(h,{name:t.icon,size:`small`}),(0,H.jsx)(`span`,{children:t.label}),g===t.value&&(0,H.jsx)(h,{name:`check`,size:`small`})]},t.value))})]}),(0,H.jsx)(n,{resource:b}),(0,H.jsx)(`section`,{className:`task-board-lanes`,"aria-label":f(`web.TaskBoard.11`),"data-testid":`progress-board`,children:q.filter(e=>e.status!==null||F.some(e=>e.status===null)).map(e=>{let t=F.filter(t=>t.status===e.status);t.sort((t,n)=>(g===`owner`?t.owner.localeCompare(n.owner,`en`,{numeric:!0}):0)||(e.status===`completed`?n.statusSince.localeCompare(t.statusSince):t.statusSince.localeCompare(n.statusSince))||t.id.localeCompare(n.id));let n=e.status===`completed`&&!T?t.slice(0,5):t;return(0,H.jsxs)(`section`,{className:`task-lane`,"aria-label":e.label,"data-stage":e.status??`unknown`,children:[(0,H.jsxs)(`h2`,{children:[(0,H.jsx)(`span`,{className:`lane-dot`}),e.label,(0,H.jsx)(x,{children:N?t.length:`—`})]}),(0,H.jsxs)(`div`,{className:`task-lane-content`,children:[t.length?n.map(e=>(0,H.jsx)(X,{task:e,number:N?.taskNumbers[e.id],memberIds:I,now:O,onEdit:()=>w(e),onSaved:()=>void b.reload()},e.id)):(0,H.jsx)(`p`,{className:`task-lane-empty`,children:b.error&&!N?f(`web.TaskBoard.12`):f(N?`web.TaskBoard.13`:`web.TaskBoard.14`)}),e.status===`completed`&&t.length>5&&(0,H.jsxs)(`button`,{type:`button`,className:`task-lane-expand`,"aria-expanded":T,onClick:()=>D(!T),children:[(0,H.jsx)(h,{name:T?`chevronUp`:`chevronDown`,size:`small`}),T?f(`web.TaskBoard.15`):f(`web.TaskBoard.16`,{p0:t.length-5})]})]})]},e.label)})}),P&&(0,H.jsx)(Q,{project:s,id:P.id,memberIds:I,onClose:()=>{let e=new URL(location.href);e.searchParams.delete(`task`),history.replaceState(history.state,``,e),window.dispatchEvent(new PopStateEvent(`popstate`))}}),S&&(0,H.jsx)(te,{task:S,onClose:()=>w(void 0),onSaved:()=>{w(void 0),b.reload()}},S.id)]})}function Y({memberId:t}){c();let{api:n,projectId:r}=M(),a=i(n.devices,!0),o=e();if(!a.data||!o.data||a.error||o.error)return null;let s=(0,V.default)(o.data.version),[l]=a.data.devices.filter(e=>e.memberId===t&&e.bound).map(e=>(0,V.default)(e.status?.clientVersion)).filter(e=>e!==null).sort((e,t)=>e.compare(t));if(!l||!s||l.compare(s)>=0)return null;let u=o.data.versions.filter(e=>{let t=(0,V.default)(e);return t&&(!t.prerelease.length||e===s.raw)&&t.compare(l)>0&&t.compare(s)<=0}).length;return(0,H.jsx)(`p`,{className:`task-board-update${u>5?` overdue`:``}`,children:(0,H.jsxs)(`a`,{href:T(r,`settings/client-maintenance.md`,`#升级与修复`),onClick:K,children:[(0,H.jsx)(h,{name:`attention`,size:`small`}),(0,H.jsxs)(`span`,{children:[f(`web.TaskBoard.17`),l.raw,` → `,s.raw]})]})})}function X({task:e,number:t,memberIds:n,onEdit:r,onSaved:i,now:o}){c();let{request:s}=M(),l=y(),[u,d]=(0,B.useState)(!1),p=a();async function m(){if(!u){d(!0),p(``);try{await s(`tasks/${e.id}/correction`,A,{method:`PATCH`,signal:l,body:{needsConfirmation:!1,expectedRevision:e.revision}}),l.aborted||i()}catch(e){l.aborted||p(e)}finally{d(!1)}}}return(0,H.jsxs)(`details`,{className:`task-card`,"data-testid":`task-card`,"data-task-id":e.id,"data-owner":e.owner,"data-status":e.status??`unknown`,children:[(0,H.jsxs)(`summary`,{className:`task-card-heading`,"data-testid":`task-toggle`,children:[(0,H.jsxs)(`h3`,{children:[t!==void 0&&(0,H.jsxs)(`span`,{className:`task-card-number`,children:[`#`,t]}),(0,H.jsx)(`span`,{className:`task-card-title`,children:e.title})]}),(0,H.jsxs)(`span`,{className:`task-card-meta`,children:[(0,H.jsx)(`small`,{title:e.owner,children:e.owner}),e.needsConfirmation&&(0,H.jsxs)(`span`,{className:`task-confirmation`,"data-testid":`task-confirmation`,children:[(0,H.jsx)(h,{name:`attention`,size:`small`}),f(`web.TaskBoard.18`)]}),e.status!==`completed`&&(0,H.jsx)(ee,{since:e.statusSince,now:o})]})]}),(0,H.jsx)(S,{icon:`edit`,className:`task-card-edit`,label:f(`web.TaskBoard.19`,{p0:e.title}),"data-testid":`task-correct`,disabled:u,onClick:r}),(0,H.jsxs)(`div`,{className:`task-card-details`,children:[(0,H.jsx)(Z,{task:e,memberIds:n}),e.needsConfirmation&&(0,H.jsx)(`div`,{className:`task-card-confirm`,children:(0,H.jsx)(`button`,{className:`primary`,"data-testid":`task-confirm-save`,disabled:u,onClick:()=>void m(),children:f(u?`web.labels.15`:`web.labels.14`)})})]})]})}function Z({task:e,memberIds:n}){c();let{projectId:r}=M(),[i,o]=t(),s=a();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h4`,{children:f(`web.TaskBoard.20`)}),(0,H.jsx)(`p`,{children:e.goal?(0,H.jsx)($,{value:e.goal,memberIds:n}):f(`web.TaskBoard.21`)}),(0,H.jsx)(`h4`,{children:f(`web.TaskBoard.22`)}),(0,H.jsx)(`p`,{className:`task-progress`,children:(0,H.jsx)($,{value:e.progress,memberIds:n})}),(0,H.jsx)(`div`,{className:`task-card-sources`,children:e.sources.map(t=>(0,H.jsxs)(`a`,{"data-testid":`task-source`,href:l(t.kind===`material`?`/projects/${r}/materials?id=${t.materialId}&revision=${t.revision}`:w(r,e.owner,t.path)),children:[(0,H.jsx)(h,{name:`file`,size:`small`}),(0,H.jsx)(`span`,{children:t.path})]},t.path))}),(0,H.jsxs)(`div`,{className:`task-card-footer`,children:[e.syncedAt&&(0,H.jsxs)(`small`,{children:[f(`web.TaskBoard.23`),(0,H.jsx)(D,{value:e.syncedAt})]}),(0,H.jsx)(`span`,{role:`status`,children:i}),(0,H.jsx)(S,{icon:`link`,label:f(`web.TaskBoard.24`),onBlur:()=>o(``),onClick:async()=>{s(``);try{await b(new URL(l(_(r,e.id)),location.origin).href),o(()=>f(`web.labels.100`))}catch{o(``),s(f(`web.TaskBoard.25`))}}})]})]})}function Q({project:e,id:t,memberIds:r,onClose:i}){c();let a=O(e,t,!0),{data:o,error:s}=a;return(0,H.jsxs)(g,{id:`shared-task`,title:o?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`task-card-number`,children:[`#`,o.number]}),` `,o.task.title]}):f(`web.TaskBoard.26`),onClose:i,children:[(0,H.jsx)(n,{resource:a}),o?(0,H.jsxs)(`div`,{className:`task-card-details`,children:[(0,H.jsxs)(`small`,{children:[o.task.owner,` · `,q.find(e=>e.status===o.task.status)?.label,!o.active&&f(`web.TaskBoard.27`)]}),(0,H.jsx)(Z,{task:o.task,memberIds:r},t)]}):!s&&(0,H.jsx)(`p`,{role:`status`,children:f(`web.TaskBoard.14`)})]})}function ee({since:e,now:t}){c();let n=Math.max(0,t-Date.parse(e)),r=Math.floor(n/6e4),i=r<1?f(`web.TaskBoard.28`):r<60?f(`web.TaskBoard.29`,{p0:r}):r<1440?f(`web.TaskBoard.30`,{p0:Math.floor(r/60)}):f(`web.TaskBoard.31`,{p0:Math.floor(r/1440)});return(0,H.jsxs)(`span`,{className:`task-age${n>6048e5?` stale`:``}`,"data-testid":`task-age`,title:f(`web.TaskBoard.32`,{p0:new Date(e).toLocaleString(v())}),"aria-label":f(`web.TaskBoard.33`,{p0:i}),children:[(0,H.jsx)(h,{name:`clock`,size:`small`}),i]})}function $({value:e,memberIds:t}){return c(),e.split(/(@[a-z][a-z0-9_-]*)/gi).map((e,n)=>e.startsWith(`@`)&&t.has(e.slice(1))?(0,H.jsx)(`mark`,{className:`task-mention`,children:e},n):e)}function te({task:e,onClose:t,onSaved:n}){c();let{request:r}=M(),i=y(),[o,s]=(0,B.useState)(e.title),[l,u]=(0,B.useState)(e.status??``),[d,m]=(0,B.useState)(e.goal??``),[h,_]=(0,B.useState)(e.progress),[v,b]=(0,B.useState)(!1),x=a(),S={...o===e.title?{}:{title:o},...l===(e.status??``)?{}:{status:l||null},...d===(e.goal??``)?{}:{goal:d||null},...h===e.progress?{}:{progress:h},...e.needsConfirmation?{needsConfirmation:!1}:{}};async function C(){if(!v&&Object.keys(S).length){b(!0),x(``);try{await r(`tasks/${e.id}/correction`,A,{method:`PATCH`,signal:i,body:{...S,expectedRevision:e.revision}}),i.aborted||n()}catch(e){i.aborted||x(e)}finally{b(!1)}}}return(0,H.jsx)(g,{id:`task-correction`,title:f(`web.TaskBoard.34`),onClose:t,children:(0,H.jsxs)(`form`,{className:`stack`,"aria-busy":v,onSubmit:e=>{e.preventDefault(),C()},children:[(0,H.jsx)(p,{id:`task-title`,label:f(`web.Assistant.14`),children:(0,H.jsx)(`input`,{value:o,required:!0,onChange:e=>s(e.target.value)})}),(0,H.jsxs)(`fieldset`,{className:`task-status-field`,disabled:v,children:[(0,H.jsx)(`legend`,{children:f(`web.TaskBoard.35`)}),(0,H.jsx)(`div`,{className:`task-status-options`,"data-testid":`task-status`,children:q.filter(e=>e.status!==null).map(e=>(0,H.jsxs)(`label`,{className:`task-status-choice`,children:[(0,H.jsx)(`input`,{type:`radio`,name:`task-status`,value:e.status,checked:l===e.status,onChange:()=>u(e.status)}),(0,H.jsx)(`span`,{children:e.label})]},e.status))}),(0,H.jsx)(`small`,{children:f(`web.TaskBoard.36`)})]}),(0,H.jsx)(p,{id:`task-goal`,label:f(`web.TaskBoard.20`),children:(0,H.jsx)(`textarea`,{value:d,onChange:e=>m(e.target.value)})}),(0,H.jsx)(p,{id:`task-progress`,label:f(`web.TaskBoard.22`),children:(0,H.jsx)(`textarea`,{value:h,onChange:e=>_(e.target.value)})}),(0,H.jsx)(`div`,{className:`row wrap`,children:(0,H.jsx)(`button`,{type:`submit`,className:`primary`,disabled:v||!Object.keys(S).length,"data-testid":`task-correction-save`,children:f(`web.labels.14`)})})]})})}function ne({members:e,config:t,memberId:n}){return c(),(0,H.jsx)(J,{members:e,project:t,memberId:n})}export{ne as Dashboard};
@@ -1 +1 @@
1
- import{C as e,H as t,M as n,O as r,Ot as i,P as a,T as o,U as s,V as c,Z as l,Zt as u,at as d,b as f,en as p,f as m,k as h,p as g,rt as _,t as v,u as y}from"./project-links-BwYckk7L.js";import{J as b,K as x,q as S,r as C,tt as w,z as T}from"./index-BCj5CDtq.js";import{a as E,i as D,l as O,n as k,o as A,s as j,t as M}from"./WorkspaceTree-C2sVptdG.js";import{t as N}from"./file-links-CQ6ShuxD.js";var P=p(u(),1),F=t();function I(e,t){let n=t.split(`/`).slice(0,-1);return n.map((t,r)=>k(e,n.slice(0,r+1).join(`/`))).concat(k(e,``))}function L({members:t,onRefresh:a}){c();let{api:u,projectId:f}=w(),[p,m]=(0,P.useState)(()=>{let e=new URLSearchParams(location.search),n=e.get(`owner`),r=i.safeParse(e.get(`path`));return n&&(j(n)||t.some(e=>e.id===n))&&r.success&&!A(r.data)?{owner:n,path:r.data}:void 0}),[h,x]=(0,P.useState)(()=>new Set(p?I(p.owner,p.path):[])),[T,O]=(0,P.useState)(()=>p?{...p,kind:`file`}:void 0),[L,B]=(0,P.useState)(0),V=r(),[H,U]=(0,P.useState)(()=>{let e=new URLSearchParams(location.search);return!p&&(e.has(`owner`)||e.has(`path`))?d(`web.Files.1`):``}),W=(0,P.useCallback)(async e=>{if(p)try{return{owner:p.owner,...await u.file(p.owner,p.path,void 0,e)}}catch(e){throw e instanceof s&&e.code===`FILE_NOT_FOUND`?new s(e.code,d(`web.Files.2`),e.status):e}},[u,p?.owner,p?.path]),G=n(W),K=G.data?.owner===p?.owner&&G.data?.file.path===p?.path?G.data:void 0;C(p?(j(p.owner)?p.path:`${p.owner}/${p.path}`).split(`/`).slice(-2).join(`/`):void 0);function q(e,t){let n=t.split(`/`).filter(Boolean);x(t=>{let r=new Set(t);for(let t=0;t<=n.length;t++)r.add(k(e,n.slice(0,t).join(`/`)));return r})}function J(e,t){V(``),U(``),q(e,t.split(`/`).slice(0,-1).join(`/`)),m({owner:e,path:t}),O({owner:e,path:t,kind:`file`}),history.replaceState(null,``,l(v(f,e,t)))}function Y(e){if(!p)return!1;V(``);let n=N(j(p.owner)?p.path:`${p.owner}/${p.path}`,e);if(!n)return!/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(`//`)&&(V(d(`web.Files.3`)),!0);if(A(n.path))return V(d(`web.Files.4`)),!0;if(E(n.path))return location.assign(l(`/projects/${f}/memory`)),!0;let[r,...i]=n.path.split(`/`),a=t.some(e=>e.id===r),o=a?r:D,s=a?i.join(`/`):n.path;return U(``),n.directory?(q(o,s),O({owner:o,path:s,kind:`directory`})):o===p.owner&&s===p.path?n.anchor&&[...document.querySelectorAll(`.markdown h1,.markdown h2,.markdown h3,.markdown h4`)].find(e=>e.textContent?.trim().toLowerCase().replace(/\s+/g,`-`)===n.anchor.toLowerCase())?.scrollIntoView({block:`center`}):J(o,s),!0}return(0,F.jsx)(S,{"data-testid":`file-browser`,label:d(`web.Files.5`),navigation:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(b,{title:d(`web.labels.21`),children:(0,F.jsx)(g,{icon:`refresh`,label:d(`web.Files.6`),"data-testid":`files-refresh`,onClick:()=>{U(``),B(e=>e+1),G.reload(),a()}})}),(0,F.jsx)(M,{members:t,expanded:h,selected:T,revealed:!G.loading&&!G.error&&K?{owner:K.owner,path:K.file.path,file:K.file}:void 0,onSelect:J,onToggle:(e,t)=>{O({owner:e,path:t,kind:`directory`}),x(n=>{let r=new Set(n),i=k(e,t);return r.has(i)?r.delete(i):r.add(i),r})}},L)]}),children:(0,F.jsxs)(`section`,{className:`file-detail`,"data-testid":`file-preview`,"data-owner-id":p?.owner,"data-file-path":p?.path,"aria-label":_.filePreview,children:[K&&(0,F.jsx)(o,{message:G.error}),K?(0,F.jsx)(z,{owner:K.owner,file:K.file,onLink:Y},`${K.owner}:${K.file.path}:${K.file.sha256}`):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(R,{target:p}),(0,F.jsxs)(`div`,{className:`reader-body`,children:[(0,F.jsx)(e,{announce:!0,retry:G.error?G.reload:void 0,children:H||G.error}),p&&G.loading&&(0,F.jsx)(`p`,{className:`preview-body`,role:`status`,children:_.loading}),!p&&!H&&(0,F.jsx)(y,{mascot:!0,title:d(`web.Files.7`),description:_.pickFile})]})]})]})})}function R({target:e,children:t}){c();let n=e&&(j(e.owner)?`teamcontext`:e.owner);return(0,F.jsx)(x,{title:e?(0,F.jsxs)(`h2`,{className:`file-detail-path`,title:`${n}/${e.path}`,children:[(0,F.jsxs)(`span`,{children:[n,` / `]}),e.path]}):_.filePreview,actions:t})}function z({owner:t,file:i,onLink:s}){c();let{readTextBlob:l,blobUrl:u,projectId:p}=w(),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(!1),S=r(),C=`teamcontext/${j(t)?``:`${t}/`}${i.path}`,E=i.size>524288,D=/\.(md|markdown)$/i.test(i.path),k=/\.html?$/i.test(i.path),A=(0,P.useCallback)(e=>E?Promise.resolve(void 0):l(i,e),[i.sha256,i.size,E]),M=n(A,!1,a(p,`file-body`,i.sha256));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(R,{target:{owner:t,path:i.path},children:(0,F.jsxs)(f,{label:d(`web.Files.8`),children:[(D||k)&&(0,F.jsx)(g,{icon:v?`preview`:`code`,label:d(v?`web.Materials.26`:`web.Materials.27`),"data-testid":`file-toggle-raw`,"aria-pressed":v,onClick:()=>y(!v)}),(0,F.jsx)(`a`,{className:`icon-button`,"data-testid":`file-download`,"aria-label":_.download,title:_.download,href:u(i.sha256),download:i.path.split(`/`).at(-1),children:(0,F.jsx)(m,{name:`download`})}),(0,F.jsx)(g,{icon:b?`check`:`link`,label:d(b?`web.Files.9`:`web.Files.10`),"data-testid":`file-copy-path`,onBlur:()=>x(!1),onClick:async()=>{S(``);try{await h(C),x(!0)}catch{x(!1),S(d(`web.Files.11`))}}})]})}),(0,F.jsxs)(`div`,{className:`reader-body`,children:[M.data!==void 0&&(0,F.jsx)(o,{message:M.error}),E?(0,F.jsx)(`div`,{className:`empty`,children:(0,F.jsx)(`p`,{children:_.previewLarge})}):M.error&&M.data===void 0?(0,F.jsx)(`div`,{className:`preview-body`,children:(0,F.jsx)(e,{announce:!0,retry:M.reload,children:M.error})}):M.loading&&M.data===void 0?(0,F.jsx)(`p`,{className:`preview-body`,role:`status`,children:_.loading}):(0,F.jsx)(`div`,{className:`preview-body${k&&!v?` preview-body-html`:``}`,children:k&&!v?(0,F.jsx)(O,{url:u(i.sha256),name:i.path.split(`/`).at(-1)}):D&&!v?(0,F.jsx)(`article`,{className:`markdown`,"data-testid":`file-content`,"data-format":`markdown`,children:(0,F.jsx)(T,{onLink:s,children:M.data??``})}):(0,F.jsx)(`pre`,{className:`raw`,"data-testid":`file-content`,"data-format":`text`,children:M.data})})]})]})}export{L as Files};
1
+ import{C as e,H as t,M as n,O as r,Ot as i,P as a,T as o,U as s,V as c,Z as l,Zt as u,at as d,b as f,en as p,f as m,k as h,p as g,rt as _,t as v,u as y}from"./project-links-CodATITq.js";import{J as b,K as x,q as S,r as C,tt as w,z as T}from"./index-Ck_8bv0N.js";import{a as E,i as D,l as O,n as k,o as A,s as j,t as M}from"./WorkspaceTree-CuwIu3vj.js";import{t as N}from"./file-links-BnaVOi2G.js";var P=p(u(),1),F=t();function I(e,t){let n=t.split(`/`).slice(0,-1);return n.map((t,r)=>k(e,n.slice(0,r+1).join(`/`))).concat(k(e,``))}function L({members:t,onRefresh:a}){c();let{api:u,projectId:f}=w(),[p,m]=(0,P.useState)(()=>{let e=new URLSearchParams(location.search),n=e.get(`owner`),r=i.safeParse(e.get(`path`));return n&&(j(n)||t.some(e=>e.id===n))&&r.success&&!A(r.data)?{owner:n,path:r.data}:void 0}),[h,x]=(0,P.useState)(()=>new Set(p?I(p.owner,p.path):[])),[T,O]=(0,P.useState)(()=>p?{...p,kind:`file`}:void 0),[L,B]=(0,P.useState)(0),V=r(),[H,U]=(0,P.useState)(()=>{let e=new URLSearchParams(location.search);return!p&&(e.has(`owner`)||e.has(`path`))?d(`web.Files.1`):``}),W=(0,P.useCallback)(async e=>{if(p)try{return{owner:p.owner,...await u.file(p.owner,p.path,void 0,e)}}catch(e){throw e instanceof s&&e.code===`FILE_NOT_FOUND`?new s(e.code,d(`web.Files.2`),e.status):e}},[u,p?.owner,p?.path]),G=n(W),K=G.data?.owner===p?.owner&&G.data?.file.path===p?.path?G.data:void 0;C(p?(j(p.owner)?p.path:`${p.owner}/${p.path}`).split(`/`).slice(-2).join(`/`):void 0);function q(e,t){let n=t.split(`/`).filter(Boolean);x(t=>{let r=new Set(t);for(let t=0;t<=n.length;t++)r.add(k(e,n.slice(0,t).join(`/`)));return r})}function J(e,t){V(``),U(``),q(e,t.split(`/`).slice(0,-1).join(`/`)),m({owner:e,path:t}),O({owner:e,path:t,kind:`file`}),history.replaceState(null,``,l(v(f,e,t)))}function Y(e){if(!p)return!1;V(``);let n=N(j(p.owner)?p.path:`${p.owner}/${p.path}`,e);if(!n)return!/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(`//`)&&(V(d(`web.Files.3`)),!0);if(A(n.path))return V(d(`web.Files.4`)),!0;if(E(n.path))return location.assign(l(`/projects/${f}/memory`)),!0;let[r,...i]=n.path.split(`/`),a=t.some(e=>e.id===r),o=a?r:D,s=a?i.join(`/`):n.path;return U(``),n.directory?(q(o,s),O({owner:o,path:s,kind:`directory`})):o===p.owner&&s===p.path?n.anchor&&[...document.querySelectorAll(`.markdown h1,.markdown h2,.markdown h3,.markdown h4`)].find(e=>e.textContent?.trim().toLowerCase().replace(/\s+/g,`-`)===n.anchor.toLowerCase())?.scrollIntoView({block:`center`}):J(o,s),!0}return(0,F.jsx)(S,{"data-testid":`file-browser`,label:d(`web.Files.5`),navigation:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(b,{title:d(`web.labels.21`),children:(0,F.jsx)(g,{icon:`refresh`,label:d(`web.Files.6`),"data-testid":`files-refresh`,onClick:()=>{U(``),B(e=>e+1),G.reload(),a()}})}),(0,F.jsx)(M,{members:t,expanded:h,selected:T,revealed:!G.loading&&!G.error&&K?{owner:K.owner,path:K.file.path,file:K.file}:void 0,onSelect:J,onToggle:(e,t)=>{O({owner:e,path:t,kind:`directory`}),x(n=>{let r=new Set(n),i=k(e,t);return r.has(i)?r.delete(i):r.add(i),r})}},L)]}),children:(0,F.jsxs)(`section`,{className:`file-detail`,"data-testid":`file-preview`,"data-owner-id":p?.owner,"data-file-path":p?.path,"aria-label":_.filePreview,children:[K&&(0,F.jsx)(o,{message:G.error}),K?(0,F.jsx)(z,{owner:K.owner,file:K.file,onLink:Y},`${K.owner}:${K.file.path}:${K.file.sha256}`):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(R,{target:p}),(0,F.jsxs)(`div`,{className:`reader-body`,children:[(0,F.jsx)(e,{announce:!0,retry:G.error?G.reload:void 0,children:H||G.error}),p&&G.loading&&(0,F.jsx)(`p`,{className:`preview-body`,role:`status`,children:_.loading}),!p&&!H&&(0,F.jsx)(y,{mascot:!0,title:d(`web.Files.7`),description:_.pickFile})]})]})]})})}function R({target:e,children:t}){c();let n=e&&(j(e.owner)?`teamcontext`:e.owner);return(0,F.jsx)(x,{title:e?(0,F.jsxs)(`h2`,{className:`file-detail-path`,title:`${n}/${e.path}`,children:[(0,F.jsxs)(`span`,{children:[n,` / `]}),e.path]}):_.filePreview,actions:t})}function z({owner:t,file:i,onLink:s}){c();let{readTextBlob:l,blobUrl:u,projectId:p}=w(),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(!1),S=r(),C=`teamcontext/${j(t)?``:`${t}/`}${i.path}`,E=i.size>524288,D=/\.(md|markdown)$/i.test(i.path),k=/\.html?$/i.test(i.path),A=(0,P.useCallback)(e=>E?Promise.resolve(void 0):l(i,e),[i.sha256,i.size,E]),M=n(A,!1,a(p,`file-body`,i.sha256));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(R,{target:{owner:t,path:i.path},children:(0,F.jsxs)(f,{label:d(`web.Files.8`),children:[(D||k)&&(0,F.jsx)(g,{icon:v?`preview`:`code`,label:d(v?`web.Materials.26`:`web.Materials.27`),"data-testid":`file-toggle-raw`,"aria-pressed":v,onClick:()=>y(!v)}),(0,F.jsx)(`a`,{className:`icon-button`,"data-testid":`file-download`,"aria-label":_.download,title:_.download,href:u(i.sha256),download:i.path.split(`/`).at(-1),children:(0,F.jsx)(m,{name:`download`})}),(0,F.jsx)(g,{icon:b?`check`:`link`,label:d(b?`web.Files.9`:`web.Files.10`),"data-testid":`file-copy-path`,onBlur:()=>x(!1),onClick:async()=>{S(``);try{await h(C),x(!0)}catch{x(!1),S(d(`web.Files.11`))}}})]})}),(0,F.jsxs)(`div`,{className:`reader-body`,children:[M.data!==void 0&&(0,F.jsx)(o,{message:M.error}),E?(0,F.jsx)(`div`,{className:`empty`,children:(0,F.jsx)(`p`,{children:_.previewLarge})}):M.error&&M.data===void 0?(0,F.jsx)(`div`,{className:`preview-body`,children:(0,F.jsx)(e,{announce:!0,retry:M.reload,children:M.error})}):M.loading&&M.data===void 0?(0,F.jsx)(`p`,{className:`preview-body`,role:`status`,children:_.loading}):(0,F.jsx)(`div`,{className:`preview-body${k&&!v?` preview-body-html`:``}`,children:k&&!v?(0,F.jsx)(O,{url:u(i.sha256),name:i.path.split(`/`).at(-1)}):D&&!v?(0,F.jsx)(`article`,{className:`markdown`,"data-testid":`file-content`,"data-format":`markdown`,children:(0,F.jsx)(T,{onLink:s,children:M.data??``})}):(0,F.jsx)(`pre`,{className:`raw`,"data-testid":`file-content`,"data-format":`text`,children:M.data})})]})]})}export{L as Files};
@@ -1,4 +1,4 @@
1
- import{E as e,H as t,M as n,V as r,Zt as i,at as a,en as o,tt as s,u as c}from"./project-links-BwYckk7L.js";import{$ as ee,F as l,I as u,J as d,K as f,L as p,Q as m,R as h,n as g,q as te,r as ne,tt as _,z as v}from"./index-BCj5CDtq.js";var y=`# 帮助
1
+ import{E as e,H as t,M as n,V as r,Zt as i,at as a,en as o,tt as s,u as c}from"./project-links-CodATITq.js";import{$ as ee,F as l,I as u,J as d,K as f,L as p,Q as m,R as h,n as g,q as te,r as ne,tt as _,z as v}from"./index-Ck_8bv0N.js";var y=`# 帮助
2
2
 
3
3
  这里是通用产品操作说明。项目特有的接入步骤由管理员维护,可在网页帮助的第一篇「项目接入指南」中阅读。
4
4
 
@@ -101,6 +101,7 @@ import{E as e,H as t,M as n,V as r,Zt as i,at as a,en as o,tt as s,u as c}from".
101
101
  | 26/11/23 | v0.2.22 | 支持通知提醒;交互改进。 |
102
102
  | 26/11/24 | v0.2.23 | 新增请求回执机制。 |
103
103
  | 26/11/25 | v0.2.24 | 中英文支持;各模块通用性改善。 |
104
+ | 26/11/26 | v0.2.25 | 支持本地 Agent 单向留言与状态查询。 |
104
105
  `,x=`# 让开发 Agent 使用 Teammy
105
106
 
106
107
  正在使用的开发 Agent 可以通过 Teammy 查询任务、资料和历史会话。开始一项工作前,让 Agent 查找团队已有的结论,有助于减少重复摸索。
@@ -214,6 +215,16 @@ teammy agent register --provider codex --cwd .
214
215
 
215
216
  需要稍后继续或周期检查时,可直接向会话说明时间、目标和停止条件。Agent 通过工具保存计划,到期后按队列继续原会话;也可以随时要求查询、暂停或取消。见[定时与周期工作](schedules.md)。
216
217
 
218
+ ### 在自己的 Agent 之间留言
219
+
220
+ 可以让当前会话中的 Agent 给本项目内另一个自己的 Agent 留言,例如:“告诉「模型评测」,数据已准备好,实例保持运行,请按原计划评测后释放。”接收会话需要开启自动接单,开发机保持在线,并使用支持留言的新版客户端。两个会话可以在同一目录、不同子目录或本人不同设备上。
221
+
222
+ Agent 通过 \`list_agent_sessions\` 查看 Teammy 会话标题和目录名称,再用列表中的 \`teammy-\` 通信地址调用 \`send_agent_message\`。留言统一经服务端信箱投递;对方忙碌时排队,空闲后沿原会话处理。正文会显示为“收到留言”,不会作为问题或审批的答案。
223
+
224
+ 发送结果包含留言回执,Agent 可按需通过 \`get_agent_message_status\` 查询排队或处理状态。入箱成功不等于已阅读,回合结束也不保证资源已经释放。对方的回复仍留在对方会话,不自动回送。网页分别保留发送记录、来源和处理状态。
225
+
226
+ 首版仅支持 Teammy 托管的本人会话,独立启动的终端 Agent 和其他成员的会话暂不在联系范围内。
227
+
217
228
  ### 导入已有会话
218
229
 
219
230
  点击目录旁的 **+**,选择执行目录,再点击「导入历史会话」并选择 Agent。点击 Session 输入框展开当前目录的历史列表,可按标题或 ID 筛选;也可以直接粘贴原生 Session ID,点击「导入」。七种本地 Agent 均支持按目录导入。开发机器需要在线,并使用支持历史导入的新版客户端。
@@ -710,6 +721,16 @@ Team queries can read existing consultation results. Sending a question and rece
710
721
 
711
722
  For later or recurring work, state the time, goal and stop condition. The Agent saves a schedule and queues work in the same session when due. You can query, pause or cancel it. See [scheduled work](schedules.md).
712
723
 
724
+ ### Leave notes between your Agents
725
+
726
+ Ask the current Agent to leave a note for another of your sessions in this project, for example: “Tell Model Evaluation the data is ready. Keep the instance running until evaluation finishes, then release it as agreed.” The recipient must have automatic intake enabled and an online device with a current client. Sessions can share a directory or run in different directories or on your other devices.
727
+
728
+ The Agent uses \`list_agent_sessions\` to find Teammy titles and directory names, then sends with \`send_agent_message\` using the listed \`teammy-\` address. Notes go through the server mailbox and queue while the recipient is busy. They continue the original session and cannot answer questions or approvals.
729
+
730
+ Sending returns a receipt for optional \`get_agent_message_status\` queries. Submission does not prove reading, and a finished turn does not guarantee that a resource was released. Replies stay in the recipient’s session. The web shows the sent note, its source and processing state.
731
+
732
+ This version supports your Teammy-managed sessions only. Independently started terminal Agents and other members’ sessions are outside its scope.
733
+
713
734
  ### Import an existing session
714
735
 
715
736
  Click **+** beside the directory, choose Import history and an Agent. The Session field opens readable history for that directory; filter by title or ID, or paste a native Session ID and click Import. All seven Agents support directory-based import. The device must be online with a current client.
@@ -1 +1 @@
1
- import{H as e,V as t,Zt as n,at as r,en as i,f as a}from"./project-links-BwYckk7L.js";import{o}from"./index-BCj5CDtq.js";var s=i(n(),1),c=e();function l({value:e,onChange:n,onSubmit:i,onQueue:l,label:d,placeholder:f=r(`web.Computers.57`),disabled:p=!1,sendDisabled:m=!1,sendLabel:h=r(`web.Computers.55`),actions:g,beforeSend:_,heading:v,inset:y=!1,plain:b=!1,attachments:x,hasAttachments:S=!1,onFiles:C}){t();let w=u(e),[T,E]=(0,s.useState)(!1),D=(0,s.useRef)(0),O=!p&&!m&&(!!e.trim()||S);return(0,c.jsxs)(`form`,{className:`message-composer${y?` message-composer-inset`:``}${b?` message-composer-plain`:``}${T?` message-composer-dragging`:``}`,"data-drag-label":r(`web.MessageComposer.2`),onDragEnter:e=>{C&&!p&&e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),D.current++,E(!0))},onDragLeave:()=>{D.current=Math.max(0,D.current-1),D.current||E(!1)},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=C&&!p?`copy`:`none`)},onDrop:e=>{D.current=0,E(!1),e.dataTransfer.files.length&&(e.preventDefault(),C&&!p&&C(Array.from(e.dataTransfer.files)))},onSubmit:e=>{e.preventDefault(),O&&i(e)},children:[v&&(0,c.jsx)(`div`,{className:`message-composer-heading`,children:v}),x,(0,c.jsx)(`textarea`,{ref:w,value:e,onChange:e=>n(e.target.value),"aria-label":d,placeholder:f,disabled:p,onPaste:t=>{let r=t.clipboardData.files.length?Array.from(t.clipboardData.files):Array.from(t.clipboardData.items).flatMap(e=>{let t=e.kind===`file`?e.getAsFile():null;return t?[t]:[]});if(C&&!p&&r.length){t.preventDefault(),C(r);let i=t.clipboardData.getData(`text/plain`);if(i){let r=t.currentTarget.selectionStart;n(e.slice(0,r)+i+e.slice(t.currentTarget.selectionEnd)),requestAnimationFrame(()=>w.current?.setSelectionRange(r+i.length,r+i.length))}}},rows:1,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!o(e.nativeEvent)&&(e.preventDefault(),O&&(l&&(e.metaKey||e.ctrlKey)?l():e.currentTarget.form?.requestSubmit()))}}),(0,c.jsxs)(`div`,{className:`message-composer-footer`,children:[g&&(0,c.jsx)(`div`,{className:`message-composer-actions`,children:g}),_,(0,c.jsx)(`button`,{type:`submit`,className:`primary message-send`,"aria-label":h,title:l?r(`web.MessageComposer.1`,{p0:h}):h,disabled:!O,children:(0,c.jsx)(a,{name:`send`,size:`small`})})]})]})}function u(e,t){let n=(0,s.useRef)(null);return(0,s.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let r=()=>{t?.(e),e.style.height=`0px`,e.style.height=`${e.scrollHeight}px`};r();let i=e.clientWidth,a=new ResizeObserver(()=>{i!==e.clientWidth&&(i=e.clientWidth,r())});return a.observe(e),()=>a.disconnect()},[e,t]),n}export{u as n,l as t};
1
+ import{H as e,V as t,Zt as n,at as r,en as i,f as a}from"./project-links-CodATITq.js";import{o}from"./index-Ck_8bv0N.js";var s=i(n(),1),c=e();function l({value:e,onChange:n,onSubmit:i,onQueue:l,label:d,placeholder:f=r(`web.Computers.57`),disabled:p=!1,sendDisabled:m=!1,sendLabel:h=r(`web.Computers.55`),actions:g,beforeSend:_,heading:v,inset:y=!1,plain:b=!1,attachments:x,hasAttachments:S=!1,onFiles:C}){t();let w=u(e),[T,E]=(0,s.useState)(!1),D=(0,s.useRef)(0),O=!p&&!m&&(!!e.trim()||S);return(0,c.jsxs)(`form`,{className:`message-composer${y?` message-composer-inset`:``}${b?` message-composer-plain`:``}${T?` message-composer-dragging`:``}`,"data-drag-label":r(`web.MessageComposer.2`),onDragEnter:e=>{C&&!p&&e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),D.current++,E(!0))},onDragLeave:()=>{D.current=Math.max(0,D.current-1),D.current||E(!1)},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=C&&!p?`copy`:`none`)},onDrop:e=>{D.current=0,E(!1),e.dataTransfer.files.length&&(e.preventDefault(),C&&!p&&C(Array.from(e.dataTransfer.files)))},onSubmit:e=>{e.preventDefault(),O&&i(e)},children:[v&&(0,c.jsx)(`div`,{className:`message-composer-heading`,children:v}),x,(0,c.jsx)(`textarea`,{ref:w,value:e,onChange:e=>n(e.target.value),"aria-label":d,placeholder:f,disabled:p,onPaste:t=>{let r=t.clipboardData.files.length?Array.from(t.clipboardData.files):Array.from(t.clipboardData.items).flatMap(e=>{let t=e.kind===`file`?e.getAsFile():null;return t?[t]:[]});if(C&&!p&&r.length){t.preventDefault(),C(r);let i=t.clipboardData.getData(`text/plain`);if(i){let r=t.currentTarget.selectionStart;n(e.slice(0,r)+i+e.slice(t.currentTarget.selectionEnd)),requestAnimationFrame(()=>w.current?.setSelectionRange(r+i.length,r+i.length))}}},rows:1,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!o(e.nativeEvent)&&(e.preventDefault(),O&&(l&&(e.metaKey||e.ctrlKey)?l():e.currentTarget.form?.requestSubmit()))}}),(0,c.jsxs)(`div`,{className:`message-composer-footer`,children:[g&&(0,c.jsx)(`div`,{className:`message-composer-actions`,children:g}),_,(0,c.jsx)(`button`,{type:`submit`,className:`primary message-send`,"aria-label":h,title:l?r(`web.MessageComposer.1`,{p0:h}):h,disabled:!O,children:(0,c.jsx)(a,{name:`send`,size:`small`})})]})]})}function u(e,t){let n=(0,s.useRef)(null);return(0,s.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let r=()=>{t?.(e),e.style.height=`0px`,e.style.height=`${e.scrollHeight}px`};r();let i=e.clientWidth,a=new ResizeObserver(()=>{i!==e.clientWidth&&(i=e.clientWidth,r())});return a.observe(e),()=>a.disconnect()},[e,t]),n}export{u as n,l as t};
@@ -1,4 +1,4 @@
1
- import{At as e,Bt as t,C as n,D as r,Dt as i,E as a,Ft as o,Gt as s,H as c,Ht as l,It as u,Jt as d,Kt as f,Lt as p,M as m,Mt as h,O as g,P as _,Pt as v,Q as y,T as b,U as x,V as S,Vt as C,Xt as w,Yt as T,Z as E,Zt as D,_ as O,at as k,d as A,en as j,f as M,h as N,j as P,kt as F,l as ee,nt as I,p as L,q as R,r as z,rt as B,u as te,x as V}from"./project-links-BwYckk7L.js";import{H,J as U,K as W,U as G,X as K,o as ne,q as re,r as ie,tt as q,z as J}from"./index-BCj5CDtq.js";import{t as ae}from"./Conversation-BMA0djTl.js";import{c as oe,l as se,r as ce}from"./WorkspaceTree-C2sVptdG.js";function le(e){return w(v,e)}var Y=j(D(),1),X=s().regex(/^R\d{6,}$/),Z=l({name:s().min(1),sha256:F,size:C().int().nonnegative()}),ue=d().refine(e=>/^https?:\/\//i.test(e),`Use an HTTP or HTTPS URL.`);l({operationId:T(),title:s().trim().default(``),text:s().optional(),url:ue.optional(),originals:u(Z).default([])}).strict().refine(e=>!!e.text?.trim()||!!e.url||e.originals.length>0,`Provide text, a link or a file.`),l({expectedRevision:e,title:s().trim().min(1).optional(),url:ue.nullable().optional(),content:s().optional(),summary:s().optional(),sourceVersion:s().optional(),contentDate:s().optional(),originals:u(Z).optional()}).strict();var de=l({id:X,projectId:s(),title:s(),submittedBy:s(),createdAt:s(),revision:e,source:l({kind:o([`web`,`chat`,`group`]),url:s().nullable(),groupId:s().optional(),messageId:s().optional(),sourceVersion:s().optional(),contentDate:s().optional()}),originals:u(Z),content:s().nullable(),summary:s().nullable(),state:o([`waiting`,`running`,`ready`,`failed`]),error:s().nullable(),url:s()}),fe=l({materials:u(de),nextCursor:C().nullable()});l({query:s().trim().min(1),scope:o([`all`,`workspace`,`materials`]).default(`all`),materialId:X.optional(),originalHash:F.optional(),after:s().default(``),limit:le().int().min(1).max(200).default(30)}).strict();var pe=l({items:u(l({key:s(),kind:o([`workspace`,`materials`]),title:s(),snippet:s(),url:s(),path:s()})),nextCursor:s().nullable()}),Q=c();function me(e){let t=(e.content??``).trimStart().split(`
1
+ import{At as e,Bt as t,C as n,D as r,Dt as i,E as a,Ft as o,Gt as s,H as c,Ht as l,It as u,Jt as d,Kt as f,Lt as p,M as m,Mt as h,O as g,P as _,Pt as v,Q as y,T as b,U as x,V as S,Vt as C,Xt as w,Yt as T,Z as E,Zt as D,_ as O,at as k,d as A,en as j,f as M,h as N,j as P,kt as F,l as ee,nt as I,p as L,q as R,r as z,rt as B,u as te,x as V}from"./project-links-CodATITq.js";import{H,J as U,K as W,U as G,X as K,o as ne,q as re,r as ie,tt as q,z as J}from"./index-Ck_8bv0N.js";import{t as ae}from"./Conversation-Dzr18Rmq.js";import{c as oe,l as se,r as ce}from"./WorkspaceTree-CuwIu3vj.js";function le(e){return w(v,e)}var Y=j(D(),1),X=s().regex(/^R\d{6,}$/),Z=l({name:s().min(1),sha256:F,size:C().int().nonnegative()}),ue=d().refine(e=>/^https?:\/\//i.test(e),`Use an HTTP or HTTPS URL.`);l({operationId:T(),title:s().trim().default(``),text:s().optional(),url:ue.optional(),originals:u(Z).default([])}).strict().refine(e=>!!e.text?.trim()||!!e.url||e.originals.length>0,`Provide text, a link or a file.`),l({expectedRevision:e,title:s().trim().min(1).optional(),url:ue.nullable().optional(),content:s().optional(),summary:s().optional(),sourceVersion:s().optional(),contentDate:s().optional(),originals:u(Z).optional()}).strict();var de=l({id:X,projectId:s(),title:s(),submittedBy:s(),createdAt:s(),revision:e,source:l({kind:o([`web`,`chat`,`group`]),url:s().nullable(),groupId:s().optional(),messageId:s().optional(),sourceVersion:s().optional(),contentDate:s().optional()}),originals:u(Z),content:s().nullable(),summary:s().nullable(),state:o([`waiting`,`running`,`ready`,`failed`]),error:s().nullable(),url:s()}),fe=l({materials:u(de),nextCursor:C().nullable()});l({query:s().trim().min(1),scope:o([`all`,`workspace`,`materials`]).default(`all`),materialId:X.optional(),originalHash:F.optional(),after:s().default(``),limit:le().int().min(1).max(200).default(30)}).strict();var pe=l({items:u(l({key:s(),kind:o([`workspace`,`materials`]),title:s(),snippet:s(),url:s(),path:s()})),nextCursor:s().nullable()}),Q=c();function me(e){let t=(e.content??``).trimStart().split(`
2
2
  `);return t[0]?.replace(/^#\s+/,``).trim()===e.title.trim()&&t[0].startsWith(`# `)&&t.shift(),t.join(`
3
3
  `).trimStart()}function he(){let e=new URLSearchParams(location.search),t=e.get(`id`);return t?{id:t,...e.get(`original`)?{original:e.get(`original`)}:{},...e.get(`revision`)?{revision:e.get(`revision`)}:{}}:void 0}function ge({active:e,onActivate:t,children:r}){S();let{request:i,projectId:o}=q(),[s,c]=(0,Y.useState)(he),[l,u]=(0,Y.useState)(s),[d,f]=(0,Y.useState)(()=>new Set(s?[s.id]:[])),[p,h]=(0,Y.useState)(!1),[v,b]=(0,Y.useState)(``),[x,C]=(0,Y.useState)(``),[w,T]=(0,Y.useState)(``),[D,O]=(0,Y.useState)([]),[A,j]=(0,Y.useState)(),[N,P]=(0,Y.useState)(!1),F=g(),ee=(0,Y.useRef)(null),I=(0,Y.useCallback)(e=>i(`materials`,fe,{signal:e}),[i]),R=m(I,5e3,_(o,`materials`)),z=(0,Y.useCallback)(e=>s?i(`materials/${encodeURIComponent(s.id)}${s.revision?`?revision=${encodeURIComponent(s.revision)}`:``}`,de,{signal:e}):Promise.resolve(null),[i,s?.id,s?.revision]),B=m(z,5e3),V=B.data?.id===s?.id?B.data:null;ie(e?V?.originals.find(e=>e.sha256===s?.original)?.name??V?.title:void 0);let H=[...new Map([...D,...R.data?.materials??[],...V?[V]:[]].map(e=>[e.id,e])).values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id)),U=A===void 0?R.data?.nextCursor:A;function G(e,n=``){t(),c(e),u(e),C(``),T(n),h(!1),f(t=>new Set([...t,e.id])),history.replaceState(null,``,E(`/projects/${o}/materials?${new URLSearchParams({...e})}`))}(0,Y.useEffect)(()=>{let e=()=>{if(!y().endsWith(`/materials`))return;let e=he();c(e),u(e),C(``),b(``),T(``),h(!1),e&&f(t=>new Set([...t,e.id]))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);async function ne(){if(U&&!N){P(!0),F(``);try{let e=await i(`materials?before=${U}`,fe);O(t=>[...t,...e.materials]),j(e.nextCursor)}catch(e){F(e)}finally{P(!1)}}}let re=H.find(e=>e.id===l?.id),ae=re?.originals.find(e=>e.sha256===l?.original)?.name??re?.title??k(`web.Materials.1`);function se(){u(void 0),T(``),ee.current?.focus()}let ce=(0,Q.jsx)(L,{icon:`plus`,label:k(`web.Materials.2`),onClick:()=>{t(),h(!0),F(``)}}),le=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(a,{resource:R}),R.data?H.length===0?(0,Q.jsx)(`p`,{className:`tree-status`,children:k(`web.Materials.3`)}):(0,Q.jsx)(Q.Fragment,{children:H.map(t=>(0,Q.jsxs)(`div`,{role:`none`,children:[(0,Q.jsxs)(K,{role:`treeitem`,"aria-level":1,"aria-expanded":d.has(t.id),"aria-selected":e&&!p&&s?.id===t.id&&!s.original,className:`tree-item tree-folder`,style:{"--tree-level":1},"data-testid":`material-folder`,title:t.title,onClick:()=>{let e=d.has(t.id);G({id:t.id}),e&&f(e=>{let n=new Set(e);return n.delete(t.id),n})},leading:(0,Q.jsx)(`span`,{className:`tree-chevron ${d.has(t.id)?`expanded`:``}`,children:(0,Q.jsx)(M,{name:`chevron`,size:`small`})}),children:[(0,Q.jsx)(M,{name:`files`}),(0,Q.jsx)(`span`,{className:`tree-name`,children:t.title})]}),d.has(t.id)&&(0,Q.jsx)(`div`,{role:`group`,children:[...t.originals].sort((e,t)=>oe(e.name,t.name)).map((n,r)=>(0,Q.jsxs)(K,{role:`treeitem`,"aria-level":2,"aria-selected":e&&!p&&s?.id===t.id&&s.original===n.sha256,className:`tree-item`,style:{"--tree-level":2},"data-testid":`material-original`,title:n.name,onClick:()=>G({id:t.id,original:n.sha256,...t.id===s?.id&&s.revision?{revision:s.revision}:{}}),leading:(0,Q.jsx)(`span`,{className:`tree-chevron`}),children:[(0,Q.jsx)(M,{name:`file`}),(0,Q.jsx)(`span`,{className:`tree-name`,children:n.name})]},`${n.sha256}:${r}`))})]},t.id))}):!R.error&&(0,Q.jsx)(`p`,{className:`tree-status`,children:k(`web.Memory.4`)}),U&&(0,Q.jsx)(`button`,{className:`tree-action`,disabled:N,onClick:()=>void ne(),children:k(N?`web.Memory.4`:`web.labels.52`)})]}),X=!p&&!x&&s?.original,Z=p?k(`web.Materials.2`):x?k(`web.Materials.4`):V?.title||k(`web.Materials.5`);return r({tree:le,reader:(0,Q.jsxs)(`section`,{className:`session-reader`,"aria-label":k(`web.Materials.6`),children:[X&&V?(0,Q.jsx)(ve,{material:V,hash:X,highlight:w,error:B.error},`${V.id}:${X}`):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(W,{title:Z}),(0,Q.jsx)(`div`,{className:`session-reader-content`,children:p?(0,Q.jsx)(Se,{onCancel:()=>h(!1),onSaved:e=>{G({id:e}),R.reload()}}):x?(0,Q.jsx)(_e,{query:x,scope:l,onSelect:e=>G(e,x)},`${x}/${l?.id}/${l?.original}`):s?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(a,{resource:B}),V?(0,Q.jsxs)(`article`,{className:`material-body`,children:[s.revision&&(0,Q.jsx)(`button`,{className:`material-link`,onClick:()=>G({id:s.id}),children:k(`web.Materials.7`)}),!s.revision&&(V.state===`waiting`||V.state===`running`)?(0,Q.jsx)(`p`,{className:`muted`,role:`status`,children:k(`web.Materials.8`)}):null,(0,Q.jsx)(n,{children:V.error}),!s.revision&&V.state===`failed`&&(0,Q.jsx)(`button`,{onClick:()=>void i(`materials/${s.id}/retry`,de,{method:`POST`}).then(()=>B.reload()).catch(e=>F(e)),children:k(`web.Materials.9`)}),V.content?(0,Q.jsx)(`div`,{className:`markdown`,children:(0,Q.jsx)(J,{highlight:w,children:me(V)})}):(0,Q.jsx)(`p`,{className:`muted`,children:k(`web.Materials.10`)})]}):!B.error&&(0,Q.jsx)(`p`,{role:`status`,children:k(`web.Memory.4`)})]}):(0,Q.jsx)(te,{mascot:!0,title:k(`web.Materials.11`),description:k(`web.Materials.12`)})})]}),!p&&(0,Q.jsxs)(`form`,{className:`session-search-dock`,"data-testid":`material-search-form`,onSubmit:e=>{e.preventDefault(),C(v.trim()),T(``)},children:[l&&(0,Q.jsxs)(`button`,{type:`button`,className:`search-scope-chip`,title:k(`web.Materials.13`),"aria-label":k(`web.Materials.14`,{p0:ae}),onClick:se,children:[(0,Q.jsxs)(`span`,{className:`scope-label`,children:[k(`web.Materials.15`),ae]}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]}),(0,Q.jsxs)(`div`,{className:`session-search-input-row`,children:[(0,Q.jsx)(`input`,{ref:ee,"aria-label":k(`web.Materials.16`),placeholder:k(`web.Materials.17`),value:v,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Backspace`&&!v&&l&&(e.preventDefault(),se())}}),(x||v||w)&&(0,Q.jsx)(L,{icon:`close`,label:k(`web.Materials.18`),onClick:()=>{b(``),C(``),T(``),ee.current?.focus()}}),(0,Q.jsx)(L,{icon:`search`,type:`submit`,label:k(`web.Materials.19`),disabled:!v.trim()})]})]})]}),actions:ce,href:`/projects/${o}/materials${s&&!p?`?${new URLSearchParams({...s})}`:``}`})}function _e({query:e,scope:t,onSelect:n}){S();let{request:r}=q(),[i,o]=(0,Y.useState)(``),s=(0,Y.useCallback)(n=>r(`resources/search?${new URLSearchParams({query:e,scope:`materials`,after:i,...t?{materialId:t.id}:{},...t?.original?{originalHash:t.original}:{}})}`,pe,{signal:n}),[r,e,t?.id,t?.original,i]),c=m(s);return(0,Q.jsxs)(`section`,{className:`session-results stack`,"aria-label":k(`web.Materials.4`),children:[(0,Q.jsx)(a,{resource:c}),c.loading?(0,Q.jsx)(`p`,{role:`status`,children:k(`web.Materials.20`)}):c.data?.items.length===0?(0,Q.jsx)(`p`,{className:`empty`,children:k(`web.Materials.21`)}):c.data?.items.map(t=>(0,Q.jsxs)(`button`,{className:`session-item`,"data-testid":`material-match`,onClick:()=>{let e=new URL(t.url,location.origin).searchParams;n({id:e.get(`id`),...e.get(`original`)?{original:e.get(`original`)}:{},...e.get(`revision`)?{revision:e.get(`revision`)}:{}})},children:[(0,Q.jsx)(`strong`,{children:t.title.replace(/^R\d+ · /,``)}),(0,Q.jsx)(`span`,{className:`session-excerpt`,children:(0,Q.jsx)(H,{value:G(t.snippet,e),query:e})})]},t.key)),c.data?.nextCursor&&(0,Q.jsx)(`button`,{disabled:c.loading,onClick:()=>o(c.data.nextCursor),children:k(`web.Materials.22`)})]})}function ve({material:e,hash:t,highlight:r,error:i}){S();let{projectId:o}=q(),s=e.originals.find(e=>e.sha256===t),c=E(`/api/v1/projects/${o}/materials/${e.id}/originals/${t}?revision=${e.revision}`),[l,u]=(0,Y.useState)(!1),d=(0,Y.useCallback)(async e=>{let t=await fetch(c,{signal:e});if(!t.ok)throw new x(`HTTP_ERROR`,k(`web.Materials.23`),t.status);let n=await t.arrayBuffer();try{let e=new TextDecoder(`utf8`,{fatal:!0}).decode(n);return e.includes(`\0`)?null:e}catch{return null}},[c]),f=m(d,!1,_(o,`material-original`,t));if(!s)return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(W,{title:k(`web.Materials.24`)}),(0,Q.jsx)(`div`,{className:`session-reader-content`,children:(0,Q.jsx)(n,{announce:!0,children:k(`web.Materials.25`)})})]});let p=/\.(md|markdown)$/i.test(s.name),h=/\.html?$/i.test(s.name);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(W,{title:s.name,actions:(0,Q.jsxs)(`div`,{className:`toolbar-actions`,children:[(p||h)&&(0,Q.jsx)(L,{icon:l?`preview`:`code`,label:k(l?`web.Materials.26`:`web.Materials.27`),"aria-pressed":l,onClick:()=>u(!l)}),(0,Q.jsx)(`a`,{className:`icon-button`,"aria-label":k(`web.Materials.28`),title:k(`web.Materials.28`),href:c,download:s.name,children:(0,Q.jsx)(M,{name:`download`})})]})}),(0,Q.jsxs)(`div`,{className:`session-reader-content`,children:[(0,Q.jsx)(b,{message:i}),(0,Q.jsx)(a,{resource:f}),f.loading&&f.data===void 0?(0,Q.jsx)(`p`,{role:`status`,children:k(`web.Memory.4`)}):f.data===null?(0,Q.jsx)(`p`,{className:`muted`,children:k(`web.Materials.29`)}):f.data!==void 0&&(0,Q.jsx)(`div`,{className:`preview-body${h&&!l?` preview-body-html`:``}`,"data-testid":`material-original-content`,children:h&&!l?(0,Q.jsx)(se,{url:c,name:s.name}):p&&!l?(0,Q.jsx)(`article`,{className:`markdown`,children:(0,Q.jsx)(J,{highlight:r,children:f.data})}):(0,Q.jsx)(`pre`,{className:`raw`,children:(0,Q.jsx)(H,{value:f.data,query:r})})})]})]})}function ye(e){if(e.kind===`text`){try{if([`http:`,`https:`].includes(new URL(e.text.trim()).protocol))return`link`}catch{}return`text`}let{name:t,type:n}=e.file;return n.startsWith(`image/`)||/\.(png|jpe?g|gif|webp|svg|heic|avif)$/i.test(t)?`imageFile`:/\.(csv|tsv|xlsx?|ods)$/i.test(t)?`spreadsheetFile`:/\.(json|ya?ml|xml|html?|css|[cm]?[jt]sx?|py|go|rs|sh|sql)$/i.test(t)?`codeFile`:n.startsWith(`text/`)||/\.(pdf|docx?|odt|rtf|md|txt)$/i.test(t)?`file`:`attachment`}function be(e){try{return new URL(e.trim()).hostname}catch{return e.trim().split(`
4
4
  `)[0]?.slice(0,80)||k(`web.Materials.30`)}}function xe(e){try{return new URL(e.trim()).href}catch{return e.trim().split(`
@@ -1,4 +1,4 @@
1
- import{H as e,O as t,V as n,Zt as r,a as i,at as a,en as o,f as s,h as c,k as l,p as u}from"./project-links-BwYckk7L.js";import{K as d,V as f}from"./index-BCj5CDtq.js";import{t as p}from"./Computers-CEBC9xd4.js";var m=o(r(),1),h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{for(var i=r>1?void 0:r?g(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&h(t,n,i),i},y=(e,t)=>(n,r)=>t(n,r,e),ee=`Terminal input`,te={get:()=>ee,set:e=>ee=e},ne=`Too much output to announce, navigate to rows manually to read`,re={get:()=>ne,set:e=>ne=e};function b(e){return e.replace(/\r?\n/g,`\r`)}function ie(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function ae(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function x(e,t,n,r){e.stopPropagation(),e.clipboardData&&oe(e.clipboardData.getData(`text/plain`),t,n,r)}function oe(e,t,n,r){e=b(e),e=ie(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function S(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function se(e,t,n,r,i){S(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function C(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ce(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var w=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},le=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128||(c=(i&31)<<6|a&63,c<128)){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},ue=``,de=` `,fe=class e{constructor(){this.fg=0,this.bg=0,this.extended=new pe}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},pe=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},T=class e extends fe{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new pe,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?C(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},me=`di$target`,E=`di$dependencies`,he=new Map;function ge(e){return e[E]||[]}function D(e){if(he.has(e))return he.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);_e(t,e,r)};return t._id=e,he.set(e,t),t}function _e(e,t,n){t[me]===t?t[E].push({id:e,index:n}):(t[E]=[{id:e,index:n}],t[me]=t)}var O=D(`BufferService`),ve=D(`CoreMouseService`),ye=D(`CoreService`),be=D(`CharsetService`),xe=D(`InstantiationService`),Se=D(`LogService`),k=D(`OptionsService`),Ce=D(`OscLinkService`),we=D(`UnicodeService`),Te=D(`DecorationService`),Ee=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new T,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):De(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Ee=v([y(0,O),y(1,k),y(2,Ce)],Ee);function De(e,t){if(confirm(`Do you want to navigate to ${t}?
1
+ import{H as e,O as t,V as n,Zt as r,a as i,at as a,en as o,f as s,h as c,k as l,p as u}from"./project-links-CodATITq.js";import{K as d,V as f}from"./index-Ck_8bv0N.js";import{t as p}from"./Computers-B-FvcufX.js";var m=o(r(),1),h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{for(var i=r>1?void 0:r?g(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&h(t,n,i),i},y=(e,t)=>(n,r)=>t(n,r,e),ee=`Terminal input`,te={get:()=>ee,set:e=>ee=e},ne=`Too much output to announce, navigate to rows manually to read`,re={get:()=>ne,set:e=>ne=e};function b(e){return e.replace(/\r?\n/g,`\r`)}function ie(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function ae(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function x(e,t,n,r){e.stopPropagation(),e.clipboardData&&oe(e.clipboardData.getData(`text/plain`),t,n,r)}function oe(e,t,n,r){e=b(e),e=ie(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function S(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function se(e,t,n,r,i){S(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function C(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ce(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var w=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},le=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128||(c=(i&31)<<6|a&63,c<128)){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},ue=``,de=` `,fe=class e{constructor(){this.fg=0,this.bg=0,this.extended=new pe}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},pe=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},T=class e extends fe{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new pe,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?C(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},me=`di$target`,E=`di$dependencies`,he=new Map;function ge(e){return e[E]||[]}function D(e){if(he.has(e))return he.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);_e(t,e,r)};return t._id=e,he.set(e,t),t}function _e(e,t,n){t[me]===t?t[E].push({id:e,index:n}):(t[E]=[{id:e,index:n}],t[me]=t)}var O=D(`BufferService`),ve=D(`CoreMouseService`),ye=D(`CoreService`),be=D(`CharsetService`),xe=D(`InstantiationService`),Se=D(`LogService`),k=D(`OptionsService`),Ce=D(`OscLinkService`),we=D(`UnicodeService`),Te=D(`DecorationService`),Ee=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new T,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):De(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Ee=v([y(0,O),y(1,k),y(2,Ce)],Ee);function De(e,t){if(confirm(`Do you want to navigate to ${t}?
2
2
 
3
3
  WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var Oe=D(`CharSizeService`),ke=D(`CoreBrowserService`),Ae=D(`MouseService`),je=D(`RenderService`),Me=D(`SelectionService`),Ne=D(`CharacterJoinerService`),Pe=D(`ThemeService`),Fe=D(`LinkProviderService`),Ie=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?He.isErrorNoTelemetry(e)?new He(e.message+`
4
4
 
@@ -1 +1 @@
1
- import{At as e,Bt as t,E as n,Gt as r,H as i,Ht as a,It as o,Kt as s,M as c,Mt as l,O as u,Ot as d,P as f,V as p,Zt as m,at as h,en as g,f as _}from"./project-links-BwYckk7L.js";import{X as v,tt as y}from"./index-BCj5CDtq.js";var b=i();function x({url:e,name:t}){return p(),(0,b.jsx)(`iframe`,{className:`html-preview`,title:h(`web.HtmlPreview.1`,{p0:t}),src:`${e}${e.includes(`?`)?`&`:`?`}view=html`,sandbox:``,referrerPolicy:`no-referrer`})}var S=g(m(),1),C=new Intl.Collator(`zh-CN`,{numeric:!0,sensitivity:`base`});function w(e,t){return C.compare(e,t)||(e<t?-1:+(e>t))}var T=`_project`,E=`_resources`,D=e=>e===`_project`||e===`_resources`,O=e=>/^_memory(?:\/|$)/i.test(e);s([l,t(T),t(E)]);var k=r().max(255).refine(e=>{let t=e.endsWith(`/`),n=t?e.slice(0,-1):e;return d.safeParse(n).success&&!n.includes(`/`)&&!n.startsWith(`.`)&&!/^_?teammy/i.test(n)&&!O(n)&&(t?n.startsWith(`_`):n.includes(`.`))},`Use a root file (README.md) or an underscore-prefixed directory (_template/).`);a({maintainer:l.nullable(),paths:o(k).max(30).refine(e=>new Set(e.map(e=>e.toLowerCase())).size===e.length),revision:e}).strict().omit({revision:!0}).extend({expectedRevision:e}).strict();function A(e){return e.split(`/`).some(e=>/^\.teammy(?:[-.]|$)/i.test(e))}function j(e){let t=e.target.closest(`[role="treeitem"]`);if(!t)return;let n=[...e.currentTarget.querySelectorAll(`[role="treeitem"]`)].filter(e=>!e.closest(`[hidden]`)),r=n.indexOf(t),i=Number(t.getAttribute(`aria-level`)),a;switch(e.key){case`ArrowDown`:a=n[r+1];break;case`ArrowUp`:a=n[r-1];break;case`Home`:a=n[0];break;case`End`:a=n.at(-1);break;case`ArrowRight`:t.getAttribute(`aria-expanded`)===`false`?t.click():Number(n[r+1]?.getAttribute(`aria-level`))>i&&(a=n[r+1]);break;case`ArrowLeft`:t.getAttribute(`aria-expanded`)===`true`?t.click():a=n.slice(0,r).reverse().find(e=>Number(e.getAttribute(`aria-level`))<i);break;default:return}e.preventDefault(),a?.focus()}var M=(e,t)=>`${e}/${t}`,N=e=>({"--tree-level":e});function P({members:e,...t}){p();let[n,r]=(0,S.useState)(()=>`folder:${M(e.find(e=>e.hasFiles)?.id??`_project`,``)}`);return(0,b.jsx)(`div`,{role:`tree`,"aria-label":h(`web.WorkspaceTree.1`),"data-testid":`workspace-tree`,onKeyDown:j,children:(0,b.jsx)(I,{owner:T,path:``,level:1,members:e.filter(e=>e.hasFiles),context:{...t,focused:n,onFocus:r}})})}function F({owner:e,path:t,level:n,context:r}){p();let i=r.expanded.has(M(e,t)),a=`folder:${M(e,t)}`;return(0,b.jsxs)(`div`,{role:`none`,children:[(0,b.jsxs)(v,{type:`button`,role:`treeitem`,className:`tree-item tree-folder`,style:N(n),"aria-label":t||e,"aria-level":n,"aria-expanded":i,"aria-selected":r.selected?.kind===`directory`&&r.selected.owner===e&&r.selected.path===t,tabIndex:r.focused===a?0:-1,"data-testid":`directory-row`,"data-owner-id":e,"data-directory-path":t,onFocus:()=>r.onFocus(a),onClick:()=>r.onToggle(e,t),leading:(0,b.jsx)(`span`,{className:`tree-chevron ${i?`expanded`:``}`,children:(0,b.jsx)(_,{name:`chevron`,size:`small`})}),children:[(0,b.jsx)(_,{name:`files`}),(0,b.jsx)(`span`,{className:`tree-name`,children:t.split(`/`).at(-1)||e})]}),i&&(0,b.jsx)(I,{owner:e,path:t,level:n+1,context:r})]})}function I({owner:e,path:t,level:r,context:i,members:a=[]}){p();let{api:o,projectId:s}=y(),l=(0,S.useCallback)(n=>o.tree(e,t,void 0,``,n),[e,t]),d=c(l,!1,f(s,`file-tree`,e,t)),[m,g]=(0,S.useState)(),[x,C]=(0,S.useState)(!1),T=u(),E=(0,S.useRef)(null);(0,S.useEffect)(()=>()=>E.current?.abort(),[]);let k=m?.revision===d.data?.revision?m:void 0,j=k?k.nextCursor:d.data?.nextCursor;async function P(){if(!j||!d.data||x)return;C(!0),T(``);let n=new AbortController;E.current=n;try{let r=await o.tree(e,t,d.data.revision,j,n.signal);n.signal.aborted||g({...r,entries:[...k?.entries??[],...r.entries]})}catch(e){n.signal.aborted||T(e)}finally{n.signal.aborted||C(!1)}}let I=[...(d.data?.entries??[]).filter(e=>!A(e.path)),...(k?.entries??[]).filter(e=>!A(e.path))],L=i.revealed;if(L?.owner===e&&!A(L.path)&&(!t||L.path.startsWith(t+`/`))){let e=t?L.path.slice(t.length+1):L.path,n=e.indexOf(`/`),r=n<0?L.path:[t,e.slice(0,n)].filter(Boolean).join(`/`);I.some(e=>e.path===r)||I.push(n<0?{...L.file,kind:`file`}:{kind:`directory`,path:r})}let R=[...I.filter(t=>e!==`_project`||!O(t.path)).map(t=>({...t,owner:e})),...a.map(e=>({kind:`directory`,path:``,owner:e.id}))].sort((e,t)=>e.kind===t.kind?w(e.path.split(`/`).at(-1)||e.owner,t.path.split(`/`).at(-1)||t.owner):e.kind===`directory`?-1:1);return(0,b.jsxs)(`div`,{role:`group`,"aria-label":M(D(e)?`teamcontext`:e,t),"aria-busy":d.loading||x,children:[d.loading&&(0,b.jsx)(`p`,{className:`tree-status`,role:`status`,children:h(`web.labels.9`)}),(0,b.jsx)(n,{resource:d}),R.map(t=>t.kind===`directory`?(0,b.jsx)(F,{owner:t.owner,path:t.path,level:r,context:i},M(t.owner,t.path)):(0,b.jsxs)(v,{type:`button`,role:`treeitem`,className:`tree-item`,style:N(r),"aria-label":t.path,"aria-level":r,"aria-selected":i.selected?.kind===`file`&&i.selected.owner===e&&i.selected.path===t.path,tabIndex:i.focused===`file:${M(e,t.path)}`?0:-1,"data-testid":`file-row`,"data-owner-id":e,"data-file-path":t.path,onFocus:()=>i.onFocus(`file:${M(e,t.path)}`),onClick:()=>i.onSelect(e,t.path),leading:(0,b.jsx)(`span`,{className:`tree-chevron`}),children:[(0,b.jsx)(_,{name:`file`}),(0,b.jsx)(`span`,{className:`tree-name`,children:t.path.split(`/`).at(-1)})]},t.path)),j&&(0,b.jsx)(`button`,{className:`tree-action`,"data-testid":`files-load-more`,disabled:x,onClick:()=>void P(),children:h(x?`web.labels.9`:`web.labels.52`)})]})}export{O as a,w as c,T as i,x as l,M as n,A as o,j as r,D as s,P as t};
1
+ import{At as e,Bt as t,E as n,Gt as r,H as i,Ht as a,It as o,Kt as s,M as c,Mt as l,O as u,Ot as d,P as f,V as p,Zt as m,at as h,en as g,f as _}from"./project-links-CodATITq.js";import{X as v,tt as y}from"./index-Ck_8bv0N.js";var b=i();function x({url:e,name:t}){return p(),(0,b.jsx)(`iframe`,{className:`html-preview`,title:h(`web.HtmlPreview.1`,{p0:t}),src:`${e}${e.includes(`?`)?`&`:`?`}view=html`,sandbox:``,referrerPolicy:`no-referrer`})}var S=g(m(),1),C=new Intl.Collator(`zh-CN`,{numeric:!0,sensitivity:`base`});function w(e,t){return C.compare(e,t)||(e<t?-1:+(e>t))}var T=`_project`,E=`_resources`,D=e=>e===`_project`||e===`_resources`,O=e=>/^_memory(?:\/|$)/i.test(e);s([l,t(T),t(E)]);var k=r().max(255).refine(e=>{let t=e.endsWith(`/`),n=t?e.slice(0,-1):e;return d.safeParse(n).success&&!n.includes(`/`)&&!n.startsWith(`.`)&&!/^_?teammy/i.test(n)&&!O(n)&&(t?n.startsWith(`_`):n.includes(`.`))},`Use a root file (README.md) or an underscore-prefixed directory (_template/).`);a({maintainer:l.nullable(),paths:o(k).max(30).refine(e=>new Set(e.map(e=>e.toLowerCase())).size===e.length),revision:e}).strict().omit({revision:!0}).extend({expectedRevision:e}).strict();function A(e){return e.split(`/`).some(e=>/^\.teammy(?:[-.]|$)/i.test(e))}function j(e){let t=e.target.closest(`[role="treeitem"]`);if(!t)return;let n=[...e.currentTarget.querySelectorAll(`[role="treeitem"]`)].filter(e=>!e.closest(`[hidden]`)),r=n.indexOf(t),i=Number(t.getAttribute(`aria-level`)),a;switch(e.key){case`ArrowDown`:a=n[r+1];break;case`ArrowUp`:a=n[r-1];break;case`Home`:a=n[0];break;case`End`:a=n.at(-1);break;case`ArrowRight`:t.getAttribute(`aria-expanded`)===`false`?t.click():Number(n[r+1]?.getAttribute(`aria-level`))>i&&(a=n[r+1]);break;case`ArrowLeft`:t.getAttribute(`aria-expanded`)===`true`?t.click():a=n.slice(0,r).reverse().find(e=>Number(e.getAttribute(`aria-level`))<i);break;default:return}e.preventDefault(),a?.focus()}var M=(e,t)=>`${e}/${t}`,N=e=>({"--tree-level":e});function P({members:e,...t}){p();let[n,r]=(0,S.useState)(()=>`folder:${M(e.find(e=>e.hasFiles)?.id??`_project`,``)}`);return(0,b.jsx)(`div`,{role:`tree`,"aria-label":h(`web.WorkspaceTree.1`),"data-testid":`workspace-tree`,onKeyDown:j,children:(0,b.jsx)(I,{owner:T,path:``,level:1,members:e.filter(e=>e.hasFiles),context:{...t,focused:n,onFocus:r}})})}function F({owner:e,path:t,level:n,context:r}){p();let i=r.expanded.has(M(e,t)),a=`folder:${M(e,t)}`;return(0,b.jsxs)(`div`,{role:`none`,children:[(0,b.jsxs)(v,{type:`button`,role:`treeitem`,className:`tree-item tree-folder`,style:N(n),"aria-label":t||e,"aria-level":n,"aria-expanded":i,"aria-selected":r.selected?.kind===`directory`&&r.selected.owner===e&&r.selected.path===t,tabIndex:r.focused===a?0:-1,"data-testid":`directory-row`,"data-owner-id":e,"data-directory-path":t,onFocus:()=>r.onFocus(a),onClick:()=>r.onToggle(e,t),leading:(0,b.jsx)(`span`,{className:`tree-chevron ${i?`expanded`:``}`,children:(0,b.jsx)(_,{name:`chevron`,size:`small`})}),children:[(0,b.jsx)(_,{name:`files`}),(0,b.jsx)(`span`,{className:`tree-name`,children:t.split(`/`).at(-1)||e})]}),i&&(0,b.jsx)(I,{owner:e,path:t,level:n+1,context:r})]})}function I({owner:e,path:t,level:r,context:i,members:a=[]}){p();let{api:o,projectId:s}=y(),l=(0,S.useCallback)(n=>o.tree(e,t,void 0,``,n),[e,t]),d=c(l,!1,f(s,`file-tree`,e,t)),[m,g]=(0,S.useState)(),[x,C]=(0,S.useState)(!1),T=u(),E=(0,S.useRef)(null);(0,S.useEffect)(()=>()=>E.current?.abort(),[]);let k=m?.revision===d.data?.revision?m:void 0,j=k?k.nextCursor:d.data?.nextCursor;async function P(){if(!j||!d.data||x)return;C(!0),T(``);let n=new AbortController;E.current=n;try{let r=await o.tree(e,t,d.data.revision,j,n.signal);n.signal.aborted||g({...r,entries:[...k?.entries??[],...r.entries]})}catch(e){n.signal.aborted||T(e)}finally{n.signal.aborted||C(!1)}}let I=[...(d.data?.entries??[]).filter(e=>!A(e.path)),...(k?.entries??[]).filter(e=>!A(e.path))],L=i.revealed;if(L?.owner===e&&!A(L.path)&&(!t||L.path.startsWith(t+`/`))){let e=t?L.path.slice(t.length+1):L.path,n=e.indexOf(`/`),r=n<0?L.path:[t,e.slice(0,n)].filter(Boolean).join(`/`);I.some(e=>e.path===r)||I.push(n<0?{...L.file,kind:`file`}:{kind:`directory`,path:r})}let R=[...I.filter(t=>e!==`_project`||!O(t.path)).map(t=>({...t,owner:e})),...a.map(e=>({kind:`directory`,path:``,owner:e.id}))].sort((e,t)=>e.kind===t.kind?w(e.path.split(`/`).at(-1)||e.owner,t.path.split(`/`).at(-1)||t.owner):e.kind===`directory`?-1:1);return(0,b.jsxs)(`div`,{role:`group`,"aria-label":M(D(e)?`teamcontext`:e,t),"aria-busy":d.loading||x,children:[d.loading&&(0,b.jsx)(`p`,{className:`tree-status`,role:`status`,children:h(`web.labels.9`)}),(0,b.jsx)(n,{resource:d}),R.map(t=>t.kind===`directory`?(0,b.jsx)(F,{owner:t.owner,path:t.path,level:r,context:i},M(t.owner,t.path)):(0,b.jsxs)(v,{type:`button`,role:`treeitem`,className:`tree-item`,style:N(r),"aria-label":t.path,"aria-level":r,"aria-selected":i.selected?.kind===`file`&&i.selected.owner===e&&i.selected.path===t.path,tabIndex:i.focused===`file:${M(e,t.path)}`?0:-1,"data-testid":`file-row`,"data-owner-id":e,"data-file-path":t.path,onFocus:()=>i.onFocus(`file:${M(e,t.path)}`),onClick:()=>i.onSelect(e,t.path),leading:(0,b.jsx)(`span`,{className:`tree-chevron`}),children:[(0,b.jsx)(_,{name:`file`}),(0,b.jsx)(`span`,{className:`tree-name`,children:t.path.split(`/`).at(-1)})]},t.path)),j&&(0,b.jsx)(`button`,{className:`tree-action`,"data-testid":`files-load-more`,disabled:x,onClick:()=>void P(),children:h(x?`web.labels.9`:`web.labels.52`)})]})}export{O as a,w as c,T as i,x as l,M as n,A as o,j as r,D as s,P as t};
@@ -1 +1 @@
1
- import{Ot as e}from"./project-links-BwYckk7L.js";function t(t,n){if(!n||/^(?:[a-z][a-z0-9+.-]*:|\/)/i.test(n))return null;try{let r=n.split(/[?#]/,1)[0],i=r?t.split(`/`).slice(0,-1):t.split(`/`);for(let e of r.split(`/`)){let t=decodeURIComponent(e);if(t&&t!==`.`){if(t===`..`){if(!i.length)return null;i.pop()}else{if(t.includes(`/`)||t.includes(`\\`))return null;i.push(t)}}}return{path:i.length?e.parse(i.join(`/`)):``,directory:r.endsWith(`/`),anchor:n.includes(`#`)?decodeURIComponent(n.slice(n.indexOf(`#`)+1)):``}}catch{return null}}export{t};
1
+ import{Ot as e}from"./project-links-CodATITq.js";function t(t,n){if(!n||/^(?:[a-z][a-z0-9+.-]*:|\/)/i.test(n))return null;try{let r=n.split(/[?#]/,1)[0],i=r?t.split(`/`).slice(0,-1):t.split(`/`);for(let e of r.split(`/`)){let t=decodeURIComponent(e);if(t&&t!==`.`){if(t===`..`){if(!i.length)return null;i.pop()}else{if(t.includes(`/`)||t.includes(`\\`))return null;i.push(t)}}}return{path:i.length?e.parse(i.join(`/`)):``,directory:r.endsWith(`/`),anchor:n.includes(`#`)?decodeURIComponent(n.slice(n.indexOf(`#`)+1)):``}}catch{return null}}export{t};