@seele00/seele-work 0.1.172 → 0.1.174

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.
Files changed (71) hide show
  1. package/libexec/seele-server +0 -0
  2. package/libexec/seele-worker +0 -0
  3. package/libexec/seele-workspace-observe +0 -0
  4. package/package.json +1 -1
  5. package/release-manifest.json +130 -130
  6. package/web/dist/assets/{abnfDiagram-VRR7QNED-DcsVlwC0.js → abnfDiagram-VRR7QNED-Qananxz0.js} +1 -1
  7. package/web/dist/assets/{arc-D6gLv5dc.js → arc-tBvSIOOM.js} +1 -1
  8. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-Ch6e4fy6.js → architectureDiagram-ZJ3FMSHR-BUtFp6SB.js} +1 -1
  9. package/web/dist/assets/{blockDiagram-677ZJIJ3-Dslobgei.js → blockDiagram-677ZJIJ3-CAwu2iad.js} +1 -1
  10. package/web/dist/assets/{c4Diagram-LMCZKHZV-D-s9Zf13.js → c4Diagram-LMCZKHZV-CpMY2_Jh.js} +1 -1
  11. package/web/dist/assets/channel-BI6D8Qw8.js +1 -0
  12. package/web/dist/assets/{chunk-2Q5K7J3B-ByZCU7qe.js → chunk-2Q5K7J3B-BAuTbAmL.js} +1 -1
  13. package/web/dist/assets/{chunk-32BRIVSS-DnbCxZKU.js → chunk-32BRIVSS-B_RdqhOh.js} +1 -1
  14. package/web/dist/assets/{chunk-5VM5RSS4-xz7bwfKC.js → chunk-5VM5RSS4-DjxaL8oH.js} +1 -1
  15. package/web/dist/assets/{chunk-EX3LRPZG-DdbGnsHi.js → chunk-EX3LRPZG-BU01bjpv.js} +1 -1
  16. package/web/dist/assets/{chunk-JWPE2WC7-C_ro6dQT.js → chunk-JWPE2WC7-Cqm65zvR.js} +1 -1
  17. package/web/dist/assets/{chunk-MOJQB5TN-CgJCxQxw.js → chunk-MOJQB5TN-CVJpYSdB.js} +1 -1
  18. package/web/dist/assets/{chunk-RYQCIY6F-CcKdIajS.js → chunk-RYQCIY6F-DinifCH0.js} +1 -1
  19. package/web/dist/assets/{chunk-V7JOEXUC-DxRtmAyR.js → chunk-V7JOEXUC-BS84cy_B.js} +1 -1
  20. package/web/dist/assets/{chunk-VR4S4FIN-Gr8MWTlj.js → chunk-VR4S4FIN-NkMaTbdy.js} +1 -1
  21. package/web/dist/assets/{chunk-XXDRQBXY-nXIWUIQh.js → chunk-XXDRQBXY-C0dcKRA_.js} +1 -1
  22. package/web/dist/assets/classDiagram-OUVF2IWQ-COi7rjx3.js +1 -0
  23. package/web/dist/assets/classDiagram-v2-EOCWNBFH-COi7rjx3.js +1 -0
  24. package/web/dist/assets/{core-CmCfnvUq.js → core-BEunYH2A.js} +1 -1
  25. package/web/dist/assets/{cose-bilkent-JH36ORCC-Do6LNJPP.js → cose-bilkent-JH36ORCC-GYdLrako.js} +1 -1
  26. package/web/dist/assets/{cynefin-VYW2F7L2-Cbx6g0Vv.js → cynefin-VYW2F7L2-CsrLDAgF.js} +1 -1
  27. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-BpTFfN7V.js → cynefinDiagram-TSTJHNR4-BrIvXwGI.js} +1 -1
  28. package/web/dist/assets/{dagre-VKFMJZFB-CW_qrn_l.js → dagre-VKFMJZFB-CWRqtFhe.js} +1 -1
  29. package/web/dist/assets/{diagram-FQU43EPY-CQdCny_i.js → diagram-FQU43EPY-Cu-YiwmD.js} +1 -1
  30. package/web/dist/assets/{diagram-G47NLZAW-SHzV10NQ.js → diagram-G47NLZAW-CaHi4une.js} +1 -1
  31. package/web/dist/assets/{diagram-NH7WQ7WH-CK8dJMhc.js → diagram-NH7WQ7WH-St04Uzoe.js} +1 -1
  32. package/web/dist/assets/{diagram-OA4YK3LP-SbpV5Gf9.js → diagram-OA4YK3LP-BgvuhVU1.js} +1 -1
  33. package/web/dist/assets/{diagram-WEI45ONY-BMJHeStz.js → diagram-WEI45ONY-AXCMouWy.js} +1 -1
  34. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-CeEsnwk_.js → ebnfDiagram-CCIWWBDH-lhOqIvif.js} +1 -1
  35. package/web/dist/assets/{elk.bundled-B6aSvDDf.js → elk.bundled-BRvn4fy1.js} +1 -1
  36. package/web/dist/assets/{erDiagram-Q63AITRT-C3VNsmH7.js → erDiagram-Q63AITRT-D0ekhlvy.js} +1 -1
  37. package/web/dist/assets/{flowDiagram-23GEKE2U-ChLmOiiW.js → flowDiagram-23GEKE2U-KDAgAAnk.js} +1 -1
  38. package/web/dist/assets/{ganttDiagram-NO4QXBWP-CTvo9ubC.js → ganttDiagram-NO4QXBWP-CMjRp9f0.js} +1 -1
  39. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-BWPmL-v8.js → gitGraphDiagram-IHSO6WYX-SgHPh46n.js} +1 -1
  40. package/web/dist/assets/index--dv-zWc4.css +1 -0
  41. package/web/dist/assets/{index-CFBO55xn.js → index-Cu2P6KUt.js} +2 -2
  42. package/web/dist/assets/{infoDiagram-FWYZ7A6U-B7WthcSy.js → infoDiagram-FWYZ7A6U-CZZ9X-6B.js} +1 -1
  43. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-BoXUiS47.js → ishikawaDiagram-FXEZZL3T-BpdIAfYC.js} +1 -1
  44. package/web/dist/assets/{journeyDiagram-5HDEW3XC-ChhYhMty.js → journeyDiagram-5HDEW3XC-wsHGhsvi.js} +1 -1
  45. package/web/dist/assets/{kanban-definition-HUTT4EX6-aL3A-SoA.js → kanban-definition-HUTT4EX6-BWS2ax4h.js} +1 -1
  46. package/web/dist/assets/{linear-BR9WIf7Z.js → linear-Btkor1mU.js} +1 -1
  47. package/web/dist/assets/{mermaid.core-Cd9bNu3p.js → mermaid.core-BDzJfNJw.js} +5 -5
  48. package/web/dist/assets/{mindmap-definition-LN4V7U3C-_2WU5Xvg.js → mindmap-definition-LN4V7U3C-e2rKTNIt.js} +1 -1
  49. package/web/dist/assets/{pegDiagram-2B236MQR-DamWNN2T.js → pegDiagram-2B236MQR-cNSMiR0d.js} +1 -1
  50. package/web/dist/assets/{pieDiagram-ENE6RG2P-HqYCgp_J.js → pieDiagram-ENE6RG2P-D61NEihi.js} +1 -1
  51. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-PImGgzhS.js → quadrantDiagram-ABIIQ3AL-vUYE75N_.js} +1 -1
  52. package/web/dist/assets/{railroadDiagram-RFXS5EU6-D2sTvxih.js → railroadDiagram-RFXS5EU6-BZoLeTnP.js} +1 -1
  53. package/web/dist/assets/{requirementDiagram-TGXJPOKE-BZVpHsSr.js → requirementDiagram-TGXJPOKE-B6mZ4R7R.js} +1 -1
  54. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-DMEZM-n6.js → sankeyDiagram-HTMAVEWB-YdX9uL_V.js} +1 -1
  55. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-BYewTjBt.js → sequenceDiagram-DBY2YBRQ-C_Y-MXge.js} +1 -1
  56. package/web/dist/assets/{sizeCapture-X5ZJPWSS-CLjBluIH.js → sizeCapture-X5ZJPWSS-CILOviIW.js} +1 -1
  57. package/web/dist/assets/{stateDiagram-2N3HPSRC-BQoEHFTE.js → stateDiagram-2N3HPSRC-CTOz35uo.js} +1 -1
  58. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-CMXodf8v.js +1 -0
  59. package/web/dist/assets/{swimlanes-5IMT3BWC-D7pDDxxW.js → swimlanes-5IMT3BWC-Dv4P96-U.js} +2 -2
  60. package/web/dist/assets/swimlanesDiagram-G3AALYLV-Brbj22gM.js +8 -0
  61. package/web/dist/assets/{timeline-definition-FHXFAJF6-CBTttl2A.js → timeline-definition-FHXFAJF6-DlBm6YfU.js} +1 -1
  62. package/web/dist/assets/{vennDiagram-L72KCM5P-c0Q0k8fl.js → vennDiagram-L72KCM5P-BvubWOFq.js} +1 -1
  63. package/web/dist/assets/{wardleyDiagram-EHGQE667-BBYahOpv.js → wardleyDiagram-EHGQE667-gvigxOT2.js} +1 -1
  64. package/web/dist/assets/{xychartDiagram-FW5EYKEG-BGwbZoPl.js → xychartDiagram-FW5EYKEG-4b5fIA4u.js} +1 -1
  65. package/web/dist/index.html +2 -2
  66. package/web/dist/assets/channel-C4jB7PiN.js +0 -1
  67. package/web/dist/assets/classDiagram-OUVF2IWQ-mFnr2eTE.js +0 -1
  68. package/web/dist/assets/classDiagram-v2-EOCWNBFH-mFnr2eTE.js +0 -1
  69. package/web/dist/assets/index-cWKSWSrS.css +0 -1
  70. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DIIcfysY.js +0 -1
  71. package/web/dist/assets/swimlanesDiagram-G3AALYLV-D-LZ73_K.js +0 -8
@@ -343,7 +343,7 @@ $$
343
343
 
344
344
  `:t)}const qv=/[#.]/g;function AA(e,t){const n=e||"",a={};let l=0,u,c;for(;l<n.length;){qv.lastIndex=l;const f=qv.exec(n),h=n.slice(l,f?f.index:n.length);h&&(u?u==="#"?a.id=h:Array.isArray(a.className)?a.className.push(h):a.className=[h]:c=h,l+=h.length),f&&(u=f[0],l++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function o6(e,t,n){const a=n?DA(n):void 0;function l(u,c,...f){let h;if(u==null){h={type:"root",children:[]};const m=c;f.unshift(m)}else{h=AA(u,t);const m=h.tagName.toLowerCase(),g=a?a.get(m):void 0;if(h.tagName=g||m,EA(c))f.unshift(c);else for(const[v,k]of Object.entries(c))NA(e,h.properties,v,k)}for(const m of f)Qp(h.children,m);return h.type==="element"&&h.tagName==="template"&&(h.content={type:"root",children:h.children},h.children=[]),h}return l}function EA(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const a of n){const l=t[a];if(l&&typeof l=="object"){if(!Array.isArray(l))return!0;const u=l;for(const c of u)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function NA(e,t,n,a){const l=lx(e,n);let u;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;u=a}else typeof a=="boolean"?u=a:typeof a=="string"?l.spaceSeparated?u=m2(a):l.commaSeparated?u=u2(a):l.commaOrSpaceSeparated?u=m2(u2(a).join(" ")):u=Uv(l,l.property,a):Array.isArray(a)?u=[...a]:u=l.property==="style"?MA(a):String(a);if(Array.isArray(u)){const c=[];for(const f of u)c.push(Uv(l,l.property,f));u=c}l.property==="className"&&Array.isArray(t.className)&&(u=t.className.concat(u)),t[l.property]=u}}function Qp(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Qp(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Qp(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Uv(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Jc(n)===Jc(t)))return!0}return n}function MA(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function DA(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const zA=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],RA=o6(sx,"div"),OA=o6(kf,"g",zA),lp={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function IA(e,t){return u6(e,{})||{type:"root",children:[]}}function u6(e,t){const n=LA(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function LA(e,t){switch(e.nodeType){case 1:return UA(e,t);case 3:return BA(e);case 8:return qA(e);case 9:return $v(e,t);case 10:return _A();case 11:return $v(e,t);default:return}}function $v(e,t){return{type:"root",children:c6(e,t)}}function _A(){return{type:"doctype"}}function BA(e){return{type:"text",value:e.nodeValue||""}}function qA(e){return{type:"comment",value:e.nodeValue||""}}function UA(e,t){const n=e.namespaceURI,a=n===lp.svg?OA:RA,l=n===lp.html?e.tagName.toLowerCase():e.tagName,u=n===lp.html&&l==="template"?e.content:e,c=e.getAttributeNames(),f={};let h=-1;for(;++h<c.length;)f[c[h]]=e.getAttribute(c[h])||"";return a(l,f,c6(u,t))}function c6(e,t){const n=e.childNodes,a=[];let l=-1;for(;++l<n.length;){const u=u6(n[l],t);u!==void 0&&a.push(u)}return a}new DOMParser;function $A(e,t){const n=HA(e);return IA(n)}function HA(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const Hv=(function(e,t,n){const a=o0(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),eo=(function(e){if(e==null)return GA;if(typeof e=="string")return PA(e);if(typeof e=="object")return FA(e);if(typeof e=="function")return X1(e);throw new Error("Expected function, string, or array as `test`")});function FA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=eo(e[n]);return X1(a);function a(...l){let u=-1;for(;++u<t.length;)if(t[u].apply(this,l))return!0;return!1}}function PA(e){return X1(t);function t(n){return n.tagName===e}}function X1(e){return t;function t(n,a,l){return!!(VA(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function GA(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function VA(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Fv=/\n/g,Pv=/[\t ]+/g,Jp=eo("br"),Gv=eo(eE),YA=eo("p"),Vv=eo("tr"),WA=eo(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",JA,tE]),d6=eo(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function KA(e,t){const n=t||{},a="children"in e?e.children:[],l=d6(e),u=m6(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...h6(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<a.length;)c.push(...f6(a[f],e,{whitespace:u,breakBefore:f?void 0:l,breakAfter:f<a.length-1?Jp(a[f+1]):l}));const h=[];let m;for(f=-1;++f<c.length;){const g=c[f];typeof g=="number"?m!==void 0&&g>m&&(m=g):g&&(m!==void 0&&m>-1&&h.push(`
345
345
  `.repeat(m)||" "),m=-1,h.push(g))}return h.join("")}function f6(e,t,n){return e.type==="element"?XA(e,t,n):e.type==="text"?n.whitespace==="normal"?h6(e,n):ZA(e):[]}function XA(e,t,n){const a=m6(e,n),l=e.children||[];let u=-1,c=[];if(WA(e))return c;let f,h;for(Jp(e)||Vv(e)&&Hv(t,e,Vv)?h=`
346
- `:YA(e)?(f=2,h=2):d6(e)&&(f=1,h=1);++u<l.length;)c=c.concat(f6(l[u],e,{whitespace:a,breakBefore:u?void 0:f,breakAfter:u<l.length-1?Jp(l[u+1]):h}));return Gv(e)&&Hv(t,e,Gv)&&c.push(" "),f&&c.unshift(f),h&&c.push(h),c}function h6(e,t){const n=String(e.value),a=[],l=[];let u=0;for(;u<=n.length;){Fv.lastIndex=u;const h=Fv.exec(n),m=h&&"index"in h?h.index:n.length;a.push(QA(n.slice(u,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?t.breakBefore:!0,m===n.length?t.breakAfter:!0)),u=m+1}let c=-1,f;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(l.push(a[c]),f=void 0):a[c]?(typeof f=="number"&&l.push(f),l.push(a[c]),f=0):(c===0||c===a.length-1)&&l.push(0);return l}function ZA(e){return[String(e.value)]}function QA(e,t,n){const a=[];let l=0,u;for(;l<e.length;){Pv.lastIndex=l;const c=Pv.exec(e);u=c?c.index:e.length,!l&&!u&&c&&!t&&a.push(""),l!==u&&a.push(e.slice(l,u)),l=c?u+c[0].length:u}return l!==u&&!n&&a.push(""),a.join(" ")}function m6(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function JA(e){return!!(e.properties||{}).hidden}function eE(e){return e.tagName==="td"||e.tagName==="th"}function tE(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const nE={},rE=[];function aE(e){const t=e||nE;return function(n,a){E1(n,"element",function(l,u){const c=Array.isArray(l.properties.className)?l.properties.className:rE,f=c.includes("language-math"),h=c.includes("math-display"),m=c.includes("math-inline");let g=h;if(!f&&!h&&!m)return;let v=u[u.length-1],k=l;if(l.tagName==="code"&&f&&v&&v.type==="element"&&v.tagName==="pre"&&(k=v,v=u[u.length-2],g=!0),!v)return;const x=KA(k,{whitespace:"pre"});let S;try{S=Zp.renderToString(x,{...t,displayMode:g,throwOnError:!0})}catch(I){const z=I,E=z.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...u,l],cause:z,place:l.position,ruleId:E,source:"rehype-katex"});try{S=Zp.renderToString(x,{...t,displayMode:g,strict:"ignore",throwOnError:!1})}catch{S=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(I)},children:[{type:"text",value:x}]}]}}typeof S=="string"&&(S=$A(S).children);const N=v.children.indexOf(k);return v.children.splice(N,1,...S),Ox})}}function iE(e,t,n){return e?t?n==="delta"?e+t:t.startsWith(e)?t:e:e:t}function lE(e,t,n){if(e.kind||e.status!=="pending")return e.status;const a=[...t].reverse().find(l=>l.nodeId===e.id);return a?a.status==="completed"?n.some(l=>l.executionId===a.id&&l.type==="result")?"delivered":"awaiting_review":["accepted","running","failed","cancelled"].includes(a.status)?a.status:e.status:e.status}function sE(e,t){var l;if(!["input:cotask_report","input:cotask_execution"].includes(e.subtype))return null;const n=Date.parse(e.createdAt);return((l=t.filter(u=>(!e.turnId||e.turnId===u.id)&&Date.parse(u.startedAt)<n&&(!u.finishedAt||n<=Date.parse(u.finishedAt))).sort((u,c)=>Date.parse(c.startedAt)-Date.parse(u.startedAt))[0])==null?void 0:l.id)??null}function oE(e){const t=e.phase??e.status,n=e.nodeActivity;if(!n||["draft","finished","completed","cancelled"].includes(t))return[{status:t}];const a=[];return t!=="running"&&a.push({status:t}),n.blocked>0&&a.push({status:"blocked",count:n.blocked}),n.waiting>0&&a.push({status:"waiting",count:n.waiting}),t==="running"&&(n.running>0||a.length===0)&&a.push({status:"running"}),a}function Yv(e,t){if(e.kind==="checkpoint")return{start:e.startedAt,end:e.finishedAt,active:e.status==="waiting"};const n=t.filter(u=>u.nodeId===e.id),a=n.find(u=>u.startedAt||u.turnId||["running","completed","failed"].includes(u.status)),l=n.at(-1);return{start:a==null?void 0:a.startedAt,end:l==null?void 0:l.finishedAt,active:!!a&&!["completed","cancelled","failed"].includes(e.status)}}function uE(e){return{start:e.startedAt,end:e.finishedAt,active:e.status==="running"}}function cE(e){return`${Math.floor(e/60)}m ${e%60}s`}function e1(e,t){const n=e.start?Date.parse(e.start):NaN,a=e.active?t:e.end?Date.parse(e.end):NaN,l=Number.isFinite(n)?new Intl.DateTimeFormat("en-CA",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(n):[],u=c=>{var f;return((f=l.find(h=>h.type===c))==null?void 0:f.value)??""};return{start:l.length?`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`:"—",duration:Number.isFinite(n)&&Number.isFinite(a)?cE(Math.max(0,Math.floor((a-n)/1e3))):"—"}}function dE({executions:e,name:t,now:n,icon:a,statusLabel:l}){const u=A.useId(),c=A.useRef(null);return A.useEffect(()=>{const f=h=>{const m=c.current;m!=null&&m.matches(":popover-open")&&!(h.target instanceof Node&&m.contains(h.target))&&m.hidePopover()};return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[]),s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"cotask-execution-history-button","aria-label":`${t}:执行历史`,title:`${l} · 查看执行历史`,popoverTarget:u,onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation();const h=f.currentTarget.getBoundingClientRect(),m=c.current;if(!m)return;const g=Math.min(480,window.innerWidth-16);m.style.width=`${g}px`,m.style.left=`${Math.max(8,Math.min(h.right+12,window.innerWidth-g-8))}px`,m.style.top=`${Math.max(8,Math.min(h.top,window.innerHeight-Math.min(320,window.innerHeight-16)-8))}px`},children:a}),Qc.createPortal(s.jsxs("div",{ref:c,id:u,popover:"auto",className:"cotask-execution-history",role:"dialog","aria-label":`${t}执行历史`,onClick:f=>f.stopPropagation(),onPointerDown:f=>f.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"执行历史"}),s.jsxs("span",{children:[e.length," 次执行 · 北京时间"]})]}),s.jsx("div",{className:"cotask-execution-history-scroll",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{"aria-label":"次序"}),s.jsx("th",{children:"开始"}),s.jsx("th",{children:"结束"}),s.jsx("th",{children:"耗时"})]})}),s.jsx("tbody",{children:[...e].reverse().map((f,h)=>{const m=e1(uE(f),n),g=e1({start:f.finishedAt,end:void 0,active:!1},n).start;return s.jsxs("tr",{children:[s.jsxs("td",{children:["#",e.length-h]}),s.jsx("td",{children:m.start}),s.jsx("td",{children:g==="—"&&f.status==="running"?"执行中":g}),s.jsx("td",{children:m.duration})]},f.id)})})]})}),e.some(f=>!f.startedAt&&f.status!=="accepted")&&s.jsx("p",{children:"部分历史执行未记录开始时间,以 — 显示。"})]}),document.body)]})}const hu=184,Qi=64,Wv=e=>`${e.x},${e.y}`,sp=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),fE=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});function t1(e,t,n=0){const a=Math.min(...e.map(g=>g.x)),l=Math.max(...e.map(g=>g.x)),u=Math.min(...e.map(g=>g.y)),c=Math.max(...e.map(g=>g.y));if(l<t.x-4||a>t.x+hu+4||c<t.y-4||u>t.y+(t.height??Qi)+4)return!1;if(n>=16||Math.max(l-a,c-u)<.25)return!0;const f=[e[0]],h=[e[e.length-1]];let m=e;for(;m.length>1;)m=m.slice(1).map((g,v)=>fE(m[v],g)),f.push(m[0]),h.unshift(m[m.length-1]);return t1(f,t,n+1)||t1(h,t,n+1)}function Kv(e,t){return e.every(n=>t.every(a=>!t1(n,a)))}function hE(e,t){const n=[];let a=e[0];const l=(u,c,f)=>{const h=f/sp(u,c);return{x:u.x+(c.x-u.x)*h,y:u.y+(c.y-u.y)*h}};for(let u=1;u<e.length-1;u++){const c=e[u],f=e[u-1],h=e[u+1],m=Math.min(t,sp(c,f)/2,sp(c,h)/2);if(m<.001){n.push([a,c]),a=c;continue}const g=l(c,f,m),v=l(c,h,m);n.push([a,g],[g,c,v]),a=v}return n.push([a,e[e.length-1]]),n}function Xv(e){return`M ${Wv(e[0][0])} `+e.map(t=>`${t.length===4?"C":t.length===3?"Q":"L"} ${t.slice(1).map(Wv).join(" ")}`).join(" ")}function p6(e,t){const n=e[0],a=e[e.length-1],l=(n.y+a.y)/2,u=[[n,{x:n.x,y:l},{x:a.x,y:l},a]];if(a.y>n.y&&Kv(u,t))return{path:Xv(u),segments:u};for(const c of[64,40,24,12,6,2,0]){const f=hE(e,c);if(Kv(f,t))return{path:Xv(f),segments:f}}throw new Error("No unobstructed CoTask route")}function mE(e){return JSON.stringify(e.map(t=>({id:t.id,dependencies:[...t.dependencies].sort(),height:t.height??Qi})).sort((t,n)=>t.id.localeCompare(n.id)))}function g6(e){const t=new Map,n=new Map,a=new Map(e.map(x=>[x.id,x])),l=[];for(;a.size;){const x=[...a.values()].filter(N=>N.dependencies.every(I=>n.has(I)||!a.has(I))),S=x.length?x:[...a.values()];l.push(S);for(const N of S)a.delete(N.id),n.set(N.id,l.length-1)}const u=Math.max(1,...l.map(x=>x.length))*296-24,c=[];let f=24;l.forEach(x=>{x.forEach((N,I)=>t.set(N.id,{x:(u-(x.length*296-72))/2+I*296,y:f}));const S=f+Math.max(Qi,...x.map(N=>N.height??Qi));c.push(S),f=S+80});const h=new Map(e.map(x=>[x.id,x.height??Qi])),m=[...t].map(([x,S])=>({id:x,...S,height:h.get(x)})),g=[],v=[];let k=u;for(const x of e)for(const S of x.dependencies){const N=t.get(S),I=t.get(x.id);if(!N||!I)continue;const z={x:N.x+hu/2,y:N.y+(h.get(S)??Qi)},E={x:I.x+hu/2,y:I.y};k+=18;const q=c[n.get(S)]+25,R=[z,{x:z.x,y:q},{x:k,y:q},{x:k,y:E.y-25},{x:E.x,y:E.y-25},E],Z=m.filter(P=>P.id!==S&&P.id!==x.id);try{g.push({source:S,target:x.id,path:p6(R,Z).path})}catch{v.push({source:S,target:x.id})}}return{positions:t,edges:g,failedEdges:v,width:k+48,height:Math.max(124,f-80+24)}}async function pE(e){var m;if(!e.length)return g6(e);const{default:t}=await on(async()=>{const{default:g}=await import("./elk.bundled-B6aSvDDf.js").then(v=>v.e);return{default:g}},[],import.meta.url),n=new Set(e.map(g=>g.id)),a=e.flatMap(g=>g.dependencies.filter(v=>n.has(v)).map(v=>({source:v,target:g.id}))),u=await new t().layout({id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.spacing.nodeNode":"40","elk.layered.spacing.nodeNodeBetweenLayers":"80","elk.layered.spacing.edgeNodeBetweenLayers":"18","elk.padding":"[top=24,left=24,bottom=24,right=24]","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX"},children:e.map(g=>({id:g.id,width:hu,height:g.height??Qi})),edges:a.map((g,v)=>({id:`edge-${v}`,sources:[g.source],targets:[g.target]}))}),c=(u.children??[]).map(g=>({id:g.id,x:g.x??0,y:g.y??0,height:g.height})),f=new Map((m=u.edges)==null?void 0:m.map(g=>[g.id,g])),h=a.map((g,v)=>{var S,N;const k=(N=(S=f.get(`edge-${v}`))==null?void 0:S.sections)==null?void 0:N[0];if(!k)throw new Error("Missing CoTask dependency route");const x=[k.startPoint,...k.bendPoints??[],k.endPoint];return{...g,path:p6(x,c.filter(I=>I.id!==g.source&&I.id!==g.target)).path}});return{positions:new Map(c.map(g=>[g.id,g])),edges:h,width:u.width??320,height:u.height??196}}const Zv={pending:"待开始",completed:"已确认完成",blocked:"已阻塞",cancelled:"已取消",running:"执行中",accepted:"等待执行",failed:"执行失败",delivered:"已交付,待确认",awaiting_review:"执行已结束,待确认"};function Qv({status:e,label:t}){const n=e==="completed"?"m6 12 4 4 8-8":["blocked","failed"].includes(e)?"M12 6v7m0 3v1":e==="cancelled"?"m8 8 8 8m0-8-8 8":e==="pending"?"M8 12h8":["paused","pausing"].includes(e)?"M9 7v10M15 7v10":"M12 6v6l4 2";return s.jsx("span",{className:`cotask-node-state-icon ${e}`,role:"img","aria-label":t,title:t,children:["running","accepted"].includes(e)?s.jsx("span",{className:"cotask-status-spinner","aria-hidden":"true"}):s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:n})]})})}function gE({nodes:e,members:t,executions:n,reports:a,selectedId:l,onSelect:u,onDismiss:c,detail:f,finalCheckpointId:h}){var J,O;const[m,g]=A.useState(Date.now),v=e.some(U=>{const me=Yv(U,n);return me.active&&!!me.start})||n.some(U=>U.status==="running"&&!!U.startedAt);A.useEffect(()=>{if(!v)return;g(Date.now());const U=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(U)},[v]);const k=e.some(U=>U.kind!==void 0),x=(U,me)=>U.kind==="checkpoint"?{pending:"等待前置完成",waiting:"等待 Owner 继续",completed:"已继续"}[me]??Zv[me]??me:U.kind&&me==="completed"?"已完成":Zv[me]??me,[S,N]=A.useState({}),I=A.useRef(new Map);A.useEffect(()=>{const U=new ResizeObserver(()=>{N(me=>{const Ce=Object.fromEntries([...I.current].map(([De,et])=>[De,et.offsetHeight]));return Object.keys(Ce).length===Object.keys(me).length&&Object.entries(Ce).every(([De,et])=>me[De]===et)?me:Ce})});return I.current.forEach(me=>U.observe(me)),()=>U.disconnect()},[e.map(U=>U.id).join("\0")]);const z=mE(e.map(U=>({...U,height:S[U.id]??(U.kind==="checkpoint"?48:Qi)}))),E=A.useMemo(()=>g6(JSON.parse(z)),[z]),[q,R]=A.useState(null),[Z,P]=A.useState(!1),$=(q==null?void 0:q.topology)===z?q.graph:E;A.useEffect(()=>{let U=!0;return P(!1),pE(JSON.parse(z)).then(me=>{U&&R({topology:z,graph:me})}).catch(()=>{U&&P(!0)}),()=>{U=!1}},[z]);const te=A.useRef(null),[ne,G]=A.useState({width:900,height:560}),[pe,ee]=A.useState(1),[ke,ve]=A.useState(!1),se=A.useRef(!1),Y=A.useRef(null),fe=A.useId().replace(/:/g,"");A.useEffect(()=>{if(!te.current)return;const U=new ResizeObserver(([me])=>G({width:me.contentRect.width,height:me.contentRect.height}));return U.observe(te.current),()=>U.disconnect()},[]);const K=Math.min(1,Math.max(.15,Math.min((ne.width-32)/$.width,(ne.height-32)/$.height))),je=pe??K,H=new Map(e.map(U=>[U.id,lE(U,n,a)])),L=e.find(U=>U.id===l);return s.jsxs("section",{className:"cotask-graph","aria-label":"Task dependency graph",children:[s.jsxs("div",{className:"cotask-graph-toolbar",children:[s.jsxs("span",{children:["Arrows show dependencies ",s.jsxs("span",{className:"cotask-graph-count",children:["· ",e.length," nodes / ",$.edges.length+(((J=$.failedEdges)==null?void 0:J.length)??0)," dependencies"]}),Z&&s.jsx("small",{role:"status",children:" · 自动布局暂不可用,已显示基础布局"})]}),s.jsxs("div",{children:[s.jsx("button",{"aria-label":"Zoom out",onClick:()=>ee(Math.max(.15,je-.15)),children:"−"}),s.jsxs("span",{children:[Math.round(je*100),"%"]}),s.jsx("button",{"aria-label":"Zoom in",onClick:()=>ee(Math.min(2,je+.15)),children:"+"}),s.jsx("button",{onClick:()=>ee(1),children:"100%"}),s.jsx("button",{onClick:()=>ee(null),children:"Fit to view"})]})]}),!!((O=$.failedEdges)!=null&&O.length)&&s.jsxs("details",{className:"cotask-warning",role:"status",children:[s.jsxs("summary",{children:[$.failedEdges.length," 条依赖连线暂未能绘制,节点仍可查看"]}),s.jsx("ul",{children:$.failedEdges.map(U=>{var me,Ce;return s.jsxs("li",{children:[((me=e.find(De=>De.id===U.source))==null?void 0:me.name)??U.source," → ",((Ce=e.find(De=>De.id===U.target))==null?void 0:Ce.name)??U.target]},`${U.source}:${U.target}`)})})]}),s.jsxs("div",{className:"cotask-graph-stage",children:[s.jsx("div",{className:`cotask-graph-viewport${ke?" dragging":""}`,ref:te,"data-layout":(q==null?void 0:q.topology)===z?"adaptive":"fallback",onClickCapture:U=>{se.current&&(U.preventDefault(),U.stopPropagation())},onClick:U=>{U.target.closest("button")||c()},onPointerDown:U=>{if(U.button!==0||U.target.closest(".cotask-node-text"))return;se.current=!1;const me=U.currentTarget;Y.current={id:U.pointerId,x:U.clientX,y:U.clientY,left:me.scrollLeft,top:me.scrollTop,moved:!1}},onPointerMove:U=>{if(!Y.current||Y.current.id!==U.pointerId)return;const me=U.clientX-Y.current.x,Ce=U.clientY-Y.current.y;Math.abs(me)+Math.abs(Ce)>4&&(Y.current.moved=!0,ve(!0),U.currentTarget.setPointerCapture(U.pointerId),U.preventDefault()),Y.current.moved&&(U.currentTarget.scrollLeft=Y.current.left-me,U.currentTarget.scrollTop=Y.current.top-Ce)},onPointerUp:U=>{Y.current&&(se.current=Y.current.moved,Y.current=null,ve(!1),U.currentTarget.hasPointerCapture(U.pointerId)&&U.currentTarget.releasePointerCapture(U.pointerId),window.setTimeout(()=>{se.current=!1},0))},onPointerCancel:()=>{Y.current=null,ve(!1)},onLostPointerCapture:()=>{Y.current=null,ve(!1)},children:s.jsx("div",{className:"cotask-graph-scroll",style:{width:Math.max(ne.width,$.width*je),height:Math.max(ne.height,$.height*je)},children:s.jsxs("div",{className:"cotask-graph-canvas",style:{width:$.width,height:$.height,transform:`scale(${je})`,left:0,top:0},children:[s.jsxs("svg",{width:$.width,height:$.height,className:"cotask-graph-edges","aria-hidden":"true",children:[s.jsx("defs",{children:["default","complete","selected"].map(U=>s.jsx("marker",{id:`${fe}-${U}`,markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 1 1 L 7 4 L 1 7 Z",className:`cotask-arrow-${U}`})},U))}),$.edges.map(U=>{const me=l&&[U.source,U.target].includes(l)?"selected":H.get(U.source)==="completed"?"complete":"default";return s.jsx("path",{"data-source":U.source,"data-target":U.target,d:U.path,className:`cotask-edge ${me}`,markerEnd:`url(#${fe}-${me})`},`${U.source}:${U.target}`)})]}),e.map(U=>{var he,_e;const me=$.positions.get(U.id),Ce=H.get(U.id),De=e1(Yv(U,n),m),et=n.filter(He=>He.nodeId===U.id);return s.jsxs(A.Fragment,{children:[s.jsxs("button",{ref:He=>{He?I.current.set(U.id,He):I.current.delete(U.id)},className:`cotask-graph-node ${Ce}${U.kind==="checkpoint"?" checkpoint":""}${l===U.id?" selected":""}`,style:{left:me.x,top:me.y,width:hu,minHeight:U.kind==="checkpoint"?48:Qi},"aria-pressed":l===U.id,onClick:()=>u(U),title:U.dependencies.length?`Depends on: ${U.dependencies.map(He=>{var We;return((We=e.find(Qe=>Qe.id===He))==null?void 0:We.name)??He}).join(", ")}`:"No dependencies",children:[U.dependencies.length>0&&s.jsx("i",{className:"cotask-node-port input"}),s.jsx("strong",{className:"cotask-node-text",title:U.name,children:U.name}),U.kind!=="checkpoint"&&s.jsx("span",{className:"cotask-graph-node-footer",children:s.jsx("span",{className:"cotask-graph-node-member cotask-node-text",title:((he=t.find(He=>He.id===U.memberId))==null?void 0:he.name)??U.memberId??void 0,children:((_e=t.find(He=>He.id===U.memberId))==null?void 0:_e.name)??U.memberId})}),s.jsxs("span",{className:"cotask-node-timing cotask-node-text",title:U.kind==="checkpoint"?`北京时间 ${De.start} · ${De.duration};从到达检查点至继续或取消,包含等待时间`:`北京时间 ${De.start} · ${De.duration};首次执行开始至最终结束,包含暂停和中间等待时间`,"aria-label":`Start ${De.start}, elapsed ${De.duration}`,children:[De.start," · ",De.duration]}),$.edges.some(He=>He.source===U.id)&&s.jsx("i",{className:"cotask-node-port output"})]}),s.jsx("div",{className:`cotask-node-icons ${Ce}`,style:{left:me.x+hu-3,top:me.y+3},onPointerDown:He=>He.stopPropagation(),onClick:He=>He.stopPropagation(),children:et.length>1?s.jsx(dE,{executions:et,name:U.name,now:m,statusLabel:x(U,Ce),icon:s.jsx(Qv,{status:Ce,label:x(U,Ce)})}):s.jsx(Qv,{status:Ce,label:x(U,Ce)})})]},U.id)})]})})}),L&&s.jsxs("aside",{className:"cotask-node-drawer","aria-label":`Node details: ${L.name}`,onKeyDown:U=>{U.key==="Escape"&&(U.stopPropagation(),c())},children:[s.jsxs("header",{children:[s.jsx("strong",{children:L.name}),s.jsx("button",{onClick:c,"aria-label":"Close node details",children:"关闭"})]}),s.jsx("div",{className:"cotask-node-drawer-content",children:f},L.id)]})]}),s.jsxs("div",{className:"cotask-graph-legend",children:[s.jsxs("span",{children:[s.jsx("i",{className:"running"}),"执行中"]}),s.jsxs("span",{children:[s.jsx("i",{className:"delivered"}),k?"检查点等待继续":"待 Owner 确认"]}),s.jsxs("span",{children:[s.jsx("i",{className:"completed"}),k?"已完成 / 已继续":"已确认完成"]}),s.jsxs("span",{children:[s.jsx("i",{className:"pending"}),"待开始"]}),s.jsx("span",{children:k?"执行节点报告结果并正常结束后自动完成;检查点由 Owner 检查后继续":"点击节点查看上下文与报告;成员执行结束不等于节点已确认完成"})]})]})}const y6=e=>({draft:"草稿",running:"运行中",pausing:"正在暂停",paused:"已暂停",waiting:"等待继续",finished:"已结束",pending:"Pending",completed:"Completed",blocked:"Blocked",cancelled:"Cancelled",accepted:"Accepted",failed:"Failed"})[e]??e;function op({task:e,compact:t=!1}){const n=oE(e).filter(({status:l,count:u})=>!t||!["blocked","waiting"].includes(l)||(u??0)>1),a={running:["active","进行中","M8 5l10 7-10 7Z"],finished:["done","已结束","m6 12 4 4 8-8"],completed:["done","已结束","m6 12 4 4 8-8"],paused:["attention","已暂停","M9 7v10M15 7v10"],pausing:["attention","正在暂停","M9 7v10M15 7v10"],waiting:["attention","等待检查","M12 6v6l4 2"],blocked:["danger","存在阻塞","M12 6v7m0 3v1"],failed:["danger","失败","M12 6v7m0 3v1"],cancelled:["neutral","已取消","m8 8 8 8m0-8-8 8"],draft:["neutral","草稿","M8 8h8M8 12h8M8 16h5"]};return s.jsx("span",{className:"cotask-task-statuses",children:n.map(({status:l,count:u})=>{const c=t&&!["blocked","waiting"].includes(l)?void 0:u,[f,h,m]=a[l]??["neutral",y6(l),"M12 6v6l4 2"];return s.jsxs("span",{className:`cotask-task-status ${f}${t?" icon-only":""}`,title:`${h}${c!=null?` · ${c}`:""}`,"aria-label":`${h}${c!=null?` · ${c}`:""}`,children:[t&&l==="running"?s.jsx("span",{className:"cotask-status-spinner","aria-hidden":"true"}):t&&c!=null&&c>1?s.jsx("span",{className:"cotask-status-count","aria-hidden":"true",children:c}):s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:m})]}),!t&&s.jsxs(s.Fragment,{children:[h,c!=null&&` · ${c}`]})]},l)})})}function yE({ownerId:e,ownerName:t,request:n,onExpanded:a,renderMember:l,renderMarkdown:u,preferenceKey:c}){const[f,h]=A.useState([]),[m,g]=A.useState(()=>{try{return!!c&&window.localStorage.getItem(c)==="true"}catch{return!1}}),v=be=>{g(be);try{c&&window.localStorage.setItem(c,String(be))}catch{}},[k,x]=A.useState(null),[S,N]=A.useState(null),[I,z]=A.useState("graph"),[E,q]=A.useState(null),[R,Z]=A.useState(null),[P,$]=A.useState(null),[te,ne]=A.useState([]),[G,pe]=A.useState(null),[ee,ke]=A.useState(null),[ve,se]=A.useState([]),[Y,fe]=A.useState(""),[K,je]=A.useState(!1),H=A.useRef(null),L=A.useRef(0),J=A.useRef("");J.current=`${k}:${S==null?void 0:S.task.revision}`;const O=A.useRef(E);O.current=E;const U=`conversations/${encodeURIComponent(e)}/cotasks`;A.useEffect(()=>{let be=!0;const lt=async()=>{try{const vt=await n(U);be&&h(vt.tasks)}catch(vt){be&&fe(String(vt))}};lt();const ft=window.setInterval(()=>void lt(),5e3);return()=>{be=!1,window.clearInterval(ft)}},[U,n]),A.useEffect(()=>(a(k!==null),()=>a(!1)),[k,a]),A.useEffect(()=>{if(!k)return;let be=!0;const lt=async()=>{try{const vt=await n(`${U}/${encodeURIComponent(k)}`);if(be&&(N(vt),fe("")),I==="operations"){const Ct=await n(`${U}/${encodeURIComponent(k)}`,{operations:!0});be&&se(Ct.operations)}}catch(vt){be&&fe(String(vt))}};lt();const ft=window.setInterval(()=>void lt(),3e3);return()=>{be=!1,window.clearInterval(ft)}},[k,U,n,I]),A.useEffect(()=>{var be;k&&((be=H.current)==null||be.focus())},[k]),A.useEffect(()=>{L.current++,pe(null),ke(null),ne([])},[S==null?void 0:S.task.revision]);const me=JSON.stringify(S==null?void 0:S.reports.map(be=>be.id)),Ce=JSON.stringify(S==null?void 0:S.nodes.map(be=>[be.id,be.status,be.reason]));A.useEffect(()=>{if(!k||!R||!S)return;let be=!0;if(!S.nodes.some(lt=>lt.id===R)){Z(null),$(null);return}return n(`${U}/${encodeURIComponent(k)}`,{nodeIds:[R]}).then(lt=>{be&&$(lt.nodes[0]??null)}).catch(lt=>{be&&fe(String(lt))}),()=>{be=!1}},[k,R,S==null?void 0:S.task.revision,me,Ce,U,n]);const De=be=>{Z(null),L.current++,pe(null),ke(null),se([]),fe(""),N(null),x(be),z("graph"),q(null),$(null),ne([])},et=()=>{L.current++,Z(null),$(null),ne([])},he=()=>{L.current++,x(null)},_e=f.find(be=>be.status==="running")??f.find(be=>be.status==="draft")??f[0];if(!k&&_e&&m)return s.jsxs("button",{type:"button",className:"cotask-launcher cotask-launcher-collapsed","aria-label":"Expand CoTask","aria-expanded":!1,title:"Expand CoTask",onClick:()=>v(!1),children:[s.jsx("span",{"aria-hidden":"true",children:"‹"}),s.jsx("span",{className:"cotask-launcher-label",children:"CoTask"}),s.jsx("small",{children:f.length})]});if(!k)return _e?s.jsxs("div",{className:"cotask-launcher",children:[s.jsx("button",{type:"button",className:"cotask-launcher-collapse","aria-label":"Collapse CoTask","aria-expanded":!0,title:"Collapse CoTask",onClick:()=>v(!0),children:s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("path",{d:"m9 5 7 7-7 7"})})}),s.jsxs("button",{className:"cotask-launch-primary",onClick:()=>De(_e.id),children:[s.jsxs("span",{className:"cotask-launch-heading",children:[s.jsx("span",{children:"CoTask"}),s.jsx(op,{task:_e,compact:!0})]}),s.jsx("strong",{children:_e.name}),s.jsxs("span",{className:"cotask-launch-progress",children:[s.jsx("progress",{"aria-label":"Completed nodes",value:_e.completedNodeCount??0,max:Math.max(1,_e.nodeCount)}),s.jsxs("span",{children:[_e.completedNodeCount??0,"/",_e.nodeCount]})]})]}),f.length>1&&s.jsxs("details",{className:"cotask-task-list",children:[s.jsxs("summary",{children:["Other tasks (",f.length-1,")"]}),f.filter(be=>be.id!==_e.id).map(be=>s.jsxs("button",{onClick:()=>De(be.id),children:[s.jsx("strong",{children:be.name}),s.jsx(op,{task:be,compact:!0})]},be.id))]})]}):null;const He=be=>{R!==be.id&&(L.current++,fe(""),$(null),ne([]),Z(be.id))},We=async be=>{const lt=++L.current;try{const ft=await n(`${U}/${k}`,{reportIds:[be.id]});lt===L.current&&ne(ft.reports)}catch(ft){fe(String(ft))}},Qe=S==null?void 0:S.bindings.find(be=>be.memberId===E),Xe=S==null?void 0:S.members.find(be=>be.id===E),yt=(be,lt=e)=>s.jsx("div",{className:"cotask-markdown",children:u(be??"",lt)});return s.jsx("div",{className:"context-panel-overlay settings-overlay cotask-overlay",children:s.jsxs("section",{className:"context-panel settings-panel cotask-frame",role:"dialog","aria-modal":"true","aria-label":"CoTask",tabIndex:-1,ref:H,onKeyDown:be=>{var lt;if(be.stopPropagation(),be.key==="Escape"&&(be.preventDefault(),I==="graph"&&R?et():he()),be.key==="Tab"){const ft=(lt=H.current)==null?void 0:lt.querySelectorAll('button:not(:disabled),select,input,a[href],textarea,[tabindex="0"]');if(!(ft!=null&&ft.length))return;const vt=ft[0],Ct=ft[ft.length-1];be.shiftKey&&(document.activeElement===vt||document.activeElement===H.current)?(be.preventDefault(),Ct.focus()):!be.shiftKey&&document.activeElement===Ct&&(be.preventDefault(),vt.focus())}},children:[s.jsxs("header",{className:"cotask-header settings-panel-header",children:[s.jsxs("div",{children:[s.jsxs("p",{children:["CoTask · ",t]}),s.jsxs("div",{className:"cotask-title-row",children:[s.jsx("h1",{children:(S==null?void 0:S.task.name)??"Loading task…"}),(S==null?void 0:S.task.status)==="draft"&&s.jsx("button",{className:"cotask-close-draft",type:"button",disabled:K,onClick:async()=>{if(!window.confirm(`Close draft “${S.task.name}”? It will not run. The task history will be retained.`))return;const be=k,lt=J.current;je(!0),fe("");try{const ft=await n(`${U}/${encodeURIComponent(be)}/close-draft`,{expectedRevision:S.task.revision},"POST");h(vt=>vt.map(Ct=>Ct.id===be?ft.task:Ct)),J.current===lt&&N(vt=>vt&&{...vt,task:ft.task})}catch(ft){J.current===lt&&fe(String(ft))}finally{je(!1)}},children:K?"Closing…":"Close draft"})]})]}),S&&s.jsx(op,{task:S.task}),s.jsxs("button",{className:"cotask-back",onClick:he,title:`Back to ${t}`,children:[s.jsx("span",{"aria-hidden":"true",children:"← "}),"Back"]})]}),s.jsxs("aside",{className:"cotask-nav",children:[s.jsxs("section",{className:"workspace-group","aria-label":"Task navigation",children:[s.jsx("h2",{className:"cotask-nav-group-title",children:"Task"}),s.jsx("nav",{className:"workspace-group-items",children:[["graph","Task graph"],["operations","Activity"],["settings","Settings"]].map(([be,lt])=>s.jsx("button",{className:`session-item${I===be?" active":""}`,"aria-current":I===be?"page":void 0,onClick:()=>{z(be),q(null)},children:s.jsx("span",{className:"session-title",children:lt})},be))})]}),s.jsxs("section",{className:"workspace-group","aria-label":"Task members",children:[s.jsx("h2",{className:"cotask-nav-group-title",children:"Members"}),s.jsx("div",{className:"workspace-group-items cotask-member-list",children:S==null?void 0:S.members.map(be=>{const lt=S.executions.some(vt=>vt.memberId===be.id&&["accepted","running"].includes(vt.status)),ft=lt?"Running":S.bindings.some(vt=>vt.memberId===be.id&&vt.workspaceId)?"Idle":"Not created";return s.jsx("button",{className:`session-item${I==="member"&&E===be.id?" active":""}`,title:`${be.name} · ${ft}`,"aria-label":`${be.name} · ${ft}`,"aria-current":I==="member"&&E===be.id?"page":void 0,onClick:()=>{q(be.id),z("member")},children:s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{className:`session-status${lt?" running":""}`,"aria-hidden":"true"}),s.jsx("span",{className:"session-title",children:be.name})]})},be.id)})})]})]}),s.jsxs("section",{className:"cotask-main",children:[Y&&s.jsx("div",{className:"cotask-error",role:"alert",children:Y}),s.jsx("div",{className:`cotask-body${I==="graph"?" cotask-graph-body":I==="member"?" cotask-member-body":""}`,children:S?s.jsxs(s.Fragment,{children:[S.warnings.length>0&&s.jsx("div",{className:"cotask-warning",children:S.warnings.map((be,lt)=>s.jsxs("p",{children:[be.id?`${be.id}: `:"Common context: ","Context may exceed the injection limit. (estimated ",be.estimatedTokens," tokens)"]},lt))}),I==="graph"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cotask-section-heading",children:[s.jsx("h2",{children:"Task graph"}),s.jsxs("span",{children:[S.nodes.filter(be=>be.status==="completed").length," / ",S.nodes.length," Completed"]})]}),!S.nodes.length&&s.jsx("p",{children:"No nodes yet. Discuss the plan with the initiating agent to define the graph."}),s.jsxs("details",{className:"cotask-context",onToggle:be=>{if(be.currentTarget.open&&G===null){const lt=J.current;n(`${U}/${k}`,{view:"definition"}).then(ft=>{J.current===lt&&pe(ft.definition.commonContext)}).catch(ft=>{J.current===lt&&fe(String(ft))})}},children:[s.jsx("summary",{children:"Common context"}),G===null?s.jsx("p",{children:"Loading…"}):yt(G)]},S.task.revision),S.nodes.length>0&&s.jsx(gE,{finalCheckpointId:S.finalCheckpointId,nodes:S.nodes,members:S.members,executions:S.executions,reports:S.reports,selectedId:R??void 0,onSelect:be=>void He(be),onDismiss:et,detail:(P==null?void 0:P.definition.id)===R?s.jsxs("div",{className:"cotask-node-detail",children:[P.runtime&&s.jsxs("p",{children:[y6(P.runtime.status),P.runtime.reason&&s.jsxs(s.Fragment,{children:[" · ",P.runtime.reason]})]}),yt(P.definition.context),s.jsx("h4",{children:P.definition.kind==="checkpoint"?"检查点":"Reports"}),P.reports.length?P.reports.map(be=>s.jsxs("button",{onClick:()=>void We(be),children:[be.type," · ",be.summary]},be.id)):s.jsx("p",{children:P.definition.kind==="checkpoint"?"此节点不启动成员执行,也不生成成员报告。Owner 按上下文检查交付内容后继续。":"No reports yet."}),te.map(be=>{var lt;return s.jsxs("article",{children:[s.jsx("h4",{children:be.summary}),yt(be.content,((lt=S.executions.find(ft=>ft.id===be.executionId))==null?void 0:lt.workspaceId)??"")]},be.id)})]}):s.jsx("p",{children:"Loading node…"})}),S.task.conclusion&&s.jsxs("details",{className:"cotask-conclusion",children:[s.jsx("summary",{children:"Conclusion"}),yt(S.task.conclusion)]})]}),I==="operations"&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Activity"}),s.jsx("p",{children:"Changes are saved immediately and retained if a turn fails."}),ve.length?ve.map((be,lt)=>s.jsxs("details",{className:"cotask-operation",children:[s.jsxs("summary",{children:[String(be.action)," · ",String(be.status)," · Turn ",String(be.turnStatus)]}),s.jsx("pre",{children:JSON.stringify(be,null,2)})]},lt)):s.jsx("p",{children:"No activity yet."})]}),I==="settings"&&s.jsx(s.Fragment,{children:s.jsx(vE,{task:S.task,path:`${U}/${k}/settings`,request:n,onSaved:be=>N({...S,task:be})},k)}),I==="member"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cotask-section-heading",children:[s.jsx("h2",{children:Xe==null?void 0:Xe.name}),s.jsx("span",{children:"CoTask member"})]}),s.jsxs("details",{className:"cotask-context",onToggle:be=>{if(be.currentTarget.open&&E&&(ee==null?void 0:ee.id)!==E){const lt=E,ft=J.current;n(`${U}/${k}`,{memberIds:[lt]}).then(vt=>{var Ct;J.current===ft&&O.current===lt&&ke({id:lt,context:((Ct=vt.members[0])==null?void 0:Ct.context)??""})}).catch(vt=>{J.current===ft&&O.current===lt&&fe(String(vt))})}},children:[s.jsx("summary",{children:"Member context"}),(ee==null?void 0:ee.id)===E?yt(ee.context):s.jsx("p",{children:"Loading…"})]},`${E}:${S.task.revision}`),Qe!=null&&Qe.workspaceId?l(Qe.workspaceId):s.jsx("p",{children:S.executions.some(be=>be.memberId===E)?"This member instance was removed. Execution history is retained.":S.task.executionMode==="self_driving"?"首次符合执行条件时,平台自动创建此成员实例。":"This member will be created when its first node is driven."})]})]}):s.jsx("p",{children:"Loading task…"})})]})]})})}function vE({task:e,path:t,request:n,onSaved:a}){var E,q;const[l,u]=A.useState({...e.runtimeSettings,mode:e.runtimeSettings.mode??"custom",fastMode:e.runtimeSettings.fastMode??!1}),[c,f]=A.useState(e.revision),[h,m]=A.useState([]),[g,v]=A.useState([]),[k,x]=A.useState(!1),[S,N]=A.useState("");A.useEffect(()=>{let R=!0;return Promise.all([n("settings/runtime/models?refresh=0"),n("settings/model-providers/options")]).then(([Z,P])=>{R&&(m(Z.models),v(P.channels))}).catch(Z=>{R&&N(String(Z))}),()=>{R=!1}},[n]);const I=h.find(R=>R.model===l.model||R.id===l.model),z=((E=I==null?void 0:I.supportedReasoningEfforts)==null?void 0:E.map(R=>R.reasoningEffort))??["none","minimal","low","medium","high","xhigh","max"];return s.jsxs("section",{className:"cotask-settings",children:[s.jsx("h2",{children:"Settings"}),s.jsx("p",{children:"Settings apply to the whole CoTask and take effect on each member’s next turn."}),s.jsxs("label",{children:["配置模式",s.jsxs("select",{value:l.mode,onChange:R=>u({...l,mode:R.target.value}),children:[s.jsx("option",{value:"global",children:"沿用 CoTask 默认配置"}),s.jsx("option",{value:"custom",children:"CoTask 自定义配置"})]})]}),l.mode==="global"?s.jsx("p",{children:"每个成员在下一次 turn 读取最新 CoTask 默认模型、推理强度和倍速设置;正在运行的 turn 不受影响。"}):s.jsxs(s.Fragment,{children:[s.jsxs("label",{children:["Model source",s.jsxs("select",{value:l.modelSource.type==="codex"?"codex":l.modelSource.channelId,onChange:R=>u({...l,modelSource:R.target.value==="codex"?{type:"codex"}:{type:"custom",channelId:R.target.value}}),children:[s.jsx("option",{value:"codex",children:"Codex"}),l.modelSource.type==="custom"&&!g.some(R=>R.id===l.modelSource.channelId)&&s.jsx("option",{value:l.modelSource.channelId,children:"Current channel unavailable"}),g.map(R=>s.jsx("option",{value:R.id,children:R.name},R.id))]})]}),l.modelSource.type==="codex"?s.jsxs(s.Fragment,{children:[s.jsxs("label",{children:[s.jsx("span",{children:"1.5 倍速(Fast mode)"}),s.jsx("input",{type:"checkbox",checked:l.fastMode,onChange:R=>u({...l,fastMode:R.target.checked})})]}),s.jsxs("label",{children:["Model",s.jsxs("select",{value:l.model,onChange:R=>u({...l,model:R.target.value}),children:[s.jsx("option",{value:"",children:"Default model"}),l.model&&!h.some(R=>R.model===l.model)&&s.jsx("option",{children:l.model}),h.map(R=>s.jsx("option",{value:R.model,children:R.displayName},R.id))]})]}),s.jsxs("label",{children:["Reasoning effort",s.jsxs("select",{value:l.reasoningEffort,onChange:R=>u({...l,reasoningEffort:R.target.value}),children:[s.jsx("option",{value:"",children:"Default"}),l.reasoningEffort&&!z.includes(l.reasoningEffort)&&s.jsx("option",{children:l.reasoningEffort}),z.map(R=>s.jsx("option",{children:R},R))]})]})]}):s.jsxs("p",{children:["Channel model: ",((q=g.find(R=>R.id===l.modelSource.channelId))==null?void 0:q.model)??"Channel unavailable",". Codex reasoning effort does not apply to custom channels."]})]}),s.jsx("button",{disabled:k,onClick:async()=>{x(!0),N("");try{const R=await n(t,{expectedRevision:c,runtimeSettings:l},"PUT");f(R.task.revision),a(R.task),N("Saved. Changes take effect on the next turn.")}catch(R){N(`${String(R)}. If the task changed, reopen Settings before saving.`)}finally{x(!1)}},children:k?"Saving…":"Save settings"}),S&&s.jsx("p",{role:"status",children:S})]})}function xE(e,t=new Date){if(e==null||!Number.isInteger(e)||e<1||e>31)return null;const n=new Date(t.getTime()+480*60*1e3),a=n.getUTCFullYear(),l=n.getUTCMonth(),u=Date.UTC(a,l,n.getUTCDate()),c=h=>Date.UTC(a,l+h,Math.min(e,new Date(Date.UTC(a,l+h+1,0)).getUTCDate()));let f=c(0);return f<u&&(f=c(1)),{date:new Date(f).toISOString().slice(0,10),days:(f-u)/864e5}}function bE({content:e,streaming:t}){const[n,a]=A.useState(!1),l=A.useId();return s.jsxs("section",{className:`message reasoning${t?" is-streaming":""}${n?" is-expanded":""}`,children:[s.jsxs("button",{className:"reasoning-toggle",type:"button","aria-expanded":n,"aria-controls":l,onClick:()=>a(u=>!u),children:[s.jsx("span",{className:"reasoning-indicator","aria-hidden":"true"}),s.jsx("span",{children:t?"思考中":"思考过程"}),s.jsx("span",{className:"reasoning-action",children:n?"收起":"展开"}),s.jsx("svg",{className:"reasoning-chevron",width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:s.jsx("path",{d:"m4 2 4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4"})})]}),s.jsx("div",{id:l,hidden:!n&&!t,className:`reasoning-content${n?"":" reasoning-preview"}`,children:s.jsx("div",{className:"message-body",children:n?e:e.slice(-600)})})]})}function wE(e,t){if(!t||typeof t!="object")return null;const{method:n,params:a}=t;if(!a)return null;if(n==="item/completed"){const m=a.item;if((m==null?void 0:m.type)!=="reasoning"||typeof m.id!="string")return null;const g=e.get(m.id)??{itemId:m.id,text:new Map,summary:new Map,completed:!1};for(const v of["text","summary"]){const k=m[v];Array.isArray(k)&&k.forEach((x,S)=>{typeof x=="string"&&x&&g[v].set(S,x)})}return g.completed=!0,e.set(m.id,g),g}const l=/^item\/reasoning\/(text|summaryText)(Delta|Snapshot)$/.exec(n??"");if(!l||typeof a.itemId!="string")return null;const u=l[1]==="text"?"text":"summary",c=a[u==="text"?"contentIndex":"summaryIndex"],f=a[l[2]==="Delta"?"delta":"text"];if(typeof c!="number"||!Number.isSafeInteger(c)||c<0||typeof f!="string")return null;const h=e.get(a.itemId)??{itemId:a.itemId,text:new Map,summary:new Map,completed:!1};return h[u].set(c,l[2]==="Snapshot"?f:(h[u].get(c)??"")+f),e.set(a.itemId,h),h}function kE(e){return[...e.text.size?e.text:e.summary].sort(([n],[a])=>n-a).map(([,n])=>n).join(`
346
+ `:YA(e)?(f=2,h=2):d6(e)&&(f=1,h=1);++u<l.length;)c=c.concat(f6(l[u],e,{whitespace:a,breakBefore:u?void 0:f,breakAfter:u<l.length-1?Jp(l[u+1]):h}));return Gv(e)&&Hv(t,e,Gv)&&c.push(" "),f&&c.unshift(f),h&&c.push(h),c}function h6(e,t){const n=String(e.value),a=[],l=[];let u=0;for(;u<=n.length;){Fv.lastIndex=u;const h=Fv.exec(n),m=h&&"index"in h?h.index:n.length;a.push(QA(n.slice(u,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?t.breakBefore:!0,m===n.length?t.breakAfter:!0)),u=m+1}let c=-1,f;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(l.push(a[c]),f=void 0):a[c]?(typeof f=="number"&&l.push(f),l.push(a[c]),f=0):(c===0||c===a.length-1)&&l.push(0);return l}function ZA(e){return[String(e.value)]}function QA(e,t,n){const a=[];let l=0,u;for(;l<e.length;){Pv.lastIndex=l;const c=Pv.exec(e);u=c?c.index:e.length,!l&&!u&&c&&!t&&a.push(""),l!==u&&a.push(e.slice(l,u)),l=c?u+c[0].length:u}return l!==u&&!n&&a.push(""),a.join(" ")}function m6(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function JA(e){return!!(e.properties||{}).hidden}function eE(e){return e.tagName==="td"||e.tagName==="th"}function tE(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const nE={},rE=[];function aE(e){const t=e||nE;return function(n,a){E1(n,"element",function(l,u){const c=Array.isArray(l.properties.className)?l.properties.className:rE,f=c.includes("language-math"),h=c.includes("math-display"),m=c.includes("math-inline");let g=h;if(!f&&!h&&!m)return;let v=u[u.length-1],k=l;if(l.tagName==="code"&&f&&v&&v.type==="element"&&v.tagName==="pre"&&(k=v,v=u[u.length-2],g=!0),!v)return;const x=KA(k,{whitespace:"pre"});let S;try{S=Zp.renderToString(x,{...t,displayMode:g,throwOnError:!0})}catch(I){const z=I,E=z.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...u,l],cause:z,place:l.position,ruleId:E,source:"rehype-katex"});try{S=Zp.renderToString(x,{...t,displayMode:g,strict:"ignore",throwOnError:!1})}catch{S=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(I)},children:[{type:"text",value:x}]}]}}typeof S=="string"&&(S=$A(S).children);const N=v.children.indexOf(k);return v.children.splice(N,1,...S),Ox})}}function iE(e,t,n){return e?t?n==="delta"?e+t:t.startsWith(e)?t:e:e:t}function lE(e,t,n){if(e.kind||e.status!=="pending")return e.status;const a=[...t].reverse().find(l=>l.nodeId===e.id);return a?a.status==="completed"?n.some(l=>l.executionId===a.id&&l.type==="result")?"delivered":"awaiting_review":["accepted","running","failed","cancelled"].includes(a.status)?a.status:e.status:e.status}function sE(e,t){var l;if(!["input:cotask_report","input:cotask_execution"].includes(e.subtype))return null;const n=Date.parse(e.createdAt);return((l=t.filter(u=>(!e.turnId||e.turnId===u.id)&&Date.parse(u.startedAt)<n&&(!u.finishedAt||n<=Date.parse(u.finishedAt))).sort((u,c)=>Date.parse(c.startedAt)-Date.parse(u.startedAt))[0])==null?void 0:l.id)??null}function oE(e){const t=e.phase??e.status,n=e.nodeActivity;if(!n||["draft","finished","completed","cancelled"].includes(t))return[{status:t}];const a=[];return t!=="running"&&a.push({status:t}),n.blocked>0&&a.push({status:"blocked",count:n.blocked}),n.waiting>0&&a.push({status:"waiting",count:n.waiting}),t==="running"&&(n.running>0||a.length===0)&&a.push({status:"running"}),a}function Yv(e,t){if(e.kind==="checkpoint")return{start:e.startedAt,end:e.finishedAt,active:e.status==="waiting"};const n=t.filter(u=>u.nodeId===e.id),a=n.find(u=>u.startedAt||u.turnId||["running","completed","failed"].includes(u.status)),l=n.at(-1);return{start:a==null?void 0:a.startedAt,end:l==null?void 0:l.finishedAt,active:!!a&&!["completed","cancelled","failed"].includes(e.status)}}function uE(e){return{start:e.startedAt,end:e.finishedAt,active:e.status==="running"}}function cE(e){return`${Math.floor(e/60)}m ${e%60}s`}function e1(e,t){const n=e.start?Date.parse(e.start):NaN,a=e.active?t:e.end?Date.parse(e.end):NaN,l=Number.isFinite(n)?new Intl.DateTimeFormat("en-CA",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(n):[],u=c=>{var f;return((f=l.find(h=>h.type===c))==null?void 0:f.value)??""};return{start:l.length?`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`:"—",duration:Number.isFinite(n)&&Number.isFinite(a)?cE(Math.max(0,Math.floor((a-n)/1e3))):"—"}}function dE({executions:e,name:t,now:n,icon:a,statusLabel:l}){const u=A.useId(),c=A.useRef(null);return A.useEffect(()=>{const f=h=>{const m=c.current;m!=null&&m.matches(":popover-open")&&!(h.target instanceof Node&&m.contains(h.target))&&m.hidePopover()};return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[]),s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"cotask-execution-history-button","aria-label":`${t}:执行历史`,title:`${l} · 查看执行历史`,popoverTarget:u,onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation();const h=f.currentTarget.getBoundingClientRect(),m=c.current;if(!m)return;const g=Math.min(480,window.innerWidth-16);m.style.width=`${g}px`,m.style.left=`${Math.max(8,Math.min(h.right+12,window.innerWidth-g-8))}px`,m.style.top=`${Math.max(8,Math.min(h.top,window.innerHeight-Math.min(320,window.innerHeight-16)-8))}px`},children:a}),Qc.createPortal(s.jsxs("div",{ref:c,id:u,popover:"auto",className:"cotask-execution-history",role:"dialog","aria-label":`${t}执行历史`,onClick:f=>f.stopPropagation(),onPointerDown:f=>f.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"执行历史"}),s.jsxs("span",{children:[e.length," 次执行 · 北京时间"]})]}),s.jsx("div",{className:"cotask-execution-history-scroll",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{"aria-label":"次序"}),s.jsx("th",{children:"开始"}),s.jsx("th",{children:"结束"}),s.jsx("th",{children:"耗时"})]})}),s.jsx("tbody",{children:[...e].reverse().map((f,h)=>{const m=e1(uE(f),n),g=e1({start:f.finishedAt,end:void 0,active:!1},n).start;return s.jsxs("tr",{children:[s.jsxs("td",{children:["#",e.length-h]}),s.jsx("td",{children:m.start}),s.jsx("td",{children:g==="—"&&f.status==="running"?"执行中":g}),s.jsx("td",{children:m.duration})]},f.id)})})]})}),e.some(f=>!f.startedAt&&f.status!=="accepted")&&s.jsx("p",{children:"部分历史执行未记录开始时间,以 — 显示。"})]}),document.body)]})}const hu=184,Qi=64,Wv=e=>`${e.x},${e.y}`,sp=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),fE=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});function t1(e,t,n=0){const a=Math.min(...e.map(g=>g.x)),l=Math.max(...e.map(g=>g.x)),u=Math.min(...e.map(g=>g.y)),c=Math.max(...e.map(g=>g.y));if(l<t.x-4||a>t.x+hu+4||c<t.y-4||u>t.y+(t.height??Qi)+4)return!1;if(n>=16||Math.max(l-a,c-u)<.25)return!0;const f=[e[0]],h=[e[e.length-1]];let m=e;for(;m.length>1;)m=m.slice(1).map((g,v)=>fE(m[v],g)),f.push(m[0]),h.unshift(m[m.length-1]);return t1(f,t,n+1)||t1(h,t,n+1)}function Kv(e,t){return e.every(n=>t.every(a=>!t1(n,a)))}function hE(e,t){const n=[];let a=e[0];const l=(u,c,f)=>{const h=f/sp(u,c);return{x:u.x+(c.x-u.x)*h,y:u.y+(c.y-u.y)*h}};for(let u=1;u<e.length-1;u++){const c=e[u],f=e[u-1],h=e[u+1],m=Math.min(t,sp(c,f)/2,sp(c,h)/2);if(m<.001){n.push([a,c]),a=c;continue}const g=l(c,f,m),v=l(c,h,m);n.push([a,g],[g,c,v]),a=v}return n.push([a,e[e.length-1]]),n}function Xv(e){return`M ${Wv(e[0][0])} `+e.map(t=>`${t.length===4?"C":t.length===3?"Q":"L"} ${t.slice(1).map(Wv).join(" ")}`).join(" ")}function p6(e,t){const n=e[0],a=e[e.length-1],l=(n.y+a.y)/2,u=[[n,{x:n.x,y:l},{x:a.x,y:l},a]];if(a.y>n.y&&Kv(u,t))return{path:Xv(u),segments:u};for(const c of[64,40,24,12,6,2,0]){const f=hE(e,c);if(Kv(f,t))return{path:Xv(f),segments:f}}throw new Error("No unobstructed CoTask route")}function mE(e){return JSON.stringify(e.map(t=>({id:t.id,dependencies:[...t.dependencies].sort(),height:t.height??Qi})).sort((t,n)=>t.id.localeCompare(n.id)))}function g6(e){const t=new Map,n=new Map,a=new Map(e.map(x=>[x.id,x])),l=[];for(;a.size;){const x=[...a.values()].filter(N=>N.dependencies.every(I=>n.has(I)||!a.has(I))),S=x.length?x:[...a.values()];l.push(S);for(const N of S)a.delete(N.id),n.set(N.id,l.length-1)}const u=Math.max(1,...l.map(x=>x.length))*296-24,c=[];let f=24;l.forEach(x=>{x.forEach((N,I)=>t.set(N.id,{x:(u-(x.length*296-72))/2+I*296,y:f}));const S=f+Math.max(Qi,...x.map(N=>N.height??Qi));c.push(S),f=S+80});const h=new Map(e.map(x=>[x.id,x.height??Qi])),m=[...t].map(([x,S])=>({id:x,...S,height:h.get(x)})),g=[],v=[];let k=u;for(const x of e)for(const S of x.dependencies){const N=t.get(S),I=t.get(x.id);if(!N||!I)continue;const z={x:N.x+hu/2,y:N.y+(h.get(S)??Qi)},E={x:I.x+hu/2,y:I.y};k+=18;const q=c[n.get(S)]+25,R=[z,{x:z.x,y:q},{x:k,y:q},{x:k,y:E.y-25},{x:E.x,y:E.y-25},E],Z=m.filter(P=>P.id!==S&&P.id!==x.id);try{g.push({source:S,target:x.id,path:p6(R,Z).path})}catch{v.push({source:S,target:x.id})}}return{positions:t,edges:g,failedEdges:v,width:k+48,height:Math.max(124,f-80+24)}}async function pE(e){var m;if(!e.length)return g6(e);const{default:t}=await on(async()=>{const{default:g}=await import("./elk.bundled-BRvn4fy1.js").then(v=>v.e);return{default:g}},[],import.meta.url),n=new Set(e.map(g=>g.id)),a=e.flatMap(g=>g.dependencies.filter(v=>n.has(v)).map(v=>({source:v,target:g.id}))),u=await new t().layout({id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.spacing.nodeNode":"40","elk.layered.spacing.nodeNodeBetweenLayers":"80","elk.layered.spacing.edgeNodeBetweenLayers":"18","elk.padding":"[top=24,left=24,bottom=24,right=24]","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX"},children:e.map(g=>({id:g.id,width:hu,height:g.height??Qi})),edges:a.map((g,v)=>({id:`edge-${v}`,sources:[g.source],targets:[g.target]}))}),c=(u.children??[]).map(g=>({id:g.id,x:g.x??0,y:g.y??0,height:g.height})),f=new Map((m=u.edges)==null?void 0:m.map(g=>[g.id,g])),h=a.map((g,v)=>{var S,N;const k=(N=(S=f.get(`edge-${v}`))==null?void 0:S.sections)==null?void 0:N[0];if(!k)throw new Error("Missing CoTask dependency route");const x=[k.startPoint,...k.bendPoints??[],k.endPoint];return{...g,path:p6(x,c.filter(I=>I.id!==g.source&&I.id!==g.target)).path}});return{positions:new Map(c.map(g=>[g.id,g])),edges:h,width:u.width??320,height:u.height??196}}const Zv={pending:"待开始",completed:"已确认完成",blocked:"已阻塞",cancelled:"已取消",running:"执行中",accepted:"等待执行",failed:"执行失败",delivered:"已交付,待确认",awaiting_review:"执行已结束,待确认"};function Qv({status:e,label:t}){const n=e==="completed"?"m6 12 4 4 8-8":["blocked","failed"].includes(e)?"M12 6v7m0 3v1":e==="cancelled"?"m8 8 8 8m0-8-8 8":e==="pending"?"M8 12h8":["paused","pausing"].includes(e)?"M9 7v10M15 7v10":"M12 6v6l4 2";return s.jsx("span",{className:`cotask-node-state-icon ${e}`,role:"img","aria-label":t,title:t,children:["running","accepted"].includes(e)?s.jsx("span",{className:"cotask-status-spinner","aria-hidden":"true"}):s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:n})]})})}function gE({nodes:e,members:t,executions:n,reports:a,selectedId:l,onSelect:u,onDismiss:c,detail:f,finalCheckpointId:h}){var J,O;const[m,g]=A.useState(Date.now),v=e.some(U=>{const me=Yv(U,n);return me.active&&!!me.start})||n.some(U=>U.status==="running"&&!!U.startedAt);A.useEffect(()=>{if(!v)return;g(Date.now());const U=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(U)},[v]);const k=e.some(U=>U.kind!==void 0),x=(U,me)=>U.kind==="checkpoint"?{pending:"等待前置完成",waiting:"等待 Owner 继续",completed:"已继续"}[me]??Zv[me]??me:U.kind&&me==="completed"?"已完成":Zv[me]??me,[S,N]=A.useState({}),I=A.useRef(new Map);A.useEffect(()=>{const U=new ResizeObserver(()=>{N(me=>{const Ce=Object.fromEntries([...I.current].map(([De,et])=>[De,et.offsetHeight]));return Object.keys(Ce).length===Object.keys(me).length&&Object.entries(Ce).every(([De,et])=>me[De]===et)?me:Ce})});return I.current.forEach(me=>U.observe(me)),()=>U.disconnect()},[e.map(U=>U.id).join("\0")]);const z=mE(e.map(U=>({...U,height:S[U.id]??(U.kind==="checkpoint"?48:Qi)}))),E=A.useMemo(()=>g6(JSON.parse(z)),[z]),[q,R]=A.useState(null),[Z,P]=A.useState(!1),$=(q==null?void 0:q.topology)===z?q.graph:E;A.useEffect(()=>{let U=!0;return P(!1),pE(JSON.parse(z)).then(me=>{U&&R({topology:z,graph:me})}).catch(()=>{U&&P(!0)}),()=>{U=!1}},[z]);const te=A.useRef(null),[ne,G]=A.useState({width:900,height:560}),[pe,ee]=A.useState(1),[ke,ve]=A.useState(!1),se=A.useRef(!1),Y=A.useRef(null),fe=A.useId().replace(/:/g,"");A.useEffect(()=>{if(!te.current)return;const U=new ResizeObserver(([me])=>G({width:me.contentRect.width,height:me.contentRect.height}));return U.observe(te.current),()=>U.disconnect()},[]);const K=Math.min(1,Math.max(.15,Math.min((ne.width-32)/$.width,(ne.height-32)/$.height))),je=pe??K,H=new Map(e.map(U=>[U.id,lE(U,n,a)])),L=e.find(U=>U.id===l);return s.jsxs("section",{className:"cotask-graph","aria-label":"Task dependency graph",children:[s.jsxs("div",{className:"cotask-graph-toolbar",children:[s.jsxs("span",{children:["Arrows show dependencies ",s.jsxs("span",{className:"cotask-graph-count",children:["· ",e.length," nodes / ",$.edges.length+(((J=$.failedEdges)==null?void 0:J.length)??0)," dependencies"]}),Z&&s.jsx("small",{role:"status",children:" · 自动布局暂不可用,已显示基础布局"})]}),s.jsxs("div",{children:[s.jsx("button",{"aria-label":"Zoom out",onClick:()=>ee(Math.max(.15,je-.15)),children:"−"}),s.jsxs("span",{children:[Math.round(je*100),"%"]}),s.jsx("button",{"aria-label":"Zoom in",onClick:()=>ee(Math.min(2,je+.15)),children:"+"}),s.jsx("button",{onClick:()=>ee(1),children:"100%"}),s.jsx("button",{onClick:()=>ee(null),children:"Fit to view"})]})]}),!!((O=$.failedEdges)!=null&&O.length)&&s.jsxs("details",{className:"cotask-warning",role:"status",children:[s.jsxs("summary",{children:[$.failedEdges.length," 条依赖连线暂未能绘制,节点仍可查看"]}),s.jsx("ul",{children:$.failedEdges.map(U=>{var me,Ce;return s.jsxs("li",{children:[((me=e.find(De=>De.id===U.source))==null?void 0:me.name)??U.source," → ",((Ce=e.find(De=>De.id===U.target))==null?void 0:Ce.name)??U.target]},`${U.source}:${U.target}`)})})]}),s.jsxs("div",{className:"cotask-graph-stage",children:[s.jsx("div",{className:`cotask-graph-viewport${ke?" dragging":""}`,ref:te,"data-layout":(q==null?void 0:q.topology)===z?"adaptive":"fallback",onClickCapture:U=>{se.current&&(U.preventDefault(),U.stopPropagation())},onClick:U=>{U.target.closest("button")||c()},onPointerDown:U=>{if(U.button!==0||U.target.closest(".cotask-node-text"))return;se.current=!1;const me=U.currentTarget;Y.current={id:U.pointerId,x:U.clientX,y:U.clientY,left:me.scrollLeft,top:me.scrollTop,moved:!1}},onPointerMove:U=>{if(!Y.current||Y.current.id!==U.pointerId)return;const me=U.clientX-Y.current.x,Ce=U.clientY-Y.current.y;Math.abs(me)+Math.abs(Ce)>4&&(Y.current.moved=!0,ve(!0),U.currentTarget.setPointerCapture(U.pointerId),U.preventDefault()),Y.current.moved&&(U.currentTarget.scrollLeft=Y.current.left-me,U.currentTarget.scrollTop=Y.current.top-Ce)},onPointerUp:U=>{Y.current&&(se.current=Y.current.moved,Y.current=null,ve(!1),U.currentTarget.hasPointerCapture(U.pointerId)&&U.currentTarget.releasePointerCapture(U.pointerId),window.setTimeout(()=>{se.current=!1},0))},onPointerCancel:()=>{Y.current=null,ve(!1)},onLostPointerCapture:()=>{Y.current=null,ve(!1)},children:s.jsx("div",{className:"cotask-graph-scroll",style:{width:Math.max(ne.width,$.width*je),height:Math.max(ne.height,$.height*je)},children:s.jsxs("div",{className:"cotask-graph-canvas",style:{width:$.width,height:$.height,transform:`scale(${je})`,left:0,top:0},children:[s.jsxs("svg",{width:$.width,height:$.height,className:"cotask-graph-edges","aria-hidden":"true",children:[s.jsx("defs",{children:["default","complete","selected"].map(U=>s.jsx("marker",{id:`${fe}-${U}`,markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 1 1 L 7 4 L 1 7 Z",className:`cotask-arrow-${U}`})},U))}),$.edges.map(U=>{const me=l&&[U.source,U.target].includes(l)?"selected":H.get(U.source)==="completed"?"complete":"default";return s.jsx("path",{"data-source":U.source,"data-target":U.target,d:U.path,className:`cotask-edge ${me}`,markerEnd:`url(#${fe}-${me})`},`${U.source}:${U.target}`)})]}),e.map(U=>{var he,_e;const me=$.positions.get(U.id),Ce=H.get(U.id),De=e1(Yv(U,n),m),et=n.filter(He=>He.nodeId===U.id);return s.jsxs(A.Fragment,{children:[s.jsxs("button",{ref:He=>{He?I.current.set(U.id,He):I.current.delete(U.id)},className:`cotask-graph-node ${Ce}${U.kind==="checkpoint"?" checkpoint":""}${l===U.id?" selected":""}`,style:{left:me.x,top:me.y,width:hu,minHeight:U.kind==="checkpoint"?48:Qi},"aria-pressed":l===U.id,onClick:()=>u(U),title:U.dependencies.length?`Depends on: ${U.dependencies.map(He=>{var We;return((We=e.find(Qe=>Qe.id===He))==null?void 0:We.name)??He}).join(", ")}`:"No dependencies",children:[U.dependencies.length>0&&s.jsx("i",{className:"cotask-node-port input"}),s.jsx("strong",{className:"cotask-node-text",title:U.name,children:U.name}),U.kind!=="checkpoint"&&s.jsx("span",{className:"cotask-graph-node-footer",children:s.jsx("span",{className:"cotask-graph-node-member cotask-node-text",title:((he=t.find(He=>He.id===U.memberId))==null?void 0:he.name)??U.memberId??void 0,children:((_e=t.find(He=>He.id===U.memberId))==null?void 0:_e.name)??U.memberId})}),s.jsxs("span",{className:"cotask-node-timing cotask-node-text",title:U.kind==="checkpoint"?`北京时间 ${De.start} · ${De.duration};从到达检查点至继续或取消,包含等待时间`:`北京时间 ${De.start} · ${De.duration};首次执行开始至最终结束,包含暂停和中间等待时间`,"aria-label":`Start ${De.start}, elapsed ${De.duration}`,children:[De.start," · ",De.duration]}),$.edges.some(He=>He.source===U.id)&&s.jsx("i",{className:"cotask-node-port output"})]}),s.jsx("div",{className:`cotask-node-icons ${Ce}`,style:{left:me.x+hu-3,top:me.y+3},onPointerDown:He=>He.stopPropagation(),onClick:He=>He.stopPropagation(),children:et.length>1?s.jsx(dE,{executions:et,name:U.name,now:m,statusLabel:x(U,Ce),icon:s.jsx(Qv,{status:Ce,label:x(U,Ce)})}):s.jsx(Qv,{status:Ce,label:x(U,Ce)})})]},U.id)})]})})}),L&&s.jsxs("aside",{className:"cotask-node-drawer","aria-label":`Node details: ${L.name}`,onKeyDown:U=>{U.key==="Escape"&&(U.stopPropagation(),c())},children:[s.jsxs("header",{children:[s.jsx("strong",{children:L.name}),s.jsx("button",{onClick:c,"aria-label":"Close node details",children:"关闭"})]}),s.jsx("div",{className:"cotask-node-drawer-content",children:f},L.id)]})]}),s.jsxs("div",{className:"cotask-graph-legend",children:[s.jsxs("span",{children:[s.jsx("i",{className:"running"}),"执行中"]}),s.jsxs("span",{children:[s.jsx("i",{className:"delivered"}),k?"检查点等待继续":"待 Owner 确认"]}),s.jsxs("span",{children:[s.jsx("i",{className:"completed"}),k?"已完成 / 已继续":"已确认完成"]}),s.jsxs("span",{children:[s.jsx("i",{className:"pending"}),"待开始"]}),s.jsx("span",{children:k?"执行节点报告结果并正常结束后自动完成;检查点由 Owner 检查后继续":"点击节点查看上下文与报告;成员执行结束不等于节点已确认完成"})]})]})}const y6=e=>({draft:"草稿",running:"运行中",pausing:"正在暂停",paused:"已暂停",waiting:"等待继续",finished:"已结束",pending:"Pending",completed:"Completed",blocked:"Blocked",cancelled:"Cancelled",accepted:"Accepted",failed:"Failed"})[e]??e;function op({task:e,compact:t=!1}){const n=oE(e),a={running:["active","进行中","M8 5l10 7-10 7Z"],finished:["done","已结束","m6 12 4 4 8-8"],completed:["done","已结束","m6 12 4 4 8-8"],paused:["attention","已暂停","M9 7v10M15 7v10"],pausing:["attention","正在暂停","M9 7v10M15 7v10"],waiting:["attention","等待检查","M12 6v6l4 2"],blocked:["danger","存在阻塞","M12 6v7m0 3v1"],failed:["danger","失败","M12 6v7m0 3v1"],cancelled:["neutral","已取消","m8 8 8 8m0-8-8 8"],draft:["neutral","草稿","M8 8h8M8 12h8M8 16h5"]};return s.jsx("span",{className:"cotask-task-statuses",children:n.map(({status:l,count:u})=>{const c=t&&!["blocked","waiting"].includes(l)?void 0:u,[f,h,m]=a[l]??["neutral",y6(l),"M12 6v6l4 2"];return s.jsxs("span",{className:`cotask-task-status ${f}${t?" icon-only":""}`,title:`${h}${c!=null?` · ${c}`:""}`,"aria-label":`${h}${c!=null?` · ${c}`:""}`,children:[t&&l==="running"?s.jsx("span",{className:"cotask-status-spinner","aria-hidden":"true"}):t&&c!=null&&c>1?s.jsx("span",{className:"cotask-status-count","aria-hidden":"true",children:c}):s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:m})]}),!t&&s.jsxs(s.Fragment,{children:[h,c!=null&&` · ${c}`]})]},l)})})}function yE({ownerId:e,ownerName:t,request:n,onExpanded:a,renderMember:l,renderMarkdown:u,preferenceKey:c}){const[f,h]=A.useState([]),[m,g]=A.useState(()=>{try{return!!c&&window.localStorage.getItem(c)==="true"}catch{return!1}}),v=be=>{g(be);try{c&&window.localStorage.setItem(c,String(be))}catch{}},[k,x]=A.useState(null),[S,N]=A.useState(null),[I,z]=A.useState("graph"),[E,q]=A.useState(null),[R,Z]=A.useState(null),[P,$]=A.useState(null),[te,ne]=A.useState([]),[G,pe]=A.useState(null),[ee,ke]=A.useState(null),[ve,se]=A.useState([]),[Y,fe]=A.useState(""),[K,je]=A.useState(!1),H=A.useRef(null),L=A.useRef(0),J=A.useRef("");J.current=`${k}:${S==null?void 0:S.task.revision}`;const O=A.useRef(E);O.current=E;const U=`conversations/${encodeURIComponent(e)}/cotasks`;A.useEffect(()=>{let be=!0;const lt=async()=>{try{const vt=await n(U);be&&h(vt.tasks)}catch(vt){be&&fe(String(vt))}};lt();const ft=window.setInterval(()=>void lt(),5e3);return()=>{be=!1,window.clearInterval(ft)}},[U,n]),A.useEffect(()=>(a(k!==null),()=>a(!1)),[k,a]),A.useEffect(()=>{if(!k)return;let be=!0;const lt=async()=>{try{const vt=await n(`${U}/${encodeURIComponent(k)}`);if(be&&(N(vt),fe("")),I==="operations"){const Ct=await n(`${U}/${encodeURIComponent(k)}`,{operations:!0});be&&se(Ct.operations)}}catch(vt){be&&fe(String(vt))}};lt();const ft=window.setInterval(()=>void lt(),3e3);return()=>{be=!1,window.clearInterval(ft)}},[k,U,n,I]),A.useEffect(()=>{var be;k&&((be=H.current)==null||be.focus())},[k]),A.useEffect(()=>{L.current++,pe(null),ke(null),ne([])},[S==null?void 0:S.task.revision]);const me=JSON.stringify(S==null?void 0:S.reports.map(be=>be.id)),Ce=JSON.stringify(S==null?void 0:S.nodes.map(be=>[be.id,be.status,be.reason]));A.useEffect(()=>{if(!k||!R||!S)return;let be=!0;if(!S.nodes.some(lt=>lt.id===R)){Z(null),$(null);return}return n(`${U}/${encodeURIComponent(k)}`,{nodeIds:[R]}).then(lt=>{be&&$(lt.nodes[0]??null)}).catch(lt=>{be&&fe(String(lt))}),()=>{be=!1}},[k,R,S==null?void 0:S.task.revision,me,Ce,U,n]);const De=be=>{Z(null),L.current++,pe(null),ke(null),se([]),fe(""),N(null),x(be),z("graph"),q(null),$(null),ne([])},et=()=>{L.current++,Z(null),$(null),ne([])},he=()=>{L.current++,x(null)},_e=f.find(be=>be.status==="running")??f.find(be=>be.status==="draft")??f[0];if(!k&&_e&&m)return s.jsxs("button",{type:"button",className:"cotask-launcher cotask-launcher-collapsed","aria-label":"Expand CoTask","aria-expanded":!1,title:"Expand CoTask",onClick:()=>v(!1),children:[s.jsx("span",{"aria-hidden":"true",children:"‹"}),s.jsx("span",{className:"cotask-launcher-label",children:"CoTask"}),s.jsx("small",{children:f.length})]});if(!k)return _e?s.jsxs("div",{className:"cotask-launcher",children:[s.jsx("button",{type:"button",className:"cotask-launcher-collapse","aria-label":"Collapse CoTask","aria-expanded":!0,title:"Collapse CoTask",onClick:()=>v(!0),children:s.jsx("svg",{width:"12",height:"64",viewBox:"0 0 12 64",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("path",{d:"M3 5 9 32 3 59"})})}),s.jsxs("button",{className:"cotask-launch-primary",onClick:()=>De(_e.id),children:[s.jsxs("span",{className:"cotask-launch-heading",children:[s.jsx("span",{children:"CoTask"}),s.jsx(op,{task:_e,compact:!0})]}),s.jsx("strong",{children:_e.name}),s.jsxs("span",{className:"cotask-launch-progress",children:[s.jsx("progress",{"aria-label":"Completed nodes",value:_e.completedNodeCount??0,max:Math.max(1,_e.nodeCount)}),s.jsxs("span",{children:[_e.completedNodeCount??0,"/",_e.nodeCount]})]})]}),f.length>1&&s.jsxs("details",{className:"cotask-task-list",children:[s.jsxs("summary",{children:["Other tasks (",f.length-1,")"]}),f.filter(be=>be.id!==_e.id).map(be=>s.jsxs("button",{onClick:()=>De(be.id),children:[s.jsx("strong",{children:be.name}),s.jsx(op,{task:be,compact:!0})]},be.id))]})]}):null;const He=be=>{R!==be.id&&(L.current++,fe(""),$(null),ne([]),Z(be.id))},We=async be=>{const lt=++L.current;try{const ft=await n(`${U}/${k}`,{reportIds:[be.id]});lt===L.current&&ne(ft.reports)}catch(ft){fe(String(ft))}},Qe=S==null?void 0:S.bindings.find(be=>be.memberId===E),Xe=S==null?void 0:S.members.find(be=>be.id===E),yt=(be,lt=e)=>s.jsx("div",{className:"cotask-markdown",children:u(be??"",lt)});return s.jsx("div",{className:"context-panel-overlay settings-overlay cotask-overlay",children:s.jsxs("section",{className:"context-panel settings-panel cotask-frame",role:"dialog","aria-modal":"true","aria-label":"CoTask",tabIndex:-1,ref:H,onKeyDown:be=>{var lt;if(be.stopPropagation(),be.key==="Escape"&&(be.preventDefault(),I==="graph"&&R?et():he()),be.key==="Tab"){const ft=(lt=H.current)==null?void 0:lt.querySelectorAll('button:not(:disabled),select,input,a[href],textarea,[tabindex="0"]');if(!(ft!=null&&ft.length))return;const vt=ft[0],Ct=ft[ft.length-1];be.shiftKey&&(document.activeElement===vt||document.activeElement===H.current)?(be.preventDefault(),Ct.focus()):!be.shiftKey&&document.activeElement===Ct&&(be.preventDefault(),vt.focus())}},children:[s.jsxs("header",{className:"cotask-header settings-panel-header",children:[s.jsxs("div",{children:[s.jsxs("p",{children:["CoTask · ",t]}),s.jsxs("div",{className:"cotask-title-row",children:[s.jsx("h1",{children:(S==null?void 0:S.task.name)??"Loading task…"}),(S==null?void 0:S.task.status)==="draft"&&s.jsx("button",{className:"cotask-close-draft",type:"button",disabled:K,onClick:async()=>{if(!window.confirm(`Close draft “${S.task.name}”? It will not run. The task history will be retained.`))return;const be=k,lt=J.current;je(!0),fe("");try{const ft=await n(`${U}/${encodeURIComponent(be)}/close-draft`,{expectedRevision:S.task.revision},"POST");h(vt=>vt.map(Ct=>Ct.id===be?ft.task:Ct)),J.current===lt&&N(vt=>vt&&{...vt,task:ft.task})}catch(ft){J.current===lt&&fe(String(ft))}finally{je(!1)}},children:K?"Closing…":"Close draft"})]})]}),S&&s.jsx(op,{task:S.task}),s.jsxs("button",{className:"cotask-back",onClick:he,title:`Back to ${t}`,children:[s.jsx("span",{"aria-hidden":"true",children:"← "}),"Back"]})]}),s.jsxs("aside",{className:"cotask-nav",children:[s.jsxs("section",{className:"workspace-group","aria-label":"Task navigation",children:[s.jsx("h2",{className:"cotask-nav-group-title",children:"Task"}),s.jsx("nav",{className:"workspace-group-items",children:[["graph","Task graph"],["operations","Activity"],["settings","Settings"]].map(([be,lt])=>s.jsx("button",{className:`session-item${I===be?" active":""}`,"aria-current":I===be?"page":void 0,onClick:()=>{z(be),q(null)},children:s.jsx("span",{className:"session-title",children:lt})},be))})]}),s.jsxs("section",{className:"workspace-group","aria-label":"Task members",children:[s.jsx("h2",{className:"cotask-nav-group-title",children:"Members"}),s.jsx("div",{className:"workspace-group-items cotask-member-list",children:S==null?void 0:S.members.map(be=>{const lt=S.executions.some(vt=>vt.memberId===be.id&&["accepted","running"].includes(vt.status)),ft=lt?"Running":S.bindings.some(vt=>vt.memberId===be.id&&vt.workspaceId)?"Idle":"Not created";return s.jsx("button",{className:`session-item${I==="member"&&E===be.id?" active":""}`,title:`${be.name} · ${ft}`,"aria-label":`${be.name} · ${ft}`,"aria-current":I==="member"&&E===be.id?"page":void 0,onClick:()=>{q(be.id),z("member")},children:s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{className:`session-status${lt?" running":""}`,"aria-hidden":"true"}),s.jsx("span",{className:"session-title",children:be.name})]})},be.id)})})]})]}),s.jsxs("section",{className:"cotask-main",children:[Y&&s.jsx("div",{className:"cotask-error",role:"alert",children:Y}),s.jsx("div",{className:`cotask-body${I==="graph"?" cotask-graph-body":I==="member"?" cotask-member-body":""}`,children:S?s.jsxs(s.Fragment,{children:[S.warnings.length>0&&s.jsx("div",{className:"cotask-warning",children:S.warnings.map((be,lt)=>s.jsxs("p",{children:[be.id?`${be.id}: `:"Common context: ","Context may exceed the injection limit. (estimated ",be.estimatedTokens," tokens)"]},lt))}),I==="graph"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cotask-section-heading",children:[s.jsx("h2",{children:"Task graph"}),s.jsxs("span",{children:[S.nodes.filter(be=>be.status==="completed").length," / ",S.nodes.length," Completed"]})]}),!S.nodes.length&&s.jsx("p",{children:"No nodes yet. Discuss the plan with the initiating agent to define the graph."}),s.jsxs("details",{className:"cotask-context",onToggle:be=>{if(be.currentTarget.open&&G===null){const lt=J.current;n(`${U}/${k}`,{view:"definition"}).then(ft=>{J.current===lt&&pe(ft.definition.commonContext)}).catch(ft=>{J.current===lt&&fe(String(ft))})}},children:[s.jsx("summary",{children:"Common context"}),G===null?s.jsx("p",{children:"Loading…"}):yt(G)]},S.task.revision),S.nodes.length>0&&s.jsx(gE,{finalCheckpointId:S.finalCheckpointId,nodes:S.nodes,members:S.members,executions:S.executions,reports:S.reports,selectedId:R??void 0,onSelect:be=>void He(be),onDismiss:et,detail:(P==null?void 0:P.definition.id)===R?s.jsxs("div",{className:"cotask-node-detail",children:[P.runtime&&s.jsxs("p",{children:[y6(P.runtime.status),P.runtime.reason&&s.jsxs(s.Fragment,{children:[" · ",P.runtime.reason]})]}),yt(P.definition.context),s.jsx("h4",{children:P.definition.kind==="checkpoint"?"检查点":"Reports"}),P.reports.length?P.reports.map(be=>s.jsxs("button",{onClick:()=>void We(be),children:[be.type," · ",be.summary]},be.id)):s.jsx("p",{children:P.definition.kind==="checkpoint"?"此节点不启动成员执行,也不生成成员报告。Owner 按上下文检查交付内容后继续。":"No reports yet."}),te.map(be=>{var lt;return s.jsxs("article",{children:[s.jsx("h4",{children:be.summary}),yt(be.content,((lt=S.executions.find(ft=>ft.id===be.executionId))==null?void 0:lt.workspaceId)??"")]},be.id)})]}):s.jsx("p",{children:"Loading node…"})}),S.task.conclusion&&s.jsxs("details",{className:"cotask-conclusion",children:[s.jsx("summary",{children:"Conclusion"}),yt(S.task.conclusion)]})]}),I==="operations"&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Activity"}),s.jsx("p",{children:"Changes are saved immediately and retained if a turn fails."}),ve.length?ve.map((be,lt)=>s.jsxs("details",{className:"cotask-operation",children:[s.jsxs("summary",{children:[String(be.action)," · ",String(be.status)," · Turn ",String(be.turnStatus)]}),s.jsx("pre",{children:JSON.stringify(be,null,2)})]},lt)):s.jsx("p",{children:"No activity yet."})]}),I==="settings"&&s.jsx(s.Fragment,{children:s.jsx(vE,{task:S.task,path:`${U}/${k}/settings`,request:n,onSaved:be=>N({...S,task:be})},k)}),I==="member"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cotask-section-heading",children:[s.jsx("h2",{children:Xe==null?void 0:Xe.name}),s.jsx("span",{children:"CoTask member"})]}),s.jsxs("details",{className:"cotask-context",onToggle:be=>{if(be.currentTarget.open&&E&&(ee==null?void 0:ee.id)!==E){const lt=E,ft=J.current;n(`${U}/${k}`,{memberIds:[lt]}).then(vt=>{var Ct;J.current===ft&&O.current===lt&&ke({id:lt,context:((Ct=vt.members[0])==null?void 0:Ct.context)??""})}).catch(vt=>{J.current===ft&&O.current===lt&&fe(String(vt))})}},children:[s.jsx("summary",{children:"Member context"}),(ee==null?void 0:ee.id)===E?yt(ee.context):s.jsx("p",{children:"Loading…"})]},`${E}:${S.task.revision}`),Qe!=null&&Qe.workspaceId?l(Qe.workspaceId):s.jsx("p",{children:S.executions.some(be=>be.memberId===E)?"This member instance was removed. Execution history is retained.":S.task.executionMode==="self_driving"?"首次符合执行条件时,平台自动创建此成员实例。":"This member will be created when its first node is driven."})]})]}):s.jsx("p",{children:"Loading task…"})})]})]})})}function vE({task:e,path:t,request:n,onSaved:a}){var E,q;const[l,u]=A.useState({...e.runtimeSettings,mode:e.runtimeSettings.mode??"custom",fastMode:e.runtimeSettings.fastMode??!1}),[c,f]=A.useState(e.revision),[h,m]=A.useState([]),[g,v]=A.useState([]),[k,x]=A.useState(!1),[S,N]=A.useState("");A.useEffect(()=>{let R=!0;return Promise.all([n("settings/runtime/models?refresh=0"),n("settings/model-providers/options")]).then(([Z,P])=>{R&&(m(Z.models),v(P.channels))}).catch(Z=>{R&&N(String(Z))}),()=>{R=!1}},[n]);const I=h.find(R=>R.model===l.model||R.id===l.model),z=((E=I==null?void 0:I.supportedReasoningEfforts)==null?void 0:E.map(R=>R.reasoningEffort))??["none","minimal","low","medium","high","xhigh","max"];return s.jsxs("section",{className:"cotask-settings",children:[s.jsx("h2",{children:"Settings"}),s.jsx("p",{children:"Settings apply to the whole CoTask and take effect on each member’s next turn."}),s.jsxs("label",{children:["配置模式",s.jsxs("select",{value:l.mode,onChange:R=>u({...l,mode:R.target.value}),children:[s.jsx("option",{value:"global",children:"沿用 CoTask 默认配置"}),s.jsx("option",{value:"custom",children:"CoTask 自定义配置"})]})]}),l.mode==="global"?s.jsx("p",{children:"每个成员在下一次 turn 读取最新 CoTask 默认模型、推理强度和倍速设置;正在运行的 turn 不受影响。"}):s.jsxs(s.Fragment,{children:[s.jsxs("label",{children:["Model source",s.jsxs("select",{value:l.modelSource.type==="codex"?"codex":l.modelSource.channelId,onChange:R=>u({...l,modelSource:R.target.value==="codex"?{type:"codex"}:{type:"custom",channelId:R.target.value}}),children:[s.jsx("option",{value:"codex",children:"Codex"}),l.modelSource.type==="custom"&&!g.some(R=>R.id===l.modelSource.channelId)&&s.jsx("option",{value:l.modelSource.channelId,children:"Current channel unavailable"}),g.map(R=>s.jsx("option",{value:R.id,children:R.name},R.id))]})]}),l.modelSource.type==="codex"?s.jsxs(s.Fragment,{children:[s.jsxs("label",{children:[s.jsx("span",{children:"1.5 倍速(Fast mode)"}),s.jsx("input",{type:"checkbox",checked:l.fastMode,onChange:R=>u({...l,fastMode:R.target.checked})})]}),s.jsxs("label",{children:["Model",s.jsxs("select",{value:l.model,onChange:R=>u({...l,model:R.target.value}),children:[s.jsx("option",{value:"",children:"Default model"}),l.model&&!h.some(R=>R.model===l.model)&&s.jsx("option",{children:l.model}),h.map(R=>s.jsx("option",{value:R.model,children:R.displayName},R.id))]})]}),s.jsxs("label",{children:["Reasoning effort",s.jsxs("select",{value:l.reasoningEffort,onChange:R=>u({...l,reasoningEffort:R.target.value}),children:[s.jsx("option",{value:"",children:"Default"}),l.reasoningEffort&&!z.includes(l.reasoningEffort)&&s.jsx("option",{children:l.reasoningEffort}),z.map(R=>s.jsx("option",{children:R},R))]})]})]}):s.jsxs("p",{children:["Channel model: ",((q=g.find(R=>R.id===l.modelSource.channelId))==null?void 0:q.model)??"Channel unavailable",". Codex reasoning effort does not apply to custom channels."]})]}),s.jsx("button",{disabled:k,onClick:async()=>{x(!0),N("");try{const R=await n(t,{expectedRevision:c,runtimeSettings:l},"PUT");f(R.task.revision),a(R.task),N("Saved. Changes take effect on the next turn.")}catch(R){N(`${String(R)}. If the task changed, reopen Settings before saving.`)}finally{x(!1)}},children:k?"Saving…":"Save settings"}),S&&s.jsx("p",{role:"status",children:S})]})}function xE(e,t=new Date){if(e==null||!Number.isInteger(e)||e<1||e>31)return null;const n=new Date(t.getTime()+480*60*1e3),a=n.getUTCFullYear(),l=n.getUTCMonth(),u=Date.UTC(a,l,n.getUTCDate()),c=h=>Date.UTC(a,l+h,Math.min(e,new Date(Date.UTC(a,l+h+1,0)).getUTCDate()));let f=c(0);return f<u&&(f=c(1)),{date:new Date(f).toISOString().slice(0,10),days:(f-u)/864e5}}function bE({content:e,streaming:t}){const[n,a]=A.useState(!1),l=A.useId();return s.jsxs("section",{className:`message reasoning${t?" is-streaming":""}${n?" is-expanded":""}`,children:[s.jsxs("button",{className:"reasoning-toggle",type:"button","aria-expanded":n,"aria-controls":l,onClick:()=>a(u=>!u),children:[s.jsx("span",{className:"reasoning-indicator","aria-hidden":"true"}),s.jsx("span",{children:t?"思考中":"思考过程"}),s.jsx("span",{className:"reasoning-action",children:n?"收起":"展开"}),s.jsx("svg",{className:"reasoning-chevron",width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:s.jsx("path",{d:"m4 2 4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4"})})]}),s.jsx("div",{id:l,hidden:!n&&!t,className:`reasoning-content${n?"":" reasoning-preview"}`,children:s.jsx("div",{className:"message-body",children:n?e:e.slice(-600)})})]})}function wE(e,t){if(!t||typeof t!="object")return null;const{method:n,params:a}=t;if(!a)return null;if(n==="item/completed"){const m=a.item;if((m==null?void 0:m.type)!=="reasoning"||typeof m.id!="string")return null;const g=e.get(m.id)??{itemId:m.id,text:new Map,summary:new Map,completed:!1};for(const v of["text","summary"]){const k=m[v];Array.isArray(k)&&k.forEach((x,S)=>{typeof x=="string"&&x&&g[v].set(S,x)})}return g.completed=!0,e.set(m.id,g),g}const l=/^item\/reasoning\/(text|summaryText)(Delta|Snapshot)$/.exec(n??"");if(!l||typeof a.itemId!="string")return null;const u=l[1]==="text"?"text":"summary",c=a[u==="text"?"contentIndex":"summaryIndex"],f=a[l[2]==="Delta"?"delta":"text"];if(typeof c!="number"||!Number.isSafeInteger(c)||c<0||typeof f!="string")return null;const h=e.get(a.itemId)??{itemId:a.itemId,text:new Map,summary:new Map,completed:!1};return h[u].set(c,l[2]==="Snapshot"?f:(h[u].get(c)??"")+f),e.set(a.itemId,h),h}function kE(e){return[...e.text.size?e.text:e.summary].sort(([n],[a])=>n-a).map(([,n])=>n).join(`
347
347
 
348
348
  `)}function SE({id:e,baseUrl:t,query:n}){var g;const[a,l]=A.useState(null),[u,c]=A.useState(!1),[f,h]=A.useState(!1),m=async()=>{c(!0),h(!1);try{const v=await n(e);v.status==="ok"||v.status==="unsupported"?l(v):(h(!0),l(k=>(k==null?void 0:k.status)==="ok"?k:v))}catch{h(!0)}finally{c(!1)}};return A.useEffect(()=>{let v=!1;return c(!0),n(e).then(k=>{v||l(k)}).catch(()=>{v||h(!0)}).finally(()=>{v||c(!1)}),()=>{v=!0}},[e,n]),s.jsxs("div",{className:"channel-balance-inline",children:[s.jsx("span",{className:"channel-balance-total",title:"Available balance",children:(a==null?void 0:a.status)==="ok"&&a.balance?a.balance.balance_infos.map(v=>`${v.currency} ${v.total_balance}`).join(" / "):u?"Checking…":(a==null?void 0:a.status)==="unsupported"?"Balance —":"Balance unavailable"}),f?s.jsx("span",{className:"channel-balance-warning",title:"Refresh failed; the displayed amount may be stale",role:"status",children:"Stale"}):null,a!=null&&a.balance&&!a.balance.is_available?s.jsx("span",{className:"channel-balance-warning",children:"Insufficient"}):null,s.jsx("button",{type:"button","aria-label":"Refresh balance",title:"Refresh balance",disabled:u,onClick:()=>void m(),children:"↻"}),s.jsxs("details",{className:"channel-balance-details",children:[s.jsx("summary",{children:"Details"}),s.jsxs("div",{children:[s.jsxs("p",{className:"channel-endpoint",children:[t," · Responses API"]}),(g=a==null?void 0:a.balance)==null?void 0:g.balance_infos.map(v=>s.jsxs("p",{children:[v.currency," · Granted ",v.granted_balance," · Topped up ",v.topped_up_balance]},v.currency)),a?s.jsxs("small",{children:["Checked ",new Date(a.checkedAt).toLocaleString()]}):null,f?s.jsx("small",{children:"Refresh failed. Any amount shown is the last successful result."}):null,(a==null?void 0:a.status)==="unsupported"?s.jsx("small",{children:"This channel does not support balance queries."}):null,s.jsx("small",{children:"Uses saved credentials; unsaved edits are not queried."})]})]})]})}function v6(e,t){const n=e??{type:"codex"},a=t??{type:"codex"};return n.type===a.type&&(n.type!=="custom"||a.type==="custom"&&n.channelId===a.channelId)}function jE({load:e,save:t,queryBalance:n}){const[a,l]=A.useState(null),[u,c]=A.useState([]),[f,h]=A.useState(!1),[m,g]=A.useState(""),[v,k]=A.useState(!1),[x,S]=A.useState(null),N=JSON.stringify(u)!==JSON.stringify((a==null?void 0:a.channels.map(E=>({channel:E})))??[]);A.useEffect(()=>{let E=!1;return e().then(q=>{E||(l(q),c(q.channels.map(R=>({channel:R}))))}).catch(()=>{E||g("Unable to load channels. Reopen this panel to retry.")}),()=>{E=!0}},[e]);const I=(E,q)=>{k(!1),c(R=>R.map((Z,P)=>P===E?{...Z,channel:{...Z.channel,...q}}:Z))},z=async E=>{if(E.preventDefault(),!(!a||f)){h(!0),g(""),k(!1);try{const q=await t({expectedRevision:a.revision,channels:u.map(R=>({channel:R.channel,...R.apiKey?{apiKey:R.apiKey}:{}}))});l(q),c(q.channels.map(R=>({channel:R}))),k(!0),S(null)}catch{g("Channels were not saved. Check the fields. If another administrator changed them, reopen this panel to load the latest version.")}finally{h(!1)}}};return s.jsxs("section",{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Custom model channels"}),s.jsx("p",{children:"Select a configured channel in Runtime."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:E=>void z(E),children:[!a&&!m?s.jsx("p",{children:"Loading channels…"}):null,s.jsxs("div",{className:"settings-field-wide channel-summary-list",children:[u.map(E=>s.jsxs("article",{className:"channel-summary-card",children:[s.jsxs("div",{className:"channel-summary-identity",children:[s.jsx("h4",{children:E.channel.name||"New channel"}),s.jsx("p",{children:E.channel.model||"Model not configured"})]}),n&&(a!=null&&a.channels.some(q=>q.id===E.channel.id))?s.jsx(SE,{id:E.channel.id,baseUrl:a.channels.find(q=>q.id===E.channel.id).baseUrl,query:n},`${E.channel.id}:${a.revision}`):s.jsx("small",{children:"Not saved"}),s.jsx("button",{type:"button",disabled:f||x!==null&&x!==E.channel.id,onClick:()=>{S(E.channel.id),k(!1)},children:"Edit channel"})]},E.channel.id)),a&&u.length===0?s.jsx("p",{children:"No custom channels yet. Add a channel to get started."}):null]}),u.map((E,q)=>x===E.channel.id?s.jsxs("fieldset",{disabled:f,className:"settings-field-wide model-channel-card",children:[s.jsx("legend",{children:a!=null&&a.channels.some(R=>R.id===E.channel.id)?"Edit channel":"Add channel"}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":`Channel ${q+1} name`,required:!0,maxLength:128,value:E.channel.name,onChange:R=>I(q,{name:R.target.value})})]}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Type"}),s.jsx("select",{"aria-label":`Channel ${q+1} type`,value:E.channel.kind,onChange:()=>{},children:s.jsx("option",{value:"responses",children:"Responses API"})})]}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Base URL"}),s.jsx("input",{"aria-label":`Channel ${q+1} URL`,type:"url",required:!0,placeholder:"https://api.example.com/v1",value:E.channel.baseUrl,onChange:R=>I(q,{baseUrl:R.target.value})})]}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Model ID"}),s.jsx("input",{"aria-label":`Channel ${q+1} model`,required:!0,maxLength:256,placeholder:"Model ID from your service",value:E.channel.model,onChange:R=>I(q,{model:R.target.value})})]}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"API key"}),s.jsx("input",{"aria-label":`Channel ${q+1} API key`,type:"password",autoComplete:"new-password",required:!(a!=null&&a.channels.some(R=>R.id===E.channel.id)),value:E.apiKey??"",placeholder:a!=null&&a.channels.some(R=>R.id===E.channel.id)?"Configured · leave blank to keep":"Enter API key",onChange:R=>{const Z=R.target.value;k(!1),c(P=>P.map(($,te)=>te===q?{...$,apiKey:Z}:$))}})]}),s.jsx("button",{type:"button",onClick:()=>{c(R=>R.filter((Z,P)=>P!==q)),k(!1),S(null)},children:"Remove channel on save"}),s.jsx("small",{children:"Changes take effect only after Save channels. Leave the API key blank to keep the saved key."})]},E.channel.id):null),m?s.jsx("p",{role:"alert",children:m}):null,v?s.jsx("p",{role:"status",children:"Channels saved. New executions use the updated configuration."}):null,s.jsxs("div",{className:"settings-form-actions",children:[s.jsx("button",{type:"button",disabled:!a||f||x!==null||u.length>=100,onClick:()=>{const E=crypto.randomUUID().replaceAll("-","");S(E),k(!1),c(q=>[...q,{channel:{id:E,name:"",kind:"responses",baseUrl:"",model:""}}])},children:"Add channel"}),x||JSON.stringify(u)!==JSON.stringify(a==null?void 0:a.channels.map(E=>({channel:E})))?s.jsx("button",{type:"button",disabled:f,onClick:()=>{c((a==null?void 0:a.channels.map(E=>({channel:E})))??[]),S(null),g("")},children:"Discard changes"}):null,x||N?s.jsx("button",{type:"submit",disabled:!a||f,children:f?"Saving…":"Save channels"}):null]})]})]})}function CE(e){const t=new Map;for(const n of e){if(!n.turnId)continue;if(n.event==="server.wakeup.started"){t.set(n.turnId,"wakeup");continue}if(n.event!=="server.turn")continue;const a=AE(n.data);t.set(n.turnId,typeof a.source=="string"?a.source:"web")}return t}function Yc(e,t){return!!(t&&e.includes(t))}function TE(e){var n;if((e==null?void 0:e.status)!=="failed")return null;const t=(n=e.error)==null?void 0:n.trim();return t?{turnId:e.id,content:t,createdAt:e.finishedAt??e.startedAt}:null}function AE(e){return e&&typeof e=="object"?e:{}}const EE=["summary","message","status","instruction","description","reason","error","text"],Jv=96,NE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),ME=new Set(["server.item.snapshot","server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),DE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),x6=new Set(["item/commandExecution/terminalInteraction"]),zE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function RE(e){if(e.event!=="codex.notification")return!1;const t=di(e.data);return typeof t.method=="string"&&x6.has(t.method)}function OE(e){if(ME.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||NE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const t=di(e.data),n=typeof t.method=="string"?t.method:"",a=di(t.params),l=di(a.item),u=typeof l.type=="string"?l.type:"";return!n.startsWith("item/")||x6.has(n)||/(?:\/delta|Delta)$/.test(n)||DE.has(u)?null:n}function b6(e,t){const n=t.replace(/^input:/,""),a=(e==null?void 0:e.trim())??"";return!a||a===t||a===n?zE.get(n)??w6(n):a}function Xs(e,t=[]){const n=di(e),l=[...t,...EE.map(u=>Wc(n[u]))].map(u=>(u==null?void 0:u.replace(/\s+/g," ").trim())??"").find(Boolean);return l?l.length<=Jv?l:`${l.slice(0,Jv-3)}...`:"查看详情"}function n1(e,t=new Map){const n=di(e),a=typeof n.unreadCount=="number"&&n.unreadCount>0?Math.floor(n.unreadCount):0,u=(Array.isArray(n.senderWorkspaceIds)?Array.from(new Set(n.senderWorkspaceIds.filter(h=>typeof h=="string").map(h=>h.trim()).filter(Boolean))):[]).map(h=>t.get(h)??h),c="Messages",f=[a>0?String(a):"",u.length>0?`from ${u.join(", ")}`:""].filter(Boolean).join(" ");return{title:c,detail:Xs({},[f])}}function IE(e){const t=di(e),n=Array.isArray(t.offers)?t.offers.map(di).filter(u=>Object.keys(u).length>0):[],a=n.map(u=>{var c;return(c=Wc(u.previewText))==null?void 0:c.trim()}).filter(u=>!!u),l=n.length;return{title:l===1?"New input available":`${l} new inputs available`,detail:Xs({},a.slice(0,2)),meta:l===1?"preview":`${l} previews`}}function LE(e){const t=di(e),n=Wc(t.actionType)??"",a=di(t.payload);return n==="seele_wakeup"||n==="seele_workspace_schedule_wakeup"?{title:(Wc(a.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:Xs(a,[Wc(a.instruction)]),meta:"after turn"}:{title:"Action requested",detail:Xs(a,[w6(n||"agent action")]),meta:"after turn"}}function w6(e){const n=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):"System event"}function Wc(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function di(e){return e&&typeof e=="object"?e:{}}function r1(e){const t=a1(e);return(Array.isArray(t.changes)?t.changes:[]).flatMap(a=>{const l=a1(a);if(typeof l.path!="string"||!l.path.trim())return[];const u=UE(l.kind),c=typeof l.diff=="string"?l.diff:"",f=qE(c,u);return[{path:l.path,kind:u,additions:f.additions,deletions:f.deletions}]})}function k6(e,t){const n=t3(e),a=t3(t??"").replace(/\/+$/,"");return a&&(n===a||n.startsWith(`${a}/`))?n.slice(a.length+1)||".":n}function _E(e,t){if(e.length===0)return"File changed";const n=k6(e[0].path,t);return e.length===1?n:`${n} +${e.length-1}`}function BE(e){return e.reduce((t,n)=>({additions:t.additions+n.additions,deletions:t.deletions+n.deletions}),{additions:0,deletions:0})}function qE(e,t){if(!e)return{additions:0,deletions:0};if(t==="add")return{additions:e3(e),deletions:0};if(t==="delete")return{additions:0,deletions:e3(e)};let n=0,a=0;for(const l of e.split(`
349
349
  `))l.startsWith("+")&&!l.startsWith("+++")?n+=1:l.startsWith("-")&&!l.startsWith("---")&&(a+=1);return{additions:n,deletions:a}}function e3(e){const t=e.split(`
@@ -381,7 +381,7 @@ ${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(t=>!!(t!
381
381
  `);if(t<0)return 0;const n=[0];for(let l=0;l<e.length;l+=1)e[l]===`
382
382
  `&&l+1<e.length&&n.push(l+1);let a=-1;for(const l of n){const u=e.indexOf(`
383
383
  `,l),c=e.slice(l,u===-1?e.length:u);/^\s*(```|~~~)/.test(c)&&(a=a===-1?l:-1)}return a>=0?a:t+1}function uD({artifact:e,onPreview:t,onCopyUrl:n,copied:a}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>t(e),type:"button",children:s.jsx("img",{alt:e.name,src:e.url})}),s.jsxs("figcaption",{children:[s.jsx("span",{children:e.name}),s.jsxs("div",{className:"artifact-preview-actions",children:[s.jsx("button",{onClick:()=>t(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>n(e),type:"button",children:a?"Copied":"Copy"})]})]})]}):null}function cD(e,t){const n=new Map;for(const a of dD(e)){const l=W6(a);if(l){const u=K6(l).toLowerCase(),c=n.get(u);(!c||mD(l,c))&&n.set(u,l)}}return Array.from(n.values()).map(a=>fD(a,t)).filter(a=>a!==null)}function dD(e){const t=[],n=/!\[[^\]]*]\(([^)]+)\)/g,a=/\[[^\]]+]\(([^)]+)\)/g,l=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const u of[n,a,l]){let c;for(;(c=u.exec(e))!==null;)t.push(c[1])}return t}function fD(e,t){const n=W6(e);if(!n||!hD(n))return null;const a=C6(n,t.workspacePath);return{id:`${t.id}:${a}`,path:a,name:K6(a),url:Ne(`conversations/${t.id}/files?path=${encodeURIComponent(a)}`)}}function W6(e){const t=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return t||null}function hD(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function K6(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function mD(e,t){return e.startsWith("/")&&!t.startsWith("/")?!0:e.length>t.length}function i0(e){return e.trim()}function X6(e){return e.trim()}function M3(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function pD(e){return{a({children:t,href:n}){if(!n)return s.jsx(s.Fragment,{children:t});const a=/^[a-z][a-z\d+.-]*:/i.test(n),l=j6(n);if(n.startsWith("seele-public:")&&!l)return s.jsxs("span",{title:"无效的 Seele Public URL 地址",children:[t,"(地址格式无效)"]});const u=!a&&e?gD(n,e):null,c=l?Ne(`deployment/public-link?path=${encodeURIComponent(l)}`):u??n,f=a||!!u;return s.jsx("a",{className:"markdown-link",href:c,rel:f?"noreferrer":void 0,target:f?"_blank":void 0,children:t})},img(){return null},pre({children:t}){const n=vD(t);return n?ag(n.language)==="mermaid"?s.jsx(xD,{code:n.code}):s.jsx(kD,{code:n.code,language:n.language}):s.jsx("pre",{children:t})},table({children:t}){return s.jsx("div",{className:"markdown-table-wrap",children:s.jsx("table",{className:"markdown-table",children:t})})},td({align:t,children:n}){return s.jsx("td",{style:D3(t),children:n})},th({align:t,children:n}){return s.jsx("th",{style:D3(t),children:n})}}}function gD(e,t){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const n=lN(e,t.workspacePath);if(!n)return null;const a=n.line?`#L${n.line}${n.column?`C${n.column}`:""}`:"";return`${Ne(`conversations/${t.id}/files?path=${encodeURIComponent(n.path)}`)}${a}`}function D3(e){return e&&e!=="char"?{textAlign:e}:void 0}function ts(e,t){const n=TA(yD(e));return s.jsx(fS,{urlTransform:a=>j6(a)?a:Lx(a),components:pD(t),remarkPlugins:[SC,CA],rehypePlugins:[[aE,{trust:!1,strict:"ignore"}]],skipHtml:!0,children:n})}function yD(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
384
- $2`)}function vD(e){var u;const t=A.Children.toArray(e),n=t.length===1&&A.isValidElement(t[0])?t[0]:null;if(!n||n.type!=="code")return null;const l=((u=(n.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:u[1])??"";return{code:c1(n.props.children).replace(/\n$/,""),language:l}}function c1(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(c1).join(""):A.isValidElement(e)?c1(e.props.children):""}const Z6="github-light",yp=new Map,vp=new Map;let xp=null,bp=null;const Q6=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function ag(e){const t=e.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[t]??t}function J6(e){const t=ag(e);return!t||t==="text"||t==="txt"?"text":Q6.has(t)?t:"text"}function xD({code:e}){const n=`seele-mermaid-${A.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[a,l]=A.useState(!1),[u,c]=A.useState(()=>vp.get(e)??null),[f,h]=A.useState(null);A.useEffect(()=>{let g=!1,v;const k=vp.get(e);return k?(c(k),h(null),()=>{g=!0}):(h(null),c(null),bD(n,e).then(x=>{g||(v!==void 0&&window.clearTimeout(v),vp.set(e,x),c(x),h(null))},x=>{if(!g){const S=x instanceof Error?x.message:String(x);v=window.setTimeout(()=>{g||h(S)},pN)}}),()=>{g=!0,v!==void 0&&window.clearTimeout(v)})},[e,n]);async function m(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${f?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":a?"Copied Mermaid source":"Copy Mermaid source",className:a?"copied":"",onClick:()=>void m(),title:a?"Copied":"Copy",type:"button",children:s.jsx(ig,{})})}),u?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:u}}):f?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:f}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function bD(e,t){return(await(await wD()).render(e,t)).svg}function wD(){return bp||(bp=on(()=>import("./mermaid.core-Cd9bNu3p.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#f9fafa",primaryBorderColor:"#d8d9e8",primaryTextColor:"#0b0f16",lineColor:"#7a8294",secondaryColor:"#f5f5fb",tertiaryColor:"#ffffff",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),t})),bp}function kD({code:e,language:t,reserveHeight:n=!1}){const[a,l]=A.useState(!1),[u,c]=A.useState(()=>{if(!O3(t))return null;const m=R3(e,t);return yp.get(m)??null}),f=n?{"--code-block-min-height":`${CN(e)}px`}:void 0;A.useEffect(()=>{let m=!1;if(!O3(t))return c(null),()=>{m=!0};const g=R3(e,t),v=yp.get(g);return v?(c(v),()=>{m=!0}):(c(null),ND(e,t).then(k=>{yp.set(g,k),m||c(k)}).catch(k=>{console.warn("Failed to highlight code block",k),m||c(null)}),()=>{m=!0})},[e,t]);async function h(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return s.jsxs("figure",{className:"code-block",style:f,children:[t?s.jsx("span",{className:"code-block-kind",children:t}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":a?"Copied code block":"Copy code block",className:a?"copied":"",onClick:()=>void h(),title:a?"Copied":"Copy",type:"button",children:s.jsx(ig,{})})}),u?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:u}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function ig(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function eb(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function lg(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function SD(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function jD(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function z3(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function CD(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function tf(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function $f(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function TD(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function AD(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function ED(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function R3(e,t){return`${Z6}:${J6(t)}:${e}`}function O3(e){const t=ag(e);return!!t&&Q6.has(t)}async function ND(e,t){return(await MD()).codeToHtml(e,{lang:J6(t),theme:Z6})}function MD(){return xp||(xp=DD()),xp}async function DD(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:t},{default:n},{default:a},{default:l},{default:u},{default:c},{default:f},{default:h},{default:m},{default:g},{default:v},{default:k},{default:x},{default:S},{default:N},{default:I},{default:z},{default:E},{default:q},{default:R},{default:Z}]=await Promise.all([on(()=>import("./core-CmCfnvUq.js"),[],import.meta.url),on(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),on(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(P=>P.b),[],import.meta.url),on(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),on(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),on(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),on(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),on(()=>import("./java-CylS5w8V.js"),[],import.meta.url),on(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),on(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),on(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),on(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),on(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),on(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(P=>P.s),[],import.meta.url),on(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),on(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),on(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),on(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),on(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),on(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:t(),themes:[n],langs:[a,l,u,c,f,h,m,g,v,k,x,S,N,I,z,E,q,R,Z]})}async function I3(){const e=Ne("conversations"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).conversations}async function zD(){const e=Ne("workspace-states"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).workspaces}async function L3(){const e=Ne("collaboration/topics"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).topics}async function Gd(e){const t=Ne(`collaboration/topics/${e}/messages?limit=100`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).messages}async function RD(e){const t=Ne("collaboration/topics"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{method:"POST",url:t}),(await n.json()).topic}async function OD(e,t){const n=Ne(`collaboration/topics/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"PATCH",url:n}),(await a.json()).topic}async function ID(e,t){const n=Ne(`collaboration/topics/${e}/archive`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:t})});return await Ve(a,{method:"POST",url:n}),(await a.json()).topic}async function LD(e){const t=Ne(`conversations/${e}/read`),n=await fetch(t,{method:"POST"});await Ve(n,{method:"POST",url:t})}async function _3(){const e=Ne("workspace-groups"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).groups}async function _D(e){const t=Ne("workspace-groups"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Ve(n,{method:"POST",url:t}),(await n.json()).group}async function BD(e,t){const n=Ne(`workspace-groups/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"PATCH",url:n}),(await a.json()).group}async function qD(e){const t=Ne(`workspace-groups/${e}`),n=await fetch(t,{method:"DELETE"});return await Ve(n,{method:"DELETE",url:t}),await n.json()}async function UD(){const e=Ne("settings/environment"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).variables}async function $D(e){const t=Ne(`conversations/${e}/settings/environment`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).variables}async function HD(e){const t=Ne(`conversations/${e}/knowledge`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).items}async function FD(){const e=Ne("settings/model-providers"),t=await fetch(e);return await Ve(t,{url:e}),t.json()}async function PD(){const e=Ne("settings/model-providers/options"),t=await fetch(e);return await Ve(t,{url:e}),t.json()}async function GD(e){const t=Ne(`settings/model-providers/${encodeURIComponent(e)}/balance`),n=await fetch(t);return await Ve(n,{url:t}),n.json()}async function VD(e){const t=Ne("settings/model-providers"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{url:t,method:"PUT"}),n.json()}async function YD(){const e=Ne("settings/runtime"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).settings}async function WD(){const e=Ne("settings/deployment"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).settings}async function KD(){const e=Ne("diagnostics"),t=await fetch(e);return await Ve(t,{url:e}),await t.json()}async function XD(){const e=Ne("settings/runtime/codex"),t=await fetch(e);return await Ve(t,{url:e}),await t.json()}async function nf(){const e=Ne("settings/runtime/accounts"),t=await fetch(e);await Ve(t,{url:e});const n=await t.json();return to(),n}async function B3(e=!1){const t=Ne(`settings/runtime/accounts/refresh${e?"?force=1":""}`),n=await fetch(t,{method:"POST"});await Ve(n,{method:"POST",url:t});const a=await n.json();return to(),a}async function ZD(e){const t=Ne("settings/runtime/accounts"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Ve(n,{method:"POST",url:t});const a=await n.json();return a.login.status==="succeeded"&&to(),a.login}async function QD(e){const t=Ne(`settings/runtime/accounts/login/${e}`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).login}async function JD(e){const t=Ne(`settings/runtime/accounts/login/${e}/cancel`),n=await fetch(t,{method:"POST"});return await Ve(n,{method:"POST",url:t}),(await n.json()).login}async function ez(e,t,n){const a=Ne(`settings/runtime/accounts/${e}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,renewalDay:n})});await Ve(l,{method:"PATCH",url:a});const u=await l.json();return to(),u.account}async function tz(e){const t=Ne(`settings/runtime/accounts/${e}`),n=await fetch(t,{method:"DELETE"});await Ve(n,{method:"DELETE",url:t}),to()}async function nz(e){const t=Ne(`settings/runtime/accounts/${e}/switch`),n=await fetch(t,{method:"POST"});await Ve(n,{method:"POST",url:t});const a=await n.json();return to(),a}async function rz(e=!0){const t=Ne(`settings/runtime/models?refresh=${e?"1":"0"}`),n=await fetch(t);return await Ve(n,{url:t}),await n.json()}async function az(e=!1){const t=Ne(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),n=await fetch(t);return await Ve(n,{url:t}),await n.json()}async function iz(){const e=Ne("settings/runtime/codex/update"),t=await fetch(e,{method:"POST"});return await Ve(t,{method:"POST",url:e}),(await t.json()).job}async function lz(e){const t=Ne(`conversations/${e}/settings/runtime`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).settings}async function sz(){const e=Ne("settings/memory"),t=await fetch(e);return await Ve(t,{url:e}),await t.json()}async function oz(e){const t=Ne("settings/runtime"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{method:"PUT",url:t}),(await n.json()).settings}async function uz(e){const t=Ne("settings/deployment"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{method:"PUT",url:t}),(await n.json()).settings}async function q3(e,t){const n=Ne(`conversations/${e}/settings/runtime`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"PUT",url:n}),await a.json()}async function U3(e,t){const n=Ne(`conversations/${e}/runtime/reset`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"POST",url:n}),(await a.json()).job}async function $3(e){const t=Ne(`conversations/${e}/runtime/reset-preview`),n=await fetch(t);return await Ve(n,{url:t}),await n.json()}async function cz(e,t){const n=Ne(`conversations/${e}/runtime/reset-selection`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await Ve(a,{method:"PUT",url:n})}async function dz(e){const t=Ne(`conversations/${e}/runtime/thread-read`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).result}async function fz(e){const t=Ne(`conversations/${e}/runtime/token-usage`),n=await fetch(t);await Ve(n,{url:t});const a=await n.json();return a.event?hb(a.event):null}async function hz(e){const t=Ne(`conversations/${e}/runtime/additional-context`),n=await fetch(t);return await Ve(n,{url:t}),await n.json()}async function mz(e){const t=Ne(`conversations/${e}/runtime/compactions`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).compactions}function pz(e,t,n){return{modelSource:v6(e.modelSource,t.modelSource)&&(n==null?void 0:n.sources.modelSource)!=="workspace"?null:e.modelSource??{type:"codex"},model:e.model===t.model?null:e.model,reasoningEffort:PE(e.reasoningEffort,t.reasoningEffort,(n==null?void 0:n.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===t.fastMode?null:e.fastMode,sandbox:e.sandbox===t.sandbox?null:e.sandbox}}function gz(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:vz(e.sourceCluesText),requiredEnv:xz(e.requiredEnvText)}}function yz(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(t=>`${t.type}: ${t.value}`).join(`
384
+ $2`)}function vD(e){var u;const t=A.Children.toArray(e),n=t.length===1&&A.isValidElement(t[0])?t[0]:null;if(!n||n.type!=="code")return null;const l=((u=(n.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:u[1])??"";return{code:c1(n.props.children).replace(/\n$/,""),language:l}}function c1(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(c1).join(""):A.isValidElement(e)?c1(e.props.children):""}const Z6="github-light",yp=new Map,vp=new Map;let xp=null,bp=null;const Q6=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function ag(e){const t=e.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[t]??t}function J6(e){const t=ag(e);return!t||t==="text"||t==="txt"?"text":Q6.has(t)?t:"text"}function xD({code:e}){const n=`seele-mermaid-${A.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[a,l]=A.useState(!1),[u,c]=A.useState(()=>vp.get(e)??null),[f,h]=A.useState(null);A.useEffect(()=>{let g=!1,v;const k=vp.get(e);return k?(c(k),h(null),()=>{g=!0}):(h(null),c(null),bD(n,e).then(x=>{g||(v!==void 0&&window.clearTimeout(v),vp.set(e,x),c(x),h(null))},x=>{if(!g){const S=x instanceof Error?x.message:String(x);v=window.setTimeout(()=>{g||h(S)},pN)}}),()=>{g=!0,v!==void 0&&window.clearTimeout(v)})},[e,n]);async function m(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${f?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":a?"Copied Mermaid source":"Copy Mermaid source",className:a?"copied":"",onClick:()=>void m(),title:a?"Copied":"Copy",type:"button",children:s.jsx(ig,{})})}),u?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:u}}):f?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:f}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function bD(e,t){return(await(await wD()).render(e,t)).svg}function wD(){return bp||(bp=on(()=>import("./mermaid.core-BDzJfNJw.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#f9fafa",primaryBorderColor:"#d8d9e8",primaryTextColor:"#0b0f16",lineColor:"#7a8294",secondaryColor:"#f5f5fb",tertiaryColor:"#ffffff",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),t})),bp}function kD({code:e,language:t,reserveHeight:n=!1}){const[a,l]=A.useState(!1),[u,c]=A.useState(()=>{if(!O3(t))return null;const m=R3(e,t);return yp.get(m)??null}),f=n?{"--code-block-min-height":`${CN(e)}px`}:void 0;A.useEffect(()=>{let m=!1;if(!O3(t))return c(null),()=>{m=!0};const g=R3(e,t),v=yp.get(g);return v?(c(v),()=>{m=!0}):(c(null),ND(e,t).then(k=>{yp.set(g,k),m||c(k)}).catch(k=>{console.warn("Failed to highlight code block",k),m||c(null)}),()=>{m=!0})},[e,t]);async function h(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return s.jsxs("figure",{className:"code-block",style:f,children:[t?s.jsx("span",{className:"code-block-kind",children:t}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":a?"Copied code block":"Copy code block",className:a?"copied":"",onClick:()=>void h(),title:a?"Copied":"Copy",type:"button",children:s.jsx(ig,{})})}),u?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:u}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function ig(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function eb(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function lg(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function SD(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function jD(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function z3(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function CD(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function tf(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function $f(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function TD(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function AD(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function ED(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function R3(e,t){return`${Z6}:${J6(t)}:${e}`}function O3(e){const t=ag(e);return!!t&&Q6.has(t)}async function ND(e,t){return(await MD()).codeToHtml(e,{lang:J6(t),theme:Z6})}function MD(){return xp||(xp=DD()),xp}async function DD(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:t},{default:n},{default:a},{default:l},{default:u},{default:c},{default:f},{default:h},{default:m},{default:g},{default:v},{default:k},{default:x},{default:S},{default:N},{default:I},{default:z},{default:E},{default:q},{default:R},{default:Z}]=await Promise.all([on(()=>import("./core-BEunYH2A.js"),[],import.meta.url),on(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),on(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(P=>P.b),[],import.meta.url),on(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),on(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),on(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),on(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),on(()=>import("./java-CylS5w8V.js"),[],import.meta.url),on(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),on(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),on(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),on(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),on(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),on(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(P=>P.s),[],import.meta.url),on(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),on(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),on(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),on(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),on(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),on(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:t(),themes:[n],langs:[a,l,u,c,f,h,m,g,v,k,x,S,N,I,z,E,q,R,Z]})}async function I3(){const e=Ne("conversations"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).conversations}async function zD(){const e=Ne("workspace-states"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).workspaces}async function L3(){const e=Ne("collaboration/topics"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).topics}async function Gd(e){const t=Ne(`collaboration/topics/${e}/messages?limit=100`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).messages}async function RD(e){const t=Ne("collaboration/topics"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{method:"POST",url:t}),(await n.json()).topic}async function OD(e,t){const n=Ne(`collaboration/topics/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"PATCH",url:n}),(await a.json()).topic}async function ID(e,t){const n=Ne(`collaboration/topics/${e}/archive`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:t})});return await Ve(a,{method:"POST",url:n}),(await a.json()).topic}async function LD(e){const t=Ne(`conversations/${e}/read`),n=await fetch(t,{method:"POST"});await Ve(n,{method:"POST",url:t})}async function _3(){const e=Ne("workspace-groups"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).groups}async function _D(e){const t=Ne("workspace-groups"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Ve(n,{method:"POST",url:t}),(await n.json()).group}async function BD(e,t){const n=Ne(`workspace-groups/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"PATCH",url:n}),(await a.json()).group}async function qD(e){const t=Ne(`workspace-groups/${e}`),n=await fetch(t,{method:"DELETE"});return await Ve(n,{method:"DELETE",url:t}),await n.json()}async function UD(){const e=Ne("settings/environment"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).variables}async function $D(e){const t=Ne(`conversations/${e}/settings/environment`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).variables}async function HD(e){const t=Ne(`conversations/${e}/knowledge`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).items}async function FD(){const e=Ne("settings/model-providers"),t=await fetch(e);return await Ve(t,{url:e}),t.json()}async function PD(){const e=Ne("settings/model-providers/options"),t=await fetch(e);return await Ve(t,{url:e}),t.json()}async function GD(e){const t=Ne(`settings/model-providers/${encodeURIComponent(e)}/balance`),n=await fetch(t);return await Ve(n,{url:t}),n.json()}async function VD(e){const t=Ne("settings/model-providers"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{url:t,method:"PUT"}),n.json()}async function YD(){const e=Ne("settings/runtime"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).settings}async function WD(){const e=Ne("settings/deployment"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).settings}async function KD(){const e=Ne("diagnostics"),t=await fetch(e);return await Ve(t,{url:e}),await t.json()}async function XD(){const e=Ne("settings/runtime/codex"),t=await fetch(e);return await Ve(t,{url:e}),await t.json()}async function nf(){const e=Ne("settings/runtime/accounts"),t=await fetch(e);await Ve(t,{url:e});const n=await t.json();return to(),n}async function B3(e=!1){const t=Ne(`settings/runtime/accounts/refresh${e?"?force=1":""}`),n=await fetch(t,{method:"POST"});await Ve(n,{method:"POST",url:t});const a=await n.json();return to(),a}async function ZD(e){const t=Ne("settings/runtime/accounts"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Ve(n,{method:"POST",url:t});const a=await n.json();return a.login.status==="succeeded"&&to(),a.login}async function QD(e){const t=Ne(`settings/runtime/accounts/login/${e}`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).login}async function JD(e){const t=Ne(`settings/runtime/accounts/login/${e}/cancel`),n=await fetch(t,{method:"POST"});return await Ve(n,{method:"POST",url:t}),(await n.json()).login}async function ez(e,t,n){const a=Ne(`settings/runtime/accounts/${e}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,renewalDay:n})});await Ve(l,{method:"PATCH",url:a});const u=await l.json();return to(),u.account}async function tz(e){const t=Ne(`settings/runtime/accounts/${e}`),n=await fetch(t,{method:"DELETE"});await Ve(n,{method:"DELETE",url:t}),to()}async function nz(e){const t=Ne(`settings/runtime/accounts/${e}/switch`),n=await fetch(t,{method:"POST"});await Ve(n,{method:"POST",url:t});const a=await n.json();return to(),a}async function rz(e=!0){const t=Ne(`settings/runtime/models?refresh=${e?"1":"0"}`),n=await fetch(t);return await Ve(n,{url:t}),await n.json()}async function az(e=!1){const t=Ne(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),n=await fetch(t);return await Ve(n,{url:t}),await n.json()}async function iz(){const e=Ne("settings/runtime/codex/update"),t=await fetch(e,{method:"POST"});return await Ve(t,{method:"POST",url:e}),(await t.json()).job}async function lz(e){const t=Ne(`conversations/${e}/settings/runtime`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).settings}async function sz(){const e=Ne("settings/memory"),t=await fetch(e);return await Ve(t,{url:e}),await t.json()}async function oz(e){const t=Ne("settings/runtime"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{method:"PUT",url:t}),(await n.json()).settings}async function uz(e){const t=Ne("settings/deployment"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{method:"PUT",url:t}),(await n.json()).settings}async function q3(e,t){const n=Ne(`conversations/${e}/settings/runtime`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"PUT",url:n}),await a.json()}async function U3(e,t){const n=Ne(`conversations/${e}/runtime/reset`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"POST",url:n}),(await a.json()).job}async function $3(e){const t=Ne(`conversations/${e}/runtime/reset-preview`),n=await fetch(t);return await Ve(n,{url:t}),await n.json()}async function cz(e,t){const n=Ne(`conversations/${e}/runtime/reset-selection`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await Ve(a,{method:"PUT",url:n})}async function dz(e){const t=Ne(`conversations/${e}/runtime/thread-read`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).result}async function fz(e){const t=Ne(`conversations/${e}/runtime/token-usage`),n=await fetch(t);await Ve(n,{url:t});const a=await n.json();return a.event?hb(a.event):null}async function hz(e){const t=Ne(`conversations/${e}/runtime/additional-context`),n=await fetch(t);return await Ve(n,{url:t}),await n.json()}async function mz(e){const t=Ne(`conversations/${e}/runtime/compactions`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).compactions}function pz(e,t,n){return{modelSource:v6(e.modelSource,t.modelSource)&&(n==null?void 0:n.sources.modelSource)!=="workspace"?null:e.modelSource??{type:"codex"},model:e.model===t.model?null:e.model,reasoningEffort:PE(e.reasoningEffort,t.reasoningEffort,(n==null?void 0:n.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===t.fastMode?null:e.fastMode,sandbox:e.sandbox===t.sandbox?null:e.sandbox}}function gz(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:vz(e.sourceCluesText),requiredEnv:xz(e.requiredEnvText)}}function yz(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(t=>`${t.type}: ${t.value}`).join(`
385
385
  `),requiredEnvText:e.fetch.requiredEnv.map(t=>t.description?`${t.key} - ${t.description}`:t.key).join(`
386
386
  `)}}function vz(e){const t=new Date().toISOString();return e.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).map(n=>{const a=n.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:a?a[1].toLowerCase():"text",value:a?a[2].trim():n,providedBy:"user",providedAt:t}})}function xz(e){return e.split(/\r?\n/).map(t=>t.trim()).filter(Boolean).map(t=>{const[n,...a]=t.split(/\s+-\s+/);return{key:n.trim().toUpperCase(),description:a.join(" - ").trim()}}).filter(t=>/^[A-Z_][A-Z0-9_]*$/.test(t.key))}function H3(e,t){const n=F3(t.attention)-F3(e.attention);return n!==0?n:t.updatedAt.localeCompare(e.updatedAt)}function F3(e){return e==="watch"?2:e==="tracked"?1:0}function Xc(e){return e.map(t=>({key:t.key??"",value:t.value??"",updatedAt:t.updatedAt}))}function bz(e){return e?/^[a-z_][a-z0-9_.-]*$/.test(e)?null:"Key must start with a lowercase English letter or underscore, and may contain lowercase letters, numbers, dots, underscores, and hyphens.":"Key is required."}function wz(e){return Xc(e).filter(t=>t.key.trim()&&t.value.trim()).map(t=>`${t.key.trim()}: ${t.value.trim()}`).join(`
387
387
  `)}async function kz(e){const t=Ne("settings/memory"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ve(n,{method:"PUT",url:t}),await n.json()}async function Sz(e,t,n){const a=Ne("settings/environment"),l=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:n,key:e,value:t})});return await Ve(l,{method:"PUT",url:a}),(await l.json()).variable}async function jz(e,t,n,a){const l=Ne(`conversations/${e}/settings/environment`),u=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:t,value:n})});return await Ve(u,{method:"PUT",url:l}),await u.json()}async function Cz(e){const t=Ne(`settings/environment/${encodeURIComponent(e)}/reveal`),n=await fetch(t);return await Ve(n,{url:t}),(await n.json()).variable.value}async function Tz(e,t){const n=Ne(`conversations/${e}/settings/environment/${encodeURIComponent(t)}/reveal`),a=await fetch(n);return await Ve(a,{url:n}),(await a.json()).variable.value}async function Az(e){const t=Ne(`settings/environment/${encodeURIComponent(e)}`),n=await fetch(t,{method:"DELETE"});await Ve(n,{method:"DELETE",url:t})}async function Ez(e,t){const n=Ne(`conversations/${e}/settings/environment/${encodeURIComponent(t)}`),a=await fetch(n,{method:"DELETE"});return await Ve(a,{method:"DELETE",url:n}),(await a.json()).conversation}async function Nz(e,t){const n=Ne(`conversations/${e}/knowledge`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"POST",url:n}),(await a.json()).item}async function Mz(e,t,n){const a=Ne(`conversations/${e}/knowledge/${encodeURIComponent(t)}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});return await Ve(l,{method:"PATCH",url:a}),(await l.json()).item}async function Dz(e,t){const n=Ne(`conversations/${e}/knowledge/${encodeURIComponent(t)}`),a=await fetch(n,{method:"DELETE"});await Ve(a,{method:"DELETE",url:n})}async function zz(){const e=Ne("meta"),t=await fetch(e);return await Ve(t,{url:e}),await t.json()}async function Rz(){const e=Ne("settings/runtime/rate-limits"),t=await fetch(e);return await Ve(t,{url:e}),(await t.json()).usage??null}async function Oz(e,t){const n=Ne("conversations"),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:t})});return await Ve(a,{method:"POST",url:n}),(await a.json()).conversation}function Iz(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}async function Lz(e,t,n,a,l){const u=Ne(`conversations/${e}/clone`),c=await fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,groupId:n,excludeTopicHistory:a,requestId:l})});return await Ve(c,{method:"POST",url:u}),await c.json()}async function _z(e){const t=Ne(`conversations/${e}/clone/retry`),n=await fetch(t,{method:"POST"});return await Ve(n,{method:"POST",url:t}),await n.json()}async function Zc(e,t={}){const n=new URLSearchParams;n.set("limit",String(t.limit??T6)),t.before&&n.set("before",t.before);const a=Ne(`conversations/${e}?${n}`),l=await fetch(a);return await Ve(l,{url:a}),(await l.json()).conversation}async function tb(e,t){const n=Ne(`conversations/${e}/turns/${t}/history-events`),a=await fetch(n);return await Ve(a,{url:n}),(await a.json()).events}async function Vd(e,t){const n=Ne(`conversations/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Ve(a,{method:"PATCH",url:n}),(await a.json()).conversation}async function Bz(e){const t=Ne(`conversations/${e}`),n=await fetch(t,{method:"DELETE"});await Ve(n,{method:"DELETE",url:t})}function qz(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function nb(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function Uz(e,t){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:aR(e.data),createdAt:e.createdAt??new Date().toISOString()};if(e.event==="server.collaboration.message_staged"||e.event==="server.collaboration.message_sent"||e.event==="server.collaboration.message_rejected"){const u=Pe(e.data),c=nt(u.toolCallId),f=typeof u.controlIndex=="number"?u.controlIndex:null;if(c||f!==null){const h=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",g=nt(u.audience),v=nt(u.recipientWorkspaceId),k=v?[v]:Array.isArray(u.recipientWorkspaceIds)?u.recipientWorkspaceIds.filter(I=>typeof I=="string"):Array.isArray(u.recipients)?u.recipients.filter(I=>typeof I=="string"):[],x=k.filter(I=>I!=="ALL").map(I=>t.get(I)).filter(I=>!!I);let S="Topic";x.length>0?S=nb(x):k.length===1?S=k[0]==="ALL"?"Topic participants":rs(k[0]):k.length>1?S=`${k.length} workspaces`:g==="public"||g==="all"?S="Topic participants":g==="owner"&&(S="Topic owner");const N=nt(u.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${S}`,body:N?`Topic ${rs(N)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:c||`legacy-topic-message:${f}`,meta:h?"pending send":m?"done":"failed",output:h||m?nt(u.contentMarkdown)||void 0:nt(u.reason)||void 0,topicAction:"send",topicRecipientLabel:S,topicMessageContent:(h||m)&&nt(u.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const u=Pe(e.data);if(e.event==="codex.input_request"||u.method==="item/tool/requestUserInput"){const c=Pe(u.params),h=(Array.isArray(c.questions)?c.questions:[]).map(m=>{const g=Pe(m),v=typeof g.question=="string"?g.question:"Please provide the missing information.",k=Array.isArray(g.options)?g.options.map(x=>{const S=Pe(x);return typeof S.label=="string"?`- ${S.label}${typeof S.description=="string"?`: ${S.description}`:""}`:""}).filter(Boolean).join(`
@@ -1,2 +1,2 @@
1
- import{_ as a,l as s,D as o,e as i}from"./mermaid.core-Cd9bNu3p.js";import{p as g}from"./cynefin-VYW2F7L2-Cbx6g0Vv.js";import"./index-CFBO55xn.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.16.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram
1
+ import{_ as a,l as s,D as o,e as i}from"./mermaid.core-BDzJfNJw.js";import{p as g}from"./cynefin-VYW2F7L2-CsrLDAgF.js";import"./index-Cu2P6KUt.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.16.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=o(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
@@ -1,4 +1,4 @@
1
- import{_ as o,c as ot,a1 as ut,D as dt,al as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,e as bt}from"./mermaid.core-Cd9bNu3p.js";import"./index-CFBO55xn.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,q,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,a1 as ut,D as dt,al as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,e as bt}from"./mermaid.core-BDzJfNJw.js";import"./index-Cu2P6KUt.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,q,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),q=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof q<"u")return q;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./chunk-5VM5RSS4-xz7bwfKC.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-32BRIVSS-DnbCxZKU.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,d as X,e as $t,p as Mt}from"./mermaid.core-Cd9bNu3p.js";import{d as it}from"./arc-D6gLv5dc.js";import"./index-CFBO55xn.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-5VM5RSS4-DjxaL8oH.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-32BRIVSS-B_RdqhOh.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,d as X,e as $t,p as Mt}from"./mermaid.core-BDzJfNJw.js";import{d as it}from"./arc-tBvSIOOM.js";import"./index-Cu2P6KUt.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{_ as c,l as te,c as W,D as fe,af as ye,ag as be,ah as me,ad as _e,B as K,i as G,Y as ke,Z as Ee,aa as Se,ab as le,ac as ce}from"./mermaid.core-Cd9bNu3p.js";import{g as Ne}from"./chunk-5VM5RSS4-xz7bwfKC.js";import"./index-CFBO55xn.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],B={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,V){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],V=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Z=m.yylloc;e.push(Z);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,q,F={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=V[R]&&V[R][E]),typeof v>"u"||!v.length||!v[0]){var Q="";Y=[];for(X in V[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Q="Parse error on line "+(z+1)+`:
1
+ import{_ as c,l as te,c as W,D as fe,af as ye,ag as be,ah as me,ad as _e,B as K,i as G,Y as ke,Z as Ee,aa as Se,ab as le,ac as ce}from"./mermaid.core-BDzJfNJw.js";import{g as Ne}from"./chunk-5VM5RSS4-DjxaL8oH.js";import"./index-Cu2P6KUt.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],B={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,V){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],V=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Z=m.yylloc;e.push(Z);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,q,F={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=V[R]&&V[R][E]),typeof v>"u"||!v.length||!v[0]){var Q="";Y=[];for(X in V[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Q="Parse error on line "+(z+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Q="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Q,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:Z,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,Z=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof q<"u")return q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=V[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{b9 as j,ba as p,bb as w,bc as k,bd as q}from"./mermaid.core-Cd9bNu3p.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=N(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=N(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function N(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function d(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=d(u,e),f=t(a,f)):(e=d(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=d(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=N,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
1
+ import{b9 as j,ba as p,bb as w,bc as k,bd as q}from"./mermaid.core-BDzJfNJw.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=N(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=N(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function N(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function d(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=d(u,e),f=t(a,f)):(e=d(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=d(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=N,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};