turtlecode 0.1.1 → 0.1.5

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 (103) hide show
  1. package/assets/assets/{_basePickBy-BcOvpC5b.js → _basePickBy-Cbr9kF3W.js} +1 -1
  2. package/assets/assets/{_baseUniq-D9AKNI-S.js → _baseUniq-90p3K5mX.js} +1 -1
  3. package/assets/assets/{arc-ClcBVsDq.js → arc-zwceMo7E.js} +1 -1
  4. package/assets/assets/{architectureDiagram-2XIMDMQ5-CRV28Qi0.js → architectureDiagram-2XIMDMQ5-DTVoAXan.js} +1 -1
  5. package/assets/assets/{auth-callback-D7CK9pHp.js → auth-callback-DDriykxK.js} +1 -1
  6. package/assets/assets/{blockDiagram-WCTKOSBZ-CL-sI8NU.js → blockDiagram-WCTKOSBZ-BSWFoRB4.js} +1 -1
  7. package/assets/assets/{c4Diagram-IC4MRINW-AFG5p1yt.js → c4Diagram-IC4MRINW-DMGytLY0.js} +1 -1
  8. package/assets/assets/channel-Dt5bKHJY.js +1 -0
  9. package/assets/assets/{chunk-4BX2VUAB-CgNy2Qqu.js → chunk-4BX2VUAB-DK5USEsv.js} +1 -1
  10. package/assets/assets/{chunk-55IACEB6-Bsz0SHtO.js → chunk-55IACEB6-Dwuz2gci.js} +1 -1
  11. package/assets/assets/{chunk-FMBD7UC4-BRuwu34q.js → chunk-FMBD7UC4-D3Ar5GCw.js} +1 -1
  12. package/assets/assets/{chunk-JSJVCQXG-Bt0GkrjS.js → chunk-JSJVCQXG-BsqvZqFi.js} +1 -1
  13. package/assets/assets/{chunk-KX2RTZJC-BiUvn-D7.js → chunk-KX2RTZJC-BEGDcj79.js} +1 -1
  14. package/assets/assets/{chunk-NQ4KR5QH-DH4YUQE9.js → chunk-NQ4KR5QH-DIhUZLGW.js} +1 -1
  15. package/assets/assets/{chunk-QZHKN3VN-CrLB363X.js → chunk-QZHKN3VN-BayZzXcy.js} +1 -1
  16. package/assets/assets/{chunk-VVM5DH6Z-D2vG_ZPx.js → chunk-VVM5DH6Z-CUl6IXI5.js} +1 -1
  17. package/assets/assets/{chunk-WL4C6EOR-913dgDB-.js → chunk-WL4C6EOR-vhjolSEq.js} +1 -1
  18. package/assets/assets/classDiagram-VBA2DB6C-DnXPRHLd.js +1 -0
  19. package/assets/assets/classDiagram-v2-RAHNMMFH-DnXPRHLd.js +1 -0
  20. package/assets/assets/clone-CbaHYGYw.js +1 -0
  21. package/assets/assets/{connection-popover-D2MEtT6z.js → connection-popover-CEFQbPWK.js} +1 -1
  22. package/assets/assets/{context-popover-C1ZDT4aK.js → context-popover-CKXEgeIh.js} +1 -1
  23. package/assets/assets/{cose-bilkent-S5V4N54A-DRWnwV5H.js → cose-bilkent-S5V4N54A--B-DQXvI.js} +1 -1
  24. package/assets/assets/{cssMode-DX-s2EC8.js → cssMode-CWSvB3aC.js} +1 -1
  25. package/assets/assets/{dagre-KLK3FWXG-CN4ule0l.js → dagre-KLK3FWXG-DY0eSi8o.js} +1 -1
  26. package/assets/assets/{diagram-E7M64L7V-docJyJu4.js → diagram-E7M64L7V-CbCSS_sV.js} +1 -1
  27. package/assets/assets/{diagram-IFDJBPK2-ChVpZldk.js → diagram-IFDJBPK2-NUrmqese.js} +1 -1
  28. package/assets/assets/{diagram-P4PSJMXO-Bf1-kRnd.js → diagram-P4PSJMXO-CbqxmMLJ.js} +1 -1
  29. package/assets/assets/{dialog-clone-project-B1wF7jYQ.js → dialog-clone-project-BRaGZzJN.js} +1 -1
  30. package/assets/assets/{dialog-connect-provider-Ot6Qr5dL.js → dialog-connect-provider-DpPISveC.js} +2 -2
  31. package/assets/assets/{dialog-create-project-BUc4DxX6.js → dialog-create-project-a3Uo_guc.js} +1 -1
  32. package/assets/assets/{dialog-edit-project-BrkjzrGe.js → dialog-edit-project-CgJu_xty.js} +1 -1
  33. package/assets/assets/{dialog-fork-CyeKjf0e.js → dialog-fork-CmIIdrc_.js} +1 -1
  34. package/assets/assets/{dialog-manage-models-CoiwPdu-.js → dialog-manage-models-YoikGlYY.js} +1 -1
  35. package/assets/assets/{dialog-select-directory-K0nOY5Ky.js → dialog-select-directory-D7DAqsnF.js} +3 -3
  36. package/assets/assets/{dialog-select-file-Dx0Bny2E.js → dialog-select-file-DfsyN5Rc.js} +1 -1
  37. package/assets/assets/{dialog-select-mcp-ehJzhdpz.js → dialog-select-mcp-BURynziq.js} +1 -1
  38. package/assets/assets/{dialog-select-model-unpaid-IVl97Sa_.js → dialog-select-model-unpaid-DKgrX02q.js} +2 -2
  39. package/assets/assets/{dialog-select-provider-CBq6hNDx.js → dialog-select-provider-0ixbAs1U.js} +1 -1
  40. package/assets/assets/{dialog-select-server-DA5hATxx.js → dialog-select-server-DgqWEODB.js} +1 -1
  41. package/assets/assets/{dialog-settings-BoOPbXZp.js → dialog-settings-BZpXHdr7.js} +1 -1
  42. package/assets/assets/{erDiagram-INFDFZHY-kDj6gvOH.js → erDiagram-INFDFZHY-C-XwpEYU.js} +1 -1
  43. package/assets/assets/{file-icon-DVEMs7Sx.js → file-icon-lmIpAi7j.js} +1 -1
  44. package/assets/assets/{flowDiagram-PKNHOUZH-CsQeJUub.js → flowDiagram-PKNHOUZH-CNyRmJrg.js} +1 -1
  45. package/assets/assets/{freemarker2-B_-gEFnj.js → freemarker2-aAsBprVy.js} +1 -1
  46. package/assets/assets/{ganttDiagram-A5KZAMGK-D1W7NciY.js → ganttDiagram-A5KZAMGK-VDRJPysM.js} +1 -1
  47. package/assets/assets/{ghostty-web-BQl0ls6m.js → ghostty-web-CDoiu3Yc.js} +1 -1
  48. package/assets/assets/{gitGraphDiagram-K3NZZRJ6-D4eeLV-l.js → gitGraphDiagram-K3NZZRJ6-yqJaE10b.js} +1 -1
  49. package/assets/assets/{graph-KGuLNbW2.js → graph-Blkyeyzn.js} +1 -1
  50. package/assets/assets/{handlebars-DlnQtQmF.js → handlebars-B9y9KVva.js} +1 -1
  51. package/assets/assets/{home-BnHPimua.js → home-Dl-ohVE3.js} +1 -1
  52. package/assets/assets/{html-DrjCwvQg.js → html-B4yimBtZ.js} +1 -1
  53. package/assets/assets/{htmlMode-C1xX0YwN.js → htmlMode-XkoEE1Us.js} +1 -1
  54. package/assets/assets/{index-DTxAHLat.css → index-9-q5x_AZ.css} +1 -1
  55. package/assets/assets/{index-DKwABhnu.js → index-Dxo83Gsl.js} +4 -4
  56. package/assets/assets/{infoDiagram-LFFYTUFH-DsQ9EVx0.js → infoDiagram-LFFYTUFH-C1FkzzLJ.js} +1 -1
  57. package/assets/assets/{ishikawaDiagram-PHBUUO56-MzetUfFK.js → ishikawaDiagram-PHBUUO56-SVTYyzMy.js} +1 -1
  58. package/assets/assets/{javascript-CBQQIA5q.js → javascript-xyQKZDGW.js} +1 -1
  59. package/assets/assets/{jobs-popover-DQmVz-e0.js → jobs-popover-BAyLs5rR.js} +1 -1
  60. package/assets/assets/{journeyDiagram-4ABVD52K-BkKgSN_9.js → journeyDiagram-4ABVD52K-CftC00L0.js} +1 -1
  61. package/assets/assets/{jsonMode-B2Ye6w7y.js → jsonMode-PsmTZD9i.js} +1 -1
  62. package/assets/assets/{kanban-definition-K7BYSVSG-DIJz6AsI.js → kanban-definition-K7BYSVSG-D8rVztxr.js} +1 -1
  63. package/assets/assets/{layout-BZKpv2Gr.js → layout-DKRzsYmw.js} +1 -1
  64. package/assets/assets/{liquid-CQXVmj19.js → liquid-B5YkEln-.js} +1 -1
  65. package/assets/assets/{list-DPJi0fzr.js → list-IrfozpgY.js} +1 -1
  66. package/assets/assets/{mdx-QuCI1OJC.js → mdx-IAVXqYJ2.js} +1 -1
  67. package/assets/assets/{mermaid.core-bhqKFRxj.js → mermaid.core-D7ns-Nfl.js} +5 -5
  68. package/assets/assets/{mindmap-definition-YRQLILUH-CVv44i-B.js → mindmap-definition-YRQLILUH-Bzur0Tav.js} +1 -1
  69. package/assets/assets/{pieDiagram-SKSYHLDU-2ekrtn6z.js → pieDiagram-SKSYHLDU-BquIe11C.js} +1 -1
  70. package/assets/assets/{python-Bx2b-xP4.js → python-BcPmedha.js} +1 -1
  71. package/assets/assets/{quadrantDiagram-337W2JSQ-BoTofVsV.js → quadrantDiagram-337W2JSQ-DfIw-PhP.js} +1 -1
  72. package/assets/assets/{razor-2zgukQRj.js → razor-Dae0nPVH.js} +1 -1
  73. package/assets/assets/{requirementDiagram-Z7DCOOCP-LSodooxy.js → requirementDiagram-Z7DCOOCP-Cjlz-DEQ.js} +1 -1
  74. package/assets/assets/{sankeyDiagram-WA2Y5GQK-DUXSSMar.js → sankeyDiagram-WA2Y5GQK-bGfKg-Gi.js} +1 -1
  75. package/assets/assets/{select-BbwOgh1Q.js → select-COPHquWP.js} +1 -1
  76. package/assets/assets/{sequenceDiagram-2WXFIKYE-C01qZdHR.js → sequenceDiagram-2WXFIKYE-B5qLrUGE.js} +1 -1
  77. package/assets/assets/{server-row-mRVGCgvL.js → server-row-D1rDT8vK.js} +1 -1
  78. package/assets/assets/{session-BXKBDkSI.js → session-kVY7vYXa.js} +15 -15
  79. package/assets/assets/{stateDiagram-RAJIS63D-BuPj1Py4.js → stateDiagram-RAJIS63D-BEP_JgCk.js} +1 -1
  80. package/assets/assets/stateDiagram-v2-FVOUBMTO-DEd6U9Bm.js +1 -0
  81. package/assets/assets/{status-popover-body-9YRn8z8W.js → status-popover-body-BDnY5y5A.js} +2 -2
  82. package/assets/assets/{switch-CHySmW8J.js → switch-CDJuR31O.js} +1 -1
  83. package/assets/assets/{tabs-CKNlwTKd.js → tabs-IESTlWqJ.js} +1 -1
  84. package/assets/assets/{tag-C4xikCZp.js → tag-DjGMdUtp.js} +1 -1
  85. package/assets/assets/{timeline-definition-YZTLITO2-CPcDqVYw.js → timeline-definition-YZTLITO2-D6uWycI3.js} +1 -1
  86. package/assets/assets/{treemap-KZPCXAKY-Bin819KW.js → treemap-KZPCXAKY-DH-YINf4.js} +1 -1
  87. package/assets/assets/{trellis-Csm7WAqm.js → trellis-CGL9IdAb.js} +7 -7
  88. package/assets/assets/{trellis-badge-demo-nxtlIRoh.js → trellis-badge-demo-R0tqETOm.js} +1 -1
  89. package/assets/assets/{trellis-op-icon-CzIuo5X7.js → trellis-op-icon-7bLDDzgi.js} +1 -1
  90. package/assets/assets/{tsMode-qOM514sL.js → tsMode-C8IFzmUX.js} +1 -1
  91. package/assets/assets/{typescript-XOJMwr_m.js → typescript-BRzjXkWD.js} +1 -1
  92. package/assets/assets/{vennDiagram-LZ73GAT5-BDAdfrV5.js → vennDiagram-LZ73GAT5-CTkGiV8C.js} +1 -1
  93. package/assets/assets/{xml-BIwomT_0.js → xml-DwrPHn8a.js} +1 -1
  94. package/assets/assets/{xychartDiagram-JWTSCODW-Be2x0vdX.js → xychartDiagram-JWTSCODW-DYfMOVBa.js} +1 -1
  95. package/assets/assets/{yaml-BZMZa-4Z.js → yaml-D5NhyUmN.js} +1 -1
  96. package/assets/index.html +2 -2
  97. package/bin/cli.mjs +43 -3
  98. package/package.json +6 -2
  99. package/assets/assets/channel-BXqEQVGi.js +0 -1
  100. package/assets/assets/classDiagram-VBA2DB6C-gcpKg8SN.js +0 -1
  101. package/assets/assets/classDiagram-v2-RAHNMMFH-gcpKg8SN.js +0 -1
  102. package/assets/assets/clone-oMsF326O.js +0 -1
  103. package/assets/assets/stateDiagram-v2-FVOUBMTO-CjYACBI3.js +0 -1
@@ -1 +1 @@
1
- import{l as r,m as t,F as o,t as i}from"./index-DKwABhnu.js";import{T as n}from"./trellis-op-icon-CzIuo5X7.js";var v=i('<div class="min-h-dvh bg-background-base text-text-base flex items-center justify-center p-8"><div class="w-full max-w-4xl rounded-16 border border-border-weaker-base bg-surface-base p-8 shadow-lg"><div class="mb-6 flex flex-col gap-2"><div class="text-14-medium text-text-strong">Trellis op badge preview</div><div class="text-12-regular text-text-weak">Isolated route for testing the symbol and color mapping before we commit to it.</div></div><div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">'),m=i('<div class="rounded-12 border border-border-weaker-base bg-background-stronger/40 p-3">');const u=["vcs:fileAdd","vcs:fileModify","vcs:fileDelete","vcs:fileRename","vcs:branchCreate","vcs:branchDelete","vcs:milestoneCreate","vcs:checkpointCreate","vcs:issueCreate","vcs:issueUpdate","vcs:issueStart","vcs:issuePause","vcs:issueResume","vcs:issueClose","vcs:issueReopen","vcs:decisionRecord"];function p(){return(()=>{var e=v(),a=e.firstChild,l=a.firstChild,c=l.nextSibling;return r(c,t(o,{each:u,children:d=>(()=>{var s=m();return r(s,t(n,{kind:d})),s})()})),e})()}export{p as default};
1
+ import{l as r,m as t,F as o,t as i}from"./index-Dxo83Gsl.js";import{T as n}from"./trellis-op-icon-7bLDDzgi.js";var v=i('<div class="min-h-dvh bg-background-base text-text-base flex items-center justify-center p-8"><div class="w-full max-w-4xl rounded-16 border border-border-weaker-base bg-surface-base p-8 shadow-lg"><div class="mb-6 flex flex-col gap-2"><div class="text-14-medium text-text-strong">Trellis op badge preview</div><div class="text-12-regular text-text-weak">Isolated route for testing the symbol and color mapping before we commit to it.</div></div><div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">'),m=i('<div class="rounded-12 border border-border-weaker-base bg-background-stronger/40 p-3">');const u=["vcs:fileAdd","vcs:fileModify","vcs:fileDelete","vcs:fileRename","vcs:branchCreate","vcs:branchDelete","vcs:milestoneCreate","vcs:checkpointCreate","vcs:issueCreate","vcs:issueUpdate","vcs:issueStart","vcs:issuePause","vcs:issueResume","vcs:issueClose","vcs:issueReopen","vcs:decisionRecord"];function p(){return(()=>{var e=v(),a=e.firstChild,l=a.firstChild,c=l.nextSibling;return r(c,t(o,{each:u,children:d=>(()=>{var s=m();return r(s,t(n,{kind:d})),s})()})),e})()}export{p as default};
@@ -1 +1 @@
1
- import{l as r,m as u,I as d,q as b,x as v,y as f,t as x}from"./index-DKwABhnu.js";var m=x('<div><div></div><div class="text-12-medium text-text-strong">');const g={"vcs:fileAdd":"file","vcs:fileModify":"file","vcs:fileDelete":"file","vcs:fileRename":"file","vcs:branchCreate":"git-branch","vcs:branchDelete":"git-branch","vcs:milestoneCreate":"milestone","vcs:checkpointCreate":"checklist","vcs:issueCreate":"issue","vcs:issueUpdate":"issue","vcs:issueStart":"enter","vcs:issuePause":"stop","vcs:issueResume":"enter","vcs:issueClose":"check-small","vcs:issueReopen":"arrow-right","vcs:decisionRecord":"brain"},C={"vcs:fileAdd":"text-success-base","vcs:fileModify":"text-warning-base","vcs:fileDelete":"text-danger-base","vcs:fileRename":"text-info-base","vcs:branchCreate":"text-info-base","vcs:branchDelete":"text-danger-base","vcs:milestoneCreate":"text-accent-base","vcs:checkpointCreate":"text-accent-base","vcs:issueCreate":"text-info-base","vcs:issueUpdate":"text-warning-base","vcs:issueStart":"text-success-base","vcs:issuePause":"text-warning-base","vcs:issueResume":"text-success-base","vcs:issueClose":"text-success-base","vcs:issueReopen":"text-info-base","vcs:decisionRecord":"text-accent-base"};function l(e){return e.replace("vcs:","").replace(/([A-Z])/g," $1").trim()}function k(e){return(()=>{var t=m(),c=t.firstChild,o=c.nextSibling;return r(c,u(d,{get name(){return g[e.kind]??"dot"},size:"small"})),r(o,()=>l(e.kind)),b(s=>{var i=`flex items-center gap-2 ${e.class??""}`,a=l(e.kind),n=`shrink-0 ${C[e.kind]??"text-icon-weak"}`;return i!==s.e&&v(t,s.e=i),a!==s.t&&f(t,"title",s.t=a),n!==s.a&&v(c,s.a=n),s},{e:void 0,t:void 0,a:void 0}),t})()}export{k as T};
1
+ import{l as r,m as u,I as d,q as b,x as v,y as f,t as x}from"./index-Dxo83Gsl.js";var m=x('<div><div></div><div class="text-12-medium text-text-strong">');const g={"vcs:fileAdd":"file","vcs:fileModify":"file","vcs:fileDelete":"file","vcs:fileRename":"file","vcs:branchCreate":"git-branch","vcs:branchDelete":"git-branch","vcs:milestoneCreate":"milestone","vcs:checkpointCreate":"checklist","vcs:issueCreate":"issue","vcs:issueUpdate":"issue","vcs:issueStart":"enter","vcs:issuePause":"stop","vcs:issueResume":"enter","vcs:issueClose":"check-small","vcs:issueReopen":"arrow-right","vcs:decisionRecord":"brain"},C={"vcs:fileAdd":"text-success-base","vcs:fileModify":"text-warning-base","vcs:fileDelete":"text-danger-base","vcs:fileRename":"text-info-base","vcs:branchCreate":"text-info-base","vcs:branchDelete":"text-danger-base","vcs:milestoneCreate":"text-accent-base","vcs:checkpointCreate":"text-accent-base","vcs:issueCreate":"text-info-base","vcs:issueUpdate":"text-warning-base","vcs:issueStart":"text-success-base","vcs:issuePause":"text-warning-base","vcs:issueResume":"text-success-base","vcs:issueClose":"text-success-base","vcs:issueReopen":"text-info-base","vcs:decisionRecord":"text-accent-base"};function l(e){return e.replace("vcs:","").replace(/([A-Z])/g," $1").trim()}function k(e){return(()=>{var t=m(),c=t.firstChild,o=c.nextSibling;return r(c,u(d,{get name(){return g[e.kind]??"dot"},size:"small"})),r(o,()=>l(e.kind)),b(s=>{var i=`flex items-center gap-2 ${e.class??""}`,a=l(e.kind),n=`shrink-0 ${C[e.kind]??"text-icon-weak"}`;return i!==s.e&&v(t,s.e=i),a!==s.t&&f(t,"title",s.t=a),n!==s.a&&v(c,s.a=n),s},{e:void 0,t:void 0,a:void 0}),t})()}export{k as T};
@@ -1,4 +1,4 @@
1
- import{t as L,m as O}from"./trellis-Csm7WAqm.js";import"./index-DKwABhnu.js";import"./select-BbwOgh1Q.js";import"./chunk-VVM5DH6Z-D2vG_ZPx.js";import"./transform-BwXaE9hv.js";import"./trellis-op-icon-CzIuo5X7.js";/*!-----------------------------------------------------------------------------
1
+ import{t as L,m as O}from"./trellis-CGL9IdAb.js";import"./index-Dxo83Gsl.js";import"./select-COPHquWP.js";import"./chunk-VVM5DH6Z-CUl6IXI5.js";import"./transform-BwXaE9hv.js";import"./trellis-op-icon-7bLDDzgi.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as s}from"./trellis-Csm7WAqm.js";import"./index-DKwABhnu.js";import"./select-BbwOgh1Q.js";import"./chunk-VVM5DH6Z-D2vG_ZPx.js";import"./transform-BwXaE9hv.js";import"./trellis-op-icon-CzIuo5X7.js";/*!-----------------------------------------------------------------------------
1
+ import{m as s}from"./trellis-CGL9IdAb.js";import"./index-Dxo83Gsl.js";import"./select-COPHquWP.js";import"./chunk-VVM5DH6Z-CUl6IXI5.js";import"./transform-BwXaE9hv.js";import"./trellis-op-icon-7bLDDzgi.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{aG as Ut,s as Wt,g as Kt,q as Ht,p as Yt,a as Xt,b as Zt,_ as w,G as wt,I as Jt,aq as Qt,ab as $t,ac as te,ad as ee,d as ne,y as se,E as ie,F as oe}from"./mermaid.core-bhqKFRxj.js";import{s as ot}from"./transform-BwXaE9hv.js";import"./index-DKwABhnu.js";const kt=(t,n)=>Ut(t,"a",-n),_t=1e-10;function st(t,n){const s=ae(t),e=s.filter(c=>re(c,t));let i=0,o=0;const a=[];if(e.length>1){const c=Tt(e);for(let u=0;u<e.length;++u){const r=e[u];r.angle=Math.atan2(r.x-c.x,r.y-c.y)}e.sort((u,r)=>r.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const r=e[u];o+=(h.x+r.x)*(r.y-h.y);const y={x:(r.x+h.x)/2,y:(r.y+h.y)/2};let d=null;for(let b=0;b<r.parentIndex.length;++b)if(h.parentIndex.includes(r.parentIndex[b])){const x=t[r.parentIndex[b]],M=Math.atan2(r.x-x.x,r.y-x.y),A=Math.atan2(h.x-x.x,h.y-x.y);let E=A-M;E<0&&(E+=2*Math.PI);const S=A-E/2;let g=q(y,{x:x.x+x.radius*Math.sin(S),y:x.y+x.radius*Math.cos(S)});g>x.radius*2&&(g=x.radius*2),(d==null||d.width>g)&&(d={circle:x,width:g,p1:r,p2:h,large:g>x.radius,sweep:!0})}d!=null&&(a.push(d),i+=lt(d.circle.radius,d.width),h=r)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(q(t[u],c)>Math.abs(c.radius-t[u].radius)){h=!0;break}h?i=o=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-_t,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+o}function re(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function ae(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Et(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(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 Et(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),a=Math.sqrt(e*e-o*o),c=t.x+o*(n.x-t.x)/s,h=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(a/s),r=-(n.x-t.x)*(a/s);return[{x:c+u,y:h-r},{x:c-u,y:h+r}]}function Tt(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 le(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,a=t(n),c=t(s);let h=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let u=0;u<i;++u){h/=2;const r=n+h,y=t(r);if(y*a>=0&&(n=r),Math.abs(h)<o||y===0)return r}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 $(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($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,a=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,r=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let d;const b=n.length,x=new Array(b+1);x[0]=n,x[0].fx=t(n),x[0].id=0;for(let v=0;v<b;++v){const l=n.slice();l[v]=l[v]?l[v]*i:o,x[v+1]=l,x[v+1].fx=t(l),x[v+1].id=v+1}function M(v){for(let l=0;l<v.length;l++)x[b][l]=v[l];x[b].fx=v.fx}const A=(v,l)=>v.fx-l.fx,E=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(x.sort(A),s.history){const p=x.map(f=>{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});p.sort((f,N)=>f.id-N.id),s.history.push({x:x[0].slice(),fx:x[0].fx,simplex:p})}d=0;for(let p=0;p<b;++p)d=Math.max(d,Math.abs(x[0][p]-x[1][p]));if(Math.abs(x[0].fx-x[b].fx)<a&&d<c)break;for(let p=0;p<b;++p){E[p]=0;for(let f=0;f<b;++f)E[p]+=x[f][p];E[p]/=b}const l=x[b];if(J(S,1+h,E,-h,l),S.fx=t(S),S.fx<x[0].fx)J(m,1+u,E,-u,l),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=x[b-1].fx){let p=!1;if(S.fx>l.fx?(J(g,1+r,E,-r,l),g.fx=t(g),g.fx<l.fx?M(g):p=!0):(J(g,1-r*h,E,r*h,l),g.fx=t(g),g.fx<S.fx?M(g):p=!0),p){if(y>=1)break;for(let f=1;f<x.length;++f)J(x[f],1-y,x[0],y,x[f]),x[f].fx=t(x[f])}}else M(S)}return x.sort(A),{fx:x[0].fx,x:x[0]}}function ce(t,n,s,e,i,o,a){const c=s.fx,h=$(s.fxprime,n);let u=c,r=c,y=h,d=0;i=i||1,o=o||1e-6,a=a||.1;function b(x,M,A){for(let E=0;E<16;++E)if(i=(x+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||u>=A)M=i;else{if(Math.abs(y)<=-a*h)return i;y*(M-x)>=0&&(M=x),x=i,A=u}return 0}for(let x=0;x<10;++x){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||x&&u>=r)return b(d,i,r);if(Math.abs(y)<=-a*h)return i;if(y>=0)return b(i,d,u);r=u,d=i,i*=2}return i}function ue(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let a,c,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),ft(a,e.fxprime,-1);for(let r=0;r<u;++r){if(h=ce(t,a,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ft(a,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),d=Math.max(0,$(o,i.fxprime)/y);J(a,d,a,-1,i.fxprime),c=e,e=i,i=c}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||ge,e=n.lossFunction||tt,i=fe(t,n),o=s(i,n),a=Object.keys(o),c=[];for(const r of a)c.push(o[r].x),c.push(o[r].y);const u=zt(r=>{const y={};for(let d=0;d<a.length;++d){const b=a[d];y[b]={x:r[2*d],y:r[2*d+1],radius:o[b].radius}}return e(y,i)},c,n).x;for(let r=0;r<a.length;++r){const y=a[r];o[y].x=u[2*r],o[y].y=u[2*r+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):le(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const r=String(h.sets[u]);c.set(r,h.size+(c.get(r)||0));for(let y=u+1;y<h.sets.length;y++){const d=String(h.sets[y]),b=`${r};${d}`,x=`${d};${r}`;c.set(b,h.size+(c.get(b)||0)),c.set(x,h.size+(c.get(x)||0))}}for(const h of e)h.sets.length<3&&(h.size=c.get(i(h.sets)))}const o=[],a=new Set;for(const c of e)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){const h=c.sets[0],u=c.sets[1];a.add(i(c.sets)),a.add(i([u,h]))}o.sort((c,h)=>c===h?0:c<h?-1:1);for(let c=0;c<o.length;++c){const h=o[c];for(let u=c+1;u<o.length;++u){const r=o[u];a.has(i([h,r]))||e.push({sets:[h,r],size:0})}}return e}function he(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const a=s[o.sets[0]],c=s[o.sets[1]],h=Math.sqrt(n[a].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),r=ht(h,u,o.size);e[a][c]=e[c][a]=r;let y=0;o.size+1e-10>=Math.min(n[a].size,n[c].size)?y=1:o.size<=1e-10&&(y=-1),i[a][c]=i[c][a]=y}),{distances:e,constraints:i}}function de(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const a=t[2*o],c=t[2*o+1];for(let h=o+1;h<s.length;++h){const u=t[2*h],r=t[2*h+1],y=s[o][h],d=e[o][h],b=(u-a)*(u-a)+(r-c)*(r-c),x=Math.sqrt(b),M=b-y*y;d>0&&x<=y||d<0&&x>=y||(i+=2*M*M,n[2*o]+=4*M*(a-u),n[2*o+1]+=4*M*(c-r),n[2*h]+=4*M*(u-a),n[2*h+1]+=4*M*(r-c))}}return i}function ge(t,n={}){let s=ye(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=xe(t,n),o=e(i,t),a=e(s,t);o+1e-8<a&&(s=i)}return s}function xe(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:o,constraints:a}=he(t,e,i);const c=ut(o.map(ut))/o.length;o=o.map(d=>d.map(b=>b/c));const h=(d,b)=>de(d,b,o,a);let u=null;for(let d=0;d<s;++d){const b=ct(o.length*2).map(Math.random),x=ue(h,b,n);(!u||x.fx<u.fx)&&(u=x)}const r=u.x,y={};for(let d=0;d<e.length;++d){const b=e[d];y[b.sets[0]]={x:r[2*d]*c,y:r[2*d+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const d of n.history)ft(d.x,c);return y}function ye(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const d=y.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[d]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let d=y.weight!=null?y.weight:1;const b=y.sets[0],x=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[x].size)&&(d=0),i[b].push({set:x,size:y.size,weight:d}),i[x].push({set:b,size:y.size,weight:d})}const o=[];Object.keys(i).forEach(y=>{let d=0;for(let b=0;b<i[y].length;++b)d+=i[y][b].size*i[y][b].weight;o.push({set:y,size:d})});function a(y,d){return d.size-y.size}o.sort(a);const c={};function h(y){return y.set in c}function u(y,d){e[d].x=y.x,e[d].y=y.y,c[d]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const d=o[y].set,b=i[d].filter(h),x=e[d];if(b.sort(a),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var r=0;r<b.length;++r){const S=e[b[r].set],g=ht(x.radius,S.radius,b[r].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=r+1;m<b.length;++m){const v=e[b[m].set],l=ht(x.radius,v.radius,b[m].size),p=Et({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:l});M.push(...p)}}let A=1e50,E=M[0];for(const S of M){e[d].x=S.x,e[d].y=S.y;const g=s(e,t);g<A&&(A=g,E=S)}u(E,d)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const a=t[e.sets[0]],c=t[e.sets[1]];i=xt(a.radius,c.radius,q(a,c))}else i=st(e.sets.map(a=>t[a]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],h=t[e.sets[1]];i=xt(c.radius,h.radius,q(c,h))}else i=st(e.sets.map(c=>t[c]));const o=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=o*a*a}return s}function pe(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const a of t)a.x-=i,a.y-=o}if(t.length===2&&q(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,o=Math.cos(i),a=Math.sin(i);for(const c of t){const h=c.x,u=c.y;c.x=o*h-a*u,c.y=a*h+o*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 o=t[1].y/(1e-10+t[1].x);for(const a of t){var e=(a.x+o*a.y)/(1+o*o);a.x=2*e-a.x,a.y=2*e*o-a.y}}}}function me(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const a=n(i),c=n(o);a.parent=c}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const a=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<a&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,a)=>Math.max(o,a[s]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,a)=>Math.min(o,a[s]-a.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=me(e);for(const u of i){pe(u,n,s);const r=dt(u);u.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),u.bounds=r}i.sort((u,r)=>r.size-u.size),e=i[0];let o=e.bounds;const a=(o.xRange.max-o.xRange.min)/50;function c(u,r,y){if(!u)return;const d=u.bounds;let b,x;if(r)b=o.xRange.max-d.xRange.min+a;else{b=o.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)x=o.yRange.max-d.yRange.min+a;else{x=o.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(x+=M)}for(const M of u)M.x+=b,M.y+=x,e.push(M)}let h=1;for(;h<i.length;)c(i[h],!0,!1),c(i[h+1],!1,!0),c(i[h+2],!0,!0),h+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:a,yRange:c}=dt(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const b=Math.sqrt(i/Math.PI)*2;h=n/b,u=s/b}else h=n/(a.max-a.min),u=s/(c.max-c.min);const r=Math.min(u,h),y=(n-(a.max-a.min)*r)/2,d=(s-(c.max-c.min)*r)/2;return Ot(o.map(b=>({radius:r*b.radius,x:e+y+(b.x-a.min)*r,y:e+d+(b.y-c.min)*r,setid:b.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 be(t={}){let n=!1,s=600,e=350,i=15,o=1e3,a=Math.PI/2,c=!0,h=null,u=!0,r=!0,y=null,d=null,b=!1,x=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,A={},E=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(p){if(p in A)return A[p];var f=A[p]=E[S];return S+=1,S>=E.length&&(S=0),f},m=At,v=tt;function l(p){let f=p.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(F=>N.has(F)));let I={},C={};if(f.length>0){let k=m(f,{lossFunction:v,distinct:b});c&&(k=Dt(k,a,d)),I=Nt(k,s,e,i,h),C=jt(I,f,M)}const G={};f.forEach(k=>{k.label&&(G[k.sets]=k.label)});function j(k){if(k.sets in G)return G[k.sets];if(k.sets.length==1)return""+k.sets[0]}p.selectAll("svg").data([I]).enter().append("svg");const T=p.select("svg");n?T.attr("viewBox",`0 0 ${s} ${e}`):T.attr("width",s).attr("height",e);const R={};let _=!1;T.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(_=!0,R[k.sets[0]]=ke(F))});function P(k){return F=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,x)}}const V=T.selectAll(".venn-area").data(f,k=>k.sets),O=V.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=O.append("path"),W=O.append("text").attr("class","label").text(k=>j(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);r&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),W.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=p;_&&typeof z.transition=="function"?(z=K(p),z.selectAll("path").attrTween("d",P)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),x);const L=z.selectAll("text").filter(k=>k.sets in C).text(k=>j(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(_?"on"in L?L.on("end",rt(I,j)):L.each("end",rt(I,j)):L.each(rt(I,j)));const D=K(V.exit()).remove();typeof V.transition=="function"&&D.selectAll("path").attrTween("d",P);const X=D.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),L.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:V,enter:O,update:z,exit:D}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(b=p,l):b},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(y=p,l):y},l.round=function(p){return arguments.length?(x=p,l):x},l.duration=function(p){return arguments.length?(o=p,l):o},l.layoutFunction=function(p){return arguments.length?(m=p,l):m},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(h=p,l):h},l.styled=function(p){return arguments.length?(r=p,l):r},l.orientation=function(p){return arguments.length?(a=p,l):a},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(v=p==="default"?tt:p==="logRatio"?Ct:p,l):v},l}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",a=o.split(/\s+/).reverse(),h=(o.length+a.length)/3;let u=a.pop(),r=[u],y=0;const d=1.1;e.textContent=null;const b=[];function x(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=x(u);for(;u=a.pop(),!!u;){r.push(u);const g=r.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(r.pop(),M.textContent=r.join(" "),r=[u],M=x(u),y++)}const A=.35-y*d/2,E=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",E),g.setAttribute("y",S),g.setAttribute("dy",`${A+m*d}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Lt(t,n,s){const e=[];for(const r of t)e.push({x:r.x,y:r.y}),e.push({x:r.x+r.radius/2,y:r.y}),e.push({x:r.x-r.radius/2,y:r.y}),e.push({x:r.x,y:r.y+r.radius/2}),e.push({x:r.x,y:r.y-r.radius/2});let i=e[0],o=at(e[0],t,n);for(let r=1;r<e.length;++r){const y=at(e[r],t,n);y>=o&&(i=e[r],o=y)}const a=zt(r=>-1*at({x:r[0],y:r[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let h=!0;for(const r of t)if(q(c,r)>r.radius){h=!1;break}for(const r of n)if(q(c,r)<r.radius){h=!1;break}if(h)return c;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?Lt(t,[]):Tt(u.arcs.map(r=>r.p1))}function ve(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],o=t[i];for(let a=e+1;a<s.length;++a){const c=s[a],h=t[c],u=q(o,h);u+h.radius<=o.radius+1e-10?n[c].push(i):u+o.radius<=h.radius+1e-10&&n[i].push(c)}}return n}function jt(t,n,s){const e={},i=ve(t);for(let o=0;o<n.length;++o){const a=n[o].sets,c={},h={};for(let d=0;d<a.length;++d){c[a[d]]=!0;const b=i[a[d]];for(let x=0;x<b.length;++x)h[b[x]]=!0}const u=[],r=[];for(let d in t)d in c?u.push(t[d]):d in h||r.push(t[d]);const y=Lt(u,r,s);e[a]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
1
+ import{aG as Ut,s as Wt,g as Kt,q as Ht,p as Yt,a as Xt,b as Zt,_ as w,G as wt,I as Jt,aq as Qt,ab as $t,ac as te,ad as ee,d as ne,y as se,E as ie,F as oe}from"./mermaid.core-D7ns-Nfl.js";import{s as ot}from"./transform-BwXaE9hv.js";import"./index-Dxo83Gsl.js";const kt=(t,n)=>Ut(t,"a",-n),_t=1e-10;function st(t,n){const s=ae(t),e=s.filter(c=>re(c,t));let i=0,o=0;const a=[];if(e.length>1){const c=Tt(e);for(let u=0;u<e.length;++u){const r=e[u];r.angle=Math.atan2(r.x-c.x,r.y-c.y)}e.sort((u,r)=>r.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const r=e[u];o+=(h.x+r.x)*(r.y-h.y);const y={x:(r.x+h.x)/2,y:(r.y+h.y)/2};let d=null;for(let b=0;b<r.parentIndex.length;++b)if(h.parentIndex.includes(r.parentIndex[b])){const x=t[r.parentIndex[b]],M=Math.atan2(r.x-x.x,r.y-x.y),A=Math.atan2(h.x-x.x,h.y-x.y);let E=A-M;E<0&&(E+=2*Math.PI);const S=A-E/2;let g=q(y,{x:x.x+x.radius*Math.sin(S),y:x.y+x.radius*Math.cos(S)});g>x.radius*2&&(g=x.radius*2),(d==null||d.width>g)&&(d={circle:x,width:g,p1:r,p2:h,large:g>x.radius,sweep:!0})}d!=null&&(a.push(d),i+=lt(d.circle.radius,d.width),h=r)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(q(t[u],c)>Math.abs(c.radius-t[u].radius)){h=!0;break}h?i=o=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-_t,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+o}function re(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function ae(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Et(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(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 Et(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),a=Math.sqrt(e*e-o*o),c=t.x+o*(n.x-t.x)/s,h=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(a/s),r=-(n.x-t.x)*(a/s);return[{x:c+u,y:h-r},{x:c-u,y:h+r}]}function Tt(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 le(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,a=t(n),c=t(s);let h=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let u=0;u<i;++u){h/=2;const r=n+h,y=t(r);if(y*a>=0&&(n=r),Math.abs(h)<o||y===0)return r}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 $(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($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,a=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,r=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let d;const b=n.length,x=new Array(b+1);x[0]=n,x[0].fx=t(n),x[0].id=0;for(let v=0;v<b;++v){const l=n.slice();l[v]=l[v]?l[v]*i:o,x[v+1]=l,x[v+1].fx=t(l),x[v+1].id=v+1}function M(v){for(let l=0;l<v.length;l++)x[b][l]=v[l];x[b].fx=v.fx}const A=(v,l)=>v.fx-l.fx,E=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(x.sort(A),s.history){const p=x.map(f=>{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});p.sort((f,N)=>f.id-N.id),s.history.push({x:x[0].slice(),fx:x[0].fx,simplex:p})}d=0;for(let p=0;p<b;++p)d=Math.max(d,Math.abs(x[0][p]-x[1][p]));if(Math.abs(x[0].fx-x[b].fx)<a&&d<c)break;for(let p=0;p<b;++p){E[p]=0;for(let f=0;f<b;++f)E[p]+=x[f][p];E[p]/=b}const l=x[b];if(J(S,1+h,E,-h,l),S.fx=t(S),S.fx<x[0].fx)J(m,1+u,E,-u,l),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=x[b-1].fx){let p=!1;if(S.fx>l.fx?(J(g,1+r,E,-r,l),g.fx=t(g),g.fx<l.fx?M(g):p=!0):(J(g,1-r*h,E,r*h,l),g.fx=t(g),g.fx<S.fx?M(g):p=!0),p){if(y>=1)break;for(let f=1;f<x.length;++f)J(x[f],1-y,x[0],y,x[f]),x[f].fx=t(x[f])}}else M(S)}return x.sort(A),{fx:x[0].fx,x:x[0]}}function ce(t,n,s,e,i,o,a){const c=s.fx,h=$(s.fxprime,n);let u=c,r=c,y=h,d=0;i=i||1,o=o||1e-6,a=a||.1;function b(x,M,A){for(let E=0;E<16;++E)if(i=(x+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||u>=A)M=i;else{if(Math.abs(y)<=-a*h)return i;y*(M-x)>=0&&(M=x),x=i,A=u}return 0}for(let x=0;x<10;++x){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>c+o*i*h||x&&u>=r)return b(d,i,r);if(Math.abs(y)<=-a*h)return i;if(y>=0)return b(i,d,u);r=u,d=i,i*=2}return i}function ue(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let a,c,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),ft(a,e.fxprime,-1);for(let r=0;r<u;++r){if(h=ce(t,a,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ft(a,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),d=Math.max(0,$(o,i.fxprime)/y);J(a,d,a,-1,i.fxprime),c=e,e=i,i=c}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||ge,e=n.lossFunction||tt,i=fe(t,n),o=s(i,n),a=Object.keys(o),c=[];for(const r of a)c.push(o[r].x),c.push(o[r].y);const u=zt(r=>{const y={};for(let d=0;d<a.length;++d){const b=a[d];y[b]={x:r[2*d],y:r[2*d+1],radius:o[b].radius}}return e(y,i)},c,n).x;for(let r=0;r<a.length;++r){const y=a[r];o[y].x=u[2*r],o[y].y=u[2*r+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):le(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const r=String(h.sets[u]);c.set(r,h.size+(c.get(r)||0));for(let y=u+1;y<h.sets.length;y++){const d=String(h.sets[y]),b=`${r};${d}`,x=`${d};${r}`;c.set(b,h.size+(c.get(b)||0)),c.set(x,h.size+(c.get(x)||0))}}for(const h of e)h.sets.length<3&&(h.size=c.get(i(h.sets)))}const o=[],a=new Set;for(const c of e)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){const h=c.sets[0],u=c.sets[1];a.add(i(c.sets)),a.add(i([u,h]))}o.sort((c,h)=>c===h?0:c<h?-1:1);for(let c=0;c<o.length;++c){const h=o[c];for(let u=c+1;u<o.length;++u){const r=o[u];a.has(i([h,r]))||e.push({sets:[h,r],size:0})}}return e}function he(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const a=s[o.sets[0]],c=s[o.sets[1]],h=Math.sqrt(n[a].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),r=ht(h,u,o.size);e[a][c]=e[c][a]=r;let y=0;o.size+1e-10>=Math.min(n[a].size,n[c].size)?y=1:o.size<=1e-10&&(y=-1),i[a][c]=i[c][a]=y}),{distances:e,constraints:i}}function de(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const a=t[2*o],c=t[2*o+1];for(let h=o+1;h<s.length;++h){const u=t[2*h],r=t[2*h+1],y=s[o][h],d=e[o][h],b=(u-a)*(u-a)+(r-c)*(r-c),x=Math.sqrt(b),M=b-y*y;d>0&&x<=y||d<0&&x>=y||(i+=2*M*M,n[2*o]+=4*M*(a-u),n[2*o+1]+=4*M*(c-r),n[2*h]+=4*M*(u-a),n[2*h+1]+=4*M*(r-c))}}return i}function ge(t,n={}){let s=ye(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=xe(t,n),o=e(i,t),a=e(s,t);o+1e-8<a&&(s=i)}return s}function xe(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:o,constraints:a}=he(t,e,i);const c=ut(o.map(ut))/o.length;o=o.map(d=>d.map(b=>b/c));const h=(d,b)=>de(d,b,o,a);let u=null;for(let d=0;d<s;++d){const b=ct(o.length*2).map(Math.random),x=ue(h,b,n);(!u||x.fx<u.fx)&&(u=x)}const r=u.x,y={};for(let d=0;d<e.length;++d){const b=e[d];y[b.sets[0]]={x:r[2*d]*c,y:r[2*d+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const d of n.history)ft(d.x,c);return y}function ye(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const d=y.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[d]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let d=y.weight!=null?y.weight:1;const b=y.sets[0],x=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[x].size)&&(d=0),i[b].push({set:x,size:y.size,weight:d}),i[x].push({set:b,size:y.size,weight:d})}const o=[];Object.keys(i).forEach(y=>{let d=0;for(let b=0;b<i[y].length;++b)d+=i[y][b].size*i[y][b].weight;o.push({set:y,size:d})});function a(y,d){return d.size-y.size}o.sort(a);const c={};function h(y){return y.set in c}function u(y,d){e[d].x=y.x,e[d].y=y.y,c[d]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const d=o[y].set,b=i[d].filter(h),x=e[d];if(b.sort(a),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var r=0;r<b.length;++r){const S=e[b[r].set],g=ht(x.radius,S.radius,b[r].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=r+1;m<b.length;++m){const v=e[b[m].set],l=ht(x.radius,v.radius,b[m].size),p=Et({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:l});M.push(...p)}}let A=1e50,E=M[0];for(const S of M){e[d].x=S.x,e[d].y=S.y;const g=s(e,t);g<A&&(A=g,E=S)}u(E,d)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const a=t[e.sets[0]],c=t[e.sets[1]];i=xt(a.radius,c.radius,q(a,c))}else i=st(e.sets.map(a=>t[a]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],h=t[e.sets[1]];i=xt(c.radius,h.radius,q(c,h))}else i=st(e.sets.map(c=>t[c]));const o=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=o*a*a}return s}function pe(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const a of t)a.x-=i,a.y-=o}if(t.length===2&&q(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,o=Math.cos(i),a=Math.sin(i);for(const c of t){const h=c.x,u=c.y;c.x=o*h-a*u,c.y=a*h+o*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 o=t[1].y/(1e-10+t[1].x);for(const a of t){var e=(a.x+o*a.y)/(1+o*o);a.x=2*e-a.x,a.y=2*e*o-a.y}}}}function me(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const a=n(i),c=n(o);a.parent=c}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const a=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<a&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,a)=>Math.max(o,a[s]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,a)=>Math.min(o,a[s]-a.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=me(e);for(const u of i){pe(u,n,s);const r=dt(u);u.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),u.bounds=r}i.sort((u,r)=>r.size-u.size),e=i[0];let o=e.bounds;const a=(o.xRange.max-o.xRange.min)/50;function c(u,r,y){if(!u)return;const d=u.bounds;let b,x;if(r)b=o.xRange.max-d.xRange.min+a;else{b=o.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)x=o.yRange.max-d.yRange.min+a;else{x=o.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(x+=M)}for(const M of u)M.x+=b,M.y+=x,e.push(M)}let h=1;for(;h<i.length;)c(i[h],!0,!1),c(i[h+1],!1,!0),c(i[h+2],!0,!0),h+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:a,yRange:c}=dt(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const b=Math.sqrt(i/Math.PI)*2;h=n/b,u=s/b}else h=n/(a.max-a.min),u=s/(c.max-c.min);const r=Math.min(u,h),y=(n-(a.max-a.min)*r)/2,d=(s-(c.max-c.min)*r)/2;return Ot(o.map(b=>({radius:r*b.radius,x:e+y+(b.x-a.min)*r,y:e+d+(b.y-c.min)*r,setid:b.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 be(t={}){let n=!1,s=600,e=350,i=15,o=1e3,a=Math.PI/2,c=!0,h=null,u=!0,r=!0,y=null,d=null,b=!1,x=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,A={},E=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(p){if(p in A)return A[p];var f=A[p]=E[S];return S+=1,S>=E.length&&(S=0),f},m=At,v=tt;function l(p){let f=p.datum();const N=new Set;f.forEach(k=>{k.size==0&&k.sets.length==1&&N.add(k.sets[0])}),f=f.filter(k=>!k.sets.some(F=>N.has(F)));let I={},C={};if(f.length>0){let k=m(f,{lossFunction:v,distinct:b});c&&(k=Dt(k,a,d)),I=Nt(k,s,e,i,h),C=jt(I,f,M)}const G={};f.forEach(k=>{k.label&&(G[k.sets]=k.label)});function j(k){if(k.sets in G)return G[k.sets];if(k.sets.length==1)return""+k.sets[0]}p.selectAll("svg").data([I]).enter().append("svg");const T=p.select("svg");n?T.attr("viewBox",`0 0 ${s} ${e}`):T.attr("width",s).attr("height",e);const R={};let _=!1;T.selectAll(".venn-area path").each(function(k){const F=this.getAttribute("d");k.sets.length==1&&F&&!b&&(_=!0,R[k.sets[0]]=ke(F))});function P(k){return F=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,x)}}const V=T.selectAll(".venn-area").data(f,k=>k.sets),O=V.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=O.append("path"),W=O.append("text").attr("class","label").text(k=>j(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);r&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),W.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=p;_&&typeof z.transition=="function"?(z=K(p),z.selectAll("path").attrTween("d",P)):z.selectAll("path").attr("d",k=>St(k.sets.map(F=>I[F])),x);const L=z.selectAll("text").filter(k=>k.sets in C).text(k=>j(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(_?"on"in L?L.on("end",rt(I,j)):L.each("end",rt(I,j)):L.each(rt(I,j)));const D=K(V.exit()).remove();typeof V.transition=="function"&&D.selectAll("path").attrTween("d",P);const X=D.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),L.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:V,enter:O,update:z,exit:D}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(b=p,l):b},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(y=p,l):y},l.round=function(p){return arguments.length?(x=p,l):x},l.duration=function(p){return arguments.length?(o=p,l):o},l.layoutFunction=function(p){return arguments.length?(m=p,l):m},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(h=p,l):h},l.styled=function(p){return arguments.length?(r=p,l):r},l.orientation=function(p){return arguments.length?(a=p,l):a},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(v=p==="default"?tt:p==="logRatio"?Ct:p,l):v},l}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",a=o.split(/\s+/).reverse(),h=(o.length+a.length)/3;let u=a.pop(),r=[u],y=0;const d=1.1;e.textContent=null;const b=[];function x(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=x(u);for(;u=a.pop(),!!u;){r.push(u);const g=r.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(r.pop(),M.textContent=r.join(" "),r=[u],M=x(u),y++)}const A=.35-y*d/2,E=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",E),g.setAttribute("y",S),g.setAttribute("dy",`${A+m*d}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Lt(t,n,s){const e=[];for(const r of t)e.push({x:r.x,y:r.y}),e.push({x:r.x+r.radius/2,y:r.y}),e.push({x:r.x-r.radius/2,y:r.y}),e.push({x:r.x,y:r.y+r.radius/2}),e.push({x:r.x,y:r.y-r.radius/2});let i=e[0],o=at(e[0],t,n);for(let r=1;r<e.length;++r){const y=at(e[r],t,n);y>=o&&(i=e[r],o=y)}const a=zt(r=>-1*at({x:r[0],y:r[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let h=!0;for(const r of t)if(q(c,r)>r.radius){h=!1;break}for(const r of n)if(q(c,r)<r.radius){h=!1;break}if(h)return c;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?Lt(t,[]):Tt(u.arcs.map(r=>r.p1))}function ve(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],o=t[i];for(let a=e+1;a<s.length;++a){const c=s[a],h=t[c],u=q(o,h);u+h.radius<=o.radius+1e-10?n[c].push(i):u+o.radius<=h.radius+1e-10&&n[i].push(c)}}return n}function jt(t,n,s){const e={},i=ve(t);for(let o=0;o<n.length;++o){const a=n[o].sets,c={},h={};for(let d=0;d<a.length;++d){c[a[d]]=!0;const b=i[a[d]];for(let x=0;x<b.length;++x)h[b[x]]=!0}const u=[],r=[];for(let d in t)d in c?u.push(t[d]):d in h||r.push(t[d]);const y=Lt(u,r,s);e[a]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return e}function Ie(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{m as r}from"./trellis-Csm7WAqm.js";import"./index-DKwABhnu.js";import"./select-BbwOgh1Q.js";import"./chunk-VVM5DH6Z-D2vG_ZPx.js";import"./transform-BwXaE9hv.js";import"./trellis-op-icon-CzIuo5X7.js";/*!-----------------------------------------------------------------------------
1
+ import{m as r}from"./trellis-CGL9IdAb.js";import"./index-Dxo83Gsl.js";import"./select-COPHquWP.js";import"./chunk-VVM5DH6Z-CUl6IXI5.js";import"./transform-BwXaE9hv.js";import"./trellis-op-icon-7bLDDzgi.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{s as ei,g as si,q as Lt,p as ni,a as ai,b as ri,_ as a,l as Et,I as oi,d as hi,y as li,G as xt,h as ci,E as It,F as ui,$ as gi,aF as xi,a7 as Tt}from"./mermaid.core-bhqKFRxj.js";import"./transform-BwXaE9hv.js";import{i as di}from"./init-Gi6I4Gst.js";import{o as fi}from"./ordinal-Cboi1Yqb.js";import{l as Dt}from"./linear-COY9pyF4.js";import"./index-DKwABhnu.js";import"./defaultLocale-DX6XiGOO.js";function pi(t,i,e){t=+t,i=+i,e=(n=arguments.length)<2?(i=t,t=0,1):n<3?1:+e;for(var s=-1,n=Math.max(0,Math.ceil((i-t)/e))|0,x=new Array(n);++s<n;)x[s]=t+s*e;return x}function ht(){var t=fi().unknown(void 0),i=t.domain,e=t.range,s=0,n=1,x,g,m=!1,S=0,D=0,v=.5;delete t.unknown;function w(){var y=i().length,E=n<s,T=E?n:s,P=E?s:n;x=(P-T)/Math.max(1,y-S+D*2),m&&(x=Math.floor(x)),T+=(P-T-x*(y-S))*v,g=x*(1-S),m&&(T=Math.round(T),g=Math.round(g));var I=pi(y).map(function(p){return T+x*p});return e(E?I.reverse():I)}return t.domain=function(y){return arguments.length?(i(y),w()):i()},t.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,w()):[s,n]},t.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,m=!0,w()},t.bandwidth=function(){return g},t.step=function(){return x},t.round=function(y){return arguments.length?(m=!!y,w()):m},t.padding=function(y){return arguments.length?(S=Math.min(1,D=+y),w()):S},t.paddingInner=function(y){return arguments.length?(S=Math.min(1,y),w()):S},t.paddingOuter=function(y){return arguments.length?(D=+y,w()):D},t.align=function(y){return arguments.length?(v=Math.max(0,Math.min(1,y)),w()):v},t.copy=function(){return ht(i(),[s,n]).round(m).paddingInner(S).paddingOuter(D).align(v)},di.apply(w(),arguments)}var lt=(function(){var t=a(function(F,o,c,u){for(c=c||{},u=F.length;u--;c[F[u]]=o);return c},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],x=[1,6],g=[1,7],m=[1,5,10,12,14,16,18,19,21,23,34,35,36],S=[1,25],D=[1,26],v=[1,28],w=[1,29],y=[1,30],E=[1,31],T=[1,32],P=[1,33],I=[1,34],p=[1,35],_=[1,36],l=[1,37],W=[1,43],z=[1,42],U=[1,47],X=[1,50],h=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],k=[1,64],$={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(o,c,u,d,A,r,j){var f=r.length-1;switch(A){case 5:d.setOrientation(r[f]);break;case 9:d.setDiagramTitle(r[f].text.trim());break;case 12:d.setLineData({text:"",type:"text"},r[f]);break;case 13:d.setLineData(r[f-1],r[f]);break;case 14:d.setBarData({text:"",type:"text"},r[f]);break;case 15:d.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),d.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:this.$=[Number(r[f-2]),...r[f]];break;case 21:this.$=[Number(r[f])];break;case 22:d.setXAxisTitle(r[f]);break;case 23:d.setXAxisTitle(r[f-1]);break;case 24:d.setXAxisTitle({type:"text",text:""});break;case 25:d.setXAxisBand(r[f]);break;case 26:d.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 27:this.$=r[f-1];break;case 28:this.$=[r[f-2],...r[f]];break;case 29:this.$=[r[f]];break;case 30:d.setYAxisTitle(r[f]);break;case 31:d.setYAxisTitle(r[f-1]);break;case 32:d.setYAxisTitle({type:"text",text:""});break;case 33:d.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 37:this.$={text:r[f],type:"text"};break;case 38:this.$={text:r[f],type:"text"};break;case 39:this.$={text:r[f],type:"markdown"};break;case 40:this.$=r[f];break;case 41:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:n,35:x,36:g}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:n,35:x,36:g}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:x,36:g}),{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]},t(m,[2,34]),t(m,[2,35]),t(m,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:n,35:x,36:g}),{1:[2,3]},t(m,[2,5]),t(i,[2,7],{4:22,34:n,35:x,36:g}),{11:23,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{11:39,13:38,24:W,27:z,29:40,30:41,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{11:45,15:44,27:U,33:46,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{11:49,17:48,24:X,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{11:52,17:51,24:X,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{20:[1,53]},{22:[1,54]},t(h,[2,18]),{1:[2,2]},t(h,[2,8]),t(h,[2,9]),t(L,[2,37],{40:55,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l}),t(L,[2,38]),t(L,[2,39]),t(C,[2,40]),t(C,[2,42]),t(C,[2,43]),t(C,[2,44]),t(C,[2,45]),t(C,[2,46]),t(C,[2,47]),t(C,[2,48]),t(C,[2,49]),t(C,[2,50]),t(C,[2,51]),t(h,[2,10]),t(h,[2,22],{30:41,29:56,24:W,27:z}),t(h,[2,24]),t(h,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},t(h,[2,11]),t(h,[2,30],{33:60,27:U}),t(h,[2,32]),{31:[1,61]},t(h,[2,12]),{17:62,24:X},{25:63,27:k},t(h,[2,14]),{17:65,24:X},t(h,[2,16]),t(h,[2,17]),t(C,[2,41]),t(h,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(h,[2,31]),{27:[1,69]},t(h,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(h,[2,15]),t(h,[2,26]),t(h,[2,27]),{11:59,32:72,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},t(h,[2,33]),t(h,[2,19]),{25:73,27:k},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(o,c){if(c.recoverable)this.trace(o);else{var u=new Error(o);throw u.hash=c,u}},"parseError"),parse:a(function(o){var c=this,u=[0],d=[],A=[null],r=[],j=this.table,f="",J=0,St=0,Zt=2,_t=1,Jt=r.slice.call(arguments,1),R=Object.create(this.lexer),Y={yy:{}};for(var nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,nt)&&(Y.yy[nt]=this.yy[nt]);R.setInput(o,Y.yy),Y.yy.lexer=R,Y.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var at=R.yylloc;r.push(at);var ti=R.options&&R.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ii(V){u.length=u.length-2*V,A.length=A.length-V,r.length=r.length-V}a(ii,"popStack");function kt(){var V;return V=d.pop()||R.lex()||_t,typeof V!="number"&&(V instanceof Array&&(d=V,V=d.pop()),V=c.symbols_[V]||V),V}a(kt,"lex");for(var M,H,B,rt,q={},tt,O,Rt,it;;){if(H=u[u.length-1],this.defaultActions[H]?B=this.defaultActions[H]:((M===null||typeof M>"u")&&(M=kt()),B=j[H]&&j[H][M]),typeof B>"u"||!B.length||!B[0]){var ot="";it=[];for(tt in j[H])this.terminals_[tt]&&tt>Zt&&it.push("'"+this.terminals_[tt]+"'");R.showPosition?ot="Parse error on line "+(J+1)+`:
1
+ import{s as ei,g as si,q as Lt,p as ni,a as ai,b as ri,_ as a,l as Et,I as oi,d as hi,y as li,G as xt,h as ci,E as It,F as ui,$ as gi,aF as xi,a7 as Tt}from"./mermaid.core-D7ns-Nfl.js";import"./transform-BwXaE9hv.js";import{i as di}from"./init-Gi6I4Gst.js";import{o as fi}from"./ordinal-Cboi1Yqb.js";import{l as Dt}from"./linear-COY9pyF4.js";import"./index-Dxo83Gsl.js";import"./defaultLocale-DX6XiGOO.js";function pi(t,i,e){t=+t,i=+i,e=(n=arguments.length)<2?(i=t,t=0,1):n<3?1:+e;for(var s=-1,n=Math.max(0,Math.ceil((i-t)/e))|0,x=new Array(n);++s<n;)x[s]=t+s*e;return x}function ht(){var t=fi().unknown(void 0),i=t.domain,e=t.range,s=0,n=1,x,g,m=!1,S=0,D=0,v=.5;delete t.unknown;function w(){var y=i().length,E=n<s,T=E?n:s,P=E?s:n;x=(P-T)/Math.max(1,y-S+D*2),m&&(x=Math.floor(x)),T+=(P-T-x*(y-S))*v,g=x*(1-S),m&&(T=Math.round(T),g=Math.round(g));var I=pi(y).map(function(p){return T+x*p});return e(E?I.reverse():I)}return t.domain=function(y){return arguments.length?(i(y),w()):i()},t.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,w()):[s,n]},t.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,m=!0,w()},t.bandwidth=function(){return g},t.step=function(){return x},t.round=function(y){return arguments.length?(m=!!y,w()):m},t.padding=function(y){return arguments.length?(S=Math.min(1,D=+y),w()):S},t.paddingInner=function(y){return arguments.length?(S=Math.min(1,y),w()):S},t.paddingOuter=function(y){return arguments.length?(D=+y,w()):D},t.align=function(y){return arguments.length?(v=Math.max(0,Math.min(1,y)),w()):v},t.copy=function(){return ht(i(),[s,n]).round(m).paddingInner(S).paddingOuter(D).align(v)},di.apply(w(),arguments)}var lt=(function(){var t=a(function(F,o,c,u){for(c=c||{},u=F.length;u--;c[F[u]]=o);return c},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],x=[1,6],g=[1,7],m=[1,5,10,12,14,16,18,19,21,23,34,35,36],S=[1,25],D=[1,26],v=[1,28],w=[1,29],y=[1,30],E=[1,31],T=[1,32],P=[1,33],I=[1,34],p=[1,35],_=[1,36],l=[1,37],W=[1,43],z=[1,42],U=[1,47],X=[1,50],h=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],C=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],k=[1,64],$={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(o,c,u,d,A,r,j){var f=r.length-1;switch(A){case 5:d.setOrientation(r[f]);break;case 9:d.setDiagramTitle(r[f].text.trim());break;case 12:d.setLineData({text:"",type:"text"},r[f]);break;case 13:d.setLineData(r[f-1],r[f]);break;case 14:d.setBarData({text:"",type:"text"},r[f]);break;case 15:d.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),d.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:this.$=[Number(r[f-2]),...r[f]];break;case 21:this.$=[Number(r[f])];break;case 22:d.setXAxisTitle(r[f]);break;case 23:d.setXAxisTitle(r[f-1]);break;case 24:d.setXAxisTitle({type:"text",text:""});break;case 25:d.setXAxisBand(r[f]);break;case 26:d.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 27:this.$=r[f-1];break;case 28:this.$=[r[f-2],...r[f]];break;case 29:this.$=[r[f]];break;case 30:d.setYAxisTitle(r[f]);break;case 31:d.setYAxisTitle(r[f-1]);break;case 32:d.setYAxisTitle({type:"text",text:""});break;case 33:d.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 37:this.$={text:r[f],type:"text"};break;case 38:this.$={text:r[f],type:"text"};break;case 39:this.$={text:r[f],type:"markdown"};break;case 40:this.$=r[f];break;case 41:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:n,35:x,36:g}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:n,35:x,36:g}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:x,36:g}),{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]},t(m,[2,34]),t(m,[2,35]),t(m,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:n,35:x,36:g}),{1:[2,3]},t(m,[2,5]),t(i,[2,7],{4:22,34:n,35:x,36:g}),{11:23,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{11:39,13:38,24:W,27:z,29:40,30:41,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{11:45,15:44,27:U,33:46,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{11:49,17:48,24:X,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{11:52,17:51,24:X,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},{20:[1,53]},{22:[1,54]},t(h,[2,18]),{1:[2,2]},t(h,[2,8]),t(h,[2,9]),t(L,[2,37],{40:55,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l}),t(L,[2,38]),t(L,[2,39]),t(C,[2,40]),t(C,[2,42]),t(C,[2,43]),t(C,[2,44]),t(C,[2,45]),t(C,[2,46]),t(C,[2,47]),t(C,[2,48]),t(C,[2,49]),t(C,[2,50]),t(C,[2,51]),t(h,[2,10]),t(h,[2,22],{30:41,29:56,24:W,27:z}),t(h,[2,24]),t(h,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},t(h,[2,11]),t(h,[2,30],{33:60,27:U}),t(h,[2,32]),{31:[1,61]},t(h,[2,12]),{17:62,24:X},{25:63,27:k},t(h,[2,14]),{17:65,24:X},t(h,[2,16]),t(h,[2,17]),t(C,[2,41]),t(h,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(h,[2,31]),{27:[1,69]},t(h,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(h,[2,15]),t(h,[2,26]),t(h,[2,27]),{11:59,32:72,37:24,38:S,39:D,40:27,41:v,42:w,43:y,44:E,45:T,46:P,47:I,48:p,49:_,50:l},t(h,[2,33]),t(h,[2,19]),{25:73,27:k},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(o,c){if(c.recoverable)this.trace(o);else{var u=new Error(o);throw u.hash=c,u}},"parseError"),parse:a(function(o){var c=this,u=[0],d=[],A=[null],r=[],j=this.table,f="",J=0,St=0,Zt=2,_t=1,Jt=r.slice.call(arguments,1),R=Object.create(this.lexer),Y={yy:{}};for(var nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,nt)&&(Y.yy[nt]=this.yy[nt]);R.setInput(o,Y.yy),Y.yy.lexer=R,Y.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var at=R.yylloc;r.push(at);var ti=R.options&&R.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ii(V){u.length=u.length-2*V,A.length=A.length-V,r.length=r.length-V}a(ii,"popStack");function kt(){var V;return V=d.pop()||R.lex()||_t,typeof V!="number"&&(V instanceof Array&&(d=V,V=d.pop()),V=c.symbols_[V]||V),V}a(kt,"lex");for(var M,H,B,rt,q={},tt,O,Rt,it;;){if(H=u[u.length-1],this.defaultActions[H]?B=this.defaultActions[H]:((M===null||typeof M>"u")&&(M=kt()),B=j[H]&&j[H][M]),typeof B>"u"||!B.length||!B[0]){var ot="";it=[];for(tt in j[H])this.terminals_[tt]&&tt>Zt&&it.push("'"+this.terminals_[tt]+"'");R.showPosition?ot="Parse error on line "+(J+1)+`:
2
2
  `+R.showPosition()+`
3
3
  Expecting `+it.join(", ")+", got '"+(this.terminals_[M]||M)+"'":ot="Parse error on line "+(J+1)+": Unexpected "+(M==_t?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(ot,{text:R.match,token:this.terminals_[M]||M,line:R.yylineno,loc:at,expected:it})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+M);switch(B[0]){case 1:u.push(M),A.push(R.yytext),r.push(R.yylloc),u.push(B[1]),M=null,St=R.yyleng,f=R.yytext,J=R.yylineno,at=R.yylloc;break;case 2:if(O=this.productions_[B[1]][1],q.$=A[A.length-O],q._$={first_line:r[r.length-(O||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(O||1)].first_column,last_column:r[r.length-1].last_column},ti&&(q._$.range=[r[r.length-(O||1)].range[0],r[r.length-1].range[1]]),rt=this.performAction.apply(q,[f,St,J,Y.yy,B[1],A,r].concat(Jt)),typeof rt<"u")return rt;O&&(u=u.slice(0,-1*O*2),A=A.slice(0,-1*O),r=r.slice(0,-1*O)),u.push(this.productions_[B[1]][0]),A.push(q.$),r.push(q._$),Rt=j[u[u.length-2]][u[u.length-1]],u.push(Rt);break;case 3:return!0}}return!0},"parse")},Ct=(function(){var F={EOF:1,parseError:a(function(c,u){if(this.yy.parser)this.yy.parser.parseError(c,u);else throw new Error(c)},"parseError"),setInput:a(function(o,c){return this.yy=c||this.yy||{},this._input=o,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:a(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var c=o.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:a(function(o){var c=o.length,u=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var d=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),u.length-1&&(this.yylineno-=u.length-1);var A=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:u?(u.length===d.length?this.yylloc.first_column:0)+d[d.length-u.length].length-u[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(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:a(function(o){this.unput(this.match.slice(o))},"less"),pastInput:a(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var o=this.pastInput(),c=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{m as i}from"./trellis-Csm7WAqm.js";import"./index-DKwABhnu.js";import"./select-BbwOgh1Q.js";import"./chunk-VVM5DH6Z-D2vG_ZPx.js";import"./transform-BwXaE9hv.js";import"./trellis-op-icon-CzIuo5X7.js";/*!-----------------------------------------------------------------------------
1
+ import{m as i}from"./trellis-CGL9IdAb.js";import"./index-Dxo83Gsl.js";import"./select-COPHquWP.js";import"./chunk-VVM5DH6Z-CUl6IXI5.js";import"./transform-BwXaE9hv.js";import"./trellis-op-icon-7bLDDzgi.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
package/assets/index.html CHANGED
@@ -44,8 +44,8 @@
44
44
  }
45
45
  })()
46
46
  </script>
47
- <script type="module" crossorigin src="/assets/index-DKwABhnu.js"></script>
48
- <link rel="stylesheet" crossorigin href="/assets/index-DTxAHLat.css">
47
+ <script type="module" crossorigin src="/assets/index-Dxo83Gsl.js"></script>
48
+ <link rel="stylesheet" crossorigin href="/assets/index-9-q5x_AZ.css">
49
49
  </head>
50
50
  <body class="antialiased overscroll-none text-12-regular overflow-hidden">
51
51
  <noscript>You need to enable JavaScript to run this app.</noscript>
package/bin/cli.mjs CHANGED
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { createServer, request as httpRequest } from "node:http"
4
- import { readFileSync, existsSync, statSync } from "node:fs"
4
+ import { readFileSync, existsSync, statSync, mkdirSync } from "node:fs"
5
5
  import { join, extname, dirname, resolve } from "node:path"
6
6
  import { fileURLToPath } from "node:url"
7
7
  import { exec, spawn } from "node:child_process"
8
+ import { homedir } from "node:os"
8
9
 
9
10
  const root = join(dirname(fileURLToPath(import.meta.url)), "..", "assets")
10
11
 
@@ -49,6 +50,27 @@ function encode(str) {
49
50
  return Buffer.from(str).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "")
50
51
  }
51
52
 
53
+ // Extract directory from base64-encoded path segment, returns { pathname, directory }
54
+ function extractDir(path) {
55
+ const match = path.match(/^\/([A-Za-z0-9_-]{10,})(\/.*)?$/)
56
+ if (!match) return { pathname: path }
57
+
58
+ const encoded = match[1]
59
+ const rest = match[2] || "/"
60
+
61
+ try {
62
+ const normalized = encoded.replace(/-/g, "+").replace(/_/g, "/")
63
+ const decoded = Buffer.from(normalized, "base64").toString("utf-8")
64
+
65
+ // Must be a valid absolute path with only printable ASCII
66
+ if (!decoded.startsWith("/") || /[^\x20-\x7e]/.test(decoded)) return { pathname: path }
67
+
68
+ return { pathname: rest, directory: decoded }
69
+ } catch {
70
+ return { pathname: path }
71
+ }
72
+ }
73
+
52
74
  function probe(origin) {
53
75
  return new Promise((ok) => {
54
76
  const req = httpRequest(origin, { method: "HEAD", timeout: 1000 }, (res) => {
@@ -130,6 +152,16 @@ if (!existsSync(join(root, "index.html"))) {
130
152
 
131
153
  const spawned = await boot(backend.origin)
132
154
 
155
+ // Ensure ~/.turtlecode exists for new project creation
156
+ const projectsDir = join(homedir(), ".turtlecode")
157
+ if (!existsSync(projectsDir)) {
158
+ try {
159
+ mkdirSync(projectsDir, { recursive: true })
160
+ } catch {
161
+ // Ignore errors (permissions, etc.) - backend will handle them
162
+ }
163
+ }
164
+
133
165
  // Determine whether a request should be proxied to the backend.
134
166
  // Static assets are served directly; browser navigation gets the SPA
135
167
  // index.html; everything else (API calls, SSE, etc.) is proxied.
@@ -150,9 +182,13 @@ function shouldProxy(req, file) {
150
182
 
151
183
  function proxy(req, res) {
152
184
  const url = new URL(req.url, `http://localhost:${port}`)
153
- const target = `${backend.origin}${url.pathname}${url.search}`
154
185
 
186
+ // Extract directory from base64 path segment; fall back to cwd for bare API calls
187
+ const { pathname, directory } = extractDir(url.pathname)
155
188
  const headers = { ...req.headers, host: backend.host }
189
+ headers["x-opencode-directory"] = directory || process.cwd()
190
+
191
+ const target = `${backend.origin}${pathname}${url.search}`
156
192
 
157
193
  const proxyReq = httpRequest(target, { method: req.method, headers }, (proxyRes) => {
158
194
  res.writeHead(proxyRes.statusCode, proxyRes.headers)
@@ -200,9 +236,13 @@ const server = createServer((req, res) => {
200
236
  // Handle WebSocket upgrade (used by PTY terminal connections)
201
237
  server.on("upgrade", (req, socket, head) => {
202
238
  const url = new URL(req.url, `http://localhost:${port}`)
203
- const target = `${backend.origin}${url.pathname}${url.search}`
239
+
240
+ // Extract directory from base64 path segment; fall back to cwd for bare API calls
241
+ const { pathname, directory } = extractDir(url.pathname)
204
242
  const headers = { ...req.headers, host: backend.host }
243
+ headers["x-opencode-directory"] = directory || process.cwd()
205
244
 
245
+ const target = `${backend.origin}${pathname}${url.search}`
206
246
  const proxyReq = httpRequest(target, { method: "GET", headers })
207
247
 
208
248
  proxyReq.on("upgrade", (proxyRes, proxySocket, proxyHead) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turtlecode",
3
- "version": "0.1.1",
3
+ "version": "0.1.5",
4
4
  "description": "AI-powered creative workspace — launch with npx turtlecode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,8 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "build": "bun script/build.ts",
15
- "prepublishOnly": "bun script/build.ts"
15
+ "prepublishOnly": "bun script/build.ts",
16
+ "test": "bun test"
16
17
  },
17
18
  "keywords": [
18
19
  "ai",
@@ -31,5 +32,8 @@
31
32
  },
32
33
  "engines": {
33
34
  "node": ">=18"
35
+ },
36
+ "devDependencies": {
37
+ "bun-types": "latest"
34
38
  }
35
39
  }
@@ -1 +0,0 @@
1
- import{U as a,C as n}from"./mermaid.core-bhqKFRxj.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-WL4C6EOR-913dgDB-.js";import{_ as i}from"./mermaid.core-bhqKFRxj.js";import"./transform-BwXaE9hv.js";import"./chunk-FMBD7UC4-BRuwu34q.js";import"./chunk-JSJVCQXG-Bt0GkrjS.js";import"./chunk-55IACEB6-Bsz0SHtO.js";import"./chunk-KX2RTZJC-BiUvn-D7.js";import"./index-DKwABhnu.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-WL4C6EOR-913dgDB-.js";import{_ as i}from"./mermaid.core-bhqKFRxj.js";import"./transform-BwXaE9hv.js";import"./chunk-FMBD7UC4-BRuwu34q.js";import"./chunk-JSJVCQXG-Bt0GkrjS.js";import"./chunk-55IACEB6-Bsz0SHtO.js";import"./chunk-KX2RTZJC-BiUvn-D7.js";import"./index-DKwABhnu.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
@@ -1 +0,0 @@
1
- import{b as r}from"./_baseUniq-D9AKNI-S.js";var e=4;function a(o){return r(o,e)}export{a as c};
@@ -1 +0,0 @@
1
- import{s as r,b as e,a,S as s}from"./chunk-NQ4KR5QH-DH4YUQE9.js";import{_ as i}from"./mermaid.core-bhqKFRxj.js";import"./transform-BwXaE9hv.js";import"./chunk-55IACEB6-Bsz0SHtO.js";import"./chunk-KX2RTZJC-BiUvn-D7.js";import"./index-DKwABhnu.js";var u={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{u as diagram};