@rubytech/create-maxy-code 0.1.291 → 0.1.292

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 (87) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +2 -2
  3. package/payload/platform/plugins/docs/references/platform.md +1 -1
  4. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts +1 -1
  5. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
  6. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +1 -1
  7. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
  8. package/payload/server/{chunk-EAJMRICW.js → chunk-QDCBAHPI.js} +1 -1
  9. package/payload/server/maxy-edge.js +1 -1
  10. package/payload/server/public/assets/AdminShell-CpRQprdb.js +1 -0
  11. package/payload/server/public/assets/{Checkbox-DWx2NcU9.js → Checkbox-hYA5LjZ5.js} +1 -1
  12. package/payload/server/public/assets/{SidebarSplitter-CidskiAr.js → SidebarSplitter-D0mErwLL.js} +1 -1
  13. package/payload/server/public/assets/{Transcript-iuM5b4JT.js → Transcript-BaC574J0.js} +1 -1
  14. package/payload/server/public/assets/{admin-Cdz561nK.js → admin-BVasculM.js} +1 -1
  15. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-AtvCAoKj.js → architectureDiagram-Q4EWVU46-d4iT6VnY.js} +1 -1
  16. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-CwUSTR3t.js → blockDiagram-DXYQGD6D-o5Tjd8VR.js} +1 -1
  17. package/payload/server/public/assets/{browser-Bwd_rYu9.js → browser-CwU2ReNI.js} +1 -1
  18. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-Btkecaf-.js → c4Diagram-AHTNJAMY-B8IQ2a83.js} +1 -1
  19. package/payload/server/public/assets/channel-CizJU0ud.js +1 -0
  20. package/payload/server/public/assets/chat-NxS8JsVQ.js +1 -0
  21. package/payload/server/public/assets/{chunk-336JU56O-fJXOXFRr.js → chunk-336JU56O-1-fVU2_7.js} +2 -2
  22. package/payload/server/public/assets/{chunk-426QAEUC-28Pgly06.js → chunk-426QAEUC-CAPR5ZG1.js} +1 -1
  23. package/payload/server/public/assets/{chunk-4TB4RGXK-IFvQOpiF.js → chunk-4TB4RGXK-k-V-xUC9.js} +1 -1
  24. package/payload/server/public/assets/{chunk-5FUZZQ4R-DD-XOAcm.js → chunk-5FUZZQ4R-DMLY3acx.js} +1 -1
  25. package/payload/server/public/assets/{chunk-5PVQY5BW-Ck-5mL2A.js → chunk-5PVQY5BW-Dw-Sd9tl.js} +1 -1
  26. package/payload/server/public/assets/{chunk-EDXVE4YY-BPqvO0TO.js → chunk-EDXVE4YY-DtpX8vYJ.js} +1 -1
  27. package/payload/server/public/assets/{chunk-ENJZ2VHE-PN6Hbw2D.js → chunk-ENJZ2VHE-TxT7_-ER.js} +1 -1
  28. package/payload/server/public/assets/{chunk-ICPOFSXX-DkmwqyfQ.js → chunk-ICPOFSXX-CPrjaFl6.js} +1 -1
  29. package/payload/server/public/assets/{chunk-OYMX7WX6-CWyihoif.js → chunk-OYMX7WX6-CmoWgYtj.js} +1 -1
  30. package/payload/server/public/assets/{chunk-U2HBQHQK-BCWQB0k9.js → chunk-U2HBQHQK-stvjyyuR.js} +1 -1
  31. package/payload/server/public/assets/{chunk-X2U36JSP-CcaCMsL0.js → chunk-X2U36JSP-qAuy5Y44.js} +1 -1
  32. package/payload/server/public/assets/{chunk-YZCP3GAM-BUTzrAoG.js → chunk-YZCP3GAM-Vk12yILs.js} +1 -1
  33. package/payload/server/public/assets/{chunk-ZZ45TVLE-BD9UGg96.js → chunk-ZZ45TVLE-WJVrlWz_.js} +1 -1
  34. package/payload/server/public/assets/classDiagram-6PBFFD2Q-kzz9ab1y.js +1 -0
  35. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-NFfOmc0C.js +1 -0
  36. package/payload/server/public/assets/clone-C15qvnbX.js +1 -0
  37. package/payload/server/public/assets/{dagre-dnTAouT6.js → dagre--B-g8MLT.js} +1 -1
  38. package/payload/server/public/assets/{dagre-KV5264BT-DcOMoMzF.js → dagre-KV5264BT-BHFfoLq0.js} +1 -1
  39. package/payload/server/public/assets/data-CebDWao6.js +1 -0
  40. package/payload/server/public/assets/{diagram-5BDNPKRD-BuQUC75n.js → diagram-5BDNPKRD-TvCFSaXd.js} +1 -1
  41. package/payload/server/public/assets/{diagram-G4DWMVQ6-DHiu9U7B.js → diagram-G4DWMVQ6-8flGaFB_.js} +1 -1
  42. package/payload/server/public/assets/{diagram-MMDJMWI5-ypu7YJGF.js → diagram-MMDJMWI5-Dag0WBhV.js} +1 -1
  43. package/payload/server/public/assets/{diagram-TYMM5635-DIwuWuqN.js → diagram-TYMM5635-u7wh2Nwj.js} +1 -1
  44. package/payload/server/public/assets/{erDiagram-SMLLAGMA-CKxGMQZW.js → erDiagram-SMLLAGMA-DBTHDFh_.js} +1 -1
  45. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-CqH2RE7a.js → flowDiagram-DWJPFMVM-C4bd2cb-.js} +1 -1
  46. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-BfuGXUUh.js → ganttDiagram-T4ZO3ILL-DrfpI4Gl.js} +1 -1
  47. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-BlpUYLLd.js → gitGraphDiagram-UUTBAWPF-a_WyzWRQ.js} +1 -1
  48. package/payload/server/public/assets/{graph-labels-DvO7i7Ez.js → graph-labels-DznU92XA.js} +1 -1
  49. package/payload/server/public/assets/{graph-BEu_XQMZ.js → graph-qR6IbCv1.js} +1 -1
  50. package/payload/server/public/assets/{graphlib-O_QsiopN.js → graphlib-B85zmy3s.js} +1 -1
  51. package/payload/server/public/assets/{infoDiagram-42DDH7IO-tHUu3AX-.js → infoDiagram-42DDH7IO-g9Re1Ubl.js} +1 -1
  52. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-CVMbR1ZD.js → ishikawaDiagram-UXIWVN3A-3jXIqGtb.js} +1 -1
  53. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-7pbwsn7f.js → journeyDiagram-VCZTEJTY-BXrBb8KE.js} +1 -1
  54. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-CWFMjHiJ.js → kanban-definition-6JOO6SKY-Dc5vZnuT.js} +1 -1
  55. package/payload/server/public/assets/{line-B4V-vQdN.js → line-x0RuVReA.js} +1 -1
  56. package/payload/server/public/assets/{mermaid-parser.core-Ba5Re-_1.js → mermaid-parser.core-CBRGDK2w.js} +1 -1
  57. package/payload/server/public/assets/{mermaid.core-C39ZL-9e.js → mermaid.core-DeYYeYyM.js} +3 -3
  58. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-BrREiATP.js → mindmap-definition-QFDTVHPH-Bw-hRp-Y.js} +1 -1
  59. package/payload/server/public/assets/{pieDiagram-DEJITSTG-sJOzKUIf.js → pieDiagram-DEJITSTG-C2DTjmdf.js} +1 -1
  60. package/payload/server/public/assets/{public-927mDSLH.js → public-tk3PfPWF.js} +3 -3
  61. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-bxoGUruT.js → quadrantDiagram-34T5L4WZ-Ffhnv5Ih.js} +1 -1
  62. package/payload/server/public/assets/{requirementDiagram-MS252O5E-C8_uEDnp.js → requirementDiagram-MS252O5E-y7-gOSmI.js} +1 -1
  63. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-CKpSBj6p.js → sankeyDiagram-XADWPNL6-CMwArh7T.js} +1 -1
  64. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-BbVOmtji.js → sequenceDiagram-FGHM5R23-C8obTGl1.js} +1 -1
  65. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-CLiLypPX.js → stateDiagram-FHFEXIEX-BZHsj7kJ.js} +1 -1
  66. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-fK1TrvKX.js +1 -0
  67. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-Dzzc-pnB.js → timeline-definition-GMOUNBTQ-D-fo_L7-.js} +1 -1
  68. package/payload/server/public/assets/{useSelectionMode-CzWzToaM.css → useSelectionMode-CQBRZjvc.css} +1 -1
  69. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-CEj_ctTP.js → vennDiagram-DHZGUBPP--aEWsS70.js} +1 -1
  70. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-Cnbz79qd.js → wardleyDiagram-NUSXRM2D-DFWrB0Kk.js} +1 -1
  71. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-MTjLweae.js → xychartDiagram-5P7HB3ND-DZsTZHC6.js} +1 -1
  72. package/payload/server/public/browser.html +5 -5
  73. package/payload/server/public/chat.html +5 -5
  74. package/payload/server/public/data.html +6 -6
  75. package/payload/server/public/graph.html +7 -7
  76. package/payload/server/public/index.html +7 -7
  77. package/payload/server/public/public.html +4 -4
  78. package/payload/server/server.js +2 -2
  79. package/payload/server/public/assets/AdminShell-BgPlhiCM.js +0 -1
  80. package/payload/server/public/assets/channel-1MEkxMOf.js +0 -1
  81. package/payload/server/public/assets/chat-wbKqew6m.js +0 -1
  82. package/payload/server/public/assets/classDiagram-6PBFFD2Q-BcD2DnVi.js +0 -1
  83. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-ChvbGJh0.js +0 -1
  84. package/payload/server/public/assets/clone-DPfDeykW.js +0 -1
  85. package/payload/server/public/assets/data-BSt0roMQ.js +0 -1
  86. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-Cn6OBfIT.js +0 -1
  87. /package/payload/server/public/assets/{useSelectionMode-BBvWzgtz.js → useSelectionMode-CJ2UADOe.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{h as e,p as t}from"./src-DssjGmtU.js";import{$ as n,B as r,C as i,Q as a,V as o,W as s,_ as c,a as l,c as u,d,et as f,tt as p,v as m,y as h}from"./chunk-ICPOFSXX-DkmwqyfQ.js";import"./dist-ePW3hz19.js";import{r as g}from"./chunk-5PVQY5BW-Ck-5mL2A.js";import{t as _}from"./chunk-426QAEUC-28Pgly06.js";import{t as v}from"./rough.esm-HAx67Hnb.js";var y=(e,t)=>f(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function ee(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function te(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||oe,r=t.lossFunction||z,i=re(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var ne=1e-10;function R(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+ne?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function re(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function ie(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=R(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ae(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function oe(e,t={}){let n=ce(e,t),r=t.lossFunction||z;if(e.length>=8){let i=se(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function se(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=ie(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ae(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=ee(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function ce(e,t){let n=t&&t.lossFunction?t.lossFunction:z,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+ne>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=R(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=R(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function z(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function le(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function ue(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function de(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function B(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function fe(e,t,n){t??=Math.PI/2;let r=he(e).map(e=>Object.assign({},e)),i=de(r);for(let e of i){ue(e,t,n);let r=B(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=B(r);return me(r)}function pe(e,t,n,r,i){let a=he(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=B(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return me(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function me(e){let t={};for(let n of e)t[n.setid]=n;return t}function he(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function ge(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=te,x=z;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=fe(e,o,f)),S=pe(e,n,r,i,c),C=ye(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=xe(t))});function k(e){return t=>we(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>we(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,V(S,T)):I.each(`end`,V(S,T)):I.each(V(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let ee=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),ee.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e===`default`?z:e===`logRatio`?le:e,S):x},S}function V(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function H(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function _e(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=H(r[0],e,t);for(let n=1;n<r.length;++n){let o=H(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*H({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?_e(e,[]):O(l.arcs.map(e=>e.p1))}function ve(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ye(e,t,n){let r={},i=ve(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=_e(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function be(e,t,n){let r=[];return r.push(`
1
+ import{h as e,p as t}from"./src-DssjGmtU.js";import{$ as n,B as r,C as i,Q as a,V as o,W as s,_ as c,a as l,c as u,d,et as f,tt as p,v as m,y as h}from"./chunk-ICPOFSXX-CPrjaFl6.js";import"./dist-ePW3hz19.js";import{r as g}from"./chunk-5PVQY5BW-Dw-Sd9tl.js";import{t as _}from"./chunk-426QAEUC-CAPR5ZG1.js";import{t as v}from"./rough.esm-HAx67Hnb.js";var y=(e,t)=>f(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function ee(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function te(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||oe,r=t.lossFunction||z,i=re(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var ne=1e-10;function R(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+ne?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function re(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function ie(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=R(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ae(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function oe(e,t={}){let n=ce(e,t),r=t.lossFunction||z;if(e.length>=8){let i=se(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function se(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=ie(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ae(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=ee(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function ce(e,t){let n=t&&t.lossFunction?t.lossFunction:z,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+ne>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=R(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=R(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function z(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function le(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function ue(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function de(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function B(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function fe(e,t,n){t??=Math.PI/2;let r=he(e).map(e=>Object.assign({},e)),i=de(r);for(let e of i){ue(e,t,n);let r=B(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=B(r);return me(r)}function pe(e,t,n,r,i){let a=he(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=B(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return me(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function me(e){let t={};for(let n of e)t[n.setid]=n;return t}function he(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function ge(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=te,x=z;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=fe(e,o,f)),S=pe(e,n,r,i,c),C=ye(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=xe(t))});function k(e){return t=>we(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>we(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,V(S,T)):I.each(`end`,V(S,T)):I.each(V(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let ee=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),ee.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e===`default`?z:e===`logRatio`?le:e,S):x},S}function V(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function H(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function _e(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=H(r[0],e,t);for(let n=1;n<r.length;++n){let o=H(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*H({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?_e(e,[]):O(l.arcs.map(e=>e.p1))}function ve(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ye(e,t,n){let r={},i=ve(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=_e(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function be(e,t,n){let r=[];return r.push(`
2
2
  M`,e,t),r.push(`
3
3
  m`,-n,0),r.push(`
4
4
  a`,n,n,0,1,0,n*2,0),r.push(`
@@ -1,4 +1,4 @@
1
- import"./chunk-K5T4RW27-Bav1KRIS.js";import"./chunk-7N4EOEYR-CFBOyqnD.js";import"./chunk-67CJDMHE-Dl7bLJGe.js";import"./chunk-KGLVRYIC-nj7A12cJ.js";import"./chunk-FOC6F5B3-COVX_UuK.js";import"./chunk-AA7GKIK3-BnnqjSlh.js";import"./chunk-2KRD3SAO-DAJbbBPY.js";import"./chunk-ORNJ4GCN-BvGwrI3j.js";import"./chunk-LIHQZDEY-BmMkL9jD.js";import"./chunk-CIAEETIT-jjeAEkQy.js";import{g as e,h as t}from"./src-DssjGmtU.js";import{B as n,C as r,L as i,V as a,W as o,_ as s,a as c,b as l,c as u,v as d}from"./chunk-ICPOFSXX-DkmwqyfQ.js";import{t as f}from"./chunk-426QAEUC-28Pgly06.js";import{t as p}from"./chunk-4BX2VUAB-BTCTbhtf.js";import{t as m}from"./mermaid-parser.core-Ba5Re-_1.js";var h=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),g=t((e,t,n)=>({x:h(t,`${n} evolution`),y:h(e,`${n} visibility`)}),`toCoordinates`),_=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),v=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),y=t((e,t)=>{if(p(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=g(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=g(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=g(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=h(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=_(e.fromPort)??_(e.toPort),{flow:i,label:a}=v(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(e.from,e.to,n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=h(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=g(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=g(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=g(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=g(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),b={parser:{yy:void 0},parse:t(async t=>{let n=await m(`wardley`,t);e.debug(n);let r=b.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);y(n,r)},`parse`)},x=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function S(e){let t=l();return i(e.trim(),t)}t(S,`textSanitizer`);function C(){return l()[`wardley-beta`]}t(C,`getConfig`);function w(e,t,n,r,i,a,o,s,c){x.addNode({id:e,label:S(t),x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(w,`addNode`);function T(e,t,n=!1,r,i){x.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(T,`addLink`);function E(e,t,n){x.addTrend({nodeId:e,targetX:t,targetY:n})}t(E,`addTrend`);function D(e,t,n){x.addAnnotation({number:e,coordinates:t,text:n?S(n):void 0})}t(D,`addAnnotation`);function O(e,t,n){x.addNote({text:S(e),x:t,y:n})}t(O,`addNote`);function k(e,t,n){x.addAccelerator({name:S(e),x:t,y:n})}t(k,`addAccelerator`);function A(e,t,n){x.addDeaccelerator({name:S(e),x:t,y:n})}t(A,`addDeaccelerator`);function j(e,t){x.setAnnotationsBox(e,t)}t(j,`setAnnotationsBox`);function M(e,t){x.setSize(e,t)}t(M,`setSize`);function N(e){x.startPipeline(e)}t(N,`startPipeline`);function P(e,t){x.addPipelineComponent(e,t)}t(P,`addPipelineComponent`);function F(e){let t={};e.xLabel&&(t.xLabel=S(e.xLabel)),e.yLabel&&(t.yLabel=S(e.yLabel)),e.stages&&(t.stages=e.stages.map(e=>S(e))),e.stageBoundaries&&(t.stageBoundaries=e.stageBoundaries),x.setAxes(t)}t(F,`updateAxes`);function I(e){return x.getNode(e)}t(I,`getNode`);function L(){return x.build()}t(L,`getWardleyData`);function R(){x.clear(),c()}t(R,`clear`);var z={getConfig:C,addNode:w,addLink:T,addTrend:E,addAnnotation:D,addNote:O,addAccelerator:k,addDeaccelerator:A,setAnnotationsBox:j,setSize:M,startPipeline:N,addPipelineComponent:P,updateAxes:F,getNode:I,getWardleyData:L,clear:R,setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},B=[`Genesis`,`Custom Built`,`Product`,`Commodity`],V=t(()=>{let{themeVariables:e}=l();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),H=t(()=>{let e=l()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),U={parser:b,db:z,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
1
+ import"./chunk-K5T4RW27-Bav1KRIS.js";import"./chunk-7N4EOEYR-CFBOyqnD.js";import"./chunk-67CJDMHE-Dl7bLJGe.js";import"./chunk-KGLVRYIC-nj7A12cJ.js";import"./chunk-FOC6F5B3-COVX_UuK.js";import"./chunk-AA7GKIK3-BnnqjSlh.js";import"./chunk-2KRD3SAO-DAJbbBPY.js";import"./chunk-ORNJ4GCN-BvGwrI3j.js";import"./chunk-LIHQZDEY-BmMkL9jD.js";import"./chunk-CIAEETIT-jjeAEkQy.js";import{g as e,h as t}from"./src-DssjGmtU.js";import{B as n,C as r,L as i,V as a,W as o,_ as s,a as c,b as l,c as u,v as d}from"./chunk-ICPOFSXX-CPrjaFl6.js";import{t as f}from"./chunk-426QAEUC-CAPR5ZG1.js";import{t as p}from"./chunk-4BX2VUAB-BTCTbhtf.js";import{t as m}from"./mermaid-parser.core-CBRGDK2w.js";var h=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),g=t((e,t,n)=>({x:h(t,`${n} evolution`),y:h(e,`${n} visibility`)}),`toCoordinates`),_=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),v=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),y=t((e,t)=>{if(p(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=g(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=g(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=g(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=h(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=_(e.fromPort)??_(e.toPort),{flow:i,label:a}=v(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(e.from,e.to,n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=h(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=g(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=g(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=g(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=g(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),b={parser:{yy:void 0},parse:t(async t=>{let n=await m(`wardley`,t);e.debug(n);let r=b.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);y(n,r)},`parse`)},x=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function S(e){let t=l();return i(e.trim(),t)}t(S,`textSanitizer`);function C(){return l()[`wardley-beta`]}t(C,`getConfig`);function w(e,t,n,r,i,a,o,s,c){x.addNode({id:e,label:S(t),x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(w,`addNode`);function T(e,t,n=!1,r,i){x.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(T,`addLink`);function E(e,t,n){x.addTrend({nodeId:e,targetX:t,targetY:n})}t(E,`addTrend`);function D(e,t,n){x.addAnnotation({number:e,coordinates:t,text:n?S(n):void 0})}t(D,`addAnnotation`);function O(e,t,n){x.addNote({text:S(e),x:t,y:n})}t(O,`addNote`);function k(e,t,n){x.addAccelerator({name:S(e),x:t,y:n})}t(k,`addAccelerator`);function A(e,t,n){x.addDeaccelerator({name:S(e),x:t,y:n})}t(A,`addDeaccelerator`);function j(e,t){x.setAnnotationsBox(e,t)}t(j,`setAnnotationsBox`);function M(e,t){x.setSize(e,t)}t(M,`setSize`);function N(e){x.startPipeline(e)}t(N,`startPipeline`);function P(e,t){x.addPipelineComponent(e,t)}t(P,`addPipelineComponent`);function F(e){let t={};e.xLabel&&(t.xLabel=S(e.xLabel)),e.yLabel&&(t.yLabel=S(e.yLabel)),e.stages&&(t.stages=e.stages.map(e=>S(e))),e.stageBoundaries&&(t.stageBoundaries=e.stageBoundaries),x.setAxes(t)}t(F,`updateAxes`);function I(e){return x.getNode(e)}t(I,`getNode`);function L(){return x.build()}t(L,`getWardleyData`);function R(){x.clear(),c()}t(R,`clear`);var z={getConfig:C,addNode:w,addLink:T,addTrend:E,addAnnotation:D,addNote:O,addAccelerator:k,addDeaccelerator:A,setAnnotationsBox:j,setSize:M,startPipeline:N,addPipelineComponent:P,updateAxes:F,getNode:I,getWardleyData:L,clear:R,setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},B=[`Genesis`,`Custom Built`,`Product`,`Commodity`],V=t(()=>{let{themeVariables:e}=l();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),H=t(()=>{let e=l()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),U={parser:b,db:z,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
2
2
  `+n);let o=H(),s=V(),c=o.nodeRadius*1.6,l=a.db,d=l.getWardleyData(),p=l.getDiagramTitle(),m=d.size?.width??o.width,h=d.size?.height??o.height,g=f(r);g.selectAll(`*`).remove(),u(g,h,m,o.useMaxWidth),g.attr(`viewBox`,`0 0 ${m} ${h}`);let _=g.append(`g`).attr(`class`,`wardley-map`),v=g.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,m).attr(`height`,h).attr(`fill`,s.backgroundColor);let y=m-o.padding*2,b=h-o.padding*2;p&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,m/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(p);let x=t(e=>o.padding+e/100*y,`projectX`),S=t(e=>h-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,m-o.padding).attr(`y1`,h-o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,h-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:B;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,h-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,m-o.padding).attr(`y1`,h-o.padding-b*n).attr(`y2`,h-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,l=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),l=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=l-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-c/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-c/2).attr(`y`,e=>D.get(e.id).y-c/2).attr(`width`,c).attr(`height`,c).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=m-o.padding-l,p=o.padding,g=h-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(p,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
3
3
  M ${n} ${r-30/2}
4
4
  L ${n+60-20} ${r-30/2}
@@ -1,4 +1,4 @@
1
- import{g as e,h as t}from"./src-DssjGmtU.js";import{B as n,C as r,E as i,L as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-ICPOFSXX-DkmwqyfQ.js";import{t as m}from"./linear-Cdt0EBMa.js";import{t as h}from"./ordinal-BLrOss5K.js";import"./defaultLocale-GJwWH1Jr.js";import{t as g}from"./init-BPLPMQ3Y.js";import"./dist-ePW3hz19.js";import{r as _}from"./chunk-5PVQY5BW-Ck-5mL2A.js";import{t as v}from"./line-B4V-vQdN.js";import{t as y}from"./chunk-426QAEUC-28Pgly06.js";import{t as b}from"./chunk-U2HBQHQK-BCWQB0k9.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],D=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],O=[1,64],k={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,27:`NUMBER_WITH_DECIMAL`,28:`COMMA`,31:`ARROW_DELIMITER`,34:`NEWLINE`,35:`SEMI`,36:`EOF`,38:`STR`,39:`MD_STR`,41:`AMP`,42:`NUM`,43:`ALPHA`,44:`PLUS`,45:`EQUALS`,46:`MULT`,47:`DOT`,48:`BRKT`,49:`MINUS`,50:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:`text`,text:``});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 27:this.$=a[s-1];break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:`text`,text:``});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:this.$={text:a[s],type:`text`};break;case 38:this.$={text:a[s],type:`text`};break;case 39:this.$={text:a[s],type:`markdown`};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(n,r,{3:1,4:2,7:4,5:i,34:a,35:o,36:s}),{1:[3]},e(n,r,{4:2,7:4,3:8,5:i,34:a,35:o,36:s}),e(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],34:a,35:o,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,34]),e(c,[2,35]),e(c,[2,36]),{1:[2,1]},e(n,r,{4:2,7:4,3:21,5:i,34:a,35:o,36:s}),{1:[2,3]},e(c,[2,5]),e(n,[2,7],{4:22,34:a,35:o,36:s}),{11:23,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:39,13:38,24:x,27:S,29:40,30:41,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:45,15:44,27:C,33:46,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:49,17:48,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:52,17:51,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,37],{40:55,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b}),e(E,[2,38]),e(E,[2,39]),e(D,[2,40]),e(D,[2,42]),e(D,[2,43]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:S}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:C}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:O},e(T,[2,14]),{17:65,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:O},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,h as t}from"./src-DssjGmtU.js";import{B as n,C as r,E as i,L as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-ICPOFSXX-CPrjaFl6.js";import{t as m}from"./linear-Cdt0EBMa.js";import{t as h}from"./ordinal-BLrOss5K.js";import"./defaultLocale-GJwWH1Jr.js";import{t as g}from"./init-BPLPMQ3Y.js";import"./dist-ePW3hz19.js";import{r as _}from"./chunk-5PVQY5BW-Dw-Sd9tl.js";import{t as v}from"./line-x0RuVReA.js";import{t as y}from"./chunk-426QAEUC-CAPR5ZG1.js";import{t as b}from"./chunk-U2HBQHQK-stvjyyuR.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],D=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],O=[1,64],k={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,27:`NUMBER_WITH_DECIMAL`,28:`COMMA`,31:`ARROW_DELIMITER`,34:`NEWLINE`,35:`SEMI`,36:`EOF`,38:`STR`,39:`MD_STR`,41:`AMP`,42:`NUM`,43:`ALPHA`,44:`PLUS`,45:`EQUALS`,46:`MULT`,47:`DOT`,48:`BRKT`,49:`MINUS`,50:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:`text`,text:``});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 27:this.$=a[s-1];break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:`text`,text:``});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:this.$={text:a[s],type:`text`};break;case 38:this.$={text:a[s],type:`text`};break;case 39:this.$={text:a[s],type:`markdown`};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(n,r,{3:1,4:2,7:4,5:i,34:a,35:o,36:s}),{1:[3]},e(n,r,{4:2,7:4,3:8,5:i,34:a,35:o,36:s}),e(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],34:a,35:o,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,34]),e(c,[2,35]),e(c,[2,36]),{1:[2,1]},e(n,r,{4:2,7:4,3:21,5:i,34:a,35:o,36:s}),{1:[2,3]},e(c,[2,5]),e(n,[2,7],{4:22,34:a,35:o,36:s}),{11:23,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:39,13:38,24:x,27:S,29:40,30:41,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:45,15:44,27:C,33:46,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:49,17:48,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:52,17:51,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,37],{40:55,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b}),e(E,[2,38]),e(E,[2,39]),e(D,[2,40]),e(D,[2,42]),e(D,[2,43]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:S}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:C}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:O},e(T,[2,14]),{17:65,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:O},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};k.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(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:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -5,12 +5,12 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Browser — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/browser-Bwd_rYu9.js"></script>
8
+ <script type="module" crossorigin src="/assets/browser-CwU2ReNI.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
10
- <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BBvWzgtz.js">
11
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-BgPlhiCM.js">
12
- <link rel="modulepreload" crossorigin href="/assets/SidebarSplitter-CidskiAr.js">
13
- <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CzWzToaM.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-CJ2UADOe.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CpRQprdb.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/SidebarSplitter-D0mErwLL.js">
13
+ <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CQBRZjvc.css">
14
14
  <link rel="stylesheet" crossorigin href="/assets/AdminShell-qc_xy7Az.css">
15
15
  </head>
16
16
  <body>
@@ -5,12 +5,12 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Chat — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/chat-wbKqew6m.js"></script>
8
+ <script type="module" crossorigin src="/assets/chat-NxS8JsVQ.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
10
- <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BBvWzgtz.js">
11
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-BgPlhiCM.js">
12
- <link rel="modulepreload" crossorigin href="/assets/Transcript-iuM5b4JT.js">
13
- <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CzWzToaM.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-CJ2UADOe.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CpRQprdb.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/Transcript-BaC574J0.js">
13
+ <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CQBRZjvc.css">
14
14
  <link rel="stylesheet" crossorigin href="/assets/AdminShell-qc_xy7Az.css">
15
15
  </head>
16
16
  <body>
@@ -5,13 +5,13 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Data — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/data-BSt0roMQ.js"></script>
8
+ <script type="module" crossorigin src="/assets/data-CebDWao6.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
10
- <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BBvWzgtz.js">
11
- <link rel="modulepreload" crossorigin href="/assets/graph-labels-DvO7i7Ez.js">
12
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-BgPlhiCM.js">
13
- <link rel="modulepreload" crossorigin href="/assets/SidebarSplitter-CidskiAr.js">
14
- <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CzWzToaM.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-CJ2UADOe.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/graph-labels-DznU92XA.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CpRQprdb.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/SidebarSplitter-D0mErwLL.js">
14
+ <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CQBRZjvc.css">
15
15
  <link rel="stylesheet" crossorigin href="/assets/AdminShell-qc_xy7Az.css">
16
16
  </head>
17
17
  <body>
@@ -5,14 +5,14 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Graph — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/graph-BEu_XQMZ.js"></script>
8
+ <script type="module" crossorigin src="/assets/graph-qR6IbCv1.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
10
- <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BBvWzgtz.js">
11
- <link rel="modulepreload" crossorigin href="/assets/graph-labels-DvO7i7Ez.js">
12
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-BgPlhiCM.js">
13
- <link rel="modulepreload" crossorigin href="/assets/Checkbox-DWx2NcU9.js">
14
- <link rel="modulepreload" crossorigin href="/assets/SidebarSplitter-CidskiAr.js">
15
- <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CzWzToaM.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-CJ2UADOe.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/graph-labels-DznU92XA.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CpRQprdb.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/Checkbox-hYA5LjZ5.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/SidebarSplitter-D0mErwLL.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CQBRZjvc.css">
16
16
  <link rel="stylesheet" crossorigin href="/assets/AdminShell-qc_xy7Az.css">
17
17
  </head>
18
18
  <body>
@@ -5,14 +5,14 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/admin-Cdz561nK.js"></script>
8
+ <script type="module" crossorigin src="/assets/admin-BVasculM.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
10
- <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BBvWzgtz.js">
11
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-BgPlhiCM.js">
12
- <link rel="modulepreload" crossorigin href="/assets/Checkbox-DWx2NcU9.js">
13
- <link rel="modulepreload" crossorigin href="/assets/SidebarSplitter-CidskiAr.js">
14
- <link rel="modulepreload" crossorigin href="/assets/Transcript-iuM5b4JT.js">
15
- <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CzWzToaM.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-CJ2UADOe.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CpRQprdb.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/Checkbox-hYA5LjZ5.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/SidebarSplitter-D0mErwLL.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/Transcript-BaC574J0.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CQBRZjvc.css">
16
16
  <link rel="stylesheet" crossorigin href="/assets/AdminShell-qc_xy7Az.css">
17
17
  <link rel="stylesheet" crossorigin href="/assets/admin-CWMpccrR.css">
18
18
  <link rel="stylesheet" href="/brand-defaults.css">
@@ -5,11 +5,11 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/public-927mDSLH.js"></script>
8
+ <script type="module" crossorigin src="/assets/public-tk3PfPWF.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
10
- <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BBvWzgtz.js">
11
- <link rel="modulepreload" crossorigin href="/assets/Checkbox-DWx2NcU9.js">
12
- <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CzWzToaM.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-CJ2UADOe.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/Checkbox-hYA5LjZ5.js">
12
+ <link rel="stylesheet" crossorigin href="/assets/useSelectionMode-CQBRZjvc.css">
13
13
  <link rel="stylesheet" crossorigin href="/assets/public-vnj7OhQj.css">
14
14
  <link rel="stylesheet" href="/brand-defaults.css">
15
15
  </head>
@@ -97,7 +97,7 @@ import {
97
97
  vncLog,
98
98
  walkPremiumBundles,
99
99
  writeAdminUserAndPerson
100
- } from "./chunk-EAJMRICW.js";
100
+ } from "./chunk-QDCBAHPI.js";
101
101
  import {
102
102
  __commonJS,
103
103
  __toESM
@@ -17762,7 +17762,7 @@ app47.get("/public", (c) => {
17762
17762
  if (isPublicHost(host)) return c.text("Not found", 404);
17763
17763
  return c.html(cachedHtml("public.html"));
17764
17764
  });
17765
- app47.get("/chat", (c) => {
17765
+ app47.get("/public-chat", (c) => {
17766
17766
  const host = (c.req.header("host") ?? "").split(":")[0];
17767
17767
  if (isPublicHost(host)) return c.text("Not found", 404);
17768
17768
  return c.html(cachedHtml("public.html"));
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-CWOGyPgy.js";import{d as t,f as n,l as r,m as i,o as a,r as o,t as s,u as c}from"./useSelectionMode-BBvWzgtz.js";async function l(){try{let e=await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`logout`})});return e.ok?(await e.json().catch(()=>({})))?.logged_out===!0:(console.error(`[admin-ui] claude-logout http-status=${e.status}`),!1)}catch(e){return console.error(`[admin-ui] claude-logout fetch failed: ${e instanceof Error?e.message:String(e)}`),!1}}var u=n(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),d=n(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),f=n(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),p=n(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),m=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),h=n(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),g=n(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),_=n(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),v=n(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),y=n(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),b=n(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),x=n(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),S=n(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),C=n(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),w=n(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),T=n(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ee=n(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),E=n(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),D=n(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),O=n(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),te=n(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),ne=n(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),k=n(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),A=n(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),j=n(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),M=`maxy-admin-session`,re=typeof BroadcastChannel<`u`;function N(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`rotation`&&typeof t.newKey==`string`&&t.newKey.length>0&&(t.surface===`chat`||t.surface===`graph`||t.surface===`data`||t.surface===`sessions`)&&typeof t.ts==`number`}function ie(e){if(!re)return()=>{};let t=new BroadcastChannel(M),n=t=>{if(!N(t.data)){console.warn(`[admin-session-broadcast] outcome=received-malformed payload=${JSON.stringify(t.data)}`);return}e(t.data)};return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),t.close()}}var P=e(i(),1),F=`maxy-admin-session-key`;function I(e,t){return`${e}${e.includes(`?`)?`&`:`?`}session_key=${encodeURIComponent(t)}`}async function L(e){let t;try{t=await e.clone().json()}catch{return`parse-failed`}if(typeof t!=`object`||!t)return`unknown-401`;let n=t.code;return n===`session-missing`||n===`session-not-registered`||n===`session-expired-age`||n===`grant-expired`?n:`unknown-401`}function R(){try{return sessionStorage.getItem(F)}catch{return null}}function z(e){let{initialCacheKey:t,surface:n}=e,[r,i]=(0,P.useState)(t),a=(0,P.useRef)(t);(0,P.useEffect)(()=>{a.current=r},[r]),(0,P.useEffect)(()=>{t!==a.current&&(i(t),a.current=t,s(e=>e+1))},[t]);let[o,s]=(0,P.useState)(0);(0,P.useEffect)(()=>ie(e=>{let t=a.current.slice(0,8),r=e.newKey.slice(0,8);e.newKey!==a.current&&(console.log(`[admin-session-broadcast] outcome=received oldKey=${t} newKey=${r} surface=${n} senderSurface=${e.surface}`),i(e.newKey),s(e=>e+1))}),[n]);let c=(0,P.useCallback)(()=>{try{sessionStorage.removeItem(F)}catch{}window.location.href=`/`},[]);return{adminFetch:(0,P.useCallback)(async(e,t)=>{let r=a.current,o=I(e,r),l=await fetch(o,t);if(l.status!==401)return l;let u=await L(l);if(u===`session-missing`||u!==`session-not-registered`)return console.warn(`[useAdminFetch] outcome=session-expired-redirect reason=${u} surface=${n} path=${e}`),c(),l;let d=R();if(!d||d===r)return console.warn(`[useAdminFetch] outcome=session-expired-redirect reason=session-not-registered-no-fresh-key surface=${n} path=${e}`),c(),l;i(d),a.current=d,s(e=>e+1),console.log(`[useAdminFetch] outcome=retry-after-rotation oldKey=${r.slice(0,8)} newKey=${d.slice(0,8)} surface=${n} path=${e}`);let f=I(e,d),p=await fetch(f,t);return p.status===401&&(console.warn(`[useAdminFetch] outcome=session-expired-redirect reason=second-401-after-retry surface=${n} path=${e}`),c()),p},[c,n]),cacheKey:r,sessionRefetchNonce:o}}var B=r(),V=(0,P.createContext)(null);function H({cacheKey:e,onSessionExpired:t,surface:n,children:r}){let i=(0,P.useCallback)(async(r,i)=>{if(!e)return fetch(r,i);let a=I(r,e),o=await fetch(a,i);if(o.status!==401)return o;let s=await L(o),c=e.slice(-8);if(s===`session-not-registered`){let a=R();if(a&&a!==e){let e=I(r,a),o=await fetch(e,i);return o.status===401?(console.warn(`[admin-auth] outcome=session-expired-redirect code=second-401-after-retry path=${r} cacheKey=${c} surface=${n}`),t({code:`second-401-after-retry`,path:r}),o):o}}return console.warn(`[admin-auth] outcome=session-expired-redirect code=${s} path=${r} cacheKey=${c} surface=${n}`),t({code:s,path:r}),o},[e,t,n]);return(0,B.jsx)(V.Provider,{value:i,children:r})}function U(){return(0,P.useContext)(V)}function ae(e){let t=U();return(0,P.useMemo)(()=>t||(async(t,n)=>fetch(e?I(t,e):t,n)),[t,e])}function W(e){let{businessName:t,onNavigate:n,onToggleSidebar:r,sidebarOpen:i,onLogout:s,onDisconnect:l,disconnecting:u}=e,[d,f]=(0,P.useState)(!1),p=(0,P.useRef)(null),g=(0,P.useRef)(null),y=ae(null),[x,D]=(0,P.useState)(null),[O,ne]=(0,P.useState)(!1),[A,M]=(0,P.useState)(null),[re,N]=(0,P.useState)(null),[ie,F]=(0,P.useState)(!1),[I,L]=(0,P.useState)(null),[R,z]=(0,P.useState)(null),[V,H]=(0,P.useState)(``);(0,P.useEffect)(()=>{H(window.location.hostname.startsWith(`admin.`)?window.location.origin.replace(`admin.`,`public.`):window.location.origin)},[]),(0,P.useEffect)(()=>{if(!d)return;let e=e=>{p.current&&!p.current.contains(e.target)&&f(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,P.useEffect)(()=>{if(!d)return;let e=e=>{e.key===`Escape`&&f(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d]),(0,P.useEffect)(()=>{d&&g.current?.focus()},[d]),(0,P.useEffect)(()=>{if(!d)return;let e=!1;return y(`/api/admin/version`).then(e=>e.json()).then(t=>{e||z(t)}).catch(e=>{console.error(`[admin/version] menu-open client fetch failed:`,e)}),()=>{e=!0}},[d,y]);let U=(0,P.useCallback)(()=>{f(e=>{let t=!e;return t&&console.info(`[admin-ui] header-menu-open`),t})},[]),W=(0,P.useCallback)(e=>{f(!1),n(e)},[n]),G=(0,P.useCallback)(async()=>{if(x!==null){D(null),N(null);return}ne(!0),M(null);try{let e=await y(`/api/admin/agents`);if(!e.ok)throw Error(`Failed to load agents`);D((await e.json()).agents??[])}catch(e){console.error(`[admin/agents] list failed:`,e),M(e instanceof Error?e.message:String(e)),D([])}finally{ne(!1)}},[x,y]),oe=(0,P.useCallback)(e=>{N(null),D(t=>t?.filter(t=>t.slug!==e)??null),y(`/api/admin/agents/${encodeURIComponent(e)}`,{method:`DELETE`}).catch(e=>console.error(`[admin/agents] delete failed:`,e))},[y]),K=(0,P.useCallback)(()=>{f(!1),s()},[s]),se=(0,P.useCallback)(async()=>{L(null),await l()?(F(!1),f(!1)):L(`Disconnect failed — credentials still present. Try again.`)},[l]),q=t||o.productName;return(0,B.jsxs)(`header`,{className:`admin-header`,children:[(0,B.jsx)(`button`,{type:`button`,className:`admin-sidebar-toggle`,"aria-label":i?`Hide sidebar`:`Show sidebar`,title:i?`Hide sidebar`:`Show sidebar`,"aria-expanded":i,onClick:r,children:i?(0,B.jsx)(ee,{size:20,strokeWidth:1.5}):(0,B.jsx)(E,{size:20,strokeWidth:1.5})}),(0,B.jsxs)(`div`,{className:`chat-header-label`,children:[(0,B.jsx)(`span`,{className:`chat-logo-btn`,"aria-hidden":`true`,children:(0,B.jsx)(`img`,{src:a,alt:``,className:`chat-logo`})}),(0,B.jsx)(`h1`,{className:`chat-tagline`,children:q})]}),(0,B.jsxs)(`div`,{className:`chat-burger-wrap`,ref:p,children:[(0,B.jsx)(`button`,{type:`button`,className:`admin-burger`,onClick:U,"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":d,children:(0,B.jsx)(w,{size:20})}),d&&(0,B.jsxs)(`div`,{className:`admin-menu`,role:`menu`,children:[(0,B.jsxs)(`button`,{ref:g,type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>W(`data`),children:[(0,B.jsx)(h,{size:14}),` Data`]}),(0,B.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>W(`graph`),children:[(0,B.jsx)(te,{size:14}),` Graph`]}),(0,B.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>W(`browser`),children:[(0,B.jsx)(v,{size:14}),` Browser`]}),(0,B.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>W(`chat`),children:[(0,B.jsx)(T,{size:14}),` Chat`]}),(0,B.jsx)(`div`,{className:`chat-menu-divider`}),(0,B.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:G,children:[(0,B.jsx)(_,{size:14}),` Public`,O&&(0,B.jsx)(S,{size:12,className:`spin`})]}),x!==null&&(0,B.jsxs)(`div`,{className:`chat-menu-agents`,children:[A&&(0,B.jsx)(`span`,{className:`chat-menu-agent-error`,children:A}),x.length===0&&!A&&(0,B.jsx)(`span`,{className:`chat-menu-agent-empty`,children:`No public agents configured`}),x.map(e=>(0,B.jsxs)(`div`,{className:`chat-menu-item chat-menu-agent-item`,children:[(0,B.jsx)(`span`,{className:`agent-status-dot ${e.status}`}),(0,B.jsxs)(`span`,{className:`agent-text`,children:[(0,B.jsx)(`span`,{className:`agent-display-name`,children:e.displayName}),(0,B.jsxs)(`span`,{className:`agent-slug`,children:[`/`,e.slug]})]}),re===e.slug?(0,B.jsxs)(`span`,{className:`agent-actions agent-confirm`,children:[(0,B.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-yes`,title:`Confirm delete`,onClick:()=>oe(e.slug),children:(0,B.jsx)(m,{size:12})}),(0,B.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel`,onClick:()=>N(null),children:(0,B.jsx)(j,{size:12})})]}):(0,B.jsxs)(`span`,{className:`agent-actions`,children:[(0,B.jsx)(`a`,{href:`${V}/${e.slug}`,target:`_blank`,rel:`noopener noreferrer`,className:`agent-action-btn`,title:`Open agent`,onClick:()=>f(!1),children:(0,B.jsx)(_,{size:12})}),(0,B.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-delete-btn`,title:`Delete agent`,onClick:()=>N(e.slug),children:(0,B.jsx)(c,{size:12})})]})]},e.slug))]}),(0,B.jsx)(`div`,{className:`chat-menu-divider`}),(0,B.jsxs)(`div`,{className:`chat-menu-version chat-menu-version-passive`,children:[(0,B.jsx)(b,{size:14}),(0,B.jsxs)(`span`,{className:`version-installed`,children:[R?`v${R.installed}`:`…`,R&&!R.updateAvailable&&(0,B.jsx)(`span`,{className:`version-uptodate-dot`}),R?.updateAvailable&&(0,B.jsx)(`span`,{className:`version-update-dot`})]})]}),ie?(0,B.jsxs)(`div`,{className:`chat-menu-item chat-menu-disconnect`,children:[(0,B.jsx)(`span`,{children:`Disconnect Claude account?`}),(0,B.jsxs)(`span`,{className:`agent-actions agent-confirm`,children:[(0,B.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-yes`,title:`Confirm disconnect`,disabled:u,onClick:se,children:u?(0,B.jsx)(S,{size:12,className:`spin`}):(0,B.jsx)(m,{size:12})}),(0,B.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel disconnect`,disabled:u,onClick:()=>{F(!1),L(null)},children:(0,B.jsx)(j,{size:12})})]})]}):(0,B.jsxs)(`button`,{type:`button`,className:`chat-menu-item chat-menu-disconnect`,role:`menuitem`,onClick:()=>{L(null),F(!0)},children:[(0,B.jsx)(k,{size:14}),` Disconnect Claude account`]}),I&&(0,B.jsx)(`span`,{className:`chat-menu-agent-error`,children:I}),(0,B.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:K,children:[(0,B.jsx)(C,{size:14}),` Log out`]})]})]})]})}var G={whatsapp:{fill:`#25D366`,label:`WhatsApp`,path:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.263.489 1.694.625.712.227 1.36.195 1.872.118.571-.085 1.758-.719 2.006-1.413.247-.694.247-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.885-9.885 9.885M20.52 3.449C18.24 1.245 15.24.044 12.045.044 5.463.044.103 5.404.1 11.99c0 2.096.546 4.142 1.588 5.945L0 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.585 0 11.946-5.36 11.949-11.946 0-3.193-1.24-6.19-3.495-8.445`},telegram:{fill:`#229ED9`,label:`Telegram`,path:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`}};function oe({channel:e,size:t=16}){let n=G[e];return(0,B.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:n.fill,role:`img`,"aria-label":n.label,className:`channel-icon`,children:(0,B.jsx)(`path`,{d:n.path})})}var K=[`whatsapp`,`telegram`];function se(e,t,n=`data`){let r=`/api/admin/files/download?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`+(n===`data`?``:`&root=${encodeURIComponent(n)}`),i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()}function q(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return n>0?`${t}m ${n}s`:`${t}m`}function ce(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var J=`auth-refresh-failed`;function le({error:e,onClose:t}){if(!e)return null;let n=e.reason===J,r=n?`Claude sign-in expired`:`Session didn’t open`,i=n?`Your claude.ai login has expired. Re-authenticate to resume sessions.`:`The session did not bind within 60 seconds, so there is no live conversation to open.`;return(0,B.jsx)(`div`,{className:`claude-info-overlay`,onClick:t,children:(0,B.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Session could not be opened`,children:[(0,B.jsxs)(`div`,{className:`claude-info-header`,children:[(0,B.jsx)(`span`,{children:r}),(0,B.jsx)(`button`,{className:`claude-info-close`,onClick:t,"aria-label":`Close`,children:`✕`})]}),(0,B.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`},children:[i,(0,B.jsxs)(`div`,{className:`claude-info-row`,style:{marginTop:`8px`},children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Reason`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:e.reason})]}),e.sessionId&&(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,B.jsxs)(`span`,{className:`claude-info-value`,children:[e.sessionId.slice(0,8),`…`]})]})]})]})})}function ue(e){let{show:t,onClose:n,claudeInfo:r,messages:i,sessionElapsed:a,sessionId:o,cacheKey:c}=e,[l,u]=(0,P.useState)(null);if(!t)return null;let d=i.flatMap(e=>e.events?.filter(e=>e.type===`usage`)??[]),f=d.at(-1),p=f?.peak_request_pct==null?f?.context_window?Math.round((f.input_tokens+f.cache_creation_tokens+f.cache_read_tokens)/f.context_window*100):0:Math.round(f.peak_request_pct*100),m=d.reduce((e,t)=>e+t.input_tokens+t.cache_creation_tokens+t.cache_read_tokens+t.output_tokens,0),h=i.flatMap(e=>e.events?.filter(e=>e.type===`rate_limit`)??[]).at(-1),g=d.reduce((e,t)=>e+(t.total_cost_usd??0),0),_=r?.account?.subscriptionType,v=e=>{let t=e*1e3-Date.now();if(t<=0)return`now`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h ${r}m`:`${r}m`};return(0,B.jsx)(`div`,{className:`claude-info-overlay`,onClick:n,children:(0,B.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`claude-info-header`,children:[(0,B.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`claude-info-icon`}),(0,B.jsx)(`span`,{children:`Claude Code`}),(0,B.jsx)(`button`,{className:`claude-info-close`,onClick:n,"aria-label":`Close`,children:`✕`})]}),(0,B.jsxs)(`div`,{className:`claude-info-section`,children:[(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Version`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:r?r.version:`…`})]}),(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Email`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:r?.account?.email??`…`})]})]}),(_||h||g>0)&&(0,B.jsxs)(`div`,{className:`claude-info-section`,children:[_&&(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Plan`}),(0,B.jsx)(`span`,{className:`claude-info-value`,style:{textTransform:`capitalize`},children:_})]}),h&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Usage`}),(0,B.jsxs)(`span`,{className:`claude-info-value`,children:[Math.round(h.utilization*100),`%`]})]}),(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Resets in`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:v(h.resetsAt)})]}),h.isUsingOverage&&(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Overage`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:`Active`})]})]}),g>0&&(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Session cost`}),(0,B.jsxs)(`span`,{className:`claude-info-value`,children:[`$`,g<.01?g.toFixed(4):g.toFixed(2)]})]})]}),(0,B.jsxs)(`div`,{className:`claude-info-section`,children:[(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Model`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:r?.model??`…`})]}),(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Context used`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:p>0?`${p}%`:`—`})]}),(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Tokens`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:m>0?ce(m):`—`})]}),(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,B.jsx)(`span`,{className:`claude-info-value`,children:q(a)})]}),(o||c)&&(()=>{let e=o??c??``;return(0,B.jsxs)(`div`,{className:`claude-info-row`,children:[(0,B.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,B.jsx)(`button`,{type:`button`,className:`claude-info-value claude-info-id-copy`,title:`${e} (${o?`flushed`:`pre-flush`}) — click to copy`,onClick:async()=>{u(await s(e)?`copied`:`failed`),setTimeout(()=>u(null),1200)},children:l===`copied`?`copied ✓`:l===`failed`?`copy failed ✕`:`${e.slice(0,8)}…`})]})})()]})]})})}var de=`https://claude.ai/code`,fe=[500,1e3,1500,2e3,2500,3e3,3e3];function pe(e,t,n){let r=n.slug??n.bridgeSessionId??null;if(e&&r)return{kind:`navigate`,url:`${de}/${r}`};let i=n.reason||n.error||`status ${t}`;return{kind:`error`,sessionId:n.sessionId??null,reason:i}}function me(e){if(!e)return``;let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}function he(e){let{businessName:n,cacheKey:r,role:i,userName:a,userAvatar:s,onSelectProjects:l,onSelectPeople:m,onSelectTasks:h,onSelectAgents:v,onCloseMobileDrawer:b,collapsed:S,selectedWhatsappId:C,onSelectWhatsappConversation:w}=e,T=ae(r),ee=o.productName,E=typeof a==`string`?a:a===null?`name unavailable`:n||ee,te=(E.trim().charAt(0)||`?`).toUpperCase(),[k,j]=(0,P.useState)(`sessions`),[M,re]=(0,P.useState)([]),[N,ie]=(0,P.useState)(!1),[F,I]=(0,P.useState)(null),[L,R]=(0,P.useState)(!1),[z,V]=(0,P.useState)(`file`),[H,U]=(0,P.useState)(null),[W,G]=(0,P.useState)(null),[q,ce]=(0,P.useState)([]),[J,ue]=(0,P.useState)(!1),[de,he]=(0,P.useState)(null),[ge,Y]=(0,P.useState)(!1),[X,ve]=(0,P.useState)(!1),[ye,be]=(0,P.useState)(!1),[xe,Se]=(0,P.useState)(null),[Ce,we]=(0,P.useState)(new Set),[Te,Ee]=(0,P.useState)(new Set),[De,Oe]=(0,P.useState)(new Set),[ke,Ae]=(0,P.useState)(new Set),[Z,je]=(0,P.useState)(!1),[Me,Ne]=(0,P.useState)([]),[Pe,Fe]=(0,P.useState)(!1),[Ie,Le]=(0,P.useState)(null),[Re,ze]=(0,P.useState)(`whatsapp`),Be=(0,P.useCallback)(e=>{if(b(),!r){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=no-cache-key`),U({message:`Session not ready — try again`,failed:!0});return}if(!e.downloadPath){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=not-downloadable`),U({message:`${e.name} can’t be downloaded`,failed:!0});return}console.info(`[admin-ui] artefact-download id=${e.id} root=${e.downloadRoot??`data`} path=${e.downloadPath}`),se(r,e.downloadPath,e.downloadRoot??`data`),U({message:`Downloading ${e.name}`,failed:!1})},[r,b]);(0,P.useEffect)(()=>{if(!H)return;let e=setTimeout(()=>U(null),2500);return()=>clearTimeout(e)},[H]);let Ve=(0,P.useCallback)(async()=>{if(r){R(!0),I(null);try{let e=await T(`/api/admin/sidebar-artefacts`);if(!e.ok)throw Error(`status ${e.status}`);re((await e.json()).artefacts??[]),ie(!0)}catch(e){let t=e instanceof Error?e.message:String(e);I(`Failed to load artefacts: ${t}`),console.error(`[admin-ui] sidebar-artefacts fetch failed: ${t}`)}finally{R(!1)}}},[r,T]),Q=(0,P.useCallback)(async()=>{if(!r)return null;Y(!0),he(null);try{let e=await T(`/api/admin/sidebar-sessions`);if(!e.ok)throw Error(`status ${e.status}`);let t=await e.json(),n=t.sessions??[];return ce(n),Se(t.accountId??null),ue(!0),n}catch(e){let t=e instanceof Error?e.message:String(e);return he(`Failed to load sessions: ${t}`),console.error(`[admin-ui] sidebar-sessions fetch failed: ${t}`),null}finally{Y(!1)}},[r,T]),He=(0,P.useCallback)(async()=>{if(r){Le(null);try{let e=await T(`/api/whatsapp-reader/conversations`);if(!e.ok)throw Error(`status ${e.status}`);Ne((await e.json()).conversations??[]),Fe(!0)}catch(e){let t=e instanceof Error?e.message:String(e);Le(`Couldn't load conversations: ${t}`),console.error(`[admin-ui] channel-convos fetch failed: ${t}`)}}},[r,T]);(0,P.useEffect)(()=>{!r||J||Q()},[r,J,Q]),(0,P.useEffect)(()=>{r&&He()},[r,He]);let Ue=(0,P.useMemo)(()=>{let e=new Map;for(let t of K)e.set(t,[]);for(let t of Me)e.get(t.channel)?.push(t);for(let t of K)console.info(`[admin-ui] sidebar-nav surface=${t} count=${e.get(t).length}`);return e},[Me]),We={whatsapp:`WhatsApp`,telegram:`Telegram`},Ge=()=>{w(null),j(`artefacts`),console.info(`[admin-ui] sidebar-nav surface=artefacts count=${N?M.length:0} collapsed=${S}`),Ve()},$=1.5,Ke=()=>{console.info(`[admin-ui] sidebar-refresh surface=artefacts`),Ve()},qe=()=>{w(null),j(`sessions`),console.info(`[admin-ui] sidebar-nav surface=sessions count=${J?q.length:0} collapsed=${S}`),J||Q()},Je=()=>{console.info(`[admin-ui] sidebar-refresh surface=sessions`),Q()},Ye=e=>{j(`whatsapp`),ze(e),console.info(`[admin-ui] sidebar-nav surface=${e} count=${Ue.get(e)?.length??0} collapsed=${S}`)},Xe=(0,P.useCallback)(async e=>{if(e.resumable===!1||Te.has(e.sessionId))return;Ee(t=>{let n=new Set(t);return n.add(e.sessionId),n});let t=window.open(``,`_blank`);try{let n=await T(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId,name:e.title||e.sessionId})}),r=await n.json().catch(()=>({})),i=pe(n.ok,n.status,{...r,sessionId:r.sessionId??e.sessionId});console.info(`[admin-ui] sidebar-session-resume sessionId=${e.sessionId} status=${n.status} outcome=${i.kind} slug=${r.slug??r.bridgeSessionId??`none`}`),i.kind===`navigate`?(b(),t?t.location.href=i.url:window.open(i.url,`_blank`)):(t?.close(),console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} status=${n.status} reason=${i.reason}`),G(i))}catch(n){t?.close();let r=n instanceof Error?n.message:String(n);console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} error=${r}`),G({sessionId:e.sessionId,reason:r})}finally{Ee(t=>{let n=new Set(t);return n.delete(e.sessionId),n})}},[T,b,Te]),Ze=(0,P.useCallback)(async e=>{let t=e.slice(0,8);for(let n=1;n<=fe.length;n++){await new Promise(e=>setTimeout(e,fe[n-1]));let r=await Q();if(r&&r.some(t=>t.sessionId===e)){console.info(`[admin-ui] sidebar-new-session-converged sessionId=${t} via=retry attempts=${n}`);return}}console.error(`[admin-ui] sidebar-new-session-converge-timeout sessionId=${t}`)},[Q]),Qe=(0,P.useCallback)(async()=>{if(Z)return;je(!0);let e=window.open(``,`_blank`);try{let t=await T(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})}),n=await t.json().catch(()=>({})),r=pe(t.ok,t.status,n);console.info(`[admin-ui] sidebar-new-session-spawned status=${t.status} outcome=${r.kind} slug=${n.slug??n.bridgeSessionId??`none`}`),r.kind===`navigate`?(e?e.location.href=r.url:window.open(r.url,`_blank`),n.sessionId?Ze(n.sessionId):console.error(`[admin-ui] sidebar-new-session-converge-skipped reason=no-session-id`)):(e?.close(),console.error(`[admin-ui] sidebar-new-session-failed status=${t.status} reason=${r.reason}`),G(r))}catch(t){e?.close();let n=t instanceof Error?t.message:String(t);console.error(`[admin-ui] sidebar-new-session-failed error=${n}`),G({sessionId:null,reason:n})}finally{je(!1)}},[T,Z,Ze]),$e=(0,P.useCallback)(async(e,t)=>{if(e.stopPropagation(),!Ce.has(t.sessionId)){we(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await T(`/api/admin/session-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),U({message:`Delete failed: ${n.error??`status ${e.status}`}`,failed:!0});return}let n=await e.json();console.info(`[admin-ui] sidebar-session-delete sessionId=${t.sessionId} pidKilled=${n.pidKilled??`?`} deleted=${n.deleted??`?`}`),ce(e=>e.filter(e=>e.sessionId!==t.sessionId)),Q()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${t.sessionId} error=${n}`),U({message:`Delete failed: ${n}`,failed:!0})}finally{we(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[T,Ce,Q]),et=(0,P.useCallback)(async(e,t)=>{if(e.stopPropagation(),!De.has(t.sessionId)){Oe(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await T(`/api/admin/session-stop`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),U({message:`Stop failed: ${n.error??`status ${e.status}`}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-stop sessionId=${t.sessionId}`),Q()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} error=${n}`),U({message:`Stop failed: ${n}`,failed:!0})}finally{Oe(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[T,De,Q]),tt=(0,P.useCallback)(async(e,t,n)=>{if(e.stopPropagation(),!ke.has(t.sessionId)){Ae(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await T(`/api/admin/session-archive`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId,mode:n})});if(!e.ok){let r=await e.json().catch(()=>({})),i=r.detail??r.error??`status ${e.status}`;console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} status=${e.status} error=${r.error??`unknown`}`),U({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${i}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-archive sessionId=${t.sessionId} mode=${n}`),Q()}catch(e){let r=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} error=${r}`),U({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${r}`,failed:!0})}finally{Ae(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[T,ke,Q]);return(0,B.jsxs)(`aside`,{className:`side`,children:[(0,B.jsx)(`div`,{className:`side-new-session-row`,children:(0,B.jsxs)(`button`,{type:`button`,className:`side-new-session`,onClick:Qe,disabled:Z,"aria-busy":Z,children:[(0,B.jsx)(D,{size:14}),(0,B.jsx)(`span`,{children:Z?`Spawning…`:`New session`})]})}),(0,B.jsxs)(`nav`,{className:`side-nav`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=people`),m(),b()},children:[(0,B.jsx)(A,{size:20,strokeWidth:$}),(0,B.jsx)(`span`,{className:`label`,children:`People`}),(0,B.jsx)(`span`,{className:`kbd`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=agents`),v(),b()},children:[(0,B.jsx)(f,{size:20,strokeWidth:$}),(0,B.jsx)(`span`,{className:`label`,children:`Agents`}),(0,B.jsx)(`span`,{className:`kbd`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=projects`),l(),b()},children:[(0,B.jsx)(p,{size:20,strokeWidth:$}),(0,B.jsx)(`span`,{className:`label`,children:`Projects`}),(0,B.jsx)(`span`,{className:`kbd`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=tasks`),h(),b()},children:[(0,B.jsx)(x,{size:20,strokeWidth:$}),(0,B.jsx)(`span`,{className:`label`,children:`Tasks`}),(0,B.jsx)(`span`,{className:`kbd`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`nav-row${k===`artefacts`?` active`:``}`,onClick:Ge,children:[(0,B.jsx)(t,{size:20,strokeWidth:$}),(0,B.jsx)(`span`,{className:`label`,children:`Artefacts`}),(0,B.jsx)(`span`,{className:`kbd`})]}),(0,B.jsxs)(`button`,{type:`button`,className:`nav-row${k===`sessions`?` active`:``}`,onClick:qe,children:[(0,B.jsx)(y,{size:20,strokeWidth:$}),(0,B.jsx)(`span`,{className:`label`,children:`Sessions`}),(0,B.jsx)(`span`,{className:`kbd`})]}),Pe&&K.filter(e=>Ue.get(e).length>0).map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`nav-row${k===`whatsapp`&&Re===e?` active`:``}`,onClick:()=>Ye(e),children:[(0,B.jsx)(oe,{channel:e,size:16}),(0,B.jsx)(`span`,{className:`label`,children:We[e]}),(0,B.jsx)(`span`,{className:`kbd`})]},e)),Ie&&(0,B.jsx)(`div`,{className:`nav-row`,style:{color:`var(--text-tertiary)`,cursor:`default`},"aria-disabled":`true`,children:(0,B.jsx)(`span`,{className:`label`,children:Ie})})]}),k===`artefacts`&&(0,B.jsxs)(`div`,{className:`side-list`,children:[(0,B.jsxs)(`div`,{className:`group-head`,children:[(0,B.jsx)(`span`,{children:`Artefacts`}),(0,B.jsxs)(`span`,{className:`group-head-meta`,children:[(0,B.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh artefacts`,"aria-label":`Refresh artefacts`,onClick:Ke,disabled:L,children:(0,B.jsx)(O,{size:12,className:L?`spinning`:void 0})}),(0,B.jsx)(`span`,{children:L?`…`:String(M.length)})]})]}),F&&(0,B.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:F}),N&&!F&&M.length>0&&(()=>{let e=M.filter(e=>e.kind===`agent-template`).length,t=M.length-e;return(0,B.jsx)(`div`,{className:`artefact-filter-chips`,children:[{key:`all`,label:`All`,count:M.length},{key:`agent`,label:`Agents`,count:e},{key:`file`,label:`Files`,count:t}].map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`artefact-filter-chip${z===e.key?` active`:``}`,onClick:()=>V(e.key),disabled:e.count===0&&e.key!==`all`,children:[e.label,(0,B.jsx)(`span`,{className:`artefact-filter-chip-count`,children:e.count})]},e.key))})})(),N&&!F&&M.length===0&&(0,B.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No artefacts yet`}),M.filter(e=>z===`all`?!0:z===`agent`?e.kind===`agent-template`:e.kind!==`agent-template`).map(e=>{let n=e.kind===`agent-template`,r=n?f:t,i=me(e.updatedAt),a=e.downloadPath!==null;return(0,B.jsxs)(`button`,{type:`button`,className:`conv`,onClick:()=>Be(e),disabled:!a,style:a?void 0:{cursor:`default`},title:a?`Download ${e.name}`:`${e.name} can’t be downloaded`,children:[(0,B.jsx)(r,{size:14,className:`conv-icon`,"data-kind":n?`agent`:`file`,"aria-label":n?`agent template`:`file`}),(0,B.jsxs)(`span`,{className:`conv-stack`,children:[(0,B.jsx)(`span`,{className:`conv-name-line`,children:(0,B.jsx)(`span`,{className:`conv-name`,children:e.name})}),i&&(0,B.jsx)(`span`,{className:`conv-timestamp`,children:i})]}),a&&(0,B.jsx)(g,{size:12,className:`conv-rc-icon`,"aria-hidden":`true`})]},e.id)})]}),k===`sessions`&&(()=>{let e=q.filter(e=>X?!0:!e.isSubagent).filter(e=>ye?!0:!e.archived),t=q.some(e=>e.isSubagent),n=q.some(e=>e.archived);return(0,B.jsxs)(`div`,{className:`side-list`,children:[(0,B.jsxs)(`div`,{className:`group-head`,children:[(0,B.jsx)(`span`,{children:`Sessions`}),(0,B.jsxs)(`span`,{className:`group-head-meta`,children:[(0,B.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh sessions`,"aria-label":`Refresh sessions`,onClick:Je,disabled:ge,children:(0,B.jsx)(O,{size:12,className:ge?`spinning`:void 0})}),(0,B.jsx)(`span`,{children:ge?`…`:String(e.length)})]})]}),xe&&(0,B.jsx)(`div`,{className:`side-account-id`,title:`This install's accountId. The first 8 characters match the truncated UUID label on the live Remote Control daemon entry in claude.ai/code.`,children:(0,B.jsx)(`code`,{children:xe})}),(t||n)&&(0,B.jsxs)(`div`,{className:`artefact-filter-chips`,children:[t&&(0,B.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${X?` active`:``}`,onClick:()=>ve(e=>!e),title:X?`Hide subagent sessions`:`Show subagent sessions`,children:`Subagents`}),n&&(0,B.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${ye?` active`:``}`,onClick:()=>be(e=>!e),title:ye?`Hide archived sessions`:`Show archived sessions`,children:`Archived`})]}),de&&(0,B.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:de}),J&&!de&&e.length===0&&(0,B.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No sessions yet`}),e.map(e=>{let t=me(e.startedAt),n=Te.has(e.sessionId),r=Ce.has(e.sessionId),i=De.has(e.sessionId),a=ke.has(e.sessionId);return(0,B.jsxs)(`div`,{className:`conv conv-with-actions`,children:[(0,B.jsxs)(`div`,{className:`conv-main-static`,children:[(0,B.jsx)(`span`,{className:`conv-live-dot`,"data-live":e.live?`1`:`0`,"aria-label":e.live?`live session`:`ended session`}),(0,B.jsxs)(`span`,{className:`conv-stack`,children:[(0,B.jsx)(`span`,{className:`conv-name-line`,children:(0,B.jsx)(`span`,{className:`conv-name`,title:e.title,children:e.title})}),(0,B.jsxs)(`span`,{className:`conv-timestamp`,children:[(0,B.jsx)(`code`,{className:`conv-session-id`,title:`First 8 characters of this session's id — distinguishes rows with identical auto-titles. The resume/delete buttons act on the full id.`,children:e.sessionId.slice(0,8)}),t&&(0,B.jsxs)(`span`,{children:[` · `,t]})]})]})]}),(0,B.jsxs)(`div`,{className:`conv-actions`,children:[e.resumable===!1?(0,B.jsx)(`span`,{className:`conv-ephemeral`,title:`Public webchat session — ephemeral, not resumable`,"aria-label":`Ephemeral public session (not resumable)`,children:(0,B.jsx)(y,{size:12})}):(0,B.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:()=>{Xe(e)},disabled:n||r||i||a,"aria-busy":n,"aria-label":`Resume session ${e.title} in claude.ai/code`,title:`Resume in a fresh local Remote Control PTY`,children:(0,B.jsx)(_,{size:12})}),e.live?(0,B.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{et(t,e)},disabled:n||r||i||a,"aria-busy":i,"aria-label":`Stop session ${e.title}`,title:`Stop session process (keeps the conversation, can resume later)`,children:(0,B.jsx)(ne,{size:12})}):null,e.archived?(0,B.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{tt(t,e,`unarchive`)},disabled:n||r||i||a,"aria-busy":a,"aria-label":`Unarchive session ${e.title}`,title:`Unarchive (move back to the active list)`,children:(0,B.jsx)(u,{size:12})}):(0,B.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{tt(t,e,`archive`)},disabled:n||r||i||a,"aria-busy":a,"aria-label":`Archive session ${e.title}`,title:`Archive (hide from the list, keeps the conversation resumable)`,children:(0,B.jsx)(d,{size:12})}),(0,B.jsx)(`button`,{type:`button`,className:`conv-action conv-action-danger`,onClick:t=>{$e(t,e)},disabled:n||r||i||a,"aria-busy":r,"aria-label":`Delete session ${e.title}`,title:`Delete session (stops the process, removes the conversation)`,children:(0,B.jsx)(c,{size:12})})]})]},e.sessionId)})]})})(),k===`whatsapp`&&(0,B.jsxs)(`div`,{className:`side-list`,children:[(0,B.jsxs)(`div`,{className:`group-head`,children:[(0,B.jsx)(`span`,{children:We[Re]}),(0,B.jsxs)(`span`,{className:`group-head-meta`,children:[(0,B.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh conversations`,"aria-label":`Refresh conversations`,onClick:()=>{He()},children:(0,B.jsx)(O,{size:12})}),(0,B.jsx)(`span`,{children:String(Ue.get(Re).length)})]})]}),Ue.get(Re).map(e=>{let t=me(e.lastMessageAt);return(0,B.jsxs)(`button`,{type:`button`,className:`conv${C===e.sessionId?` active`:``}`,onClick:()=>{w(e),b()},title:e.title,children:[(0,B.jsx)(oe,{channel:e.channel,size:14}),(0,B.jsxs)(`span`,{className:`conv-stack`,children:[(0,B.jsx)(`span`,{className:`conv-name-line`,children:(0,B.jsx)(`span`,{className:`conv-name`,children:e.operatorName??e.whatsappName??e.senderId??e.title})}),t&&(0,B.jsx)(`span`,{className:`conv-timestamp`,children:t})]})]},e.sessionId)})]}),(0,B.jsx)(_e,{}),(0,B.jsxs)(`div`,{className:`side-foot`,children:[(0,B.jsx)(`div`,{className:`avatar`,children:s?(0,B.jsx)(`img`,{src:s,alt:E}):te}),(0,B.jsxs)(`div`,{className:`who`,children:[(0,B.jsx)(`span`,{className:`name`,children:E}),(0,B.jsx)(`span`,{className:`role`,children:i??`operator`})]})]}),H&&(0,B.jsx)(`div`,{className:`copy-toast${H.failed?` copy-toast-failed`:``}`,role:`status`,children:H.message}),(0,B.jsx)(le,{error:W,onClose:()=>G(null)})]})}var ge=5e3;function _e(){let[e,t]=(0,P.useState)(null);if((0,P.useEffect)(()=>{let e=!1,n=null;async function r(){try{let n=await fetch(`/api/admin/system-stats`);if(!n.ok){console.error(`[admin-ui] system-stats-fetch-failed status=${n.status}`);return}let r=await n.json();e||t(r)}catch(e){console.error(`[admin-ui] system-stats-fetch-failed reason=${e instanceof Error?e.message:String(e)}`)}}function i(){n===null&&(r(),n=setInterval(()=>{r()},ge))}function a(){n!==null&&(clearInterval(n),n=null)}function o(){document.hidden?a():i()}return document.hidden||i(),document.addEventListener(`visibilitychange`,o),()=>{e=!0,a(),document.removeEventListener(`visibilitychange`,o)}},[]),!e||e.platform===`darwin`)return null;let n=e.cpuPct,r=e.memUsedPct,i=n!==null&&n>=.9,a=n!==null&&n>=.98,o=r!==null&&r>=.9,s=r!==null&&r>=.98,c=i||o,l=a||s,u=e=>e===null?`—`:`${Math.round(e*100)}%`,d=e=>{if(e===null)return{width:`0%`,background:`var(--text-tertiary)`};let t=Math.min(1,Math.max(0,e)),n=Math.round(140*(1-t));return{width:`${Math.round(t*100)}%`,background:`hsl(${n}, 65%, 45%)`}},f=[`system-stats`];return c&&f.push(`system-stats--warn`),l&&f.push(`system-stats--crit`),(0,B.jsxs)(`div`,{className:f.join(` `),role:`status`,"aria-label":`host CPU and RAM`,children:[(0,B.jsxs)(`div`,{className:`system-stats__metric`,children:[(0,B.jsxs)(`span`,{className:i?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`CPU `,u(n)]}),(0,B.jsx)(`div`,{className:`system-stats__bar`,children:(0,B.jsx)(`div`,{className:`system-stats__bar-fill`,style:d(n)})})]}),(0,B.jsxs)(`div`,{className:`system-stats__metric`,children:[(0,B.jsxs)(`span`,{className:o?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`RAM `,u(r)]}),(0,B.jsx)(`div`,{className:`system-stats__bar`,children:(0,B.jsx)(`div`,{className:`system-stats__bar-fill`,style:d(r)})})]})]})}var Y=`admin-sidebar-collapsed`,X=`admin-sidebar-drawer-open`;function ve(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(Y)===`1`}catch{return!1}}function ye(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(Y,`1`):window.sessionStorage.removeItem(Y)}catch{}}function be(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(X)===`1`}catch{return!1}}function xe(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(X,`1`):window.sessionStorage.removeItem(X)}catch{}}var Se=720;function Ce(e,t){return e===`/`?{via:`in-place`}:{via:`navigate`,href:`/?wa=${encodeURIComponent(t.sessionId)}&projectDir=${encodeURIComponent(t.projectDir)}`}}function we(e,t){if(e!==`/`)return null;let n=new URLSearchParams(t),r=n.get(`wa`),i=n.get(`projectDir`);return!r||!i?null:{sessionId:r,projectDir:i,title:``,senderId:null,startedAt:``,channel:`whatsapp`,operatorName:null,whatsappName:null,lastMessageAt:null}}function Te(e){let{cacheKey:t,businessName:n,onLogout:r,onDisconnect:i,disconnecting:a,userName:o,userAvatar:s,role:c,children:l,footer:u}=e,[d,f]=(0,P.useState)(()=>ve()),[p,m]=(0,P.useState)(()=>be()),[h,g]=(0,P.useState)(()=>typeof window<`u`&&window.matchMedia(`(max-width: ${Se}px)`).matches),[_,v]=(0,P.useState)(null);(0,P.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: ${Se}px)`),t=e=>g(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let y=(0,P.useCallback)(e=>{ye(e),f(e)},[]),b=(0,P.useCallback)(e=>{xe(e),m(e)},[]);(0,P.useEffect)(()=>{if(typeof window>`u`)return;let e=window.location?.pathname??``;console.info(`[admin-ui] shell-mount route=${e} collapsed=${d} drawer=${p}`)},[]),(0,P.useEffect)(()=>{if(typeof window>`u`)return;let e=we(window.location.pathname,window.location.search);e&&(v(e),console.info(`[admin-ui] wa-hydrate route=/ sessionId=${e.sessionId.slice(0,8)}`),window.history.replaceState(null,``,`/`))},[]);let x=(0,P.useCallback)(e=>{if(e===null){v(null);return}let t=typeof window<`u`?window.location.pathname:`/`,n=Ce(t,e);console.info(`[admin-ui] wa-open route=${t} via=${n.via} sessionId=${e.sessionId.slice(0,8)}`),n.via===`in-place`?v(e):window.location.href=n.href},[]),S=h?p:!d,C=(0,P.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${Se}px)`).matches){let e=p;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),b(!e)}else{let e=d;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),y(!e)}},[d,p,y,b]),w=(0,P.useCallback)(e=>{console.info(`[admin-ui] header-menu-nav target=${e}`);let t=e===`data`?`/data`:e===`graph`?`/graph`:e===`chat`?`/chat`:`/browser`;window.location.href=t},[]),T={collapsed:d,mobileDrawerOpen:p,sidebarOpen:S,onToggleSidebar:C,setMobileDrawerOpen:b,selectedWhatsapp:_,onClearWhatsapp:()=>v(null)};return(0,B.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,B.jsx)(W,{businessName:n,onNavigate:w,onToggleSidebar:C,sidebarOpen:S,onLogout:r,onDisconnect:i,disconnecting:a}),(0,B.jsxs)(`div`,{className:`platform${p?` menu-open`:``}${d?` sidebar-collapsed`:``}`,"data-artefact":`closed`,children:[(0,B.jsx)(he,{businessName:n,cacheKey:t,role:c??null,userName:o,userAvatar:s??null,onSelectProjects:()=>{window.location.href=`/graph?label=Project`},onSelectPeople:()=>{window.location.href=`/graph?label=Person`},onSelectTasks:()=>{window.location.href=`/graph?label=Task`},onSelectAgents:()=>{window.location.href=`/graph?label=Agent`},onCloseMobileDrawer:()=>b(!1),collapsed:d,mobileDrawerOpen:p,selectedWhatsappId:_?.sessionId??null,onSelectWhatsappConversation:x}),typeof l==`function`?l(T):l]}),p&&(0,B.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>b(!1)}),u]})}export{ae as a,te as c,T as d,S as f,l as g,g as h,H as i,O as l,_ as m,ue as n,z as o,v as p,se as r,j as s,Te as t,D as u};
@@ -1 +0,0 @@
1
- import{it as e,rt as t}from"./chunk-ICPOFSXX-DkmwqyfQ.js";var n=(n,r)=>e.lang.round(t.parse(n)[r]);export{n as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-CWOGyPgy.js";import{f as t,l as n,m as r,p as i}from"./useSelectionMode-BBvWzgtz.js";import{d as a,f as o,g as s,i as c,t as l}from"./AdminShell-BgPlhiCM.js";import{t as u}from"./Transcript-iuM5b4JT.js";var d=t(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),f=i(),p=e(r(),1),m=n(),h=2e3,g=15;function _({cacheKey:e}){let[t,n]=(0,p.useState)(null),[r,i]=(0,p.useState)(``),[o,s]=(0,p.useState)(!1),c=(0,p.useRef)(0),l=(0,p.useRef)(!1);(0,p.useEffect)(()=>(l.current=!1,()=>{l.current=!0}),[]);let f=(0,p.useCallback)(async()=>{try{let t=await fetch(`/api/webchat/session?session_key=${encodeURIComponent(e)}`);if(!t.ok)return null;let r=await t.json();return l.current||n(r),r}catch{return null}},[e]);(0,p.useEffect)(()=>{f()},[f]);let _=(0,p.useCallback)(()=>{c.current=g;let e=async()=>{if(l.current||c.current<=0)return;--c.current;let t=await f();l.current||t?.projectDir||setTimeout(()=>void e(),h)};setTimeout(()=>void e(),h)},[f]),v=(0,p.useCallback)(async()=>{let n=r.trim();if(!(!n||o)){s(!0);try{let r=await fetch(`/api/webchat/send?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:n})});r.ok?(i(``),t?.projectDir||_()):console.error(`[admin-ui] webchat-send-failed status=${r.status}`)}catch(e){console.error(`[admin-ui] webchat-send-failed error=${e instanceof Error?e.message:String(e)}`)}finally{s(!1)}}},[r,o,e,t,_]),y=(0,p.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),v())},[v]);return(0,m.jsxs)(`div`,{className:`webchat-page`,children:[t?.projectDir?(0,m.jsx)(u,{sessionId:t.sessionId,projectDir:t.projectDir,sessionKey:e},t.sessionId):(0,m.jsxs)(`div`,{className:`webchat-empty`,children:[(0,m.jsx)(a,{size:20}),(0,m.jsx)(`p`,{children:`Send a message to start the conversation with your agent.`})]}),(0,m.jsxs)(`div`,{className:`webchat-composer`,children:[(0,m.jsx)(`textarea`,{className:`webchat-input`,value:r,placeholder:`Message your agent…`,rows:2,onChange:e=>i(e.target.value),onKeyDown:y}),(0,m.jsx)(`button`,{type:`button`,className:`webchat-send`,onClick:()=>void v(),disabled:o||r.trim().length===0,"aria-label":`Send`,title:`Send`,children:(0,m.jsx)(d,{size:16})})]})]})}function v(){let[e,t]=(0,p.useState)(null),[n,r]=(0,p.useState)(!1),[i,a]=(0,p.useState)(void 0),[u,d]=(0,p.useState)(null),[f,h]=(0,p.useState)(void 0),[g,v]=(0,p.useState)(null),[y,b]=(0,p.useState)(null);(0,p.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&a(e.businessName),e.sessionId!==void 0&&d(e.sessionId??null),b(e.role??null),h(e.userName===void 0?null:e.userName),v(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let x=(0,p.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[S,C]=(0,p.useState)(!1),w=(0,p.useCallback)(async()=>{C(!0);try{let e=await s();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{C(!1)}},[]);return n?e?(0,m.jsx)(c,{cacheKey:e,surface:`chat`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=chat`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,m.jsx)(l,{cacheKey:e,businessName:i,sessionId:u,onLogout:x,onDisconnect:w,disconnecting:S,userName:f,userAvatar:g,role:y,children:(0,m.jsx)(_,{cacheKey:e})})}):(0,m.jsx)(`div`,{className:`data-page`,children:(0,m.jsxs)(`div`,{className:`data-empty`,children:[(0,m.jsx)(`p`,{children:`You are not signed in.`}),(0,m.jsxs)(`p`,{children:[`Open the `,(0,m.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,m.jsx)(`div`,{className:`data-page`,children:(0,m.jsxs)(`div`,{className:`data-loading`,children:[(0,m.jsx)(o,{size:18,className:`spin`}),` Loading…`]})})}(0,f.createRoot)(document.getElementById(`root`)).render((0,m.jsx)(v,{}));
@@ -1 +0,0 @@
1
- import{h as e}from"./src-DssjGmtU.js";import"./chunk-ICPOFSXX-DkmwqyfQ.js";import"./dist-ePW3hz19.js";import"./chunk-5PVQY5BW-Ck-5mL2A.js";import"./chunk-U2HBQHQK-BCWQB0k9.js";import"./chunk-FMBD7UC4-B0zglVlf.js";import"./chunk-BSJP7CBP-DKCTDAZE.js";import"./chunk-ZZ45TVLE-BD9UGg96.js";import"./chunk-YZCP3GAM-BUTzrAoG.js";import"./chunk-55IACEB6-BY026nUv.js";import"./chunk-EDXVE4YY-BPqvO0TO.js";import"./chunk-X2U36JSP-CcaCMsL0.js";import"./chunk-5FUZZQ4R-DD-XOAcm.js";import"./chunk-ENJZ2VHE-PN6Hbw2D.js";import"./chunk-336JU56O-fJXOXFRr.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-IFvQOpiF.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1 +0,0 @@
1
- import{h as e}from"./src-DssjGmtU.js";import"./chunk-ICPOFSXX-DkmwqyfQ.js";import"./dist-ePW3hz19.js";import"./chunk-5PVQY5BW-Ck-5mL2A.js";import"./chunk-U2HBQHQK-BCWQB0k9.js";import"./chunk-FMBD7UC4-B0zglVlf.js";import"./chunk-BSJP7CBP-DKCTDAZE.js";import"./chunk-ZZ45TVLE-BD9UGg96.js";import"./chunk-YZCP3GAM-BUTzrAoG.js";import"./chunk-55IACEB6-BY026nUv.js";import"./chunk-EDXVE4YY-BPqvO0TO.js";import"./chunk-X2U36JSP-CcaCMsL0.js";import"./chunk-5FUZZQ4R-DD-XOAcm.js";import"./chunk-ENJZ2VHE-PN6Hbw2D.js";import"./chunk-336JU56O-fJXOXFRr.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-IFvQOpiF.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1 +0,0 @@
1
- import{i as e}from"./graphlib-O_QsiopN.js";var t=4;function n(n){return e(n,t)}export{n as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-CWOGyPgy.js";import{f as t,l as n,m as r,p as i,u as a}from"./useSelectionMode-BBvWzgtz.js";import{f as o,g as s,h as c,i as l,l as u,o as d,r as ee,t as f}from"./AdminShell-BgPlhiCM.js";import{i as p,t as m}from"./graph-labels-DvO7i7Ez.js";import{t as te}from"./SidebarSplitter-CidskiAr.js";var h=t(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),g=t(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),ne=t(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),re=t(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),_=i(),v=e(r(),1);function ie(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||m.has(e)&&(t.add(e),n.push(e)));return n}var y=n();function b(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(void 0),[c,u]=(0,v.useState)(null),[d,ee]=(0,v.useState)(void 0),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null);(0,v.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&a(e.businessName),e.sessionId!==void 0&&u(e.sessionId??null),g(e.role??null),ee(e.userName===void 0?null:e.userName),m(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let ne=(0,v.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[re,_]=(0,v.useState)(!1),ie=(0,v.useCallback)(async()=>{_(!0);try{let e=await s();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{_(!1)}},[]);return n?e?(0,y.jsx)(l,{cacheKey:e,surface:`data`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=data`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,y.jsxs)(f,{cacheKey:e,businessName:i,sessionId:c,onLogout:ne,onDisconnect:ie,disconnecting:re,userName:d,userAvatar:p,role:h,children:[(0,y.jsx)(te,{}),(0,y.jsx)(`div`,{className:`data-page`,children:(0,y.jsx)(x,{cacheKey:e})})]})}):(0,y.jsx)(`div`,{className:`data-page`,children:(0,y.jsxs)(`div`,{className:`data-empty`,children:[(0,y.jsx)(`p`,{children:`You are not signed in.`}),(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,y.jsx)(`div`,{className:`data-page`,children:(0,y.jsxs)(`div`,{className:`data-loading`,children:[(0,y.jsx)(o,{size:18,className:`spin`}),` Loading…`]})})}function x({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}=d({initialCacheKey:e,surface:`data`});return(0,y.jsx)(S,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})}function ae(){if(typeof window>`u`)return`.`;let e=new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`path`);return e&&e.length>0?e:`.`}function oe(e){if(typeof window>`u`)return;let t=new URL(window.location.href);t.hash=e===`.`?``:`path=${encodeURIComponent(e)}`,window.history.replaceState(window.history.state,``,t.toString())}function S({adminFetch:e,cacheKey:t,sessionRefetchNonce:n}){let[r,i]=(0,v.useState)(``),[s,l]=(0,v.useState)(``),[d,f]=(0,v.useState)(null),[m,te]=(0,v.useState)(`hybrid`),[_,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(null),[C,le]=(0,v.useState)(null),[w,de]=(0,v.useState)(0),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(()=>ae()),[A,fe]=(0,v.useState)(null),[j,pe]=(0,v.useState)([]),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(null),[I,L]=(0,v.useState)(!1),[R,z]=(0,v.useState)(null),[B,V]=(0,v.useState)(null),[me,he]=(0,v.useState)(null),[H,U]=(0,v.useState)(null),W=(0,v.useRef)(null),[ge,G]=(0,v.useState)(0),[K,q]=(0,v.useState)(!1),J=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=r.trim();if(!e){l(``),f(null);return}D(!1);let t=setTimeout(()=>l(e),300);return()=>clearTimeout(t)},[r]),(0,v.useEffect)(()=>{if(!s)return;let t=!1;return b(!0),S(null),e(`/api/admin/graph-search?q=${encodeURIComponent(s)}&labels=FileArtifact&limit=20${E?`&threshold=0`:``}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(f(e.results),te(e.mode??`hybrid`),de(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||S(e instanceof Error?e.message:String(e))}).finally(()=>{t||b(!1)}),()=>{t=!0}},[s,e,n,E]);let Y=(0,v.useMemo)(()=>d?ie(d):[],[d]),X=C&&Y.includes(C)?C:null,Z=(0,v.useMemo)(()=>d?X?d.filter(e=>e.labels.includes(X)):d:null,[d,X]),_e=(0,v.useCallback)(e=>{let n=e.properties.relativePath;if(typeof n!=`string`||n.length===0)return;let r=`/api/admin/files/download?session_key=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}`,i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()},[t]);(0,v.useEffect)(()=>{let t=!1;return N(!0),F(null),e(`/api/admin/files?path=${encodeURIComponent(O===`.`?``:O)}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(fe(e.entries),pe(e.displayPath??[]))}).catch(e=>{t||(fe([]),pe([]),F(e instanceof Error?e.message:String(e)))}).finally(()=>{t||N(!1)}),()=>{t=!0}},[e,O,ge,n]),(0,v.useEffect)(()=>{oe(O)},[O]);let ve=(0,v.useCallback)(()=>{G(e=>e+1)},[]),Q=(0,v.useCallback)(e=>{q(!1),k(e)},[]),ye=(0,v.useCallback)(()=>{if(O===`.`||O===``)return;let e=O.split(`/`).filter(Boolean);e.pop(),k(e.length===0?`.`:e.join(`/`))},[O]),be=(0,v.useCallback)(e=>{ee(t,O===`.`?e.name:`${O}/${e.name}`)},[O,t]),xe=(0,v.useCallback)(()=>{W.current?.click()},[]),Se=(0,v.useCallback)(e=>{V(null),U(e.name)},[]),Ce=(0,v.useCallback)(()=>{U(null)},[]),we=(0,v.useCallback)(async t=>{let n=O===`.`?t.name:`${O}/${t.name}`;V(null),U(null),he(t.name);try{let t=await e(`/api/admin/files?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(r.error??`HTTP ${t.status}`);G(e=>e+1)}catch(e){V(e instanceof Error?e.message:String(e))}finally{he(null)}},[O,e]);(0,v.useEffect)(()=>{if(!H)return;let e=e=>{e.key===`Escape`&&U(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[H]);let Te=(0,v.useCallback)(async e=>{z(null),L(!0);try{let n=new FormData;n.append(`session_key`,t),n.append(`file`,e);let r=await fetch(`/api/admin/files/upload`,{method:`POST`,body:n}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);k(i.path.split(`/`).slice(0,-1).join(`/`)||`.`),G(e=>e+1)}catch(e){z(e instanceof Error?e.message:String(e))}finally{L(!1),W.current&&(W.current.value=``)}},[t]);(0,v.useEffect)(()=>{if(!K)return;let e=e=>{J.current&&!J.current.contains(e.target)&&q(!1)},t=e=>{e.key===`Escape`&&q(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[K]);let $=(0,v.useCallback)(e=>j.slice(0,e+1).map(e=>e.name).join(`/`),[j]),Ee=j.length>=2,De=Ee?[{name:`.`,label:`data`},...j.slice(0,j.length-2).map((e,t)=>({name:$(t),label:e.displayName??e.name}))]:[];return(0,y.jsxs)(`main`,{className:`data-main`,children:[(0,y.jsxs)(`div`,{className:`data-toolbar`,children:[(0,y.jsxs)(`div`,{className:`data-search-input`,children:[(0,y.jsx)(p,{size:14}),(0,y.jsx)(`input`,{type:`text`,placeholder:`Search your knowledge…`,value:r,onChange:e=>i(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),_&&(0,y.jsx)(o,{size:14,className:`spin`})]}),(0,y.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:ve,disabled:M,title:`Refresh this folder`,"aria-label":`Refresh this folder`,children:[M?(0,y.jsx)(o,{size:14,className:`spin`}):(0,y.jsx)(u,{size:14}),(0,y.jsx)(`span`,{className:`data-btn-label`,children:`Refresh`})]}),(0,y.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:xe,disabled:I,title:`Upload a file`,"aria-label":`Upload a file`,children:[I?(0,y.jsx)(o,{size:14,className:`spin`}):(0,y.jsx)(re,{size:14}),(0,y.jsx)(`span`,{className:`data-btn-label`,children:`Upload`})]}),(0,y.jsx)(`input`,{type:`file`,ref:W,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&Te(t)}})]}),(0,y.jsxs)(`section`,{className:`data-panel`,children:[x&&(0,y.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,x]}),Y.length>0&&(0,y.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:Y.map(e=>{let t=e===X;return(0,y.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>le(t?null:e),children:ce([e])??e},e)})}),d&&!_&&(0,y.jsxs)(`div`,{className:`data-results-meta`,children:[Z.length,` of `,d.length,` result`,d.length===1?``:`s`]}),d&&!_&&!X&&w>0&&!E&&(0,y.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>D(!0),children:[w,` low-confidence result`,w===1?``:`s`,` hidden — show all`]}),d&&!_&&!X&&E&&(0,y.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>D(!1),children:`Showing all results — hide low-confidence`}),d&&d.length===0&&!_&&(0,y.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),Z&&Z.length>0&&(0,y.jsx)(`ul`,{className:`data-results`,children:Z.map(e=>(0,y.jsx)(se,{hit:e,mode:m,onDownload:_e},e.nodeId))})]}),(0,y.jsxs)(`section`,{className:`data-panel`,children:[(0,y.jsxs)(`div`,{className:`data-breadcrumbs`,children:[O!==`.`&&(0,y.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-back-btn`,onClick:ye,title:`Up one level`,"aria-label":`Up one level`,children:(0,y.jsx)(h,{size:14})}),Ee?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`span`,{className:`data-crumb-wrap`,ref:J,children:[(0,y.jsx)(`button`,{type:`button`,className:`data-crumb data-crumb-ellipsis`,onClick:()=>q(e=>!e),"aria-haspopup":`menu`,"aria-expanded":K,"aria-label":`Show parent folders`,title:`Show parent folders`,children:`…`}),K&&(0,y.jsx)(`div`,{className:`data-crumb-menu`,role:`menu`,children:De.map(e=>(0,y.jsx)(`button`,{type:`button`,role:`menuitem`,className:`data-crumb-menu-item`,onClick:()=>Q(e.name),title:e.label,children:e.label},e.name))})]}),[j.length-2,j.length-1].map(e=>{let t=j[e];return(0,y.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,y.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,y.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>Q($(e)),title:t.name,children:t.displayName??t.name})]},$(e))})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>Q(`.`),children:`data`}),j.map((e,t)=>(0,y.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,y.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,y.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>Q($(t)),title:e.name,children:e.displayName??e.name})]},$(t)))]})]}),R&&(0,y.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,R]}),B&&(0,y.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,B]}),P&&(0,y.jsx)(`div`,{className:`data-error`,children:P}),M&&(0,y.jsxs)(`div`,{className:`data-loading`,children:[(0,y.jsx)(o,{size:14,className:`spin`}),` Loading…`]}),!M&&A&&A.length===0&&!P&&(0,y.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!M&&A&&A.length>0&&(0,y.jsx)(`ul`,{className:`data-entries`,children:A.map(e=>{let t=e.displayName??e.name,n=me===e.name,r=H===e.name;return(0,y.jsx)(`li`,{className:`data-entry`,children:e.kind===`directory`?(0,y.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>Q(O===`.`?e.name:`${O}/${e.name}`),children:[(0,y.jsx)(ne,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t})]}):e.kind===`file`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>be(e),title:`Download ${t}`,disabled:r,children:[(0,y.jsx)(g,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t}),(0,y.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${T(e.modifiedAt)}`,children:[ue(e.sizeBytes),` · `,T(e.modifiedAt)]}),(0,y.jsx)(c,{size:12,className:`data-entry-download-icon`})]}),r?(0,y.jsxs)(`div`,{className:`data-entry-confirm`,role:`group`,"aria-label":`Confirm delete ${t}`,children:[(0,y.jsx)(`span`,{className:`data-entry-confirm-label`,children:`Delete?`}),(0,y.jsx)(`button`,{type:`button`,className:`data-entry-confirm-yes`,onClick:()=>we(e),autoFocus:!0,children:`Yes`}),(0,y.jsx)(`button`,{type:`button`,className:`data-entry-confirm-no`,onClick:Ce,children:`No`})]}):(0,y.jsx)(`button`,{type:`button`,className:`data-entry-delete`,onClick:()=>Se(e),disabled:n,title:`Delete ${t}`,"aria-label":`Delete ${t}`,children:n?(0,y.jsx)(o,{size:14,className:`spin`}):(0,y.jsx)(a,{size:14})})]}):(0,y.jsxs)(`div`,{className:`data-entry-btn data-entry-disabled`,children:[(0,y.jsx)(g,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,children:t}),(0,y.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})},e.name)})})]})]})}function se({hit:e,mode:t,onDownload:n}){let r=C(e.properties),i=le(e.properties),a=ce(e.labels),o=w(e.properties),[s,c]=(0,v.useState)(!1),l=i&&i.length>280,u=s||!l?i:i?.slice(0,280)+`…`,d=t===`bm25`?`bm25 ${e.bm25Score.toFixed(2)}`:`vector ${e.vectorScore.toFixed(2)} · bm25 ${e.bm25Score.toFixed(2)} · combined ${e.score.toFixed(2)}`;return(0,y.jsxs)(`li`,{className:`data-result`,children:[(0,y.jsxs)(`div`,{role:`button`,tabIndex:0,className:`data-result-open`,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e))},"aria-label":`Download ${r??a??`file`}`,children:[a&&(0,y.jsx)(`div`,{className:`data-result-header`,children:(0,y.jsx)(`span`,{className:`data-result-labels`,children:a})}),r&&(0,y.jsx)(`div`,{className:`data-result-title`,children:r}),i&&(0,y.jsx)(`pre`,{className:`data-result-body`,children:u}),(0,y.jsxs)(`div`,{className:`data-result-scores`,children:[o&&(0,y.jsxs)(`span`,{className:`data-result-updated`,children:[`Updated `,T(o),` · `]}),d]})]}),l&&(0,y.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>c(e=>!e),children:s?`Show less`:`Show more`})]})}function ce(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function C(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function le(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function w(e){for(let t of[`updatedAt`,`modifiedAt`,`fetchedAt`,`createdAt`,`lastModified`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function ue(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function T(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}(0,_.createRoot)(document.getElementById(`root`)).render((0,y.jsx)(b,{}));
@@ -1 +0,0 @@
1
- import{h as e}from"./src-DssjGmtU.js";import"./chunk-ICPOFSXX-DkmwqyfQ.js";import"./dist-ePW3hz19.js";import"./chunk-5PVQY5BW-Ck-5mL2A.js";import"./chunk-U2HBQHQK-BCWQB0k9.js";import"./chunk-BSJP7CBP-DKCTDAZE.js";import"./chunk-ZZ45TVLE-BD9UGg96.js";import"./chunk-55IACEB6-BY026nUv.js";import"./chunk-EDXVE4YY-BPqvO0TO.js";import"./chunk-X2U36JSP-CcaCMsL0.js";import"./chunk-5FUZZQ4R-DD-XOAcm.js";import"./chunk-ENJZ2VHE-PN6Hbw2D.js";import"./chunk-336JU56O-fJXOXFRr.js";import{i as t,n,r,t as i}from"./chunk-OYMX7WX6-CWyihoif.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};