@av-pi-studio/web-client 0.0.117 → 0.0.119

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 (122) hide show
  1. package/README.md +12 -12
  2. package/dist/web/assets/BinaryFallbackViewer-DZ6fyGsu.js +1 -0
  3. package/dist/web/assets/{ChatPanel-Dh8HDToX.js → ChatPanel-yRv-CSyg.js} +5 -5
  4. package/dist/web/assets/CodeView-HA63pf1I.js +1 -0
  5. package/dist/web/assets/{DiffView-H0nfCGhg.js → DiffView-Bp1YwIcs.js} +1 -1
  6. package/dist/web/assets/FilePanel-KbN8R1q4.js +1 -0
  7. package/dist/web/assets/HtmlViewer-BlBKng1E.js +1 -0
  8. package/dist/web/assets/ImageViewer-CSOSyfvS.js +1 -0
  9. package/dist/web/assets/MarkdownFileViewer-lxpM7SOl.js +1 -0
  10. package/dist/web/assets/ModelProvidersPanel-CB3LnoWb.js +1 -0
  11. package/dist/web/assets/MoleculeViewerPanel-B2E7mzSf.js +1 -0
  12. package/dist/web/assets/PdfViewer-DhWWrlIg.js +1 -0
  13. package/dist/web/assets/SaveFileButton-B7-DaZRk.js +1 -0
  14. package/dist/web/assets/SettingsDialog-PvCzy46o.js +8 -0
  15. package/dist/web/assets/SkillsPanel-BAOCx8Mk.js +1 -0
  16. package/dist/web/assets/{StatusBadge-4Ta2PiFt.js → StatusBadge-eoBBn7zF.js} +1 -1
  17. package/dist/web/assets/{Switch-DrRVfYsF.js → Switch-DvBJf8Rd.js} +1 -1
  18. package/dist/web/assets/TerminalPanel-D7OImgct.js +1 -0
  19. package/dist/web/assets/TextViewer-BYKfoK_A.js +1 -0
  20. package/dist/web/assets/VideoViewer-D5zXCCTy.js +1 -0
  21. package/dist/web/assets/ViewersPanel-CcXyTny7.js +1 -0
  22. package/dist/web/assets/{abnfDiagram-N423BO3Z-DAM-L4Gi.js → abnfDiagram-N423BO3Z-CpfpOF_O.js} +1 -1
  23. package/dist/web/assets/{arc-B5fbklv-.js → arc-DBTSI6_N.js} +1 -1
  24. package/dist/web/assets/{architectureDiagram-T3A2C74G-g5YdBqOD.js → architectureDiagram-T3A2C74G-BSevfMW_.js} +1 -1
  25. package/dist/web/assets/{blockDiagram-VBNYF7ZC-CnQe9SwF.js → blockDiagram-VBNYF7ZC-mjH_gzpo.js} +1 -1
  26. package/dist/web/assets/{c4Diagram-5PPSVZJV-hnI3bmAh.js → c4Diagram-5PPSVZJV-CKvGPw0r.js} +1 -1
  27. package/dist/web/assets/channel-DewxN4Jo.js +1 -0
  28. package/dist/web/assets/{chunk-2GRJ4B5K-ga2EpiBM.js → chunk-2GRJ4B5K-DX9yxpY8.js} +1 -1
  29. package/dist/web/assets/{chunk-2Q5K7J3B-8EL89tcM.js → chunk-2Q5K7J3B-CLN7DvaK.js} +1 -1
  30. package/dist/web/assets/{chunk-5RXB4S5H-ny9nLzV7.js → chunk-5RXB4S5H-_JxweRkX.js} +1 -1
  31. package/dist/web/assets/{chunk-5VM5RSS4-D8AiE16-.js → chunk-5VM5RSS4-3BAvSy1_.js} +1 -1
  32. package/dist/web/assets/{chunk-6Q2QTUOP-BEyDElR_.js → chunk-6Q2QTUOP-DQLD88Lm.js} +1 -1
  33. package/dist/web/assets/{chunk-GF5L2VYU-BOQX5MLe.js → chunk-GF5L2VYU-D-1fx8P7.js} +1 -1
  34. package/dist/web/assets/{chunk-JWPE2WC7-DZ7yLQfa.js → chunk-JWPE2WC7-C2fToatl.js} +1 -1
  35. package/dist/web/assets/{chunk-KBJHAD2P-ogydf6uq.js → chunk-KBJHAD2P-DHjSexvX.js} +1 -1
  36. package/dist/web/assets/{chunk-RYQCIY6F-B4kX-J9n.js → chunk-RYQCIY6F-DsVSVTjX.js} +1 -1
  37. package/dist/web/assets/{chunk-XXDRQBXY-CJ0O9VGU.js → chunk-XXDRQBXY-Csxxsn8g.js} +1 -1
  38. package/dist/web/assets/classDiagram-JCYQIIEL-YbS66O-E.js +1 -0
  39. package/dist/web/assets/classDiagram-v2-OCEON4UE-YbS66O-E.js +1 -0
  40. package/dist/web/assets/{cose-bilkent-JH36ORCC-lwzifGUR.js → cose-bilkent-JH36ORCC-DIVX_YPY.js} +1 -1
  41. package/dist/web/assets/{cynefin-VYW2F7L2-UwoALUYS.js → cynefin-VYW2F7L2-fVS7Seyd.js} +1 -1
  42. package/dist/web/assets/{cynefinDiagram-MW4NZA55-Dal57Q23.js → cynefinDiagram-MW4NZA55-krsTOg0x.js} +1 -1
  43. package/dist/web/assets/{dagre-VZM6K2ZE-CKlrZnar.js → dagre-VZM6K2ZE-Byz_9-UR.js} +1 -1
  44. package/dist/web/assets/{diagram-7IWD3JNH-FMn1vsHL.js → diagram-7IWD3JNH-CAwWHICT.js} +1 -1
  45. package/dist/web/assets/{diagram-B4RE2ZJO-CI5rpxKQ.js → diagram-B4RE2ZJO-zvv-V2co.js} +1 -1
  46. package/dist/web/assets/{diagram-LBJQPF4R-BOVH3I-f.js → diagram-LBJQPF4R-i5y2WTdZ.js} +1 -1
  47. package/dist/web/assets/{diagram-Q27KOJAE-DmuUX06N.js → diagram-Q27KOJAE-B1inWemu.js} +1 -1
  48. package/dist/web/assets/{diagram-UB23O5K3-Cw9DrP-K.js → diagram-UB23O5K3-Dh89SZOh.js} +1 -1
  49. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-f4TEQ7_W.js → ebnfDiagram-BXEA7PRR-su2ygatX.js} +1 -1
  50. package/dist/web/assets/{erDiagram-JOGREHBK-CF47Mcra.js → erDiagram-JOGREHBK-BbsgEzQn.js} +1 -1
  51. package/dist/web/assets/{flowDiagram-UKHOOZJN-rdiIClpu.js → flowDiagram-UKHOOZJN-Chl_0-ag.js} +1 -1
  52. package/dist/web/assets/{ganttDiagram-PKOTCBZU-BBqllMXi.js → ganttDiagram-PKOTCBZU-CYMojHU0.js} +1 -1
  53. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-6sOrT3Es.js → gitGraphDiagram-DS77QQ5N-BZQF2UJa.js} +1 -1
  54. package/dist/web/assets/{graph-DUOUaKTD.js → graph-q4AqDxwU.js} +1 -1
  55. package/dist/web/assets/{href-resolution-XVtyCiRv.js → href-resolution-73JOZBv8.js} +1 -1
  56. package/dist/web/assets/index-DFue5iwi.js +19 -0
  57. package/dist/web/assets/{index-DbyP1ZAT.css → index-Dg0mhDS9.css} +1 -1
  58. package/dist/web/assets/{infoDiagram-6WML65LV-B8DQ1Ntn.js → infoDiagram-6WML65LV-L2kKwrdb.js} +1 -1
  59. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-CL_6Xhdk.js → ishikawaDiagram-WSZJBQD7-B-hdpT0j.js} +1 -1
  60. package/dist/web/assets/{journeyDiagram-NVQOT4AX-iO2oB_PM.js → journeyDiagram-NVQOT4AX-DtZbDU0g.js} +1 -1
  61. package/dist/web/assets/{kanban-definition-27J2QSJJ-Bq5zUdk6.js → kanban-definition-27J2QSJJ-BNVi4euz.js} +1 -1
  62. package/dist/web/assets/{layout-CKWK6l6a.js → layout-ZLTTNfUo.js} +1 -1
  63. package/dist/web/assets/{linear-hDCiku2e.js → linear-Dg9CPt0k.js} +1 -1
  64. package/dist/web/assets/markdown-CIs21q13.js +5 -0
  65. package/dist/web/assets/{mermaid.core-CHAol8ex.js → mermaid.core-524tR-D2.js} +4 -4
  66. package/dist/web/assets/{mindmap-definition-FAOFIHXS-BBmO4Gks.js → mindmap-definition-FAOFIHXS-CJKkZcYQ.js} +1 -1
  67. package/dist/web/assets/{ordinal-Bt4q2WDw.js → ordinal-B7gl1e82.js} +1 -1
  68. package/dist/web/assets/{pegDiagram-VL7TDLO6-DqQhyw9T.js → pegDiagram-VL7TDLO6-C29SbD0M.js} +1 -1
  69. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-BS5cr7Al.js → pieDiagram-7S7Q4E2Y-BpeO9BuX.js} +1 -1
  70. package/dist/web/assets/{provider-auth-store-B0otZuIW.js → provider-auth-store-CpmUGwuu.js} +1 -1
  71. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-BLDUr9qC.js → quadrantDiagram-CIZ2JOQS-yU4K00QE.js} +1 -1
  72. package/dist/web/assets/{railroadDiagram-AXF67PYL-VFMEovCO.js → railroadDiagram-AXF67PYL-DIkSup17.js} +1 -1
  73. package/dist/web/assets/{requirementDiagram-LRYGKXZP-B1AZqGHF.js → requirementDiagram-LRYGKXZP-DB5tgpS1.js} +1 -1
  74. package/dist/web/assets/{sankeyDiagram-W5VNT64P-DsZPKpe8.js → sankeyDiagram-W5VNT64P-DYPa3r0S.js} +1 -1
  75. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-BiJ-GnCG.js → sequenceDiagram-SI44F4Z6-C_rD0zxP.js} +1 -1
  76. package/dist/web/assets/{sizeCapture-X5ZJPWSS-C2FFfWkK.js → sizeCapture-X5ZJPWSS-DzC-Nn78.js} +1 -1
  77. package/dist/web/assets/{stateDiagram-OKZ733FA-qFV_v5ZT.js → stateDiagram-OKZ733FA-DQdSURcD.js} +1 -1
  78. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-BCmrjJ-P.js +1 -0
  79. package/dist/web/assets/{swimlanes-SLNWSIFB-9sGFMDql.js → swimlanes-SLNWSIFB-BA-Oww3o.js} +2 -2
  80. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-BtietnZ5.js +8 -0
  81. package/dist/web/assets/{timeline-definition-Z64GVDOM-D3ypJvTh.js → timeline-definition-Z64GVDOM-C7JXpk1W.js} +1 -1
  82. package/dist/web/assets/use-file-download-DXQ8x6cp.js +1 -0
  83. package/dist/web/assets/{use-file-watch-Ca_f0M8P.js → use-file-watch-Bi_rtv7D.js} +1 -1
  84. package/dist/web/assets/{use-provider-auth-list-BfHGDiIE.js → use-provider-auth-list-Bxn9HTsw.js} +1 -1
  85. package/dist/web/assets/{vendor-dnd-CayJj8TC.js → vendor-dnd-vJGfGIIi.js} +1 -1
  86. package/dist/web/assets/{vendor-highlight-2yu9fuIs.js → vendor-highlight-DaCUEPaW.js} +1 -1
  87. package/dist/web/assets/{vendor-icons-DEs9VPZK.js → vendor-icons-CSCeICuX.js} +1 -1
  88. package/dist/web/assets/{vendor-markdown-BdpekPki.js → vendor-markdown-Bo-Xpsuy.js} +1 -1
  89. package/dist/web/assets/{vendor-molviewer-DeAF8d5d.js → vendor-molviewer-7FbONJs2.js} +1 -1
  90. package/dist/web/assets/{vendor-overlays-SaWbfdX8.js → vendor-overlays-DjMT65Ip.js} +1 -1
  91. package/dist/web/assets/{vendor-pdfjs-BrYGnqfM.js → vendor-pdfjs-BSchhGel.js} +2 -2
  92. package/dist/web/assets/{vendor-query-i7fr__Xm.js → vendor-query-CDNPrdQ8.js} +1 -1
  93. package/dist/web/assets/{vendor-react-DQUAl2K8.js → vendor-react-Dka9ZH0B.js} +1 -1
  94. package/dist/web/assets/{vendor-D3SOLPPh.js → vendor-z183l2lP.js} +6 -6
  95. package/dist/web/assets/{vennDiagram-T6HMQDX7-CL6HBdNJ.js → vennDiagram-T6HMQDX7-C_y33Ta5.js} +1 -1
  96. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-CovrUiAA.js → wardleyDiagram-T6FBY63Y-gxOBkNAp.js} +1 -1
  97. package/dist/web/assets/{xychartDiagram-ELKLHX3M-B4B84nxd.js → xychartDiagram-ELKLHX3M-BEdGwPiU.js} +1 -1
  98. package/dist/web/index.html +9 -8
  99. package/package.json +5 -42
  100. package/dist/web/assets/BinaryFallbackViewer-BtxtcHuV.js +0 -1
  101. package/dist/web/assets/CodeView-CAB3SZYK.js +0 -1
  102. package/dist/web/assets/FilePanel-C8cn3iJj.js +0 -1
  103. package/dist/web/assets/HtmlViewer-C6i8TGWc.js +0 -1
  104. package/dist/web/assets/ImageViewer-CyNec5RW.js +0 -1
  105. package/dist/web/assets/MarkdownFileViewer-Ck__w_R6.js +0 -1
  106. package/dist/web/assets/ModelProvidersPanel-BzCxTWcG.js +0 -1
  107. package/dist/web/assets/MoleculeViewerPanel-Dm74U_GU.js +0 -1
  108. package/dist/web/assets/PdfViewer-DP5N6Zq4.js +0 -1
  109. package/dist/web/assets/SettingsDialog-DFOcdK5d.js +0 -8
  110. package/dist/web/assets/SkillsPanel-B1rX9W8m.js +0 -1
  111. package/dist/web/assets/TerminalPanel-Bl7fG-P0.js +0 -1
  112. package/dist/web/assets/TextViewer-C6sO1Esy.js +0 -1
  113. package/dist/web/assets/VideoViewer-cj1hw5cl.js +0 -1
  114. package/dist/web/assets/ViewersPanel-DtgabN6n.js +0 -1
  115. package/dist/web/assets/channel-BC5O3Fw2.js +0 -1
  116. package/dist/web/assets/classDiagram-JCYQIIEL-DtNk70ER.js +0 -1
  117. package/dist/web/assets/classDiagram-v2-OCEON4UE-DtNk70ER.js +0 -1
  118. package/dist/web/assets/index-DVjN3uZm.js +0 -19
  119. package/dist/web/assets/markdown-DNjz8eN5.js +0 -5
  120. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-BLx9oVo-.js +0 -1
  121. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-DXJEgu0Z.js +0 -8
  122. package/dist/web/assets/use-file-download-DF0pV2Qv.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aI as Wt,s as Kt,g as Ht,p as Yt,o as Xt,a as Zt,b as Jt,_ as S,z as St,F as Qt,d as rt,au as $t,aa as te,ab as ee,ac as ne,e as se,q as ie,B as re,D as oe}from"./mermaid.core-CHAol8ex.js";import"./vendor-D3SOLPPh.js";import"./vendor-react-DQUAl2K8.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],M=Math.atan2(a.x-y.x,a.y-y.y),E=Math.atan2(h.x-y.x,h.y-y.y);let T=E-M;T<0&&(T+=2*Math.PI);const w=E-T/2;let g=K(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}const E=(v,c)=>v.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(E),s.history){const x=y.map(f=>{const O=f.slice();return O.fx=f.fx,O.id=f.id,O});x.sort((f,O)=>f.id-O.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){T[x]=0;for(let f=0;f<m;++f)T[x]+=y[f][x];T[x]/=m}const c=y[m];if(Q(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)Q(b,1+u,T,-u,c),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(Q(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Q(g,1-a*h,T,a*h,c),g.fx=t(g),g.fx<w.fx?M(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)Q(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else M(w)}return y.sort(E),{fx:y[0].fx,x:y[0]}}function ue(t,n,s,e,i,r,o){const l=s.fx,h=tt(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,M,E){for(let T=0;T<16;++T)if(i=(y+M)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=ue(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ht(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);Q(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=zt(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),M=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const l=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),y=he(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,l);return p}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}r.sort(o);const l={};function h(p){return p.set in l}function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(y.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ft(y.radius,v.radius,m[b].size),x=Tt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,T=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<E&&(E=g,T=w)}u(T,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=xt(o.radius,l.radius,K(o,l))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;K(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=dt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Ot(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(C=>O.has(C)));let k={},R={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Ct(I,o,d)),k=Nt(I,s,e,i,h),R=Lt(k,f,M)}const Z={};f.forEach(I=>{I.label&&(Z[I.sets]=I.label)});function U(I){if(I.sets in Z)return Z[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!m&&(z=!0,V[I.sets[0]]=Me(C))});function q(I){return C=>{const G=I.sets.map(J=>{let W=V[J],X=k[J];return W||(W={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:W.x*(1-C)+X.x*C,y:W.y*(1-C)+X.y*C,radius:W.radius*(1-C)+X.radius*C}});return wt(G,y)}}const A=B.selectAll(".venn-area").data(f,I=>I.sets),F=A.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),j=F.append("path"),L=F.append("text").attr("class","label").text(I=>U(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function P(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",I=>wt(I.sets.map(C=>k[C])),y);const D=_.selectAll("text").filter(I=>I.sets in R).text(I=>U(I)).attr("x",I=>Math.floor(R[I.sets].x)).attr("y",I=>Math.floor(R[I.sets].y));u&&(z?"on"in D?D.on("end",ot(k,U)):D.each("end",ot(k,U)):D.each(ot(k,U)));const N=P(A.exit()).remove();typeof A.transition=="function"&&N.selectAll("path").attrTween("d",q);const Y=N.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),D.style("font-size",p),Y.style("font-size","0px")),{circles:k,textCentres:R,nodes:A,enter:F,update:_,exit:N}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Dt:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-K(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=K(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const p=at(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=K(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=jt(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
1
+ import{aI as Wt,s as Kt,g as Ht,p as Yt,o as Xt,a as Zt,b as Jt,_ as S,z as St,F as Qt,d as rt,au as $t,aa as te,ab as ee,ac as ne,e as se,q as ie,B as re,D as oe}from"./mermaid.core-524tR-D2.js";import"./vendor-z183l2lP.js";import"./vendor-react-Dka9ZH0B.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],M=Math.atan2(a.x-y.x,a.y-y.y),E=Math.atan2(h.x-y.x,h.y-y.y);let T=E-M;T<0&&(T+=2*Math.PI);const w=E-T/2;let g=K(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}const E=(v,c)=>v.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(E),s.history){const x=y.map(f=>{const O=f.slice();return O.fx=f.fx,O.id=f.id,O});x.sort((f,O)=>f.id-O.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){T[x]=0;for(let f=0;f<m;++f)T[x]+=y[f][x];T[x]/=m}const c=y[m];if(Q(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)Q(b,1+u,T,-u,c),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(Q(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Q(g,1-a*h,T,a*h,c),g.fx=t(g),g.fx<w.fx?M(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)Q(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else M(w)}return y.sort(E),{fx:y[0].fx,x:y[0]}}function ue(t,n,s,e,i,r,o){const l=s.fx,h=tt(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,M,E){for(let T=0;T<16;++T)if(i=(y+M)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=ue(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ht(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);Q(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=zt(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),M=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const l=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),y=he(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,l);return p}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}r.sort(o);const l={};function h(p){return p.set in l}function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(y.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ft(y.radius,v.radius,m[b].size),x=Tt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,T=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<E&&(E=g,T=w)}u(T,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=xt(o.radius,l.radius,K(o,l))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;K(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=dt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Ot(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(C=>O.has(C)));let k={},R={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Ct(I,o,d)),k=Nt(I,s,e,i,h),R=Lt(k,f,M)}const Z={};f.forEach(I=>{I.label&&(Z[I.sets]=I.label)});function U(I){if(I.sets in Z)return Z[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!m&&(z=!0,V[I.sets[0]]=Me(C))});function q(I){return C=>{const G=I.sets.map(J=>{let W=V[J],X=k[J];return W||(W={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:W.x*(1-C)+X.x*C,y:W.y*(1-C)+X.y*C,radius:W.radius*(1-C)+X.radius*C}});return wt(G,y)}}const A=B.selectAll(".venn-area").data(f,I=>I.sets),F=A.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),j=F.append("path"),L=F.append("text").attr("class","label").text(I=>U(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function P(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",I=>wt(I.sets.map(C=>k[C])),y);const D=_.selectAll("text").filter(I=>I.sets in R).text(I=>U(I)).attr("x",I=>Math.floor(R[I.sets].x)).attr("y",I=>Math.floor(R[I.sets].y));u&&(z?"on"in D?D.on("end",ot(k,U)):D.each("end",ot(k,U)):D.each(ot(k,U)));const N=P(A.exit()).remove();typeof A.transition=="function"&&N.selectAll("path").attrTween("d",q);const Y=N.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),D.style("font-size",p),Y.style("font-size","0px")),{circles:k,textCentres:R,nodes:A,enter:F,update:_,exit:N}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Dt:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-K(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=K(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const p=at(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=K(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=jt(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
2
2
  M`,t,n),e.push(`
3
3
  m`,-s,0),e.push(`
4
4
  a`,s,s,0,1,0,s*2,0),e.push(`
@@ -1,4 +1,4 @@
1
- import{p as zt}from"./chunk-JWPE2WC7-DZ7yLQfa.js";import{s as Lt,g as Tt,p as At,o as Xt,a as Et,b as Yt,_ as y,W as It,z as Bt,B as Q,l as et,F as Ft,e as Rt,q as Ot,c as V}from"./mermaid.core-CHAol8ex.js";import{p as Wt}from"./cynefin-VYW2F7L2-UwoALUYS.js";import"./vendor-D3SOLPPh.js";import"./vendor-react-DQUAl2K8.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(zt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,L=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,L,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new 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.");Gt(o,e)},"parse")},I,qt=(I=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={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,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}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:Xt,getDiagramTitle:At,getAccDescription:Tt,setAccDescription:Lt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,L,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((L=a.wardley)==null?void 0:L.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var J,K;et.debug(`Rendering Wardley map
1
+ import{p as zt}from"./chunk-JWPE2WC7-C2fToatl.js";import{s as Lt,g as Tt,p as At,o as Xt,a as Et,b as Yt,_ as y,W as It,z as Bt,B as Q,l as et,F as Ft,e as Rt,q as Ot,c as V}from"./mermaid.core-524tR-D2.js";import{p as Wt}from"./cynefin-VYW2F7L2-fVS7Seyd.js";import"./vendor-z183l2lP.js";import"./vendor-react-Dka9ZH0B.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(zt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,L=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,L,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new 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.");Gt(o,e)},"parse")},I,qt=(I=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={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,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}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:Xt,getDiagramTitle:At,getAccDescription:Tt,setAccDescription:Lt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,L,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((L=a.wardley)==null?void 0:L.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var J,K;et.debug(`Rendering Wardley map
2
2
  `+a);const r=_t(),d=Vt(),m=r.nodeRadius*1.6,v=p.db,g=v.getWardleyData(),L=v.getDiagramTitle(),M=((J=g.size)==null?void 0:J.width)??r.width,k=((K=g.size)==null?void 0:K.height)??r.height,N=Ft(o);N.selectAll("*").remove(),Rt(N,k,M,r.useMaxWidth),N.attr("viewBox",`0 0 ${M} ${k}`);const P=N.append("g").attr("class","wardley-map"),q=N.append("defs");q.append("marker").attr("id",`arrow-${o}`).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",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${o}`).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",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${o}`).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",d.linkStroke).attr("stroke","none"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",k).attr("fill",d.backgroundColor);const B=M-r.padding*2,F=k-r.padding*2;L&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(L);const T=y(t=>r.padding+t/100*B,"projectX"),A=y(t=>k-r.padding-t/100*F,"projectY"),O=P.append("g").attr("class","wardley-axes");O.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const kt=g.axes.xLabel??"Evolution",bt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+B/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(kt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+F/2})`).text(bt);const R=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(R.length>0){const t=P.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===R.length){let i=0;n.forEach(h=>{s.push({start:i,end:h}),i=h})}else{const i=1/R.length;R.forEach((h,l)=>{s.push({start:l*i,end:(l+1)*i})})}R.forEach((i,h)=>{const l=s[h],x=r.padding+l.start*B,f=r.padding+l.end*B,u=(x+f)/2;h>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+B*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding-F*s).attr("y2",k-r.padding-F*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:T(t.x),y:A(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),n=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f<i.length-1;f++){const u=i[f],w=i[f+1];n.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,l=-1/0,x=0;if(s.componentIds.forEach(f=>{const u=c.get(f);u&&(h=Math.min(h,u.x),l=Math.max(l,u.x),x=u.y)}),h!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=x-u/2,S=c.get(s.nodeId);if(S){const z=(h+l)/2;S.x=z,S.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",w).attr("width",l-h+30).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=P.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=Z.get(t.target);return!(n!=null&&n.has(t.source))});_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.x+l/f*h}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.y+x/f*h}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.x+l/f*h}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.y+x/f*h}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=s.y-n.y,l=s.x-n.x,x=Math.sqrt(l*l+h*h),f=8,u=h/x;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,h=s.x-n.x,l=s.y-n.y,x=Math.sqrt(h*h+l*l),f=8,u=-h/x;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=(n.y+s.y)/2,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x),u=8,w=x/f,S=-l/f,z=i+w*u,W=h+S*u;let Y=Math.atan2(x,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${z} ${W})`}).text(t=>t.label);const $t=P.append("g").attr("class","wardley-trends"),vt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=T(t.targetX),i=A(t.targetY),h=s-n.x,l=i-n.y,x=Math.sqrt(h*h+l*l),f=r.nodeRadius+2,u=x>f?s-h/x*f:s,w=x>f?i-l/x*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);$t.selectAll("line").data(vt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${o})`);const C=P.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));C.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const X=C.filter(t=>t.sourceStrategy==="market");X.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=r.nodeRadius*.7,$=r.nodeRadius*1.2;if(X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),C.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),C.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",r.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:T(i.x),y:A(i.y)}));if(s.length>1)for(let i=0;i<s.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[i].x).attr("y1",s[i].y).attr("x2",s[i+1].x).attr("y2",s[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach(i=>{const h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.number)})}),g.annotationsBox){let n=T(g.annotationsBox.x),s=A(g.annotationsBox.y);const i=10,h=16,l=11,x=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,S)=>w.number-S.number),u=[];if(f.forEach((w,S)=>{const z=x.append("text").attr("x",n+i).attr("y",s+i+(S+1)*h).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(z)}),u.length>0){let w=0,S=0;u.forEach(j=>{const D=j.node(),Nt=D.getComputedTextLength();w=Math.max(w,Nt);const Ct=D.getBBox();S=Math.max(S,Ct.height)});const z=w+i*2+105,W=f.length*h+i*2+S/2,Y=r.padding,Pt=M-r.padding-z,St=r.padding,Mt=k-r.padding-W;n=Math.max(Y,Math.min(n,Pt)),s=Math.max(St,Math.min(s,Mt)),u.forEach((j,D)=>{j.attr("x",n+i).attr("y",s+i+(D+1)*h)}),x.insert("rect","text").attr("x",n).attr("y",s).attr("width",z).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=P.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=T(n.x),i=A(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
3
3
  M ${s} ${i-l/2}
4
4
  L ${s+h-x} ${i-l/2}
@@ -1,4 +1,4 @@
1
- import{s as xi,g as di,p as Yt,o as fi,a as pi,b as mi,_ as n,l as Nt,F as yi,e as bi,q as Ai,z as kt,i as wi,B as Ht,D as Ci,W as Si,aH as Ri,a7 as Ot}from"./mermaid.core-CHAol8ex.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Bt4q2WDw.js";import{l as Wt}from"./linear-hDCiku2e.js";import"./vendor-D3SOLPPh.js";import"./vendor-react-DQUAl2K8.js";import"./defaultLocale-DX6XiGOO.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s<a;)o[s]=e+s*i;return o}function wt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,a=1,o,l,p=!1,d=0,k=0,T=.5;delete e.unknown;function _(){var b=t().length,E=a<s,L=E?a:s,P=E?s:a;o=(P-L)/Math.max(1,b-d+k*2),p&&(o=Math.floor(o)),L+=(P-L-o*(b-d))*T,l=o*(1-d),p&&(L=Math.round(L),l=Math.round(l));var I=Ti(b).map(function(m){return L+o*m});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),_()):t()},e.range=function(b){return arguments.length?([s,a]=b,s=+s,a=+a,_()):[s,a]},e.rangeRound=function(b){return[s,a]=b,s=+s,a=+a,p=!0,_()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(b){return arguments.length?(p=!!b,_()):p},e.padding=function(b){return arguments.length?(d=Math.min(1,k=+b),_()):d},e.paddingInner=function(b){return arguments.length?(d=Math.min(1,b),_()):d},e.paddingOuter=function(b){return arguments.length?(k=+b,_()):k},e.align=function(b){return arguments.length?(T=Math.max(0,Math.min(1,b)),_()):T},e.copy=function(){return wt(t(),[s,a]).round(p).paddingInner(d).paddingOuter(k).align(T)},_i.apply(_(),arguments)}var Ct=(function(){var e=n(function(F,h,u,g){for(u=u||{},g=F.length;g--;u[F[g]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],o=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],k=[1,26],T=[1,28],_=[1,29],b=[1,30],E=[1,31],L=[1,32],P=[1,33],I=[1,34],m=[1,35],D=[1,36],c=[1,37],B=[1,43],W=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],V=[26,28],R={trace:n(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,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$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",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"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],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(h,u,g,x,C,r,rt){var f=r.length-1;switch(C){case 5:x.setOrientation(r[f]);break;case 9:x.setDiagramTitle(r[f].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[f]);break;case 13:x.setLineData(r[f-1],r[f]);break;case 14:x.setBarData({text:"",type:"text"},r[f]);break;case 15:x.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:case 30:this.$=[r[f-2],...r[f]];break;case 21:case 31:this.$=[r[f]];break;case 22:this.$={value:Number(r[f-1]),label:r[f]};break;case 23:this.$={value:Number(r[f]),label:""};break;case 24:x.setXAxisTitle(r[f]);break;case 25:x.setXAxisTitle(r[f-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[f]);break;case 28:x.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 29:this.$=r[f-1];break;case 32:x.setYAxisTitle(r[f]);break;case 33:x.setYAxisTitle(r[f-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 39:this.$={text:r[f],type:"text"};break;case 40:this.$={text:r[f],type:"text"};break;case 41:this.$={text:r[f],type:"markdown"};break;case 42:this.$=r[f];break;case 43:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:o,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:o,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:o,38:l}),{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(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:o,38:l}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:l}),{11:23,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:39,13:38,24:B,29:W,30:d,31:40,32:41,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:49,17:48,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:52,17:51,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:B,29:W}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:Y},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(V,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(h,u){if(u.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=u,g}},"parseError"),parse:n(function(h){var u=this,g=[0],x=[],C=[null],r=[],rt=this.table,f="",gt=0,Mt=0,li=2,zt=1,ci=r.slice.call(arguments,1),v=Object.create(this.lexer),$={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&($.yy[mt]=this.yy[mt]);v.setInput(h,$.yy),$.yy.lexer=v,$.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(z){g.length=g.length-2*z,C.length=C.length-z,r.length=r.length-z}n(gi,"popStack");function Bt(){var z;return z=x.pop()||v.lex()||zt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(Bt,"lex");for(var M,U,O,bt,G={},xt,N,Vt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=Bt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`:
1
+ import{s as xi,g as di,p as Yt,o as fi,a as pi,b as mi,_ as n,l as Nt,F as yi,e as bi,q as Ai,z as kt,i as wi,B as Ht,D as Ci,W as Si,aH as Ri,a7 as Ot}from"./mermaid.core-524tR-D2.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-B7gl1e82.js";import{l as Wt}from"./linear-Dg9CPt0k.js";import"./vendor-z183l2lP.js";import"./vendor-react-Dka9ZH0B.js";import"./defaultLocale-DX6XiGOO.js";function Ti(e,t,i){e=+e,t=+t,i=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+i;for(var s=-1,a=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(a);++s<a;)o[s]=e+s*i;return o}function wt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,a=1,o,l,p=!1,d=0,k=0,T=.5;delete e.unknown;function _(){var b=t().length,E=a<s,L=E?a:s,P=E?s:a;o=(P-L)/Math.max(1,b-d+k*2),p&&(o=Math.floor(o)),L+=(P-L-o*(b-d))*T,l=o*(1-d),p&&(L=Math.round(L),l=Math.round(l));var I=Ti(b).map(function(m){return L+o*m});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),_()):t()},e.range=function(b){return arguments.length?([s,a]=b,s=+s,a=+a,_()):[s,a]},e.rangeRound=function(b){return[s,a]=b,s=+s,a=+a,p=!0,_()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(b){return arguments.length?(p=!!b,_()):p},e.padding=function(b){return arguments.length?(d=Math.min(1,k=+b),_()):d},e.paddingInner=function(b){return arguments.length?(d=Math.min(1,b),_()):d},e.paddingOuter=function(b){return arguments.length?(k=+b,_()):k},e.align=function(b){return arguments.length?(T=Math.max(0,Math.min(1,b)),_()):T},e.copy=function(){return wt(t(),[s,a]).round(p).paddingInner(d).paddingOuter(k).align(T)},_i.apply(_(),arguments)}var Ct=(function(){var e=n(function(F,h,u,g){for(u=u||{},g=F.length;g--;u[F[g]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],o=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],k=[1,26],T=[1,28],_=[1,29],b=[1,30],E=[1,31],L=[1,32],P=[1,33],I=[1,34],m=[1,35],D=[1,36],c=[1,37],B=[1,43],W=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],V=[26,28],R={trace:n(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,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$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",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"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],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(h,u,g,x,C,r,rt){var f=r.length-1;switch(C){case 5:x.setOrientation(r[f]);break;case 9:x.setDiagramTitle(r[f].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[f]);break;case 13:x.setLineData(r[f-1],r[f]);break;case 14:x.setBarData({text:"",type:"text"},r[f]);break;case 15:x.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:case 30:this.$=[r[f-2],...r[f]];break;case 21:case 31:this.$=[r[f]];break;case 22:this.$={value:Number(r[f-1]),label:r[f]};break;case 23:this.$={value:Number(r[f]),label:""};break;case 24:x.setXAxisTitle(r[f]);break;case 25:x.setXAxisTitle(r[f-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[f]);break;case 28:x.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 29:this.$=r[f-1];break;case 32:x.setYAxisTitle(r[f]);break;case 33:x.setYAxisTitle(r[f-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 39:this.$={text:r[f],type:"text"};break;case 40:this.$={text:r[f],type:"text"};break;case 41:this.$={text:r[f],type:"markdown"};break;case 42:this.$=r[f];break;case 43:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:o,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:o,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:o,38:l}),{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(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:o,38:l}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:l}),{11:23,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:39,13:38,24:B,29:W,30:d,31:40,32:41,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:49,17:48,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{11:52,17:51,24:Y,30:d,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:B,29:W}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:Y},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(V,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:k,41:27,42:T,43:_,44:b,45:E,46:L,47:P,48:I,49:m,50:D,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(h,u){if(u.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=u,g}},"parseError"),parse:n(function(h){var u=this,g=[0],x=[],C=[null],r=[],rt=this.table,f="",gt=0,Mt=0,li=2,zt=1,ci=r.slice.call(arguments,1),v=Object.create(this.lexer),$={yy:{}};for(var mt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,mt)&&($.yy[mt]=this.yy[mt]);v.setInput(h,$.yy),$.yy.lexer=v,$.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var yt=v.yylloc;r.push(yt);var ui=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function gi(z){g.length=g.length-2*z,C.length=C.length-z,r.length=r.length-z}n(gi,"popStack");function Bt(){var z;return z=x.pop()||v.lex()||zt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=u.symbols_[z]||z),z}n(Bt,"lex");for(var M,U,O,bt,G={},xt,N,Vt,dt;;){if(U=g[g.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((M===null||typeof M>"u")&&(M=Bt()),O=rt[U]&&rt[U][M]),typeof O>"u"||!O.length||!O[0]){var At="";dt=[];for(xt in rt[U])this.terminals_[xt]&&xt>li&&dt.push("'"+this.terminals_[xt]+"'");v.showPosition?At="Parse error on line "+(gt+1)+`:
2
2
  `+v.showPosition()+`
3
3
  Expecting `+dt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":At="Parse error on line "+(gt+1)+": Unexpected "+(M==zt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(At,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:yt,expected:dt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+M);switch(O[0]){case 1:g.push(M),C.push(v.yytext),r.push(v.yylloc),g.push(O[1]),M=null,Mt=v.yyleng,f=v.yytext,gt=v.yylineno,yt=v.yylloc;break;case 2:if(N=this.productions_[O[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ui&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),bt=this.performAction.apply(G,[f,Mt,gt,$.yy,O[1],C,r].concat(ci)),typeof bt<"u")return bt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),C.push(G.$),r.push(G._$),Vt=rt[g[g.length-2]][g[g.length-1]],g.push(Vt);break;case 3:return!0}}return!0},"parse")},ot=(function(){var F={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(h,u){return this.yy=u||this.yy||{},this._input=h,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:n(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var u=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=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),g.length-1&&(this.yylineno-=g.length-1);var C=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:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(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:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
@@ -5,15 +5,16 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
7
7
  <title>Pi-Studio</title>
8
- <script type="module" crossorigin src="/assets/index-DVjN3uZm.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-DQUAl2K8.js">
10
- <link rel="modulepreload" crossorigin href="/assets/vendor-query-i7fr__Xm.js">
11
- <link rel="modulepreload" crossorigin href="/assets/vendor-D3SOLPPh.js">
12
- <link rel="modulepreload" crossorigin href="/assets/vendor-icons-DEs9VPZK.js">
13
- <link rel="modulepreload" crossorigin href="/assets/vendor-overlays-SaWbfdX8.js">
14
- <link rel="modulepreload" crossorigin href="/assets/vendor-dnd-CayJj8TC.js">
8
+ <script type="module" crossorigin src="/assets/index-DFue5iwi.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-Dka9ZH0B.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/vendor-z183l2lP.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/vendor-query-CDNPrdQ8.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/vendor-icons-CSCeICuX.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/vendor-overlays-DjMT65Ip.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/vendor-dnd-vJGfGIIi.js">
15
+ <link rel="modulepreload" crossorigin href="/assets/vendor-pdfjs-BSchhGel.js">
15
16
  <link rel="stylesheet" crossorigin href="/assets/vendor-CEK31ho9.css">
16
- <link rel="stylesheet" crossorigin href="/assets/index-DbyP1ZAT.css">
17
+ <link rel="stylesheet" crossorigin href="/assets/index-Dg0mhDS9.css">
17
18
  </head>
18
19
  <body>
19
20
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@av-pi-studio/web-client",
3
- "version": "0.0.117",
3
+ "version": "0.0.119",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.map",
@@ -9,58 +9,21 @@
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "dev": "vite",
12
- "build:web": "VITE_TARGET=web tsc -b && NODE_OPTIONS=--max-old-space-size=6144 VITE_TARGET=web vite build",
13
- "build:electron": "VITE_TARGET=electron tsc -b && NODE_OPTIONS=--max-old-space-size=6144 VITE_TARGET=electron vite build",
12
+ "build:web": "tsc -b && NODE_OPTIONS=--max-old-space-size=6144 vite build",
14
13
  "preview": "vite preview",
15
14
  "typecheck": "tsc -p tsconfig.json --noEmit",
16
15
  "clean": "rm -rf dist *.tsbuildinfo"
17
16
  },
18
17
  "devDependencies": {
19
- "@av-pi-studio/client": "^0.0.117",
20
- "@av-pi-studio/protocol": "^0.0.117",
21
- "@av-pi-studio/ui-library": "^0.0.117",
22
- "@codemirror/language": "^6.12.4",
23
- "@codemirror/language-data": "^6.5.2",
24
- "@codemirror/state": "^6.7.1",
25
- "@codemirror/view": "^6.43.6",
26
- "@dnd-kit/core": "^6.3.1",
27
- "@dnd-kit/sortable": "^10.0.0",
28
- "@dnd-kit/utilities": "^3.2.2",
29
- "@floating-ui/react": "^0.27.19",
30
- "@molviewer/core": "^0.4.6",
31
- "@radix-ui/react-dialog": "^1.1.18",
32
- "@radix-ui/react-dropdown-menu": "^2.1.19",
33
- "@radix-ui/react-popover": "^1.1.18",
34
- "@radix-ui/react-tooltip": "^1.2.11",
35
- "@tanstack/react-query": "^5.101.2",
36
- "@tanstack/react-virtual": "^3.14.5",
37
- "@testing-library/react": "^16.1.0",
38
- "@types/qrcode": "^1.5.6",
18
+ "@av-pi-studio/ui-library": "^0.0.119",
19
+ "@av-pi-studio/workbench": "^0.0.119",
39
20
  "@types/react": "^19.2.17",
40
21
  "@types/react-dom": "^19.2.3",
41
- "@uiw/codemirror-theme-github": "^4.25.11",
42
- "@uiw/react-codemirror": "^4.25.11",
43
22
  "@vitejs/plugin-react": "^4.7.0",
44
- "@xterm/addon-fit": "^0.10.0",
45
- "@xterm/xterm": "^5.5.0",
46
- "clsx": "^2.1.1",
47
- "framer-motion": "^11.18.2",
48
- "katex": "^0.18.4",
49
- "lucide-react": "^0.475.0",
50
- "mermaid": "^11.16.1",
51
23
  "pdfjs-dist": "^6.4.299",
52
- "qrcode": "^1.5.4",
53
24
  "react": "^19.2.7",
54
25
  "react-dom": "^19.2.7",
55
- "react-markdown": "^9.1.0",
56
- "react-router": "^7.18.1",
57
- "rehype-katex": "^7.0.1",
58
- "remark-gfm": "^4.0.1",
59
- "remark-math": "^6.0.0",
60
- "shiki": "^1.29.2",
61
- "vite": "^6.4.3",
62
- "zod": "^3.23.0",
63
- "zustand": "^5.0.14"
26
+ "vite": "^6.4.3"
64
27
  },
65
28
  "repository": {
66
29
  "type": "git",
@@ -1 +0,0 @@
1
- import{r as l,j as e}from"./vendor-react-DQUAl2K8.js";import{S as d,B as a}from"./index-DVjN3uZm.js";import{u as m}from"./use-file-download-DF0pV2Qv.js";import{F as c}from"./vendor-icons-DEs9VPZK.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-D3SOLPPh.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";const p="_wrap_inn1j_1",j="_name_inn1j_12",n={wrap:p,name:j};function z({path:s,workspaceCwd:f}){const[i,t]=l.useState(!1),r=m(s,i),o=s.split("/").pop()||s;return e.jsxs("div",{className:n.wrap,children:[e.jsx(c,{size:32}),e.jsx("div",{className:n.name,children:o}),e.jsx("div",{children:"No preview available for this file type."}),r.isError&&e.jsxs("div",{children:["Error: ",r.error instanceof Error?r.error.message:"download failed"]}),i&&r.isLoading?e.jsx(d,{size:"sm"}):r.data?e.jsx("a",{href:r.data.objectUrl,download:r.data.fileName||o,children:e.jsx(a,{size:"sm",children:"Save file"})}):e.jsx(a,{size:"sm",onClick:()=>t(!0),children:"Download"})]})}export{z as BinaryFallbackViewer};
@@ -1 +0,0 @@
1
- var j=Object.defineProperty;var q=(r,n,e)=>n in r?j(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var d=(r,n,e)=>q(r,typeof n!="symbol"?n+"":n,e);import{r as u,j as w}from"./vendor-react-DQUAl2K8.js";import{u as y}from"./vendor-query-i7fr__Xm.js";import{u as F,r as p}from"./index-DVjN3uZm.js";import{u as x}from"./use-file-download-DF0pV2Qv.js";import{Q as S,S as _,T as b,U as B,V as z,W as U}from"./vendor-D3SOLPPh.js";function D(r){const{maxDisplayBytes:n,inline:e,streamed:o,download:a}=r;if(e.isLoading)return{kind:"loading"};if(e.tooLarge){const{size:t}=e.tooLarge;return t>n?{kind:"too-large",size:t,maxDisplayBytes:n,downloading:a.requested&&a.isLoading,downloadUrl:a.objectUrl,downloadName:a.fileName}:o.isLoading?{kind:"streaming",size:t}:o.isError?{kind:"stream-error",size:t,message:o.errorMessage??"stream failed"}:o.content!==null?{kind:"streamed",size:t,content:o.content}:{kind:"loading"}}return e.isError?{kind:"error",message:e.errorMessage??"unknown error"}:e.content!==null?{kind:"inline",content:e.content}:{kind:"loading"}}class h extends Error{constructor(e,o){super("file_too_large");d(this,"size");d(this,"maxBytes");this.name="FileTooLargeError",this.size=e,this.maxBytes=o}}function R(r){if(!r.ok)throw r.error==="file_too_large"?new h(r.size??0,r.maxBytes):new Error(r.error??"file read failed");return{content:r.content??"",size:r.size??0}}function T(r,n=!0){const e=F(o=>o.client);return y({queryKey:p.fileRead(r),queryFn:async()=>{if(!e)throw new Error("not connected");const o=await e.connection.request("file_read_request",{path:r});return R(o)},enabled:!!e&&!!r&&n})}function M(r){const{enabled:n,download:e,decode:o}=r;return{isLoading:n&&(e.isLoading||e.hasObjectUrl&&o.isLoading),isError:e.isError||o.isError,error:e.isError?e.error:o.error,data:o.data}}function C(r,n=!0){var t;const e=x(r,n),o=(t=e.data)==null?void 0:t.objectUrl,a=y({queryKey:p.fileText(r,o??null),queryFn:async()=>({content:await(await fetch(o)).text()}),enabled:n&&!!o});return M({enabled:n,download:{isLoading:e.isLoading,isError:e.isError,error:e.error,hasObjectUrl:!!o},decode:{isLoading:a.isLoading,isError:a.isError,error:a.error,data:a.data}})}const E=30*1024*1024;function Y(r,n=!0){var c,f,g,m;const e=T(r,n),o=e.error instanceof h?e.error:null,a=o!==null&&o.size<=E,t=C(r,n&&a),[i,k]=u.useState(!1),s=x(r,n&&i),l=D({maxDisplayBytes:E,inline:{isLoading:e.isLoading,isError:e.isError,tooLarge:o?{size:o.size}:null,errorMessage:e.error instanceof Error?e.error.message:null,content:((c=e.data)==null?void 0:c.content)??null},streamed:{isLoading:t.isLoading,isError:t.isError,errorMessage:t.error instanceof Error?t.error.message:null,content:((f=t.data)==null?void 0:f.content)??null},download:{requested:i,isLoading:s.isLoading,objectUrl:((g=s.data)==null?void 0:g.objectUrl)??null,fileName:((m=s.data)==null?void 0:m.fileName)??null}});return l.kind==="too-large"?{...l,requestDownload:()=>k(!0)}:l}const N="_wrap_1feu3_1",v={wrap:N},L=new Map;function K(r){const[n,e]=u.useState(null);return u.useEffect(()=>{const o=z.matchFilename(U,r);if(!o){e(null);return}const a=L.get(o.name);if(a){e(a);return}let t=!1;return e(null),o.load().then(i=>{L.set(o.name,i),t||e(i)}),()=>{t=!0}},[r]),n?[n]:[]}function I({path:r,content:n}){const e=K(r),o=[S.lineWrapping,_(),...e];return w.jsx("div",{className:v.wrap,children:w.jsx(b,{value:n,theme:B,extensions:o,editable:!1,readOnly:!0,basicSetup:{highlightActiveLine:!1,foldGutter:!1,searchKeymap:!1},height:"100%"})})}export{I as C,Y as u};
@@ -1 +0,0 @@
1
- import{r as d,j as s}from"./vendor-react-DQUAl2K8.js";import{N as _}from"./vendor-D3SOLPPh.js";import{u as j,r as f,L as w,a as E,e as D,V as K,P as N,B as x,E as l,S as y,i as S}from"./index-DVjN3uZm.js";import{u as b,a as k}from"./vendor-query-i7fr__Xm.js";import{u as q}from"./use-file-watch-Ca_f0M8P.js";import{D as z}from"./DiffView-H0nfCGhg.js";import"./vendor-icons-DEs9VPZK.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";function V(e,t,n,i=!0){const a=j(r=>r.client);return b({queryKey:f.fileDiff(e,t,n),queryFn:async()=>{if(!a)throw new Error("not connected");return{patch:(await a.connection.request("file_diff_request",{path:e,cwd:t,staged:n})).patch??""}},enabled:!!a&&!!e&&!!t&&i})}function B(e,t,n){const i=k(),a=w.has(n)?E(e,t):null,{changedAt:r}=q(a);d.useEffect(()=>{r!==null&&(i.invalidateQueries({queryKey:f.fileRead(e)}),i.invalidateQueries({queryKey:f.fileDownload(e)}),i.invalidateQueries({queryKey:f.fileDiffByPath(e)}))},[r,e,i])}const C="_header_10rse_1",F="_path_10rse_11",L="_size_10rse_18",P="_viewToggle_10rse_23",Q="_body_10rse_28",c={header:C,path:F,size:L,viewToggle:P,body:Q};function g(e){return"path"in e}function R(e){return"staged"in e}function O({tab:e}){var m;const t=e.kind==="diff",n=e.data,i=g(n)?n.path:"",a=g(n)&&R(n)?n.staged:!1,[r,h]=d.useState(t?"diff":"file"),u=e.workspaceCwd||"~",[p]=d.useState(()=>D(i,S));B(i,u,p);const o=V(i,u,a,r==="diff"),v=K[p];return s.jsxs(N,{children:[s.jsxs("div",{className:c.header,children:[s.jsx("span",{className:c.path,children:i}),s.jsx("span",{className:c.size,children:r==="diff"?a?"staged":"unstaged":null}),s.jsxs("div",{className:c.viewToggle,children:[s.jsx(x,{size:"xs",variant:r==="file"?"default":"ghost",onClick:()=>h("file"),children:"File"}),s.jsx(x,{size:"xs",variant:r==="diff"?"default":"ghost",onClick:()=>h("diff"),children:"Diff"})]})]}),s.jsx("div",{className:_(c.body,"file-body"),children:r==="file"?s.jsx(d.Suspense,{fallback:s.jsxs(l,{children:[s.jsx(y,{size:"sm"})," Loading..."]}),children:s.jsx(v,{path:i,workspaceCwd:u})}):o.isLoading?s.jsxs(l,{children:[s.jsx(y,{size:"sm"})," Loading diff..."]}):o.isError?s.jsxs(l,{children:["Error: ",o.error instanceof Error?o.error.message:"unknown error"]}):(m=o.data)!=null&&m.patch?s.jsx(z,{patch:o.data.patch}):s.jsx(l,{style:{padding:"var(--pi-spacing-30)"},children:"No changes (file matches HEAD)"})})]})}export{O as FilePanel};
@@ -1 +0,0 @@
1
- import{r as v,j as r}from"./vendor-react-DQUAl2K8.js";import{a as ie,u as ae}from"./vendor-query-i7fr__Xm.js";import{n as ce,a as G,c as le,d as X,u as F,p as ue,E as A,S as R,B as C,r as B,t as de}from"./index-DVjN3uZm.js";import{u as fe,C as me}from"./CodeView-CAB3SZYK.js";import{p as pe,S as he}from"./href-resolution-XVtyCiRv.js";import{S as ge}from"./Switch-DrRVfYsF.js";import"./vendor-D3SOLPPh.js";import"./vendor-icons-DEs9VPZK.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";import"./use-file-download-DF0pV2Qv.js";const I={maxCount:64,maxBytesPerAsset:2*1024*1024,maxBytesTotal:16*1024*1024};function K(s,t,e){return!(s>=I.maxCount||e>I.maxBytesPerAsset||t+e>I.maxBytesTotal)}function Y(s){return s===""||s.startsWith("#")?"unsupported":s.startsWith("//")||he.test(s)?"external":null}function xe(s,t,e){return e!==null&&t===e?s:t}function J(s,t,e,n,i=null){const o=s.trim(),u=Y(o);if(u)return{kind:"skip",raw:s,reason:u};const a=pe(o);let p;if(a.startsWith("/")?p=a:a==="~"||a.startsWith("~/")?p=i!==null?ce(a,i):null:p=G(a,t),!p)return{kind:"skip",raw:s,reason:"unsupported"};const h=le(p);return h!==e&&!h.startsWith(`${e}/`)?{kind:"skip",raw:s,reason:"outside-workspace"}:{kind:"local",raw:s,path:h,context:n}}const we={css:"text/css",js:"text/javascript",mjs:"text/javascript",html:"text/html",htm:"text/html",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp",avif:"image/avif",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",m4v:"video/x-m4v",ogv:"video/ogg",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",m4a:"audio/mp4",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject"};function _e(s){const t=s.lastIndexOf("/"),e=s.lastIndexOf(".");return e<=t?"application/octet-stream":we[s.slice(e+1).toLowerCase()]??"application/octet-stream"}function ve(s){let t="";for(let n=0;n<s.length;n+=32768)t+=String.fromCharCode(...s.subarray(n,n+32768));return btoa(t)}function q(s,t){return`data:${s};base64,${ve(t)}`}const z=/<([a-zA-Z][a-zA-Z0-9]*)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)(\s*\/?>)/g,O=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;function ee(s){const t=new Map;O.lastIndex=0;let e;for(;e=O.exec(s);){const n=e[1].toLowerCase();t.has(n)||t.set(n,e[2]??e[3]??e[4]??"")}return t}function te(s,t){switch(s){case"link":{const e=t.get("rel")??"";return/(^|\s)stylesheet(\s|$)/i.test(e)?t.has("href")?[{name:"href",context:"style",multi:!1}]:[]:[]}case"script":return t.has("src")?[{name:"src",context:"script",multi:!1}]:[];case"img":{const e=[];return t.has("src")&&e.push({name:"src",context:"image",multi:!1}),t.has("srcset")&&e.push({name:"srcset",context:"image",multi:!0}),e}case"source":{const e=[];return t.has("src")&&e.push({name:"src",context:"media",multi:!1}),t.has("srcset")&&e.push({name:"srcset",context:"media",multi:!0}),e}case"video":{const e=[];return t.has("src")&&e.push({name:"src",context:"media",multi:!1}),t.has("poster")&&e.push({name:"poster",context:"media",multi:!1}),e}case"audio":return t.has("src")?[{name:"src",context:"media",multi:!1}]:[];default:return[]}}function se(s){return s.split(",").map(t=>t.trim()).filter(t=>t!=="").map(t=>{const e=t.search(/\s/);return e===-1?{url:t,descriptor:""}:{url:t.slice(0,e),descriptor:t.slice(e).trim()}})}function ye(s){return s.map(t=>t.descriptor?`${t.url} ${t.descriptor}`:t.url).join(", ")}function $(s,t,e){Y(t.trim())||s.has(t)||s.set(t,{raw:t,context:e})}function ke(s){const t=new Map;z.lastIndex=0;let e;for(;e=z.exec(s);){const n=e[1].toLowerCase(),i=ee(e[2]??"");for(const o of te(n,i)){const u=i.get(o.name)??"";if(o.multi)for(const a of se(u))$(t,a.url,o.context);else $(t,u,o.context)}}return[...t.values()]}function je(s,t){let e=!1;const n=se(s).map(i=>{const o=t[i.url];return o===void 0?i:(e=!0,{url:o,descriptor:i.descriptor})});return e?ye(n):null}function be(s,t){return Object.keys(t).length===0?s:(z.lastIndex=0,s.replace(z,(e,n,i,o)=>{const u=ee(i),a=te(n.toLowerCase(),u);if(a.length===0)return e;const p=new Map(a.map(d=>[d.name,d]));let h=!1;const E=i.replace(O,(d,f,l,w,y)=>{const _=p.get(f.toLowerCase());if(!_)return d;const g=l??w??y??"",b=_.multi?je(g,t):t[g]??null;return b===null?d:(h=!0,`${f}="${b}"`)});return h?`<${n}${E}${o}`:e}))}const P=/url\(\s*(?:"([^"]*)"|'([^']*)'|([^'")\s]*))\s*\)/gi,U=/@font-face\s*\{[^}]*\}/gi;function ne(s,t,e){return s??t??e??""}function Se(s){const t=[];U.lastIndex=0;let e;for(;e=U.exec(s);)t.push([e.index,e.index+e[0].length]);return t}function Ee(s){const t=Se(s),e=new Map;P.lastIndex=0;let n;for(;n=P.exec(s);){const i=ne(n[1],n[2],n[3]),o=t.some(([u,a])=>n.index>=u&&n.index<a)?"font":"image";$(e,i,o)}return[...e.values()]}function Le(s,t){return Object.keys(t).length===0?s:(P.lastIndex=0,s.replace(P,(e,n,i,o)=>{const u=t[ne(n,i,o)];return u===void 0?e:`url("${u}")`}))}const Ae=Object.freeze(["allow-scripts"]),Ce="https://pi-studio-preview.invalid/",Ne="default-src 'none'; img-src data:; style-src 'unsafe-inline' data:; script-src 'unsafe-inline' data:; font-src data:; media-src data:",Te=`<script>(function(){document.addEventListener("click",function(e){var a=e.target&&e.target.closest&&e.target.closest('a[href^="#"]');if(!a)return;var frag=a.getAttribute("href").slice(1);e.preventDefault();if(!frag){window.scrollTo(0,0);return;}var el=document.getElementById(frag)||document.getElementsByName(frag)[0];if(el)el.scrollIntoView();},true);})();<\/script>`,Re=/<head(\s[^>]*)?>/i,Be=/<html(\s[^>]*)?>/i,Me=/<base[\s/>]/i;function ze(s,t){const e=be(s,t.assets??{}),n=[];t.blockRemote&&n.push(`<meta http-equiv="Content-Security-Policy" content="${Ne}">`),Me.test(e)||(n.push(`<base href="${Ce}">`),n.push(Te));const i=n.join("");if(i==="")return e;const o=Re.exec(e);if(o){const a=o.index+o[0].length;return e.slice(0,a)+i+e.slice(a)}const u=Be.exec(e);if(u){const a=u.index+u[0].length;return e.slice(0,a)+`<head>${i}</head>`+e.slice(a)}return`<head>${i}</head>`+e}const V=6;async function W(s,t,e){let n=0;async function i(){for(;n<s.length;){const o=s[n];n+=1,await e(o)}}await Promise.all(Array.from({length:Math.min(t,s.length)},i))}function Q(s){const t=new Map;for(const e of s){const n=t.get(e.path);n?n.push(e):t.set(e.path,[e])}return t}async function Pe(s,t){const e={},n=[];let i=0,o=0,u=!1;const a=[];for(const d of s)d.kind==="skip"?n.push({raw:d.raw,reason:d.reason}):a.push(d);function p(d,f){for(const l of d)n.push({raw:l.raw,reason:f})}async function h(d,f){if(u){p(f,"over-cap");return}let l;try{l=await t.fetchBytes(d)}catch{p(f,"fetch-failed");return}if(!K(i,o,l.byteLength)){u=!0,p(f,"over-cap");return}if(i+=1,o+=l.byteLength,f[0].context!=="style"){const m=q(_e(d),l);for(const j of f)e[j.raw]=m;return}const w=new TextDecoder().decode(l),y=X(d),_=Ee(w).map(m=>J(m.raw,y,t.root,m.context,t.homeDir)),g=[];for(const m of _)m.kind==="skip"?n.push({raw:m.raw,reason:m.reason}):g.push(m);const b=Q(g);await W([...b.entries()],V,([m,j])=>h(m,j));const N={};for(const m of g){const j=e[m.raw];j!==void 0&&(N[m.raw]=j)}const L=Le(w,N),S=new TextEncoder().encode(L),k=S.byteLength-l.byteLength;if(k>0&&!K(i-1,o-l.byteLength,S.byteLength)){u=!0,p(f,"over-cap");return}o+=k;const T=q("text/css",S);for(const m of f)e[m.raw]=T}const E=Q(a);return await W([...E.entries()],V,([d,f])=>h(d,f)),{assets:e,skipped:n}}const Ie="_wrap_1et27_1",Oe="_toolbar_1et27_7",$e="_modeToggle_1et27_20",De="_controls_1et27_24",He="_switchLabel_1et27_29",Fe="_streamedNote_1et27_37",Ke="_skippedNote_1et27_45",qe="_skippedToggle_1et27_52",Ue="_skippedList_1et27_64",Ve="_body_1et27_69",We="_frame_1et27_73",Qe="_tooLarge_1et27_79",x={wrap:Ie,toolbar:Oe,modeToggle:$e,controls:De,switchLabel:He,streamedNote:Fe,skippedNote:Ke,skippedToggle:qe,skippedList:Ue,body:Ve,frame:We,tooLarge:Qe},Ze=Ae.join(" "),Z=Object.freeze({}),Ge=Object.freeze([]),oe={external:"external","outside-workspace":"outside workspace",unsupported:"unsupported","over-cap":"over cap","fetch-failed":"not found"};function Xe(s){const t=new Map;for(const e of s){const n=oe[e.reason];t.set(n,(t.get(n)??0)+1)}return[...t.entries()].map(([e,n])=>`${n} ${e}`).join(", ")}function Ye(s){let t=2166136261;for(let e=0;e<s.length;e++)t^=s.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(16)}function M(s){return`${(s/(1024*1024)).toFixed(1)} MB`}function dt({path:s,workspaceCwd:t}){var D,H;const e=fe(s),[n,i]=v.useState("preview"),[o,u]=v.useState(!1),[a,p]=v.useState(!1),h=ie(),E=F(c=>c.client),d=F(c=>c.daemon),f=ue(),l=e.kind==="inline"||e.kind==="streamed"?e.content:null,w=v.useMemo(()=>{const c=G(s,t);return c?X(c):null},[s,t]),y=v.useMemo(()=>w!==null?xe(w,t,f):null,[w,t,f]),_=v.useMemo(()=>l===null||w===null||y===null?[]:ke(l).map(c=>J(c.raw,w,y,c.context,f)),[l,w,y,f]),g=v.useMemo(()=>_.some(c=>c.kind==="local"),[_]),b=v.useMemo(()=>_.flatMap(c=>c.kind==="skip"?[{raw:c.raw,reason:c.reason}]:[]),[_]),N=v.useMemo(()=>g&&l!==null?Ye(l):"",[l,g]),L=ae({queryKey:B.htmlAssetBundle(s,N),queryFn:()=>y===null?Promise.resolve({assets:{},skipped:[]}):Pe(_,{root:y,homeDir:f,fetchBytes:async re=>{if(!E||!d)throw new Error("not connected");return(await de(d).download(re)).bytes}}),enabled:g,staleTime:1/0}),S=g?((D=L.data)==null?void 0:D.assets)??Z:Z,k=g?((H=L.data)==null?void 0:H.skipped)??Ge:b,T=v.useMemo(()=>l===null?null:ze(l,{assets:S,blockRemote:o}),[l,S,o]);function m(){h.invalidateQueries({queryKey:B.fileRead(s)}),h.invalidateQueries({queryKey:B.fileDownload(s)}),h.invalidateQueries({queryKey:B.htmlAssetBundleByPath(s)})}switch(e.kind){case"loading":return r.jsxs(A,{children:[r.jsx(R,{size:"sm"})," Loading..."]});case"streaming":return r.jsxs(A,{children:[r.jsx(R,{size:"sm"})," Streaming ",M(e.size)," file..."]});case"stream-error":case"error":return r.jsxs(A,{children:["Error: ",e.message]});case"too-large":{const c=s.split("/").pop()||s;return r.jsx(A,{children:r.jsxs("div",{className:x.tooLarge,children:[r.jsxs("div",{children:[M(e.size)," — too large to display (display ceiling is"," ",M(e.maxDisplayBytes),")."]}),e.downloading?r.jsx(R,{size:"sm"}):e.downloadUrl?r.jsx("a",{href:e.downloadUrl,download:e.downloadName||c,children:r.jsx(C,{size:"sm",children:"Save file"})}):r.jsx(C,{size:"sm",onClick:()=>e.requestDownload(),children:"Download"})]})})}}if(l===null||T===null)return null;if(g&&L.data===void 0)return r.jsxs(A,{children:[r.jsx(R,{size:"sm"})," Loading assets..."]});const j=s.split("/").pop()||s;return r.jsxs("div",{className:x.wrap,children:[r.jsxs("div",{className:x.toolbar,children:[r.jsxs("div",{className:x.modeToggle,children:[r.jsx(C,{size:"xs",variant:n==="preview"?"default":"ghost",onClick:()=>i("preview"),children:"Preview"}),r.jsx(C,{size:"xs",variant:n==="source"?"default":"ghost",onClick:()=>i("source"),children:"Source"})]}),r.jsxs("div",{className:x.controls,children:[r.jsxs("label",{className:x.switchLabel,children:[r.jsx(ge,{checked:o,onCheckedChange:u,"aria-label":"Block remote resources"}),"Block remote resources"]}),r.jsx(C,{size:"xs",variant:"ghost",onClick:m,children:"Reload"})]})]}),e.kind==="streamed"?r.jsxs("div",{className:x.streamedNote,children:[M(e.size)," file streamed"]}):null,k.length>0?r.jsxs("div",{className:x.skippedNote,children:[r.jsxs("button",{type:"button",className:x.skippedToggle,onClick:()=>p(c=>!c),children:[k.length," reference",k.length===1?"":"s"," not inlined (",Xe(k),")"]}),a?r.jsx("ul",{className:x.skippedList,children:k.map(c=>r.jsxs("li",{children:[c.raw," — ",oe[c.reason]]},c.raw))}):null]}):null,r.jsxs("div",{className:x.body,children:[r.jsx("iframe",{sandbox:Ze,srcDoc:T,referrerPolicy:"no-referrer",allow:"",className:x.frame,style:n==="preview"?void 0:{display:"none"},title:j}),n==="source"?r.jsx(me,{path:s,content:l}):null]})]})}export{dt as HtmlViewer};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-react-DQUAl2K8.js";import{E as s,S as a}from"./index-DVjN3uZm.js";import{u as t}from"./use-file-download-DF0pV2Qv.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-D3SOLPPh.js";import"./vendor-icons-DEs9VPZK.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";const n="_wrap_1vzo5_1",m="_image_1vzo5_15",i={wrap:n,image:m};function x({path:e,workspaceCwd:p}){const r=t(e);return r.isLoading?o.jsxs(s,{children:[o.jsx(a,{size:"sm"})," Loading image..."]}):r.isError?o.jsxs(s,{children:["Error: ",r.error instanceof Error?r.error.message:"unknown error"]}):r.data?o.jsx("div",{className:i.wrap,children:o.jsx("img",{className:i.image,src:r.data.objectUrl,alt:e.split("/").pop()||e})}):null}export{x as ImageViewer};
@@ -1 +0,0 @@
1
- import{r as x,j as e}from"./vendor-react-DQUAl2K8.js";import{a as j,d as g,B as i,E as a,S as c}from"./index-DVjN3uZm.js";import{u as w,C as h}from"./CodeView-CAB3SZYK.js";import{M as v}from"./markdown-DNjz8eN5.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-D3SOLPPh.js";import"./vendor-icons-DEs9VPZK.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";import"./use-file-download-DF0pV2Qv.js";import"./vendor-highlight-2yu9fuIs.js";import"./vendor-markdown-BdpekPki.js";import"./href-resolution-XVtyCiRv.js";const _="_wrap_g5iym_1",f="_toolbar_g5iym_6",y="_rendered_g5iym_17",z="_streamedNote_g5iym_21",N="_tooLarge_g5iym_29",t={wrap:_,toolbar:f,rendered:y,streamedNote:z,tooLarge:N};function n(r){return`${(r/(1024*1024)).toFixed(1)} MB`}function q({path:r,workspaceCwd:d}){const s=w(r),[l,m]=x.useState("preview"),p=x.useMemo(()=>{const o=j(r,d);return o?g(o):null},[r,d]);switch(s.kind){case"loading":return e.jsxs(a,{children:[e.jsx(c,{size:"sm"})," Loading..."]});case"streaming":return e.jsxs(a,{children:[e.jsx(c,{size:"sm"})," Streaming ",n(s.size)," file..."]});case"stream-error":case"error":return e.jsxs(a,{children:["Error: ",s.message]});case"too-large":{const o=r.split("/").pop()||r;return e.jsx(a,{children:e.jsxs("div",{className:t.tooLarge,children:[e.jsxs("div",{children:[n(s.size)," — too large to display (display ceiling is"," ",n(s.maxDisplayBytes),")."]}),s.downloading?e.jsx(c,{size:"sm"}):s.downloadUrl?e.jsx("a",{href:s.downloadUrl,download:s.downloadName||o,children:e.jsx(i,{size:"sm",children:"Save file"})}):e.jsx(i,{size:"sm",onClick:()=>s.requestDownload(),children:"Download"})]})})}case"inline":case"streamed":{const o=s.content,u=s.kind==="streamed";return e.jsxs("div",{className:t.wrap,children:[e.jsxs("div",{className:t.toolbar,children:[e.jsx(i,{size:"xs",variant:l==="preview"?"default":"ghost",onClick:()=>m("preview"),children:"Preview"}),e.jsx(i,{size:"xs",variant:l==="source"?"default":"ghost",onClick:()=>m("source"),children:"Source"})]}),u?e.jsxs("div",{className:t.streamedNote,children:[n(s.size)," file streamed"]}):null,l==="preview"?e.jsx("div",{className:t.rendered,children:e.jsx(v,{text:o,assetBase:p,workspaceCwd:d})}):e.jsx(h,{path:r,content:o})]})}}}export{q as MarkdownFileViewer};
@@ -1 +0,0 @@
1
- import{r as w,j as n}from"./vendor-react-DQUAl2K8.js";import{a as E}from"./vendor-query-i7fr__Xm.js";import{u as P,E as u,S as C,B as b,r as x}from"./index-DVjN3uZm.js";import{u as R}from"./use-provider-auth-list-BfHGDiIE.js";import{u as y}from"./provider-auth-store-B0otZuIW.js";import{S as N}from"./StatusBadge-4Ta2PiFt.js";import"./vendor-D3SOLPPh.js";import"./vendor-icons-DEs9VPZK.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";const j="env:";function I(t){var i;return t.configured==="unknown"?{label:"Unknown",variant:"warning"}:t.configured===!1?{label:"Not configured",variant:"muted"}:(i=t.configuredSource)!=null&&i.startsWith(j)?{label:`env: ${t.configuredSource.slice(j.length)}`,variant:"success"}:t.configuredType==="oauth"?{label:"OAuth",variant:"success"}:{label:"API key",variant:"success"}}function M(t){const i=t.configured===!0?"Re-login":"Log in";if(t.authTypes.length<=1){const s=t.authTypes[0]??"api_key";return[{authType:s,label:s==="oauth"?t.oauthLoginLabel??i:i}]}return t.authTypes.map(s=>s==="oauth"?{authType:s,label:t.oauthLoginLabel??"Log in with OAuth"}:{authType:s,label:"API key"})}const q="_list_vm1k7_1",O="_row_vm1k7_7",T="_rowMain_vm1k7_18",B="_name_vm1k7_25",z="_tag_vm1k7_33",F="_rowActions_vm1k7_37",K="_pendingNote_vm1k7_44",Q="_note_vm1k7_49",U="_errorState_vm1k7_55",a={list:q,row:O,rowMain:T,name:B,tag:z,rowActions:F,pendingNote:K,note:Q,errorState:U};function ee(){const t=P(e=>e.client),i=E(),s=y(e=>e.pendingLogin),k=y(e=>e.requestLogin),[d,g]=w.useState(null),[p,m]=w.useState({}),{data:r,isLoading:L,isError:S,error:h}=R();async function A(e){if(t&&window.confirm(`Log out of ${e.name}? Running agents keep working until their current credential use fails.`)){m(o=>({...o,[e.id]:""})),g(e.id);try{const o=await t.logoutProvider(e.id);m(l=>({...l,[e.id]:o.stillConfigured?"Removed the stored credential — still configured via an environment variable.":""})),await i.invalidateQueries({queryKey:x.providerAuthList()}),i.invalidateQueries({queryKey:x.providerModelsAll()})}finally{g(null)}}}return L?n.jsxs(u,{children:[n.jsx(C,{size:"sm"})," Loading providers…"]}):S?n.jsx(u,{className:a.errorState,children:h instanceof Error?h.message:"Failed to load providers."}):!r||r.length===0?n.jsx(u,{children:"No providers available."}):n.jsx("div",{className:a.list,children:r.map(e=>{const o=I(e),l=M(e),f=(s==null?void 0:s.provider)===e.id,_=s!==null&&!f,v=p[e.id];return n.jsxs("div",{className:a.row,children:[n.jsxs("div",{className:a.rowMain,children:[n.jsx("span",{className:a.name,children:e.name}),e.oauthIsSubscription&&n.jsx(N,{label:"Subscription",variant:"muted",className:a.tag}),n.jsx(N,{label:o.label,variant:o.variant,className:a.tag})]}),n.jsx("div",{className:a.rowActions,children:f?n.jsx("span",{className:a.pendingNote,children:"Logging in…"}):n.jsxs(n.Fragment,{children:[l.map(c=>n.jsx(b,{size:"xs",variant:"secondary",disabled:_,onClick:()=>k(e.id,e.name,c.authType),children:c.label},c.authType)),e.configured!==!1&&n.jsx(b,{size:"xs",variant:"ghost",disabled:_||d===e.id,loading:d===e.id,onClick:()=>void A(e),children:"Log out"})]})}),v&&n.jsx("div",{className:a.note,children:v})]},e.id)})})}export{ee as ModelProvidersPanel};
@@ -1 +0,0 @@
1
- import{r as c,j as t}from"./vendor-react-DQUAl2K8.js";import{u as I,q as W,P as w,E as N,S as k,o as q,s as C,d as U,v as X,C as Y,w as z,h as D}from"./index-DVjN3uZm.js";import{F as G}from"./vendor-molviewer-DeAF8d5d.js";import{u as H}from"./use-file-download-DF0pV2Qv.js";import{u as K}from"./use-file-watch-Ca_f0M8P.js";import{S as v}from"./StatusBadge-4Ta2PiFt.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-D3SOLPPh.js";import"./vendor-icons-DEs9VPZK.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";function J(e,r){return!e||!r?null:{url:r,name:e.split("/").pop()||e}}function Q({changedAt:e,lastAppliedAt:r,modified:n}){return!(e===null||n||e===r)}const Z={empty_path:"Nothing to save.",too_large:"File is too large to save (over 5 MiB).",not_found:"The file no longer exists.",unreadable:"The file could not be read.",not_a_file:"That path is not a file."};async function ee(e,r,n){const a=await e.connection.request("file_write_request",{path:r,content:n});if(!a.ok){const l=a.error??"";throw new Error(Z[l]??l??"Failed to save")}}const re="mol2";function oe(e){const{sourcePath:r,monomers:n,attempt:a}=e,l=a>0?`_${a+1}`:"";return`${te(r)}_polymer_${n}${l}.${re}`}function te(e){return(e.split("/").pop()??"").replace(/\.[^.]+$/,"").trim()||"polymer"}const se={"--canvas":"var(--pi-color-surface0)","--well":"var(--pi-color-surface0)","--recess":"var(--pi-color-surface1)","--chrome":"var(--pi-color-surface1)","--control":"var(--pi-color-surface2)","--control-hover":"var(--pi-color-surface3)","--control-strong-hover":"var(--pi-color-surface4)","--border-control":"var(--pi-color-border)","--border-input":"var(--pi-color-border)","--popover":"var(--pi-color-surface1)","--popover-item-hover":"var(--pi-color-surface2)","--row-hover":"var(--pi-color-surface2)","--border-popover":"var(--pi-color-border)","--text-primary":"var(--pi-color-foreground)","--text-on-control":"var(--pi-color-foreground)"},ne="_wrap_tixu9_1",ae="_molViewer_tixu9_4",le="_badges_tixu9_8",g={wrap:ne,molViewer:ae,badges:le},ie=50;async function ce(e){const{client:r,upload:n,sourcePath:a,monomers:l,text:f}=e,p=U(a);let s=null,i="";for(let u=0;u<ie&&s===null;u+=1){i=oe({sourcePath:a,monomers:l,attempt:u});try{s=await X(r,p,i,"file")}catch(m){if(m instanceof Y&&m.code==="exists")continue;throw m}}if(s===null)throw new Error(`No free name for ${i} — too many builds in this folder.`);try{await n(p,new File([f],i,{type:"chemical/x-mol2"}))}catch(u){throw await z(r,s).catch(()=>{}),u}return s}function ue({path:e,workspaceCwd:r,tabId:n,isActive:a,onModifiedChange:l}){var T;const f=I(o=>o.client),{upload:p}=W(),s=H(e??"",!!e),{changedAt:i}=K(e),u=c.useRef(null),m=c.useRef(!1),[h,_]=c.useState(null),[E,A]=c.useState(!1),[S,x]=c.useState(null),[j,y]=c.useState(null),[M,P]=c.useState(null),b=c.useRef(null),R=((T=s.data)==null?void 0:T.objectUrl)??null,$=c.useMemo(()=>J(e,R),[e,R]);c.useEffect(()=>{Q({changedAt:i,lastAppliedAt:b.current,modified:E})&&(b.current=i,s.refetch())},[i,E,s.refetch]);const L=i!==null&&i!==b.current&&E;async function V(o){if(e){if(!f){x("Not connected — cannot save.");return}x(null);try{await ee(f,e,o.text()),o.saved()}catch(d){x(d instanceof Error?d.message:"Failed to save")}}}async function B(o){if(e){if(!f){y("Not connected — cannot save the polymer.");return}y(null),P(null);try{const d=await ce({client:f,upload:p,sourcePath:e,monomers:o.monomers,text:o.text()});o.report.clashes>0&&P(`${o.report.clashes} close contacts — relax the geometry before simulating`);const O=q.getState().paneOfTab(r,n);C(d,r,O??void 0)}catch(d){y(d instanceof Error?d.message:"Failed to save the polymer")}}}const F=(s.isError?s.error instanceof Error?s.error.message:"download failed":null)??(h==null?void 0:h.message)??null;return e&&s.isPending?t.jsx(w,{children:t.jsxs(N,{children:[t.jsx(k,{size:"sm"})," Loading..."]})}):F?t.jsx(w,{children:t.jsxs(N,{children:["Error: ",F]})}):t.jsxs(w,{className:g.wrap,"data-molecule-active":a?"true":"false",children:[t.jsxs("div",{className:g.badges,children:[L&&t.jsx(v,{label:"File changed on disk",variant:"muted"}),S&&t.jsx(v,{label:`Save failed: ${S}`,variant:"error"}),j&&t.jsx(v,{label:`Polymer build: ${j}`,variant:"error"}),M&&t.jsx(v,{label:M,variant:"warning"})]}),t.jsx(G,{ref:u,className:g.molViewer,theme:se,source:$,sourceMode:m.current?"update":"replace",onLoad:()=>{m.current=!0,_(null)},onLoadError:o=>_(o.error),onModifiedChange:o=>{A(o),l==null||l(o)},onSave:e?V:void 0,onPolymerBuild:e?B:void 0})]})}function _e({tab:e}){const{path:r}=e.data,n=D(e.id);return t.jsx(w,{children:t.jsx(ue,{path:r,workspaceCwd:e.workspaceCwd,tabId:e.id,isActive:n})})}export{_e as MoleculeViewerPanel};
@@ -1 +0,0 @@
1
- import{r as o,j as s}from"./vendor-react-DQUAl2K8.js";import{E as I,B as M,S as X}from"./index-DVjN3uZm.js";import{u as $}from"./use-file-download-DF0pV2Qv.js";import{W as H,G as J,p as K}from"./vendor-pdfjs-BrYGnqfM.js";import{Z as Q,a as Y,M as ee,D as te}from"./vendor-icons-DEs9VPZK.js";import"./vendor-query-i7fr__Xm.js";import"./vendor-D3SOLPPh.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";const C=new URL("/pdfjs/",document.baseURI),re={cMapUrl:new URL("cmaps/",C).href,cMapPacked:!0,standardFontDataUrl:new URL("standard_fonts/",C).href,wasmUrl:new URL("wasm/",C).href,iccUrl:new URL("iccs/",C).href};function T(){var t;return(t=J).workerPort??(t.workerPort=new H({name:"pdfjs"})),K}const z=[.25,.5,.75,1,1.25,1.5,2,3,4],q=z[0],O=z[z.length-1],se=16777216,Z=1e-6;function ne(t){return z.find(r=>r>t+Z)??O}function oe(t){return z.findLast(r=>r<t-Z)??q}function ae(t,r,e){const a=t-r;return a<=0||e<=0?1:Math.min(O,Math.max(q,a/e))}function ie(t,r,e,a,c=se){const l=t*e*(r*e);return l<=0?a:Math.min(a,Math.sqrt(c/l))}function ce(t,r,e,a){const c=[];let l=a;for(const i of t)c.push(l),l+=i*r+e;return c}function le(t,r,e){const a=r+e/2,c=t.findIndex(l=>l>a);return Math.max(0,(c===-1?t.length:c)-1)}const de="_viewer_16fdq_1",ue="_toolbar_16fdq_7",fe="_pageIndicator_16fdq_18",he="_zoom_16fdq_19",me="_controls_16fdq_23",pe="_scroller_16fdq_32",ge="_stack_16fdq_40",we="_page_16fdq_18",xe="_canvas_16fdq_56",_e="_pageError_16fdq_61",ve="_failure_16fdq_71",Ee="_textLayer_16fdq_86",u={viewer:de,toolbar:ue,pageIndicator:fe,zoom:he,controls:me,scroller:pe,stack:ge,page:we,canvas:xe,pageError:_e,failure:ve,textLayer:Ee},je=12,U=16,Se="100% 0px",Pe=120,Me={invalid:"This file could not be opened as a PDF.",password:"This PDF is password-protected.",failed:"This PDF could not be loaded."};function be(t){const r=t instanceof Error?t.name:"";return r==="PasswordException"?"password":r==="InvalidPDFException"||r==="FormatError"||r==="MissingPDFException"?"invalid":"failed"}function ye(t){return t instanceof Error&&/Cancelled|destroyed/i.test(`${t.name} ${t.message}`)}function Te({path:t}){var F;const r=$(t),[e,a]=o.useState(null),[c,l]=o.useState(null),[i,D]=o.useState(null),[L,b]=o.useState(0),[h,w]=o.useState(!0),[m,S]=o.useState(1),[_,y]=o.useState(0),p=(F=r.data)==null?void 0:F.objectUrl;o.useEffect(()=>{if(!p)return;let n=!1,f=!1,x=null;return(async()=>{try{const j=new Uint8Array(await(await fetch(p)).arrayBuffer());if(n)return;x=T().getDocument({data:j,enableXfa:!1,...re});const P=await x.promise,W=await Promise.all(Array.from({length:P.numPages},async(ze,G)=>{const{width:B,height:V}=(await P.getPage(G+1)).getViewport({scale:1});return{width:B,height:V}}));if(n)return;f=!0,l(null),a({task:x,doc:P,sizes:W})}catch(j){n||l(be(j))}})(),()=>{n=!0,f||x==null||x.destroy()}},[p]),o.useEffect(()=>{const n=e==null?void 0:e.task;return()=>void(n==null?void 0:n.destroy())},[e==null?void 0:e.task]),o.useEffect(()=>{if(!i)return;let n,f=!0;const x=new ResizeObserver(([j])=>{const P=(j==null?void 0:j.contentRect.width)??0;if(clearTimeout(n),f){f=!1,b(P);return}n=setTimeout(()=>b(P),Pe)});return x.observe(i),()=>{clearTimeout(n),x.disconnect()}},[i]);const g=e==null?void 0:e.sizes,v=o.useMemo(()=>Math.max(0,...(g??[]).map(n=>n.width)),[g]),d=h?ae(L,U*2,v):m,E=o.useMemo(()=>ce((g??[]).map(n=>n.height),d,je,U),[g,d]),k=()=>{i&&y(le(E,i.scrollTop,i.clientHeight))},N=o.useRef(d);o.useLayoutEffect(()=>{i&&N.current!==d&&(i.scrollTop=i.scrollTop*d/N.current),N.current=d},[d,i]),o.useEffect(k,[E,i]);const A=()=>{var f;if(!p)return;const n=document.createElement("a");n.href=p,n.download=((f=r.data)==null?void 0:f.fileName)||t.split("/").pop()||"document.pdf",n.click()};if(r.isError)return s.jsxs(I,{children:["Error: ",r.error instanceof Error?r.error.message:"unknown error"]});if(c&&!e)return s.jsxs("div",{className:u.failure,children:[s.jsx("span",{children:Me[c]}),s.jsx(M,{size:"sm",onClick:A,children:"Download"})]});if(!e)return s.jsxs(I,{children:[s.jsx(X,{size:"sm"})," Loading PDF..."]});if(e.sizes.length===0)return s.jsxs("div",{className:u.failure,children:[s.jsx("span",{children:"This PDF has no pages."}),s.jsx(M,{size:"sm",onClick:A,children:"Download"})]});const R=n=>{S(n(d)),w(!1)};return s.jsxs("div",{className:u.viewer,children:[s.jsxs("div",{className:u.toolbar,children:[s.jsxs("span",{className:u.pageIndicator,"aria-live":"polite",children:[_+1," / ",e.sizes.length]}),s.jsxs("div",{className:u.controls,children:[s.jsx(M,{size:"xs",variant:"ghost",iconOnly:!0,"aria-label":"Zoom out",onClick:()=>R(oe),children:s.jsx(Q,{size:14})}),s.jsxs("span",{className:u.zoom,children:[Math.round(d*100),"%"]}),s.jsx(M,{size:"xs",variant:"ghost",iconOnly:!0,"aria-label":"Zoom in",onClick:()=>R(ne),children:s.jsx(Y,{size:14})}),s.jsx(M,{size:"xs",variant:h?"default":"ghost",iconOnly:!0,"aria-label":"Fit width","aria-pressed":h,onClick:()=>w(n=>!n),children:s.jsx(ee,{size:14})}),s.jsx(M,{size:"xs",variant:"ghost",iconOnly:!0,"aria-label":"Download PDF",onClick:A,children:s.jsx(te,{size:14})})]})]}),s.jsx("div",{ref:D,className:u.scroller,onScroll:k,children:s.jsx("div",{className:u.stack,children:e.sizes.map((n,f)=>s.jsx(ke,{doc:e.doc,pageNumber:f+1,size:n,scale:d,root:i},f))})})]})}function ke({doc:t,pageNumber:r,size:e,scale:a,root:c}){const l=o.useRef(null),[i,D]=o.useState(!1),[L,b]=o.useState(null);return o.useEffect(()=>{const h=l.current;if(!c||!h)return;const w=new IntersectionObserver(([m])=>D((m==null?void 0:m.isIntersecting)??!1),{root:c,rootMargin:Se});return w.observe(h),()=>w.disconnect()},[c]),o.useEffect(()=>{const h=l.current;if(!h)return;if(!i){h.replaceChildren();return}let w=!1,m=null,S=null;return(async()=>{try{const _=T(),y=await t.getPage(r),p=y.getViewport({scale:a}),g=ie(e.width,e.height,a,window.devicePixelRatio||1),v=document.createElement("canvas");v.width=Math.floor(p.width*g),v.height=Math.floor(p.height*g),v.className=u.canvas??"";const d=y.render({canvas:v,viewport:p,transform:g===1?void 0:[g,0,0,g,0,0]});m=d,await d.promise;const E=document.createElement("div");E.className=`textLayer ${u.textLayer??""}`,E.style.setProperty("--total-scale-factor",String(a));const k=new _.TextLayer({textContentSource:y.streamTextContent(),container:E,viewport:p});if(S=k,await k.render(),w)return;h.replaceChildren(v,E),b(null)}catch(_){!w&&!ye(_)&&b(_ instanceof Error?_.message:"render failed")}})(),()=>{w=!0,m==null||m.cancel(),S==null||S.cancel()}},[i,t,r,a,e.width,e.height]),s.jsx("div",{ref:l,className:u.page,style:{width:e.width*a,height:e.height*a},"data-page":r,children:L&&s.jsxs("span",{className:u.pageError,children:["Page ",r," failed to render."]})})}export{Te as PdfViewer};
@@ -1,8 +0,0 @@
1
- import{b as me,r as v,j as l}from"./vendor-react-DQUAl2K8.js";import{af as we,N as ye}from"./vendor-D3SOLPPh.js";import{u as oe,r as _t,D as ie,B as G,S as It,x as Ce,y as Ee,K as Ne,M as Be,N as Se,I as Ie,E as Lt}from"./index-DVjN3uZm.js";import{a as Re}from"./vendor-query-i7fr__Xm.js";import{u as O}from"./provider-auth-store-B0otZuIW.js";import{E as se,C as be,d as Ae}from"./vendor-icons-DEs9VPZK.js";import"./vendor-overlays-SaWbfdX8.js";import"./vendor-dnd-CayJj8TC.js";function _e(t,n){return{provider:t,authType:n,phase:"starting",statusLines:[]}}function Le(t,n,i){return{...t,phase:t.phase==="starting"?"waiting":t.phase,statusLines:[...t.statusLines,{kind:"info",message:n,links:i}]}}function Te(t,n){const i=t.statusLines.filter(r=>r.kind!=="progress");return{...t,phase:t.phase==="starting"?"waiting":t.phase,statusLines:[...i,{kind:"progress",message:n}]}}function Me(t,n,i){return{...t,authUrl:{url:n,instructions:i}}}function Pe(t,n,i,r,e){return{...t,deviceCode:{userCode:n,verificationUri:i,intervalSeconds:r,expiresInSeconds:e}}}function ve(t,n){return{...t,phase:"prompt",prompt:n}}function je(t,n){var i;return((i=t.prompt)==null?void 0:i.promptId)!==n?t:{...t,phase:"waiting",prompt:void 0}}function De(t,n,i){return{...t,phase:"done",result:{ok:n,error:i}}}function xe(t,n){if(t.phase==="done")return t;switch(n.kind){case"info":return Le(t,n.message,n.links);case"progress":return Te(t,n.message);case"auth_url":return Me(t,n.url,n.instructions);case"device_code":return Pe(t,n.userCode,n.verificationUri,n.intervalSeconds,n.expiresInSeconds);case"prompt":return ve(t,n);case"prompt_cancelled":return je(t,n.promptId);case"done":return De(t,n.ok,n.error)}}var V={},nt,Tt;function ke(){return Tt||(Tt=1,nt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),nt}var rt={},U={},Mt;function F(){if(Mt)return U;Mt=1;let t;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return U.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},U.getSymbolTotalCodewords=function(r){return n[r]},U.getBCHDigit=function(i){let r=0;for(;i!==0;)r++,i>>>=1;return r},U.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');t=r},U.isKanjiModeEnabled=function(){return typeof t<"u"},U.toSJIS=function(r){return t(r)},U}var ot={},Pt;function Rt(){return Pt||(Pt=1,(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+i)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,e){if(t.isValid(r))return r;try{return n(r)}catch{return e}}})(ot)),ot}var it,vt;function Ue(){if(vt)return it;vt=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(n){const i=Math.floor(n/8);return(this.buffer[i]>>>7-n%8&1)===1},put:function(n,i){for(let r=0;r<i;r++)this.putBit((n>>>i-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(n){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),n&&(this.buffer[i]|=128>>>this.length%8),this.length++}},it=t,it}var st,jt;function qe(){if(jt)return st;jt=1;function t(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n)}return t.prototype.set=function(n,i,r,e){const o=n*this.size+i;this.data[o]=r,e&&(this.reservedBit[o]=!0)},t.prototype.get=function(n,i){return this.data[n*this.size+i]},t.prototype.xor=function(n,i,r){this.data[n*this.size+i]^=r},t.prototype.isReserved=function(n,i){return this.reservedBit[n*this.size+i]},st=t,st}var at={},Dt;function Fe(){return Dt||(Dt=1,(function(t){const n=F().getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const e=Math.floor(r/7)+2,o=n(r),s=o===145?26:Math.ceil((o-13)/(2*e-2))*2,a=[o-7];for(let u=1;u<e-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},t.getPositions=function(r){const e=[],o=t.getRowColCoords(r),s=o.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||e.push([o[a],o[u]]);return e}})(at)),at}var ut={},xt;function ze(){if(xt)return ut;xt=1;const t=F().getSymbolSize,n=7;return ut.getPositions=function(r){const e=t(r);return[[0,0],[e-n,0],[0,e-n]]},ut}var ct={},kt;function Ke(){return kt||(kt=1,(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const n={N1:3,N2:3,N3:40,N4:10};t.isValid=function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const o=e.size;let s=0,a=0,u=0,c=null,m=null;for(let E=0;E<o;E++){a=u=0,c=m=null;for(let S=0;S<o;S++){let h=e.get(E,S);h===c?a++:(a>=5&&(s+=n.N1+(a-5)),c=h,a=1),h=e.get(S,E),h===m?u++:(u>=5&&(s+=n.N1+(u-5)),m=h,u=1)}a>=5&&(s+=n.N1+(a-5)),u>=5&&(s+=n.N1+(u-5))}return s},t.getPenaltyN2=function(e){const o=e.size;let s=0;for(let a=0;a<o-1;a++)for(let u=0;u<o-1;u++){const c=e.get(a,u)+e.get(a,u+1)+e.get(a+1,u)+e.get(a+1,u+1);(c===4||c===0)&&s++}return s*n.N2},t.getPenaltyN3=function(e){const o=e.size;let s=0,a=0,u=0;for(let c=0;c<o;c++){a=u=0;for(let m=0;m<o;m++)a=a<<1&2047|e.get(c,m),m>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|e.get(m,c),m>=10&&(u===1488||u===93)&&s++}return s*n.N3},t.getPenaltyN4=function(e){let o=0;const s=e.data.length;for(let u=0;u<s;u++)o+=e.data[u];return Math.abs(Math.ceil(o*100/s/5)-10)*n.N4};function i(r,e,o){switch(r){case t.Patterns.PATTERN000:return(e+o)%2===0;case t.Patterns.PATTERN001:return e%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(e+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return e*o%2+e*o%3===0;case t.Patterns.PATTERN110:return(e*o%2+e*o%3)%2===0;case t.Patterns.PATTERN111:return(e*o%3+(e+o)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}t.applyMask=function(e,o){const s=o.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)o.isReserved(u,a)||o.xor(u,a,i(e,u,a))},t.getBestMask=function(e,o){const s=Object.keys(t.Patterns).length;let a=0,u=1/0;for(let c=0;c<s;c++){o(c),t.applyMask(c,e);const m=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(c,e),m<u&&(u=m,a=c)}return a}})(ct)),ct}var W={},Ut;function ae(){if(Ut)return W;Ut=1;const t=Rt(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return W.getBlocksCount=function(e,o){switch(o){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},W.getTotalCodewordsCount=function(e,o){switch(o){case t.L:return i[(e-1)*4+0];case t.M:return i[(e-1)*4+1];case t.Q:return i[(e-1)*4+2];case t.H:return i[(e-1)*4+3];default:return}},W}var lt={},Q={},qt;function Ve(){if(qt)return Q;qt=1;const t=new Uint8Array(512),n=new Uint8Array(256);return(function(){let r=1;for(let e=0;e<255;e++)t[e]=r,n[r]=e,r<<=1,r&256&&(r^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),Q.log=function(r){if(r<1)throw new Error("log("+r+")");return n[r]},Q.exp=function(r){return t[r]},Q.mul=function(r,e){return r===0||e===0?0:t[n[r]+n[e]]},Q}var Ft;function Oe(){return Ft||(Ft=1,(function(t){const n=Ve();t.mul=function(r,e){const o=new Uint8Array(r.length+e.length-1);for(let s=0;s<r.length;s++)for(let a=0;a<e.length;a++)o[s+a]^=n.mul(r[s],e[a]);return o},t.mod=function(r,e){let o=new Uint8Array(r);for(;o.length-e.length>=0;){const s=o[0];for(let u=0;u<e.length;u++)o[u]^=n.mul(e[u],s);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o},t.generateECPolynomial=function(r){let e=new Uint8Array([1]);for(let o=0;o<r;o++)e=t.mul(e,new Uint8Array([1,n.exp(o)]));return e}})(lt)),lt}var dt,zt;function He(){if(zt)return dt;zt=1;const t=Oe();function n(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return n.prototype.initialize=function(r){this.degree=r,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(r.length+this.degree);e.set(r);const o=t.mod(e,this.genPoly),s=this.degree-o.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(o,s),a}return o},dt=n,dt}var ft={},ht={},gt={},Kt;function ue(){return Kt||(Kt=1,gt.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}),gt}var D={},Vt;function ce(){if(Vt)return D;Vt=1;const t="[0-9]+",n="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
2
- ]))+`;D.KANJI=new RegExp(i,"g"),D.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),D.BYTE=new RegExp(r,"g"),D.NUMERIC=new RegExp(t,"g"),D.ALPHANUMERIC=new RegExp(n,"g");const e=new RegExp("^"+i+"$"),o=new RegExp("^"+t+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return D.testKanji=function(u){return e.test(u)},D.testNumeric=function(u){return o.test(u)},D.testAlphanumeric=function(u){return s.test(u)},D}var Ot;function z(){return Ot||(Ot=1,(function(t){const n=ue(),i=ce();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!n.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return i.testNumeric(o)?t.NUMERIC:i.testAlphanumeric(o)?t.ALPHANUMERIC:i.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function r(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}t.from=function(o,s){if(t.isValid(o))return o;try{return r(o)}catch{return s}}})(ht)),ht}var Ht;function Qe(){return Ht||(Ht=1,(function(t){const n=F(),i=ae(),r=Rt(),e=z(),o=ue(),s=7973,a=n.getBCHDigit(s);function u(S,h,_){for(let d=1;d<=40;d++)if(h<=t.getCapacity(d,_,S))return d}function c(S,h){return e.getCharCountIndicator(S,h)+4}function m(S,h){let _=0;return S.forEach(function(d){const P=c(d.mode,h);_+=P+d.getBitsLength()}),_}function E(S,h){for(let _=1;_<=40;_++)if(m(S,_)<=t.getCapacity(_,h,e.MIXED))return _}t.from=function(h,_){return o.isValid(h)?parseInt(h,10):_},t.getCapacity=function(h,_,d){if(!o.isValid(h))throw new Error("Invalid QR Code version");typeof d>"u"&&(d=e.BYTE);const P=n.getSymbolTotalCodewords(h),A=i.getTotalCodewordsCount(h,_),L=(P-A)*8;if(d===e.MIXED)return L;const b=L-c(d,h);switch(d){case e.NUMERIC:return Math.floor(b/10*3);case e.ALPHANUMERIC:return Math.floor(b/11*2);case e.KANJI:return Math.floor(b/13);case e.BYTE:default:return Math.floor(b/8)}},t.getBestVersionForData=function(h,_){let d;const P=r.from(_,r.M);if(Array.isArray(h)){if(h.length>1)return E(h,P);if(h.length===0)return 1;d=h[0]}else d=h;return u(d.mode,d.getLength(),P)},t.getEncodedBits=function(h){if(!o.isValid(h)||h<7)throw new Error("Invalid QR Code version");let _=h<<12;for(;n.getBCHDigit(_)-a>=0;)_^=s<<n.getBCHDigit(_)-a;return h<<12|_}})(ft)),ft}var pt={},Qt;function Je(){if(Qt)return pt;Qt=1;const t=F(),n=1335,i=21522,r=t.getBCHDigit(n);return pt.getEncodedBits=function(o,s){const a=o.bit<<3|s;let u=a<<10;for(;t.getBCHDigit(u)-r>=0;)u^=n<<t.getBCHDigit(u)-r;return(a<<10|u)^i},pt}var mt={},wt,Jt;function Ye(){if(Jt)return wt;Jt=1;const t=z();function n(i){this.mode=t.NUMERIC,this.data=i.toString()}return n.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let e,o,s;for(e=0;e+3<=this.data.length;e+=3)o=this.data.substr(e,3),s=parseInt(o,10),r.put(s,10);const a=this.data.length-e;a>0&&(o=this.data.substr(e),s=parseInt(o,10),r.put(s,a*3+1))},wt=n,wt}var yt,Yt;function $e(){if(Yt)return yt;Yt=1;const t=z(),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(r){this.mode=t.ALPHANUMERIC,this.data=r}return i.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let o;for(o=0;o+2<=this.data.length;o+=2){let s=n.indexOf(this.data[o])*45;s+=n.indexOf(this.data[o+1]),e.put(s,11)}this.data.length%2&&e.put(n.indexOf(this.data[o]),6)},yt=i,yt}var Ct,$t;function Ge(){if($t)return Ct;$t=1;const t=z();function n(i){this.mode=t.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return n.getBitsLength=function(r){return r*8},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(i){for(let r=0,e=this.data.length;r<e;r++)i.put(this.data[r],8)},Ct=n,Ct}var Et,Gt;function We(){if(Gt)return Et;Gt=1;const t=z(),n=F();function i(r){this.mode=t.KANJI,this.data=r}return i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){let e;for(e=0;e<this.data.length;e++){let o=n.toSJIS(this.data[e]);if(o>=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
- Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),r.put(o,13)}},Et=i,Et}var Wt;function Xe(){return Wt||(Wt=1,(function(t){const n=z(),i=Ye(),r=$e(),e=Ge(),o=We(),s=ce(),a=F(),u=we();function c(A){return unescape(encodeURIComponent(A)).length}function m(A,L,b){const R=[];let M;for(;(M=A.exec(b))!==null;)R.push({data:M[0],index:M.index,mode:L,length:M[0].length});return R}function E(A){const L=m(s.NUMERIC,n.NUMERIC,A),b=m(s.ALPHANUMERIC,n.ALPHANUMERIC,A);let R,M;return a.isKanjiModeEnabled()?(R=m(s.BYTE,n.BYTE,A),M=m(s.KANJI,n.KANJI,A)):(R=m(s.BYTE_KANJI,n.BYTE,A),M=[]),L.concat(b,R,M).sort(function(N,w){return N.index-w.index}).map(function(N){return{data:N.data,mode:N.mode,length:N.length}})}function S(A,L){switch(L){case n.NUMERIC:return i.getBitsLength(A);case n.ALPHANUMERIC:return r.getBitsLength(A);case n.KANJI:return o.getBitsLength(A);case n.BYTE:return e.getBitsLength(A)}}function h(A){return A.reduce(function(L,b){const R=L.length-1>=0?L[L.length-1]:null;return R&&R.mode===b.mode?(L[L.length-1].data+=b.data,L):(L.push(b),L)},[])}function _(A){const L=[];for(let b=0;b<A.length;b++){const R=A[b];switch(R.mode){case n.NUMERIC:L.push([R,{data:R.data,mode:n.ALPHANUMERIC,length:R.length},{data:R.data,mode:n.BYTE,length:R.length}]);break;case n.ALPHANUMERIC:L.push([R,{data:R.data,mode:n.BYTE,length:R.length}]);break;case n.KANJI:L.push([R,{data:R.data,mode:n.BYTE,length:c(R.data)}]);break;case n.BYTE:L.push([{data:R.data,mode:n.BYTE,length:c(R.data)}])}}return L}function d(A,L){const b={},R={start:{}};let M=["start"];for(let p=0;p<A.length;p++){const N=A[p],w=[];for(let g=0;g<N.length;g++){const I=N[g],y=""+p+g;w.push(y),b[y]={node:I,lastCount:0},R[y]={};for(let B=0;B<M.length;B++){const C=M[B];b[C]&&b[C].node.mode===I.mode?(R[C][y]=S(b[C].lastCount+I.length,I.mode)-S(b[C].lastCount,I.mode),b[C].lastCount+=I.length):(b[C]&&(b[C].lastCount=I.length),R[C][y]=S(I.length,I.mode)+4+n.getCharCountIndicator(I.mode,L))}}M=w}for(let p=0;p<M.length;p++)R[M[p]].end=0;return{map:R,table:b}}function P(A,L){let b;const R=n.getBestModeForData(A);if(b=n.from(L,R),b!==n.BYTE&&b.bit<R.bit)throw new Error('"'+A+'" cannot be encoded with mode '+n.toString(b)+`.
4
- Suggested mode is: `+n.toString(R));switch(b===n.KANJI&&!a.isKanjiModeEnabled()&&(b=n.BYTE),b){case n.NUMERIC:return new i(A);case n.ALPHANUMERIC:return new r(A);case n.KANJI:return new o(A);case n.BYTE:return new e(A)}}t.fromArray=function(L){return L.reduce(function(b,R){return typeof R=="string"?b.push(P(R,null)):R.data&&b.push(P(R.data,R.mode)),b},[])},t.fromString=function(L,b){const R=E(L,a.isKanjiModeEnabled()),M=_(R),p=d(M,b),N=u.find_path(p.map,"start","end"),w=[];for(let g=1;g<N.length-1;g++)w.push(p.table[N[g]].node);return t.fromArray(h(w))},t.rawSplit=function(L){return t.fromArray(E(L,a.isKanjiModeEnabled()))}})(mt)),mt}var Xt;function Ze(){if(Xt)return rt;Xt=1;const t=F(),n=Rt(),i=Ue(),r=qe(),e=Fe(),o=ze(),s=Ke(),a=ae(),u=He(),c=Qe(),m=Je(),E=z(),S=Xe();function h(p,N){const w=p.size,g=o.getPositions(N);for(let I=0;I<g.length;I++){const y=g[I][0],B=g[I][1];for(let C=-1;C<=7;C++)if(!(y+C<=-1||w<=y+C))for(let f=-1;f<=7;f++)B+f<=-1||w<=B+f||(C>=0&&C<=6&&(f===0||f===6)||f>=0&&f<=6&&(C===0||C===6)||C>=2&&C<=4&&f>=2&&f<=4?p.set(y+C,B+f,!0,!0):p.set(y+C,B+f,!1,!0))}}function _(p){const N=p.size;for(let w=8;w<N-8;w++){const g=w%2===0;p.set(w,6,g,!0),p.set(6,w,g,!0)}}function d(p,N){const w=e.getPositions(N);for(let g=0;g<w.length;g++){const I=w[g][0],y=w[g][1];for(let B=-2;B<=2;B++)for(let C=-2;C<=2;C++)B===-2||B===2||C===-2||C===2||B===0&&C===0?p.set(I+B,y+C,!0,!0):p.set(I+B,y+C,!1,!0)}}function P(p,N){const w=p.size,g=c.getEncodedBits(N);let I,y,B;for(let C=0;C<18;C++)I=Math.floor(C/3),y=C%3+w-8-3,B=(g>>C&1)===1,p.set(I,y,B,!0),p.set(y,I,B,!0)}function A(p,N,w){const g=p.size,I=m.getEncodedBits(N,w);let y,B;for(y=0;y<15;y++)B=(I>>y&1)===1,y<6?p.set(y,8,B,!0):y<8?p.set(y+1,8,B,!0):p.set(g-15+y,8,B,!0),y<8?p.set(8,g-y-1,B,!0):y<9?p.set(8,15-y-1+1,B,!0):p.set(8,15-y-1,B,!0);p.set(g-8,8,1,!0)}function L(p,N){const w=p.size;let g=-1,I=w-1,y=7,B=0;for(let C=w-1;C>0;C-=2)for(C===6&&C--;;){for(let f=0;f<2;f++)if(!p.isReserved(I,C-f)){let j=!1;B<N.length&&(j=(N[B]>>>y&1)===1),p.set(I,C-f,j),y--,y===-1&&(B++,y=7)}if(I+=g,I<0||w<=I){I-=g,g=-g;break}}}function b(p,N,w){const g=new i;w.forEach(function(f){g.put(f.mode.bit,4),g.put(f.getLength(),E.getCharCountIndicator(f.mode,p)),f.write(g)});const I=t.getSymbolTotalCodewords(p),y=a.getTotalCodewordsCount(p,N),B=(I-y)*8;for(g.getLengthInBits()+4<=B&&g.put(0,4);g.getLengthInBits()%8!==0;)g.putBit(0);const C=(B-g.getLengthInBits())/8;for(let f=0;f<C;f++)g.put(f%2?17:236,8);return R(g,p,N)}function R(p,N,w){const g=t.getSymbolTotalCodewords(N),I=a.getTotalCodewordsCount(N,w),y=g-I,B=a.getBlocksCount(N,w),C=g%B,f=B-C,j=Math.floor(g/B),q=Math.floor(y/B),Y=q+1,H=j-q,ge=new u(H);let X=0;const $=new Array(B),bt=new Array(B);let Z=0;const pe=new Uint8Array(p.buffer);for(let K=0;K<B;K++){const et=K<f?q:Y;$[K]=pe.slice(X,X+et),bt[K]=ge.encode($[K]),X+=et,Z=Math.max(Z,et)}const tt=new Uint8Array(g);let At=0,x,k;for(x=0;x<Z;x++)for(k=0;k<B;k++)x<$[k].length&&(tt[At++]=$[k][x]);for(x=0;x<H;x++)for(k=0;k<B;k++)tt[At++]=bt[k][x];return tt}function M(p,N,w,g){let I;if(Array.isArray(p))I=S.fromArray(p);else if(typeof p=="string"){let j=N;if(!j){const q=S.rawSplit(p);j=c.getBestVersionForData(q,w)}I=S.fromString(p,j||40)}else throw new Error("Invalid data");const y=c.getBestVersionForData(I,w);if(!y)throw new Error("The amount of data is too big to be stored in a QR Code");if(!N)N=y;else if(N<y)throw new Error(`
5
- The chosen QR Code version cannot contain this amount of data.
6
- Minimum version required to store current data is: `+y+`.
7
- `);const B=b(N,w,I),C=t.getSymbolSize(N),f=new r(C);return h(f,N),_(f),d(f,N),A(f,w,0),N>=7&&P(f,N),L(f,B),isNaN(g)&&(g=s.getBestMask(f,A.bind(null,f,w))),s.applyMask(g,f),A(f,w,g),{modules:f,version:N,errorCorrectionLevel:w,maskPattern:g,segments:I}}return rt.create=function(N,w){if(typeof N>"u"||N==="")throw new Error("No input text");let g=n.M,I,y;return typeof w<"u"&&(g=n.from(w.errorCorrectionLevel,n.M),I=c.from(w.version),y=s.from(w.maskPattern),w.toSJISFunc&&t.setToSJISFunction(w.toSJISFunc)),M(N,I,g,y)},rt}var Nt={},Bt={},Zt;function le(){return Zt||(Zt=1,(function(t){function n(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(o){return[o,o]}))),r.length===6&&r.push("F","F");const e=parseInt(r.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const e=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,o=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:o,scale:o?4:s,margin:e,color:{dark:n(r.color.dark||"#000000ff"),light:n(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,e){return e.width&&e.width>=r+e.margin*2?e.width/(r+e.margin*2):e.scale},t.getImageWidth=function(r,e){const o=t.getScale(r,e);return Math.floor((r+e.margin*2)*o)},t.qrToImageData=function(r,e,o){const s=e.modules.size,a=e.modules.data,u=t.getScale(s,o),c=Math.floor((s+o.margin*2)*u),m=o.margin*u,E=[o.color.light,o.color.dark];for(let S=0;S<c;S++)for(let h=0;h<c;h++){let _=(S*c+h)*4,d=o.color.light;if(S>=m&&h>=m&&S<c-m&&h<c-m){const P=Math.floor((S-m)/u),A=Math.floor((h-m)/u);d=E[a[P*s+A]?1:0]}r[_++]=d.r,r[_++]=d.g,r[_++]=d.b,r[_]=d.a}}})(Bt)),Bt}var te;function tn(){return te||(te=1,(function(t){const n=le();function i(e,o,s){e.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=s,o.width=s,o.style.height=s+"px",o.style.width=s+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(o,s,a){let u=a,c=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(c=r()),u=n.getOptions(u);const m=n.getImageWidth(o.modules.size,u),E=c.getContext("2d"),S=E.createImageData(m,m);return n.qrToImageData(S.data,o,u),i(E,c,m),E.putImageData(S,0,0),c},t.renderToDataURL=function(o,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const c=t.render(o,s,u),m=u.type||"image/png",E=u.rendererOpts||{};return c.toDataURL(m,E.quality)}})(Nt)),Nt}var St={},ee;function en(){if(ee)return St;ee=1;const t=le();function n(e,o){const s=e.a/255,a=o+'="'+e.hex+'"';return s<1?a+" "+o+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function i(e,o,s){let a=e+o;return typeof s<"u"&&(a+=" "+s),a}function r(e,o,s){let a="",u=0,c=!1,m=0;for(let E=0;E<e.length;E++){const S=Math.floor(E%o),h=Math.floor(E/o);!S&&!c&&(c=!0),e[E]?(m++,E>0&&S>0&&e[E-1]||(a+=c?i("M",S+s,.5+h+s):i("m",u,0),u=0,c=!1),S+1<o&&e[E+1]||(a+=i("h",m),m=0)):u++}return a}return St.render=function(o,s,a){const u=t.getOptions(s),c=o.modules.size,m=o.modules.data,E=c+u.margin*2,S=u.color.light.a?"<path "+n(u.color.light,"fill")+' d="M0 0h'+E+"v"+E+'H0z"/>':"",h="<path "+n(u.color.dark,"stroke")+' d="'+r(m,c,u.margin)+'"/>',_='viewBox="0 0 '+E+" "+E+'"',P='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+_+' shape-rendering="crispEdges">'+S+h+`</svg>
8
- `;return typeof a=="function"&&a(null,P),P},St}var ne;function nn(){if(ne)return V;ne=1;const t=ke(),n=Ze(),i=tn(),r=en();function e(o,s,a,u,c){const m=[].slice.call(arguments,1),E=m.length,S=typeof m[E-1]=="function";if(!S&&!t())throw new Error("Callback required as last argument");if(S){if(E<2)throw new Error("Too few arguments provided");E===2?(c=a,a=s,s=u=void 0):E===3&&(s.getContext&&typeof c>"u"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(E<1)throw new Error("Too few arguments provided");return E===1?(a=s,s=u=void 0):E===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(h,_){try{const d=n.create(a,u);h(o(d,s,u))}catch(d){_(d)}})}try{const h=n.create(a,u);c(null,o(h,s,u))}catch(h){c(h)}}return V.create=n.create,V.toCanvas=e.bind(null,i.render),V.toDataURL=e.bind(null,i.renderToDataURL),V.toString=e.bind(null,function(o,s,a){return r.render(o,a)}),V}var rn=nn();const on=me(rn),sn="_qr_lnaw6_1",an="_placeholder_lnaw6_2",re={qr:sn,placeholder:an},un=320;function de({value:t,label:n}){const[i,r]=v.useState(null),[e,o]=v.useState(!1);return v.useEffect(()=>{let s=!0;return r(null),o(!1),on.toDataURL(t,{width:un,margin:1,errorCorrectionLevel:"M"}).then(a=>{s&&r(a)}).catch(()=>{s&&o(!0)}),()=>{s=!1}},[t]),e?null:i?l.jsx("img",{className:re.qr,src:i,alt:n}):l.jsx("div",{className:re.placeholder,"aria-hidden":"true"})}const cn="_body_1yyw5_1",ln="_status_1yyw5_11",dn="_statusLine_1yyw5_17",fn="_statusLineProgress_1yyw5_18",hn="_statusText_1yyw5_28",gn="_prompt_1yyw5_40",pn="_promptMessage_1yyw5_46",mn="_options_1yyw5_51",wn="_option_1yyw5_51",yn="_optionLabel_1yyw5_76",Cn="_optionDescription_1yyw5_81",En="_success_1yyw5_86",Nn="_error_1yyw5_91",Bn="_oauth_1yyw5_98",Sn="_oauthInstructions_1yyw5_107",In="_oauthMain_1yyw5_115",Rn="_oauthActions_1yyw5_123",bn="_openButton_1yyw5_135",An="_urlRow_1yyw5_156",_n="_oauthUrl_1yyw5_164",Ln="_oauthQr_1yyw5_175",Tn="_oauthQrCaption_1yyw5_184",Mn="_deviceCode_1yyw5_191",Pn="_countdown_1yyw5_198",T={body:cn,status:ln,statusLine:dn,statusLineProgress:fn,statusText:hn,prompt:gn,promptMessage:pn,options:mn,option:wn,optionLabel:yn,optionDescription:Cn,success:En,error:Nn,oauth:Bn,oauthInstructions:Sn,oauthMain:In,oauthActions:Rn,openButton:bn,urlRow:An,oauthUrl:_n,oauthQr:Ln,oauthQrCaption:Tn,deviceCode:Mn,countdown:Pn},vn=1200,fe="provider-auth-prompt-form";function jn(){const t=O(a=>a.pendingLogin),n=O(a=>a.cancelLogin),i=O(a=>a.clearLogin),r=O(a=>a.retryLogin),e=oe(a=>a.client),o=Re(),s=v.useCallback(()=>{o.invalidateQueries({queryKey:_t.providerAuthList()}),o.invalidateQueries({queryKey:_t.providerModelsAll()})},[o]);return!t||!e?null:l.jsx(Dn,{provider:t.provider,providerName:t.providerName,authType:t.authType,controller:t.controller,client:e,onCancel:n,onClear:i,onRetry:r,onSuccess:s},`${t.provider}:${t.authType}:${t.attempt}`)}function Dn({provider:t,providerName:n,authType:i,controller:r,client:e,onCancel:o,onClear:s,onRetry:a,onSuccess:u}){var I,y,B,C;const[c,m]=v.useReducer(xe,_e(t,i)),E=v.useRef(null),S=v.useRef(!1),h=v.useRef(!1),[_,d]=v.useState(""),[P,A]=v.useState(null);v.useEffect(()=>(h.current=!0,S.current||(S.current=!0,e.loginProvider(t,i,{prompt:f=>new Promise((j,q)=>{var Y;E.current={promptId:f.promptId,resolve:j,reject:q},m({kind:"prompt",...f}),(Y=f.signal)==null||Y.addEventListener("abort",()=>{var H;((H=E.current)==null?void 0:H.promptId)===f.promptId&&(E.current=null),d(""),m({kind:"prompt_cancelled",promptId:f.promptId})},{once:!0})}),onEvent:f=>m(f)},{signal:r.signal}).then(f=>{h.current&&m({kind:"done",ok:f.ok,error:f.error})}).catch(f=>{h.current&&m({kind:"done",ok:!1,error:f instanceof Error?f.message:String(f)})})),()=>{var f;h.current=!1,(f=E.current)==null||f.reject(new Error("login dialog closed")),E.current=null}),[]),v.useEffect(()=>{var j;if(c.phase!=="done"||!((j=c.result)!=null&&j.ok))return;u();const f=setTimeout(s,vn);return()=>clearTimeout(f)},[c.phase,(I=c.result)==null?void 0:I.ok,u,s]);function L(f){const j=E.current;j&&(E.current=null,A(j.promptId),d(""),j.resolve(f))}function b(f){f.preventDefault(),L(_)}function R(f){f||(c.phase==="done"?s():o())}const M=c.phase==="done",p=M&&((y=c.result)==null?void 0:y.ok)===!0,N=M&&((B=c.result)==null?void 0:B.ok)===!1,w=c.phase==="prompt"&&c.prompt&&c.prompt.promptId!==P?c.prompt:void 0,g=w&&w.promptKind!=="select"?w:void 0;return l.jsx(ie,{open:!0,onOpenChange:R,title:`Log in to ${n}`,width:480,footer:M?l.jsxs(l.Fragment,{children:[l.jsx(G,{variant:"ghost",onClick:s,children:"Close"}),N&&l.jsx(G,{onClick:a,children:"Try again"})]}):l.jsxs(l.Fragment,{children:[l.jsx(G,{variant:"ghost",onClick:o,children:"Cancel"}),g&&l.jsx(G,{type:"submit",form:fe,children:"Submit"})]}),children:l.jsxs("div",{className:T.body,children:[l.jsx(xn,{state:c}),!M&&c.authUrl&&l.jsx(qn,{authUrl:c.authUrl,showInstructions:!g}),!M&&c.deviceCode&&l.jsx(zn,{deviceCode:c.deviceCode,stopped:M}),w&&l.jsx(kn,{prompt:w,inputValue:_,onInputChange:d,onTextSubmit:b,onSelect:L}),p&&l.jsx("p",{className:T.success,children:"Signed in. Closing…"}),N&&l.jsx("p",{className:T.error,children:((C=c.result)==null?void 0:C.error)??"Login failed."})]})})}function xn({state:t}){return t.statusLines.length===0&&t.phase!=="starting"?null:l.jsxs("div",{className:T.status,children:[t.phase==="starting"&&l.jsxs("div",{className:T.statusLine,children:[l.jsx(It,{size:"sm"})," Starting…"]}),t.statusLines.map((n,i)=>{var r;return l.jsxs("div",{className:n.kind==="progress"?T.statusLineProgress:T.statusLine,children:[n.kind==="progress"&&l.jsx(It,{size:"sm"}),l.jsxs("span",{className:T.statusText,children:[l.jsx("span",{children:n.message}),(r=n.links)==null?void 0:r.map(e=>l.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",children:e.label??e.url},e.url))]})]},i)})]})}function kn({prompt:t,inputValue:n,onInputChange:i,onTextSubmit:r,onSelect:e}){var o;return t.promptKind==="select"?l.jsxs("div",{className:T.prompt,children:[l.jsx("p",{className:T.promptMessage,children:t.message}),l.jsx("div",{className:T.options,children:(o=t.options)==null?void 0:o.map(s=>l.jsxs("button",{type:"button",className:T.option,onClick:()=>e(s.id),children:[l.jsx("span",{className:T.optionLabel,children:s.label}),s.description&&l.jsx("span",{className:T.optionDescription,children:s.description})]},s.id))})]}):l.jsxs("form",{id:fe,className:T.prompt,onSubmit:r,children:[l.jsx("label",{className:T.promptMessage,htmlFor:"login-prompt-input",children:t.message}),l.jsx(Ce,{id:"login-prompt-input",autoFocus:!0,type:t.promptKind==="secret"?"password":"text",autoComplete:t.promptKind==="secret"?"off":void 0,"data-1p-ignore":t.promptKind==="secret"?"true":void 0,"data-lpignore":t.promptKind==="secret"?"true":void 0,"data-bwignore":t.promptKind==="secret"?"true":void 0,placeholder:t.placeholder,value:n,onChange:s=>i(s.target.value)})]})}const Un=1800;function he({value:t,label:n}){const[i,r]=v.useState(!1);return v.useEffect(()=>{if(!i)return;const e=setTimeout(()=>r(!1),Un);return()=>clearTimeout(e)},[i]),l.jsx(Ee,{size:"sm","aria-label":i?"Copied":n,title:i?"Copied":n,onClick:()=>{Ne(t).then(()=>r(!0),()=>r(!1))},children:i?l.jsx(be,{size:14}):l.jsx(Ae,{size:14})})}function qn({authUrl:t,showInstructions:n}){return l.jsxs("div",{className:T.oauth,children:[n&&t.instructions&&l.jsx("p",{className:T.oauthInstructions,children:t.instructions}),l.jsxs("div",{className:T.oauthMain,children:[l.jsxs("div",{className:T.oauthActions,children:[l.jsxs("a",{className:T.openButton,href:t.url,target:"_blank",rel:"noreferrer",children:[l.jsx(se,{size:14}),"Open login page"]}),l.jsxs("div",{className:T.urlRow,children:[l.jsx("span",{className:T.oauthUrl,children:t.url}),l.jsx(he,{value:t.url,label:"Copy link"})]})]}),l.jsxs("div",{className:T.oauthQr,children:[l.jsx(de,{value:t.url,label:"QR code for the provider's login page"}),l.jsx("span",{className:T.oauthQrCaption,children:"Scan on another device"})]})]})]})}function Fn(t){const n=Math.max(0,t),i=Math.floor(n/60),r=n%60;return`${i}:${String(r).padStart(2,"0")}`}function zn({deviceCode:t,stopped:n}){const[i,r]=v.useState(t.expiresInSeconds);return v.useEffect(()=>{if(n||t.expiresInSeconds===void 0)return;r(t.expiresInSeconds);const e=setInterval(()=>{r(o=>o===void 0?void 0:Math.max(0,o-1))},1e3);return()=>clearInterval(e)},[t.expiresInSeconds,n]),l.jsx("div",{className:T.oauth,children:l.jsxs("div",{className:T.oauthMain,children:[l.jsxs("div",{className:T.oauthActions,children:[l.jsx("span",{className:T.oauthInstructions,children:"Enter this code at the verification page"}),l.jsxs("div",{className:T.urlRow,children:[l.jsx("span",{className:T.deviceCode,children:t.userCode}),l.jsx(he,{value:t.userCode,label:"Copy code"})]}),l.jsxs("a",{className:T.openButton,href:t.verificationUri,target:"_blank",rel:"noreferrer",children:[l.jsx(se,{size:14}),"Open verification page"]}),i!==void 0&&l.jsx("span",{className:T.countdown,children:i>0?`Expires in ${Fn(i)}`:"Code expired"})]}),l.jsxs("div",{className:T.oauthQr,children:[l.jsx(de,{value:t.verificationUri,label:"QR code for the verification page"}),l.jsx("span",{className:T.oauthQrCaption,children:"Scan on another device"})]})]})})}const Kn="_shell_13hat_7",Vn="_sidebar_13hat_14",On="_category_13hat_24",Hn="_categoryActive_13hat_44",Qn="_content_13hat_2",J={shell:Kn,sidebar:Vn,category:On,categoryActive:Hn,content:Qn};function er({open:t,onOpenChange:n}){var _;const i=oe(d=>d.serverInfo),r=O(d=>d.pendingLogin),e=O(d=>d.cancelLogin),o=Be(i==null?void 0:i.features),s=Se.filter(d=>d.available(o)),[a,u]=v.useState((_=s[0])==null?void 0:_.id);v.useEffect(()=>{var d;s.some(P=>P.id===a)||u((d=s[0])==null?void 0:d.id)},[s.map(d=>d.id).join(",")]);const c=s.find(d=>d.id===a)??s[0],m=c==null?void 0:c.component;function E(d){!d&&r&&e(),n(d)}function S(d){if(r){d.preventDefault();return}const P=d.detail.originalEvent.target;P instanceof Node&&!P.isConnected&&d.preventDefault()}function h(d){r&&d.preventDefault()}return l.jsxs(l.Fragment,{children:[l.jsx(ie,{open:t,onOpenChange:E,title:"Settings",width:900,onInteractOutside:S,onEscapeKeyDown:h,children:l.jsxs("div",{className:J.shell,children:[l.jsx("nav",{className:J.sidebar,children:s.map(d=>l.jsxs("button",{type:"button",className:ye(J.category,d.id===(c==null?void 0:c.id)&&J.categoryActive),onClick:()=>u(d.id),children:[l.jsx(Ie,{icon:d.icon,size:"sm"}),d.label]},d.id))}),l.jsx("div",{className:J.content,children:m?l.jsx(v.Suspense,{fallback:l.jsxs(Lt,{children:[l.jsx(It,{size:"sm"})," Loading…"]}),children:l.jsx(m,{})}):l.jsx(Lt,{children:"No settings categories available."})})]})}),l.jsx(jn,{})]})}export{er as SettingsDialog};