@teammy/server 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +8 -2
- package/dist/web/assets/{Assistant-ZM9at-n8.js → Assistant-Ceif-ARy.js} +1 -1
- package/dist/web/assets/{Computers-CV-4FaxZ.js → Computers-B_8KVFSv.js} +1 -1
- package/dist/web/assets/{Conversation-CZ8mOF1T.js → Conversation-1APTn0kq.js} +1 -1
- package/dist/web/assets/Dashboard-B-LuQT0a.js +1 -0
- package/dist/web/assets/{Files-DD-tWR-r.js → Files-BdfIlw8b.js} +1 -1
- package/dist/web/assets/{Help-DGI26Qe5.js → Help-BXvLax7h.js} +4 -4
- package/dist/web/assets/{HtmlPreview-TOlZ7wbO.js → HtmlPreview-BcspnVI6.js} +1 -1
- package/dist/web/assets/{Markdown-Drn0H2RJ.js → Markdown-Bb9dy2Sh.js} +1 -1
- package/dist/web/assets/{MessageComposer-SftlQB1e.js → MessageComposer-B6iTInqD.js} +1 -1
- package/dist/web/assets/{ResourceLibrary-RyTep8PC.js → ResourceLibrary-CXqTEv7V.js} +1 -1
- package/dist/web/assets/{WorkspaceTree-BEiahyEL.js → WorkspaceTree-D0UUUBtF.js} +1 -1
- package/dist/web/assets/{file-links-BYBi3BDP.js → file-links-B0q73ekI.js} +1 -1
- package/dist/web/assets/{index-BQicHl1a.js → index-C5-iSe99.js} +2 -2
- package/dist/web/downloads/teammy-skill.zip +0 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/Dashboard-wZpQ1Qxb.js +0 -1
package/dist/main.js
CHANGED
|
@@ -2854,6 +2854,11 @@ var Matters = class {
|
|
|
2854
2854
|
}
|
|
2855
2855
|
mark(identity, id, cursor) {
|
|
2856
2856
|
this.requireMember(identity, id);
|
|
2857
|
+
this.hub.db.prepare(
|
|
2858
|
+
`INSERT INTO web_group_reads(conversation_id,member_id,read_seq)
|
|
2859
|
+
VALUES(?,?,MIN(?,COALESCE((SELECT MAX(seq) FROM agent_messages WHERE conversation_id=?),0)))
|
|
2860
|
+
ON CONFLICT(conversation_id,member_id) DO UPDATE SET read_seq=MAX(read_seq,excluded.read_seq)`
|
|
2861
|
+
).run(id, identity.memberId, cursor, id);
|
|
2857
2862
|
this.hub.db.prepare(
|
|
2858
2863
|
`UPDATE agent_matter_members SET read_seq=MAX(read_seq,MIN(?,COALESCE((SELECT MAX(seq) FROM agent_messages WHERE conversation_id=?),0))) WHERE conversation_id=? AND member_id=?`
|
|
2859
2864
|
).run(cursor, id, id, identity.memberId);
|
|
@@ -6496,10 +6501,11 @@ var WebChannels = class {
|
|
|
6496
6501
|
COALESCE((SELECT body FROM agent_messages WHERE conversation_id=c.id ORDER BY seq LIMIT 1),'') summary,
|
|
6497
6502
|
COALESCE((SELECT author FROM web_channel_topics WHERE conversation_id=c.id),(SELECT author FROM agent_messages WHERE conversation_id=c.id ORDER BY seq LIMIT 1),'') author,
|
|
6498
6503
|
MAX(0,(SELECT COUNT(*) FROM agent_messages WHERE conversation_id=c.id)-1) replies,
|
|
6499
|
-
EXISTS(SELECT 1 FROM agent_messages s WHERE s.conversation_id=c.id AND s.seq>COALESCE(p.read_seq,0)) unread
|
|
6504
|
+
EXISTS(SELECT 1 FROM agent_messages s WHERE s.conversation_id=c.id AND s.seq>MAX(COALESCE(p.read_seq,0),COALESCE(r.read_seq,0))) unread
|
|
6500
6505
|
FROM project_agent_conversations c JOIN agent_matters m ON m.conversation_id=c.id LEFT JOIN agent_matter_members p ON p.conversation_id=c.id AND p.member_id=?
|
|
6506
|
+
LEFT JOIN web_group_reads r ON r.conversation_id=c.id AND r.member_id=?
|
|
6501
6507
|
WHERE c.project_id=? AND (m.visibility='project' OR p.member_id IS NOT NULL) AND ${channelTopicPredicate} ORDER BY updated_at DESC,c.id`
|
|
6502
|
-
).all(identity.memberId, identity.workspaceId);
|
|
6508
|
+
).all(identity.memberId, identity.memberId, identity.workspaceId);
|
|
6503
6509
|
return {
|
|
6504
6510
|
topics: rows.map((r) => ({
|
|
6505
6511
|
id: String(r.id),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e,G as t,H as n,I as r,J as i,K as ee,L as a,N as o,P as s,U as c,W as l,_t as u,a as te,dt as d,g as f,i as ne,lt as p,n as m,o as h,ot as g,pt as re,r as ie,st as _,t as ae,ut as v,vt as oe,y as se}from"./index-BQicHl1a.js";import{t as y}from"./Markdown-Drn0H2RJ.js";import{a as ce,i as le,n as ue,r as de,t as fe}from"./Conversation-CZ8mOF1T.js";import{t as pe}from"./MessageComposer-SftlQB1e.js";var b=u(),x=t(),me=v({topics:g(v({id:d(),title:d(),summary:d(),author:d(),replies:p(),unread:_(),createdAt:d(),updatedAt:d(),delivery:v({available:_(),connected:_(),state:d(),error:d().nullable()})}))}),he=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),S=e=>e.replace(/[#*_`>]/g,``).replace(/\s+/g,` `).trim();function C({me:t,mode:u=`messages`}){let{projectId:p,request:g}=se(),C=l(),_e=c(p,t,`${u}-selection`),w=c(p,t,`${u}-drafts`),ve=(0,b.useCallback)(e=>g(`agents/outbox`,te,{signal:e}),[g]),T=n(ve,3e3,c(p,t,`outbox`)),ye=(0,b.useCallback)(async e=>u===`messages`?g(`agents/chats`,ae,{signal:e}):{chats:(await g(`channels/topics`,me,{signal:e})).topics.map(e=>({...e,kind:`matter`,state:null}))},[g,u]),E=n(ye,3e3,c(p,t,u,`chats`)),[D,be]=(0,b.useState)(()=>{let e=new URLSearchParams(location.search),t=e.get(`chat`);return t?`chat:${t}`:e.get(`message`)??C?.get(_e)??``}),O=D.startsWith(`chat:`)?D.slice(5):``,k=!D||!!O,[A,j]=(0,b.useState)(()=>C?.get(c(p,t,`chat`,O))),M=A?.id===O?A:C?.get(c(p,t,`chat`,O)),N=E.data?.chats.find(e=>e.id===O),P=N&&`delivery`in N?N.delivery:void 0,[xe,F]=(0,b.useState)(),[I,L]=(0,b.useState)(()=>C?.get(w)??{}),Se=I[D]??``,Ce=e=>L(t=>({...t,[D]:e})),[R,z]=(0,b.useState)(!1),[B,we]=(0,b.useState)(!1),[Te,V]=(0,b.useState)(!1),[H,Ee]=(0,b.useState)(``),[De,Oe]=(0,b.useState)(``),ke=(0,b.useRef)(crypto.randomUUID()),[Ae,U]=(0,b.useState)(``),[je,W]=(0,b.useState)(``),G=(0,b.useRef)(new Map),Me=(0,b.useRef)(null),K=(0,b.useRef)(!0),q=(0,b.useRef)(D);q.current=D,(0,b.useEffect)(()=>{A&&C?.set(c(p,t,`chat`,A.id),A)},[C,p,t,A]),(0,b.useEffect)(()=>{C?.set(w,I)},[C,w,I]);function J(e){q.current=e,be(e),C?.set(_e,e);let t=new URL(location.href);e.startsWith(`chat:`)?t.searchParams.set(`chat`,e.slice(5)):t.searchParams.delete(`chat`),e&&!e.startsWith(`chat:`)&&e!==`debug`?t.searchParams.set(`message`,e):t.searchParams.delete(`message`),history.replaceState(history.state,``,t)}(0,b.useEffect)(()=>{!D&&E.data?.chats.length&&J(`chat:${E.data.chats[0].id}`)},[D,E.data]);let Y=(T.data?.messages??[]).filter(e=>u===`messages`&&e.box===`debug`).reverse(),X=T.data?.messages.find(e=>e.id===(D===`debug`?xe:D));(0,b.useEffect)(()=>{D!==`debug`&&X?.conversationId&&J(`chat:${X.conversationId}`)},[D,X?.conversationId]);let Z=Y.filter(e=>!e.readAt).map(e=>e.id).join(`,`);(0,b.useEffect)(()=>{X&&!X.readAt&&D!==`debug`&&g(`agents/outbox/${X.id}/read`,h,{method:`POST`}).then(()=>{window.dispatchEvent(new Event(`teammy:outbox`)),T.reload()}).catch(e=>U(i(e)))},[X?.id,X?.readAt,D,g,T.reload]),(0,b.useEffect)(()=>{D===`debug`&&Z&&Promise.all(Z.split(`,`).map(e=>g(`agents/outbox/${e}/read`,h,{method:`POST`}))).then(()=>{window.dispatchEvent(new Event(`teammy:outbox`)),T.reload()}).catch(e=>U(i(e)))},[D,Z,g,T.reload]),(0,b.useEffect)(()=>{if(W(``),!O)return;let e=!0,n=-1,r=!1,a=new AbortController,o=t=>{!e||t.id!==O||t.cursor<n||(n=t.cursor,r=!0,t.redirect?J(`chat:${t.redirect}`):t.entry===`channel`&&u!==`channels`?location.replace(oe(`/projects/${p}/channels?chat=${t.id}`)):(j(t),W(``)))};g(`agents/chats/${O}`,m,{signal:a.signal}).then(o).catch(n=>{e&&!a.signal.aborted&&(n instanceof ee&&[401,403,404].includes(n.status)&&(C?.delete(c(p,t,`chat`,O)),j(e=>e?.id===O?void 0:e)),r||W(i(n)))});let s=t=>{let r=Number(t.lastEventId);return!e||!Number.isSafeInteger(r)||r<=n?!1:(n=r,!0)},l=new EventSource(oe(`/api/v1/projects/${encodeURIComponent(p)}/agents/chats/${encodeURIComponent(O)}/events`));l.addEventListener(`snapshot`,t=>{if(e)try{o(m.parse(JSON.parse(t.data)))}catch(e){W(i(e))}}),l.onerror=()=>{e&&W(`对话连接中断,正在重新连接…`)},l.addEventListener(`context`,e=>{if(!s(e))return;let t=m.pick({kind:!0,title:!0,status:!0,visibility:!0,participants:!0,pending:!0,hold:!0,redirect:!0}).parse(JSON.parse(e.data));t.redirect?J(`chat:${t.redirect}`):j(e=>e?.id===O?{...e,...t,cursor:n}:e)}),l.addEventListener(`message`,e=>{if(!s(e))return;let t=ie.parse(JSON.parse(e.data));j(n=>n?.id===O?{...n,readCursor:Math.max(n.readCursor,t.seq),cursor:Math.max(n.cursor,Number(e.lastEventId)||0),messages:[...n.messages.filter(e=>e.id!==t.id),t].sort((e,t)=>e.seq-t.seq)}:n)}),l.addEventListener(`message_removed`,e=>{if(!s(e))return;let{id:t}=v({id:d()}).parse(JSON.parse(e.data));j(e=>e?.id===O?{...e,cursor:n,messages:e.messages.filter(e=>e.id!==t)}:e)}),l.addEventListener(`run`,e=>{if(!s(e))return;let t=ne.parse(JSON.parse(e.data));j(n=>n?.id===O?{...n,cursor:Math.max(n.cursor,Number(e.lastEventId)||0),runs:n.runs.some(e=>e.id===t.id)?n.runs:[...n.runs,t]}:n)});for(let e of[`delta`,`reset`,`state`])l.addEventListener(e,t=>{if(!s(t))return;let n=JSON.parse(t.data);j(r=>r?.id===O?{...r,cursor:Math.max(r.cursor,Number(t.lastEventId)||0),messages:r.messages.map(t=>t.runId!==n.id||t.role!==`assistant`?t:{...t,body:e===`delta`?t.body+(n.text??``):e===`reset`?``:n.answer??t.body,state:n.state??t.state}),runs:r.runs.map(t=>t.id===n.id?{...t,answer:e===`delta`?t.answer+(n.text??``):e===`reset`?``:n.answer??t.answer,state:n.state??t.state,error:n.error===void 0?t.error:n.error}:t)}:r)});return()=>{e=!1,a.abort(),l.close()}},[p,O,t,g,C]),(0,b.useEffect)(()=>{if(!M||M.id!==O)return;let e=()=>{document.visibilityState===`visible`&&g(`agents/chats/${O}/read`,v({ok:_()}),{method:`POST`,body:{cursor:M.readCursor}}).then(()=>{E.reload(),window.dispatchEvent(new Event(`teammy:outbox`))}).catch(e=>U(i(e)))},t=setTimeout(e,300);return document.addEventListener(`visibilitychange`,e),()=>{clearTimeout(t),document.removeEventListener(`visibilitychange`,e)}},[O,M?.readCursor,M?.kind,g]),(0,b.useEffect)(()=>{K.current&&Me.current?.scrollIntoView({block:`end`})},[D,A?.messages,X?.recipients,Y.length]);function Ne(){window.dispatchEvent(new Event(`teammy:outbox`)),T.reload()}async function Q(e){if(K.current=!0,J(e),U(``),F(void 0),e.startsWith(`chat:`)||e===`debug`)return;let t=T.data?.messages.find(t=>t.id===e)?.conversationId;if(t)J(`chat:${t}`);else try{await g(`agents/outbox/${e}/read`,h,{method:`POST`}),Ne()}catch(e){U(i(e))}}async function Pe(){if(!B){we(!0),U(``);try{let e=await g(`agents/chats`,m,{method:`POST`});j(e),await Q(`chat:${e.id}`),E.reload()}catch(e){U(i(e))}finally{we(!1)}}}async function Fe(e){e.preventDefault();let t=Se.trim();if(!t||R||B)return;z(!0),U(``);let n=G.current.get(D);n&&n.text===t||(n={text:t,id:crypto.randomUUID()},G.current.set(D,n));try{if(k){let e=n.target??O;if(!e){let r=await g(`agents/chats`,m,{method:`POST`});e=r.id,n.target=e,G.current.set(`chat:${e}`,n),L(n=>({...n,[`chat:${e}`]:t})),q.current===D&&(j(r),J(`chat:${e}`))}let r=await g(`agents/chats/${e}`,ne.extend({conversationId:d().optional()}),{method:`POST`,body:{text:t,requestId:n.id}});r.conversationId&&r.conversationId!==e&&(q.current===D||q.current===`chat:${e}`)&&J(`chat:${r.conversationId}`),j(t=>t?.id===e?{...t,runs:t.runs.some(e=>e.id===r.id)?t.runs:[...t.runs,r]}:t),E.reload()}else{let e=await g(`agents/outbox/${X.id}/reply`,v({conversationId:d()}),{method:`POST`,body:{body:t,requestId:n.id}});Ne(),q.current===D&&J(`chat:${e.conversationId}`),E.reload(),F(void 0)}G.current.delete(D),n.target&&G.current.delete(`chat:${n.target}`),L(e=>({...e,[D]:``,...n.target?{[`chat:${n.target}`]:``}:{}}))}catch(e){U(i(e))}finally{z(!1)}}let Ie=u===`channels`?le:fe,Le=k&&!M?.closed&&(u!==`channels`||!!O)||!!X&&!X.archivedAt,$=k&&!M&&(!!O||!E.data);return(0,x.jsxs)(de,{className:u===`channels`?`channel-layout`:``,testId:`assistant-page`,label:k?`Tim对话`:`消息内容`,navigation:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`header`,{className:`assistant-list-heading`,children:[(0,x.jsx)(`h1`,{children:u===`channels`?`频道`:`对话`}),(0,x.jsx)(s,{className:`assistant-new-chat`,icon:`plus`,label:u===`channels`?`发表话题`:`新建对话`,disabled:B,onClick:()=>u===`channels`?V(!0):void Pe(),"data-testid":`assistant-launcher`})]}),(0,x.jsxs)(`div`,{className:`assistant-message-scroll`,children:[E.loading&&!E.data&&(0,x.jsx)(`p`,{className:`assistant-list-status`,role:`status`,children:`加载中…`}),E.data?.chats.map(e=>(0,x.jsxs)(`button`,{type:`button`,"data-testid":`assistant-chat-${e.id}`,className:`assistant-message-item assistant-chat-item ${O===e.id?`selected`:``}`,"aria-pressed":O===e.id,onClick:()=>void Q(`chat:${e.id}`),children:[(0,x.jsx)(`span`,{className:`assistant-message-dot ${e.unread||e.state===`running`||e.state===`queued`?`unread`:``}`}),(0,x.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,x.jsx)(f,{selected:O===e.id,children:(0,x.jsx)(`strong`,{children:e.title})}),u===`channels`&&`summary`in e&&(0,x.jsx)(`span`,{className:`topic-preview`,children:S(String(e.summary)).slice(0,140)}),(0,x.jsxs)(`time`,{dateTime:e.updatedAt,children:[new Date(e.updatedAt).toLocaleDateString([],{month:`numeric`,day:`numeric`}),` `,he(e.updatedAt)]})]})]},e.id)),!!Y.length&&(0,x.jsxs)(`button`,{type:`button`,"data-testid":`debug-outbox`,className:`assistant-message-item ${D===`debug`?`selected`:``}`,onClick:()=>void Q(`debug`),children:[(0,x.jsx)(`span`,{className:`assistant-message-dot ${Z?`unread`:``}`}),(0,x.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,x.jsx)(f,{selected:D===`debug`,children:(0,x.jsx)(`strong`,{children:`运行提醒`})}),(0,x.jsx)(`span`,{children:S(Y.at(-1).body)})]})]}),T.data?.messages.filter(e=>u===`messages`&&e.box!==`debug`&&!e.conversationId).sort((e,t)=>Number(!!e.archivedAt)-Number(!!t.archivedAt)).map(e=>(0,x.jsxs)(`button`,{type:`button`,"data-testid":`outbox-${e.id}`,className:`assistant-message-item ${e.archivedAt?`archived`:``} ${D===e.id?`selected`:``}`,onClick:()=>void Q(e.id),children:[(0,x.jsx)(`span`,{className:`assistant-message-dot ${e.readAt?``:`unread`}`}),(0,x.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,x.jsx)(f,{selected:D===e.id,children:(0,x.jsx)(`strong`,{children:S(e.body)})}),(0,x.jsxs)(`time`,{dateTime:e.createdAt,children:[new Date(e.createdAt).toLocaleDateString([],{month:`numeric`,day:`numeric`}),` `,he(e.createdAt)]})]})]},e.id))]}),(0,x.jsx)(a,{error:!0,children:T.error||E.error})]}),children:[Te&&(0,x.jsxs)(r,{id:`new-topic`,title:`发表话题`,onClose:()=>V(!1),children:[(0,x.jsx)(pe,{inset:!0,plain:!0,value:De,onChange:Oe,label:`正文`,placeholder:`开始一个话题…`,sendLabel:`发表话题`,sendDisabled:R||!H.trim(),heading:(0,x.jsx)(`input`,{className:`topic-title`,"aria-label":`标题`,placeholder:`标题`,required:!0,value:H,onChange:e=>Ee(e.target.value)}),onSubmit:e=>{e.preventDefault(),z(!0),U(``),g(`channels/topics`,m,{method:`POST`,body:{id:ke.current,title:H,body:De}}).then(e=>{j(e),J(`chat:${e.id}`),V(!1),Ee(``),Oe(``),ke.current=crypto.randomUUID(),E.reload()}).catch(e=>U(i(e))).finally(()=>z(!1))}}),(0,x.jsx)(a,{error:!0,children:Ae})]}),(0,x.jsx)(ue,{title:(0,x.jsx)(`h2`,{children:k?N?.title??M?.title??(O?`无标题`:`Tim`):D===`debug`?`运行提醒`:`项目消息`}),actions:(0,x.jsxs)(x.Fragment,{children:[u!==`channels`&&M?.kind===`matter`&&(0,x.jsxs)(`span`,{className:`assistant-participants`,title:M.participants?.join(`、`),children:[M.visibility===`project`?`项目共享 · `:``,M.participants?.join(`、`)]}),u===`channels`&&P?.available&&(P.state===`web`||P.state===`cancelled`||!P.connected)&&(0,x.jsx)(s,{icon:`send`,label:`发布到企业微信频道`,disabled:R,onClick:()=>{z(!0),g(`channels/topics/${O}/publish`,re(),{method:`POST`}).then(()=>E.reload()).catch(e=>U(i(e))).finally(()=>z(!1))}})]})}),u===`channels`&&(0,x.jsx)(a,{error:!0,children:P?.error}),u!==`channels`&&M?.kind===`matter`&&(M.hold||M.pending||M.status===`completed`)&&(0,x.jsx)(`div`,{className:`assistant-matter-state`,role:`status`,children:M.hold?`${M.hold.scope===`all`?`已暂停`:`暂缓修改`} · ${M.hold.reason}`:M.pending?`待确认 · ${M.pending.members.join(`、`)}:${M.pending.question}`:`已完成`}),(0,x.jsxs)(ce,{"data-testid":`assistant-transcript`,onScroll:e=>{let t=e.currentTarget;K.current=t.scrollHeight-t.scrollTop-t.clientHeight<100},children:[k?$?(0,x.jsxs)(`div`,{className:`assistant-empty`,"data-testid":`assistant-loading`,children:[(0,x.jsx)(e,{}),(0,x.jsx)(`p`,{role:`status`,children:je||E.error?`暂时无法加载对话`:`加载中…`})]}):M?.messages.length?M.messages.filter(e=>e.body||[`queued`,`running`,`failed`].includes(e.state)).map(e=>(0,x.jsx)(`div`,{className:`assistant-turn`,children:(0,x.jsxs)(Ie,{mine:e.role===`user`&&e.author===t,author:`${e.role===`assistant`?`Tim`:e.author}${e.source===`wecom`?` · 企业微信`:``}`,time:e.createdAt,children:[e.body&&(0,x.jsx)(`div`,{className:`markdown`,children:(0,x.jsx)(y,{children:e.body})}),e.role===`assistant`&&[`queued`,`running`].includes(e.state)&&(0,x.jsxs)(`span`,{className:`assistant-typing`,"aria-label":`正在回答`,children:[(0,x.jsx)(`i`,{}),(0,x.jsx)(`i`,{}),(0,x.jsx)(`i`,{})]}),e.state===`failed`&&(0,x.jsx)(a,{error:!0,children:M.runs.find(t=>t.id===e.runId)?.error||`本次回答未完成。`})]})},e.id)):(0,x.jsxs)(`div`,{className:`assistant-empty`,children:[(0,x.jsx)(e,{}),(0,x.jsx)(`p`,{children:`有什么项目问题想聊聊?`})]}):!T.data&&T.loading?(0,x.jsx)(`div`,{className:`assistant-empty`,children:(0,x.jsx)(`p`,{role:`status`,children:`加载中…`})}):D===`debug`?Y.map(e=>(0,x.jsx)(ge,{item:e,onReply:e.archivedAt?void 0:()=>{F(e.id),Ce(``),U(``)}},e.id)):X&&(0,x.jsx)(ge,{item:X}),(0,x.jsx)(`div`,{ref:Me})]}),(0,x.jsx)(a,{error:!0,children:Ae||(k?je:``)}),Le?(0,x.jsx)(pe,{value:Se,onChange:Ce,onSubmit:e=>void Fe(e),disabled:B,sendDisabled:R||$,label:k?`向Tim提问`:`回复消息`}):D!==`debug`&&X&&(0,x.jsxs)(`div`,{className:`assistant-archived`,children:[(0,x.jsx)(o,{name:`archive`}),`已归档`]})]})}function ge({item:e,onReply:t}){return(0,x.jsx)(`div`,{"data-testid":`outbox-thread-${e.id}`,children:(0,x.jsxs)(fe,{author:e.box===`debug`?`运行提醒`:`Tim`,time:e.createdAt,children:[(0,x.jsx)(`div`,{className:`markdown`,children:(0,x.jsx)(y,{children:e.body})}),t&&(0,x.jsx)(`button`,{type:`button`,className:`assistant-debug-reply`,onClick:t,children:`回复`})]})})}export{C as Assistant};
|
|
1
|
+
import{F as e,G as t,H as n,I as r,J as i,K as ee,L as a,N as o,P as s,U as c,W as l,_t as u,a as te,dt as d,g as f,i as ne,lt as p,n as m,o as h,ot as g,pt as re,r as ie,st as _,t as ae,ut as v,vt as oe,y as se}from"./index-C5-iSe99.js";import{t as y}from"./Markdown-Bb9dy2Sh.js";import{a as ce,i as le,n as ue,r as de,t as fe}from"./Conversation-1APTn0kq.js";import{t as pe}from"./MessageComposer-B6iTInqD.js";var b=u(),x=t(),me=v({topics:g(v({id:d(),title:d(),summary:d(),author:d(),replies:p(),unread:_(),createdAt:d(),updatedAt:d(),delivery:v({available:_(),connected:_(),state:d(),error:d().nullable()})}))}),he=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),S=e=>e.replace(/[#*_`>]/g,``).replace(/\s+/g,` `).trim();function C({me:t,mode:u=`messages`}){let{projectId:p,request:g}=se(),C=l(),_e=c(p,t,`${u}-selection`),w=c(p,t,`${u}-drafts`),ve=(0,b.useCallback)(e=>g(`agents/outbox`,te,{signal:e}),[g]),T=n(ve,3e3,c(p,t,`outbox`)),ye=(0,b.useCallback)(async e=>u===`messages`?g(`agents/chats`,ae,{signal:e}):{chats:(await g(`channels/topics`,me,{signal:e})).topics.map(e=>({...e,kind:`matter`,state:null}))},[g,u]),E=n(ye,3e3,c(p,t,u,`chats`)),[D,be]=(0,b.useState)(()=>{let e=new URLSearchParams(location.search),t=e.get(`chat`);return t?`chat:${t}`:e.get(`message`)??C?.get(_e)??``}),O=D.startsWith(`chat:`)?D.slice(5):``,k=!D||!!O,[A,j]=(0,b.useState)(()=>C?.get(c(p,t,`chat`,O))),M=A?.id===O?A:C?.get(c(p,t,`chat`,O)),N=E.data?.chats.find(e=>e.id===O),P=N&&`delivery`in N?N.delivery:void 0,[xe,F]=(0,b.useState)(),[I,L]=(0,b.useState)(()=>C?.get(w)??{}),Se=I[D]??``,Ce=e=>L(t=>({...t,[D]:e})),[R,z]=(0,b.useState)(!1),[B,we]=(0,b.useState)(!1),[Te,V]=(0,b.useState)(!1),[H,Ee]=(0,b.useState)(``),[De,Oe]=(0,b.useState)(``),ke=(0,b.useRef)(crypto.randomUUID()),[Ae,U]=(0,b.useState)(``),[je,W]=(0,b.useState)(``),G=(0,b.useRef)(new Map),Me=(0,b.useRef)(null),K=(0,b.useRef)(!0),q=(0,b.useRef)(D);q.current=D,(0,b.useEffect)(()=>{A&&C?.set(c(p,t,`chat`,A.id),A)},[C,p,t,A]),(0,b.useEffect)(()=>{C?.set(w,I)},[C,w,I]);function J(e){q.current=e,be(e),C?.set(_e,e);let t=new URL(location.href);e.startsWith(`chat:`)?t.searchParams.set(`chat`,e.slice(5)):t.searchParams.delete(`chat`),e&&!e.startsWith(`chat:`)&&e!==`debug`?t.searchParams.set(`message`,e):t.searchParams.delete(`message`),history.replaceState(history.state,``,t)}(0,b.useEffect)(()=>{!D&&E.data?.chats.length&&J(`chat:${E.data.chats[0].id}`)},[D,E.data]);let Y=(T.data?.messages??[]).filter(e=>u===`messages`&&e.box===`debug`).reverse(),X=T.data?.messages.find(e=>e.id===(D===`debug`?xe:D));(0,b.useEffect)(()=>{D!==`debug`&&X?.conversationId&&J(`chat:${X.conversationId}`)},[D,X?.conversationId]);let Z=Y.filter(e=>!e.readAt).map(e=>e.id).join(`,`);(0,b.useEffect)(()=>{X&&!X.readAt&&D!==`debug`&&g(`agents/outbox/${X.id}/read`,h,{method:`POST`}).then(()=>{window.dispatchEvent(new Event(`teammy:outbox`)),T.reload()}).catch(e=>U(i(e)))},[X?.id,X?.readAt,D,g,T.reload]),(0,b.useEffect)(()=>{D===`debug`&&Z&&Promise.all(Z.split(`,`).map(e=>g(`agents/outbox/${e}/read`,h,{method:`POST`}))).then(()=>{window.dispatchEvent(new Event(`teammy:outbox`)),T.reload()}).catch(e=>U(i(e)))},[D,Z,g,T.reload]),(0,b.useEffect)(()=>{if(W(``),!O)return;let e=!0,n=-1,r=!1,a=new AbortController,o=t=>{!e||t.id!==O||t.cursor<n||(n=t.cursor,r=!0,t.redirect?J(`chat:${t.redirect}`):t.entry===`channel`&&u!==`channels`?location.replace(oe(`/projects/${p}/channels?chat=${t.id}`)):(j(t),W(``)))};g(`agents/chats/${O}`,m,{signal:a.signal}).then(o).catch(n=>{e&&!a.signal.aborted&&(n instanceof ee&&[401,403,404].includes(n.status)&&(C?.delete(c(p,t,`chat`,O)),j(e=>e?.id===O?void 0:e)),r||W(i(n)))});let s=t=>{let r=Number(t.lastEventId);return!e||!Number.isSafeInteger(r)||r<=n?!1:(n=r,!0)},l=new EventSource(oe(`/api/v1/projects/${encodeURIComponent(p)}/agents/chats/${encodeURIComponent(O)}/events`));l.addEventListener(`snapshot`,t=>{if(e)try{o(m.parse(JSON.parse(t.data)))}catch(e){W(i(e))}}),l.onerror=()=>{e&&W(`对话连接中断,正在重新连接…`)},l.addEventListener(`context`,e=>{if(!s(e))return;let t=m.pick({kind:!0,title:!0,status:!0,visibility:!0,participants:!0,pending:!0,hold:!0,redirect:!0}).parse(JSON.parse(e.data));t.redirect?J(`chat:${t.redirect}`):j(e=>e?.id===O?{...e,...t,cursor:n}:e)}),l.addEventListener(`message`,e=>{if(!s(e))return;let t=ie.parse(JSON.parse(e.data));j(n=>n?.id===O?{...n,readCursor:Math.max(n.readCursor,t.seq),cursor:Math.max(n.cursor,Number(e.lastEventId)||0),messages:[...n.messages.filter(e=>e.id!==t.id),t].sort((e,t)=>e.seq-t.seq)}:n)}),l.addEventListener(`message_removed`,e=>{if(!s(e))return;let{id:t}=v({id:d()}).parse(JSON.parse(e.data));j(e=>e?.id===O?{...e,cursor:n,messages:e.messages.filter(e=>e.id!==t)}:e)}),l.addEventListener(`run`,e=>{if(!s(e))return;let t=ne.parse(JSON.parse(e.data));j(n=>n?.id===O?{...n,cursor:Math.max(n.cursor,Number(e.lastEventId)||0),runs:n.runs.some(e=>e.id===t.id)?n.runs:[...n.runs,t]}:n)});for(let e of[`delta`,`reset`,`state`])l.addEventListener(e,t=>{if(!s(t))return;let n=JSON.parse(t.data);j(r=>r?.id===O?{...r,cursor:Math.max(r.cursor,Number(t.lastEventId)||0),messages:r.messages.map(t=>t.runId!==n.id||t.role!==`assistant`?t:{...t,body:e===`delta`?t.body+(n.text??``):e===`reset`?``:n.answer??t.body,state:n.state??t.state}),runs:r.runs.map(t=>t.id===n.id?{...t,answer:e===`delta`?t.answer+(n.text??``):e===`reset`?``:n.answer??t.answer,state:n.state??t.state,error:n.error===void 0?t.error:n.error}:t)}:r)});return()=>{e=!1,a.abort(),l.close()}},[p,O,t,g,C]),(0,b.useEffect)(()=>{if(!M||M.id!==O)return;let e=()=>{document.visibilityState===`visible`&&g(`agents/chats/${O}/read`,v({ok:_()}),{method:`POST`,body:{cursor:M.readCursor}}).then(()=>{E.reload(),window.dispatchEvent(new Event(`teammy:outbox`))}).catch(e=>U(i(e)))},t=setTimeout(e,300);return document.addEventListener(`visibilitychange`,e),()=>{clearTimeout(t),document.removeEventListener(`visibilitychange`,e)}},[O,M?.readCursor,M?.kind,g]),(0,b.useEffect)(()=>{K.current&&Me.current?.scrollIntoView({block:`end`})},[D,A?.messages,X?.recipients,Y.length]);function Ne(){window.dispatchEvent(new Event(`teammy:outbox`)),T.reload()}async function Q(e){if(K.current=!0,J(e),U(``),F(void 0),e.startsWith(`chat:`)||e===`debug`)return;let t=T.data?.messages.find(t=>t.id===e)?.conversationId;if(t)J(`chat:${t}`);else try{await g(`agents/outbox/${e}/read`,h,{method:`POST`}),Ne()}catch(e){U(i(e))}}async function Pe(){if(!B){we(!0),U(``);try{let e=await g(`agents/chats`,m,{method:`POST`});j(e),await Q(`chat:${e.id}`),E.reload()}catch(e){U(i(e))}finally{we(!1)}}}async function Fe(e){e.preventDefault();let t=Se.trim();if(!t||R||B)return;z(!0),U(``);let n=G.current.get(D);n&&n.text===t||(n={text:t,id:crypto.randomUUID()},G.current.set(D,n));try{if(k){let e=n.target??O;if(!e){let r=await g(`agents/chats`,m,{method:`POST`});e=r.id,n.target=e,G.current.set(`chat:${e}`,n),L(n=>({...n,[`chat:${e}`]:t})),q.current===D&&(j(r),J(`chat:${e}`))}let r=await g(`agents/chats/${e}`,ne.extend({conversationId:d().optional()}),{method:`POST`,body:{text:t,requestId:n.id}});r.conversationId&&r.conversationId!==e&&(q.current===D||q.current===`chat:${e}`)&&J(`chat:${r.conversationId}`),j(t=>t?.id===e?{...t,runs:t.runs.some(e=>e.id===r.id)?t.runs:[...t.runs,r]}:t),E.reload()}else{let e=await g(`agents/outbox/${X.id}/reply`,v({conversationId:d()}),{method:`POST`,body:{body:t,requestId:n.id}});Ne(),q.current===D&&J(`chat:${e.conversationId}`),E.reload(),F(void 0)}G.current.delete(D),n.target&&G.current.delete(`chat:${n.target}`),L(e=>({...e,[D]:``,...n.target?{[`chat:${n.target}`]:``}:{}}))}catch(e){U(i(e))}finally{z(!1)}}let Ie=u===`channels`?le:fe,Le=k&&!M?.closed&&(u!==`channels`||!!O)||!!X&&!X.archivedAt,$=k&&!M&&(!!O||!E.data);return(0,x.jsxs)(de,{className:u===`channels`?`channel-layout`:``,testId:`assistant-page`,label:k?`Tim对话`:`消息内容`,navigation:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`header`,{className:`assistant-list-heading`,children:[(0,x.jsx)(`h1`,{children:u===`channels`?`频道`:`对话`}),(0,x.jsx)(s,{className:`assistant-new-chat`,icon:`plus`,label:u===`channels`?`发表话题`:`新建对话`,disabled:B,onClick:()=>u===`channels`?V(!0):void Pe(),"data-testid":`assistant-launcher`})]}),(0,x.jsxs)(`div`,{className:`assistant-message-scroll`,children:[E.loading&&!E.data&&(0,x.jsx)(`p`,{className:`assistant-list-status`,role:`status`,children:`加载中…`}),E.data?.chats.map(e=>(0,x.jsxs)(`button`,{type:`button`,"data-testid":`assistant-chat-${e.id}`,className:`assistant-message-item assistant-chat-item ${O===e.id?`selected`:``}`,"aria-pressed":O===e.id,onClick:()=>void Q(`chat:${e.id}`),children:[(0,x.jsx)(`span`,{className:`assistant-message-dot ${e.unread||e.state===`running`||e.state===`queued`?`unread`:``}`}),(0,x.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,x.jsx)(f,{selected:O===e.id,children:(0,x.jsx)(`strong`,{children:e.title})}),u===`channels`&&`summary`in e&&(0,x.jsx)(`span`,{className:`topic-preview`,children:S(String(e.summary)).slice(0,140)}),(0,x.jsxs)(`time`,{dateTime:e.updatedAt,children:[new Date(e.updatedAt).toLocaleDateString([],{month:`numeric`,day:`numeric`}),` `,he(e.updatedAt)]})]})]},e.id)),!!Y.length&&(0,x.jsxs)(`button`,{type:`button`,"data-testid":`debug-outbox`,className:`assistant-message-item ${D===`debug`?`selected`:``}`,onClick:()=>void Q(`debug`),children:[(0,x.jsx)(`span`,{className:`assistant-message-dot ${Z?`unread`:``}`}),(0,x.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,x.jsx)(f,{selected:D===`debug`,children:(0,x.jsx)(`strong`,{children:`运行提醒`})}),(0,x.jsx)(`span`,{children:S(Y.at(-1).body)})]})]}),T.data?.messages.filter(e=>u===`messages`&&e.box!==`debug`&&!e.conversationId).sort((e,t)=>Number(!!e.archivedAt)-Number(!!t.archivedAt)).map(e=>(0,x.jsxs)(`button`,{type:`button`,"data-testid":`outbox-${e.id}`,className:`assistant-message-item ${e.archivedAt?`archived`:``} ${D===e.id?`selected`:``}`,onClick:()=>void Q(e.id),children:[(0,x.jsx)(`span`,{className:`assistant-message-dot ${e.readAt?``:`unread`}`}),(0,x.jsxs)(`span`,{className:`assistant-message-copy`,children:[(0,x.jsx)(f,{selected:D===e.id,children:(0,x.jsx)(`strong`,{children:S(e.body)})}),(0,x.jsxs)(`time`,{dateTime:e.createdAt,children:[new Date(e.createdAt).toLocaleDateString([],{month:`numeric`,day:`numeric`}),` `,he(e.createdAt)]})]})]},e.id))]}),(0,x.jsx)(a,{error:!0,children:T.error||E.error})]}),children:[Te&&(0,x.jsxs)(r,{id:`new-topic`,title:`发表话题`,onClose:()=>V(!1),children:[(0,x.jsx)(pe,{inset:!0,plain:!0,value:De,onChange:Oe,label:`正文`,placeholder:`开始一个话题…`,sendLabel:`发表话题`,sendDisabled:R||!H.trim(),heading:(0,x.jsx)(`input`,{className:`topic-title`,"aria-label":`标题`,placeholder:`标题`,required:!0,value:H,onChange:e=>Ee(e.target.value)}),onSubmit:e=>{e.preventDefault(),z(!0),U(``),g(`channels/topics`,m,{method:`POST`,body:{id:ke.current,title:H,body:De}}).then(e=>{j(e),J(`chat:${e.id}`),V(!1),Ee(``),Oe(``),ke.current=crypto.randomUUID(),E.reload()}).catch(e=>U(i(e))).finally(()=>z(!1))}}),(0,x.jsx)(a,{error:!0,children:Ae})]}),(0,x.jsx)(ue,{title:(0,x.jsx)(`h2`,{children:k?N?.title??M?.title??(O?`无标题`:`Tim`):D===`debug`?`运行提醒`:`项目消息`}),actions:(0,x.jsxs)(x.Fragment,{children:[u!==`channels`&&M?.kind===`matter`&&(0,x.jsxs)(`span`,{className:`assistant-participants`,title:M.participants?.join(`、`),children:[M.visibility===`project`?`项目共享 · `:``,M.participants?.join(`、`)]}),u===`channels`&&P?.available&&(P.state===`web`||P.state===`cancelled`||!P.connected)&&(0,x.jsx)(s,{icon:`send`,label:`发布到企业微信频道`,disabled:R,onClick:()=>{z(!0),g(`channels/topics/${O}/publish`,re(),{method:`POST`}).then(()=>E.reload()).catch(e=>U(i(e))).finally(()=>z(!1))}})]})}),u===`channels`&&(0,x.jsx)(a,{error:!0,children:P?.error}),u!==`channels`&&M?.kind===`matter`&&(M.hold||M.pending||M.status===`completed`)&&(0,x.jsx)(`div`,{className:`assistant-matter-state`,role:`status`,children:M.hold?`${M.hold.scope===`all`?`已暂停`:`暂缓修改`} · ${M.hold.reason}`:M.pending?`待确认 · ${M.pending.members.join(`、`)}:${M.pending.question}`:`已完成`}),(0,x.jsxs)(ce,{"data-testid":`assistant-transcript`,onScroll:e=>{let t=e.currentTarget;K.current=t.scrollHeight-t.scrollTop-t.clientHeight<100},children:[k?$?(0,x.jsxs)(`div`,{className:`assistant-empty`,"data-testid":`assistant-loading`,children:[(0,x.jsx)(e,{}),(0,x.jsx)(`p`,{role:`status`,children:je||E.error?`暂时无法加载对话`:`加载中…`})]}):M?.messages.length?M.messages.filter(e=>e.body||[`queued`,`running`,`failed`].includes(e.state)).map(e=>(0,x.jsx)(`div`,{className:`assistant-turn`,children:(0,x.jsxs)(Ie,{mine:e.role===`user`&&e.author===t,author:`${e.role===`assistant`?`Tim`:e.author}${e.source===`wecom`?` · 企业微信`:``}`,time:e.createdAt,children:[e.body&&(0,x.jsx)(`div`,{className:`markdown`,children:(0,x.jsx)(y,{children:e.body})}),e.role===`assistant`&&[`queued`,`running`].includes(e.state)&&(0,x.jsxs)(`span`,{className:`assistant-typing`,"aria-label":`正在回答`,children:[(0,x.jsx)(`i`,{}),(0,x.jsx)(`i`,{}),(0,x.jsx)(`i`,{})]}),e.state===`failed`&&(0,x.jsx)(a,{error:!0,children:M.runs.find(t=>t.id===e.runId)?.error||`本次回答未完成。`})]})},e.id)):(0,x.jsxs)(`div`,{className:`assistant-empty`,children:[(0,x.jsx)(e,{}),(0,x.jsx)(`p`,{children:`有什么项目问题想聊聊?`})]}):!T.data&&T.loading?(0,x.jsx)(`div`,{className:`assistant-empty`,children:(0,x.jsx)(`p`,{role:`status`,children:`加载中…`})}):D===`debug`?Y.map(e=>(0,x.jsx)(ge,{item:e,onReply:e.archivedAt?void 0:()=>{F(e.id),Ce(``),U(``)}},e.id)):X&&(0,x.jsx)(ge,{item:X}),(0,x.jsx)(`div`,{ref:Me})]}),(0,x.jsx)(a,{error:!0,children:Ae||(k?je:``)}),Le?(0,x.jsx)(pe,{value:Se,onChange:Ce,onSubmit:e=>void Fe(e),disabled:B,sendDisabled:R||$,label:k?`向Tim提问`:`回复消息`}):D!==`debug`&&X&&(0,x.jsxs)(`div`,{className:`assistant-archived`,children:[(0,x.jsx)(o,{name:`archive`}),`已归档`]})]})}function ge({item:e,onReply:t}){return(0,x.jsx)(`div`,{"data-testid":`outbox-thread-${e.id}`,children:(0,x.jsxs)(fe,{author:e.box===`debug`?`运行提醒`:`Tim`,time:e.createdAt,children:[(0,x.jsx)(`div`,{className:`markdown`,children:(0,x.jsx)(y,{children:e.body})}),t&&(0,x.jsx)(`button`,{type:`button`,className:`assistant-debug-reply`,onClick:t,children:`回复`})]})})}export{C as Assistant};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as e,E as t,G as n,H as r,I as i,J as a,L as o,N as s,P as c,S as l,T as u,_t as d,b as f,d as p,dt as m,h,j as g,k as _,m as v,ot as y,pt as b,st as x,ut as S,v as C,vt as w,w as T,x as E,y as D}from"./index-
|
|
1
|
+
import{C as e,E as t,G as n,H as r,I as i,J as a,L as o,N as s,P as c,S as l,T as u,_t as d,b as f,d as p,dt as m,h,j as g,k as _,m as v,ot as y,pt as b,st as x,ut as S,v as C,vt as w,w as T,x as E,y as D}from"./index-C5-iSe99.js";import{t as O}from"./Markdown-Bb9dy2Sh.js";import{a as ee,n as te,o as ne,r as re,t as ie}from"./Conversation-1APTn0kq.js";import{n as k,t as ae}from"./MessageComposer-B6iTInqD.js";import{r as oe}from"./WorkspaceTree-D0UUUBtF.js";var A=d(),j=n();function M({disabled:e,onSend:t}){let[n,r]=(0,A.useState)(``),[i,a]=(0,A.useState)(!1),o=`其他回答`,c=(0,A.useRef)(null),l=(0,A.useCallback)(e=>{if(!c.current)return;let t=document.createElement(`canvas`).getContext(`2d`);if(!t)return;t.font=getComputedStyle(e).font;let r=Math.max(...(n||`${o}…`).split(`
|
|
2
2
|
`).map(e=>t.measureText(e).width));c.current.style.setProperty(`--reply-width`,`${Math.ceil(r+(i?52:26))}px`)},[n,i,o]),u=k(n,l);return(0,j.jsxs)(`form`,{ref:c,className:`inline-reply${i?` active`:``}`,onFocus:()=>a(!0),onBlur:e=>{!n&&!e.currentTarget.contains(e.relatedTarget)&&a(!1)},onSubmit:i=>{i.preventDefault(),!e&&n.trim()&&t(n.trim()).then(e=>{e&&r(``)})},children:[(0,j.jsx)(`textarea`,{ref:u,rows:1,"aria-label":`自定义回答`,placeholder:`${o}…`,value:n,disabled:e,onChange:e=>r(e.target.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&!t.nativeEvent.isComposing&&(t.preventDefault(),!e&&n.trim()&&t.currentTarget.form?.requestSubmit())}}),i&&(0,j.jsx)(`button`,{className:`inline-reply-send`,type:`submit`,disabled:e||!n.trim(),"aria-label":`发送${o}`,title:`发送${o}`,children:(0,j.jsx)(s,{name:`send`,size:`small`})})]})}var N={minimal:`极低`,low:`低`,medium:`中`,high:`高`,xhigh:`极高`,max:`最高`,ultra:`极致`,none:`无`},P=[{value:`read-only`,label:`只读`,description:`读取文件,不修改代码`},{value:`workspace-write`,label:`工作区写入`,shortLabel:`工作区`,description:`可修改工作区,额外权限按需审批`},{value:`full-access`,label:`完整访问`,description:`可访问工作区之外,按需审批`}];function F({id:e,label:t,current:n,options:r,disabled:i,onSelect:a}){let o=r.find(e=>e.value===n);return(0,j.jsx)(v,{id:`${e}-menu`,triggerId:e,placement:`top`,className:`composer-menu composer-choice`,label:`选择${t}`,disabled:i,routeKey:n,trigger:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{title:`${t}:${o?.label??n}`,children:o?.shortLabel??o?.label??n}),(0,j.jsx)(s,{name:`chevronDown`,size:`small`})]}),children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`composer-menu-heading`,children:t}),r.map(t=>(0,j.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-label":t.label,onClick:()=>{e(),a(t.value)},children:[(0,j.jsxs)(`span`,{className:`composer-option-copy`,children:[(0,j.jsx)(`span`,{children:t.label}),t.description&&(0,j.jsx)(`small`,{children:t.description})]}),t.value===n&&(0,j.jsx)(s,{name:`check`,size:`small`})]},t.value))]})})}function se({session:e,models:t,busy:n,available:r,online:i,commands:a,draft:o,onInsert:c,onConfig:l}){let[u,d]=(0,A.useState)(!1);(0,A.useEffect)(()=>{/^[/$]([^\s]*)$/.exec(o)?d(!0):d(!1)},[o]);let f=t.find(t=>t.id===(e.config.model??e.effectiveConfig?.model)),p=n||!r,m=t.find(e=>e.isDefault)?.id??(e.config.model?null:e.effectiveConfig?.model),h=t.find(e=>e.id===m)?.name??m,g=[{value:``,label:h?`默认 · ${h}`:`模型未获取`},...t.map(e=>({value:e.id,label:e.name}))];e.config.model&&!t.some(t=>t.id===e.config.model)&&g.push({value:e.config.model,label:e.config.model});let _=f?.id===e.effectiveConfig?.model?e.effectiveConfig?.effort:f?.defaultEffort,y=[{value:``,label:_?`默认 · ${N[_]??_}`:`默认强度`},...(f?.efforts??[]).map(e=>({value:e,label:N[e]??e}))];return e.config.effort&&!y.some(t=>t.value===e.config.effort)&&y.push({value:e.config.effort,label:N[e.config.effort]??e.config.effort}),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(v,{id:`session-commands`,triggerId:`session-command-trigger`,label:`命令与 Skills`,placement:`top`,className:`composer-menu composer-commands`,routeKey:e.id,trigger:(0,j.jsx)(s,{name:`slash`,size:`small`}),open:u,onOpenChange:d,focusFirst:!1,disabled:p||!i,children:e=>(0,j.jsxs)(j.Fragment,{children:[[...a].sort((e,t)=>e.name.localeCompare(t.name,`en`)).map(t=>(0,j.jsx)(`button`,{type:`button`,role:`menuitem`,title:[t.description,t.path].filter(Boolean).join(`
|
|
3
3
|
`),onClick:()=>{e(),c(t)},children:(0,j.jsxs)(`span`,{className:`composer-command-row`,children:[(0,j.jsxs)(`span`,{className:`composer-command-name`,children:[t.kind===`skill`?`$`:`/`,t.name]}),(0,j.jsx)(`small`,{children:t.description})]})},`${t.kind}:${t.path??t.name}`)),!a.length&&(0,j.jsx)(`div`,{className:`composer-menu-heading`,children:`尚未获取命令`})]})}),(0,j.jsx)(F,{id:`session-model`,label:`模型`,current:e.config.model??``,options:g,disabled:p,onSelect:n=>{let r=t.find(e=>e.id===n);l({...e.config,model:n||null,effort:e.config.effort&&r?.efforts.includes(e.config.effort)?e.config.effort:null})}}),(0,j.jsx)(F,{id:`session-effort`,label:`思考强度`,current:e.config.effort??``,options:y,disabled:p,onSelect:t=>l({...e.config,effort:t||null})}),(0,j.jsx)(F,{id:`session-permission`,label:`权限`,current:e.config.permission,options:P,disabled:p,onSelect:t=>l({...e.config,permission:t})})]})}var ce=S({taskRoot:m().nullable().default(null),online:x(),computer:S({id:m(),name:m(),platform:m()}).nullable(),capabilities:y(m()),models:y(u),catalogs:y(T).default([]),directories:y(f),sessions:y(e)}),le=S({ok:x()}),I={idle:`空闲`,working:`工作中`,waiting:`等待回答`,queued:`等待执行`,uncertain:`需要核对`,human:`人工处理`,offered:`待本地接收`,accepted:`本地已接手`,human_routed:`未送达本地`,pending:`待投递`,sent:`已发送`,succeeded:`已完成`,running:`进行中`,failed:`失败`};function ue(){let{request:e}=D(),t=(0,A.useCallback)(t=>e(`web/local-agent-settings`,E,{signal:t}),[e]),n=r(t,3e4);return n.error?(0,j.jsx)(o,{error:!0,children:n.error}):n.data?n.data.accessible?(0,j.jsx)(L,{}):(0,j.jsx)(g,{title:`本项目暂未向你开放本地 Agent 功能`}):null}function L(){let t=D(),[n,u]=(0,A.useState)(()=>new Set),[d,f]=(0,A.useState)(()=>({project:t.projectId,directory:new URLSearchParams(location.search).get(`directory`)??``,session:new URLSearchParams(location.search).get(`session`)??``})),[m,g]=(0,A.useState)(``),[y,x]=(0,A.useState)(!1),[S,T]=(0,A.useState)(!1),[E,k]=(0,A.useState)(!1),[M,N]=(0,A.useState)(``),[P,F]=(0,A.useState)(``),[ue,L]=(0,A.useState)(!1),[fe,he]=(0,A.useState)(``),R=(0,A.useRef)(null),z=(0,A.useRef)(!0),B=(0,A.useRef)(void 0),ge=(0,A.useRef)(crypto.randomUUID()),_e=(0,A.useCallback)(async e=>[{...await t.request(`web/local-agent-computer`,ce,{signal:e}),project:t.projectId}],[t]),V=r(_e,3e3),H=V.data?.find(e=>e.project===d.project),U=H?.directories.find(e=>e.id===d.directory);C(d.project);let W=(0,A.useCallback)((e,t,n)=>C(d.project).request(e,t,n),[d.project]),ve=(0,A.useCallback)(e=>d.session?W(`web/local-agent-sessions/${d.session}`,l,{signal:e}):Promise.resolve(null),[W,d.session]),G=r(ve,15e3),[K,ye]=(0,A.useState)(),q=K?.session.id===d.session&&(!G.data||K.cursor>=G.data.cursor)?K:G.data;(0,A.useEffect)(()=>{if(!d.session)return;let e=new EventSource(w(`/api/v1/projects/${encodeURIComponent(d.project)}/web/local-agent-sessions/${encodeURIComponent(d.session)}/events`)),t=!0;return e.addEventListener(`snapshot`,e=>{try{let n=l.parse(JSON.parse(e.data));t&&ye(e=>e?.session.id===n.session.id&&e.cursor>n.cursor?e:n)}catch(e){g(a(e))}}),()=>{t=!1,e.close()}},[d.project,d.session]),(0,A.useEffect)(()=>{z.current=!0},[d.project,d.session]),(0,A.useEffect)(()=>{z.current&&R.current&&(R.current.scrollTop=R.current.scrollHeight)},[q?.cursor,q?.messages.length]);let J=q?.session,Y=H?.capabilities.includes(`local-sessions-v1`),X=(e,n,r=``)=>{f({project:e,directory:n,session:r}),k(!1),L(!1),he(``),N(``),g(``);let i=new URL(location.href);i.searchParams.set(`directory`,n),r?i.searchParams.set(`session`,r):i.searchParams.delete(`session`),e===t.projectId&&history.replaceState(null,``,i)};(0,A.useEffect)(()=>{if(!d.directory&&V.data?.[0]?.directories[0]){let e=V.data[0],t=e.directories[0],n=e.sessions.find(e=>e.id===d.session);X(e.project,n?.directory??t.id,n?.id??t.defaultSession)}},[V.data]),(0,A.useEffect)(()=>{if(!J)return;let e=()=>{document.visibilityState===`visible`&&W(`web/local-agent-sessions/${J.id}/read`,le,{method:`POST`}).catch(e=>g(a(e)))};return e(),document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[J?.id,q?.messages.at(-1)?.seq,W]);async function Z(e){x(!0),g(``);try{await e(),await Promise.all([G.reload(),V.reload()])}catch(e){g(a(e))}finally{x(!1)}}let[Q,$]=(0,A.useState)(null);(0,A.useEffect)(()=>$(null),[J?.id]);let be=H?.catalogs.find(e=>J?.cwd?e.cwd===J.cwd:e.directory===(J?.executionDirectory??J?.directory))?.commands??[],xe=new Map;for(let e of V.data??[]){let t=e.computer?.id??`unknown:${e.project}`;xe.set(t,[...xe.get(t)??[],e])}return(0,j.jsxs)(re,{className:`computers-layout`,testId:`computers-page`,label:`本地会话`,tree:!0,navigation:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(p,{title:`电脑`,icon:`computers`,children:(0,j.jsx)(v,{id:`computer-create-menu`,triggerId:`computer-create`,label:`新建`,trigger:(0,j.jsx)(s,{name:`plus`}),className:`computer-create-menu`,routeKey:d.directory,children:e=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:!U||!Y,onClick:()=>{e(),L(!0),T(!1),k(!1)},children:`新建会话`}),(0,j.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{e(),T(!0),L(!1),k(!1)},children:`接入目录`})]})})}),(0,j.jsx)(`div`,{className:`assistant-message-scroll computer-tree`,role:`tree`,"aria-label":`电脑与会话`,onKeyDown:oe,children:[...xe.entries()].map(([e,t])=>(0,j.jsxs)(`div`,{role:`none`,children:[(0,j.jsxs)(`div`,{className:`computer-device`,children:[(0,j.jsx)(`span`,{className:`computer-connection ${t.some(e=>e.online)?`online`:``}`,role:`img`,"aria-label":t.some(e=>e.online)?`在线`:`离线`,title:t.some(e=>e.online)?`在线`:`离线`,children:(0,j.jsx)(s,{name:`device`,size:`small`})}),(0,j.jsx)(`span`,{title:t[0].computer?.name,children:t[0].computer?.name??`已连接客户端`})]}),t.map(e=>(0,j.jsx)(`div`,{role:`none`,children:e.directories.map(t=>{let r=`${e.project}/${t.id}`,i=!n.has(r);return(0,j.jsxs)(`div`,{role:`none`,children:[(0,j.jsxs)(h,{className:`tree-item tree-folder`,role:`treeitem`,"aria-level":1,"aria-expanded":i,style:{"--tree-level":1},leading:(0,j.jsx)(`span`,{className:`tree-chevron ${i?`expanded`:``}`,children:(0,j.jsx)(s,{name:`chevron`,size:`small`})}),onClick:()=>u(e=>{let t=new Set(e);return i?t.add(r):t.delete(r),t}),children:[(0,j.jsx)(s,{name:`files`}),(0,j.jsx)(`span`,{className:`tree-name`,title:t.name,children:t.name})]}),i&&(0,j.jsx)(`div`,{role:`group`,children:e.sessions.filter(e=>e.directory===t.id).map(n=>(0,j.jsxs)(h,{className:`tree-item`,role:`treeitem`,"aria-level":2,"aria-selected":d.session===n.id&&d.project===e.project,style:{"--tree-level":2},leading:(0,j.jsx)(`span`,{className:`tree-chevron`,children:(0,j.jsx)(`span`,{className:`assistant-message-dot ${n.unread?`unread`:``}`})}),title:n.title,onClick:()=>X(e.project,t.id,n.id),children:[(0,j.jsx)(s,{name:`messages`}),(0,j.jsx)(`span`,{className:`tree-name`,children:n.title}),n.archived?(0,j.jsx)(`span`,{title:`已归档`,role:`img`,"aria-label":`已归档`,children:(0,j.jsx)(s,{name:`archive`,size:`small`})}):n.state!==`idle`&&(0,j.jsx)(ne,{state:n.state,label:I[n.state]??n.state})]},n.id))})]},t.id)})},e.project))]},e))}),(0,j.jsx)(o,{error:!0,children:V.error})]}),children:[S&&(0,j.jsxs)(`div`,{className:`stack computer-panel`,children:[(0,j.jsx)(`h2`,{children:`接入目录`}),(0,j.jsx)(_,{id:`computer-connect`,label:`在目标电脑连接项目`,value:`teammy connect`}),(0,j.jsx)(_,{id:`computer-register`,label:`在该电脑登记执行目录`,value:`teammy agent register --provider codex --cwd .`}),(0,j.jsx)(`p`,{className:`muted`,children:`完成登记后自动显示。会话可直接在网页使用,也可连接专用群。`})]}),U?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(te,{title:J?(0,j.jsx)(me,{title:J.title,busy:y,onSave:t=>Z(()=>W(`web/local-agent-sessions/${J.id}/settings`,e,{method:`PUT`,body:{expectedRevision:J.revision,title:t,config:J.config}}))},J.id):(0,j.jsx)(`h2`,{children:U.name}),actions:(0,j.jsx)(c,{icon:`settings`,label:`会话与目录设置`,disabled:!J,onClick:()=>k(!0)})}),!Y&&(0,j.jsx)(o,{children:`升级客户端后可使用多个会话和网页对话。`}),ue&&(0,j.jsxs)(`form`,{className:`computer-panel inline-form`,onSubmit:t=>{t.preventDefault(),Z(async()=>{let t=await W(`web/local-agents/${U.id}/sessions`,e,{method:`POST`,body:{id:ge.current,title:P}});ge.current=crypto.randomUUID(),L(!1),F(``),X(d.project,U.id,t.id)})},children:[(0,j.jsx)(`input`,{required:!0,"aria-label":`会话名称`,placeholder:`会话名称`,value:P,onChange:e=>F(e.target.value)}),(0,j.jsx)(`button`,{disabled:y||!P.trim(),children:`创建`})]}),E&&J&&H&&(0,j.jsx)(i,{id:`computer-settings`,title:`会话与目录设置`,onClose:()=>k(!1),children:(0,j.jsx)(pe,{session:J,directory:U,entry:H,request:W,busy:y,save:Z,code:fe,setCode:he},`${J.id}:${J.revision}`)}),(0,j.jsxs)(ee,{ref:R,onScroll:e=>{let t=e.currentTarget;z.current=t.scrollHeight-t.scrollTop-t.clientHeight<96},"aria-label":`本地会话记录`,children:[q?.messages.map(e=>e.role===`system`?(0,j.jsx)(`div`,{className:`conversation-system-message`,children:e.body},e.id):(0,j.jsxs)(ie,{className:e.question?`question-bubble`:``,mine:e.role===`user`,author:e.role===`user`?`你`:`本地 Agent`,time:e.createdAt,children:[e.question?(0,j.jsx)(de,{question:e.question,session:J.id,request:W,refresh:G.reload}):(0,j.jsx)(`div`,{className:`markdown`,children:(0,j.jsx)(O,{children:e.body})}),e.role===`user`&&[`offered`,`pending`,`human_routed`,`failed`,`uncertain`].includes(e.state)&&(0,j.jsx)(ne,{label:I[e.state]??e.state,state:e.state})]},e.id)),!q?.messages.length&&(0,j.jsx)(`div`,{className:`assistant-empty`,children:`在当前目录开始一段对话。`})]}),q?.commands.filter(e=>e.state!==`succeeded`).slice(-3).map(e=>(0,j.jsxs)(`p`,{className:`computer-control-status`,role:`status`,children:[e.kind,` · `,I[e.state]??e.state,e.error?`:${e.error}`:``]},e.id)),(0,j.jsx)(o,{error:!0,children:m||G.error||J?.error}),J&&(0,j.jsx)(ae,{value:M,onChange:N,label:`向本地 Agent 发送消息`,placeholder:J.archived?`会话已归档`:`输入消息…`,disabled:J.archived||!Y,sendDisabled:y,actions:(0,j.jsx)(se,{session:J,models:H?.models??[],busy:y,available:!!Y,online:!!H?.online,commands:be,draft:M,onInsert:e=>{$(e.kind===`skill`?e:null),N(`${e.kind===`skill`?`$`:`/`}${e.name} `),requestAnimationFrame(()=>document.querySelector(`.message-composer textarea`)?.focus())},onConfig:t=>{k(!1),Z(()=>W(`web/local-agent-sessions/${J.id}/settings`,e,{method:`PUT`,body:{expectedRevision:J.revision,title:J.title,config:t}}))}}),onSubmit:e=>{e.preventDefault();let t=M.trim();if(!t)return;let n=Q?.path&&t.startsWith(`$${Q.name}`)?[{name:Q.name,path:Q.path}]:void 0,r=JSON.stringify({session:J.id,body:t,skills:n});B.current?.fingerprint!==r&&(B.current={fingerprint:r,id:crypto.randomUUID()});let i=B.current;Z(async()=>{await W(`web/local-agent-sessions/${J.id}/messages`,b(),{method:`POST`,body:{id:i.id,body:t,...n?{skills:n}:{}}}),N(e=>e.trim()===t?``:e),$(null),B.current===i&&(B.current=void 0)})}})]}):(0,j.jsxs)(`div`,{className:`assistant-empty`,children:[`尚未登记本地执行目录。`,(0,j.jsx)(`button`,{onClick:()=>T(!0),children:`接入目录`})]})]})}function de({question:e,session:t,request:n,refresh:r}){let[i,c]=(0,A.useState)({}),[l,u]=(0,A.useState)(``),[d,f]=(0,A.useState)(!1),p=(0,A.useRef)(null),m=(0,A.useRef)(!1),h=(0,A.useRef)(void 0);(0,A.useEffect)(()=>{if(e.state!==`pending`||m.current||!p.current)return;let r=!1,i=()=>{if(r&&document.visibilityState===`visible`&&p.current){let r=p.current.getBoundingClientRect();r.bottom>0&&r.top<innerHeight&&n(`web/local-agent-sessions/${t}/questions/${e.id}/presented`,le,{method:`POST`}).then(()=>{m.current=!0}).catch(e=>u(a(e)))}},o=new IntersectionObserver(e=>{r=e.some(e=>e.isIntersecting),r&&i()});return o.observe(p.current),document.addEventListener(`visibilitychange`,i),()=>{o.disconnect(),document.removeEventListener(`visibilitychange`,i)}},[e.id,e.state,t,n]);async function g(i,o){h.current&&h.current.body===i||(h.current={body:i,id:crypto.randomUUID(),...o===void 0?{}:{decision:o}}),f(!0),u(``);try{return await n(`web/local-agent-sessions/${t}/questions/${e.id}/answers`,b(),{method:`POST`,body:h.current}),h.current=void 0,r(),!0}catch(e){return u(a(e)),!1}finally{f(!1)}}let _=e.response,v=e.state===`answered`,y=[`expired`,`cancelled`].includes(e.state),x=[`human_routed`,`failed`].includes(e.submissionState??``),S=e.state===`pending`&&(!_||x),C=y?`已过期`:e.state===`uncertain`||e.submissionState===`uncertain`?`需核对`:v?e.approval?_?.decision===!0?`已允许`:_?.decision===!1?`已拒绝`:`已处理`:_?``:`已回答`:x?`未送达`:_?`正在提交`:``,w=y||_?.decision===!1||x?`close`:v?`check`:`clock`;return(0,j.jsxs)(`div`,{className:`native-question`,ref:p,children:[e.questions.map(t=>(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`p`,{children:t.text}),S&&(0,j.jsx)(`div`,{className:`question-options`,children:(e.approval?[`允许`,`拒绝`]:t.options).map(n=>(0,j.jsx)(`button`,{disabled:d||e.state!==`pending`,"aria-pressed":i[t.id]===n,onClick:()=>{c(e=>({...e,[t.id]:n})),e.questions.length===1&&g(n,e.approval?n===`允许`:void 0)},children:n},n))}),!e.approval&&t.freeText&&S&&(0,j.jsx)(M,{disabled:d,onSend:async n=>e.questions.length===1?g(n):(c(e=>({...e,[t.id]:n})),!0)}),!S&&!e.approval&&_?.answers[t.id]&&(0,j.jsxs)(`div`,{className:`question-response`,children:[(0,j.jsx)(s,{name:v?`check`:`clock`,size:`small`}),(0,j.jsx)(`span`,{children:_.answers[t.id]})]}),S&&e.questions.length>1&&i[t.id]&&!t.options.includes(i[t.id])&&(0,j.jsx)(`small`,{children:i[t.id]})]},t.id)),S?(0,j.jsxs)(j.Fragment,{children:[!e.approval&&e.questions.length>1&&(0,j.jsx)(`div`,{className:`question-actions`,children:(0,j.jsx)(`button`,{disabled:d||e.questions.some(e=>!i[e.id]?.trim()),onClick:()=>void g(e.questions.length===1?i[e.questions[0].id]:JSON.stringify(i)),children:`回答`})}),e.approval&&(0,j.jsx)(`small`,{className:`muted`,children:`60 秒后自动允许`})]}):null,C&&(0,j.jsxs)(`small`,{className:`question-result`,children:[(0,j.jsx)(s,{name:w,size:`small`}),C]}),(0,j.jsx)(o,{error:!0,children:l})]})}function fe({value:e,onChange:t,models:n}){let r=n.find(t=>t.id===e.model);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`label`,{children:[`模型`,(0,j.jsxs)(`select`,{value:e.model??``,onChange:n=>t({...e,model:n.target.value||null,effort:null}),children:[(0,j.jsx)(`option`,{value:``,children:`本机默认`}),n.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,j.jsxs)(`label`,{children:[`思考强度`,(0,j.jsxs)(`select`,{value:e.effort??``,onChange:n=>t({...e,effort:n.target.value||null}),children:[(0,j.jsx)(`option`,{value:``,children:`模型默认`}),r?.efforts.map(e=>(0,j.jsx)(`option`,{children:e},e))]})]}),(0,j.jsxs)(`label`,{children:[`权限`,(0,j.jsxs)(`select`,{value:e.permission,onChange:n=>t({...e,permission:n.target.value}),children:[(0,j.jsx)(`option`,{value:`read-only`,children:`只读 · 禁止提权`}),(0,j.jsx)(`option`,{value:`workspace-write`,children:`工作区写入 · 按需审批`}),(0,j.jsx)(`option`,{value:`full-access`,children:`完整访问 · 按需审批`})]})]})]})}function pe({session:n,directory:r,entry:i,request:a,busy:o,save:s,code:c,setCode:l}){let[u,d]=(0,A.useState)(r.defaults??t.parse({})),[f,p]=(0,A.useState)(r.defaultSession??n.id),[h,g]=(0,A.useState)(r.name),[v,y]=(0,A.useState)(r.responsibilities),[x,C]=(0,A.useState)(r.enabled),[w,T]=(0,A.useState)(n.executionDirectory),[D,O]=(0,A.useState)();return(0,A.useEffect)(()=>{a(`web/local-agent-settings`,E).then(O).catch(()=>{})},[a]),(0,j.jsxs)(`div`,{className:`computer-panel stack`,children:[(0,j.jsxs)(`details`,{open:!0,children:[(0,j.jsx)(`summary`,{children:`执行位置与连接`}),(0,j.jsx)(`div`,{className:`config-fields`,children:(0,j.jsxs)(`label`,{children:[`执行位置`,(0,j.jsxs)(`select`,{value:w??``,onChange:e=>T(e.target.value||null),children:[(0,j.jsx)(`option`,{value:``,children:`原登记目录`}),i.directories.filter(e=>e.id!==r.id).map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})}),n.cwd&&(0,j.jsxs)(`p`,{className:`computer-paths`,children:[`当前执行路径:`,(0,j.jsx)(`code`,{children:n.cwd})]}),(0,j.jsx)(`button`,{disabled:o,onClick:()=>void s(()=>a(`web/local-agent-sessions/${n.id}/settings`,e,{method:`PUT`,body:{expectedRevision:n.revision,title:n.title,config:n.config,executionDirectory:w}})),children:`保存执行位置`}),(0,j.jsx)(`button`,{disabled:o||n.bound,onClick:()=>void s(async()=>{l((await a(`web/local-agent-bindings/codes`,S({code:m()}),{method:`POST`,body:{directory:r.id,session:n.id,expectedRevision:n.bindingRevision}})).code)}),children:n.bound?`已连接专用群`:`连接专用群`}),c&&(0,j.jsx)(_,{id:`session-binding`,label:`在目标群发送`,value:`/bind ${c}`})]}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:`目录默认设置与接单`}),(0,j.jsxs)(`div`,{className:`config-fields`,children:[(0,j.jsxs)(`label`,{children:[`目录名称`,(0,j.jsx)(`input`,{value:h,onChange:e=>g(e.target.value)})]}),(0,j.jsxs)(`label`,{children:[`职责`,(0,j.jsx)(`textarea`,{value:v,onChange:e=>y(e.target.value)})]}),(0,j.jsxs)(`label`,{children:[`默认会话`,(0,j.jsx)(`select`,{value:f,onChange:e=>p(e.target.value),children:i.sessions.filter(e=>e.directory===r.id&&!e.archived).map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.title},e.id))})]}),(0,j.jsx)(fe,{value:u,onChange:d,models:i.models})]}),(0,j.jsx)(`p`,{className:`muted`,children:`用于新会话与新派工。`}),(0,j.jsx)(`button`,{disabled:o,onClick:()=>void s(()=>a(`web/local-agents/${r.id}/settings`,b(),{method:`PUT`,body:{defaultSession:f,defaults:u,name:h,responsibilities:v,enabled:x,expectedRevision:r.revision}})),children:`保存目录默认设置`}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>C(e.target.checked)}),`此目录自动接单`]}),(0,j.jsx)(`p`,{children:r.available?`可自动接单`:r.reason}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:D?.enabled??!1,disabled:!D||o,onChange:e=>void s(async()=>O(await a(`web/local-agent-settings`,E,{method:`PUT`,body:{enabled:e.target.checked,expectedRevision:D.revision}})))}),`开启本项目的本地执行`]}),(0,j.jsx)(_,{id:`directory-intake`,label:r.enabled?`暂停此目录新增接单`:`开启此目录自动接单`,value:`teammy agent ${r.enabled?`disable`:`enable`} --id ${r.id}`})]})]})}function me({title:e,busy:t,onSave:n}){let[r,i]=(0,A.useState)(!1),[a,o]=(0,A.useState)(e);return r?(0,j.jsx)(`form`,{className:`session-title-form`,onSubmit:t=>{t.preventDefault(),a.trim()&&a.trim()!==e&&n(a.trim()),i(!1)},children:(0,j.jsx)(`input`,{autoFocus:!0,"aria-label":`会话标题`,value:a,disabled:t,onChange:e=>o(e.target.value),onBlur:()=>i(!1),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),i(!1))}})}):(0,j.jsx)(`h2`,{children:(0,j.jsx)(`button`,{type:`button`,className:`session-rename`,title:`重命名会话`,"aria-label":`重命名会话:${e}`,onClick:()=>{o(e),i(!0)},children:e})})}export{ue as Computers};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,p as t}from"./index-
|
|
1
|
+
import{G as e,p as t}from"./index-C5-iSe99.js";var n=e();function r({navigation:e,children:r,className:i=``,tree:a=!1,label:o,testId:s}){return(0,n.jsx)(t,{className:`assistant-layout conversation-layout ${i}`,"data-testid":s,navigation:(0,n.jsx)(`aside`,{className:`assistant-list ${a?`file-tree-pane`:``}`,"aria-label":`${o}列表`,children:e}),children:(0,n.jsx)(`section`,{className:`assistant-thread`,"aria-label":o,children:r})})}function i({mine:e=!1,author:t,time:r,children:i,className:a=``,ref:o,...s}){return(0,n.jsx)(`div`,{...s,ref:o,className:`assistant-bubble-row ${e?`mine`:``} ${a}`,children:(0,n.jsxs)(`div`,{className:`assistant-bubble`,children:[(0,n.jsxs)(`div`,{className:`assistant-bubble-meta`,children:[(0,n.jsx)(`span`,{children:t}),r&&(0,n.jsx)(`time`,{dateTime:r,children:new Date(r).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]}),i]})})}function a({label:e,state:t=`idle`}){return(0,n.jsx)(`span`,{className:`conversation-status state-${t}`,role:`img`,"aria-label":e,title:e})}function o({author:e,time:t,children:r}){return(0,n.jsxs)(`article`,{className:`conversation-post assistant-bubble`,children:[(0,n.jsxs)(`header`,{className:`assistant-bubble-meta`,children:[(0,n.jsx)(`strong`,{children:e}),t&&(0,n.jsx)(`time`,{dateTime:t,children:new Date(t).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})})]}),r]})}function s({title:e,actions:t}){return(0,n.jsxs)(`header`,{className:`assistant-thread-heading`,children:[(0,n.jsx)(`div`,{className:`conversation-title`,children:e}),t]})}function c({ref:e,...t}){return(0,n.jsx)(`div`,{role:`log`,"aria-live":`polite`,...t,ref:e,className:`assistant-transcript`})}export{c as a,o as i,s as n,a as o,r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,B as t,D as n,G as r,H as i,I as a,J as o,L as s,M as c,N as l,O as u,P as d,R as f,U as p,V as m,_t as h,vt as g,y as _}from"./index-C5-iSe99.js";import{t as v}from"./project-links-Dy6-B89_.js";import"./file-links-B0q73ekI.js";var y=h(),b=r(),x=[{status:`planned`,label:`计划`},{status:`in_progress`,label:`进行中`},{status:`in_review`,label:`待验收`},{status:`completed`,label:`已完成`},{status:null,label:`未明确`}];function S({members:t,project:r,userName:a}){let{request:o,projectId:c}=_(),u=(0,y.useCallback)(e=>o(`tasks`,n,{signal:e}),[o]),d=i(u,3e3,p(c,`tasks`)),[m,h]=(0,y.useState)(),[v,S]=(0,y.useState)(!1),[w,T]=(0,y.useState)(Date.now);(0,y.useEffect)(()=>{let e=setInterval(()=>T(Date.now()),6e4);return()=>clearInterval(e)},[]);let D=d.data,O=new Map(t.map(e=>[e.id,e.displayName||e.id]));return(0,b.jsxs)(`div`,{className:`task-board`,children:[(0,b.jsx)(f,{title:r?.projectName.trim()?`${r.projectName.trim()}|工作看板`:`工作看板`,description:r?.description.trim()||``,children:(0,b.jsx)(`a`,{className:`account-home`,"data-testid":`home-link`,href:g(`/projects`),onClick:e=>{e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),history.pushState(null,``,g(`/projects`)),window.dispatchEvent(new PopStateEvent(`popstate`)))},"aria-label":`项目主页`,"data-tooltip":`项目主页`,children:(0,b.jsx)(`strong`,{children:a})})}),(0,b.jsx)(s,{error:!0,children:d.error}),(0,b.jsx)(`section`,{className:`task-board-lanes`,"aria-label":`任务进度`,"data-testid":`progress-board`,children:x.filter(e=>e.status!==null||D?.tasks.some(e=>e.status===null)).map(t=>{let n=D?.tasks.filter(e=>e.status===t.status)??[];n.sort((e,n)=>(t.status===`completed`?n.statusSince.localeCompare(e.statusSince):e.statusSince.localeCompare(n.statusSince))||e.id.localeCompare(n.id));let r=t.status===`completed`&&!v?n.slice(0,5):n;return(0,b.jsxs)(`section`,{className:`task-lane`,"aria-label":t.label,"data-stage":t.status??`unknown`,children:[(0,b.jsxs)(`h2`,{children:[(0,b.jsx)(`span`,{className:`lane-dot`}),t.label,(0,b.jsx)(e,{children:D?n.length:`—`})]}),(0,b.jsxs)(`div`,{className:`task-lane-content`,children:[n.length?r.map(e=>(0,b.jsx)(C,{task:e,names:O,now:w,onEdit:()=>h(e),onSaved:()=>void d.reload()},e.id)):(0,b.jsx)(`p`,{className:`task-lane-empty`,children:d.error&&!D?`读取失败`:D?`暂无任务`:`读取中…`}),t.status===`completed`&&n.length>5&&(0,b.jsxs)(`button`,{type:`button`,className:`task-lane-expand`,"aria-expanded":v,onClick:()=>S(!v),children:[(0,b.jsx)(l,{name:v?`chevronUp`:`chevronDown`,size:`small`}),v?`收起`:`展开其余 ${n.length-5} 项`]})]})]},t.label)})}),m&&(0,b.jsx)(E,{task:m,onClose:()=>h(void 0),onSaved:()=>{h(void 0),d.reload()}},m.id)]})}function C({task:e,names:n,onEdit:r,onSaved:i,now:a}){let{projectId:c,request:f}=_(),p=m(),[h,x]=(0,y.useState)(!1),[S,C]=(0,y.useState)(``);async function E(){if(!h){x(!0),C(``);try{await f(`tasks/${e.id}/correction`,u,{method:`PATCH`,signal:p,body:{needsConfirmation:!1,expectedRevision:e.revision}}),p.aborted||i()}catch(e){p.aborted||C(o(e))}finally{x(!1)}}}return(0,b.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,b.jsxs)(`summary`,{className:`task-card-heading`,"data-testid":`task-toggle`,children:[(0,b.jsx)(`h3`,{children:e.title}),(0,b.jsxs)(`span`,{className:`task-card-meta`,children:[(0,b.jsx)(`small`,{title:n.get(e.owner)??e.owner,children:n.get(e.owner)??e.owner}),e.needsConfirmation&&(0,b.jsxs)(`span`,{className:`task-confirmation`,"data-testid":`task-confirmation`,children:[(0,b.jsx)(l,{name:`attention`,size:`small`}),`需要确认`]}),e.status!==`completed`&&(0,b.jsx)(w,{since:e.statusSince,now:a})]})]}),(0,b.jsx)(d,{icon:`edit`,className:`task-card-edit`,label:`纠正任务:${e.title}`,"data-testid":`task-correct`,disabled:h,onClick:r}),(0,b.jsxs)(`div`,{className:`task-card-details`,children:[(0,b.jsx)(`h4`,{children:`目标`}),(0,b.jsx)(`p`,{children:e.goal?(0,b.jsx)(T,{value:e.goal,names:n}):`目标未明确`}),(0,b.jsx)(`h4`,{children:`当前进展`}),(0,b.jsx)(`p`,{className:`task-progress`,children:(0,b.jsx)(T,{value:e.progress,names:n})}),(0,b.jsx)(`div`,{className:`task-card-sources`,children:e.sources.map(t=>(0,b.jsxs)(`a`,{"data-testid":`task-source`,href:g(t.kind===`material`?`/projects/${c}/materials?id=${t.materialId}&revision=${t.revision}`:v(c,e.owner,t.path)),children:[(0,b.jsx)(l,{name:`file`,size:`small`}),(0,b.jsx)(`span`,{children:t.path})]},t.path))}),e.syncedAt&&(0,b.jsxs)(`small`,{children:[`资料同步于 `,(0,b.jsx)(t,{value:e.syncedAt})]}),e.needsConfirmation&&(0,b.jsxs)(`div`,{className:`task-card-confirm`,children:[(0,b.jsx)(s,{error:!0,children:S}),(0,b.jsx)(`button`,{className:`primary`,"data-testid":`task-confirm-save`,disabled:h,onClick:()=>void E(),children:h?`正在保存…`:`保存`})]})]})]})}function w({since:e,now:t}){let n=Math.max(0,t-Date.parse(e)),r=Math.floor(n/6e4),i=r<1?`刚刚`:r<60?`${r} 分钟`:r<1440?`${Math.floor(r/60)} 小时`:`${Math.floor(r/1440)} 天`;return(0,b.jsxs)(`span`,{className:`task-age${n>6048e5?` stale`:``}`,"data-testid":`task-age`,title:`进入当前状态:${new Date(e).toLocaleString(`zh-CN`)}`,"aria-label":`当前状态停留 ${i}`,children:[(0,b.jsx)(l,{name:`clock`,size:`small`}),i]})}function T({value:e,names:t}){return e.split(/(@[a-z][a-z0-9_-]*)/gi).map((e,n)=>e.startsWith(`@`)&&t.has(e.slice(1))?(0,b.jsx)(`mark`,{className:`task-mention`,children:e},n):e)}function E({task:e,onClose:t,onSaved:n}){let{request:r}=_(),i=m(),[l,d]=(0,y.useState)(e.title),[f,p]=(0,y.useState)(e.status??``),[h,g]=(0,y.useState)(e.goal??``),[v,S]=(0,y.useState)(e.progress),[C,w]=(0,y.useState)(!1),[T,E]=(0,y.useState)(``),D={...l===e.title?{}:{title:l},...f===(e.status??``)?{}:{status:f||null},...h===(e.goal??``)?{}:{goal:h||null},...v===e.progress?{}:{progress:v},...e.needsConfirmation?{needsConfirmation:!1}:{}};async function O(){if(!C&&Object.keys(D).length){w(!0),E(``);try{await r(`tasks/${e.id}/correction`,u,{method:`PATCH`,signal:i,body:{...D,expectedRevision:e.revision}}),i.aborted||n()}catch(e){i.aborted||E(o(e))}finally{w(!1)}}}return(0,b.jsx)(a,{id:`task-correction`,title:`纠正任务`,onClose:t,children:(0,b.jsxs)(`form`,{className:`stack`,"aria-busy":C,onSubmit:e=>{e.preventDefault(),O()},children:[(0,b.jsx)(c,{id:`task-title`,label:`标题`,children:(0,b.jsx)(`input`,{value:l,required:!0,onChange:e=>d(e.target.value)})}),(0,b.jsxs)(`fieldset`,{className:`task-status-field`,disabled:C,children:[(0,b.jsx)(`legend`,{children:`状态`}),(0,b.jsx)(`div`,{className:`task-status-options`,"data-testid":`task-status`,children:x.filter(e=>e.status!==null).map(e=>(0,b.jsxs)(`label`,{className:`task-status-choice`,children:[(0,b.jsx)(`input`,{type:`radio`,name:`task-status`,value:e.status,checked:f===e.status,onChange:()=>p(e.status)}),(0,b.jsx)(`span`,{children:e.label})]},e.status))}),(0,b.jsx)(`small`,{children:`待验收:任务成果已提交,等待验收或最终确认。`})]}),(0,b.jsx)(c,{id:`task-goal`,label:`目标`,children:(0,b.jsx)(`textarea`,{value:h,onChange:e=>g(e.target.value)})}),(0,b.jsx)(c,{id:`task-progress`,label:`当前进展`,children:(0,b.jsx)(`textarea`,{value:v,onChange:e=>S(e.target.value)})}),(0,b.jsx)(s,{error:!0,children:T}),(0,b.jsx)(`div`,{className:`row wrap`,children:(0,b.jsx)(`button`,{type:`submit`,className:`primary`,disabled:C||!Object.keys(D).length,"data-testid":`task-correction-save`,children:`保存`})})]})})}function D({members:e,config:t,userName:n}){return(0,b.jsx)(S,{members:e,project:t,userName:n})}export{D as Dashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,H as t,K as n,L as r,N as i,P as a,Q as o,U as s,_t as c,c as l,d as u,et as d,f,j as p,l as m,s as h,u as g,vt as _,y as v,z as y}from"./index-
|
|
1
|
+
import{G as e,H as t,K as n,L as r,N as i,P as a,Q as o,U as s,_t as c,c as l,d as u,et as d,f,j as p,l as m,s as h,u as g,vt as _,y as v,z as y}from"./index-C5-iSe99.js";import{t as b}from"./Markdown-Bb9dy2Sh.js";import{n as x,t as S}from"./WorkspaceTree-D0UUUBtF.js";import{t as C}from"./project-links-Dy6-B89_.js";import{t as w}from"./file-links-B0q73ekI.js";import{t as T}from"./HtmlPreview-BcspnVI6.js";var E=c(),D=e();function O(e,t){let n=t.split(`/`).slice(0,-1);return n.map((t,r)=>x(e,n.slice(0,r+1).join(`/`))).concat(x(e,``))}function k({members:e,onRefresh:i}){let{api:s,projectId:c}=v(),[y,b]=(0,E.useState)(()=>{let t=new URLSearchParams(location.search),n=t.get(`owner`),r=d.safeParse(t.get(`path`));return n&&(g(n)||e.some(e=>e.id===n))&&r.success&&!m(r.data)?{owner:n,path:r.data}:void 0}),[T,k]=(0,E.useState)(()=>new Set(y?O(y.owner,y.path):[])),[j,M]=(0,E.useState)(()=>y?{...y,kind:`file`}:void 0),[N,P]=(0,E.useState)(0),[F,I]=(0,E.useState)(()=>{let e=new URLSearchParams(location.search);return!y&&(e.has(`owner`)||e.has(`path`))?`文件链接不完整或目标已不可用。`:``}),L=(0,E.useCallback)(async e=>{if(y)try{return{owner:y.owner,...await s.file(y.owner,y.path,void 0,e)}}catch(e){throw e instanceof n&&e.code===`FILE_NOT_FOUND`?Error(`找不到这个文件,可能已被删除或移动。`):e}},[y?.owner,y?.path,N]),R=t(L),z=R.data?.owner===y?.owner&&R.data?.file.path===y?.path?R.data:void 0;function B(e,t){let n=t.split(`/`).filter(Boolean);k(t=>{let r=new Set(t);for(let t=0;t<=n.length;t++)r.add(x(e,n.slice(0,t).join(`/`)));return r})}function V(e,t){I(``),B(e,t.split(`/`).slice(0,-1).join(`/`)),b({owner:e,path:t}),M({owner:e,path:t,kind:`file`}),history.replaceState(null,``,_(C(c,e,t)))}function H(t){if(!y)return!1;let n=w(g(y.owner)?y.path:`${y.owner}/${y.path}`,t);if(!n)return!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!t.startsWith(`//`)&&(I(`该链接超出工作区,请在原仓库查看。`),!0);if(m(n.path))return I(`配置文件不在文件浏览中显示。`),!0;if(l(n.path))return location.assign(_(`/projects/${c}/memory`)),!0;let[r,...i]=n.path.split(`/`),a=e.some(e=>e.id===r),o=a?r:h,s=a?i.join(`/`):n.path;return I(``),n.directory?(B(o,s),M({owner:o,path:s,kind:`directory`})):o===y.owner&&s===y.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`}):V(o,s),!0}return(0,D.jsx)(f,{"data-testid":`file-browser`,label:`文件资源管理器`,navigation:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(u,{title:`工作区`,icon:`files`,children:(0,D.jsx)(a,{icon:`refresh`,label:`刷新文件`,"data-testid":`files-refresh`,onClick:()=>{I(``),P(e=>e+1),i()}})}),(0,D.jsx)(S,{members:e,expanded:T,selected:j,revealed:!R.loading&&!R.error&&z?{owner:z.owner,path:z.file.path,file:z.file}:void 0,onSelect:V,onToggle:(e,t)=>{M({owner:e,path:t,kind:`directory`}),k(n=>{let r=new Set(n),i=x(e,t);return r.has(i)?r.delete(i):r.add(i),r})}},N)]}),children:(0,D.jsx)(`section`,{className:`file-detail`,"data-testid":`file-preview`,"data-owner-id":y?.owner,"data-file-path":y?.path,"aria-label":o.filePreview,children:y?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(r,{error:!0,children:F||!R.loading&&R.error}),R.error&&(0,D.jsx)(`button`,{className:`file-entry-retry`,"data-testid":`files-retry`,onClick:()=>void R.reload(),children:o.retry}),R.loading?(0,D.jsx)(`p`,{className:`preview-body`,role:`status`,children:o.loading}):!R.error&&z&&(0,D.jsx)(A,{owner:z.owner,file:z.file,onLink:H},`${z.owner}:${z.file.path}:${z.file.sha256}`)]}):F?(0,D.jsx)(r,{error:!0,children:F}):(0,D.jsx)(p,{mascot:!0,title:`查看工作区文件`,description:o.pickFile})})})}function A({owner:e,file:n,onLink:c}){let{readTextBlob:l,blobUrl:u,projectId:d}=v(),[f,p]=(0,E.useState)(!1),m=n.size>524288,h=/\.(md|markdown)$/i.test(n.path),_=/\.html?$/i.test(n.path),x=(0,E.useCallback)(e=>m?Promise.resolve(void 0):l(n,e),[n.sha256,n.size,m]),S=t(x,!1,s(d,`file-body`,n.sha256));return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`header`,{className:`file-detail-header`,children:[(0,D.jsxs)(`span`,{className:`file-detail-path`,title:`${g(e)?`teamcontext`:e}/${n.path}`,children:[(0,D.jsxs)(`span`,{children:[g(e)?`teamcontext`:e,` / `]}),n.path]}),(0,D.jsxs)(y,{label:`文件操作`,children:[(h||_)&&(0,D.jsx)(a,{icon:f?`preview`:`code`,label:f?`切换为预览`:`切换为原文`,"data-testid":`file-toggle-raw`,"aria-pressed":f,onClick:()=>p(!f)}),(0,D.jsx)(`a`,{className:`icon-button`,"data-testid":`file-download`,"aria-label":o.download,title:o.download,href:u(n.sha256),download:n.path.split(`/`).at(-1),children:(0,D.jsx)(i,{name:`download`})})]})]}),m?(0,D.jsx)(`div`,{className:`empty`,children:(0,D.jsx)(`p`,{children:o.previewLarge})}):S.error?(0,D.jsxs)(`div`,{className:`preview-body`,children:[(0,D.jsx)(r,{error:!0,children:S.error}),(0,D.jsx)(`button`,{"data-testid":`file-preview-retry`,onClick:()=>void S.reload(),children:o.retry})]}):S.loading?(0,D.jsx)(`p`,{className:`preview-body`,role:`status`,children:o.loading}):(0,D.jsx)(`div`,{className:`preview-body${_&&!f?` preview-body-html`:``}`,children:_&&!f?(0,D.jsx)(T,{url:u(n.sha256),name:n.path.split(`/`).at(-1)}):h&&!f?(0,D.jsx)(`article`,{className:`markdown`,"data-testid":`file-content`,"data-format":`markdown`,children:(0,D.jsx)(b,{onLink:c,children:S.data??``})}):(0,D.jsx)(`pre`,{className:`raw`,"data-testid":`file-content`,"data-format":`text`,children:S.data})})]})}export{k as Files};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as e,H as t,X as n,_ as r,_t as i,d as a,f as o,j as s,k as c,q as l,vt as u}from"./index-
|
|
1
|
+
import{G as e,H as t,X as n,_ as r,_t as i,d as a,f as o,j as s,k as c,q as l,vt as u}from"./index-C5-iSe99.js";import{t as d}from"./Markdown-Bb9dy2Sh.js";var f=`# 帮助
|
|
2
2
|
|
|
3
3
|
网页目录按 [index.json](index.json) 中的分组和文章顺序展示。
|
|
4
4
|
|
|
@@ -43,7 +43,7 @@ import{G as e,H as t,X as n,_ as r,_t as i,d as a,f as o,j as s,k as c,q as l,vt
|
|
|
43
43
|
|
|
44
44
|
| 日期 | 版本 | 核心更新 |
|
|
45
45
|
| -------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
46
|
-
| 26/10/xx | v0.0.x
|
|
46
|
+
| 26/10/xx | v0.0.x | 开发与内部验证。 |
|
|
47
47
|
| 26/10/29 | v0.1.2 | 首个公开版本上线 TI-ONE 服务。 |
|
|
48
48
|
| 26/10/29 | v0.1.3 | 修复已知问题。 |
|
|
49
49
|
| 26/10/30 | v0.1.4 | 修复已知问题。 |
|
|
@@ -70,9 +70,9 @@ import{G as e,H as t,X as n,_ as r,_t as i,d as a,f as o,j as s,k as c,q as l,vt
|
|
|
70
70
|
| 26/11/05 | v0.1.26 | 开放公共资料编辑权限,移除共享 Skills 维护。 |
|
|
71
71
|
| 26/11/06 | v0.1.27 | 精简 MR 规则文档,修复企微频道代码块展示。 |
|
|
72
72
|
| 26/11/06 | v0.2.0 | 首个 teammy-client 版本进入测试。 |
|
|
73
|
-
| 26/11/
|
|
74
|
-
| 26/11/12 | v0.2.1 | 支持本地执行,由 Tim 转交本地 Agent 开展;角色分工重构;网页消息/资料入口调整;新增帮助文档页;细节修复 |
|
|
73
|
+
| 26/11/12 | v0.2.1 | 新增 teammy-client 支持本地执行任务;角色分工和通信重构;网页消息/资料入口调整;新增帮助文档页;细节修复 |
|
|
75
74
|
| 26/11/12 | v0.2.2 | 本地执行能力按成员开放测试;看板排序修复;cli 修复; |
|
|
75
|
+
| 26/11/12 | v0.2.3 | 修复已知问题。 |
|
|
76
76
|
`,m=`# 让开发 Agent 使用 Teammy
|
|
77
77
|
|
|
78
78
|
正在使用的开发 Agent 可以通过 Teammy 查询任务、资料和历史会话,也可以向 Tim 提问或委托协作。开始一项工作前,让 Agent 查找团队已有的结论,有助于减少重复摸索。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e}from"./index-
|
|
1
|
+
import{G as e}from"./index-C5-iSe99.js";var t=e();function n({url:e,name:n}){return(0,t.jsx)(`iframe`,{className:`html-preview`,title:`${n} 预览`,src:`${e}${e.includes(`?`)?`&`:`?`}view=html`,sandbox:``,referrerPolicy:`no-referrer`})}export{n as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as e,Q as t,St as n,_t as r,bt as i,vt as a,xt as o}from"./index-BQicHl1a.js";function s(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var c=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,u={};function d(e,t){return((t||u).jsx?l:c).test(e)}var f=/[ \t\n\f\r]/g;function p(e){return typeof e==`object`?e.type===`text`&&m(e.value):m(e)}function m(e){return e.replace(f,``)===``}var h=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};h.prototype.normal={},h.prototype.property={},h.prototype.space=void 0;function g(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new h(n,r,t)}function _(e){return e.toLowerCase()}var v=class{constructor(e,t){this.attribute=t,this.property=e}};v.prototype.attribute=``,v.prototype.booleanish=!1,v.prototype.boolean=!1,v.prototype.commaOrSpaceSeparated=!1,v.prototype.commaSeparated=!1,v.prototype.defined=!1,v.prototype.mustUseProperty=!1,v.prototype.number=!1,v.prototype.overloadedBoolean=!1,v.prototype.property=``,v.prototype.spaceSeparated=!1,v.prototype.space=void 0;var y=o({boolean:()=>x,booleanish:()=>S,commaOrSpaceSeparated:()=>D,commaSeparated:()=>E,number:()=>w,overloadedBoolean:()=>C,spaceSeparated:()=>T}),b=0,x=O(),S=O(),C=O(),w=O(),T=O(),E=O(),D=O();function O(){return 2**++b}var k=Object.keys(y),A=class extends v{constructor(e,t,n,r){let i=-1;if(super(e,t),ee(this,`space`,r),typeof n==`number`)for(;++i<k.length;){let e=k[i];ee(this,k[i],(n&y[e])===y[e])}}};A.prototype.defined=!0;function ee(e,t,n){n&&(e[t]=n)}function j(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new A(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_(r)]=r,n[_(a.attribute)]=r}return new h(t,n,e.space)}var M=j({properties:{ariaActiveDescendant:null,ariaAtomic:S,ariaAutoComplete:null,ariaBusy:S,ariaChecked:S,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:T,ariaCurrent:null,ariaDescribedBy:T,ariaDetails:null,ariaDisabled:S,ariaDropEffect:T,ariaErrorMessage:null,ariaExpanded:S,ariaFlowTo:T,ariaGrabbed:S,ariaHasPopup:null,ariaHidden:S,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:T,ariaLevel:w,ariaLive:null,ariaModal:S,ariaMultiLine:S,ariaMultiSelectable:S,ariaOrientation:null,ariaOwns:T,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:S,ariaReadOnly:S,ariaRelevant:null,ariaRequired:S,ariaRoleDescription:T,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:S,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function te(e,t){return t in e?e[t]:t}function ne(e,t){return te(e,t.toLowerCase())}var N=j({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:E,acceptCharset:T,accessKey:T,action:null,allow:null,allowFullScreen:x,allowPaymentRequest:x,allowUserMedia:x,alpha:x,alt:null,as:null,async:x,autoCapitalize:null,autoComplete:T,autoFocus:x,autoPlay:x,blocking:T,capture:null,charSet:null,checked:x,cite:null,className:T,closedBy:null,colorSpace:null,cols:w,colSpan:w,command:null,commandFor:null,content:null,contentEditable:S,controls:x,controlsList:T,coords:w|E,crossOrigin:null,data:null,dateTime:null,decoding:null,default:x,defer:x,dir:null,dirName:null,disabled:x,download:C,draggable:S,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:x,formTarget:null,headers:T,height:w,hidden:C,high:w,href:null,hrefLang:null,htmlFor:T,httpEquiv:T,id:null,imageSizes:null,imageSrcSet:null,inert:x,inputMode:null,integrity:null,is:null,isMap:x,itemId:null,itemProp:T,itemRef:T,itemScope:x,itemType:T,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:x,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:x,muted:x,name:null,nonce:null,noModule:x,noValidate:x,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:x,optimum:w,pattern:null,ping:T,placeholder:null,playsInline:x,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:x,referrerPolicy:null,rel:T,required:x,reversed:x,rows:w,rowSpan:w,sandbox:T,scope:null,scoped:x,seamless:x,selected:x,shadowRootClonable:x,shadowRootCustomElementRegistry:x,shadowRootDelegatesFocus:x,shadowRootMode:null,shadowRootSerializable:x,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:S,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:x,useMap:null,value:S,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:T,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:x,declare:x,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:x,noHref:x,noShade:x,noWrap:x,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:S,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:x,disablePictureInPicture:x,disableRemotePlayback:x,exportParts:E,part:T,prefix:null,property:null,results:w,security:null,unselectable:null},space:`html`,transform:ne}),re=j({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:D,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:T,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:x,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:E,g2:E,glyphName:E,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:D,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:T,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D,rev:D,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D,requiredFeatures:D,requiredFonts:D,requiredFormats:D,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:D,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:te}),ie=j({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ae=j({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ne}),oe=j({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),se={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ce=/[A-Z]/g,le=/-[a-z]/g,ue=/^data[-\w.:]+$/i;function de(e,t){let n=_(t),r=t,i=v;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ue.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(le,pe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!le.test(e)){let n=e.replace(ce,fe);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=A}return new i(r,t)}function fe(e){return`-`+e.toLowerCase()}function pe(e){return e.charAt(1).toUpperCase()}var me=g([M,N,ie,ae,oe],`html`),he=g([M,re,ie,ae,oe],`svg`);function ge(e){return e.join(` `).trim()}var _e=i(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
1
|
+
import{G as e,Q as t,St as n,_t as r,bt as i,vt as a,xt as o}from"./index-C5-iSe99.js";function s(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var c=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,u={};function d(e,t){return((t||u).jsx?l:c).test(e)}var f=/[ \t\n\f\r]/g;function p(e){return typeof e==`object`?e.type===`text`&&m(e.value):m(e)}function m(e){return e.replace(f,``)===``}var h=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};h.prototype.normal={},h.prototype.property={},h.prototype.space=void 0;function g(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new h(n,r,t)}function _(e){return e.toLowerCase()}var v=class{constructor(e,t){this.attribute=t,this.property=e}};v.prototype.attribute=``,v.prototype.booleanish=!1,v.prototype.boolean=!1,v.prototype.commaOrSpaceSeparated=!1,v.prototype.commaSeparated=!1,v.prototype.defined=!1,v.prototype.mustUseProperty=!1,v.prototype.number=!1,v.prototype.overloadedBoolean=!1,v.prototype.property=``,v.prototype.spaceSeparated=!1,v.prototype.space=void 0;var y=o({boolean:()=>x,booleanish:()=>S,commaOrSpaceSeparated:()=>D,commaSeparated:()=>E,number:()=>w,overloadedBoolean:()=>C,spaceSeparated:()=>T}),b=0,x=O(),S=O(),C=O(),w=O(),T=O(),E=O(),D=O();function O(){return 2**++b}var k=Object.keys(y),A=class extends v{constructor(e,t,n,r){let i=-1;if(super(e,t),ee(this,`space`,r),typeof n==`number`)for(;++i<k.length;){let e=k[i];ee(this,k[i],(n&y[e])===y[e])}}};A.prototype.defined=!0;function ee(e,t,n){n&&(e[t]=n)}function j(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new A(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_(r)]=r,n[_(a.attribute)]=r}return new h(t,n,e.space)}var M=j({properties:{ariaActiveDescendant:null,ariaAtomic:S,ariaAutoComplete:null,ariaBusy:S,ariaChecked:S,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:T,ariaCurrent:null,ariaDescribedBy:T,ariaDetails:null,ariaDisabled:S,ariaDropEffect:T,ariaErrorMessage:null,ariaExpanded:S,ariaFlowTo:T,ariaGrabbed:S,ariaHasPopup:null,ariaHidden:S,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:T,ariaLevel:w,ariaLive:null,ariaModal:S,ariaMultiLine:S,ariaMultiSelectable:S,ariaOrientation:null,ariaOwns:T,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:S,ariaReadOnly:S,ariaRelevant:null,ariaRequired:S,ariaRoleDescription:T,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:S,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function te(e,t){return t in e?e[t]:t}function ne(e,t){return te(e,t.toLowerCase())}var N=j({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:E,acceptCharset:T,accessKey:T,action:null,allow:null,allowFullScreen:x,allowPaymentRequest:x,allowUserMedia:x,alpha:x,alt:null,as:null,async:x,autoCapitalize:null,autoComplete:T,autoFocus:x,autoPlay:x,blocking:T,capture:null,charSet:null,checked:x,cite:null,className:T,closedBy:null,colorSpace:null,cols:w,colSpan:w,command:null,commandFor:null,content:null,contentEditable:S,controls:x,controlsList:T,coords:w|E,crossOrigin:null,data:null,dateTime:null,decoding:null,default:x,defer:x,dir:null,dirName:null,disabled:x,download:C,draggable:S,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:x,formTarget:null,headers:T,height:w,hidden:C,high:w,href:null,hrefLang:null,htmlFor:T,httpEquiv:T,id:null,imageSizes:null,imageSrcSet:null,inert:x,inputMode:null,integrity:null,is:null,isMap:x,itemId:null,itemProp:T,itemRef:T,itemScope:x,itemType:T,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:x,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:x,muted:x,name:null,nonce:null,noModule:x,noValidate:x,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:x,optimum:w,pattern:null,ping:T,placeholder:null,playsInline:x,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:x,referrerPolicy:null,rel:T,required:x,reversed:x,rows:w,rowSpan:w,sandbox:T,scope:null,scoped:x,seamless:x,selected:x,shadowRootClonable:x,shadowRootCustomElementRegistry:x,shadowRootDelegatesFocus:x,shadowRootMode:null,shadowRootSerializable:x,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:S,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:x,useMap:null,value:S,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:T,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:x,declare:x,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:x,noHref:x,noShade:x,noWrap:x,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:S,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:x,disablePictureInPicture:x,disableRemotePlayback:x,exportParts:E,part:T,prefix:null,property:null,results:w,security:null,unselectable:null},space:`html`,transform:ne}),re=j({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:D,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:T,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:x,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:E,g2:E,glyphName:E,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:D,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:T,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D,rev:D,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D,requiredFeatures:D,requiredFonts:D,requiredFormats:D,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:D,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:te}),ie=j({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ae=j({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ne}),oe=j({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),se={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ce=/[A-Z]/g,le=/-[a-z]/g,ue=/^data[-\w.:]+$/i;function de(e,t){let n=_(t),r=t,i=v;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ue.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(le,pe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!le.test(e)){let n=e.replace(ce,fe);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=A}return new i(r,t)}function fe(e){return`-`+e.toLowerCase()}function pe(e){return e.charAt(1).toUpperCase()}var me=g([M,N,ie,ae,oe],`html`),he=g([M,re,ie,ae,oe],`svg`);function ge(e){return e.join(` `).trim()}var _e=i(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
2
2
|
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),ve=i(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(_e());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),ye=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),be=i(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ve()),i=ye();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),xe=Ce(`end`),Se=Ce(`start`);function Ce(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function we(e){let t=Se(e),n=xe(e);if(t&&n)return{start:t,end:n}}function Te(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?De(e.position):`start`in e||`end`in e?De(e):`line`in e||`column`in e?Ee(e):``}function Ee(e){return Oe(e&&e.line)+`:`+Oe(e&&e.column)}function De(e){return Ee(e&&e.start)+`-`+Ee(e&&e.end)}function Oe(e){return e&&typeof e==`number`?e:1}var P=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Te(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};P.prototype.file=``,P.prototype.name=``,P.prototype.reason=``,P.prototype.message=``,P.prototype.stack=``,P.prototype.column=void 0,P.prototype.line=void 0,P.prototype.ancestors=void 0,P.prototype.cause=void 0,P.prototype.fatal=void 0,P.prototype.place=void 0,P.prototype.ruleId=void 0,P.prototype.source=void 0;var ke=n(be(),1),Ae={}.hasOwnProperty,je=new Map,Me=/[A-Z]/g,Ne=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Pe=new Set([`td`,`th`]),Fe=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ie(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=qe(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Ke(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?he:me,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Le(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Le(e,t,n){if(t.type===`element`)return Re(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return ze(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ve(e,t,n);if(t.type===`mdxjsEsm`)return Be(e,t);if(t.type===`root`)return He(e,t,n);if(t.type===`text`)return Ue(e,t)}function Re(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=he,e.schema=i),e.ancestors.push(t);let a=$e(e,t.tagName,!1),o=Je(e,t),s=Xe(e,t);return Ne.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!p(e)})),We(e,o,a,t),Ge(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ze(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}et(e,t.position)}function Be(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);et(e,t.position)}function Ve(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=he,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:$e(e,t.name,!0),o=Ye(e,t),s=Xe(e,t);return We(e,o,a,t),Ge(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function He(e,t,n){let r={};return Ge(r,Xe(e,t)),e.create(t,e.Fragment,r,n)}function Ue(e,t){return t.value}function We(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ge(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ke(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function qe(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Se(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Je(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ae.call(t.properties,i)){let a=Ze(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Pe.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Ye(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else et(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else et(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Xe(e,t){let n=[],r=-1,i=e.passKeys?new Map:je;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Le(e,a,o);s!==void 0&&n.push(s)}return n}function Ze(e,t,n){let r=de(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?s(n):ge(n)),r.property===`style`){let t=typeof n==`object`?n:Qe(e,String(n));return e.stylePropertyNameCase===`css`&&(t=tt(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?se[r.property]||r.property:r.attribute,n]}}function Qe(e,t){try{return(0,ke.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new P("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Fe+`#cannot-parse-style-attribute`,r}}function $e(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=d(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=d(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ae.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);et(e)}function et(e,t){let n=new P("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Fe+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function tt(e){let t={},n;for(n in e)Ae.call(e,n)&&(t[nt(n)]=e[n]);return t}function nt(e){let t=e.replace(Me,rt);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function rt(e){return`-`+e.toLowerCase()}var it={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},at={};function ot(e,t){let n=t||at;return st(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function st(e,t,n){if(lt(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return ct(e.children,t,n)}return Array.isArray(e)?ct(e,t,n):``}function ct(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=st(e[i],t,n);return r.join(``)}function lt(e){return!!(e&&typeof e==`object`)}var ut=document.createElement(`i`);function dt(e){let t=`&`+e+`;`;ut.innerHTML=t;let n=ut.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function F(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function I(e,t){return e.length>0?(F(e,e.length,0,t),e):t}var ft={}.hasOwnProperty;function pt(e){let t={},n=-1;for(;++n<e.length;)mt(t,e[n]);return t}function mt(e,t){let n;for(n in t){let r=(ft.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ft.call(r,a)||(r[a]=[]);let e=i[a];ht(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ht(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);F(e,0,0,r)}function gt(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function L(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var R=W(/[A-Za-z]/),z=W(/[\dA-Za-z]/),_t=W(/[#-'*+\--9=?A-Z^-~]/);function vt(e){return e!==null&&(e<32||e===127)}var yt=W(/\d/),bt=W(/[\dA-Fa-f]/),xt=W(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function V(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}var St=W(/\p{P}|\p{S}/u),U=W(/\s/);function W(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ct(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&z(e.charCodeAt(n+1))&&z(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function G(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return H(r)?(e.enter(n),s(r)):t(r)}function s(r){return H(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function wt(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&H(t)?(e.enter(r),c(t)):l(t)}function c(t){return H(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Tt={tokenize:Et};function Et(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),G(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return B(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Dt=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Ot(this,e,t,n,!1)}addBefore(e,t,n){Ot(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Ot(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var kt={tokenize:jt},At={tokenize:Mt};function jt(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Dt;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(At,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(At,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return B(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Dt;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mt(e,t,n){return G(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Nt(e){if(e===null||V(e)||U(e))return 1;if(St(e))return 2}function Pt(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Ft={name:`attention`,resolveAll:It,tokenize:Lt};function It(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Rt(o,-a),Rt(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=I(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=I(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=I(r,Pt(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=I(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=I(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),F(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Lt(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Nt(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Nt(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Rt(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var zt={name:`autolink`,tokenize:Bt};function Bt(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return R(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||z(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||z(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||vt(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):_t(t)?(e.consume(t),l):n(t)}function u(e){return z(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||z(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Vt={partial:!0,tokenize:Ht};function Ht(e,t,n){return r;function r(t){return H(t)?G(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||B(e)?t(e):n(e)}}var Ut={continuation:{tokenize:Gt},exit:Kt,name:`blockQuote`,tokenize:Wt};function Wt(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return H(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Gt(e,t,n){let r=this;return i;function i(t){return H(t)?G(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ut,t,n)(r)}}function Kt(e){e.exit(`blockQuote`)}var qt={name:`characterEscape`,tokenize:Jt};function Jt(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return xt(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Yt={name:`characterReference`,tokenize:Xt};function Xt(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=z,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=bt,u):(e.enter(`characterReferenceValue`),a=7,o=yt,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===z&&!dt(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Zt={partial:!0,tokenize:Qt};function Qt(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var $t={concrete:!0,name:`codeFenced`,tokenize:en};function en(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),H(t)?G(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||B(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Zt,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),G(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||B(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&H(t)?G(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||B(t)?e.check(Zt,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||B(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),H(t)?G(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),H(t)?G(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||B(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var tn={name:`codeIndented`,tokenize:rn},nn={partial:!0,tokenize:an};function rn(e,t,n){return r;function r(t){return e.enter(`codeIndented`),wt(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):B(t)?e.attempt(nn,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||B(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function an(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):B(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):wt(e,t,a,`linePrefix`,4,4)(o)}function a(e){return B(e)?i(e):n(e)}}var on={name:`codeText`,previous:cn,resolve:sn,tokenize:ln};function sn(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function cn(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ln(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||B(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var un=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&dn(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),dn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),dn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);dn(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);dn(this.left,t.reverse())}}}};function dn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function fn(e){let t={},n=-1,r,i,a,o,s,c,l,u=new un(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,pn(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return F(e,0,1/0,u.slice(0)),!l}function pn(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var mn={resolve:gn,tokenize:_n},hn={partial:!0,tokenize:vn};function gn(e){return fn(e),e}function _n(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):B(t)?e.check(hn,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function vn(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),G(e,a,`linePrefix`)}function a(i){if(i===null||B(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function yn(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||vt(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||B(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||V(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||vt(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function bn(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):B(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||B(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!H(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function xn(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),G(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||B(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Sn(e,t){let n;return r;function r(i){return B(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):H(i)?G(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Cn={name:`definition`,tokenize:Tn},wn={partial:!0,tokenize:En};function Tn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return bn.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=L(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return V(t)?Sn(e,l)(t):l(t)}function l(t){return yn(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(wn,d,d)(t)}function d(t){return H(t)?G(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||B(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function En(e,t,n){return r;function r(t){return V(t)?Sn(e,i)(t):n(t)}function i(t){return xn(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return H(t)?G(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||B(e)?t(e):n(e)}}var Dn={name:`hardBreakEscape`,tokenize:On};function On(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return B(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var kn={name:`headingAtx`,resolve:An,tokenize:jn};function An(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};F(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function jn(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||V(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||B(n)?(e.exit(`atxHeading`),t(n)):H(n)?G(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||V(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Mn=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Nn=[`pre`,`script`,`style`,`textarea`],Pn={concrete:!0,name:`htmlFlow`,resolveTo:In,tokenize:Ln},Fn={partial:!0,tokenize:Rn};function In(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ln(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:N):R(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):R(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return R(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||V(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Nn.includes(l)?(i=1,r.interrupt?t(s):O(s)):Mn.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||z(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return H(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||R(t)?(e.consume(t),b):H(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||z(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):H(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):H(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||B(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||V(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||H(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||B(t)?O(t):H(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),ne):B(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Fn,ie,k)(t)):t===null||B(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Zt,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||B(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),N):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return Nn.includes(n)?(e.consume(t),re):O(t)}return R(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function ne(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||B(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Rn(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Vt,t,n)}}var zn={name:`htmlText`,tokenize:Bn};function Bn(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):R(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):R(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):B(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):B(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):B(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):B(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return R(t)?(e.consume(t),S):n(t)}function S(t){return t===45||z(t)?(e.consume(t),S):C(t)}function C(t){return B(t)?(o=C,M(t)):H(t)?(e.consume(t),C):j(t)}function w(t){return t===45||z(t)?(e.consume(t),w):t===47||t===62||V(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||R(t)?(e.consume(t),E):B(t)?(o=T,M(t)):H(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||z(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):B(t)?(o=D,M(t)):H(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):B(t)?(o=O,M(t)):H(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):B(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||V(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||V(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return H(t)?G(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var Vn={name:`labelEnd`,resolveAll:Gn,resolveTo:Kn,tokenize:qn},Hn={tokenize:Jn},Un={tokenize:Yn},Wn={tokenize:Xn};function Gn(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&F(e,0,e.length,n),e}function Kn(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=I(o,e.slice(i+1,i+r+3)),o=I(o,[[`enter`,l,t]]),o=I(o,Pt(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=I(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=I(o,e.slice(a+1)),o=I(o,[[`exit`,s,t]]),F(e,i,e.length,o),e}function qn(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(L(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Hn,u,o?u:d)(t):t===91?e.attempt(Un,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Wn,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Jn(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return V(t)?Sn(e,a)(t):a(t)}function a(t){return t===41?u(t):yn(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return V(t)?Sn(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?xn(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return V(t)?Sn(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Yn(e,t,n){let r=this;return i;function i(t){return bn.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(L(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Xn(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Zn={name:`labelStartImage`,resolveAll:Vn.resolveAll,tokenize:Qn};function Qn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var $n={name:`labelStartLink`,resolveAll:Vn.resolveAll,tokenize:er};function er(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var tr={name:`lineEnding`,tokenize:nr};function nr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),G(e,t,`linePrefix`)}}var rr={name:`thematicBreak`,tokenize:ir};function ir(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||B(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),H(t)?G(e,s,`whitespace`)(t):s(t))}}var K={continuation:{tokenize:cr},exit:ur,name:`list`,tokenize:sr},ar={partial:!0,tokenize:dr},or={partial:!0,tokenize:lr};function sr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:yt(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(rr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return yt(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Vt,r.interrupt?n:u,e.attempt(ar,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return H(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function cr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Vt,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,G(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!H(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(or,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,G(e,e.attempt(K,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function lr(e,t,n){let r=this;return G(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ur(e){e.exit(this.containerState.type)}function dr(e,t,n){let r=this;return G(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!H(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var fr={name:`setextUnderline`,resolveTo:pr,tokenize:mr};function pr(e,t){let n=new Dt,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function mr(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),H(t)?G(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||B(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var hr={tokenize:gr};function gr(e){let t=this,n=e.attempt(Vt,r,e.attempt(this.parser.constructs.flowInitial,i,G(e,e.attempt(this.parser.constructs.flow,i,e.attempt(mn,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var _r={resolveAll:xr()},vr=br(`string`),yr=br(`text`);function br(e){return{resolveAll:xr(e===`text`?Sr:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function xr(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Sr(e,t){let n=new Dt,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Cr=o({attentionMarkers:()=>jr,contentInitial:()=>Tr,disable:()=>Mr,document:()=>wr,flow:()=>Dr,flowInitial:()=>Er,insideSpan:()=>Ar,string:()=>Or,text:()=>kr}),wr={42:K,43:K,45:K,48:K,49:K,50:K,51:K,52:K,53:K,54:K,55:K,56:K,57:K,62:Ut},Tr={91:Cn},Er={[-2]:tn,[-1]:tn,32:tn},Dr={35:kn,42:rr,45:[fr,rr],60:Pn,61:fr,95:rr,96:$t,126:$t},Or={38:Yt,92:qt},kr={[-5]:tr,[-4]:tr,[-3]:tr,33:Zn,38:Yt,42:Ft,60:[zt,zn],91:$n,92:[Dn,qt],93:Vn,95:Ft,96:on},Ar={null:[Ft,_r]},jr={null:[42,95]},Mr={null:[]};function Nr(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=I(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Pt(a,l.events,l),l.events):[]}function f(e,t){return Fr(p(e),t)}function p(e){return Pr(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){B(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&F(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Pr(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Fr(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
3
3
|
`;break;case-3:o=`\r
|
|
4
4
|
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Ir(e){let t={constructs:pt([Cr,...(e||{}).extensions||[]]),content:n(Tt),defined:[],document:n(kt),flow:n(hr),lazy:{},string:n(vr),text:n(yr)};return t;function n(e){return n;function n(n){return Nr(t,e,n)}}}function Lr(e){for(;!fn(e););return e}var Rr=/[\0\t\n\r]/g;function zr(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){Rr.lastIndex=c;let n=Rr.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Br=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Vr(e){return e.replace(Br,Hr)}function Hr(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return gt(n.slice(t?2:1),t?16:10)}return dt(n)||e}var Ur={}.hasOwnProperty;function Wr(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Gr(n)(Lr(Ir(n).document().write(zr()(e,t,!0))))}function Gr(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(Se),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(ve),blockQuote:o(pe),characterEscape:E,characterReference:E,codeFenced:o(me),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(me,s),codeText:o(he,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(ge),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(_e),hardBreakEscape:o(ye),hardBreakTrailing:o(ye),htmlFlow:o(be,s),htmlFlowData:E,htmlText:o(be,s),htmlTextData:E,image:o(xe),label:s,link:o(Se),listItem:o(we),listItemValue:p,listOrdered:o(Ce,f),listUnordered:o(Ce),paragraph:o(Ee),reference:oe,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ve),strong:o(De),thematicBreak:o(P)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(j),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(ee),htmlTextData:D,image:l(te),label:N,labelText:ne,lineEnding:O,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:se,resourceDestinationString:re,resourceTitleString:ie,resource:ae,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};Kr(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),Ur.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||Jr).call(o,void 0,e[0])}for(r.position={start:q(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:q(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:q(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Te({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Jr).call(this,e,r[0])),n.position.end=q(e.end)}function d(){return ot(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=L(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Oe(),n.position={start:q(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=q(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=q(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Vr(t),n.identifier=L(t).toLowerCase()}function N(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=L(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=gt(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=dt(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=q(e.end)}function de(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[],position:void 0}}function me(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function he(){return{type:`inlineCode`,value:``,position:void 0}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function _e(){return{type:`emphasis`,children:[],position:void 0}}function ve(){return{type:`heading`,depth:0,children:[],position:void 0}}function ye(){return{type:`break`,position:void 0}}function be(){return{type:`html`,value:``,position:void 0}}function xe(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function Se(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Ee(){return{type:`paragraph`,children:[],position:void 0}}function De(){return{type:`strong`,children:[],position:void 0}}function Oe(){return{type:`text`,value:``,position:void 0}}function P(){return{type:`thematicBreak`,position:void 0}}}function q(e){return{line:e.line,column:e.column,offset:e.offset}}function Kr(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Kr(e,r):qr(e,r)}}function qr(e,t){let n;for(n in t)if(Ur.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Jr(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Te({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Te({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Te({start:t.start,end:t.end})+`) is still open`)}function Yr(e){let t=this;t.parser=n;function n(n){return Wr(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Xr(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Zr(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,N as t,_t as n}from"./index-
|
|
1
|
+
import{G as e,N as t,_t as n}from"./index-C5-iSe99.js";var r=n(),i=e();function a({value:e,onChange:n,onSubmit:r,label:a,placeholder:s=`输入消息…`,disabled:c=!1,sendDisabled:l=!1,sendLabel:u=`发送`,actions:d,heading:f,inset:p=!1,plain:m=!1}){let h=o(e),g=!c&&!l&&!!e.trim();return(0,i.jsxs)(`form`,{className:`message-composer${p?` message-composer-inset`:``}${m?` message-composer-plain`:``}`,onSubmit:e=>{e.preventDefault(),g&&r(e)},children:[f&&(0,i.jsx)(`div`,{className:`message-composer-heading`,children:f}),(0,i.jsx)(`textarea`,{ref:h,value:e,onChange:e=>n(e.target.value),"aria-label":a,placeholder:s,disabled:c,rows:1,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),g&&e.currentTarget.form?.requestSubmit())}}),(0,i.jsxs)(`div`,{className:`message-composer-footer`,children:[d&&(0,i.jsx)(`div`,{className:`message-composer-actions`,children:d}),(0,i.jsx)(`button`,{type:`submit`,className:`primary message-send`,"aria-label":u,title:u,disabled:!g,children:(0,i.jsx)(t,{name:`send`,size:`small`})})]})]})}function o(e,t){let n=(0,r.useRef)(null);return(0,r.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{o as n,a as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,B as t,G as n,H as r,I as i,J as a,K as o,L as s,M as c,N as l,P as u,Q as d,R as f,U as p,V as m,Y as h,Z as g,_t as _,at as v,ct as y,d as b,dt as x,f as S,ft as C,gt as w,h as T,ht as E,it as D,j as ee,lt as O,mt as k,nt as A,ot as j,rt as M,st as N,tt as P,ut as F,vt as I,y as L,yt as te}from"./index-
|
|
1
|
+
import{$ as e,B as t,G as n,H as r,I as i,J as a,K as o,L as s,M as c,N as l,P as u,Q as d,R as f,U as p,V as m,Y as h,Z as g,_t as _,at as v,ct as y,d as b,dt as x,f as S,ft as C,gt as w,h as T,ht as E,it as D,j as ee,lt as O,mt as k,nt as A,ot as j,rt as M,st as N,tt as P,ut as F,vt as I,y as L,yt as te}from"./index-C5-iSe99.js";import{n as R,r as z,t as B}from"./Markdown-Bb9dy2Sh.js";import{t as V}from"./Conversation-1APTn0kq.js";import{i as ne,r as H}from"./WorkspaceTree-D0UUUBtF.js";import{n as U}from"./project-links-Dy6-B89_.js";import{t as W}from"./HtmlPreview-BcspnVI6.js";function G(e){return w(D,e)}var K=_(),q=x().regex(/^R\d{6,}$/),J=F({name:x().min(1),sha256:P,size:O().int().nonnegative()}),Y=k().refine(e=>/^https?:\/\//i.test(e),`Use an HTTP or HTTPS URL.`);F({operationId:E(),title:x().trim().default(``),text:x().optional(),url:Y.optional(),originals:j(J).default([])}).strict().refine(e=>!!e.text?.trim()||!!e.url||e.originals.length>0,`Provide text, a link or a file.`),F({expectedRevision:A,title:x().trim().min(1).optional(),url:Y.nullable().optional(),content:x().optional(),summary:x().optional(),sourceVersion:x().optional(),contentDate:x().optional(),originals:j(J).optional()}).strict();var X=F({id:q,projectId:x(),title:x(),submittedBy:x(),createdAt:x(),revision:A,source:F({kind:v([`web`,`chat`,`group`]),url:x().nullable(),groupId:x().optional(),messageId:x().optional(),sourceVersion:x().optional(),contentDate:x().optional()}),originals:j(J),content:x().nullable(),summary:x().nullable(),state:v([`waiting`,`running`,`ready`,`failed`]),error:x().nullable(),url:x()}),re=F({materials:j(X),nextCursor:O().nullable()});F({query:x().trim().min(1),scope:v([`all`,`workspace`,`materials`]).default(`all`),materialId:q.optional(),originalHash:P.optional(),after:x().default(``),limit:G().int().min(1).max(200).default(30)}).strict();var ie=F({items:j(F({key:x(),kind:v([`workspace`,`materials`]),title:x(),snippet:x(),url:x(),path:x()})),nextCursor:x().nullable()}),Z=n();function ae(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 oe(){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 se({active:e,onActivate:t,children:n}){let{request:i,projectId:o}=L(),[c,d]=(0,K.useState)(oe),[f,m]=(0,K.useState)(c),[h,g]=(0,K.useState)(()=>new Set(c?[c.id]:[])),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(``),[x,S]=(0,K.useState)(``),[C,w]=(0,K.useState)(``),[E,D]=(0,K.useState)([]),[O,k]=(0,K.useState)(),[A,j]=(0,K.useState)(!1),[M,N]=(0,K.useState)(``),P=(0,K.useRef)(null),F=(0,K.useCallback)(e=>i(`materials`,re,{signal:e}),[i]),R=r(F,5e3,p(o,`materials`)),z=(0,K.useCallback)(e=>c?i(`materials/${encodeURIComponent(c.id)}${c.revision?`?revision=${encodeURIComponent(c.revision)}`:``}`,X,{signal:e}):Promise.resolve(null),[i,c?.id,c?.revision]),V=r(z,5e3),H=V.data?.id===c?.id?V.data:null,U=[...new Map([...E,...R.data?.materials??[],...H?[H]:[]].map(e=>[e.id,e])).values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id)),W=O===void 0?R.data?.nextCursor:O;function G(e,n=``){t(),d(e),m(e),S(``),w(n),v(!1),g(t=>new Set([...t,e.id])),history.replaceState(null,``,I(`/projects/${o}/materials?${new URLSearchParams({...e})}`))}(0,K.useEffect)(()=>{let e=()=>{if(!te().endsWith(`/materials`))return;let e=oe();d(e),m(e),S(``),b(``),w(``),v(!1),e&&g(t=>new Set([...t,e.id]))};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);async function q(){if(W&&!A){j(!0),N(``);try{let e=await i(`materials?before=${W}`,re);D(t=>[...t,...e.materials]),k(e.nextCursor)}catch(e){N(a(e))}finally{j(!1)}}}let J=U.find(e=>e.id===f?.id),Y=J?.originals.find(e=>e.sha256===f?.original)?.name??J?.title??`当前资料`;function ie(){m(void 0),w(``),P.current?.focus()}let se=(0,Z.jsx)(u,{icon:`plus`,label:`新增资料`,onClick:()=>{t(),v(!0),N(``)}});return n({tree:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(s,{error:!0,children:R.error||M}),R.data?U.length===0?(0,Z.jsx)(`p`,{className:`tree-status`,children:`暂无资料`}):(0,Z.jsx)(Z.Fragment,{children:U.map(t=>(0,Z.jsxs)(`div`,{role:`none`,children:[(0,Z.jsxs)(T,{role:`treeitem`,"aria-level":1,"aria-expanded":h.has(t.id),"aria-selected":e&&!_&&c?.id===t.id&&!c.original,className:`tree-item tree-folder`,style:{"--tree-level":1},"data-testid":`material-folder`,title:t.title,onClick:()=>{let e=h.has(t.id);G({id:t.id}),e&&g(e=>{let n=new Set(e);return n.delete(t.id),n})},leading:(0,Z.jsx)(`span`,{className:`tree-chevron ${h.has(t.id)?`expanded`:``}`,children:(0,Z.jsx)(l,{name:`chevron`,size:`small`})}),children:[(0,Z.jsx)(l,{name:`files`}),(0,Z.jsx)(`span`,{className:`tree-name`,children:t.title})]}),h.has(t.id)&&(0,Z.jsx)(`div`,{role:`group`,children:[...t.originals].sort((e,t)=>ne(e.name,t.name)).map((n,r)=>(0,Z.jsxs)(T,{role:`treeitem`,"aria-level":2,"aria-selected":e&&!_&&c?.id===t.id&&c.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===c?.id&&c.revision?{revision:c.revision}:{}}),leading:(0,Z.jsx)(`span`,{className:`tree-chevron`}),children:[(0,Z.jsx)(l,{name:`file`}),(0,Z.jsx)(`span`,{className:`tree-name`,children:n.name})]},`${n.sha256}:${r}`))})]},t.id))}):(0,Z.jsx)(`p`,{className:`tree-status`,children:`加载中…`}),W&&(0,Z.jsx)(`button`,{className:`tree-action`,disabled:A,onClick:()=>void q(),children:A?`加载中…`:`加载更多`})]}),reader:(0,Z.jsxs)(`section`,{className:`session-reader`,"aria-label":`资料内容与搜索`,children:[(0,Z.jsx)(`div`,{className:`session-reader-content`,children:_?(0,Z.jsx)(fe,{onCancel:()=>v(!1),onSaved:e=>{G({id:e}),R.reload()}}):x?(0,Z.jsx)(ce,{query:x,scope:f,onSelect:e=>G(e,x)},`${x}/${f?.id}/${f?.original}`):c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(s,{error:!0,children:V.error}),H?c.original?(0,Z.jsx)(le,{material:H,hash:c.original,highlight:C},`${H.id}:${c.original}`):(0,Z.jsxs)(`article`,{className:`material-body`,children:[(0,Z.jsx)(`h1`,{children:H.title}),c.revision&&(0,Z.jsx)(`button`,{className:`material-link`,onClick:()=>G({id:c.id}),children:`查看最新内容`}),!c.revision&&(H.state===`waiting`||H.state===`running`)?(0,Z.jsx)(`p`,{className:`muted`,role:`status`,children:`正在整理…`}):null,(0,Z.jsx)(s,{error:!0,children:H.error??``}),!c.revision&&H.state===`failed`&&(0,Z.jsx)(`button`,{onClick:()=>void i(`materials/${c.id}/retry`,X,{method:`POST`}).then(()=>V.reload()).catch(e=>N(a(e))),children:`重试整理`}),H.content?(0,Z.jsx)(`div`,{className:`markdown`,children:(0,Z.jsx)(B,{highlight:C,children:ae(H)})}):(0,Z.jsx)(`p`,{className:`muted`,children:`正文尚未整理,可以先查看左侧原件。`})]}):(0,Z.jsx)(`p`,{role:`status`,children:`加载中…`})]}):(0,Z.jsx)(ee,{mascot:!0,title:`选择资料开始阅读`,description:`也可以在下方搜索资料内容。`})}),!_&&(0,Z.jsxs)(`form`,{className:`session-search-dock`,"data-testid":`material-search-form`,onSubmit:e=>{e.preventDefault(),S(y.trim()),w(``)},children:[f&&(0,Z.jsxs)(`button`,{type:`button`,className:`search-scope-chip`,title:`清除搜索范围`,"aria-label":`清除范围:${Y}`,onClick:ie,children:[(0,Z.jsxs)(`span`,{className:`scope-label`,children:[`搜索:`,Y]}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`×`})]}),(0,Z.jsxs)(`div`,{className:`session-search-input-row`,children:[(0,Z.jsx)(`input`,{ref:P,"aria-label":`搜索资料`,placeholder:`搜索资料内容`,value:y,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Backspace`&&!y&&f&&(e.preventDefault(),ie())}}),(x||y||C)&&(0,Z.jsx)(u,{icon:`close`,label:`清空搜索`,onClick:()=>{b(``),S(``),w(``),P.current?.focus()}}),(0,Z.jsx)(u,{icon:`search`,type:`submit`,label:`搜索`,disabled:!y.trim()})]})]})]}),actions:se,href:`/projects/${o}/materials${c&&!_?`?${new URLSearchParams({...c})}`:``}`})}function ce({query:e,scope:t,onSelect:n}){let{request:i}=L(),[a,o]=(0,K.useState)(``),c=(0,K.useCallback)(n=>i(`resources/search?${new URLSearchParams({query:e,scope:`materials`,after:a,...t?{materialId:t.id}:{},...t?.original?{originalHash:t.original}:{}})}`,ie,{signal:n}),[i,e,t?.id,t?.original,a]),l=r(c);return(0,Z.jsxs)(`section`,{className:`session-results stack`,"aria-label":`搜索结果`,children:[(0,Z.jsx)(s,{error:!0,children:l.error}),l.loading?(0,Z.jsx)(`p`,{role:`status`,children:`正在搜索…`}):l.data?.items.length===0?(0,Z.jsx)(`p`,{className:`empty`,children:`没有找到匹配的资料`}):l.data?.items.map(t=>(0,Z.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,Z.jsx)(`strong`,{children:t.title.replace(/^R\d+ · /,``)}),(0,Z.jsx)(`span`,{className:`session-excerpt`,children:(0,Z.jsx)(R,{value:z(t.snippet,e),query:e})})]},t.key)),l.data?.nextCursor&&(0,Z.jsx)(`button`,{disabled:l.loading,onClick:()=>o(l.data.nextCursor),children:`下一页`})]})}function le({material:e,hash:t,highlight:n}){let{projectId:i}=L(),a=e.originals.find(e=>e.sha256===t),o=I(`/api/v1/projects/${i}/materials/${e.id}/originals/${t}?revision=${e.revision}`),[c,d]=(0,K.useState)(!1),f=(0,K.useCallback)(async e=>{let t=await fetch(o,{signal:e});if(!t.ok)throw Error(`原件暂时无法读取。`);let n=await t.arrayBuffer();try{let e=new TextDecoder(`utf8`,{fatal:!0}).decode(n);return e.includes(`\0`)?null:e}catch{return null}},[o]),m=r(f,!1,p(i,`material-original`,t));if(!a)return(0,Z.jsx)(s,{error:!0,children:`找不到此原件。`});let h=/\.(md|markdown)$/i.test(a.name),g=/\.html?$/i.test(a.name);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`header`,{className:`file-detail-header`,children:[(0,Z.jsx)(`span`,{className:`file-detail-path`,children:a.name}),(0,Z.jsxs)(`div`,{className:`toolbar-actions`,children:[(h||g)&&(0,Z.jsx)(u,{icon:c?`preview`:`code`,label:c?`切换为预览`:`切换为原文`,"aria-pressed":c,onClick:()=>d(!c)}),(0,Z.jsx)(`a`,{className:`icon-button`,"aria-label":`下载原件`,title:`下载原件`,href:o,download:a.name,children:(0,Z.jsx)(l,{name:`download`})})]})]}),(0,Z.jsx)(s,{error:!0,children:m.error}),m.loading?(0,Z.jsx)(`p`,{role:`status`,children:`加载中…`}):m.data===null?(0,Z.jsx)(`p`,{className:`muted`,children:`此格式请下载后查看。`}):m.data!==void 0&&(0,Z.jsx)(`div`,{className:`preview-body${g&&!c?` preview-body-html`:``}`,"data-testid":`material-original-content`,children:g&&!c?(0,Z.jsx)(W,{url:o,name:a.name}):h&&!c?(0,Z.jsx)(`article`,{className:`markdown`,children:(0,Z.jsx)(B,{highlight:n,children:m.data})}):(0,Z.jsx)(`pre`,{className:`raw`,children:(0,Z.jsx)(R,{value:m.data,query:n})})})]})}function ue(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 Q(e){try{return new URL(e.trim()).hostname}catch{return e.trim().split(`
|
|
4
4
|
`)[0]?.slice(0,80)||`文本`}}function de(e){try{return new URL(e.trim()).href}catch{return e.trim().split(`
|