@markus-global/cli 0.12.0-rc.2 → 0.12.0
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/commands/start.js +1 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/markus.mjs +3340 -3463
- package/dist/web-ui/assets/{AsyncState-D1MjBziR.js → AsyncState-Czik5FUM.js} +1 -1
- package/dist/web-ui/assets/{CommentInput-DoDCJB56.js → CommentInput-BsaOrj2g.js} +1 -1
- package/dist/web-ui/assets/{ContentRenderer-BQ77yvOJ.js → ContentRenderer-Cl9-dJ-4.js} +2 -2
- package/dist/web-ui/assets/{DeliverableShareModal-DvNGiVma.js → DeliverableShareModal-wgdeaboz.js} +1 -1
- package/dist/web-ui/assets/{Deliverables-z8y1RoIc.js → Deliverables-Czrn3ezy.js} +2 -2
- package/dist/web-ui/assets/{Notifications-D1IJbilh.js → Notifications-BoxombIH.js} +1 -1
- package/dist/web-ui/assets/{Search-n_NvkmUl.js → Search-D9FOOaVc.js} +1 -1
- package/dist/web-ui/assets/{SendToChat-C8yyyTBL.js → SendToChat-D95-I-fu.js} +1 -1
- package/dist/web-ui/assets/{Settings-D45ydMkM.js → Settings-DvknF2D-.js} +1 -1
- package/dist/web-ui/assets/{Store-C-lknVpt.js → Store-CVTUuEyr.js} +1 -1
- package/dist/web-ui/assets/{Switch-DAAFfXa0.js → Switch-CJm0Y6Ab.js} +1 -1
- package/dist/web-ui/assets/{Team-YRwejXFx.js → Team-CnQniCUA.js} +44 -44
- package/dist/web-ui/assets/{Work-CWxUln1b.js → Work-Dmxua6PP.js} +6 -6
- package/dist/web-ui/assets/{arc-DaVDBvVJ.js → arc-BLg_pCBM.js} +1 -1
- package/dist/web-ui/assets/{architectureDiagram-3BPJPVTR-RI4xfXsq.js → architectureDiagram-3BPJPVTR-Cmx-kPk8.js} +1 -1
- package/dist/web-ui/assets/{blockDiagram-GPEHLZMM-3m9lt9Tv.js → blockDiagram-GPEHLZMM-C7M18dlD.js} +1 -1
- package/dist/web-ui/assets/{c4Diagram-AAUBKEIU-C3uJ8ygg.js → c4Diagram-AAUBKEIU-Cfwl8fbI.js} +1 -1
- package/dist/web-ui/assets/channel-0w5HoIsN.js +1 -0
- package/dist/web-ui/assets/{chunk-2J33WTMH-BAFOp_1Q.js → chunk-2J33WTMH-C5mU_TTU.js} +1 -1
- package/dist/web-ui/assets/{chunk-4BX2VUAB-Dl4hewAE.js → chunk-4BX2VUAB-CQCbo-ag.js} +1 -1
- package/dist/web-ui/assets/{chunk-55IACEB6-BEZs165b.js → chunk-55IACEB6-4c3wqJwT.js} +1 -1
- package/dist/web-ui/assets/{chunk-727SXJPM-D40hw6dx.js → chunk-727SXJPM-DXdlGwqz.js} +1 -1
- package/dist/web-ui/assets/{chunk-AQP2D5EJ-Db0w70qS.js → chunk-AQP2D5EJ-K192souI.js} +1 -1
- package/dist/web-ui/assets/{chunk-FMBD7UC4-DSXWhRDm.js → chunk-FMBD7UC4-D5Q3CYrz.js} +1 -1
- package/dist/web-ui/assets/{chunk-ND2GUHAM-DHMvwtzx.js → chunk-ND2GUHAM-qNuRMI8p.js} +1 -1
- package/dist/web-ui/assets/{chunk-QZHKN3VN-CzsZVugR.js → chunk-QZHKN3VN-BkmKoVv4.js} +1 -1
- package/dist/web-ui/assets/classDiagram-4FO5ZUOK-C7BIpwAA.js +1 -0
- package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-C7BIpwAA.js +1 -0
- package/dist/web-ui/assets/{cose-bilkent-S5V4N54A-Dp3zgnT2.js → cose-bilkent-S5V4N54A-Cc-LCylz.js} +1 -1
- package/dist/web-ui/assets/{dagre-BM42HDAG-IbXphJ2p.js → dagre-BM42HDAG-CcbGFoMh.js} +1 -1
- package/dist/web-ui/assets/{diagram-2AECGRRQ-Dr80j8n6.js → diagram-2AECGRRQ-BMK1aNmF.js} +1 -1
- package/dist/web-ui/assets/{diagram-5GNKFQAL-BarMHyaM.js → diagram-5GNKFQAL-DLZ1Dlob.js} +1 -1
- package/dist/web-ui/assets/{diagram-KO2AKTUF-BLxNHwEs.js → diagram-KO2AKTUF-DgF4N3Vp.js} +1 -1
- package/dist/web-ui/assets/{diagram-LMA3HP47-dpjJXsFX.js → diagram-LMA3HP47-Dj6Rsgtz.js} +1 -1
- package/dist/web-ui/assets/{diagram-OG6HWLK6-B-AZz5xs.js → diagram-OG6HWLK6-B33vd8GS.js} +1 -1
- package/dist/web-ui/assets/{docx-preview-B9xb3lVY.js → docx-preview-Cbe9vyIJ.js} +1 -1
- package/dist/web-ui/assets/{erDiagram-TEJ5UH35-b55Ez0GT.js → erDiagram-TEJ5UH35-C0ArR1aG.js} +1 -1
- package/dist/web-ui/assets/{flowDiagram-I6XJVG4X-C-7BGCm3.js → flowDiagram-I6XJVG4X-wdN-ujEZ.js} +1 -1
- package/dist/web-ui/assets/{ganttDiagram-6RSMTGT7-BW47InmE.js → ganttDiagram-6RSMTGT7-BUKw6wm1.js} +1 -1
- package/dist/web-ui/assets/{gitGraphDiagram-PVQCEYII-YmWaJOLB.js → gitGraphDiagram-PVQCEYII-DU3TBBvN.js} +1 -1
- package/dist/web-ui/assets/index-Ci5bUF3m.js +883 -0
- package/dist/web-ui/assets/{index-DD3NMntN.css → index-D4zDaGe4.css} +1 -1
- package/dist/web-ui/assets/{infoDiagram-5YYISTIA-BYnK_hKC.js → infoDiagram-5YYISTIA-Dk634Bq4.js} +1 -1
- package/dist/web-ui/assets/{ishikawaDiagram-YF4QCWOH-FJ8nEqaM.js → ishikawaDiagram-YF4QCWOH-BE5upFcq.js} +1 -1
- package/dist/web-ui/assets/{journeyDiagram-JHISSGLW-Ufh7z6pn.js → journeyDiagram-JHISSGLW-C_fU89IU.js} +1 -1
- package/dist/web-ui/assets/{kanban-definition-UN3LZRKU-BKU0dWlO.js → kanban-definition-UN3LZRKU-DCPTTiVV.js} +1 -1
- package/dist/web-ui/assets/{mermaid.core-sMPs34mJ.js → mermaid.core-CwgDshh9.js} +5 -5
- package/dist/web-ui/assets/{mindmap-definition-RKZ34NQL-Csa43MLU.js → mindmap-definition-RKZ34NQL-B1O4o7mE.js} +1 -1
- package/dist/web-ui/assets/{pieDiagram-4H26LBE5-CUdusImI.js → pieDiagram-4H26LBE5-HKc1yZ37.js} +1 -1
- package/dist/web-ui/assets/{quadrantDiagram-W4KKPZXB-DL80bobR.js → quadrantDiagram-W4KKPZXB-DSJ8Nt1Y.js} +1 -1
- package/dist/web-ui/assets/{requirementDiagram-4Y6WPE33-1b7FWXut.js → requirementDiagram-4Y6WPE33-Bnk4zXkX.js} +1 -1
- package/dist/web-ui/assets/{sankeyDiagram-5OEKKPKP-D5bCHLyF.js → sankeyDiagram-5OEKKPKP-DW5T8bfU.js} +1 -1
- package/dist/web-ui/assets/{sequenceDiagram-3UESZ5HK-CwbH4Qmn.js → sequenceDiagram-3UESZ5HK-D80T-VQ2.js} +1 -1
- package/dist/web-ui/assets/{stateDiagram-AJRCARHV-BBseKBV0.js → stateDiagram-AJRCARHV-DbMI2WnT.js} +1 -1
- package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-BxYWXdlm.js +1 -0
- package/dist/web-ui/assets/{timeline-definition-PNZ67QCA-Pamw3ZAk.js → timeline-definition-PNZ67QCA-m1796nxN.js} +1 -1
- package/dist/web-ui/assets/{vennDiagram-CIIHVFJN-BRlYubXq.js → vennDiagram-CIIHVFJN-uQ9kkGtM.js} +1 -1
- package/dist/web-ui/assets/{wardley-L42UT6IY-Cpejr3QL.js → wardley-L42UT6IY-Bwp548d-.js} +1 -1
- package/dist/web-ui/assets/{wardleyDiagram-YWT4CUSO-D9mX9POT.js → wardleyDiagram-YWT4CUSO-D1Dcm5Tb.js} +1 -1
- package/dist/web-ui/assets/{xychartDiagram-2RQKCTM6-BZMvL0gm.js → xychartDiagram-2RQKCTM6-CRhoH3Re.js} +1 -1
- package/dist/web-ui/index.html +2 -2
- package/docs/architecture/mailbox-audit-checklist.md +194 -0
- package/docs/architecture/mailbox-system.md +374 -74
- package/docs/records/page-switch-jank-2026-10-23.md +174 -0
- package/package.json +1 -1
- package/dist/web-ui/assets/channel-BSxKSPBW.js +0 -1
- package/dist/web-ui/assets/classDiagram-4FO5ZUOK-BXPDTPh-.js +0 -1
- package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-BXPDTPh-.js +0 -1
- package/dist/web-ui/assets/index-tXN2M_eu.js +0 -883
- package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-jcfX_Wlv.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as c,j as e}from"./index-
|
|
1
|
+
import{u as c,j as e}from"./index-Ci5bUF3m.js";function a(...t){return t.filter(Boolean).join(" ")}function d({className:t}){return e.jsxs("svg",{className:a("animate-spin shrink-0",t??"w-3.5 h-3.5"),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.5",opacity:"0.2"}),e.jsx("path",{d:"M21 12a9 9 0 0 0-9-9",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]})}function u({label:t,className:r}){const{t:n}=c("common");return e.jsxs("div",{className:a("flex-1 flex flex-col items-center justify-center gap-2.5 py-10 text-fg-tertiary",r),role:"status","aria-live":"polite",children:[e.jsx(d,{className:"w-5 h-5 text-brand-400"}),e.jsx("span",{className:"text-xs",children:t??n("loading")})]})}function p({rows:t=3,label:r,variant:n="skeleton",className:s}){const{t:i}=c("common");return n==="text"?e.jsxs("div",{className:a("flex items-center gap-2 px-1 py-2 text-xs text-fg-tertiary",s),role:"status","aria-live":"polite",children:[e.jsx(d,{className:"w-3 h-3"}),e.jsx("span",{children:r??i("loading")})]}):e.jsx("div",{className:a("space-y-2.5 p-1",s),role:"status","aria-live":"polite","aria-label":r??i("loading"),children:Array.from({length:t}).map((o,l)=>e.jsxs("div",{className:"animate-pulse space-y-1.5",children:[e.jsx("div",{className:"h-3.5 bg-surface-elevated rounded w-2/3"}),e.jsx("div",{className:"h-2.5 bg-surface-elevated/70 rounded w-1/3"})]},l))})}function f({icon:t,title:r,hint:n,action:s,size:i="md",className:o}){const l=i==="sm"?"py-6":i==="lg"?"py-16":"py-10",x=i==="sm"?"text-xs":"text-sm";return e.jsxs("div",{className:a("flex flex-col items-center justify-center text-center px-4",l,o),children:[t&&e.jsx("div",{className:"mb-2.5 text-fg-muted",children:t}),e.jsx("div",{className:a("font-medium text-fg-secondary",x),children:r}),n&&e.jsx("div",{className:"mt-1 text-xs text-fg-tertiary max-w-xs leading-relaxed",children:n}),s&&e.jsx("button",{onClick:s.onClick,className:a("mt-3 px-3 py-1.5 rounded-md text-xs font-medium transition-colors",s.variant==="secondary"?"border border-border-default text-fg-secondary hover:bg-surface-elevated":"bg-brand-600 hover:bg-brand-500 text-white"),children:s.label})]})}export{f as E,p as L,u as P,d as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,u as T,r as a,k as ee}from"./index-tXN2M_eu.js";const te=1920,ne=10*1024*1024,W=5,se=.8;function re(l,u,i){return new Promise((b,f)=>{const w=new Image;w.onload=()=>{let{width:r,height:s}=w;if(r<=u&&s<=u){b(l);return}r>s?(s=Math.round(s*(u/r)),r=u):(r=Math.round(r*(u/s)),s=u);const h=document.createElement("canvas");h.width=r,h.height=s;const g=h.getContext("2d");if(!g){f(new Error("Failed to get canvas context"));return}g.drawImage(w,0,0,r,s),b(h.toDataURL("image/jpeg",i))},w.onerror=()=>f(new Error("Failed to load image")),w.src=l})}function ae({candidates:l,filter:u,anchorRef:i,onSelect:b,selectedIndex:f,onIndexChange:w}){const{t:r}=T("common"),[s,h]=a.useState(null),g=a.useRef(null),y=l.filter(d=>d.name.toLowerCase().includes(u));return a.useEffect(()=>{const d=i.current;if(!d)return;const x=d.getBoundingClientRect();h({top:x.top+window.scrollY-4,left:x.left+window.scrollX+8})},[i,u]),a.useEffect(()=>{if(!g.current||!s)return;if(g.current.getBoundingClientRect().top<8){const x=i.current;if(!x)return;const c=x.getBoundingClientRect();h({top:c.bottom+window.scrollY+4,left:s.left})}},[s,i]),a.useEffect(()=>{f>=y.length&&w(Math.max(0,y.length-1))},[y.length,f,w]),a.useEffect(()=>{if(!g.current)return;g.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"nearest"})},[f]),!s||y.length===0?null:ee.createPortal(t.jsxs("div",{ref:g,style:{position:"absolute",top:s.top,left:s.left,transform:"translateY(-100%)"},className:"w-60 bg-surface-overlay border border-border-default rounded-lg shadow-xl z-[9999] max-h-48 overflow-y-auto",children:[t.jsx("div",{className:"px-2.5 py-1.5 text-[10px] text-fg-tertiary font-medium uppercase tracking-wider border-b border-border-default",children:r("commentInput.mentionHeading")}),y.map((d,x)=>t.jsxs("button",{"data-selected":x===f,onMouseDown:c=>{c.preventDefault(),b(d)},onMouseEnter:()=>w(x),className:`w-full text-left px-3 py-2 text-xs flex items-center gap-2 transition-colors ${x===f?"bg-brand-500/15 text-brand-500":"hover:bg-surface-elevated"}`,children:[t.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 ${d.type==="human"?"bg-green-500/20 text-green-500":"bg-brand-500/20 text-brand-500"}`,children:d.name.slice(0,2).toUpperCase()}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("span",{className:"text-fg-primary font-medium",children:d.name}),t.jsx("span",{className:"text-fg-tertiary text-[10px] ml-1.5",children:d.subtitle??d.type})]}),d.type==="agent"&&t.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${d.online?"bg-green-400":"bg-gray-500"}`})]},d.id))]}),document.body)}function oe(l){return/^\w+$/.test(l)?`@${l}`:`@[${l}]`}const K=/@\[([^\]]+)\]|@([\w\p{L}\p{N}]+)/gu;function ie(l){const u=[];let i;for(K.lastIndex=0;(i=K.exec(l))!==null;)u.push(i[1]??i[2]);return u}function ce(l,u,i){const b=[];let f=0;const w=u.map(s=>s.name).sort((s,h)=>h.length-s.length);let r=0;for(;r<l.length;){const s=l.indexOf("@",r);if(s<0){b.push(t.jsx("span",{children:l.slice(r)},f++));break}if(s>r&&b.push(t.jsx("span",{children:l.slice(r,s)},f++)),l[s+1]==="["){const c=l.indexOf("]",s+2);if(c>s+2){const m=l.slice(s+2,c),j=u.find(k=>k.name.toLowerCase()===m.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&j?"cursor-pointer hover:underline":""}`,onClick:i&&j?k=>i(j,k):void 0,title:j?`${j.name} (${j.role})`:void 0,children:["@",m]},f++)),r=c+1;continue}}const h=l.slice(s+1),g=h.toLowerCase(),y=w.find(c=>g.startsWith(c.toLowerCase()));if(y){const c=u.find(m=>m.name.toLowerCase()===y.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&c?"cursor-pointer hover:underline":""}`,onClick:i&&c?m=>i(c,m):void 0,title:c?`${c.name} (${c.role})`:void 0,children:["@",y]},f++)),r=s+1+y.length;continue}const d=/^([\w\p{L}\p{N}]+)/u,x=h.match(d);if(x){const c=x[1],m=u.find(j=>j.name.toLowerCase()===c.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&m?"cursor-pointer hover:underline":""}`,onClick:i&&m?j=>i(m,j):void 0,title:m?`${m.name} (${m.role})`:void 0,children:["@",c]},f++)),r=s+1+c.length;continue}b.push(t.jsx("span",{children:"@"},f++)),r=s+1}return b.length>0?b:[t.jsx("span",{children:l},0)]}function de({agents:l,humans:u,onSubmit:i,placeholder:b,replyTo:f,onCancelReply:w}){const{t:r}=T("common"),[s,h]=a.useState(""),[g,y]=a.useState(!1),[d,x]=a.useState(null),[c,m]=a.useState(!1),[j,k]=a.useState(""),[C,S]=a.useState([]),[B,I]=a.useState(0),[N,M]=a.useState([]),[z,A]=a.useState(!1),F=a.useRef(null),U=a.useRef(null),L=a.useRef(null),$=a.useMemo(()=>{const e=(u??[]).map(n=>({id:n.id,name:n.name,type:"human",subtitle:n.role}));for(const n of l)e.push({id:n.id,name:n.name,type:"agent",subtitle:n.role,online:n.status==="idle"||n.status==="working"});return e},[l,u]),D=$.filter(e=>e.name.toLowerCase().includes(j)),E=a.useCallback(e=>{const n=Array.from(e).filter(o=>o.type.startsWith("image/"));if(n.length!==0)for(const o of n){if(o.size>ne)continue;const p=new FileReader;p.onload=()=>{const R=p.result;re(R,te,se).then(v=>{M(_=>_.length>=W?_:[..._,{id:`img_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,dataUrl:v,name:o.name}])})},p.readAsDataURL(o)}},[]),X=a.useCallback(e=>{M(n=>n.filter(o=>o.id!==e))},[]),Y=a.useCallback(e=>{const n=e.clipboardData?.files;if(n&&n.length>0){const o=Array.from(n).filter(p=>p.type.startsWith("image/"));o.length>0&&(e.preventDefault(),E(o))}},[E]),q=a.useCallback(e=>{e.preventDefault(),A(!1);const n=e.dataTransfer?.files;n&&n.length>0&&E(Array.from(n).filter(o=>o.type.startsWith("image/")))},[E]),H=a.useCallback(e=>{e.preventDefault(),A(!0)},[]),G=a.useCallback(()=>{A(!1)},[]),O=async()=>{if(!(!s.trim()&&N.length===0)){y(!0),x(null),L.current={content:s,mentions:[...C],images:[...N]};try{await i(s,C,[...N],f?.id),h(""),S([]),M([]),L.current=null,w?.()}catch(e){x(String(e instanceof Error?e.message:e)||r("commentInput.sendFailed"))}y(!1)}},Q=async()=>{if(!L.current)return;const{content:e,mentions:n,images:o}=L.current;y(!0),x(null);try{await i(e,n,o),h(""),S([]),M([]),L.current=null}catch(p){x(String(p instanceof Error?p.message:p)||r("commentInput.sendFailed"))}y(!1)},P=a.useCallback(e=>{h(n=>{const o=n.lastIndexOf("@"),p=oe(e.name);return o>=0?n.slice(0,o)+p+" ":n+p+" "}),C.includes(e.id)||S(n=>[...n,e.id]),m(!1),k(""),I(0),F.current?.focus()},[C]),V=e=>{h(e),x(null);const n=e.lastIndexOf("@");if(n>=0&&(n===0||e[n-1]===" ")){const p=e.slice(n+1).toLowerCase();if($.some(v=>v.name.toLowerCase().includes(p))){k(p),m(!0),I(0);return}}m(!1)},Z=e=>{if(c&&D.length>0){const n=e.key==="ArrowUp"||e.ctrlKey&&e.key==="p",o=e.key==="ArrowDown"||e.ctrlKey&&e.key==="n",p=e.key==="Enter"||e.key==="Tab",R=e.key==="Escape";if(n){e.preventDefault(),I(v=>(v-1+D.length)%D.length);return}if(o){e.preventDefault(),I(v=>(v+1)%D.length);return}if(p){e.preventDefault();const v=D[B];v&&P(v);return}if(R){e.preventDefault(),m(!1);return}}e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),O())},J=a.useCallback(()=>{setTimeout(()=>m(!1),200)},[]);return t.jsxs("div",{className:"relative",onDragOver:H,onDragLeave:G,onDrop:q,children:[z&&t.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-brand-500/10 rounded-lg border-2 border-dashed border-brand-500",children:t.jsx("span",{className:"text-sm text-brand-500 font-medium",children:r("commentInput.dragDropHint")})}),c&&t.jsx(ae,{candidates:$,filter:j,anchorRef:F,onSelect:P,selectedIndex:B,onIndexChange:I}),t.jsxs("div",{className:"border border-border-default rounded-lg bg-surface-elevated",children:[f&&t.jsxs("div",{className:"flex items-center gap-2 px-2.5 pt-2 pb-1 border-b border-border-default/50",children:[t.jsxs("div",{className:"flex-1 min-w-0 pl-2 border-l-2 border-brand-500/50",children:[t.jsx("span",{className:"text-[10px] font-medium text-brand-500",children:f.authorName}),t.jsx("p",{className:"text-[10px] text-fg-tertiary truncate",children:f.content})]}),t.jsx("button",{onClick:w,className:"text-fg-tertiary hover:text-fg-secondary shrink-0 p-0.5",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),C.length>0&&t.jsx("div",{className:"flex gap-1 px-2.5 pt-2 flex-wrap",children:C.map(e=>{const n=$.find(o=>o.id===e);return t.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded-full ${n?.type==="human"?"bg-green-500/15 text-green-500":"bg-brand-500/15 text-brand-500"}`,children:["@",n?.name??e,t.jsx("button",{onClick:()=>S(o=>o.filter(p=>p!==e)),className:"hover:text-red-400",children:"×"})]},e)})}),t.jsx("textarea",{ref:F,value:s,onChange:e=>V(e.target.value),onKeyDown:Z,onBlur:J,onPaste:Y,placeholder:b??r("commentInput.placeholder"),rows:2,className:"w-full px-2.5 py-2 text-xs bg-transparent text-fg-primary placeholder-fg-tertiary outline-none resize-none"}),N.length>0&&t.jsx("div",{className:"flex items-center gap-1.5 px-2.5 pb-1.5 overflow-x-auto",children:N.map(e=>t.jsxs("div",{className:"relative group/img shrink-0",children:[t.jsx("img",{src:e.dataUrl,alt:e.name,className:"w-12 h-12 rounded-lg object-cover border border-border-default"}),t.jsx("button",{onClick:()=>X(e.id),className:"absolute -top-1.5 -right-1.5 w-4 h-4 bg-surface-secondary border border-gray-600 rounded-full flex items-center justify-center text-fg-secondary hover:text-red-500 hover:border-red-500 text-[10px] opacity-0 group-hover/img:opacity-100 transition-opacity",title:r("commentInput.removeImage"),children:"×"})]},e.id))}),d&&t.jsxs("div",{className:"flex items-center gap-2 px-2.5 pb-1.5",children:[t.jsx("span",{className:"text-[11px] text-red-400 flex-1 truncate",children:d}),t.jsxs("button",{onClick:Q,disabled:g,className:"text-[11px] text-amber-500 hover:text-amber-400 font-medium transition-colors flex items-center gap-1",children:[t.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("polyline",{points:"23 4 23 10 17 10"}),t.jsx("path",{d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),r("commentInput.retry")]})]}),t.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2",children:[t.jsx("button",{type:"button",onClick:()=>U.current?.click(),disabled:g||N.length>=W,className:"p-1 text-fg-tertiary hover:text-brand-500 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:r("commentInput.attachImage"),children:t.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("polyline",{points:"21 15 16 10 5 21"})]})}),t.jsx("input",{ref:U,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&E(e.target.files),e.target.value=""}}),t.jsx("button",{onClick:O,disabled:!s.trim()&&N.length===0||g,className:"px-3 py-1 text-[11px] font-medium bg-brand-500 text-white rounded-md hover:bg-brand-600 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:r(g?"commentInput.sending":"commentInput.submit")})]})]}),s.trim()&&!g&&t.jsx("div",{className:"mt-0.5 -mb-0.5 flex justify-end px-2.5 pointer-events-none select-none",children:t.jsx("span",{className:"text-[10px] text-fg-tertiary/80",children:r("common:shiftEnterHint")})}),t.jsx("p",{className:"mt-1 text-center text-[10px] text-fg-tertiary/80 select-none",children:r("aiDisclaimer")})]})}export{de as C,ie as p,ce as r};
|
|
1
|
+
import{j as t,u as T,r as a,k as ee}from"./index-Ci5bUF3m.js";const te=1920,ne=10*1024*1024,W=5,se=.8;function re(l,u,i){return new Promise((b,f)=>{const w=new Image;w.onload=()=>{let{width:r,height:s}=w;if(r<=u&&s<=u){b(l);return}r>s?(s=Math.round(s*(u/r)),r=u):(r=Math.round(r*(u/s)),s=u);const h=document.createElement("canvas");h.width=r,h.height=s;const g=h.getContext("2d");if(!g){f(new Error("Failed to get canvas context"));return}g.drawImage(w,0,0,r,s),b(h.toDataURL("image/jpeg",i))},w.onerror=()=>f(new Error("Failed to load image")),w.src=l})}function ae({candidates:l,filter:u,anchorRef:i,onSelect:b,selectedIndex:f,onIndexChange:w}){const{t:r}=T("common"),[s,h]=a.useState(null),g=a.useRef(null),y=l.filter(d=>d.name.toLowerCase().includes(u));return a.useEffect(()=>{const d=i.current;if(!d)return;const x=d.getBoundingClientRect();h({top:x.top+window.scrollY-4,left:x.left+window.scrollX+8})},[i,u]),a.useEffect(()=>{if(!g.current||!s)return;if(g.current.getBoundingClientRect().top<8){const x=i.current;if(!x)return;const c=x.getBoundingClientRect();h({top:c.bottom+window.scrollY+4,left:s.left})}},[s,i]),a.useEffect(()=>{f>=y.length&&w(Math.max(0,y.length-1))},[y.length,f,w]),a.useEffect(()=>{if(!g.current)return;g.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"nearest"})},[f]),!s||y.length===0?null:ee.createPortal(t.jsxs("div",{ref:g,style:{position:"absolute",top:s.top,left:s.left,transform:"translateY(-100%)"},className:"w-60 bg-surface-overlay border border-border-default rounded-lg shadow-xl z-[9999] max-h-48 overflow-y-auto",children:[t.jsx("div",{className:"px-2.5 py-1.5 text-[10px] text-fg-tertiary font-medium uppercase tracking-wider border-b border-border-default",children:r("commentInput.mentionHeading")}),y.map((d,x)=>t.jsxs("button",{"data-selected":x===f,onMouseDown:c=>{c.preventDefault(),b(d)},onMouseEnter:()=>w(x),className:`w-full text-left px-3 py-2 text-xs flex items-center gap-2 transition-colors ${x===f?"bg-brand-500/15 text-brand-500":"hover:bg-surface-elevated"}`,children:[t.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 ${d.type==="human"?"bg-green-500/20 text-green-500":"bg-brand-500/20 text-brand-500"}`,children:d.name.slice(0,2).toUpperCase()}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("span",{className:"text-fg-primary font-medium",children:d.name}),t.jsx("span",{className:"text-fg-tertiary text-[10px] ml-1.5",children:d.subtitle??d.type})]}),d.type==="agent"&&t.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${d.online?"bg-green-400":"bg-gray-500"}`})]},d.id))]}),document.body)}function oe(l){return/^\w+$/.test(l)?`@${l}`:`@[${l}]`}const K=/@\[([^\]]+)\]|@([\w\p{L}\p{N}]+)/gu;function ie(l){const u=[];let i;for(K.lastIndex=0;(i=K.exec(l))!==null;)u.push(i[1]??i[2]);return u}function ce(l,u,i){const b=[];let f=0;const w=u.map(s=>s.name).sort((s,h)=>h.length-s.length);let r=0;for(;r<l.length;){const s=l.indexOf("@",r);if(s<0){b.push(t.jsx("span",{children:l.slice(r)},f++));break}if(s>r&&b.push(t.jsx("span",{children:l.slice(r,s)},f++)),l[s+1]==="["){const c=l.indexOf("]",s+2);if(c>s+2){const m=l.slice(s+2,c),j=u.find(k=>k.name.toLowerCase()===m.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&j?"cursor-pointer hover:underline":""}`,onClick:i&&j?k=>i(j,k):void 0,title:j?`${j.name} (${j.role})`:void 0,children:["@",m]},f++)),r=c+1;continue}}const h=l.slice(s+1),g=h.toLowerCase(),y=w.find(c=>g.startsWith(c.toLowerCase()));if(y){const c=u.find(m=>m.name.toLowerCase()===y.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&c?"cursor-pointer hover:underline":""}`,onClick:i&&c?m=>i(c,m):void 0,title:c?`${c.name} (${c.role})`:void 0,children:["@",y]},f++)),r=s+1+y.length;continue}const d=/^([\w\p{L}\p{N}]+)/u,x=h.match(d);if(x){const c=x[1],m=u.find(j=>j.name.toLowerCase()===c.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&m?"cursor-pointer hover:underline":""}`,onClick:i&&m?j=>i(m,j):void 0,title:m?`${m.name} (${m.role})`:void 0,children:["@",c]},f++)),r=s+1+c.length;continue}b.push(t.jsx("span",{children:"@"},f++)),r=s+1}return b.length>0?b:[t.jsx("span",{children:l},0)]}function de({agents:l,humans:u,onSubmit:i,placeholder:b,replyTo:f,onCancelReply:w}){const{t:r}=T("common"),[s,h]=a.useState(""),[g,y]=a.useState(!1),[d,x]=a.useState(null),[c,m]=a.useState(!1),[j,k]=a.useState(""),[C,S]=a.useState([]),[B,I]=a.useState(0),[N,M]=a.useState([]),[z,A]=a.useState(!1),F=a.useRef(null),U=a.useRef(null),L=a.useRef(null),$=a.useMemo(()=>{const e=(u??[]).map(n=>({id:n.id,name:n.name,type:"human",subtitle:n.role}));for(const n of l)e.push({id:n.id,name:n.name,type:"agent",subtitle:n.role,online:n.status==="idle"||n.status==="working"});return e},[l,u]),D=$.filter(e=>e.name.toLowerCase().includes(j)),E=a.useCallback(e=>{const n=Array.from(e).filter(o=>o.type.startsWith("image/"));if(n.length!==0)for(const o of n){if(o.size>ne)continue;const p=new FileReader;p.onload=()=>{const R=p.result;re(R,te,se).then(v=>{M(_=>_.length>=W?_:[..._,{id:`img_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,dataUrl:v,name:o.name}])})},p.readAsDataURL(o)}},[]),X=a.useCallback(e=>{M(n=>n.filter(o=>o.id!==e))},[]),Y=a.useCallback(e=>{const n=e.clipboardData?.files;if(n&&n.length>0){const o=Array.from(n).filter(p=>p.type.startsWith("image/"));o.length>0&&(e.preventDefault(),E(o))}},[E]),q=a.useCallback(e=>{e.preventDefault(),A(!1);const n=e.dataTransfer?.files;n&&n.length>0&&E(Array.from(n).filter(o=>o.type.startsWith("image/")))},[E]),H=a.useCallback(e=>{e.preventDefault(),A(!0)},[]),G=a.useCallback(()=>{A(!1)},[]),O=async()=>{if(!(!s.trim()&&N.length===0)){y(!0),x(null),L.current={content:s,mentions:[...C],images:[...N]};try{await i(s,C,[...N],f?.id),h(""),S([]),M([]),L.current=null,w?.()}catch(e){x(String(e instanceof Error?e.message:e)||r("commentInput.sendFailed"))}y(!1)}},Q=async()=>{if(!L.current)return;const{content:e,mentions:n,images:o}=L.current;y(!0),x(null);try{await i(e,n,o),h(""),S([]),M([]),L.current=null}catch(p){x(String(p instanceof Error?p.message:p)||r("commentInput.sendFailed"))}y(!1)},P=a.useCallback(e=>{h(n=>{const o=n.lastIndexOf("@"),p=oe(e.name);return o>=0?n.slice(0,o)+p+" ":n+p+" "}),C.includes(e.id)||S(n=>[...n,e.id]),m(!1),k(""),I(0),F.current?.focus()},[C]),V=e=>{h(e),x(null);const n=e.lastIndexOf("@");if(n>=0&&(n===0||e[n-1]===" ")){const p=e.slice(n+1).toLowerCase();if($.some(v=>v.name.toLowerCase().includes(p))){k(p),m(!0),I(0);return}}m(!1)},Z=e=>{if(c&&D.length>0){const n=e.key==="ArrowUp"||e.ctrlKey&&e.key==="p",o=e.key==="ArrowDown"||e.ctrlKey&&e.key==="n",p=e.key==="Enter"||e.key==="Tab",R=e.key==="Escape";if(n){e.preventDefault(),I(v=>(v-1+D.length)%D.length);return}if(o){e.preventDefault(),I(v=>(v+1)%D.length);return}if(p){e.preventDefault();const v=D[B];v&&P(v);return}if(R){e.preventDefault(),m(!1);return}}e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),O())},J=a.useCallback(()=>{setTimeout(()=>m(!1),200)},[]);return t.jsxs("div",{className:"relative",onDragOver:H,onDragLeave:G,onDrop:q,children:[z&&t.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-brand-500/10 rounded-lg border-2 border-dashed border-brand-500",children:t.jsx("span",{className:"text-sm text-brand-500 font-medium",children:r("commentInput.dragDropHint")})}),c&&t.jsx(ae,{candidates:$,filter:j,anchorRef:F,onSelect:P,selectedIndex:B,onIndexChange:I}),t.jsxs("div",{className:"border border-border-default rounded-lg bg-surface-elevated",children:[f&&t.jsxs("div",{className:"flex items-center gap-2 px-2.5 pt-2 pb-1 border-b border-border-default/50",children:[t.jsxs("div",{className:"flex-1 min-w-0 pl-2 border-l-2 border-brand-500/50",children:[t.jsx("span",{className:"text-[10px] font-medium text-brand-500",children:f.authorName}),t.jsx("p",{className:"text-[10px] text-fg-tertiary truncate",children:f.content})]}),t.jsx("button",{onClick:w,className:"text-fg-tertiary hover:text-fg-secondary shrink-0 p-0.5",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),C.length>0&&t.jsx("div",{className:"flex gap-1 px-2.5 pt-2 flex-wrap",children:C.map(e=>{const n=$.find(o=>o.id===e);return t.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded-full ${n?.type==="human"?"bg-green-500/15 text-green-500":"bg-brand-500/15 text-brand-500"}`,children:["@",n?.name??e,t.jsx("button",{onClick:()=>S(o=>o.filter(p=>p!==e)),className:"hover:text-red-400",children:"×"})]},e)})}),t.jsx("textarea",{ref:F,value:s,onChange:e=>V(e.target.value),onKeyDown:Z,onBlur:J,onPaste:Y,placeholder:b??r("commentInput.placeholder"),rows:2,className:"w-full px-2.5 py-2 text-xs bg-transparent text-fg-primary placeholder-fg-tertiary outline-none resize-none"}),N.length>0&&t.jsx("div",{className:"flex items-center gap-1.5 px-2.5 pb-1.5 overflow-x-auto",children:N.map(e=>t.jsxs("div",{className:"relative group/img shrink-0",children:[t.jsx("img",{src:e.dataUrl,alt:e.name,className:"w-12 h-12 rounded-lg object-cover border border-border-default"}),t.jsx("button",{onClick:()=>X(e.id),className:"absolute -top-1.5 -right-1.5 w-4 h-4 bg-surface-secondary border border-gray-600 rounded-full flex items-center justify-center text-fg-secondary hover:text-red-500 hover:border-red-500 text-[10px] opacity-0 group-hover/img:opacity-100 transition-opacity",title:r("commentInput.removeImage"),children:"×"})]},e.id))}),d&&t.jsxs("div",{className:"flex items-center gap-2 px-2.5 pb-1.5",children:[t.jsx("span",{className:"text-[11px] text-red-400 flex-1 truncate",children:d}),t.jsxs("button",{onClick:Q,disabled:g,className:"text-[11px] text-amber-500 hover:text-amber-400 font-medium transition-colors flex items-center gap-1",children:[t.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("polyline",{points:"23 4 23 10 17 10"}),t.jsx("path",{d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),r("commentInput.retry")]})]}),t.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2",children:[t.jsx("button",{type:"button",onClick:()=>U.current?.click(),disabled:g||N.length>=W,className:"p-1 text-fg-tertiary hover:text-brand-500 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:r("commentInput.attachImage"),children:t.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("polyline",{points:"21 15 16 10 5 21"})]})}),t.jsx("input",{ref:U,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&E(e.target.files),e.target.value=""}}),t.jsx("button",{onClick:O,disabled:!s.trim()&&N.length===0||g,className:"px-3 py-1 text-[11px] font-medium bg-brand-500 text-white rounded-md hover:bg-brand-600 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:r(g?"commentInput.sending":"commentInput.submit")})]})]}),s.trim()&&!g&&t.jsx("div",{className:"mt-0.5 -mb-0.5 flex justify-end px-2.5 pointer-events-none select-none",children:t.jsx("span",{className:"text-[10px] text-fg-tertiary/80",children:r("common:shiftEnterHint")})}),t.jsx("p",{className:"mt-1 text-center text-[10px] text-fg-tertiary/80 select-none",children:r("aiDisclaimer")})]})}export{de as C,ie as p,ce as r};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{j as a,r as i,_ as f}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ci5bUF3m.js","assets/index-D4zDaGe4.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as a,r as i,_ as f}from"./index-Ci5bUF3m.js";const b=i.lazy(()=>f(()=>import("./index-Ci5bUF3m.js").then(e=>e.bn),__vite__mapDeps([0,1])).then(e=>({default:e.MarkdownMessage}))),x=new Set(["ts","tsx","js","jsx","mjs","cjs","py","go","rs","java","kt","kts","c","cc","cpp","cxx","h","hpp","hxx","cs","rb","php","swift","scala","sh","bash","zsh","fish","ps1","sql","yaml","yml","toml","xml","css","scss","less","vue","svelte","graphql","gql","proto","dockerfile","makefile","cmake","rsx","r","lua","pl","pm","ex","exs","erl","hs","clj","zig","nim","dart","gradle","tf","hcl"]);function v(e){const t=e.split(/[/\\]/).pop()?.toLowerCase()||"";if(t==="dockerfile"||t==="makefile")return"code";const r=t.includes(".")?t.split(".").pop():"";switch(r){case"md":case"markdown":return"markdown";case"html":case"htm":return"html";case"json":case"jsonc":return"json";case"csv":case"tsv":return"csv";default:return r&&x.has(r)?"code":r?"text":void 0}}function w(e){const t=e.trimStart();if(/^<!doctype\s+html/i.test(t)||/^<html[\s>]/i.test(t))return"html";if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(e),"json"}catch{}}function S(e){if(e.format)return e.format;if(e.reference){const t=v(e.reference);if(t)return t}if(e.content){const t=w(e.content);if(t)return t}return e.reference?"text":"markdown"}function y({content:e,className:t,onSelection:r}){const c=i.useRef(null),[l,p]=i.useState(null);i.useEffect(()=>{const o=d=>{d.data?.type==="__htmlpreview_height"&&typeof d.data.height=="number"&&p(d.data.height),d.data?.type==="__htmlpreview_selection"&&r&&r(d.data)};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)},[r]);const h=`<script>
|
|
3
3
|
(function(){
|
|
4
4
|
function getXPath(el){
|
|
5
5
|
if(!el||el.nodeType!==1)return'';
|
package/dist/web-ui/assets/{DeliverableShareModal-DvNGiVma.js → DeliverableShareModal-wgdeaboz.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as de,r as u,h as R,o as ue,v as fe,l as N,j as r}from"./index-tXN2M_eu.js";const G=50*1024*1024,q=new Set(["markdown","html"]);function be(e){return e||"markdown"}function he(e){return q.has(be(e))}class S extends Error{constructor(t){super(t),this.name="DeliverableShareError"}}class Q extends S{constructor(){super("需要登录 Markus Hub 账号后才能分享产出物。"),this.name="NotLoggedIntoHubError"}}class pe extends S{bytes;limit;constructor(t,a){super(`产出物文件大小 ${t} 字节超过上限 ${a} 字节(50MB),请压缩或拒绝分享。`),this.name="DeliverableTooLargeError",this.bytes=t,this.limit=a}}class me extends S{status;constructor(t,a){super(`Hub 请求失败 (HTTP ${t}): ${a}`),this.name="HubApiError",this.status=t}}function ge(e){const t=e.replace(/\s+/g,"");if(!t)return 0;let a=0;return t.endsWith("==")?a=2:t.endsWith("=")&&(a=1),Math.floor(t.length*3/4)-a}function $(e,t){const a=e&&typeof e=="object"?e:{},l=a.share??a.deliverable??{},s=m=>a[m]??l[m],i=s("id")??s("shareId")??"",c=s("slug"),o=c!=null?String(c):void 0,d=s("url")??s("shareUrl");let b=null;d!=null?b=String(d):o&&t&&(b=`${t.replace(/\/+$/,"")}/deliverable/${encodeURIComponent(o)}`);const f=s("reason")??s("rejectNote"),p=s("localDeliverableId")??s("localId");return{id:String(i),slug:o,visibility:s("visibility")??"public",status:s("status")??"pending_review",url:b,reason:f!=null?String(f):null,localId:p!=null?String(p):null}}class xe{basePath;fetchImpl;hubOrigin;constructor(t){this.getHubToken=t.getHubToken,this.hubOrigin=t.hubUrl,this.basePath=(t.proxyBasePath??"/api/hub").replace(/\/+$/,""),this.fetchImpl=t.fetch??(globalThis.fetch?globalThis.fetch.bind(globalThis):(()=>{throw new Error("fetch unavailable")}))}getHubToken;isHubLoggedIn(){return!!this.getHubToken()}assertHubLoggedIn(){if(!this.getHubToken())throw new Q}async doFetch(t,a){const l=this.getHubToken(),s={"Content-Type":"application/json",...a.headers};l&&(s.Authorization=`Bearer ${l}`);const i=await this.fetchImpl(`${this.basePath}${t}`,{...a,headers:s,credentials:"include"});let c=null;try{c=await i.json()}catch{c=null}if(!i.ok){const o=c&&typeof c=="object"&&"error"in c?String(c.error):i.statusText||`HTTP ${i.status}`;throw new me(i.status,o)}return{status:i.status,data:c}}async publish(t){this.assertHubLoggedIn();const a=t.fileSizeBytes??(t.fileBase64?ge(t.fileBase64):0);if(a>G)throw new pe(a,G);const l={localDeliverableId:t.localId,visibility:t.visibility,title:t.title,summary:t.summary,tags:t.tags,filename:t.filename,format:t.format,producerAgent:{id:t.producerAgent.id,name:t.producerAgent.name,source:t.producerAgent.source}};t.content&&(l.content=t.content),t.fileBase64&&(l.fileBase64=t.fileBase64);const{data:s}=await this.doFetch("/deliverables/publish",{method:"POST",body:JSON.stringify(l)});return $(s,this.hubOrigin)}async pollStatus(t){this.assertHubLoggedIn();const{data:a}=await this.doFetch(`/deliverables/status?localId=${encodeURIComponent(t)}`,{method:"GET"});return $(a,this.hubOrigin)}async listMine(){this.assertHubLoggedIn();const{data:t}=await this.doFetch("/deliverables/mine",{method:"GET"}),a=t&&typeof t=="object"?t:{};return(Array.isArray(a.shares)?a.shares:[]).map(s=>$(s,this.hubOrigin))}async revoke(t){this.assertHubLoggedIn();const{data:a}=await this.doFetch("/deliverables/revoke",{method:"POST",body:JSON.stringify({localId:t})});return{...$(a,this.hubOrigin),status:"revoked",url:null}}}function ye(e,t){return new xe({getHubToken:e,hubUrl:t,proxyBasePath:"/api/hub"})}const ve=/\.(png|jpe?g|gif|webp|svg|bmp|avif|ico)$/i,ke=/\.(mp4|webm|mp3|wav|ogg|m4a|mov|avi|mkv|flac)$/i;function X(e){return ve.test(e)?"image":ke.test(e)?"media":"other"}function we(e){return e.replace(/^file:\/\//i,"").replace(/^file:/i,"")}function J(e){const t=e.match(/!?\[[^\]]*\]\(([^)]+)\)/);if(t)return t[1].trim().split(/\s+(?="|')/)[0].trim()||null;const a=e.match(/(?:src|href|poster)\s*=\s*["']([^"']+)["']/i);return a?a[1]:null}function Z(e){return!e||/^(https?:|data:|mailto:|tel:|#)/i.test(e)||e.startsWith("//")?!1:(e.startsWith("/api/files/"),!0)}function Y(e,t){if(!e)return null;const a=e.trim(),l=a.match(/^\/api\/files\/(?:image|stream|preview)\?path=([^&]+)/i);if(l)try{return decodeURIComponent(l[1])||null}catch{return l[1]||null}return/^file:\/\//i.test(a)?we(a).replace(/\\/g,"/"):/^[a-zA-Z]:[\\/]/.test(a)?a.replace(/\\/g,"/"):a.startsWith("/")?a:t&&(a.startsWith("./")||a.startsWith("../")||!a.includes("://"))?`${t.replace(/\\/g,"/").replace(/\/+$/,"")}/${a.replace(/^\.\//,"").replace(/\\/g,"/")}`:null}function je(e,t){const a=[],l=new Set,s=/!?\[[^\]]*\]\(([^)\s]+(?:\s+["'][^"']*["'])?)\)/g;for(const c of e.matchAll(s)){const o=c[0],d=J(o);if(!d||!Z(d))continue;const b=Y(d,t);!b||l.has(o)||(l.add(o),a.push({raw:o,localPath:b,kind:X(b.split("?")[0])}))}const i=/<[a-zA-Z][^>]*(?:src|href|poster)\s*=\s*["'][^"']+["'][^>]*>/gi;for(const c of e.matchAll(i)){const o=c[0],d=J(o);if(!d||!Z(d))continue;const b=Y(d,t);!b||l.has(o)||(l.add(o),a.push({raw:o,localPath:b,kind:X(b.split("?")[0])}))}return{refs:a,baseDir:t??""}}function Ne(e,t){let a=e;for(const[l,s]of t){const i=Se(l,s);a=a.split(l).join(i)}return a}function Se(e,t){const a=e.match(/^(!?\[[^\]]*\])\([^)]*\)$/);if(a)return`${a[1]}(${t})`;const l=e.match(/(src|href|poster)(\s*=\s*)(["'])[^"']*\3/i);return l?e.replace(/(src|href|poster)(\s*=\s*)(["'])[^"']*\3/i,`${l[1]}${l[2]}${l[3]}${t}${l[3]}`):t}function He(e,t){return/^https?:\/\//i.test(e)?e:`${t.replace(/\/+$/,"")}${e.startsWith("/")?"":"/"}${e}`}function Ve(e,t,a){const l=new Map,s=new Map(e.map(i=>[i.localPath,i]));for(const i of t){if(!i.key)continue;const c=s.get(i.key);!c||!i.url||l.set(c.raw,He(i.url,a))}return l}async function Ie(e){try{const t=N.files.streamUrl(e),a=await fetch(t).then(d=>d.ok?d.blob():null);if(!a)return null;const l=await a.arrayBuffer(),s=new Uint8Array(l);let i="";const c=32768;for(let d=0;d<s.length;d+=c)i+=String.fromCharCode.apply(null,Array.from(s.subarray(d,d+c)));const o=e.split("/").pop()||"media";return{base64:btoa(i),filename:o}}catch{return null}}async function Te(e,t){const a=new Map;if(e.length===0)return a;const l=[];for(const c of e){const o=await Ie(c.localPath);o&&l.push({key:c.localPath,filename:o.filename,base64:o.base64})}if(l.length===0)return a;const{files:s,errors:i}=await R.uploadMediaBatch(l);return i.length>0&&console.warn("[deliverable-share] media upload errors:",i),Ve(e,s,t)}async function Ce(e,t,a){if(!e||t==="directory"||e.startsWith("http://")||e.startsWith("https://"))return{};try{const l=await N.files.preview(e);if((l.type==="text"||l.type==="markdown"||l.type==="html"||l.type==="json"||l.type==="csv")&&typeof l.content=="string"){if(!(l.type==="markdown"||l.type==="html"))return{content:l.content};const i=e.replace(/[/\\]/g,"/").split("/").slice(0,-1).join("/"),{refs:c}=je(l.content,i);if(c.length===0)return{content:l.content};const o=await Te(c,a);return o.size===0?{content:l.content}:{content:Ne(l.content,o),uploadedMedia:o.size}}if(l.type==="image"||l.type==="audio"||l.type==="video"||l.type==="binary"){const s=l.streamUrl||(l.path?N.files.streamUrl(l.path):N.files.streamUrl(e)),c=await(await fetch(s).then(f=>f.blob())).arrayBuffer(),o=new Uint8Array(c);let d="";const b=32768;for(let f=0;f<o.length;f+=b)d+=String.fromCharCode.apply(null,Array.from(o.subarray(f,f+b)));return{fileBase64:btoa(d)}}return{}}catch{return{}}}function Ee({item:e,onClose:t,onShared:a,service:l}){const{t:s}=de(["deliverables","common"]),i=u.useMemo(()=>l??ye(ue,R.getUrl()),[l]),[c,o]=u.useState(()=>i?i.isHubLoggedIn():null),[d,b]=u.useState(!1),[f,p]=u.useState(()=>{const n=e.shareStatus;return n==="published"?"published":n==="pending_review"?"pending_review":n==="rejected"?"rejected":"form"}),[m,M]=u.useState("public"),[H,ee]=u.useState(e.title||""),[E,te]=u.useState(e.summary||""),[x,L]=u.useState(Array.isArray(e.tags)?[...e.tags]:[]),[k,P]=u.useState(""),[A,re]=u.useState(null),[V,U]=u.useState(!1),[I,g]=u.useState(null),F=u.useRef(a);F.current=a;const y=u.useCallback(n=>{re(n);const h=n.status;p(h==="published"?"published":h==="rejected"?"rejected":h==="revoked"?"revoked":h==="pending_review"?"pending_review":"form"),F.current?.(n)},[]);u.useEffect(()=>{o(i.isHubLoggedIn())},[i]);const se=u.useCallback(async()=>{b(!0),g(null);try{await fe({force:!0}),o(i.isHubLoggedIn())}catch{o(i.isHubLoggedIn())}finally{b(!1)}},[i]),B=u.useCallback(()=>{const n=k.trim().replace(/^#/,"");n&&!x.includes(n)&&L(h=>[...h,n]),P("")},[k,x]),ae=u.useCallback(n=>{L(h=>h.filter(v=>v!==n))},[]),le=u.useCallback(n=>{n.key==="Enter"||n.key===","?(n.preventDefault(),B()):n.key==="Backspace"&&!k&&x.length&&L(h=>h.slice(0,-1))},[B,k,x.length]),D=u.useCallback(()=>{const n=A?.url??e.shareUrl;n&&navigator.clipboard?.writeText(n).then(()=>{U(!0),setTimeout(()=>U(!1),1500)}).catch(()=>{})},[A,e.shareUrl]),ne=u.useCallback(async()=>{if(!he(e.format)){g(`分享仅支持 ${[...q].join(" / ")} 格式`);return}g(null),p("busy");try{const n=e.reference.replace(/[/\\]/g,"/").split("/").pop()||"deliverable",h=R.getUrl(),{content:v,fileBase64:ie,uploadedMedia:z}=await Ce(e.reference,e.type,h);z&&console.info(`[deliverable-share] uploaded ${z} local media reference(s) to Hub`);const w=e.agentId??"";let O=w;if(w)try{const{agents:oe}=await N.agents.list({lean:!0}),K=oe.find(ce=>ce.id===w);K&&(O=K.name||w)}catch{}const j=await i.publish({localId:e.id,title:H.trim()||e.title,summary:E.trim(),tags:x,visibility:m,filename:n,format:e.format||"markdown",content:v,fileBase64:ie,producerAgent:{id:w,name:O,source:"local"}});y(j),j.status==="rejected"?g(typeof j.reason=="string"&&j.reason?j.reason:"分享被拒绝"):t()}catch(n){if(p("form"),n instanceof Q){o(!1);return}g(n instanceof S||n instanceof Error?n.message:String(n))}},[i,e,H,E,x,m,y]),_=u.useCallback(async()=>{g(null);try{const n=await i.revoke(e.id);y({...n,status:"revoked",url:null})}catch(n){g(n instanceof S?n.message:String(n))}},[i,e.id,y]),W=u.useCallback(()=>{p("form"),g(null)},[]);u.useEffect(()=>{if(f!=="pending_review")return;let n=!1;const h=setInterval(async()=>{try{const v=await i.pollStatus(e.id);if(n)return;v.status!=="pending_review"&&y(v)}catch{}},8e3);return()=>{n=!0,clearInterval(h)}},[f,i,e.id,y]),u.useEffect(()=>{const n=h=>{h.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]);const T=m==="link",C=A?.url??e.shareUrl;return r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:t,children:[r.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),r.jsxs("div",{className:"relative bg-surface-primary rounded-2xl shadow-2xl border border-border-default w-full max-w-md max-h-[85vh] overflow-y-auto",onClick:n=>n.stopPropagation(),children:[r.jsxs("div",{className:"sticky top-0 bg-surface-primary/95 backdrop-blur-sm border-b border-border-default px-5 py-4 flex items-center justify-between rounded-t-2xl z-10",children:[r.jsx("h3",{className:"text-base font-semibold text-fg-primary",children:s("deliverables:share.title",{defaultValue:"分享到 Markus Hub"})}),r.jsx("button",{onClick:t,className:"p-1.5 rounded-lg hover:bg-surface-overlay transition-colors text-fg-tertiary hover:text-fg-primary",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),r.jsx("div",{className:"px-5 py-4 space-y-4",children:c===!1?r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-amber-500/10 border border-amber-500/25 p-3",children:[r.jsx("span",{className:"text-lg",children:"🔑"}),r.jsx("p",{className:"text-sm text-fg-secondary",children:s("deliverables:share.needHubLogin",{defaultValue:"需登录 Markus Hub 账号后才能分享产出物。"})})]}),r.jsx("button",{onClick:()=>{se()},disabled:d,className:"w-full px-3 py-2 text-sm font-medium rounded-lg bg-brand-600 text-white hover:bg-brand-500 transition-colors disabled:opacity-60",children:d?s("deliverables:share.loggingIn",{defaultValue:"正在打开登录…"}):s("deliverables:share.loginHub",{defaultValue:"登录 Markus Hub 账号"})}),r.jsx("p",{className:"text-[11px] text-fg-tertiary",children:s("deliverables:share.loginHint",{defaultValue:"解锁后将支持一键公开/链接分享产出物。"})})]}):r.jsx(r.Fragment,{children:f==="published"?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"px-2 py-0.5 text-[11px] rounded-full bg-green-500/15 text-green-500 font-medium",children:s("deliverables:share.published",{defaultValue:"已发布"})}),r.jsx("span",{className:"text-[11px] text-fg-tertiary",children:m==="link"?s("deliverables:share.linkVisibility",{defaultValue:"有链接可见"}):s("deliverables:share.publicVisibility",{defaultValue:"公开"})})]}),C?r.jsxs("div",{className:"flex items-center gap-2 bg-surface-elevated rounded-lg px-3 py-2",children:[r.jsx("span",{className:"text-xs text-fg-secondary font-mono break-all flex-1 select-all",children:C}),r.jsx("button",{onClick:D,className:`px-2 py-1 text-[10px] rounded transition-colors shrink-0 ${V?"bg-green-500/20 text-green-500":"bg-brand-600/20 text-brand-500 hover:bg-brand-600/30"}`,children:V?s("common:copied",{defaultValue:"已复制"}):s("common:copy",{defaultValue:"复制链接"})})]}):r.jsx("p",{className:"text-xs text-fg-tertiary",children:s("deliverables:share.urlPending",{defaultValue:"链接生成中,稍后刷新查看…"})}),r.jsx("button",{onClick:()=>{_()},className:"w-full px-3 py-2 text-xs font-medium rounded-lg text-red-500 border border-red-500/30 hover:bg-red-500/10 transition-colors",children:s("deliverables:share.revoke",{defaultValue:"取消分享"})})]}):f==="pending_review"?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-500 animate-pulse"}),r.jsx("span",{className:"px-2 py-0.5 text-[11px] rounded-full bg-amber-500/15 text-amber-500 font-medium",children:s("deliverables:share.pendingReview",{defaultValue:"审核中"})}),r.jsx("span",{className:"text-[11px] text-fg-tertiary",children:m==="link"?s("deliverables:share.linkVisibility",{defaultValue:"有链接可见"}):s("deliverables:share.publicVisibility",{defaultValue:"公开"})})]}),r.jsx("p",{className:"text-sm text-fg-secondary",children:s("deliverables:share.pendingHint",{defaultValue:"你的产出物已公开,其他人现在就能通过链接访问。管理员审核通过后,内容将进入搜索引擎收录。"})}),C?r.jsxs("div",{className:"flex items-center gap-2 bg-surface-elevated rounded-lg px-3 py-2",children:[r.jsx("span",{className:"text-xs text-fg-secondary font-mono break-all flex-1 select-all",children:C}),r.jsx("button",{onClick:D,className:`px-2 py-1 text-[10px] rounded transition-colors shrink-0 ${V?"bg-green-500/20 text-green-500":"bg-brand-600/20 text-brand-500 hover:bg-brand-600/30"}`,children:V?s("common:copied",{defaultValue:"已复制"}):s("common:copy",{defaultValue:"复制链接"})})]}):null,r.jsx("button",{onClick:()=>{_()},className:"w-full px-3 py-2 text-xs font-medium rounded-lg text-red-500 border border-red-500/30 hover:bg-red-500/10 transition-colors",children:s("deliverables:share.revoke",{defaultValue:"取消分享"})})]}):f==="rejected"?r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex items-center gap-2",children:r.jsx("span",{className:"px-2 py-0.5 text-[11px] rounded-full bg-red-500/15 text-red-500 font-medium",children:s("deliverables:share.rejected",{defaultValue:"已拒绝"})})}),I&&r.jsx("div",{className:"rounded-lg bg-red-500/10 border border-red-500/25 px-3 py-2 text-xs text-red-500",children:I}),r.jsx("button",{onClick:W,className:"w-full px-3 py-2 text-sm font-medium rounded-lg bg-brand-600 text-white hover:bg-brand-500 transition-colors",children:s("deliverables:share.resubmit",{defaultValue:"重新提交"})})]}):f==="revoked"?r.jsxs("div",{className:"space-y-3",children:[r.jsx("p",{className:"text-sm text-fg-secondary",children:s("deliverables:share.revoked",{defaultValue:"已取消分享,该产出物不再公开可访问。"})}),r.jsx("button",{onClick:W,className:"w-full px-3 py-2 text-sm font-medium rounded-lg bg-brand-600 text-white hover:bg-brand-500 transition-colors",children:s("deliverables:share.shareAgain",{defaultValue:"重新分享"})})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider font-medium",children:s("deliverables:share.visibility",{defaultValue:"可见性"})}),r.jsxs("label",{className:`flex items-start gap-3 rounded-xl border p-3 cursor-pointer transition-colors ${T?"border-border-default hover:bg-surface-elevated":"border-brand-500/50 bg-brand-500/5"}`,children:[r.jsx("input",{type:"radio",name:"visibility",checked:!T,onChange:()=>M("public"),className:"mt-0.5 accent-brand-500"}),r.jsxs("span",{className:"space-y-0.5",children:[r.jsx("span",{className:"block text-sm font-medium text-fg-primary",children:s("deliverables:share.public",{defaultValue:"公开(所有人可见 + 搜索引擎)"})}),r.jsx("span",{className:"block text-[11px] text-fg-tertiary",children:s("deliverables:share.publicHint",{defaultValue:"公开产出物需经 Hub 审核后发布,发布后所有人可见并参与搜索"})})]})]}),r.jsxs("label",{className:`flex items-start gap-3 rounded-xl border p-3 cursor-pointer transition-colors ${T?"border-brand-500/50 bg-brand-500/5":"border-border-default hover:bg-surface-elevated"}`,children:[r.jsx("input",{type:"radio",name:"visibility",checked:T,onChange:()=>M("link"),className:"mt-0.5 accent-brand-500"}),r.jsxs("span",{className:"space-y-0.5",children:[r.jsx("span",{className:"block text-sm font-medium text-fg-primary",children:s("deliverables:share.link",{defaultValue:"有链接可见"})}),r.jsx("span",{className:"block text-[11px] text-fg-tertiary",children:s("deliverables:share.linkHint",{defaultValue:"仅获得链接的人可查看,不参与搜索引擎;同样需经 Hub 审核"})})]})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider font-medium",children:s("deliverables:share.titleField",{defaultValue:"标题"})}),r.jsx("input",{value:H,onChange:n=>ee(n.target.value),placeholder:s("deliverables:share.titlePlaceholder",{defaultValue:"清晰、可检索的标题"}),className:"w-full px-3 py-2 text-sm rounded-lg bg-surface-elevated border border-border-default focus:border-brand-500/60 outline-none"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider font-medium",children:s("deliverables:share.summary",{defaultValue:"摘要"})}),r.jsx("textarea",{value:E,onChange:n=>te(n.target.value),rows:3,placeholder:s("deliverables:share.summaryPlaceholder",{defaultValue:"简要描述该产出物…"}),className:"w-full px-3 py-2 text-sm rounded-lg bg-surface-elevated border border-border-default focus:border-brand-500/60 outline-none resize-y"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider font-medium",children:s("deliverables:share.tags",{defaultValue:"标签"})}),r.jsx("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:x.map(n=>r.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[11px] bg-surface-elevated rounded-md text-fg-secondary",children:[n,r.jsx("button",{onClick:()=>ae(n),className:"text-fg-tertiary hover:text-red-500","aria-label":"remove",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},n))}),r.jsx("input",{value:k,onChange:n=>P(n.target.value),onKeyDown:le,onBlur:B,placeholder:s("deliverables:share.tagsPlaceholder",{defaultValue:"输入标签后回车添加"}),className:"w-full px-3 py-2 text-sm rounded-lg bg-surface-elevated border border-border-default focus:border-brand-500/60 outline-none"})]}),I&&r.jsx("div",{className:"rounded-lg bg-red-500/10 border border-red-500/25 px-3 py-2 text-xs text-red-500",children:I}),r.jsxs("button",{type:"button",onClick:()=>{ne()},disabled:f==="busy"||!H.trim(),className:"w-full px-3 py-2.5 text-sm font-medium rounded-lg bg-brand-600 text-white hover:bg-brand-500 transition-colors disabled:opacity-60 flex items-center justify-center gap-2",children:[f==="busy"&&r.jsxs("svg",{className:"animate-spin",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),r.jsx("path",{d:"M22 12a10 10 0 0 0-10-10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),f==="busy"?s("deliverables:share.sharing",{defaultValue:"分享中…"}):s("deliverables:share.shareToHub",{defaultValue:"分享到 Hub"})]})]})})})]})]})}export{Ee as D,he as a,ye as c};
|
|
1
|
+
import{u as de,r as u,h as R,o as ue,v as fe,l as N,j as r}from"./index-Ci5bUF3m.js";const G=50*1024*1024,q=new Set(["markdown","html"]);function be(e){return e||"markdown"}function he(e){return q.has(be(e))}class S extends Error{constructor(t){super(t),this.name="DeliverableShareError"}}class Q extends S{constructor(){super("需要登录 Markus Hub 账号后才能分享产出物。"),this.name="NotLoggedIntoHubError"}}class pe extends S{bytes;limit;constructor(t,a){super(`产出物文件大小 ${t} 字节超过上限 ${a} 字节(50MB),请压缩或拒绝分享。`),this.name="DeliverableTooLargeError",this.bytes=t,this.limit=a}}class me extends S{status;constructor(t,a){super(`Hub 请求失败 (HTTP ${t}): ${a}`),this.name="HubApiError",this.status=t}}function ge(e){const t=e.replace(/\s+/g,"");if(!t)return 0;let a=0;return t.endsWith("==")?a=2:t.endsWith("=")&&(a=1),Math.floor(t.length*3/4)-a}function $(e,t){const a=e&&typeof e=="object"?e:{},l=a.share??a.deliverable??{},s=m=>a[m]??l[m],i=s("id")??s("shareId")??"",c=s("slug"),o=c!=null?String(c):void 0,d=s("url")??s("shareUrl");let b=null;d!=null?b=String(d):o&&t&&(b=`${t.replace(/\/+$/,"")}/deliverable/${encodeURIComponent(o)}`);const f=s("reason")??s("rejectNote"),p=s("localDeliverableId")??s("localId");return{id:String(i),slug:o,visibility:s("visibility")??"public",status:s("status")??"pending_review",url:b,reason:f!=null?String(f):null,localId:p!=null?String(p):null}}class xe{basePath;fetchImpl;hubOrigin;constructor(t){this.getHubToken=t.getHubToken,this.hubOrigin=t.hubUrl,this.basePath=(t.proxyBasePath??"/api/hub").replace(/\/+$/,""),this.fetchImpl=t.fetch??(globalThis.fetch?globalThis.fetch.bind(globalThis):(()=>{throw new Error("fetch unavailable")}))}getHubToken;isHubLoggedIn(){return!!this.getHubToken()}assertHubLoggedIn(){if(!this.getHubToken())throw new Q}async doFetch(t,a){const l=this.getHubToken(),s={"Content-Type":"application/json",...a.headers};l&&(s.Authorization=`Bearer ${l}`);const i=await this.fetchImpl(`${this.basePath}${t}`,{...a,headers:s,credentials:"include"});let c=null;try{c=await i.json()}catch{c=null}if(!i.ok){const o=c&&typeof c=="object"&&"error"in c?String(c.error):i.statusText||`HTTP ${i.status}`;throw new me(i.status,o)}return{status:i.status,data:c}}async publish(t){this.assertHubLoggedIn();const a=t.fileSizeBytes??(t.fileBase64?ge(t.fileBase64):0);if(a>G)throw new pe(a,G);const l={localDeliverableId:t.localId,visibility:t.visibility,title:t.title,summary:t.summary,tags:t.tags,filename:t.filename,format:t.format,producerAgent:{id:t.producerAgent.id,name:t.producerAgent.name,source:t.producerAgent.source}};t.content&&(l.content=t.content),t.fileBase64&&(l.fileBase64=t.fileBase64);const{data:s}=await this.doFetch("/deliverables/publish",{method:"POST",body:JSON.stringify(l)});return $(s,this.hubOrigin)}async pollStatus(t){this.assertHubLoggedIn();const{data:a}=await this.doFetch(`/deliverables/status?localId=${encodeURIComponent(t)}`,{method:"GET"});return $(a,this.hubOrigin)}async listMine(){this.assertHubLoggedIn();const{data:t}=await this.doFetch("/deliverables/mine",{method:"GET"}),a=t&&typeof t=="object"?t:{};return(Array.isArray(a.shares)?a.shares:[]).map(s=>$(s,this.hubOrigin))}async revoke(t){this.assertHubLoggedIn();const{data:a}=await this.doFetch("/deliverables/revoke",{method:"POST",body:JSON.stringify({localId:t})});return{...$(a,this.hubOrigin),status:"revoked",url:null}}}function ye(e,t){return new xe({getHubToken:e,hubUrl:t,proxyBasePath:"/api/hub"})}const ve=/\.(png|jpe?g|gif|webp|svg|bmp|avif|ico)$/i,ke=/\.(mp4|webm|mp3|wav|ogg|m4a|mov|avi|mkv|flac)$/i;function X(e){return ve.test(e)?"image":ke.test(e)?"media":"other"}function we(e){return e.replace(/^file:\/\//i,"").replace(/^file:/i,"")}function J(e){const t=e.match(/!?\[[^\]]*\]\(([^)]+)\)/);if(t)return t[1].trim().split(/\s+(?="|')/)[0].trim()||null;const a=e.match(/(?:src|href|poster)\s*=\s*["']([^"']+)["']/i);return a?a[1]:null}function Z(e){return!e||/^(https?:|data:|mailto:|tel:|#)/i.test(e)||e.startsWith("//")?!1:(e.startsWith("/api/files/"),!0)}function Y(e,t){if(!e)return null;const a=e.trim(),l=a.match(/^\/api\/files\/(?:image|stream|preview)\?path=([^&]+)/i);if(l)try{return decodeURIComponent(l[1])||null}catch{return l[1]||null}return/^file:\/\//i.test(a)?we(a).replace(/\\/g,"/"):/^[a-zA-Z]:[\\/]/.test(a)?a.replace(/\\/g,"/"):a.startsWith("/")?a:t&&(a.startsWith("./")||a.startsWith("../")||!a.includes("://"))?`${t.replace(/\\/g,"/").replace(/\/+$/,"")}/${a.replace(/^\.\//,"").replace(/\\/g,"/")}`:null}function je(e,t){const a=[],l=new Set,s=/!?\[[^\]]*\]\(([^)\s]+(?:\s+["'][^"']*["'])?)\)/g;for(const c of e.matchAll(s)){const o=c[0],d=J(o);if(!d||!Z(d))continue;const b=Y(d,t);!b||l.has(o)||(l.add(o),a.push({raw:o,localPath:b,kind:X(b.split("?")[0])}))}const i=/<[a-zA-Z][^>]*(?:src|href|poster)\s*=\s*["'][^"']+["'][^>]*>/gi;for(const c of e.matchAll(i)){const o=c[0],d=J(o);if(!d||!Z(d))continue;const b=Y(d,t);!b||l.has(o)||(l.add(o),a.push({raw:o,localPath:b,kind:X(b.split("?")[0])}))}return{refs:a,baseDir:t??""}}function Ne(e,t){let a=e;for(const[l,s]of t){const i=Se(l,s);a=a.split(l).join(i)}return a}function Se(e,t){const a=e.match(/^(!?\[[^\]]*\])\([^)]*\)$/);if(a)return`${a[1]}(${t})`;const l=e.match(/(src|href|poster)(\s*=\s*)(["'])[^"']*\3/i);return l?e.replace(/(src|href|poster)(\s*=\s*)(["'])[^"']*\3/i,`${l[1]}${l[2]}${l[3]}${t}${l[3]}`):t}function He(e,t){return/^https?:\/\//i.test(e)?e:`${t.replace(/\/+$/,"")}${e.startsWith("/")?"":"/"}${e}`}function Ve(e,t,a){const l=new Map,s=new Map(e.map(i=>[i.localPath,i]));for(const i of t){if(!i.key)continue;const c=s.get(i.key);!c||!i.url||l.set(c.raw,He(i.url,a))}return l}async function Ie(e){try{const t=N.files.streamUrl(e),a=await fetch(t).then(d=>d.ok?d.blob():null);if(!a)return null;const l=await a.arrayBuffer(),s=new Uint8Array(l);let i="";const c=32768;for(let d=0;d<s.length;d+=c)i+=String.fromCharCode.apply(null,Array.from(s.subarray(d,d+c)));const o=e.split("/").pop()||"media";return{base64:btoa(i),filename:o}}catch{return null}}async function Te(e,t){const a=new Map;if(e.length===0)return a;const l=[];for(const c of e){const o=await Ie(c.localPath);o&&l.push({key:c.localPath,filename:o.filename,base64:o.base64})}if(l.length===0)return a;const{files:s,errors:i}=await R.uploadMediaBatch(l);return i.length>0&&console.warn("[deliverable-share] media upload errors:",i),Ve(e,s,t)}async function Ce(e,t,a){if(!e||t==="directory"||e.startsWith("http://")||e.startsWith("https://"))return{};try{const l=await N.files.preview(e);if((l.type==="text"||l.type==="markdown"||l.type==="html"||l.type==="json"||l.type==="csv")&&typeof l.content=="string"){if(!(l.type==="markdown"||l.type==="html"))return{content:l.content};const i=e.replace(/[/\\]/g,"/").split("/").slice(0,-1).join("/"),{refs:c}=je(l.content,i);if(c.length===0)return{content:l.content};const o=await Te(c,a);return o.size===0?{content:l.content}:{content:Ne(l.content,o),uploadedMedia:o.size}}if(l.type==="image"||l.type==="audio"||l.type==="video"||l.type==="binary"){const s=l.streamUrl||(l.path?N.files.streamUrl(l.path):N.files.streamUrl(e)),c=await(await fetch(s).then(f=>f.blob())).arrayBuffer(),o=new Uint8Array(c);let d="";const b=32768;for(let f=0;f<o.length;f+=b)d+=String.fromCharCode.apply(null,Array.from(o.subarray(f,f+b)));return{fileBase64:btoa(d)}}return{}}catch{return{}}}function Ee({item:e,onClose:t,onShared:a,service:l}){const{t:s}=de(["deliverables","common"]),i=u.useMemo(()=>l??ye(ue,R.getUrl()),[l]),[c,o]=u.useState(()=>i?i.isHubLoggedIn():null),[d,b]=u.useState(!1),[f,p]=u.useState(()=>{const n=e.shareStatus;return n==="published"?"published":n==="pending_review"?"pending_review":n==="rejected"?"rejected":"form"}),[m,M]=u.useState("public"),[H,ee]=u.useState(e.title||""),[E,te]=u.useState(e.summary||""),[x,L]=u.useState(Array.isArray(e.tags)?[...e.tags]:[]),[k,P]=u.useState(""),[A,re]=u.useState(null),[V,U]=u.useState(!1),[I,g]=u.useState(null),F=u.useRef(a);F.current=a;const y=u.useCallback(n=>{re(n);const h=n.status;p(h==="published"?"published":h==="rejected"?"rejected":h==="revoked"?"revoked":h==="pending_review"?"pending_review":"form"),F.current?.(n)},[]);u.useEffect(()=>{o(i.isHubLoggedIn())},[i]);const se=u.useCallback(async()=>{b(!0),g(null);try{await fe({force:!0}),o(i.isHubLoggedIn())}catch{o(i.isHubLoggedIn())}finally{b(!1)}},[i]),B=u.useCallback(()=>{const n=k.trim().replace(/^#/,"");n&&!x.includes(n)&&L(h=>[...h,n]),P("")},[k,x]),ae=u.useCallback(n=>{L(h=>h.filter(v=>v!==n))},[]),le=u.useCallback(n=>{n.key==="Enter"||n.key===","?(n.preventDefault(),B()):n.key==="Backspace"&&!k&&x.length&&L(h=>h.slice(0,-1))},[B,k,x.length]),D=u.useCallback(()=>{const n=A?.url??e.shareUrl;n&&navigator.clipboard?.writeText(n).then(()=>{U(!0),setTimeout(()=>U(!1),1500)}).catch(()=>{})},[A,e.shareUrl]),ne=u.useCallback(async()=>{if(!he(e.format)){g(`分享仅支持 ${[...q].join(" / ")} 格式`);return}g(null),p("busy");try{const n=e.reference.replace(/[/\\]/g,"/").split("/").pop()||"deliverable",h=R.getUrl(),{content:v,fileBase64:ie,uploadedMedia:z}=await Ce(e.reference,e.type,h);z&&console.info(`[deliverable-share] uploaded ${z} local media reference(s) to Hub`);const w=e.agentId??"";let O=w;if(w)try{const{agents:oe}=await N.agents.list({lean:!0}),K=oe.find(ce=>ce.id===w);K&&(O=K.name||w)}catch{}const j=await i.publish({localId:e.id,title:H.trim()||e.title,summary:E.trim(),tags:x,visibility:m,filename:n,format:e.format||"markdown",content:v,fileBase64:ie,producerAgent:{id:w,name:O,source:"local"}});y(j),j.status==="rejected"?g(typeof j.reason=="string"&&j.reason?j.reason:"分享被拒绝"):t()}catch(n){if(p("form"),n instanceof Q){o(!1);return}g(n instanceof S||n instanceof Error?n.message:String(n))}},[i,e,H,E,x,m,y]),_=u.useCallback(async()=>{g(null);try{const n=await i.revoke(e.id);y({...n,status:"revoked",url:null})}catch(n){g(n instanceof S?n.message:String(n))}},[i,e.id,y]),W=u.useCallback(()=>{p("form"),g(null)},[]);u.useEffect(()=>{if(f!=="pending_review")return;let n=!1;const h=setInterval(async()=>{try{const v=await i.pollStatus(e.id);if(n)return;v.status!=="pending_review"&&y(v)}catch{}},8e3);return()=>{n=!0,clearInterval(h)}},[f,i,e.id,y]),u.useEffect(()=>{const n=h=>{h.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]);const T=m==="link",C=A?.url??e.shareUrl;return r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:t,children:[r.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),r.jsxs("div",{className:"relative bg-surface-primary rounded-2xl shadow-2xl border border-border-default w-full max-w-md max-h-[85vh] overflow-y-auto",onClick:n=>n.stopPropagation(),children:[r.jsxs("div",{className:"sticky top-0 bg-surface-primary/95 backdrop-blur-sm border-b border-border-default px-5 py-4 flex items-center justify-between rounded-t-2xl z-10",children:[r.jsx("h3",{className:"text-base font-semibold text-fg-primary",children:s("deliverables:share.title",{defaultValue:"分享到 Markus Hub"})}),r.jsx("button",{onClick:t,className:"p-1.5 rounded-lg hover:bg-surface-overlay transition-colors text-fg-tertiary hover:text-fg-primary",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),r.jsx("div",{className:"px-5 py-4 space-y-4",children:c===!1?r.jsxs("div",{className:"space-y-4 py-2",children:[r.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-amber-500/10 border border-amber-500/25 p-3",children:[r.jsx("span",{className:"text-lg",children:"🔑"}),r.jsx("p",{className:"text-sm text-fg-secondary",children:s("deliverables:share.needHubLogin",{defaultValue:"需登录 Markus Hub 账号后才能分享产出物。"})})]}),r.jsx("button",{onClick:()=>{se()},disabled:d,className:"w-full px-3 py-2 text-sm font-medium rounded-lg bg-brand-600 text-white hover:bg-brand-500 transition-colors disabled:opacity-60",children:d?s("deliverables:share.loggingIn",{defaultValue:"正在打开登录…"}):s("deliverables:share.loginHub",{defaultValue:"登录 Markus Hub 账号"})}),r.jsx("p",{className:"text-[11px] text-fg-tertiary",children:s("deliverables:share.loginHint",{defaultValue:"解锁后将支持一键公开/链接分享产出物。"})})]}):r.jsx(r.Fragment,{children:f==="published"?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"px-2 py-0.5 text-[11px] rounded-full bg-green-500/15 text-green-500 font-medium",children:s("deliverables:share.published",{defaultValue:"已发布"})}),r.jsx("span",{className:"text-[11px] text-fg-tertiary",children:m==="link"?s("deliverables:share.linkVisibility",{defaultValue:"有链接可见"}):s("deliverables:share.publicVisibility",{defaultValue:"公开"})})]}),C?r.jsxs("div",{className:"flex items-center gap-2 bg-surface-elevated rounded-lg px-3 py-2",children:[r.jsx("span",{className:"text-xs text-fg-secondary font-mono break-all flex-1 select-all",children:C}),r.jsx("button",{onClick:D,className:`px-2 py-1 text-[10px] rounded transition-colors shrink-0 ${V?"bg-green-500/20 text-green-500":"bg-brand-600/20 text-brand-500 hover:bg-brand-600/30"}`,children:V?s("common:copied",{defaultValue:"已复制"}):s("common:copy",{defaultValue:"复制链接"})})]}):r.jsx("p",{className:"text-xs text-fg-tertiary",children:s("deliverables:share.urlPending",{defaultValue:"链接生成中,稍后刷新查看…"})}),r.jsx("button",{onClick:()=>{_()},className:"w-full px-3 py-2 text-xs font-medium rounded-lg text-red-500 border border-red-500/30 hover:bg-red-500/10 transition-colors",children:s("deliverables:share.revoke",{defaultValue:"取消分享"})})]}):f==="pending_review"?r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-500 animate-pulse"}),r.jsx("span",{className:"px-2 py-0.5 text-[11px] rounded-full bg-amber-500/15 text-amber-500 font-medium",children:s("deliverables:share.pendingReview",{defaultValue:"审核中"})}),r.jsx("span",{className:"text-[11px] text-fg-tertiary",children:m==="link"?s("deliverables:share.linkVisibility",{defaultValue:"有链接可见"}):s("deliverables:share.publicVisibility",{defaultValue:"公开"})})]}),r.jsx("p",{className:"text-sm text-fg-secondary",children:s("deliverables:share.pendingHint",{defaultValue:"你的产出物已公开,其他人现在就能通过链接访问。管理员审核通过后,内容将进入搜索引擎收录。"})}),C?r.jsxs("div",{className:"flex items-center gap-2 bg-surface-elevated rounded-lg px-3 py-2",children:[r.jsx("span",{className:"text-xs text-fg-secondary font-mono break-all flex-1 select-all",children:C}),r.jsx("button",{onClick:D,className:`px-2 py-1 text-[10px] rounded transition-colors shrink-0 ${V?"bg-green-500/20 text-green-500":"bg-brand-600/20 text-brand-500 hover:bg-brand-600/30"}`,children:V?s("common:copied",{defaultValue:"已复制"}):s("common:copy",{defaultValue:"复制链接"})})]}):null,r.jsx("button",{onClick:()=>{_()},className:"w-full px-3 py-2 text-xs font-medium rounded-lg text-red-500 border border-red-500/30 hover:bg-red-500/10 transition-colors",children:s("deliverables:share.revoke",{defaultValue:"取消分享"})})]}):f==="rejected"?r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"flex items-center gap-2",children:r.jsx("span",{className:"px-2 py-0.5 text-[11px] rounded-full bg-red-500/15 text-red-500 font-medium",children:s("deliverables:share.rejected",{defaultValue:"已拒绝"})})}),I&&r.jsx("div",{className:"rounded-lg bg-red-500/10 border border-red-500/25 px-3 py-2 text-xs text-red-500",children:I}),r.jsx("button",{onClick:W,className:"w-full px-3 py-2 text-sm font-medium rounded-lg bg-brand-600 text-white hover:bg-brand-500 transition-colors",children:s("deliverables:share.resubmit",{defaultValue:"重新提交"})})]}):f==="revoked"?r.jsxs("div",{className:"space-y-3",children:[r.jsx("p",{className:"text-sm text-fg-secondary",children:s("deliverables:share.revoked",{defaultValue:"已取消分享,该产出物不再公开可访问。"})}),r.jsx("button",{onClick:W,className:"w-full px-3 py-2 text-sm font-medium rounded-lg bg-brand-600 text-white hover:bg-brand-500 transition-colors",children:s("deliverables:share.shareAgain",{defaultValue:"重新分享"})})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider font-medium",children:s("deliverables:share.visibility",{defaultValue:"可见性"})}),r.jsxs("label",{className:`flex items-start gap-3 rounded-xl border p-3 cursor-pointer transition-colors ${T?"border-border-default hover:bg-surface-elevated":"border-brand-500/50 bg-brand-500/5"}`,children:[r.jsx("input",{type:"radio",name:"visibility",checked:!T,onChange:()=>M("public"),className:"mt-0.5 accent-brand-500"}),r.jsxs("span",{className:"space-y-0.5",children:[r.jsx("span",{className:"block text-sm font-medium text-fg-primary",children:s("deliverables:share.public",{defaultValue:"公开(所有人可见 + 搜索引擎)"})}),r.jsx("span",{className:"block text-[11px] text-fg-tertiary",children:s("deliverables:share.publicHint",{defaultValue:"公开产出物需经 Hub 审核后发布,发布后所有人可见并参与搜索"})})]})]}),r.jsxs("label",{className:`flex items-start gap-3 rounded-xl border p-3 cursor-pointer transition-colors ${T?"border-brand-500/50 bg-brand-500/5":"border-border-default hover:bg-surface-elevated"}`,children:[r.jsx("input",{type:"radio",name:"visibility",checked:T,onChange:()=>M("link"),className:"mt-0.5 accent-brand-500"}),r.jsxs("span",{className:"space-y-0.5",children:[r.jsx("span",{className:"block text-sm font-medium text-fg-primary",children:s("deliverables:share.link",{defaultValue:"有链接可见"})}),r.jsx("span",{className:"block text-[11px] text-fg-tertiary",children:s("deliverables:share.linkHint",{defaultValue:"仅获得链接的人可查看,不参与搜索引擎;同样需经 Hub 审核"})})]})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider font-medium",children:s("deliverables:share.titleField",{defaultValue:"标题"})}),r.jsx("input",{value:H,onChange:n=>ee(n.target.value),placeholder:s("deliverables:share.titlePlaceholder",{defaultValue:"清晰、可检索的标题"}),className:"w-full px-3 py-2 text-sm rounded-lg bg-surface-elevated border border-border-default focus:border-brand-500/60 outline-none"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider font-medium",children:s("deliverables:share.summary",{defaultValue:"摘要"})}),r.jsx("textarea",{value:E,onChange:n=>te(n.target.value),rows:3,placeholder:s("deliverables:share.summaryPlaceholder",{defaultValue:"简要描述该产出物…"}),className:"w-full px-3 py-2 text-sm rounded-lg bg-surface-elevated border border-border-default focus:border-brand-500/60 outline-none resize-y"})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider font-medium",children:s("deliverables:share.tags",{defaultValue:"标签"})}),r.jsx("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:x.map(n=>r.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[11px] bg-surface-elevated rounded-md text-fg-secondary",children:[n,r.jsx("button",{onClick:()=>ae(n),className:"text-fg-tertiary hover:text-red-500","aria-label":"remove",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},n))}),r.jsx("input",{value:k,onChange:n=>P(n.target.value),onKeyDown:le,onBlur:B,placeholder:s("deliverables:share.tagsPlaceholder",{defaultValue:"输入标签后回车添加"}),className:"w-full px-3 py-2 text-sm rounded-lg bg-surface-elevated border border-border-default focus:border-brand-500/60 outline-none"})]}),I&&r.jsx("div",{className:"rounded-lg bg-red-500/10 border border-red-500/25 px-3 py-2 text-xs text-red-500",children:I}),r.jsxs("button",{type:"button",onClick:()=>{ne()},disabled:f==="busy"||!H.trim(),className:"w-full px-3 py-2.5 text-sm font-medium rounded-lg bg-brand-600 text-white hover:bg-brand-500 transition-colors disabled:opacity-60 flex items-center justify-center gap-2",children:[f==="busy"&&r.jsxs("svg",{className:"animate-spin",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),r.jsx("path",{d:"M22 12a10 10 0 0 0-10-10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),f==="busy"?s("deliverables:share.sharing",{defaultValue:"分享中…"}):s("deliverables:share.shareToHub",{defaultValue:"分享到 Hub"})]})]})})})]})]})}export{Ee as D,he as a,ye as c};
|